[Libreoffice-commits] .: sd/source

Olivier Hallot ohallot at kemper.freedesktop.org
Sat Apr 7 09:44:40 PDT 2012


 sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx |   34 ++++++--------
 sd/source/ui/view/drviewsa.cxx                            |   20 ++++----
 sd/source/ui/view/frmview.cxx                             |    6 +-
 sd/source/ui/view/viewshel.cxx                            |    2 
 4 files changed, 29 insertions(+), 33 deletions(-)

New commits:
commit 85bdc19fcb6a1a71d6aef0f00b8610f4b85e5a00
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date:   Sat Apr 7 13:41:56 2012 -0300

    More stuffs related to OUStrings in sd

diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index 9231f42..b025ced 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -68,8 +68,6 @@ using namespace ::com::sun::star::accessibility;
 
 class SfxViewFrame;
 
-#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
-
 namespace accessibility {
 
 
@@ -399,31 +397,30 @@ void SAL_CALL
         OUString sFirstService = aServices[0];
         if ( sFirstService == "com.sun.star.drawing.DrawingDocumentDrawView" )
         {
-            if( aServices.getLength() >= 2 &&
-                aServices[1].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.PresentationView")))
+            if( aServices.getLength() >= 2 && aServices[1] == "com.sun.star.presentation.PresentationView")
             {
                 SolarMutexGuard aGuard;
 
-                sName = String( SdResId(SID_SD_A11Y_I_DRAWVIEW_N) );
+                sName = ResId::toString(SdResId(SID_SD_A11Y_I_DRAWVIEW_N) );
             }
             else
             {
                 SolarMutexGuard aGuard;
 
-                sName = String( SdResId(SID_SD_A11Y_D_DRAWVIEW_N) );
+                sName = ResId::toString( SdResId(SID_SD_A11Y_D_DRAWVIEW_N) );
             }
         }
         else if ( sFirstService == "com.sun.star.presentation.NotesView" )
         {
             SolarMutexGuard aGuard;
 
-            sName = String( SdResId(SID_SD_A11Y_I_NOTESVIEW_N) );
+            sName = ResId::toString( SdResId(SID_SD_A11Y_I_NOTESVIEW_N) );
         }
         else if ( sFirstService == "com.sun.star.presentation.HandoutView" )
         {
             SolarMutexGuard aGuard;
 
-            sName = String( SdResId(SID_SD_A11Y_I_HANDOUTVIEW_N) );
+            sName = ResId::toString( SdResId(SID_SD_A11Y_I_HANDOUTVIEW_N) );
         }
         else
         {
@@ -432,7 +429,7 @@ void SAL_CALL
     }
     else
     {
-        sName = OUString(RTL_CONSTASCII_USTRINGPARAM("AccessibleDrawDocumentView"));
+        sName = "AccessibleDrawDocumentView";
     }
     return sName;
 }
@@ -456,31 +453,30 @@ void SAL_CALL
         OUString sFirstService = aServices[0];
         if ( sFirstService == "com.sun.star.drawing.DrawingDocumentDrawView" )
         {
-            if( aServices.getLength() >= 2 &&
-                aServices[1].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.PresentationView")))
+            if( aServices.getLength() >= 2 && aServices[1] == "com.sun.star.presentation.PresentationView")
             {
                 SolarMutexGuard aGuard;
 
-                sDescription = String( SdResId(SID_SD_A11Y_I_DRAWVIEW_D) );
+                sDescription = ResId::toString( SdResId(SID_SD_A11Y_I_DRAWVIEW_D) );
             }
             else
             {
                 SolarMutexGuard aGuard;
 
-                sDescription = String( SdResId(SID_SD_A11Y_D_DRAWVIEW_D) );
+                sDescription = ResId::toString( SdResId(SID_SD_A11Y_D_DRAWVIEW_D) );
             }
         }
         else if ( sFirstService == "com.sun.star.presentation.NotesView" )
         {
             SolarMutexGuard aGuard;
 
-            sDescription = String( SdResId(SID_SD_A11Y_I_NOTESVIEW_D) );
+            sDescription = ResId::toString( SdResId(SID_SD_A11Y_I_NOTESVIEW_D) );
         }
         else if ( sFirstService == "com.sun.star.presentation.HandoutView" )
         {
             SolarMutexGuard aGuard;
 
-            sDescription = String( SdResId(SID_SD_A11Y_I_HANDOUTVIEW_D) );
+            sDescription = ResId::toString( SdResId(SID_SD_A11Y_I_HANDOUTVIEW_D) );
         }
         else
         {
@@ -489,7 +485,7 @@ void SAL_CALL
     }
     else
     {
-        sDescription = OUString(RTL_CONSTASCII_USTRINGPARAM("Accessible Draw Document"));
+        sDescription = "Accessible Draw Document";
     }
     return sDescription;
 }
@@ -694,7 +690,7 @@ void SAL_CALL AccessibleDrawDocumentView::disposing (void)
 void AccessibleDrawDocumentView::UpdateAccessibleName (void)
 {
     OUString sNewName (CreateAccessibleName());
-    sNewName += A2S(": ");
+    sNewName += ": ";
 
     // Add the number of the current slide.
     uno::Reference<drawing::XDrawView> xView (mxController, uno::UNO_QUERY);
@@ -705,7 +701,7 @@ void AccessibleDrawDocumentView::UpdateAccessibleName (void)
             try
             {
                 sal_Int16 nPageNumber (0);
-                if (xProperties->getPropertyValue(A2S("Number")) >>= nPageNumber)
+                if (xProperties->getPropertyValue("Number") >>= nPageNumber)
                 {
                     sNewName += OUString::valueOf(sal_Int32(nPageNumber));
                 }
@@ -722,7 +718,7 @@ void AccessibleDrawDocumentView::UpdateAccessibleName (void)
         Reference<container::XIndexAccess> xPages (xPagesSupplier->getDrawPages(), UNO_QUERY);
         if (xPages.is())
         {
-            sNewName += A2S(" / ");
+            sNewName += " / ";
             sNewName += OUString::valueOf(xPages->getCount());
         }
     }
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 6dd99c1..672043a 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -378,7 +378,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
 
     mbIsRulerDrag = sal_False;
 
-    String aName( RTL_CONSTASCII_USTRINGPARAM("DrawViewShell"));
+    rtl::OUString aName( "DrawViewShell" );
     SetName (aName);
 
     mnLockCount = 0UL;
@@ -751,11 +751,11 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_STATUS_PAGE ) )
     {
         // Allways show the slide/page number.
-        String aString (SdResId( STR_SD_PAGE ));
-        aString += sal_Unicode(' ');
-        aString += UniString::CreateFromInt32( maTabControl.GetCurPageId() );
-        aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " / " ));
-        aString += UniString::CreateFromInt32( GetDoc()->GetSdPageCount( mePageKind ) );
+        OUString aOUString = ResId::toString(SdResId( STR_SD_PAGE ));
+        aOUString += " ";
+        aOUString += OUString::valueOf( maTabControl.GetCurPageId() );
+        aOUString += " / " ;
+        aOUString += OUString::valueOf( GetDoc()->GetSdPageCount( mePageKind ) );
 
         // If in layer mode additionally show the layer that contains all
         // selected shapes of the page.  If the shapes are distributed on
