[Libreoffice-commits] core.git: sc/inc sd/source vcl/inc vcl/source

elixir prashant3.yishu at gmail.com
Wed Feb 27 17:26:00 PST 2013


 sc/inc/styleuno.hxx            |    2 -
 sd/source/core/stlsheet.cxx    |   66 +++++++++++++++++++++++------------------
 sd/source/ui/func/fuprobjs.cxx |   12 +++----
 sd/source/ui/func/futempl.cxx  |    2 -
 vcl/inc/svdata.hxx             |    2 -
 vcl/inc/vcl/svapp.hxx          |    4 +-
 vcl/source/app/svapp.cxx       |    6 +--
 7 files changed, 52 insertions(+), 42 deletions(-)

New commits:
commit 9133cc452c9e473164755a2177b7a2285c09cb22
Author: elixir <prashant3.yishu at gmail.com>
Date:   Thu Feb 21 03:54:57 2013 +0530

    fdo#38838,UniString,String_to_OUString
    
    Change-Id: I024a2de18fe3c22be0860b62a862ede992e12c1e
    Reviewed-on: https://gerrit.libreoffice.org/2303
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx
index 71d01da..21f3d38 100644
--- a/sc/inc/styleuno.hxx
+++ b/sc/inc/styleuno.hxx
@@ -215,7 +215,7 @@ private:
     const SfxItemPropertySet* pPropSet;
     ScDocShell*             pDocShell;
     SfxStyleFamily          eFamily;        // Family
-    String                  aStyleName;
+    OUString                aStyleName;
 
     SfxStyleSheetBase*      GetStyle_Impl();
     const SfxItemSet*       GetStyleItemSet_Impl( const ::rtl::OUString& rPropName, const SfxItemPropertySimpleEntry*& rpEntry );
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 09c85c3..0854049 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -55,7 +55,7 @@
 #include "../ui/inc/DrawViewShell.hxx"
 #include "../ui/inc/ViewShellBase.hxx"
 
-using ::rtl::OUString;
+
 using ::osl::MutexGuard;
 using ::osl::ClearableMutexGuard;
 using ::cppu::OInterfaceContainerHelper;
