From 1889728897e16800d58773a302eb5232a6fada76 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 30 Mar 2012 07:59:00 +0100 Subject: remove static OUStrings from static_initialization_and_destruction chain --- .../source/dispatch/windowcommanddispatch.cxx | 12 ++---- .../source/helper/uiconfigelementwrapperbase.cxx | 46 +++++++++++----------- .../source/inc/dispatch/windowcommanddispatch.hxx | 14 ------- 3 files changed, 26 insertions(+), 46 deletions(-) (limited to 'framework') diff --git a/framework/source/dispatch/windowcommanddispatch.cxx b/framework/source/dispatch/windowcommanddispatch.cxx index 470daa07f843..022537c52f87 100644 --- a/framework/source/dispatch/windowcommanddispatch.cxx +++ b/framework/source/dispatch/windowcommanddispatch.cxx @@ -60,12 +60,6 @@ namespace framework{ namespace css = ::com::sun::star; -//_______________________________________________ -// declarations - -const ::rtl::OUString WindowCommandDispatch::COMMAND_PREFERENCES(RTL_CONSTASCII_USTRINGPARAM(".uno:OptionsTreeDialog")); -const ::rtl::OUString WindowCommandDispatch::COMMAND_ABOUTBOX(RTL_CONSTASCII_USTRINGPARAM(".uno:About")); - //----------------------------------------------- WindowCommandDispatch::WindowCommandDispatch(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , const css::uno::Reference< css::frame::XFrame >& xFrame) @@ -152,16 +146,16 @@ IMPL_LINK(WindowCommandDispatch, impl_notifyCommand, void*, pParam) return 0L; const int nCommand = pData->GetDialogId(); - ::rtl::OUString sCommand; + ::rtl::OUString sCommand; switch (nCommand) { case SHOWDIALOG_ID_PREFERENCES : - sCommand = WindowCommandDispatch::COMMAND_PREFERENCES; + sCommand = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:OptionsTreeDialog")); break; case SHOWDIALOG_ID_ABOUT : - sCommand = WindowCommandDispatch::COMMAND_ABOUTBOX; + sCommand = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:About")); break; default : diff --git a/framework/source/helper/uiconfigelementwrapperbase.cxx b/framework/source/helper/uiconfigelementwrapperbase.cxx index 5c28d2679ac2..92b5f7f65859 100644 --- a/framework/source/helper/uiconfigelementwrapperbase.cxx +++ b/framework/source/helper/uiconfigelementwrapperbase.cxx @@ -60,14 +60,14 @@ const int UIELEMENT_PROPHANDLE_XMENUBAR = 6; const int UIELEMENT_PROPHANDLE_CONFIGLISTENER = 7; const int UIELEMENT_PROPHANDLE_NOCLOSE = 8; const int UIELEMENT_PROPCOUNT = 8; -const rtl::OUString UIELEMENT_PROPNAME_CONFIGLISTENER( RTL_CONSTASCII_USTRINGPARAM( "ConfigListener" )); -const rtl::OUString UIELEMENT_PROPNAME_CONFIGSOURCE( RTL_CONSTASCII_USTRINGPARAM( "ConfigurationSource" )); -const rtl::OUString UIELEMENT_PROPNAME_FRAME( RTL_CONSTASCII_USTRINGPARAM( "Frame" )); -const rtl::OUString UIELEMENT_PROPNAME_PERSISTENT( RTL_CONSTASCII_USTRINGPARAM( "Persistent" )); -const rtl::OUString UIELEMENT_PROPNAME_RESOURCEURL( RTL_CONSTASCII_USTRINGPARAM( "ResourceURL" )); -const rtl::OUString UIELEMENT_PROPNAME_TYPE( RTL_CONSTASCII_USTRINGPARAM( "Type" )); -const rtl::OUString UIELEMENT_PROPNAME_XMENUBAR( RTL_CONSTASCII_USTRINGPARAM( "XMenuBar" )); -const rtl::OUString UIELEMENT_PROPNAME_NOCLOSE( RTL_CONSTASCII_USTRINGPARAM( "NoClose" )); +const char UIELEMENT_PROPNAME_CONFIGLISTENER[] = "ConfigListener"; +const char UIELEMENT_PROPNAME_CONFIGSOURCE[] = "ConfigurationSource"; +const char UIELEMENT_PROPNAME_FRAME[] = "Frame"; +const char UIELEMENT_PROPNAME_PERSISTENT[] = "Persistent"; +const char UIELEMENT_PROPNAME_RESOURCEURL[] = "ResourceURL"; +const char UIELEMENT_PROPNAME_TYPE[] = "Type"; +const char UIELEMENT_PROPNAME_XMENUBAR[] = "XMenuBar"; +const char UIELEMENT_PROPNAME_NOCLOSE[] = "NoClose"; using ::rtl::OUString; using namespace com::sun::star::beans; using namespace com::sun::star::uno; @@ -161,19 +161,19 @@ throw ( Exception, RuntimeException ) PropertyValue aPropValue; if ( aArguments[n] >>= aPropValue ) { - if ( aPropValue.Name.equals( UIELEMENT_PROPNAME_CONFIGSOURCE )) + if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(UIELEMENT_PROPNAME_CONFIGSOURCE))) setFastPropertyValue_NoBroadcast( UIELEMENT_PROPHANDLE_CONFIGSOURCE, aPropValue.Value ); - else if ( aPropValue.Name.equals( UIELEMENT_PROPNAME_FRAME )) + else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(UIELEMENT_PROPNAME_FRAME))) setFastPropertyValue_NoBroadcast( UIELEMENT_PROPHANDLE_FRAME, aPropValue.Value ); - else if ( aPropValue.Name.equals( UIELEMENT_PROPNAME_PERSISTENT )) + else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(UIELEMENT_PROPNAME_PERSISTENT))) setFastPropertyValue_NoBroadcast( UIELEMENT_PROPHANDLE_PERSISTENT, aPropValue.Value ); - else if ( aPropValue.Name.equals( UIELEMENT_PROPNAME_RESOURCEURL )) + else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(UIELEMENT_PROPNAME_RESOURCEURL))) setFastPropertyValue_NoBroadcast( UIELEMENT_PROPHANDLE_RESOURCEURL, aPropValue.Value ); - else if ( aPropValue.Name.equals( UIELEMENT_PROPNAME_TYPE )) + else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(UIELEMENT_PROPNAME_TYPE))) setFastPropertyValue_NoBroadcast( UIELEMENT_PROPHANDLE_TYPE, aPropValue.Value ); - else if ( aPropValue.Name.equals( UIELEMENT_PROPNAME_CONFIGLISTENER )) + else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(UIELEMENT_PROPNAME_CONFIGLISTENER))) setFastPropertyValue_NoBroadcast( UIELEMENT_PROPHANDLE_CONFIGLISTENER, aPropValue.Value ); - else if ( aPropValue.Name.equals( UIELEMENT_PROPNAME_NOCLOSE )) + else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(UIELEMENT_PROPNAME_NOCLOSE))) setFastPropertyValue_NoBroadcast( UIELEMENT_PROPHANDLE_NOCLOSE, aPropValue.Value ); } } @@ -472,14 +472,14 @@ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > UIConfigE const com::sun::star::beans::Property pProperties[] = { - com::sun::star::beans::Property( UIELEMENT_PROPNAME_CONFIGLISTENER, UIELEMENT_PROPHANDLE_CONFIGLISTENER , ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), - com::sun::star::beans::Property( UIELEMENT_PROPNAME_CONFIGSOURCE , UIELEMENT_PROPHANDLE_CONFIGSOURCE , ::getCppuType((const Reference< ::com::sun::star::ui::XUIConfigurationManager >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), - com::sun::star::beans::Property( UIELEMENT_PROPNAME_FRAME , UIELEMENT_PROPHANDLE_FRAME , ::getCppuType((const Reference< com::sun::star::frame::XFrame >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ), - com::sun::star::beans::Property( UIELEMENT_PROPNAME_NOCLOSE , UIELEMENT_PROPHANDLE_NOCLOSE , ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), - com::sun::star::beans::Property( UIELEMENT_PROPNAME_PERSISTENT , UIELEMENT_PROPHANDLE_PERSISTENT , ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), - com::sun::star::beans::Property( UIELEMENT_PROPNAME_RESOURCEURL , UIELEMENT_PROPHANDLE_RESOURCEURL , ::getCppuType((const ::rtl::OUString*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ), - com::sun::star::beans::Property( UIELEMENT_PROPNAME_TYPE , UIELEMENT_PROPHANDLE_TYPE , ::getCppuType((const ::rtl::OUString*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ), - com::sun::star::beans::Property( UIELEMENT_PROPNAME_XMENUBAR , UIELEMENT_PROPHANDLE_XMENUBAR , ::getCppuType((const Reference< com::sun::star::awt::XMenuBar >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ) + com::sun::star::beans::Property( rtl::OUString(UIELEMENT_PROPNAME_CONFIGLISTENER), UIELEMENT_PROPHANDLE_CONFIGLISTENER , ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), + com::sun::star::beans::Property( rtl::OUString(UIELEMENT_PROPNAME_CONFIGSOURCE), UIELEMENT_PROPHANDLE_CONFIGSOURCE , ::getCppuType((const Reference< ::com::sun::star::ui::XUIConfigurationManager >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), + com::sun::star::beans::Property( rtl::OUString(UIELEMENT_PROPNAME_FRAME), UIELEMENT_PROPHANDLE_FRAME , ::getCppuType((const Reference< com::sun::star::frame::XFrame >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ), + com::sun::star::beans::Property( rtl::OUString(UIELEMENT_PROPNAME_NOCLOSE), UIELEMENT_PROPHANDLE_NOCLOSE , ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), + com::sun::star::beans::Property( rtl::OUString(UIELEMENT_PROPNAME_PERSISTENT), UIELEMENT_PROPHANDLE_PERSISTENT , ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), + com::sun::star::beans::Property( rtl::OUString(UIELEMENT_PROPNAME_RESOURCEURL), UIELEMENT_PROPHANDLE_RESOURCEURL , ::getCppuType((const ::rtl::OUString*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ), + com::sun::star::beans::Property( rtl::OUString(UIELEMENT_PROPNAME_TYPE), UIELEMENT_PROPHANDLE_TYPE , ::getCppuType((const ::rtl::OUString*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ), + com::sun::star::beans::Property( rtl::OUString(UIELEMENT_PROPNAME_XMENUBAR), UIELEMENT_PROPHANDLE_XMENUBAR , ::getCppuType((const Reference< com::sun::star::awt::XMenuBar >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ) }; // Use it to initialize sequence! const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, UIELEMENT_PROPCOUNT ); diff --git a/framework/source/inc/dispatch/windowcommanddispatch.hxx b/framework/source/inc/dispatch/windowcommanddispatch.hxx index 549c6d9e69ae..5315240d7a94 100644 --- a/framework/source/inc/dispatch/windowcommanddispatch.hxx +++ b/framework/source/inc/dispatch/windowcommanddispatch.hxx @@ -74,20 +74,6 @@ namespace css = ::com::sun::star; */ class WindowCommandDispatch : private ThreadHelpBase { - //___________________________________________ - // const - - private: - - /// dispatch URL to trigger our "Tools->Options" dialog - static const ::rtl::OUString COMMAND_PREFERENCES; - - /// dispatch URL to trigger our About box - static const ::rtl::OUString COMMAND_ABOUTBOX; - - //___________________________________________ - // member - private: /// can be used to create own needed services on demand. -- cgit v1.2.3