@@ -793,14 +793,14 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
                 pLayer = rLayerAdmin.GetLayerPerID( nLayer );
                 if( pLayer )
                 {
-                    aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " (" ));
-                    aString += pLayer->GetName();
-                    aString += sal_Unicode(')');
+                    aOUString += " (" ;
+                    aOUString += pLayer->GetName();
+                    aOUString += ")";
                 }
             }
         }
 
-        rSet.Put (SfxStringItem (SID_STATUS_PAGE, aString));
+        rSet.Put (SfxStringItem (SID_STATUS_PAGE, aOUString));
     }
     // Layout
     if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_STATUS_LAYOUT ) )
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
index b55d15c..47f80be 100644
--- a/sd/source/ui/view/frmview.cxx
+++ b/sd/source/ui/view/frmview.cxx
@@ -956,19 +956,19 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
             {
                 pValue->Value >>= aSnapGridWidthYDom;
             }
-            else if (!bImpress && pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_VisibleLayers ) ) )
+            else if (!bImpress && pValue->Name == sUNO_View_VisibleLayers  )
             {
                 SetOfByte aSetOfBytes;
                 aSetOfBytes.PutValue( pValue->Value );
                 SetVisibleLayers( aSetOfBytes );
             }
-            else if (!bImpress && pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_PrintableLayers ) ) )
+            else if (!bImpress && pValue->Name == sUNO_View_PrintableLayers )
             {
                 SetOfByte aSetOfBytes;
                 aSetOfBytes.PutValue( pValue->Value );
                 SetPrintableLayers( aSetOfBytes );
             }
-            else if (!bImpress && pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_LockedLayers ) ) )
+            else if (!bImpress && pValue->Name == sUNO_View_LockedLayers )
             {
                 SetOfByte aSetOfBytes;
                 aSetOfBytes.PutValue( pValue->Value );
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 6ac752e..fdbead9 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -229,7 +229,7 @@ void ViewShell::construct(void)
         mpScrollBarBox.reset(new ScrollBarBox(GetParentWindow(), WB_SIZEABLE));
     }
 
-    String aName( RTL_CONSTASCII_USTRINGPARAM( "ViewShell" ));
+    rtl::OUString aName( "ViewShell" );
     SetName (aName);
 
     GetDoc()->StartOnlineSpelling(sal_False);


More information about the Libreoffice-commits mailing list