Kaydet (Commit) c3140e23 authored tarafından Ivan Timofeev's avatar Ivan Timofeev

String->OUString

Change-Id: Ia58a7df837621886e617727d80fce135365a8055
üst aa6959ba
...@@ -140,13 +140,11 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet, ...@@ -140,13 +140,11 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
{ {
SfxStyleSheetBasePool* pStShPool = mrDoc.GetStyleSheetPool(); SfxStyleSheetBasePool* pStShPool = mrDoc.GetStyleSheetPool();
SdPage& rPage = *mpDrawViewShell->getCurrentPage(); SdPage& rPage = *mpDrawViewShell->getCurrentPage();
String aLayoutName = rPage.GetName();
SdrTextObj* pEditObject = static_cast< SdrTextObj* >( GetTextEditObject() ); SdrTextObj* pEditObject = static_cast< SdrTextObj* >( GetTextEditObject() );
if (pEditObject) if (pEditObject)
{ {
// Textedit // Textedit
String aTemplateName(aLayoutName);
sal_uInt32 nInv = pEditObject->GetObjInventor(); sal_uInt32 nInv = pEditObject->GetObjInventor();
...@@ -180,17 +178,13 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet, ...@@ -180,17 +178,13 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
OutlinerView* pOV = GetTextEditOutlinerView(); OutlinerView* pOV = GetTextEditOutlinerView();
::Outliner* pOutliner = pOV->GetOutliner(); ::Outliner* pOutliner = pOV->GetOutliner();
aTemplateName += String(SdResId(STR_LAYOUT_OUTLINE));
pOutliner->SetUpdateMode(sal_False); pOutliner->SetUpdateMode(sal_False);
mpDocSh->SetWaitCursor( sal_True ); mpDocSh->SetWaitCursor( sal_True );
// replace placeholder by template name // replace placeholder by template name
String aComment(SdResId(STR_UNDO_CHANGE_PRES_OBJECT)); OUString aComment(SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT));
xub_StrLen nPos = aComment.Search( (sal_Unicode)'$' ); aComment = aComment.replaceFirst("$", SD_RESSTR(STR_PSEUDOSHEET_OUTLINE));
aComment.Erase(nPos, 1); mpDocSh->GetUndoManager()->EnterListAction( aComment, OUString() );
aComment.Insert( String((SdResId(STR_PSEUDOSHEET_OUTLINE))), nPos);
mpDocSh->GetUndoManager()->EnterListAction( aComment, String() );
std::vector<Paragraph*> aSelList; std::vector<Paragraph*> aSelList;
pOV->CreateSelectionList(aSelList); pOV->CreateSelectionList(aSelList);
...@@ -202,9 +196,8 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet, ...@@ -202,9 +196,8 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
{ {
sal_Int32 nParaPos = pOutliner->GetAbsPos( pPara ); sal_Int32 nParaPos = pOutliner->GetAbsPos( pPara );
sal_Int16 nDepth = pOutliner->GetDepth( nParaPos ); sal_Int16 nDepth = pOutliner->GetDepth( nParaPos );
String aName(rPage.GetLayoutName()); OUString aName = rPage.GetLayoutName() + " " +
aName += (sal_Unicode)(' '); OUString::number((nDepth <= 0) ? 1 : nDepth + 1);
aName += OUString::number( (nDepth <= 0) ? 1 : nDepth + 1 );
SfxStyleSheet* pSheet = (SfxStyleSheet*)pStShPool->Find(aName, SD_STYLE_FAMILY_MASTERPAGE); SfxStyleSheet* pSheet = (SfxStyleSheet*)pStShPool->Find(aName, SD_STYLE_FAMILY_MASTERPAGE);
DBG_ASSERT(pSheet, "StyleSheet not found"); DBG_ASSERT(pSheet, "StyleSheet not found");
...@@ -229,9 +222,8 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet, ...@@ -229,9 +222,8 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
sal_Int16 nChild; sal_Int16 nChild;
for( nChild = nDepth + 1; nChild < 9; nChild++ ) for( nChild = nDepth + 1; nChild < 9; nChild++ )
{ {
String aSheetName(rPage.GetLayoutName()); OUString aSheetName = rPage.GetLayoutName() + " " +
aSheetName += (sal_Unicode)(' '); OUString::number((nChild <= 0) ? 1 : nChild + 1);
aSheetName += OUString::number( nChild <= 0 ? 1 : nChild + 1 );
SfxStyleSheet* pOutlSheet = static_cast< SfxStyleSheet* >(pStShPool->Find(aSheetName, SD_STYLE_FAMILY_MASTERPAGE)); SfxStyleSheet* pOutlSheet = static_cast< SfxStyleSheet* >(pStShPool->Find(aSheetName, SD_STYLE_FAMILY_MASTERPAGE));
if( pOutlSheet ) if( pOutlSheet )
...@@ -273,7 +265,6 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet, ...@@ -273,7 +265,6 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
{ {
sal_uInt16 eObjKind = pObject->GetObjIdentifier(); sal_uInt16 eObjKind = pObject->GetObjIdentifier();
PresObjKind ePresObjKind = rPage.GetPresObjKind(pObject); PresObjKind ePresObjKind = rPage.GetPresObjKind(pObject);
String aTemplateName(aLayoutName);
if (ePresObjKind == PRESOBJ_TITLE || if (ePresObjKind == PRESOBJ_TITLE ||
ePresObjKind == PRESOBJ_NOTES) ePresObjKind == PRESOBJ_NOTES)
...@@ -297,12 +288,10 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet, ...@@ -297,12 +288,10 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
else if (eObjKind == OBJ_OUTLINETEXT) else if (eObjKind == OBJ_OUTLINETEXT)
{ {
// Presentation object outline // Presentation object outline
aTemplateName += String(SdResId(STR_LAYOUT_OUTLINE));
for (sal_uInt16 nLevel = 9; nLevel > 0; nLevel--) for (sal_uInt16 nLevel = 9; nLevel > 0; nLevel--)
{ {
String aName(rPage.GetLayoutName()); OUString aName = rPage.GetLayoutName() + " " +
aName += (sal_Unicode)(' '); OUString::number(nLevel);
aName += OUString::number( (sal_Int32)nLevel );
SfxStyleSheet* pSheet = (SfxStyleSheet*)pStShPool-> SfxStyleSheet* pSheet = (SfxStyleSheet*)pStShPool->
Find(aName, SD_STYLE_FAMILY_MASTERPAGE); Find(aName, SD_STYLE_FAMILY_MASTERPAGE);
DBG_ASSERT(pSheet, "StyleSheet not found"); DBG_ASSERT(pSheet, "StyleSheet not found");
...@@ -435,7 +424,7 @@ sal_Bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemov ...@@ -435,7 +424,7 @@ sal_Bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemov
{ {
InfoBox(mpDrawViewShell->GetActiveWindow(), InfoBox(mpDrawViewShell->GetActiveWindow(),
String(SdResId(STR_ACTION_NOTPOSSIBLE))).Execute(); SD_RESSTR(STR_ACTION_NOTPOSSIBLE)).Execute();
bResult = sal_False; bResult = sal_False;
} }
else else
...@@ -545,9 +534,8 @@ void DrawView::DeleteMarked() ...@@ -545,9 +534,8 @@ void DrawView::DeleteMarked()
if( pUndoManager ) if( pUndoManager )
{ {
String aUndo( SVX_RES(STR_EditDelete) ); OUString aUndo(SVX_RESSTR(STR_EditDelete));
String aSearchString("%1"); aUndo = aUndo.replaceFirst("%1", GetDescriptionOfMarkedObjects());
aUndo.SearchAndReplace(aSearchString, GetDescriptionOfMarkedObjects());
pUndoManager->EnterListAction(aUndo, aUndo); pUndoManager->EnterListAction(aUndo, aUndo);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment