diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-03-31 15:54:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-04-02 14:53:48 +0100 |
commit | ae9219769106648ac35d594fc07c83103a62ecbe (patch) | |
tree | dbc21e302fe1808fc798c15156ad3a96418f5f45 | |
parent | 437f93ec8d1cb0f1486c69b863cb509aea4dac65 (diff) |
remove static objects from static_initialization_and_destruction chain
25 files changed, 279 insertions, 476 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 438064104fed..47eb85c3303b 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -114,7 +114,7 @@ static char const ID_DBG_SUPPORTEDINTERFACES[] = "Dbg_SupportedInterfaces"; static char const ID_DBG_PROPERTIES[] = "Dbg_Properties"; static char const ID_DBG_METHODS[] = "Dbg_Methods"; -static ::rtl::OUString aSeqLevelStr( RTL_CONSTASCII_USTRINGPARAM("[]") ); +static char const aSeqLevelStr[] = "[]"; static char const defaultNameSpace[] = "ooo.vba"; // Gets the default property for an uno object. Note: There is some @@ -1000,9 +1000,10 @@ Type getUnoTypeForSbxValue( SbxValue* pVal ) } } - ::rtl::OUString aSeqTypeName( aSeqLevelStr ); - aSeqTypeName += aElementType.getTypeName(); - aRetType = Type( TypeClass_SEQUENCE, aSeqTypeName ); + ::rtl::OUStringBuffer aSeqTypeName; + aSeqTypeName.appendAscii(RTL_CONSTASCII_STRINGPARAM(aSeqLevelStr)) + .append(aElementType.getTypeName()); + aRetType = Type( TypeClass_SEQUENCE, aSeqTypeName.makeStringAndClear() ); } // #i33795 Map also multi dimensional arrays to corresponding sequences else if( nDims > 1 ) @@ -1038,11 +1039,11 @@ Type getUnoTypeForSbxValue( SbxValue* pVal ) } } - ::rtl::OUString aSeqTypeName; + ::rtl::OUStringBuffer aSeqTypeName; for( short iDim = 0 ; iDim < nDims ; iDim++ ) - aSeqTypeName += aSeqLevelStr; - aSeqTypeName += aElementType.getTypeName(); - aRetType = Type( TypeClass_SEQUENCE, aSeqTypeName ); + aSeqTypeName.appendAscii(RTL_CONSTASCII_STRINGPARAM(aSeqLevelStr)); + aSeqTypeName.append(aElementType.getTypeName()); + aRetType = Type( TypeClass_SEQUENCE, aSeqTypeName.makeStringAndClear() ); } } // No array, but ... @@ -1176,13 +1177,12 @@ static Any implRekMultiDimArrayToSequence( SbxDimArray* pArray, sal_Int32* pActualIndices, sal_Int32* pLowerBounds, sal_Int32* pUpperBounds ) { sal_Int32 nSeqLevel = nMaxDimIndex - nActualDim + 1; - ::rtl::OUString aSeqTypeName; + ::rtl::OUStringBuffer aSeqTypeName; sal_Int32 i; for( i = 0 ; i < nSeqLevel ; i++ ) - aSeqTypeName += aSeqLevelStr; - - aSeqTypeName += aElemType.getTypeName(); - Type aSeqType( TypeClass_SEQUENCE, aSeqTypeName ); + aSeqTypeName.appendAscii(RTL_CONSTASCII_STRINGPARAM(aSeqLevelStr)); + aSeqTypeName.append(aElemType.getTypeName()); + Type aSeqType( TypeClass_SEQUENCE, aSeqTypeName.makeStringAndClear() ); // Create Sequence instance Any aRetVal; diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.cxx b/editeng/source/misc/SvXMLAutoCorrectImport.cxx index e7354b9d772a..16b604d00f76 100644 --- a/editeng/source/misc/SvXMLAutoCorrectImport.cxx +++ b/editeng/source/misc/SvXMLAutoCorrectImport.cxx @@ -35,7 +35,7 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; using namespace ::rtl; -static OUString sBlockList ( RTL_CONSTASCII_USTRINGPARAM ( "_block-list" ) ); +const char aBlockList[] = "_block-list"; SvXMLAutoCorrectImport::SvXMLAutoCorrectImport( const uno::Reference< lang::XMultiServiceFactory > xServiceFactory, @@ -48,7 +48,7 @@ SvXMLAutoCorrectImport::SvXMLAutoCorrectImport( xStorage ( rNewStorage ) { GetNamespaceMap().Add( - sBlockList, + rtl::OUString(aBlockList), GetXMLToken ( XML_N_BLOCK_LIST), XML_NAMESPACE_BLOCKLIST ); } @@ -162,7 +162,7 @@ SvXMLExceptionListImport::SvXMLExceptionListImport( rList (rNewList) { GetNamespaceMap().Add( - sBlockList, + rtl::OUString(aBlockList), GetXMLToken ( XML_N_BLOCK_LIST), XML_NAMESPACE_BLOCKLIST ); } diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk index a1110ab2475e..45796693d7f3 100644 --- a/framework/Library_fwk.mk +++ b/framework/Library_fwk.mk @@ -75,8 +75,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\ framework/source/classes/menumanager \ framework/source/classes/taskcreator \ framework/source/constant/containerquery \ - framework/source/constant/contenthandler \ - framework/source/constant/frameloader \ framework/source/dispatch/closedispatcher \ framework/source/dispatch/dispatchinformationprovider \ framework/source/dispatch/dispatchprovider \ diff --git a/framework/inc/xml/saxnamespacefilter.hxx b/framework/inc/xml/saxnamespacefilter.hxx index 11f8a5b4d333..c842d1a892fb 100644 --- a/framework/inc/xml/saxnamespacefilter.hxx +++ b/framework/inc/xml/saxnamespacefilter.hxx @@ -99,6 +99,10 @@ class FWE_DLLPUBLIC SaxNamespaceFilter : public ThreadHelpBase, // Struct for ri ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler> xDocumentHandler; NamespaceStack m_aNamespaceStack; sal_Int32 m_nDepth; + + rtl::OUString m_aXMLAttributeNamespace; + rtl::OUString m_aXMLAttributeType; + }; } diff --git a/framework/inc/xml/xmlnamespaces.hxx b/framework/inc/xml/xmlnamespaces.hxx index f21a77744d7d..8f848ee1cc5d 100644 --- a/framework/inc/xml/xmlnamespaces.hxx +++ b/framework/inc/xml/xmlnamespaces.hxx @@ -59,6 +59,7 @@ class FWE_DLLPUBLIC XMLNamespaces throw( ::com::sun::star::xml::sax::SAXException ); ::rtl::OUString m_aDefaultNamespace; + ::rtl::OUString m_aXMLAttributeNamespace; NamespaceMap m_aNamespaceMap; }; diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx index 8f015638737b..4b0af601d076 100644 --- a/framework/source/classes/menumanager.cxx +++ b/framework/source/classes/menumanager.cxx @@ -130,7 +130,7 @@ namespace framework #define aSpecialFileCommand "PickList" #define aSpecialWindowCommand "WindowList" -const ::rtl::OUString UNO_COMMAND( RTL_CONSTASCII_USTRINGPARAM( ".uno:" )); +const char UNO_COMMAND[] = ".uno:"; MenuManager::MenuManager( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, @@ -785,10 +785,10 @@ IMPL_LINK( MenuManager, Activate, Menu *, pMenu ) m_bActive = sal_True; ::rtl::OUString aCommand( m_aMenuItemCommand ); - if ( m_aMenuItemCommand.matchIgnoreAsciiCase( UNO_COMMAND, 0 )) + if (m_aMenuItemCommand.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(UNO_COMMAND))) { // Remove protocol part from command so we can use an easier comparision method - aCommand = aCommand.copy( UNO_COMMAND.getLength() ); + aCommand = aCommand.copy(RTL_CONSTASCII_LENGTH(UNO_COMMAND)); } if ( m_aMenuItemCommand.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(aSpecialFileMenu)) || diff --git a/framework/source/constant/contenthandler.cxx b/framework/source/constant/contenthandler.cxx deleted file mode 100644 index c7945aee68a8..000000000000 --- a/framework/source/constant/contenthandler.cxx +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include <constant/contenthandler.hxx> - -namespace framework{ - namespace constant{ - -const ::rtl::OUString ContentHandler::PROP_NAME = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name" )); -const ::rtl::OUString ContentHandler::PROP_TYPES = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Types")); - - } // namespace constant -} // namespace framework - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/constant/frameloader.cxx b/framework/source/constant/frameloader.cxx deleted file mode 100644 index 2e61eb092275..000000000000 --- a/framework/source/constant/frameloader.cxx +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include <constant/frameloader.hxx> - -namespace framework{ - namespace constant{ - -const ::rtl::OUString FrameLoader::PROP_NAME = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name" )); -const ::rtl::OUString FrameLoader::PROP_TYPES = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Types")); - - } // namespace constant -} // namespace framework - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index 0b670eb7b501..43756fb36b23 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -66,12 +66,9 @@ namespace framework{ #endif namespace fpf = ::framework::pattern::frame; -//_______________________________________________ -// non exported const - -static ::rtl::OUString URL_CLOSEDOC = DECLARE_ASCII(".uno:CloseDoc" ); -static ::rtl::OUString URL_CLOSEWIN = DECLARE_ASCII(".uno:CloseWin" ); -static ::rtl::OUString URL_CLOSEFRAME = DECLARE_ASCII(".uno:CloseFrame"); +const char URL_CLOSEDOC[] = ".uno:CloseDoc"; +const char URL_CLOSEWIN[] = ".uno:CloseWin"; +const char URL_CLOSEFRAME[] = ".uno:CloseFrame"; //_______________________________________________ // declarations @@ -136,15 +133,14 @@ css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL CloseDispatcher:: a configurable feature ... and further it does not have a valid UIName entry inside the GenericCommands.xcu ... */ css::uno::Sequence< css::frame::DispatchInformation > lViewInfos(1); - lViewInfos[0].Command = URL_CLOSEWIN; + lViewInfos[0].Command = rtl::OUString(URL_CLOSEWIN); lViewInfos[0].GroupId = css::frame::CommandGroup::VIEW; return lViewInfos; } - else - if (nCommandGroup == css::frame::CommandGroup::DOCUMENT) + else if (nCommandGroup == css::frame::CommandGroup::DOCUMENT) { css::uno::Sequence< css::frame::DispatchInformation > lDocInfos(1); - lDocInfos[0].Command = URL_CLOSEDOC; + lDocInfos[0].Command = rtl::OUString(URL_CLOSEDOC); lDocInfos[0].GroupId = css::frame::CommandGroup::DOCUMENT; return lDocInfos; } @@ -197,13 +193,11 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL& // If not - we have to break this operation. But an optional listener must be informed. // BTW: We save the information about the requested operation. Because // we need it later. - if (aURL.Complete.equals(URL_CLOSEDOC)) + if (aURL.Complete.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(URL_CLOSEDOC))) m_eOperation = E_CLOSE_DOC; - else - if (aURL.Complete.equals(URL_CLOSEWIN)) + else if (aURL.Complete.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(URL_CLOSEWIN))) m_eOperation = E_CLOSE_WIN; - else - if (aURL.Complete.equals(URL_CLOSEFRAME)) + else if (aURL.Complete.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(URL_CLOSEFRAME))) m_eOperation = E_CLOSE_FRAME; else { diff --git a/framework/source/fwe/xml/saxnamespacefilter.cxx b/framework/source/fwe/xml/saxnamespacefilter.cxx index ede89d5232b4..52d5dc0ad54f 100644 --- a/framework/source/fwe/xml/saxnamespacefilter.cxx +++ b/framework/source/fwe/xml/saxnamespacefilter.cxx @@ -44,9 +44,6 @@ using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::uno; -const ::rtl::OUString aXMLAttributeNamespace( RTL_CONSTASCII_USTRINGPARAM( "xmlns" )); -const ::rtl::OUString aXMLAttributeType( RTL_CONSTASCII_USTRINGPARAM( "CDATA" )); - namespace framework{ @@ -54,7 +51,9 @@ SaxNamespaceFilter::SaxNamespaceFilter( Reference< XDocumentHandler >& rSax1Docu ThreadHelpBase( &Application::GetSolarMutex() ), m_xLocator( 0 ), xDocumentHandler( rSax1DocumentHandler ), - m_nDepth( 0 ) + m_nDepth( 0 ), + m_aXMLAttributeNamespace( RTL_CONSTASCII_USTRINGPARAM( "xmlns" )), + m_aXMLAttributeType( RTL_CONSTASCII_USTRINGPARAM( "CDATA" )) { } @@ -89,7 +88,7 @@ void SAL_CALL SaxNamespaceFilter::startElement( for ( sal_Int16 i=0; i< xAttribs->getLength(); i++ ) { ::rtl::OUString aName = xAttribs->getNameByIndex( i ); - if ( aName.compareTo( aXMLAttributeNamespace, aXMLAttributeNamespace.getLength() ) == 0 ) + if ( aName.compareTo( m_aXMLAttributeNamespace, m_aXMLAttributeNamespace.getLength() ) == 0 ) aXMLNamespaces.addNamespace( aName, xAttribs->getValueByIndex( i )); else aAttributeIndexes.push_back( i ); @@ -109,7 +108,7 @@ void SAL_CALL SaxNamespaceFilter::startElement( ::rtl::OUString aAttributeName = xAttribs->getNameByIndex( *i ); ::rtl::OUString aValue = xAttribs->getValueByIndex( *i ); ::rtl::OUString aNamespaceAttributeName = aXMLNamespaces.applyNSToAttributeName( aAttributeName ); - pNewList->AddAttribute( aNamespaceAttributeName, aXMLAttributeType, aValue ); + pNewList->AddAttribute( aNamespaceAttributeName, m_aXMLAttributeType, aValue ); } } catch ( SAXException& e ) diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx index 80104946dfd1..da2eb459eb18 100644 --- a/framework/source/fwe/xml/xmlnamespaces.cxx +++ b/framework/source/fwe/xml/xmlnamespaces.cxx @@ -32,12 +32,11 @@ using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::uno; -const ::rtl::OUString aXMLAttributeNamespace( RTL_CONSTASCII_USTRINGPARAM( "xmlns" )); - namespace framework { XMLNamespaces::XMLNamespaces() + : m_aXMLAttributeNamespace( RTL_CONSTASCII_USTRINGPARAM( "xmlns" )) { } @@ -55,10 +54,10 @@ void XMLNamespaces::addNamespace( const ::rtl::OUString& aName, const ::rtl::OUS { NamespaceMap::iterator p; ::rtl::OUString aNamespaceName( aName ); - sal_Int32 nXMLNamespaceLength = aXMLAttributeNamespace.getLength(); + sal_Int32 nXMLNamespaceLength = m_aXMLAttributeNamespace.getLength(); // delete preceding "xmlns" - if ( aNamespaceName.compareTo( aXMLAttributeNamespace, nXMLNamespaceLength ) == 0 ) + if ( aNamespaceName.compareTo( m_aXMLAttributeNamespace, nXMLNamespaceLength ) == 0 ) { if ( aNamespaceName.getLength() == nXMLNamespaceLength ) { diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx index 5f7cbed7ac73..150481e410f0 100644 --- a/framework/source/fwi/uielement/constitemcontainer.cxx +++ b/framework/source/fwi/uielement/constitemcontainer.cxx @@ -46,7 +46,7 @@ const char WRONG_TYPE_EXCEPTION[] = "Type must be com::sun::star::uno::Sequence< const int PROPHANDLE_UINAME = 1; const int PROPCOUNT = 1; -const rtl::OUString PROPNAME_UINAME( RTL_CONSTASCII_USTRINGPARAM( "UIName" )); +const char PROPNAME_UINAME[] = "UIName"; namespace framework { @@ -350,7 +350,7 @@ throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::bean Any SAL_CALL ConstItemContainer::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { - if ( PropertyName.equals( PROPNAME_UINAME )) + if (PropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROPNAME_UINAME))) return makeAny( m_aUIName ); throw UnknownPropertyException(); @@ -431,7 +431,7 @@ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > ConstItem const com::sun::star::beans::Property pProperties[] = { - com::sun::star::beans::Property( PROPNAME_UINAME, PROPHANDLE_UINAME , + com::sun::star::beans::Property( rtl::OUString(PROPNAME_UINAME), PROPHANDLE_UINAME , ::getCppuType((const rtl::OUString*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ) }; diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx index 667850693342..d52e7c4f624f 100644 --- a/framework/source/fwi/uielement/rootitemcontainer.cxx +++ b/framework/source/fwi/uielement/rootitemcontainer.cxx @@ -50,7 +50,7 @@ const char WRONG_TYPE_EXCEPTION[] = "Type must be com::sun::star::uno::Sequence< const int PROPHANDLE_UINAME = 1; const int PROPCOUNT = 1; -const rtl::OUString PROPNAME_UINAME( RTL_CONSTASCII_USTRINGPARAM( "UIName" )); +const char PROPNAME_UINAME[] = "UIName"; namespace framework { @@ -397,7 +397,7 @@ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > RootItemC const com::sun::star::beans::Property pProperties[] = { - com::sun::star::beans::Property( PROPNAME_UINAME, PROPHANDLE_UINAME , + com::sun::star::beans::Property( rtl::OUString(PROPNAME_UINAME), PROPHANDLE_UINAME , ::getCppuType((const rtl::OUString*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ) }; diff --git a/framework/source/helper/uielementwrapperbase.cxx b/framework/source/helper/uielementwrapperbase.cxx index d069f4767c0c..339ee0379735 100644 --- a/framework/source/helper/uielementwrapperbase.cxx +++ b/framework/source/helper/uielementwrapperbase.cxx @@ -52,9 +52,9 @@ const int UIELEMENT_PROPHANDLE_RESOURCEURL = 1; const int UIELEMENT_PROPHANDLE_TYPE = 2; const int UIELEMENT_PROPHANDLE_FRAME = 3; const int UIELEMENT_PROPCOUNT = 3; -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_FRAME( RTL_CONSTASCII_USTRINGPARAM( "Frame" )); +const char UIELEMENT_PROPNAME_RESOURCEURL[] = "ResourceURL"; +const char UIELEMENT_PROPNAME_TYPE[] = "Type"; +const char UIELEMENT_PROPNAME_FRAME[] = "Frame"; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -261,9 +261,9 @@ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > UIElement const com::sun::star::beans::Property pProperties[] = { - com::sun::star::beans::Property( UIELEMENT_PROPNAME_FRAME , UIELEMENT_PROPHANDLE_FRAME , ::getCppuType((Reference< XFrame >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ), - com::sun::star::beans::Property( UIELEMENT_PROPNAME_RESOURCEURL , UIELEMENT_PROPHANDLE_RESOURCEURL , ::getCppuType((sal_Int16*)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( rtl::OUString(UIELEMENT_PROPNAME_FRAME), UIELEMENT_PROPHANDLE_FRAME , ::getCppuType((Reference< XFrame >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ), + com::sun::star::beans::Property( rtl::OUString(UIELEMENT_PROPNAME_RESOURCEURL), UIELEMENT_PROPHANDLE_RESOURCEURL , ::getCppuType((sal_Int16*)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 ) }; // 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/constant/contenthandler.hxx b/framework/source/inc/constant/contenthandler.hxx deleted file mode 100644 index 19eabc22719e..000000000000 --- a/framework/source/inc/constant/contenthandler.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef __FRAMEWORK_CONSTANT_CONTENTHANDLER_H_ -#define __FRAMEWORK_CONSTANT_CONTENTHANDLER_H_ - -#include <rtl/ustring.hxx> - -namespace framework{ - namespace constant{ - -struct ContentHandler -{ - public: - - static const ::rtl::OUString PROP_NAME; - static const ::rtl::OUString PROP_TYPES; -}; - - } // namespace constant -} // namespace framework - -#endif // #ifndef __FRAMEWORK_CONSTANT_CONTENTHANDLER_H_ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/inc/constant/frameloader.hxx b/framework/source/inc/constant/frameloader.hxx deleted file mode 100644 index 1db45dddc5ba..000000000000 --- a/framework/source/inc/constant/frameloader.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef __FRAMEWORK_CONSTANT_FRAMELOADER_H_ -#define __FRAMEWORK_CONSTANT_FRAMELOADER_H_ - -#include <rtl/ustring.hxx> - -namespace framework{ - namespace constant{ - -class FrameLoader -{ - public: - - static const ::rtl::OUString PROP_NAME; // string - static const ::rtl::OUString PROP_TYPES; // seq< string > -}; - - } // namespace constant -} // namespace framework - -#endif // #ifndef __FRAMEWORK_CONSTANT_FRAMELOADER_H_ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 0b394066c1f5..ea4b4bb00b2d 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -33,10 +33,6 @@ #include <loadenv/targethelper.hxx> #include <framework/framelistanalyzer.hxx> -#include <constant/frameloader.hxx> - -#include <constant/contenthandler.hxx> - #include <constant/containerquery.hxx> #include <interaction/quietinteraction.hxx> #include <threadhelp/writeguard.hxx> @@ -96,7 +92,9 @@ #include <rtl/ustrbuf.hxx> #include <vcl/svapp.hxx> -//_______________________________________________ +const char PROP_TYPES[] = "Types"; +const char PROP_NAME[] = "Name"; + // namespace namespace framework{ @@ -736,8 +734,10 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString& // Because there exist some types, which are referenced by // other objects ... but not by filters nor frame loaders! + rtl::OUString sPROP_TYPES(PROP_TYPES); + lTypesReg[0] = sType; - lQuery[0].Name = ::framework::constant::FrameLoader::PROP_TYPES; + lQuery[0].Name = sPROP_TYPES; lQuery[0].Value <<= lTypesReg; xContainer = css::uno::Reference< css::container::XContainerQuery >(xSMGR->createInstance(SERVICENAME_FRAMELOADERFACTORY), css::uno::UNO_QUERY); @@ -752,7 +752,7 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString& // Such contents can be handled ... but not loaded. lTypesReg[0] = sType; - lQuery[0].Name = ::framework::constant::ContentHandler::PROP_TYPES; + lQuery[0].Name = sPROP_TYPES; lQuery[0].Value <<= lTypesReg; xContainer = css::uno::Reference< css::container::XContainerQuery >(xSMGR->createInstance(SERVICENAME_CONTENTHANDLERFACTORY), css::uno::UNO_QUERY); @@ -912,14 +912,16 @@ sal_Bool LoadEnv::impl_handleContent() lTypeReg[0] = sType; css::uno::Sequence< css::beans::NamedValue > lQuery(1); - lQuery[0].Name = ::framework::constant::ContentHandler::PROP_TYPES; + lQuery[0].Name = rtl::OUString(PROP_TYPES); lQuery[0].Value <<= lTypeReg; + ::rtl::OUString sPROP_NAME(PROP_NAME); + css::uno::Reference< css::container::XEnumeration > xSet = xQuery->createSubSetEnumerationByProperties(lQuery); while(xSet->hasMoreElements()) { ::comphelper::SequenceAsHashMap lProps (xSet->nextElement()); - ::rtl::OUString sHandler = lProps.getUnpackedValueOrDefault(::framework::constant::ContentHandler::PROP_NAME, ::rtl::OUString()); + ::rtl::OUString sHandler = lProps.getUnpackedValueOrDefault(sPROP_NAME, ::rtl::OUString()); css::uno::Reference< css::frame::XNotifyingDispatch > xHandler; try @@ -1210,16 +1212,18 @@ css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader() lTypesReg[0] = sType; css::uno::Sequence< css::beans::NamedValue > lQuery(1); - lQuery[0].Name = ::framework::constant::FrameLoader::PROP_TYPES; + lQuery[0].Name = rtl::OUString(PROP_TYPES); lQuery[0].Value <<= lTypesReg; + ::rtl::OUString sPROP_NAME(PROP_NAME); + css::uno::Reference< css::container::XEnumeration > xSet = xQuery->createSubSetEnumerationByProperties(lQuery); while(xSet->hasMoreElements()) { // try everyone ... // Ignore any loader, which makes trouble :-) ::comphelper::SequenceAsHashMap lLoaderProps(xSet->nextElement()); - ::rtl::OUString sLoader = lLoaderProps.getUnpackedValueOrDefault(::framework::constant::FrameLoader::PROP_NAME, ::rtl::OUString()); + ::rtl::OUString sLoader = lLoaderProps.getUnpackedValueOrDefault(sPROP_NAME, ::rtl::OUString()); css::uno::Reference< css::uno::XInterface > xLoader ; try { diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 73f6ac6e9eda..28d2734a44c8 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -131,73 +131,69 @@ namespace framework //----------------------------------------------- // recovery.xcu -static const ::rtl::OUString CFG_PACKAGE_RECOVERY(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery/")); -static const ::rtl::OUString CFG_ENTRY_RECOVERYLIST(RTL_CONSTASCII_USTRINGPARAM("RecoveryList")); -static const ::rtl::OUString CFG_PATH_RECOVERYINFO(RTL_CONSTASCII_USTRINGPARAM("RecoveryInfo")); -static const ::rtl::OUString CFG_ENTRY_ENABLED(RTL_CONSTASCII_USTRINGPARAM("Enabled")); -static const ::rtl::OUString CFG_ENTRY_CRASHED(RTL_CONSTASCII_USTRINGPARAM("Crashed")); -static const ::rtl::OUString CFG_ENTRY_SESSIONDATA(RTL_CONSTASCII_USTRINGPARAM("SessionData")); - -static const ::rtl::OUString CFG_ENTRY_AUTOSAVE_ENABLED(RTL_CONSTASCII_USTRINGPARAM("AutoSave/Enabled")); -static const ::rtl::OUString CFG_ENTRY_AUTOSAVE_TIMEINTERVALL(RTL_CONSTASCII_USTRINGPARAM("AutoSave/TimeIntervall")); - -static const ::rtl::OUString CFG_PATH_AUTOSAVE(RTL_CONSTASCII_USTRINGPARAM("AutoSave")); -static const ::rtl::OUString CFG_ENTRY_MINSPACE_DOCSAVE(RTL_CONSTASCII_USTRINGPARAM("MinSpaceDocSave")); -static const ::rtl::OUString CFG_ENTRY_MINSPACE_CONFIGSAVE(RTL_CONSTASCII_USTRINGPARAM("MinSpaceConfigSave")); - -static const ::rtl::OUString CFG_PACKAGE_MODULES(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup/Office/Factories")); -static const ::rtl::OUString CFG_ENTRY_REALDEFAULTFILTER(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryActualFilter")); - -static const ::rtl::OUString CFG_ENTRY_PROP_TEMPURL(RTL_CONSTASCII_USTRINGPARAM("TempURL")); -static const ::rtl::OUString CFG_ENTRY_PROP_ORIGINALURL(RTL_CONSTASCII_USTRINGPARAM("OriginalURL")); -static const ::rtl::OUString CFG_ENTRY_PROP_TEMPLATEURL(RTL_CONSTASCII_USTRINGPARAM("TemplateURL")); -static const ::rtl::OUString CFG_ENTRY_PROP_FACTORYURL(RTL_CONSTASCII_USTRINGPARAM("FactoryURL")); -static const ::rtl::OUString CFG_ENTRY_PROP_MODULE(RTL_CONSTASCII_USTRINGPARAM("Module")); -static const ::rtl::OUString CFG_ENTRY_PROP_DOCUMENTSTATE(RTL_CONSTASCII_USTRINGPARAM("DocumentState")); -static const ::rtl::OUString CFG_ENTRY_PROP_FILTER(RTL_CONSTASCII_USTRINGPARAM("Filter")); -static const ::rtl::OUString CFG_ENTRY_PROP_TITLE(RTL_CONSTASCII_USTRINGPARAM("Title")); -static const ::rtl::OUString CFG_ENTRY_PROP_ID(RTL_CONSTASCII_USTRINGPARAM("ID")); -static const ::rtl::OUString CFG_ENTRY_PROP_VIEWNAMES(RTL_CONSTASCII_USTRINGPARAM("ViewNames")); - -static const ::rtl::OUString FILTER_PROP_TYPE(RTL_CONSTASCII_USTRINGPARAM("Type")); -static const ::rtl::OUString FILTER_PROP_NAME(RTL_CONSTASCII_USTRINGPARAM("Name")); -static const ::rtl::OUString TYPE_PROP_EXTENSIONS(RTL_CONSTASCII_USTRINGPARAM("Extensions")); -static const ::rtl::OUString DOCINFO_PROP_TEMPLATE(RTL_CONSTASCII_USTRINGPARAM("TemplateFileName")); +static const char CFG_PACKAGE_RECOVERY[] = "org.openoffice.Office.Recovery/"; +static const char CFG_ENTRY_RECOVERYLIST[] = "RecoveryList"; +static const char CFG_PATH_RECOVERYINFO[] = "RecoveryInfo"; +static const char CFG_ENTRY_CRASHED[] = "Crashed"; +static const char CFG_ENTRY_SESSIONDATA[] = "SessionData"; + +static const char CFG_ENTRY_AUTOSAVE_ENABLED[] = "AutoSave/Enabled"; +static const char CFG_ENTRY_AUTOSAVE_TIMEINTERVALL[] = "AutoSave/TimeIntervall"; //sic! + +static const char CFG_PATH_AUTOSAVE[] = "AutoSave"; +static const char CFG_ENTRY_MINSPACE_DOCSAVE[] = "MinSpaceDocSave"; +static const char CFG_ENTRY_MINSPACE_CONFIGSAVE[] = "MinSpaceConfigSave"; + +static const char CFG_PACKAGE_MODULES[] = "org.openoffice.Setup/Office/Factories"; +static const char CFG_ENTRY_REALDEFAULTFILTER[] = "ooSetupFactoryActualFilter"; + +static const char CFG_ENTRY_PROP_TEMPURL[] = "TempURL"; +static const char CFG_ENTRY_PROP_ORIGINALURL[] = "OriginalURL"; +static const char CFG_ENTRY_PROP_TEMPLATEURL[] = "TemplateURL"; +static const char CFG_ENTRY_PROP_FACTORYURL[] = "FactoryURL"; +static const char CFG_ENTRY_PROP_MODULE[] = "Module"; +static const char CFG_ENTRY_PROP_DOCUMENTSTATE[] = "DocumentState"; +static const char CFG_ENTRY_PROP_FILTER[] = "Filter"; +static const char CFG_ENTRY_PROP_TITLE[] = "Title"; +static const char CFG_ENTRY_PROP_ID[] = "ID"; +static const char CFG_ENTRY_PROP_VIEWNAMES[] = "ViewNames"; + +static const char FILTER_PROP_TYPE[] = "Type"; +static const char TYPE_PROP_EXTENSIONS[] = "Extensions"; // setup.xcu -static const ::rtl::OUString CFG_ENTRY_PROP_EMPTYDOCUMENTURL(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryEmptyDocumentURL")); -static const ::rtl::OUString CFG_ENTRY_PROP_DEFAULTFILTER(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryDefaultFilter")); -static const ::rtl::OUString CFG_ENTRY_PROP_FACTORYSERVICE(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryDocumentService")); - -static const ::rtl::OUString EVENT_ON_NEW(RTL_CONSTASCII_USTRINGPARAM("OnNew")); -static const ::rtl::OUString EVENT_ON_LOAD(RTL_CONSTASCII_USTRINGPARAM("OnLoad")); -static const ::rtl::OUString EVENT_ON_UNLOAD(RTL_CONSTASCII_USTRINGPARAM("OnUnload")); -static const ::rtl::OUString EVENT_ON_MODIFYCHANGED(RTL_CONSTASCII_USTRINGPARAM("OnModifyChanged")); -static const ::rtl::OUString EVENT_ON_SAVE(RTL_CONSTASCII_USTRINGPARAM("OnSave")); -static const ::rtl::OUString EVENT_ON_SAVEAS(RTL_CONSTASCII_USTRINGPARAM("OnSaveAs")); -static const ::rtl::OUString EVENT_ON_SAVETO(RTL_CONSTASCII_USTRINGPARAM("OnCopyTo")); -static const ::rtl::OUString EVENT_ON_SAVEDONE(RTL_CONSTASCII_USTRINGPARAM("OnSaveDone")); -static const ::rtl::OUString EVENT_ON_SAVEASDONE(RTL_CONSTASCII_USTRINGPARAM("OnSaveAsDone")); -static const ::rtl::OUString EVENT_ON_SAVETODONE(RTL_CONSTASCII_USTRINGPARAM("OnCopyToDone")); -static const ::rtl::OUString EVENT_ON_SAVEFAILED(RTL_CONSTASCII_USTRINGPARAM("OnSaveFailed")); -static const ::rtl::OUString EVENT_ON_SAVEASFAILED(RTL_CONSTASCII_USTRINGPARAM("OnSaveAsFailed")); -static const ::rtl::OUString EVENT_ON_SAVETOFAILED(RTL_CONSTASCII_USTRINGPARAM("OnCopyToFailed")); - -static const ::rtl::OUString RECOVERY_ITEM_BASE_IDENTIFIER(RTL_CONSTASCII_USTRINGPARAM("recovery_item_")); - -static const ::rtl::OUString CMD_PROTOCOL(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.autorecovery:")); - -static const ::rtl::OUString CMD_DO_AUTO_SAVE(RTL_CONSTASCII_USTRINGPARAM("/doAutoSave")); // force AutoSave ignoring the AutoSave timer -static const ::rtl::OUString CMD_DO_PREPARE_EMERGENCY_SAVE(RTL_CONSTASCII_USTRINGPARAM("/doPrepareEmergencySave")); // prepare the office for the following EmergencySave step (hide windows etcpp.) -static const ::rtl::OUString CMD_DO_EMERGENCY_SAVE(RTL_CONSTASCII_USTRINGPARAM("/doEmergencySave")); // do EmergencySave on crash -static const ::rtl::OUString CMD_DO_RECOVERY(RTL_CONSTASCII_USTRINGPARAM("/doAutoRecovery")); // recover all crashed documents -static const ::rtl::OUString CMD_DO_ENTRY_BACKUP(RTL_CONSTASCII_USTRINGPARAM("/doEntryBackup")); // try to store a temp or original file to a user defined location -static const ::rtl::OUString CMD_DO_ENTRY_CLEANUP(RTL_CONSTASCII_USTRINGPARAM("/doEntryCleanUp")); // remove the specified entry from the recovery cache -static const ::rtl::OUString CMD_DO_SESSION_SAVE(RTL_CONSTASCII_USTRINGPARAM("/doSessionSave")); // save all open documents if e.g. a window manager closes an user session -static const ::rtl::OUString CMD_DO_SESSION_QUIET_QUIT(RTL_CONSTASCII_USTRINGPARAM("/doSessionQuietQuit")); // let the current session be quietly closed ( the saving should be done using doSessionSave previously ) if e.g. a window manager closes an user session -static const ::rtl::OUString CMD_DO_SESSION_RESTORE(RTL_CONSTASCII_USTRINGPARAM("/doSessionRestore")); // restore a saved user session from disc -static const ::rtl::OUString CMD_DO_DISABLE_RECOVERY(RTL_CONSTASCII_USTRINGPARAM("/disableRecovery")); // disable recovery and auto save (!) temp. for this office session -static const ::rtl::OUString CMD_DO_SET_AUTOSAVE_STATE(RTL_CONSTASCII_USTRINGPARAM("/setAutoSaveState")); // disable/enable auto save (not crash save) for this office session +static const char CFG_ENTRY_PROP_EMPTYDOCUMENTURL[] = "ooSetupFactoryEmptyDocumentURL"; +static const char CFG_ENTRY_PROP_FACTORYSERVICE[] = "ooSetupFactoryDocumentService"; + +static const char EVENT_ON_NEW[] = "OnNew"; +static const char EVENT_ON_LOAD[] = "OnLoad"; +static const char EVENT_ON_UNLOAD[] = "OnUnload"; +static const char EVENT_ON_MODIFYCHANGED[] = "OnModifyChanged"; +static const char EVENT_ON_SAVE[] = "OnSave"; +static const char EVENT_ON_SAVEAS[] = "OnSaveAs"; +static const char EVENT_ON_SAVETO[] = "OnCopyTo"; +static const char EVENT_ON_SAVEDONE[] = "OnSaveDone"; +static const char EVENT_ON_SAVEASDONE[] = "OnSaveAsDone"; +static const char EVENT_ON_SAVETODONE[] = "OnCopyToDone"; +static const char EVENT_ON_SAVEFAILED[] = "OnSaveFailed"; +static const char EVENT_ON_SAVEASFAILED[] = "OnSaveAsFailed"; +static const char EVENT_ON_SAVETOFAILED[] = "OnCopyToFailed"; + +static const char RECOVERY_ITEM_BASE_IDENTIFIER[] = "recovery_item_"; + +static const char CMD_PROTOCOL[] = "vnd.sun.star.autorecovery:"; + +static const char CMD_DO_AUTO_SAVE[] = "/doAutoSave"; // force AutoSave ignoring the AutoSave timer +static const char CMD_DO_PREPARE_EMERGENCY_SAVE[] = "/doPrepareEmergencySave"; // prepare the office for the following EmergencySave step (hide windows etcpp.) +static const char CMD_DO_EMERGENCY_SAVE[] = "/doEmergencySave"; // do EmergencySave on crash +static const char CMD_DO_RECOVERY[] = "/doAutoRecovery"; // recover all crashed documents +static const char CMD_DO_ENTRY_BACKUP[] = "/doEntryBackup"; // try to store a temp or original file to a user defined location +static const char CMD_DO_ENTRY_CLEANUP[] = "/doEntryCleanUp"; // remove the specified entry from the recovery cache +static const char CMD_DO_SESSION_SAVE[] = "/doSessionSave"; // save all open documents if e.g. a window manager closes an user session +static const char CMD_DO_SESSION_QUIET_QUIT[] = "/doSessionQuietQuit"; // let the current session be quietly closed ( the saving should be done using doSessionSave previously ) if e.g. a window manager closes an user session +static const char CMD_DO_SESSION_RESTORE[] = "/doSessionRestore"; // restore a saved user session from disc +static const char CMD_DO_DISABLE_RECOVERY[] = "/disableRecovery"; // disable recovery and auto save (!) temp. for this office session +static const char CMD_DO_SET_AUTOSAVE_STATE[] = "/setAutoSaveState"; // disable/enable auto save (not crash save) for this office session static const char REFERRER_USER[] = "private:user"; @@ -773,15 +769,14 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent // new document => put it into the internal list if ( - (aEvent.EventName.equals(EVENT_ON_NEW )) || - (aEvent.EventName.equals(EVENT_ON_LOAD)) + (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_NEW))) || + (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_LOAD))) ) { implts_registerDocument(xDocument); } // document modified => set its modify state new (means modified against the original file!) - else - if (aEvent.EventName.equals(EVENT_ON_MODIFYCHANGED)) + else if (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_MODIFYCHANGED))) { implts_updateModifiedState(xDocument); } @@ -790,20 +785,18 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent at the same time. So we have to supress our AutoSave feature for the moment, till this other save requests will be finished. */ - else - if ( - (aEvent.EventName.equals(EVENT_ON_SAVE )) || - (aEvent.EventName.equals(EVENT_ON_SAVEAS)) || - (aEvent.EventName.equals(EVENT_ON_SAVETO)) + else if ( + (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVE))) || + (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVEAS))) || + (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVETO))) ) { implts_updateDocumentUsedForSavingState(xDocument, SAVE_IN_PROGRESS); } // document saved => remove tmp. files - but hold config entries alive! - else - if ( - (aEvent.EventName.equals(EVENT_ON_SAVEDONE )) || - (aEvent.EventName.equals(EVENT_ON_SAVEASDONE)) + else if ( + (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVEDONE))) || + (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVEASDONE))) ) { implts_markDocumentAsSaved(xDocument); @@ -814,8 +807,7 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent Dont remove temp. files or change the modified state of the document! It was not realy saved to the original file ... */ - else - if (aEvent.EventName.equals(EVENT_ON_SAVETODONE)) + else if (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVETODONE))) { implts_updateDocumentUsedForSavingState(xDocument, SAVE_FINISHED); } @@ -823,18 +815,16 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent // by ourself next time AutoSave or EmergencySave is triggered. // But we can reset the state "used for other save requests". Otherwhise // these documents will never be saved! - else - if ( - (aEvent.EventName.equals(EVENT_ON_SAVEFAILED )) || - (aEvent.EventName.equals(EVENT_ON_SAVEASFAILED)) || - (aEvent.EventName.equals(EVENT_ON_SAVETOFAILED)) + else if ( + (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVEFAILED))) || + (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVEASFAILED))) || + (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVETOFAILED))) ) { implts_updateDocumentUsedForSavingState(xDocument, SAVE_FINISHED); } // document closed => remove temp. files and configuration entries - else - if (aEvent.EventName.equals(EVENT_ON_UNLOAD)) + else if (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_UNLOAD))) { implts_deregisterDocument(xDocument, sal_True); // sal_True => stop listening for disposing() ! } @@ -864,7 +854,7 @@ void SAL_CALL AutoRecovery::changesOccurred(const css::util::ChangesEvent& aEven ::rtl::OUString sPath; pChanges[i].Accessor >>= sPath; - if (sPath.equals(CFG_ENTRY_AUTOSAVE_ENABLED)) + if (sPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_AUTOSAVE_ENABLED))) { sal_Bool bEnabled = sal_False; if (pChanges[i].Element >>= bEnabled) @@ -882,7 +872,7 @@ void SAL_CALL AutoRecovery::changesOccurred(const css::util::ChangesEvent& aEven } } else - if (sPath.equals(CFG_ENTRY_AUTOSAVE_TIMEINTERVALL)) + if (sPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_AUTOSAVE_TIMEINTERVALL))) pChanges[i].Element >>= m_nAutoSaveTimeIntervall; } @@ -951,9 +941,10 @@ css::uno::Reference< css::container::XNameAccess > AutoRecovery::implts_openConf aWriteLock.unlock(); // <- SAFE ---------------------------------- + rtl::OUString sCFG_PACKAGE_RECOVERY(RTL_CONSTASCII_USTRINGPARAM(CFG_PACKAGE_RECOVERY)); // throws a RuntimeException if an error occure! css::uno::Reference< css::container::XNameAccess > xCFG( - ::comphelper::ConfigurationHelper::openConfig(xSMGR, CFG_PACKAGE_RECOVERY, ::comphelper::ConfigurationHelper::E_STANDARD), + ::comphelper::ConfigurationHelper::openConfig(xSMGR, sCFG_PACKAGE_RECOVERY, ::comphelper::ConfigurationHelper::E_STANDARD), css::uno::UNO_QUERY); sal_Int32 nMinSpaceDocSave = MIN_DISCSPACE_DOCSAVE; @@ -961,16 +952,17 @@ css::uno::Reference< css::container::XNameAccess > AutoRecovery::implts_openConf try { + rtl::OUString sCFG_PATH_AUTOSAVE(CFG_PATH_AUTOSAVE); ::comphelper::ConfigurationHelper::readDirectKey(xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_AUTOSAVE, - CFG_ENTRY_MINSPACE_DOCSAVE, + sCFG_PACKAGE_RECOVERY, + sCFG_PATH_AUTOSAVE, + rtl::OUString(CFG_ENTRY_MINSPACE_DOCSAVE), ::comphelper::ConfigurationHelper::E_STANDARD) >>= nMinSpaceDocSave; ::comphelper::ConfigurationHelper::readDirectKey(xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_AUTOSAVE, - CFG_ENTRY_MINSPACE_CONFIGSAVE, + sCFG_PACKAGE_RECOVERY, + sCFG_PATH_AUTOSAVE, + rtl::OUString(CFG_ENTRY_MINSPACE_CONFIGSAVE), ::comphelper::ConfigurationHelper::E_STANDARD) >>= nMinSpaceConfigSave; } catch(const css::uno::Exception&) @@ -999,7 +991,7 @@ void AutoRecovery::implts_readAutoSaveConfig() // AutoSave [bool] sal_Bool bEnabled = sal_False; - xCommonRegistry->getByHierarchicalName(CFG_ENTRY_AUTOSAVE_ENABLED) >>= bEnabled; + xCommonRegistry->getByHierarchicalName(rtl::OUString(CFG_ENTRY_AUTOSAVE_ENABLED)) >>= bEnabled; // SAFE -> ------------------------------ WriteGuard aWriteLock(m_aLock); @@ -1018,7 +1010,7 @@ void AutoRecovery::implts_readAutoSaveConfig() // AutoSaveTimeIntervall [int] in min sal_Int32 nTimeIntervall = 15; - xCommonRegistry->getByHierarchicalName(CFG_ENTRY_AUTOSAVE_TIMEINTERVALL) >>= nTimeIntervall; + xCommonRegistry->getByHierarchicalName(rtl::OUString(CFG_ENTRY_AUTOSAVE_TIMEINTERVALL)) >>= nTimeIntervall; // SAFE -> ---------------------------------- aWriteLock.lock(); @@ -1051,11 +1043,12 @@ void AutoRecovery::implts_readConfig() css::uno::Any aValue; // RecoveryList [set] - aValue = xCommonRegistry->getByHierarchicalName(CFG_ENTRY_RECOVERYLIST); + aValue = xCommonRegistry->getByHierarchicalName(rtl::OUString(CFG_ENTRY_RECOVERYLIST)); css::uno::Reference< css::container::XNameAccess > xList; aValue >>= xList; if (xList.is()) { + const rtl::OUString sRECOVERY_ITEM_BASE_IDENTIFIER(RECOVERY_ITEM_BASE_IDENTIFIER); const css::uno::Sequence< ::rtl::OUString > lItems = xList->getElementNames(); const ::rtl::OUString* pItems = lItems.getConstArray(); sal_Int32 c = lItems.getLength(); @@ -1074,20 +1067,20 @@ void AutoRecovery::implts_readConfig() AutoRecovery::TDocumentInfo aInfo; aInfo.NewTempURL = ::rtl::OUString(); aInfo.Document = css::uno::Reference< css::frame::XModel >(); - xItem->getPropertyValue(CFG_ENTRY_PROP_ORIGINALURL ) >>= aInfo.OrgURL ; - xItem->getPropertyValue(CFG_ENTRY_PROP_TEMPURL ) >>= aInfo.OldTempURL ; - xItem->getPropertyValue(CFG_ENTRY_PROP_TEMPLATEURL ) >>= aInfo.TemplateURL ; - xItem->getPropertyValue(CFG_ENTRY_PROP_FILTER ) >>= aInfo.RealFilter ; - xItem->getPropertyValue(CFG_ENTRY_PROP_DOCUMENTSTATE) >>= aInfo.DocumentState; - xItem->getPropertyValue(CFG_ENTRY_PROP_MODULE ) >>= aInfo.AppModule ; - xItem->getPropertyValue(CFG_ENTRY_PROP_TITLE ) >>= aInfo.Title ; - xItem->getPropertyValue(CFG_ENTRY_PROP_VIEWNAMES ) >>= aInfo.ViewNames ; + xItem->getPropertyValue(rtl::OUString(CFG_ENTRY_PROP_ORIGINALURL)) >>= aInfo.OrgURL ; + xItem->getPropertyValue(rtl::OUString(CFG_ENTRY_PROP_TEMPURL)) >>= aInfo.OldTempURL ; + xItem->getPropertyValue(rtl::OUString(CFG_ENTRY_PROP_TEMPLATEURL)) >>= aInfo.TemplateURL ; + xItem->getPropertyValue(rtl::OUString(CFG_ENTRY_PROP_FILTER)) >>= aInfo.RealFilter ; + xItem->getPropertyValue(rtl::OUString(CFG_ENTRY_PROP_DOCUMENTSTATE)) >>= aInfo.DocumentState; + xItem->getPropertyValue(rtl::OUString(CFG_ENTRY_PROP_MODULE)) >>= aInfo.AppModule; + xItem->getPropertyValue(rtl::OUString(CFG_ENTRY_PROP_TITLE)) >>= aInfo.Title; + xItem->getPropertyValue(rtl::OUString(CFG_ENTRY_PROP_VIEWNAMES)) >>= aInfo.ViewNames; implts_specifyAppModuleAndFactory(aInfo); implts_specifyDefaultFilterAndExtension(aInfo); - if (pItems[i].indexOf(RECOVERY_ITEM_BASE_IDENTIFIER)==0) + if (pItems[i].indexOf(sRECOVERY_ITEM_BASE_IDENTIFIER)==0) { - ::rtl::OUString sID = pItems[i].copy(RECOVERY_ITEM_BASE_IDENTIFIER.getLength()); + ::rtl::OUString sID = pItems[i].copy(sRECOVERY_ITEM_BASE_IDENTIFIER.getLength()); aInfo.ID = sID.toInt32(); // SAFE -> ---------------------- aWriteLock.lock(); @@ -1141,7 +1134,8 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume { // open module config on demand and cache the update access xCFG = css::uno::Reference< css::container::XNameAccess >( - ::comphelper::ConfigurationHelper::openConfig(xSMGR, CFG_PACKAGE_MODULES, ::comphelper::ConfigurationHelper::E_STANDARD), + ::comphelper::ConfigurationHelper::openConfig(xSMGR, rtl::OUString(CFG_PACKAGE_MODULES), + ::comphelper::ConfigurationHelper::E_STANDARD), css::uno::UNO_QUERY_THROW); // SAFE -> ---------------------------------- @@ -1155,15 +1149,15 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume xCFG->getByName(rInfo.AppModule), css::uno::UNO_QUERY_THROW); - xModuleProps->getByName(CFG_ENTRY_REALDEFAULTFILTER) >>= rInfo.DefaultFilter; + xModuleProps->getByName(rtl::OUString(CFG_ENTRY_REALDEFAULTFILTER)) >>= rInfo.DefaultFilter; css::uno::Reference< css::container::XNameAccess > xFilterCFG(xSMGR->createInstance(SERVICENAME_FILTERFACTORY), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::container::XNameAccess > xTypeCFG (xSMGR->createInstance(SERVICENAME_TYPEDETECTION), css::uno::UNO_QUERY_THROW); ::comphelper::SequenceAsHashMap lFilterProps (xFilterCFG->getByName(rInfo.DefaultFilter)); - ::rtl::OUString sTypeRegistration = lFilterProps.getUnpackedValueOrDefault(FILTER_PROP_TYPE, ::rtl::OUString()); + ::rtl::OUString sTypeRegistration = lFilterProps.getUnpackedValueOrDefault(rtl::OUString(FILTER_PROP_TYPE), ::rtl::OUString()); ::comphelper::SequenceAsHashMap lTypeProps (xTypeCFG->getByName(sTypeRegistration)); - css::uno::Sequence< ::rtl::OUString > lExtensions = lTypeProps.getUnpackedValueOrDefault(TYPE_PROP_EXTENSIONS, css::uno::Sequence< ::rtl::OUString >()); + css::uno::Sequence< ::rtl::OUString > lExtensions = lTypeProps.getUnpackedValueOrDefault(rtl::OUString(TYPE_PROP_EXTENSIONS), css::uno::Sequence< ::rtl::OUString >()); if (lExtensions.getLength()) { rInfo.Extension = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")); @@ -1200,8 +1194,8 @@ void AutoRecovery::implts_specifyAppModuleAndFactory(AutoRecovery::TDocumentInfo rInfo.AppModule = xManager->identify(rInfo.Document); ::comphelper::SequenceAsHashMap lModuleDescription(xModuleConfig->getByName(rInfo.AppModule)); - lModuleDescription[CFG_ENTRY_PROP_EMPTYDOCUMENTURL] >>= rInfo.FactoryURL; - lModuleDescription[CFG_ENTRY_PROP_FACTORYSERVICE] >>= rInfo.FactoryService; + lModuleDescription[rtl::OUString(CFG_ENTRY_PROP_EMPTYDOCUMENTURL)] >>= rInfo.FactoryURL; + lModuleDescription[rtl::OUString(CFG_ENTRY_PROP_FACTORYSERVICE)] >>= rInfo.FactoryService; } //----------------------------------------------- @@ -1272,13 +1266,13 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn xCFG = css::uno::Reference< css::container::XHierarchicalNameAccess >(implts_openConfig(), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::container::XNameAccess > xCheck; - xCFG->getByHierarchicalName(CFG_ENTRY_RECOVERYLIST) >>= xCheck; + xCFG->getByHierarchicalName(rtl::OUString(CFG_ENTRY_RECOVERYLIST)) >>= xCheck; css::uno::Reference< css::container::XNameContainer > xModify(xCheck, css::uno::UNO_QUERY_THROW); css::uno::Reference< css::lang::XSingleServiceFactory > xCreate(xCheck, css::uno::UNO_QUERY_THROW); ::rtl::OUStringBuffer sIDBuf; - sIDBuf.append(RECOVERY_ITEM_BASE_IDENTIFIER); + sIDBuf.appendAscii(RTL_CONSTASCII_STRINGPARAM(RECOVERY_ITEM_BASE_IDENTIFIER)); sIDBuf.append((sal_Int32)rInfo.ID); ::rtl::OUString sID = sIDBuf.makeStringAndClear(); @@ -1307,14 +1301,14 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn else xCheck->getByName(sID) >>= xSet; - xSet->setPropertyValue(CFG_ENTRY_PROP_ORIGINALURL , css::uno::makeAny(rInfo.OrgURL )); - xSet->setPropertyValue(CFG_ENTRY_PROP_TEMPURL , css::uno::makeAny(rInfo.OldTempURL )); - xSet->setPropertyValue(CFG_ENTRY_PROP_TEMPLATEURL , css::uno::makeAny(rInfo.TemplateURL )); - xSet->setPropertyValue(CFG_ENTRY_PROP_FILTER , css::uno::makeAny(rInfo.RealFilter )); - xSet->setPropertyValue(CFG_ENTRY_PROP_DOCUMENTSTATE, css::uno::makeAny(rInfo.DocumentState)); - xSet->setPropertyValue(CFG_ENTRY_PROP_MODULE , css::uno::makeAny(rInfo.AppModule )); - xSet->setPropertyValue(CFG_ENTRY_PROP_TITLE , css::uno::makeAny(rInfo.Title )); - xSet->setPropertyValue(CFG_ENTRY_PROP_VIEWNAMES , css::uno::makeAny(rInfo.ViewNames )); + xSet->setPropertyValue(rtl::OUString(CFG_ENTRY_PROP_ORIGINALURL), css::uno::makeAny(rInfo.OrgURL )); + xSet->setPropertyValue(rtl::OUString(CFG_ENTRY_PROP_TEMPURL), css::uno::makeAny(rInfo.OldTempURL )); + xSet->setPropertyValue(rtl::OUString(CFG_ENTRY_PROP_TEMPLATEURL), css::uno::makeAny(rInfo.TemplateURL )); + xSet->setPropertyValue(rtl::OUString(CFG_ENTRY_PROP_FILTER), css::uno::makeAny(rInfo.RealFilter)); + xSet->setPropertyValue(rtl::OUString(CFG_ENTRY_PROP_DOCUMENTSTATE), css::uno::makeAny(rInfo.DocumentState)); + xSet->setPropertyValue(rtl::OUString(CFG_ENTRY_PROP_MODULE), css::uno::makeAny(rInfo.AppModule)); + xSet->setPropertyValue(rtl::OUString(CFG_ENTRY_PROP_TITLE), css::uno::makeAny(rInfo.Title)); + xSet->setPropertyValue(rtl::OUString(CFG_ENTRY_PROP_VIEWNAMES), css::uno::makeAny(rInfo.ViewNames)); if (bNew) xModify->insertByName(sID, css::uno::makeAny(xSet)); @@ -2839,7 +2833,7 @@ void AutoRecovery::implts_informListener( sal_Int32 eJ { // describe the current running operation ::rtl::OUStringBuffer sFeature(256); - sFeature.append(CMD_PROTOCOL); + sFeature.appendAscii(RTL_CONSTASCII_STRINGPARAM(CMD_PROTOCOL)); // Attention: Because "eJob" is used as a flag field the order of checking these // flags is importent. We must preferr job with higher priorities! @@ -2848,31 +2842,31 @@ void AutoRecovery::implts_informListener( sal_Int32 eJ // e.g. PrepareEmergencySave must be done before EmergencySave is started of course. if ((eJob & AutoRecovery::E_PREPARE_EMERGENCY_SAVE) == AutoRecovery::E_PREPARE_EMERGENCY_SAVE) - sFeature.append(CMD_DO_PREPARE_EMERGENCY_SAVE); + sFeature.appendAscii(RTL_CONSTASCII_STRINGPARAM(CMD_DO_PREPARE_EMERGENCY_SAVE)); else if ((eJob & AutoRecovery::E_EMERGENCY_SAVE) == AutoRecovery::E_EMERGENCY_SAVE) - sFeature.append(CMD_DO_EMERGENCY_SAVE); + sFeature.appendAscii(RTL_CONSTASCII_STRINGPARAM(CMD_DO_EMERGENCY_SAVE)); else if ((eJob & AutoRecovery::E_RECOVERY) == AutoRecovery::E_RECOVERY) - sFeature.append(CMD_DO_RECOVERY); + sFeature.appendAscii(RTL_CONSTASCII_STRINGPARAM(CMD_DO_RECOVERY)); else if ((eJob & AutoRecovery::E_SESSION_SAVE) == AutoRecovery::E_SESSION_SAVE) - sFeature.append(CMD_DO_SESSION_SAVE); + sFeature.appendAscii(RTL_CONSTASCII_STRINGPARAM(CMD_DO_SESSION_SAVE)); else if ((eJob & AutoRecovery::E_SESSION_QUIET_QUIT) == AutoRecovery::E_SESSION_QUIET_QUIT) - sFeature.append(CMD_DO_SESSION_QUIET_QUIT); + sFeature.appendAscii(RTL_CONSTASCII_STRINGPARAM(CMD_DO_SESSION_QUIET_QUIT)); else if ((eJob & AutoRecovery::E_SESSION_RESTORE) == AutoRecovery::E_SESSION_RESTORE) - sFeature.append(CMD_DO_SESSION_RESTORE); + sFeature.appendAscii(RTL_CONSTASCII_STRINGPARAM(CMD_DO_SESSION_RESTORE)); else if ((eJob & AutoRecovery::E_ENTRY_BACKUP) == AutoRecovery::E_ENTRY_BACKUP) - sFeature.append(CMD_DO_ENTRY_BACKUP); + sFeature.appendAscii(RTL_CONSTASCII_STRINGPARAM(CMD_DO_ENTRY_BACKUP)); else if ((eJob & AutoRecovery::E_ENTRY_CLEANUP) == AutoRecovery::E_ENTRY_CLEANUP) - sFeature.append(CMD_DO_ENTRY_CLEANUP); + sFeature.appendAscii(RTL_CONSTASCII_STRINGPARAM(CMD_DO_ENTRY_CLEANUP)); else if ((eJob & AutoRecovery::E_AUTO_SAVE) == AutoRecovery::E_AUTO_SAVE) - sFeature.append(CMD_DO_AUTO_SAVE); + sFeature.appendAscii(RTL_CONSTASCII_STRINGPARAM(CMD_DO_AUTO_SAVE)); #ifdef ENABLE_WARNINGS else if ( eJob != AutoRecovery::E_NO_JOB ) LOG_WARNING("AutoRecovery::implst_getJobDescription()", "Invalid job identifier detected.") @@ -2884,36 +2878,27 @@ void AutoRecovery::implts_informListener( sal_Int32 eJ //----------------------------------------------- sal_Int32 AutoRecovery::implst_classifyJob(const css::util::URL& aURL) { - if (aURL.Protocol.equals(CMD_PROTOCOL)) + if (aURL.Protocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_PROTOCOL))) { - if (aURL.Path.equals(CMD_DO_PREPARE_EMERGENCY_SAVE)) + if (aURL.Path.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_DO_PREPARE_EMERGENCY_SAVE))) return AutoRecovery::E_PREPARE_EMERGENCY_SAVE; - else - if (aURL.Path.equals(CMD_DO_EMERGENCY_SAVE)) + else if (aURL.Path.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_DO_EMERGENCY_SAVE))) return AutoRecovery::E_EMERGENCY_SAVE; - else - if (aURL.Path.equals(CMD_DO_RECOVERY)) + else if (aURL.Path.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_DO_RECOVERY))) return AutoRecovery::E_RECOVERY; - else - if (aURL.Path.equals(CMD_DO_ENTRY_BACKUP)) + else if (aURL.Path.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_DO_ENTRY_BACKUP))) return AutoRecovery::E_ENTRY_BACKUP; - else - if (aURL.Path.equals(CMD_DO_ENTRY_CLEANUP)) + else if (aURL.Path.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_DO_ENTRY_CLEANUP))) return AutoRecovery::E_ENTRY_CLEANUP; - else - if (aURL.Path.equals(CMD_DO_SESSION_SAVE)) + else if (aURL.Path.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_DO_SESSION_SAVE))) return AutoRecovery::E_SESSION_SAVE; - else - if (aURL.Path.equals(CMD_DO_SESSION_QUIET_QUIT)) + else if (aURL.Path.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_DO_SESSION_QUIET_QUIT))) return AutoRecovery::E_SESSION_QUIET_QUIT; - else - if (aURL.Path.equals(CMD_DO_SESSION_RESTORE)) + else if (aURL.Path.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_DO_SESSION_RESTORE))) return AutoRecovery::E_SESSION_RESTORE; - else - if (aURL.Path.equals(CMD_DO_DISABLE_RECOVERY)) + else if (aURL.Path.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_DO_DISABLE_RECOVERY))) return AutoRecovery::E_DISABLE_AUTORECOVERY; - else - if (aURL.Path.equals(CMD_DO_SET_AUTOSAVE_STATE)) + else if (aURL.Path.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_DO_SET_AUTOSAVE_STATE))) return AutoRecovery::E_SET_AUTOSAVE_STATE; } @@ -2934,15 +2919,15 @@ css::frame::FeatureStateEvent AutoRecovery::implst_createFeatureStateEvent( { // pack rInfo for transport via UNO ::comphelper::NamedValueCollection aInfo; - aInfo.put( CFG_ENTRY_PROP_ID, pInfo->ID ); - aInfo.put( CFG_ENTRY_PROP_ORIGINALURL, pInfo->OrgURL ); - aInfo.put( CFG_ENTRY_PROP_FACTORYURL, pInfo->FactoryURL ); - aInfo.put( CFG_ENTRY_PROP_TEMPLATEURL, pInfo->TemplateURL ); - aInfo.put( CFG_ENTRY_PROP_TEMPURL, pInfo->OldTempURL.isEmpty() ? pInfo->NewTempURL : pInfo->OldTempURL ); - aInfo.put( CFG_ENTRY_PROP_MODULE, pInfo->AppModule ); - aInfo.put( CFG_ENTRY_PROP_TITLE, pInfo->Title ); - aInfo.put( CFG_ENTRY_PROP_VIEWNAMES, pInfo->ViewNames ); - aInfo.put( CFG_ENTRY_PROP_DOCUMENTSTATE, pInfo->DocumentState ); + aInfo.put( rtl::OUString(CFG_ENTRY_PROP_ID), pInfo->ID ); + aInfo.put( rtl::OUString(CFG_ENTRY_PROP_ORIGINALURL), pInfo->OrgURL ); + aInfo.put( rtl::OUString(CFG_ENTRY_PROP_FACTORYURL), pInfo->FactoryURL ); + aInfo.put( rtl::OUString(CFG_ENTRY_PROP_TEMPLATEURL), pInfo->TemplateURL ); + aInfo.put( rtl::OUString(CFG_ENTRY_PROP_TEMPURL), pInfo->OldTempURL.isEmpty() ? pInfo->NewTempURL : pInfo->OldTempURL ); + aInfo.put( rtl::OUString(CFG_ENTRY_PROP_MODULE), pInfo->AppModule) ; + aInfo.put( rtl::OUString(CFG_ENTRY_PROP_TITLE), pInfo->Title); + aInfo.put( rtl::OUString(CFG_ENTRY_PROP_VIEWNAMES), pInfo->ViewNames); + aInfo.put( rtl::OUString(CFG_ENTRY_PROP_DOCUMENTSTATE), pInfo->DocumentState); aEvent.State <<= aInfo.getPropertyValues(); } @@ -2996,9 +2981,9 @@ void AutoRecovery::implts_doEmergencySave(const DispatchParams& aParams) // documents exists and was saved. ::comphelper::ConfigurationHelper::writeDirectKey( m_xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_RECOVERYINFO, - CFG_ENTRY_CRASHED, + rtl::OUString(CFG_PACKAGE_RECOVERY), + rtl::OUString(CFG_PATH_RECOVERYINFO), + rtl::OUString(CFG_ENTRY_CRASHED), css::uno::makeAny(sal_True), ::comphelper::ConfigurationHelper::E_STANDARD); @@ -3057,9 +3042,9 @@ void AutoRecovery::implts_doRecovery(const DispatchParams& aParams) // Reset the configuration hint "we was crashed"! ::comphelper::ConfigurationHelper::writeDirectKey( m_xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_RECOVERYINFO, - CFG_ENTRY_CRASHED, + rtl::OUString(CFG_PACKAGE_RECOVERY), + rtl::OUString(CFG_PATH_RECOVERYINFO), + rtl::OUString(CFG_ENTRY_CRASHED), css::uno::makeAny(sal_False), ::comphelper::ConfigurationHelper::E_STANDARD); } @@ -3124,9 +3109,9 @@ void AutoRecovery::implts_doSessionQuietQuit(const DispatchParams& /*aParams*/) // the on next startup we know what's happen last time ::comphelper::ConfigurationHelper::writeDirectKey( m_xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_RECOVERYINFO, - CFG_ENTRY_SESSIONDATA, + rtl::OUString(CFG_PACKAGE_RECOVERY), + rtl::OUString(CFG_PATH_RECOVERYINFO), + rtl::OUString(CFG_ENTRY_SESSIONDATA), css::uno::makeAny(sal_True), ::comphelper::ConfigurationHelper::E_STANDARD); @@ -3161,9 +3146,9 @@ void AutoRecovery::implts_doSessionRestore(const DispatchParams& aParams) LOG_RECOVERY("... reset config key 'SessionData'") ::comphelper::ConfigurationHelper::writeDirectKey( m_xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_RECOVERYINFO, - CFG_ENTRY_SESSIONDATA, + rtl::OUString(CFG_PACKAGE_RECOVERY), + rtl::OUString(CFG_PATH_RECOVERYINFO), + rtl::OUString(CFG_ENTRY_SESSIONDATA), css::uno::makeAny(sal_False), ::comphelper::ConfigurationHelper::E_STANDARD); @@ -3300,9 +3285,9 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue , sal_Bool bSessionData = sal_False; ::comphelper::ConfigurationHelper::readDirectKey( m_xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_RECOVERYINFO, - CFG_ENTRY_SESSIONDATA, + rtl::OUString(CFG_PACKAGE_RECOVERY), + rtl::OUString(CFG_PATH_RECOVERYINFO), + rtl::OUString(CFG_ENTRY_SESSIONDATA), ::comphelper::ConfigurationHelper::E_READONLY) >>= bSessionData; sal_Bool bRecoveryData = ((sal_Bool)(m_lDocCache.size()>0)); @@ -3319,18 +3304,18 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue , case AUTORECOVERY_PROPHANDLE_CRASHED : aValue = ::comphelper::ConfigurationHelper::readDirectKey( m_xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_RECOVERYINFO, - CFG_ENTRY_CRASHED, + rtl::OUString(CFG_PACKAGE_RECOVERY), + rtl::OUString(CFG_PATH_RECOVERYINFO), + rtl::OUString(CFG_ENTRY_CRASHED), ::comphelper::ConfigurationHelper::E_READONLY); break; case AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA : aValue = ::comphelper::ConfigurationHelper::readDirectKey( m_xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_RECOVERYINFO, - CFG_ENTRY_SESSIONDATA, + rtl::OUString(CFG_PACKAGE_RECOVERY), + rtl::OUString(CFG_PATH_RECOVERYINFO), + rtl::OUString(CFG_ENTRY_SESSIONDATA), ::comphelper::ConfigurationHelper::E_READONLY); break; } diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx index 2dedc41f5639..b3a4a35efee6 100644 --- a/sc/source/ui/vba/vbahelper.cxx +++ b/sc/source/ui/vba/vbahelper.cxx @@ -107,7 +107,9 @@ nViewNo && !pView->GetObjectShell()->IsInPlaceActive() ) } return false; } -const ::rtl::OUString REPLACE_CELLS_WARNING( RTL_CONSTASCII_USTRINGPARAM( "ReplaceCellsWarning")); + +const char REPLACE_CELLS_WARNING[] = "ReplaceCellsWarning"; + const uno::Any& aNULL() { @@ -132,13 +134,13 @@ private: bool getReplaceCellsWarning() throw ( uno::RuntimeException ) { sal_Bool res = false; - getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res; + getGlobalSheetSettings()->getPropertyValue( rtl::OUString(REPLACE_CELLS_WARNING) ) >>= res; return ( res == sal_True ); } void setReplaceCellsWarning( bool bState ) throw ( uno::RuntimeException ) { - getGlobalSheetSettings()->setPropertyValue( REPLACE_CELLS_WARNING, uno::makeAny( bState ) ); + getGlobalSheetSettings()->setPropertyValue( rtl::OUString(REPLACE_CELLS_WARNING), uno::makeAny( bState ) ); } public: PasteCellsWarningReseter() throw ( uno::RuntimeException ) diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 1146f7cea924..a9f5fc07b224 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -27,6 +27,7 @@ ************************************************************************/ #include <svtools/toolboxcontroller.hxx> +#include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -38,11 +39,9 @@ #include <svtools/miscopt.hxx> #include <toolkit/unohlp.hxx> #include <vcl/toolbox.hxx> -//shizhobo -#include <com/sun/star/beans/PropertyAttribute.hpp> + const int TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIBLE = 1; -const rtl::OUString TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE( RTL_CONSTASCII_USTRINGPARAM( "SupportsVisible" )); -//end +const char TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE[] = "SupportsVisible"; using ::rtl::OUString; @@ -97,8 +96,7 @@ ToolboxController::ToolboxController( , m_aCommandURL( aCommandURL ) , m_aListenerContainer( m_aMutex ) { - //registger Propertyh by shizhoubo - registerProperty(TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE, TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIBLE, com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY, + registerProperty(rtl::OUString(TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE), TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIBLE, com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY, &m_bSupportVisible, getCppuType(&m_bSupportVisible)); m_pImpl = new ToolboxController_Impl; @@ -122,8 +120,7 @@ ToolboxController::ToolboxController() : , m_bDisposed( sal_False ) , m_aListenerContainer( m_aMutex ) { - //registger Propertyh by shizhoubo - registerProperty(TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE, TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIBLE, com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY, + registerProperty(rtl::OUString(TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE), TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIBLE, com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY, &m_bSupportVisible, getCppuType(&m_bSupportVisible)); m_pImpl = new ToolboxController_Impl; diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index e6c282832db4..3a25bb1c2487 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -84,10 +84,6 @@ const long FRAMESEL_GEOM_ADD_CLICK_INNER = 2; // ---------------------------------------------------------------------------- -static const frame::Style OBJ_FRAMESTYLE_DONTCARE( 3, 0, 0, SOLID ); - -// ---------------------------------------------------------------------------- - /** Returns the corresponding flag for a frame border. */ FrameSelFlags lclGetFlagFromType( FrameBorderType eBorder ) { @@ -164,7 +160,7 @@ void FrameBorder::SetState( FrameBorderState eState ) break; case FRAMESTATE_DONTCARE: maCoreStyle = SvxBorderLine(); - maUIStyle = OBJ_FRAMESTYLE_DONTCARE; + maUIStyle = frame::Style(3, 0, 0, SOLID); //OBJ_FRAMESTYLE_DONTCARE break; } } diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx index 948af5e1f0a5..a8aa9271c275 100644 --- a/sw/source/ui/dbui/mmconfigitem.cxx +++ b/sw/source/ui/dbui/mmconfigitem.cxx @@ -43,6 +43,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/types.hxx> #include <com/sun/star/sdb/CommandType.hpp> +#include <rtl/instance.hxx> #include <unotools/configitem.hxx> #include <mailmergehelper.hxx> #include <swunohelper.hxx> @@ -736,9 +737,13 @@ void SwMailMergeConfigItem_Impl::SetCurrentGreeting( SetModified(); } -static SwMailMergeConfigItem_Impl* pOptions = NULL; -static sal_Int32 nRefCount = 0; -static ::osl::Mutex aMutex; +namespace +{ + static SwMailMergeConfigItem_Impl* pOptions = NULL; + static sal_Int32 nRefCount = 0; + + class theMailMergeConfigMutex : public rtl::Static<osl::Mutex, theMailMergeConfigMutex> {}; +} SwMailMergeConfigItem::SwMailMergeConfigItem() : m_bAddressInserted(false), @@ -751,7 +756,7 @@ SwMailMergeConfigItem::SwMailMergeConfigItem() : m_pTargetView(0) { // Global access, must be guarded (multithreading) - ::osl::MutexGuard aGuard( aMutex ); + ::osl::MutexGuard aGuard( theMailMergeConfigMutex::get() ); if ( !pOptions ) pOptions = new SwMailMergeConfigItem_Impl; ++nRefCount; @@ -761,7 +766,7 @@ SwMailMergeConfigItem::SwMailMergeConfigItem() : SwMailMergeConfigItem::~SwMailMergeConfigItem() { // Global access, must be guarded (multithreading) - ::osl::MutexGuard aGuard( aMutex ); + ::osl::MutexGuard aGuard( theMailMergeConfigMutex::get() ); if ( !--nRefCount ) { DELETEZ( pOptions ); diff --git a/vbahelper/inc/vbahelper/vbaglobalbase.hxx b/vbahelper/inc/vbahelper/vbaglobalbase.hxx index 1f7d7a280f56..ea78fcec97f6 100644 --- a/vbahelper/inc/vbahelper/vbaglobalbase.hxx +++ b/vbahelper/inc/vbahelper/vbaglobalbase.hxx @@ -36,6 +36,7 @@ class VBAHELPER_DLLPUBLIC VbaGlobalsBase : public Globals_BASE { protected: rtl::OUString msDocCtxName; + rtl::OUString msApplication; bool hasServiceName( const rtl::OUString& serviceName ); void init( const css::uno::Sequence< css::beans::PropertyValue >& aInitArgs ); diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx index 7e6d365823c8..d81cfc155440 100644 --- a/vbahelper/source/vbahelper/vbaglobalbase.cxx +++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx @@ -35,15 +35,15 @@ using namespace com::sun::star; using namespace ooo::vba; -rtl::OUString sApplication( RTL_CONSTASCII_USTRINGPARAM("Application") ); - // special key to return the Application -rtl::OUString sAppService( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.Application") ); +const char sAppService[] = "ooo.vba.Application"; VbaGlobalsBase::VbaGlobalsBase( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const rtl::OUString& sDocCtxName ) -: Globals_BASE( xParent, xContext ), msDocCtxName( sDocCtxName ) + : Globals_BASE( xParent, xContext ) + , msDocCtxName( sDocCtxName ) + , msApplication( RTL_CONSTASCII_USTRINGPARAM("Application") ) { // overwrite context with custom one ( that contains the application ) // wrap the service manager as we don't want the disposing context to tear down the 'normal' ServiceManager ( or at least thats what the code appears like it wants to do ) @@ -55,7 +55,7 @@ const uno::Reference< uno::XComponentContext >& xContext, const rtl::OUString& s ::cppu::ContextEntry_Init aHandlerContextInfo[] = { - ::cppu::ContextEntry_Init( sApplication, uno::Any() ), + ::cppu::ContextEntry_Init( msApplication, uno::Any() ), ::cppu::ContextEntry_Init( sDocCtxName, uno::Any() ), ::cppu::ContextEntry_Init( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.lang.theServiceManager" ) ), aSrvMgr ) }; @@ -74,7 +74,7 @@ VbaGlobalsBase::~VbaGlobalsBase() // release document reference ( we don't wan't the component context trying to dispose that ) xNameContainer->removeByName( msDocCtxName ); // release application reference, as it is holding onto the context - xNameContainer->removeByName( sApplication ); + xNameContainer->removeByName( msApplication ); } } catch ( const uno::Exception& ) @@ -89,9 +89,9 @@ VbaGlobalsBase::init( const uno::Sequence< beans::PropertyValue >& aInitArgs ) for ( sal_Int32 nIndex = 0; nIndex < nLen; ++nIndex ) { uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY_THROW ); - if ( aInitArgs[ nIndex ].Name.equals( sApplication ) ) + if ( aInitArgs[ nIndex ].Name.equals( msApplication ) ) { - xNameContainer->replaceByName( sApplication, aInitArgs[ nIndex ].Value ); + xNameContainer->replaceByName( msApplication, aInitArgs[ nIndex ].Value ); uno::Reference< XHelperInterface > xParent( aInitArgs[ nIndex ].Value, uno::UNO_QUERY ); mxParent = xParent; } @@ -104,11 +104,11 @@ uno::Reference< uno::XInterface > SAL_CALL VbaGlobalsBase::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (uno::Exception, uno::RuntimeException) { uno::Reference< uno::XInterface > xReturn; - if ( aServiceSpecifier.equals( sAppService ) ) + if ( aServiceSpecifier.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sAppService)) ) { // try to extract the Application from the context uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY ); - xNameContainer->getByName( sApplication ) >>= xReturn; + xNameContainer->getByName( msApplication ) >>= xReturn; } else if ( hasServiceName( aServiceSpecifier ) ) xReturn = mxContext->getServiceManager()->createInstanceWithContext( aServiceSpecifier, mxContext ); @@ -120,11 +120,11 @@ VbaGlobalsBase::createInstanceWithArguments( const ::rtl::OUString& aServiceSpec { uno::Reference< uno::XInterface > xReturn; - if ( aServiceSpecifier.equals( sAppService ) ) + if ( aServiceSpecifier.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sAppService)) ) { // try to extract the Application from the context uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY ); - xNameContainer->getByName( sApplication ) >>= xReturn; + xNameContainer->getByName( msApplication ) >>= xReturn; } else if ( hasServiceName( aServiceSpecifier ) ) xReturn = mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( aServiceSpecifier, Arguments, mxContext ); diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 03525bafbfef..2f82c18e57fb 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -956,14 +956,14 @@ double UserFormGeometryHelper::getOffsetY() const // ---------------------------------------------------------------------------- -static const ::rtl::OUString saPosXName( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ); -static const ::rtl::OUString saPosYName( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ); -static const ::rtl::OUString saWidthName( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ); -static const ::rtl::OUString saHeightName( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ); +static const char saPosXName[] = "PositionX"; +static const char saPosYName[] = "PositionY"; +static const char saWidthName[] = "Width"; +static const char saHeightName[] = "Height"; double UserFormGeometryHelper::implGetPos( bool bPosY ) const { - sal_Int32 nPosAppFont = mxModelProps->getPropertyValue( bPosY ? saPosYName : saPosXName ).get< sal_Int32 >(); + sal_Int32 nPosAppFont = mxModelProps->getPropertyValue( bPosY ? rtl::OUString(saPosYName) : rtl::OUString(saPosXName) ).get< sal_Int32 >(); // appfont to pixel awt::Point aPosPixel = mxUnitConv->convertPointToPixel( awt::Point( nPosAppFont, nPosAppFont ), util::MeasureUnit::APPFONT ); // pixel to VBA points @@ -978,12 +978,12 @@ void UserFormGeometryHelper::implSetPos( double fPos, bool bPosY ) awt::Point aPosPixel = mxUnitConv->convertPointToPixel( awt::Point( nPosPixel, nPosPixel ), util::MeasureUnit::POINT ); // pixel to appfont awt::Point aPosAppFont = mxUnitConv->convertPointToLogic( aPosPixel, util::MeasureUnit::APPFONT ); - mxModelProps->setPropertyValue( bPosY ? saPosYName : saPosXName, uno::Any( bPosY ? aPosAppFont.Y : aPosAppFont.X ) ); + mxModelProps->setPropertyValue( bPosY ? rtl::OUString(saPosYName) : rtl::OUString(saPosXName), uno::Any( bPosY ? aPosAppFont.Y : aPosAppFont.X ) ); } double UserFormGeometryHelper::implGetSize( bool bHeight, bool bOuter ) const { - sal_Int32 nSizeAppFont = mxModelProps->getPropertyValue( bHeight ? saHeightName : saWidthName ).get< sal_Int32 >(); + sal_Int32 nSizeAppFont = mxModelProps->getPropertyValue( bHeight ? rtl::OUString(saHeightName) : rtl::OUString(saWidthName) ).get< sal_Int32 >(); // appfont to pixel awt::Size aSizePixel = mxUnitConv->convertSizeToPixel( awt::Size( nSizeAppFont, nSizeAppFont ), util::MeasureUnit::APPFONT ); @@ -1031,7 +1031,7 @@ void UserFormGeometryHelper::implSetSize( double fSize, bool bHeight, bool bOute } awt::Size aSizeAppFont = mxUnitConv->convertSizeToLogic( aSizePixel, util::MeasureUnit::APPFONT ); - mxModelProps->setPropertyValue( bHeight ? saHeightName : saWidthName, uno::Any( bHeight ? aSizeAppFont.Height : aSizeAppFont.Width ) ); + mxModelProps->setPropertyValue( bHeight ? rtl::OUString(saHeightName) : rtl::OUString(saWidthName), uno::Any( bHeight ? aSizeAppFont.Height : aSizeAppFont.Width ) ); } // ============================================================================ |