String->OUString

Change-Id: Ifda8c7453ecb40abdae8d63656b8742c80691b98
This commit is contained in:
Ivan Timofeev
2013-08-10 16:30:45 +04:00
parent f115934e0a
commit e1b8dfda24
9 changed files with 59 additions and 62 deletions

View File

@@ -30,8 +30,8 @@ TYPEINIT1(SdLayerModifyUndoAction, SdUndoAction);
SdLayerModifyUndoAction::SdLayerModifyUndoAction( SdLayerModifyUndoAction::SdLayerModifyUndoAction(
SdDrawDocument* _pDoc, SdrLayer* pLayer, SdDrawDocument* _pDoc, SdrLayer* pLayer,
const String& rOldLayerName, const String& rOldLayerTitle, const String& rOldLayerDesc, bool bOldIsVisible, bool bOldIsLocked, bool bOldIsPrintable, const OUString& rOldLayerName, const OUString& rOldLayerTitle, const OUString& rOldLayerDesc, bool bOldIsVisible, bool bOldIsLocked, bool bOldIsPrintable,
const String& rNewLayerName, const String& rNewLayerTitle, const String& rNewLayerDesc, bool bNewIsVisible, bool bNewIsLocked, bool bNewIsPrintable ) const OUString& rNewLayerName, const OUString& rNewLayerTitle, const OUString& rNewLayerDesc, bool bNewIsVisible, bool bNewIsLocked, bool bNewIsPrintable )
: SdUndoAction( _pDoc ), : SdUndoAction( _pDoc ),
mpLayer( pLayer ), mpLayer( pLayer ),
maOldLayerName( rOldLayerName ), maOldLayerName( rOldLayerName ),

View File

