[Libreoffice-commits] .: vbahelper/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 7 06:36:27 PDT 2012


 vbahelper/source/vbahelper/vbaglobalbase.cxx    |   22 ++++-----
 vbahelper/source/vbahelper/vbapagesetupbase.cxx |   56 ++++++++++++------------
 2 files changed, 39 insertions(+), 39 deletions(-)

New commits:
commit 419d074df87d24d4612a9e5ef5f70cb9dcefef93
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date:   Thu Sep 6 18:58:56 2012 -0300

    More OUString cleanup in vbahelper
    
    Change-Id: Ie7e350698900f1c1cacb6ebc3fa6716ef03ab782
    Reviewed-on: https://gerrit.libreoffice.org/575
    Reviewed-by: Luboš Luňák <l.lunak at suse.cz>
    Tested-by: Luboš Luňák <l.lunak at suse.cz>

diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx
index 9b38f52..62091b6 100644
--- a/vbahelper/source/vbahelper/vbaglobalbase.cxx
+++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx
@@ -33,7 +33,7 @@ const char sAppService[] = "ooo.vba.Application";
 
 VbaGlobalsBase::VbaGlobalsBase(
 const uno::Reference< ov::XHelperInterface >& xParent,
-const uno::Reference< uno::XComponentContext >& xContext, const rtl::OUString& sDocCtxName )
+const uno::Reference< uno::XComponentContext >& xContext, const OUString& sDocCtxName )
     : Globals_BASE( xParent, xContext )
     , msDocCtxName( sDocCtxName )
     , msApplication( RTL_CONSTASCII_USTRINGPARAM("Application") )
@@ -43,14 +43,14 @@ const uno::Reference< uno::XComponentContext >& xContext, const rtl::OUString& s
     uno::Reference< uno::XInterface > aSrvMgr;
     if ( xContext.is() && xContext->getServiceManager().is() )
     {
-        aSrvMgr = xContext->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.stoc.OServiceManagerWrapper") ), xContext );
+        aSrvMgr = xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.comp.stoc.OServiceManagerWrapper" , xContext );
     }
 
     ::cppu::ContextEntry_Init aHandlerContextInfo[] =
     {
         ::cppu::ContextEntry_Init( msApplication, uno::Any() ),
         ::cppu::ContextEntry_Init( sDocCtxName, uno::Any() ),
-        ::cppu::ContextEntry_Init( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.lang.theServiceManager" ) ), uno::makeAny( aSrvMgr ) )
+        ::cppu::ContextEntry_Init( "/singletons/com.sun.star.lang.theServiceManager" , uno::makeAny( aSrvMgr ) )
     };
     // don't pass a delegate, this seems to introduce yet another cyclic dependency ( and
     // some strange behavior
@@ -117,7 +117,7 @@ VbaGlobalsBase::init(  const uno::Sequence< beans::PropertyValue >& aInitArgs )
 }
 
 uno::Reference< uno::XInterface > SAL_CALL
-VbaGlobalsBase::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (uno::Exception, uno::RuntimeException)
+VbaGlobalsBase::createInstance( const OUString& aServiceSpecifier ) throw (uno::Exception, uno::RuntimeException)
 {
     uno::Reference< uno::XInterface > xReturn;
     if ( aServiceSpecifier == sAppService )
@@ -132,7 +132,7 @@ VbaGlobalsBase::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw
 }
 
 uno::Reference< uno::XInterface > SAL_CALL
