diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-09-06 22:35:52 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-09-08 20:48:59 +0000 |
commit | 6ed2f211251a45c9653f80ad2e228a5ee83e17a8 (patch) | |
tree | 86e7a8123f11e63fbbaa534d2358879ea2ddf5b2 | |
parent | 1b9c7dae5a62c91e51a03f3d5a1c452a494a08d0 (diff) |
More OUString cleanup in vbahelper
Change-Id: Ie9c650da762e9d5afea9018dd2c6496fcd14ca6f
Reviewed-on: https://gerrit.libreoffice.org/577
Reviewed-by: Olivier Hallot <olivier.hallot@alta.org.br>
Tested-by: Olivier Hallot <olivier.hallot@alta.org.br>
24 files changed, 456 insertions, 467 deletions
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index d9ce6b737bd3..abdbe10c0fca 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -53,7 +53,7 @@ using namespace ::ooo::vba; #define OFFICEVERSION "11.0" // ====VbaTimerInfo================================== -typedef ::std::pair< ::rtl::OUString, ::std::pair< double, double > > VbaTimerInfo; +typedef ::std::pair< OUString, ::std::pair< double, double > > VbaTimerInfo; // ====VbaTimer================================== class VbaTimer @@ -98,10 +98,10 @@ public: return (sal_Int32) nResult; } - void Start( const ::rtl::Reference< VbaApplicationBase > xBase, const ::rtl::OUString& aFunction, double nFrom, double nTo ) + void Start( const ::rtl::Reference< VbaApplicationBase > xBase, const OUString& aFunction, double nFrom, double nTo ) { if ( !xBase.is() || aFunction.isEmpty() ) - throw uno::RuntimeException( ::rtl::OUString( "Unexpected arguments!" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Unexpected arguments!" , uno::Reference< uno::XInterface >() ); m_xBase = xBase; m_aTimerInfo = VbaTimerInfo( aFunction, ::std::pair< double, double >( nFrom, nTo ) ); @@ -206,8 +206,8 @@ VbaApplicationBase::getDisplayStatusBar() throw (uno::RuntimeException) uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); if( xProps.is() ){ - uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString("LayoutManager") ), uno::UNO_QUERY_THROW ); - rtl::OUString url( "private:resource/statusbar/statusbar" ); + uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager"), uno::UNO_QUERY_THROW ); + OUString url( "private:resource/statusbar/statusbar" ); if( xLayoutManager.is() && xLayoutManager->isElementVisible( url ) ){ return sal_True; } @@ -223,8 +223,8 @@ VbaApplicationBase::setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (uno:: uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); if( xProps.is() ){ - uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString("LayoutManager") ), uno::UNO_QUERY_THROW ); - rtl::OUString url( "private:resource/statusbar/statusbar" ); + uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager" ), uno::UNO_QUERY_THROW ); + OUString url( "private:resource/statusbar/statusbar" ); if( xLayoutManager.is() ){ if( bDisplayStatusBar && !xLayoutManager->isElementVisible( url ) ){ if( !xLayoutManager->showElement( url ) ) @@ -270,11 +270,11 @@ void SAL_CALL VbaApplicationBase::setVisible( sal_Bool bVisible ) throw (uno::Ru void SAL_CALL -VbaApplicationBase::OnKey( const ::rtl::OUString& Key, const uno::Any& Procedure ) throw (uno::RuntimeException) +VbaApplicationBase::OnKey( const OUString& Key, const uno::Any& Procedure ) throw (uno::RuntimeException) { // parse the Key & modifiers awt::KeyEvent aKeyEvent = parseKeyEvent( Key ); - rtl::OUString MacroName; + OUString MacroName; Procedure >>= MacroName; uno::Reference< frame::XModel > xModel; SbMethod* pMeth = StarBASIC::GetActiveMethod(); @@ -300,15 +300,15 @@ VbaApplicationBase::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeExc return uno::makeAny( xCommandBars ); } -::rtl::OUString SAL_CALL +OUString SAL_CALL VbaApplicationBase::getVersion() throw (uno::RuntimeException) { - return rtl::OUString(OFFICEVERSION); + return OUString(OFFICEVERSION); } -uno::Any SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const uno::Any& varg1, const uno::Any& varg2, const uno::Any& varg3, const uno::Any& varg4, const uno::Any& varg5, const uno::Any& varg6, const uno::Any& varg7, const uno::Any& varg8, const uno::Any& varg9, const uno::Any& varg10, const uno::Any& varg11, const uno::Any& varg12, const uno::Any& varg13, const uno::Any& varg14, const uno::Any& varg15, const uno::Any& varg16, const uno::Any& varg17, const uno::Any& varg18, const uno::Any& varg19, const uno::Any& varg20, const uno::Any& varg21, const uno::Any& varg22, const uno::Any& varg23, const uno::Any& varg24, const uno::Any& varg25, const uno::Any& varg26, const uno::Any& varg27, const uno::Any& varg28, const uno::Any& varg29, const uno::Any& varg30 ) throw (uno::RuntimeException) +uno::Any SAL_CALL VbaApplicationBase::Run( const OUString& MacroName, const uno::Any& varg1, const uno::Any& varg2, const uno::Any& varg3, const uno::Any& varg4, const uno::Any& varg5, const uno::Any& varg6, const uno::Any& varg7, const uno::Any& varg8, const uno::Any& varg9, const uno::Any& varg10, const uno::Any& varg11, const uno::Any& varg12, const uno::Any& varg13, const uno::Any& varg14, const uno::Any& varg15, const uno::Any& varg16, const uno::Any& varg17, const uno::Any& varg18, const uno::Any& varg19, const uno::Any& varg20, const uno::Any& varg21, const uno::Any& varg22, const uno::Any& varg23, const uno::Any& varg24, const uno::Any& varg25, const uno::Any& varg26, const uno::Any& varg27, const uno::Any& varg28, const uno::Any& varg29, const uno::Any& varg30 ) throw (uno::RuntimeException) { - ::rtl::OUString aMacroName = MacroName.trim(); + OUString aMacroName = MacroName.trim(); if (0 == aMacroName.indexOf('!')) aMacroName = aMacroName.copy(1).trim(); @@ -352,21 +352,21 @@ uno::Any SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, con } else { - throw uno::RuntimeException( rtl::OUString( "The macro doesn't exist" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "The macro doesn't exist" , uno::Reference< uno::XInterface >() ); } } -void SAL_CALL VbaApplicationBase::OnTime( const uno::Any& aEarliestTime, const ::rtl::OUString& aFunction, const uno::Any& aLatestTime, const uno::Any& aSchedule ) +void SAL_CALL VbaApplicationBase::OnTime( const uno::Any& aEarliestTime, const OUString& aFunction, const uno::Any& aLatestTime, const uno::Any& aSchedule ) throw ( uno::RuntimeException ) { if ( aFunction.isEmpty() ) - throw uno::RuntimeException( ::rtl::OUString( "Unexpected function name!" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Unexpected function name!" , uno::Reference< uno::XInterface >() ); double nEarliestTime = 0; double nLatestTime = 0; if ( !( aEarliestTime >>= nEarliestTime ) || ( aLatestTime.hasValue() && !( aLatestTime >>= nLatestTime ) ) ) - throw uno::RuntimeException( ::rtl::OUString( "Only double is supported as time for now!" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Only double is supported as time for now!" , uno::Reference< uno::XInterface >() ); sal_Bool bSetTimer = sal_True; aSchedule >>= bSetTimer; @@ -405,7 +405,7 @@ uno::Any SAL_CALL VbaApplicationBase::getVBE() throw (uno::RuntimeException) aArgs[ 0 ] <<= getCurrentDocument(); uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); uno::Reference< uno::XInterface > xVBE = xServiceManager->createInstanceWithArgumentsAndContext( - ::rtl::OUString( "ooo.vba.vbide.VBE" ), aArgs, mxContext ); + "ooo.vba.vbide.VBE" , aArgs, mxContext ); return uno::Any( xVBE ); } catch( const uno::Exception& ) @@ -414,20 +414,20 @@ uno::Any SAL_CALL VbaApplicationBase::getVBE() throw (uno::RuntimeException) return uno::Any(); } -rtl::OUString +OUString VbaApplicationBase::getServiceImplName() { - return rtl::OUString("VbaApplicationBase"); + return OUString("VbaApplicationBase"); } -uno::Sequence<rtl::OUString> +uno::Sequence<OUString> VbaApplicationBase::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.VbaApplicationBase" ); + aServiceNames[ 0 ] = "ooo.vba.VbaApplicationBase"; } return aServiceNames; } @@ -436,7 +436,7 @@ void SAL_CALL VbaApplicationBase::Undo() throw (uno::RuntimeException) { uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - dispatchRequests( xModel, ::rtl::OUString( ".uno:Undo" ) ); + dispatchRequests( xModel, ".uno:Undo" ); } void VbaApplicationBase::Quit() throw (uno::RuntimeException) diff --git a/vbahelper/source/vbahelper/vbacolorformat.cxx b/vbahelper/source/vbahelper/vbacolorformat.cxx index 1f5004549325..7496d2b9af9a 100644 --- a/vbahelper/source/vbahelper/vbacolorformat.cxx +++ b/vbahelper/source/vbahelper/vbacolorformat.cxx @@ -62,20 +62,20 @@ ScVbaColorFormat::getRGB() throw (uno::RuntimeException) switch( m_nColorFormatType ) { case ColorFormatType::LINEFORMAT_FORECOLOR: - m_xPropertySet->getPropertyValue( rtl::OUString("LineColor") ) >>= nRGB; + m_xPropertySet->getPropertyValue( "LineColor" ) >>= nRGB; break; case ColorFormatType::LINEFORMAT_BACKCOLOR: //TODO BackColor not supported // m_xPropertySet->setPropertyValue( rtl::OUString("Color"), uno::makeAny( nRGB ) ); break; case ColorFormatType::FILLFORMAT_FORECOLOR: - m_xPropertySet->getPropertyValue( rtl::OUString("FillColor") ) >>= nRGB; + m_xPropertySet->getPropertyValue( "FillColor" ) >>= nRGB; break; case ColorFormatType::FILLFORMAT_BACKCOLOR: nRGB = m_nFillFormatBackColor; break; default: - throw uno::RuntimeException( rtl::OUString("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Second parameter of ColorFormat is wrong." , uno::Reference< uno::XInterface >() ); } nRGB = OORGBToXLRGB( nRGB ); return nRGB; @@ -88,13 +88,13 @@ ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException) switch( m_nColorFormatType ) { case ColorFormatType::LINEFORMAT_FORECOLOR: - m_xPropertySet->setPropertyValue( rtl::OUString("LineColor"), uno::makeAny( nRGB ) ); + m_xPropertySet->setPropertyValue( "LineColor" , uno::makeAny( nRGB ) ); break; case ColorFormatType::LINEFORMAT_BACKCOLOR: // TODO BackColor not supported break; case ColorFormatType::FILLFORMAT_FORECOLOR: - m_xPropertySet->setPropertyValue( rtl::OUString("FillColor"), uno::makeAny( nRGB ) ); + m_xPropertySet->setPropertyValue( "FillColor" , uno::makeAny( nRGB ) ); if( m_pFillFormat ) { m_pFillFormat->setForeColorAndInternalStyle(nRGB); @@ -108,7 +108,7 @@ ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException) } break; default: - throw uno::RuntimeException( rtl::OUString("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Second parameter of ColorFormat is wrong." , uno::Reference< uno::XInterface >() ); } } @@ -151,20 +151,20 @@ ScVbaColorFormat::setSchemeColor( sal_Int32 _schemecolor ) throw (uno::RuntimeEx setRGB( nColor ); } -rtl::OUString +OUString ScVbaColorFormat::getServiceImplName() { - return rtl::OUString("ScVbaColorFormat"); + return OUString("ScVbaColorFormat"); } -uno::Sequence< rtl::OUString > +uno::Sequence< OUString > ScVbaColorFormat::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msforms.ColorFormat" ); + aServiceNames[ 0 ] = "ooo.vba.msforms.ColorFormat"; } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbacolorformat.hxx b/vbahelper/source/vbahelper/vbacolorformat.hxx index 4de4b8694598..881a6439fee7 100644 --- a/vbahelper/source/vbahelper/vbacolorformat.hxx +++ b/vbahelper/source/vbahelper/vbacolorformat.hxx @@ -100,8 +100,8 @@ private: sal_Int16 m_nColorFormatType; sal_Int32 m_nFillFormatBackColor; protected: - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); public: ScVbaColorFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XHelperInterface > xInternalParent, const css::uno::Reference< css::drawing::XShape > xShape, const sal_Int16 nColorFormatType ); diff --git a/vbahelper/source/vbahelper/vbacommandbar.cxx b/vbahelper/source/vbahelper/vbacommandbar.cxx index bd9482c091b4..305c9801ece7 100644 --- a/vbahelper/source/vbahelper/vbacommandbar.cxx +++ b/vbahelper/source/vbahelper/vbacommandbar.cxx @@ -29,17 +29,17 @@ using namespace com::sun::star; using namespace ooo::vba; -ScVbaCommandBar::ScVbaCommandBar( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Bool bIsMenu ) throw( uno::RuntimeException ) : CommandBar_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl ), m_bIsMenu( bIsMenu ) +ScVbaCommandBar::ScVbaCommandBar( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Bool bIsMenu ) throw( uno::RuntimeException ) : CommandBar_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl ), m_bIsMenu( bIsMenu ) { } -::rtl::OUString SAL_CALL +OUString SAL_CALL ScVbaCommandBar::getName() throw ( uno::RuntimeException ) { // This will get a "NULL length string" when Name is not set. uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW ); - uno::Any aName = xPropertySet->getPropertyValue( rtl::OUString("UIName") ); - rtl::OUString sName; + uno::Any aName = xPropertySet->getPropertyValue( "UIName" ); + OUString sName; aName >>= sName; if( sName.isEmpty() ) { @@ -48,9 +48,9 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException ) if( m_sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) ) { if( pCBarHelper->getModuleId() == "com.sun.star.sheet.SpreadsheetDocument" ) - sName = rtl::OUString( "Worksheet Menu Bar" ); + sName = "Worksheet Menu Bar"; else if( pCBarHelper->getModuleId() == "com.sun.star.text.TextDocument" ) - sName = rtl::OUString( "Menu Bar" ); + sName = "Menu Bar"; return sName; } } @@ -60,16 +60,16 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException ) { uno::Sequence< beans::PropertyValue > aToolBar; xNameAccess->getByName( m_sResourceUrl ) >>= aToolBar; - getPropertyValue( aToolBar, rtl::OUString( "UIName" ) ) >>= sName; + getPropertyValue( aToolBar, "UIName" ) >>= sName; } } return sName; } void SAL_CALL -ScVbaCommandBar::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException) +ScVbaCommandBar::setName( const OUString& _name ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW ); - xPropertySet->setPropertyValue( rtl::OUString("UIName"), uno::makeAny( _name ) ); + xPropertySet->setPropertyValue( "UIName" , uno::makeAny( _name ) ); pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings ); } @@ -88,7 +88,7 @@ ScVbaCommandBar::getVisible() throw (uno::RuntimeException) { uno::Sequence< beans::PropertyValue > aToolBar; xNameAccess->getByName( m_sResourceUrl ) >>= aToolBar; - getPropertyValue( aToolBar, rtl::OUString( "Visible" ) ) >>= bVisible; + getPropertyValue( aToolBar, "Visible" ) >>= bVisible; } } catch (const uno::Exception&) @@ -170,20 +170,20 @@ ScVbaCommandBar::FindControl( const uno::Any& /*aType*/, const uno::Any& /*aId*/ return uno::makeAny( uno::Reference< XCommandBarControl > () ); } -rtl::OUString +OUString ScVbaCommandBar::getServiceImplName() { - return rtl::OUString("ScVbaCommandBar"); + return OUString("ScVbaCommandBar"); } -uno::Sequence<rtl::OUString> +uno::Sequence<OUString> ScVbaCommandBar::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBar" ); + aServiceNames[ 0 ] = "ooo.vba.CommandBar"; } return aServiceNames; } @@ -192,19 +192,19 @@ ScVbaCommandBar::getServiceNames() VbaDummyCommandBar::VbaDummyCommandBar( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, - const ::rtl::OUString& rName, sal_Int32 nType ) throw( uno::RuntimeException ) : + const OUString& rName, sal_Int32 nType ) throw( uno::RuntimeException ) : CommandBar_BASE( xParent, xContext ), maName( rName ), mnType( nType ) { } -::rtl::OUString SAL_CALL VbaDummyCommandBar::getName() throw ( uno::RuntimeException ) +OUString SAL_CALL VbaDummyCommandBar::getName() throw ( uno::RuntimeException ) { return maName; } -void SAL_CALL VbaDummyCommandBar::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException) +void SAL_CALL VbaDummyCommandBar::setName( const OUString& _name ) throw (uno::RuntimeException) { maName = _name; } @@ -256,18 +256,18 @@ uno::Any SAL_CALL VbaDummyCommandBar::FindControl( const uno::Any& /*aType*/, co return uno::Any( uno::Reference< XCommandBarControl >() ); } -rtl::OUString VbaDummyCommandBar::getServiceImplName() +OUString VbaDummyCommandBar::getServiceImplName() { - return rtl::OUString("VbaDummyCommandBar"); + return OUString("VbaDummyCommandBar"); } -uno::Sequence< rtl::OUString > VbaDummyCommandBar::getServiceNames() +uno::Sequence< OUString > VbaDummyCommandBar::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBar" ); + aServiceNames[ 0 ] = "ooo.vba.CommandBar"; } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbacommandbar.hxx b/vbahelper/source/vbahelper/vbacommandbar.hxx index d539bf0c77c0..1054dea28a76 100644 --- a/vbahelper/source/vbahelper/vbacommandbar.hxx +++ b/vbahelper/source/vbahelper/vbacommandbar.hxx @@ -37,17 +37,17 @@ class ScVbaCommandBar : public CommandBar_BASE private: VbaCommandBarHelperRef pCBarHelper; css::uno::Reference< css::container::XIndexAccess > m_xBarSettings; - rtl::OUString m_sResourceUrl; + OUString m_sResourceUrl; sal_Bool m_bIsMenu; public: - ScVbaCommandBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Bool bIsMenu ) throw( css::uno::RuntimeException ); + ScVbaCommandBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Bool bIsMenu ) throw( css::uno::RuntimeException ); sal_Bool IsMenu() const { return m_bIsMenu; } // Attributes - virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); - virtual void SAL_CALL setName( const ::rtl::OUString& _name ) throw (css::uno::RuntimeException); + virtual OUString SAL_CALL getName() throw (css::uno::RuntimeException); + virtual void SAL_CALL setName( const OUString& _name ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException); @@ -60,8 +60,8 @@ public: virtual css::uno::Any SAL_CALL FindControl( const css::uno::Any& aType, const css::uno::Any& aId, const css::uno::Any& aTag, const css::uno::Any& aVisible, const css::uno::Any& aRecursive ) throw (css::script::BasicErrorException, css::uno::RuntimeException); // XHelperInterface - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); }; /** Dummy command bar implementation. Does nothing but provide its name. */ @@ -71,12 +71,12 @@ public: VbaDummyCommandBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, - const ::rtl::OUString& rName, + const OUString& rName, sal_Int32 nType ) throw( css::uno::RuntimeException ); // Attributes - virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); - virtual void SAL_CALL setName( const ::rtl::OUString& _name ) throw (css::uno::RuntimeException); + virtual OUString SAL_CALL getName() throw (css::uno::RuntimeException); + virtual void SAL_CALL setName( const OUString& _name ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException); @@ -89,11 +89,11 @@ public: virtual css::uno::Any SAL_CALL FindControl( const css::uno::Any& aType, const css::uno::Any& aId, const css::uno::Any& aTag, const css::uno::Any& aVisible, const css::uno::Any& aRecursive ) throw (css::script::BasicErrorException, css::uno::RuntimeException); // XHelperInterface - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); private: - ::rtl::OUString maName; + OUString maName; sal_Int32 mnType; }; diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx index 2c7c50d18e84..4be6c82ef840 100644 --- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx @@ -24,7 +24,7 @@ using namespace com::sun::star; using namespace ooo::vba; -ScVbaCommandBarControl::ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_sResourceUrl( sResourceUrl ), m_xCurrentSettings( xSettings ), m_xBarSettings( xBarSettings ), m_nPosition( 0 ), m_bTemporary( sal_True ) +ScVbaCommandBarControl::ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl ) throw (css::uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_sResourceUrl( sResourceUrl ), m_xCurrentSettings( xSettings ), m_xBarSettings( xBarSettings ), m_nPosition( 0 ), m_bTemporary( sal_True ) { } @@ -35,42 +35,42 @@ void ScVbaCommandBarControl::ApplyChange() throw ( uno::RuntimeException ) pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings ); } -::rtl::OUString SAL_CALL +OUString SAL_CALL ScVbaCommandBarControl::getCaption() throw ( uno::RuntimeException ) { // "Label" always empty - rtl::OUString sCaption; - getPropertyValue( m_aPropertyValues, rtl::OUString("Label") ) >>= sCaption; + OUString sCaption; + getPropertyValue( m_aPropertyValues, "Label" ) >>= sCaption; return sCaption; } void SAL_CALL -ScVbaCommandBarControl::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException) +ScVbaCommandBarControl::setCaption( const OUString& _caption ) throw (uno::RuntimeException) { - rtl::OUString sCaption = _caption.replace('&','~'); - setPropertyValue( m_aPropertyValues, rtl::OUString("Label"), uno::makeAny( sCaption ) ); + OUString sCaption = _caption.replace('&','~'); + setPropertyValue( m_aPropertyValues, "Label" , uno::makeAny( sCaption ) ); ApplyChange(); } -::rtl::OUString SAL_CALL +OUString SAL_CALL ScVbaCommandBarControl::getOnAction() throw (uno::RuntimeException) { - rtl::OUString sCommandURL; - getPropertyValue( m_aPropertyValues, rtl::OUString("CommandURL") ) >>= sCommandURL; + OUString sCommandURL; + getPropertyValue( m_aPropertyValues, "CommandURL" ) >>= sCommandURL; return sCommandURL; } void SAL_CALL -ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (uno::RuntimeException) +ScVbaCommandBarControl::setOnAction( const OUString& _onaction ) throw (uno::RuntimeException) { // get the current model uno::Reference< frame::XModel > xModel( pCBarHelper->getModel() ); MacroResolvedInfo aResolvedMacro = ooo::vba::resolveVBAMacro( getSfxObjShell( xModel ), _onaction, true ); if ( aResolvedMacro.mbFound ) { - rtl::OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.msResolvedMacro ); - OSL_TRACE(" ScVbaCommandBarControl::setOnAction: %s", rtl::OUStringToOString( aCommandURL, RTL_TEXTENCODING_UTF8 ).getStr() ); - setPropertyValue( m_aPropertyValues, rtl::OUString("CommandURL"), uno::makeAny( aCommandURL ) ); + OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.msResolvedMacro ); + OSL_TRACE(" ScVbaCommandBarControl::setOnAction: %s", OUStringToOString( aCommandURL, RTL_TEXTENCODING_UTF8 ).getStr() ); + setPropertyValue( m_aPropertyValues, "CommandURL" , uno::makeAny( aCommandURL ) ); ApplyChange(); } } @@ -79,7 +79,7 @@ ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (u ScVbaCommandBarControl::getVisible() throw (uno::RuntimeException) { sal_Bool bVisible = sal_True; - uno::Any aValue = getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ISVISIBLE ) ); + uno::Any aValue = getPropertyValue( m_aPropertyValues, ITEM_DESCRIPTOR_ISVISIBLE ); if( aValue.hasValue() ) aValue >>= bVisible; return bVisible; @@ -87,10 +87,10 @@ ScVbaCommandBarControl::getVisible() throw (uno::RuntimeException) void SAL_CALL ScVbaCommandBarControl::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException) { - uno::Any aValue = getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ISVISIBLE ) ); + uno::Any aValue = getPropertyValue( m_aPropertyValues, ITEM_DESCRIPTOR_ISVISIBLE ); if( aValue.hasValue() ) { - setPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ISVISIBLE ), uno::makeAny( _visible ) ); + setPropertyValue( m_aPropertyValues, ITEM_DESCRIPTOR_ISVISIBLE , uno::makeAny( _visible ) ); ApplyChange(); } } @@ -100,7 +100,7 @@ ScVbaCommandBarControl::getEnabled() throw (uno::RuntimeException) { sal_Bool bEnabled = sal_True; - uno::Any aValue = getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ENABLED ) ); + uno::Any aValue = getPropertyValue( m_aPropertyValues, ITEM_DESCRIPTOR_ENABLED ); if( aValue.hasValue() ) { aValue >>= bEnabled; @@ -116,10 +116,10 @@ ScVbaCommandBarControl::getEnabled() throw (uno::RuntimeException) void SAL_CALL ScVbaCommandBarControl::setEnabled( sal_Bool _enabled ) throw (uno::RuntimeException) { - uno::Any aValue = getPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ENABLED ) ); + uno::Any aValue = getPropertyValue( m_aPropertyValues, ITEM_DESCRIPTOR_ENABLED ); if( aValue.hasValue() ) { - setPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ENABLED ), uno::makeAny( _enabled ) ); + setPropertyValue( m_aPropertyValues, ITEM_DESCRIPTOR_ENABLED , uno::makeAny( _enabled ) ); ApplyChange(); } else @@ -163,7 +163,7 @@ ScVbaCommandBarControl::Controls( const uno::Any& aIndex ) throw (script::BasicE { // only Popup Menu has controls uno::Reference< container::XIndexAccess > xSubMenu; - getPropertyValue( m_aPropertyValues, rtl::OUString( ITEM_DESCRIPTOR_CONTAINER ) ) >>= xSubMenu; + getPropertyValue( m_aPropertyValues, ITEM_DESCRIPTOR_CONTAINER ) >>= xSubMenu; if( !xSubMenu.is() ) throw uno::RuntimeException(); @@ -175,72 +175,72 @@ ScVbaCommandBarControl::Controls( const uno::Any& aIndex ) throw (script::BasicE return uno::makeAny( xCommandBarControls ); } -rtl::OUString +OUString ScVbaCommandBarControl::getServiceImplName() { - return rtl::OUString("ScVbaCommandBarControl"); + return OUString("ScVbaCommandBarControl"); } -uno::Sequence<rtl::OUString> +uno::Sequence<OUString> ScVbaCommandBarControl::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarControl" ); + aServiceNames[ 0 ] = "ooo.vba.CommandBarControl"; } return aServiceNames; } //////////// ScVbaCommandBarPopup ////////////////////////////// -ScVbaCommandBarPopup::ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException) : CommandBarPopup_BASE( xParent, xContext, xSettings, pHelper, xBarSettings, sResourceUrl ) +ScVbaCommandBarPopup::ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException) : CommandBarPopup_BASE( xParent, xContext, xSettings, pHelper, xBarSettings, sResourceUrl ) { m_nPosition = nPosition; m_bTemporary = bTemporary; m_xCurrentSettings->getByIndex( m_nPosition ) >>= m_aPropertyValues; } -rtl::OUString +OUString ScVbaCommandBarPopup::getServiceImplName() { - return rtl::OUString("ScVbaCommandBarPopup"); + return OUString("ScVbaCommandBarPopup"); } -uno::Sequence<rtl::OUString> +uno::Sequence<OUString> ScVbaCommandBarPopup::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarPopup" ); + aServiceNames[ 0 ] = "ooo.vba.CommandBarPopup"; } return aServiceNames; } //////////// ScVbaCommandBarButton ////////////////////////////// -ScVbaCommandBarButton::ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException) : CommandBarButton_BASE( xParent, xContext, xSettings, pHelper, xBarSettings, sResourceUrl ) +ScVbaCommandBarButton::ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException) : CommandBarButton_BASE( xParent, xContext, xSettings, pHelper, xBarSettings, sResourceUrl ) { m_nPosition = nPosition; m_bTemporary = bTemporary; m_xCurrentSettings->getByIndex( m_nPosition ) >>= m_aPropertyValues; } -rtl::OUString +OUString ScVbaCommandBarButton::getServiceImplName() { - return rtl::OUString("ScVbaCommandBarButton"); + return OUString("ScVbaCommandBarButton"); } -uno::Sequence<rtl::OUString> +uno::Sequence<OUString> ScVbaCommandBarButton::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarButton" ); + aServiceNames[ 0 ] = "ooo.vba.CommandBarButton"; } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx index 7e9beb3e19a3..409d8683fb45 100644 --- a/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx +++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx @@ -34,7 +34,7 @@ class ScVbaCommandBarControl : public CommandBarControl_BASE { protected: VbaCommandBarHelperRef pCBarHelper; - rtl::OUString m_sResourceUrl; + OUString m_sResourceUrl; css::uno::Reference< css::container::XIndexAccess > m_xCurrentSettings; css::uno::Reference< css::container::XIndexAccess > m_xBarSettings; css::uno::Sequence< css::beans::PropertyValue > m_aPropertyValues; @@ -46,13 +46,13 @@ private: void ApplyChange() throw (css::uno::RuntimeException); public: - ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException); + ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl ) throw (css::uno::RuntimeException); // Attributes - virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); - virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException); - virtual void SAL_CALL setOnAction( const ::rtl::OUString& _onaction ) throw (css::uno::RuntimeException); + virtual OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); + virtual void SAL_CALL setCaption( const OUString& _caption ) throw (css::uno::RuntimeException); + virtual OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException); + virtual void SAL_CALL setOnAction( const OUString& _onaction ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException); @@ -69,38 +69,38 @@ public: virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException); // XHelperInterface - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); }; typedef cppu::ImplInheritanceHelper1< ScVbaCommandBarControl, ov::XCommandBarPopup > CommandBarPopup_BASE; class ScVbaCommandBarPopup : public CommandBarPopup_BASE { public: - ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException); + ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException); virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException) { return ov::office::MsoControlType::msoControlPopup; } // XHelperInterface - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); }; typedef cppu::ImplInheritanceHelper1< ScVbaCommandBarControl, ov::XCommandBarButton > CommandBarButton_BASE; class ScVbaCommandBarButton : public CommandBarButton_BASE { public: - ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException); + ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException); virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException) { return ov::office::MsoControlType::msoControlButton; } // XHelperInterface - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); }; #endif//SC_VBA_COMMANDBARCONTROL_HXX diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx index c07301403ff6..12fbe00a9e91 100644 --- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx @@ -47,14 +47,14 @@ public: } }; -ScVbaCommandBarControls::ScVbaCommandBarControls( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess>& xIndexAccess, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess>& xBarSettings, const rtl::OUString& sResourceUrl ) throw (uno::RuntimeException) : CommandBarControls_BASE( xParent, xContext, xIndexAccess ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl ) +ScVbaCommandBarControls::ScVbaCommandBarControls( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess>& xIndexAccess, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess>& xBarSettings, const OUString& sResourceUrl ) throw (uno::RuntimeException) : CommandBarControls_BASE( xParent, xContext, xIndexAccess ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl ) { m_bIsMenu = sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) ? sal_True : sal_False; } -uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemData( const rtl::OUString& sCommandURL, - const rtl::OUString& sHelpURL, - const rtl::OUString& sLabel, +uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemData( const OUString& sCommandURL, + const OUString& sHelpURL, + const OUString& sLabel, sal_uInt16 nType, const uno::Any& aSubMenu, sal_Bool isVisible, @@ -62,41 +62,41 @@ uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemDat { uno::Sequence< beans::PropertyValue > aProps(7); - aProps[0].Name = rtl::OUString( ITEM_DESCRIPTOR_COMMANDURL ); + aProps[0].Name = ITEM_DESCRIPTOR_COMMANDURL; aProps[0].Value <<= sCommandURL; - aProps[1].Name = rtl::OUString( ITEM_DESCRIPTOR_HELPURL ); + aProps[1].Name = ITEM_DESCRIPTOR_HELPURL; aProps[1].Value <<= sHelpURL; - aProps[2].Name = rtl::OUString( ITEM_DESCRIPTOR_LABEL ); + aProps[2].Name = ITEM_DESCRIPTOR_LABEL; aProps[2].Value <<= sLabel; - aProps[3].Name = rtl::OUString( ITEM_DESCRIPTOR_TYPE ); + aProps[3].Name = ITEM_DESCRIPTOR_TYPE; aProps[3].Value <<= nType; - aProps[4].Name = rtl::OUString( ITEM_DESCRIPTOR_CONTAINER ); + aProps[4].Name = ITEM_DESCRIPTOR_CONTAINER; aProps[4].Value = aSubMenu; - aProps[5].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ISVISIBLE ); + aProps[5].Name = ITEM_DESCRIPTOR_ISVISIBLE; aProps[5].Value <<= isVisible; - aProps[6].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ENABLED ); + aProps[6].Name = ITEM_DESCRIPTOR_ENABLED; aProps[6].Value <<= isEnabled; return aProps; } -uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateToolbarItemData( const rtl::OUString& sCommandURL, const rtl::OUString& sHelpURL, const rtl::OUString& sLabel, sal_uInt16 nType, const uno::Any& aSubMenu, sal_Bool isVisible, sal_Int32 nStyle ) +uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateToolbarItemData( const OUString& sCommandURL, const OUString& sHelpURL, const OUString& sLabel, sal_uInt16 nType, const uno::Any& aSubMenu, sal_Bool isVisible, sal_Int32 nStyle ) { uno::Sequence< beans::PropertyValue > aProps(7); - aProps[0].Name = rtl::OUString( ITEM_DESCRIPTOR_COMMANDURL ); + aProps[0].Name = ITEM_DESCRIPTOR_COMMANDURL; aProps[0].Value <<= sCommandURL; - aProps[1].Name = rtl::OUString( ITEM_DESCRIPTOR_HELPURL ); + aProps[1].Name = ITEM_DESCRIPTOR_HELPURL; aProps[1].Value <<= sHelpURL; - aProps[2].Name = rtl::OUString( ITEM_DESCRIPTOR_LABEL ); + aProps[2].Name = ITEM_DESCRIPTOR_LABEL; aProps[2].Value <<= sLabel; - aProps[3].Name = rtl::OUString( ITEM_DESCRIPTOR_TYPE ); + aProps[3].Name = ITEM_DESCRIPTOR_TYPE; aProps[3].Value <<= nType; - aProps[4].Name = rtl::OUString( ITEM_DESCRIPTOR_CONTAINER ); + aProps[4].Name = ITEM_DESCRIPTOR_CONTAINER; aProps[4].Value = aSubMenu; - aProps[5].Name = rtl::OUString( ITEM_DESCRIPTOR_ISVISIBLE ); + aProps[5].Name = ITEM_DESCRIPTOR_ISVISIBLE; aProps[5].Value <<= isVisible; - aProps[6].Name = rtl::OUString( ITEM_DESCRIPTOR_STYLE ); + aProps[6].Name = ITEM_DESCRIPTOR_STYLE; aProps[6].Value <<= nStyle; return aProps; @@ -123,7 +123,7 @@ ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource ) uno::Sequence< beans::PropertyValue > aProps; m_xIndexAccess->getByIndex( nPosition ) >>= aProps; uno::Reference< container::XIndexAccess > xSubMenu; - getPropertyValue( aProps, rtl::OUString( ITEM_DESCRIPTOR_CONTAINER ) ) >>= xSubMenu; + getPropertyValue( aProps, ITEM_DESCRIPTOR_CONTAINER ) >>= xSubMenu; ScVbaCommandBarControl* pNewCommandBarControl = NULL; if( xSubMenu.is() ) pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, sal_True ); @@ -140,7 +140,7 @@ ScVbaCommandBarControls::Item( const uno::Any& aIndex, const uno::Any& /*aIndex* sal_Int32 nPosition = -1; if( aIndex.getValueTypeClass() == uno::TypeClass_STRING ) { - rtl::OUString sName; + OUString sName; aIndex >>= sName; nPosition = VbaCommandBarHelper::findControlByName( m_xIndexAccess, sName, m_bIsMenu ); } @@ -162,8 +162,8 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un { // Parameter is not supported // the following name needs to be individually created; - rtl::OUString sLabel("Custom"); - rtl::OUString sCommandUrl(rtl::OUString( CUSTOM_MENU_STR) + sLabel); + OUString sLabel("Custom"); + OUString sCommandUrl( CUSTOM_MENU_STR + sLabel); sal_Int32 nType = office::MsoControlType::msoControlButton; sal_Int32 nPosition = 0; sal_Bool bTemporary = sal_True; @@ -175,11 +175,11 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un if( nType != office::MsoControlType::msoControlButton && nType != office::MsoControlType::msoControlPopup ) - throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() ); if( Id.hasValue() || Parameter.hasValue( ) ) { - throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() ); } if( Before.hasValue() ) @@ -200,7 +200,7 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un // create control uno::Sequence< beans::PropertyValue > aProps; - rtl::OUString sHelpUrl; + OUString sHelpUrl; sal_uInt16 nItemType = 0; if( IsMenu() ) { @@ -229,20 +229,20 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un } // XHelperInterface -rtl::OUString +OUString ScVbaCommandBarControls::getServiceImplName() { - return rtl::OUString("ScVbaCommandBarControls"); + return OUString("ScVbaCommandBarControls"); } -uno::Sequence<rtl::OUString> +uno::Sequence<OUString> ScVbaCommandBarControls::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarControls" ); + aServiceNames[ 0 ] = "ooo.vba.CommandBarControls"; } return aServiceNames; } @@ -303,18 +303,18 @@ uno::Reference< XCommandBarControl > SAL_CALL VbaDummyCommandBarControls::Add( } // XHelperInterface -rtl::OUString VbaDummyCommandBarControls::getServiceImplName() +OUString VbaDummyCommandBarControls::getServiceImplName() { - return rtl::OUString("VbaDummyCommandBarControls"); + return OUString("VbaDummyCommandBarControls"); } -uno::Sequence<rtl::OUString> VbaDummyCommandBarControls::getServiceNames() +uno::Sequence<OUString> VbaDummyCommandBarControls::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarControls" ); + aServiceNames[ 0 ] = "ooo.vba.CommandBarControls"; } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx index b84a2653fa07..9ff92f991261 100644 --- a/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx +++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx @@ -32,20 +32,20 @@ class ScVbaCommandBarControls : public CommandBarControls_BASE private: VbaCommandBarHelperRef pCBarHelper; css::uno::Reference< css::container::XIndexAccess > m_xBarSettings; - rtl::OUString m_sResourceUrl; + OUString m_sResourceUrl; sal_Bool m_bIsMenu; - css::uno::Sequence< css::beans::PropertyValue > CreateMenuItemData( const rtl::OUString& sCommandURL, - const rtl::OUString& sHelpURL, - const rtl::OUString& sLabel, + css::uno::Sequence< css::beans::PropertyValue > CreateMenuItemData( const OUString& sCommandURL, + const OUString& sHelpURL, + const OUString& sLabel, sal_uInt16 nType, const css::uno::Any& aSubMenu, sal_Bool isVisible, sal_Bool isEnabled ); - css::uno::Sequence< css::beans::PropertyValue > CreateToolbarItemData( const rtl::OUString& sCommandURL, const rtl::OUString& sHelpURL, const rtl::OUString& sLabel, sal_uInt16 nType, const css::uno::Any& aSubMenu, sal_Bool isVisible, sal_Int32 nStyle ); + css::uno::Sequence< css::beans::PropertyValue > CreateToolbarItemData( const OUString& sCommandURL, const OUString& sHelpURL, const OUString& sLabel, sal_uInt16 nType, const css::uno::Any& aSubMenu, sal_Bool isVisible, sal_Int32 nStyle ); public: - ScVbaCommandBarControls( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl ) throw( css::uno::RuntimeException ); + ScVbaCommandBarControls( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl ) throw( css::uno::RuntimeException ); sal_Bool IsMenu(){ return m_bIsMenu; } // XEnumerationAccess @@ -57,8 +57,8 @@ public: virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::XCommandBarControl > SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& Id, const css::uno::Any& Parameter, const css::uno::Any& Before, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException); // XHelperInterface - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); }; class VbaDummyCommandBarControls : public CommandBarControls_BASE @@ -77,8 +77,8 @@ public: virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::XCommandBarControl > SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& Id, const css::uno::Any& Parameter, const css::uno::Any& Before, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException); // XHelperInterface - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); }; #endif//SC_VBA_COMMANDBARCONTROLS_HXX diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx index b29d01463041..9595def041dd 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx @@ -33,9 +33,7 @@ using namespace com::sun::star; using namespace ooo::vba; -#define CREATEOUSTRING(asciistr) rtl::OUString(asciistr) - -typedef std::map< rtl::OUString, rtl::OUString > MSO2OOCommandbarMap; +typedef std::map< OUString, OUString > MSO2OOCommandbarMap; class MSO2OOCommandbarHelper { @@ -46,17 +44,17 @@ private: MSO2OOCommandbarHelper() { // Buildin toolbars - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Standard"),CREATEOUSTRING("private:resource/toolbar/standardbar") ) ); - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Formatting"),CREATEOUSTRING("private:resource/toolbar/formatobjectbar") ) ); - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Drawing"),CREATEOUSTRING("private:resource/toolbar/drawbar") ) ); - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Toolbar List"),CREATEOUSTRING("private:resource/toolbar/toolbar") ) ); - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Forms"),CREATEOUSTRING("private:resource/toolbar/formcontrols") ) ); - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Form Controls"),CREATEOUSTRING("private:resource/toolbar/formcontrols") ) ); - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Full Screen"),CREATEOUSTRING("private:resource/toolbar/fullscreenbar") ) ); - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Chart"),CREATEOUSTRING("private:resource/toolbar/flowchartshapes") ) ); - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("Picture"),CREATEOUSTRING("private:resource/toolbar/graphicobjectbar") ) ); - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("WordArt"),CREATEOUSTRING("private:resource/toolbar/fontworkobjectbar") ) ); - maBuildinToolbarMap.insert( std::make_pair( CREATEOUSTRING("3-D Settings"),CREATEOUSTRING("private:resource/toolbar/extrusionobjectbar") ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("Standard") , OUString("private:resource/toolbar/standardbar" ) ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("Formatting"), OUString("private:resource/toolbar/formatobjectbar") ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("Drawing"), OUString("private:resource/toolbar/drawbar") ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("Toolbar List"), OUString("private:resource/toolbar/toolbar") ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("Forms"), OUString("private:resource/toolbar/formcontrols") ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("Form Controls"),OUString("private:resource/toolbar/formcontrols") ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("Full Screen"), OUString("private:resource/toolbar/fullscreenbar") ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("Chart"), OUString("private:resource/toolbar/flowchartshapes") ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("Picture"), OUString("private:resource/toolbar/graphicobjectbar") ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("WordArt"), OUString("private:resource/toolbar/fontworkobjectbar") ) ); + maBuildinToolbarMap.insert( std::make_pair( OUString("3-D Settings"), OUString("private:resource/toolbar/extrusionobjectbar") ) ); } public: @@ -70,16 +68,16 @@ public: return pMSO2OOCommandbarHelper; } - rtl::OUString findBuildinToolbar( const rtl::OUString& sToolbarName ) + OUString findBuildinToolbar( const OUString& sToolbarName ) { MSO2OOCommandbarMap::iterator it = maBuildinToolbarMap.begin(); for(; it != maBuildinToolbarMap.end(); ++it ) { - rtl::OUString sName = it->first; + OUString sName = it->first; if( sName.equalsIgnoreAsciiCase( sToolbarName ) ) return it->second; } - return rtl::OUString(); + return OUString(); } }; @@ -97,18 +95,18 @@ void VbaCommandBarHelper::Init( ) throw (css::uno::RuntimeException) m_xDocCfgMgr = xUICfgSupplier->getUIConfigurationManager(); uno::Reference< lang::XServiceInfo > xServiceInfo( mxModel, uno::UNO_QUERY_THROW ); - if( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.sheet.SpreadsheetDocument" ) ) ) + if( xServiceInfo->supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) ) { - maModuleId = rtl::OUString( "com.sun.star.sheet.SpreadsheetDocument" ); + maModuleId = "com.sun.star.sheet.SpreadsheetDocument"; } - else if( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.text.TextDocument" ) ) ) + else if( xServiceInfo->supportsService( "com.sun.star.text.TextDocument" ) ) { - maModuleId = rtl::OUString( "com.sun.star.text.TextDocument" ); + maModuleId = "com.sun.star.text.TextDocument"; } if( maModuleId.isEmpty() ) { - throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() ); } uno::Reference< lang::XMultiServiceFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); @@ -118,12 +116,12 @@ void VbaCommandBarHelper::Init( ) throw (css::uno::RuntimeException) m_xAppCfgMgr.set( xUICfgMgrSupp->getUIConfigurationManager( maModuleId ), uno::UNO_QUERY_THROW ); - css::uno::Reference< css::container::XNameAccess > xNameAccess( xServiceManager->createInstance( rtl::OUString( "com.sun.star.ui.WindowStateConfiguration" )), uno::UNO_QUERY_THROW ); + css::uno::Reference< css::container::XNameAccess > xNameAccess( xServiceManager->createInstance( "com.sun.star.ui.WindowStateConfiguration" ), uno::UNO_QUERY_THROW ); m_xWindowState.set( xNameAccess->getByName( maModuleId ), uno::UNO_QUERY_THROW ); } -css::uno::Reference< css::container::XIndexAccess > VbaCommandBarHelper::getSettings( const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException) +css::uno::Reference< css::container::XIndexAccess > VbaCommandBarHelper::getSettings( const OUString& sResourceUrl ) throw (css::uno::RuntimeException) { if( m_xDocCfgMgr->hasSettings( sResourceUrl ) ) return m_xDocCfgMgr->getSettings( sResourceUrl, sal_True ); @@ -136,7 +134,7 @@ css::uno::Reference< css::container::XIndexAccess > VbaCommandBarHelper::getSett } } -void VbaCommandBarHelper::removeSettings( const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException) +void VbaCommandBarHelper::removeSettings( const OUString& sResourceUrl ) throw (css::uno::RuntimeException) { if( m_xDocCfgMgr->hasSettings( sResourceUrl ) ) m_xDocCfgMgr->removeSettings( sResourceUrl ); @@ -146,7 +144,7 @@ void VbaCommandBarHelper::removeSettings( const rtl::OUString& sResourceUrl ) th // persistChanges(); } -void VbaCommandBarHelper::ApplyChange( const rtl::OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, sal_Bool bTemporary ) throw (css::uno::RuntimeException) +void VbaCommandBarHelper::ApplyChange( const OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, sal_Bool bTemporary ) throw (css::uno::RuntimeException) { if( m_xDocCfgMgr->hasSettings( sResourceUrl ) ) { @@ -178,17 +176,17 @@ uno::Reference< frame::XLayoutManager > VbaCommandBarHelper::getLayoutManager() { uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xPropertySet( xFrame, uno::UNO_QUERY_THROW ); - uno::Reference< frame::XLayoutManager > xLayoutManager( xPropertySet->getPropertyValue( rtl::OUString("LayoutManager") ), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XLayoutManager > xLayoutManager( xPropertySet->getPropertyValue( "LayoutManager" ), uno::UNO_QUERY_THROW ); return xLayoutManager; } -sal_Bool VbaCommandBarHelper::hasToolbar( const rtl::OUString& sResourceUrl, const rtl::OUString& sName ) throw (css::uno::RuntimeException) +sal_Bool VbaCommandBarHelper::hasToolbar( const OUString& sResourceUrl, const OUString& sName ) throw (css::uno::RuntimeException) { if( m_xDocCfgMgr->hasSettings( sResourceUrl ) ) { - rtl::OUString sUIName; + OUString sUIName; uno::Reference< beans::XPropertySet > xPropertySet( m_xDocCfgMgr->getSettings( sResourceUrl, sal_False ), uno::UNO_QUERY_THROW ); - xPropertySet->getPropertyValue( rtl::OUString(ITEM_DESCRIPTOR_UINAME) ) >>= sUIName; + xPropertySet->getPropertyValue( ITEM_DESCRIPTOR_UINAME ) >>= sUIName; if( sName.equalsIgnoreAsciiCase( sUIName ) ) return sal_True; } @@ -196,16 +194,16 @@ sal_Bool VbaCommandBarHelper::hasToolbar( const rtl::OUString& sResourceUrl, con } // return the resource url if found -rtl::OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException) +OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const OUString& sName ) throw (css::uno::RuntimeException) { - rtl::OUString sResourceUrl; + OUString sResourceUrl; // check if it is an buildin toolbar sResourceUrl = MSO2OOCommandbarHelper::getMSO2OOCommandbarHelper()->findBuildinToolbar( sName ); if( !sResourceUrl.isEmpty() ) return sResourceUrl; - uno::Sequence< ::rtl::OUString > allNames = xNameAccess->getElementNames(); + uno::Sequence< OUString > allNames = xNameAccess->getElementNames(); for( sal_Int32 i = 0; i < allNames.getLength(); i++ ) { sResourceUrl = allNames[i]; @@ -217,26 +215,26 @@ rtl::OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< } // the customize toolbars creating during importing, shoud found there. - static rtl::OUString sToolbarPrefix( "private:resource/toolbar/custom_" ); + static OUString sToolbarPrefix( "private:resource/toolbar/custom_" ); sResourceUrl = sToolbarPrefix.concat( sName ); if( hasToolbar( sResourceUrl, sName ) ) return sResourceUrl; - return rtl::OUString(); + return OUString(); } // if found, return the position of the control. if not found, return -1 -sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const rtl::OUString& sName, bool bMenu ) throw (css::uno::RuntimeException) +sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const OUString& sName, bool bMenu ) throw (css::uno::RuntimeException) { sal_Int32 nCount = xIndexAccess->getCount(); css::uno::Sequence< css::beans::PropertyValue > aProps; for( sal_Int32 i = 0; i < nCount; i++ ) { - rtl::OUString sLabel; + OUString sLabel; xIndexAccess->getByIndex( i ) >>= aProps; - getPropertyValue( aProps, rtl::OUString(ITEM_DESCRIPTOR_LABEL) ) >>= sLabel; + getPropertyValue( aProps, ITEM_DESCRIPTOR_LABEL ) >>= sLabel; // handle the hotkey marker '~' (remove in toolbars (?), replace by '&' in menus) - ::rtl::OUStringBuffer aBuffer; + OUStringBuffer aBuffer; sal_Int32 index = sLabel.indexOf( sal_Unicode('~') ); if( index < 0 ) { @@ -249,8 +247,8 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css aBuffer.append( sal_Unicode( '&' ) ); aBuffer.append( sLabel.copy( index + 1 ) ); } - rtl::OUString sNewLabel = aBuffer.makeStringAndClear(); - OSL_TRACE("VbaCommandBarHelper::findControlByName, control name: %s", rtl::OUStringToOString( sNewLabel, RTL_TEXTENCODING_UTF8 ).getStr() ); + OUString sNewLabel = aBuffer.makeStringAndClear(); + OSL_TRACE("VbaCommandBarHelper::findControlByName, control name: %s", OUStringToOString( sNewLabel, RTL_TEXTENCODING_UTF8 ).getStr() ); if( sName.equalsIgnoreAsciiCase( sNewLabel ) ) return i; } @@ -259,14 +257,14 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css return -1; } -rtl::OUString VbaCommandBarHelper::generateCustomURL() +OUString VbaCommandBarHelper::generateCustomURL() { - rtl::OUString url( ITEM_TOOLBAR_URL ); - url += rtl::OUString( CUSTOM_TOOLBAR_STR ); + OUString url( ITEM_TOOLBAR_URL ); + url += CUSTOM_TOOLBAR_STR; // use a random number to minimize possible clash with existing custom toolbars srand( unsigned( time( NULL ) )); - url += rtl::OUString::valueOf( sal_Int64( rand() ), 16 ); + url += OUString::valueOf( sal_Int64( rand() ), 16 ); return url; } diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx index ca06464d9137..bd47c696d084 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx @@ -57,10 +57,10 @@ private: css::uno::Reference< css::ui::XUIConfigurationManager > m_xDocCfgMgr; // current document css::uno::Reference< css::ui::XUIConfigurationManager > m_xAppCfgMgr; css::uno::Reference< css::container::XNameAccess > m_xWindowState; - rtl::OUString maModuleId; + OUString maModuleId; void Init() throw (css::uno::RuntimeException); - sal_Bool hasToolbar( const rtl::OUString& sResourceUrl, const rtl::OUString& sName ) throw (css::uno::RuntimeException); + sal_Bool hasToolbar( const OUString& sResourceUrl, const OUString& sName ) throw (css::uno::RuntimeException); public: VbaCommandBarHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ) throw( css::uno::RuntimeException ); @@ -79,16 +79,16 @@ public: return m_xWindowState; } sal_Bool persistChanges() throw (css::uno::RuntimeException); - css::uno::Reference< css::container::XIndexAccess > getSettings( const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException); - void removeSettings( const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException); - void ApplyChange( const rtl::OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, sal_Bool bTemporary = sal_True ) throw (css::uno::RuntimeException); + css::uno::Reference< css::container::XIndexAccess > getSettings( const OUString& sResourceUrl ) throw (css::uno::RuntimeException); + void removeSettings( const OUString& sResourceUrl ) throw (css::uno::RuntimeException); + void ApplyChange( const OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, sal_Bool bTemporary = sal_True ) throw (css::uno::RuntimeException); css::uno::Reference< css::frame::XLayoutManager > getLayoutManager() throw (css::uno::RuntimeException); - const rtl::OUString getModuleId() const { return maModuleId; } - rtl::OUString findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException); - static sal_Int32 findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const rtl::OUString& sName, bool bMenu = false ) throw (css::uno::RuntimeException); - static rtl::OUString generateCustomURL(); + const OUString getModuleId() const { return maModuleId; } + OUString findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const OUString& sName ) throw (css::uno::RuntimeException); + static sal_Int32 findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const OUString& sName, bool bMenu = false ) throw (css::uno::RuntimeException); + static OUString generateCustomURL(); }; #endif //VBA_COMMANDBARHELPER_HXX diff --git a/vbahelper/source/vbahelper/vbacommandbars.hxx b/vbahelper/source/vbahelper/vbacommandbars.hxx index 20adb1af0bb1..1616af328ae1 100644 --- a/vbahelper/source/vbahelper/vbacommandbars.hxx +++ b/vbahelper/source/vbahelper/vbacommandbars.hxx @@ -48,8 +48,8 @@ public: virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Item( const css::uno::Any& aIndex, const css::uno::Any& /*aIndex2*/ ) throw( css::uno::RuntimeException); // XHelperInterface - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); }; #endif//SC_VBA_COMMANDBARS_HXX diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index 91eb8885331d..dee89256be3e 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -57,9 +57,9 @@ using namespace ::com::sun::star; static const char aSpreadsheetDocument[] = "com.sun.star.sheet.SpreadsheetDocument"; static const char aTextDocument[] = "com.sun.star.text.TextDocument"; -typedef boost::unordered_map< rtl::OUString, -sal_Int32, ::rtl::OUStringHash, -::std::equal_to< ::rtl::OUString > > NameIndexHash; +typedef boost::unordered_map< OUString, +sal_Int32, OUStringHash, +::std::equal_to< OUString > > NameIndexHash; typedef std::vector < uno::Reference< frame::XModel > > Documents; @@ -85,7 +85,7 @@ public: m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< frame::XDesktop > xDesktop - (xSMgr->createInstanceWithContext(::rtl::OUString("com.sun.star.frame.Desktop"), m_xContext), uno::UNO_QUERY_THROW ); + (xSMgr->createInstanceWithContext( "com.sun.star.frame.Desktop" , m_xContext), uno::UNO_QUERY_THROW ); uno::Reference< container::XEnumeration > mxComponents = xDesktop->getComponents()->createEnumeration(); while( mxComponents->hasMoreElements() ) { @@ -137,12 +137,12 @@ public: { uno::Reference< lang::XServiceInfo > xServiceInfo( xEnum->nextElement(), uno::UNO_QUERY ); if ( xServiceInfo.is() - && ( ( xServiceInfo->supportsService( rtl::OUString(aSpreadsheetDocument) ) && meDocType == VbaDocumentsBase::EXCEL_DOCUMENT ) - || ( xServiceInfo->supportsService( rtl::OUString(aTextDocument) ) && meDocType == VbaDocumentsBase::WORD_DOCUMENT ) ) ) + && ( ( xServiceInfo->supportsService( OUString(aSpreadsheetDocument) ) && meDocType == VbaDocumentsBase::EXCEL_DOCUMENT ) + || ( xServiceInfo->supportsService( OUString(aTextDocument) ) && meDocType == VbaDocumentsBase::WORD_DOCUMENT ) ) ) { uno::Reference< frame::XModel > xModel( xServiceInfo, uno::UNO_QUERY_THROW ); // that the spreadsheetdocument is a xmodel is a given m_documents.push_back( xModel ); - rtl::OUString sName; + OUString sName; uno::Reference< ::ooo::vba::XDocumentBase > xVbaDocument = new VbaDocumentBase( uno::Reference< XHelperInterface >(), xContext, xModel ); if ( xVbaDocument.is() ) { @@ -184,7 +184,7 @@ public: } //XNameAccess - virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + virtual uno::Any SAL_CALL getByName( const OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { NameIndexHash::const_iterator it = namesToIndices.find( aName ); if ( it == namesToIndices.end() ) @@ -193,10 +193,10 @@ public: } - virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) + virtual uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) { - uno::Sequence< ::rtl::OUString > names( namesToIndices.size() ); - ::rtl::OUString* pString = names.getArray(); + uno::Sequence< OUString > names( namesToIndices.size() ); + OUString* pString = names.getArray(); NameIndexHash::const_iterator it = namesToIndices.begin(); NameIndexHash::const_iterator it_end = namesToIndices.end(); for ( ; it != it_end; ++it, ++pString ) @@ -204,7 +204,7 @@ public: return names; } - virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) + virtual ::sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (uno::RuntimeException) { NameIndexHash::const_iterator it = namesToIndices.find( aName ); return (it != namesToIndices.end()); @@ -253,26 +253,23 @@ uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException) mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< frame::XComponentLoader > xLoader( - xSMgr->createInstanceWithContext( - ::rtl::OUString("com.sun.star.frame.Desktop"), - mxContext), uno::UNO_QUERY_THROW ); - rtl::OUString sURL; + xSMgr->createInstanceWithContext("com.sun.star.frame.Desktop" , mxContext), uno::UNO_QUERY_THROW ); + OUString sURL; if( meDocType == WORD_DOCUMENT ) - sURL = rtl::OUString( "private:factory/swriter" ); + sURL = "private:factory/swriter"; else if( meDocType == EXCEL_DOCUMENT ) - sURL = rtl::OUString( "private:factory/scalc" ); + sURL = "private:factory/scalc"; else - throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() ); // prepare the media descriptor ::comphelper::MediaDescriptor aMediaDesc; aMediaDesc[ ::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE() ] <<= document::MacroExecMode::USE_CONFIG; - aMediaDesc.setComponentDataEntry( ::rtl::OUString( "ApplyFormDesignMode" ), uno::Any( false ) ); + aMediaDesc.setComponentDataEntry( "ApplyFormDesignMode" , uno::Any( false ) ); - // craete the new document + // create the new document uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( - sURL , - rtl::OUString( "_blank" ), 0, + sURL , "_blank", 0, aMediaDesc.getAsConstPropertyValueList() ); // #163808# lock document controllers and container window if specified by application @@ -295,7 +292,7 @@ void VbaDocumentsBase::closeDocuments() throw (uno::RuntimeException) } // #TODO# #FIXME# can any of the unused params below be used? -uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (uno::RuntimeException) +uno::Any VbaDocumentsBase::openDocument( const OUString& rFileName, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (uno::RuntimeException) { // #163808# determine state of Application.ScreenUpdating and Application.Interactive symbols (before new document is opened) uno::Reference< XApplicationBase > xApplication( Application(), uno::UNO_QUERY ); @@ -303,7 +300,7 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u sal_Bool bInteractive = !xApplication.is() || xApplication->getInteractive(); // we need to detect if this is a URL, if not then assume its a file path - rtl::OUString aURL; + OUString aURL; INetURLObject aObj; aObj.SetURL( rFileName ); bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; @@ -313,18 +310,13 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u osl::FileBase::getFileURLFromSystemPath( rFileName, aURL ); uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XDesktop > xDesktop - (xSMgr->createInstanceWithContext(::rtl::OUString("com.sun.star.frame.Desktop") , mxContext), - uno::UNO_QUERY_THROW ); + uno::Reference< frame::XDesktop > xDesktop(xSMgr->createInstanceWithContext( "com.sun.star.frame.Desktop" , mxContext), uno::UNO_QUERY_THROW ); uno::Reference< frame::XComponentLoader > xLoader( - xSMgr->createInstanceWithContext( - ::rtl::OUString("com.sun.star.frame.Desktop"), - mxContext), - uno::UNO_QUERY_THROW ); + xSMgr->createInstanceWithContext( "com.sun.star.frame.Desktop" , mxContext), uno::UNO_QUERY_THROW ); uno::Sequence< beans::PropertyValue > sProps( rProps ); sProps.realloc( sProps.getLength() + 1 ); - sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( "MacroExecutionMode" ); + sProps[ sProps.getLength() - 1 ].Name = "MacroExecutionMode"; sProps[ sProps.getLength() - 1 ].Value <<= document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN; if ( ReadOnly.hasValue() ) @@ -333,13 +325,13 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u if ( bIsReadOnly ) { sProps.realloc( sProps.getLength() + 1 ); - sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( "ReadOnly" ); + sProps[ sProps.getLength() - 1 ].Name = "ReadOnly"; sProps[ sProps.getLength() - 1 ].Value <<= true; } } uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( aURL, - rtl::OUString( "_default" ), + "_default" , frame::FrameSearchFlag::CREATE, sProps); diff --git a/vbahelper/source/vbahelper/vbafillformat.cxx b/vbahelper/source/vbahelper/vbafillformat.cxx index 01dfd855406e..3142709f2e4e 100644 --- a/vbahelper/source/vbahelper/vbafillformat.cxx +++ b/vbahelper/source/vbahelper/vbafillformat.cxx @@ -41,7 +41,7 @@ ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::Runti m_nFillStyle = nFillStyle; if( m_nFillStyle == drawing::FillStyle_GRADIENT ) { - m_xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny( drawing::FillStyle_GRADIENT ) ); + m_xPropertySet->setPropertyValue( "FillStyle" , uno::makeAny( drawing::FillStyle_GRADIENT ) ); awt::Gradient aGradient; // AXIAL // RADIAL @@ -58,11 +58,11 @@ ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::Runti aGradient.StartIntensity = 100; aGradient.EndIntensity = 100; aGradient.StepCount = 1; - m_xPropertySet->setPropertyValue( rtl::OUString("FillGradient"), uno::makeAny( aGradient ) ); + m_xPropertySet->setPropertyValue( "FillGradient" , uno::makeAny( aGradient ) ); } else if( m_nFillStyle == drawing::FillStyle_SOLID ) { - m_xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny(drawing::FillStyle_SOLID) ); + m_xPropertySet->setPropertyValue( "FillStyle" , uno::makeAny(drawing::FillStyle_SOLID) ); } } @@ -78,7 +78,7 @@ sal_Bool SAL_CALL ScVbaFillFormat::getVisible() throw (uno::RuntimeException) { drawing::FillStyle nFillStyle; - m_xPropertySet->getPropertyValue( rtl::OUString("FillStyle") ) >>= nFillStyle; + m_xPropertySet->getPropertyValue( "FillStyle" ) >>= nFillStyle; if( nFillStyle == drawing::FillStyle_NONE ) return sal_False; return sal_True; @@ -88,10 +88,10 @@ void SAL_CALL ScVbaFillFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException) { drawing::FillStyle aFillStyle; - m_xPropertySet->getPropertyValue( rtl::OUString("FillStyle") ) >>= aFillStyle; + m_xPropertySet->getPropertyValue( "FillStyle" ) >>= aFillStyle; if( !_visible ) { - m_xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny( drawing::FillStyle_NONE ) ); + m_xPropertySet->setPropertyValue( "FillStyle" , uno::makeAny( drawing::FillStyle_NONE ) ); } else { @@ -107,7 +107,7 @@ ScVbaFillFormat::getTransparency() throw (uno::RuntimeException) { sal_Int16 nTransparence = 0; double dTransparence = 0; - m_xPropertySet->getPropertyValue( rtl::OUString("FillTransparence") ) >>= nTransparence; + m_xPropertySet->getPropertyValue( "FillTransparence" ) >>= nTransparence; dTransparence = static_cast<double>( nTransparence ); dTransparence /= 100; return dTransparence; @@ -117,7 +117,7 @@ void SAL_CALL ScVbaFillFormat::setTransparency( double _transparency ) throw (uno::RuntimeException) { sal_Int16 nTransparence = static_cast< sal_Int16 >( _transparency * 100 ); - m_xPropertySet->setPropertyValue( rtl::OUString("FillTransparence"), uno::makeAny( nTransparence ) ); + m_xPropertySet->setPropertyValue( "FillTransparence" , uno::makeAny( nTransparence ) ); } @@ -169,20 +169,20 @@ ScVbaFillFormat::ForeColor() throw (uno::RuntimeException) return m_xColorFormat; } -rtl::OUString +OUString ScVbaFillFormat::getServiceImplName() { - return rtl::OUString("ScVbaFillFormat"); + return OUString("ScVbaFillFormat"); } -uno::Sequence< rtl::OUString > +uno::Sequence< OUString > ScVbaFillFormat::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msforms.FillFormat" ); + aServiceNames[ 0 ] = "ooo.vba.msforms.FillFormat"; } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbafillformat.hxx b/vbahelper/source/vbahelper/vbafillformat.hxx index 37aa6e4da82e..9bd0ffb7547e 100644 --- a/vbahelper/source/vbahelper/vbafillformat.hxx +++ b/vbahelper/source/vbahelper/vbafillformat.hxx @@ -39,8 +39,8 @@ private: private: void setFillStyle( css::drawing::FillStyle nFillStyle ) throw (css::uno::RuntimeException); protected: - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); public: ScVbaFillFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape ); diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx index b5327c13811a..28f755dc1300 100644 --- a/vbahelper/source/vbahelper/vbaglobalbase.cxx +++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx @@ -36,7 +36,7 @@ const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const OUString& sDocCtxName ) : Globals_BASE( xParent, xContext ) , msDocCtxName( sDocCtxName ) - , msApplication( RTL_CONSTASCII_USTRINGPARAM("Application") ) + , msApplication( "Application" ) { // overwrite context with custom one ( that contains the application ) // wrap the service manager as we don't want the disposing context to tear down the 'normal' ServiceManager ( or at least thats what the code appears like it wants to do ) diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 748a4c067344..301cd76f02cd 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -111,7 +111,7 @@ getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException) if( !xIntrospection.is() ) { uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - xIntrospection.set( xFactory->createInstance( rtl::OUString("com.sun.star.beans.Introspection") ), uno::UNO_QUERY_THROW ); + xIntrospection.set( xFactory->createInstance( "com.sun.star.beans.Introspection" ), uno::UNO_QUERY_THROW ); } return xIntrospection->inspect( aObject ); } @@ -145,18 +145,18 @@ void dispatchExecute(SfxViewShell* pViewShell, sal_uInt16 nSlot, SfxCallMode nCa } void -dispatchRequests (const uno::Reference< frame::XModel>& xModel, const rtl::OUString & aUrl, const uno::Sequence< beans::PropertyValue >& sProps ) +dispatchRequests (const uno::Reference< frame::XModel>& xModel, const OUString & aUrl, const uno::Sequence< beans::PropertyValue >& sProps ) { util::URL url; url.Complete = aUrl; - rtl::OUString emptyString = rtl::OUString( "" ); + OUString emptyString( "" ); uno::Reference<frame::XController> xController = xModel->getCurrentController(); uno::Reference<frame::XFrame> xFrame = xController->getFrame(); uno::Reference<frame::XDispatchProvider> xDispatchProvider (xFrame,uno::UNO_QUERY_THROW); try { uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - uno::Reference<uno::XComponentContext > xContext( xProps->getPropertyValue( rtl::OUString( "DefaultContext" )), uno::UNO_QUERY_THROW ); + uno::Reference<uno::XComponentContext > xContext( xProps->getPropertyValue( "DefaultContext" ), uno::UNO_QUERY_THROW ); if ( !xContext.is() ) return; @@ -195,14 +195,14 @@ dispatchRequests (const uno::Reference< frame::XModel>& xModel, const rtl::OUStr } void -dispatchRequests( const uno::Reference< frame::XModel>& xModel, const rtl::OUString& aUrl ) +dispatchRequests( const uno::Reference< frame::XModel>& xModel, const OUString& aUrl ) { uno::Sequence<beans::PropertyValue> dispatchProps; dispatchRequests( xModel, aUrl, dispatchProps ); } uno::Reference< frame::XModel > -getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException) +getCurrentDoc( const OUString& sKey ) throw (uno::RuntimeException) { uno::Reference< frame::XModel > xModel; SbxObject* pBasic = dynamic_cast< SbxObject* > ( SFX_APP()->GetBasic() ); @@ -236,27 +236,27 @@ getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException) !xModel.is() ) { throw uno::RuntimeException( - rtl::OUString( "Can't extract model from basic ( it's obviously not set yet therefore don't know the current document context)"), uno::Reference< uno::XInterface >() ); + "Can't extract model from basic ( it's obviously not set yet therefore don't know the current document context)" , uno::Reference< uno::XInterface >() ); } else { OSL_TRACE("Have model points to url %s", - ::rtl::OUStringToOString( xModel->getURL(), + OUStringToOString( xModel->getURL(), RTL_TEXTENCODING_ASCII_US ).pData->buffer ); } } else { - OSL_TRACE("Failed to get %s", rtl::OUStringToOString( sKey, RTL_TEXTENCODING_UTF8 ).getStr() ); + OSL_TRACE("Failed to get %s", OUStringToOString( sKey, RTL_TEXTENCODING_UTF8 ).getStr() ); throw uno::RuntimeException( - rtl::OUString( "Can't determine the currently selected document" ), + "Can't determine the currently selected document" , uno::Reference< uno::XInterface >() ); } return xModel; } uno::Reference< frame::XModel > -getCurrentDocCtx( const rtl::OUString& ctxName, const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) +getCurrentDocCtx( const OUString& ctxName, const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { uno::Reference< frame::XModel > xModel; // try fallback to calling doc @@ -268,19 +268,19 @@ getCurrentDocCtx( const rtl::OUString& ctxName, const uno::Reference< uno::XComp uno::Reference< frame::XModel > getThisExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - return getCurrentDocCtx( rtl::OUString( "ExcelDocumentContext" ), xContext ); + return getCurrentDocCtx( "ExcelDocumentContext" , xContext ); } uno::Reference< frame::XModel > getThisWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - return getCurrentDocCtx( rtl::OUString( "WordDocumentContext" ), xContext ); + return getCurrentDocCtx( "WordDocumentContext" , xContext ); } uno::Reference< frame::XModel > getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - static const rtl::OUString sThisExcelDoc( "ThisExcelDoc" ); + static const OUString sThisExcelDoc( "ThisExcelDoc" ); uno::Reference< frame::XModel > xModel; try { @@ -296,7 +296,7 @@ getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) t uno::Reference< frame::XModel > getCurrentWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - static const rtl::OUString sThisWordDoc( "ThisWordDoc" ); + static const OUString sThisWordDoc( "ThisWordDoc" ); uno::Reference< frame::XModel > xModel; try { @@ -374,15 +374,15 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno:: if ( nCopies > 1 ) // Collate only useful when more that 1 copy Collate >>= bCollate; - rtl::OUString sRange( "-" ); - rtl::OUString sFileName; + OUString sRange( "-" ); + OUString sFileName; if (( nFrom || nTo ) ) { if ( nFrom ) - sRange = ( ::rtl::OUString::valueOf( nFrom ) + sRange ); + sRange = ( OUString::valueOf( nFrom ) + sRange ); if ( nTo ) - sRange += ::rtl::OUString::valueOf( nTo ); + sRange += OUString::valueOf( nTo ); } if ( PrToFileName.getValue() ) @@ -485,56 +485,56 @@ bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException) return rAny.get< sal_Int64 >() != 0; default:; } - throw uno::RuntimeException( ::rtl::OUString( "Invalid type, cannot convert to boolean." ), 0 ); + throw uno::RuntimeException( "Invalid type, cannot convert to boolean." , 0 ); } -::rtl::OUString extractStringFromAny( const uno::Any& rAny, bool bUppercaseBool ) throw (uno::RuntimeException) +OUString extractStringFromAny( const uno::Any& rAny, bool bUppercaseBool ) throw (uno::RuntimeException) { switch( rAny.getValueType().getTypeClass() ) { case uno::TypeClass_STRING: - return rAny.get< ::rtl::OUString >(); + return rAny.get< OUString >(); case uno::TypeClass_BOOLEAN: return bUppercaseBool ? - (rAny.get< bool >() ? ::rtl::OUString( "TRUE" ) : ::rtl::OUString( "FALSE" )) : - ::rtl::OUString::valueOf( (sal_Bool)rAny.get< bool >() ); + (rAny.get< bool >() ? OUString( "TRUE" ) : OUString( "FALSE" )) : + OUString::valueOf( (sal_Bool)rAny.get< bool >() ); case uno::TypeClass_FLOAT: - return ::rtl::OUString::valueOf( rAny.get< float >() ); + return OUString::valueOf( rAny.get< float >() ); case uno::TypeClass_DOUBLE: - return ::rtl::OUString::valueOf( rAny.get< double >() ); + return OUString::valueOf( rAny.get< double >() ); case uno::TypeClass_BYTE: case uno::TypeClass_SHORT: case uno::TypeClass_LONG: - return ::rtl::OUString::valueOf( rAny.get< sal_Int32 >() ); + return OUString::valueOf( rAny.get< sal_Int32 >() ); case uno::TypeClass_HYPER: - return ::rtl::OUString::valueOf( rAny.get< sal_Int64 >() ); + return OUString::valueOf( rAny.get< sal_Int64 >() ); default:; } - throw uno::RuntimeException( ::rtl::OUString( "Invalid type, cannot convert to string." ), 0 ); + throw uno::RuntimeException( "Invalid type, cannot convert to string." , 0 ); } -::rtl::OUString extractStringFromAny( const uno::Any& rAny, const ::rtl::OUString& rDefault, bool bUppercaseBool ) throw (uno::RuntimeException) +OUString extractStringFromAny( const uno::Any& rAny, const OUString& rDefault, bool bUppercaseBool ) throw (uno::RuntimeException) { return rAny.hasValue() ? extractStringFromAny( rAny, bUppercaseBool ) : rDefault; } -rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException ) +OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException ) { return extractStringFromAny( pvargItem ); } -rtl::OUString -ContainerUtilities::getUniqueName( const uno::Sequence< ::rtl::OUString >& _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator) +OUString +ContainerUtilities::getUniqueName( const uno::Sequence< OUString >& _slist, const OUString& _sElementName, const OUString& _sSuffixSeparator) { return getUniqueName(_slist, _sElementName, _sSuffixSeparator, sal_Int32(2)); } -rtl::OUString -ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix) +OUString +ContainerUtilities::getUniqueName( const uno::Sequence< OUString >& _slist, const OUString _sElementName, const OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix) { sal_Int32 a = _nStartSuffix; - rtl::OUString scompname = _sElementName; + OUString scompname = _sElementName; bool bElementexists = true; sal_Int32 nLen = _slist.getLength(); if ( nLen == 0 ) @@ -549,13 +549,13 @@ ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, return scompname; } } - scompname = _sElementName + _sSuffixSeparator + rtl::OUString::valueOf( a++ ); + scompname = _sElementName + _sSuffixSeparator + OUString::valueOf( a++ ); } - return rtl::OUString(); + return OUString(); } sal_Int32 -ContainerUtilities::FieldInList( const uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString ) +ContainerUtilities::FieldInList( const uno::Sequence< OUString >& SearchList, const OUString& SearchString ) { sal_Int32 FieldLen = SearchList.getLength(); sal_Int32 retvalue = -1; @@ -579,9 +579,9 @@ bool NeedEsc(sal_Unicode cCode) return (STRING_NOTFOUND != sEsc.Search(cCode)); } -rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike ) +OUString VBAToRegexp(const OUString &rIn, bool bForLike ) { - rtl::OUStringBuffer sResult; + OUStringBuffer sResult; const sal_Unicode *start = rIn.getStr(); const sal_Unicode *end = start + rIn.getLength(); @@ -598,11 +598,11 @@ rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike ) start++; break; case '*': - sResult.append(rtl::OUString(".*")); + sResult.append(".*"); start++; break; case '#': - sResult.append(rtl::OUString("[0-9]")); + sResult.append("[0-9]"); start++; break; case '~': @@ -799,7 +799,7 @@ uno::Any getDefaultPropByIntrospection( const uno::Any& aObj ) throw ( uno::Runt return aValue; } -uno::Any getPropertyValue( const uno::Sequence< beans::PropertyValue >& aProp, const rtl::OUString& aName ) +uno::Any getPropertyValue( const uno::Sequence< beans::PropertyValue >& aProp, const OUString& aName ) { uno::Any result; for ( sal_Int32 i = 0; i < aProp.getLength(); i++ ) @@ -813,7 +813,7 @@ uno::Any getPropertyValue( const uno::Sequence< beans::PropertyValue >& aProp, c return result; } -sal_Bool setPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, const rtl::OUString& aName, const uno::Any& aValue ) +sal_Bool setPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, const OUString& aName, const uno::Any& aValue ) { for ( sal_Int32 i = 0; i < aProp.getLength(); i++ ) { @@ -826,7 +826,7 @@ sal_Bool setPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, const r return sal_False; } -void setOrAppendPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, const rtl::OUString& aName, const uno::Any& aValue ) +void setOrAppendPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, const OUString& aName, const uno::Any& aValue ) { if( setPropertyValue( aProp, aName, aValue ) ) return; @@ -849,8 +849,7 @@ UserFormGeometryHelper::UserFormGeometryHelper( mbDialog( uno::Reference< awt::XDialog >( xControl, uno::UNO_QUERY ).is() ) { if ( !xControl.is() ) - throw uno::RuntimeException( ::rtl::OUString( "No control is provided!" ), - uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "No control is provided!", uno::Reference< uno::XInterface >() ); mxWindow.set( xControl->getPeer(), uno::UNO_QUERY_THROW ); mxModelProps.set( xControl->getModel(), uno::UNO_QUERY_THROW ); @@ -936,7 +935,7 @@ static const char saHeightName[] = "Height"; double UserFormGeometryHelper::implGetPos( bool bPosY ) const { - sal_Int32 nPosAppFont = mxModelProps->getPropertyValue( bPosY ? rtl::OUString(saPosYName) : rtl::OUString(saPosXName) ).get< sal_Int32 >(); + sal_Int32 nPosAppFont = mxModelProps->getPropertyValue( bPosY ? OUString(saPosYName) : OUString(saPosXName) ).get< sal_Int32 >(); // appfont to pixel awt::Point aPosPixel = mxUnitConv->convertPointToPixel( awt::Point( nPosAppFont, nPosAppFont ), util::MeasureUnit::APPFONT ); // pixel to VBA points @@ -951,12 +950,12 @@ void UserFormGeometryHelper::implSetPos( double fPos, bool bPosY ) awt::Point aPosPixel = mxUnitConv->convertPointToPixel( awt::Point( nPosPixel, nPosPixel ), util::MeasureUnit::POINT ); // pixel to appfont awt::Point aPosAppFont = mxUnitConv->convertPointToLogic( aPosPixel, util::MeasureUnit::APPFONT ); - mxModelProps->setPropertyValue( bPosY ? rtl::OUString(saPosYName) : rtl::OUString(saPosXName), uno::Any( bPosY ? aPosAppFont.Y : aPosAppFont.X ) ); + mxModelProps->setPropertyValue( bPosY ? OUString(saPosYName) : OUString(saPosXName), uno::Any( bPosY ? aPosAppFont.Y : aPosAppFont.X ) ); } double UserFormGeometryHelper::implGetSize( bool bHeight, bool bOuter ) const { - sal_Int32 nSizeAppFont = mxModelProps->getPropertyValue( bHeight ? rtl::OUString(saHeightName) : rtl::OUString(saWidthName) ).get< sal_Int32 >(); + sal_Int32 nSizeAppFont = mxModelProps->getPropertyValue( bHeight ? OUString(saHeightName) : OUString(saWidthName) ).get< sal_Int32 >(); // appfont to pixel awt::Size aSizePixel = mxUnitConv->convertSizeToPixel( awt::Size( nSizeAppFont, nSizeAppFont ), util::MeasureUnit::APPFONT ); @@ -1004,7 +1003,7 @@ void UserFormGeometryHelper::implSetSize( double fSize, bool bHeight, bool bOute } awt::Size aSizeAppFont = mxUnitConv->convertSizeToLogic( aSizePixel, util::MeasureUnit::APPFONT ); - mxModelProps->setPropertyValue( bHeight ? rtl::OUString(saHeightName) : rtl::OUString(saWidthName), uno::Any( bHeight ? aSizeAppFont.Height : aSizeAppFont.Width ) ); + mxModelProps->setPropertyValue( bHeight ? OUString(saHeightName) : OUString(saWidthName), uno::Any( bHeight ? aSizeAppFont.Height : aSizeAppFont.Width ) ); } // ============================================================================ @@ -1047,7 +1046,7 @@ void ConcreteXShapeGeometryAttributes::setWidth( double nWidth) ShapeHelper::ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException ) : xShape( _xShape ) { if( !xShape.is() ) - throw css::uno::RuntimeException( rtl::OUString("No valid shape for helper"), css::uno::Reference< css::uno::XInterface >() ); + throw css::uno::RuntimeException( "No valid shape for helper" , css::uno::Reference< css::uno::XInterface >() ); } double ShapeHelper::getHeight() const @@ -1066,7 +1065,7 @@ double ShapeHelper::getHeight() const } catch (const css::uno::Exception&) { - throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); + throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, OUString() ); } } double ShapeHelper::getWidth() const @@ -1084,7 +1083,7 @@ void ShapeHelper::setWidth(double _fWidth) throw ( css::script::BasicErrorExcept } catch (const css::uno::Exception&) { - throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); + throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, OUString() ); } } @@ -1116,19 +1115,19 @@ void ShapeHelper::setTop(double _fTop) xShape->setPosition(aPoint); } -void DebugHelper::exception( const rtl::OUString& DetailedMessage, const css::uno::Exception& ex, int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException ) +void DebugHelper::exception( const OUString& DetailedMessage, const css::uno::Exception& ex, int err, const OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException ) { // #TODO #FIXME ( do we want to support additionalArg here ) - throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString(" ") ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() ); + throw css::script::BasicErrorException( DetailedMessage.concat( " " ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, OUString() ); } -void DebugHelper::exception( int err, const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException ) +void DebugHelper::exception( int err, const OUString& additionalArgument ) throw( css::script::BasicErrorException ) { - exception( rtl::OUString(), css::uno::Exception(), err, additionalArgument ); + exception( OUString(), css::uno::Exception(), err, additionalArgument ); } void DebugHelper::exception( const css::uno::Exception& ex ) throw( css::script::BasicErrorException ) { - exception( rtl::OUString(), ex, SbERR_INTERNAL_ERROR, rtl::OUString() ); + exception( OUString(), ex, SbERR_INTERNAL_ERROR, OUString() ); } Millimeter::Millimeter():m_nMillimeter(0) {} @@ -1163,8 +1162,8 @@ uno::Reference< XHelperInterface > getVBADocument( const uno::Reference< frame:: try { uno::Reference< beans::XPropertySet > xDocProps( xModel, uno::UNO_QUERY_THROW ); - ::rtl::OUString aCodeName; - xDocProps->getPropertyValue( ::rtl::OUString( "CodeName" ) ) >>= aCodeName; + OUString aCodeName; + xDocProps->getPropertyValue( "CodeName" ) >>= aCodeName; xIf = getUnoDocModule( aCodeName, getSfxObjShell( xModel ) ); } catch (const uno::Exception&) @@ -1178,7 +1177,7 @@ uno::Reference< XHelperInterface > getUnoDocModule( const String& aModName, SfxO uno::Reference< XHelperInterface > xIf; if ( pShell ) { - rtl::OUString sProj( "Standard" ); + OUString sProj( "Standard" ); BasicManager* pBasMgr = pShell->GetBasicManager(); if ( pBasMgr && pBasMgr->GetName().Len() ) sProj = pBasMgr->GetName(); diff --git a/vbahelper/source/vbahelper/vbalineformat.cxx b/vbahelper/source/vbahelper/vbalineformat.cxx index e87edb948d11..26d198279530 100644 --- a/vbahelper/source/vbahelper/vbalineformat.cxx +++ b/vbahelper/source/vbahelper/vbalineformat.cxx @@ -36,7 +36,7 @@ ScVbaLineFormat::ScVbaLineFormat( const uno::Reference< ov::XHelperInterface >& } sal_Int32 -ScVbaLineFormat::convertLineStartEndNameToArrowheadStyle( rtl::OUString sLineName ) +ScVbaLineFormat::convertLineStartEndNameToArrowheadStyle( OUString sLineName ) { sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone; if ( sLineName == "Small Arrow" || sLineName == "Arrow" || sLineName == "msArrowEnd" || sLineName == "Double Arrow") @@ -73,25 +73,25 @@ ScVbaLineFormat::convertLineStartEndNameToArrowheadStyle( rtl::OUString sLineNam return nLineType; } -rtl::OUString +OUString ScVbaLineFormat::convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (uno::RuntimeException) { switch( nArrowheadStyle ) { case office::MsoArrowheadStyle::msoArrowheadNone: - return rtl::OUString(); + return OUString(); case office::MsoArrowheadStyle::msoArrowheadStealth: - return rtl::OUString("Arrow concave"); + return OUString("Arrow concave"); case office::MsoArrowheadStyle::msoArrowheadOpen: - return rtl::OUString("Line Arrow"); + return OUString("Line Arrow"); case office::MsoArrowheadStyle::msoArrowheadOval: - return rtl::OUString("Circle"); + return OUString("Circle"); case office::MsoArrowheadStyle::msoArrowheadDiamond: - return rtl::OUString("Square 45"); + return OUString("Square 45"); case office::MsoArrowheadStyle::msoArrowheadTriangle: - return rtl::OUString("Arrow"); + return OUString("Arrow"); default: - throw uno::RuntimeException( rtl::OUString("Invalid Arrow Style!"), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Invalid Arrow Style!" , uno::Reference< uno::XInterface >() ); } } @@ -100,12 +100,12 @@ sal_Int32 SAL_CALL ScVbaLineFormat::getBeginArrowheadStyle() throw (uno::RuntimeException) { sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone; - rtl::OUString sLineName; - m_xPropertySet->getPropertyValue( rtl::OUString("LineStartName") ) >>= sLineName; + OUString sLineName; + m_xPropertySet->getPropertyValue( "LineStartName" ) >>= sLineName; if( ( sLineName.getLength() > 7 ) && ( sLineName.indexOf( "msArray" ) ) != -1 ) { sal_Int32 nIndex = sLineName.indexOf( ' ' ); - rtl::OUString sName = sLineName.copy( 0, nIndex ); + OUString sName = sLineName.copy( 0, nIndex ); //sal_Int32 nSize = sLineName.copy( nIndex + 1 ).toInt32(); nLineType = convertLineStartEndNameToArrowheadStyle( sName ); } @@ -119,8 +119,8 @@ ScVbaLineFormat::getBeginArrowheadStyle() throw (uno::RuntimeException) void SAL_CALL ScVbaLineFormat::setBeginArrowheadStyle( sal_Int32 _beginarrowheadstyle ) throw (uno::RuntimeException) { - rtl::OUString sArrayName = convertArrowheadStyleToLineStartEndName( _beginarrowheadstyle ); - m_xPropertySet->setPropertyValue( rtl::OUString("LineStartName"), uno::makeAny( sArrayName ) ); + OUString sArrayName = convertArrowheadStyleToLineStartEndName( _beginarrowheadstyle ); + m_xPropertySet->setPropertyValue( "LineStartName" , uno::makeAny( sArrayName ) ); } sal_Int32 SAL_CALL @@ -128,7 +128,7 @@ ScVbaLineFormat::getBeginArrowheadLength() throw (uno::RuntimeException) { // #STUB // force error - throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Property 'EndArrowheadWidth' is not supported." , uno::Reference< uno::XInterface >() ); } void SAL_CALL @@ -136,7 +136,7 @@ ScVbaLineFormat::setBeginArrowheadLength( sal_Int32 /*_beginarrowheadlength*/ ) { // #STUB // force error - throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Property 'EndArrowheadWidth' is not supported." , uno::Reference< uno::XInterface >() ); } sal_Int32 SAL_CALL @@ -144,7 +144,7 @@ ScVbaLineFormat::getBeginArrowheadWidth() throw (uno::RuntimeException) { // #STUB // force error - throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Property 'EndArrowheadWidth' is not supported." , uno::Reference< uno::XInterface >() ); } void SAL_CALL @@ -152,7 +152,7 @@ ScVbaLineFormat::setBeginArrowheadWidth( sal_Int32 /*_beginarrowheadwidth*/ ) th { // #STUB // force error - throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Property 'EndArrowheadWidth' is not supported." , uno::Reference< uno::XInterface >() ); } sal_Int32 SAL_CALL @@ -173,35 +173,35 @@ ScVbaLineFormat::getEndArrowheadLength() throw (uno::RuntimeException) { // #STUB // force error - throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Property 'EndArrowheadWidth' is not supported." , uno::Reference< uno::XInterface >() ); } void SAL_CALL ScVbaLineFormat::setEndArrowheadLength( sal_Int32 /*_endarrowheadlength*/ ) throw (uno::RuntimeException) { // #STUB - throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Property 'EndArrowheadWidth' is not supported." , uno::Reference< uno::XInterface >() ); } sal_Int32 SAL_CALL ScVbaLineFormat::getEndArrowheadWidth() throw (uno::RuntimeException) { // #STUB - throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Property 'EndArrowheadWidth' is not supported." , uno::Reference< uno::XInterface >() ); } void SAL_CALL ScVbaLineFormat::setEndArrowheadWidth( sal_Int32 /*_endarrowheadwidth*/ ) throw (uno::RuntimeException) { // #STUB - throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Property 'EndArrowheadWidth' is not supported." , uno::Reference< uno::XInterface >() ); } double SAL_CALL ScVbaLineFormat::getWeight() throw (uno::RuntimeException) { sal_Int32 nLineWidth=0; - m_xPropertySet->getPropertyValue( rtl::OUString("LineWidth") ) >>= nLineWidth; + m_xPropertySet->getPropertyValue( "LineWidth" ) >>= nLineWidth; double dLineWidth = Millimeter::getInPoints( nLineWidth ); return dLineWidth; } @@ -210,7 +210,7 @@ void SAL_CALL ScVbaLineFormat::setWeight( double _weight ) throw (uno::RuntimeException) { if( _weight < 0 ) - throw uno::RuntimeException( rtl::OUString("Parameter: Must be positive."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Parameter: Must be positive." , uno::Reference< uno::XInterface >() ); if( _weight == 0 ) _weight = 0.5; m_nLineWeight = _weight; @@ -218,7 +218,7 @@ ScVbaLineFormat::setWeight( double _weight ) throw (uno::RuntimeException) aMillimeter.setInPoints( _weight ); sal_Int32 nLineWidth = static_cast<sal_Int32>( aMillimeter.getInHundredthsOfOneMillimeter() ); - m_xPropertySet->setPropertyValue( rtl::OUString("LineWidth"), uno::makeAny( nLineWidth ) ); + m_xPropertySet->setPropertyValue( "LineWidth" , uno::makeAny( nLineWidth ) ); setDashStyle( m_nLineDashStyle ); } @@ -226,7 +226,7 @@ sal_Bool SAL_CALL ScVbaLineFormat::getVisible() throw (uno::RuntimeException) { drawing::LineStyle aLineStyle; - m_xPropertySet->getPropertyValue( rtl::OUString("LineStyle") ) >>= aLineStyle; + m_xPropertySet->getPropertyValue( "LineStyle" ) >>= aLineStyle; if( aLineStyle == drawing::LineStyle_NONE ) { return sal_False; @@ -238,11 +238,11 @@ void SAL_CALL ScVbaLineFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException) { drawing::LineStyle aLineStyle; - m_xPropertySet->getPropertyValue( rtl::OUString("LineStyle") ) >>= aLineStyle; + m_xPropertySet->getPropertyValue( "LineStyle" ) >>= aLineStyle; if( !_visible ) { aLineStyle = drawing::LineStyle_NONE; - m_xPropertySet->setPropertyValue( rtl::OUString("LineStyle"), uno::makeAny( aLineStyle ) ); + m_xPropertySet->setPropertyValue( "LineStyle" , uno::makeAny( aLineStyle ) ); } else { @@ -257,7 +257,7 @@ double SAL_CALL ScVbaLineFormat::getTransparency() throw (uno::RuntimeException) { sal_Int16 nTransparency = 0; - m_xPropertySet->getPropertyValue( rtl::OUString("LineTransparence") ) >>= nTransparency; + m_xPropertySet->getPropertyValue( "LineTransparence" ) >>= nTransparency; double fTransparency = static_cast<double>( nTransparency ); return fTransparency / 100; } @@ -266,7 +266,7 @@ void SAL_CALL ScVbaLineFormat::setTransparency( double _transparency ) throw (uno::RuntimeException) { sal_Int16 nTransparency = static_cast<sal_Int16>( _transparency * 100 ); - m_xPropertySet->setPropertyValue( rtl::OUString("LineTransparence"), uno::makeAny( nTransparency ) ); + m_xPropertySet->setPropertyValue( "LineTransparence" , uno::makeAny( nTransparency ) ); } sal_Int16 SAL_CALL @@ -293,13 +293,13 @@ ScVbaLineFormat::getDashStyle() throw (uno::RuntimeException) { drawing::LineStyle eLineStyle; //LineStyle integer in Xray - m_xPropertySet->getPropertyValue( rtl::OUString("LineStyle") ) >>= eLineStyle; + m_xPropertySet->getPropertyValue( "LineStyle" ) >>= eLineStyle; if( eLineStyle == drawing::LineStyle_SOLID ) m_nLineDashStyle = office::MsoLineDashStyle::msoLineSolid; else { drawing::LineDash aLineDash; - m_xPropertySet->getPropertyValue( rtl::OUString("LineDash") ) >>= aLineDash; + m_xPropertySet->getPropertyValue( "LineDash" ) >>= aLineDash; if( aLineDash.Dots == 0 ) { //LineDash @@ -345,11 +345,11 @@ ScVbaLineFormat::setDashStyle( sal_Int32 _dashstyle ) throw (uno::RuntimeExcepti m_nLineDashStyle = _dashstyle; if( _dashstyle == office::MsoLineDashStyle::msoLineSolid ) { - m_xPropertySet->setPropertyValue( rtl::OUString("LineStyle"), uno::makeAny( drawing::LineStyle_SOLID )); + m_xPropertySet->setPropertyValue( "LineStyle" , uno::makeAny( drawing::LineStyle_SOLID )); } else { - m_xPropertySet->setPropertyValue( rtl::OUString("LineStyle"), uno::makeAny( drawing::LineStyle_DASH ) ); + m_xPropertySet->setPropertyValue( "LineStyle" , uno::makeAny( drawing::LineStyle_DASH ) ); drawing::LineDash pLineDash; Millimeter aMillimeter( m_nLineWeight ); sal_Int32 nPixel = static_cast< sal_Int32 >( aMillimeter.getInHundredthsOfOneMillimeter() ); @@ -405,9 +405,9 @@ ScVbaLineFormat::setDashStyle( sal_Int32 _dashstyle ) throw (uno::RuntimeExcepti pLineDash.Distance = nPixel; break; default: - throw uno::RuntimeException( rtl::OUString("this MsoLineDashStyle is not supported."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "this MsoLineDashStyle is not supported." , uno::Reference< uno::XInterface >() ); } - m_xPropertySet->setPropertyValue( rtl::OUString("LineDash"), uno::makeAny( pLineDash ) ); + m_xPropertySet->setPropertyValue( "LineDash" , uno::makeAny( pLineDash ) ); } } @@ -424,20 +424,20 @@ ScVbaLineFormat::ForeColor() throw (uno::RuntimeException) return uno::Reference< msforms::XColorFormat >( new ScVbaColorFormat( getParent(), mxContext, this, m_xShape, ::ColorFormatType::LINEFORMAT_FORECOLOR ) ); } -rtl::OUString +OUString ScVbaLineFormat::getServiceImplName() { - return rtl::OUString("ScVbaLineFormat"); + return OUString("ScVbaLineFormat"); } -uno::Sequence< rtl::OUString > +uno::Sequence< OUString > ScVbaLineFormat::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.LineFormat" ); + aServiceNames[ 0 ] = "ooo.vba.msform.LineFormat"; } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbalineformat.hxx b/vbahelper/source/vbahelper/vbalineformat.hxx index 052829a18caa..71a4271a25d7 100644 --- a/vbahelper/source/vbahelper/vbalineformat.hxx +++ b/vbahelper/source/vbahelper/vbalineformat.hxx @@ -34,10 +34,10 @@ private: sal_Int32 m_nLineDashStyle; double m_nLineWeight; protected: - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); - sal_Int32 convertLineStartEndNameToArrowheadStyle( rtl::OUString sLineName ); - rtl::OUString convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (css::uno::RuntimeException); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); + sal_Int32 convertLineStartEndNameToArrowheadStyle( OUString sLineName ); + OUString convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (css::uno::RuntimeException); public: ScVbaLineFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape ); diff --git a/vbahelper/source/vbahelper/vbapictureformat.cxx b/vbahelper/source/vbahelper/vbapictureformat.cxx index 2ffdff10fad9..9b2aa114f6e0 100644 --- a/vbahelper/source/vbahelper/vbapictureformat.cxx +++ b/vbahelper/source/vbahelper/vbapictureformat.cxx @@ -34,11 +34,11 @@ ScVbaPictureFormat::checkParameterRangeInDouble( double nRange, double nMin, dou { if( nRange < nMin ) { - throw uno::RuntimeException( rtl::OUString("Parameter out of range, value is too small.") , uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Parameter out of range, value is too small." , uno::Reference< uno::XInterface >() ); } if( nRange > nMax ) { - throw uno::RuntimeException( rtl::OUString("Parameter out of range, value is too high.") , uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Parameter out of range, value is too high." , uno::Reference< uno::XInterface >() ); } } @@ -47,7 +47,7 @@ double SAL_CALL ScVbaPictureFormat::getBrightness() throw (uno::RuntimeException) { sal_Int16 nLuminance = 0; - m_xPropertySet->getPropertyValue( rtl::OUString("AdjustLuminance") ) >>= nLuminance; + m_xPropertySet->getPropertyValue( "AdjustLuminance" ) >>= nLuminance; double fBrightness = static_cast< double >( nLuminance ); fBrightness = ( fBrightness +100 ) / 200; return fBrightness; @@ -59,14 +59,14 @@ ScVbaPictureFormat::setBrightness( double _brightness ) throw (uno::RuntimeExcep checkParameterRangeInDouble( _brightness, 0.0, 1.0 ); double fLuminance = _brightness * 200 - 100; sal_Int16 nLuminance = static_cast< sal_Int16 >( fLuminance ); - m_xPropertySet->setPropertyValue( rtl::OUString("AdjustLuminance"), uno::makeAny( nLuminance ) ); + m_xPropertySet->setPropertyValue( "AdjustLuminance" , uno::makeAny( nLuminance ) ); } double SAL_CALL ScVbaPictureFormat::getContrast() throw (uno::RuntimeException) { sal_Int16 nContrast = 0; - m_xPropertySet->getPropertyValue( rtl::OUString("AdjustContrast") ) >>= nContrast; + m_xPropertySet->getPropertyValue( "AdjustContrast" ) >>= nContrast; double fContrast = static_cast< double >( nContrast ); fContrast = ( fContrast + 100 ) / 200; return fContrast; @@ -78,7 +78,7 @@ ScVbaPictureFormat::setContrast( double _contrast ) throw (uno::RuntimeException checkParameterRangeInDouble( _contrast, 0.0, 1.0 ); double fContrast = _contrast * 200 - 100; sal_Int16 nContrast = static_cast< sal_Int16 >( fContrast ); - m_xPropertySet->setPropertyValue( rtl::OUString("AdjustContrast"), uno::makeAny( nContrast ) ); + m_xPropertySet->setPropertyValue( "AdjustContrast" , uno::makeAny( nContrast ) ); } @@ -115,20 +115,20 @@ ScVbaPictureFormat::IncrementContrast( double increment ) throw (uno::RuntimeExc setContrast( nContrast ); } -rtl::OUString +OUString ScVbaPictureFormat::getServiceImplName() { - return rtl::OUString("ScVbaPictureFormat"); + return OUString("ScVbaPictureFormat"); } -uno::Sequence< rtl::OUString > +uno::Sequence< OUString > ScVbaPictureFormat::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.PictureFormat" ); + aServiceNames[ 0 ] = "ooo.vba.msform.PictureFormat"; } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbapictureformat.hxx b/vbahelper/source/vbahelper/vbapictureformat.hxx index ccc68f2f7b22..b06f944d89d1 100644 --- a/vbahelper/source/vbahelper/vbapictureformat.hxx +++ b/vbahelper/source/vbahelper/vbapictureformat.hxx @@ -32,8 +32,8 @@ private: css::uno::Reference< css::drawing::XShape > m_xShape; css::uno::Reference< css::beans::XPropertySet > m_xPropertySet; protected: - virtual rtl::OUString getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual OUString getServiceImplName(); + virtual css::uno::Sequence<OUString> getServiceNames(); private: void checkParameterRangeInDouble( double nRange, double nMin, double nMax ) throw (css::uno::RuntimeException); public: diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx index 679290bf9def..04462432a81c 100644 --- a/vbahelper/source/vbahelper/vbashape.cxx +++ b/vbahelper/source/vbahelper/vbashape.cxx @@ -113,10 +113,10 @@ ScVbaShape::removeShapesListener() throw( uno::RuntimeException ) sal_Int32 ScVbaShape::getType( const css::uno::Reference< drawing::XShape > xShape ) throw (uno::RuntimeException) { - rtl::OUString sShapeType; + OUString sShapeType; uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor( xShape, uno::UNO_QUERY_THROW ); sShapeType = xShapeDescriptor->getShapeType(); - OSL_TRACE("ScVbaShape::getType: %s", rtl::OUStringToOString( sShapeType, RTL_TEXTENCODING_UTF8 ).getStr() ); + OSL_TRACE("ScVbaShape::getType: %s", OUStringToOString( sShapeType, RTL_TEXTENCODING_UTF8 ).getStr() ); // office::MsoShapeType::msoDiagram to "com.sun.star.drawing.GroupShape" if( sShapeType == "com.sun.star.drawing.GroupShape" ) return office::MsoShapeType::msoGroup; @@ -132,7 +132,7 @@ ScVbaShape::getType( const css::uno::Reference< drawing::XShape > xShape ) throw { enum drawing::ConnectorType connectorType; uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW ); - xPropertySet->getPropertyValue( rtl::OUString("EdgeKind")) >>= connectorType; + xPropertySet->getPropertyValue( "EdgeKind" ) >>= connectorType; if( connectorType == drawing::ConnectorType_CURVE ) return office::MsoShapeType::msoFreeform; else if( connectorType == drawing::ConnectorType_LINE ) @@ -147,21 +147,21 @@ ScVbaShape::getType( const css::uno::Reference< drawing::XShape > xShape ) throw else if( sShapeType == "com.sun.star.drawing.TextShape" ) return office::MsoShapeType::msoTextBox; else - throw uno::RuntimeException( rtl::OUString("the shape type do not be supported: ") + sShapeType, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( OUString("the shape type do not be supported: ") + sShapeType, uno::Reference< uno::XInterface >() ); } // Attributes -rtl::OUString SAL_CALL +OUString SAL_CALL ScVbaShape::getName() throw (uno::RuntimeException) { - rtl::OUString sName; + OUString sName; uno::Reference< container::XNamed > xNamed( m_xShape, uno::UNO_QUERY_THROW ); sName = xNamed->getName(); return sName; } void SAL_CALL -ScVbaShape::setName( const rtl::OUString& _name ) throw (uno::RuntimeException) +ScVbaShape::setName( const OUString& _name ) throw (uno::RuntimeException) { uno::Reference< container::XNamed > xNamed( m_xShape, uno::UNO_QUERY_THROW ); xNamed->setName( _name ); @@ -203,7 +203,7 @@ ScVbaShape::getLeft() throw (uno::RuntimeException) { // fail to get position by using XShape::getPosition() sal_Int32 nLeft = 0; - m_xPropertySet->getPropertyValue( rtl::OUString( "HoriOrientPosition" ) ) >>= nLeft; + m_xPropertySet->getPropertyValue( "HoriOrientPosition" ) >>= nLeft; left = Millimeter::getInPoints( nLeft ); } return left; @@ -220,7 +220,7 @@ ScVbaShape::setLeft( double _left ) throw (uno::RuntimeException) { sal_Int32 nLeft = 0; nLeft = Millimeter::getInHundredthsOfOneMillimeter( _left ); - m_xPropertySet->setPropertyValue( rtl::OUString("HoriOrientPosition"), uno::makeAny( nLeft ) ); + m_xPropertySet->setPropertyValue( "HoriOrientPosition" , uno::makeAny( nLeft ) ); } } @@ -235,7 +235,7 @@ ScVbaShape::getTop() throw (uno::RuntimeException) catch( uno::Exception& ) { sal_Int32 nTop = 0; - m_xPropertySet->getPropertyValue( rtl::OUString( "VertOrientPosition" ) ) >>= nTop; + m_xPropertySet->getPropertyValue( "VertOrientPosition" ) >>= nTop; top = Millimeter::getInPoints( nTop ); } return top; @@ -252,7 +252,7 @@ ScVbaShape::setTop( double _top ) throw (uno::RuntimeException) { sal_Int32 nTop = 0; nTop = Millimeter::getInHundredthsOfOneMillimeter( _top ); - m_xPropertySet->setPropertyValue( rtl::OUString("VertOrientPosition"), uno::makeAny( nTop ) ); + m_xPropertySet->setPropertyValue( "VertOrientPosition" , uno::makeAny( nTop ) ); } } @@ -275,7 +275,7 @@ sal_Int32 SAL_CALL ScVbaShape::getZOrderPosition() throw (uno::RuntimeException) { sal_Int32 nZOrderPosition = 0; - uno::Any aZOrderPosition = m_xPropertySet->getPropertyValue( rtl::OUString("ZOrder") ); + uno::Any aZOrderPosition = m_xPropertySet->getPropertyValue( "ZOrder" ); aZOrderPosition >>= nZOrderPosition; return nZOrderPosition + 1; } @@ -291,7 +291,7 @@ ScVbaShape::getRotation() throw (uno::RuntimeException) { double dRotation = 0; sal_Int32 nRotation = 0; - m_xPropertySet->getPropertyValue( rtl::OUString("RotateAngle") ) >>= nRotation; + m_xPropertySet->getPropertyValue( "RotateAngle" ) >>= nRotation; dRotation = static_cast< double >( nRotation /100 ); return dRotation; } @@ -300,7 +300,7 @@ void SAL_CALL ScVbaShape::setRotation( double _rotation ) throw (uno::RuntimeException) { sal_Int32 nRotation = static_cast < sal_Int32 > ( _rotation * 100 ); - m_xPropertySet->setPropertyValue( rtl::OUString("RotateAngle"), uno::makeAny( nRotation ) ); + m_xPropertySet->setPropertyValue( "RotateAngle" , uno::makeAny( nRotation ) ); } uno::Reference< msforms::XLineFormat > SAL_CALL @@ -327,13 +327,13 @@ uno::Any SAL_CALL ScVbaShape::TextFrame() throw (uno::RuntimeException) { uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW ); - if( xServiceInfo->supportsService( ::rtl::OUString( "com.sun.star.sheet.SpreadsheetDocument" ) ) ) + if( xServiceInfo->supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) ) { uno::Reference< lang::XMultiServiceFactory > xSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); uno::Sequence< uno::Any > aArgs(2); aArgs[0] = uno::makeAny( getParent() ); aArgs[1] <<= m_xShape; - uno::Reference< uno::XInterface > xTextFrame( xSF->createInstanceWithArguments( rtl::OUString( "ooo.vba.excel.TextFrame" ) , aArgs ) , uno::UNO_QUERY_THROW ); + uno::Reference< uno::XInterface > xTextFrame( xSF->createInstanceWithArguments( "ooo.vba.excel.TextFrame" , aArgs ) , uno::UNO_QUERY_THROW ); return uno::makeAny( xTextFrame ); } @@ -351,33 +351,33 @@ void SAL_CALL ScVbaShape::ZOrder( sal_Int32 ZOrderCmd ) throw (uno::RuntimeException) { sal_Int32 nOrderPositon; - uno::Any aOrderPostion = m_xPropertySet->getPropertyValue( rtl::OUString("ZOrder") ); + uno::Any aOrderPostion = m_xPropertySet->getPropertyValue( "ZOrder" ); aOrderPostion >>= nOrderPositon; switch( ZOrderCmd ) { case office::MsoZOrderCmd::msoBringToFront: - m_xPropertySet->setPropertyValue( rtl::OUString("ZOrder"), uno::makeAny( SAL_MAX_INT32 ) ); + m_xPropertySet->setPropertyValue( "ZOrder" , uno::makeAny( SAL_MAX_INT32 ) ); break; case office::MsoZOrderCmd::msoSendToBack: - m_xPropertySet->setPropertyValue( rtl::OUString("ZOrder"), uno::makeAny( (sal_Int32)0 ) ); + m_xPropertySet->setPropertyValue( "ZOrder" , uno::makeAny( (sal_Int32)0 ) ); break; case office::MsoZOrderCmd::msoBringForward: nOrderPositon += 1; - m_xPropertySet->setPropertyValue( rtl::OUString("ZOrder"), uno::makeAny( nOrderPositon ) ); + m_xPropertySet->setPropertyValue( "ZOrder" , uno::makeAny( nOrderPositon ) ); break; case office::MsoZOrderCmd::msoSendBackward: if( nOrderPositon > 0 ) { nOrderPositon -= 1; - m_xPropertySet->setPropertyValue( rtl::OUString("ZOrder"), uno::makeAny( nOrderPositon ) ); + m_xPropertySet->setPropertyValue( "ZOrder" , uno::makeAny( nOrderPositon ) ); } break; // below two commands use with Writer for text and image object. case office::MsoZOrderCmd::msoBringInFrontOfText: case office::MsoZOrderCmd::msoSendBehindText: - throw uno::RuntimeException( rtl::OUString("This ZOrderCmd is not implemented, it is use with writer."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "This ZOrderCmd is not implemented, it is use with writer." , uno::Reference< uno::XInterface >() ); default: - throw uno::RuntimeException( rtl::OUString("Invalid Parameter."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Invalid Parameter." , uno::Reference< uno::XInterface >() ); } } @@ -430,7 +430,7 @@ ScVbaShape::ScaleHeight( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal } else { - throw uno::RuntimeException( rtl::OUString("ScaleHeight.Scale wrong value is given.") , uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "ScaleHeight.Scale wrong value is given." , uno::Reference< uno::XInterface >() ); } } @@ -459,7 +459,7 @@ ScVbaShape::ScaleWidth( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal_ } else { - throw uno::RuntimeException( rtl::OUString("ScaleHeight.Scale wrong value is given.") , uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "ScaleHeight.Scale wrong value is given." , uno::Reference< uno::XInterface >() ); } } @@ -498,7 +498,7 @@ void SAL_CALL ScVbaShape::Copy() throw (uno::RuntimeException) { Select( uno::Any() ); // Copy this Shape. - rtl::OUString sUrl = rtl::OUString( ".uno:Copy" ); + OUString sUrl( ".uno:Copy" ); dispatchRequests( m_xModel, sUrl ); } } @@ -534,7 +534,7 @@ ScVbaShape::getRelativeHorizontalPosition() throw (uno::RuntimeException) { sal_Int32 nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionMargin; sal_Int16 nType = text::RelOrientation::PAGE_LEFT; - m_xPropertySet->getPropertyValue( rtl::OUString( "HoriOrientRelation" ) ) >>= nType; + m_xPropertySet->getPropertyValue( "HoriOrientRelation" ) >>= nType; switch( nType ) { @@ -560,7 +560,7 @@ ScVbaShape::getRelativeHorizontalPosition() throw (uno::RuntimeException) } default: { - throw uno::RuntimeException( rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Shape::RelativeHorizontalPosition: not implemented" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Shape::RelativeHorizontalPosition: not implemented" , uno::Reference< uno::XInterface >() ); } } return nRelativeHorizontalPosition; @@ -594,10 +594,10 @@ ScVbaShape::setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalpositi } default: { - DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString()); + DebugHelper::exception(SbERR_BAD_ARGUMENT, OUString()); } } - m_xPropertySet->setPropertyValue( rtl::OUString( "HoriOrientRelation" ), uno::makeAny( nType ) ); + m_xPropertySet->setPropertyValue( "HoriOrientRelation" , uno::makeAny( nType ) ); } sal_Int32 SAL_CALL @@ -605,7 +605,7 @@ ScVbaShape::getRelativeVerticalPosition() throw (uno::RuntimeException) { sal_Int32 nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionMargin; sal_Int16 nType = text::RelOrientation::PAGE_FRAME; - m_xPropertySet->getPropertyValue( rtl::OUString( "VertOrientRelation" ) ) >>= nType; + m_xPropertySet->getPropertyValue( "VertOrientRelation" ) >>= nType; switch( nType ) { @@ -631,7 +631,7 @@ ScVbaShape::getRelativeVerticalPosition() throw (uno::RuntimeException) } default: { - throw uno::RuntimeException( rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Shape::RelativeVerticalPosition: not implemented" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Shape::RelativeVerticalPosition: not implemented" , uno::Reference< uno::XInterface >() ); } } return nRelativeVerticalPosition; @@ -665,42 +665,42 @@ ScVbaShape::setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) } default: { - DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString()); + DebugHelper::exception(SbERR_BAD_ARGUMENT, OUString()); } } - m_xPropertySet->setPropertyValue( rtl::OUString( "VertOrientRelation" ), uno::makeAny( nType ) ); + m_xPropertySet->setPropertyValue( "VertOrientRelation" , uno::makeAny( nType ) ); } uno::Any SAL_CALL ScVbaShape::WrapFormat() throw (uno::RuntimeException) { uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW ); - if( xServiceInfo->supportsService( ::rtl::OUString( "com.sun.star.text.TextDocument" ) ) ) + if( xServiceInfo->supportsService( "com.sun.star.text.TextDocument" )) { uno::Reference< lang::XMultiServiceFactory > xSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); uno::Sequence< uno::Any > aArgs(2); aArgs[0] = uno::makeAny( getParent() ); aArgs[1] <<= m_xShape; - uno::Reference< uno::XInterface > xWrapFormat( xSF->createInstanceWithArguments( rtl::OUString( "ooo.vba.word.WrapFormat" ) , aArgs ) , uno::UNO_QUERY_THROW ); + uno::Reference< uno::XInterface > xWrapFormat( xSF->createInstanceWithArguments( "ooo.vba.word.WrapFormat" , aArgs ) , uno::UNO_QUERY_THROW ); return uno::makeAny( xWrapFormat ); } - throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() ); } -rtl::OUString +OUString ScVbaShape::getServiceImplName() { - return rtl::OUString("ScVbaShape"); + return OUString("ScVbaShape"); } -uno::Sequence< rtl::OUString > +uno::Sequence< OUString > ScVbaShape::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.Shape" ); + aServiceNames[ 0 ] = "ooo.vba.msform.Shape"; } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx index 128b3232acab..da02ffb8f1ed 100644 --- a/vbahelper/source/vbahelper/vbashaperange.cxx +++ b/vbahelper/source/vbahelper/vbashaperange.cxx @@ -117,7 +117,7 @@ ScVbaShapeRange::IncrementTop( double Increment ) throw (uno::RuntimeException) } } -rtl::OUString SAL_CALL ScVbaShapeRange::getName() throw (uno::RuntimeException) +OUString SAL_CALL ScVbaShapeRange::getName() throw (uno::RuntimeException) { sal_Int32 nLen = getCount(); for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ ) @@ -128,7 +128,7 @@ rtl::OUString SAL_CALL ScVbaShapeRange::getName() throw (uno::RuntimeException) throw uno::RuntimeException(); } -void SAL_CALL ScVbaShapeRange::setName( const rtl::OUString& _name ) throw (uno::RuntimeException) +void SAL_CALL ScVbaShapeRange::setName( const OUString& _name ) throw (uno::RuntimeException) { sal_Int32 nLen = getCount(); for ( sal_Int32 index = 1; index <= nLen; ++index ) @@ -382,20 +382,20 @@ ScVbaShapeRange:: createCollectionObject( const css::uno::Any& aSource ) return uno::makeAny( xVbShape ); } -rtl::OUString +OUString ScVbaShapeRange::getServiceImplName() { - return rtl::OUString("ScVbaShapeRange"); + return OUString("ScVbaShapeRange"); } -uno::Sequence< rtl::OUString > +uno::Sequence< OUString > ScVbaShapeRange::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.ShapeRange" ); + aServiceNames[ 0 ] = "ooo.vba.msform.ShapeRange"; } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbatextframe.cxx b/vbahelper/source/vbahelper/vbatextframe.cxx index afd81d645add..a4c5f661fda6 100644 --- a/vbahelper/source/vbahelper/vbatextframe.cxx +++ b/vbahelper/source/vbahelper/vbatextframe.cxx @@ -35,11 +35,11 @@ VbaTextFrame::setAsMSObehavior() //set property TextWordWrap default as False. // TextFitToSize control the text content. it seems we should set the default as False. // com.sun.star.drawing.TextFitToSizeType.NONE - m_xPropertySet->setPropertyValue( rtl::OUString("TextWordWrap"), uno::makeAny( sal_False ) ); - m_xPropertySet->setPropertyValue( rtl::OUString("TextFitToSize"), uno::makeAny( drawing::TextFitToSizeType_NONE ) ); + m_xPropertySet->setPropertyValue( "TextWordWrap", uno::makeAny( sal_False ) ); + m_xPropertySet->setPropertyValue( "TextFitToSize", uno::makeAny( drawing::TextFitToSizeType_NONE ) ); } -sal_Int32 VbaTextFrame::getMargin( rtl::OUString sMarginType ) +sal_Int32 VbaTextFrame::getMargin( OUString sMarginType ) { sal_Int32 nMargin = 0; uno::Any aMargin = m_xPropertySet->getPropertyValue( sMarginType ); @@ -47,7 +47,7 @@ sal_Int32 VbaTextFrame::getMargin( rtl::OUString sMarginType ) return nMargin; } -void VbaTextFrame::setMargin( rtl::OUString sMarginType, float fMargin ) +void VbaTextFrame::setMargin( OUString sMarginType, float fMargin ) { sal_Int32 nMargin = Millimeter::getInHundredthsOfOneMillimeter( fMargin ); m_xPropertySet->setPropertyValue( sMarginType, uno::makeAny( nMargin ) ); @@ -61,7 +61,7 @@ VbaTextFrame::getAutoSize() throw (uno::RuntimeException) // TextFitToSize control the text content. // and in mso, there isnot option TextWordWrap which means auto wrap. the default is False. sal_Bool bAutosize = sal_False; - uno::Any aTextAutoGrowHeight = m_xPropertySet->getPropertyValue( rtl::OUString("TextAutoGrowHeight") ); + uno::Any aTextAutoGrowHeight = m_xPropertySet->getPropertyValue( "TextAutoGrowHeight" ); aTextAutoGrowHeight >>= bAutosize; return bAutosize; } @@ -70,13 +70,13 @@ void SAL_CALL VbaTextFrame::setAutoSize( sal_Bool _autosize ) throw (uno::RuntimeException) { setAsMSObehavior(); - m_xPropertySet->setPropertyValue( rtl::OUString("TextAutoGrowHeight"), uno::makeAny( _autosize ) ); + m_xPropertySet->setPropertyValue( "TextAutoGrowHeight", uno::makeAny( _autosize ) ); } float SAL_CALL VbaTextFrame::getMarginBottom() throw (uno::RuntimeException) { - sal_Int32 nMargin = getMargin( rtl::OUString("TextLowerDistance") ); + sal_Int32 nMargin = getMargin( "TextLowerDistance" ); float fMargin = (float)Millimeter::getInPoints( nMargin ); return fMargin; } @@ -84,13 +84,13 @@ VbaTextFrame::getMarginBottom() throw (uno::RuntimeException) void SAL_CALL VbaTextFrame::setMarginBottom( float _marginbottom ) throw (uno::RuntimeException) { - setMargin( rtl::OUString("TextLowerDistance"), _marginbottom ); + setMargin( "TextLowerDistance", _marginbottom ); } float SAL_CALL VbaTextFrame::getMarginTop() throw (uno::RuntimeException) { - sal_Int32 nMargin = getMargin( rtl::OUString("TextUpperDistance") ); + sal_Int32 nMargin = getMargin( "TextUpperDistance" ); float fMargin = (float)Millimeter::getInPoints( nMargin ); return fMargin; } @@ -98,13 +98,13 @@ VbaTextFrame::getMarginTop() throw (uno::RuntimeException) void SAL_CALL VbaTextFrame::setMarginTop( float _margintop ) throw (uno::RuntimeException) { - setMargin( rtl::OUString("TextUpperDistance"), _margintop ); + setMargin( "TextUpperDistance", _margintop ); } float SAL_CALL VbaTextFrame::getMarginLeft() throw (uno::RuntimeException) { - sal_Int32 nMargin = getMargin( rtl::OUString("TextLeftDistance") ); + sal_Int32 nMargin = getMargin( "TextLeftDistance" ); float fMargin = (float)Millimeter::getInPoints( nMargin ); return fMargin; } @@ -112,13 +112,13 @@ VbaTextFrame::getMarginLeft() throw (uno::RuntimeException) void SAL_CALL VbaTextFrame::setMarginLeft( float _marginleft ) throw (uno::RuntimeException) { - setMargin( rtl::OUString("TextLeftDistance"), _marginleft ); + setMargin( "TextLeftDistance", _marginleft ); } float SAL_CALL VbaTextFrame::getMarginRight() throw (uno::RuntimeException) { - sal_Int32 nMargin = getMargin( rtl::OUString("TextRightDistance") ); + sal_Int32 nMargin = getMargin( "TextRightDistance" ); float fMargin = (float)Millimeter::getInPoints( nMargin ); return fMargin; } @@ -126,7 +126,7 @@ VbaTextFrame::getMarginRight() throw (uno::RuntimeException) void SAL_CALL VbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException) { - setMargin( rtl::OUString("TextRightDistance"), _marginright ); + setMargin( "TextRightDistance" , _marginright ); } @@ -134,23 +134,23 @@ VbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException) uno::Any SAL_CALL VbaTextFrame::Characters() throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() ); } -rtl::OUString +OUString VbaTextFrame::getServiceImplName() { - return rtl::OUString("VbaTextFrame"); + return OUString("VbaTextFrame"); } -uno::Sequence< rtl::OUString > +uno::Sequence< OUString > VbaTextFrame::getServiceNames() { - static uno::Sequence< rtl::OUString > aServiceNames; + static uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msforms.TextFrame" ); + aServiceNames[ 0 ] = "ooo.vba.msforms.TextFrame"; } return aServiceNames; } |