@@ -30,8 +30,8 @@ TYPEINIT1(SdPresentationLayoutUndoAction, SdUndoAction);
SdPresentationLayoutUndoAction::SdPresentationLayoutUndoAction( SdPresentationLayoutUndoAction::SdPresentationLayoutUndoAction(
SdDrawDocument* pTheDoc, SdDrawDocument* pTheDoc,
String aTheOldLayoutName, OUString aTheOldLayoutName,
String aTheNewLayoutName, OUString aTheNewLayoutName,
AutoLayout eTheOldAutoLayout, AutoLayout eTheOldAutoLayout,
AutoLayout eTheNewAutoLayout, AutoLayout eTheNewAutoLayout,
sal_Bool bSet, sal_Bool bSet,
@@ -46,7 +46,7 @@ SdPresentationLayoutUndoAction::SdPresentationLayoutUndoAction(
DBG_ASSERT(pThePage, "No Page set!"); DBG_ASSERT(pThePage, "No Page set!");
pPage = pThePage; pPage = pThePage;
aComment = String(SdResId(STR_UNDO_SET_PRESLAYOUT)); aComment = SD_RESSTR(STR_UNDO_SET_PRESLAYOUT);
} }
void SdPresentationLayoutUndoAction::Undo() void SdPresentationLayoutUndoAction::Undo()

View File

@@ -33,23 +33,23 @@ class SdLayerModifyUndoAction : public SdUndoAction
public: public:
TYPEINFO(); TYPEINFO();
SdLayerModifyUndoAction( SdDrawDocument* _pDoc, SdrLayer* pLayer, SdLayerModifyUndoAction( SdDrawDocument* _pDoc, SdrLayer* pLayer,
const String& rOldLayerName, const String& rOldLayerTitle, const String& rOldLayerDesc, bool bOldIsVisible, bool bOldIsLocked, bool bOldIsPrintable, const OUString& rOldLayerName, const OUString& rOldLayerTitle, const OUString& rOldLayerDesc, bool bOldIsVisible, bool bOldIsLocked, bool bOldIsPrintable,
const String& rNewLayerName, const String& rNewLayerTitle, const String& rNewLayerDesc, bool bNewIsVisible, bool bNewIsLocked, bool bNewIsPrintable ); const OUString& rNewLayerName, const OUString& rNewLayerTitle, const OUString& rNewLayerDesc, bool bNewIsVisible, bool bNewIsLocked, bool bNewIsPrintable );
virtual void Undo(); virtual void Undo();
virtual void Redo(); virtual void Redo();
private: private:
SdrLayer* mpLayer; SdrLayer* mpLayer;
String maOldLayerName; OUString maOldLayerName;
String maOldLayerTitle; OUString maOldLayerTitle;
String maOldLayerDesc; OUString maOldLayerDesc;
bool mbOldIsVisible; bool mbOldIsVisible;
bool mbOldIsLocked; bool mbOldIsLocked;
bool mbOldIsPrintable; bool mbOldIsPrintable;
String maNewLayerName; OUString maNewLayerName;
String maNewLayerTitle; OUString maNewLayerTitle;
String maNewLayerDesc; OUString maNewLayerDesc;
bool mbNewIsVisible; bool mbNewIsVisible;
bool mbNewIsLocked; bool mbNewIsLocked;
bool mbNewIsPrintable; bool mbNewIsPrintable;

View File

@@ -29,8 +29,8 @@ class SdPage;
class ModifyPageUndoAction : public SdUndoAction class ModifyPageUndoAction : public SdUndoAction
{ {
SdPage* mpPage; SdPage* mpPage;
String maOldName; OUString maOldName;
String maNewName; OUString maNewName;
AutoLayout meOldAutoLayout; AutoLayout meOldAutoLayout;
AutoLayout meNewAutoLayout; AutoLayout meNewAutoLayout;
sal_Bool mbOldBckgrndVisible; sal_Bool mbOldBckgrndVisible;
@@ -38,14 +38,14 @@ class ModifyPageUndoAction : public SdUndoAction
sal_Bool mbOldBckgrndObjsVisible; sal_Bool mbOldBckgrndObjsVisible;
sal_Bool mbNewBckgrndObjsVisible; sal_Bool mbNewBckgrndObjsVisible;
String maComment; OUString maComment;
public: public:
TYPEINFO(); TYPEINFO();
ModifyPageUndoAction( ModifyPageUndoAction(
SdDrawDocument* pTheDoc, SdDrawDocument* pTheDoc,
SdPage* pThePage, SdPage* pThePage,
String aTheNewName, OUString aTheNewName,
AutoLayout eTheNewAutoLayout, AutoLayout eTheNewAutoLayout,
sal_Bool bTheNewBckgrndVisible, sal_Bool bTheNewBckgrndVisible,
sal_Bool bTheNewBckgrndObjsVisible); sal_Bool bTheNewBckgrndObjsVisible);
@@ -57,12 +57,14 @@ public:
virtual OUString GetComment() const; virtual OUString GetComment() const;
}; };
// --------------------------------------------------------------------
class RenameLayoutTemplateUndoAction : public SdUndoAction class RenameLayoutTemplateUndoAction : public SdUndoAction
{ {
public: public:
RenameLayoutTemplateUndoAction( SdDrawDocument* pDocument, const String& rOldLayoutName, const String& rNewLayoutName ); RenameLayoutTemplateUndoAction(
SdDrawDocument* pDocument,
const OUString& rOldLayoutName,
const OUString& rNewLayoutName);
virtual void Undo(); virtual void Undo();
virtual void Redo(); virtual void Redo();
@@ -70,9 +72,9 @@ public:
virtual OUString GetComment() const; virtual OUString GetComment() const;
private: private:
String maOldName; OUString maOldName;
String maNewName; OUString maNewName;
const String maComment; const OUString maComment;
}; };
#endif // _SD_UNMODPG_HXX #endif // _SD_UNMODPG_HXX

View File

@@ -28,19 +28,19 @@ class SdPage;
class SdPresentationLayoutUndoAction : public SdUndoAction class SdPresentationLayoutUndoAction : public SdUndoAction
{ {
String aOldLayoutName; OUString aOldLayoutName;
String aNewLayoutName; OUString aNewLayoutName;
AutoLayout eOldAutoLayout; AutoLayout eOldAutoLayout;
AutoLayout eNewAutoLayout; AutoLayout eNewAutoLayout;
sal_Bool bSetAutoLayout; // sal_True: change AutoLayout sal_Bool bSetAutoLayout; // sal_True: change AutoLayout
SdPage* pPage; SdPage* pPage;
String aComment; OUString aComment;
public: public:
TYPEINFO(); TYPEINFO();
SdPresentationLayoutUndoAction(SdDrawDocument* pTheDoc, SdPresentationLayoutUndoAction(SdDrawDocument* pTheDoc,
String aTheOldLayoutName, OUString aTheOldLayoutName,
String aTheNewLayoutName, OUString aTheNewLayoutName,
AutoLayout eTheOldAutoLayout, AutoLayout eTheOldAutoLayout,
AutoLayout eTheNewAutoLayout, AutoLayout eTheNewAutoLayout,
sal_Bool bSet, sal_Bool bSet,

View File

@@ -43,7 +43,7 @@ TYPEINIT1(ModifyPageUndoAction, SdUndoAction);
ModifyPageUndoAction::ModifyPageUndoAction( ModifyPageUndoAction::ModifyPageUndoAction(
SdDrawDocument* pTheDoc, SdDrawDocument* pTheDoc,
SdPage* pThePage, SdPage* pThePage,
String aTheNewName, OUString aTheNewName,
AutoLayout eTheNewAutoLayout, AutoLayout eTheNewAutoLayout,
sal_Bool bTheNewBckgrndVisible, sal_Bool bTheNewBckgrndVisible,
sal_Bool bTheNewBckgrndObjsVisible) sal_Bool bTheNewBckgrndObjsVisible)
@@ -63,15 +63,15 @@ ModifyPageUndoAction::ModifyPageUndoAction(
{ {
maOldName = mpPage->GetName(); maOldName = mpPage->GetName();
SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False); sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND), sal_False);
sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False); sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ), sal_False);
SetOfByte aVisibleLayers = mpPage->TRG_GetMasterPageVisibleLayers(); SetOfByte aVisibleLayers = mpPage->TRG_GetMasterPageVisibleLayers();
mbOldBckgrndVisible = aVisibleLayers.IsSet(aBckgrnd); mbOldBckgrndVisible = aVisibleLayers.IsSet(aBckgrnd);
mbOldBckgrndObjsVisible = aVisibleLayers.IsSet(aBckgrndObj); mbOldBckgrndObjsVisible = aVisibleLayers.IsSet(aBckgrndObj);
} }
maComment = String(SdResId(STR_UNDO_MODIFY_PAGE)); maComment = SD_RESSTR(STR_UNDO_MODIFY_PAGE);
} }
#include <svx/svdviter.hxx> #include <svx/svdviter.hxx>
@@ -106,8 +106,8 @@ void ModifyPageUndoAction::Undo()
} }
SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False); sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND), sal_False);
sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False); sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ), sal_False);
SetOfByte aVisibleLayers; SetOfByte aVisibleLayers;
aVisibleLayers.Set(aBckgrnd, mbOldBckgrndVisible); aVisibleLayers.Set(aBckgrnd, mbOldBckgrndVisible);
aVisibleLayers.Set(aBckgrndObj, mbOldBckgrndObjsVisible); aVisibleLayers.Set(aBckgrndObj, mbOldBckgrndObjsVisible);
@@ -150,8 +150,8 @@ void ModifyPageUndoAction::Redo()
} }
SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False); sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND), sal_False);
sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False); sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ), sal_False);
SetOfByte aVisibleLayers; SetOfByte aVisibleLayers;
aVisibleLayers.Set(aBckgrnd, mbNewBckgrndVisible); aVisibleLayers.Set(aBckgrnd, mbNewBckgrndVisible);
aVisibleLayers.Set(aBckgrndObj, mbNewBckgrndObjsVisible); aVisibleLayers.Set(aBckgrndObj, mbNewBckgrndObjsVisible);
@@ -174,34 +174,30 @@ OUString ModifyPageUndoAction::GetComment() const
return maComment; return maComment;
} }
// --------------------------------------------------------------------
RenameLayoutTemplateUndoAction::RenameLayoutTemplateUndoAction( SdDrawDocument* pDocument, const String& rOldLayoutName, const String& rNewLayoutName ) RenameLayoutTemplateUndoAction::RenameLayoutTemplateUndoAction(
: SdUndoAction(pDocument) SdDrawDocument* pDocument,
, maOldName( rOldLayoutName ) const OUString& rOldLayoutName,
, maNewName( rNewLayoutName ) const OUString& rNewLayoutName)
, maComment(SdResId(STR_TITLE_RENAMESLIDE)) : SdUndoAction(pDocument)
, maOldName(rOldLayoutName)
, maNewName(rNewLayoutName)
, maComment(SD_RESSTR(STR_TITLE_RENAMESLIDE))
{ {
sal_uInt16 nPos = maOldName.SearchAscii( SD_LT_SEPARATOR ); sal_Int32 nPos = maOldName.indexOf(SD_LT_SEPARATOR);
if( nPos != (sal_uInt16)-1 ) if (nPos != -1)
maOldName.Erase(nPos); maOldName = maOldName.copy(0, nPos);
} }
void RenameLayoutTemplateUndoAction::Undo() void RenameLayoutTemplateUndoAction::Undo()
{ {
String aLayoutName( maNewName ); OUString aLayoutName(maNewName + SD_LT_SEPARATOR + SD_RESSTR(STR_LAYOUT_OUTLINE));
aLayoutName.AppendAscii( SD_LT_SEPARATOR );
aLayoutName.Append( String(SdResId(STR_LAYOUT_OUTLINE))) ;
mpDoc->RenameLayoutTemplate( aLayoutName, maOldName ); mpDoc->RenameLayoutTemplate( aLayoutName, maOldName );
} }
void RenameLayoutTemplateUndoAction::Redo() void RenameLayoutTemplateUndoAction::Redo()
{ {
String aLayoutName( maOldName ); OUString aLayoutName(maOldName + SD_LT_SEPARATOR + SD_RESSTR(STR_LAYOUT_OUTLINE));
aLayoutName.AppendAscii( SD_LT_SEPARATOR );
aLayoutName.Append( String(SdResId(STR_LAYOUT_OUTLINE))) ;
mpDoc->RenameLayoutTemplate( aLayoutName, maNewName ); mpDoc->RenameLayoutTemplate( aLayoutName, maNewName );
} }

