From 02bd365494a59bb9080a4d73eafbde7903bd2cc9 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Thu, 31 May 2012 19:37:03 -0500 Subject: targeted string re-work Change-Id: I7a67dba479e562ae3b08e6acf9bb6139eb155556 --- vbahelper/inc/vbahelper/vbacollectionimpl.hxx | 12 +-- vbahelper/inc/vbahelper/vbapropvalue.hxx | 2 +- vbahelper/source/msforms/vbacheckbox.hxx | 2 +- vbahelper/source/msforms/vbacombobox.hxx | 2 +- vbahelper/source/msforms/vbacontrol.cxx | 118 ++++++++++----------- vbahelper/source/msforms/vbalabel.hxx | 2 +- vbahelper/source/msforms/vbalistbox.cxx | 36 +++---- vbahelper/source/msforms/vbalistbox.hxx | 2 +- vbahelper/source/msforms/vbalistcontrolhelper.cxx | 16 +-- vbahelper/source/msforms/vbamultipage.hxx | 2 +- vbahelper/source/msforms/vbaprogressbar.hxx | 2 +- vbahelper/source/msforms/vbaradiobutton.hxx | 2 +- vbahelper/source/msforms/vbatextbox.hxx | 2 +- vbahelper/source/msforms/vbatogglebutton.hxx | 2 +- vbahelper/source/msforms/vbauserform.cxx | 12 +-- vbahelper/source/vbahelper/vbaapplicationbase.cxx | 26 ++--- vbahelper/source/vbahelper/vbacolorformat.cxx | 18 ++-- vbahelper/source/vbahelper/vbacommandbar.cxx | 20 ++-- .../source/vbahelper/vbacommandbarcontrol.cxx | 22 ++-- .../source/vbahelper/vbacommandbarcontrols.cxx | 42 ++++---- vbahelper/source/vbahelper/vbacommandbarhelper.cxx | 30 +++--- vbahelper/source/vbahelper/vbacommandbars.cxx | 22 ++-- vbahelper/source/vbahelper/vbadocumentsbase.cxx | 26 ++--- vbahelper/source/vbahelper/vbafillformat.cxx | 20 ++-- vbahelper/source/vbahelper/vbahelper.cxx | 50 +++++---- vbahelper/source/vbahelper/vbalineformat.cxx | 68 ++++++------ vbahelper/source/vbahelper/vbapictureformat.cxx | 16 +-- vbahelper/source/vbahelper/vbashape.cxx | 60 +++++------ vbahelper/source/vbahelper/vbashaperange.cxx | 6 +- vbahelper/source/vbahelper/vbashapes.cxx | 56 +++++----- vbahelper/source/vbahelper/vbatextframe.cxx | 30 +++--- 31 files changed, 361 insertions(+), 365 deletions(-) diff --git a/vbahelper/inc/vbahelper/vbacollectionimpl.hxx b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx index a0447bde4ef0..2149821c78be 100644 --- a/vbahelper/inc/vbahelper/vbacollectionimpl.hxx +++ b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx @@ -249,7 +249,7 @@ protected: virtual css::uno::Any getItemByStringIndex( const rtl::OUString& sIndex ) throw (css::uno::RuntimeException) { if ( !m_xNameAccess.is() ) - throw css::uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScVbaCollectionBase string index access not supported by this object") ), css::uno::Reference< css::uno::XInterface >() ); + throw css::uno::RuntimeException( rtl::OUString( "ScVbaCollectionBase string index access not supported by this object" ), css::uno::Reference< css::uno::XInterface >() ); if( mbIgnoreCase ) { @@ -269,12 +269,11 @@ protected: virtual css::uno::Any getItemByIntIndex( const sal_Int32 nIndex ) throw (css::uno::RuntimeException) { if ( !m_xIndexAccess.is() ) - throw css::uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScVbaCollectionBase numeric index access not supported by this object") ), css::uno::Reference< css::uno::XInterface >() ); + throw css::uno::RuntimeException( rtl::OUString( "ScVbaCollectionBase numeric index access not supported by this object" ), css::uno::Reference< css::uno::XInterface >() ); if ( nIndex <= 0 ) { throw css::lang::IndexOutOfBoundsException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "index is 0 or negative" ) ), + ::rtl::OUString( "index is 0 or negative" ), css::uno::Reference< css::uno::XInterface >() ); } // need to adjust for vba index ( for which first element is 1 ) @@ -305,8 +304,7 @@ public: if ( ( Index1 >>= nIndex ) != sal_True ) { rtl::OUString message; - message = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Couldn't convert index to Int32")); + message = rtl::OUString( "Couldn't convert index to Int32"); throw css::lang::IndexOutOfBoundsException( message, css::uno::Reference< css::uno::XInterface >() ); } @@ -320,7 +318,7 @@ public: // XDefaultMethod ::rtl::OUString SAL_CALL getDefaultMethodName( ) throw (css::uno::RuntimeException) { - const static rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM("Item") ); + const static rtl::OUString sName( "Item" ); return sName; } // XEnumerationAccess diff --git a/vbahelper/inc/vbahelper/vbapropvalue.hxx b/vbahelper/inc/vbahelper/vbapropvalue.hxx index 87414d1a7055..5cc8d73ca4f9 100644 --- a/vbahelper/inc/vbahelper/vbapropvalue.hxx +++ b/vbahelper/inc/vbahelper/vbapropvalue.hxx @@ -55,7 +55,7 @@ public: virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - rtl::OUString SAL_CALL getDefaultPropertyName() throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } + rtl::OUString SAL_CALL getDefaultPropertyName() throw (css::uno::RuntimeException) { return ::rtl::OUString("Value"); } }; #endif //SC_VBA_PROPVALULE_HXX diff --git a/vbahelper/source/msforms/vbacheckbox.hxx b/vbahelper/source/msforms/vbacheckbox.hxx index b665a8554b3e..a357b8a7c616 100644 --- a/vbahelper/source/msforms/vbacheckbox.hxx +++ b/vbahelper/source/msforms/vbacheckbox.hxx @@ -52,7 +52,7 @@ public: virtual sal_Bool SAL_CALL getLocked() throw (css::uno::RuntimeException); virtual void SAL_CALL setLocked( sal_Bool bAutoSize ) throw (css::uno::RuntimeException); // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } + rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString("Value"); } //XHelperInterface virtual rtl::OUString getServiceImplName(); virtual css::uno::Sequence getServiceNames(); diff --git a/vbahelper/source/msforms/vbacombobox.hxx b/vbahelper/source/msforms/vbacombobox.hxx index 4bef619c3b44..d8e65f28338d 100644 --- a/vbahelper/source/msforms/vbacombobox.hxx +++ b/vbahelper/source/msforms/vbacombobox.hxx @@ -89,7 +89,7 @@ public: virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException); // XDefaultProperty - ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } + ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString("Value"); } //XHelperInterface virtual rtl::OUString getServiceImplName(); virtual css::uno::Sequence getServiceNames(); diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx index caf5491f7370..1978899704cf 100644 --- a/vbahelper/source/msforms/vbacontrol.cxx +++ b/vbahelper/source/msforms/vbacontrol.cxx @@ -95,7 +95,7 @@ ScVbaControl::getWindowPeer() throw (uno::RuntimeException) } catch(const uno::Exception&) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The Control does not exsit")), + throw uno::RuntimeException( rtl::OUString("The Control does not exsit"), uno::Reference< uno::XInterface >() ); } return xWinPeer; @@ -147,7 +147,7 @@ ScVbaControl::ScVbaControl( const uno::Reference< XHelperInterface >& xParent, c { m_xProps.set( xControlShape->getControl(), uno::UNO_QUERY_THROW ); rtl::OUString sDefaultControl; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultControl") ) ) >>= sDefaultControl; + m_xProps->getPropertyValue( rtl::OUString( "DefaultControl" ) ) >>= sDefaultControl; uno::Reference< lang::XMultiComponentFactory > xMFac( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); m_xEmptyFormControl.set( xMFac->createInstanceWithContext( sDefaultControl, mxContext ), uno::UNO_QUERY_THROW ); } @@ -185,7 +185,7 @@ void ScVbaControl::removeResouce() throw( uno::RuntimeException ) sal_Bool SAL_CALL ScVbaControl::getEnabled() throw (uno::RuntimeException) { uno::Any aValue = m_xProps->getPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) ) ); + (rtl::OUString( "Enabled" ) ); sal_Bool bRet = false; aValue >>= bRet; return bRet; @@ -195,7 +195,7 @@ void SAL_CALL ScVbaControl::setEnabled( sal_Bool bVisible ) throw (uno::RuntimeE { uno::Any aValue( bVisible ); m_xProps->setPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) ), aValue); + (rtl::OUString( "Enabled" ), aValue); } @@ -203,7 +203,7 @@ sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException) { sal_Bool bVisible( sal_True ); m_xProps->getPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) )) >>= bVisible; + (rtl::OUString( "EnableVisible" )) >>= bVisible; return bVisible; } @@ -211,7 +211,7 @@ void SAL_CALL ScVbaControl::setVisible( sal_Bool bVisible ) throw (uno::RuntimeE { uno::Any aValue( bVisible ); m_xProps->setPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) ), aValue); + (rtl::OUString( "EnableVisible" ), aValue); } double SAL_CALL ScVbaControl::getHeight() throw (uno::RuntimeException) { @@ -298,12 +298,12 @@ ScVbaControl::getControlSource() throw (uno::RuntimeException) try { uno::Reference< lang::XMultiServiceFactory > xFac( m_xModel, uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.table.CellAddressConversion" ))), uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( rtl::OUString( "com.sun.star.table.CellAddressConversion" )), uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xProps( xBindable->getValueBinding(), uno::UNO_QUERY_THROW ); table::CellAddress aAddress; - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BoundCell") ) ) >>= aAddress; - xConvertor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Address") ), uno::makeAny( aAddress ) ); - xConvertor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("XL_A1_Representation") ) ) >>= sControlSource; + xProps->getPropertyValue( rtl::OUString( "BoundCell" ) ) >>= aAddress; + xConvertor->setPropertyValue( rtl::OUString( "Address" ), uno::makeAny( aAddress ) ); + xConvertor->getPropertyValue( rtl::OUString( "XL_A1_Representation" ) ) >>= sControlSource; } catch(const uno::Exception&) { @@ -311,7 +311,7 @@ ScVbaControl::getControlSource() throw (uno::RuntimeException) } return sControlSource; #else - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("getControlSource not supported") ), uno::Reference< uno::XInterface >()); // not supported + throw uno::RuntimeException( rtl::OUString( "getControlSource not supported" ), uno::Reference< uno::XInterface >()); // not supported #endif } @@ -322,7 +322,7 @@ ScVbaControl::setControlSource( const rtl::OUString& _controlsource ) throw (uno rtl::OUString sEmpty; svt::BindableControlHelper::ApplyListSourceAndBindableData( m_xModel, m_xProps, _controlsource, sEmpty ); #else - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("setControlSource not supported ") ).concat( _controlsource ), uno::Reference< uno::XInterface >()); // not supported + throw uno::RuntimeException( rtl::OUString( "setControlSource not supported " ).concat( _controlsource ), uno::Reference< uno::XInterface >()); // not supported #endif } @@ -337,13 +337,13 @@ ScVbaControl::getRowSource() throw (uno::RuntimeException) try { uno::Reference< lang::XMultiServiceFactory > xFac( m_xModel, uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.table.CellRangeAddressConversion" ))), uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( rtl::OUString( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xProps( xListSink->getListEntrySource(), uno::UNO_QUERY_THROW ); table::CellRangeAddress aAddress; - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellRange") ) ) >>= aAddress; - xConvertor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Address")), uno::makeAny( aAddress ) ); - xConvertor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("XL_A1_Representation") ) ) >>= sRowSource; + xProps->getPropertyValue( rtl::OUString( "CellRange" ) ) >>= aAddress; + xConvertor->setPropertyValue( rtl::OUString( "Address"), uno::makeAny( aAddress ) ); + xConvertor->getPropertyValue( rtl::OUString( "XL_A1_Representation" ) ) >>= sRowSource; } catch(const uno::Exception&) { @@ -351,7 +351,7 @@ ScVbaControl::getRowSource() throw (uno::RuntimeException) } return sRowSource; #else - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("getRowSource not supported") ), uno::Reference< uno::XInterface >()); // not supported + throw uno::RuntimeException( rtl::OUString( "getRowSource not supported" ), uno::Reference< uno::XInterface >()); // not supported #endif } @@ -362,7 +362,7 @@ ScVbaControl::setRowSource( const rtl::OUString& _rowsource ) throw (uno::Runtim rtl::OUString sEmpty; svt::BindableControlHelper::ApplyListSourceAndBindableData( m_xModel, m_xProps, sEmpty, _rowsource ); #else - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("setRowSource not supported ") ).concat( _rowsource ), uno::Reference< uno::XInterface >()); // not supported + throw uno::RuntimeException( rtl::OUString( "setRowSource not supported " ).concat( _rowsource ), uno::Reference< uno::XInterface >()); // not supported #endif } @@ -371,7 +371,7 @@ ScVbaControl::getName() throw (uno::RuntimeException) { rtl::OUString sName; m_xProps->getPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sName; + (rtl::OUString( "Name" ) ) >>= sName; return sName; } @@ -380,7 +380,7 @@ void SAL_CALL ScVbaControl::setName( const rtl::OUString& _name ) throw (uno::RuntimeException) { m_xProps->setPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ), uno::makeAny( _name ) ); + (rtl::OUString( "Name" ), uno::makeAny( _name ) ); } rtl::OUString SAL_CALL @@ -388,7 +388,7 @@ ScVbaControl::getControlTipText() throw (css::uno::RuntimeException) { rtl::OUString sName; m_xProps->getPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) ) ) >>= sName; + (rtl::OUString( "HelpText" ) ) >>= sName; return sName; } @@ -396,7 +396,7 @@ void SAL_CALL ScVbaControl::setControlTipText( const rtl::OUString& rsToolTip ) throw (css::uno::RuntimeException) { m_xProps->setPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) ), uno::makeAny( rsToolTip ) ); + (rtl::OUString( "HelpText" ), uno::makeAny( rsToolTip ) ); } ::rtl::OUString SAL_CALL ScVbaControl::getTag() @@ -414,13 +414,13 @@ void SAL_CALL ScVbaControl::setTag( const ::rtl::OUString& aTag ) ::sal_Int32 SAL_CALL ScVbaControl::getForeColor() throw (::com::sun::star::uno::RuntimeException) { sal_Int32 nForeColor = -1; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextColor" ) ) ) >>= nForeColor; + m_xProps->getPropertyValue( rtl::OUString( "TextColor" ) ) >>= nForeColor; return OORGBToXLRGB( nForeColor ); } void SAL_CALL ScVbaControl::setForeColor( ::sal_Int32 _forecolor ) throw (::com::sun::star::uno::RuntimeException) { - m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextColor" ) ), uno::makeAny( XLRGBToOORGB( _forecolor ) ) ); + m_xProps->setPropertyValue( rtl::OUString( "TextColor" ), uno::makeAny( XLRGBToOORGB( _forecolor ) ) ); } struct PointerStyles @@ -505,10 +505,10 @@ ScVbaControl::setMousePointer( ::sal_Int32 _mousepointer ) throw (::com::sun::st void ScVbaControl::fireEvent( script::ScriptEvent& evt ) { uno::Reference xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - uno::Reference< script::XScriptListener > xScriptListener( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.EventListener" ) ), mxContext ), uno::UNO_QUERY_THROW ); + uno::Reference< script::XScriptListener > xScriptListener( xServiceManager->createInstanceWithContext( rtl::OUString( "ooo.vba.EventListener" ), mxContext ), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xProps( xScriptListener, uno::UNO_QUERY_THROW ); - xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ), uno::makeAny( m_xModel ) ); + xProps->setPropertyValue( ::rtl::OUString( "Model" ), uno::makeAny( m_xModel ) ); // handling for sheet control uno::Reference< msforms::XControl > xThisControl( this ); @@ -526,7 +526,7 @@ void ScVbaControl::fireEvent( script::ScriptEvent& evt ) aEvt.Source = m_xEmptyFormControl; // Set up proper scriptcode uno::Reference< lang::XMultiServiceFactory > xDocFac( m_xModel, uno::UNO_QUERY_THROW ); - uno::Reference< document::XCodeNameQuery > xNameQuery( xDocFac->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooo.vba.VBACodeNameProvider")) ), uno::UNO_QUERY_THROW ); + uno::Reference< document::XCodeNameQuery > xNameQuery( xDocFac->createInstance( rtl::OUString("ooo.vba.VBACodeNameProvider") ), uno::UNO_QUERY_THROW ); uno::Reference< uno::XInterface > xIf( xControlShape->getControl(), uno::UNO_QUERY_THROW ); evt.ScriptCode = xNameQuery->getCodeNameForObject( xIf ); evt.Arguments[ 0 ] = uno::makeAny( aEvt ); @@ -555,18 +555,18 @@ void ScVbaControl::fireEvent( script::ScriptEvent& evt ) void ScVbaControl::fireChangeEvent() { script::ScriptEvent evt; - evt.ScriptType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VBAInterop") ); + evt.ScriptType = rtl::OUString( "VBAInterop" ); evt.ListenerType = form::XChangeListener::static_type(0); - evt.MethodName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("changed") ); + evt.MethodName = rtl::OUString( "changed" ); fireEvent( evt ); } void ScVbaControl::fireClickEvent() { script::ScriptEvent evt; - evt.ScriptType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VBAInterop") ); + evt.ScriptType = rtl::OUString( "VBAInterop" ); evt.ListenerType = awt::XActionListener::static_type(0); - evt.MethodName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("actionPerformed") ); + evt.MethodName = rtl::OUString( "actionPerformed" ); fireEvent( evt ); } @@ -588,7 +588,7 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R { uno::Reference< beans::XPropertySet > xProps( xControlShape->getControl(), uno::UNO_QUERY_THROW ); sal_Int32 nClassId = -1; - const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") ); + const static rtl::OUString sClassId( "ClassId" ); xProps->getPropertyValue( sClassId ) >>= nClassId; uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess uno::Reference< drawing::XShape > xShape( xControlShape, uno::UNO_QUERY_THROW ); @@ -616,7 +616,7 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R case form::FormComponentType::SCROLLBAR: return new ScVbaScrollBar( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() ); } - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unsupported control.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Unsupported control."), uno::Reference< uno::XInterface >() ); } /*static*/ uno::Reference< msforms::XControl > ScVbaControlFactory::createUserformControl( @@ -632,59 +632,59 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess ::std::auto_ptr< UserFormGeometryHelper > xGeoHelper( new UserFormGeometryHelper( xContext, xControl, fOffsetX, fOffsetY ) ); - if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCheckBoxModel") ) ) ) + if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlCheckBoxModel" ) ) ) xVBAControl.set( new ScVbaCheckbox( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlRadioButtonModel" ) ) ) xVBAControl.set( new ScVbaRadioButton( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlEditModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlEditModel" ) ) ) xVBAControl.set( new ScVbaTextBox( xVbaParent, xContext, xControl, xModel, xGeoHelper.release(), true ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlButtonModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlButtonModel" ) ) ) { sal_Bool bToggle = sal_False; - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toggle") ) ) >>= bToggle; + xProps->getPropertyValue( rtl::OUString( "Toggle" ) ) >>= bToggle; if ( bToggle ) xVBAControl.set( new ScVbaToggleButton( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); else xVBAControl.set( new ScVbaButton( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); } - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlComboBoxModel" ) ) ) xVBAControl.set( new ScVbaComboBox( xVbaParent, xContext, xControl, xModel, xGeoHelper.release(), true ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlListBoxModel" ) ) ) xVBAControl.set( new ScVbaListBox( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedTextModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlFixedTextModel" ) ) ) xVBAControl.set( new ScVbaLabel( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlImageControlModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlImageControlModel" ) ) ) xVBAControl.set( new ScVbaImage( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlProgressBarModel" ) ) ) xVBAControl.set( new ScVbaProgressBar( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlGroupBoxModel" ) ) ) xVBAControl.set( new ScVbaFrame( xVbaParent, xContext, xControl, xModel, xGeoHelper.release(), xDialog ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlScrollBarModel" ) ) ) xVBAControl.set( new ScVbaScrollBar( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoMultiPageModel" ) ) ) xVBAControl.set( new ScVbaMultiPage( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlSpinButtonModel" ) ) ) xVBAControl.set( new ScVbaSpinButton( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.custom.awt.UnoControlSystemAXContainerModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.custom.awt.UnoControlSystemAXContainerModel" ) ) ) xVBAControl.set( new VbaSystemAXControl( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); // #FIXME implement a page control - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoPageModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoPageModel" ) ) ) xVBAControl.set( new ScVbaControl( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoFrameModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoFrameModel" ) ) ) xVBAControl.set( new ScVbaFrame( xVbaParent, xContext, xControl, xModel, xGeoHelper.release(), xDialog ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.awt.UnoControlSpinButtonModel" ) ) ) xVBAControl.set( new ScVbaSpinButton( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.custom.awt.UnoControlSystemAXContainerModel") ) ) ) + else if ( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.custom.awt.UnoControlSystemAXContainerModel" ) ) ) xVBAControl.set( new VbaSystemAXControl( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) ); if( xVBAControl.is() ) return xVBAControl; - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unsupported control.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Unsupported control."), uno::Reference< uno::XInterface >() ); } rtl::OUString ScVbaControl::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaControl")); + return rtl::OUString("ScVbaControl"); } uno::Sequence< rtl::OUString > @@ -694,7 +694,7 @@ ScVbaControl::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Control" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.excel.Control" ); } return aServiceNames; } @@ -704,7 +704,7 @@ sal_Int32 nSysCols[] = { 0xC8D0D4, 0x0, 0x6A240A, 0x808080, 0xE4E4E4, 0xFFFFFF, sal_Int32 ScVbaControl::getBackColor() throw (uno::RuntimeException) { sal_Int32 nBackColor = 0; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= nBackColor; + m_xProps->getPropertyValue( rtl::OUString( "BackgroundColor" ) ) >>= nBackColor; return nBackColor; } @@ -714,7 +714,7 @@ void ScVbaControl::setBackColor( sal_Int32 nBackColor ) throw (uno::RuntimeExcep { nBackColor = nSysCols[ nBackColor - 0x80000000 ]; } - m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ), uno::makeAny( XLRGBToOORGB( nBackColor ) ) ); + m_xProps->setPropertyValue( rtl::OUString( "BackgroundColor" ), uno::makeAny( XLRGBToOORGB( nBackColor ) ) ); } sal_Bool ScVbaControl::getAutoSize() throw (uno::RuntimeException) @@ -730,13 +730,13 @@ void ScVbaControl::setAutoSize( sal_Bool /*bAutoSize*/ ) throw (uno::RuntimeExce sal_Bool ScVbaControl::getLocked() throw (uno::RuntimeException) { sal_Bool bRes( sal_False ); - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ) ) >>= bRes; + m_xProps->getPropertyValue( rtl::OUString( "ReadOnly" ) ) >>= bRes; return bRes; } void ScVbaControl::setLocked( sal_Bool bLocked ) throw (uno::RuntimeException) { - m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), uno::makeAny( bLocked ) ); + m_xProps->setPropertyValue( rtl::OUString( "ReadOnly" ), uno::makeAny( bLocked ) ); } typedef cppu::WeakImplHelper1< XControlProvider > ControlProvider_BASE; diff --git a/vbahelper/source/msforms/vbalabel.hxx b/vbahelper/source/msforms/vbalabel.hxx index 07f049ef69ec..00c6afd39fb0 100644 --- a/vbahelper/source/msforms/vbalabel.hxx +++ b/vbahelper/source/msforms/vbalabel.hxx @@ -56,7 +56,7 @@ public: virtual rtl::OUString getServiceImplName(); virtual css::uno::Sequence getServiceNames(); // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } + rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString("Value"); } }; #endif //SC_VBA_LABEL_HXX diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx index 394cb4237117..a7cd768c5960 100644 --- a/vbahelper/source/msforms/vbalistbox.cxx +++ b/vbahelper/source/msforms/vbalistbox.cxx @@ -35,9 +35,9 @@ using namespace com::sun::star; using namespace ooo::vba; -const static rtl::OUString TEXT( RTL_CONSTASCII_USTRINGPARAM("Text") ); -const static rtl::OUString SELECTEDITEMS( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ); -const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ); +const static rtl::OUString TEXT( "Text" ); +const static rtl::OUString SELECTEDITEMS( "SelectedItems" ); +const static rtl::OUString ITEMS( "StringItemList" ); ScVbaListBox::ScVbaListBox( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ListBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) @@ -73,8 +73,8 @@ ScVbaListBox::getValue() throw (uno::RuntimeException) m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection; m_xProps->getPropertyValue( ITEMS ) >>= sItems; if( getMultiSelect() ) - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Attribute use invalid." )), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( + "Attribute use invalid." ), uno::Reference< uno::XInterface >() ); uno::Any aRet; if ( sSelection.getLength() ) aRet = uno::makeAny( sItems[ sSelection[ 0 ] ] ); @@ -86,8 +86,8 @@ ScVbaListBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException) { if( getMultiSelect() ) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Attribute use invalid." )), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( + "Attribute use invalid." ), uno::Reference< uno::XInterface >() ); } rtl::OUString sValue = getAnyAsString( _value ); uno::Sequence< rtl::OUString > sList; @@ -105,8 +105,8 @@ ScVbaListBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException) } } if( nValue == -1 ) - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Attribute use invalid." )), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( + "Attribute use invalid." ), uno::Reference< uno::XInterface >() ); uno::Sequence< sal_Int16 > nSelectedIndices(1); uno::Sequence< sal_Int16 > nOldSelectedIndices; @@ -136,7 +136,7 @@ sal_Int32 SAL_CALL ScVbaListBox::getMultiSelect() throw (css::uno::RuntimeException) { sal_Bool bMultiSelect = sal_False; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ) ) >>= bMultiSelect; + m_xProps->getPropertyValue( rtl::OUString( "MultiSelection" ) ) >>= bMultiSelect; return bMultiSelect ? 1 : 0 ; } @@ -144,7 +144,7 @@ void SAL_CALL ScVbaListBox::setMultiSelect( sal_Int32 _multiselect ) throw (css::uno::RuntimeException) { sal_Bool bMultiSelect = _multiselect == 1 ? 1 : 0; - m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ), uno::makeAny( bMultiSelect ) ); + m_xProps->setPropertyValue( rtl::OUString( "MultiSelection" ), uno::makeAny( bMultiSelect ) ); } @@ -158,8 +158,8 @@ ScVbaListBox::Selected( sal_Int32 index ) throw (css::uno::RuntimeException) // the indices are but sal_Int16 sal_Int16 nIndex = static_cast< sal_Int16 >( index ); if( nIndex < 0 || nIndex >= nLength ) - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Error Number." )), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( + "Error Number." ), uno::Reference< uno::XInterface >() ); m_nIndex = nIndex; return uno::makeAny( uno::Reference< XPropValue > ( new ScVbaPropValue( this ) ) ); } @@ -192,8 +192,8 @@ ScVbaListBox::setValueEvent( const uno::Any& value ) { sal_Bool bValue = sal_False; if( !(value >>= bValue) ) - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Invalid type\n. need boolean." )), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( + "Invalid type\n. need boolean." ), uno::Reference< uno::XInterface >() ); uno::Sequence< sal_Int16 > nList; m_xProps->getPropertyValue( SELECTEDITEMS ) >>= nList; sal_Int16 nLength = static_cast( nList.getLength() ); @@ -244,7 +244,7 @@ css::uno::Any ScVbaListBox::getValueEvent() { uno::Sequence< sal_Int16 > nList; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) ) ) >>= nList; + m_xProps->getPropertyValue( rtl::OUString( "SelectedItems" ) ) >>= nList; sal_Int32 nLength = nList.getLength(); sal_Int32 nIndex = m_nIndex; @@ -284,7 +284,7 @@ uno::Reference< msforms::XNewFont > SAL_CALL ScVbaListBox::getFont() throw (uno: rtl::OUString ScVbaListBox::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaListBox")); + return rtl::OUString("ScVbaListBox"); } uno::Sequence< rtl::OUString > @@ -294,7 +294,7 @@ ScVbaListBox::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ScVbaListBox" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msforms.ScVbaListBox" ); } return aServiceNames; } diff --git a/vbahelper/source/msforms/vbalistbox.hxx b/vbahelper/source/msforms/vbalistbox.hxx index 70327bae4cfa..d027ae63fa61 100644 --- a/vbahelper/source/msforms/vbalistbox.hxx +++ b/vbahelper/source/msforms/vbalistbox.hxx @@ -75,7 +75,7 @@ public: virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException); // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } + rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString("Value"); } //XHelperInterface virtual rtl::OUString getServiceImplName(); diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.cxx b/vbahelper/source/msforms/vbalistcontrolhelper.cxx index 8186d3d660a6..4d3eddbf088c 100644 --- a/vbahelper/source/msforms/vbalistcontrolhelper.cxx +++ b/vbahelper/source/msforms/vbalistcontrolhelper.cxx @@ -6,7 +6,7 @@ using namespace com::sun::star; using namespace ooo::vba; -const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ); +const static rtl::OUString ITEMS( "StringItemList" ); class ListPropListener : public PropListener { @@ -29,8 +29,8 @@ ListPropListener::ListPropListener( const uno::Reference< beans::XPropertySet >& void ListPropListener::setValueEvent( const uno::Any& value ) { if( m_pvargIndex.hasValue() || m_pvarColumn.hasValue() ) - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Bad argument" )), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( + "Bad argument" ), uno::Reference< uno::XInterface >() ); m_xProps->setPropertyValue( ITEMS, value ); } @@ -46,13 +46,13 @@ uno::Any ListPropListener::getValueEvent() sal_Int16 nIndex = -1; m_pvargIndex >>= nIndex; if( nIndex < 0 || nIndex >= nLength ) - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Bad row Index" )), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( + "Bad row Index" ), uno::Reference< uno::XInterface >() ); aRet <<= sList[ nIndex ]; } else if ( m_pvarColumn.hasValue() ) // pvarColumn on its own would be bad - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Bad column Index" )), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( + "Bad column Index" ), uno::Reference< uno::XInterface >() ); else // List() ( e.g. no args ) { uno::Sequence< uno::Sequence< rtl::OUString > > sReturnArray( nLength ); @@ -131,7 +131,7 @@ ListControlHelper::removeItem( const uno::Any& index ) throw (uno::RuntimeExcept uno::Sequence< rtl::OUString > sList; m_xProps->getPropertyValue( ITEMS ) >>= sList; if( nIndex < 0 || nIndex > ( sList.getLength() - 1 ) ) - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid index")), uno::Reference< uno::XInterface > () ); + throw uno::RuntimeException( rtl::OUString("Invalid index"), uno::Reference< uno::XInterface > () ); if( sList.hasElements() ) { if( sList.getLength() == 1 ) diff --git a/vbahelper/source/msforms/vbamultipage.hxx b/vbahelper/source/msforms/vbamultipage.hxx index 9743d94a5640..dc0746f1effa 100644 --- a/vbahelper/source/msforms/vbamultipage.hxx +++ b/vbahelper/source/msforms/vbamultipage.hxx @@ -56,7 +56,7 @@ public: virtual rtl::OUString getServiceImplName(); virtual css::uno::Sequence getServiceNames(); // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } + rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString("Value"); } }; #endif //SC_VBA_LABEL_HXX diff --git a/vbahelper/source/msforms/vbaprogressbar.hxx b/vbahelper/source/msforms/vbaprogressbar.hxx index f7c61f466148..7bab228bfba3 100644 --- a/vbahelper/source/msforms/vbaprogressbar.hxx +++ b/vbahelper/source/msforms/vbaprogressbar.hxx @@ -47,7 +47,7 @@ public: virtual rtl::OUString getServiceImplName(); virtual css::uno::Sequence getServiceNames(); // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } + rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString("Value"); } }; #endif //SC_VBA_LABEL_HXX diff --git a/vbahelper/source/msforms/vbaradiobutton.hxx b/vbahelper/source/msforms/vbaradiobutton.hxx index befbcd55c4be..56cb5fcf2f49 100644 --- a/vbahelper/source/msforms/vbaradiobutton.hxx +++ b/vbahelper/source/msforms/vbaradiobutton.hxx @@ -48,7 +48,7 @@ public: virtual rtl::OUString getServiceImplName(); virtual css::uno::Sequence getServiceNames(); // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } + rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString("Value"); } }; #endif //SC_VBA_RADIOBUTTON_HXX diff --git a/vbahelper/source/msforms/vbatextbox.hxx b/vbahelper/source/msforms/vbatextbox.hxx index d416952fa8b3..7ce9a102e866 100644 --- a/vbahelper/source/msforms/vbatextbox.hxx +++ b/vbahelper/source/msforms/vbatextbox.hxx @@ -62,7 +62,7 @@ public: virtual void SAL_CALL setLocked( sal_Bool bAutoSize ) throw (css::uno::RuntimeException); // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } + rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString("Value"); } //XHelperInterface virtual rtl::OUString getServiceImplName(); virtual css::uno::Sequence getServiceNames(); diff --git a/vbahelper/source/msforms/vbatogglebutton.hxx b/vbahelper/source/msforms/vbatogglebutton.hxx index 5cc25c7f3811..4d910530c3dd 100644 --- a/vbahelper/source/msforms/vbatogglebutton.hxx +++ b/vbahelper/source/msforms/vbatogglebutton.hxx @@ -63,7 +63,7 @@ public: virtual rtl::OUString getServiceImplName(); virtual css::uno::Sequence getServiceNames(); // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } + rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString("Value"); } }; #endif //SC_VBA_TOGGLEBUTTON_HXX diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx index 323ffe41d882..2648da5ffbbd 100644 --- a/vbahelper/source/msforms/vbauserform.cxx +++ b/vbahelper/source/msforms/vbauserform.cxx @@ -113,13 +113,13 @@ rtl::OUString SAL_CALL ScVbaUserForm::getCaption() throw (uno::RuntimeException) { rtl::OUString sCaption; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ) ) >>= sCaption; + m_xProps->getPropertyValue( rtl::OUString( "Title" ) ) >>= sCaption; return sCaption; } void ScVbaUserForm::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException) { - m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ), uno::makeAny( _caption ) ); + m_xProps->setPropertyValue( rtl::OUString( "Title" ), uno::makeAny( _caption ) ); } double SAL_CALL ScVbaUserForm::getInnerWidth() throw (uno::RuntimeException) @@ -185,7 +185,7 @@ ScVbaUserForm::UnloadObject( ) throw (uno::RuntimeException) rtl::OUString ScVbaUserForm::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaUserForm")); + return rtl::OUString("ScVbaUserForm"); } uno::Sequence< rtl::OUString > @@ -195,7 +195,7 @@ ScVbaUserForm::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.UserForm" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.excel.UserForm" ); } return aServiceNames; } @@ -273,7 +273,7 @@ ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::Un uno::Reference< msforms::XControl > xVBAControl = ScVbaControlFactory::createUserformControl( mxContext, xControl, xDialogControl, m_xModel, mpGeometryHelper->getOffsetX(), mpGeometryHelper->getOffsetY() ); ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() ); if ( !m_sLibName.isEmpty() ) - pControl->setLibraryAndCodeName( m_sLibName.concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ).concat( getName() ) ); + pControl->setLibraryAndCodeName( m_sLibName.concat( rtl::OUString( "." ) ).concat( getName() ) ); aResult = uno::makeAny( xVBAControl ); } } @@ -309,7 +309,7 @@ ScVbaUserForm::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeEx uno::Reference< beans::XPropertySet > xDlgProps( xControl->getModel(), uno::UNO_QUERY ); if ( xDlgProps.is() ) { - uno::Reference< container::XNameContainer > xAllChildren( xDlgProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllDialogChildren")) ), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameContainer > xAllChildren( xDlgProps->getPropertyValue( rtl::OUString("AllDialogChildren") ), uno::UNO_QUERY_THROW ); sal_Bool bRes = xAllChildren->hasByName( aName ); OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d ---> %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xAllChildren.is(), bRes ); return bRes; diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index ecf1e50d2200..74e6666efb6a 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -110,7 +110,7 @@ public: void Start( const ::rtl::Reference< VbaApplicationBase > xBase, const ::rtl::OUString& aFunction, double nFrom, double nTo ) { if ( !xBase.is() || aFunction.isEmpty() ) - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected arguments!" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( ::rtl::OUString( "Unexpected arguments!" ), uno::Reference< uno::XInterface >() ); m_xBase = xBase; m_aTimerInfo = VbaTimerInfo( aFunction, ::std::pair< double, double >( nFrom, nTo ) ); @@ -215,8 +215,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(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ), uno::UNO_QUERY_THROW ); - rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" )); + uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString("LayoutManager") ), uno::UNO_QUERY_THROW ); + rtl::OUString url( "private:resource/statusbar/statusbar" ); if( xLayoutManager.is() && xLayoutManager->isElementVisible( url ) ){ return sal_True; } @@ -232,8 +232,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(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ), uno::UNO_QUERY_THROW ); - rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" )); + uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString("LayoutManager") ), uno::UNO_QUERY_THROW ); + rtl::OUString url( "private:resource/statusbar/statusbar" ); if( xLayoutManager.is() ){ if( bDisplayStatusBar && !xLayoutManager->isElementVisible( url ) ){ if( !xLayoutManager->showElement( url ) ) @@ -312,7 +312,7 @@ VbaApplicationBase::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeExc ::rtl::OUString SAL_CALL VbaApplicationBase::getVersion() throw (uno::RuntimeException) { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(OFFICEVERSION)); + return rtl::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) @@ -361,7 +361,7 @@ uno::Any SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, con } else { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("The macro doesn't exist") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "The macro doesn't exist" ), uno::Reference< uno::XInterface >() ); } } @@ -369,13 +369,13 @@ void SAL_CALL VbaApplicationBase::OnTime( const uno::Any& aEarliestTime, const : throw ( uno::RuntimeException ) { if ( aFunction.isEmpty() ) - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected function name!" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( ::rtl::OUString( "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( RTL_CONSTASCII_USTRINGPARAM( "Only double is supported as time for now!" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( ::rtl::OUString( "Only double is supported as time for now!" ), uno::Reference< uno::XInterface >() ); sal_Bool bSetTimer = sal_True; aSchedule >>= bSetTimer; @@ -414,7 +414,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( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.vbide.VBE" ) ), aArgs, mxContext ); + ::rtl::OUString( "ooo.vba.vbide.VBE" ), aArgs, mxContext ); return uno::Any( xVBE ); } catch( const uno::Exception& ) @@ -426,7 +426,7 @@ uno::Any SAL_CALL VbaApplicationBase::getVBE() throw (uno::RuntimeException) rtl::OUString VbaApplicationBase::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VbaApplicationBase")); + return rtl::OUString("VbaApplicationBase"); } uno::Sequence @@ -436,7 +436,7 @@ VbaApplicationBase::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.VbaApplicationBase" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.VbaApplicationBase" ); } return aServiceNames; } @@ -445,7 +445,7 @@ void SAL_CALL VbaApplicationBase::Undo() throw (uno::RuntimeException) { uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - dispatchRequests( xModel, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Undo" ) ) ); + dispatchRequests( xModel, ::rtl::OUString( ".uno:Undo" ) ); } void VbaApplicationBase::Quit() throw (uno::RuntimeException) diff --git a/vbahelper/source/vbahelper/vbacolorformat.cxx b/vbahelper/source/vbahelper/vbacolorformat.cxx index 7cd190847890..4dad2b094706 100644 --- a/vbahelper/source/vbahelper/vbacolorformat.cxx +++ b/vbahelper/source/vbahelper/vbacolorformat.cxx @@ -71,20 +71,20 @@ ScVbaColorFormat::getRGB() throw (uno::RuntimeException) switch( m_nColorFormatType ) { case ColorFormatType::LINEFORMAT_FORECOLOR: - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineColor")) ) >>= nRGB; + m_xPropertySet->getPropertyValue( rtl::OUString("LineColor") ) >>= nRGB; break; case ColorFormatType::LINEFORMAT_BACKCOLOR: //TODO BackColor not supported - // m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Color")), uno::makeAny( nRGB ) ); + // m_xPropertySet->setPropertyValue( rtl::OUString("Color"), uno::makeAny( nRGB ) ); break; case ColorFormatType::FILLFORMAT_FORECOLOR: - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")) ) >>= nRGB; + m_xPropertySet->getPropertyValue( rtl::OUString("FillColor") ) >>= nRGB; break; case ColorFormatType::FILLFORMAT_BACKCOLOR: nRGB = m_nFillFormatBackColor; break; default: - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Second parameter of ColorFormat is wrong.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() ); } nRGB = OORGBToXLRGB( nRGB ); return nRGB; @@ -97,13 +97,13 @@ ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException) switch( m_nColorFormatType ) { case ColorFormatType::LINEFORMAT_FORECOLOR: - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineColor")), uno::makeAny( nRGB ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("LineColor"), uno::makeAny( nRGB ) ); break; case ColorFormatType::LINEFORMAT_BACKCOLOR: // TODO BackColor not supported break; case ColorFormatType::FILLFORMAT_FORECOLOR: - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")), uno::makeAny( nRGB ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("FillColor"), uno::makeAny( nRGB ) ); if( m_pFillFormat ) { m_pFillFormat->setForeColorAndInternalStyle(nRGB); @@ -117,7 +117,7 @@ ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException) } break; default: - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Second parameter of ColorFormat is wrong.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() ); } } @@ -163,7 +163,7 @@ ScVbaColorFormat::setSchemeColor( sal_Int32 _schemecolor ) throw (uno::RuntimeEx rtl::OUString ScVbaColorFormat::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaColorFormat")); + return rtl::OUString("ScVbaColorFormat"); } uno::Sequence< rtl::OUString > @@ -173,7 +173,7 @@ ScVbaColorFormat::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ColorFormat" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msforms.ColorFormat" ); } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbacommandbar.cxx b/vbahelper/source/vbahelper/vbacommandbar.cxx index 11eec85e6227..dde7419ed630 100644 --- a/vbahelper/source/vbahelper/vbacommandbar.cxx +++ b/vbahelper/source/vbahelper/vbacommandbar.cxx @@ -47,7 +47,7 @@ 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(RTL_CONSTASCII_USTRINGPARAM("UIName")) ); + uno::Any aName = xPropertySet->getPropertyValue( rtl::OUString("UIName") ); rtl::OUString sName; aName >>= sName; if( sName.isEmpty() ) @@ -57,9 +57,9 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException ) if( m_sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) ) { if( pCBarHelper->getModuleId() == "com.sun.star.sheet.SpreadsheetDocument" ) - sName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Worksheet Menu Bar") ); + sName = rtl::OUString( "Worksheet Menu Bar" ); else if( pCBarHelper->getModuleId() == "com.sun.star.text.TextDocument" ) - sName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Menu Bar") ); + sName = rtl::OUString( "Menu Bar" ); return sName; } } @@ -69,7 +69,7 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException ) { uno::Sequence< beans::PropertyValue > aToolBar; xNameAccess->getByName( m_sResourceUrl ) >>= aToolBar; - getPropertyValue( aToolBar, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UIName") ) ) >>= sName; + getPropertyValue( aToolBar, rtl::OUString( "UIName" ) ) >>= sName; } } return sName; @@ -78,7 +78,7 @@ void SAL_CALL ScVbaCommandBar::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW ); - xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIName")), uno::makeAny( _name ) ); + xPropertySet->setPropertyValue( rtl::OUString("UIName"), uno::makeAny( _name ) ); pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings ); } @@ -97,7 +97,7 @@ ScVbaCommandBar::getVisible() throw (uno::RuntimeException) { uno::Sequence< beans::PropertyValue > aToolBar; xNameAccess->getByName( m_sResourceUrl ) >>= aToolBar; - getPropertyValue( aToolBar, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Visible") ) ) >>= bVisible; + getPropertyValue( aToolBar, rtl::OUString( "Visible" ) ) >>= bVisible; } } catch (const uno::Exception&) @@ -182,7 +182,7 @@ ScVbaCommandBar::FindControl( const uno::Any& /*aType*/, const uno::Any& /*aId*/ rtl::OUString ScVbaCommandBar::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBar")); + return rtl::OUString("ScVbaCommandBar"); } uno::Sequence @@ -192,7 +192,7 @@ ScVbaCommandBar::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBar" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBar" ); } return aServiceNames; } @@ -264,7 +264,7 @@ uno::Any SAL_CALL VbaDummyCommandBar::FindControl( const uno::Any& /*aType*/, co rtl::OUString VbaDummyCommandBar::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VbaDummyCommandBar")); + return rtl::OUString("VbaDummyCommandBar"); } uno::Sequence< rtl::OUString > VbaDummyCommandBar::getServiceNames() @@ -273,7 +273,7 @@ uno::Sequence< rtl::OUString > VbaDummyCommandBar::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBar" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBar" ); } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx index d71511f1036e..34a46b022175 100644 --- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx @@ -49,7 +49,7 @@ ScVbaCommandBarControl::getCaption() throw ( uno::RuntimeException ) { // "Label" always empty rtl::OUString sCaption; - getPropertyValue( m_aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ) >>= sCaption; + getPropertyValue( m_aPropertyValues, rtl::OUString("Label") ) >>= sCaption; return sCaption; } @@ -57,7 +57,7 @@ void SAL_CALL ScVbaCommandBarControl::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException) { rtl::OUString sCaption = _caption.replace('&','~'); - setPropertyValue( m_aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")), uno::makeAny( sCaption ) ); + setPropertyValue( m_aPropertyValues, rtl::OUString("Label"), uno::makeAny( sCaption ) ); ApplyChange(); } @@ -65,7 +65,7 @@ ScVbaCommandBarControl::setCaption( const ::rtl::OUString& _caption ) throw (uno ScVbaCommandBarControl::getOnAction() throw (uno::RuntimeException) { rtl::OUString sCommandURL; - getPropertyValue( m_aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CommandURL")) ) >>= sCommandURL; + getPropertyValue( m_aPropertyValues, rtl::OUString("CommandURL") ) >>= sCommandURL; return sCommandURL; } @@ -79,7 +79,7 @@ ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (u { 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(RTL_CONSTASCII_USTRINGPARAM("CommandURL")), uno::makeAny( aCommandURL ) ); + setPropertyValue( m_aPropertyValues, rtl::OUString("CommandURL"), uno::makeAny( aCommandURL ) ); ApplyChange(); } } @@ -171,7 +171,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(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER )) ) >>= xSubMenu; + getPropertyValue( m_aPropertyValues, rtl::OUString( ITEM_DESCRIPTOR_CONTAINER ) ) >>= xSubMenu; if( !xSubMenu.is() ) throw uno::RuntimeException(); @@ -186,7 +186,7 @@ ScVbaCommandBarControl::Controls( const uno::Any& aIndex ) throw (script::BasicE rtl::OUString ScVbaCommandBarControl::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarControl")); + return rtl::OUString("ScVbaCommandBarControl"); } uno::Sequence @@ -196,7 +196,7 @@ ScVbaCommandBarControl::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarControl" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarControl" ); } return aServiceNames; } @@ -212,7 +212,7 @@ ScVbaCommandBarPopup::ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelp rtl::OUString ScVbaCommandBarPopup::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarPopup")); + return rtl::OUString("ScVbaCommandBarPopup"); } uno::Sequence @@ -222,7 +222,7 @@ ScVbaCommandBarPopup::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarPopup" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarPopup" ); } return aServiceNames; } @@ -238,7 +238,7 @@ ScVbaCommandBarButton::ScVbaCommandBarButton( const css::uno::Reference< ov::XHe rtl::OUString ScVbaCommandBarButton::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarButton")); + return rtl::OUString("ScVbaCommandBarButton"); } uno::Sequence @@ -248,7 +248,7 @@ ScVbaCommandBarButton::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarButton" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarButton" ); } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx index 6cb4b516e253..74a74d63f58a 100644 --- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx @@ -71,15 +71,15 @@ uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemDat { uno::Sequence< beans::PropertyValue > aProps(7); - aProps[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL )); + aProps[0].Name = rtl::OUString( ITEM_DESCRIPTOR_COMMANDURL ); aProps[0].Value <<= sCommandURL; - aProps[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL )); + aProps[1].Name = rtl::OUString( ITEM_DESCRIPTOR_HELPURL ); aProps[1].Value <<= sHelpURL; - aProps[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL )); + aProps[2].Name = rtl::OUString( ITEM_DESCRIPTOR_LABEL ); aProps[2].Value <<= sLabel; - aProps[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE )); + aProps[3].Name = rtl::OUString( ITEM_DESCRIPTOR_TYPE ); aProps[3].Value <<= nType; - aProps[4].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER )); + aProps[4].Name = rtl::OUString( ITEM_DESCRIPTOR_CONTAINER ); aProps[4].Value = aSubMenu; aProps[5].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ISVISIBLE ); aProps[5].Value <<= isVisible; @@ -93,19 +93,19 @@ uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateToolbarItem { uno::Sequence< beans::PropertyValue > aProps(7); - aProps[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL )); + aProps[0].Name = rtl::OUString( ITEM_DESCRIPTOR_COMMANDURL ); aProps[0].Value <<= sCommandURL; - aProps[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL )); + aProps[1].Name = rtl::OUString( ITEM_DESCRIPTOR_HELPURL ); aProps[1].Value <<= sHelpURL; - aProps[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL )); + aProps[2].Name = rtl::OUString( ITEM_DESCRIPTOR_LABEL ); aProps[2].Value <<= sLabel; - aProps[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE )); + aProps[3].Name = rtl::OUString( ITEM_DESCRIPTOR_TYPE ); aProps[3].Value <<= nType; - aProps[4].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER )); + aProps[4].Name = rtl::OUString( ITEM_DESCRIPTOR_CONTAINER ); aProps[4].Value = aSubMenu; - aProps[5].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_ISVISIBLE )); + aProps[5].Name = rtl::OUString( ITEM_DESCRIPTOR_ISVISIBLE ); aProps[5].Value <<= isVisible; - aProps[6].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_STYLE )); + aProps[6].Name = rtl::OUString( ITEM_DESCRIPTOR_STYLE ); aProps[6].Value <<= nStyle; return aProps; @@ -132,7 +132,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(RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER )) ) >>= xSubMenu; + getPropertyValue( aProps, rtl::OUString( 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 ); @@ -171,8 +171,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(RTL_CONSTASCII_USTRINGPARAM("Custom")); - rtl::OUString sCommandUrl(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CUSTOM_MENU_STR)) + sLabel); + rtl::OUString sLabel("Custom"); + rtl::OUString sCommandUrl(rtl::OUString( CUSTOM_MENU_STR) + sLabel); sal_Int32 nType = office::MsoControlType::msoControlButton; sal_Int32 nPosition = 0; sal_Bool bTemporary = sal_True; @@ -184,11 +184,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( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); if( Id.hasValue() || Parameter.hasValue( ) ) { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); } if( Before.hasValue() ) @@ -241,7 +241,7 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un rtl::OUString ScVbaCommandBarControls::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarControls")); + return rtl::OUString("ScVbaCommandBarControls"); } uno::Sequence @@ -251,7 +251,7 @@ ScVbaCommandBarControls::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarControls" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarControls" ); } return aServiceNames; } @@ -314,7 +314,7 @@ uno::Reference< XCommandBarControl > SAL_CALL VbaDummyCommandBarControls::Add( // XHelperInterface rtl::OUString VbaDummyCommandBarControls::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VbaDummyCommandBarControls")); + return rtl::OUString("VbaDummyCommandBarControls"); } uno::Sequence VbaDummyCommandBarControls::getServiceNames() @@ -323,7 +323,7 @@ uno::Sequence VbaDummyCommandBarControls::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarControls" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarControls" ); } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx index 6223ee04f0ac..8c62b882e526 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx @@ -41,7 +41,7 @@ using namespace com::sun::star; using namespace ooo::vba; -#define CREATEOUSTRING(asciistr) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(asciistr)) +#define CREATEOUSTRING(asciistr) rtl::OUString(asciistr) typedef std::map< rtl::OUString, rtl::OUString > MSO2OOCommandbarMap; @@ -105,27 +105,27 @@ 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( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument") ) ) ) + if( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.sheet.SpreadsheetDocument" ) ) ) { - maModuleId = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument") ); + maModuleId = rtl::OUString( "com.sun.star.sheet.SpreadsheetDocument" ); } - else if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) ) + else if( xServiceInfo->supportsService( rtl::OUString( "com.sun.star.text.TextDocument" ) ) ) { - maModuleId = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument") ); + maModuleId = rtl::OUString( "com.sun.star.text.TextDocument" ); } if( maModuleId.isEmpty() ) { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); } uno::Reference< lang::XMultiServiceFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUICfgMgrSupp( xServiceManager->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ))), uno::UNO_QUERY_THROW ); + css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUICfgMgrSupp( xServiceManager->createInstance( rtl::OUString( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" )), uno::UNO_QUERY_THROW ); m_xAppCfgMgr.set( xUICfgMgrSupp->getUIConfigurationManager( maModuleId ), uno::UNO_QUERY_THROW ); - css::uno::Reference< css::container::XNameAccess > xNameAccess( xServiceManager->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.WindowStateConfiguration" ))), uno::UNO_QUERY_THROW ); + css::uno::Reference< css::container::XNameAccess > xNameAccess( xServiceManager->createInstance( rtl::OUString( "com.sun.star.ui.WindowStateConfiguration" )), uno::UNO_QUERY_THROW ); m_xWindowState.set( xNameAccess->getByName( maModuleId ), uno::UNO_QUERY_THROW ); } @@ -185,7 +185,7 @@ 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(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XLayoutManager > xLayoutManager( xPropertySet->getPropertyValue( rtl::OUString("LayoutManager") ), uno::UNO_QUERY_THROW ); return xLayoutManager; } @@ -195,7 +195,7 @@ sal_Bool VbaCommandBarHelper::hasToolbar( const rtl::OUString& sResourceUrl, con { rtl::OUString sUIName; uno::Reference< beans::XPropertySet > xPropertySet( m_xDocCfgMgr->getSettings( sResourceUrl, sal_False ), uno::UNO_QUERY_THROW ); - xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ITEM_DESCRIPTOR_UINAME)) ) >>= sUIName; + xPropertySet->getPropertyValue( rtl::OUString(ITEM_DESCRIPTOR_UINAME) ) >>= sUIName; if( sName.equalsIgnoreAsciiCase( sUIName ) ) return sal_True; } @@ -216,7 +216,7 @@ rtl::OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< for( sal_Int32 i = 0; i < allNames.getLength(); i++ ) { sResourceUrl = allNames[i]; - if(sResourceUrl.indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_TOOLBAR_URL )) ) == 0 ) + if(sResourceUrl.indexOf( rtl::OUString( ITEM_TOOLBAR_URL ) ) == 0 ) { if( hasToolbar( sResourceUrl, sName ) ) return sResourceUrl; @@ -224,7 +224,7 @@ rtl::OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< } // the customize toolbars creating during importing, shoud found there. - static rtl::OUString sToolbarPrefix( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/custom_" ) ); + static rtl::OUString sToolbarPrefix( "private:resource/toolbar/custom_" ); sResourceUrl = sToolbarPrefix.concat( sName ); if( hasToolbar( sResourceUrl, sName ) ) return sResourceUrl; @@ -241,7 +241,7 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css { rtl::OUString sLabel; xIndexAccess->getByIndex( i ) >>= aProps; - getPropertyValue( aProps, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ITEM_DESCRIPTOR_LABEL)) ) >>= sLabel; + getPropertyValue( aProps, rtl::OUString(ITEM_DESCRIPTOR_LABEL) ) >>= sLabel; // handle the hotkey marker '~' (remove in toolbars (?), replace by '&' in menus) ::rtl::OUStringBuffer aBuffer; sal_Int32 index = sLabel.indexOf( sal_Unicode('~') ); @@ -268,8 +268,8 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css rtl::OUString VbaCommandBarHelper::generateCustomURL() { - rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM( ITEM_TOOLBAR_URL )); - url += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CUSTOM_TOOLBAR_STR )); + rtl::OUString url( ITEM_TOOLBAR_URL ); + url += rtl::OUString( CUSTOM_TOOLBAR_STR ); // use a random number to minimize possible clash with existing custom toolbars srand( unsigned( time( NULL ) )); diff --git a/vbahelper/source/vbahelper/vbacommandbars.cxx b/vbahelper/source/vbahelper/vbacommandbars.cxx index 4703a1d5f339..d07f2e39981d 100644 --- a/vbahelper/source/vbahelper/vbacommandbars.cxx +++ b/vbahelper/source/vbahelper/vbacommandbars.cxx @@ -68,7 +68,7 @@ public: if( hasMoreElements() ) { rtl::OUString sResourceUrl( m_sNames[ m_nCurrentPosition++ ] ); - if( sResourceUrl.indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/")) ) != -1 ) + if( sResourceUrl.indexOf( rtl::OUString("private:resource/toolbar/") ) != -1 ) { uno::Reference< container::XIndexAccess > xCBarSetting = m_pCBarHelper->getSettings( sResourceUrl ); uno::Reference< XCommandBar > xCommandBar( new ScVbaCommandBar( m_xParent, m_xContext, m_pCBarHelper, xCBarSetting, sResourceUrl, sal_False, sal_False ) ); @@ -123,7 +123,7 @@ ScVbaCommandBars::createCollectionObject( const uno::Any& aSource ) if( sBarName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("Worksheet Menu Bar") ) ) { // spreadsheet menu bar - sResourceUrl = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_MENUBAR_URL )); + sResourceUrl = rtl::OUString( ITEM_MENUBAR_URL ); bMenu = sal_True; } else if( sBarName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("Cell") ) ) @@ -137,7 +137,7 @@ ScVbaCommandBars::createCollectionObject( const uno::Any& aSource ) if( sBarName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("Menu Bar") ) ) { // text processor menu bar - sResourceUrl = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ITEM_MENUBAR_URL )); + sResourceUrl = rtl::OUString( ITEM_MENUBAR_URL ); bMenu = sal_True; } } @@ -157,7 +157,7 @@ ScVbaCommandBars::createCollectionObject( const uno::Any& aSource ) } if( !aRet.hasValue() ) - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toolbar do not exist") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "Toolbar do not exist" ), uno::Reference< uno::XInterface >() ); return aRet; } @@ -178,11 +178,11 @@ ScVbaCommandBars::Add( const css::uno::Any& Name, const css::uno::Any& /*Positio { sResourceUrl = m_pCBarHelper->findToolbarByName( m_xNameAccess, sName ); if( !sResourceUrl.isEmpty() ) - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toolbar exists") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "Toolbar exists" ), uno::Reference< uno::XInterface >() ); } else { - sName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom1") ); + sName = rtl::OUString( "Custom1" ); } sal_Bool bTemporary = sal_False; @@ -203,7 +203,7 @@ ScVbaCommandBars::getCount() throw(css::uno::RuntimeException) uno::Sequence< ::rtl::OUString > allNames = m_xNameAccess->getElementNames(); for( sal_Int32 i = 0; i < allNames.getLength(); i++ ) { - if(allNames[i].indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/")) ) != -1 ) + if(allNames[i].indexOf( rtl::OUString("private:resource/toolbar/") ) != -1 ) { nCount++; } @@ -227,9 +227,9 @@ ScVbaCommandBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) th { uno::Any aSource; if( m_pCBarHelper->getModuleId() == "com.sun.star.sheet.SpreadsheetDocument" ) - aSource <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Worksheet Menu Bar")); + aSource <<= rtl::OUString("Worksheet Menu Bar"); else if( m_pCBarHelper->getModuleId() == "com.sun.star.text.TextDocument" ) - aSource <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Menu Bar")); + aSource <<= rtl::OUString("Menu Bar"); if( aSource.hasValue() ) return createCollectionObject( aSource ); } @@ -240,7 +240,7 @@ ScVbaCommandBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) th rtl::OUString ScVbaCommandBars::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBars")); + return rtl::OUString("ScVbaCommandBars"); } uno::Sequence @@ -250,7 +250,7 @@ ScVbaCommandBars::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBars" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBars" ); } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index f10c68285290..ccc90ce83443 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -94,7 +94,7 @@ public: m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< frame::XDesktop > xDesktop - (xSMgr->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")), m_xContext), uno::UNO_QUERY_THROW ); + (xSMgr->createInstanceWithContext(::rtl::OUString("com.sun.star.frame.Desktop"), m_xContext), uno::UNO_QUERY_THROW ); uno::Reference< container::XEnumeration > mxComponents = xDesktop->getComponents()->createEnumeration(); while( mxComponents->hasMoreElements() ) { @@ -263,25 +263,25 @@ uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException) uno::Reference< frame::XComponentLoader > xLoader( xSMgr->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")), + ::rtl::OUString("com.sun.star.frame.Desktop"), mxContext), uno::UNO_QUERY_THROW ); rtl::OUString sURL; if( meDocType == WORD_DOCUMENT ) - sURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("private:factory/swriter") ); + sURL = rtl::OUString( "private:factory/swriter" ); else if( meDocType == EXCEL_DOCUMENT ) - sURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("private:factory/scalc") ); + sURL = rtl::OUString( "private:factory/scalc" ); else - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "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( RTL_CONSTASCII_USTRINGPARAM( "ApplyFormDesignMode" ) ), uno::Any( false ) ); + aMediaDesc.setComponentDataEntry( ::rtl::OUString( "ApplyFormDesignMode" ), uno::Any( false ) ); // craete the new document uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( sURL , - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0, + rtl::OUString( "_blank" ), 0, aMediaDesc.getAsConstPropertyValueList() ); // #163808# lock document controllers and container window if specified by application @@ -298,7 +298,7 @@ void VbaDocumentsBase::closeDocuments() throw (uno::RuntimeException) uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CloseDoc")); + rtl::OUString url = rtl::OUString( ".uno:CloseDoc"); dispatchRequests(xModel,url); */ } @@ -323,17 +323,17 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< frame::XDesktop > xDesktop - (xSMgr->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) , mxContext), + (xSMgr->createInstanceWithContext(::rtl::OUString("com.sun.star.frame.Desktop") , mxContext), uno::UNO_QUERY_THROW ); uno::Reference< frame::XComponentLoader > xLoader( xSMgr->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")), + ::rtl::OUString("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( RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode") ); + sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( "MacroExecutionMode" ); sProps[ sProps.getLength() - 1 ].Value <<= document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN; if ( ReadOnly.hasValue() ) @@ -342,13 +342,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( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ); + sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( "ReadOnly" ); sProps[ sProps.getLength() - 1 ].Value <<= true; } } uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( aURL, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_default") ), + rtl::OUString( "_default" ), frame::FrameSearchFlag::CREATE, sProps); diff --git a/vbahelper/source/vbahelper/vbafillformat.cxx b/vbahelper/source/vbahelper/vbafillformat.cxx index de7f35b5da96..b8b8d732c3f2 100644 --- a/vbahelper/source/vbahelper/vbafillformat.cxx +++ b/vbahelper/source/vbahelper/vbafillformat.cxx @@ -50,7 +50,7 @@ ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::Runti m_nFillStyle = nFillStyle; if( m_nFillStyle == drawing::FillStyle_GRADIENT ) { - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")), uno::makeAny( drawing::FillStyle_GRADIENT ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny( drawing::FillStyle_GRADIENT ) ); awt::Gradient aGradient; // AXIAL // RADIAL @@ -67,11 +67,11 @@ ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::Runti aGradient.StartIntensity = 100; aGradient.EndIntensity = 100; aGradient.StepCount = 1; - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillGradient")), uno::makeAny( aGradient ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("FillGradient"), uno::makeAny( aGradient ) ); } else if( m_nFillStyle == drawing::FillStyle_SOLID ) { - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")), uno::makeAny(drawing::FillStyle_SOLID) ); + m_xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny(drawing::FillStyle_SOLID) ); } } @@ -87,7 +87,7 @@ sal_Bool SAL_CALL ScVbaFillFormat::getVisible() throw (uno::RuntimeException) { drawing::FillStyle nFillStyle; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")) ) >>= nFillStyle; + m_xPropertySet->getPropertyValue( rtl::OUString("FillStyle") ) >>= nFillStyle; if( nFillStyle == drawing::FillStyle_NONE ) return sal_False; return sal_True; @@ -97,10 +97,10 @@ void SAL_CALL ScVbaFillFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException) { drawing::FillStyle aFillStyle; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")) ) >>= aFillStyle; + m_xPropertySet->getPropertyValue( rtl::OUString("FillStyle") ) >>= aFillStyle; if( !_visible ) { - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")), uno::makeAny( drawing::FillStyle_NONE ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny( drawing::FillStyle_NONE ) ); } else { @@ -116,7 +116,7 @@ ScVbaFillFormat::getTransparency() throw (uno::RuntimeException) { sal_Int16 nTransparence = 0; double dTransparence = 0; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillTransparence")) ) >>= nTransparence; + m_xPropertySet->getPropertyValue( rtl::OUString("FillTransparence") ) >>= nTransparence; dTransparence = static_cast( nTransparence ); dTransparence /= 100; return dTransparence; @@ -126,7 +126,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(RTL_CONSTASCII_USTRINGPARAM("FillTransparence")), uno::makeAny( nTransparence ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("FillTransparence"), uno::makeAny( nTransparence ) ); } @@ -181,7 +181,7 @@ ScVbaFillFormat::ForeColor() throw (uno::RuntimeException) rtl::OUString ScVbaFillFormat::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaFillFormat")); + return rtl::OUString("ScVbaFillFormat"); } uno::Sequence< rtl::OUString > @@ -191,7 +191,7 @@ ScVbaFillFormat::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.FillFormat" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msforms.FillFormat" ); } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index ebfc85476be3..4132e9dba3de 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -118,7 +118,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(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.Introspection")) ), uno::UNO_QUERY_THROW ); + xIntrospection.set( xFactory->createInstance( rtl::OUString("com.sun.star.beans.Introspection") ), uno::UNO_QUERY_THROW ); } return xIntrospection->inspect( aObject ); } @@ -126,7 +126,7 @@ getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException) uno::Reference< script::XTypeConverter > getTypeConverter( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - static uno::Reference< script::XTypeConverter > xTypeConv( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter") ), xContext ), uno::UNO_QUERY_THROW ); + static uno::Reference< script::XTypeConverter > xTypeConv( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString( "com.sun.star.script.Converter" ), xContext ), uno::UNO_QUERY_THROW ); return xTypeConv; } const uno::Any& @@ -156,14 +156,14 @@ dispatchRequests (const uno::Reference< frame::XModel>& xModel, const rtl::OUStr { util::URL url; url.Complete = aUrl; - rtl::OUString emptyString = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" )); + rtl::OUString emptyString = rtl::OUString( "" ); uno::Reference xController = xModel->getCurrentController(); uno::Reference xFrame = xController->getFrame(); uno::Reference xDispatchProvider (xFrame,uno::UNO_QUERY_THROW); try { uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - uno::Reference xContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW ); + uno::Reference xContext( xProps->getPropertyValue( rtl::OUString( "DefaultContext" )), uno::UNO_QUERY_THROW ); if ( !xContext.is() ) return; @@ -172,7 +172,7 @@ dispatchRequests (const uno::Reference< frame::XModel>& xModel, const rtl::OUStr return; uno::Reference xParser( xServiceManager->createInstanceWithContext( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) ), xContext), + rtl::OUString( "com.sun.star.util.URLTransformer" ), xContext), uno::UNO_QUERY_THROW ); if (!xParser.is()) return; @@ -202,7 +202,7 @@ dispatchRequests (const uno::Reference< frame::XModel>& xModel, const rtl::OUStr if ( bSilent ) { - (*pDest).Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Silent" )); + (*pDest).Name = rtl::OUString( "Silent" ); (*pDest).Value <<= (sal_Bool)sal_True; } @@ -258,7 +258,7 @@ getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException) !xModel.is() ) { throw uno::RuntimeException( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't extract model from basic ( it's obviously not set yet ) therefore don't know the current document context") ), uno::Reference< uno::XInterface >() ); + 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 >() ); } else { @@ -271,9 +271,7 @@ getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException) { OSL_TRACE("Failed to get %s", rtl::OUStringToOString( sKey, RTL_TEXTENCODING_UTF8 ).getStr() ); throw uno::RuntimeException( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "Can't determine the currently selected document") ), + rtl::OUString( "Can't determine the currently selected document" ), uno::Reference< uno::XInterface >() ); } return xModel; @@ -292,19 +290,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( RTL_CONSTASCII_USTRINGPARAM("ExcelDocumentContext" ) ), xContext ); + return getCurrentDocCtx( rtl::OUString( "ExcelDocumentContext" ), xContext ); } uno::Reference< frame::XModel > getThisWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - return getCurrentDocCtx( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WordDocumentContext" ) ), xContext ); + return getCurrentDocCtx( rtl::OUString( "WordDocumentContext" ), xContext ); } uno::Reference< frame::XModel > getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - static const rtl::OUString sThisExcelDoc( RTL_CONSTASCII_USTRINGPARAM("ThisExcelDoc" ) ); + static const rtl::OUString sThisExcelDoc( "ThisExcelDoc" ); uno::Reference< frame::XModel > xModel; try { @@ -320,7 +318,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( RTL_CONSTASCII_USTRINGPARAM("ThisWordDoc" ) ); + static const rtl::OUString sThisWordDoc( "ThisWordDoc" ); uno::Reference< frame::XModel > xModel; try { @@ -398,7 +396,7 @@ 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_CONSTASCII_USTRINGPARAM( "-" ) ); + rtl::OUString sRange( "-" ); rtl::OUString sFileName; if (( nFrom || nTo ) ) @@ -509,7 +507,7 @@ bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException) return rAny.get< sal_Int64 >() != 0; default:; } - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid type, cannot convert to boolean." ) ), 0 ); + throw uno::RuntimeException( ::rtl::OUString( "Invalid type, cannot convert to boolean." ), 0 ); } ::rtl::OUString extractStringFromAny( const uno::Any& rAny, bool bUppercaseBool ) throw (uno::RuntimeException) @@ -520,7 +518,7 @@ bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException) return rAny.get< ::rtl::OUString >(); case uno::TypeClass_BOOLEAN: return bUppercaseBool ? - (rAny.get< bool >() ? ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TRUE" ) ) : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) )) : + (rAny.get< bool >() ? ::rtl::OUString( "TRUE" ) : ::rtl::OUString( "FALSE" )) : ::rtl::OUString::valueOf( (sal_Bool)rAny.get< bool >() ); case uno::TypeClass_FLOAT: return ::rtl::OUString::valueOf( rAny.get< float >() ); @@ -534,7 +532,7 @@ bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException) return ::rtl::OUString::valueOf( rAny.get< sal_Int64 >() ); default:; } - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid type, cannot convert to string." ) ), 0 ); + throw uno::RuntimeException( ::rtl::OUString( "Invalid type, cannot convert to string." ), 0 ); } ::rtl::OUString extractStringFromAny( const uno::Any& rAny, const ::rtl::OUString& rDefault, bool bUppercaseBool ) throw (uno::RuntimeException) @@ -599,7 +597,7 @@ ContainerUtilities::FieldInList( const uno::Sequence< rtl::OUString >& SearchLis } bool NeedEsc(sal_Unicode cCode) { - String sEsc(RTL_CONSTASCII_USTRINGPARAM(".^$+\\|{}()")); + String sEsc(".^$+\\|{}()"); return (STRING_NOTFOUND != sEsc.Search(cCode)); } @@ -622,11 +620,11 @@ rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike ) start++; break; case '*': - sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*"))); + sResult.append(rtl::OUString(".*")); start++; break; case '#': - sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[0-9]"))); + sResult.append(rtl::OUString("[0-9]")); start++; break; case '~': @@ -873,7 +871,7 @@ UserFormGeometryHelper::UserFormGeometryHelper( mbDialog( uno::Reference< awt::XDialog >( xControl, uno::UNO_QUERY ).is() ) { if ( !xControl.is() ) - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No control is provided!" ) ), + throw uno::RuntimeException( ::rtl::OUString( "No control is provided!" ), uno::Reference< uno::XInterface >() ); mxWindow.set( xControl->getPeer(), uno::UNO_QUERY_THROW ); @@ -1071,7 +1069,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(RTL_CONSTASCII_USTRINGPARAM("No valid shape for helper")), css::uno::Reference< css::uno::XInterface >() ); + throw css::uno::RuntimeException( rtl::OUString("No valid shape for helper"), css::uno::Reference< css::uno::XInterface >() ); } double ShapeHelper::getHeight() const @@ -1143,7 +1141,7 @@ void ShapeHelper::setTop(double _fTop) void DebugHelper::exception( const rtl::OUString& DetailedMessage, const css::uno::Exception& ex, int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException ) { // #TODO #FIXME ( do we want to support additionalArg here ) - throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() ); + throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString(" ") ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() ); } void DebugHelper::exception( int err, const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException ) @@ -1210,7 +1208,7 @@ uno::Reference< XHelperInterface > getVBADocument( const uno::Reference< frame:: { uno::Reference< beans::XPropertySet > xDocProps( xModel, uno::UNO_QUERY_THROW ); ::rtl::OUString aCodeName; - xDocProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CodeName" ) ) ) >>= aCodeName; + xDocProps->getPropertyValue( ::rtl::OUString( "CodeName" ) ) >>= aCodeName; xIf = getUnoDocModule( aCodeName, getSfxObjShell( xModel ) ); } catch (const uno::Exception&) @@ -1224,7 +1222,7 @@ uno::Reference< XHelperInterface > getUnoDocModule( const String& aModName, SfxO uno::Reference< XHelperInterface > xIf; if ( pShell ) { - rtl::OUString sProj( RTL_CONSTASCII_USTRINGPARAM("Standard") ); + rtl::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 0c8ab87c8369..90527ea8b3dc 100644 --- a/vbahelper/source/vbahelper/vbalineformat.cxx +++ b/vbahelper/source/vbahelper/vbalineformat.cxx @@ -90,17 +90,17 @@ ScVbaLineFormat::convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadSt case office::MsoArrowheadStyle::msoArrowheadNone: return rtl::OUString(); case office::MsoArrowheadStyle::msoArrowheadStealth: - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Arrow concave")); + return rtl::OUString("Arrow concave"); case office::MsoArrowheadStyle::msoArrowheadOpen: - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Line Arrow")); + return rtl::OUString("Line Arrow"); case office::MsoArrowheadStyle::msoArrowheadOval: - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Circle")); + return rtl::OUString("Circle"); case office::MsoArrowheadStyle::msoArrowheadDiamond: - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Square 45")); + return rtl::OUString("Square 45"); case office::MsoArrowheadStyle::msoArrowheadTriangle: - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Arrow")); + return rtl::OUString("Arrow"); default: - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid Arrow Style!")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Invalid Arrow Style!"), uno::Reference< uno::XInterface >() ); } } @@ -110,10 +110,10 @@ ScVbaLineFormat::getBeginArrowheadStyle() throw (uno::RuntimeException) { sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone; rtl::OUString sLineName; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStartName")) ) >>= sLineName; - if( ( sLineName.getLength() > 7 ) && ( sLineName.indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("msArray")) ) ) != -1 ) + m_xPropertySet->getPropertyValue( rtl::OUString("LineStartName") ) >>= sLineName; + if( ( sLineName.getLength() > 7 ) && ( sLineName.indexOf( rtl::OUString("msArray") ) ) != -1 ) { - sal_Int32 nIndex = sLineName.indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) ); + sal_Int32 nIndex = sLineName.indexOf( rtl::OUString(" ") ); rtl::OUString sName = sLineName.copy( 0, nIndex ); //sal_Int32 nSize = sLineName.copy( nIndex + 1 ).toInt32(); nLineType = convertLineStartEndNameToArrowheadStyle( sName ); @@ -129,31 +129,31 @@ void SAL_CALL ScVbaLineFormat::setBeginArrowheadStyle( sal_Int32 _beginarrowheadstyle ) throw (uno::RuntimeException) { rtl::OUString sArrayName = convertArrowheadStyleToLineStartEndName( _beginarrowheadstyle ); - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStartName")), uno::makeAny( sArrayName ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("LineStartName"), uno::makeAny( sArrayName ) ); } sal_Int32 SAL_CALL ScVbaLineFormat::getBeginArrowheadLength() throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); } void SAL_CALL ScVbaLineFormat::setBeginArrowheadLength( sal_Int32 /*_beginarrowheadlength*/ ) throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); } sal_Int32 SAL_CALL ScVbaLineFormat::getBeginArrowheadWidth() throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); } void SAL_CALL ScVbaLineFormat::setBeginArrowheadWidth( sal_Int32 /*_beginarrowheadwidth*/ ) throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); } sal_Int32 SAL_CALL @@ -170,32 +170,32 @@ ScVbaLineFormat::setEndArrowheadStylel( sal_Int32 /*_endarrowheadstylel*/ ) thro sal_Int32 SAL_CALL ScVbaLineFormat::getEndArrowheadLength() throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); } void SAL_CALL ScVbaLineFormat::setEndArrowheadLength( sal_Int32 /*_endarrowheadlength*/ ) throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); } sal_Int32 SAL_CALL ScVbaLineFormat::getEndArrowheadWidth() throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); } void SAL_CALL ScVbaLineFormat::setEndArrowheadWidth( sal_Int32 /*_endarrowheadwidth*/ ) throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 'EndArrowheadWidth' is not supported.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("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(RTL_CONSTASCII_USTRINGPARAM("LineWidth")) ) >>= nLineWidth; + m_xPropertySet->getPropertyValue( rtl::OUString("LineWidth") ) >>= nLineWidth; double dLineWidth = Millimeter::getInPoints( nLineWidth ); return dLineWidth; } @@ -204,7 +204,7 @@ void SAL_CALL ScVbaLineFormat::setWeight( double _weight ) throw (uno::RuntimeException) { if( _weight < 0 ) - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parameter: Must be positive.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Parameter: Must be positive."), uno::Reference< uno::XInterface >() ); if( _weight == 0 ) _weight = 0.5; m_nLineWeight = _weight; @@ -212,7 +212,7 @@ ScVbaLineFormat::setWeight( double _weight ) throw (uno::RuntimeException) aMillimeter.setInPoints( _weight ); sal_Int32 nLineWidth = static_cast( aMillimeter.getInHundredthsOfOneMillimeter() ); - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineWidth")), uno::makeAny( nLineWidth ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("LineWidth"), uno::makeAny( nLineWidth ) ); setDashStyle( m_nLineDashStyle ); } @@ -220,7 +220,7 @@ sal_Bool SAL_CALL ScVbaLineFormat::getVisible() throw (uno::RuntimeException) { drawing::LineStyle aLineStyle; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")) ) >>= aLineStyle; + m_xPropertySet->getPropertyValue( rtl::OUString("LineStyle") ) >>= aLineStyle; if( aLineStyle == drawing::LineStyle_NONE ) { return sal_False; @@ -232,11 +232,11 @@ void SAL_CALL ScVbaLineFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException) { drawing::LineStyle aLineStyle; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")) ) >>= aLineStyle; + m_xPropertySet->getPropertyValue( rtl::OUString("LineStyle") ) >>= aLineStyle; if( !_visible ) { aLineStyle = drawing::LineStyle_NONE; - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")), uno::makeAny( aLineStyle ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("LineStyle"), uno::makeAny( aLineStyle ) ); } else { @@ -251,7 +251,7 @@ double SAL_CALL ScVbaLineFormat::getTransparency() throw (uno::RuntimeException) { sal_Int16 nTransparency = 0; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineTransparence")) ) >>= nTransparency; + m_xPropertySet->getPropertyValue( rtl::OUString("LineTransparence") ) >>= nTransparency; double fTransparency = static_cast( nTransparency ); return fTransparency / 100; } @@ -260,7 +260,7 @@ void SAL_CALL ScVbaLineFormat::setTransparency( double _transparency ) throw (uno::RuntimeException) { sal_Int16 nTransparency = static_cast( _transparency * 100 ); - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineTransparence")), uno::makeAny( nTransparency ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("LineTransparence"), uno::makeAny( nTransparency ) ); } sal_Int16 SAL_CALL @@ -285,13 +285,13 @@ ScVbaLineFormat::getDashStyle() throw (uno::RuntimeException) { drawing::LineStyle eLineStyle; //LineStyle integer in Xray - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")) ) >>= eLineStyle; + m_xPropertySet->getPropertyValue( rtl::OUString("LineStyle") ) >>= eLineStyle; if( eLineStyle == drawing::LineStyle_SOLID ) m_nLineDashStyle = office::MsoLineDashStyle::msoLineSolid; else { drawing::LineDash aLineDash; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineDash")) ) >>= aLineDash; + m_xPropertySet->getPropertyValue( rtl::OUString("LineDash") ) >>= aLineDash; if( aLineDash.Dots == 0 ) { //LineDash @@ -337,11 +337,11 @@ ScVbaLineFormat::setDashStyle( sal_Int32 _dashstyle ) throw (uno::RuntimeExcepti m_nLineDashStyle = _dashstyle; if( _dashstyle == office::MsoLineDashStyle::msoLineSolid ) { - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")), uno::makeAny( drawing::LineStyle_SOLID )); + m_xPropertySet->setPropertyValue( rtl::OUString("LineStyle"), uno::makeAny( drawing::LineStyle_SOLID )); } else { - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")), uno::makeAny( drawing::LineStyle_DASH ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("LineStyle"), uno::makeAny( drawing::LineStyle_DASH ) ); drawing::LineDash pLineDash; Millimeter aMillimeter( m_nLineWeight ); sal_Int32 nPixel = static_cast< sal_Int32 >( aMillimeter.getInHundredthsOfOneMillimeter() ); @@ -397,9 +397,9 @@ ScVbaLineFormat::setDashStyle( sal_Int32 _dashstyle ) throw (uno::RuntimeExcepti pLineDash.Distance = nPixel; break; default: - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this MsoLineDashStyle is not supported.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("this MsoLineDashStyle is not supported."), uno::Reference< uno::XInterface >() ); } - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineDash")), uno::makeAny( pLineDash ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("LineDash"), uno::makeAny( pLineDash ) ); } } @@ -419,7 +419,7 @@ ScVbaLineFormat::ForeColor() throw (uno::RuntimeException) rtl::OUString ScVbaLineFormat::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaLineFormat")); + return rtl::OUString("ScVbaLineFormat"); } uno::Sequence< rtl::OUString > @@ -429,7 +429,7 @@ ScVbaLineFormat::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.LineFormat" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.LineFormat" ); } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbapictureformat.cxx b/vbahelper/source/vbahelper/vbapictureformat.cxx index ec7ef50042dd..bfbade9835cf 100644 --- a/vbahelper/source/vbahelper/vbapictureformat.cxx +++ b/vbahelper/source/vbahelper/vbapictureformat.cxx @@ -43,11 +43,11 @@ ScVbaPictureFormat::checkParameterRangeInDouble( double nRange, double nMin, dou { if( nRange < nMin ) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parameter out of range, value is too small.")) , uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Parameter out of range, value is too small.") , uno::Reference< uno::XInterface >() ); } if( nRange > nMax ) { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parameter out of range, value is too high.")) , uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Parameter out of range, value is too high.") , uno::Reference< uno::XInterface >() ); } } @@ -56,7 +56,7 @@ double SAL_CALL ScVbaPictureFormat::getBrightness() throw (uno::RuntimeException) { sal_Int16 nLuminance = 0; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AdjustLuminance")) ) >>= nLuminance; + m_xPropertySet->getPropertyValue( rtl::OUString("AdjustLuminance") ) >>= nLuminance; double fBrightness = static_cast< double >( nLuminance ); fBrightness = ( fBrightness +100 ) / 200; return fBrightness; @@ -68,14 +68,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(RTL_CONSTASCII_USTRINGPARAM("AdjustLuminance")), uno::makeAny( nLuminance ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("AdjustLuminance"), uno::makeAny( nLuminance ) ); } double SAL_CALL ScVbaPictureFormat::getContrast() throw (uno::RuntimeException) { sal_Int16 nContrast = 0; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AdjustContrast")) ) >>= nContrast; + m_xPropertySet->getPropertyValue( rtl::OUString("AdjustContrast") ) >>= nContrast; double fContrast = static_cast< double >( nContrast ); fContrast = ( fContrast + 100 ) / 200; return fContrast; @@ -87,7 +87,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(RTL_CONSTASCII_USTRINGPARAM("AdjustContrast")), uno::makeAny( nContrast ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("AdjustContrast"), uno::makeAny( nContrast ) ); } @@ -128,7 +128,7 @@ ScVbaPictureFormat::IncrementContrast( double increment ) throw (uno::RuntimeExc rtl::OUString ScVbaPictureFormat::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaPictureFormat")); + return rtl::OUString("ScVbaPictureFormat"); } uno::Sequence< rtl::OUString > @@ -138,7 +138,7 @@ ScVbaPictureFormat::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.PictureFormat" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.PictureFormat" ); } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx index 8642427c2e29..589eae743d1b 100644 --- a/vbahelper/source/vbahelper/vbashape.cxx +++ b/vbahelper/source/vbahelper/vbashape.cxx @@ -150,7 +150,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(RTL_CONSTASCII_USTRINGPARAM("EdgeKind"))) >>= connectorType; + xPropertySet->getPropertyValue( rtl::OUString("EdgeKind")) >>= connectorType; if( connectorType == drawing::ConnectorType_CURVE ) return office::MsoShapeType::msoFreeform; else if( connectorType == drawing::ConnectorType_LINE ) @@ -165,7 +165,7 @@ 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(RTL_CONSTASCII_USTRINGPARAM("the shape type do not be supported: ")) + sShapeType, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("the shape type do not be supported: ") + sShapeType, uno::Reference< uno::XInterface >() ); } // Attributes @@ -221,7 +221,7 @@ ScVbaShape::getLeft() throw (uno::RuntimeException) { // fail to get position by using XShape::getPosition() sal_Int32 nLeft = 0; - m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition") ) ) >>= nLeft; + m_xPropertySet->getPropertyValue( rtl::OUString( "HoriOrientPosition" ) ) >>= nLeft; left = Millimeter::getInPoints( nLeft ); } return left; @@ -238,7 +238,7 @@ ScVbaShape::setLeft( double _left ) throw (uno::RuntimeException) { sal_Int32 nLeft = 0; nLeft = Millimeter::getInHundredthsOfOneMillimeter( _left ); - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition")), uno::makeAny( nLeft ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("HoriOrientPosition"), uno::makeAny( nLeft ) ); } } @@ -253,7 +253,7 @@ ScVbaShape::getTop() throw (uno::RuntimeException) catch( uno::Exception& ) { sal_Int32 nTop = 0; - m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition") ) ) >>= nTop; + m_xPropertySet->getPropertyValue( rtl::OUString( "VertOrientPosition" ) ) >>= nTop; top = Millimeter::getInPoints( nTop ); } return top; @@ -270,7 +270,7 @@ ScVbaShape::setTop( double _top ) throw (uno::RuntimeException) { sal_Int32 nTop = 0; nTop = Millimeter::getInHundredthsOfOneMillimeter( _top ); - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition")), uno::makeAny( nTop ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("VertOrientPosition"), uno::makeAny( nTop ) ); } } @@ -291,7 +291,7 @@ sal_Int32 SAL_CALL ScVbaShape::getZOrderPosition() throw (uno::RuntimeException) { sal_Int32 nZOrderPosition = 0; - uno::Any aZOrderPosition = m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")) ); + uno::Any aZOrderPosition = m_xPropertySet->getPropertyValue( rtl::OUString("ZOrder") ); aZOrderPosition >>= nZOrderPosition; return nZOrderPosition + 1; } @@ -307,7 +307,7 @@ ScVbaShape::getRotation() throw (uno::RuntimeException) { double dRotation = 0; sal_Int32 nRotation = 0; - m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RotateAngle")) ) >>= nRotation; + m_xPropertySet->getPropertyValue( rtl::OUString("RotateAngle") ) >>= nRotation; dRotation = static_cast< double >( nRotation /100 ); return dRotation; } @@ -316,7 +316,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(RTL_CONSTASCII_USTRINGPARAM("RotateAngle")), uno::makeAny( nRotation ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("RotateAngle"), uno::makeAny( nRotation ) ); } uno::Reference< msforms::XLineFormat > SAL_CALL @@ -343,13 +343,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( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument" ) ) ) ) + if( xServiceInfo->supportsService( ::rtl::OUString( "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( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.TextFrame") ) , aArgs ) , uno::UNO_QUERY_THROW ); + uno::Reference< uno::XInterface > xTextFrame( xSF->createInstanceWithArguments( rtl::OUString( "ooo.vba.excel.TextFrame" ) , aArgs ) , uno::UNO_QUERY_THROW ); return uno::makeAny( xTextFrame ); } @@ -367,33 +367,33 @@ void SAL_CALL ScVbaShape::ZOrder( sal_Int32 ZOrderCmd ) throw (uno::RuntimeException) { sal_Int32 nOrderPositon; - uno::Any aOrderPostion = m_xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")) ); + uno::Any aOrderPostion = m_xPropertySet->getPropertyValue( rtl::OUString("ZOrder") ); aOrderPostion >>= nOrderPositon; switch( ZOrderCmd ) { case office::MsoZOrderCmd::msoBringToFront: - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")), uno::makeAny( SAL_MAX_INT32 ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("ZOrder"), uno::makeAny( SAL_MAX_INT32 ) ); break; case office::MsoZOrderCmd::msoSendToBack: - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")), uno::makeAny( (sal_Int32)0 ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("ZOrder"), uno::makeAny( (sal_Int32)0 ) ); break; case office::MsoZOrderCmd::msoBringForward: nOrderPositon += 1; - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")), uno::makeAny( nOrderPositon ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("ZOrder"), uno::makeAny( nOrderPositon ) ); break; case office::MsoZOrderCmd::msoSendBackward: if( nOrderPositon > 0 ) { nOrderPositon -= 1; - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder")), uno::makeAny( nOrderPositon ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("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(RTL_CONSTASCII_USTRINGPARAM("This ZOrderCmd is not implemented, it is use with writer.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("This ZOrderCmd is not implemented, it is use with writer."), uno::Reference< uno::XInterface >() ); default: - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid Parameter.")), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("Invalid Parameter."), uno::Reference< uno::XInterface >() ); } } @@ -446,7 +446,7 @@ ScVbaShape::ScaleHeight( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal } else { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScaleHeight.Scale wrong value is given.")) , uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("ScaleHeight.Scale wrong value is given.") , uno::Reference< uno::XInterface >() ); } } @@ -475,7 +475,7 @@ ScVbaShape::ScaleWidth( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal_ } else { - throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScaleHeight.Scale wrong value is given.")) , uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString("ScaleHeight.Scale wrong value is given.") , uno::Reference< uno::XInterface >() ); } } @@ -514,7 +514,7 @@ void SAL_CALL ScVbaShape::Copy() throw (uno::RuntimeException) { Select( uno::Any() ); // Copy this Shape. - rtl::OUString sUrl = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Copy") ); + rtl::OUString sUrl = rtl::OUString( ".uno:Copy" ); dispatchRequests( m_xModel, sUrl ); } } @@ -550,7 +550,7 @@ ScVbaShape::getRelativeHorizontalPosition() throw (uno::RuntimeException) { sal_Int32 nRelativeHorizontalPosition = word::WdRelativeHorizontalPosition::wdRelativeHorizontalPositionMargin; sal_Int16 nType = text::RelOrientation::PAGE_LEFT; - m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrientRelation") ) ) >>= nType; + m_xPropertySet->getPropertyValue( rtl::OUString( "HoriOrientRelation" ) ) >>= nType; switch( nType ) { @@ -613,7 +613,7 @@ ScVbaShape::setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalpositi DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString()); } } - m_xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrientRelation") ), uno::makeAny( nType ) ); + m_xPropertySet->setPropertyValue( rtl::OUString( "HoriOrientRelation" ), uno::makeAny( nType ) ); } sal_Int32 SAL_CALL @@ -621,7 +621,7 @@ ScVbaShape::getRelativeVerticalPosition() throw (uno::RuntimeException) { sal_Int32 nRelativeVerticalPosition = word::WdRelativeVerticalPosition::wdRelativeVerticalPositionMargin; sal_Int16 nType = text::RelOrientation::PAGE_FRAME; - m_xPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VertOrientRelation") ) ) >>= nType; + m_xPropertySet->getPropertyValue( rtl::OUString( "VertOrientRelation" ) ) >>= nType; switch( nType ) { @@ -684,29 +684,29 @@ ScVbaShape::setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString()); } } - m_xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VertOrientRelation") ), uno::makeAny( nType ) ); + m_xPropertySet->setPropertyValue( rtl::OUString( "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( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) ) + if( xServiceInfo->supportsService( ::rtl::OUString( "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( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.WrapFormat") ) , aArgs ) , uno::UNO_QUERY_THROW ); + uno::Reference< uno::XInterface > xWrapFormat( xSF->createInstanceWithArguments( rtl::OUString( "ooo.vba.word.WrapFormat" ) , aArgs ) , uno::UNO_QUERY_THROW ); return uno::makeAny( xWrapFormat ); } - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); } rtl::OUString ScVbaShape::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaShape")); + return rtl::OUString("ScVbaShape"); } uno::Sequence< rtl::OUString > @@ -716,7 +716,7 @@ ScVbaShape::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.Shape" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.Shape" ); } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx index 413c76fc10ad..5ede51f3b521 100644 --- a/vbahelper/source/vbahelper/vbashaperange.cxx +++ b/vbahelper/source/vbahelper/vbashaperange.cxx @@ -83,7 +83,7 @@ ScVbaShapeRange::getShapes() throw (uno::RuntimeException) if ( !m_xShapes.is() ) { uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - m_xShapes.set( xMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ShapeCollection")) ), uno::UNO_QUERY_THROW ); + m_xShapes.set( xMSF->createInstance( rtl::OUString("com.sun.star.drawing.ShapeCollection") ), uno::UNO_QUERY_THROW ); sal_Int32 nLen = m_xIndexAccess->getCount(); for ( sal_Int32 index = 0; index < nLen; ++index ) m_xShapes->add( uno::Reference< drawing::XShape >( m_xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ) ); @@ -394,7 +394,7 @@ ScVbaShapeRange:: createCollectionObject( const css::uno::Any& aSource ) rtl::OUString ScVbaShapeRange::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaShapeRange")); + return rtl::OUString("ScVbaShapeRange"); } uno::Sequence< rtl::OUString > @@ -404,7 +404,7 @@ ScVbaShapeRange::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.ShapeRange" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.ShapeRange" ); } return aServiceNames; } diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx index 859d5caa274c..bd0385bb2bcc 100644 --- a/vbahelper/source/vbahelper/vbashapes.cxx +++ b/vbahelper/source/vbahelper/vbashapes.cxx @@ -120,7 +120,7 @@ ScVbaShapes::getElementType() throw (uno::RuntimeException) rtl::OUString ScVbaShapes::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaShapes")); + return rtl::OUString("ScVbaShapes"); } uno::Sequence< rtl::OUString > @@ -130,7 +130,7 @@ ScVbaShapes::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.Shapes" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.Shapes" ); } return aServiceNames; } @@ -236,7 +236,7 @@ ScVbaShapes::createShape( rtl::OUString service ) throw (css::uno::RuntimeExcept uno::Any ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, uno::Any aRange ) throw (css::uno::RuntimeException) { - rtl::OUString sCreateShapeName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.RectangleShape")) ); + rtl::OUString sCreateShapeName( rtl::OUString("com.sun.star.drawing.RectangleShape") ); sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX ); sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY ); sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth ); @@ -245,7 +245,7 @@ ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWi uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW ); m_xShapes->add( xShape ); - rtl::OUString sName(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rectangle")) )); + rtl::OUString sName(createName( rtl::OUString("Rectangle") )); setDefaultShapeProperties( xShape ); setShape_NameProperty( xShape, sName ); @@ -268,7 +268,7 @@ ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWi uno::Any ScVbaShapes::AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, uno::Any aRange ) throw (css::uno::RuntimeException) { - rtl::OUString sCreateShapeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.EllipseShape") ); + rtl::OUString sCreateShapeName( "com.sun.star.drawing.EllipseShape" ); sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX ); sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY ); sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth ); @@ -290,7 +290,7 @@ ScVbaShapes::AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidt setShape_AnchorTypeAndRangeProperty(xShape, _aRange); */ - rtl::OUString name(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Oval")))); + rtl::OUString name(createName( rtl::OUString("Oval"))); setDefaultShapeProperties(xShape); setShape_NameProperty(xShape, name); @@ -321,12 +321,12 @@ ScVbaShapes::AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_In sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( StartX ); sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( StartY ); - uno::Reference< drawing::XShape > xShape( createShape( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.LineShape")) ), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XShape > xShape( createShape( rtl::OUString("com.sun.star.drawing.LineShape") ), uno::UNO_QUERY_THROW ); m_xShapes->add( xShape ); awt::Point aMovePositionIfRange( 0, 0 ); - rtl::OUString name(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Line")) )); + rtl::OUString name(createName( rtl::OUString("Line") )); setDefaultShapeProperties(xShape); setShape_NameProperty(xShape, name); @@ -363,17 +363,17 @@ uno::Any SAL_CALL ScVbaShapes::AddTextbox( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException) { uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW ); - if( xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) ) + if( xServiceInfo->supportsService( ::rtl::OUString( "com.sun.star.text.TextDocument" ) ) ) { return AddTextboxInWriter( _nOrientation, _nLeft, _nTop, _nWidth, _nHeight ); } - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); } uno::Any ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException) { - rtl::OUString sCreateShapeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TextShape") ); + rtl::OUString sCreateShapeName( "com.sun.star.drawing.TextShape" ); sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( _nLeft ); sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( _nTop ); sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( _nWidth ); @@ -384,7 +384,7 @@ ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, setDefaultShapeProperties(xShape); - rtl::OUString sName(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text Box")) )); + rtl::OUString sName(createName( rtl::OUString("Text Box") )); setShape_NameProperty( xShape, sName ); awt::Size size; @@ -393,23 +393,23 @@ ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, xShape->setSize(size); uno::Reference< beans::XPropertySet > xShapeProps( xShape, uno::UNO_QUERY_THROW ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorType")), uno::makeAny( text::TextContentAnchorType_AT_PAGE ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrientRelation")), uno::makeAny( text::RelOrientation::PAGE_LEFT ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrient")), uno::makeAny( text::HoriOrientation::NONE ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition")), uno::makeAny( nXPos ) ); + xShapeProps->setPropertyValue( rtl::OUString("AnchorType"), uno::makeAny( text::TextContentAnchorType_AT_PAGE ) ); + xShapeProps->setPropertyValue( rtl::OUString("HoriOrientRelation"), uno::makeAny( text::RelOrientation::PAGE_LEFT ) ); + xShapeProps->setPropertyValue( rtl::OUString("HoriOrient"), uno::makeAny( text::HoriOrientation::NONE ) ); + xShapeProps->setPropertyValue( rtl::OUString("HoriOrientPosition"), uno::makeAny( nXPos ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientRelation")), uno::makeAny( text::RelOrientation::PAGE_FRAME ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrient")), uno::makeAny( text::VertOrientation::NONE ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition")), uno::makeAny( nYPos ) ); + xShapeProps->setPropertyValue( rtl::OUString("VertOrientRelation"), uno::makeAny( text::RelOrientation::PAGE_FRAME ) ); + xShapeProps->setPropertyValue( rtl::OUString("VertOrient"), uno::makeAny( text::VertOrientation::NONE ) ); + xShapeProps->setPropertyValue( rtl::OUString("VertOrientPosition"), uno::makeAny( nYPos ) ); // set to visible drawing::LineStyle aLineStyle = drawing::LineStyle_SOLID; - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")), uno::makeAny( aLineStyle ) ); + xShapeProps->setPropertyValue( rtl::OUString("LineStyle"), uno::makeAny( aLineStyle ) ); // set to font sal_Int16 nLayerId = 1; - rtl::OUString sLayerName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Heaven")); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayerID")), uno::makeAny( nLayerId ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayerName")), uno::makeAny( sLayerName ) ); + rtl::OUString sLayerName = rtl::OUString("Heaven"); + xShapeProps->setPropertyValue( rtl::OUString("LayerID"), uno::makeAny( nLayerId ) ); + xShapeProps->setPropertyValue( rtl::OUString("LayerName"), uno::makeAny( sLayerName ) ); ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) ); @@ -420,11 +420,11 @@ void ScVbaShapes::setDefaultShapeProperties( uno::Reference< drawing::XShape > xShape ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW ); - xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")), uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SOLID")) ) ); - xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")), uno::makeAny( sal_Int32(0xFFFFFF) ) ); - xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextWordWrap")), uno::makeAny( text::WrapTextMode_THROUGHT ) ); + xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny( rtl::OUString("SOLID") ) ); + xPropertySet->setPropertyValue( rtl::OUString("FillColor"), uno::makeAny( sal_Int32(0xFFFFFF) ) ); + xPropertySet->setPropertyValue( rtl::OUString("TextWordWrap"), uno::makeAny( text::WrapTextMode_THROUGHT ) ); //not find in OOo2.3 - //xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Opaque")), uno::makeAny( sal_True ) ); + //xPropertySet->setPropertyValue( rtl::OUString("Opaque"), uno::makeAny( sal_True ) ); } void @@ -433,7 +433,7 @@ ScVbaShapes::setShape_NameProperty( uno::Reference< css::drawing::XShape > xShap uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW ); try { - xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), uno::makeAny( sName ) ); + xPropertySet->setPropertyValue( rtl::OUString("Name"), uno::makeAny( sName ) ); } catch(const script::BasicErrorException&) { diff --git a/vbahelper/source/vbahelper/vbatextframe.cxx b/vbahelper/source/vbahelper/vbatextframe.cxx index 14140fc279ef..8964af6c3400 100644 --- a/vbahelper/source/vbahelper/vbatextframe.cxx +++ b/vbahelper/source/vbahelper/vbatextframe.cxx @@ -44,8 +44,8 @@ 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(RTL_CONSTASCII_USTRINGPARAM("TextWordWrap")), uno::makeAny( sal_False ) ); - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextFitToSize")), uno::makeAny( drawing::TextFitToSizeType_NONE ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("TextWordWrap"), uno::makeAny( sal_False ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("TextFitToSize"), uno::makeAny( drawing::TextFitToSizeType_NONE ) ); } sal_Int32 VbaTextFrame::getMargin( rtl::OUString sMarginType ) @@ -70,7 +70,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(RTL_CONSTASCII_USTRINGPARAM("TextAutoGrowHeight")) ); + uno::Any aTextAutoGrowHeight = m_xPropertySet->getPropertyValue( rtl::OUString("TextAutoGrowHeight") ); aTextAutoGrowHeight >>= bAutosize; return bAutosize; } @@ -79,13 +79,13 @@ void SAL_CALL VbaTextFrame::setAutoSize( sal_Bool _autosize ) throw (uno::RuntimeException) { setAsMSObehavior(); - m_xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextAutoGrowHeight")), uno::makeAny( _autosize ) ); + m_xPropertySet->setPropertyValue( rtl::OUString("TextAutoGrowHeight"), uno::makeAny( _autosize ) ); } float SAL_CALL VbaTextFrame::getMarginBottom() throw (uno::RuntimeException) { - sal_Int32 nMargin = getMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextLowerDistance")) ); + sal_Int32 nMargin = getMargin( rtl::OUString("TextLowerDistance") ); float fMargin = (float)Millimeter::getInPoints( nMargin ); return fMargin; } @@ -93,13 +93,13 @@ VbaTextFrame::getMarginBottom() throw (uno::RuntimeException) void SAL_CALL VbaTextFrame::setMarginBottom( float _marginbottom ) throw (uno::RuntimeException) { - setMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextLowerDistance")), _marginbottom ); + setMargin( rtl::OUString("TextLowerDistance"), _marginbottom ); } float SAL_CALL VbaTextFrame::getMarginTop() throw (uno::RuntimeException) { - sal_Int32 nMargin = getMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextUpperDistance")) ); + sal_Int32 nMargin = getMargin( rtl::OUString("TextUpperDistance") ); float fMargin = (float)Millimeter::getInPoints( nMargin ); return fMargin; } @@ -107,13 +107,13 @@ VbaTextFrame::getMarginTop() throw (uno::RuntimeException) void SAL_CALL VbaTextFrame::setMarginTop( float _margintop ) throw (uno::RuntimeException) { - setMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextUpperDistance")), _margintop ); + setMargin( rtl::OUString("TextUpperDistance"), _margintop ); } float SAL_CALL VbaTextFrame::getMarginLeft() throw (uno::RuntimeException) { - sal_Int32 nMargin = getMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextLeftDistance")) ); + sal_Int32 nMargin = getMargin( rtl::OUString("TextLeftDistance") ); float fMargin = (float)Millimeter::getInPoints( nMargin ); return fMargin; } @@ -121,13 +121,13 @@ VbaTextFrame::getMarginLeft() throw (uno::RuntimeException) void SAL_CALL VbaTextFrame::setMarginLeft( float _marginleft ) throw (uno::RuntimeException) { - setMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextLeftDistance")), _marginleft ); + setMargin( rtl::OUString("TextLeftDistance"), _marginleft ); } float SAL_CALL VbaTextFrame::getMarginRight() throw (uno::RuntimeException) { - sal_Int32 nMargin = getMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextRightDistance")) ); + sal_Int32 nMargin = getMargin( rtl::OUString("TextRightDistance") ); float fMargin = (float)Millimeter::getInPoints( nMargin ); return fMargin; } @@ -135,7 +135,7 @@ VbaTextFrame::getMarginRight() throw (uno::RuntimeException) void SAL_CALL VbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException) { - setMargin( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextRightDistance")), _marginright ); + setMargin( rtl::OUString("TextRightDistance"), _marginright ); } @@ -143,13 +143,13 @@ VbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException) uno::Any SAL_CALL VbaTextFrame::Characters() throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); } rtl::OUString VbaTextFrame::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VbaTextFrame")); + return rtl::OUString("VbaTextFrame"); } uno::Sequence< rtl::OUString > @@ -159,7 +159,7 @@ VbaTextFrame::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.TextFrame" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msforms.TextFrame" ); } return aServiceNames; } -- cgit