-VbaGlobalsBase::createInstanceWithArguments( const ::rtl::OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& Arguments ) throw (uno::Exception, uno::RuntimeException)
+VbaGlobalsBase::createInstanceWithArguments( const OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& Arguments ) throw (uno::Exception, uno::RuntimeException)
 {
 
     uno::Reference< uno::XInterface > xReturn;
@@ -147,21 +147,21 @@ VbaGlobalsBase::createInstanceWithArguments( const ::rtl::OUString& aServiceSpec
     return xReturn;
 }
 
-uno::Sequence< ::rtl::OUString > SAL_CALL
+uno::Sequence< OUString > SAL_CALL
 VbaGlobalsBase::getAvailableServiceNames(  ) throw (uno::RuntimeException)
 {
-    static const rtl::OUString names[] = {
+    static const OUString names[] = {
     // common
-        ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.msforms.UserForm" ) ),
+        "ooo.vba.msforms.UserForm" ,
       };
-    static uno::Sequence< rtl::OUString > serviceNames( names, sizeof( names )/ sizeof( names[0] ) );
+    static uno::Sequence< OUString > serviceNames( names, sizeof( names )/ sizeof( names[0] ) );
     return serviceNames;
 }
 
 bool
-VbaGlobalsBase::hasServiceName( const rtl::OUString& serviceName )
+VbaGlobalsBase::hasServiceName( const OUString& serviceName )
 {
-    uno::Sequence< rtl::OUString > sServiceNames( getAvailableServiceNames() );
+    uno::Sequence< OUString > sServiceNames( getAvailableServiceNames() );
     sal_Int32 nLen = sServiceNames.getLength();
     for ( sal_Int32 index = 0; index < nLen; ++index )
     {
diff --git a/vbahelper/source/vbahelper/vbapagesetupbase.cxx b/vbahelper/source/vbahelper/vbapagesetupbase.cxx
index 885abed..a47f591 100644
--- a/vbahelper/source/vbahelper/vbapagesetupbase.cxx
+++ b/vbahelper/source/vbahelper/vbapagesetupbase.cxx
@@ -34,15 +34,15 @@ double SAL_CALL VbaPageSetupBase::getTopMargin() throw (css::uno::RuntimeExcepti
 
     try
     {
-        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsOn")));
+        uno::Any aValue = mxPageProps->getPropertyValue( "HeaderIsOn" );
         aValue >>= headerOn;
 
-        aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")));
+        aValue = mxPageProps->getPropertyValue( "TopMargin" );
         aValue >>= topMargin;
 
         if( headerOn )
         {
-            aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderHeight")));
+            aValue = mxPageProps->getPropertyValue( "HeaderHeight" );
             aValue >>= headerHeight;
             topMargin = topMargin + headerHeight;
         }
@@ -62,18 +62,18 @@ void SAL_CALL VbaPageSetupBase::setTopMargin( double margin ) throw (css::uno::R
 
     try
     {
-        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsOn")));
+        uno::Any aValue = mxPageProps->getPropertyValue( "HeaderIsOn" );
         aValue >>= headerOn;
 
         if( headerOn )
         {
-            aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderHeight")));
+            aValue = mxPageProps->getPropertyValue( "HeaderHeight" );
             aValue >>= headerHeight;
             topMargin -= headerHeight;
         }
 
         aValue <<= topMargin;
-        mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")), aValue );
+        mxPageProps->setPropertyValue( "TopMargin" , aValue );
     }
     catch( uno::Exception& )
     {
@@ -88,15 +88,15 @@ double SAL_CALL VbaPageSetupBase::getBottomMargin() throw (css::uno::RuntimeExce
 
     try
     {
-        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsOn")));
+        uno::Any aValue = mxPageProps->getPropertyValue( "FooterIsOn" );
         aValue >>= footerOn;
 
-        aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")));
+        aValue = mxPageProps->getPropertyValue( "BottomMargin" );
         aValue >>= bottomMargin;
 
         if( footerOn )
         {
-            aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterHeight")));
+            aValue = mxPageProps->getPropertyValue( "FooterHeight" );
             aValue >>= footerHeight;
             bottomMargin += footerHeight;
         }
@@ -116,18 +116,18 @@ void SAL_CALL VbaPageSetupBase::setBottomMargin( double margin ) throw (css::uno
 
     try
     {
-        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsOn")));
+        uno::Any aValue = mxPageProps->getPropertyValue( "FooterIsOn" );
         aValue >>= footerOn;
 
         if( footerOn )
         {
-            aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterHeight")));
+            aValue = mxPageProps->getPropertyValue( "FooterHeight" );
             aValue >>= footerHeight;
             bottomMargin -= footerHeight;
         }
 
         aValue <<= bottomMargin;
-        mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")), aValue );
+        mxPageProps->setPropertyValue( "BottomMargin" , aValue );
     }
     catch( uno::Exception& )
     {
@@ -139,7 +139,7 @@ double SAL_CALL VbaPageSetupBase::getRightMargin() throw (css::uno::RuntimeExcep
     sal_Int32 rightMargin = 0;
     try
     {
-        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightMargin")));
+        uno::Any aValue = mxPageProps->getPropertyValue( "RightMargin" );
         aValue >>= rightMargin;
     }
     catch( uno::Exception& )
@@ -156,7 +156,7 @@ void SAL_CALL VbaPageSetupBase::setRightMargin( double margin ) throw (css::uno:
     {
         uno::Any aValue;
         aValue <<= rightMargin;
-        mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightMargin")), aValue );
+        mxPageProps->setPropertyValue( "RightMargin" , aValue );
     }
     catch( uno::Exception& )
     {
@@ -169,7 +169,7 @@ double SAL_CALL VbaPageSetupBase::getLeftMargin() throw (css::uno::RuntimeExcept
     sal_Int32 leftMargin = 0;
     try
     {
-        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin")));
+        uno::Any aValue = mxPageProps->getPropertyValue( "LeftMargin" );
         aValue >>= leftMargin;
     }
     catch( uno::Exception& )
@@ -186,7 +186,7 @@ void SAL_CALL VbaPageSetupBase::setLeftMargin( double margin ) throw (css::uno::
     {
         uno::Any aValue;
         aValue <<= leftMargin;
-        mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin")), aValue );
+        mxPageProps->setPropertyValue( "LeftMargin" , aValue );
     }
     catch( uno::Exception& )
     {
@@ -198,7 +198,7 @@ double SAL_CALL VbaPageSetupBase::getHeaderMargin() throw (css::uno::RuntimeExce
     sal_Int32 headerMargin = 0;
     try
     {
-        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")));
+        uno::Any aValue = mxPageProps->getPropertyValue( "TopMargin" );
         aValue >>= headerMargin;
     }
     catch( uno::Exception& )
@@ -215,7 +215,7 @@ void SAL_CALL VbaPageSetupBase::setHeaderMargin( double margin ) throw (css::uno
     {
         uno::Any aValue;
         aValue <<= headerMargin;
-        mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")), aValue );
+        mxPageProps->setPropertyValue( "TopMargin" , aValue );
     }
     catch( uno::Exception& )
     {
@@ -227,7 +227,7 @@ double SAL_CALL VbaPageSetupBase::getFooterMargin() throw (css::uno::RuntimeExce
     sal_Int32 footerMargin = 0;
     try
     {
-        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")));
+        uno::Any aValue = mxPageProps->getPropertyValue( "BottomMargin" );
         aValue >>= footerMargin;
     }
     catch( uno::Exception& )
@@ -244,7 +244,7 @@ void SAL_CALL VbaPageSetupBase::setFooterMargin( double margin ) throw (css::uno
     {
         uno::Any aValue;
         aValue <<= footerMargin;
-        mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")), aValue );
+        mxPageProps->setPropertyValue( "BottomMargin" , aValue );
     }
     catch( uno::Exception& )
     {
@@ -257,7 +257,7 @@ sal_Int32 SAL_CALL VbaPageSetupBase::getOrientation() throw (css::uno::RuntimeEx
     try
     {
         sal_Bool isLandscape = sal_False;
-        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")));
+        uno::Any aValue = mxPageProps->getPropertyValue( "IsLandscape" );
         aValue >>= isLandscape;
 
         if( isLandscape )
@@ -276,13 +276,13 @@ void SAL_CALL VbaPageSetupBase::setOrientation( sal_Int32 orientation ) throw (c
     if( ( orientation != mnOrientPortrait ) &&
         ( orientation != mnOrientLandscape ) )
     {
-        DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
+        DebugHelper::exception(SbERR_BAD_PARAMETER, OUString() );
     }
 
     try
     {
         sal_Bool isLandscape = sal_False;
-        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")));
+        uno::Any aValue = mxPageProps->getPropertyValue( "IsLandscape" );
         aValue >>= isLandscape;
 
         sal_Bool switchOrientation = sal_False;
@@ -295,11 +295,11 @@ void SAL_CALL VbaPageSetupBase::setOrientation( sal_Int32 orientation ) throw (c
         if( switchOrientation )
         {
             aValue <<= !isLandscape;
-            uno::Any aHeight = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height")));
-            uno::Any aWidth = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width")));
-            mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")), aValue );
-            mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width")),  aHeight );
-            mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height")), aWidth );
+            uno::Any aHeight = mxPageProps->getPropertyValue( "Height" );
+            uno::Any aWidth = mxPageProps->getPropertyValue( "Width" );
+            mxPageProps->setPropertyValue( "IsLandscape" , aValue );
+            mxPageProps->setPropertyValue( "Width" ,  aHeight );
+            mxPageProps->setPropertyValue( "Height" , aWidth );
         }
     }
     catch( uno::Exception& )


More information about the Libreoffice-commits mailing list