View File

@@ -890,7 +890,7 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
if (aErrCode != 0 && !bAbort) if (aErrCode != 0 && !bAbort)
{ {
ErrorHandler::HandleError(* new StringErrorInfo(aErrCode, String() ) ); ErrorHandler::HandleError(* new StringErrorInfo(aErrCode, OUString() ) );
} }
return aErrCode == 0; return aErrCode == 0;

View File

@@ -143,7 +143,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet )
{ {
// Set the necessary string like in // Set the necessary string like in
// sfx2/source/view/viewfrm.cxx ver 1.23 ln 1072 ff. // sfx2/source/view/viewfrm.cxx ver 1.23 ln 1072 ff.
String aTmp( SvtResId( STR_UNDO ) ); OUString aTmp(SVT_RESSTR(STR_UNDO));
aTmp += pUndoManager->GetUndoActionComment(0); aTmp += pUndoManager->GetUndoActionComment(0);
rSet.Put(SfxStringItem(SID_UNDO, aTmp)); rSet.Put(SfxStringItem(SID_UNDO, aTmp));
} }
@@ -170,7 +170,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet )
{ {
// Set the necessary string like in // Set the necessary string like in
// sfx2/source/view/viewfrm.cxx ver 1.23 ln 1081 ff. // sfx2/source/view/viewfrm.cxx ver 1.23 ln 1081 ff.
String aTmp(SvtResId(STR_REDO)); OUString aTmp(SVT_RESSTR(STR_REDO));
aTmp += pUndoManager->GetRedoActionComment(0); aTmp += pUndoManager->GetRedoActionComment(0);
rSet.Put(SfxStringItem(SID_REDO, aTmp)); rSet.Put(SfxStringItem(SID_REDO, aTmp));
} }
@@ -198,8 +198,8 @@ SdPage* ViewShell::CreateOrDuplicatePage (
sal_uInt16 nSId = rRequest.GetSlot(); sal_uInt16 nSId = rRequest.GetSlot();
SdDrawDocument* pDocument = GetDoc(); SdDrawDocument* pDocument = GetDoc();
SdrLayerAdmin& rLayerAdmin = pDocument->GetLayerAdmin(); SdrLayerAdmin& rLayerAdmin = pDocument->GetLayerAdmin();
sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False); sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND), sal_False);
sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False); sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ), sal_False);
SetOfByte aVisibleLayers; SetOfByte aVisibleLayers;
// Determine the page from which to copy some values, such as layers, // Determine the page from which to copy some values, such as layers,
// size, master page, to the new page. This is usually the given page. // size, master page, to the new page. This is usually the given page.
@@ -212,8 +212,8 @@ SdPage* ViewShell::CreateOrDuplicatePage (
else else
aVisibleLayers.SetAll(); aVisibleLayers.SetAll();
String aStandardPageName; OUString aStandardPageName;
String aNotesPageName; OUString aNotesPageName;
AutoLayout eStandardLayout (AUTOLAYOUT_NONE); AutoLayout eStandardLayout (AUTOLAYOUT_NONE);
AutoLayout eNotesLayout (AUTOLAYOUT_NOTES); AutoLayout eNotesLayout (AUTOLAYOUT_NOTES);
sal_Bool bIsPageBack = aVisibleLayers.IsSet(aBckgrnd); sal_Bool bIsPageBack = aVisibleLayers.IsSet(aBckgrnd);
@@ -310,7 +310,7 @@ SdPage* ViewShell::CreateOrDuplicatePage (
View* pDrView = GetView(); View* pDrView = GetView();
const bool bUndo = pDrView && pDrView->IsUndoEnabled(); const bool bUndo = pDrView && pDrView->IsUndoEnabled();
if( bUndo ) if( bUndo )
pDrView->BegUndo( String( SdResId(STR_INSERTPAGE) ) ); pDrView->BegUndo(SD_RESSTR(STR_INSERTPAGE));
sal_uInt16 nNewPageIndex = 0xffff; sal_uInt16 nNewPageIndex = 0xffff;
switch (nSId) switch (nSId)

View File

@@ -787,8 +787,7 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16&
if(bOutliner) if(bOutliner)
{ {
SfxStyleSheetBasePool* pSSPool = mpView->GetDocSh()->GetStyleSheetPool(); SfxStyleSheetBasePool* pSSPool = mpView->GetDocSh()->GetStyleSheetPool();
String aStyleName((SdResId(STR_LAYOUT_OUTLINE))); OUString aStyleName(SD_RESSTR(STR_LAYOUT_OUTLINE) + " 1");
aStyleName.AppendAscii( " 1" );
SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( aStyleName, SD_STYLE_FAMILY_PSEUDO); SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( aStyleName, SD_STYLE_FAMILY_PSEUDO);
if( pFirstStyleSheet ) if( pFirstStyleSheet )
pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, sal_False, (const SfxPoolItem**)&pItem); pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, sal_False, (const SfxPoolItem**)&pItem);