[Libreoffice-commits] core.git: chart2/source cui/source include/svx sc/source sd/source sw/source

Ivan Timofeev timofeev.i.s at gmail.com
Thu Aug 15 05:57:47 PDT 2013


 chart2/source/controller/main/ShapeController.cxx      |   12 +--
 cui/source/customize/cfg.cxx                           |   10 +-
 cui/source/dialogs/hangulhanjadlg.cxx                  |    4 -
 cui/source/factory/dlgfact.cxx                         |    8 +-
 cui/source/factory/dlgfact.hxx                         |    8 +-
 cui/source/inc/dlgname.hxx                             |    8 +-
 cui/source/inc/hangulhanjadlg.hxx                      |    2 
 cui/source/options/optcolor.cxx                        |    6 -
 cui/source/tabpages/tpbitmap.cxx                       |   10 +-
 cui/source/tabpages/tpcolor.cxx                        |    4 -
 cui/source/tabpages/tpgradnt.cxx                       |    8 +-
 cui/source/tabpages/tphatch.cxx                        |    8 +-
 cui/source/tabpages/tplnedef.cxx                       |    8 +-
 cui/source/tabpages/tplneend.cxx                       |    6 -
 include/svx/svxdlg.hxx                                 |    8 +-
 sc/source/ui/drawfunc/drawsh5.cxx                      |   12 +--
 sd/source/ui/docshell/docshel2.cxx                     |   60 ++++++++---------
 sd/source/ui/func/fulinend.cxx                         |    6 -
 sd/source/ui/inc/DrawDocShell.hxx                      |    4 -
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |    8 +-
 sd/source/ui/view/drviews2.cxx                         |   10 +-
 sd/source/ui/view/drviewsb.cxx                         |    4 -
 sd/source/ui/view/drviewsc.cxx                         |    4 -
 sd/source/ui/view/sdview2.cxx                          |    2 
 sd/source/ui/view/tabcontr.cxx                         |    2 
 sw/source/ui/shells/drwbassh.cxx                       |   10 +-
 sw/source/ui/shells/frmsh.cxx                          |    4 -
 27 files changed, 115 insertions(+), 121 deletions(-)

New commits:
commit 1edb495a45fde1d788b409fd1a9a839bd370c426
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Thu Aug 15 16:56:09 2013 +0400

    convert GetName/Title/Description methods to OUString
    
    Change-Id: Id16a2b29b1d6cf02b94cc6c423e2475a9cbeb8a3

diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 9991774..24c32c1 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -231,12 +231,12 @@ void ShapeController::describeSupportedFeatures()
 
 IMPL_LINK( ShapeController, CheckNameHdl, AbstractSvxNameDialog*, pDialog )
 {
-    String aName;
+    OUString aName;
     if ( pDialog )
     {
         pDialog->GetName( aName );
     }
-    if ( aName.Len() )
+    if ( !aName.isEmpty() )
     {
         DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
         if ( pDrawViewWrapper && pDrawViewWrapper->getNamedSdrObject( aName ) )
@@ -436,8 +436,8 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
             SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
             if ( pSelectedObj )
             {
-                String aTitle( pSelectedObj->GetTitle() );
-                String aDescription( pSelectedObj->GetDescription() );
+                OUString aTitle( pSelectedObj->GetTitle() );
+                OUString aDescription( pSelectedObj->GetDescription() );
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 if ( pFact )
                 {
@@ -476,9 +476,7 @@ void ShapeController::executeDispatch_RenameObject()
                     pDlg->SetCheckNameHdl( LINK( this, ShapeController, CheckNameHdl ) );
                     if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
                     {
-                        String aTmp;
-                        pDlg->GetName(aTmp);
-                        aName = aTmp;
+                        pDlg->GetName(aName);
                         if (pSelectedObj->GetName().equals(aName))
                         {
                             pSelectedObj->SetName( aName );
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 8cf9483..7e1d9a3 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2535,7 +2535,7 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton )
         {
             SvxConfigEntry* pMenuData = GetTopLevelSelection();
 
-            String aNewName( stripHotKey( pMenuData->GetName() ) );
+            OUString aNewName( stripHotKey( pMenuData->GetName() ) );
             String aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
 
             SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
@@ -2593,7 +2593,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
     {
         case ID_ADD_SUBMENU:
         {
-            String aNewName;
+            OUString aNewName;
             String aDesc = CUI_RESSTR( RID_SVXSTR_SUBMENU_NAME );
 
             SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
@@ -2639,7 +2639,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
             SvxConfigEntry* pEntry =
                 (SvxConfigEntry*) pActEntry->GetUserData();
 
-            String aNewName( stripHotKey( pEntry->GetName() ) );
+            OUString aNewName( stripHotKey( pEntry->GetName() ) );
             String aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
 
             SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
@@ -3272,7 +3272,7 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
         }
         case ID_RENAME:
         {
-            String aNewName( stripHotKey( pToolbar->GetName() ) );
+            OUString aNewName( stripHotKey( pToolbar->GetName() ) );
             String aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
 
             SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
@@ -3363,7 +3363,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
             SvxConfigEntry* pEntry =
                 (SvxConfigEntry*) pActEntry->GetUserData();
 
-            String aNewName( stripHotKey( pEntry->GetName() ) );
+            OUString aNewName( stripHotKey( pEntry->GetName() ) );
             String aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
 
             SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 5f46b8e..28bcd89 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -1027,7 +1027,7 @@ namespace svx
 
     IMPL_LINK_NOARG(HangulHanjaOptionsDialog, NewDictHdl)
     {
-        String                      aName;
+        OUString                    aName;
         HangulHanjaNewDictDialog    aNewDlg( this );
         aNewDlg.Execute();
         if( aNewDlg.GetName( aName ) )
@@ -1223,7 +1223,7 @@ namespace svx
     {
     }
 
-    bool HangulHanjaNewDictDialog::GetName( String& _rRetName ) const
+    bool HangulHanjaNewDictDialog::GetName( OUString& _rRetName ) const
     {
         if( m_bEntered )
             _rRetName = comphelper::string::stripEnd(m_aDictNameED.GetText(), ' ');
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 5b2928a..e3436c4 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -716,7 +716,7 @@ long AbstractFmInputRecordNoDialog_Impl::GetValue() const
     return pDlg->GetNewDictionary();
 }
 
-void AbstractSvxNameDialog_Impl::GetName( String& rName )
+void AbstractSvxNameDialog_Impl::GetName(OUString& rName)
 {
     pDlg->GetName( rName );
 }
@@ -748,7 +748,7 @@ IMPL_LINK_NOARG(AbstractSvxNameDialog_Impl, CheckNameHdl)
     return 0;
 }
 
-void AbstractSvxObjectNameDialog_Impl::GetName(String& rName)
+void AbstractSvxObjectNameDialog_Impl::GetName(OUString& rName)
 {
     pDlg->GetName(rName);
 }
@@ -777,12 +777,12 @@ IMPL_LINK_NOARG(AbstractSvxObjectNameDialog_Impl, CheckNameHdl)
     return 0;
 }
 
-void AbstractSvxObjectTitleDescDialog_Impl::GetTitle(String& rTitle)
+void AbstractSvxObjectTitleDescDialog_Impl::GetTitle(OUString& rTitle)
 {
     pDlg->GetTitle(rTitle);
 }
 
-void AbstractSvxObjectTitleDescDialog_Impl::GetDescription(String& rDescription)
+void AbstractSvxObjectTitleDescDialog_Impl::GetDescription(OUString& rDescription)
 {
     pDlg->GetDescription(rDescription);
 }
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index a4b39d9..9b38df3 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -386,7 +386,7 @@ class SvxNameDialog;
 class AbstractSvxNameDialog_Impl :public AbstractSvxNameDialog
 {
     DECL_ABSTDLG_BASE(AbstractSvxNameDialog_Impl,SvxNameDialog)
-    virtual void    GetName( String& rName ) ;
+    virtual void    GetName( OUString& rName ) ;
     virtual void    SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false ) ;
     virtual void    SetEditHelpId(const OString&) ;
     //from class Window
@@ -408,7 +408,7 @@ class SvxObjectTitleDescDialog;
 class AbstractSvxObjectNameDialog_Impl :public AbstractSvxObjectNameDialog
 {
     DECL_ABSTDLG_BASE(AbstractSvxObjectNameDialog_Impl, SvxObjectNameDialog)
-    virtual void GetName(String& rName) ;
+    virtual void GetName(OUString& rName) ;
     virtual void SetCheckNameHdl(const Link& rLink, bool bCheckImmediately = false);
 
 private:
@@ -419,8 +419,8 @@ private:
 class AbstractSvxObjectTitleDescDialog_Impl :public AbstractSvxObjectTitleDescDialog
 {
     DECL_ABSTDLG_BASE(AbstractSvxObjectTitleDescDialog_Impl, SvxObjectTitleDescDialog)
-    virtual void GetTitle(String& rName);
-    virtual void GetDescription(String& rName);
+    virtual void GetTitle(OUString& rName);
+    virtual void GetDescription(OUString& rName);
 };
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/cui/source/inc/dlgname.hxx b/cui/source/inc/dlgname.hxx
index ffe670d..2123370 100644
--- a/cui/source/inc/dlgname.hxx
+++ b/cui/source/inc/dlgname.hxx
@@ -41,7 +41,7 @@ private:
 public:
     SvxNameDialog( Window* pWindow, const String& rName, const String& rDesc );
 
-    void    GetName( String& rName ){rName = pEdtName->GetText();}
+    void    GetName( OUString& rName ){rName = pEdtName->GetText();}
 
     /** add a callback Link that is called whenever the content of the edit
         field is changed.  The Link result determines whether the OK
@@ -90,7 +90,7 @@ public:
     SvxObjectNameDialog(Window* pWindow, const String& rName);
 
     // data access
-    void GetName(String& rName) {rName = pEdtName->GetText(); }
+    void GetName(OUString& rName) {rName = pEdtName->GetText(); }
 
     // set handler
     void SetCheckNameHdl(const Link& rLink, bool bCheckImmediately = false)
@@ -120,8 +120,8 @@ public:
     SvxObjectTitleDescDialog(Window* pWindow, const String& rTitle, const String& rDesc);
 
     // data access
-    void GetTitle(String& rTitle) {rTitle = pEdtTitle->GetText(); }
-    void GetDescription(String& rDescription) {rDescription = pEdtDescription->GetText(); }
+    void GetTitle(OUString& rTitle) {rTitle = pEdtTitle->GetText(); }
+    void GetDescription(OUString& rDescription) {rDescription = pEdtDescription->GetText(); }
 };
 
 /// Dialog to cancel, save, or add
diff --git a/cui/source/inc/hangulhanjadlg.hxx b/cui/source/inc/hangulhanjadlg.hxx
index e469f22..e7c3913 100644
--- a/cui/source/inc/hangulhanjadlg.hxx
+++ b/cui/source/inc/hangulhanjadlg.hxx
@@ -254,7 +254,7 @@ namespace svx
                             HangulHanjaNewDictDialog( Window* _pParent );
         virtual             ~HangulHanjaNewDictDialog();
 
-        bool                GetName( String& _rRetName ) const;
+        bool                GetName( OUString& _rRetName ) const;
     };
 
 
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index e359353..3866eb3 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -1150,7 +1150,7 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
 {
     if (m_pSaveSchemePB == pButton)
     {
-        String sName;
+        OUString sName;
 
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         DBG_ASSERT(pFact, "Dialogdiet fail!");
@@ -1194,9 +1194,9 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
 
 IMPL_LINK(SvxColorOptionsTabPage, CheckNameHdl_Impl, AbstractSvxNameDialog*, pDialog )
 {
-    String sName;
+    OUString sName;
     pDialog->GetName(sName);
-    return sName.Len() && LISTBOX_ENTRY_NOTFOUND == m_pColorSchemeLB->GetEntryPos( sName );
+    return !sName.isEmpty() && LISTBOX_ENTRY_NOTFOUND == m_pColorSchemeLB->GetEntryPos( sName );
 }
 
 void SvxColorOptionsTabPage::FillUserData()
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 4c3f968..0e5b505 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -458,7 +458,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickAddHdl_Impl)
 
     String aNewName( SVX_RES( RID_SVXSTR_BITMAP ) );
     String aDesc( CUI_RES( RID_SVXSTR_DESC_NEW_BITMAP ) );
-    String aName;
+    OUString aName;
 
     long nCount = pBitmapList->Count();
     long j = 1;
@@ -467,7 +467,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickAddHdl_Impl)
     while( !bDifferent )
     {
         aName  = aNewName;
-        aName += sal_Unicode(' ');
+        aName += " ";
         aName += OUString::number( j++ );
         bDifferent = sal_True;
 
@@ -583,7 +583,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl_Impl)
             MessageDialog*    pWarnBox = NULL;
 
             // convert file URL to UI name
-            String          aName;
+            OUString        aName;
             INetURLObject   aURL( aDlg.GetPath() );
             SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
             DBG_ASSERT(pFact, "Dialogdiet fail!");
@@ -655,8 +655,8 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickModifyHdl_Impl)
     {
         ResMgr& rMgr = CUI_MGR();
         String aDesc( ResId( RID_SVXSTR_DESC_NEW_BITMAP, rMgr ) );
-        String aName( pBitmapList->GetBitmap( nPos )->GetName() );
-        String aOldName = aName;
+        OUString aName( pBitmapList->GetBitmap( nPos )->GetName() );
+        OUString aOldName = aName;
 
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         DBG_ASSERT(pFact, "Dialogdiet fail!");
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 070e52a..4a649f9 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -673,7 +673,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
 
     ResMgr& rMgr = CUI_MGR();
     String aDesc( ResId( RID_SVXSTR_DESC_COLOR, rMgr ) );
-    String aName( m_pEdtName->GetText() );
+    OUString aName( m_pEdtName->GetText() );
     XColorEntry* pEntry;
     long nCount = pColorList->Count();
     sal_Bool bDifferent = sal_True;
@@ -748,7 +748,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
     {
         ResMgr& rMgr = CUI_MGR();
         String aDesc( ResId( RID_SVXSTR_DESC_COLOR, rMgr ) );
-        String aName( m_pEdtName->GetText() );
+        OUString aName( m_pEdtName->GetText() );
         long nCount = pColorList->Count();
         sal_Bool bDifferent = sal_True;
 
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index b7b5794..0515111 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -408,7 +408,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
 {
     String aNewName( SVX_RES( RID_SVXSTR_GRADIENT ) );
     String aDesc( CUI_RES( RID_SVXSTR_DESC_GRADIENT ) );
-    String aName;
+    OUString aName;
 
     long nCount = pGradientList->Count();
     long j = 1;
@@ -417,7 +417,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
     while( !bDifferent )
     {
         aName  = aNewName;
-        aName += sal_Unicode(' ');
+        aName += " ";
         aName += OUString::number( j++ );
         bDifferent = sal_True;
 
@@ -514,8 +514,8 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl)
     if ( nPos != LISTBOX_ENTRY_NOTFOUND )
     {
         String aDesc( CUI_RES( RID_SVXSTR_DESC_GRADIENT ) );
-        String aName( pGradientList->GetGradient( nPos )->GetName() );
-        String aOldName = aName;
+        OUString aName( pGradientList->GetGradient( nPos )->GetName() );
+        OUString aOldName = aName;
 
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         DBG_ASSERT(pFact, "Dialogdiet fail!");
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 97b6fc7..9fea458a 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -457,7 +457,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
 {
     String aNewName( SVX_RES( RID_SVXSTR_HATCH ) );
     String aDesc( CUI_RES( RID_SVXSTR_DESC_HATCH ) );
-    String aName;
+    OUString aName;
 
     long nCount = pHatchingList->Count();
     long j = 1;
@@ -466,7 +466,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
     while( !bDifferent )
     {
         aName  = aNewName;
-        aName += sal_Unicode(' ');
+        aName += " ";
         aName += OUString::number( j++ );
         bDifferent = sal_True;
 
@@ -557,8 +557,8 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl)
     if ( nPos != LISTBOX_ENTRY_NOTFOUND )
     {
         String aDesc( CUI_RES( RID_SVXSTR_DESC_HATCH ) );
-        String aName( pHatchingList->GetHatch( nPos )->GetName() );
-        String aOldName = aName;
+        OUString aName( pHatchingList->GetHatch( nPos )->GetName() );
+        OUString aOldName = aName;
 
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         DBG_ASSERT(pFact, "Dialogdiet fail!");
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index fb5cb61..ef60c66 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -524,7 +524,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl)
     ResMgr& rMgr = CUI_MGR();
     String aNewName( SVX_RES( RID_SVXSTR_LINESTYLE ) );
     String aDesc( ResId( RID_SVXSTR_DESC_LINESTYLE, rMgr ) );
-    String aName;
+    OUString aName;
     XDashEntry* pEntry;
 
     long nCount = pDashList->Count();
@@ -534,7 +534,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl)
     while ( !bDifferent )
     {
         aName = aNewName;
-        aName += sal_Unicode(' ');
+        aName += " ";
         aName += OUString::number( j++ );
         bDifferent = sal_True;
 
@@ -618,8 +618,8 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl)
     {
         ResMgr& rMgr = CUI_MGR();
         String aDesc( ResId( RID_SVXSTR_DESC_LINESTYLE, rMgr ) );
-        String aName( pDashList->GetDash( nPos )->GetName() );
-        String aOldName = aName;
+        OUString aName( pDashList->GetDash( nPos )->GetName() );
+        OUString aOldName = aName;
 
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         DBG_ASSERT(pFact, "Dialogdiet fail!");
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index b571eeb..e5c8706 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -313,7 +313,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl)
     {
         ResMgr& rMgr = CUI_MGR();
         OUString aDesc( ResId( RID_SVXSTR_DESC_LINEEND, rMgr ) );
-        String aName( m_pEdtName->GetText() );
+        OUString aName( m_pEdtName->GetText() );
         long nCount = pLineEndList->Count();
         sal_Bool bDifferent = sal_True;
 
@@ -417,7 +417,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl)
         ResMgr& rMgr = CUI_MGR();
         OUString aNewName( SVX_RES( RID_SVXSTR_LINEEND ) );
         OUString aDesc( ResId( RID_SVXSTR_DESC_LINEEND, rMgr ) );
-        String aName;
+        OUString aName;
 
         long nCount = pLineEndList->Count();
         long j = 1;
@@ -426,7 +426,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl)
         while ( !bDifferent )
         {
             aName = aNewName;
-            aName += sal_Unicode(' ');
+            aName += " ";
             aName += OUString::number( j++ );
             bDifferent = sal_True;
 
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index a1b8f2d..83639e0 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -183,7 +183,7 @@ public:
 class AbstractSvxNameDialog :public VclAbstractDialog  //add for SvxNameDialog
 {
 public:
-    virtual void    GetName( String& rName ) = 0;
+    virtual void    GetName( OUString& rName ) = 0;
     virtual void    SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false ) = 0;
     virtual void    SetEditHelpId(const OString&) = 0;
     //from class Window
@@ -197,15 +197,15 @@ public:
 class AbstractSvxObjectNameDialog :public VclAbstractDialog
 {
 public:
-    virtual void GetName(String& rName) = 0;
+    virtual void GetName(OUString& rName) = 0;
     virtual void SetCheckNameHdl(const Link& rLink, bool bCheckImmediately = false) = 0;
 };
 
 class AbstractSvxObjectTitleDescDialog :public VclAbstractDialog
 {
 public:
-    virtual void GetTitle(String& rTitle) = 0;
-    virtual void GetDescription(String& rDescription) = 0;
+    virtual void GetTitle(OUString& rTitle) = 0;
+    virtual void GetDescription(OUString& rDescription) = 0;
 };
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 6af9454..02965d5 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -502,9 +502,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
                         if(RET_OK == pDlg->Execute())
                         {
                             ScDocShell* pDocSh = pViewData->GetDocShell();
-                            String aTmp;
-                            pDlg->GetName(aTmp);
-                            aName = aTmp;
+                            pDlg->GetName(aName);
 
                             if (!aName.equals(pSelected->GetName()))
                             {
@@ -562,8 +560,8 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
 
                     if(SC_LAYER_INTERN != pSelected->GetLayer())
                     {
-                        String aTitle(pSelected->GetTitle());
-                        String aDescription(pSelected->GetDescription());
+                        OUString aTitle(pSelected->GetTitle());
+                        OUString aDescription(pSelected->GetDescription());
 
                         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                         OSL_ENSURE(pFact, "Dialogdiet fail!");
@@ -632,13 +630,13 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
 
 IMPL_LINK( ScDrawShell, NameObjectHdl, AbstractSvxNameDialog*, pDialog )
 {
-    String aName;
+    OUString aName;
 
     if( pDialog )
         pDialog->GetName( aName );
 
     ScDrawLayer* pModel = pViewData->GetDocument()->GetDrawLayer();
-    if ( aName.Len() && pModel )
+    if ( !aName.isEmpty() && pModel )
     {
         SCTAB nDummyTab;
         if ( pModel->GetNamedObject( aName, 0, nDummyTab ) )
diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx
index 43e0b74..9306d8f 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -284,7 +284,7 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe
  * name.
  * @return sal_False if the user cancels the action.
  */
-sal_Bool DrawDocShell::CheckPageName (::Window* pWin, String& rName )
+sal_Bool DrawDocShell::CheckPageName (::Window* pWin, OUString& rName )
 {
     const String aStrForDlg( rName );
     bool bIsNameValid = IsNewPageNameValid( rName, true );
@@ -317,49 +317,47 @@ sal_Bool DrawDocShell::CheckPageName (::Window* pWin, String& rName )
     return ( bIsNameValid ? sal_True : sal_False );
 }
 
-bool DrawDocShell::IsNewPageNameValid( String & rInOutPageName, bool bResetStringIfStandardName /* = false */ )
+bool DrawDocShell::IsNewPageNameValid( OUString & rInOutPageName, bool bResetStringIfStandardName /* = false */ )
 {
     bool bCanUseNewName = false;
 
     // check if name is something like 'Slide n'
-    String aStrPage( SdResId( STR_SD_PAGE ) );
-    aStrPage += ' ';
+    OUString aStrPage(SD_RESSTR(STR_SD_PAGE) + " ");
 
     bool bIsStandardName = false;
 
     // prevent also _future_ slide names of the form "'STR_SD_PAGE' + ' ' + '[0-9]+|[a-z]|[A-Z]|[CDILMVX]+|[cdilmvx]+'"
     // (arabic, lower- and upper case single letter, lower- and upper case roman numbers)
-    if( 0 == rInOutPageName.Search( aStrPage ) )
+    if (rInOutPageName.startsWith(aStrPage) &&
+        rInOutPageName.getLength() > aStrPage.getLength())
     {
-        if( rInOutPageName.GetToken( 1, sal_Unicode(' ') ).GetChar(0) >= '0' &&
-            rInOutPageName.GetToken( 1, sal_Unicode(' ') ).GetChar(0) <= '9' )
+        OUString sRemainder = rInOutPageName.getToken(1, ' ');
+        if (sRemainder[0] >= '0' && sRemainder[0] <= '9')
         {
             // check for arabic numbering
 
-            // gobble up all following numbers
-            String sRemainder = rInOutPageName.GetToken( 1, sal_Unicode(' ') );
-            while( sRemainder.Len() &&
-                   sRemainder.GetChar(0) >= '0' &&
-                   sRemainder.GetChar(0) <= '9' )
+            sal_Int32 nIndex = 1;
+            // skip all following numbers
+            while (nIndex < sRemainder.getLength() &&
+                   sRemainder[nIndex] >= '0' && sRemainder[nIndex] <= '9')
             {
-                // trim by one
-                sRemainder.Erase(0, 1);
+                nIndex++;
             }
 
             // EOL? Reserved name!
-            if( !sRemainder.Len() )
+            if (nIndex >= sRemainder.getLength())
             {
                 bIsStandardName = true;
             }
         }
-        else if( rInOutPageName.GetToken( 1, sal_Unicode(' ') ).Len() == 1 &&
-                 comphelper::string::islowerAscii(rInOutPageName.GetToken( 1, sal_Unicode(' ') ).GetChar(0) ) )
+        else if (sRemainder.getLength() == 1 &&
+                 comphelper::string::islowerAscii(sRemainder[0]))
         {
             // lower case, single character: reserved
             bIsStandardName = true;
         }
-        else if( rInOutPageName.GetToken( 1, sal_Unicode(' ') ).Len() == 1 &&
-                 comphelper::string::isupperAscii(rInOutPageName.GetToken( 1, sal_Unicode(' ') ).GetChar(0) ) )
+        else if (sRemainder.getLength() == 1 &&
+                 comphelper::string::isupperAscii(sRemainder[0]))
         {
             // upper case, single character: reserved
             bIsStandardName = true;
@@ -367,21 +365,21 @@ bool DrawDocShell::IsNewPageNameValid( String & rInOutPageName, bool bResetStrin
         else
         {
             // check for upper/lower case roman numbering
-            String sReserved( OUString("cdilmvx") );
+            OUString sReserved("cdilmvx");
 
-            // gobble up all following characters contained in one reserved class
-            String sRemainder = rInOutPageName.GetToken( 1, sal_Unicode(' ') );
-            if( sReserved.Search( sRemainder.GetChar(0) ) == STRING_NOTFOUND )
-                sReserved.ToUpperAscii();
+            // skip all following characters contained in one reserved class
+            if (sReserved.indexOf(sRemainder[0]) == -1)
+                sReserved = sReserved.toAsciiUpperCase();
 
-            while( sReserved.Search( sRemainder.GetChar(0) ) != STRING_NOTFOUND )
+            sal_Int32 nIndex = 0;
+            while (nIndex < sRemainder.getLength() &&
+                   sReserved.indexOf(sRemainder[nIndex]) != -1)
             {
-                // trim by one
-                sRemainder.Erase(0, 1);
+                nIndex++;
             }
 
             // EOL? Reserved name!
-            if( !sRemainder.Len() )
+            if (nIndex >= sRemainder.getLength())
             {
                 bIsStandardName = true;
             }
@@ -395,7 +393,7 @@ bool DrawDocShell::IsNewPageNameValid( String & rInOutPageName, bool bResetStrin
             // this is for insertion of slides from other files with standard
             // name.  They get a new standard name, if the string is set to an
             // empty one.
-            rInOutPageName = String();
+            rInOutPageName = OUString();
             bCanUseNewName = true;
         }
         else
@@ -403,7 +401,7 @@ bool DrawDocShell::IsNewPageNameValid( String & rInOutPageName, bool bResetStrin
     }
     else
     {
-        if( rInOutPageName.Len() > 0 )
+        if (!rInOutPageName.isEmpty())
         {
             sal_Bool   bOutDummy;
             sal_uInt16 nExistingPageNum = mpDoc->GetPageByName( rInOutPageName, bOutDummy );
@@ -421,7 +419,7 @@ IMPL_LINK( DrawDocShell, RenameSlideHdl, AbstractSvxNameDialog*, pDialog )
     if( ! pDialog )
         return 0;
 
-    String aNewName;
+    OUString aNewName;
     pDialog->GetName( aNewName );
 
     return IsNewPageNameValid( aNewName );
diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx
index 531ecda..ae0520f 100644
--- a/sd/source/ui/func/fulinend.cxx
+++ b/sd/source/ui/func/fulinend.cxx
@@ -94,7 +94,7 @@ void FuLineEnd::DoExecute( SfxRequest& )
 
         String aNewName( SdResId( STR_LINEEND ) );
         String aDesc( SdResId( STR_DESC_LINEEND ) );
-        String aName;
+        OUString aName;
 
         long nCount = pLineEndList->Count();
         long j = 1;
@@ -103,8 +103,8 @@ void FuLineEnd::DoExecute( SfxRequest& )
         while( !bDifferent )
         {
             aName = aNewName;
-            aName.Append( sal_Unicode(' ') );
-            aName.Append( OUString::valueOf( j++ ) );
+            aName += " ";
+            aName += OUString::number(j++);
             bDifferent = sal_True;
             for( long i = 0; i < nCount && bDifferent; i++ )
             {
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index c36f038..397fa88 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -146,7 +146,7 @@ public:
                 a default name of a not-yet-existing slide (e.g. 'Slide 17'),
                 sal_True is returned, but rName is set to an empty string.
      */
-    sal_Bool                    CheckPageName(::Window* pWin, String& rName );
+    sal_Bool                    CheckPageName(::Window* pWin, OUString& rName );
 
     void                    SetSlotFilter(sal_Bool bEnable = sal_False, sal_uInt16 nCount = 0, const sal_uInt16* pSIDs = NULL) { mbFilterEnable = bEnable; mnFilterCount = nCount; mpFilterSIDs = pSIDs; }
     void                    ApplySlotFilter() const;
@@ -177,7 +177,7 @@ public:
                     is true, the return value is also true, if the slide name is
                     a standard name (see above)
      */
-    bool                    IsNewPageNameValid( String & rInOutPageName, bool bResetStringIfStandardName = false );
+    bool                    IsNewPageNameValid( OUString & rInOutPageName, bool bResetStringIfStandardName = false );
 
 
     /** Return the reference device for the current document.  When the
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 6b9c690..0e8babb 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -949,9 +949,9 @@ void SlotManager::RenameSlide (void)
 
             if( aNameDlg->Execute() == RET_OK )
             {
-                String aNewName;
+                OUString aNewName;
                 aNameDlg->GetName( aNewName );
-                if( ! aNewName.Equals( aPageName ) )
+                if (aNewName != aPageName)
                 {
 #ifdef DBG_UTIL
                     bool bResult =
@@ -976,7 +976,7 @@ IMPL_LINK(SlotManager, RenameSlideHdl, AbstractSvxNameDialog*, pDialog)
     if( ! pDialog )
         return 0;
 
-    String aNewName;
+    OUString aNewName;
     pDialog->GetName( aNewName );
 
     model::SharedPageDescriptor pDescriptor (
@@ -985,7 +985,7 @@ IMPL_LINK(SlotManager, RenameSlideHdl, AbstractSvxNameDialog*, pDialog)
     if (pDescriptor.get() != NULL)
         pCurrentPage = pDescriptor->GetPage();
 
-    return ( (pCurrentPage!=NULL && aNewName.Equals( pCurrentPage->GetName() ))
+    return ( (pCurrentPage!=NULL && aNewName == pCurrentPage->GetName())
         || (mrSlideSorter.GetViewShell()
             && mrSlideSorter.GetViewShell()->GetDocSh()->IsNewPageNameValid( aNewName ) ));
 }
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index f4f6eeb..d1d96b3 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -445,9 +445,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
                 if( aNameDlg->Execute() == RET_OK )
                 {
-                    String aNewName;
+                    OUString aNewName;
                     aNameDlg->GetName( aNewName );
-                    if( ! aNewName.Equals( aPageName ) )
+                    if (aNewName != aPageName)
                     {
 #ifdef DBG_UTIL
                         bool bResult =
@@ -2036,7 +2036,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                 // #i68101#
                 SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0L);
                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
-                String aName(pSelected->GetName());
+                OUString aName(pSelected->GetName());
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "Dialogdiet fail!");
@@ -2070,8 +2070,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
             {
                 SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0L);
                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
-                String aTitle(pSelected->GetTitle());
-                String aDescription(pSelected->GetDescription());
+                OUString aTitle(pSelected->GetTitle());
+                OUString aDescription(pSelected->GetDescription());
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "Dialogdiet fail!");
diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx
index e2e402f..26dc337 100644
--- a/sd/source/ui/view/drviewsb.cxx
+++ b/sd/source/ui/view/drviewsb.cxx
@@ -146,12 +146,12 @@ IMPL_LINK( DrawViewShell, RenameSlideHdl, AbstractSvxNameDialog*, pDialog )
     if( ! pDialog )
         return 0;
 
-    String aNewName;
+    OUString aNewName;
     pDialog->GetName( aNewName );
 
     SdPage* pCurrentPage = GetDoc()->GetSdPage( maTabControl.GetCurPageId() - 1, GetPageKind() );
 
-    return pCurrentPage && ( aNewName.Equals( pCurrentPage->GetName() ) || GetDocSh()->IsNewPageNameValid( aNewName ) );
+    return pCurrentPage && ( aNewName == pCurrentPage->GetName() || GetDocSh()->IsNewPageNameValid( aNewName ) );
 }
 
 
diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx
index d39a2f2..3649dea7 100644
--- a/sd/source/ui/view/drviewsc.cxx
+++ b/sd/source/ui/view/drviewsc.cxx
@@ -361,12 +361,12 @@ void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
 
 IMPL_LINK( DrawViewShell, NameObjectHdl, AbstractSvxNameDialog*, pDialog )
 {
-    String aName;
+    OUString aName;
 
     if( pDialog )
         pDialog->GetName( aName );
 
-    return( ( !aName.Len() || ( GetDoc() && !GetDoc()->GetObj( aName ) ) ) ? 1 : 0 );
+    return ( aName.isEmpty() || ( GetDoc() && !GetDoc()->GetObj( aName ) ) ) ? 1 : 0;
 }
 
 } // end of namespace sd
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index caa35322..50213b6 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -905,7 +905,7 @@ bool View::GetExchangeList (std::vector<OUString> &rExchangeList,
     std::vector<OUString>::const_iterator pIter;
     for ( pIter = rBookmarkList.begin(); bNameOK && pIter != rBookmarkList.end(); ++pIter )
     {
-        String aNewName = *pIter;
+        OUString aNewName = *pIter;
 
         if( nType == 0  || nType == 2 )
             bNameOK = mpDocSh->CheckPageName(mpViewSh->GetActiveWindow(), aNewName);
diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx
index 379296e..0dec8d6 100644
--- a/sd/source/ui/view/tabcontr.cxx
+++ b/sd/source/ui/view/tabcontr.cxx
@@ -323,7 +323,7 @@ long TabControl::AllowRenaming()
 {
     sal_Bool bOK = sal_True;
 
-    String aNewName( GetEditText() );
+    OUString aNewName( GetEditText() );
     OUString aCompareName( GetPageText( GetEditPageId() ) );
 
     if( aCompareName != aNewName )
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index 7d3c280..81c804d 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -532,7 +532,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
                 // #i68101#
                 SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0L);
                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
-                String aName(pSelected->GetName());
+                OUString aName(pSelected->GetName());
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "Dialogdiet fail!");
@@ -563,8 +563,8 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
             {
                 SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0L);
                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
-                String aTitle(pSelected->GetTitle());
-                String aDescription(pSelected->GetDescription());
+                OUString aTitle(pSelected->GetTitle());
+                OUString aDescription(pSelected->GetDescription());
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "Dialogdiet fail!");
@@ -616,10 +616,10 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
     OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection");
     SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
     const String sCurrentName = pObj->GetName();
-    String sNewName;
+    OUString sNewName;
     pNameDialog->GetName(sNewName);
     long nRet = 0;
-    if(!sNewName.Len() || sCurrentName == sNewName)
+    if (sNewName.isEmpty() || sCurrentName == sNewName)
         nRet = 1;
     else
     {
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 038f489..0e413d8 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -626,8 +626,8 @@ void SwFrameShell::Execute(SfxRequest &rReq)
             if ( pSdrView &&
                  pSdrView->GetMarkedObjectCount() == 1 )
             {
-                String aDescription(rSh.GetObjDescription());
-                String aTitle(rSh.GetObjTitle());
+                OUString aDescription(rSh.GetObjDescription());
+                OUString aTitle(rSh.GetObjTitle());
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "Dialogdiet fail!");


More information about the Libreoffice-commits mailing list