@@ -124,7 +124,7 @@ void ModifyListenerForewarder::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& /*
 }
 
 SdStyleSheet::SdStyleSheet(const OUString& rDisplayName, SfxStyleSheetBasePool& _rPool, SfxStyleFamily eFamily, sal_uInt16 _nMask)
-: SdStyleSheetBase( UniString( rDisplayName ), _rPool, eFamily, _nMask)
+: SdStyleSheetBase( OUString( rDisplayName ), _rPool, eFamily, _nMask)
 , ::cppu::BaseMutex()
 , msApiName( rDisplayName )
 , mxPool( const_cast< SfxStyleSheetBasePool* >(&_rPool) )
@@ -386,8 +386,8 @@ bool SdStyleSheet::IsUsed() const
 
 SdStyleSheet* SdStyleSheet::GetRealStyleSheet() const
 {
-    String aRealStyle;
-    String aSep( RTL_CONSTASCII_USTRINGPARAM( SD_LT_SEPARATOR ));
+    OUString aRealStyle;
+    OUString aSep( SD_LT_SEPARATOR );
     SdStyleSheet* pRealStyle = NULL;
     SdDrawDocument* pDoc = ((SdStyleSheetPool*)pPool)->GetDoc();
 
@@ -404,11 +404,14 @@ SdStyleSheet* SdStyleSheet::GetRealStyleSheet() const
         {
             aRealStyle = pPage->GetLayoutName();
             // cut after seperator string
-            aRealStyle.Erase(aRealStyle.Search(aSep) + aSep.Len());
+            
+            if( aRealStyle.indexOf(aSep) >= 0)
+            {
+                aRealStyle = aRealStyle.copy(0,(aRealStyle.indexOf(aSep) + aSep.getLength()));
+            }      
         }
     }
-
-    if (aRealStyle.Len() == 0)
+    if (aRealStyle.isEmpty())
     {
         SdPage* pPage = pDoc->GetSdPage(0, PK_STANDARD);
 
@@ -426,7 +429,10 @@ SdStyleSheet* SdStyleSheet::GetRealStyleSheet() const
                 aRealStyle = pSheet->GetName();
         }
 
-        aRealStyle.Erase(aRealStyle.Search(aSep) + aSep.Len());
+            if( aRealStyle.indexOf(aSep) >= 0)
+            {
+                aRealStyle = aRealStyle.copy(0,(aRealStyle.indexOf(aSep) + aSep.getLength()));
+            }
     }
 
     // jetzt vom Namen (landessprachlich angepasst) auf den internen
@@ -490,39 +496,43 @@ SdStyleSheet* SdStyleSheet::GetRealStyleSheet() const
 SdStyleSheet* SdStyleSheet::GetPseudoStyleSheet() const
 {
     SdStyleSheet* pPseudoStyle = NULL;
-    String aSep( RTL_CONSTASCII_USTRINGPARAM( SD_LT_SEPARATOR ));
-    String aStyleName(aName);
+    OUString aSep( SD_LT_SEPARATOR );
+    OUString aStyleName(aName);
         // ohne Layoutnamen und Separator
-    aStyleName.Erase(0, aStyleName.Search(aSep) + aSep.Len());
 
-    if (aStyleName == String(SdResId(STR_LAYOUT_TITLE)))
+    if( aStyleName.indexOf(aSep) >=0 )
     {
-        aStyleName = String(SdResId(STR_PSEUDOSHEET_TITLE));
+        aStyleName = aStyleName.copy (aStyleName.indexOf(aSep) + aSep.getLength());
     }
-    else if (aStyleName == String(SdResId(STR_LAYOUT_SUBTITLE)))
+
+    if (aStyleName == OUString(SdResId(STR_LAYOUT_TITLE)))
+    {
+        aStyleName = OUString(SdResId(STR_PSEUDOSHEET_TITLE));
+    }
+    else if (aStyleName == OUString(SdResId(STR_LAYOUT_SUBTITLE)))
     {
-        aStyleName = String(SdResId(STR_PSEUDOSHEET_SUBTITLE));
+        aStyleName = OUString(SdResId(STR_PSEUDOSHEET_SUBTITLE));
     }
-    else if (aStyleName == String(SdResId(STR_LAYOUT_BACKGROUND)))
+    else if (aStyleName == OUString(SdResId(STR_LAYOUT_BACKGROUND)))
     {
-        aStyleName = String(SdResId(STR_PSEUDOSHEET_BACKGROUND));
+        aStyleName = OUString(SdResId(STR_PSEUDOSHEET_BACKGROUND));
     }
-    else if (aStyleName == String(SdResId(STR_LAYOUT_BACKGROUNDOBJECTS)))
+    else if (aStyleName == OUString(SdResId(STR_LAYOUT_BACKGROUNDOBJECTS)))
     {
-        aStyleName = String(SdResId(STR_PSEUDOSHEET_BACKGROUNDOBJECTS));
+        aStyleName = OUString(SdResId(STR_PSEUDOSHEET_BACKGROUNDOBJECTS));
     }
-    else if (aStyleName == String(SdResId(STR_LAYOUT_NOTES)))
+    else if (aStyleName == OUString(SdResId(STR_LAYOUT_NOTES)))
     {
-        aStyleName = String(SdResId(STR_PSEUDOSHEET_NOTES));
+        aStyleName = OUString(SdResId(STR_PSEUDOSHEET_NOTES));
     }
     else
     {
-        String aOutlineStr((SdResId(STR_LAYOUT_OUTLINE)));
-        sal_uInt16 nPos = aStyleName.Search(aOutlineStr);
-        if (nPos != STRING_NOTFOUND)
+        OUString aOutlineStr((SdResId(STR_LAYOUT_OUTLINE)));
+        sal_Int32 nPos = aStyleName.indexOf(aOutlineStr);
+        if (nPos != -1)
         {
-            String aNumStr(aStyleName.Copy(aOutlineStr.Len()));
-            aStyleName = String(SdResId(STR_PSEUDOSHEET_OUTLINE));
+            OUString aNumStr(aStyleName.copy(aOutlineStr.getLength()));
+            aStyleName = OUString(SdResId(STR_PSEUDOSHEET_OUTLINE));
             aStyleName += aNumStr;
         }
     }
@@ -573,7 +583,7 @@ void SdStyleSheet::AdjustToFontHeight(SfxItemSet& rSet, sal_Bool bOnlyMissingIte
     // Bulletbreite und Texteinzug an neue Fonthoehe
     // anpassen, wenn sie nicht explizit gesetzt wurden
     SfxStyleFamily eFamily = nFamily;
-    String aStyleName(aName);
+    OUString aStyleName(aName);
     if (eFamily == SD_STYLE_FAMILY_PSEUDO)
     {
         SfxStyleSheet* pRealStyle = GetRealStyleSheet();
@@ -582,7 +592,7 @@ void SdStyleSheet::AdjustToFontHeight(SfxItemSet& rSet, sal_Bool bOnlyMissingIte
     }
 
     if (eFamily == SD_STYLE_FAMILY_MASTERPAGE &&
-        aStyleName.Search(String(SdResId(STR_LAYOUT_OUTLINE))) != STRING_NOTFOUND &&
+        aStyleName.indexOf(OUString(SdResId(STR_LAYOUT_OUTLINE))) != -1 &&
         rSet.GetItemState(EE_CHAR_FONTHEIGHT) == SFX_ITEM_SET)
     {
         const SfxItemSet* pCurSet = &GetItemSet();
diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx
index 899b75e..f38b91f 100644
--- a/sd/source/ui/func/fuprobjs.cxx
+++ b/sd/source/ui/func/fuprobjs.cxx
@@ -121,8 +121,8 @@ void FuPresentationObjects::DoExecute( SfxRequest& )
 
     if( bUnique )
     {
-        String aStyleName = aLayoutName;
-        aStyleName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ) );
+        OUString aStyleName = aLayoutName;
+        aStyleName += SD_LT_SEPARATOR ;
         sal_uInt16 nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
         PresentationObjects ePO;
 
@@ -130,15 +130,15 @@ void FuPresentationObjects::DoExecute( SfxRequest& )
         {
             ePO = PO_TITLE;
             String aStr(SdResId( STR_LAYOUT_TITLE ));
-            aStyleName.Append( aStr );
+            aStyleName += aStr ;
         }
         else
         {
             ePO = (PresentationObjects) ( PO_OUTLINE_1 + nDepth - 1 );
             String aStr(SdResId( STR_LAYOUT_OUTLINE ));
-            aStyleName.Append( aStr );
-            aStyleName.Append( sal_Unicode(' ') );
-            aStyleName.Append( OUString::number( nDepth ) );
+            aStyleName += aStr ;
+            aStyleName += OUString(' ') ;
+            aStyleName += OUString::number( nDepth ) ;
         }
 
         SfxStyleSheetBasePool* pStyleSheetPool = mpDocSh->GetStyleSheetPool();
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index 91d06f3..14a6035 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -126,7 +126,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
             nFamily = SD_STYLE_FAMILY_PSEUDO;
     }
 
-    String aStyleName;
+    OUString aStyleName;
     sal_uInt16 nRetMask = SFXSTYLEBIT_ALL;
 
     switch( nSId )
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index b4b59b5..7f89f9f 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -120,7 +120,7 @@ struct ImplSVAppData
     ImplAccelManager*       mpAccelMgr;         // Accelerator Manager
     XubString*              mpAppName;          // Application name
     XubString*              mpAppFileName;      // Abs. Application FileName
-    XubString*              mpDisplayName;      // Application Display Name
+    OUString*               mpDisplayName;      // Application Display Name
     String*                 mpFontPath;         // Additional Fontpath
     Help*                   mpHelp;             // Application help
     PopupMenu*              mpActivePopupMenu;  // Actives Popup-Menu (in Execute)
diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index 3643168..a3eb6b7 100644
--- a/vcl/inc/vcl/svapp.hxx
+++ b/vcl/inc/vcl/svapp.hxx
@@ -260,8 +260,8 @@ public:
     static bool                 LoadBrandSVG( const char *pName, BitmapEx &rBitmap );
 
     // default name of the application for message dialogs and printing
-    static void                 SetDisplayName( const UniString& rDisplayName );
-    static UniString            GetDisplayName();
+    static void                 SetDisplayName( const OUString& rDisplayName );
+    static OUString             GetDisplayName();
 
 
     static unsigned int         GetScreenCount();
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 9e67117..9182b1c 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1192,20 +1192,20 @@ XubString Application::GetAppName()
 
 // -----------------------------------------------------------------------
 
-void Application::SetDisplayName( const UniString& rName )
+void Application::SetDisplayName( const OUString& rName )
 {
     ImplSVData* pSVData = ImplGetSVData();
 
     // create if not existing
     if ( !pSVData->maAppData.mpDisplayName )
-        pSVData->maAppData.mpDisplayName = new UniString( rName );
+        pSVData->maAppData.mpDisplayName = new OUString( rName );
     else
         *(pSVData->maAppData.mpDisplayName) = rName;
 }
 
 // -----------------------------------------------------------------------
 
-UniString Application::GetDisplayName()
+OUString Application::GetDisplayName()
 {
     ImplSVData* pSVData = ImplGetSVData();
     if ( pSVData->maAppData.mpDisplayName )


More information about the Libreoffice-commits mailing list