diff options
Diffstat (limited to 'sfx2/source')
210 files changed, 3405 insertions, 5150 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index 74a5a717dd57..8c85cf10adce 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -231,7 +231,7 @@ SfxApplication::SfxApplication() SfxApplication::~SfxApplication() { - OSL_ENSURE( GetObjectShells_Impl().Count() == 0, "Memory leak: some object shells were not removed!" ); + OSL_ENSURE( GetObjectShells_Impl().size() == 0, "Memory leak: some object shells were not removed!" ); Broadcast( SfxSimpleHint(SFX_HINT_DYING) ); @@ -501,14 +501,14 @@ IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic ) return 0; #else // get basctl dllname - static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) ); + static ::rtl::OUString aLibName( SVLIBRARY( "basctl" ) ); // load module oslModule handleMod = osl_loadModuleRelative( &thisModule, aLibName.pData, 0 ); // get symbol - ::rtl::OUString aSymbol( RTL_CONSTASCII_USTRINGPARAM( "basicide_handle_basic_error" ) ); + ::rtl::OUString aSymbol( "basicide_handle_basic_error" ); basicide_handle_basic_error pSymbol = (basicide_handle_basic_error) osl_getFunctionSymbol( handleMod, aSymbol.pData ); // call basicide_handle_basic_error in basctl @@ -532,8 +532,8 @@ sal_Bool SfxApplication::IsXScriptURL( const String& rScriptURL ) ::com::sun::star::uno::Reference < ::com::sun::star::uri::XUriReferenceFactory > xFactory( xSMgr->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.uri.UriReferenceFactory" )) ), + ::rtl::OUString( + "com.sun.star.uri.UriReferenceFactory" ) ), ::com::sun::star::uno::UNO_QUERY ); if ( xFactory.is() ) @@ -600,14 +600,14 @@ void SfxApplication::MacroOrganizer( sal_Int16 nTabId ) (void) nTabId; #else // get basctl dllname - static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) ); + static ::rtl::OUString aLibName( SVLIBRARY( "basctl" ) ); // load module oslModule handleMod = osl_loadModuleRelative( &thisModule, aLibName.pData, 0 ); // get symbol - ::rtl::OUString aSymbol( RTL_CONSTASCII_USTRINGPARAM( "basicide_macro_organizer" ) ); + ::rtl::OUString aSymbol( "basicide_macro_organizer" ); basicide_macro_organizer pSymbol = (basicide_macro_organizer) osl_getFunctionSymbol( handleMod, aSymbol.pData ); // call basicide_choose_macro in basctl diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc index 33b57a2341b4..5cbfd7fed9a8 100644 --- a/sfx2/source/appl/app.hrc +++ b/sfx2/source/appl/app.hrc @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_APP_HRC #define _SFX_APP_HRC @@ -31,15 +22,12 @@ // #defines ***************************************************************** -#define ACC_IBM (RID_SFX_APP_START+2) #define MSG_ERR_NO_WEBBROWSER_FOUND (RID_SFX_APP_START+7) #define MSG_ERR_NO_ABS_URI_REF (RID_SFX_APP_START+8) -#define MSG_ISPRINTING_QUERYABORT (RID_SFX_APP_START+9) #define MSG_CANT_QUIT (RID_SFX_APP_START+10) #define STR_ISMODIFIED (RID_SFX_APP_START+11) #define RID_FULLSCREENTOOLBOX (RID_SFX_APP_START+42) -#define RID_RECORDINGTOOLBOX (RID_SFX_APP_START+43) #define RID_ENVTOOLBOX (RID_SFX_APP_START+44) #define STR_QUITAPP (RID_SFX_APP_START+59) diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index 0018663e83e8..833a99b0e3e0 100644 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -120,12 +120,6 @@ using namespace ::com::sun::star::script; using ::basic::BasicManagerRepository; //========================================================================= -sal_uInt16 SfxApplication::SaveBasicManager() const -{ - return 0; -} - -//-------------------------------------------------------------------- sal_uInt16 SfxApplication::SaveBasicAndDialogContainer() const { if ( pAppData_Impl->pBasicManager->isValid() ) @@ -147,7 +141,7 @@ SbxVariable* MakeVariable( StarBASIC *pBas, SbxObject *pObject, (void) eClassType; return 0; #else - SbxVariable *pVar = pBas->Make( String::CreateFromAscii(pName), eClassType, eType ); //SbxCLASS_PROPERTY + SbxVariable *pVar = pBas->Make( rtl::OUString::createFromAscii(pName), eClassType, eType ); //SbxCLASS_PROPERTY pVar->SetUserData( nSID ); pVar->SetFlag( SBX_DONTSTORE ); pObject->StartListening( pVar->GetBroadcaster() ); @@ -248,24 +242,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq ) break; } - case SID_STATUSBARTEXT: - { - SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, nSID, sal_False); - String aText = pStringItem->GetValue(); - if ( aText.Len() ) - GetpApp()->ShowStatusText( aText ); - else - GetpApp()->HideStatusText(); - break; - } - - case SID_OFFICE_PRIVATE_USE: - case SID_OFFICE_COMMERCIAL_USE: - { - DBG_ASSERT( sal_False, "SfxApplication::PropExec_Impl()\nSID_OFFICE_PRIVATE_USE & SID_OFFICE_COMMERCIAL_USE are obsolete!\n" ); - break; - } - case SID_OFFICE_CUSTOMERNUMBER: { SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, nSID, sal_False); diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx index b50b563d8d79..2d467c58429e 100644 --- a/sfx2/source/appl/appbaslib.cxx +++ b/sfx2/source/appl/appbaslib.cxx @@ -175,7 +175,7 @@ Sequence< OUString > SfxApplicationDialogLibraryContainer::impl_getStaticSupport if( bNeedsInit ) { OUString* pSeq = seqServiceNames.getArray(); - pSeq[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.ApplicationDialogLibraryContainer")); + pSeq[0] = OUString("com.sun.star.script.ApplicationDialogLibraryContainer"); bNeedsInit = sal_False; } return seqServiceNames; @@ -202,31 +202,15 @@ SFX_IMPL_ONEINSTANCEFACTORY( SfxApplicationScriptLibraryContainer ) Sequence< OUString > SfxApplicationScriptLibraryContainer::impl_getStaticSupportedServiceNames() { - static Sequence< OUString > seqServiceNames( 1 ); - static sal_Bool bNeedsInit = sal_True; - - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if( bNeedsInit ) - { - OUString* pSeq = seqServiceNames.getArray(); - pSeq[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.ApplicationScriptLibraryContainer")); - bNeedsInit = sal_False; - } + Sequence< OUString > seqServiceNames( 1 ); + OUString* pSeq = seqServiceNames.getArray(); + pSeq[0] = OUString("com.sun.star.script.ApplicationScriptLibraryContainer"); return seqServiceNames; } OUString SfxApplicationScriptLibraryContainer::impl_getStaticImplementationName() { - static OUString aImplName; - static sal_Bool bNeedsInit = sal_True; - - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if( bNeedsInit ) - { - aImplName = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer")); - bNeedsInit = sal_False; - } - return aImplName; + return OUString("com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer"); } Reference< XInterface > SAL_CALL SfxApplicationScriptLibraryContainer::impl_createInstance diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 4b8d786d4b1a..0cec85b7c554 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -164,7 +164,6 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) { sal_Bool bRet = sal_False; SfxItemPool &rPool = GetPool(); - String asal_TrueStr('1'); const sal_uInt16 *pRanges = rSet.GetRanges(); SvtSaveOptions aSaveOptions; @@ -390,11 +389,6 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) } } break; - case SID_ENABLE_METAFILEPRINT : -#ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI - DBG_ASSERT(sal_False, "SfxApplication::GetOptions()\nSoffice.ini key \"Common\\MetafilePrint\" is obsolete! .. How I can support SID_ENABLE_METAFILEPRINT any longer?\n"); -#endif - break; case SID_INET_PROXY_TYPE : if (rSet.Put( SfxUInt16Item( @@ -445,12 +439,6 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) bRet = true; } break; - case SID_INET_SECURITY_PROXY_NAME : - case SID_INET_SECURITY_PROXY_PORT : -#ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI - DBG_ASSERT( sal_False, "SfxApplication::GetOptions()\nSome INET values no longer supported!\n" ); -#endif - break; case SID_INET_NOPROXY : if (rSet.Put( SfxStringItem( @@ -470,8 +458,7 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) for ( sal_uInt16 nProp = SvtPathOptions::PATH_ADDIN; nProp <= SvtPathOptions::PATH_WORK; nProp++ ) { - const String aName( SfxResId( CONFIG_PATH_START + nProp ) ); - aNames.InsertValue( nProp, aName ); + aNames.InsertValue( nProp, SfxResId(CONFIG_PATH_START + nProp).toString() ); rtl::OUString aValue; switch ( nProp ) { @@ -810,14 +797,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) aSecurityOptions.SetConfirmationEnabled( ( (const SfxBoolItem *)pItem )->GetValue() ); } - // EnableMetafilePrint - if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ENABLE_METAFILEPRINT ), sal_True, &pItem ) ) - { -#ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI - DBG_ASSERT(sal_False, "SfxApplication::SetOptions_Impl()\nsoffice.ini key \"MetafilPrint\" not supported any longer!\n"); -#endif - } - // Store changed data batch->commit(); } @@ -839,10 +818,10 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) DBG_ASSERT(pItem->ISA(SfxAllEnumItem), "AllEnumItem expected"); const SfxAllEnumItem* pEnumItem = (const SfxAllEnumItem *)pItem; sal_uInt32 nCount = pEnumItem->GetValueCount(); - String aNoChangeStr( ' ' ); + rtl::OUString aNoChangeStr( ' ' ); for( sal_uInt32 nPath=0; nPath<nCount; ++nPath ) { - String sValue = pEnumItem->GetValueTextByPos((sal_uInt16)nPath); + rtl::OUString sValue = pEnumItem->GetValueTextByPos((sal_uInt16)nPath); if ( sValue != aNoChangeStr ) { switch( nPath ) diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx index 6c5f7c8eb735..183d3811c4d1 100644 --- a/sfx2/source/appl/appchild.cxx +++ b/sfx2/source/appl/appchild.cxx @@ -57,16 +57,15 @@ void SfxApplication::RegisterChildWindow_Impl( SfxModule *pMod, SfxChildWinFacto if (!pAppData_Impl->pFactArr) pAppData_Impl->pFactArr = new SfxChildWinFactArr_Impl; - for (sal_uInt16 nFactory=0; nFactory<pAppData_Impl->pFactArr->Count(); ++nFactory) + for (sal_uInt16 nFactory=0; nFactory<pAppData_Impl->pFactArr->size(); ++nFactory) { if (pFact->nId == (*pAppData_Impl->pFactArr)[nFactory]->nId) { - pAppData_Impl->pFactArr->Remove( nFactory ); + pAppData_Impl->pFactArr->erase( pAppData_Impl->pFactArr->begin() + nFactory ); } } - pAppData_Impl->pFactArr->C40_INSERT( - SfxChildWinFactory, pFact, pAppData_Impl->pFactArr->Count() ); + pAppData_Impl->pFactArr->push_back( pFact ); } void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt16 nId, @@ -80,7 +79,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1 pFactories = pMod->GetChildWinFactories_Impl(); if ( pFactories ) { - sal_uInt16 nCount = pFactories->Count(); + sal_uInt16 nCount = pFactories->size(); for (sal_uInt16 nFactory=0; nFactory<nCount; ++nFactory) { SfxChildWinFactory *pFac = (*pFactories)[nFactory]; @@ -101,7 +100,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1 DBG_ASSERT( pAppData_Impl->pFactArr, "No Factories!" ); pFactories = pAppData_Impl->pFactArr; - sal_uInt16 nCount = pFactories->Count(); + sal_uInt16 nCount = pFactories->size(); for (sal_uInt16 nFactory=0; nFactory<nCount; ++nFactory) { SfxChildWinFactory *pFac = (*pFactories)[nFactory]; @@ -128,7 +127,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1 { if ( !pF->pArr ) pF->pArr = new SfxChildWinContextArr_Impl; - pF->pArr->C40_INSERT( SfxChildWinContextFactory, pFact, pF->pArr->Count() ); + pF->pArr->push_back( pFact ); return; } diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 98a7c5e8b3f0..f72e64a6cacb 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -236,8 +236,7 @@ public: }; -SV_DECL_PTRARR( SfxDdeDocTopics_Impl, SfxDdeDocTopic_Impl *, 4 ) -SV_IMPL_PTRARR( SfxDdeDocTopics_Impl, SfxDdeDocTopic_Impl *) +class SfxDdeDocTopics_Impl : public std::vector<SfxDdeDocTopic_Impl*> {}; //======================================================================== @@ -578,7 +577,8 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh ) // prevent double submit String sShellNm; sal_Bool bFnd = sal_False; - for( sal_uInt16 n = pAppData_Impl->pDocTopics->Count(); n; ) + for (size_t n = pAppData_Impl->pDocTopics->size(); n;) + { if( (*pAppData_Impl->pDocTopics)[ --n ]->pSh == pSh ) { // If the document is untitled, is still a new Topic is created! @@ -591,10 +591,10 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh ) if( sShellNm == sNm.ToLowerAscii() ) return ; } + } - const SfxDdeDocTopic_Impl* pTopic = new SfxDdeDocTopic_Impl( pSh ); - pAppData_Impl->pDocTopics->Insert( pTopic, - pAppData_Impl->pDocTopics->Count() ); + SfxDdeDocTopic_Impl *const pTopic = new SfxDdeDocTopic_Impl(pSh); + pAppData_Impl->pDocTopics->push_back(pTopic); pAppData_Impl->pDdeService->AddTopic( *pTopic ); } #endif @@ -606,13 +606,16 @@ void SfxApplication::RemoveDdeTopic( SfxObjectShell* pSh ) if( !pAppData_Impl->pDocTopics ) return; - SfxDdeDocTopic_Impl* pTopic; - for( sal_uInt16 n = pAppData_Impl->pDocTopics->Count(); n; ) - if( ( pTopic = (*pAppData_Impl->pDocTopics)[ --n ])->pSh == pSh ) + for (size_t n = pAppData_Impl->pDocTopics->size(); n; ) + { + SfxDdeDocTopic_Impl *const pTopic = (*pAppData_Impl->pDocTopics)[ --n ]; + if (pTopic->pSh == pSh) { pAppData_Impl->pDdeService->RemoveTopic( *pTopic ); - pAppData_Impl->pDocTopics->DeleteAndDestroy( n ); + delete pTopic; + pAppData_Impl->pDocTopics->erase( pAppData_Impl->pDocTopics->begin() + n ); } + } } const DdeService* SfxApplication::GetDdeService() const diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 08e6a78bf87c..f4e9fcb36c44 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -109,9 +109,6 @@ void SAL_CALL SfxTerminateListener_Impl::queryTermination( const EventObject& ) void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& aEvent ) throw(RuntimeException ) { - static ::rtl::OUString SERVICE_GLOBALEVENTBROADCASTER(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster")); - static ::rtl::OUString EVENT_QUIT_APP (RTL_CONSTASCII_USTRINGPARAM("OnCloseApp")); - Reference< XDesktop > xDesktop( aEvent.Source, UNO_QUERY ); if( xDesktop.is() == sal_True ) xDesktop->removeTerminateListener( this ); @@ -125,11 +122,11 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a pApp->Get_Impl()->pAppDispatch->release(); css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); - css::uno::Reference< css::document::XEventListener > xGlobalBroadcaster(xSMGR->createInstance(SERVICE_GLOBALEVENTBROADCASTER), css::uno::UNO_QUERY); + css::uno::Reference< css::document::XEventListener > xGlobalBroadcaster(xSMGR->createInstance("com.sun.star.frame.GlobalEventBroadcaster"), css::uno::UNO_QUERY); if (xGlobalBroadcaster.is()) { css::document::EventObject aEvent2; - aEvent2.EventName = EVENT_QUIT_APP; + aEvent2.EventName = "OnCloseApp"; xGlobalBroadcaster->notifyEvent(aEvent2); } @@ -139,8 +136,7 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a ::rtl::OUString SAL_CALL SfxTerminateListener_Impl::getImplementationName() throw (RuntimeException) { - static const ::rtl::OUString IMPLNAME(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sfx2.SfxTerminateListener")); - return IMPLNAME; + return ::rtl::OUString("com.sun.star.comp.sfx2.SfxTerminateListener"); } ::sal_Bool SAL_CALL SfxTerminateListener_Impl::supportsService( const ::rtl::OUString& sServiceName ) throw (RuntimeException) @@ -166,7 +162,7 @@ Sequence< ::rtl::OUString > SAL_CALL SfxTerminateListener_Impl::getSupportedServ // The desktop must know, which listener will terminate the SfxApplication in real ! // It must call this special listener as last one ... otherwise we shutdown the SfxApplication BEFORE other listener // can react ... - static const ::rtl::OUString SERVICENAME(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.TerminateListener")); + static const ::rtl::OUString SERVICENAME("com.sun.star.frame.TerminateListener"); Sequence< ::rtl::OUString > lNames(1); lNames[0] = SERVICENAME; return lNames; @@ -193,12 +189,12 @@ String GetSpecialCharsForEdit(Window* pParent, const Font& rFont) { bDetermineFunction = true; - static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "cui" ) ) ); + static ::rtl::OUString aLibName( SVLIBRARY( "cui" ) ); oslModule handleMod = osl_loadModuleRelative( &thisModule, aLibName.pData, 0 ); // get symbol - ::rtl::OUString aSymbol( RTL_CONSTASCII_USTRINGPARAM( "GetSpecialCharsForEdit" ) ); + ::rtl::OUString aSymbol( "GetSpecialCharsForEdit" ); pfunc_getSpecialCharsForEdit = (PFunc_getSpecialCharsForEdit)osl_getFunctionSymbol( handleMod, aSymbol.pData ); DBG_ASSERT( pfunc_getSpecialCharsForEdit, "GetSpecialCharsForEdit() not found!" ); } @@ -221,7 +217,7 @@ bool SfxApplication::Initialize_Impl() Reference < XDesktop > xDesktop ( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); if (!xDesktop.is()) - throw RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Couldn't create mandatory desktop service!" )), xDesktop ); + throw RuntimeException( rtl::OUString( "Couldn't create mandatory desktop service!" ), xDesktop ); xDesktop->addTerminateListener( new SfxTerminateListener_Impl() ); Application::EnableAutoHelpId(); diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 1e62b634e6b5..a8dfa09d1cd4 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -88,14 +88,6 @@ using namespace ::com::sun::star::container; //=================================================================== -SV_IMPL_PTRARR( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory* ); -SV_IMPL_PTRARR( SfxStbCtrlFactArr_Impl, SfxStbCtrlFactory* ); -SV_IMPL_PTRARR( SfxMenuCtrlFactArr_Impl, SfxMenuCtrlFactory* ); -SV_IMPL_PTRARR( SfxChildWinFactArr_Impl, SfxChildWinFactory* ); -SV_IMPL_PTRARR( SfxModuleArr_Impl, SfxModule* ); - -//=================================================================== - #define SfxApplication #include "sfxslots.hxx" @@ -240,10 +232,10 @@ std::vector<sal_uInt16>* SfxApplication::GetDisabledSlotList_Impl() // If an entry slot is present, but no or faulty slot file, or a slot // file, but no slot entry, then this is considered to be a // misconfiguration - new SfxSpecialConfigError_Impl( String( SfxResId( RID_SPECIALCONFIG_ERROR ) ) ); + new SfxSpecialConfigError_Impl( SfxResId( RID_SPECIALCONFIG_ERROR ).toString() ); } - return pList; + return pList; } @@ -284,4 +276,28 @@ Image SfxApplication::GetApplicationLogo() return Image( aBitmap ); } +SfxChildWinFactArr_Impl::~SfxChildWinFactArr_Impl() +{ + for( const_iterator it = begin(); it != end(); ++it ) + delete *it; +} + +SfxMenuCtrlFactArr_Impl::~SfxMenuCtrlFactArr_Impl() +{ + for( const_iterator it = begin(); it != end(); ++it ) + delete *it; +} + +SfxStbCtrlFactArr_Impl::~SfxStbCtrlFactArr_Impl() +{ + for( const_iterator it = begin(); it != end(); ++it ) + delete *it; +} + +SfxTbxCtrlFactArr_Impl::~SfxTbxCtrlFactArr_Impl() +{ + for( const_iterator it = begin(); it != end(); ++it ) + delete *it; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index ae5a6968e3f4..7a105a34e2a6 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/frame/DispatchResultState.hpp> #include <com/sun/star/frame/XDispatchResultListener.hpp> #include <com/sun/star/util/URL.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/system/SystemShellExecuteException.hpp> #include <com/sun/star/document/XTypeDetection.hpp> @@ -272,7 +273,7 @@ private: ::comphelper::OStorageHelper::SetCommonStorageEncryptionData( mxStorage, rEncryptionData ); mxStorage->openStreamElement( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ) ), + ::rtl::OUString( "content.xml" ), embed::ElementModes::READ | embed::ElementModes::NOCREATE ); // no exception -> success @@ -322,7 +323,7 @@ sal_uInt32 CheckPasswd_Impl { sal_Bool bIsEncrypted = sal_False; try { - xStorageProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasEncryptedEntries")) ) + xStorageProps->getPropertyValue( ::rtl::OUString("HasEncryptedEntries") ) >>= bIsEncrypted; } catch( uno::Exception& ) { @@ -404,7 +405,7 @@ sal_uInt32 CheckPasswd_Impl sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFileName, sal_Bool bCopy, SfxItemSet* pSet ) { const SfxFilter* pFilter = NULL; - SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ), sal_False ); + SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ) ); if ( !aMedium.GetStorage( sal_True ).is() ) aMedium.GetInStream(); @@ -434,8 +435,8 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String DBG_ASSERT( !xDoc.Is(), "Sorry, not implemented!" ); delete pSet; SfxStringItem aName( SID_FILE_NAME, rFileName ); - SfxStringItem aReferer( SID_REFERER, String::CreateFromAscii("private:user") ); - SfxStringItem aFlags( SID_OPTIONS, String::CreateFromAscii("T") ); + SfxStringItem aReferer( SID_REFERER, rtl::OUString("private:user") ); + SfxStringItem aFlags( SID_OPTIONS, rtl::OUString("T") ); SfxBoolItem aHidden( SID_HIDDEN, sal_True ); const SfxPoolItem *pRet = GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, &aName, &aHidden, &aReferer, &aFlags, 0L ); const SfxObjectItem *pObj = PTR_CAST( SfxObjectItem, pRet ); @@ -460,7 +461,7 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String if ( !xDoc.Is() ) xDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName() ); - SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_STD_READ, sal_False, pFilter, pSet ); + SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_STD_READ, pFilter, pSet ); if(!xDoc->DoLoad(pMedium)) { ErrCode nErrCode = xDoc->GetErrorCode(); @@ -536,11 +537,11 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq ) SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, GetPool() ); - String aFact = String::CreateFromAscii("private:factory/"); + String aFact = rtl::OUString("private:factory/"); aFact += aFactName; aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aFact ) ); aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, GetFrame() ) ); - aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_default" ) ) ); + aReq.AppendItem( SfxStringItem( SID_TARGETNAME, rtl::OUString( "_default" ) ) ); // TODO/LATER: Should the other arguments be transfered as well? SFX_REQUEST_ARG( rReq, pDefaultPathItem, SfxStringItem, SID_DEFAULTFILEPATH, sal_False); @@ -678,7 +679,7 @@ bool lcl_isFilterNativelySupported(const SfxFilter& rFilter) return true; ::rtl::OUString aName = rFilter.GetFilterName(); - if (aName.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Excel"))) == 0) + if (aName.indexOf(::rtl::OUString("MS Excel")) == 0) // We can handle all Excel variants natively. return true; @@ -689,6 +690,11 @@ bool lcl_isFilterNativelySupported(const SfxFilter& rFilter) void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { + rtl::OUString aDocService; + SFX_REQUEST_ARG(rReq, pDocSrvItem, SfxStringItem, SID_DOC_SERVICE, false); + if (pDocSrvItem) + aDocService = pDocSrvItem->GetValue(); + sal_uInt16 nSID = rReq.GetSlot(); SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False ); if ( pFileNameItem ) @@ -763,8 +769,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) rReq.SetArgs( *(SfxAllItemSet*)pSet ); if (aFilter.Len() >0 ) rReq.AppendItem( SfxStringItem( SID_FILTER_NAME, aFilter ) ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_default") ) ); - rReq.AppendItem( SfxStringItem( SID_REFERER, String::CreateFromAscii(SFX_REFERER_USER) ) ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, rtl::OUString("_default") ) ); + rReq.AppendItem( SfxStringItem( SID_REFERER, rtl::OUString(SFX_REFERER_USER) ) ); delete pSet; if(!pURLList.empty()) @@ -798,6 +804,12 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) ::framework::PreventDuplicateInteraction::InteractionInfo aRule (aInteraction, 1); pHandler->addInteractionRule(aRule); + if (!aDocService.isEmpty()) + { + rReq.RemoveItem(SID_DOC_SERVICE); + rReq.AppendItem(SfxStringItem(SID_DOC_SERVICE, aDocService)); + } + for(std::vector<rtl::OUString>::const_iterator i = pURLList.begin(); i != pURLList.end(); ++i) { rReq.RemoveItem( SID_FILE_NAME ); @@ -917,7 +929,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { Reference< ::com::sun::star::document::XTypeDetection > xTypeDetection( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection"))), + ::rtl::OUString("com.sun.star.document.TypeDetection")), UNO_QUERY ); if ( xTypeDetection.is() ) { @@ -925,8 +937,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) ::rtl::OUString aTypeName; aURL.Complete = aFileName; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); + Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aURL ); INetProtocol aINetProtocol = INetURLObject( aURL.Complete ).GetProtocol(); @@ -938,9 +949,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) SolarMutexGuard aGuard; Window *pWindow = SFX_APP()->GetTopWindow(); - String aSecurityWarningBoxTitle( SfxResId( RID_SECURITY_WARNING_TITLE )); WarningBox aSecurityWarningBox( pWindow, SfxResId( RID_SECURITY_WARNING_NO_HYPERLINKS )); - aSecurityWarningBox.SetText( aSecurityWarningBoxTitle ); + aSecurityWarningBox.SetText( SfxResId(RID_SECURITY_WARNING_TITLE).toString() ); aSecurityWarningBox.Execute(); return; } @@ -955,7 +965,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { // don't dispatch mailto hyperlink to desktop dispatcher rReq.RemoveItem( SID_TARGETNAME ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_self") ) ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, rtl::OUString("_self") ) ); } else if ( aINetProtocol == INET_PROT_FTP || aINetProtocol == INET_PROT_HTTP || @@ -970,14 +980,14 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) Sequence < ::rtl::OUString > aProtocols(2); // add special protocols that always should be treated as internal - aProtocols[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:*")); - aProtocols[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.*")); + aProtocols[0] = ::rtl::OUString("private:*"); + aProtocols[1] = ::rtl::OUString("vnd.sun.star.*"); try { // get registered protocol handlers from configuration Reference < XNameAccess > xAccess( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.ProtocolHandler/HandlerSet")), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY ); + ::rtl::OUString("org.openoffice.Office.ProtocolHandler/HandlerSet"), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY ); if ( xAccess.is() ) { Sequence < ::rtl::OUString > aNames = xAccess->getElementNames(); @@ -989,7 +999,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( xSet.is() ) { // copy protocols - aRet = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Protocols")) ); + aRet = xSet->getPropertyValue( ::rtl::OUString("Protocols") ); Sequence < ::rtl::OUString > aTmp; aRet >>= aTmp; @@ -1033,7 +1043,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) catch ( ::com::sun::star::system::SystemShellExecuteException& ) { rReq.RemoveItem( SID_TARGETNAME ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_default") ) ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, rtl::OUString("_default") ) ); bLoadInternal = sal_True; } } @@ -1052,7 +1062,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { // hyperlink document must be loaded into a new frame rReq.RemoveItem( SID_TARGETNAME ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_default") ) ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, rtl::OUString("_default") ) ); } } } @@ -1108,7 +1118,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if (!pInteractionItem) { - Reference < ::com::sun::star::task::XInteractionHandler > xHdl( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.uui.UUIInteractionHandler"))), UNO_QUERY ); + Reference < ::com::sun::star::task::XInteractionHandler > xHdl( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString("com.sun.star.comp.uui.UUIInteractionHandler")), UNO_QUERY ); if (xHdl.is()) rReq.AppendItem( SfxUnoAnyItem(SID_INTERACTIONHANDLER,::com::sun::star::uno::makeAny(xHdl)) ); } @@ -1127,12 +1137,12 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { SFX_REQUEST_ARG( rReq, pNewViewItem, SfxBoolItem, SID_OPEN_NEW_VIEW, sal_False ); if ( pNewViewItem && pNewViewItem->GetValue() ) - aTarget = String::CreateFromAscii("_blank" ); + aTarget = rtl::OUString("_blank" ); } if ( bHidden ) { - aTarget = String::CreateFromAscii("_blank"); + aTarget = rtl::OUString("_blank"); DBG_ASSERT( rReq.IsSynchronCall() || pLinkItem, "Hidden load process must be done synchronously!" ); } @@ -1147,7 +1157,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } else { - xTargetFrame.set( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), UNO_QUERY ); + xTargetFrame.set( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString("com.sun.star.frame.Desktop")), UNO_QUERY ); } } @@ -1198,7 +1208,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { URL aURL; aURL.Complete = aFileName; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); + Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aURL ); Reference < XDispatchProvider > xProv( xTargetFrame, UNO_QUERY ); diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index a4edf3af18b3..e1dfc2270d32 100644 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -94,11 +94,6 @@ void SfxApplication::Deinitialize() #ifndef DISABLE_SCRIPTING StarBASIC::Stop(); - // Save BASIC if possible - BasicManager* pBasMgr = BasicManagerRepository::getApplicationBasicManager( false ); - if ( pBasMgr && pBasMgr->IsModified() ) - SaveBasicManager(); - SaveBasicAndDialogContainer(); #endif diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx index 070bf9f92494..23d9e80cf574 100644 --- a/sfx2/source/appl/appreg.cxx +++ b/sfx2/source/appl/appreg.cxx @@ -84,7 +84,7 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac } #ifdef DBG_UTIL - for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->size(); n++ ) { SfxTbxCtrlFactory *pF = (*pAppData_Impl->pTbxCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -95,7 +95,7 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac } #endif - pAppData_Impl->pTbxCtrlFac->C40_INSERT( SfxTbxCtrlFactory, pFact, pAppData_Impl->pTbxCtrlFac->Count() ); + pAppData_Impl->pTbxCtrlFac->push_back( pFact ); } //-------------------------------------------------------------------- @@ -109,7 +109,7 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF } #ifdef DBG_UTIL - for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->size(); n++ ) { SfxStbCtrlFactory *pF = (*pAppData_Impl->pStbCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -120,7 +120,7 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF } #endif - pAppData_Impl->pStbCtrlFac->C40_INSERT( SfxStbCtrlFactory, pFact, pAppData_Impl->pStbCtrlFac->Count() ); + pAppData_Impl->pStbCtrlFac->push_back( pFact ); } //-------------------------------------------------------------------- @@ -134,7 +134,7 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto } #ifdef DBG_UTIL - for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->size(); n++ ) { SfxMenuCtrlFactory *pF = (*pAppData_Impl->pMenuCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -145,7 +145,7 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto } #endif - pAppData_Impl->pMenuCtrlFac->C40_INSERT( SfxMenuCtrlFactory, pFact, pAppData_Impl->pMenuCtrlFac->Count() ); + pAppData_Impl->pMenuCtrlFac->push_back( pFact ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 5e83a9f4ecf9..fadf7ea7a35a 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -125,6 +125,7 @@ #include <sfx2/dialogs.hrc> #include "sorgitm.hxx" #include "sfx2/sfxhelp.hxx" +#include <sfx2/zoomitem.hxx> #include "templatedlg.hxx" using namespace ::com::sun::star; @@ -147,7 +148,7 @@ static sal_Bool checkURL( const char *pName, const char *pExt, rtl::OUString &rU using namespace osl; DirectoryItem aDirItem; - rURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/") ); + rURL = rtl::OUString( "$BRAND_BASE_DIR/" ); rURL += rtl::OUString::createFromAscii( pName ); rURL += rtl::OUString::createFromAscii( pExt ); rtl::Bootstrap::expandMacros( rURL ); @@ -162,18 +163,18 @@ static sal_Bool checkURL( const char *pName, const char *pExt, rtl::OUString &rU static void showDocument( const char* pBaseName ) { try { - Reference < XComponentLoader > xLoader( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY ); + Reference < XComponentLoader > xLoader( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString("com.sun.star.frame.Desktop") ), UNO_QUERY ); Sequence < com::sun::star::beans::PropertyValue > args(2); - args[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ViewOnly")); + args[0].Name = ::rtl::OUString("ViewOnly"); args[0].Value <<= sal_True; - args[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); + args[1].Name = ::rtl::OUString("ReadOnly"); args[1].Value <<= sal_True; rtl::OUString aURL; if ( checkURL ( pBaseName, ".odt", aURL ) || checkURL ( pBaseName, ".html", aURL ) || checkURL ( pBaseName, "", aURL ) ) { - xLoader->loadComponentFromURL( aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0, args ); + xLoader->loadComponentFromURL( aURL, ::rtl::OUString("_blank"), 0, args ); } } catch (const ::com::sun::star::uno::Exception &) { } @@ -208,7 +209,7 @@ namespace { if ( i != STR_LICENSING_INFORMATION_1 ) aLicensing += String( RTL_CONSTASCII_USTRINGPARAM( "\n\n" ) ); - aLicensing += String( SfxResId( i ) ); + aLicensing += SfxResId( i ).toString(); } aText.SetText( aLicensing ); @@ -289,8 +290,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) return; } - String aName = String::CreateFromAscii("vnd.sun.star.cmd:logout"); - SfxStringItem aNameItem( SID_FILE_NAME, aName ); + SfxStringItem aNameItem( SID_FILE_NAME, rtl::OUString("vnd.sun.star.cmd:logout") ); SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE( "private/user" ) ); pAppData_Impl->pAppDispat->Execute( SID_OPENDOC, SFX_CALLMODE_SLOT, &aNameItem, &aReferer, 0L ); return; @@ -432,7 +432,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_SEND_FEEDBACK: { - ::rtl::OUString sURL(RTL_CONSTASCII_USTRINGPARAM("http://hub.libreoffice.org/file-a-bug/")); + ::rtl::OUString sURL("http://hub.libreoffice.org/file-a-bug/"); try { uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( @@ -465,7 +465,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Help* pHelp = Application::GetHelp(); if ( pHelp ) { - pHelp->Start( String::CreateFromAscii(".uno:HelpIndex"), NULL ); // show start page + pHelp->Start( rtl::OUString(".uno:HelpIndex"), NULL ); // show start page bDone = true; } break; @@ -611,6 +611,51 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) bDone = true; break; + case SID_ZOOM_50_PERCENT: + case SID_ZOOM_75_PERCENT: + case SID_ZOOM_100_PERCENT: + case SID_ZOOM_150_PERCENT: + case SID_ZOOM_200_PERCENT: + case SID_ZOOM_OPTIMAL: + case SID_ZOOM_ENTIRE_PAGE: + case SID_ZOOM_PAGE_WIDTH: + { + // make sure aZoom is initialized with a proper value if SetType + // doesn't work + SvxZoomItem aZoom( SVX_ZOOM_PERCENT, 100 ); + + switch (rReq.GetSlot()) + { + case SID_ZOOM_50_PERCENT: + aZoom.SetValue(50); + break; + case SID_ZOOM_75_PERCENT: + aZoom.SetValue(75); + break; + case SID_ZOOM_100_PERCENT: + aZoom.SetValue(100); + break; + case SID_ZOOM_150_PERCENT: + aZoom.SetValue(150); + break; + case SID_ZOOM_200_PERCENT: + aZoom.SetValue(200); + break; + case SID_ZOOM_OPTIMAL: + aZoom.SetType( SVX_ZOOM_OPTIMAL ); + break; + case SID_ZOOM_ENTIRE_PAGE: + aZoom.SetType( SVX_ZOOM_WHOLEPAGE ); + break; + case SID_ZOOM_PAGE_WIDTH: + aZoom.SetType( SVX_ZOOM_PAGEWIDTH ); + break; + } + + SfxViewFrame::Current()->GetDispatcher()->Execute(SID_ATTR_ZOOM, SFX_CALLMODE_ASYNCHRON, &aZoom, 0L); + + break; + } case SID_AVAILABLE_TOOLBARS: { SfxStringItem const * pToolbarName = static_cast< SfxStringItem const *>( @@ -629,7 +674,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { try { - Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + Any aValue = xPropSet->getPropertyValue( rtl::OUString( "LayoutManager" )); aValue >>= xLayoutManager; } catch ( const ::com::sun::star::uno::RuntimeException& ) @@ -643,7 +688,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) if ( xLayoutManager.is() ) { - rtl::OUString aToolbarResName( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/" )); + rtl::OUString aToolbarResName( "private:resource/toolbar/" ); rtl::OUStringBuffer aBuf( aToolbarResName ); aBuf.append( pToolbarName->GetValue() ); @@ -696,7 +741,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) if ( pAppData_Impl->nDocModalMode ) rSet.DisableItem(nWhich); else - rSet.Put(SfxStringItem(nWhich, String(SfxResId(STR_QUITAPP)))); + rSet.Put(SfxStringItem(nWhich, SfxResId(STR_QUITAPP).toString())); break; } @@ -810,14 +855,14 @@ extern "C" { static void SAL_CALL thisModule() {} } ::rtl::OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, sal_Bool bChooseOnly, const ::rtl::OUString& rMacroDesc = ::rtl::OUString() ) { // get basctl dllname - static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) ); + static ::rtl::OUString aLibName( SVLIBRARY( "basctl" ) ); // load module oslModule handleMod = osl_loadModuleRelative( &thisModule, aLibName.pData, 0 ); // get symbol - ::rtl::OUString aSymbol( RTL_CONSTASCII_USTRINGPARAM( "basicide_choose_macro" ) ); + ::rtl::OUString aSymbol( "basicide_choose_macro" ); basicide_choose_macro pSymbol = (basicide_choose_macro) osl_getFunctionSymbol( handleMod, aSymbol.pData ); // call basicide_choose_macro in basctl @@ -830,14 +875,14 @@ extern "C" { static void SAL_CALL thisModule() {} } void MacroOrganizer( sal_Int16 nTabId ) { // get basctl dllname - static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) ); + static ::rtl::OUString aLibName( SVLIBRARY( "basctl" ) ); // load module oslModule handleMod = osl_loadModuleRelative( &thisModule, aLibName.pData, 0 ); // get symbol - ::rtl::OUString aSymbol( RTL_CONSTASCII_USTRINGPARAM( "basicide_macro_organizer" ) ); + ::rtl::OUString aSymbol( "basicide_macro_organizer" ); basicide_macro_organizer pSymbol = (basicide_macro_organizer) osl_getFunctionSymbol( handleMod, aSymbol.pData ); // call basicide_macro_organizer in basctl @@ -878,7 +923,7 @@ namespace const ::rtl::OUString& lcl_getBasicIDEServiceName() { - static const ::rtl::OUString s_sBasicName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.BasicIDE" ) ); + static const ::rtl::OUString s_sBasicName( "com.sun.star.script.BasicIDE" ); return s_sBasicName; } @@ -1010,9 +1055,9 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) // read repository URL from configuration ::rtl::OUString sTemplRepoURL = getConfigurationStringValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dictionaries")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepositoryURL")), + ::rtl::OUString("org.openoffice.Office.Common"), + ::rtl::OUString("Dictionaries"), + ::rtl::OUString("RepositoryURL"), ::rtl::OUString()); if ( xSystemShell.is() && !sTemplRepoURL.isEmpty() ) @@ -1022,10 +1067,10 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) // read locale from configuration ::rtl::OUString sLocale = getConfigurationStringValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooLocale")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US"))); + ::rtl::OUString("org.openoffice.Setup"), + ::rtl::OUString("L10N"), + ::rtl::OUString("ooLocale"), + ::rtl::OUString("en-US")); aURLBuf.append( sLocale ); xSystemShell->execute( @@ -1062,7 +1107,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) SfxFrameLoader_Impl::impl_getStaticImplementationName() ), UNO_QUERY_THROW ); ::comphelper::NamedValueCollection aLoadArgs; aLoadArgs.put( "Model", pBasicIDE->GetModel() ); - aLoadArgs.put( "URL", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/sbasic" ) ) ); + aLoadArgs.put( "URL", ::rtl::OUString( "private:factory/sbasic" ) ); Reference< XFrame > xTargetFrame( lcl_findStartModuleFrame( aContext ) ); if ( !xTargetFrame.is() ) @@ -1273,13 +1318,13 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) Reference< com::sun::star::lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory(); Reference< com::sun::star::frame::XDispatchProvider > xProv( - xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ModuleDispatcher"))), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString("com.sun.star.drawing.ModuleDispatcher")), UNO_QUERY ); if ( xProv.is() ) { ::rtl::OUString aCmd = ::rtl::OUString::createFromAscii( GetInterface()->GetSlot( rReq.GetSlot() )->GetUnoName() ); Reference< com::sun::star::frame::XDispatchHelper > xHelper( - xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchHelper"))), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString("com.sun.star.frame.DispatchHelper")), UNO_QUERY ); if ( xHelper.is() ) { Sequence < com::sun::star::beans::PropertyValue > aSeq; @@ -1303,13 +1348,13 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) { Reference< com::sun::star::lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory(); Reference< com::sun::star::frame::XDispatchProvider > xProv( - xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.ModuleDispatcher"))), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString("com.sun.star.text.ModuleDispatcher")), UNO_QUERY ); if ( xProv.is() ) { ::rtl::OUString aCmd = ::rtl::OUString::createFromAscii( GetInterface()->GetSlot( rReq.GetSlot() )->GetUnoName() ); Reference< com::sun::star::frame::XDispatchHelper > xHelper( - xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchHelper"))), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString("com.sun.star.frame.DispatchHelper")), UNO_QUERY ); if ( xHelper.is() ) { Sequence < com::sun::star::beans::PropertyValue > aSeq; @@ -1329,7 +1374,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) case SID_ADDRESS_DATA_SOURCE: { - ::rtl::OUString sDialogServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.AddressBookSourcePilot" ) ); + ::rtl::OUString sDialogServiceName( "com.sun.star.ui.dialogs.AddressBookSourcePilot" ); try { Reference< com::sun::star::lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory(); @@ -1349,9 +1394,9 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) case SID_COMP_BIBLIOGRAPHY: { - SfxStringItem aURL(SID_FILE_NAME, String::CreateFromAscii(".component:Bibliography/View1")); - SfxStringItem aRef(SID_REFERER, String::CreateFromAscii("private:user")); - SfxStringItem aTarget(SID_TARGETNAME, String::CreateFromAscii("_blank")); + SfxStringItem aURL(SID_FILE_NAME, rtl::OUString(".component:Bibliography/View1")); + SfxStringItem aRef(SID_REFERER, rtl::OUString("private:user")); + SfxStringItem aTarget(SID_TARGETNAME, rtl::OUString("_blank")); SfxViewFrame::Current()->GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, &aURL, &aRef, &aTarget, 0L); } break; diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 8dfb849996cf..9a07f83625b0 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -185,6 +185,7 @@ static char const sModifyPasswordInfo[] = "ModifyPasswordInfo"; static char const sSuggestedSaveAsDir[] = "SuggestedSaveAsDir"; static char const sSuggestedSaveAsName[] = "SuggestedSaveAsName"; static char const sEncryptionData[] = "EncryptionData"; +static char const sDocumentService[] = "DocumentService"; void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot ) @@ -871,6 +872,13 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_SUGGESTEDSAVEASNAME, sVal ) ); } + else if (aName == sDocumentService) + { + rtl::OUString aVal; + bool bOK = ((rProp.Value >>= aVal) && !aVal.isEmpty()); + if (bOK) + rSet.Put(SfxStringItem(SID_DOC_SERVICE, aVal)); + } #ifdef DBG_UTIL else --nFoundArgs; @@ -1094,6 +1102,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nAdditional++; if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME ) == SFX_ITEM_SET ) nAdditional++; + if ( rSet.GetItemState( SID_DOC_SERVICE ) == SFX_ITEM_SET ) + nAdditional++; // consider additional arguments nProps += nAdditional; @@ -1229,7 +1239,9 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta continue; if ( nId == SID_NOAUTOSAVE ) continue; - if ( nId == SID_ENCRYPTIONDATA ) + if ( nId == SID_ENCRYPTIONDATA ) + continue; + if ( nId == SID_DOC_SERVICE ) continue; // used only internally @@ -1271,7 +1283,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta sal_uInt16 nSubCount = pType->nAttribs; if ( !nSubCount ) { - pValue[nActProp].Name = String( String::CreateFromAscii( pSlot->pUnoName ) ) ; + pValue[nActProp].Name = rtl::OUString::createFromAscii(pSlot->pUnoName) ; if ( !pItem->QueryValue( pValue[nActProp].Value ) ) { rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( @@ -1290,9 +1302,9 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nSubId |= CONVERT_TWIPS; DBG_ASSERT(( pType->aAttrib[n-1].nAID ) <= 127, "Member ID out of range" ); - String aName( String::CreateFromAscii( pSlot->pUnoName ) ) ; + String aName( rtl::OUString::createFromAscii( pSlot->pUnoName ) ) ; aName += '.'; - aName += String( String::CreateFromAscii( pType->aAttrib[n-1].pName ) ) ; + aName += rtl::OUString::createFromAscii( pType->aAttrib[n-1].pName ) ; pValue[nActProp].Name = aName; if ( !pItem->QueryValue( pValue[nActProp++].Value, nSubId ) ) { @@ -1324,7 +1336,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta sal_uInt16 nSubCount = rArg.pType->nAttribs; if ( !nSubCount ) { - pValue[nActProp].Name = String( String::CreateFromAscii( rArg.pName ) ) ; + pValue[nActProp].Name = rtl::OUString::createFromAscii( rArg.pName ) ; if ( !pItem->QueryValue( pValue[nActProp++].Value ) ) { rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( @@ -1343,9 +1355,9 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nSubId |= CONVERT_TWIPS; DBG_ASSERT((rArg.pType->aAttrib[n-1].nAID) <= 127, "Member ID out of range" ); - String aName( String::CreateFromAscii( rArg.pName ) ) ; + String aName( rtl::OUString::createFromAscii( rArg.pName ) ) ; aName += '.'; - aName += String( String::CreateFromAscii( rArg.pType->aAttrib[n-1].pName ) ) ; + aName += rtl::OUString::createFromAscii( rArg.pType->aAttrib[n-1].pName ) ; pValue[nActProp].Name = aName; if ( !pItem->QueryValue( pValue[nActProp++].Value, nSubId ) ) { @@ -1369,67 +1381,67 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta const SfxPoolItem *pItem=0; if ( rSet.GetItemState( SID_COMPONENTDATA, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sComponentData)); + pValue[nActProp].Name = rtl::OUString(sComponentData); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_COMPONENTCONTEXT, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sComponentContext)); + pValue[nActProp].Name = rtl::OUString(sComponentContext); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStatusInd)); + pValue[nActProp].Name = rtl::OUString(sStatusInd); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_INTERACTIONHANDLER, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sInteractionHdl)); + pValue[nActProp].Name = rtl::OUString(sInteractionHdl); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_VIEW_DATA, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sViewData)); + pValue[nActProp].Name = rtl::OUString(sViewData); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_FILTER_DATA, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFilterData)); + pValue[nActProp].Name = rtl::OUString(sFilterData); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DOCUMENT, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sModel)); + pValue[nActProp].Name = rtl::OUString(sModel); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_CONTENT, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sUCBContent)); + pValue[nActProp].Name = rtl::OUString(sUCBContent); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_INPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sInputStream)); + pValue[nActProp].Name = rtl::OUString(sInputStream); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_STREAM, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStream)); + pValue[nActProp].Name = rtl::OUString(sStream); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_OUTPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sOutputStream)); + pValue[nActProp].Name = rtl::OUString(sOutputStream); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_POSTDATA, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sPostData)); + pValue[nActProp].Name = rtl::OUString(sPostData); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_FILLFRAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFrame)); + pValue[nActProp].Name = rtl::OUString(sFrame); if ( pItem->ISA( SfxUsrAnyItem ) ) { OSL_FAIL( "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" ); @@ -1442,87 +1454,87 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta } if ( rSet.GetItemState( SID_TEMPLATE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sAsTemplate)); + pValue[nActProp].Name = rtl::OUString(sAsTemplate); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_OPEN_NEW_VIEW, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sOpenNewView)); + pValue[nActProp].Name = rtl::OUString(sOpenNewView); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_VIEW_ID, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sViewId)); + pValue[nActProp].Name = rtl::OUString(sViewId); pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_PLUGIN_MODE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sPluginMode)); + pValue[nActProp].Name = rtl::OUString(sPluginMode); pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DOC_READONLY, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sReadOnly)); + pValue[nActProp].Name = rtl::OUString(sReadOnly); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDdeReconnect)); + pValue[nActProp].Name = rtl::OUString(sDdeReconnect); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStartPresentation)); + pValue[nActProp].Name = rtl::OUString(sStartPresentation); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_SELECTION, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSelectionOnly)); + pValue[nActProp].Name = rtl::OUString(sSelectionOnly); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_HIDDEN, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sHidden)); + pValue[nActProp].Name = rtl::OUString(sHidden); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_MINIMIZED, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sMinimized)); + pValue[nActProp].Name = rtl::OUString(sMinimized); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_SILENT, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSilent)); + pValue[nActProp].Name = rtl::OUString(sSilent); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_PREVIEW, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sPreview)); + pValue[nActProp].Name = rtl::OUString(sPreview); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_VIEWONLY, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sViewOnly)); + pValue[nActProp].Name = rtl::OUString(sViewOnly); pValue[nActProp++].Value <<= (sal_Bool) (( ((SfxBoolItem*)pItem)->GetValue() )); } if ( rSet.GetItemState( SID_EDITDOC, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDontEdit)); + pValue[nActProp].Name = rtl::OUString(sDontEdit); pValue[nActProp++].Value <<= (sal_Bool) (!( ((SfxBoolItem*)pItem)->GetValue() )); } if ( rSet.GetItemState( SID_FILE_DIALOG, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sUseSystemDialog)); + pValue[nActProp].Name = rtl::OUString(sUseSystemDialog); pValue[nActProp++].Value <<= (sal_Bool) ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_STANDARD_DIR, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStandardDir)); + pValue[nActProp].Name = rtl::OUString(sStandardDir); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_BLACK_LIST, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sBlackList)); + pValue[nActProp].Name = rtl::OUString(sBlackList); com::sun::star::uno::Sequence< rtl::OUString > aList; ((SfxStringListItem*)pItem)->GetStringList( aList ); @@ -1530,105 +1542,110 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta } if ( rSet.GetItemState( SID_TARGETNAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFrameName)); + pValue[nActProp].Name = rtl::OUString(sFrameName); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_DOC_SALVAGE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSalvagedFile)); + pValue[nActProp].Name = rtl::OUString(sSalvagedFile); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_PATH, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFolderName)); + pValue[nActProp].Name = rtl::OUString(sFolderName); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_CONTENTTYPE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sMediaType)); + pValue[nActProp].Name = rtl::OUString(sMediaType); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_TEMPLATE_NAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sTemplateName)); + pValue[nActProp].Name = rtl::OUString(sTemplateName); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_TEMPLATE_REGIONNAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sTemplateRegionName)); + pValue[nActProp].Name = rtl::OUString(sTemplateRegionName); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_JUMPMARK, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sJumpMark)); + pValue[nActProp].Name = rtl::OUString(sJumpMark); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_CHARSET, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sCharacterSet)); + pValue[nActProp].Name = rtl::OUString(sCharacterSet); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_MACROEXECMODE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sMacroExecMode)); + pValue[nActProp].Name = rtl::OUString(sMacroExecMode); pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_UPDATEDOCMODE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sUpdateDocMode)); + pValue[nActProp].Name = rtl::OUString(sUpdateDocMode); pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_REPAIRPACKAGE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sRepairPackage)); + pValue[nActProp].Name = rtl::OUString(sRepairPackage); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DOCINFO_TITLE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDocumentTitle)); + pValue[nActProp].Name = rtl::OUString(sDocumentTitle); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_DOC_BASEURL, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDocumentBaseURL)); + pValue[nActProp].Name = rtl::OUString(sDocumentBaseURL); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_DOC_HIERARCHICALNAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sHierarchicalDocumentName)); + pValue[nActProp].Name = rtl::OUString(sHierarchicalDocumentName); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_COPY_STREAM_IF_POSSIBLE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sCopyStreamIfPossible)); + pValue[nActProp].Name = rtl::OUString(sCopyStreamIfPossible); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_NOAUTOSAVE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sNoAutoSave)); + pValue[nActProp].Name = rtl::OUString(sNoAutoSave); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sModifyPasswordInfo)); + pValue[nActProp].Name = rtl::OUString(sModifyPasswordInfo); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_ENCRYPTIONDATA, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sEncryptionData)); + pValue[nActProp].Name = rtl::OUString(sEncryptionData); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSuggestedSaveAsDir)); + pValue[nActProp].Name = rtl::OUString(sSuggestedSaveAsDir); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSuggestedSaveAsName)); + pValue[nActProp].Name = rtl::OUString(sSuggestedSaveAsName); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } + if ( rSet.GetItemState( SID_DOC_SERVICE, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(sDocumentService); + pValue[nActProp++].Value <<= rtl::OUString(static_cast<const SfxStringItem*>(pItem)->GetValue()); + } } } @@ -2020,7 +2037,7 @@ throw (::com::sun::star::uno::RuntimeException) if ( pAppSlotPool ) { const sal_uIntPtr nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); - rtl::OUString aCmdPrefix( RTL_CONSTASCII_USTRINGPARAM( ".uno:" )); + rtl::OUString aCmdPrefix( ".uno:" ); // Gruppe anw"ahlen ( Gruppe 0 ist intern ) for ( sal_uInt16 i=0; i<pAppSlotPool->GetGroupCount(); i++ ) @@ -2059,8 +2076,8 @@ throw (::com::sun::star::uno::RuntimeException) #ifdef TEST_HANDLERS #include <cppuhelper/implbase2.hxx> -#include <com/sun/star/awt/XKeyHandler.hdl> -#include <com/sun/star/awt/XMouseClickHandler.hdl> +#include <com/sun/star/awt/XKeyHandler.hpp> +#include <com/sun/star/awt/XMouseClickHandler.hpp> class TestKeyHandler: public ::cppu::WeakImplHelper2 < diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index a69800230211..8335e65a9347 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -49,8 +49,6 @@ static const sal_uInt16 nVersion = 2; DBG_NAME(SfxChildWindow) -SV_IMPL_PTRARR( SfxChildWinContextArr_Impl, SfxChildWinContextFactory* ); - struct SfxChildWindow_Impl { ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame; @@ -215,7 +213,7 @@ SfxChildWindow* SfxChildWindow::CreateChildWindow( sal_uInt16 nId, SfxApplication *pApp = SFX_APP(); { SfxChildWinFactArr_Impl &rFactories = pApp->GetChildWinFactories_Impl(); - for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory ) { pFact = rFactories[nFactory]; if ( pFact->nId == nId ) @@ -246,7 +244,7 @@ SfxChildWindow* SfxChildWindow::CreateChildWindow( sal_uInt16 nId, if ( pFactories ) { SfxChildWinFactArr_Impl &rFactories = *pFactories; - for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory ) { pFact = rFactories[nFactory]; if ( pFact->nId == nId ) @@ -430,7 +428,7 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding if ( pFactories ) { SfxChildWinFactArr_Impl &rFactories = *pFactories; - for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory ) { pFact = rFactories[nFactory]; if ( pFact->nId == GetType() ) @@ -439,10 +437,9 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding if ( !pFact->pArr ) break; - SfxChildWinContextFactory *pConFact=0; - for ( sal_uInt16 n=0; n<pFact->pArr->Count(); ++n ) + for ( sal_uInt16 n=0; n<pFact->pArr->size(); ++n ) { - pConFact = (*pFact->pArr)[n]; + SfxChildWinContextFactory *pConFact = &(*pFact->pArr)[n]; rBindings.ENTERREGISTRATIONS(); if ( pConFact->nContextId == nContextId ) { @@ -462,7 +459,7 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding if ( !pCon ) { SfxChildWinFactArr_Impl &rFactories = pApp->GetChildWinFactories_Impl(); - for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory ) { pFact = rFactories[nFactory]; if ( pFact->nId == GetType() ) @@ -471,10 +468,9 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding if ( !pFact->pArr ) break; - SfxChildWinContextFactory *pConFact=0; - for ( sal_uInt16 n=0; n<pFact->pArr->Count(); ++n ) + for ( sal_uInt16 n=0; n<pFact->pArr->size(); ++n ) { - pConFact = (*pFact->pArr)[n]; + SfxChildWinContextFactory *pConFact = &(*pFact->pArr)[n]; rBindings.ENTERREGISTRATIONS(); if ( pConFact->nContextId == nContextId ) { diff --git a/sfx2/source/appl/dde.hrc b/sfx2/source/appl/dde.hrc index d3e178606809..86628ddd2c00 100644 --- a/sfx2/source/appl/dde.hrc +++ b/sfx2/source/appl/dde.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_DDE_HRC #define _SFX_DDE_HRC diff --git a/sfx2/source/appl/dde.src b/sfx2/source/appl/dde.src index 18f6517f181c..b01e00e73c1e 100644 --- a/sfx2/source/appl/dde.src +++ b/sfx2/source/appl/dde.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "dde.hrc" diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index d9190d6162bc..ae648c1c877e 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -270,7 +270,7 @@ sal_Bool SvFileObject::LoadFile_Impl() return sal_False; // at the moment on the current DocShell - xMed = new SfxMedium( sFileNm, STREAM_STD_READ, sal_True ); + xMed = new SfxMedium( sFileNm, STREAM_STD_READ ); SvLinkSource::StreamToLoadFrom aStreamToLoadFrom = getStreamToLoadFrom(); xMed->setStreamToLoadFrom( @@ -402,7 +402,7 @@ String impl_getFilter( const String& _rURL ) { css::uno::Reference< ::com::sun::star::document::XTypeDetection > xTypeDetection( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")) ), + ::rtl::OUString("com.sun.star.document.TypeDetection") ), css::uno::UNO_QUERY ); if ( xTypeDetection.is() ) { @@ -419,7 +419,7 @@ String impl_getFilter( const String& _rURL ) { ::comphelper::SequenceAsHashMap lTypeProps( xTypeCont->getByName( sType ) ); sFilter = lTypeProps.getUnpackedValueOrDefault( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter")), ::rtl::OUString() ); + ::rtl::OUString("PreferredFilter"), ::rtl::OUString() ); } } } diff --git a/sfx2/source/appl/fwkhelper.cxx b/sfx2/source/appl/fwkhelper.cxx index d502b89b77de..7b0786ec4827 100644 --- a/sfx2/source/appl/fwkhelper.cxx +++ b/sfx2/source/appl/fwkhelper.cxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/frame/XFrame.hpp> diff --git a/sfx2/source/appl/helpdispatch.hxx b/sfx2/source/appl/helpdispatch.hxx index f99c054a3063..b4b772e3f7fa 100644 --- a/sfx2/source/appl/helpdispatch.hxx +++ b/sfx2/source/appl/helpdispatch.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef SFX_HELPDISPATCH_HXX #define SFX_HELPDISPATCH_HXX diff --git a/sfx2/source/appl/helpinterceptor.cxx b/sfx2/source/appl/helpinterceptor.cxx index 47d22e9b74e2..85fd84ca6533 100644 --- a/sfx2/source/appl/helpinterceptor.cxx +++ b/sfx2/source/appl/helpinterceptor.cxx @@ -152,7 +152,7 @@ Reference< XDispatch > SAL_CALL HelpInterceptor_Impl::queryDispatch( if ( m_xSlaveDispatcher.is() ) xResult = m_xSlaveDispatcher->queryDispatch( aURL, aTargetFrameName, nSearchFlags ); - sal_Bool bHelpURL = aURL.Complete.toAsciiLowerCase().match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help")),0); + sal_Bool bHelpURL = aURL.Complete.toAsciiLowerCase().match("vnd.sun.star.help",0); if ( bHelpURL ) { diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 9184f57d92e3..73ca33ec1f5f 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -240,7 +240,7 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink ) { sal_Bool bSysTopic; { - DdeConnection aTmp( sServer, String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "SYSTEM" ) ) ); + DdeConnection aTmp(sServer, rtl::OUString("SYSTEM")); bSysTopic = !aTmp.GetError(); } diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index daec440c0c5a..147ade785320 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -26,6 +26,7 @@ * ************************************************************************/ +#include <comphelper/string.hxx> #include <sfx2/linkmgr.hxx> #include <com/sun/star/document/UpdateDocMode.hpp> #include <sfx2/objsh.hxx> @@ -73,8 +74,6 @@ public: }; -SV_IMPL_PTRARR( SvBaseLinks, SvBaseLinkRefPtr ) - LinkManager::LinkManager(SfxObjectShell* p) : pPersist( p ) { @@ -83,15 +82,15 @@ LinkManager::LinkManager(SfxObjectShell* p) LinkManager::~LinkManager() { - SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData(); - for( sal_uInt16 n = aLinkTbl.Count(); n; --n, ++ppRef ) + for( sal_uInt16 n = 0; n < aLinkTbl.size(); ++n) { - if( (*ppRef)->Is() ) + SvBaseLinkRef* pTmp = aLinkTbl[ n ]; + if( pTmp->Is() ) { - (*(*ppRef))->Disconnect(); - (*(*ppRef))->SetLinkManager( NULL ); + (*pTmp)->Disconnect(); + (*pTmp)->SetLinkManager( NULL ); } - delete *ppRef; + delete pTmp; } } @@ -120,48 +119,49 @@ void LinkManager::Remove( SvBaseLink *pLink ) { // No duplicate links inserted int bFound = sal_False; - SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData(); - for( sal_uInt16 n = aLinkTbl.Count(); n; --n, ++ppRef ) + for( sal_uInt16 n = 0; n < aLinkTbl.size(); ) { - if( pLink == *(*ppRef) ) + SvBaseLinkRef* pTmp = aLinkTbl[ n ]; + if( pLink == *pTmp ) { - (*(*ppRef))->Disconnect(); - (*(*ppRef))->SetLinkManager( NULL ); - (*(*ppRef)).Clear(); + (*pTmp)->Disconnect(); + (*pTmp)->SetLinkManager( NULL ); + (*pTmp).Clear(); bFound = sal_True; } - // Remove emty ones if they exist - if( !(*ppRef)->Is() ) + // Remove empty ones if they exist + if( !pTmp->Is() ) { - delete *ppRef; - aLinkTbl.Remove( aLinkTbl.Count() - n, 1 ); + delete pTmp; + aLinkTbl.erase( aLinkTbl.begin() + n ); if( bFound ) return ; - --ppRef; } + else + ++n; } } void LinkManager::Remove( sal_uInt16 nPos, sal_uInt16 nCnt ) { - if( nCnt && nPos < aLinkTbl.Count() ) + if( nCnt && nPos < aLinkTbl.size() ) { - if( nPos + nCnt > aLinkTbl.Count() ) - nCnt = aLinkTbl.Count() - nPos; + if( nPos + nCnt > aLinkTbl.size() ) + nCnt = aLinkTbl.size() - nPos; - SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData() + nPos; - for( sal_uInt16 n = nCnt; n; --n, ++ppRef ) + for( sal_uInt16 n = nPos; n < nPos + nCnt; ++n) { - if( (*ppRef)->Is() ) + SvBaseLinkRef* pTmp = aLinkTbl[ n ]; + if( pTmp->Is() ) { - (*(*ppRef))->Disconnect(); - (*(*ppRef))->SetLinkManager( NULL ); + (*pTmp)->Disconnect(); + (*pTmp)->SetLinkManager( NULL ); } - delete *ppRef; + delete pTmp; } - aLinkTbl.Remove( nPos, nCnt ); + aLinkTbl.erase( aLinkTbl.begin() + nPos, aLinkTbl.begin() + nPos + nCnt ); } } @@ -169,11 +169,14 @@ void LinkManager::Remove( sal_uInt16 nPos, sal_uInt16 nCnt ) sal_Bool LinkManager::Insert( SvBaseLink* pLink ) { // No duplicate links inserted - for( sal_uInt16 n = 0; n < aLinkTbl.Count(); ++n ) + for( sal_uInt16 n = 0; n < aLinkTbl.size(); ++n ) { SvBaseLinkRef* pTmp = aLinkTbl[ n ]; if( !pTmp->Is() ) - aLinkTbl.DeleteAndDestroy( n-- ); + { + delete pTmp; + aLinkTbl.erase( aLinkTbl.begin() + n-- ); + } if( pLink == *pTmp ) return sal_False; @@ -181,7 +184,7 @@ sal_Bool LinkManager::Insert( SvBaseLink* pLink ) SvBaseLinkRef* pTmp = new SvBaseLinkRef( pLink ); pLink->SetLinkManager( this ); - aLinkTbl.Insert( pTmp, aLinkTbl.Count() ); + aLinkTbl.push_back( pTmp ); return sal_True; } @@ -261,10 +264,10 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * pLink, if( pType ) { sal_uInt16 nObjType = pLink->GetObjType(); - *pType = String( SfxResId( + *pType = SfxResId( ( OBJECT_CLIENT_FILE == nObjType || OBJECT_CLIENT_OLE == nObjType ) ? RID_SVXSTR_FILELINK - : RID_SVXSTR_GRAFIKLINK )); + : RID_SVXSTR_GRAFIKLINK).toString(); } bRet = true; } @@ -318,9 +321,9 @@ void LinkManager::UpdateAllLinks( { // First make a copy of the array in order to update links // links in ... no contact between them! - SvPtrarr aTmpArr( 255 ); + std::vector<SvBaseLink*> aTmpArr; sal_uInt16 n; - for( n = 0; n < aLinkTbl.Count(); ++n ) + for( n = 0; n < aLinkTbl.size(); ++n ) { SvBaseLink* pLink = *aLinkTbl[ n ]; if( !pLink ) @@ -328,16 +331,16 @@ void LinkManager::UpdateAllLinks( Remove( n-- ); continue; } - aTmpArr.Insert( pLink, aTmpArr.Count() ); + aTmpArr.push_back( pLink ); } - for( n = 0; n < aTmpArr.Count(); ++n ) + for( n = 0; n < aTmpArr.size(); ++n ) { - SvBaseLink* pLink = (SvBaseLink*)aTmpArr[ n ]; + SvBaseLink* pLink = aTmpArr[ n ]; // search first in the array after the entry sal_uInt16 nFndPos = USHRT_MAX; - for( sal_uInt16 i = 0; i < aLinkTbl.Count(); ++i ) + for( sal_uInt16 i = 0; i < aLinkTbl.size(); ++i ) if( pLink == *aLinkTbl[ i ] ) { nFndPos = i; @@ -354,7 +357,7 @@ void LinkManager::UpdateAllLinks( if( bAskUpdate ) { - int nRet = QueryBox( pParentWin, WB_YES_NO | WB_DEF_YES, SfxResId( STR_QUERY_UPDATE_LINKS ) ).Execute(); + int nRet = QueryBox( pParentWin, WB_YES_NO | WB_DEF_YES, SfxResId( STR_QUERY_UPDATE_LINKS ).toString() ).Execute(); if( RET_YES != nRet ) return ; // nothing should be updated bAskUpdate = sal_False; // once is enough @@ -387,19 +390,16 @@ SvLinkSourceRef LinkManager::CreateObj( SvBaseLink * pLink ) sal_Bool LinkManager::InsertServer( SvLinkSource* pObj ) { // no duplicate inserts - if( !pObj || USHRT_MAX != aServerTbl.GetPos( pObj ) ) + if( !pObj ) return sal_False; - aServerTbl.Insert( pObj, aServerTbl.Count() ); - return sal_True; + return aServerTbl.insert( pObj ).second; } void LinkManager::RemoveServer( SvLinkSource* pObj ) { - sal_uInt16 nPos = aServerTbl.GetPos( pObj ); - if( USHRT_MAX != nPos ) - aServerTbl.Remove( nPos, 1 ); + aServerTbl.erase( pObj ); } @@ -407,14 +407,25 @@ void MakeLnkName( String& rName, const String* pType, const String& rFile, const String& rLink, const String* pFilter ) { if( pType ) - (rName = *pType).EraseLeadingChars().EraseTrailingChars() += cTokenSeperator; + { + rName = comphelper::string::strip(*pType, ' '); + rName += cTokenSeperator; + } else if( rName.Len() ) rName.Erase(); - ((rName += rFile).EraseLeadingChars().EraseTrailingChars() += - cTokenSeperator ).EraseLeadingChars().EraseTrailingChars() += rLink; + rName += rFile; + + rName = comphelper::string::strip(rName, ' '); + rName += cTokenSeperator; + rName = comphelper::string::strip(rName, ' '); + rName += rLink; if( pFilter ) - ((rName += cTokenSeperator ) += *pFilter).EraseLeadingChars().EraseTrailingChars(); + { + rName += cTokenSeperator; + rName += *pFilter; + rName = comphelper::string::strip(rName, ' '); + } } void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer) @@ -424,7 +435,7 @@ void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer) return; const ::sfx2::SvBaseLinks& rLinks = GetLinks(); - sal_uInt16 n = rLinks.Count(); + sal_uInt16 n = rLinks.size(); for (sal_uInt16 i = 0; i < n; ++i) { @@ -518,7 +529,7 @@ void LinkManager::CancelTransfers() sfx2::SvBaseLink* pLnk; const sfx2::SvBaseLinks& rLnks = GetLinks(); - for( sal_uInt16 n = rLnks.Count(); n; ) + for( sal_uInt16 n = rLnks.size(); n; ) if( 0 != ( pLnk = &(*rLnks[ --n ])) && OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & pLnk->GetObjType()) && 0 != ( pFileObj = (SvFileObject*)pLnk->GetObj() ) ) @@ -536,8 +547,7 @@ sal_uIntPtr LinkManager::RegisterStatusInfoId() if( !nFormat ) { nFormat = SotExchange::RegisterFormatName( - String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( - "StatusInfo from SvxInternalLink" ))); + rtl::OUString("StatusInfo from SvxInternalLink")); } return nFormat; } @@ -693,7 +703,7 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) SfxStringItem aName( SID_FILE_NAME, sTopic ); SfxBoolItem aMinimized(SID_MINIMIZED, sal_True); SfxBoolItem aHidden(SID_HIDDEN, sal_True); - SfxStringItem aTarget( SID_TARGETNAME, String::CreateFromAscii("_blank") ); + SfxStringItem aTarget( SID_TARGETNAME, rtl::OUString("_blank") ); SfxStringItem aReferer( SID_REFERER, sReferer ); SfxUInt16Item aUpdate( SID_UPDATEDOCMODE, nUpdateMode ); SfxBoolItem aReadOnly(SID_DOC_READONLY, false); diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx index 7fee276c527a..64730e89297a 100644 --- a/sfx2/source/appl/linksrc.cxx +++ b/sfx2/source/appl/linksrc.cxx @@ -34,6 +34,8 @@ #include <vcl/timer.hxx> #include <svl/svarray.hxx> +#include <vector> +#include <algorithm> using namespace ::com::sun::star::uno; @@ -99,9 +101,25 @@ SvLinkSource_Entry_Impl::~SvLinkSource_Entry_Impl() { } -typedef SvLinkSource_Entry_Impl* SvLinkSource_Entry_ImplPtr; -SV_DECL_PTRARR_DEL( SvLinkSource_Array_Impl, SvLinkSource_Entry_ImplPtr, 4 ) -SV_IMPL_PTRARR( SvLinkSource_Array_Impl, SvLinkSource_Entry_ImplPtr ); +class SvLinkSource_Array_Impl : public std::vector<SvLinkSource_Entry_Impl*> +{ +public: + void DeleteAndDestroy(SvLinkSource_Entry_Impl* p) + { + iterator it = std::find(begin(), end(), p); + if (it != end()) + { + erase(it); + delete p; + } + } + + ~SvLinkSource_Array_Impl() + { + for(const_iterator it = begin(); it != end(); ++it) + delete *it; + } +}; class SvLinkSource_EntryIter_Impl { @@ -112,34 +130,34 @@ public: SvLinkSource_EntryIter_Impl( const SvLinkSource_Array_Impl& rArr ); ~SvLinkSource_EntryIter_Impl(); SvLinkSource_Entry_Impl* Curr() - { return nPos < aArr.Count() ? aArr[ nPos ] : 0; } + { return nPos < aArr.size() ? aArr[ nPos ] : 0; } SvLinkSource_Entry_Impl* Next(); sal_Bool IsValidCurrValue( SvLinkSource_Entry_Impl* pEntry ); }; SvLinkSource_EntryIter_Impl::SvLinkSource_EntryIter_Impl( const SvLinkSource_Array_Impl& rArr ) - : rOrigArr( rArr ), nPos( 0 ) + : aArr( rArr ), rOrigArr( rArr ), nPos( 0 ) { - aArr.Insert( &rArr, 0 ); } SvLinkSource_EntryIter_Impl::~SvLinkSource_EntryIter_Impl() { - aArr.Remove( 0, aArr.Count() ); + aArr.clear(); } sal_Bool SvLinkSource_EntryIter_Impl::IsValidCurrValue( SvLinkSource_Entry_Impl* pEntry ) { - return ( nPos < aArr.Count() && aArr[nPos] == pEntry && USHRT_MAX != rOrigArr.GetPos( pEntry ) ); + return ( nPos < aArr.size() && aArr[nPos] == pEntry + && std::find( rOrigArr.begin(), rOrigArr.end(), pEntry ) != rOrigArr.end() ); } SvLinkSource_Entry_Impl* SvLinkSource_EntryIter_Impl::Next() { - SvLinkSource_Entry_ImplPtr pRet = 0; - if( nPos + 1 < aArr.Count() ) + SvLinkSource_Entry_Impl* pRet = 0; + if( nPos + 1 < (sal_uInt16)aArr.size() ) { ++nPos; - if( rOrigArr.Count() == aArr.Count() && + if( rOrigArr.size() == aArr.size() && rOrigArr[ nPos ] == aArr[ nPos ] ) pRet = aArr[ nPos ]; else @@ -147,13 +165,13 @@ SvLinkSource_Entry_Impl* SvLinkSource_EntryIter_Impl::Next() // then we must search the current (or the next) in the orig do { pRet = aArr[ nPos ]; - if( USHRT_MAX != rOrigArr.GetPos( pRet )) + if( std::find(rOrigArr.begin(), rOrigArr.end(), pRet ) != rOrigArr.end() ) break; pRet = 0; ++nPos; - } while( nPos < aArr.Count() ); + } while( nPos < aArr.size() ); - if( nPos >= aArr.Count() ) + if( nPos >= aArr.size() ) pRet = 0; } } @@ -234,7 +252,7 @@ void SvLinkSource::SetUpdateTimeout( sal_uIntPtr nTimeout ) void SvLinkSource::SendDataChanged() { SvLinkSource_EntryIter_Impl aIter( pImpl->aArr ); - for( SvLinkSource_Entry_ImplPtr p = aIter.Curr(); p; p = aIter.Next() ) + for( SvLinkSource_Entry_Impl* p = aIter.Curr(); p; p = aIter.Next() ) { if( p->bIsDataSink ) { @@ -253,9 +271,7 @@ void SvLinkSource::SendDataChanged() if( p->nAdviseModes & ADVISEMODE_ONLYONCE ) { - sal_uInt16 nFndPos = pImpl->aArr.GetPos( p ); - if( USHRT_MAX != nFndPos ) - pImpl->aArr.DeleteAndDestroy( nFndPos ); + pImpl->aArr.DeleteAndDestroy( p ); } } @@ -276,7 +292,7 @@ void SvLinkSource::NotifyDataChanged() else { SvLinkSource_EntryIter_Impl aIter( pImpl->aArr ); - for( SvLinkSource_Entry_ImplPtr p = aIter.Curr(); p; p = aIter.Next() ) + for( SvLinkSource_Entry_Impl* p = aIter.Curr(); p; p = aIter.Next() ) if( p->bIsDataSink ) { Any aVal; @@ -290,9 +306,7 @@ void SvLinkSource::NotifyDataChanged() if( p->nAdviseModes & ADVISEMODE_ONLYONCE ) { - sal_uInt16 nFndPos = pImpl->aArr.GetPos( p ); - if( USHRT_MAX != nFndPos ) - pImpl->aArr.DeleteAndDestroy( nFndPos ); + pImpl->aArr.DeleteAndDestroy( p ); } } } @@ -319,7 +333,7 @@ void SvLinkSource::DataChanged( const String & rMimeType, else { SvLinkSource_EntryIter_Impl aIter( pImpl->aArr ); - for( SvLinkSource_Entry_ImplPtr p = aIter.Curr(); p; p = aIter.Next() ) + for( SvLinkSource_Entry_Impl* p = aIter.Curr(); p; p = aIter.Next() ) { if( p->bIsDataSink ) { @@ -330,9 +344,7 @@ void SvLinkSource::DataChanged( const String & rMimeType, if( p->nAdviseModes & ADVISEMODE_ONLYONCE ) { - sal_uInt16 nFndPos = pImpl->aArr.GetPos( p ); - if( USHRT_MAX != nFndPos ) - pImpl->aArr.DeleteAndDestroy( nFndPos ); + pImpl->aArr.DeleteAndDestroy( p ); } } } @@ -350,39 +362,35 @@ void SvLinkSource::DataChanged( const String & rMimeType, void SvLinkSource::AddDataAdvise( SvBaseLink * pLink, const String& rMimeType, sal_uInt16 nAdviseModes ) { - SvLinkSource_Entry_ImplPtr pNew = new SvLinkSource_Entry_Impl( + SvLinkSource_Entry_Impl* pNew = new SvLinkSource_Entry_Impl( pLink, rMimeType, nAdviseModes ); - pImpl->aArr.Insert( pNew, pImpl->aArr.Count() ); + pImpl->aArr.push_back( pNew ); } void SvLinkSource::RemoveAllDataAdvise( SvBaseLink * pLink ) { SvLinkSource_EntryIter_Impl aIter( pImpl->aArr ); - for( SvLinkSource_Entry_ImplPtr p = aIter.Curr(); p; p = aIter.Next() ) + for( SvLinkSource_Entry_Impl* p = aIter.Curr(); p; p = aIter.Next() ) if( p->bIsDataSink && &p->xSink == pLink ) { - sal_uInt16 nFndPos = pImpl->aArr.GetPos( p ); - if( USHRT_MAX != nFndPos ) - pImpl->aArr.DeleteAndDestroy( nFndPos ); + pImpl->aArr.DeleteAndDestroy( p ); } } // only one link is correct void SvLinkSource::AddConnectAdvise( SvBaseLink * pLink ) { - SvLinkSource_Entry_ImplPtr pNew = new SvLinkSource_Entry_Impl( pLink ); - pImpl->aArr.Insert( pNew, pImpl->aArr.Count() ); + SvLinkSource_Entry_Impl* pNew = new SvLinkSource_Entry_Impl( pLink ); + pImpl->aArr.push_back( pNew ); } void SvLinkSource::RemoveConnectAdvise( SvBaseLink * pLink ) { SvLinkSource_EntryIter_Impl aIter( pImpl->aArr ); - for( SvLinkSource_Entry_ImplPtr p = aIter.Curr(); p; p = aIter.Next() ) + for( SvLinkSource_Entry_Impl* p = aIter.Curr(); p; p = aIter.Next() ) if( !p->bIsDataSink && &p->xSink == pLink ) { - sal_uInt16 nFndPos = pImpl->aArr.GetPos( p ); - if( USHRT_MAX != nFndPos ) - pImpl->aArr.DeleteAndDestroy( nFndPos ); + pImpl->aArr.DeleteAndDestroy( p ); } } @@ -390,7 +398,7 @@ sal_Bool SvLinkSource::HasDataLinks( const SvBaseLink* pLink ) const { sal_Bool bRet = sal_False; const SvLinkSource_Entry_Impl* p; - for( sal_uInt16 n = 0, nEnd = pImpl->aArr.Count(); n < nEnd; ++n ) + for( sal_uInt16 n = 0, nEnd = pImpl->aArr.size(); n < nEnd; ++n ) if( ( p = pImpl->aArr[ n ] )->bIsDataSink && ( !pLink || &p->xSink == pLink ) ) { diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 842a83ec0fa8..21ed30a178ce 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -590,7 +590,7 @@ void ImplDdeItem::AdviseLoop( sal_Bool bOpen ) // A connection is re-established if( OBJECT_DDE_EXTERN == pLink->GetObjType() ) { - pLink->GetObj()->AddDataAdvise( pLink, String::CreateFromAscii( "text/plain;charset=utf-16" ), ADVISEMODE_NODATA ); + pLink->GetObj()->AddDataAdvise( pLink, rtl::OUString("text/plain;charset=utf-16"), ADVISEMODE_NODATA ); pLink->GetObj()->AddConnectAdvise( pLink ); } } diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 47ec441ef1a0..cfa7b1362e1e 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -144,7 +144,7 @@ void SfxModule::Construct_Impl() SfxApplication *pApp = SFX_APP(); SfxModuleArr_Impl& rArr = GetModules_Impl(); SfxModule* pPtr = (SfxModule*)this; - rArr.C40_INSERT( SfxModule, pPtr, rArr.Count() ); + rArr.push_back( pPtr ); pImpl = new SfxModule_Impl; pImpl->pSlotPool = new SfxSlotPool( &pApp->GetAppSlotPool_Impl(), pResMgr ); @@ -170,11 +170,11 @@ SfxModule::~SfxModule() // The module will be destroyed before the Deinitialize, // so remove from the array SfxModuleArr_Impl& rArr = GetModules_Impl(); - for( sal_uInt16 nPos = rArr.Count(); nPos--; ) + for( sal_uInt16 nPos = rArr.size(); nPos--; ) { if( rArr[ nPos ] == this ) { - rArr.Remove( nPos ); + rArr.erase( rArr.begin() + nPos ); break; } } @@ -202,18 +202,17 @@ void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact) if (!pImpl->pFactArr) pImpl->pFactArr = new SfxChildWinFactArr_Impl; - for (sal_uInt16 nFactory=0; nFactory<pImpl->pFactArr->Count(); ++nFactory) + for (sal_uInt16 nFactory=0; nFactory<pImpl->pFactArr->size(); ++nFactory) { if (pFact->nId == (*pImpl->pFactArr)[nFactory]->nId) { - pImpl->pFactArr->Remove( nFactory ); + pImpl->pFactArr->erase( pImpl->pFactArr->begin() + nFactory ); SAL_WARN("sfx2.appl", "ChildWindow registered multiple times!"); return; } } - pImpl->pFactArr->C40_INSERT( - SfxChildWinFactory, pFact, pImpl->pFactArr->Count() ); + pImpl->pFactArr->push_back( pFact ); } //------------------------------------------------------------------------- @@ -224,7 +223,7 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact ) pImpl->pTbxCtrlFac = new SfxTbxCtrlFactArr_Impl; #ifdef DBG_UTIL - for ( sal_uInt16 n=0; n<pImpl->pTbxCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pImpl->pTbxCtrlFac->size(); n++ ) { SfxTbxCtrlFactory *pF = (*pImpl->pTbxCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -235,7 +234,7 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact ) } #endif - pImpl->pTbxCtrlFac->C40_INSERT( SfxTbxCtrlFactory, pFact, pImpl->pTbxCtrlFac->Count() ); + pImpl->pTbxCtrlFac->push_back( pFact ); } //------------------------------------------------------------------------- @@ -246,7 +245,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact ) pImpl->pStbCtrlFac = new SfxStbCtrlFactArr_Impl; #ifdef DBG_UTIL - for ( sal_uInt16 n=0; n<pImpl->pStbCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pImpl->pStbCtrlFac->size(); n++ ) { SfxStbCtrlFactory *pF = (*pImpl->pStbCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -257,7 +256,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact ) } #endif - pImpl->pStbCtrlFac->C40_INSERT( SfxStbCtrlFactory, pFact, pImpl->pStbCtrlFac->Count() ); + pImpl->pStbCtrlFac->push_back( pFact ); } //------------------------------------------------------------------------- @@ -268,7 +267,7 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact ) pImpl->pMenuCtrlFac = new SfxMenuCtrlFactArr_Impl; #ifdef DBG_UTIL - for ( sal_uInt16 n=0; n<pImpl->pMenuCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pImpl->pMenuCtrlFac->size(); n++ ) { SfxMenuCtrlFactory *pF = (*pImpl->pMenuCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -279,7 +278,7 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact ) } #endif - pImpl->pMenuCtrlFac->C40_INSERT( SfxMenuCtrlFactory, pFact, pImpl->pMenuCtrlFac->Count() ); + pImpl->pMenuCtrlFac->push_back( pFact ); } //------------------------------------------------------------------------- @@ -332,9 +331,9 @@ void SfxModule::DestroyModules_Impl() if ( pModules ) { SfxModuleArr_Impl& rModules = *pModules; - for( sal_uInt16 nPos = rModules.Count(); nPos--; ) + for( sal_uInt16 nPos = rModules.size(); nPos--; ) { - SfxModule* pMod = rModules.GetObject(nPos); + SfxModule* pMod = rModules[nPos]; delete pMod; } delete pModules, pModules = 0; diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index d1f066ef0995..d9e5f8a1d36e 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -84,6 +84,7 @@ #include <com/sun/star/util/URL.hpp> #include <com/sun/star/util/XSearchable.hpp> #include <com/sun/star/util/XSearchDescriptor.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/view/XViewSettingsSupplier.hpp> @@ -148,7 +149,7 @@ using namespace ::comphelper; #define TBI_SEARCHDIALOG 1008 #define TBI_SOURCEVIEW 1009 #define TBI_SELECTIONMODE 1010 -#define TBI_ONSTARTUP 1011 +// TBI_ONSTARTUP 1011 #define CONFIGNAME_HELPWIN DEFINE_CONST_UNICODE("OfficeHelp") #define CONFIGNAME_INDEXWIN DEFINE_CONST_UNICODE("OfficeHelpIndex") @@ -170,8 +171,7 @@ using namespace ::comphelper; #define KEY_UI_NAME DEFINE_CONST_OUSTRING("ooSetupFactoryUIName") #define PARSE_URL( aURL ) \ - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( \ - DEFINE_CONST_UNICODE("com.sun.star.util.URLTransformer" )), UNO_QUERY ); \ + Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); \ xTrans->parseStrict( aURL ) //......................................................................... @@ -388,7 +388,7 @@ void ContentListBox_Impl::RequestingChildren( SvLBoxEntry* pParent ) else { pEntry = InsertEntry( aTitle, aDocumentImage, aDocumentImage, pParent ); - Any aAny( ::utl::UCBContentHelper::GetProperty( aURL, String(RTL_CONSTASCII_USTRINGPARAM("TargetURL" ) ) ) ); + Any aAny( ::utl::UCBContentHelper::GetProperty( aURL, String("TargetURL" ) ) ); rtl::OUString aTargetURL; if ( aAny >>= aTargetURL ) pEntry->SetUserData( new ContentEntry_Impl( aTargetURL, sal_False ) ); @@ -1073,7 +1073,7 @@ void SearchTabPage_Impl::RememberSearchText( const String& rSearchText ) IMPL_LINK_NOARG(SearchTabPage_Impl, SearchHdl) { - String aSearchText = TRIM( aSearchED.GetText() ); + String aSearchText = comphelper::string::strip(aSearchED.GetText(), ' '); if ( aSearchText.Len() > 0 ) { EnterWait(); @@ -1107,7 +1107,7 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, SearchHdl) if ( !nCount ) { InfoBox aBox( this, SfxResId( RID_INFO_NOSEARCHRESULTS ) ); - aBox.SetText( String( SfxResId( STR_HELP_WINDOW_TITLE ) ) ); + aBox.SetText( SfxResId( STR_HELP_WINDOW_TITLE ).toString() ); aBox.Execute(); } } @@ -1126,7 +1126,7 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, OpenHdl) IMPL_LINK_NOARG(SearchTabPage_Impl, ModifyHdl) { - String aSearchText = TRIM( aSearchED.GetText() ); + String aSearchText = comphelper::string::strip(aSearchED.GetText(), ' '); aSearchBtn.Enable( aSearchText.Len() > 0 ); return 0; } @@ -2047,9 +2047,9 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : aOnStartupCB ( this, SfxResId( RID_HELP_ONSTARTUP_BOX ) ), aIndexOnImage ( SfxResId( IMG_HELP_TOOLBOX_INDEX_ON ) ), aIndexOffImage ( SfxResId( IMG_HELP_TOOLBOX_INDEX_OFF ) ), - aIndexOnText ( SfxResId( STR_HELP_BUTTON_INDEX_ON ) ), - aIndexOffText ( SfxResId( STR_HELP_BUTTON_INDEX_OFF ) ), - aOnStartupText ( SfxResId( RID_HELP_ONSTARTUP_TEXT ) ), + aIndexOnText ( SfxResId( STR_HELP_BUTTON_INDEX_ON ).toString() ), + aIndexOffText ( SfxResId( STR_HELP_BUTTON_INDEX_OFF ).toString() ), + aOnStartupText ( SfxResId( RID_HELP_ONSTARTUP_TEXT ).toString() ), pHelpWin ( pParent ), pTextWin ( new TextWin_Impl( this ) ), pSrchDlg ( NULL ), @@ -2073,18 +2073,18 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : aToolBox.InsertItem( TBI_INDEX, aIndexOffText ); aToolBox.SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX ); aToolBox.InsertSeparator(); - aToolBox.InsertItem( TBI_BACKWARD, String( SfxResId( STR_HELP_BUTTON_PREV ) ) ); + aToolBox.InsertItem( TBI_BACKWARD, SfxResId( STR_HELP_BUTTON_PREV ).toString() ); aToolBox.SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD ); - aToolBox.InsertItem( TBI_FORWARD, String( SfxResId( STR_HELP_BUTTON_NEXT ) ) ); + aToolBox.InsertItem( TBI_FORWARD, SfxResId( STR_HELP_BUTTON_NEXT ).toString() ); aToolBox.SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD ); - aToolBox.InsertItem( TBI_START, String( SfxResId( STR_HELP_BUTTON_START ) ) ); + aToolBox.InsertItem( TBI_START, SfxResId( STR_HELP_BUTTON_START ).toString() ); aToolBox.SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START ); aToolBox.InsertSeparator(); - aToolBox.InsertItem( TBI_PRINT, String( SfxResId( STR_HELP_BUTTON_PRINT ) ) ); + aToolBox.InsertItem( TBI_PRINT, SfxResId( STR_HELP_BUTTON_PRINT ).toString() ); aToolBox.SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT ); - aToolBox.InsertItem( TBI_BOOKMARKS, String( SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ) ) ); + aToolBox.InsertItem( TBI_BOOKMARKS, SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ).toString() ); aToolBox.SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS ); - aToolBox.InsertItem( TBI_SEARCHDIALOG, String( SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ) ) ); + aToolBox.InsertItem( TBI_SEARCHDIALOG, SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ).toString() ); aToolBox.SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG ); InitToolBoxImages(); @@ -2238,7 +2238,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText ) { // set module name in checkbox text String sText( aOnStartupText ); - sText.SearchAndReplace( String::CreateFromAscii( "%MODULENAME" ), sModuleName ); + sText.SearchAndReplace( rtl::OUString("%MODULENAME"), sModuleName ); aOnStartupCB.SetText( sText ); // and show it aOnStartupCB.Show(); @@ -2560,40 +2560,40 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aMenu.SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX ); aMenu.InsertSeparator(); aMenu.InsertItem( TBI_BACKWARD, - String( SfxResId( STR_HELP_BUTTON_PREV ) ), + SfxResId( STR_HELP_BUTTON_PREV ).toString(), Image( SfxResId( IMG_HELP_TOOLBOX_PREV ) ) ); aMenu.SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD ); aMenu.EnableItem( TBI_BACKWARD, pHelpWin->HasHistoryPredecessor() ); aMenu.InsertItem( TBI_FORWARD, - String( SfxResId( STR_HELP_BUTTON_NEXT ) ), + SfxResId( STR_HELP_BUTTON_NEXT ).toString(), Image( SfxResId( IMG_HELP_TOOLBOX_NEXT ) ) ); aMenu.SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD ); aMenu.EnableItem( TBI_FORWARD, pHelpWin->HasHistorySuccessor() ); aMenu.InsertItem( TBI_START, - String( SfxResId( STR_HELP_BUTTON_START ) ), + SfxResId( STR_HELP_BUTTON_START ).toString(), Image( SfxResId( IMG_HELP_TOOLBOX_START ) ) ); aMenu.SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START ); aMenu.InsertSeparator(); aMenu.InsertItem( TBI_PRINT, - String( SfxResId( STR_HELP_BUTTON_PRINT ) ), + SfxResId( STR_HELP_BUTTON_PRINT ).toString(), Image( SfxResId( IMG_HELP_TOOLBOX_PRINT ) ) ); aMenu.SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT ); aMenu.InsertItem( TBI_BOOKMARKS, - String( SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ) ), + SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ).toString(), Image( SfxResId( IMG_HELP_TOOLBOX_BOOKMARKS ) ) ); aMenu.SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS ); aMenu.InsertItem( TBI_SEARCHDIALOG, - String( SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ) ), + SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ).toString(), Image( SfxResId( IMG_HELP_TOOLBOX_SEARCHDIALOG ) ) ); aMenu.SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG ); aMenu.InsertSeparator(); - aMenu.InsertItem( TBI_SELECTIONMODE, String( SfxResId( STR_HELP_MENU_TEXT_SELECTION_MODE ) ) ); + aMenu.InsertItem( TBI_SELECTIONMODE, SfxResId( STR_HELP_MENU_TEXT_SELECTION_MODE ).toString() ); aMenu.SetHelpId( TBI_SELECTIONMODE, HID_HELP_TEXT_SELECTION_MODE ); Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); URL aURL; @@ -2613,7 +2613,7 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) } aMenu.InsertSeparator(); aMenu.InsertItem( TBI_COPY, - String( SfxResId( STR_HELP_MENU_TEXT_COPY ) ), + SfxResId(STR_HELP_MENU_TEXT_COPY).toString(), Image( SfxResId( IMG_HELP_TOOLBOX_COPY ) ) ); aMenu.SetHelpId( TBI_COPY, ".uno:Copy" ); @@ -2622,7 +2622,7 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) if ( bIsDebug ) { aMenu.InsertSeparator(); - aMenu.InsertItem( TBI_SOURCEVIEW, String( SfxResId( STR_HELP_BUTTON_SOURCEVIEW ) ) ); + aMenu.InsertItem( TBI_SOURCEVIEW, SfxResId(STR_HELP_BUTTON_SOURCEVIEW).toString() ); } if( SvtMenuOptions().IsEntryHidingEnabled() == sal_False ) @@ -3058,7 +3058,7 @@ IMPL_LINK_NOARG(SfxHelpWindow_Impl, OpenHdl) ::rtl::OUString sHelpURL; - bool bComplete = rtl::OUString(aEntry).toAsciiLowerCase().match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help")),0); + bool bComplete = rtl::OUString(aEntry).toAsciiLowerCase().match(rtl::OUString("vnd.sun.star.help"),0); if (bComplete) sHelpURL = ::rtl::OUString(aEntry); @@ -3163,7 +3163,7 @@ void SfxHelpWindow_Impl::openDone(const ::rtl::OUString& sURL , } // When the SearchPage opens the help doc, then select all words, which are equal to its text - String sSearchText = TRIM( pIndexWin->GetSearchText() ); + String sSearchText = comphelper::string::strip(pIndexWin->GetSearchText(), ' '); if ( sSearchText.Len() > 0 ) pTextWin->SelectSearchText( sSearchText, pIndexWin->IsFullWordSearch() ); @@ -3441,7 +3441,7 @@ SfxAddHelpBookmarkDialog_Impl::SfxAddHelpBookmarkDialog_Impl( Window* pParent, s { if ( bRename ) - SetText( String( SfxResId( STR_BOOKMARK_RENAME ) ) ); + SetText( SfxResId(STR_BOOKMARK_RENAME).toString() ); FreeResource(); } diff --git a/sfx2/source/appl/newhelp.hrc b/sfx2/source/appl/newhelp.hrc index 7bb9aa85678c..5be2cbf7bdad 100644 --- a/sfx2/source/appl/newhelp.hrc +++ b/sfx2/source/appl/newhelp.hrc @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_NEWHELP_HRC #define _SFX_NEWHELP_HRC diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index a0dc6e435932..a62de6194809 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -138,7 +138,7 @@ short SvxOpenGraphicDialog::Execute() // non-local? if ( INET_PROT_FILE != aObj.GetProtocol() ) { - SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ, sal_True ); + SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); aMed.DownLoad(); SvStream* pStream = aMed.GetInStream(); @@ -168,7 +168,7 @@ short SvxOpenGraphicDialog::Execute() // could not load? if ( nFound == USHRT_MAX ) { - WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, String( SfxResId( SvxOpenGrfErr2ResId(nImpRet) ) ) ); + WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString() ); bQuitLoop = aWarningBox.Execute()==RET_RETRY ? sal_False : sal_True; } else diff --git a/sfx2/source/appl/panelist.hxx b/sfx2/source/appl/panelist.hxx index e5924071a64e..0bb327970eff 100644 --- a/sfx2/source/appl/panelist.hxx +++ b/sfx2/source/appl/panelist.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef SFX_PANELIST_HXX diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 6b3d69930e33..77a30465b4fb 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/awt/XTopWindow.hpp> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -96,7 +97,7 @@ public: NoHelpErrorBox::NoHelpErrorBox( Window* _pParent ) : - ErrorBox( _pParent, WB_OK, String( SfxResId( RID_STR_HLPFILENOTEXIST ) ) ) + ErrorBox( _pParent, WB_OK, SfxResId( RID_STR_HLPFILENOTEXIST ).toString() ) { // Error message: "No help available" } @@ -116,7 +117,7 @@ static rtl::OUString HelpLocaleString() static rtl::OUString aLocaleStr; if (aLocaleStr.isEmpty()) { - const rtl::OUString aEnglish( RTL_CONSTASCII_USTRINGPARAM( "en" ) ); + const rtl::OUString aEnglish( "en" ); // detect installed locale aLocaleStr = utl::ConfigManager::getLocale(); bool bOk = !aLocaleStr.isEmpty(); @@ -188,7 +189,7 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor ) { ::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ), Reference< ::com::sun::star::ucb::XCommandEnvironment > () ); - if ( ( aCnt.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorName")) ) >>= sAnchor ) ) + if ( ( aCnt.getPropertyValue( ::rtl::OUString("AnchorName") ) >>= sAnchor ) ) { if ( !sAnchor.isEmpty() ) @@ -242,7 +243,7 @@ static Sequence< ::rtl::OUString > GetPropertyNames() } SfxHelpOptions_Impl::SfxHelpOptions_Impl() - : ConfigItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.SFX/Help")) ) + : ConfigItem( ::rtl::OUString("Office.SFX/Help") ) { Sequence< ::rtl::OUString > aNames = GetPropertyNames(); Sequence< Any > aValues = GetProperties( aNames ); @@ -360,7 +361,7 @@ SfxHelp::SfxHelp() : // if it's set, you will see debug output on active help { ::rtl::OUString sHelpDebug; - ::rtl::OUString sEnvVarName( RTL_CONSTASCII_USTRINGPARAM( "HELP_DEBUG" ) ); + ::rtl::OUString sEnvVarName( "HELP_DEBUG" ); osl_getEnvironment( sEnvVarName.pData, &sHelpDebug.pData ); bIsDebug = !sHelpDebug.isEmpty(); } @@ -489,13 +490,13 @@ String SfxHelp::GetHelpModuleName_Impl() { // Map some module identifiers to their "real" help module string. if ( aFactoryShortName == "chart2" ) - aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "schart" ) ); + aFactoryShortName = rtl::OUString( "schart" ); else if ( aFactoryShortName == "BasicIDE" ) - aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "sbasic" ) ); + aFactoryShortName = rtl::OUString( "sbasic" ); else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sweb")) || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sglobal")) || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swxform")) ) - aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "swriter" ) ); + aFactoryShortName = rtl::OUString( "swriter" ); else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbquery")) || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbbrowser")) || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbrelation")) @@ -505,7 +506,7 @@ String SfxHelp::GetHelpModuleName_Impl() || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swreport")) || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbbrowser")) || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swform")) ) - aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "sdatabase" ) ); + aFactoryShortName = rtl::OUString( "sdatabase" ); else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sbibliography")) || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StartModule")) ) aFactoryShortName = sDefaultModule; @@ -528,11 +529,11 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rM if ( aModuleName.Len() == 0 ) aModuleName = getDefaultModule_Impl(); - aHelpURL = String::CreateFromAscii("vnd.sun.star.help://"); + aHelpURL = rtl::OUString("vnd.sun.star.help://"); aHelpURL += aModuleName; if ( !aCommandURL.Len() ) - aHelpURL += String::CreateFromAscii("/start"); + aHelpURL += rtl::OUString("/start"); else { aHelpURL += '/'; @@ -586,7 +587,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask , if (xProps.is()) xProps->setPropertyValue( DEFINE_CONST_UNICODE("Title"), - makeAny(::rtl::OUString(String(SfxResId(STR_HELP_WINDOW_TITLE))))); + makeAny(SfxResId(STR_HELP_WINDOW_TITLE).toString())); pHelpWindow->setContainerWindow( xParentWindow ); xParentWindow->setVisible(sal_True); @@ -672,17 +673,17 @@ sal_Bool SfxHelp::Start( const String& rURL, const Window* pWindow ) /// Redirect the vnd.sun.star.help:// urls to http://help.libreoffice.org static bool impl_showOnlineHelp( const String& rURL ) { - String aInternal( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.help://" ) ); + String aInternal( "vnd.sun.star.help://" ); if ( rURL.Len() <= aInternal.Len() || rURL.Copy( 0, aInternal.Len() ) != aInternal ) return false; - rtl::OUString aHelpLink( RTL_CONSTASCII_USTRINGPARAM( "http://help.libreoffice.org/" ) ); + rtl::OUString aHelpLink( "http://help.libreoffice.org/" ); aHelpLink += rURL.Copy( aInternal.Len() ); try { Reference< XSystemShellExecute > xSystemShell( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), + rtl::OUString( "com.sun.star.system.SystemShellExecute" ) ), UNO_QUERY ); if ( xSystemShell.is() ) @@ -839,8 +840,7 @@ void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId ) { URL aURL; aURL.Complete = CreateHelpURL_Impl( rtl::OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), GetHelpModuleName_Impl() ); - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ), UNO_QUERY ); + Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict(aURL); Reference < XFrame > xCurrentFrame; @@ -853,7 +853,7 @@ void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId ) Reference< XDispatch > xHelpDispatch; if ( xDispProv.is() ) xHelpDispatch = xDispProv->queryDispatch( - aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_helpagent")), + aURL, ::rtl::OUString("_helpagent"), FrameSearchFlag::PARENT | FrameSearchFlag::SELF ); DBG_ASSERT( xHelpDispatch.is(), "OpenHelpAgent: could not get a dispatcher!" ); diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index b3c48f2c622f..8e685064faad 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -330,7 +330,7 @@ void SfxPickList::ExecuteEntry( sal_uInt32 nIndex ) sal_uInt16 nPos=aFilter.Search('|'); if( nPos != STRING_NOTFOUND ) { - String aOptions(aFilter.Copy( nPos ).GetBuffer()+1); + rtl::OUString aOptions(aFilter.Copy(nPos).GetBuffer()+1); aFilter.Erase( nPos ); aReq.AppendItem( SfxStringItem(SID_FILE_FILTEROPTIONS, aOptions)); } diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 2fec49473611..d240f3746ebf 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> #include <com/sun/star/ui/dialogs/XFilterManager.hpp> @@ -154,12 +155,12 @@ bool ShutdownIcon::LoadModule( osl::Module **pModule, oslGenericFunction pTmpInit = NULL; oslGenericFunction pTmpDeInit = NULL; - if ( pPlugin->loadRelative( &thisModule, OUString (RTL_CONSTASCII_USTRINGPARAM( STRING( PLUGIN_NAME ) ) ) ) ) + if ( pPlugin->loadRelative( &thisModule, OUString (STRING( PLUGIN_NAME ) ) ) ) { pTmpInit = pPlugin->getFunctionSymbol( - OUString( RTL_CONSTASCII_USTRINGPARAM( "plugin_init_sys_tray" ) ) ); + OUString( "plugin_init_sys_tray" ) ); pTmpDeInit = pPlugin->getFunctionSymbol( - OUString( RTL_CONSTASCII_USTRINGPARAM( "plugin_shutdown_sys_tray" ) ) ); + OUString( "plugin_shutdown_sys_tray" ) ); } if ( !pTmpInit || !pTmpDeInit ) { @@ -296,27 +297,22 @@ void ShutdownIcon::OpenURL( const ::rtl::OUString& aURL, const ::rtl::OUString& com::sun::star::util::URL aDispatchURL; aDispatchURL.Complete = aURL; - Reference < com::sun::star::util::XURLTransformer > xURLTransformer( - ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ), - com::sun::star::uno::UNO_QUERY ); - if ( xURLTransformer.is() ) + Reference< util::XURLTransformer > xURLTransformer( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); + try { - try - { - Reference< com::sun::star::frame::XDispatch > xDispatch; + Reference< com::sun::star::frame::XDispatch > xDispatch; - xURLTransformer->parseStrict( aDispatchURL ); - xDispatch = xDispatchProvider->queryDispatch( aDispatchURL, rTarget, 0 ); - if ( xDispatch.is() ) - xDispatch->dispatch( aDispatchURL, aArgs ); - } - catch ( com::sun::star::uno::RuntimeException& ) - { - throw; - } - catch ( com::sun::star::uno::Exception& ) - { - } + xURLTransformer->parseStrict( aDispatchURL ); + xDispatch = xDispatchProvider->queryDispatch( aDispatchURL, rTarget, 0 ); + if ( xDispatch.is() ) + xDispatch->dispatch( aDispatchURL, aArgs ); + } + catch ( com::sun::star::uno::RuntimeException& ) + { + throw; + } + catch ( com::sun::star::uno::Exception& ) + { } } } @@ -346,8 +342,8 @@ void ShutdownIcon::FromTemplate() xFrame = Reference < ::com::sun::star::frame::XFrame >( xDesktop, UNO_QUERY ); URL aTargetURL; - aTargetURL.Complete = OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:5500" ) ); - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); + aTargetURL.Complete = OUString( "slot:5500" ); + Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aTargetURL ); Reference < ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, UNO_QUERY ); @@ -357,14 +353,14 @@ void ShutdownIcon::FromTemplate() if ( aTargetURL.Protocol.compareToAscii("slot:") == COMPARE_EQUAL ) xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(), 0 ); else - xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0 ); + xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString("_blank"), 0 ); } if ( xDisp.is() ) { Sequence<PropertyValue> aArgs(1); PropertyValue* pArg = aArgs.getArray(); - pArg[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer")); - pArg[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:user")); + pArg[0].Name = rtl::OUString("Referer"); + pArg[0].Value <<= ::rtl::OUString("private:user"); Reference< ::com::sun::star::frame::XNotifyingDispatch > xNotifyer( xDisp, UNO_QUERY ); if ( xNotifyer.is() ) { @@ -452,18 +448,18 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR Sequence< PropertyValue > aArgs(3); Reference < com::sun::star::task::XInteractionHandler > xInteraction( - ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler")) ), + ::comphelper::getProcessServiceFactory()->createInstance( OUString("com.sun.star.task.InteractionHandler") ), com::sun::star::uno::UNO_QUERY ); - aArgs[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")); + aArgs[0].Name = OUString("InteractionHandler"); aArgs[0].Value <<= xInteraction; sal_Int16 nMacroExecMode = ::com::sun::star::document::MacroExecMode::USE_CONFIG; - aArgs[1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode")); + aArgs[1].Name = OUString("MacroExecutionMode"); aArgs[1].Value <<= nMacroExecMode; sal_Int16 nUpdateDoc = ::com::sun::star::document::UpdateDocMode::ACCORDING_TO_CONFIG; - aArgs[2].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("UpdateDocMode")); + aArgs[2].Name = OUString("UpdateDocMode"); aArgs[2].Value <<= nUpdateDoc; // use the filedlghelper to get the current filter name, @@ -485,7 +481,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR if ( bReadOnly ) { aArgs.realloc( ++nArgs ); - aArgs[nArgs-1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); + aArgs[nArgs-1].Name = OUString("ReadOnly"); aArgs[nArgs-1].Value <<= bReadOnly; } @@ -500,7 +496,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR sal_Int16 uVersion = (sal_Int16)iVersion; aArgs.realloc( ++nArgs ); - aArgs[nArgs-1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Version")); + aArgs[nArgs-1].Name = OUString("Version"); aArgs[nArgs-1].Value <<= uVersion; } @@ -525,26 +521,26 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR if ( !aFilterName.isEmpty() ) { aArgs.realloc( ++nArgs ); - aArgs[nArgs-1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); + aArgs[nArgs-1].Name = OUString("FilterName"); aArgs[nArgs-1].Value <<= aFilterName; } } } if ( 1 == nFiles ) - OpenURL( sFiles[0], OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ), aArgs ); + OpenURL( sFiles[0], OUString( "_default" ), aArgs ); else { OUString aBaseDirURL = sFiles[0]; if ( !aBaseDirURL.isEmpty() && aBaseDirURL[aBaseDirURL.getLength()-1] != '/' ) - aBaseDirURL += OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + aBaseDirURL += OUString("/"); int iFiles; for ( iFiles = 1; iFiles < nFiles; iFiles++ ) { OUString aURL = aBaseDirURL; aURL += sFiles[iFiles]; - OpenURL( aURL, OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ), aArgs ); + OpenURL( aURL, OUString( "_default" ), aArgs ); } } } @@ -806,9 +802,9 @@ static OUString getAutostartDir( bool bCreate = false ) OUString aHomeURL; osl::Security().getHomeDir( aHomeURL ); ::osl::File::getSystemPathFromFileURL( aHomeURL, aShortcut ); - aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/.config" ) ); + aShortcut += OUString( "/.config" ); } - aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/autostart" ) ); + aShortcut += OUString( "/autostart" ); if (bCreate) { OUString aShortcutUrl; @@ -825,7 +821,7 @@ rtl::OUString ShutdownIcon::getShortcutName() return OUString(); #else - OUString aShortcutName( RTL_CONSTASCII_USTRINGPARAM( "StarOffice 6.0" ) ); + OUString aShortcutName( "StarOffice 6.0" ); ResMgr* pMgr = SfxResId::GetResMgr(); if( pMgr ) { @@ -833,14 +829,14 @@ rtl::OUString ShutdownIcon::getShortcutName() aShortcutName = SFX2_RESSTR(STR_QUICKSTART_LNKNAME); } #ifdef WNT - aShortcutName += OUString( RTL_CONSTASCII_USTRINGPARAM( ".lnk" ) ); + aShortcutName += OUString( ".lnk" ); OUString aShortcut(GetAutostartFolderNameW32()); - aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\" ) ); + aShortcut += OUString( "\\" ); aShortcut += aShortcutName; #else // UNX OUString aShortcut = getAutostartDir(); - aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/qstart.desktop" ) ); + aShortcut += OUString( "/qstart.desktop" ); #endif // UNX return aShortcut; #endif // ENABLE_QUICKSTART_APPLET @@ -880,7 +876,7 @@ void ShutdownIcon::SetAutostart( bool bActivate ) #else // UNX getAutostartDir( true ); - OUString aPath( RTL_CONSTASCII_USTRINGPARAM("${BRAND_BASE_DIR}/share/xdg/qstart.desktop" ) ); + OUString aPath( "${BRAND_BASE_DIR}/share/xdg/qstart.desktop" ); Bootstrap::expandMacros( aPath ); OUString aDesktopFile; diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 294cefb0c9ff..0d3b86c46e53 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -181,7 +181,7 @@ static HMENU createSystrayMenu( ) ::std::set< ::rtl::OUString > aFileNewAppsAvailable; SvtDynamicMenuOptions aOpt; Sequence < Sequence < PropertyValue > > aNewMenu = aOpt.GetMenu( E_NEWMENU ); - const ::rtl::OUString sURLKey( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ); + const ::rtl::OUString sURLKey( "URL" ); const Sequence< PropertyValue >* pNewMenu = aNewMenu.getConstArray(); const Sequence< PropertyValue >* pNewMenuEnd = aNewMenu.getConstArray() + aNewMenu.getLength(); @@ -213,7 +213,7 @@ static HMENU createSystrayMenu( ) OUString aEmpty; // insert the menu entries for launching the applications - for ( size_t i = 0; i < SAL_N_ELEMENTS( aMenuItems ); ++i ) + for ( size_t i = 0; i < sizeof( aMenuItems ) / sizeof( aMenuItems[0] ); ++i ) { if ( !aModuleOptions.IsModuleInstalled( aMenuItems[i].eModuleIdentifier ) ) // the complete application is not even installed @@ -236,7 +236,7 @@ static HMENU createSystrayMenu( ) addMenuItem( hMenu, IDM_TEMPLATE, ICON_TEMPLATE, pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true, aEmpty); addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty ); - addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString(RTL_CONSTASCII_USTRINGPARAM("SHELL32"))); + addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString("SHELL32")); addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty ); #endif addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false, aEmpty ); @@ -446,22 +446,22 @@ LRESULT CALLBACK executerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP ShutdownIcon::FileOpen(); break; case IDM_WRITER: - ShutdownIcon::OpenURL( OUString( RTL_CONSTASCII_USTRINGPARAM( WRITER_URL ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ) ); + ShutdownIcon::OpenURL( OUString( WRITER_URL ), OUString( "_default" ) ); break; case IDM_CALC: - ShutdownIcon::OpenURL( OUString( RTL_CONSTASCII_USTRINGPARAM( CALC_URL ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ) ); + ShutdownIcon::OpenURL( OUString( CALC_URL ), OUString( "_default" ) ); break; case IDM_IMPRESS: - ShutdownIcon::OpenURL( OUString( RTL_CONSTASCII_USTRINGPARAM( IMPRESS_WIZARD_URL ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ) ); + ShutdownIcon::OpenURL( OUString( IMPRESS_WIZARD_URL ), OUString( "_default" ) ); break; case IDM_DRAW: - ShutdownIcon::OpenURL( OUString( RTL_CONSTASCII_USTRINGPARAM( DRAW_URL ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ) ); + ShutdownIcon::OpenURL( OUString( DRAW_URL ), OUString( "_default" ) ); break; case IDM_BASE: - ShutdownIcon::OpenURL( OUString( RTL_CONSTASCII_USTRINGPARAM( BASE_URL ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ) ); + ShutdownIcon::OpenURL( OUString( BASE_URL ), OUString( "_default" ) ); break; case IDM_MATH: - ShutdownIcon::OpenURL( OUString( RTL_CONSTASCII_USTRINGPARAM( MATH_URL ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ) ); + ShutdownIcon::OpenURL( OUString( MATH_URL ), OUString( "_default" ) ); break; case IDM_TEMPLATE: if ( !ShutdownIcon::bModalMode ) @@ -839,7 +839,7 @@ bool ShutdownIcon::IsQuickstarterInstalled() aOfficepath = aOfficepath.copy(0, i); OUString quickstartExe(aOfficepath); - quickstartExe += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\quickstart.exe" ) ); + quickstartExe += OUString( "\\quickstart.exe" ); return FileExistsW( reinterpret_cast<LPCWSTR>(quickstartExe.getStr()) ); } @@ -855,7 +855,7 @@ void ShutdownIcon::EnableAutostartW32( const rtl::OUString &aShortcut ) aOfficepath = aOfficepath.copy(0, i); OUString quickstartExe(aOfficepath); - quickstartExe += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\quickstart.exe" ) ); + quickstartExe += OUString( "\\quickstart.exe" ); CreateShortcut( quickstartExe, aOfficepath, aShortcut, OUString(), OUString() ); } diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 5f6d001ad6e4..0f4906eda40a 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -2457,7 +2457,7 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW) SfxApplication *pApp = SFX_APP(); { SfxChildWinFactArr_Impl &rFactories = pApp->GetChildWinFactories_Impl(); - for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory ) { pFact = rFactories[nFactory]; if ( pFact->nId == pCW->nSaveId ) @@ -2487,7 +2487,7 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW) if ( pFactories ) { SfxChildWinFactArr_Impl &rFactories = *pFactories; - for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory ) { pFact = rFactories[nFactory]; if ( pFact->nId == pCW->nSaveId ) diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx index 44c4ed180959..07cc2256c961 100644 --- a/sfx2/source/appl/xpackcreator.cxx +++ b/sfx2/source/appl/xpackcreator.cxx @@ -46,15 +46,15 @@ using namespace ::com::sun::star; uno::Sequence< ::rtl::OUString > SAL_CALL OPackageStructureCreator::impl_getStaticSupportedServiceNames() { uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.PackageStructureCreator")); - aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.PackageStructureCreator")); + aRet[0] = ::rtl::OUString("com.sun.star.embed.PackageStructureCreator"); + aRet[1] = ::rtl::OUString("com.sun.star.comp.embed.PackageStructureCreator"); return aRet; } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OPackageStructureCreator::impl_getStaticImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.PackageStructureCreator")); + return ::rtl::OUString("com.sun.star.comp.embed.PackageStructureCreator"); } //------------------------------------------------------------------------- diff --git a/sfx2/source/appl/xpackcreator.hxx b/sfx2/source/appl/xpackcreator.hxx index 03ef58e27e03..fa204aac0e02 100644 --- a/sfx2/source/appl/xpackcreator.hxx +++ b/sfx2/source/appl/xpackcreator.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef __XFACTORY_HXX_ #define __XFACTORY_HXX_ diff --git a/sfx2/source/bastyp/bastyp.hrc b/sfx2/source/bastyp/bastyp.hrc index fd53e2577212..8cb66dd98c8c 100644 --- a/sfx2/source/bastyp/bastyp.hrc +++ b/sfx2/source/bastyp/bastyp.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include <sfx2/sfx.hrc> @@ -32,7 +23,5 @@ #define RC_BASTYP RID_SFX_BASTYP_START #define STR_FILTER_NOT_INSTALLED (RC_BASTYP + 9) #define STR_FILTER_CONSULT_SERVICE (RC_BASTYP + 10) -#define STR_MEMEXCEPTION (RC_BASTYP + 28) -#define MSG_MEM_WARN (RC_BASTYP + 29) #define STR_HTML_GENERATOR (RC_BASTYP + 30) diff --git a/sfx2/source/bastyp/bastyp.src b/sfx2/source/bastyp/bastyp.src index 5ef74f5874b3..1d31cc8fbda1 100644 --- a/sfx2/source/bastyp/bastyp.src +++ b/sfx2/source/bastyp/bastyp.src @@ -1,66 +1,23 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "bastyp.hrc" String STR_HTML_GENERATOR { Text = "%PRODUCTNAME %PRODUCTVERSION %PRODUCTEXTENSION (%1)" ; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 3bb6497b6678..313aef390038 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -218,8 +218,8 @@ const SfxFilter* SfxFilterContainer::GetDefaultFilter_Impl( const String& rName const SfxFilter* pFilter = aMatcher.GetFilter4FilterName(sDefaultFilter); if ( - (pFilter) && - (pFilter->GetServiceName().CompareIgnoreCaseToAscii( sServiceName ) != COMPARE_EQUAL) + pFilter && + !pFilter->GetServiceName().equalsIgnoreAsciiCase(sServiceName) ) { pFilter = 0; @@ -235,7 +235,7 @@ const SfxFilter* SfxFilterContainer::GetDefaultFilter_Impl( const String& rName for ( size_t i = 0, n = pFilterArr->size(); i < n; ++i ) { const SfxFilter* pCheckFilter = pFilterArr->at( i ); - if ( pCheckFilter->GetServiceName().CompareIgnoreCaseToAscii( sServiceName ) == COMPARE_EQUAL ) + if ( pCheckFilter->GetServiceName().equalsIgnoreAsciiCase(sServiceName) ) { pFilter = pCheckFilter; break; @@ -336,7 +336,7 @@ void SfxFilterMatcher_Impl::Update() for ( size_t i = 0, n = pFilterArr->size(); i < n; ++i ) { SfxFilter* pFilter = pFilterArr->at( i ); - if ( pFilter->GetServiceName() == String(aName) ) + if ( pFilter->GetServiceName() == aName ) pList->push_back( pFilter ); } } @@ -386,7 +386,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent( SfxFilterFlags nMust, SfxFilterFlags nDont ) const { - Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection"))), UNO_QUERY ); + Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString("com.sun.star.document.TypeDetection")), UNO_QUERY ); ::rtl::OUString sTypeName; try { @@ -421,7 +421,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c const SfxFilter* pOldFilter = *ppFilter; // no detection service -> nothing to do ! - Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection"))), UNO_QUERY ); + Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString("com.sun.star.document.TypeDetection")), UNO_QUERY ); if (!xDetection.is()) return ERRCODE_ABORT; @@ -433,6 +433,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c ::rtl::OUString sURL( rMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInStream = rMedium.GetInputStream(); + rtl::OUString aFilterName; // stream exists => deep detection (with preselection ... if possible) if (xInStream.is()) @@ -454,6 +455,13 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > lDescriptor = aDescriptor.getAsConstPropertyValueList(); sTypeName = xDetection->queryTypeByDescriptor(lDescriptor, sal_True); // lDescriptor is used as In/Out param ... dont use aDescriptor.getAsConstPropertyValueList() directly! + + for (sal_Int32 i = 0; i < lDescriptor.getLength(); ++i) + { + if (lDescriptor[i].Name == "FilterName") + // Type detection picked a preferred filter for this format. + aFilterName = lDescriptor[i].Value.get<rtl::OUString>(); + } } // no stream exists => try flat detection without preselection as fallback else @@ -461,16 +469,25 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c if (!sTypeName.isEmpty()) { - // detect filter by given type - // In case of this matcher is bound to a particular document type: - // If there is no acceptable type for this document at all, the type detection has possibly returned something else. - // The DocumentService property is only a preselection, and all preselections are considered as optional! - // This "wrong" type will be sorted out now because we match only allowed filters to the detected type - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > lQuery(1); - lQuery[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); - lQuery[0].Value <<= sTypeName; - - const SfxFilter* pFilter = GetFilterForProps(lQuery, nMust, nDont); + const SfxFilter* pFilter = NULL; + if (!aFilterName.isEmpty()) + // Type detection returned a suitable filter for this. Use it. + pFilter = SfxFilter::GetFilterByName(aFilterName); + + if (!pFilter) + { + // detect filter by given type + // In case of this matcher is bound to a particular document type: + // If there is no acceptable type for this document at all, the type detection has possibly returned something else. + // The DocumentService property is only a preselection, and all preselections are considered as optional! + // This "wrong" type will be sorted out now because we match only allowed filters to the detected type + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > lQuery(1); + lQuery[0].Name = ::rtl::OUString("Name"); + lQuery[0].Value <<= sTypeName; + + pFilter = GetFilterForProps(lQuery, nMust, nDont); + } + if (pFilter) { *ppFilter = pFilter; @@ -490,7 +507,7 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter ) if ( pFilter->GetFilterFlags() & SFX_FILTER_MUSTINSTALL ) { // Here could a re-installation be offered - String aText( SfxResId( STR_FILTER_NOT_INSTALLED ) ); + String aText( SfxResId(STR_FILTER_NOT_INSTALLED).toString() ); aText.SearchAndReplaceAscii( "$(FILTER)", pFilter->GetUIName() ); QueryBox aQuery( NULL, WB_YES_NO | WB_DEF_YES, aText ); short nRet = aQuery.Execute(); @@ -508,7 +525,7 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter ) } else if ( pFilter->GetFilterFlags() & SFX_FILTER_CONSULTSERVICE ) { - String aText( SfxResId( STR_FILTER_CONSULT_SERVICE ) ); + String aText( SfxResId(STR_FILTER_CONSULT_SERVICE).toString() ); aText.SearchAndReplaceAscii( "$(FILTER)", pFilter->GetUIName() ); InfoBox ( NULL, aText ).Execute(); return sal_False; @@ -610,7 +627,7 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno: ::rtl::OUString aValue; // try to get the preferred filter (works without loading all filters!) - if ( (aProps[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter"))] >>= aValue) && !aValue.isEmpty() ) + if ( (aProps[::rtl::OUString("PreferredFilter")] >>= aValue) && !aValue.isEmpty() ) { const SfxFilter* pFilter = SfxFilter::GetFilterByName( aValue ); if ( !pFilter || (pFilter->GetFilterFlags() & nMust) != nMust || (pFilter->GetFilterFlags() & nDont ) ) @@ -621,11 +638,11 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno: if ( !m_rImpl.aName.isEmpty() ) { // if this is not the global FilterMatcher: check if filter matches the document type - if ( pFilter->GetServiceName() != String(m_rImpl.aName) ) + if ( pFilter->GetServiceName() != m_rImpl.aName ) { // preferred filter belongs to another document type; now we must search the filter m_rImpl.InitForIterating(); - aProps[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"))] >>= aValue; + aProps[::rtl::OUString("Name")] >>= aValue; pFilter = GetFilter4EA( aValue, nMust, nDont ); if ( pFilter ) return pFilter; @@ -658,7 +675,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const ::rtl::OUString& rMedia } com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); + aSeq[0].Name = ::rtl::OUString("MediaType"); aSeq[0].Value <<= rMediaType; return GetFilterForProps( aSeq, nMust, nDont ); } @@ -687,7 +704,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4EA( const String& rType,SfxFilterFl } com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); + aSeq[0].Name = ::rtl::OUString("Name"); aSeq[0].Value <<= ::rtl::OUString( rType ); return GetFilterForProps( aSeq, nMust, nDont ); } @@ -726,7 +743,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const String& rExt, SfxF sExt.Erase(0,1); com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")); + aSeq[0].Name = ::rtl::OUString("Extensions"); ::com::sun::star::uno::Sequence < ::rtl::OUString > aExts(1); aExts[0] = sExt; aSeq[0].Value <<= aExts; @@ -740,7 +757,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4ClipBoardId( sal_uInt32 nId, SfxFil com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); ::rtl::OUString aName = SotExchange::GetFormatName( nId ); - aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ClipboardFormat")); + aSeq[0].Name = ::rtl::OUString("ClipboardFormat"); aSeq[0].Value <<= aName; return GetFilterForProps( aSeq, nMust, nDont ); } diff --git a/sfx2/source/bastyp/fltfnc.src b/sfx2/source/bastyp/fltfnc.src index 4203163eceeb..28bc41840be1 100644 --- a/sfx2/source/bastyp/fltfnc.src +++ b/sfx2/source/bastyp/fltfnc.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ // include --------------------------------------------------------------- #include <sfx2/sfx.hrc> @@ -38,38 +29,3 @@ String STR_FILTER_CONSULT_SERVICE { Text [ en-US ] = "The selected filter $(FILTER) is not included in your edition.\nYou can find information about orders on our homepage."; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 300eac3aed9c..97b580a34054 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -26,8 +26,6 @@ * ************************************************************************/ - -#include <svl/inetdef.hxx> #include "svtools/htmlkywd.hxx" #include <rtl/tencinfo.h> @@ -107,7 +105,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL, if( pCharSet ) { - String aContentType = String::CreateFromAscii( sHTML_MIME_text_html ); + String aContentType = rtl::OUString(sHTML_MIME_text_html); aContentType.AppendAscii( pCharSet ); OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_content_type, aContentType, sal_True, eDestEnc, pNonConvertableChars ); @@ -146,8 +144,8 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL, } // Who we are - String sGenerator( SfxResId( STR_HTML_GENERATOR ) ); - ::rtl::OUString os( RTL_CONSTASCII_USTRINGPARAM("$_OS") ); + String sGenerator( SfxResId(STR_HTML_GENERATOR).toString() ); + ::rtl::OUString os( "$_OS" ); ::rtl::Bootstrap::expandMacros(os); sGenerator.SearchAndReplaceAscii( "%1", os ); OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_generator, sGenerator, sal_False, eDestEnc, pNonConvertableChars ); @@ -227,7 +225,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL, uno::Reference < script::XTypeConverter > xConverter( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))), + ::rtl::OUString("com.sun.star.script.Converter")), uno::UNO_QUERY_THROW ); uno::Reference<beans::XPropertySet> xUserDefinedProps( i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW); @@ -267,7 +265,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( { rtl::OStringBuffer sOut; ::rtl::OUString aStr; - uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameURL")) ); + uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString("FrameURL") ); if ( (aAny >>= aStr) && !aStr.isEmpty() ) { String aURL = INetURLObject( aStr ).GetMainURL( INetURLObject::DECODE_TO_IURI ); @@ -283,7 +281,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( } } - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameName")) ); + aAny = xSet->getPropertyValue( ::rtl::OUString("FrameName") ); if ( (aAny >>= aStr) && !aStr.isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name) @@ -294,13 +292,13 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( } sal_Int32 nVal = SIZE_NOT_SET; - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginWidth")) ); + aAny = xSet->getPropertyValue( ::rtl::OUString("FrameMarginWidth") ); if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_marginwidth) .append('=').append(nVal); } - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginHeight")) ); + aAny = xSet->getPropertyValue( ::rtl::OUString("FrameMarginHeight") ); if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_marginheight) @@ -308,10 +306,10 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( } sal_Bool bVal = sal_True; - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsAutoScroll")) ); + aAny = xSet->getPropertyValue( ::rtl::OUString("FrameIsAutoScroll") ); if ( (aAny >>= bVal) && !bVal ) { - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsScrollingMode")) ); + aAny = xSet->getPropertyValue( ::rtl::OUString("FrameIsScrollingMode") ); if ( aAny >>= bVal ) { const sal_Char *pStr = bVal ? sHTML_SC_yes : sHTML_SC_no; @@ -321,10 +319,10 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( } // frame border (MS+Netscape-Extension) - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsAutoBorder")) ); + aAny = xSet->getPropertyValue( ::rtl::OUString("FrameIsAutoBorder") ); if ( (aAny >>= bVal) && !bVal ) { - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsBorder")) ); + aAny = xSet->getPropertyValue( ::rtl::OUString("FrameIsBorder") ); if ( aAny >>= bVal ) { const char* pStr = bVal ? sHTML_SC_yes : sHTML_SC_no; diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index 5da2d95414ef..24eb85640796 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -79,7 +79,7 @@ void AppendDateTime_Impl( const util::DateTime rDT, DateTime aDT( DateTime::EMPTY ); CONVERT_DATETIME( rDT, aDT ); String aDateStr = rWrapper.getDate( aDT ); - aDateStr += String::CreateFromAscii( ", " ); + aDateStr += rtl::OUString(", "); aDateStr += rWrapper.getTime( aDT ); rRow += aDateStr; } @@ -96,9 +96,9 @@ uno::Sequence < OUString > SfxContentHelper::GetResultSet( const String& rURL ) uno::Reference< ucb::XDynamicResultSet > xDynResultSet; uno::Sequence< OUString > aProps(3); OUString* pProps = aProps.getArray(); - pProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); - pProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM("ContentType")); - pProps[2] = OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")); + pProps[0] = "Title"; + pProps[1] = "ContentType"; + pProps[2] = "IsFolder"; try { @@ -180,14 +180,14 @@ uno::Sequence< OUString > SfxContentHelper::GetHelpTreeViewContents( const Strin { uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); uno::Reference< task::XInteractionHandler > xInteractionHandler = uno::Reference< task::XInteractionHandler > ( - xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler") ) ), uno::UNO_QUERY ); + xFactory->createInstance( "com.sun.star.task.InteractionHandler" ), uno::UNO_QUERY ); ::ucbhelper::Content aCnt( rURL, new ::ucbhelper::CommandEnvironment( xInteractionHandler, uno::Reference< ucb::XProgressHandler >() ) ); uno::Reference< sdbc::XResultSet > xResultSet; uno::Sequence< OUString > aProps(2); OUString* pProps = aProps.getArray(); - pProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); - pProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")); + pProps[0] = "Title"; + pProps[1] = "IsFolder"; try { @@ -264,7 +264,7 @@ String SfxContentHelper::GetActiveHelpString( const String& rURL ) { uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); uno::Reference< task::XInteractionHandler > xInteractionHandler = uno::Reference< task::XInteractionHandler > ( - xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler") ) ), uno::UNO_QUERY ); + xFactory->createInstance( "com.sun.star.task.InteractionHandler" ), uno::UNO_QUERY ); ::ucbhelper::Content aCnt( rURL, new ::ucbhelper::CommandEnvironment( xInteractionHandler, uno::Reference< ucb::XProgressHandler >() ) ); // open the "active help" stream uno::Reference< io::XInputStream > xStream = aCnt.openStream(); @@ -298,7 +298,7 @@ sal_Bool SfxContentHelper::IsHelpErrorDocument( const String& rURL ) { ::ucbhelper::Content aCnt( INetURLObject( rURL ).GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); - if ( !( aCnt.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsErrorDocument")) ) >>= bRet ) ) + if ( !( aCnt.getPropertyValue( "IsErrorDocument" ) >>= bRet ) ) { SAL_WARN( "sfx2.bastyp", "Property 'IsErrorDocument' is missing" ); } @@ -321,7 +321,7 @@ sal_uIntPtr SfxContentHelper::GetSize( const String& rContent ) try { ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); - aCnt.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Size")) ) >>= nTemp; + aCnt.getPropertyValue( "Size" ) >>= nTemp; } catch( const ucb::CommandAbortedException& ) { diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx index f31b125c25da..d48c8cdf99de 100644 --- a/sfx2/source/bastyp/progress.cxx +++ b/sfx2/source/bastyp/progress.cxx @@ -68,7 +68,6 @@ struct SfxProgress_Impl sal_Bool bWaitMode; sal_Bool bAllowRescheduling; sal_Bool bRunning; - sal_Bool bIsStatusText; SfxProgress* pActiveProgress; SfxObjectShellRef xObjSh; @@ -157,7 +156,6 @@ SfxProgress::SfxProgress pImp->nMax = nRange; pImp->bLocked = sal_False; pImp->bWaitMode = bWait; - pImp->bIsStatusText = sal_False; pImp->nCreate = Get10ThSec(); pImp->nNextReschedule = pImp->nCreate; DBG( DbgOutf( "SfxProgress: created for '%s' at %luds", @@ -188,9 +186,6 @@ SfxProgress::~SfxProgress() Stop(); if ( pImp->xStatusInd.is() ) pImp->xStatusInd->end(); - - if( pImp->bIsStatusText == sal_True ) - GetpApp()->HideStatusText( ); delete pImp; } @@ -256,7 +251,6 @@ long TimeOut_Impl( void*, void* pArgV ) Timer *pArg = (Timer*)pArgV; if( Time::GetSystemTicks() - nLastTime > 3000 ) { - GetpApp()->HideStatusText(); nLastTime = 0; delete pArg; } diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 6a3fee662876..51d597f6164c 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -242,7 +242,7 @@ void SfxHTMLParser::StartFileDownload( const String& rURL, if( pDLMedium ) return; - pDLMedium = new SfxMedium( rURL, SFX_STREAM_READONLY, sal_False ); + pDLMedium = new SfxMedium( rURL, SFX_STREAM_READONLY ); if( pSh ) { // Register the medium, so that it can be stopped. diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx index 4f693a1bb269..fd2e6fee2c71 100644 --- a/sfx2/source/config/evntconf.cxx +++ b/sfx2/source/config/evntconf.cxx @@ -169,17 +169,17 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro ) uno::Sequence < beans::PropertyValue > aProperties(3); beans::PropertyValue *pValues = aProperties.getArray(); - ::rtl::OUString aType(RTL_CONSTASCII_USTRINGPARAM( STAR_BASIC )); + ::rtl::OUString aType(STAR_BASIC ); ::rtl::OUString aLib = pMacro->GetLibName(); ::rtl::OUString aMacro = pMacro->GetMacName(); - pValues[ 0 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_EVENT_TYPE )); + pValues[ 0 ].Name = ::rtl::OUString(PROP_EVENT_TYPE ); pValues[ 0 ].Value <<= aType; - pValues[ 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_LIBRARY )); + pValues[ 1 ].Name = ::rtl::OUString(PROP_LIBRARY ); pValues[ 1 ].Value <<= aLib; - pValues[ 2 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_MACRO_NAME )); + pValues[ 2 ].Name = ::rtl::OUString(PROP_MACRO_NAME ); pValues[ 2 ].Value <<= aMacro; aEventData <<= aProperties; @@ -192,10 +192,10 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro ) ::rtl::OUString aLib = pMacro->GetLibName(); ::rtl::OUString aMacro = pMacro->GetMacName(); - pValues[ 0 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_EVENT_TYPE )); + pValues[ 0 ].Name = ::rtl::OUString(PROP_EVENT_TYPE ); pValues[ 0 ].Value <<= aLib; - pValues[ 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_SCRIPT )); + pValues[ 1 ].Name = ::rtl::OUString(PROP_SCRIPT ); pValues[ 1 ].Value <<= aMacro; aEventData <<= aProperties; @@ -207,10 +207,10 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro ) ::rtl::OUString aMacro = pMacro->GetMacName(); - pValues[ 0 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_EVENT_TYPE )); - pValues[ 0 ].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT)); + pValues[ 0 ].Name = ::rtl::OUString(PROP_EVENT_TYPE ); + pValues[ 0 ].Value <<= ::rtl::OUString(SVX_MACRO_LANGUAGE_JAVASCRIPT); - pValues[ 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_MACRO_NAME )); + pValues[ 1 ].Name = ::rtl::OUString(PROP_MACRO_NAME ); pValues[ 1 ].Value <<= aMacro; aEventData <<= aProperties; @@ -241,7 +241,7 @@ void PropagateEvent_Impl( SfxObjectShell *pDoc, rtl::OUString aEventName, const { xSupplier = uno::Reference < document::XEventsSupplier > ( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster"))), uno::UNO_QUERY ); + rtl::OUString("com.sun.star.frame.GlobalEventBroadcaster")), uno::UNO_QUERY ); } if ( xSupplier.is() ) diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index a4de3f3efc86..f45d746510ac 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -39,6 +39,7 @@ #include <svl/intitem.hxx> #include <svl/stritem.hxx> #include <svl/visitem.hxx> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> #include <com/sun/star/frame/XDispatch.hpp> @@ -205,8 +206,15 @@ struct SfxFoundCache_Impl //-------------------------------------------------------------------------- -SV_DECL_PTRARR_SORT_DEL(SfxFoundCacheArr_Impl, SfxFoundCache_Impl*, 16) -SV_IMPL_OP_PTRARR_SORT(SfxFoundCacheArr_Impl, SfxFoundCache_Impl*); +class SfxFoundCacheArr_Impl : public std::vector<SfxFoundCache_Impl*> +{ +public: + ~SfxFoundCacheArr_Impl() + { + for(const_iterator it = begin(); it != end(); ++it) + delete *it; + } +}; //========================================================================== @@ -329,14 +337,14 @@ void SfxBindings::DeleteControllers_Impl() if( pImp->pUnoCtrlArr ) { - sal_uInt16 nCtrlCount = pImp->pUnoCtrlArr->Count(); + sal_uInt16 nCtrlCount = pImp->pUnoCtrlArr->size(); for ( sal_uInt16 n=nCtrlCount; n>0; n-- ) { SfxUnoControllerItem *pCtrl = (*pImp->pUnoCtrlArr)[n-1]; pCtrl->ReleaseBindings(); } - DBG_ASSERT( !pImp->pUnoCtrlArr->Count(), "Do not remove UnoControllerItems!" ); + DBG_ASSERT( !pImp->pUnoCtrlArr->size(), "Do not remove UnoControllerItems!" ); DELETEZ( pImp->pUnoCtrlArr ); } } @@ -411,7 +419,7 @@ void SfxBindings::Update_Impl // Post Status const SfxInterface *pInterface = rDispat.GetShell(pMsgServer->GetShellLevel())->GetInterface(); - for ( sal_uInt16 nPos = 0; nPos < aFound.Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < aFound.size(); ++nPos ) { const SfxFoundCache_Impl *pFound = aFound[nPos]; sal_uInt16 nWhich = pFound->nWhichId; @@ -1367,9 +1375,9 @@ SfxItemSet* SfxBindings::CreateSet_Impl pFnc = pRealSlot->GetStateFnc(); // the RealSlot is always on - const SfxFoundCache_Impl *pFound = new SfxFoundCache_Impl( + SfxFoundCache_Impl *pFound = new SfxFoundCache_Impl( pRealSlot->GetSlotId(), pRealSlot->GetWhich(rPool), pRealSlot, pCache ); - rFound.Insert( pFound ); + rFound.push_back( pFound ); sal_uInt16 nSlot = pRealSlot->GetSlotId(); if ( !(nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) ) @@ -1434,25 +1442,25 @@ SfxItemSet* SfxBindings::CreateSet_Impl if ( bInsert && bSameMethod ) { - const SfxFoundCache_Impl *pFoundCache = new SfxFoundCache_Impl( + SfxFoundCache_Impl *pFoundCache = new SfxFoundCache_Impl( pSibling->GetSlotId(), pSibling->GetWhich(rPool), pSibling, pSiblingCache ); - rFound.Insert( pFoundCache ); + rFound.push_back( pFoundCache ); } pSibling = pSibling->GetNextSlot(); } // Create a Set from the ranges - sal_uInt16 *pRanges = new sal_uInt16[rFound.Count() * 2 + 1]; + sal_uInt16 *pRanges = new sal_uInt16[rFound.size() * 2 + 1]; int j = 0; sal_uInt16 i = 0; - while ( i < rFound.Count() ) + while ( i < rFound.size() ) { pRanges[j++] = rFound[i]->nWhichId; // consecutive numbers - for ( ; i < rFound.Count()-1; ++i ) + for ( ; i < rFound.size()-1; ++i ) if ( rFound[i]->nWhichId+1 != rFound[i+1]->nWhichId ) break; pRanges[j++] = rFound[i++]->nWhichId; @@ -2086,17 +2094,18 @@ void SfxBindings::RegisterUnoController_Impl( SfxUnoControllerItem* pControl ) { if ( !pImp->pUnoCtrlArr ) pImp->pUnoCtrlArr = new SfxUnoControllerArr_Impl; - pImp->pUnoCtrlArr->Insert( pControl, pImp->pUnoCtrlArr->Count() ); + pImp->pUnoCtrlArr->push_back( pControl ); } void SfxBindings::ReleaseUnoController_Impl( SfxUnoControllerItem* pControl ) { if ( pImp->pUnoCtrlArr ) { - sal_uInt16 nPos = pImp->pUnoCtrlArr->GetPos( pControl ); - if ( nPos != 0xFFFF ) + SfxUnoControllerArr_Impl::iterator it = std::find( + pImp->pUnoCtrlArr->begin(), pImp->pUnoCtrlArr->end(), pControl ); + if ( it != pImp->pUnoCtrlArr->end() ) { - pImp->pUnoCtrlArr->Remove( nPos ); + pImp->pUnoCtrlArr->erase( it ); return; } } @@ -2109,7 +2118,7 @@ void SfxBindings::InvalidateUnoControllers_Impl() { if ( pImp->pUnoCtrlArr ) { - sal_uInt16 nCount = pImp->pUnoCtrlArr->Count(); + sal_uInt16 nCount = pImp->pUnoCtrlArr->size(); for ( sal_uInt16 n=nCount; n>0; n-- ) { SfxUnoControllerItem *pCtrl = (*pImp->pUnoCtrlArr)[n-1]; @@ -2189,7 +2198,7 @@ sal_Bool SfxBindings::ExecuteCommand_Impl( const String& rCommand ) { ::com::sun::star::util::URL aURL; aURL.Complete = rCommand; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); + Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aURL ); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp = pImp->xProv->queryDispatch( aURL, ::rtl::OUString(), 0 ); if ( xDisp.is() ) diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 8df57ea1b6b9..1e1bd682a60e 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -71,14 +71,11 @@ #include <deque> #include <boost/ptr_container/ptr_vector.hpp> -namespace css = ::com::sun::star; - DBG_NAME(SfxDispatcherFlush) DBG_NAME(SfxDispatcherFillState) typedef boost::ptr_vector<SfxRequest> SfxRequestPtrArray; -SV_IMPL_PTRARR( SfxItemPtrArray, SfxPoolItemPtr ); DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 ); struct SfxToDo_Impl @@ -226,7 +223,7 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest if ( xSet.is() ) { - com::sun::star::uno::Any aProp = xSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DispatchRecorderSupplier"))); + com::sun::star::uno::Any aProp = xSet->getPropertyValue(::rtl::OUString("DispatchRecorderSupplier")); com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorderSupplier > xSupplier; com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder; aProp >>= xSupplier; @@ -1275,11 +1272,11 @@ void SfxDispatcher::SetMenu_Impl() if ( xPropSet.is() ) { com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; - com::sun::star::uno::Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + com::sun::star::uno::Any aValue = xPropSet->getPropertyValue( rtl::OUString( "LayoutManager" )); aValue >>= xLayoutManager; if ( xLayoutManager.is() ) { - rtl::OUString aMenuBarURL( RTL_CONSTASCII_USTRINGPARAM( "private:resource/menubar/menubar" )); + rtl::OUString aMenuBarURL( "private:resource/menubar/menubar" ); if ( !xLayoutManager->isElementVisible( aMenuBarURL ) ) xLayoutManager->createElement( aMenuBarURL ); } @@ -1339,7 +1336,7 @@ void SfxDispatcher::Update_Impl( sal_Bool bForce ) { try { - com::sun::star::uno::Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )) ); + com::sun::star::uno::Any aValue = xPropSet->getPropertyValue( rtl::OUString( "LayoutManager" ) ); aValue >>= xLayoutManager; } catch (const com::sun::star::uno::Exception&) @@ -2191,7 +2188,7 @@ void SfxDispatcher::HideUI( sal_Bool bHide ) if ( xPropSet.is() ) { com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; - com::sun::star::uno::Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + com::sun::star::uno::Any aValue = xPropSet->getPropertyValue( rtl::OUString( "LayoutManager" )); aValue >>= xLayoutManager; if ( xLayoutManager.is() ) xLayoutManager->setVisible( !bHide ); diff --git a/sfx2/source/control/minfitem.cxx b/sfx2/source/control/minfitem.cxx index 5dc16b4fc28d..105752d7313a 100644 --- a/sfx2/source/control/minfitem.cxx +++ b/sfx2/source/control/minfitem.cxx @@ -1,33 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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 --------------------------------------------------------------- + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "sfx2/minfitem.hxx" diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx index 76b0e5e14dee..e72e1ea22159 100644 --- a/sfx2/source/control/msgpool.cxx +++ b/sfx2/source/control/msgpool.cxx @@ -181,13 +181,13 @@ String SfxSlotPool::SeekGroup( sal_uInt16 nNo ) if ( !aResId.GetResMgr()->IsAvailable(aResId) ) { OSL_FAIL( "GroupId-Name not defined in SFX!" ); - return String(); + return rtl::OUString(); } - return String( aResId ); + return aResId.toString(); } - return String(); + return rtl::OUString(); } diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index f6409c56eb0c..852fb40f9a0a 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -432,7 +432,7 @@ SfxObjectUI_Impl* CreateObjectBarUI_Impl( sal_uInt16 nPos, const ResId& rResId, if ( !aResId.GetResMgr() || !aResId.GetResMgr()->IsAvailable(aResId) ) pUI->pName = new String (DEFINE_CONST_UNICODE("NoName")); else - pUI->pName = new String(aResId); + pUI->pName = new String(aResId.toString()); } else pUI->pName = new String(*pStr); diff --git a/sfx2/source/control/querystatus.cxx b/sfx2/source/control/querystatus.cxx index 5d6c2ee2117c..4c40279578a3 100644 --- a/sfx2/source/control/querystatus.cxx +++ b/sfx2/source/control/querystatus.cxx @@ -38,6 +38,7 @@ #include <comphelper/processfactory.hxx> #include <osl/mutex.hxx> #include <vcl/svapp.hxx> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/status/ItemStatus.hpp> #include <com/sun/star/frame/status/ItemState.hpp> @@ -95,8 +96,7 @@ SfxQueryStatus_Impl::SfxQueryStatus_Impl( const Reference< XDispatchProvider >& m_nSlotID( nSlotId ) { m_aCommand.Complete = rCommand; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); + Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( m_aCommand ); if ( rDispatchProvider.is() ) m_xDispatch = rDispatchProvider->queryDispatch( m_aCommand, rtl::OUString(), 0 ); diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 2bdc5d16e3a0..ccc6b1bb9101 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -26,13 +26,12 @@ * ************************************************************************/ - - #include <com/sun/star/frame/DispatchStatement.hpp> #include <com/sun/star/container/XIndexReplace.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> #include <svl/itemiter.hxx> @@ -40,6 +39,7 @@ #include <svl/itempool.hxx> #include <svtools/itemdel.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <svl/smplhint.hxx> @@ -341,7 +341,7 @@ void SfxRequest_Impl::Record */ { - String aCommand = String::CreateFromAscii(".uno:"); + String aCommand = rtl::OUString(".uno:"); aCommand.AppendAscii( pSlot->GetUnoName() ); ::rtl::OUString aCmd( aCommand ); if(xRecorder.is()) @@ -373,9 +373,7 @@ void SfxRequest_Impl::Record ::comphelper::getProcessServiceFactory(), com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference< com::sun::star::util::XURLTransformer > xTransform( - xFactory->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), - com::sun::star::uno::UNO_QUERY); + uno::Reference< util::XURLTransformer > xTransform( util::URLTransformer::create( ::comphelper::ComponentContext(xFactory).getUNOContext() ) ); com::sun::star::util::URL aURL; aURL.Complete = aCmd; @@ -826,7 +824,7 @@ com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > SfxRe if(xSet.is()) { - com::sun::star::uno::Any aProp = xSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DispatchRecorderSupplier"))); + com::sun::star::uno::Any aProp = xSet->getPropertyValue(rtl::OUString("DispatchRecorderSupplier")); com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorderSupplier > xSupplier; aProp >>= xSupplier; if(xSupplier.is()) diff --git a/sfx2/source/control/sfxstatuslistener.cxx b/sfx2/source/control/sfxstatuslistener.cxx index 0fa06828e1ec..9c580f47fae6 100644 --- a/sfx2/source/control/sfxstatuslistener.cxx +++ b/sfx2/source/control/sfxstatuslistener.cxx @@ -38,6 +38,7 @@ #include <comphelper/processfactory.hxx> #include <osl/mutex.hxx> #include <vcl/svapp.hxx> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/frame/status/ItemStatus.hpp> @@ -66,8 +67,7 @@ SfxStatusListener::SfxStatusListener( const Reference< XDispatchProvider >& rDis m_xDispatchProvider( rDispatchProvider ) { m_aCommand.Complete = rCommand; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); + Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( m_aCommand ); if ( rDispatchProvider.is() ) m_xDispatch = rDispatchProvider->queryDispatch( m_aCommand, rtl::OUString(), 0 ); diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index a9b3f5cfc67c..838c59a7cd80 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -61,9 +61,15 @@ DBG_NAME(SfxShell) TYPEINIT0(SfxShell); //==================================================================== -typedef SfxSlot* SfxSlotPtr; -SV_DECL_PTRARR_DEL( SfxVerbSlotArr_Impl, SfxSlotPtr, 4 ) -SV_IMPL_PTRARR( SfxVerbSlotArr_Impl, SfxSlotPtr); +class SfxVerbSlotArr_Impl : public std::vector<SfxSlot*> +{ +public: + ~SfxVerbSlotArr_Impl() + { + for(const_iterator it = begin(); it != end(); ++it) + delete *it; + } +}; using namespace com::sun::star; @@ -73,7 +79,7 @@ using namespace com::sun::star; struct SfxShell_Impl: public SfxBroadcaster { String aObjectName; // Name of Sbx-Objects - SfxItemArray_Impl aItems; // Data exchange on Item level + SfxItemPtrMap aItems; // Data exchange on Item level SfxViewShell* pViewSh; // SfxViewShell if Shell is // ViewFrame/ViewShell/SubShell list SfxViewFrame* pFrame; // Frame, if <UI-active> @@ -299,9 +305,9 @@ const SfxPoolItem* SfxShell::GetItem */ { - for ( sal_uInt16 nPos = 0; nPos < pImp->aItems.Count(); ++nPos ) - if ( pImp->aItems.GetObject(nPos)->Which() == nSlotId ) - return pImp->aItems.GetObject(nPos); + SfxItemPtrMap::iterator it = pImp->aItems.find( nSlotId ); + if( it != pImp->aItems.end() ) + return it->second; return 0; } @@ -334,40 +340,39 @@ void SfxShell::PutItem "items with Which-Ids aren't allowed here" ); // MSC made a mess here of WNT/W95, beware of changes - const SfxPoolItem *pItem = rItem.Clone(); - SfxPoolItemHint aItemHint( (SfxPoolItem*) pItem ); + SfxPoolItem *pItem = rItem.Clone(); + SfxPoolItemHint aItemHint( pItem ); const sal_uInt16 nWhich = rItem.Which(); - SfxPoolItem **ppLoopItem = (SfxPoolItem**) pImp->aItems.GetData(); - sal_uInt16 nPos; - for ( nPos = 0; nPos < pImp->aItems.Count(); ++nPos, ++ppLoopItem ) + + SfxItemPtrMap::iterator it = pImp->aItems.find( nWhich ); + if( it != pImp->aItems.end() ) { - if ( (*ppLoopItem)->Which() == nWhich ) + SfxPoolItem *pLoopItem = it->second; + // Replace Item + delete pLoopItem; + it->second = pItem; + + // if active, notify Bindings + SfxDispatcher *pDispat = GetDispatcher(); + if ( pDispat ) { - // Replace Item - delete *ppLoopItem; - pImp->aItems.Remove(nPos); - pImp->aItems.Insert( (SfxPoolItemPtr) pItem, nPos ); - - // if active, notify Bindings - SfxDispatcher *pDispat = GetDispatcher(); - if ( pDispat ) + SfxBindings* pBindings = pDispat->GetBindings(); + pBindings->Broadcast( aItemHint ); + sal_uInt16 nSlotId = nWhich; //pItem->GetSlotId(); + SfxStateCache* pCache = pBindings->GetStateCache( nSlotId ); + if ( pCache ) { - SfxBindings* pBindings = pDispat->GetBindings(); - pBindings->Broadcast( aItemHint ); - sal_uInt16 nSlotId = nWhich; //pItem->GetSlotId(); - SfxStateCache* pCache = pBindings->GetStateCache( nSlotId ); - if ( pCache ) - { - pCache->SetState( SFX_ITEM_AVAILABLE, pItem->Clone(), sal_True ); - pCache->SetCachedState( sal_True ); - } + pCache->SetState( SFX_ITEM_AVAILABLE, pItem->Clone(), sal_True ); + pCache->SetCachedState( sal_True ); } - return; } + return; + } + else + { + Broadcast( aItemHint ); + pImp->aItems[ pItem->Which() ] = pItem; } - - Broadcast( aItemHint ); - pImp->aItems.Insert((SfxPoolItemPtr)pItem, nPos ); } //-------------------------------------------------------------------- @@ -979,7 +984,7 @@ void SfxShell::SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::em { SfxBindings *pBindings = pViewSh->GetViewFrame()->GetDispatcher()->GetBindings(); - sal_uInt16 nCount = pImp->aSlotArr.Count(); + sal_uInt16 nCount = pImp->aSlotArr.size(); for (sal_uInt16 n1=0; n1<nCount ; n1++) { sal_uInt16 nId = SID_VERB_START + n1; @@ -1013,16 +1018,16 @@ void SfxShell::SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::em pNewSlot->pFirstArgDef = 0; pNewSlot->pUnoName = 0; - if (pImp->aSlotArr.Count()) + if (!pImp->aSlotArr.empty()) { - SfxSlot *pSlot = (pImp->aSlotArr)[0]; + SfxSlot *pSlot = pImp->aSlotArr[0]; pNewSlot->pNextSlot = pSlot->pNextSlot; pSlot->pNextSlot = pNewSlot; } else pNewSlot->pNextSlot = pNewSlot; - pImp->aSlotArr.Insert(pNewSlot, (sal_uInt16) n); + pImp->aSlotArr.insert(pImp->aSlotArr.begin() + (sal_uInt16) n, pNewSlot); } pImp->aVerbList = aVerbs; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 005db6e6b1a4..a738a882e8ac 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -36,6 +36,7 @@ #include <svtools/javacontext.hxx> #include <svl/itempool.hxx> #include <tools/urlobj.hxx> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/frame/XFrameActionListener.hpp> @@ -67,6 +68,8 @@ #include <sfx2/msgpool.hxx> #include <sfx2/objsh.hxx> +#include <boost/scoped_ptr.hpp> + namespace css = ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; @@ -106,7 +109,7 @@ SfxUnoControllerItem::SfxUnoControllerItem( SfxControllerItem *pItem, SfxBinding DBG_ASSERT( !pCtrlItem || !pCtrlItem->IsBound(), "ControllerItem is incorrect!" ); aCommand.Complete = rCmd; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); + Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aCommand ); pBindings->RegisterUnoController_Impl( this ); } @@ -462,7 +465,7 @@ SfxDispatchController_Impl::SfxDispatchController_Impl( rtl::OStringBuffer aTmp(RTL_CONSTASCII_STRINGPARAM(".uno:")); aTmp.append(pUnoName); aDispatchURL.Complete = ::rtl::OStringToOUString(aTmp.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); - Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); + Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aDispatchURL ); } @@ -686,7 +689,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util // so we must retrieve this as an argument from the parsed URL lNewArgs.realloc( lNewArgs.getLength()+1 ); nMarkArg = lNewArgs.getLength()-1; - lNewArgs[nMarkArg].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Bookmark")); + lNewArgs[nMarkArg].Name = ::rtl::OUString("Bookmark"); lNewArgs[nMarkArg].Value <<= aURL.Mark; } @@ -725,16 +728,20 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util } eMapUnit = GetCoreMetric( pShell->GetPool(), GetId() ); - SfxAllItemSet aSet( pShell->GetPool() ); - TransformParameters( GetId(), lNewArgs, aSet, pSlot ); - if ( aSet.Count() ) + boost::scoped_ptr<SfxAllItemSet> xSet(new SfxAllItemSet(pShell->GetPool())); + TransformParameters(GetId(), lNewArgs, *xSet, pSlot); + if (xSet->Count()) { // execute with arguments - call directly - pItem = pDispatcher->Execute( GetId(), nCall, &aSet, &aInternalSet, nModifier ); + pItem = pDispatcher->Execute(GetId(), nCall, xSet.get(), &aInternalSet, nModifier); bSuccess = (pItem != NULL); } else { + // Be sure to delete this before we send a dispatch + // request, which will destroy the current shell. + xSet.reset(); + // execute using bindings, enables support for toggle/enum etc. SfxRequest aReq( GetId(), nCall, pShell->GetPool() ); aReq.SetModifier( nModifier ); diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx index 1dfecd0fe96c..e9f7852669c5 100644 --- a/sfx2/source/dialog/alienwarn.cxx +++ b/sfx2/source/dialog/alienwarn.cxx @@ -153,7 +153,7 @@ void SfxAlienWarningDialog::InitSize() &m_aSaveODFBtn, &m_aKeepCurrentBtn, &m_aMoreInfoBtn, &m_aOptionLine, &m_aWarningOnBox }; Window** pCurrent = pWins; - for ( sal_uInt32 i = 0; i < SAL_N_ELEMENTS( pWins ); ++i, ++pCurrent ) + for ( sal_uInt32 i = 0; i < sizeof( pWins ) / sizeof( pWins[ 0 ] ); ++i, ++pCurrent ) { Point aNewPos = (*pCurrent)->GetPosPixel(); aNewPos.Y() -= nDelta; diff --git a/sfx2/source/dialog/alienwarn.hrc b/sfx2/source/dialog/alienwarn.hrc index 2b5ac2be8416..3093b4b4ad31 100644 --- a/sfx2/source/dialog/alienwarn.hrc +++ b/sfx2/source/dialog/alienwarn.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_ALIENWARN_HRC #define _SFX_ALIENWARN_HRC diff --git a/sfx2/source/dialog/alienwarn.src b/sfx2/source/dialog/alienwarn.src index 98d3372b2b30..7ac9c9f3b485 100644 --- a/sfx2/source/dialog/alienwarn.src +++ b/sfx2/source/dialog/alienwarn.src @@ -87,5 +87,3 @@ ModalDialog RID_DLG_ALIEN_WARNING Text [ en-US ] = "~Ask when not saving in ODF format"; }; }; - - diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 8cb8a0741492..4c4529abbdcc 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ - -// include --------------------------------------------------------------- - #include <stdlib.h> #include <vcl/fixed.hxx> #include <vcl/help.hxx> @@ -54,7 +51,7 @@ using namespace ::com::sun::star::uno; using namespace ::rtl; -#define USERITEM_NAME OUString(RTL_CONSTASCII_USTRINGPARAM("UserItem")) +#define USERITEM_NAME OUString("UserItem") class SfxModelessDialog_Impl : public SfxListener { diff --git a/sfx2/source/dialog/dialog.src b/sfx2/source/dialog/dialog.src index c39425510ae2..2ae47bac56bc 100644 --- a/sfx2/source/dialog/dialog.src +++ b/sfx2/source/dialog/dialog.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ // include --------------------------------------------------------------- #include <sfx2/sfx.hrc> diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index ba0d0c29d4a6..b45ce723714d 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -68,6 +68,7 @@ #include <sfx2/objsh.hxx> #include <sfx2/docfile.hxx> #include <comphelper/storagehelper.hxx> +#include <comphelper/string.hxx> #include <sfx2/sfx.hrc> #include "dinfdlg.hrc" @@ -122,7 +123,7 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes = sal_True, sal_B String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartExtraBytes ) { String aUnitStr = ' '; - aUnitStr += String( SfxResId(STR_BYTES) ); + aUnitStr += SfxResId(STR_BYTES).toString(); sal_uIntPtr nSize1 = nSize; sal_uIntPtr nSize2 = nSize1; sal_uIntPtr nMega = 1024 * 1024; @@ -135,7 +136,7 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE { nSize1 /= 1024; aUnitStr = ' '; - aUnitStr += String( SfxResId(STR_KB) ); + aUnitStr += SfxResId(STR_KB).toString(); fSize /= 1024; nDec = 0; } @@ -143,7 +144,7 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE { nSize1 /= nMega; aUnitStr = ' '; - aUnitStr += String( SfxResId(STR_MB) ); + aUnitStr += SfxResId(STR_MB).toString(); fSize /= nMega; nDec = 2; } @@ -151,7 +152,7 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE { nSize1 /= nGiga; aUnitStr = ' '; - aUnitStr += String( SfxResId(STR_GB) ); + aUnitStr += SfxResId(STR_GB).toString(); bGB = sal_True; fSize /= nGiga; nDec = 3; @@ -164,13 +165,13 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE { aSizeStr = ::rtl::math::doubleToUString( fSize, rtl_math_StringFormat_F, nDec, - rLocaleWrapper.getNumDecimalSep().GetChar(0) ); + rLocaleWrapper.getNumDecimalSep()[0] ); aSizeStr += aUnitStr; aSizeStr += DEFINE_CONST_UNICODE(" ("); aSizeStr += rLocaleWrapper.getNum( nSize2, 0 ); aSizeStr += ' '; - aSizeStr += String( SfxResId(STR_BYTES) ); + aSizeStr += SfxResId(STR_BYTES).toString(); aSizeStr += ')'; } else if ( bGB && bSmartExtraBytes ) @@ -193,9 +194,8 @@ String ConvertDateTime_Impl( const String& rName, String aStr( rWrapper.getDate( aD ) ); aStr += pDelim; aStr += rWrapper.getTime( aT, sal_True, sal_False ); - String aAuthor = rName; - aAuthor.EraseLeadingChars(); - if ( aAuthor.Len() ) + rtl::OUString aAuthor = comphelper::string::stripStart(rName, ' '); + if (!aAuthor.isEmpty()) { aStr += pDelim; aStr += aAuthor; @@ -801,14 +801,14 @@ SfxDocumentPage::SfxDocumentPage( Window* pParent, const SfxItemSet& rItemSet ) aTemplFt ( this, SfxResId( FT_TEMPL ) ), aTemplValFt ( this, SfxResId( FT_TEMPL_VAL ) ), - aUnknownSize ( SfxResId( STR_UNKNOWNSIZE ) ), - aMultiSignedStr ( SfxResId( STR_MULTSIGNED ) ), + aUnknownSize ( SfxResId( STR_UNKNOWNSIZE ).toString() ), + aMultiSignedStr ( SfxResId( STR_MULTSIGNED ).toString() ), bEnableUseUserData ( sal_False ), bHandleDelete ( sal_False ) { - aNameED.SetAccessibleName( String( SfxResId( EDIT_FILE_NAME ) ) ); + aNameED.SetAccessibleName( SfxResId( EDIT_FILE_NAME ).toString() ); FreeResource(); ImplUpdateSignatures(); ImplCheckPasswordState(); @@ -959,7 +959,7 @@ void SfxDocumentPage::ImplUpdateSignatures() s = aMultiSignedStr; else if ( aInfos.getLength() == 1 ) { - String aCN_Id( String::CreateFromAscii( "CN" ) ); + rtl::OUString aCN_Id("CN"); const security::DocumentSignatureInformation& rInfo = aInfos[ 0 ]; s = GetDateTimeString( rInfo.SignatureDate, rInfo.SignatureTime ); s.AppendAscii( ", " ); @@ -1107,7 +1107,7 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet ) INetURLObject aURL(aFile); aName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET ); if ( !aName.Len() || aURL.GetProtocol() == INET_PROT_PRIVATE ) - aName = String( SfxResId( STR_NONAME ) ); + aName = SfxResId( STR_NONAME ).toString(); aNameED.SetReadOnly( sal_True ); } else @@ -1140,7 +1140,7 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet ) String aDescription = SvFileInformationManager::GetDescription( INetURLObject(rMainURL) ); if ( aDescription.Len() == 0 ) - aDescription = String( SfxResId( STR_SFX_NEWOFFICEDOC ) ); + aDescription = SfxResId( STR_SFX_NEWOFFICEDOC ).toString(); aShowTypeFT.SetText( aDescription ); // determine location @@ -1214,7 +1214,7 @@ SfxInternetPage::SfxInternetPage( Window* pParent, const SfxItemSet& rItemSet ) aFTFrame ( this, SfxResId( FT_FRAME ) ), aCBFrame ( this, SfxResId( CB_FRAME ) ), - aForwardErrorMessg ( SfxResId( STR_FORWARD_ERRMSSG ) ), + aForwardErrorMessg ( SfxResId(STR_FORWARD_ERRMSSG).toString() ), pInfoItem ( NULL ), pFileDlg ( NULL ), eState ( S_Init ) @@ -1573,7 +1573,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent, aTitle += aFile; } else - aTitle += String( SfxResId( STR_NONAME ) ); + aTitle += SfxResId( STR_NONAME ).toString(); } else { @@ -1728,12 +1728,12 @@ void CustomPropertiesDurationField::SetDuration( const util::Duration& rDuration m_aDuration = rDuration; String sText(rDuration.Negative ? '-' : '+'); sText += m_pLine->m_sDurationFormat; - sText.SearchAndReplace(String::CreateFromAscii( "%1"), String::CreateFromInt32( rDuration.Years ) ); - sText.SearchAndReplace(String::CreateFromAscii( "%2"), String::CreateFromInt32( rDuration.Months ) ); - sText.SearchAndReplace(String::CreateFromAscii( "%3"), String::CreateFromInt32( rDuration.Days ) ); - sText.SearchAndReplace(String::CreateFromAscii( "%4"), String::CreateFromInt32( rDuration.Hours ) ); - sText.SearchAndReplace(String::CreateFromAscii( "%5"), String::CreateFromInt32( rDuration.Minutes) ); - sText.SearchAndReplace(String::CreateFromAscii( "%6"), String::CreateFromInt32( rDuration.Seconds) ); + sText.SearchAndReplace(rtl::OUString("%1"), String::CreateFromInt32( rDuration.Years ) ); + sText.SearchAndReplace(rtl::OUString("%2"), String::CreateFromInt32( rDuration.Months ) ); + sText.SearchAndReplace(rtl::OUString("%3"), String::CreateFromInt32( rDuration.Days ) ); + sText.SearchAndReplace(rtl::OUString("%4"), String::CreateFromInt32( rDuration.Hours ) ); + sText.SearchAndReplace(rtl::OUString("%5"), String::CreateFromInt32( rDuration.Minutes) ); + sText.SearchAndReplace(rtl::OUString("%6"), String::CreateFromInt32( rDuration.Seconds) ); SetText( sText ); } @@ -1777,7 +1777,7 @@ CustomPropertyLine::CustomPropertyLine( Window* pParent ) : m_aValueEdit ( pParent, SfxResId( SFX_ED_PROPERTY_VALUE ), this ), m_aDateField ( pParent, SfxResId( SFX_FLD_DATE), this), m_aTimeField ( pParent, SfxResId( SFX_FLD_TIME), this), - m_sDurationFormat( SfxResId( SFX_ST_DURATION_FORMAT )), + m_sDurationFormat( SfxResId( SFX_ST_DURATION_FORMAT ).toString() ), m_aDurationField( pParent, SfxResId( SFX_FLD_DURATION), this), m_aEditButton( pParent, SfxResId( SFX_PB_EDIT ), this), m_aYesNoButton ( pParent, SfxResId( SFX_WIN_PROPERTY_YESNO ) ), @@ -1831,9 +1831,9 @@ CustomPropertiesWindow::CustomPropertiesWindow( Window* pParent, const ResId& rR m_aBoxLoseFocusTimer.SetTimeoutHdl( LINK( this, CustomPropertiesWindow, BoxTimeoutHdl ) ); ResMgr* pResMgr = rResId.GetResMgr(); - m_aNameBox.SetAccessibleName( String( ResId( STR_HEADER_NAME, *pResMgr ) ) ); - m_aTypeBox.SetAccessibleName( String( ResId( STR_HEADER_TYPE, *pResMgr ) ) ); - m_aValueEdit.SetAccessibleName( String( ResId( STR_HEADER_VALUE, *pResMgr ) ) ); + m_aNameBox.SetAccessibleName( ResId( STR_HEADER_NAME, *pResMgr ).toString() ); + m_aTypeBox.SetAccessibleName( ResId( STR_HEADER_TYPE, *pResMgr ).toString() ); + m_aValueEdit.SetAccessibleName( ResId( STR_HEADER_VALUE, *pResMgr ).toString() ); } CustomPropertiesWindow::~CustomPropertiesWindow() @@ -2315,10 +2315,10 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId& const HeaderBarItemBits nHeadBits = HIB_VCENTER | HIB_FIXED | HIB_FIXEDPOS | HIB_LEFT; nWidth = nWidth / 4; ResMgr* pResMgr = rResId.GetResMgr(); - m_aHeaderBar.InsertItem( HI_NAME, String( ResId( STR_HEADER_NAME, *pResMgr ) ), nWidth, nHeadBits ); - m_aHeaderBar.InsertItem( HI_TYPE, String( ResId( STR_HEADER_TYPE, *pResMgr ) ), nWidth, nHeadBits ); - m_aHeaderBar.InsertItem( HI_VALUE, String( ResId( STR_HEADER_VALUE, *pResMgr ) ), nWidth, nHeadBits ); - m_aHeaderBar.InsertItem( HI_ACTION, String( ResId( STR_HEADER_ACTION, *pResMgr ) ), nWidth, nHeadBits ); + m_aHeaderBar.InsertItem( HI_NAME, ResId( STR_HEADER_NAME, *pResMgr ).toString(), nWidth, nHeadBits ); + m_aHeaderBar.InsertItem( HI_TYPE, ResId( STR_HEADER_TYPE, *pResMgr ).toString(), nWidth, nHeadBits ); + m_aHeaderBar.InsertItem( HI_VALUE, ResId( STR_HEADER_VALUE, *pResMgr ).toString(), nWidth, nHeadBits ); + m_aHeaderBar.InsertItem( HI_ACTION, ResId( STR_HEADER_ACTION, *pResMgr ).toString(), nWidth, nHeadBits ); m_aHeaderBar.Show(); FreeResource(); diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc index 362f42f75ac8..0c7fa33cfc1a 100644 --- a/sfx2/source/dialog/dinfdlg.hrc +++ b/sfx2/source/dialog/dinfdlg.hrc @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _DINFDLG_HRC #define _DINFDLG_HRC @@ -89,7 +80,6 @@ #define ED_INFO4 22 #define FT_COMMENT 23 #define ED_COMMENT 24 -#define GB_INFO 30 #define FT_TEMPL 32 #define FT_TEMPL_VAL 33 #define BTN_EDITLABEL 34 @@ -140,12 +130,6 @@ #define FT_PROPERTIES 92 #define CTRL_PROPERTIES 93 #define BTN_ADD 94 -#define LB_PROPNAME 95 -#define ED_PROPVALUE 96 -#define RB_PROPYES 96 -#define RB_PROPNO 97 -#define LB_PROPTYPE 98 -#define PB_REMOVEPROP 99 #define RB_PROPERTY_YES 100 #define RB_PROPERTY_NO 101 @@ -154,9 +138,7 @@ #define STR_HEADER_VALUE 92 #define STR_HEADER_ACTION 93 -//IAccessibility2 Implementation 2009----- #define EDIT_FILE_NAME 94 -//-----IAccessibility2 Implementation 2009 #define PB_OK 100 #define PB_CANCEL 101 diff --git a/sfx2/source/dialog/dinfedt.hrc b/sfx2/source/dialog/dinfedt.hrc index ef52362af2cb..d55bb0c49344 100644 --- a/sfx2/source/dialog/dinfedt.hrc +++ b/sfx2/source/dialog/dinfedt.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #define BT_OK 1 #define BT_CANCEL 2 #define BTN_HELP 3 diff --git a/sfx2/source/dialog/dinfedt.src b/sfx2/source/dialog/dinfedt.src index 110dccf11c40..ff66e2843287 100644 --- a/sfx2/source/dialog/dinfedt.src +++ b/sfx2/source/dialog/dinfedt.src @@ -91,35 +91,3 @@ ModalDialog DLG_DOCINFO_EDT TabStop = TRUE ; }; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 00da60db9a61..0d43e62b9202 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -252,12 +252,6 @@ Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo return pWin; } -sal_uInt16 SfxDockingWrapper::GetChildWindowId () -{ - DBG_ASSERT( false, "This method shouldn't be called!" ); - return 0; -} - void SfxDockingWrapper::RegisterChildWindow (sal_Bool bVis, SfxModule *pMod, sal_uInt16 nFlags) { // pre-register a couple of docking windows diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 0fcc340bdbd2..c61217adeb99 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -124,7 +124,7 @@ using namespace ::cppu; #define IODLG_CONFIGNAME String(DEFINE_CONST_UNICODE("FilePicker_Save")) #define IMPGRF_CONFIGNAME String(DEFINE_CONST_UNICODE("FilePicker_Graph")) -#define USERITEM_NAME ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UserItem" )) +#define USERITEM_NAME ::rtl::OUString("UserItem" ) //----------------------------------------------------------------------------- @@ -133,9 +133,9 @@ namespace sfx2 const OUString* GetLastFilterConfigId( FileDialogHelper::Context _eContext ) { - static const OUString aSD_EXPORT_IDENTIFIER( RTL_CONSTASCII_USTRINGPARAM( "SdExportLastFilter" ) ); - static const OUString aSI_EXPORT_IDENTIFIER( RTL_CONSTASCII_USTRINGPARAM( "SiExportLastFilter" ) ); - static const OUString aSW_EXPORT_IDENTIFIER( RTL_CONSTASCII_USTRINGPARAM( "SwExportLastFilter" ) ); + static const OUString aSD_EXPORT_IDENTIFIER( "SdExportLastFilter" ); + static const OUString aSI_EXPORT_IDENTIFIER( "SiExportLastFilter" ); + static const OUString aSW_EXPORT_IDENTIFIER( "SwExportLastFilter" ); const OUString* pRet = NULL; @@ -491,7 +491,7 @@ void FileDialogHelper_Impl::updateExportButton() uno::Reference < XFilePickerControlAccess > xCtrlAccess( mxFileDlg, UNO_QUERY ); if ( xCtrlAccess.is() ) { - OUString sEllipses( RTL_CONSTASCII_USTRINGPARAM( "..." ) ); + OUString sEllipses( "..." ); OUString sOldLabel( xCtrlAccess->getLabel( CommonFilePickerElementIds::PUSHBUTTON_OK ) ); // initialize button label; we need the label with the mnemonic char @@ -507,7 +507,7 @@ void FileDialogHelper_Impl::updateExportButton() OUString sLabel = maButtonLabel; // filter with options -> append ellipses on export button label if ( CheckFilterOptionsCapability( getCurentSfxFilter() ) ) - sLabel += OUString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ); + sLabel += OUString( "..." ); if ( sOldLabel != sLabel ) { @@ -659,7 +659,7 @@ void FileDialogHelper_Impl::updateVersions() uno::Sequence < util::RevisionTag > xVersions = SfxMedium::GetVersionList( xStorage ); aEntries.realloc( xVersions.getLength() + 1 ); - aEntries[0] = OUString( String ( SfxResId( STR_SFX_FILEDLG_ACTUALVERSION ) ) ); + aEntries[0] = SfxResId( STR_SFX_FILEDLG_ACTUALVERSION ).toString(); for ( sal_Int32 i=0; i<xVersions.getLength(); i++ ) aEntries[ i + 1 ] = xVersions[i].Identifier; @@ -1072,26 +1072,26 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( else { aInitArguments[0] <<= NamedValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TemplateDescription" ) ), + ::rtl::OUString( "TemplateDescription" ), makeAny( nTemplateDescription ) ); ::rtl::OUString sStandardDirTemp = ::rtl::OUString( sStandardDir ); aInitArguments[1] <<= NamedValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StandardDir" ) ), + ::rtl::OUString( "StandardDir" ), makeAny( sStandardDirTemp ) ); aInitArguments[2] <<= NamedValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BlackList" ) ), + ::rtl::OUString( "BlackList" ), makeAny( rBlackList ) ); if ( mpPreferredParentWindow ) aInitArguments[3] <<= NamedValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ) ), + ::rtl::OUString( "ParentWindow" ), makeAny( VCLUnoHelper::GetInterface( mpPreferredParentWindow ) ) ); } @@ -1119,7 +1119,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( // Export dialog if ( mbExport ) { - mxFileDlg->setTitle( OUString( String( SfxResId( STR_SFX_EXPLORERFILE_EXPORT ) ) ) ); + mxFileDlg->setTitle( SfxResId( STR_SFX_EXPLORERFILE_EXPORT ).toString() ); try { com::sun::star::uno::Reference < XFilePickerControlAccess > xCtrlAccess( mxFileDlg, UNO_QUERY_THROW ); xCtrlAccess->enableControl( ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR, sal_True ); @@ -1130,14 +1130,14 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( // the "insert file" dialog needs another title if ( mbInsert ) { - mxFileDlg->setTitle( OUString( String( SfxResId( STR_SFX_EXPLORERFILE_INSERT ) ) ) ); + mxFileDlg->setTitle( SfxResId( STR_SFX_EXPLORERFILE_INSERT ).toString() ); uno::Reference < XFilePickerControlAccess > xExtDlg( mxFileDlg, UNO_QUERY ); if ( xExtDlg.is() ) { try { xExtDlg->setLabel( CommonFilePickerElementIds::PUSHBUTTON_OK, - OUString( String( SfxResId( STR_SFX_EXPLORERFILE_BUTTONINSERT ) ) ) ); + SfxResId( STR_SFX_EXPLORERFILE_BUTTONINSERT ).toString() ); } catch( const IllegalArgumentException& ){} } @@ -1208,7 +1208,7 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con // forward these ids to the file picker try { - const ::rtl::OUString sHelpIdPrefix( RTL_CONSTASCII_USTRINGPARAM( INET_HID_SCHEME ) ); + const ::rtl::OUString sHelpIdPrefix( INET_HID_SCHEME ); // the ids for the single controls uno::Reference< XFilePickerControlAccess > xControlAccess( mxFileDlg, UNO_QUERY ); if ( xControlAccess.is() ) @@ -1799,7 +1799,7 @@ void FileDialogHelper_Impl::addFilters( const String& rFactory, uno::Reference< XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); uno::Reference< XContainerQuery > xFilterCont( - xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory"))), + xSMGR->createInstance(::rtl::OUString("com.sun.star.document.FilterFactory")), UNO_QUERY); if ( ! xFilterCont.is() ) return; @@ -1909,7 +1909,7 @@ void FileDialogHelper_Impl::addGraphicFilter() try { - OUString aAllFilterName = String( SfxResId( STR_SFX_IMPORT_ALL ) ); + OUString aAllFilterName = SfxResId( STR_SFX_IMPORT_ALL ).toString(); aAllFilterName = ::sfx2::addExtension( aAllFilterName, aExtensions, bIsInOpenMode, *this ); xFltMgr->appendFilter( aAllFilterName, aExtensions ); @@ -2328,9 +2328,9 @@ FileDialogHelper::FileDialogHelper( if ( aExtName.indexOf( (sal_Unicode)'*' ) != 0 ) { if ( !aExtName.isEmpty() && aExtName.indexOf( (sal_Unicode)'.' ) != 0 ) - aWildcard = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*." ) ); + aWildcard = ::rtl::OUString( "*." ); else - aWildcard = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*" ) ); + aWildcard = ::rtl::OUString( "*" ); } aWildcard += aExtName; @@ -2695,7 +2695,7 @@ ErrCode FileOpenDialog_Impl( sal_Int16 nDialogType, ErrCode RequestPassword(const SfxFilter* pCurrentFilter, rtl::OUString& aURL, SfxItemSet* pSet) { - uno::Reference < ::com::sun::star::task::XInteractionHandler > xInteractionHandler( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.uui.UUIInteractionHandler"))), UNO_QUERY ); + uno::Reference < ::com::sun::star::task::XInteractionHandler > xInteractionHandler( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString("com.sun.star.comp.uui.UUIInteractionHandler")), UNO_QUERY ); if( xInteractionHandler.is() ) { // TODO: need a save way to distinguish MS filters from other filters @@ -2723,8 +2723,8 @@ ErrCode RequestPassword(const SfxFilter* pCurrentFilter, rtl::OUString& aURL, Sf if ( aEncryptionKey.getLength() ) { ::comphelper::SequenceAsHashMap aHashData; - aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97EncryptionKey" ) ) ] <<= aEncryptionKey; - aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97UniqueID" ) ) ] <<= aUniqueID; + aHashData[ ::rtl::OUString( "STD97EncryptionKey" ) ] <<= aEncryptionKey; + aHashData[ ::rtl::OUString( "STD97UniqueID" ) ] <<= aUniqueID; pSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aHashData.getAsConstNamedValueList() ) ) ); } @@ -2743,7 +2743,7 @@ ErrCode RequestPassword(const SfxFilter* pCurrentFilter, rtl::OUString& aURL, Sf if ( bMSType ) { // the empty password has 0 as Hash - sal_Int32 nHash = SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ).equals( pCurrentFilter->GetServiceName() ) ); + sal_Int32 nHash = SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(), ::rtl::OUString( "com.sun.star.text.TextDocument" ).equals( pCurrentFilter->GetServiceName() ) ); if ( nHash ) pSet->Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, uno::makeAny( nHash ) ) ); } diff --git a/sfx2/source/dialog/filedlghelper.src b/sfx2/source/dialog/filedlghelper.src index eeee5d36aab7..3f33c97fd8dc 100644 --- a/sfx2/source/dialog/filedlghelper.src +++ b/sfx2/source/dialog/filedlghelper.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "sfxlocal.hrc" #include "filedlghelper.hrc" @@ -125,44 +116,3 @@ String STR_LB_VERSION }; //******************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 4c3c68bb7344..7c08ca70dc06 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -190,7 +190,7 @@ namespace sfx2 sal_Int64 nFlags, sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG, Window* _pPreferredParentWindow = NULL, - const String& sStandardDir = String::CreateFromAscii( "" ), + const String& sStandardDir = rtl::OUString(), const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList = ::com::sun::star::uno::Sequence< ::rtl::OUString >() ); virtual ~FileDialogHelper_Impl(); diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index 25f7a39051a5..816c5854c78b 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -162,8 +162,8 @@ namespace sfx2 void lcl_ReadFilterClass( const OConfigurationNode& _rClassesNode, const ::rtl::OUString& _rLogicalClassName, FilterClass& /* [out] */ _rClass ) { - static const ::rtl::OUString sDisplaNameNodeName( RTL_CONSTASCII_USTRINGPARAM( "DisplayName" ) ); - static const ::rtl::OUString sSubFiltersNodeName( RTL_CONSTASCII_USTRINGPARAM( "Filters" ) ); + static const ::rtl::OUString sDisplaNameNodeName( "DisplayName" ); + static const ::rtl::OUString sSubFiltersNodeName( "Filters" ); // the description node for the current class OConfigurationNode aClassDesc = _rClassesNode.openNode( _rLogicalClassName ); @@ -776,7 +776,7 @@ namespace sfx2 { ::rtl::OUString sUIName; sal_Bool bHasAll = sal_False; - _rAllFilterName = String( SfxResId( STR_SFX_FILTERNAME_ALL ) ); + _rAllFilterName = SfxResId( STR_SFX_FILTERNAME_ALL ).toString(); // =============================================================== // check if there's already a filter <ALL> @@ -885,7 +885,7 @@ namespace sfx2 { ::comphelper::SequenceAsHashMap lFilterProps (xFilterList->nextElement()); ::rtl::OUString sFilterName = lFilterProps.getUnpackedValueOrDefault( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), + ::rtl::OUString("Name"), ::rtl::OUString()); if (!sFilterName.isEmpty()) m_lFilters.push_back(sFilterName); @@ -999,7 +999,7 @@ namespace sfx2 std::vector< ExportFilter > aFilterGroup; Reference< XFilterGroupManager > xFilterGroupManager( _rxFilterManager, UNO_QUERY ); ::rtl::OUString sTypeName; - const ::rtl::OUString sWriterHTMLType( DEFINE_CONST_OUSTRING("writer_web_HTML") ); + const ::rtl::OUString sWriterHTMLType( DEFINE_CONST_OUSTRING("generic_HTML") ); const ::rtl::OUString sGraphicHTMLType( DEFINE_CONST_OUSTRING("graphic_HTML") ); const ::rtl::OUString sXHTMLType( DEFINE_CONST_OUSTRING("XHTML_File") ); const ::rtl::OUString sPDFType( DEFINE_CONST_OUSTRING("pdf_Portable_Document_Format") ); @@ -1187,9 +1187,9 @@ namespace sfx2 const ::rtl::OUString& _rExtension, sal_Bool _bForOpen, FileDialogHelper_Impl& _rFileDlgImpl ) { - static ::rtl::OUString sAllFilter( RTL_CONSTASCII_USTRINGPARAM( "(*.*)" ) ); - static ::rtl::OUString sOpenBracket( RTL_CONSTASCII_USTRINGPARAM( " (" ) ); - static ::rtl::OUString sCloseBracket( RTL_CONSTASCII_USTRINGPARAM( ")" ) ); + static ::rtl::OUString sAllFilter( "(*.*)" ); + static ::rtl::OUString sOpenBracket( " (" ); + static ::rtl::OUString sCloseBracket( ")" ); ::rtl::OUString sRet = _rDisplayText; if ( sRet.indexOf( sAllFilter ) == -1 ) diff --git a/sfx2/source/dialog/filtergrouping.hxx b/sfx2/source/dialog/filtergrouping.hxx index 5702362298fd..6dbe3cc7cce4 100644 --- a/sfx2/source/dialog/filtergrouping.hxx +++ b/sfx2/source/dialog/filtergrouping.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef SFX2_FILTERGROUPING_HXX #define SFX2_FILTERGROUPING_HXX diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 5e2e869429f0..8f69fd0faa1c 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -26,7 +26,6 @@ * ************************************************************************/ -// includes -------------------------------------------------------------- #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertyAccess.hpp> #include <com/sun/star/frame/XFrame.hpp> @@ -34,6 +33,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ucb/CommandAbortedException.hpp> #include <com/sun/star/uno/Reference.h> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/system/XSimpleMailClientSupplier.hpp> #include <com/sun/star/system/SimpleMailClientFlags.hpp> @@ -72,6 +72,7 @@ #include <tools/urlobj.hxx> #include <unotools/useroptions.hxx> #include <comphelper/extract.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/mediadescriptor.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequenceashashmap.hxx> @@ -166,7 +167,7 @@ sal_Bool HasDocumentValidSignature( const css::uno::Reference< css::frame::XMode css::uno::Reference< css::beans::XPropertySet > xPropSet( xModel, css::uno::UNO_QUERY ); if ( xPropSet.is() ) { - Any a = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasValidSignatures" ))); + Any a = xPropSet->getPropertyValue( rtl::OUString( "HasValidSignatures" )); sal_Bool bReturn = sal_Bool(); if ( a >>= bReturn ) return bReturn; @@ -200,7 +201,7 @@ SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xFilterCFG = uno::Reference< container::XNameAccess >( xSMGR->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")) ), uno::UNO_QUERY ); + ::rtl::OUString("com.sun.star.document.FilterFactory") ), uno::UNO_QUERY ); css::uno::Reference< css::util::XModifiable > xModifiable( xModel, css::uno::UNO_QUERY ); if ( !xFilterCFG.is() ) @@ -234,14 +235,12 @@ SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog( //add an internal property, used to tell the dialog we want to set a different //string for the ok button //used in filter/source/pdf/impdialog.cxx - String aOkSendText( SfxResId( STR_PDF_EXPORT_SEND )); - uno::Sequence< beans::PropertyValue > aFilterDataValue(1); - aFilterDataValue[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_OkButtonString" )); - aFilterDataValue[0].Value = css::uno::makeAny( ::rtl::OUString( aOkSendText )); + aFilterDataValue[0].Name = ::rtl::OUString( "_OkButtonString" ); + aFilterDataValue[0].Value = css::uno::makeAny(SfxResId(STR_PDF_EXPORT_SEND ).toString()); //add to the filterdata property, the only one the PDF export filter dialog will care for - aPropsForDialog[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterData" )); + aPropsForDialog[0].Name = ::rtl::OUString( "FilterData" ); aPropsForDialog[0].Value = css::uno::makeAny( aFilterDataValue ); //when executing the dialog will merge the persistent FilterData properties @@ -325,7 +324,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( if (!xSMGR.is()) return eRet; - const rtl::OUString aModuleManager( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" )); + const rtl::OUString aModuleManager( "com.sun.star.frame.ModuleManager" ); css::uno::Reference< css::frame::XModuleManager > xModuleManager( xSMGR->createInstance( aModuleManager ), css::uno::UNO_QUERY_THROW ); if ( !xModuleManager.is() ) return eRet; @@ -386,16 +385,16 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( css::uno::Reference< css::container::XContainerQuery > xContainerQuery( xSMGR->createInstance( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" ))), + "com.sun.star.document.FilterFactory" )), css::uno::UNO_QUERY ); if ( bStoreTo ) { // Retrieve filter from type css::uno::Sequence< css::beans::NamedValue > aQuery( bSendAsPDF ? 3 : 2 ); - aQuery[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" )); + aQuery[0].Name = rtl::OUString( "Type" ); aQuery[0].Value = css::uno::makeAny( aTypeName ); - aQuery[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentService" )); + aQuery[1].Name = rtl::OUString( "DocumentService" ); aQuery[1].Value = css::uno::makeAny( aModule ); if( bSendAsPDF ) { @@ -404,7 +403,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( // exact flag value as detailed in the filter configuration to get it // this seems to be a bug // without flags we get an import filter here, which is also unwanted - aQuery[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Flags" )); + aQuery[2].Name = rtl::OUString( "Flags" ); aQuery[2].Value = css::uno::makeAny( sal_Int32(0x80042) ); // EXPORT ALIEN 3RDPARTY } @@ -415,7 +414,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { ::comphelper::SequenceAsHashMap aFilterPropsHM( xEnumeration->nextElement() ); aFilterName = aFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), + ::rtl::OUString("Name"), ::rtl::OUString() ); } @@ -424,7 +423,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( // Retrieve filter from media descriptor ::comphelper::SequenceAsHashMap aMediaDescrPropsHM( xModel->getArgs() ); rtl::OUString aOrgFilterName = aMediaDescrPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" )), + ::rtl::OUString( "FilterName" ), ::rtl::OUString() ); if ( aOrgFilterName == aFilterName ) { @@ -442,7 +441,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( // Retrieve filter from media descriptor ::comphelper::SequenceAsHashMap aMediaDescrPropsHM( xModel->getArgs() ); aFilterName = aMediaDescrPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" )), + ::rtl::OUString( "FilterName" ), ::rtl::OUString() ); } @@ -454,7 +453,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { ::comphelper::SequenceAsHashMap aFilterPropsHM( xNameAccess->getByName( aModule ) ); aFilterName = aFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryDefaultFilter")), + ::rtl::OUString("ooSetupFactoryDefaultFilter"), ::rtl::OUString() ); css::uno::Reference< css::container::XNameAccess > xNameAccess2( xContainerQuery, css::uno::UNO_QUERY ); @@ -462,7 +461,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { ::comphelper::SequenceAsHashMap aFilterPropsHM2( xNameAccess2->getByName( aFilterName ) ); aTypeName = aFilterPropsHM2.getUnpackedValueOrDefault( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Type")), + ::rtl::OUString("Type"), ::rtl::OUString() ); } } @@ -491,7 +490,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { css::uno::Reference< container::XNameAccess > xTypeDetection( xSMGR->createInstance( ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" ))), + "com.sun.star.document.TypeDetection" )), css::uno::UNO_QUERY ); @@ -501,7 +500,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { ::comphelper::SequenceAsHashMap aTypeNamePropsHM( xTypeDetection->getByName( aTypeName ) ); uno::Sequence< ::rtl::OUString > aExtensions = aTypeNamePropsHM.getUnpackedValueOrDefault( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")), + ::rtl::OUString("Extensions"), ::uno::Sequence< ::rtl::OUString >() ); if ( aExtensions.getLength() ) aExtension = aExtensions[0]; @@ -519,7 +518,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( if ( !bHasLocation ) { // Create a noname file name with the correct extension - const rtl::OUString aNoNameFileName( RTL_CONSTASCII_USTRINGPARAM( "noname" )); + const rtl::OUString aNoNameFileName( "noname" ); aFileName = aNoNameFileName; } else @@ -550,9 +549,9 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( rtl::OUString aFileURL = aFilePathObj.GetMainURL( INetURLObject::NO_DECODE ); sal_Int32 nNumArgs(0); - const rtl::OUString aPasswordPropName( RTL_CONSTASCII_USTRINGPARAM( "Password" )); + const rtl::OUString aPasswordPropName( "Password" ); css::uno::Sequence< css::beans::PropertyValue > aArgs( ++nNumArgs ); - aArgs[nNumArgs-1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" )); + aArgs[nNumArgs-1].Name = rtl::OUString( "FilterName" ); aArgs[nNumArgs-1].Value = css::uno::makeAny( aFilterName ); ::comphelper::SequenceAsHashMap aMediaDescrPropsHM( xModel->getArgs() ); @@ -570,20 +569,15 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( css::util::URL aPrepareURL; css::uno::Reference< css::frame::XDispatch > xPrepareDispatch; css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( xFrame, css::uno::UNO_QUERY ); - css::uno::Reference< css::util::XURLTransformer > xURLTransformer( - xSMGR->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), - css::uno::UNO_QUERY ); + css::uno::Reference< css::util::XURLTransformer > xURLTransformer( css::util::URLTransformer::create( ::comphelper::ComponentContext(xSMGR).getUNOContext() ) ); if( !bSendAsPDF ) { try { // check if the document needs to be prepared for sending as mail (embedding of links, removal of invisible content) - if ( xURLTransformer.is() ) - { - aPrepareURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrepareMailExport" )); - xURLTransformer->parseStrict( aPrepareURL ); - } + aPrepareURL.Complete = rtl::OUString( ".uno:PrepareMailExport" ); + xURLTransformer->parseStrict( aPrepareURL ); if ( xDispatchProvider.is() ) { @@ -651,11 +645,8 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { css::util::URL aURL; // #i30432# notify that export is finished - the Writer may want to restore removed content - if ( xURLTransformer.is() ) - { - aURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:MailExportFinished" )); - xURLTransformer->parseStrict( aURL ); - } + aURL.Complete = rtl::OUString( ".uno:MailExportFinished" ); + xURLTransformer->parseStrict( aURL ); if ( xDispatchProvider.is() ) { @@ -701,7 +692,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { // We need 1:1 copy of the document to preserve an added signature. aArgs.realloc( ++nNumArgs ); - aArgs[nNumArgs-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CopyStreamIfPossible" ) ); + aArgs[nNumArgs-1].Name = ::rtl::OUString( "CopyStreamIfPossible" ); aArgs[nNumArgs-1].Value = css::uno::makeAny( (sal_Bool)sal_True ); try @@ -807,13 +798,13 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css: // Prefer the SimpleSystemMail service if available xSimpleMailClientSupplier = css::uno::Reference< XSimpleMailClientSupplier >( - xMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SimpleSystemMail" ))), + xMgr->createInstance( OUString( "com.sun.star.system.SimpleSystemMail" )), UNO_QUERY ); if ( ! xSimpleMailClientSupplier.is() ) { xSimpleMailClientSupplier = css::uno::Reference< XSimpleMailClientSupplier >( - xMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SimpleCommandMail" ))), + xMgr->createInstance( OUString( "com.sun.star.system.SimpleCommandMail" )), UNO_QUERY ); } @@ -895,7 +886,7 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css: OUString baseName( maAttachedDocuments[0].copy( maAttachedDocuments[0].lastIndexOf( '/' ) + 1 ) ); OUString subject( baseName ); if ( maAttachedDocuments.size() > 1 ) - subject += OUString(RTL_CONSTASCII_USTRINGPARAM(", ...")); + subject += OUString(", ..."); xSimpleMailMessage->setSubject( subject ); } xSimpleMailMessage->setAttachement( aAttachmentSeq ); @@ -979,12 +970,12 @@ sal_Bool CreateFromAddress_Impl( String& rFrom ) { if ( aFirstName.Len() ) { - rFrom = TRIM( aFirstName ); + rFrom = comphelper::string::strip(aFirstName, ' '); if ( aName.Len() ) rFrom += ' '; } - rFrom += TRIM( aName ); + rFrom += comphelper::string::strip(aName, ' '); // remove illegal characters rFrom = comphelper::string::remove(rFrom, '<'); rFrom = comphelper::string::remove(rFrom, '>'); @@ -1000,7 +991,7 @@ sal_Bool CreateFromAddress_Impl( String& rFrom ) { if ( rFrom.Len() ) rFrom += ' '; - ( ( rFrom += '<' ) += TRIM( aEmailName ) ) += '>'; + ( ( rFrom += '<' ) += comphelper::string::strip(aEmailName, ' ') ) += '>'; } else rFrom.Erase(); diff --git a/sfx2/source/dialog/mailwindow.src b/sfx2/source/dialog/mailwindow.src index e5648e7f414f..e2a0fac74977 100644 --- a/sfx2/source/dialog/mailwindow.src +++ b/sfx2/source/dialog/mailwindow.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "dialog.hrc" #include "helpid.hrc" @@ -38,39 +29,3 @@ ErrorBox RID_ERRBOX_MAIL_CONFIG }; // ------------------------------------------------------------------- EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 2e377bb52af5..f9bc26bc05dd 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -26,8 +26,7 @@ * ************************************************************************/ - -// include --------------------------------------------------------------- +#include <comphelper/string.hxx> #include <vcl/msgbox.hxx> #include <vcl/field.hxx> #include <svl/eitem.hxx> @@ -122,7 +121,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem if ( !pStyle->GetName().Len() && pPool ) { // NullString as Name -> generate Name - String aNoName( SfxResId( STR_NONAME ) ); + String aNoName( SfxResId(STR_NONAME).toString() ); sal_uInt16 nNo = 1; String aNo( aNoName ); aNoName += String::CreateFromInt32( nNo ); @@ -181,7 +180,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem { if ( pStyle->HasClearParentSupport() ) // the base template can be set to NULL - aBaseLb.InsertEntry( String( SfxResId( STR_NONE ) ) ); + aBaseLb.InsertEntry( SfxResId(STR_NONE).toString() ); SfxStyleSheetBase* pPoolStyle = pPool->First(); @@ -364,7 +363,7 @@ IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit ) */ { - aBuf = pEdit->GetText().EraseLeadingChars(); + aBuf = comphelper::string::stripStart(pEdit->GetText(), ' '); return 0; } IMPL_LINK_INLINE_END( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit ) @@ -381,7 +380,7 @@ IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit ) */ { - const String aStr( pEdit->GetText().EraseLeadingChars() ); + const String aStr(comphelper::string::stripStart(pEdit->GetText(), ' ')); pEdit->SetText( aStr ); // Update the Listbox of the base template if possible if ( aStr != aBuf ) @@ -483,11 +482,11 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet& /*rAttrSet*/ ) pStyle->SetParent( aParent ); if ( !aParent.Len() ) - aBaseLb.SelectEntry( String( SfxResId( STR_NONE ) ) ); + aBaseLb.SelectEntry( SfxResId(STR_NONE).toString() ); else aBaseLb.SelectEntry( aParent ); - if ( String( SfxResId( STR_STANDARD ) ) == aName ) + if ( SfxResId(STR_STANDARD).toString().equals(aName) ) { // the default template can not be linked aBaseFt.Disable(); @@ -581,7 +580,7 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) if ( aNameEd.HasFocus() ) LoseFocusHdl( &aNameEd ); - if ( !pStyle->SetName( aNameEd.GetText().EraseLeadingChars() ) ) + if (!pStyle->SetName(comphelper::string::stripStart(aNameEd.GetText(), ' '))) { InfoBox aBox( this, SfxResId( MSG_TABPAGE_INVALIDNAME ) ); aBox.Execute(); @@ -613,7 +612,7 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) { String aParentEntry( aBaseLb.GetSelectEntry() ); - if ( String( SfxResId( STR_NONE ) ) == aParentEntry || aParentEntry == pStyle->GetName() ) + if ( SfxResId(STR_NONE).toString().equals(aParentEntry) || aParentEntry == pStyle->GetName() ) aParentEntry.Erase(); if ( pStyle->GetParent() != aParentEntry ) diff --git a/sfx2/source/dialog/mgetempl.hrc b/sfx2/source/dialog/mgetempl.hrc index a34700846f9c..d658892b144d 100644 --- a/sfx2/source/dialog/mgetempl.hrc +++ b/sfx2/source/dialog/mgetempl.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #define ED_NAME 2 #define MLE_NAME 13 #define LB_NEXT 4 diff --git a/sfx2/source/dialog/mgetempl.src b/sfx2/source/dialog/mgetempl.src index 9d0a8e269234..69de5be1d051 100644 --- a/sfx2/source/dialog/mgetempl.src +++ b/sfx2/source/dialog/mgetempl.src @@ -132,33 +132,3 @@ TabPage TP_MANAGE_STYLES }; }; // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx index 4d27330cce73..3aa284577c46 100644 --- a/sfx2/source/dialog/navigat.cxx +++ b/sfx2/source/dialog/navigat.cxx @@ -64,7 +64,7 @@ SfxNavigator::SfxNavigator( SfxBindings* pBind , nBits ) , pWrapper( pChildWin ) { - SetText( String( SfxResId( SID_NAVIGATOR ) ) ); + SetText( SfxResId(SID_NAVIGATOR).toString() ); } void SfxNavigator::Resize() diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index 3dc68298256c..c529a28d5b86 100644 --- a/sfx2/source/dialog/newstyle.cxx +++ b/sfx2/source/dialog/newstyle.cxx @@ -26,8 +26,6 @@ * ************************************************************************/ - -// INCLUDE --------------------------------------------------------------- #include <comphelper/string.hxx> #include <svl/style.hxx> @@ -90,7 +88,7 @@ SfxNewStyleDlg::SfxNewStyleDlg( Window* pParent, SfxStyleSheetBasePool& rInPool aOKBtn.SetClickHdl(LINK(this, SfxNewStyleDlg, OKHdl)); aColBox.SetModifyHdl(LINK(this, SfxNewStyleDlg, ModifyHdl)); aColBox.SetDoubleClickHdl(LINK(this, SfxNewStyleDlg, OKHdl)); - aColBox.SetAccessibleName(SfxResId(FL_COL)); + aColBox.SetAccessibleName(SfxResId(FL_COL).toString()); SfxStyleSheetBase *pStyle = rPool.First(); while ( pStyle ) diff --git a/sfx2/source/dialog/newstyle.hrc b/sfx2/source/dialog/newstyle.hrc index 0efc04869ba9..03415d643a06 100644 --- a/sfx2/source/dialog/newstyle.hrc +++ b/sfx2/source/dialog/newstyle.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #define BT_OK 100 #define BT_CANCEL 101 diff --git a/sfx2/source/dialog/newstyle.src b/sfx2/source/dialog/newstyle.src index b5954028779b..035917e5ca58 100644 --- a/sfx2/source/dialog/newstyle.src +++ b/sfx2/source/dialog/newstyle.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include <sfx2/sfx.hrc> #include "dialog.hrc" @@ -72,34 +63,3 @@ ModalDialog DLG_NEW_STYLE_BY_EXAMPLE Message [ en-US ] = "Style already exists. Overwrite?" ; }; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index 681d3683bb0a..f19569bd1942 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -119,15 +119,15 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText maCancelBtn ( this, SfxResId( BTN_PASSWD_CANCEL ) ), maHelpBtn ( this, SfxResId( BTN_PASSWD_HELP ) ), - maMinLenPwdStr ( SfxResId( STR_PASSWD_MIN_LEN ) ), - maEmptyPwdStr ( SfxResId( STR_PASSWD_EMPTY ) ), + maMinLenPwdStr ( SfxResId( STR_PASSWD_MIN_LEN ).toString() ), + maEmptyPwdStr ( SfxResId( STR_PASSWD_EMPTY ).toString() ), maMainPwdStr ( ), mnMinLen ( 5 ), mnExtras ( 0 ), mbAsciiOnly ( false ) { - maPasswordED.SetAccessibleName(String(SfxResId(TEXT_PASSWD))); + maPasswordED.SetAccessibleName(SfxResId(TEXT_PASSWD).toString()); FreeResource(); // setup layout @@ -207,7 +207,7 @@ void SfxPasswordDialog::SetPasswdText( ) else { maMainPwdStr = maMinLenPwdStr; - maMainPwdStr.SearchAndReplace( String::CreateFromAscii( "$(MINLEN)" ), String::CreateFromInt32((sal_Int32) mnMinLen ), 0); + maMainPwdStr.SearchAndReplace( rtl::OUString("$(MINLEN)"), String::CreateFromInt32((sal_Int32) mnMinLen ), 0); maMinLengthFT.SetText( maMainPwdStr ); maMinLengthFT.Show(); } diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc index 8a82c853320e..cea12b57bf14 100644 --- a/sfx2/source/dialog/passwd.hrc +++ b/sfx2/source/dialog/passwd.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_PASSWD_HRC #define _SFX_PASSWD_HRC @@ -47,7 +38,6 @@ #define FT_PASSWD_CONFIRM2 27 #define ED_PASSWD_CONFIRM2 28 -#define STR_PASSWD_CONFIRM 29 #define STR_PASSWD_MIN_LEN 30 #define STR_PASSWD_EMPTY 31 diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx index 45bbdbb161ac..c0400cda6754 100644 --- a/sfx2/source/dialog/printopt.cxx +++ b/sfx2/source/dialog/printopt.cxx @@ -43,6 +43,8 @@ static sal_uInt16 aDPIArray[] = { 72, 96, 150, 200, 300, 600 }; static sal_Bool bOutputForPrinter = sal_True; +#define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ])) + SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage( pParent, SfxResId( TP_COMMONPRINTOPTIONS ), rSet ), @@ -230,7 +232,7 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCu aReduceBitmapsResolutionLB.SelectEntryPos( 0 ); else { - for( long i = ( SAL_N_ELEMENTS(aDPIArray) - 1 ); i >= 0; i-- ) + for( long i = ( DPI_COUNT - 1 ); i >= 0; i-- ) { if( nDPI >= aDPIArray[ i ] ) { @@ -252,7 +254,7 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCu void SfxCommonPrintOptionsTabPage::ImplSetAccessibleNames() { - static const String cSeparator = String::CreateFromAscii( " - " ); + const rtl::OUString cSeparator(" - "); String sReduceText = aReduceGB.GetDisplayText(); sReduceText += cSeparator; @@ -359,7 +361,7 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOpt pCurrentOptions->SetReducedBitmapMode( aReduceBitmapsOptimalRB.IsChecked() ? PRINTER_BITMAP_OPTIMAL : ( aReduceBitmapsNormalRB.IsChecked() ? PRINTER_BITMAP_NORMAL : PRINTER_BITMAP_RESOLUTION ) ); pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) aReduceBitmapsResolutionLB.GetSelectEntryPos(), - (sal_uInt16)( SAL_N_ELEMENTS( aDPIArray ) - 1 ) ) ] ); + (sal_uInt16)( (sizeof (aDPIArray) / sizeof (aDPIArray[0])) - 1 ) ) ] ); pCurrentOptions->SetReducedBitmapIncludesTransparency( aReduceBitmapsTransparencyCB.IsChecked() ); pCurrentOptions->SetConvertToGreyscales( aConvertToGreyscalesCB.IsChecked() ); } diff --git a/sfx2/source/dialog/printopt.hrc b/sfx2/source/dialog/printopt.hrc index 28c4b57532ee..bdc04b2347a3 100644 --- a/sfx2/source/dialog/printopt.hrc +++ b/sfx2/source/dialog/printopt.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #define GB_REDUCE 1 diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 010002b1840b..2426ec708fe9 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -173,8 +173,8 @@ sal_Bool SfxRecordingFloatWrapper_Impl::QueryClose() com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder = pBindings->GetRecorder(); if ( xRecorder.is() && !xRecorder->getRecordedMacro().isEmpty() ) { - QueryBox aBox( GetWindow(), WB_YES_NO | WB_DEF_NO , String( SfxResId( STR_MACRO_LOSS ) ) ); - aBox.SetText( String( SfxResId(STR_CANCEL_RECORDING) ) ); + QueryBox aBox( GetWindow(), WB_YES_NO | WB_DEF_NO , SfxResId(STR_MACRO_LOSS).toString() ); + aBox.SetText( SfxResId(STR_CANCEL_RECORDING).toString() ); bRet = ( aBox.Execute() == RET_YES ); } diff --git a/sfx2/source/dialog/recfloat.src b/sfx2/source/dialog/recfloat.src index 47e4803c1b5b..71f6236d9c44 100644 --- a/sfx2/source/dialog/recfloat.src +++ b/sfx2/source/dialog/recfloat.src @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ // include --------------------------------------------------------------- #include "helpid.hrc" #include "dialog.hrc" @@ -64,23 +55,3 @@ String STR_CANCEL_RECORDING { Text [ en-US ] = "Cancel Recording"; }; - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx index 22efcf333ebb..588608f3f124 100644 --- a/sfx2/source/dialog/securitypage.cxx +++ b/sfx2/source/dialog/securitypage.cxx @@ -134,7 +134,7 @@ static bool lcl_IsPasswordCorrect( const String &rPassword ) if (SvPasswordHelper::CompareHashPassword( aPasswordHash, rPassword )) bRes = true; // password was correct else - InfoBox( NULL, String( SfxResId( RID_SFX_INCORRECT_PASSWORD ) ) ).Execute(); + InfoBox( NULL, SfxResId( RID_SFX_INCORRECT_PASSWORD ).toString() ).Execute(); return bRes; } @@ -200,12 +200,12 @@ SfxSecurityPage_Impl::SfxSecurityPage_Impl( SfxSecurityPage &rTabPage, const Sfx m_aOpenReadonlyCB (&rTabPage, SfxResId( OPEN_READONLY_CB ) ), m_aRecordChangesCB (&rTabPage, SfxResId( RECORD_CHANGES_CB ) ), m_aChangeProtectionPB (&rTabPage, SfxResId( CHANGE_PROTECTION_PB ) ), - m_aProtectSTR ( SfxResId( STR_PROTECT ) ), - m_aUnProtectSTR ( SfxResId( STR_UNPROTECT ) ), + m_aProtectSTR ( SfxResId( STR_PROTECT ).toString() ), + m_aUnProtectSTR ( SfxResId( STR_UNPROTECT ).toString() ), m_eRedlingMode ( RL_NONE ), m_bOrigPasswordIsConfirmed ( false ), m_bNewPasswordIsValid ( false ), - m_aEndRedliningWarning ( SfxResId( STR_END_REDLINING_WARNING ) ), + m_aEndRedliningWarning ( SfxResId( STR_END_REDLINING_WARNING ).toString() ), m_bEndRedliningWarningDone ( false ) { m_aChangeProtectionPB.SetText( m_aProtectSTR ); diff --git a/sfx2/source/dialog/securitypage.hrc b/sfx2/source/dialog/securitypage.hrc index d425131b4772..6b41f8e9a946 100644 --- a/sfx2/source/dialog/securitypage.hrc +++ b/sfx2/source/dialog/securitypage.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SECURITYPAGE_HRC_ #define _SECURITYPAGE_HRC_ diff --git a/sfx2/source/dialog/sfxdlg.cxx b/sfx2/source/dialog/sfxdlg.cxx index 37d952f6530c..df2fd39026cc 100644 --- a/sfx2/source/dialog/sfxdlg.cxx +++ b/sfx2/source/dialog/sfxdlg.cxx @@ -1,34 +1,24 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include <sfx2/sfxdlg.hxx> -//#include "cuilib.hxx" #include <osl/module.hxx> diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 4c40b6734a00..1e3b37e56e1e 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -54,7 +54,7 @@ using namespace ::rtl; #define VERSION 1 #define nPixel 30L -#define USERITEM_NAME OUString(RTL_CONSTASCII_USTRINGPARAM("UserItem")) +#define USERITEM_NAME OUString("UserItem") struct SfxDock_Impl { @@ -65,9 +65,16 @@ struct SfxDock_Impl long nSize; }; -typedef SfxDock_Impl* SfxDockPtr; -SV_DECL_PTRARR_DEL( SfxDockArr_Impl, SfxDockPtr, 4 ) -SV_IMPL_PTRARR( SfxDockArr_Impl, SfxDockPtr); +class SfxDockArr_Impl : public std::vector<SfxDock_Impl*> +{ +public: + ~SfxDockArr_Impl() + { + for(const_iterator it = begin(); it != end(); ++it) + delete *it; + } + +}; class SfxEmptySplitWin_Impl : public SplitWindow { @@ -235,7 +242,7 @@ SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl, if ( bWithButtons ) { // Read Configuration - String aWindowId = String::CreateFromAscii("SplitWindow"); + String aWindowId = rtl::OUString("SplitWindow"); aWindowId += String::CreateFromInt32( (sal_Int32) eTbxAlign ); SvtViewOptions aWinOpt( E_WINDOW, aWindowId ); String aWinData; @@ -273,7 +280,7 @@ SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl, pDock->bNewLine = sal_True; } - pDockArr->Insert(pDock,n); + pDockArr->insert(pDockArr->begin() + n, pDock); } } } @@ -317,7 +324,7 @@ void SfxSplitWindow::SaveConfig_Impl() sal_uInt16 nCount = 0; sal_uInt16 n; - for ( n=0; n<pDockArr->Count(); n++ ) + for ( n=0; n<pDockArr->size(); n++ ) { SfxDock_Impl *pDock = (*pDockArr)[n]; if ( pDock->bHide || pDock->pWin ) @@ -326,7 +333,7 @@ void SfxSplitWindow::SaveConfig_Impl() aWinData += String::CreateFromInt32( nCount ); - for ( n=0; n<pDockArr->Count(); n++ ) + for ( n=0; n<pDockArr->size(); n++ ) { SfxDock_Impl *pDock = (*pDockArr)[n]; if ( !pDock->bHide && !pDock->pWin ) @@ -337,7 +344,7 @@ void SfxSplitWindow::SaveConfig_Impl() aWinData += String::CreateFromInt32( pDock->nType); } - String aWindowId = String::CreateFromAscii("SplitWindow"); + String aWindowId = rtl::OUString("SplitWindow"); aWindowId += String::CreateFromInt32( (sal_Int32) GetAlign() ); SvtViewOptions aWinOpt( E_WINDOW, aWindowId ); aWinOpt.SetUserItem( USERITEM_NAME, makeAny( OUString( aWinData ) ) ); @@ -394,7 +401,7 @@ void SfxSplitWindow::Split() SplitWindow::Split(); - sal_uInt16 nCount = pDockArr->Count(); + sal_uInt16 nCount = pDockArr->size(); for ( sal_uInt16 n=0; n<nCount; n++ ) { SfxDock_Impl *pD = (*pDockArr)[n]; @@ -440,7 +447,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize sal_Bool bNewLine = sal_True; sal_Bool bSaveConfig = sal_False; SfxDock_Impl *pFoundDock=0; - sal_uInt16 nCount = pDockArr->Count(); + sal_uInt16 nCount = pDockArr->size(); for ( sal_uInt16 n=0; n<nCount; n++ ) { SfxDock_Impl *pDock = (*pDockArr)[n]; @@ -500,7 +507,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize // Not found, insert at end pFoundDock = new SfxDock_Impl; pFoundDock->bHide = sal_True; - pDockArr->Insert( pFoundDock, nCount ); + pDockArr->push_back( pFoundDock ); pFoundDock->nType = pDockWin->GetType(); nLine++; nPos = 0; @@ -527,7 +534,7 @@ void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, sal_Bool bSa { SfxDock_Impl *pDock=0; - sal_uInt16 nCount = pDockArr->Count(); + sal_uInt16 nCount = pDockArr->size(); sal_Bool bFound = sal_False; for ( sal_uInt16 n=0; n<nCount; n++ ) { @@ -539,7 +546,7 @@ void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, sal_Bool bSa // Window has a position, this we forget bFound = sal_True; - pDockArr->Remove(n); + pDockArr->erase(pDockArr->begin() + n); break; } } @@ -599,7 +606,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize // The window must be inserted before the first window so that it has the // same or a greater position than pDockWin. - sal_uInt16 nCount = pDockArr->Count(); + sal_uInt16 nCount = pDockArr->size(); sal_uInt16 nLastWindowIdx(0); // If no window is found, a first window is inserted @@ -640,7 +647,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize nInsertPos = nLastWindowIdx + 1; // ignore all non-windows after the last window } - pDockArr->Insert(pDock, nInsertPos); + pDockArr->insert(pDockArr->begin() + nInsertPos, pDock); InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine ); SaveConfig_Impl(); } @@ -794,7 +801,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, sal_Bool bHide ) } SfxDock_Impl *pDock=0; - sal_uInt16 nCount = pDockArr->Count(); + sal_uInt16 nCount = pDockArr->size(); for ( sal_uInt16 n=0; n<nCount; n++ ) { pDock = (*pDockArr)[n]; @@ -1214,7 +1221,7 @@ void SfxSplitWindow::FadeIn() void SfxSplitWindow::Show_Impl() { - sal_uInt16 nCount = pDockArr->Count(); + sal_uInt16 nCount = pDockArr->size(); for ( sal_uInt16 n=0; n<nCount; n++ ) { SfxDock_Impl *pDock = (*pDockArr)[n]; @@ -1227,7 +1234,7 @@ sal_Bool SfxSplitWindow::ActivateNextChild_Impl( sal_Bool bForward ) { // If no pActive, go to first and last window (!bForward is first // decremented in the loop) - sal_uInt16 nCount = pDockArr->Count(); + sal_uInt16 nCount = pDockArr->size(); sal_uInt16 n = bForward ? 0 : nCount; // if Focus is within, then move to a window forward or backwards diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx index 0d5528a7398b..ed4edad38128 100644 --- a/sfx2/source/dialog/srchdlg.cxx +++ b/sfx2/source/dialog/srchdlg.cxx @@ -62,7 +62,7 @@ SearchDialog::SearchDialog( Window* pWindow, const ::rtl::OUString& rConfigName m_aBackwardsBox ( this, SfxResId( CB_BACKWARDS ) ), m_aFindBtn ( this, SfxResId( PB_FIND ) ), m_aCancelBtn ( this, SfxResId( PB_CANCELFIND ) ), - m_sToggleText ( SfxResId( STR_TOGGLE ) ), + m_sToggleText ( SfxResId( STR_TOGGLE ).toString() ), m_sConfigName ( rConfigName ), m_bIsConstructed ( false ) @@ -127,7 +127,7 @@ void SearchDialog::SaveConfig() sUserData += m_aSearchEdit.GetEntry(i); sUserData += '\t'; } - sUserData.EraseTrailingChars( '\t' ); + sUserData = comphelper::string::stripStart(sUserData, '\t'); sUserData += ';'; sUserData += String::CreateFromInt32( m_aWholeWordsBox.IsChecked() ? 1 : 0 ); sUserData += ';'; diff --git a/sfx2/source/dialog/srchdlg.hrc b/sfx2/source/dialog/srchdlg.hrc index 55fe9ce47d26..e184e1c90062 100644 --- a/sfx2/source/dialog/srchdlg.hrc +++ b/sfx2/source/dialog/srchdlg.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_SRCHDLG_HRC_ #define _SFX_SRCHDLG_HRC_ diff --git a/sfx2/source/dialog/srchdlg.src b/sfx2/source/dialog/srchdlg.src index d1cee69e9157..aeeaff6df5ad 100644 --- a/sfx2/source/dialog/srchdlg.src +++ b/sfx2/source/dialog/srchdlg.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_SRCHDLG_HRC_ #include "srchdlg.hrc" diff --git a/sfx2/source/dialog/styfitem.cxx b/sfx2/source/dialog/styfitem.cxx index 54ff9d848299..93d68f0079fd 100644 --- a/sfx2/source/dialog/styfitem.cxx +++ b/sfx2/source/dialog/styfitem.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ - -// INCLUDE --------------------------------------------------------------- - #include <sfx2/styfitem.hxx> #include <svtools/localresaccess.hxx> #include <tools/debug.hxx> diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx index 2fbdd661d7f3..5b9e0734fa7b 100644 --- a/sfx2/source/dialog/styledlg.cxx +++ b/sfx2/source/dialog/styledlg.cxx @@ -26,8 +26,6 @@ * ************************************************************************/ - -// include --------------------------------------------------------------- #include <svl/whiter.hxx> #include <svl/style.hxx> #include <vcl/msgbox.hxx> @@ -66,7 +64,7 @@ SfxStyleDialog::SfxStyleDialog { AddTabPage( ID_TABPAGE_MANAGESTYLES, - String( SfxResId( STR_TABPAGE_MANAGESTYLES ) ), + SfxResId( STR_TABPAGE_MANAGESTYLES ).toString(), SfxManageStyleSheetPage::Create, 0, sal_False, 0 ); // With new template always set the management page as the current page diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 64d28b731c10..342dc47834f9 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -52,7 +52,7 @@ using namespace ::com::sun::star::uno; using namespace ::rtl; -#define USERITEM_NAME OUString(RTL_CONSTASCII_USTRINGPARAM("UserItem")) +#define USERITEM_NAME OUString("UserItem") TYPEINIT1(SfxTabDialogItem,SfxSetItem); @@ -468,10 +468,7 @@ SfxTabDialog::SfxTabDialog SfxTabDialog::~SfxTabDialog() { - // save settings (screen position and current page) - SvtViewOptions aDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) ); - aDlgOpt.SetWindowState(OStringToOUString(GetWindowState(WINDOWSTATE_MASK_POS),RTL_TEXTENCODING_ASCII_US)); - aDlgOpt.SetPageID( aTabCtrl.GetCurPageId() ); + SavePosAndId(); const sal_uInt16 nCount = pImpl->pData->Count(); for ( sal_uInt16 i = 0; i < nCount; ++i ) @@ -520,7 +517,7 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText ) aOKBtn.SetClickHdl( LINK( this, SfxTabDialog, OkHdl ) ); aCancelBtn.SetClickHdl( LINK( this, SfxTabDialog, CancelHdl ) ); aResetBtn.SetClickHdl( LINK( this, SfxTabDialog, ResetHdl ) ); - aResetBtn.SetText( String( SfxResId( STR_RESET ) ) ); + aResetBtn.SetText( SfxResId( STR_RESET ).toString() ); aTabCtrl.SetActivatePageHdl( LINK( this, SfxTabDialog, ActivatePageHdl ) ); aTabCtrl.SetDeactivatePageHdl( @@ -543,8 +540,7 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText ) different behavior than implemented!! */ if ( bFmtFlag ) { - String aStd( SfxResId( STR_STANDARD_SHORTCUT ) ); - aBaseFmtBtn.SetText( aStd ); + aBaseFmtBtn.SetText( SfxResId( STR_STANDARD_SHORTCUT ).toString() ); aBaseFmtBtn.SetClickHdl( LINK( this, SfxTabDialog, BaseFmtHdl ) ); aBaseFmtBtn.SetHelpId( HID_TABDLG_STANDARD_BTN ); @@ -632,7 +628,7 @@ void SfxTabDialog::EnableApplyButton(sal_Bool bEnable) pImpl->pApplyButton = new PushButton( this ); // in the z-order, the apply button should be behind the ok button, thus appearing at the right side of it pImpl->pApplyButton->SetZOrder(&aOKBtn, WINDOW_ZORDER_BEHIND); - pImpl->pApplyButton->SetText( String( SfxResId( STR_APPLY ) ) ); + pImpl->pApplyButton->SetText( SfxResId( STR_APPLY ).toString() ); pImpl->pApplyButton->Show(); pImpl->pApplyButton->SetHelpId( HID_TABDLG_APPLY_BTN ); @@ -877,6 +873,14 @@ SfxTabPage* SfxTabDialog::GetTabPage( sal_uInt16 nPageId ) const return NULL; } +void SfxTabDialog::SavePosAndId() +{ + // save settings (screen position and current page) + SvtViewOptions aDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) ); + aDlgOpt.SetWindowState(OStringToOUString(GetWindowState(WINDOWSTATE_MASK_POS),RTL_TEXTENCODING_ASCII_US)); + aDlgOpt.SetPageID( aTabCtrl.GetCurPageId() ); +} + // ----------------------------------------------------------------------- short SfxTabDialog::Ok() @@ -884,6 +888,10 @@ short SfxTabDialog::Ok() /* [Description] Ok handler for the Dialogue. + + Dialog's current location and current page are saved for the next time + the dialog is shown. + The OutputSet is created and for each page this or the special OutputSet is set by calling the method <SfxTabPage::FillItemSet(SfxItemSet &)>, to insert the entered data by the user into the set. @@ -895,6 +903,8 @@ short SfxTabDialog::Ok() */ { + SavePosAndId(); //See fdo#38828 "Apply" resetting window position + pImpl->bInOK = sal_True; if ( !pOutSet ) diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index 6169998dd946..e2de2dd28713 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -35,17 +35,16 @@ #include "sfxlocal.hrc" #include "helpid.hrc" -/** === begin UNO includes === **/ #include <com/sun/star/frame/XModuleManager.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/ui/XToolPanel.hpp> #include <com/sun/star/ui/XUIElementFactory.hpp> #include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/awt/PosSize.hpp> +#include <com/sun/star/graphic/GraphicProvider.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/awt/XControl.hpp> -/** === end UNO includes === **/ #include <comphelper/componentcontext.hxx> #include <comphelper/namedvaluecollection.hxx> @@ -69,6 +68,7 @@ namespace sfx2 /** === begin UNO using === **/ using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::uno::XInterface; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::UNO_QUERY_THROW; @@ -188,8 +188,8 @@ namespace sfx2 } // otherwise, delegate to the GraphicProvider - const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - const Reference< XGraphicProvider > xGraphicProvider( aContext.createComponent( "com.sun.star.graphic.GraphicProvider" ), UNO_QUERY_THROW ); + const Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + const Reference< XGraphicProvider > xGraphicProvider( com::sun::star::graphic::GraphicProvider::create(xContext) ); const Reference< XGraphic > xGraphic( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_SET_THROW ); return Image( xGraphic ); @@ -213,7 +213,7 @@ namespace sfx2 ,m_aPaneController( m_aTaskPane, *this ) { m_aTaskPane.Show(); - SetText( String( SfxResId( SID_TASKPANE ) ) ); + SetText( SfxResId( SID_TASKPANE ).toString() ); } //------------------------------------------------------------------------------------------------------------------ @@ -941,7 +941,7 @@ namespace sfx2 { m_rDockingWindow.ResetToolBox(); m_nViewMenuID = m_rDockingWindow.AddDropDownToolBoxItem( - String( SfxResId( STR_SFX_TASK_PANE_VIEW ) ), + SfxResId( STR_SFX_TASK_PANE_VIEW ).toString(), HID_TASKPANE_VIEW_MENU, LINK( this, TaskPaneController_Impl, OnToolboxClicked ) ); @@ -957,7 +957,7 @@ namespace sfx2 m_aPanelRepository.push_back( PanelDescriptor( pPanel ) ); } - SetDefaultTitle( String( SfxResId( STR_SFX_TASKS ) ) ); + SetDefaultTitle( SfxResId( STR_SFX_TASKS ).toString() ); } //------------------------------------------------------------------------------------------------------------------ @@ -1245,9 +1245,9 @@ namespace sfx2 pMenu->InsertSeparator(); #if OSL_DEBUG_LEVEL > 0 - pMenu->InsertItem( MID_LAYOUT_TABS, String::CreateFromAscii( "Tab-Layout (exp.)" ), MIB_CHECKABLE ); + pMenu->InsertItem( MID_LAYOUT_TABS, rtl::OUString("Tab-Layout (exp.)"), MIB_CHECKABLE ); pMenu->CheckItem( MID_LAYOUT_TABS, impl_getLayout() != LAYOUT_DRAWERS ); - pMenu->InsertItem( MID_LAYOUT_DRAWERS, String::CreateFromAscii( "Drawer-Layout" ), MIB_CHECKABLE ); + pMenu->InsertItem( MID_LAYOUT_DRAWERS, rtl::OUString("Drawer-Layout"), MIB_CHECKABLE ); pMenu->CheckItem( MID_LAYOUT_DRAWERS, impl_getLayout() == LAYOUT_DRAWERS ); pMenu->InsertSeparator(); @@ -1257,12 +1257,12 @@ namespace sfx2 if ( m_rDockingWindow.IsFloatingMode() ) pMenu->InsertItem( MID_LOCK_TASK_PANEL, - String( SfxResId( STR_SFX_DOCK ) ) + SfxResId( STR_SFX_DOCK ).toString() ); else pMenu->InsertItem( MID_UNLOCK_TASK_PANEL, - String( SfxResId( STR_SFX_UNDOCK ) ) + SfxResId( STR_SFX_UNDOCK ).toString() ); pMenu->RemoveDisabledEntries( sal_False, sal_False ); diff --git a/sfx2/source/dialog/taskpane.src b/sfx2/source/dialog/taskpane.src index 5a955e8587d1..f4e99242acff 100644 --- a/sfx2/source/dialog/taskpane.src +++ b/sfx2/source/dialog/taskpane.src @@ -1,28 +1,20 @@ -/************************************************************************* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +/* + * This file is part of the LibreOffice project. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * OpenOffice.org - a multi-platform office productivity suite + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include <sfx2/sfx.hrc> #include "sfxlocal.hrc" diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index e06df27a42af..8991589f1690 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -96,20 +96,13 @@ static sal_uInt16 nLastItemId = USHRT_MAX; // filter box has maximum 12 entries visible #define MAX_FILTER_ENTRIES 12 -// Special constant to save hierarchical mode -// We've to use this hack since this is not the -// index in the filter listbox that is saved but the -// index in the filters list and hierarchical is not -// in it -#define HIERARCHICAL_FILTER_INDEX 0xfffe // 0xffff is reserved - //========================================================================= TYPEINIT0(SfxCommonTemplateDialog_Impl); TYPEINIT1(SfxTemplateDialog_Impl,SfxCommonTemplateDialog_Impl); TYPEINIT1(SfxTemplateCatalog_Impl,SfxCommonTemplateDialog_Impl); -SFX_IMPL_DOCKINGWINDOW(SfxTemplateDialogWrapper, SID_STYLE_DESIGNER) +SFX_IMPL_DOCKINGWINDOW_WITHID(SfxTemplateDialogWrapper, SID_STYLE_DESIGNER) //------------------------------------------------------------------------- @@ -427,8 +420,7 @@ void SfxTemplateDialogWrapper::SetParagraphFamily() } //========================================================================= -SV_DECL_PTRARR_DEL(ExpandedEntries, StringPtr,16) -SV_IMPL_PTRARR(ExpandedEntries, StringPtr) +typedef std::vector<rtl::OUString> ExpandedEntries_t; /* [Description] @@ -463,7 +455,7 @@ public: using SvLBox::GetParent; const String& GetParent() const { return aParent; } const String& GetStyle() const { return aStyle; } - void MakeExpanded_Impl(ExpandedEntries& rEntries) const; + void MakeExpanded_Impl(ExpandedEntries_t& rEntries) const; virtual PopupMenu* CreateContextMenu( void ); }; @@ -471,16 +463,14 @@ public: //------------------------------------------------------------------------- -void StyleTreeListBox_Impl::MakeExpanded_Impl(ExpandedEntries& rEntries) const +void StyleTreeListBox_Impl::MakeExpanded_Impl(ExpandedEntries_t& rEntries) const { SvLBoxEntry *pEntry; - sal_uInt16 nCount=0; for(pEntry=(SvLBoxEntry*)FirstVisible();pEntry;pEntry=(SvLBoxEntry*)NextVisible(pEntry)) { if(IsExpanded(pEntry)) { - StringPtr pString=new String(GetEntryText(pEntry)); - rEntries.Insert(pString,nCount++); + rEntries.push_back(GetEntryText(pEntry)); } } } @@ -624,7 +614,6 @@ StyleTreeListBox_Impl::StyleTreeListBox_Impl( class StyleTreeArr_Impl; - /* [Description] Internal structure for the establishment of the hierarchical view @@ -645,14 +634,20 @@ struct StyleTree_Impl sal_uIntPtr Count(); }; -typedef StyleTree_Impl* StyleTree_ImplPtr; -SV_DECL_PTRARR_DEL(StyleTreeArr_Impl, StyleTree_ImplPtr, 16) -SV_IMPL_PTRARR(StyleTreeArr_Impl, StyleTree_ImplPtr) +class StyleTreeArr_Impl : public std::vector<StyleTree_Impl*> +{ +public: + ~StyleTreeArr_Impl() + { + for(const_iterator it = begin(); it != end(); ++it) + delete *it; + } +}; sal_uIntPtr StyleTree_Impl::Count() { - return pChildren ? pChildren->Count() : 0L; + return pChildren ? pChildren->size() : 0L; } //------------------------------------------------------------------------- @@ -670,15 +665,16 @@ void StyleTree_Impl::Put(StyleTree_Impl* pIns, sal_uIntPtr lPos) pChildren = new StyleTreeArr_Impl; if ( ULONG_MAX == lPos ) - lPos = pChildren->Count(); - pChildren->Insert( pIns, (sal_uInt16)lPos ); + pChildren->push_back( pIns ); + else + pChildren->insert( pChildren->begin() + (sal_uInt16)lPos, pIns ); } //------------------------------------------------------------------------- StyleTreeArr_Impl &MakeTree_Impl(StyleTreeArr_Impl &rArr) { - const sal_uInt16 nCount = rArr.Count(); + const sal_uInt16 nCount = rArr.size(); comphelper::string::NaturalStringSorter aSorter( ::comphelper::getProcessComponentContext(), @@ -688,12 +684,12 @@ StyleTreeArr_Impl &MakeTree_Impl(StyleTreeArr_Impl &rArr) sal_uInt16 i; for(i = 0; i < nCount; ++i) { - StyleTree_ImplPtr pEntry = rArr[i]; + StyleTree_Impl* pEntry = rArr[i]; if(pEntry->HasParent()) { for(sal_uInt16 j = 0; j < nCount; ++j) { - StyleTree_ImplPtr pCmp = rArr[j]; + StyleTree_Impl* pCmp = rArr[j]; if(pCmp->aName == pEntry->aParent) { // Paste initial filter @@ -708,10 +704,10 @@ StyleTreeArr_Impl &MakeTree_Impl(StyleTreeArr_Impl &rArr) } } - for(i = 0; i < rArr.Count(); ) + for(i = 0; i < rArr.size(); ) { if(rArr[i]->HasParent()) - rArr.Remove(i); + rArr.erase(rArr.begin() + i); else ++i; } @@ -721,25 +717,26 @@ StyleTreeArr_Impl &MakeTree_Impl(StyleTreeArr_Impl &rArr) //------------------------------------------------------------------------- -inline sal_Bool IsExpanded_Impl( const ExpandedEntries& rEntries, - const String &rStr) +inline sal_Bool IsExpanded_Impl( const ExpandedEntries_t& rEntries, + const rtl::OUString &rStr) { - sal_uInt16 nCount=rEntries.Count(); - for(sal_uInt16 n=0;n<nCount;n++) - if(*rEntries[n]==rStr) + for (size_t n = 0; n < rEntries.size(); ++n) + { + if (rEntries[n] == rStr) return sal_True; + } return sal_False; } SvLBoxEntry* FillBox_Impl(SvTreeListBox *pBox, - StyleTree_ImplPtr pEntry, - const ExpandedEntries& rEntries, + StyleTree_Impl* pEntry, + const ExpandedEntries_t& rEntries, SvLBoxEntry* pParent = 0) { SvLBoxEntry* pNewEntry = pBox->InsertEntry(pEntry->aName, pParent); - const sal_uInt16 nCount = pEntry->pChildren? pEntry->pChildren->Count(): 0; + const sal_uInt16 nCount = pEntry->pChildren ? pEntry->pChildren->size() : 0; for(sal_uInt16 i = 0; i < nCount; ++i) FillBox_Impl(pBox, (*pEntry->pChildren)[i], rEntries, pNewEntry); return pNewEntry; @@ -785,7 +782,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx bHierarchical ( sal_False ), bBindingUpdate ( sal_True ) { - aFmtLb.SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST)); + aFmtLb.SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST).toString()); aFmtLb.SetHelpId( HID_TEMPLATE_FMT ); aFilterLb.SetHelpId( HID_TEMPLATE_FILTER ); aFmtLb.SetStyle( aFmtLb.GetStyle() | WB_SORT | WB_HIDESELECTION ); @@ -1184,22 +1181,22 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox() pTreeBox->SetDragDropMode(SV_DRAGDROP_NONE); while(pStyle) { - StyleTree_ImplPtr pNew = + StyleTree_Impl* pNew = new StyleTree_Impl(pStyle->GetName(), pStyle->GetParent()); - aArr.Insert(pNew, aArr.Count()); + aArr.push_back(pNew); pStyle = pStyleSheetPool->Next(); } MakeTree_Impl(aArr); - ExpandedEntries aEntries; + ExpandedEntries_t aEntries; if(pTreeBox) ((const StyleTreeListBox_Impl *)pTreeBox)-> MakeExpanded_Impl( aEntries); pTreeBox->SetUpdateMode( sal_False ); pTreeBox->Clear(); - const sal_uInt16 nCount = aArr.Count(); + const sal_uInt16 nCount = aArr.size(); for(sal_uInt16 i = 0; i < nCount; ++i) FillBox_Impl(pTreeBox, aArr[i], aEntries); -; + EnableItem(SID_STYLE_WATERCAN,sal_False); SfxTemplateItem* pState = pFamilyState[nActFamily-1]; @@ -1274,7 +1271,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) aFilterLb.SetUpdateMode(sal_False); aFilterLb.Clear(); //insert hierarchical at the beginning - sal_uInt16 nPos = aFilterLb.InsertEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)), 0); + sal_uInt16 nPos = aFilterLb.InsertEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString(), 0); aFilterLb.SetEntryData( nPos, (void*)(sal_uIntPtr)SFXSTYLEBIT_ALL ); const SfxStyleFilter& rFilter = pItem->GetFilterList(); for( size_t i = 0; i < rFilter.size(); ++i) @@ -1296,7 +1293,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) // if the tree view again, select family hierarchy if(pTreeBox) - aFilterLb.SelectEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL))); + aFilterLb.SelectEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString()); // show maximum 12 entries aFilterLb.SetDropDownLineCount( MAX_FILTER_ENTRIES ); @@ -1747,7 +1744,7 @@ sal_Bool SfxCommonTemplateDialog_Impl::Execute_Impl( // Handler der Listbox der Filter IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox ) { - if ( pBox->GetSelectEntry() == String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)) ) + if ( SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString().equals(pBox->GetSelectEntry()) ) { if ( !bHierarchical ) { @@ -1772,13 +1769,9 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox ) ((StyleTreeListBox_Impl*)pTreeBox)-> SetDropHdl(LINK(this, SfxCommonTemplateDialog_Impl, DropHdl)); pTreeBox->SetIndent(10); - SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame(); - SfxObjectShell *pDocShell = pViewFrame->GetObjectShell(); - if (pDocShell) - SaveFactoryStyleFilter( pDocShell, HIERARCHICAL_FILTER_INDEX ); FillTreeBox(); SelectStyle(aSelectEntry); - pTreeBox->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST)); + pTreeBox->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST).toString()); pTreeBox->Show(); } } @@ -2041,8 +2034,8 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *) { String aMsg; if ( pStyle->IsUsed() ) - aMsg = String( SfxResId( STR_DELETE_STYLE_USED ) ); - aMsg += String ( SfxResId( STR_DELETE_STYLE ) ); + aMsg = SfxResId(STR_DELETE_STYLE_USED).toString(); + aMsg += SfxResId(STR_DELETE_STYLE).toString(); aMsg.SearchAndReplaceAscii( "$1", aTemplName ); #if defined UNX QueryBox aBox( SFX_APP()->GetTopWindow(), WB_YES_NO | WB_DEF_NO, aMsg ); @@ -2263,9 +2256,6 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl( { pDlgWindow->FreeResource(); - SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame(); - pCurObjShell = pViewFrame->GetObjectShell(); - sal_uInt16 nSavedFilter = static_cast< sal_uInt16 >( LoadFactoryStyleFilter( pCurObjShell ) ); Initialize(); m_aActionTbL.SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxLSelect)); @@ -2277,12 +2267,6 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl( aFont.SetWeight( WEIGHT_NORMAL ); aFilterLb.SetFont( aFont ); m_aActionTbL.SetHelpId( HID_TEMPLDLG_TOOLBOX_LEFT ); - if( nSavedFilter == HIERARCHICAL_FILTER_INDEX ) - { - bHierarchical = sal_False; // Force content refresh - aFilterLb.SelectEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL))); - FilterSelectHdl(&aFilterLb); - } } // ------------------------------------------------------------------------ @@ -2571,12 +2555,12 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox ) boost::scoped_ptr<PopupMenu> pMenu(new PopupMenu); uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()-> - createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.frame.UICommandDescription")) ), uno::UNO_QUERY ); + createInstance( ::rtl::OUString( + "com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY ); uno::Reference< container::XNameAccess > xUICommands; if ( xNameAccess.is() ) { - rtl::OUString sTextDoc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument")); + rtl::OUString sTextDoc("com.sun.star.text.TextDocument"); if(xNameAccess->hasByName(sTextDoc)) { uno::Any a = xNameAccess->getByName( sTextDoc ); @@ -2588,18 +2572,18 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox ) try { uno::Sequence< beans::PropertyValue > aPropSeq; - uno::Any aCommand = xUICommands->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:StyleNewByExample"))); + uno::Any aCommand = xUICommands->getByName(::rtl::OUString(".uno:StyleNewByExample")); ::rtl::OUString sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_STYLE_NEW_BY_EXAMPLE, sLabel ); pMenu->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, HID_TEMPLDLG_NEWBYEXAMPLE); - aCommand = xUICommands->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:StyleUpdateByExample"))); + aCommand = xUICommands->getByName(::rtl::OUString(".uno:StyleUpdateByExample")); sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_STYLE_UPDATE_BY_EXAMPLE, sLabel ); pMenu->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, HID_TEMPLDLG_UPDATEBYEXAMPLE); - aCommand = xUICommands->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:LoadStyles"))); + aCommand = xUICommands->getByName(::rtl::OUString(".uno:LoadStyles")); sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_TEMPLATE_LOAD, sLabel ); pMenu->SetHelpId(SID_TEMPLATE_LOAD, ".uno:LoadStyles"); @@ -2694,7 +2678,7 @@ IMPL_LINK_INLINE_END( SfxTemplateCatalog_Impl, CancelHdl, Button *, pButton ) IMPL_LINK_INLINE_START( SfxTemplateCatalog_Impl, NewHdl, Button *, pButton ) { (void)pButton; //unused - aCancelBtn.SetText( String( SfxResId( STR_CLOSE ) ) ); + aCancelBtn.SetText( SfxResId(STR_CLOSE).toString() ); SfxCommonTemplateDialog_Impl::NewHdl( NULL ); return 0; } @@ -2705,7 +2689,7 @@ IMPL_LINK_INLINE_END( SfxTemplateCatalog_Impl, NewHdl, Button *, pButton ) IMPL_LINK_INLINE_START( SfxTemplateCatalog_Impl, ChangeHdl, Button *, pButton ) { (void)pButton; //unused - aCancelBtn.SetText( String( SfxResId( STR_CLOSE ) ) ); + aCancelBtn.SetText( SfxResId(STR_CLOSE).toString() ); SfxCommonTemplateDialog_Impl::EditHdl( NULL ); return 0; } @@ -2726,7 +2710,7 @@ IMPL_LINK_INLINE_END( SfxTemplateCatalog_Impl, DelHdl, Button *, pButton ) IMPL_LINK( SfxTemplateCatalog_Impl, OrgHdl, Button *, pButton ) { (void)pButton; //unused - aCancelBtn.SetText( String( SfxResId( STR_CLOSE ) ) ); + aCancelBtn.SetText( SfxResId(STR_CLOSE).toString() ); SfxDocumentTemplates aTemplates; aTemplates.Construct(); SfxTemplateOrganizeDlg* pDlg = new SfxTemplateOrganizeDlg( pReal, &aTemplates ); @@ -2835,7 +2819,7 @@ void SfxTemplateCatalog_Impl::ClearFamilyList() void SfxTemplateCatalog_Impl::PrepareDeleteAction() { aDelBtn.Disable(); - aCancelBtn.SetText( String( SfxResId( STR_CLOSE ) ) ); + aCancelBtn.SetText( SfxResId(STR_CLOSE).toString() ); } diff --git a/sfx2/source/dialog/templdlg.hrc b/sfx2/source/dialog/templdlg.hrc index 1a22fb2d50fc..c5808a4a48e8 100644 --- a/sfx2/source/dialog/templdlg.hrc +++ b/sfx2/source/dialog/templdlg.hrc @@ -24,7 +24,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#define TB_FMT 1 #define LB_FMT 3 #define BTN_EDIT 11 #define BTN_DELETE 12 @@ -32,12 +31,6 @@ #define BTN_NEW 10 #define LB_FILTER 4 -#define ID_APPLY_TEMPLATE 10 - -#define ID_NEW_STYLE_BY_EXAMPLE 20 -#define ID_UPDATE_STYLE_BY_EXAMPLE 21 -#define ID_TREEVIEW 22 - #define BT_OK 1 #define BT_CANCEL 2 #define BT_ORG 3 diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src index 7075d1963757..920d6a5569b9 100644 --- a/sfx2/source/dialog/templdlg.src +++ b/sfx2/source/dialog/templdlg.src @@ -190,21 +190,3 @@ DockingWindow DLG_STYLE_DESIGNER }; }; }; - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/dialog/tplcitem.cxx b/sfx2/source/dialog/tplcitem.cxx index e5d79fe866f3..2fffb3a3997a 100644 --- a/sfx2/source/dialog/tplcitem.cxx +++ b/sfx2/source/dialog/tplcitem.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ - -// INCLUDE --------------------------------------------------------------- - #include <svl/intitem.hxx> #include <vcl/svapp.hxx> diff --git a/sfx2/source/dialog/tplpitem.cxx b/sfx2/source/dialog/tplpitem.cxx index 0aadf2d9d3e6..012b5be007de 100644 --- a/sfx2/source/dialog/tplpitem.cxx +++ b/sfx2/source/dialog/tplpitem.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ - -// INCLUDE --------------------------------------------------------------- - #include "sfx2/tplpitem.hxx" #include <com/sun/star/frame/status/Template.hpp> diff --git a/sfx2/source/dialog/versdlg.hrc b/sfx2/source/dialog/versdlg.hrc index 2de7596221e1..f21b3b4e8ebc 100644 --- a/sfx2/source/dialog/versdlg.hrc +++ b/sfx2/source/dialog/versdlg.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include <dialog.hrc> @@ -44,5 +35,4 @@ #define PB_OK 15 #define PB_CANCEL 16 #define PB_COMPARE 17 -#define PB_MERGE 18 diff --git a/sfx2/source/dialog/versdlg.src b/sfx2/source/dialog/versdlg.src index a86de72fec81..14f5a3ec6935 100644 --- a/sfx2/source/dialog/versdlg.src +++ b/sfx2/source/dialog/versdlg.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "versdlg.hrc" ModalDialog DLG_VERSIONS @@ -194,28 +185,3 @@ String DLG_COMMENTS { Text [ en-US ] = "Version comment" ; }; - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index d27df1dece1d..4fb52ecc7247 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -116,6 +116,13 @@ static bool isStylesFile (::rtl::OUString const & i_rPath) return i_rPath == s_styles; } +bool isValidXmlId(::rtl::OUString const & i_rStreamName, + ::rtl::OUString const & i_rIdref) +{ + return isValidNCName(i_rIdref) + && (isContentFile(i_rStreamName) || isStylesFile(i_rStreamName)); +} + static bool isReservedFile(::rtl::OUString const & i_rPath) { return isContentFile(i_rPath) || isStylesFile(i_rPath) || i_rPath == s_meta || i_rPath == s_settings; @@ -153,8 +160,8 @@ uno::Reference<rdf::XURI> createBaseURI( i_xContext->getServiceManager(), uno::UNO_SET_THROW); const uno::Reference<uri::XUriReferenceFactory> xUriFactory( xServiceFactory->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.uri.UriReferenceFactory")), i_xContext), + ::rtl::OUString( + "com.sun.star.uri.UriReferenceFactory"), i_xContext), uno::UNO_QUERY_THROW); uno::Reference< uri::XUriReference > xBaseURI; @@ -325,8 +332,8 @@ addFile(struct DocumentMetadataAccess_Impl & i_rImpl, throw; } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "addFile: exception")), /*this*/0, uno::makeAny(e)); + ::rtl::OUString( + "addFile: exception"), /*this*/0, uno::makeAny(e)); } } @@ -374,7 +381,7 @@ removeFile(struct DocumentMetadataAccess_Impl & i_rImpl, throw; } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("removeFile: exception")), + ::rtl::OUString("removeFile: exception"), 0, uno::makeAny(e)); } } @@ -403,7 +410,7 @@ getAllParts(struct DocumentMetadataAccess_Impl & i_rImpl) throw; } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("getAllParts: exception")), + ::rtl::OUString("getAllParts: exception"), 0, uno::makeAny(e)); } } @@ -425,7 +432,7 @@ isPartOfType(struct DocumentMetadataAccess_Impl & i_rImpl, throw; } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("isPartOfType: exception")), + ::rtl::OUString("isPartOfType: exception"), 0, uno::makeAny(e)); } } @@ -441,10 +448,10 @@ mkException( ::rtl::OUString const & i_rMessage, iaioe.Classification = task::InteractionClassification_ERROR; iaioe.Code = i_ErrorCode; - const beans::PropertyValue uriProp(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")), + const beans::PropertyValue uriProp(::rtl::OUString("Uri"), -1, uno::makeAny(i_rUri), static_cast<beans::PropertyState>(0)); const beans::PropertyValue rnProp( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ResourceName")), + ::rtl::OUString("ResourceName"), -1, uno::makeAny(i_rResource), static_cast<beans::PropertyState>(0)); iaioe.Arguments = ::comphelper::makeSequence( uno::makeAny(uriProp), uno::makeAny(rnProp)); @@ -464,8 +471,8 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException, const uno::Reference<task::XInteractionHandler> & i_xHandler) { if (!i_xHandler.is()) { - throw lang::WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "DocumentMetadataAccess::loadMetadataFromStorage: exception")), + throw lang::WrappedTargetException(::rtl::OUString( + "DocumentMetadataAccess::loadMetadataFromStorage: exception"), /* *this*/ 0, uno::makeAny(i_rException)); } @@ -488,8 +495,8 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException, return false; } else { OSL_ENSURE(pAbort->wasSelected(), "no continuation selected?"); - throw lang::WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "DocumentMetadataAccess::loadMetadataFromStorage: exception")), + throw lang::WrappedTargetException(::rtl::OUString( + "DocumentMetadataAccess::loadMetadataFromStorage: exception"), /* *this*/ 0, uno::makeAny(i_rException)); } } @@ -501,8 +508,8 @@ collectFilesFromStorage(uno::Reference<embed::XStorage> const& i_xStorage, ::rtl::OUString i_Path, std::set< ::rtl::OUString > & o_rFiles) { - static ::rtl::OUString content(RTL_CONSTASCII_USTRINGPARAM(s_content)); - static ::rtl::OUString styles(RTL_CONSTASCII_USTRINGPARAM(s_styles )); + static ::rtl::OUString content(s_content); + static ::rtl::OUString styles(s_styles ); try { if (i_xStorage->hasByName(content) && i_xStorage->isStreamElement(content)) @@ -545,8 +552,8 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl, i_rImpl.m_xRepository->importGraph(rdf::FileFormat::RDF_XML, xInStream, xURI, xBaseURI); } else { - throw mkException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "readStream: is not a stream")), + throw mkException(::rtl::OUString( + "readStream: is not a stream"), ucb::IOErrorCode_NO_FILE, i_rBaseURI + i_rPath, i_rPath); } } else { @@ -572,8 +579,8 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl, buf.append(dir).append(static_cast<sal_Unicode>('/')); readStream(i_rImpl, xDir, rest, buf.makeStringAndClear() ); } else { - throw mkException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "readStream: is not a directory")), + throw mkException(::rtl::OUString( + "readStream: is not a directory"), ucb::IOErrorCode_NO_DIRECTORY, i_rBaseURI + dir, dir); } } @@ -606,7 +613,7 @@ retry: throw; } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("importFile: exception")), + ::rtl::OUString("importFile: exception"), 0, uno::makeAny(e)); } } @@ -627,8 +634,8 @@ exportStream(struct DocumentMetadataAccess_Impl & i_rImpl, uno::UNO_QUERY); if (xStreamProps.is()) { // this is NOT supported in FileSystemStorage xStreamProps->setPropertyValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), - uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_rdfxml)))); + ::rtl::OUString("MediaType"), + uno::makeAny(::rtl::OUString(s_rdfxml))); } const uno::Reference<io::XOutputStream> xOutStream( xStream->getOutputStream(), uno::UNO_SET_THROW ); @@ -747,9 +754,9 @@ retry: if (rterr.hasValue()) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + ::rtl::OUString( "DocumentMetadataAccess::loadMetadataFromStorage: " - "exception")), 0, rterr); + "exception"), 0, rterr); } if (err) { @@ -773,7 +780,7 @@ static void init(struct DocumentMetadataAccess_Impl & i_rImpl) getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext).get()); } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("init: unexpected exception")), 0, + ::rtl::OUString("init: unexpected exception"), 0, uno::makeAny(e)); } @@ -860,8 +867,8 @@ throw (uno::RuntimeException) const IXmlIdRegistry * pReg( m_pImpl->m_rXmlIdRegistrySupplier.GetXmlIdRegistry() ); if (!pReg) { - throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "DocumentMetadataAccess::getElementByXmlId: no registry")), *this); + throw uno::RuntimeException(::rtl::OUString( + "DocumentMetadataAccess::getElementByXmlId: no registry"), *this); } return pReg->GetElementByMetadataReference(i_rReference); } @@ -872,8 +879,8 @@ DocumentMetadataAccess::getElementByURI( throw (uno::RuntimeException, lang::IllegalArgumentException) { if (!i_xURI.is()) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "DocumentMetadataAccess::getElementByURI: URI is null")), *this, 0); + throw lang::IllegalArgumentException(::rtl::OUString( + "DocumentMetadataAccess::getElementByURI: URI is null"), *this, 0); } const ::rtl::OUString baseURI( m_pImpl->m_xBaseURI->getStringValue() ); @@ -898,9 +905,9 @@ DocumentMetadataAccess::getMetadataGraphsWithType( throw (uno::RuntimeException, lang::IllegalArgumentException) { if (!i_xType.is()) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::getMetadataGraphsWithType: " - "type is null")), *this, 0); + "type is null"), *this, 0); } ::comphelper::SequenceAsVector< uno::Reference< rdf::XURI > > ret; @@ -921,21 +928,21 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, container::ElementExistException) { if (!isFileNameValid(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "DocumentMetadataAccess::addMetadataFile: invalid FileName")), + throw lang::IllegalArgumentException(::rtl::OUString( + "DocumentMetadataAccess::addMetadataFile: invalid FileName"), *this, 0); } if (isReservedFile(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::addMetadataFile:" - "invalid FileName: reserved")), *this, 0); + "invalid FileName: reserved"), *this, 0); } for (sal_Int32 i = 0; i < i_rTypes.getLength(); ++i) { if (!i_rTypes[i].is()) { throw lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + ::rtl::OUString( "DocumentMetadataAccess::addMetadataFile: " - "null type")), *this, 2); + "null type"), *this, 2); } } @@ -946,8 +953,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, m_pImpl->m_xRepository->createGraph(xGraphName); } catch (const rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "DocumentMetadataAccess::addMetadataFile: exception")), + ::rtl::OUString( + "DocumentMetadataAccess::addMetadataFile: exception"), *this, uno::makeAny(e)); // note: all other exceptions are propagated } @@ -967,20 +974,20 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, container::ElementExistException, rdf::ParseException, io::IOException) { if (!isFileNameValid(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "DocumentMetadataAccess::importMetadataFile: invalid FileName")), + throw lang::IllegalArgumentException(::rtl::OUString( + "DocumentMetadataAccess::importMetadataFile: invalid FileName"), *this, 0); } if (isReservedFile(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::importMetadataFile:" - "invalid FileName: reserved")), *this, 0); + "invalid FileName: reserved"), *this, 0); } for (sal_Int32 i = 0; i < i_rTypes.getLength(); ++i) { if (!i_rTypes[i].is()) { throw lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "DocumentMetadataAccess::importMetadataFile: null type")), + ::rtl::OUString( + "DocumentMetadataAccess::importMetadataFile: null type"), *this, 5); } } @@ -993,9 +1000,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, i_Format, i_xInStream, xGraphName, i_xBaseURI); } catch (const rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + ::rtl::OUString( "DocumentMetadataAccess::importMetadataFile: " - "RepositoryException")), *this, uno::makeAny(e)); + "RepositoryException"), *this, uno::makeAny(e)); // note: all other exceptions are propagated } @@ -1014,9 +1021,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, m_pImpl->m_xRepository->destroyGraph(i_xGraphName); } catch (const rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + ::rtl::OUString( "DocumentMetadataAccess::removeMetadataFile: " - "RepositoryException")), *this, uno::makeAny(e)); + "RepositoryException"), *this, uno::makeAny(e)); // note: all other exceptions are propagated } @@ -1031,15 +1038,15 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, container::ElementExistException) { if (!isFileNameValid(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::addContentOrStylesFile: " - "invalid FileName")), *this, 0); + "invalid FileName"), *this, 0); } if (!addContentOrStylesFileImpl(*m_pImpl, i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::addContentOrStylesFile: " - "invalid FileName: must end with content.xml or styles.xml")), + "invalid FileName: must end with content.xml or styles.xml"), *this, 0); } } @@ -1051,9 +1058,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, container::NoSuchElementException) { if (!isFileNameValid(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::removeContentOrStylesFile: " - "invalid FileName")), *this, 0); + "invalid FileName"), *this, 0); } try { @@ -1066,9 +1073,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, uno::UNO_SET_THROW); if (!xEnum->hasMoreElements()) { throw container::NoSuchElementException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + ::rtl::OUString( "DocumentMetadataAccess::removeContentOrStylesFile: " - "cannot find stream in manifest graph: ")) + i_rFileName, + "cannot find stream in manifest graph: ") + i_rFileName, *this); } @@ -1079,8 +1086,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, throw; } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "DocumentMetadataAccess::removeContentOrStylesFile: exception")), + ::rtl::OUString( + "DocumentMetadataAccess::removeContentOrStylesFile: exception"), *this, uno::makeAny(e)); } } @@ -1093,32 +1100,32 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, lang::WrappedTargetException) { if (!i_xStorage.is()) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::loadMetadataFromStorage: " - "storage is null")), *this, 0); + "storage is null"), *this, 0); } if (!i_xBaseURI.is()) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::loadMetadataFromStorage: " - "base URI is null")), *this, 1); + "base URI is null"), *this, 1); } const ::rtl::OUString baseURI( i_xBaseURI->getStringValue()); if (baseURI.indexOf('#') >= 0) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::loadMetadataFromStorage: " - "base URI not absolute")), *this, 1); + "base URI not absolute"), *this, 1); } if (baseURI.isEmpty() || !baseURI.endsWithAsciiL("/", 1)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::loadMetadataFromStorage: " - "base URI does not end with slash")), *this, 1); + "base URI does not end with slash"), *this, 1); } initLoading(*m_pImpl, i_xStorage, i_xBaseURI, i_xHandler); std::set< ::rtl::OUString > StgFiles; collectFilesFromStorage(i_xStorage, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), StgFiles); + ::rtl::OUString(""), StgFiles); std::vector< ::rtl::OUString > MfstMetadataFiles; @@ -1185,9 +1192,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, throw; } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + ::rtl::OUString( "DocumentMetadataAccess::loadMetadataFromStorage: " - "exception")), *this, uno::makeAny(e)); + "exception"), *this, uno::makeAny(e)); } std::for_each(StgFiles.begin(), StgFiles.end(), @@ -1204,9 +1211,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, lang::WrappedTargetException) { if (!i_xStorage.is()) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::storeMetadataToStorage: " - "storage is null")), *this, 0); + "storage is null"), *this, 0); } // export manifest @@ -1220,12 +1227,12 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, } catch (const uno::RuntimeException &) { throw; } catch (const io::IOException & e) { - throw lang::WrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "storeMetadataToStorage: IO exception")), *this, uno::makeAny(e)); + throw lang::WrappedTargetException( ::rtl::OUString( + "storeMetadataToStorage: IO exception"), *this, uno::makeAny(e)); } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "storeMetadataToStorage: exception")), *this, uno::makeAny(e)); + ::rtl::OUString( + "storeMetadataToStorage: exception"), *this, uno::makeAny(e)); } // export metadata streams @@ -1258,20 +1265,20 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, throw; } catch (const io::IOException & e) { throw lang::WrappedTargetException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "storeMetadataToStorage: IO exception")), + ::rtl::OUString( + "storeMetadataToStorage: IO exception"), *this, uno::makeAny(e)); } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "storeMetadataToStorage: exception")), + ::rtl::OUString( + "storeMetadataToStorage: exception"), *this, uno::makeAny(e)); } } } catch (const rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "storeMetadataToStorage: exception")), *this, uno::makeAny(e)); + ::rtl::OUString( + "storeMetadataToStorage: exception"), *this, uno::makeAny(e)); } } @@ -1291,9 +1298,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, md[ ::comphelper::MediaDescriptor::PROP_INPUTSTREAM() ] >>= xIn; } if (!xIn.is() && URL.isEmpty()) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::loadMetadataFromMedium: " - "inalid medium: no URL, no input stream")), *this, 0); + "inalid medium: no URL, no input stream"), *this, 0); } uno::Reference<embed::XStorage> xStorage; try { @@ -1312,14 +1319,14 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, throw; } catch (const uno::Exception & e) { throw lang::WrappedTargetException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + ::rtl::OUString( "DocumentMetadataAccess::loadMetadataFromMedium: " - "exception")), *this, uno::makeAny(e)); + "exception"), *this, uno::makeAny(e)); } if (!xStorage.is()) { - throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw uno::RuntimeException(::rtl::OUString( "DocumentMetadataAccess::loadMetadataFromMedium: " - "cannot get Storage")), *this); + "cannot get Storage"), *this); } uno::Reference<rdf::XURI> xBaseURI; try { @@ -1347,9 +1354,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, ::rtl::OUString URL; md[ ::comphelper::MediaDescriptor::PROP_URL() ] >>= URL; if (URL.isEmpty()) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw lang::IllegalArgumentException(::rtl::OUString( "DocumentMetadataAccess::storeMetadataToMedium: " - "invalid medium: no URL")), *this, 0); + "invalid medium: no URL"), *this, 0); } SfxMedium aMedium(i_rMedium); @@ -1366,9 +1373,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, } if (!xStorage.is()) { - throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw uno::RuntimeException(::rtl::OUString( "DocumentMetadataAccess::storeMetadataToMedium: " - "cannot get Storage")), *this); + "cannot get Storage"), *this); } // set MIME type of the storage ::comphelper::MediaDescriptor::const_iterator iter diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx index 73374214251b..15639622b002 100644 --- a/sfx2/source/doc/Metadatable.cxx +++ b/sfx2/source/doc/Metadatable.cxx @@ -404,7 +404,7 @@ template< typename T > ::boost::unordered_map< ::rtl::OUString, T, ::rtl::OUStringHash > & i_rXmlIdMap) { static rtlRandomPool s_Pool( rtl_random_createPool() ); - const ::rtl::OUString prefix(RTL_CONSTASCII_USTRINGPARAM(s_prefix)); + const ::rtl::OUString prefix(s_prefix); typename ::boost::unordered_map< ::rtl::OUString, T, ::rtl::OUStringHash > ::const_iterator iter; ::rtl::OUString id; @@ -521,8 +521,8 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupElement( { if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "illegal XmlId")), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString( + "illegal XmlId"), 0, 0); } const XmlIdList_t * pList( LookupElementList(i_rStreamName, i_rIdref) ); @@ -687,15 +687,15 @@ XmlIdRegistryDocument::TryRegisterMetadatable(Metadatable & i_rObject, if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "illegal XmlId")), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString( + "illegal XmlId"), 0, 0); } if (i_rObject.IsInContent() ? !isContentFile(i_rStreamName) : !isStylesFile(i_rStreamName)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "illegal XmlId: wrong stream")), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString( + "illegal XmlId: wrong stream"), 0, 0); } ::rtl::OUString old_path; @@ -990,8 +990,8 @@ XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupEntry( { if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "illegal XmlId")), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString( + "illegal XmlId"), 0, 0); } const ClipboardXmlIdMap_t::const_iterator iter( m_XmlIdMap.find(i_rIdref) ); @@ -1119,15 +1119,15 @@ XmlIdRegistryClipboard::TryRegisterMetadatable(Metadatable & i_rObject, if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "illegal XmlId")), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString( + "illegal XmlId"), 0, 0); } if (i_rObject.IsInContent() ? !isContentFile(i_rStreamName) : !isStylesFile(i_rStreamName)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "illegal XmlId: wrong stream")), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString( + "illegal XmlId: wrong stream"), 0, 0); } ::rtl::OUString old_path; @@ -1256,8 +1256,8 @@ XmlIdRegistryClipboard::RegisterCopyClipboard(Metadatable & i_rCopy, if (!isValidXmlId(i_rReference.First, i_rReference.Second)) { - throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "illegal XmlId")), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString( + "illegal XmlId"), 0, 0); } if (!i_isLatent) @@ -1349,8 +1349,8 @@ Metadatable::SetMetadataReference( else { throw lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Metadatable::" - "SetMetadataReference: argument is invalid")), /*this*/0, 0); + ::rtl::OUString("Metadatable::" + "SetMetadataReference: argument is invalid"), /*this*/0, 0); } } } @@ -1616,8 +1616,8 @@ throw (uno::RuntimeException) if (!pObject) { throw uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "MetadatableMixin: cannot get core object; not inserted?")), + ::rtl::OUString( + "MetadatableMixin: cannot get core object; not inserted?"), *this); } return pObject->GetMetadataReference(); @@ -1634,8 +1634,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException) if (!pObject) { throw uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "MetadatableMixin: cannot get core object; not inserted?")), + ::rtl::OUString( + "MetadatableMixin: cannot get core object; not inserted?"), *this); } return pObject->SetMetadataReference(i_rReference); @@ -1650,8 +1650,8 @@ throw (uno::RuntimeException) if (!pObject) { throw uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "MetadatableMixin: cannot get core object; not inserted?")), + ::rtl::OUString( + "MetadatableMixin: cannot get core object; not inserted?"), *this); } return pObject->EnsureMetadataReference(); diff --git a/sfx2/source/doc/QuerySaveDocument.cxx b/sfx2/source/doc/QuerySaveDocument.cxx index 7ac2b6771809..1f355c2d8219 100644 --- a/sfx2/source/doc/QuerySaveDocument.cxx +++ b/sfx2/source/doc/QuerySaveDocument.cxx @@ -41,12 +41,12 @@ short ExecuteQuerySaveDocument(Window* _pParent,const String& _rTitle) { // don't block Desktop::terminate() if there's no user to ask return RET_NO; } - String aText( SfxResId( STR_QUERY_SAVE_DOCUMENT ) ); + String aText( SfxResId(STR_QUERY_SAVE_DOCUMENT).toString() ); aText.SearchAndReplace( DEFINE_CONST_UNICODE( "$(DOC)" ), _rTitle ); QueryBox aQBox( _pParent, WB_YES_NO_CANCEL | WB_DEF_YES, aText ); - aQBox.SetButtonText( BUTTONID_NO, SfxResId( STR_NOSAVEANDCLOSE ) ); - aQBox.SetButtonText( BUTTONID_YES, SfxResId( STR_SAVEDOC ) ); + aQBox.SetButtonText( BUTTONID_NO, SfxResId(STR_NOSAVEANDCLOSE).toString() ); + aQBox.SetButtonText( BUTTONID_YES, SfxResId(STR_SAVEDOC).toString() ); return aQBox.Execute(); } // ----------------------------------------------------------------------------- diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 2e5ff08e5bea..11f285824d84 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -655,30 +655,30 @@ SfxDocumentMetaData::getURLProperties( css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference< css::beans::XPropertyContainer> xPropArg( - xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.beans.PropertyBag")), m_xContext), + xMsf->createInstanceWithContext(::rtl::OUString( + "com.sun.star.beans.PropertyBag"), m_xContext), css::uno::UNO_QUERY_THROW); try { ::rtl::OUString dburl = - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL")); + ::rtl::OUString("DocumentBaseURL"); ::rtl::OUString hdn = - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HierarchicalDocumentName")); + ::rtl::OUString("HierarchicalDocumentName"); for (sal_Int32 i = 0; i < i_rMedium.getLength(); ++i) { if (i_rMedium[i].Name.equals(dburl)) { xPropArg->addProperty( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")), + ::rtl::OUString("BaseURI"), css::beans::PropertyAttribute::MAYBEVOID, i_rMedium[i].Value); } else if (i_rMedium[i].Name.equals(hdn)) { xPropArg->addProperty( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")), + ::rtl::OUString("StreamRelPath"), css::beans::PropertyAttribute::MAYBEVOID, i_rMedium[i].Value); } } - xPropArg->addProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), + xPropArg->addProperty(::rtl::OUString("StreamName"), css::beans::PropertyAttribute::MAYBEVOID, - css::uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta)))); + css::uno::makeAny(::rtl::OUString(s_meta))); } catch (const css::uno::Exception &) { // ignore } @@ -693,8 +693,8 @@ getNodeText(css::uno::Reference<css::xml::dom::XNode> i_xNode) throw (css::uno::RuntimeException) { if (!i_xNode.is()) throw css::uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::getNodeText: argument is null")), i_xNode); + ::rtl::OUString( + "SfxDocumentMetaData::getNodeText: argument is null"), i_xNode); for (css::uno::Reference<css::xml::dom::XNode> c = i_xNode->getFirstChild(); c.is(); c = c->getNextSibling()) { @@ -773,8 +773,8 @@ SfxDocumentMetaData::setMetaText(const char* i_name, } catch (const css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::setMetaText: DOM exception")), + ::rtl::OUString( + "SfxDocumentMetaData::setMetaText: DOM exception"), css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -910,8 +910,8 @@ SfxDocumentMetaData::setMetaList(const char* i_name, } catch (const css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::setMetaList: DOM exception")), + ::rtl::OUString( + "SfxDocumentMetaData::setMetaList: DOM exception"), css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -952,7 +952,7 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet) ::sax::Converter::convertBool(buf, b); values.push_back(buf.makeStringAndClear()); as.push_back(std::make_pair(vt, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("boolean")))); + ::rtl::OUString("boolean"))); } else if (type == ::cppu::UnoType< ::rtl::OUString>::get()) { ::rtl::OUString s; any >>= s; @@ -964,20 +964,20 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet) if (4 <= i) { as.push_back(std::make_pair(vt, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string")))); + ::rtl::OUString("string"))); } } else if (type == ::cppu::UnoType<css::util::DateTime>::get()) { css::util::DateTime dt; any >>= dt; values.push_back(dateTimeToText(dt)); as.push_back(std::make_pair(vt, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("date")))); + ::rtl::OUString("date"))); } else if (type == ::cppu::UnoType<css::util::Date>::get()) { css::util::Date d; any >>= d; values.push_back(dateToText(d)); as.push_back(std::make_pair(vt, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("date")))); + ::rtl::OUString("date"))); } else if (type == ::cppu::UnoType<css::util::Time>::get()) { // #i97029#: replaced by Duration // Time is supported for backward compatibility with OOo 3.x, x<=2 @@ -990,13 +990,13 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet) ud.MilliSeconds = 10 * ut.HundredthSeconds; values.push_back(durationToText(ud)); as.push_back(std::make_pair(vt, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("time")))); + ::rtl::OUString("time"))); } else if (type == ::cppu::UnoType<css::util::Duration>::get()) { css::util::Duration ud; any >>= ud; values.push_back(durationToText(ud)); as.push_back(std::make_pair(vt, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("time")))); + ::rtl::OUString("time"))); } else if (::cppu::UnoType<double>::get().isAssignableFrom(type)) { // support not just double, but anything that can be converted double d = 0; @@ -1005,7 +1005,7 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet) ::sax::Converter::convertDouble(buf, d); values.push_back(buf.makeStringAndClear()); as.push_back(std::make_pair(vt, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("float")))); + ::rtl::OUString("float"))); } else { DBG_WARNING1("SfxDocumentMetaData: unsupported property type: %s", OUStringToOString(any.getValueTypeName(), @@ -1051,8 +1051,8 @@ SfxDocumentMetaData::updateElement(const char *i_name, } catch (const css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::updateElement: DOM exception")), + ::rtl::OUString( + "SfxDocumentMetaData::updateElement: DOM exception"), css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -1074,10 +1074,10 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes() || isValidDateTime(m_TemplateDate)) { attributes.push_back(std::make_pair( static_cast<const char*>("xlink:type"), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("simple")))); + ::rtl::OUString("simple"))); attributes.push_back(std::make_pair( static_cast<const char*>("xlink:actuate"), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("onRequest")))); + ::rtl::OUString("onRequest"))); attributes.push_back(std::make_pair( static_cast<const char*>("xlink:title"), m_TemplateName)); attributes.push_back(std::make_pair( @@ -1128,18 +1128,18 @@ SfxDocumentMetaData::createDOM() const // throw (css::uno::RuntimeException) css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference<css::xml::dom::XDocumentBuilder> xBuilder( - xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.xml.dom.DocumentBuilder")), m_xContext), + xMsf->createInstanceWithContext(::rtl::OUString( + "com.sun.star.xml.dom.DocumentBuilder"), m_xContext), css::uno::UNO_QUERY_THROW ); if (!xBuilder.is()) throw css::uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::createDOM: " - "cannot create DocumentBuilder service")), + ::rtl::OUString("SfxDocumentMetaData::createDOM: " + "cannot create DocumentBuilder service"), *const_cast<SfxDocumentMetaData*>(this)); css::uno::Reference<css::xml::dom::XDocument> xDoc = xBuilder->newDocument(); if (!xDoc.is()) throw css::uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::createDOM: " - "cannot create new document")), + ::rtl::OUString("SfxDocumentMetaData::createDOM: " + "cannot create new document"), *const_cast<SfxDocumentMetaData*>(this)); return xDoc; } @@ -1148,8 +1148,8 @@ void SAL_CALL SfxDocumentMetaData::checkInit() const // throw (css::uno::RuntimeException) { if (!m_isInitialized) { - throw css::uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::checkInit: not initialized")), + throw css::uno::RuntimeException(::rtl::OUString( + "SfxDocumentMetaData::checkInit: not initialized"), *const_cast<SfxDocumentMetaData*>(this)); } DBG_ASSERT((m_xDoc.is() && m_xParent.is() ), @@ -1161,36 +1161,36 @@ void SAL_CALL SfxDocumentMetaData::init( css::uno::Reference<css::xml::dom::XDocument> i_xDoc) { if (!i_xDoc.is()) throw css::uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::init: no DOM tree given")), *this); + ::rtl::OUString( + "SfxDocumentMetaData::init: no DOM tree given"), *this); css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference<css::xml::xpath::XXPathAPI> xPath( - xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.xml.xpath.XPathAPI")), m_xContext), + xMsf->createInstanceWithContext(::rtl::OUString( + "com.sun.star.xml.xpath.XPathAPI"), m_xContext), css::uno::UNO_QUERY_THROW ); if (!xPath.is()) throw css::uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::init:" - " cannot create XPathAPI service")), *this); + ::rtl::OUString("SfxDocumentMetaData::init:" + " cannot create XPathAPI service"), *this); m_isInitialized = false; m_xDoc = i_xDoc; // select nodes for standard meta data stuff - xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xlink")), + xPath->registerNS(::rtl::OUString("xlink"), ::rtl::OUString::createFromAscii(s_nsXLink)); - xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dc")), + xPath->registerNS(::rtl::OUString("dc"), ::rtl::OUString::createFromAscii(s_nsDC)); - xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office")), + xPath->registerNS(::rtl::OUString("office"), ::rtl::OUString::createFromAscii(s_nsODF)); - xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta")), + xPath->registerNS(::rtl::OUString("meta"), ::rtl::OUString::createFromAscii(s_nsODFMeta)); // NB: we do not handle the single-XML-file ODF variant, which would // have the root element office:document. // The root of such documents must be converted in the importer! - ::rtl::OUString prefix(RTL_CONSTASCII_USTRINGPARAM( - "/child::office:document-meta/child::office:meta")); + ::rtl::OUString prefix( + "/child::office:document-meta/child::office:meta"); css::uno::Reference<css::xml::dom::XNode> xDocNode( m_xDoc, css::uno::UNO_QUERY_THROW); m_xParent.clear(); @@ -1229,27 +1229,27 @@ void SAL_CALL SfxDocumentMetaData::init( if (!xRElem.is()) { xRElem = i_xDoc->createElementNS( ::rtl::OUString::createFromAscii(s_nsODF), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:document-meta"))); + ::rtl::OUString("office:document-meta")); css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem, css::uno::UNO_QUERY_THROW); i_xDoc->appendChild(xRNode); } xRElem->setAttributeNS(::rtl::OUString::createFromAscii(s_nsODF), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:version")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1.0"))); + ::rtl::OUString("office:version"), + ::rtl::OUString("1.0")); // does not exist, otherwise m_xParent would not be null css::uno::Reference<css::xml::dom::XNode> xParent ( i_xDoc->createElementNS( ::rtl::OUString::createFromAscii(s_nsODF), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:meta"))), + ::rtl::OUString("office:meta")), css::uno::UNO_QUERY_THROW); xRElem->appendChild(xParent); m_xParent = xParent; } catch (const css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::init: DOM exception")), + ::rtl::OUString( + "SfxDocumentMetaData::init: DOM exception"), css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -1266,7 +1266,7 @@ void SAL_CALL SfxDocumentMetaData::init( // application-specific. css::uno::Reference<css::xml::dom::XNode> xNode = xPath->selectSingleNode(m_xParent, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("child::")) + name); + ::rtl::OUString("child::") + name); // Do not create an empty element if it is missing; // for certain elements, such as dateTime, this would be invalid m_meta[name] = xNode; @@ -1277,7 +1277,7 @@ void SAL_CALL SfxDocumentMetaData::init( ::rtl::OUString name = ::rtl::OUString::createFromAscii(*pName); css::uno::Reference<css::xml::dom::XNodeList> nodes = xPath->selectNodeList(m_xParent, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("child::")) + name); + ::rtl::OUString("child::") + name); std::vector<css::uno::Reference<css::xml::dom::XNode> > v; for (sal_Int32 i = 0; i < nodes->getLength(); ++i) { v.push_back(nodes->item(i)); @@ -1298,7 +1298,7 @@ void SAL_CALL SfxDocumentMetaData::init( std::vector<css::uno::Reference<css::xml::dom::XNode> > & vec = - m_metaList[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta:user-defined"))]; + m_metaList[::rtl::OUString("meta:user-defined")]; m_xUserDefined.clear(); // #i105826#: reset (may be re-initialization) if ( !vec.empty() ) { @@ -1313,10 +1313,10 @@ void SAL_CALL SfxDocumentMetaData::init( css::uno::Any any; ::rtl::OUString name = xElem->getAttributeNS( ::rtl::OUString::createFromAscii(s_nsODFMeta), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name"))); + ::rtl::OUString("name")); ::rtl::OUString type = xElem->getAttributeNS( ::rtl::OUString::createFromAscii(s_nsODFMeta), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value-type"))); + ::rtl::OUString("value-type")); ::rtl::OUString text = getNodeText(*it); if ( type == "float" ) { double d; @@ -1573,7 +1573,7 @@ SfxDocumentMetaData::setLanguage(const css::lang::Locale & the_value) { ::rtl::OUString text = the_value.Language; if (!the_value.Country.isEmpty()) { - text += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-")).concat(the_value.Country); + text += ::rtl::OUString("-").concat(the_value.Country); } setMetaTextAndNotify("dc:language", text); } @@ -1731,8 +1731,8 @@ SfxDocumentMetaData::setAutoloadSecs(::sal_Int32 the_value) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException) { if (the_value < 0) throw css::lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::setAutoloadSecs: argument is negative")), + ::rtl::OUString( + "SfxDocumentMetaData::setAutoloadSecs: argument is negative"), *this, 0); ::osl::ClearableMutexGuard g(m_aMutex); checkInit(); @@ -1845,8 +1845,8 @@ SfxDocumentMetaData::setEditingCycles(::sal_Int16 the_value) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException) { if (the_value < 0) throw css::lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::setEditingCycles: argument is negative")), + ::rtl::OUString( + "SfxDocumentMetaData::setEditingCycles: argument is negative"), *this, 0); ::rtl::OUStringBuffer buf; ::sax::Converter::convertNumber(buf, the_value); @@ -1865,8 +1865,8 @@ SfxDocumentMetaData::setEditingDuration(::sal_Int32 the_value) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException) { if (the_value < 0) throw css::lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::setEditingDuration: argument is negative")), + ::rtl::OUString( + "SfxDocumentMetaData::setEditingDuration: argument is negative"), *this, 0); setMetaTextAndNotify("meta:editing-duration", durationToText(the_value)); } @@ -1890,7 +1890,7 @@ SfxDocumentMetaData::resetUserData(const ::rtl::OUString & the_value) dateTimeToText(css::util::DateTime())); bModified |= setMetaText("meta:editing-duration", durationToText(0)); bModified |= setMetaText("meta:editing-cycles", - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1"))); + ::rtl::OUString("1")); if (bModified) { g.clear(); @@ -1919,14 +1919,14 @@ SfxDocumentMetaData::loadFromStorage( css::lang::WrappedTargetException, css::io::IOException) { if (!xStorage.is()) throw css::lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::loadFromStorage:" - " argument is null")), *this, 0); + ::rtl::OUString("SfxDocumentMetaData::loadFromStorage:" + " argument is null"), *this, 0); ::osl::MutexGuard g(m_aMutex); // open meta data file css::uno::Reference<css::io::XStream> xStream( xStorage->openStreamElement( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta)), + ::rtl::OUString(s_meta), css::embed::ElementModes::READ) ); if (!xStream.is()) throw css::uno::RuntimeException(); css::uno::Reference<css::io::XInputStream> xInStream = @@ -1937,12 +1937,12 @@ SfxDocumentMetaData::loadFromStorage( css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference<css::xml::sax::XParser> xParser ( - xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.xml.sax.Parser")), m_xContext), + xMsf->createInstanceWithContext(::rtl::OUString( + "com.sun.star.xml.sax.Parser"), m_xContext), css::uno::UNO_QUERY_THROW); if (!xParser.is()) throw css::uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::loadFromStorage:" - " cannot create Parser service")), *this); + ::rtl::OUString("SfxDocumentMetaData::loadFromStorage:" + " cannot create Parser service"), *this); css::xml::sax::InputSource input; input.aInputStream = xInStream; @@ -1957,12 +1957,12 @@ SfxDocumentMetaData::loadFromStorage( css::uno::Reference<css::beans::XPropertySet> xPropArg = getURLProperties(Medium); try { - xPropArg->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI"))) + xPropArg->getPropertyValue(::rtl::OUString("BaseURI")) >>= input.sSystemId; - input.sSystemId += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")).concat( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta))); + input.sSystemId += ::rtl::OUString("/").concat( + ::rtl::OUString(s_meta)); } catch (const css::uno::Exception &) { - input.sSystemId = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta)); + input.sSystemId = ::rtl::OUString(s_meta); } css::uno::Sequence< css::uno::Any > args(1); args[0] <<= xPropArg; @@ -1972,8 +1972,8 @@ SfxDocumentMetaData::loadFromStorage( ::rtl::OUString::createFromAscii(pServiceName), args, m_xContext), css::uno::UNO_QUERY_THROW); if (!xDocHandler.is()) throw css::uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::loadFromStorage:" - " cannot create XMLOasisMetaImporter service")), *this); + ::rtl::OUString("SfxDocumentMetaData::loadFromStorage:" + " cannot create XMLOasisMetaImporter service"), *this); css::uno::Reference<css::document::XImporter> xImp (xDocHandler, css::uno::UNO_QUERY_THROW); xImp->setTargetDocument(css::uno::Reference<css::lang::XComponent>(this)); @@ -1981,9 +1981,9 @@ SfxDocumentMetaData::loadFromStorage( try { xParser->parseStream(input); } catch (const css::xml::sax::SAXException &) { - throw css::io::WrongFormatException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + throw css::io::WrongFormatException(::rtl::OUString( "SfxDocumentMetaData::loadFromStorage:" - " XML parsing exception")), *this); + " XML parsing exception"), *this); } // NB: the implementation of XMLOasisMetaImporter calls initialize checkInit(); @@ -1997,8 +1997,8 @@ SfxDocumentMetaData::storeToStorage( css::lang::WrappedTargetException, css::io::IOException) { if (!xStorage.is()) throw css::lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::storeToStorage:" - " argument is null")), *this, 0); + ::rtl::OUString("SfxDocumentMetaData::storeToStorage:" + " argument is null"), *this, 0); ::osl::MutexGuard g(m_aMutex); checkInit(); @@ -2007,20 +2007,20 @@ SfxDocumentMetaData::storeToStorage( // write into storage css::uno::Reference<css::io::XStream> xStream = - xStorage->openStreamElement(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta)), + xStorage->openStreamElement(::rtl::OUString(s_meta), css::embed::ElementModes::WRITE | css::embed::ElementModes::TRUNCATE); if (!xStream.is()) throw css::uno::RuntimeException(); css::uno::Reference< css::beans::XPropertySet > xStreamProps(xStream, css::uno::UNO_QUERY_THROW); xStreamProps->setPropertyValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), - css::uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/xml")))); + ::rtl::OUString("MediaType"), + css::uno::makeAny(::rtl::OUString("text/xml"))); xStreamProps->setPropertyValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed")), + ::rtl::OUString("Compressed"), css::uno::makeAny(static_cast<sal_Bool> (sal_False))); xStreamProps->setPropertyValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption")), + ::rtl::OUString("UseCommonStoragePasswordEncryption"), css::uno::makeAny(static_cast<sal_Bool> (sal_False))); css::uno::Reference<css::io::XOutputStream> xOutStream = xStream->getOutputStream(); @@ -2028,8 +2028,8 @@ SfxDocumentMetaData::storeToStorage( css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference<css::io::XActiveDataSource> xSaxWriter( - xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.xml.sax.Writer")), m_xContext), + xMsf->createInstanceWithContext(::rtl::OUString( + "com.sun.star.xml.sax.Writer"), m_xContext), css::uno::UNO_QUERY_THROW); xSaxWriter->setOutputStream(xOutStream); css::uno::Reference<css::xml::sax::XDocumentHandler> xDocHandler ( @@ -2063,8 +2063,8 @@ SfxDocumentMetaData::storeToStorage( xTransaction->commit(); } } else { - throw css::io::IOException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::storeToStorage: cannot filter")), *this); + throw css::io::IOException(::rtl::OUString( + "SfxDocumentMetaData::storeToStorage: cannot filter"), *this); } } @@ -2100,14 +2100,14 @@ SfxDocumentMetaData::loadFromMedium(const ::rtl::OUString & URL, throw; } catch (const css::uno::Exception & e) { throw css::lang::WrappedTargetException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::loadFromMedium: exception")), + ::rtl::OUString( + "SfxDocumentMetaData::loadFromMedium: exception"), css::uno::Reference<css::uno::XInterface>(*this), css::uno::makeAny(e)); } if (!xStorage.is()) { - throw css::uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::loadFromMedium: cannot get Storage")), + throw css::uno::RuntimeException(::rtl::OUString( + "SfxDocumentMetaData::loadFromMedium: cannot get Storage"), *this); } loadFromStorage(xStorage, md.getAsConstPropertyValueList()); @@ -2129,8 +2129,8 @@ SfxDocumentMetaData::storeToMedium(const ::rtl::OUString & URL, if (!xStorage.is()) { - throw css::uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::storeToMedium: cannot get Storage")), + throw css::uno::RuntimeException(::rtl::OUString( + "SfxDocumentMetaData::storeToMedium: cannot get Storage"), *this); } // set MIME type of the storage @@ -2179,14 +2179,14 @@ SfxDocumentMetaData::initialize( if (any >>= xDoc) { if (!xDoc.is()) { throw css::lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::" - "initialize: argument is null")), + ::rtl::OUString("SfxDocumentMetaData::" + "initialize: argument is null"), *this, static_cast<sal_Int16>(i)); } } else { throw css::lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::" - "initialize: argument must be XDocument")), + ::rtl::OUString("SfxDocumentMetaData::" + "initialize: argument must be XDocument"), *this, static_cast<sal_Int16>(i)); } } @@ -2225,8 +2225,8 @@ SfxDocumentMetaData::createClone() } catch (const css::uno::Exception & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData::createClone: exception")), + ::rtl::OUString( + "SfxDocumentMetaData::createClone: exception"), css::uno::Reference<css::uno::XInterface>(*this), a); } return css::uno::Reference<css::util::XCloneable> (pNew); @@ -2343,19 +2343,19 @@ void SfxDocumentMetaData::createUserDefined() types[10] = ::cppu::UnoType<css::util::Time>::get(); css::uno::Sequence<css::uno::Any> args(2); args[0] <<= css::beans::NamedValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowedTypes")), + ::rtl::OUString("AllowedTypes"), css::uno::makeAny(types)); // #i94175#: ODF allows empty user-defined property names! args[1] <<= css::beans::NamedValue( ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("AllowEmptyPropertyName")), + "AllowEmptyPropertyName"), css::uno::makeAny(sal_True)); const css::uno::Reference<css::lang::XMultiComponentFactory> xMsf( m_xContext->getServiceManager()); m_xUserDefined.set( xMsf->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.beans.PropertyBag")), m_xContext), + ::rtl::OUString( + "com.sun.star.beans.PropertyBag"), m_xContext), css::uno::UNO_QUERY_THROW); const css::uno::Reference<css::lang::XInitialization> xInit( m_xUserDefined, css::uno::UNO_QUERY); @@ -2387,14 +2387,14 @@ void SfxDocumentMetaData::createUserDefined() namespace comp_CompatWriterDocProps { ::rtl::OUString SAL_CALL _getImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "CompatWriterDocPropsImpl")); + return ::rtl::OUString( + "CompatWriterDocPropsImpl"); } css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames() { css::uno::Sequence< rtl::OUString > aServiceNames(1); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.writer.DocumentProperties" ) ); + aServiceNames[ 0 ] = rtl::OUString( "com.sun.star.writer.DocumentProperties" ); return aServiceNames; } css::uno::Reference< css::uno::XInterface > SAL_CALL _create( @@ -2409,15 +2409,15 @@ namespace comp_CompatWriterDocProps { namespace comp_SfxDocumentMetaData { ::rtl::OUString SAL_CALL _getImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentMetaData")); + return ::rtl::OUString( + "SfxDocumentMetaData"); } css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames() { css::uno::Sequence< ::rtl::OUString > s(1); - s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.document.DocumentProperties")); + s[0] = ::rtl::OUString( + "com.sun.star.document.DocumentProperties"); return s; } diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc index e93bac160325..f3edfa7390d2 100644 --- a/sfx2/source/doc/doc.hrc +++ b/sfx2/source/doc/doc.hrc @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_DOC_HRC #define _SFX_DOC_HRC @@ -34,11 +25,6 @@ #define RID_SFX_DOC_END (RID_SFX_DIALOG_START-1) #define STR_NODEFPRINTER (RID_SFX_DOC_START+ 0) -#define STR_PRINTER_NOTAVAIL_1 (RID_SFX_DOC_START+ 1) -#define STR_PRINTER_NOTAVAIL_2 (RID_SFX_DOC_START+ 2) -#define STR_PRINTER_NOTAVAIL_3 (RID_SFX_DOC_START+ 3) -#define STR_PRINTER_NOTAVAIL_4 (RID_SFX_DOC_START+ 4) -#define STR_PRINTER_NOTAVAIL_5 (RID_SFX_DOC_START+ 5) #define STR_PRINT_OPTIONS (RID_SFX_DOC_START+ 6) #define STR_ERROR_PRINTER_BUSY (RID_SFX_DOC_START+ 7) #define STR_NOSTARTPRINTER (RID_SFX_DOC_START+ 8) @@ -100,9 +86,7 @@ #define RID_STR_FILTCONFIG (RID_SFX_DOC_START+ 52) #define RID_STR_FILTBASIC (RID_SFX_DOC_START+ 53) #define RID_STR_WARNSTYLEOVERWRITE (RID_SFX_DOC_START+ 54) -#define RID_DLSTATUS (RID_SFX_DOC_START+ 55) -#define STR_DOC_LOADING (RID_SFX_DOC_START+ 57) #define MSG_OPEN_READONLY (RID_SFX_DOC_START+ 58) #define RID_OFFICEFILTER (RID_SFX_DOC_START+ 59) @@ -127,7 +111,6 @@ #define STR_DOCTYPENAME_MESSAGE (RID_SFX_DOC_START+ 75) #define RID_STR_NEW_TASK (RID_SFX_DOC_START+ 76) -#define STR_SAVEANDCLOSE (RID_SFX_DOC_START+ 77) #define STR_NOSAVEANDCLOSE (RID_SFX_DOC_START+ 78) #define STR_PACKNGO_NOACCESS (RID_SFX_DOC_START+ 79) #define STR_PACKNGO_NEWMEDIUM (RID_SFX_DOC_START+ 80) @@ -138,11 +121,6 @@ #define STR_OBJECT (RID_SFX_DOC_START+ 84) -#define DLOAD_URL 1 -#define DLOAD_STATUS 2 -#define DLOAD_NAME 3 -#define DLOAD_TEXT 4 -#define DLOAD_CANCEL 1 #define DLG_MACROQUERY (RID_SFX_DOC_START+87) #define BTN_OK (RID_SFX_DOC_START+88) @@ -161,7 +139,6 @@ // some icons are commented out since they are removed #define BMP_SIGNATURE (RID_SFX_DOC_START+97) #define BMP_128X128_CALC_DOC (RID_SFX_DOC_START+99) -#define BMP_128X128_CHART_DOC (RID_SFX_DOC_START+101) #define BMP_128X128_DRAW_DOC (RID_SFX_DOC_START+102) #define BMP_128X128_IMPRESS_DOC (RID_SFX_DOC_START+104) #define BMP_128X128_MATH_DOC (RID_SFX_DOC_START+107) diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src index 4d99ae12cc2d..d45856101b60 100644 --- a/sfx2/source/doc/doc.src +++ b/sfx2/source/doc/doc.src @@ -27,8 +27,6 @@ #include <sfx2/sfx.hrc> #include "doc.hrc" #define __RSC -#include <svl/inetdef.hxx> - // ----------------------------------------------------------------------- QueryBox MSG_CONFIRM_FILTER @@ -229,29 +227,6 @@ String RID_STR_WARNSTYLEOVERWRITE { Text [ en-US ] = "Should the \"$(ARG1)\" Style be replaced?" ; }; -String STR_DOC_LOADING -{ - Text [ en-US ] = "Loading Document" ; -}; -Resource RID_DLSTATUS -{ - String INET_NAME_RESOLVE_START - { - Text [ en-US ] = "Connection to: $(HOST). Waiting for response..." ; - }; - String INET_CONNECT_START - { - Text [ en-US ] = "Opening $(TARGET) at $(HOST)" ; - }; - String INET_READ_STATUS - { - Text [ en-US ] = "Loading: $(TARGET) from $(HOST). Loaded: $(BYTE)" ; - }; - String INET_CONNECTION_CLOSED - { - Text [ en-US ] = "Disconnected" ; - }; -}; QueryBox MSG_OPEN_READONLY { BUTTONS = WB_YES_NO ; diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 80a0f4cc8526..3607949667cb 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -29,7 +29,8 @@ #include <com/sun/star/registry/MergeConflictException.hpp> #include <com/sun/star/registry/XSimpleRegistry.hpp> #include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/ucb/SimpleFileAccess.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> #include <com/sun/star/document/XTypeDetection.hpp> #include <com/sun/star/frame/XLoadable.hpp> #include <com/sun/star/frame/XStorable.hpp> @@ -38,6 +39,7 @@ #include <unotools/moduleoptions.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/localfilehelper.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/configurationhelper.hxx> @@ -77,7 +79,6 @@ DBG_NAME(SfxObjectFactory) struct SfxObjectFactory_Impl { SfxViewFactoryArr_Impl aViewFactoryArr;// List of <SfxViewFactory>s - SfxFilterArr_Impl aFilterArr; // List of <SFxFilter>n ResId* pNameResId; ::rtl::OUString aServiceName; SfxFilterContainer* pFilterContainer; @@ -115,9 +116,9 @@ SfxObjectFactory::SfxObjectFactory nFlags( nFlagsP ) { DBG_CTOR(SfxObjectFactory, 0); - pImpl->pFilterContainer = new SfxFilterContainer( String::CreateFromAscii( pName ) ); + pImpl->pFilterContainer = new SfxFilterContainer( rtl::OUString::createFromAscii( pName ) ); - String aShortName( String::CreateFromAscii( pShortName ) ); + String aShortName( rtl::OUString::createFromAscii( pShortName ) ); aShortName.ToLowerAscii(); pImpl->aClassName = rName; if ( aShortName.EqualsAscii( "swriter" ) ) @@ -142,9 +143,6 @@ SfxObjectFactory::~SfxObjectFactory() { DBG_DTOR(SfxObjectFactory, 0); - const sal_uInt16 nCount = pImpl->aFilterArr.Count(); - for ( sal_uInt16 i = 0; i < nCount; ++i ) - delete pImpl->aFilterArr[i]; delete pImpl->pNameResId; delete pImpl->pFilterContainer; delete pImpl; @@ -211,22 +209,21 @@ void SfxObjectFactory::SetModule_Impl( SfxModule *pMod ) void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const String& rTemplateName ) { static const int nMaxPathSize = 16000; - static ::rtl::OUString SERVICE_FILTER_FACTORY(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")); - static ::rtl::OUString SERVICE_TYPE_DECTECTION(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")); - static ::rtl::OUString SERVICE_SIMPLE_ACCESS(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")); + static ::rtl::OUString SERVICE_FILTER_FACTORY("com.sun.star.document.FilterFactory"); + static ::rtl::OUString SERVICE_TYPE_DECTECTION("com.sun.star.document.TypeDetection"); - static ::rtl::OUString CONF_ROOT(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")); - static ::rtl::OUString CONF_PATH = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Office/Factories/" )) + ::rtl::OUString( rServiceName ); - static ::rtl::OUString PROP_DEF_TEMPL_CHANGED(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactorySystemDefaultTemplateChanged")); - static ::rtl::OUString PROP_ACTUAL_FILTER(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryActualFilter")); + static ::rtl::OUString CONF_ROOT("/org.openoffice.Setup"); + static ::rtl::OUString CONF_PATH = ::rtl::OUString("Office/Factories/" ) + ::rtl::OUString( rServiceName ); + static ::rtl::OUString PROP_DEF_TEMPL_CHANGED("ooSetupFactorySystemDefaultTemplateChanged"); + static ::rtl::OUString PROP_ACTUAL_FILTER("ooSetupFactoryActualFilter"); - static ::rtl::OUString DEF_TPL_STR(RTL_CONSTASCII_USTRINGPARAM("/soffice.")); + static ::rtl::OUString DEF_TPL_STR("/soffice."); rtl::OUString sURL; String sPath; sal_Unicode aPathBuffer[nMaxPathSize]; if ( SystemPath::GetUserTemplateLocation( aPathBuffer, nMaxPathSize )) - sPath = String( aPathBuffer ); + sPath = rtl::OUString( aPathBuffer ); ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, sURL ); ::rtl::OUString aUserTemplateURL( sURL ); @@ -256,19 +253,19 @@ void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const Stri aActuralFilterData[nInd].Value >>= aActualFilterTypeName; ::comphelper::SequenceAsHashMap aProps1( xTypeDetection->getByName( aActualFilterTypeName ) ); uno::Sequence< ::rtl::OUString > aAllExt = - aProps1.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")), uno::Sequence< ::rtl::OUString >() ); + aProps1.getUnpackedValueOrDefault( ::rtl::OUString("Extensions"), uno::Sequence< ::rtl::OUString >() ); //To-do: check if aAllExt is empty first ::rtl::OUString aExt = aAllExt[0]; aUserTemplateURL += DEF_TPL_STR; aUserTemplateURL += aExt; - uno::Reference< ucb::XSimpleFileAccess > xSimpleFileAccess( - xFactory->createInstance( SERVICE_SIMPLE_ACCESS ), uno::UNO_QUERY_THROW ); + uno::Reference<ucb::XSimpleFileAccess2> xSimpleFileAccess( + ucb::SimpleFileAccess::create( ::comphelper::ComponentContext(xFactory).getUNOContext() ) ); ::rtl::OUString aBackupURL; ::osl::Security().getConfigDir(aBackupURL); - aBackupURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/temp")); + aBackupURL += ::rtl::OUString("/temp"); if ( !xSimpleFileAccess->exists( aBackupURL ) ) xSimpleFileAccess->createFolder( aBackupURL ); @@ -284,21 +281,21 @@ void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const Stri uno::Reference< document::XTypeDetection > xTypeDetector( xTypeDetection, uno::UNO_QUERY ); ::comphelper::SequenceAsHashMap aProps2( xTypeDetection->getByName( xTypeDetector->queryTypeByURL( rTemplateName ) ) ); ::rtl::OUString aFilterName = - aProps2.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter")), ::rtl::OUString() ); + aProps2.getUnpackedValueOrDefault( ::rtl::OUString("PreferredFilter"), ::rtl::OUString() ); uno::Sequence< beans::PropertyValue > aArgs( 3 ); - aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); + aArgs[0].Name = ::rtl::OUString("FilterName"); aArgs[0].Value <<= aFilterName; - aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate")); + aArgs[1].Name = ::rtl::OUString("AsTemplate"); aArgs[1].Value <<= sal_True; - aArgs[2].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")); + aArgs[2].Name = ::rtl::OUString("URL"); aArgs[2].Value <<= ::rtl::OUString( rTemplateName ); uno::Reference< frame::XLoadable > xLoadable( xFactory->createInstance( ::rtl::OUString( rServiceName ) ), uno::UNO_QUERY ); xLoadable->load( aArgs ); aArgs.realloc( 2 ); - aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Overwrite")); + aArgs[1].Name = ::rtl::OUString("Overwrite"); aArgs[1].Value <<= sal_True; uno::Reference< frame::XStorable > xStorable( xLoadable, uno::UNO_QUERY ); @@ -350,7 +347,7 @@ String SfxObjectFactory::GetStandardTemplate( const String& rServiceName ) const SfxFilter* SfxObjectFactory::GetTemplateFilter() const { sal_uInt16 nVersion=0; - SfxFilterMatcher aMatcher ( String::CreateFromAscii( pShortName ) ); + SfxFilterMatcher aMatcher ( rtl::OUString::createFromAscii( pShortName ) ); SfxFilterMatcherIter aIter( aMatcher ); const SfxFilter *pFilter = 0; const SfxFilter *pTemp = aIter.First(); @@ -393,20 +390,17 @@ String SfxObjectFactory::GetFactoryURL() const String SfxObjectFactory::GetModuleName() const { - static ::rtl::OUString SERVICENAME_MODULEMANAGER(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")); - static ::rtl::OUString PROP_MODULEUINAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryUIName")); - try { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Reference< css::container::XNameAccess > xModuleManager( - xSMGR->createInstance(SERVICENAME_MODULEMANAGER), + xSMGR->createInstance("com.sun.star.frame.ModuleManager"), css::uno::UNO_QUERY_THROW); ::rtl::OUString sDocService(GetDocumentServiceName()); ::comphelper::SequenceAsHashMap aPropSet( xModuleManager->getByName(sDocService) ); - ::rtl::OUString sModuleName = aPropSet.getUnpackedValueOrDefault(PROP_MODULEUINAME, ::rtl::OUString()); + ::rtl::OUString sModuleName = aPropSet.getUnpackedValueOrDefault("ooSetupFactoryUIName", ::rtl::OUString()); return String(sModuleName); } catch(const css::uno::RuntimeException&) diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 2daebaee8c3f..c9685077afc1 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/ucb/XContent.hpp> +#include <com/sun/star/container/XChild.hpp> #include <com/sun/star/document/XDocumentRevisionListPersistence.hpp> #include <com/sun/star/document/LockedDocumentRequest.hpp> #include <com/sun/star/document/OwnLockOnDocumentRequest.hpp> @@ -154,15 +155,15 @@ sal_Bool IsSystemFileLockingUsed() uno::Reference< uno::XInterface > xCommonConfig = ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common" ) ), + ::rtl::OUString( "/org.openoffice.Office.Common" ), ::comphelper::ConfigurationHelper::E_STANDARD ); if ( !xCommonConfig.is() ) throw uno::RuntimeException(); ::comphelper::ConfigurationHelper::readRelativeKey( xCommonConfig, - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Misc/" ) ), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseDocumentSystemFileLocking" ) ) ) >>= bUseSystemLock; + ::rtl::OUString( "Misc/" ), + ::rtl::OUString( "UseDocumentSystemFileLocking" ) ) >>= bUseSystemLock; } catch( const uno::Exception& ) { @@ -181,15 +182,15 @@ sal_Bool IsOOoLockFileUsed() uno::Reference< uno::XInterface > xCommonConfig = ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common" ) ), + ::rtl::OUString( "/org.openoffice.Office.Common" ), ::comphelper::ConfigurationHelper::E_STANDARD ); if ( !xCommonConfig.is() ) throw uno::RuntimeException(); ::comphelper::ConfigurationHelper::readRelativeKey( xCommonConfig, - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Misc/" ) ), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseDocumentOOoLockFile" ) ) ) >>= bOOoLockFileUsed; + ::rtl::OUString( "Misc/" ), + ::rtl::OUString( "UseDocumentOOoLockFile" ) ) >>= bOOoLockFileUsed; } catch( const uno::Exception& ) { @@ -312,6 +313,8 @@ public: uno::Reference< logging::XSimpleLogRing > m_xLogRing; + bool m_originallyReadOnly; + SfxMedium_Impl( SfxMedium* pAntiImplP ); ~SfxMedium_Impl(); }; @@ -339,7 +342,8 @@ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) pTempFile( NULL ), nLastStorageError( 0 ), m_bRemoveBackup( sal_False ), - m_nSignatureState( SIGNATURESTATE_NOSIGNATURES ) + m_nSignatureState( SIGNATURESTATE_NOSIGNATURES ), + m_originallyReadOnly(false) { aDoneLink.CreateMutex(); } @@ -360,7 +364,6 @@ SfxMedium_Impl::~SfxMedium_Impl() #define IMPL_CTOR(rootVal,URLVal) \ eError( SVSTREAM_OK ), \ \ - bDirect( sal_False ), \ bRoot( rootVal ), \ bSetFilter( sal_False ), \ bTriedStorage( sal_False ), \ @@ -453,7 +456,7 @@ void SfxMedium::CheckFileDate( const util::DateTime& aInitDate ) ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection(); if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() ) { - SetError( ERRCODE_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_ABORT, ::rtl::OUString( OSL_LOG_PREFIX ) ); } } catch ( const uno::Exception& ) @@ -478,7 +481,7 @@ util::DateTime SfxMedium::GetInitFileDate( sal_Bool bIgnoreOldValue ) uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > xDummyEnv; ::ucbhelper::Content aContent( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv ); - aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DateModified" )) ) >>= pImp->m_aDateTime; + aContent.getPropertyValue( ::rtl::OUString("DateModified" ) ) >>= pImp->m_aDateTime; pImp->m_bGotDateTime = sal_True; } catch ( const ::com::sun::star::uno::Exception& ) @@ -538,7 +541,7 @@ Reference < XContent > SfxMedium::GetContent() const { try { - Any aAny = pImp->aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI" )) ); + Any aAny = pImp->aContent.getPropertyValue( ::rtl::OUString("BaseURI" ) ); aAny >>= aBaseURL; } catch ( const ::com::sun::star::uno::Exception& ) @@ -804,7 +807,7 @@ void SfxMedium::StorageBackup_Impl() { DoInternalBackup_Impl( aOriginalContent ); if( pImp->m_aBackupURL.isEmpty() ) - SetError( ERRCODE_SFX_CANTCREATEBACKUP, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_SFX_CANTCREATEBACKUP, ::rtl::OUString( OSL_LOG_PREFIX ) ); } } @@ -863,7 +866,7 @@ void SfxMedium::SetEncryptionDataToStorage_Impl() { OSL_FAIL( "It must be possible to set a common password for the storage" ); // TODO/LATER: set the error code in case of problem - // SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + // SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } } } @@ -902,9 +905,9 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const uno::Sequence< ::rtl::OUStri if ( !aInfo.isEmpty() && !aData[LOCKFILE_EDITTIME_ID].isEmpty() ) { - aInfo += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " ( " ) ); + aInfo += ::rtl::OUString( " ( " ); aInfo += aData[LOCKFILE_EDITTIME_ID]; - aInfo += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " )" ) ); + aInfo += ::rtl::OUString( " )" ); } } @@ -932,7 +935,7 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const uno::Sequence< ::rtl::OUStri ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection(); if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() ) { - SetError( ERRCODE_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_ABORT, ::rtl::OUString( OSL_LOG_PREFIX ) ); } else if ( uno::Reference< task::XInteractionDisapprove >( xSelected.get(), uno::UNO_QUERY ).is() ) { @@ -971,7 +974,7 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const uno::Sequence< ::rtl::OUStri GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) ); } else - SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( OSL_LOG_PREFIX ) ); } @@ -1039,7 +1042,7 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) // MediaDescriptor does this check also, the duplication should be avoided in future Reference< ::com::sun::star::ucb::XCommandEnvironment > xDummyEnv; ::ucbhelper::Content aContent( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv ); - aContent.getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ) ) >>= bContentReadonly; + aContent.getPropertyValue( ::rtl::OUString( "IsReadOnly" ) ) >>= bContentReadonly; } catch( const uno::Exception& ) {} @@ -1058,6 +1061,11 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) bContentReadonly = IsReadonlyAccordingACL( aPhysPath.GetBuffer() ); } #endif + + if ( bContentReadonly ) + { + pImp->m_originallyReadOnly = true; + } } // do further checks only if the file not readonly in fs @@ -1214,7 +1222,7 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) SFX_ITEMSET_ARG( pSet, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY, sal_False ); if ( !bLoading || (pReadOnlyItem && !pReadOnlyItem->GetValue()) ) - SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( OSL_LOG_PREFIX ) ); else GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) ); } @@ -1266,9 +1274,9 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIf new utl::ProgressHandlerWrap( xStatusIndicator ) ); uno::Sequence< beans::PropertyValue > aAddProps( 2 ); - aAddProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")); + aAddProps[0].Name = ::rtl::OUString("RepairPackage"); aAddProps[0].Value <<= (sal_Bool)sal_True; - aAddProps[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator")); + aAddProps[1].Name = ::rtl::OUString("StatusIndicator"); aAddProps[1].Value <<= xProgressHandler; // the first arguments will be filled later @@ -1480,7 +1488,6 @@ sal_Bool SfxMedium::WillDisposeStorageOnClose_Impl() //------------------------------------------------------------------ void SfxMedium::SetOpenMode( StreamMode nStorOpen, - sal_Bool bDirectP, sal_Bool bDontClose ) { if ( nStorOpenMode != nStorOpen ) @@ -1496,7 +1503,6 @@ void SfxMedium::SetOpenMode( StreamMode nStorOpen, } } - bDirect = bDirectP; bSetFilter = sal_False; } @@ -1568,13 +1574,13 @@ sal_Bool SfxMedium::StorageCommit_Impl() } if ( !GetError() ) - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } } catch ( const uno::Exception& ) { //TODO/LATER: improve error handling - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } } } @@ -1648,7 +1654,7 @@ sal_Bool SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource, { Reference< XInputStream > aTempInput = aTempCont.openStream(); bTransactStarted = sal_True; - aOriginalContent.setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")), + aOriginalContent.setPropertyValue( ::rtl::OUString("Size"), uno::makeAny( (sal_Int64)0 ) ); aOriginalContent.writeStream( aTempInput, bOverWrite ); bResult = sal_True; @@ -1761,7 +1767,7 @@ sal_Bool SfxMedium::TryDirectTransfer( const ::rtl::OUString& aURL, SfxItemSet& Any aCmdArg; aCmdArg <<= aInsertArg; - aTargetContent.executeCommand( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ), + aTargetContent.executeCommand( ::rtl::OUString( "insert" ), aCmdArg ); if ( xSeek.is() ) @@ -1851,7 +1857,7 @@ void SfxMedium::Transfer_Impl() else { OSL_FAIL( "Illegal Output stream parameter!\n" ); - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } // free the reference @@ -1883,7 +1889,7 @@ void SfxMedium::Transfer_Impl() aAny <<= pSegmentSize->GetValue(); uno::Reference < beans::XPropertySet > xSet( pImp->xStorage, uno::UNO_QUERY ); - xSet->setPropertyValue( String::CreateFromAscii("SegmentSize"), aAny ); + xSet->setPropertyValue( rtl::OUString("SegmentSize"), aAny ); // copy the temporary storage into the disk spanned package GetStorage()->copyToStorage( xStor ); @@ -1913,6 +1919,7 @@ void SfxMedium::Transfer_Impl() Reference< ::com::sun::star::ucb::XProgressHandler >() ); rtl::OUString aDestURL( aDest.GetMainURL( INetURLObject::NO_DECODE ) ); + if ( ::utl::LocalFileHelper::IsLocalFile( aDestURL ) || !aDest.removeSegment() ) { TransactedTransferForFS_Impl( aSource, aDest, xComEnv ); @@ -1934,8 +1941,30 @@ void SfxMedium::Transfer_Impl() ::ucbhelper::Content aSourceContent; ::ucbhelper::Content aTransferContent; - String aFileName = GetLongName(); - if ( !aFileName.Len() ) + // Get the parent URL from the XChild if possible: why would the URL necessarily have + // a hierarchical path? It's not the case for CMIS. + ::ucbhelper::Content aDestContent; + ::ucbhelper::Content::create( aDestURL, xComEnv, aDestContent ); + Reference< ::com::sun::star::container::XChild> xChild( aDestContent.get(), uno::UNO_QUERY ); + rtl::OUString sParentUrl; + if ( xChild.is( ) ) + { + Reference< ::com::sun::star::ucb::XContent > xParent( xChild->getParent( ), uno::UNO_QUERY ); + if ( xParent.is( ) ) + { + sParentUrl = xParent->getIdentifier( )->getContentIdentifier(); + } + } + + if ( !sParentUrl.isEmpty() ) + aDest = INetURLObject( sParentUrl ); + + // LongName wasn't defined anywhere, only used here... get the Title instead + // as it's less probably empty + rtl::OUString aFileName; + Any aAny = aDestContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title" )) ); + aAny >>= aFileName; + if ( aFileName.isEmpty() ) aFileName = GetURLObject().getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); try @@ -2331,7 +2360,7 @@ void SfxMedium::GetMedium_Impl() //TODO/MBA: ErrorHandling - how to transport error from MediaDescriptor if ( !GetError() && !pImp->xStream.is() && !pImp->xInputStream.is() ) - SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( OSL_LOG_PREFIX ) ); if ( !GetError() ) { @@ -2821,7 +2850,7 @@ void SfxMedium::CompleteReOpen() //------------------------------------------------------------------ SfxMedium::SfxMedium ( - const String &rName, StreamMode nOpenMode, sal_Bool bDirectP, + const String &rName, StreamMode nOpenMode, const SfxFilter *pFlt, SfxItemSet *pInSet ) : IMPL_CTOR( sal_False, 0 ), // bRoot, pURLObj @@ -2831,7 +2860,6 @@ SfxMedium::SfxMedium { aLogicName = rName; nStorOpenMode = nOpenMode; - bDirect = bDirectP; Init_Impl(); } @@ -2878,16 +2906,14 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b } } - sal_Bool bReadOnly = sal_False; SFX_ITEMSET_ARG( pSet, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY, sal_False ); if ( pReadOnlyItem && pReadOnlyItem->GetValue() ) - bReadOnly = sal_True; + pImp->m_originallyReadOnly = true; SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False ); if (!pFileNameItem) throw uno::RuntimeException(); aLogicName = pFileNameItem->GetValue(); - nStorOpenMode = bReadOnly ? SFX_STREAM_READONLY : SFX_STREAM_READWRITE; - bDirect = sal_False; + nStorOpenMode = pImp->m_originallyReadOnly ? SFX_STREAM_READONLY : SFX_STREAM_READWRITE; Init_Impl(); } @@ -3030,11 +3056,11 @@ SvKeyValueIterator* SfxMedium::GetHeaderAttributes_Impl() try { - Any aAny = pImp->aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ); + Any aAny = pImp->aContent.getPropertyValue( ::rtl::OUString("MediaType") ); ::rtl::OUString aContentType; aAny >>= aContentType; - pImp->xAttributes->Append( SvKeyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content-type")), aContentType ) ); + pImp->xAttributes->Append( SvKeyValue( ::rtl::OUString("content-type"), aContentType ) ); } catch ( const ::com::sun::star::uno::Exception& ) { @@ -3059,7 +3085,7 @@ const uno::Sequence < util::RevisionTag >& SfxMedium::GetVersionList( bool _bNoR ( !aName.isEmpty() || aLogicName.Len() ) && GetStorage().is() ) { uno::Reference < document::XDocumentRevisionListPersistence > xReader( comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentRevisionListPersistence")) ), uno::UNO_QUERY ); + ::rtl::OUString("com.sun.star.document.DocumentRevisionListPersistence") ), uno::UNO_QUERY ); if ( xReader.is() ) { try @@ -3081,7 +3107,7 @@ const uno::Sequence < util::RevisionTag >& SfxMedium::GetVersionList( bool _bNoR uno::Sequence < util::RevisionTag > SfxMedium::GetVersionList( const uno::Reference < embed::XStorage >& xStorage ) { uno::Reference < document::XDocumentRevisionListPersistence > xReader( comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentRevisionListPersistence")) ), uno::UNO_QUERY ); + ::rtl::OUString("com.sun.star.document.DocumentRevisionListPersistence") ), uno::UNO_QUERY ); if ( xReader.is() ) { try @@ -3169,7 +3195,7 @@ sal_Bool SfxMedium::SaveVersionList_Impl( sal_Bool /*bUseXML*/ ) return sal_True; uno::Reference < document::XDocumentRevisionListPersistence > xWriter( comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentRevisionListPersistence")) ), uno::UNO_QUERY ); + ::rtl::OUString("com.sun.star.document.DocumentRevisionListPersistence") ), uno::UNO_QUERY ); if ( xWriter.is() ) { try @@ -3212,6 +3238,11 @@ sal_Bool SfxMedium::IsReadOnly() return bReadOnly; } +bool SfxMedium::IsOriginallyReadOnly() const +{ + return pImp->m_originallyReadOnly; +} + //---------------------------------------------------------------- sal_Bool SfxMedium::SetWritableForUserOnly( const ::rtl::OUString& aURL ) { @@ -3260,7 +3291,7 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace ) ::rtl::OUString aTmpURL = pImp->pTempFile->GetURL(); if ( aName.isEmpty() || aTmpURL.isEmpty() ) { - SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( OSL_LOG_PREFIX ) ); return; } @@ -3337,7 +3368,7 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace ) if ( !bTransferSuccess ) { - SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( OSL_LOG_PREFIX ) ); return; } } @@ -3357,7 +3388,7 @@ void SfxMedium::CreateTempFileNoCopy() aName = pImp->pTempFile->GetFileName(); if ( aName.isEmpty() ) { - SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( OSL_LOG_PREFIX ) ); return; } @@ -3385,7 +3416,7 @@ sal_Bool SfxMedium::SignContents_Impl( sal_Bool bScriptingContent, const ::rtl:: aArgs[1] <<= bHasValidDocumentSignature; ::com::sun::star::uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xSigner( comphelper::getProcessServiceFactory()->createInstanceWithArguments( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), + rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures" ), aArgs ), ::com::sun::star::uno::UNO_QUERY ); @@ -3408,7 +3439,7 @@ sal_Bool SfxMedium::SignContents_Impl( sal_Bool bScriptingContent, const ::rtl:: throw uno::RuntimeException(); uno::Reference< embed::XStorage > xMetaInf = xWriteableZipStor->openStorageElement( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ), + ::rtl::OUString( "META-INF" ), embed::ElementModes::READWRITE ); if ( !xMetaInf.is() ) throw uno::RuntimeException(); diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx index 3477d9cb9804..df06e3a3e2f5 100644 --- a/sfx2/source/doc/docfilt.cxx +++ b/sfx2/source/doc/docfilt.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ - -// INCLUDE --------------------------------------------------------------- - #ifdef SOLARIS #include <ctime> #endif @@ -139,26 +136,26 @@ const SfxFilter* SfxFilter::GetFilterByName( const String& rName ) String SfxFilter::GetTypeFromStorage( const SotStorage& rStg ) { const char* pType=0; - if ( rStg.IsStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "WordDocument" ) ) ) ) + if ( rStg.IsStream( rtl::OUString("WordDocument") ) ) { - if ( rStg.IsStream( String::CreateFromAscii("0Table" ) ) || rStg.IsStream( String::CreateFromAscii("1Table" ) ) ) + if ( rStg.IsStream( rtl::OUString("0Table") ) || rStg.IsStream( rtl::OUString("1Table") ) ) pType = "writer_MS_Word_97"; else pType = "writer_MS_Word_95"; } - else if ( rStg.IsStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Book" ) ) ) ) + else if ( rStg.IsStream( rtl::OUString("Book") ) ) { pType = "calc_MS_Excel_95"; } - else if ( rStg.IsStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Workbook" ) ) ) ) + else if ( rStg.IsStream( rtl::OUString("Workbook" ) ) ) { pType = "calc_MS_Excel_97"; } - else if ( rStg.IsStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "PowerPoint Document" ) ) ) ) + else if ( rStg.IsStream( rtl::OUString("PowerPoint Document") ) ) { pType = "impress_MS_PowerPoint_97"; } - else if ( rStg.IsStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Equation Native" ) ) ) ) + else if ( rStg.IsStream( rtl::OUString("Equation Native") ) ) { pType = "math_MathType_3x"; } @@ -173,7 +170,7 @@ String SfxFilter::GetTypeFromStorage( const SotStorage& rStg ) } } - return pType ? String::CreateFromAscii(pType) : String(); + return pType ? rtl::OUString::createFromAscii(pType) : rtl::OUString(); } String SfxFilter::GetTypeFromStorage( const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xStorage, sal_Bool bTemplate, @@ -195,7 +192,7 @@ String SfxFilter::GetTypeFromStorage( const com::sun::star::uno::Reference< com: if ( xProps.is() ) { ::rtl::OUString aMediaType; - xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ) >>= aMediaType; + xProps->getPropertyValue( ::rtl::OUString("MediaType") ) >>= aMediaType; if ( !aMediaType.isEmpty() ) { ::com::sun::star::datatransfer::DataFlavor aDataFlavor; @@ -241,7 +238,7 @@ String SfxFilter::GetTypeFromStorage( const com::sun::star::uno::Reference< com: String aRet; if ( pType ) { - aRet = String::CreateFromAscii(pType); + aRet = rtl::OUString::createFromAscii(pType); if ( pFilterName ) *pFilterName = aMatcher.GetFilter4EA( aRet )->GetName(); } diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx index 136d9cf274ed..0e311c4a56a9 100644 --- a/sfx2/source/doc/docinf.cxx +++ b/sfx2/source/doc/docinf.cxx @@ -64,7 +64,7 @@ sal_uInt32 SFX2_DLLPUBLIC LoadOlePropertySet( // load the property set SfxOlePropertySet aGlobSet; ErrCode nGlobError = aGlobSet.LoadPropertySet(i_pStorage, - String( RTL_CONSTASCII_USTRINGPARAM( STREAM_SUMMARYINFO ) ) ); + String( STREAM_SUMMARYINFO ) ); // global section SfxOleSectionRef xGlobSect = aGlobSet.GetSection( SECTION_GLOBAL ); @@ -145,7 +145,7 @@ sal_uInt32 SFX2_DLLPUBLIC LoadOlePropertySet( // load the property set SfxOlePropertySet aDocSet; ErrCode nDocError = aDocSet.LoadPropertySet(i_pStorage, - String( RTL_CONSTASCII_USTRINGPARAM( STREAM_DOCSUMMARYINFO ) ) ); + String( STREAM_DOCSUMMARYINFO ) ); // custom properties SfxOleSectionRef xCustomSect = aDocSet.GetSection( SECTION_CUSTOM ); @@ -247,7 +247,7 @@ bool SFX2_DLLPUBLIC SaveOlePropertySet( // save the property set ErrCode nGlobError = aGlobSet.SavePropertySet(i_pStorage, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STREAM_SUMMARYINFO))); + ::rtl::OUString(STREAM_SUMMARYINFO)); // *** custom properties into stream "005DocumentSummaryInformation" *** @@ -264,7 +264,7 @@ bool SFX2_DLLPUBLIC SaveOlePropertySet( const sal_Int32 nPropId = rCustomSect.GetFreePropertyId(); rCustomSect.SetBlobValue( nPropId, *i_pGuid ); rCustomSect.SetPropertyName( nPropId, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_PID_GUID")) ); + ::rtl::OUString("_PID_GUID") ); } // write hyperlinks @@ -272,7 +272,7 @@ bool SFX2_DLLPUBLIC SaveOlePropertySet( const sal_Int32 nPropId = rCustomSect.GetFreePropertyId(); rCustomSect.SetBlobValue( nPropId, *i_pHyperlinks ); rCustomSect.SetPropertyName( nPropId, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_PID_HLINKS")) ); + ::rtl::OUString("_PID_HLINKS") ); } uno::Reference<beans::XPropertySet> xUserDefinedProps( @@ -306,7 +306,7 @@ bool SFX2_DLLPUBLIC SaveOlePropertySet( // save the property set ErrCode nDocError = aDocSet.SavePropertySet(i_pStorage, - String( RTL_CONSTASCII_USTRINGPARAM( STREAM_DOCSUMMARYINFO ) ) ); + String( STREAM_DOCSUMMARYINFO ) ); // return code return (nGlobError == ERRCODE_NONE) && (nDocError == ERRCODE_NONE); diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index 8ad6af137945..a9629aaaf73c 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -98,7 +98,7 @@ SfxMedium* DocumentInserter::CreateMedium() DBG_ASSERT( m_pURLList.size() == 1, "DocumentInserter::CreateMedium(): invalid URL list count" ); String sURL(m_pURLList[0]); pMedium = new SfxMedium( - sURL, SFX_STREAM_READONLY, sal_False, + sURL, SFX_STREAM_READONLY, SFX_APP()->GetFilterMatcher().GetFilter4FilterName( m_sFilter ), m_pItemSet ); pMedium->UseInteractionHandler( sal_True ); SfxFilterMatcher* pMatcher = NULL; @@ -131,7 +131,7 @@ SfxMediumList* DocumentInserter::CreateMediumList() for(std::vector<rtl::OUString>::const_iterator i = m_pURLList.begin(); i != m_pURLList.end(); ++i) { SfxMedium* pMedium = new SfxMedium( - *i, SFX_STREAM_READONLY, sal_False, + *i, SFX_STREAM_READONLY, SFX_APP()->GetFilterMatcher().GetFilter4FilterName( m_sFilter ), m_pItemSet ); pMedium->UseInteractionHandler( sal_True ); diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index 70cd49542fb0..4a3ae6006cf2 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -31,7 +31,6 @@ #include "sfx2/signaturestate.hxx" #include "sfx2/docfile.hxx" -/** === begin UNO includes === **/ #include <com/sun/star/document/MacroExecMode.hpp> #include <com/sun/star/task/ErrorCodeRequest.hpp> #include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp> @@ -39,7 +38,6 @@ #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> #include <com/sun/star/script/XLibraryQueryExecutable.hpp> #include <com/sun/star/script/vba/XVBACompatibility.hpp> -/** === end UNO includes === **/ #include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> @@ -337,6 +335,7 @@ namespace sfx2 sal_Bool DocumentMacroMode::hasMacroLibrary() const { sal_Bool bHasMacroLib = sal_False; +#ifndef DISABLE_SCRIPTING try { Reference< XEmbeddedScripts > xScripts( m_pData->m_rDocumentAccess.getEmbeddedDocumentScripts() ); @@ -408,7 +407,7 @@ namespace sfx2 { DBG_UNHANDLED_EXCEPTION(); } - +#endif return bHasMacroLib; } @@ -420,8 +419,8 @@ namespace sfx2 { try { - static const ::rtl::OUString s_sBasicStorageName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) ) ); - static const ::rtl::OUString s_sScriptsStorageName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Scripts" ) ) ); + const ::rtl::OUString s_sBasicStorageName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) ) ); + const ::rtl::OUString s_sScriptsStorageName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Scripts" ) ) ); bHasMacros =( ( rxStorage->hasByName( s_sBasicStorageName ) && rxStorage->isStorageElement( s_sBasicStorageName ) diff --git a/sfx2/source/doc/docstoragemodifylistener.cxx b/sfx2/source/doc/docstoragemodifylistener.cxx index f9d888eb7f5f..d03c81108b2f 100644 --- a/sfx2/source/doc/docstoragemodifylistener.cxx +++ b/sfx2/source/doc/docstoragemodifylistener.cxx @@ -26,13 +26,9 @@ * ************************************************************************/ - #include "sfx2/docstoragemodifylistener.hxx" #include <osl/mutex.hxx> -/** === begin UNO includes === **/ -/** === end UNO includes === **/ - //........................................................................ namespace sfx2 { diff --git a/sfx2/source/doc/doctdlg.cxx b/sfx2/source/doc/doctdlg.cxx index 2b616182153d..75d3c2534efd 100644 --- a/sfx2/source/doc/doctdlg.cxx +++ b/sfx2/source/doc/doctdlg.cxx @@ -111,7 +111,7 @@ void SfxDocumentTemplateDlg::Init() for(sal_uInt16 i = 0; i < nCount; ++i) aRegionLb.InsertEntry(pTemplates->GetFullRegionName(i)); if(!nCount) - aRegionLb.InsertEntry(String(SfxResId(STR_STANDARD))); + aRegionLb.InsertEntry(SfxResId(STR_STANDARD).toString()); aRegionLb.SelectEntryPos(0); if(nCount) { @@ -145,7 +145,7 @@ IMPL_LINK( SfxDocumentTemplateDlg, OrganizeHdl, Button *, pButton ) aRegionLb.SetUpdateMode( sal_True ); aRegionLb.Invalidate(); aRegionLb.Update(); - aCancelBt.SetText(String(SfxResId(STR_CLOSE))); + aCancelBt.SetText(SfxResId(STR_CLOSE).toString()); } else if(RET_EDIT_STYLE == nRet) EndDialog(RET_CANCEL); diff --git a/sfx2/source/doc/doctdlg.hrc b/sfx2/source/doc/doctdlg.hrc index 8deed4699f3b..219db5b696ff 100644 --- a/sfx2/source/doc/doctdlg.hrc +++ b/sfx2/source/doc/doctdlg.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #define FT_SECTION 1 #define LB_SECTION 2 #define FT_STYLESHEETS 3 @@ -34,7 +25,6 @@ #define FT_NAME 6 #define ED_NAME 7 #define BT_OK 10 -#define BT_SECTION 11 #define BT_EDIT 12 #define BT_NEW 13 #define BT_DELETE 15 diff --git a/sfx2/source/doc/doctdlg.src b/sfx2/source/doc/doctdlg.src index 1b50fd56c55e..3aaf703d1c9c 100644 --- a/sfx2/source/doc/doctdlg.src +++ b/sfx2/source/doc/doctdlg.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include <sfx2/sfx.hrc> #include "doc.hrc" @@ -115,38 +106,3 @@ ModalDialog DLG_DOC_TEMPLATE Text [ en-US ] = "~Organizer..." ; }; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index 3b48b431b294..130a7c656f57 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -51,6 +51,7 @@ #include <com/sun/star/document/XTypeDetection.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> +#include <com/sun/star/frame/DocumentTemplates.hpp> #include <com/sun/star/frame/XDocumentTemplates.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XPersist.hpp> @@ -113,7 +114,6 @@ using ::std::advance; #define COMMAND_TRANSFER "transfer" #define SERVICENAME_DOCINFO "com.sun.star.document.DocumentProperties" -#define SERVICENAME_DOCTEMPLATES "com.sun.star.frame.DocumentTemplates" #define SERVICENAME_DESKTOP "com.sun.star.frame.Desktop" //======================================================================== @@ -572,7 +572,7 @@ String SfxDocumentTemplates::GetPath uno::Reference< XCommandEnvironment > aCmdEnv; if ( Content::create( aTemplateObj.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv, aTemplate ) ) { - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) ); + OUString aPropName( TARGET_URL ); getTextProperty_Impl( aTemplate, aPropName, aResult ); aResult = SvtPathOptions().SubstituteVariable( aResult ); } @@ -835,7 +835,7 @@ sal_Bool SfxDocumentTemplates::CopyTo aTransferInfo.NameClash = NameClash::OVERWRITE; Any aArg = makeAny( aTransferInfo ); - OUString aCmd( RTL_CONSTASCII_USTRINGPARAM( COMMAND_TRANSFER ) ); + OUString aCmd( COMMAND_TRANSFER ); aTarget.executeCommand( aCmd, aArg ); } @@ -898,12 +898,12 @@ sal_Bool SfxDocumentTemplates::CopyFrom } else { - OUString aService( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_DESKTOP ) ); + OUString aService( SERVICENAME_DESKTOP ); uno::Reference< XComponentLoader > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( aService ), UNO_QUERY ); Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden")); + aArgs[0].Name = ::rtl::OUString("Hidden"); aArgs[0].Value <<= sal_True; INetURLObject aTemplURL( rName ); @@ -913,7 +913,7 @@ sal_Bool SfxDocumentTemplates::CopyFrom { xStorable = uno::Reference< XStorable >( xDesktop->loadComponentFromURL( aTemplURL.GetMainURL(INetURLObject::NO_DECODE), - OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), + OUString("_blank"), 0, aArgs ), UNO_QUERY ); @@ -965,7 +965,7 @@ sal_Bool SfxDocumentTemplates::CopyFrom if( Content::create( aTemplURL, aCmdEnv, aTemplCont ) ) { OUString aTemplName; - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) ); + OUString aPropName( TARGET_URL ); if( getTextProperty_Impl( aTemplCont, aPropName, aTemplName ) ) { @@ -1676,7 +1676,7 @@ const OUString& DocTempl_EntryData_Impl::GetTargetURL() if ( Content::create( GetHierarchyURL(), aCmdEnv, aRegion ) ) { - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) ); + OUString aPropName( TARGET_URL ); getTextProperty_Impl( aRegion, aPropName, maTargetURL ); } @@ -1837,7 +1837,7 @@ const OUString& RegionData_Impl::GetTargetURL() if ( Content::create( GetHierarchyURL(), aCmdEnv, aRegion ) ) { - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ); + OUString aPropName( TARGET_DIR_URL ); getTextProperty_Impl( aRegion, aPropName, maTargetURL ); // The targeturl must be substituted: $(baseinsturl) (#i32656#) @@ -1974,8 +1974,8 @@ void SfxDocTemplate_Impl::AddRegion( const OUString& rTitle, // now get the content of the region uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(2); - aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); - aProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL )); + aProps[0] = OUString(TITLE ); + aProps[1] = OUString(TARGET_URL ); try { @@ -2011,7 +2011,7 @@ void SfxDocTemplate_Impl::CreateFromHierarchy( Content &rTemplRoot ) { uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(1); - aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); + aProps[0] = OUString(TITLE ); try { @@ -2053,31 +2053,25 @@ sal_Bool SfxDocTemplate_Impl::Construct( ) if ( mbConstructed ) return sal_True; - uno::Reference< XMultiServiceFactory > xFactory; - xFactory = ::comphelper::getProcessServiceFactory(); + uno::Reference< XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); + uno::Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - OUString aService( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_DOCINFO ) ); + OUString aService( SERVICENAME_DOCINFO ); uno::Reference< XPersist > xInfo( xFactory->createInstance( aService ), UNO_QUERY ); mxInfo = xInfo; - aService = OUString( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_DOCTEMPLATES ) ); - uno::Reference< XDocumentTemplates > xTemplates( xFactory->createInstance( aService ), UNO_QUERY ); + mxTemplates = frame::DocumentTemplates::create(xContext); - if ( xTemplates.is() ) - mxTemplates = xTemplates; - else - return sal_False; - - uno::Reference< XLocalizable > xLocalizable( xTemplates, UNO_QUERY ); + uno::Reference< XLocalizable > xLocalizable( mxTemplates, UNO_QUERY ); Sequence< Any > aCompareArg(1); - *(aCompareArg.getArray()) <<= xLocalizable->getLocale();; + *(aCompareArg.getArray()) <<= xLocalizable->getLocale(); m_rCompareFactory = uno::Reference< XAnyCompareFactory >( - xFactory->createInstanceWithArguments( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.AnyCompareFactory")), + xFactory->createInstanceWithArguments( OUString("com.sun.star.ucb.AnyCompareFactory"), aCompareArg ), UNO_QUERY ); - uno::Reference < XContent > aRootContent = xTemplates->getContent(); + uno::Reference < XContent > aRootContent = mxTemplates->getContent(); uno::Reference < XCommandEnvironment > aCmdEnv; if ( ! aRootContent.is() ) @@ -2185,7 +2179,7 @@ sal_Bool SfxDocTemplate_Impl::GetTitleFromURL( const OUString& rURL, uno::Reference< XPropertySet > aPropSet( mxInfo, UNO_QUERY ); if ( aPropSet.is() ) { - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TITLE ) ); + OUString aPropName( TITLE ); Any aValue = aPropSet->getPropertyValue( aPropName ); aValue >>= aTitle; } diff --git a/sfx2/source/doc/doctempl.src b/sfx2/source/doc/doctempl.src index e71e77ff2cb3..482bbd4c0457 100644 --- a/sfx2/source/doc/doctempl.src +++ b/sfx2/source/doc/doctempl.src @@ -70,39 +70,3 @@ String RID_CNT_STR_WAITING { Text [ en-US ] = "The templates are being initialized for first-time usage." ; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index cdf6397e389d..85c5cd1aed61 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -419,12 +419,12 @@ void SfxDocTplService_Impl::init_Impl() // set maRootContent to the root of the templates hierarchy. Create the // entry if necessary - maRootURL = OUString( RTL_CONSTASCII_USTRINGPARAM( TEMPLATE_ROOT_URL ) ); + maRootURL = OUString( TEMPLATE_ROOT_URL ); maRootURL += String( '/' ); maRootURL += aLang; - ::rtl::OUString aTemplVersPropName( RTL_CONSTASCII_USTRINGPARAM( TEMPLATE_VERSION ) ); - ::rtl::OUString aTemplVers( RTL_CONSTASCII_USTRINGPARAM( TEMPLATE_VERSION_VALUE ) ); + ::rtl::OUString aTemplVersPropName( TEMPLATE_VERSION ); + ::rtl::OUString aTemplVers( TEMPLATE_VERSION_VALUE ); if ( Content::create( maRootURL, maCmdEnv, maRootContent ) ) { uno::Any aValue; @@ -450,7 +450,7 @@ void SfxDocTplService_Impl::init_Impl() if ( bIsInitialized ) { - OUString aService( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_DOCINFO ) ); + OUString aService( SERVICENAME_DOCINFO ); try { mxInfo = uno::Reference< XStandaloneDocumentInfo > ( mxFactory->createInstance( aService ), UNO_QUERY ); @@ -459,7 +459,7 @@ void SfxDocTplService_Impl::init_Impl() "cannot create DocumentProperties service"); } - aService = OUString( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_TYPEDETECTION ) ); + aService = OUString( SERVICENAME_TYPEDETECTION ); mxType = uno::Reference< XTypeDetection > ( mxFactory->createInstance( aService ), UNO_QUERY ); getDirList(); @@ -578,7 +578,7 @@ OUString SfxDocTplService_Impl::getLongName( const OUString& rShortName ) //----------------------------------------------------------------------------- void SfxDocTplService_Impl::getDirList() { - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( PROPERTY_DIRLIST ) ); + OUString aPropName( PROPERTY_DIRLIST ); Any aValue; // Get the template dir list @@ -593,21 +593,20 @@ void SfxDocTplService_Impl::getDirList() uno::Reference< util::XMacroExpander > xExpander; uno::Reference< XPropertySet > xPropSet( mxFactory, UNO_QUERY ); const rtl::OUString aPrefix( - RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.expand:" ) ); + "vnd.sun.star.expand:" ); if ( xPropSet.is() ) { xPropSet->getPropertyValue( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ) + "DefaultContext" ) ) >>= xCtx; } if ( xCtx.is() ) { xCtx->getValueByName( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "/singletons/com.sun.star.util.theMacroExpander" ) ) ) + rtl::OUString( "/singletons/com.sun.star.util.theMacroExpander" ) ) >>= xExpander; OSL_ENSURE( xExpander.is(), @@ -639,7 +638,7 @@ void SfxDocTplService_Impl::getDirList() //----------------------------------------------------------------------------- sal_Bool SfxDocTplService_Impl::needsUpdate() { - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( PROPERTY_NEEDSUPDATE ) ); + OUString aPropName( PROPERTY_NEEDSUPDATE ); sal_Bool bHasProperty = sal_False; sal_Bool bNeedsUpdate = sal_True; Any aValue; @@ -672,7 +671,7 @@ sal_Bool SfxDocTplService_Impl::setTitleForURL( const OUString& rURL, const OUSt { mxInfo->loadFromURL( rURL ); uno::Reference< XPropertySet > xPropSet( mxInfo, UNO_QUERY_THROW ); - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TITLE ) ); + OUString aPropName( TITLE ); xPropSet->setPropertyValue( aPropName, uno::makeAny( aTitle ) ); mxInfo->storeIntoURL( rURL ); bResult = sal_True; @@ -707,11 +706,11 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString& uno::Reference< XPropertySet > aPropSet( mxInfo, UNO_QUERY ); if ( aPropSet.is() ) { - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TITLE ) ); + OUString aPropName( TITLE ); Any aValue = aPropSet->getPropertyValue( aPropName ); aValue >>= aTitle; - aPropName = OUString( RTL_CONSTASCII_USTRINGPARAM( "MIMEType" ) ); + aPropName = OUString( "MIMEType" ); aValue = aPropSet->getPropertyValue( aPropName ); aValue >>= aType; } @@ -729,7 +728,7 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString& uno::Reference< container::XNameAccess > xTypeDetection( mxType, uno::UNO_QUERY_THROW ); SequenceAsHashMap aTypeProps( xTypeDetection->getByName( aDocType ) ); aType = aTypeProps.getUnpackedValueOrDefault( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), + ::rtl::OUString("MediaType"), ::rtl::OUString() ); } catch( uno::Exception& ) @@ -768,17 +767,17 @@ sal_Bool SfxDocTplService_Impl::addEntry( Content& rParentFolder, if ( ! Content::create( aLinkURL, maCmdEnv, aLink ) ) { Sequence< OUString > aNames(3); - aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( TITLE ) ); - aNames[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( IS_FOLDER ) ); - aNames[2] = OUString( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) ); + aNames[0] = OUString( TITLE ); + aNames[1] = OUString( IS_FOLDER ); + aNames[2] = OUString( TARGET_URL ); Sequence< Any > aValues(3); aValues[0] = makeAny( rTitle ); aValues[1] = makeAny( sal_Bool( sal_False ) ); aValues[2] = makeAny( rTargetURL ); - OUString aType( RTL_CONSTASCII_USTRINGPARAM( TYPE_LINK ) ); - OUString aAdditionalProp( RTL_CONSTASCII_USTRINGPARAM( PROPERTY_TYPE ) ); + OUString aType( TYPE_LINK ); + OUString aAdditionalProp( PROPERTY_TYPE ); try { @@ -819,8 +818,8 @@ sal_Bool SfxDocTplService_Impl::createFolder( const OUString& rNewFolderURL, try { Sequence< OUString > aNames(2); - aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( TITLE ) ); - aNames[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( IS_FOLDER ) ); + aNames[0] = OUString( TITLE ); + aNames[1] = OUString( IS_FOLDER ); Sequence< Any > aValues(2); aValues[0] = makeAny( aFolderName ); @@ -829,9 +828,9 @@ sal_Bool SfxDocTplService_Impl::createFolder( const OUString& rNewFolderURL, OUString aType; if ( bFsysFolder ) - aType = OUString( RTL_CONSTASCII_USTRINGPARAM( TYPE_FSYS_FOLDER ) ); + aType = OUString( TYPE_FSYS_FOLDER ); else - aType = OUString( RTL_CONSTASCII_USTRINGPARAM( TYPE_FOLDER ) ); + aType = OUString( TYPE_FOLDER ); aParent.insertNewContent( aType, aNames, aValues, rNewFolder ); bCreatedFolder = sal_True; @@ -884,14 +883,14 @@ sal_Bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const ::rtl::OU try { Sequence< OUString > aNames(2); - aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( TITLE ) ); - aNames[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( IS_FOLDER ) ); + aNames[0] = OUString( TITLE ); + aNames[1] = OUString( IS_FOLDER ); Sequence< Any > aValues(2); aValues[0] = makeAny( aTryName ); aValues[1] = makeAny( sal_Bool( sal_True ) ); - OUString aType( RTL_CONSTASCII_USTRINGPARAM( TYPE_FSYS_FOLDER ) ); + OUString aType( TYPE_FSYS_FOLDER ); bCreated = aParent.insertNewContent( aType, aNames, aValues, aNewFolder ); } @@ -944,20 +943,20 @@ sal_Bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const ::rtl::OU if ( nInd ) aTryName += ::rtl::OUString::valueOf( nInd ); if ( aExt.toChar() != '.' ) - aTryName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ); + aTryName += ::rtl::OUString( "." ); aTryName += aExt; try { Sequence< OUString > aNames(2); - aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( TITLE ) ); - aNames[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( IS_DOCUMENT ) ); + aNames[0] = OUString( TITLE ); + aNames[1] = OUString( IS_DOCUMENT ); Sequence< Any > aValues(2); aValues[0] = makeAny( aTryName ); aValues[1] = makeAny( sal_Bool( sal_True ) ); - OUString aType( RTL_CONSTASCII_USTRINGPARAM( TYPE_FSYS_FILE ) ); + OUString aType( TYPE_FSYS_FILE ); bCreated = aParent.insertNewContent( aType, aNames, aValues, aNewFile ); } @@ -994,7 +993,7 @@ sal_Bool SfxDocTplService_Impl::removeContent( Content& rContent ) sal_Bool bRemoved = sal_False; try { - OUString aCmd( RTL_CONSTASCII_USTRINGPARAM( COMMAND_DELETE ) ); + OUString aCmd( COMMAND_DELETE ); Any aArg = makeAny( sal_Bool( sal_True ) ); rContent.executeCommand( aCmd, aArg ); @@ -1233,7 +1232,7 @@ void SfxDocTplService_Impl::doUpdate() { ::osl::MutexGuard aGuard( maMutex ); - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( PROPERTY_NEEDSUPDATE ) ); + OUString aPropName( PROPERTY_NEEDSUPDATE ); Any aValue; aValue <<= sal_True; @@ -1277,7 +1276,7 @@ void SfxDocTplService_Impl::doUpdate() Content aGroup; if ( Content::create( pGroup->getHierarchyURL(), maCmdEnv, aGroup ) ) setProperty( aGroup, - OUString( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ), + OUString( TARGET_DIR_URL ), makeAny( pGroup->getTargetURL() ) ); size_t nCount = pGroup->count(); @@ -1318,7 +1317,7 @@ void SfxDocTplService_Impl::doUpdate() uno::Sequence< beans::StringPair > SfxDocTplService_Impl::ReadUINamesForTemplateDir_Impl( const ::rtl::OUString& aUserPath ) { INetURLObject aLocObj( aUserPath ); - aLocObj.insertName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "groupuinames.xml" ) ), false, + aLocObj.insertName( ::rtl::OUString( "groupuinames.xml" ), false, INetURLObject::LAST_SEGMENT, true, INetURLObject::ENCODE_ALL ); Content aLocContent; @@ -1419,11 +1418,11 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU sal_Bool bResult = sal_False; try { uno::Reference< beans::XPropertySet > xTempFile( - mxFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")) ), + mxFactory->createInstance( ::rtl::OUString("com.sun.star.io.TempFile") ), uno::UNO_QUERY_THROW ); ::rtl::OUString aTempURL; - uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")) ); + uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString("Uri") ); aUrl >>= aTempURL; uno::Reference< io::XStream > xStream( xTempFile, uno::UNO_QUERY_THROW ); @@ -1442,7 +1441,7 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU Content aSourceContent( aTempURL, maCmdEnv ); aTargetContent.transferContent( aSourceContent, InsertOperation_COPY, - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "groupuinames.xml" ) ), + ::rtl::OUString( "groupuinames.xml" ), ucb::NameClash::OVERWRITE ); bResult = sal_True; } @@ -1473,7 +1472,7 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU aResultURL, aNewFolder ) && !CreateNewUniqueFolderWithPrefix( aTargetPath, - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserGroup" ) ), + ::rtl::OUString( "UserGroup" ), aNewFolderName, aResultURL, aNewFolder ) ) @@ -1489,7 +1488,7 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU } // Now set the target url for this group and we are done - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ); + OUString aPropName( TARGET_DIR_URL ); Any aValue = makeAny( aResultURL ); if ( ! setProperty( aGroup, aPropName, aValue ) ) @@ -1551,7 +1550,7 @@ sal_Bool SfxDocTplService_Impl::addGroup( const OUString& rGroupName ) aNewFolderURL, aNewFolder ) && !CreateNewUniqueFolderWithPrefix( aUserPath, - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserGroup" ) ), + ::rtl::OUString( "UserGroup" ), aNewFolderName, aNewFolderURL, aNewFolder ) ) @@ -1572,7 +1571,7 @@ sal_Bool SfxDocTplService_Impl::addGroup( const OUString& rGroupName ) } // Now set the target url for this group and we are done - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ); + OUString aPropName( TARGET_DIR_URL ); Any aValue = makeAny( aNewFolderURL ); if ( ! setProperty( aNewGroup, aPropName, aValue ) ) @@ -1607,7 +1606,7 @@ sal_Bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName ) if ( Content::create( aGroupURL, maCmdEnv, aGroup ) ) { - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ); + OUString aPropName( TARGET_DIR_URL ); Any aValue; OUString aGroupTargetURL; @@ -1632,7 +1631,7 @@ sal_Bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName ) uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps( 1 ); - aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL )); + aProps[0] = OUString(TARGET_URL ); try { @@ -1723,7 +1722,7 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName, OUString aGroupTargetURL; // there is no need to check whether target dir url is in target path, since if the target path is changed // the target dir url should be already generated new - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ); + OUString aPropName( TARGET_DIR_URL ); Any aValue; if ( getProperty( aGroup, aPropName, aValue ) ) aValue >>= aGroupTargetURL; @@ -1749,7 +1748,7 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName, uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps( 1 ); - aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL )); + aProps[0] = OUString(TARGET_URL ); ResultSetInclude eInclude = INCLUDE_DOCUMENTS_ONLY; xResultSet = aGroup.createCursor( aProps, eInclude ); @@ -1783,7 +1782,7 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName, rNewName ) ) { // rename the group in the hierarchy - OUString aTitleProp( RTL_CONSTASCII_USTRINGPARAM( TITLE ) ); + OUString aTitleProp( TITLE ); Any aTitleValue; aTitleValue <<= rNewName; @@ -1818,7 +1817,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, return sal_False; ::rtl::OUString aGroupTargetURL; - ::rtl::OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ); + ::rtl::OUString aPropName( TARGET_DIR_URL ); Any aValue; if ( getProperty( aGroup, aPropName, aValue ) ) aValue >>= aGroupTargetURL; @@ -1835,7 +1834,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, if ( Content::create( aTemplateURL, maCmdEnv, aTemplateToRemove ) ) { - OUString aTargetTemplPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) ); + OUString aTargetTemplPropName( TARGET_URL ); bRemoveOldTemplateContent = sal_True; if ( getProperty( aTemplateToRemove, aTargetTemplPropName, aValue ) ) @@ -1855,7 +1854,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, // get document service name uno::Reference< frame::XModuleManager > xModuleManager( xFactory->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")) ), + ::rtl::OUString("com.sun.star.frame.ModuleManager") ), uno::UNO_QUERY_THROW ); sDocServiceName = xModuleManager->identify( uno::Reference< uno::XInterface >( rStorable, uno::UNO_QUERY ) ); if ( sDocServiceName.isEmpty() ) @@ -1866,18 +1865,18 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, uno::Reference< lang::XMultiServiceFactory > xConfigProvider( xFactory->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")) ), + ::rtl::OUString("com.sun.star.configuration.ConfigurationProvider") ), uno::UNO_QUERY_THROW ); uno::Sequence< uno::Any > aArgs( 1 ); beans::PropertyValue aPathProp; - aPathProp.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")); - aPathProp.Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Setup/Office/Factories/" ) ); + aPathProp.Name = ::rtl::OUString("nodepath"); + aPathProp.Value <<= ::rtl::OUString( "/org.openoffice.Setup/Office/Factories/" ); aArgs[0] <<= aPathProp; uno::Reference< container::XNameAccess > xSOFConfig( xConfigProvider->createInstanceWithArguments( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")), + ::rtl::OUString("com.sun.star.configuration.ConfigurationAccess"), aArgs ), uno::UNO_QUERY_THROW ); @@ -1886,14 +1885,14 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, if ( !xApplConfig.is() ) throw uno::RuntimeException(); - xApplConfig->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooSetupFactoryActualTemplateFilter" ) ) ) >>= aFilterName; + xApplConfig->getByName( ::rtl::OUString( "ooSetupFactoryActualTemplateFilter" ) ) >>= aFilterName; if ( aFilterName.isEmpty() ) throw uno::RuntimeException(); // find the related type name ::rtl::OUString aTypeName; uno::Reference< container::XNameAccess > xFilterFactory( - xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")) ), + xFactory->createInstance( ::rtl::OUString("com.sun.star.document.FilterFactory") ), uno::UNO_QUERY_THROW ); uno::Sequence< beans::PropertyValue > aFilterData; @@ -1910,16 +1909,16 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, mxType.is() ? uno::Reference< container::XNameAccess >( mxType, uno::UNO_QUERY_THROW ) : uno::Reference< container::XNameAccess >( - xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")) ), + xFactory->createInstance( ::rtl::OUString("com.sun.star.document.TypeDetection") ), uno::UNO_QUERY_THROW ); SequenceAsHashMap aTypeProps( xTypeDetection->getByName( aTypeName ) ); uno::Sequence< ::rtl::OUString > aAllExt = - aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")), Sequence< ::rtl::OUString >() ); + aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString("Extensions"), Sequence< ::rtl::OUString >() ); if ( !aAllExt.getLength() ) throw uno::RuntimeException(); - ::rtl::OUString aMediaType = aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), ::rtl::OUString() ); + ::rtl::OUString aMediaType = aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString("MediaType"), ::rtl::OUString() ); ::rtl::OUString aExt = aAllExt[0]; if ( aMediaType.isEmpty() || aExt.isEmpty() ) @@ -1937,7 +1936,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, ::rtl::OUString aNewTemplateTargetURL = CreateNewUniqueFileWithPrefix( aGroupTargetURL, rTemplateName, aExt ); if ( aNewTemplateTargetURL.isEmpty() ) { - aNewTemplateTargetURL = CreateNewUniqueFileWithPrefix( aGroupTargetURL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserTemplate" ) ), aExt ); + aNewTemplateTargetURL = CreateNewUniqueFileWithPrefix( aGroupTargetURL, ::rtl::OUString( "UserTemplate" ), aExt ); if ( aNewTemplateTargetURL.isEmpty() ) throw uno::RuntimeException(); @@ -1945,9 +1944,9 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, // store template uno::Sequence< PropertyValue > aStoreArgs( 2 ); - aStoreArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); + aStoreArgs[0].Name = ::rtl::OUString("FilterName"); aStoreArgs[0].Value <<= aFilterName; - aStoreArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")); + aStoreArgs[1].Name = ::rtl::OUString("DocumentTitle"); aStoreArgs[1].Value <<= rTemplateName; ::rtl::OUString aCurrentDocumentURL = rStorable->getLocation(); @@ -2019,7 +2018,7 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, // get the target url of the group OUString aTargetURL; - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ); + OUString aPropName( TARGET_DIR_URL ); Any aValue; if ( getProperty( aGroup, aPropName, aValue ) ) @@ -2097,7 +2096,7 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, Content aResultContent; if ( Content::create( aNewTemplateTargetURL, xEnv, aResultContent ) ) { - ::rtl::OUString aPropertyName( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ); + ::rtl::OUString aPropertyName( "IsReadOnly" ); uno::Any aProperty; sal_Bool bReadOnly = sal_False; if ( getProperty( aResultContent, aPropertyName, aProperty ) && ( aProperty >>= bReadOnly ) && bReadOnly ) @@ -2169,7 +2168,7 @@ sal_Bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName, // get the target URL from the template OUString aTargetURL; - OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) ); + OUString aPropName( TARGET_URL ); Any aValue; if ( getProperty( aTemplate, aPropName, aValue ) ) @@ -2232,7 +2231,7 @@ sal_Bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName, return sal_False; OUString aTemplateTargetURL; - OUString aTargetProp( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) ); + OUString aTargetProp( TARGET_URL ); Any aTargetValue; if ( getProperty( aTemplate, aTargetProp, aTargetValue ) ) @@ -2242,7 +2241,7 @@ sal_Bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName, return sal_False; // rename the template entry in the cache - OUString aTitleProp( RTL_CONSTASCII_USTRINGPARAM( TITLE ) ); + OUString aTitleProp( TITLE ); Any aTitleValue; aTitleValue <<= rNewName; @@ -2420,7 +2419,7 @@ WaitWindow_Impl::WaitWindow_Impl() { Rectangle aRect = Rectangle( 0, 0, 300, 30000 ); _nTextStyle = TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER | TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE; - _aText = String( SfxResId( RID_CNT_STR_WAITING ) ); + _aText = SfxResId( RID_CNT_STR_WAITING ).toString(); _aRect = GetTextRect( aRect, _aText, _nTextStyle ); aRect = _aRect; aRect.Right() += 2*X_OFFSET; @@ -2454,9 +2453,9 @@ void SfxDocTplService_Impl::addHierGroup( GroupList_Impl& rList, uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(3); - aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); - aProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL )); - aProps[2] = OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTY_TYPE )); + aProps[0] = OUString(TITLE ); + aProps[1] = OUString(TARGET_URL ); + aProps[2] = OUString(PROPERTY_TYPE ); try { @@ -2565,7 +2564,7 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, Content aContent; uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(1); - aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); + aProps[0] = OUString(TITLE ); try { @@ -2618,7 +2617,7 @@ void SfxDocTplService_Impl::createFromContent( GroupList_Impl& rList, // when scanning the file system, we have to add the 'standard' group, too if ( ! bHierarchy ) { - OUString aUIStdTitle = getLongName( OUString( RTL_CONSTASCII_USTRINGPARAM( STANDARD_FOLDER ) ) ); + OUString aUIStdTitle = getLongName( OUString( STANDARD_FOLDER ) ); addFsysGroup( rList, ::rtl::OUString(), aUIStdTitle, aTargetURL, bWriteableContent ); } @@ -2632,7 +2631,7 @@ void SfxDocTplService_Impl::createFromContent( GroupList_Impl& rList, uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(1); - aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); + aProps[0] = OUString(TITLE ); try { @@ -2724,13 +2723,13 @@ void SfxDocTplService_Impl::updateData( DocTemplates_EntryData_Impl *pData ) if ( pData->getUpdateType() ) { - aPropName = OUString( RTL_CONSTASCII_USTRINGPARAM( PROPERTY_TYPE ) ); + aPropName = OUString( PROPERTY_TYPE ); setProperty( aTemplate, aPropName, makeAny( pData->getType() ) ); } if ( pData->getUpdateLink() ) { - aPropName = OUString( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) ); + aPropName = OUString( TARGET_URL ); setProperty( aTemplate, aPropName, makeAny( pData->getTargetURL() ) ); } } @@ -2738,7 +2737,7 @@ void SfxDocTplService_Impl::updateData( DocTemplates_EntryData_Impl *pData ) //----------------------------------------------------------------------------- void SfxDocTplService_Impl::addGroupToHierarchy( GroupData_Impl *pGroup ) { - OUString aAdditionalProp( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ); + OUString aAdditionalProp( TARGET_DIR_URL ); Content aGroup; INetURLObject aNewGroupObj( maRootURL ); @@ -2878,7 +2877,7 @@ void SfxURLRelocator_Impl::initOfficeInstDirs() { xPropSet->getPropertyValue( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ) + "DefaultContext" ) ) >>= xCtx; } @@ -2889,9 +2888,9 @@ void SfxURLRelocator_Impl::initOfficeInstDirs() if ( xCtx.is() ) { xCtx->getValueByName( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString( "/singletons/" - "com.sun.star.util.theOfficeInstallationDirectories" ) ) ) + "com.sun.star.util.theOfficeInstallationDirectories" ) ) >>= mxOfficeInstDirs; } diff --git a/sfx2/source/doc/doctemplateslocal.hxx b/sfx2/source/doc/doctemplateslocal.hxx index 720cb62b71c0..49327eab3b75 100644 --- a/sfx2/source/doc/doctemplateslocal.hxx +++ b/sfx2/source/doc/doctemplateslocal.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_DOCTEMPLATESLOCAL_HXX #define _SFX_DOCTEMPLATESLOCAL_HXX diff --git a/sfx2/source/doc/docundomanager.cxx b/sfx2/source/doc/docundomanager.cxx index 6c3948163e4c..f74d12b6e3e4 100644 --- a/sfx2/source/doc/docundomanager.cxx +++ b/sfx2/source/doc/docundomanager.cxx @@ -33,9 +33,7 @@ #include "sfx2/viewsh.hxx" #include "sfx2/bindings.hxx" -/** === begin UNO includes === **/ #include <com/sun/star/lang/XComponent.hpp> -/** === end UNO includes === **/ #include <comphelper/anytostring.hxx> #include <comphelper/flagguard.hxx> diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index a1eded4f2b52..73e3d79abaae 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -244,7 +244,7 @@ SfxOrganizeDlg_Impl::SfxOrganizeDlg_Impl( SfxTemplateOrganizeDlg* pParent, else { // fallback - String aProgURL = SvtPathOptions().SubstituteVariable( String::CreateFromAscii("$(PROGURL)") ); + String aProgURL = SvtPathOptions().SubstituteVariable( rtl::OUString("$(PROGURL)") ); INetURLObject aObj( aProgURL ); DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Illegal URL !" ); aLastDir = aObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); @@ -329,7 +329,7 @@ sal_Bool QueryDelete_Impl(Window *pParent, // Parent to QueryBox */ { SfxResId aResId( nId ); - String aEntryText( aResId ); + String aEntryText( aResId.toString() ); aEntryText.SearchAndReplaceAscii( "$1", rTemplateName ); QueryBox aBox( pParent, WB_YES_NO | WB_DEF_NO, aEntryText ); return RET_NO != aBox.Execute(); @@ -346,12 +346,12 @@ void ErrorDelete_Impl(Window *pParent, const String &rName, sal_Bool bFolder = s { if ( bFolder ) { - String aText( SfxResId( STR_ERROR_DELETE_TEMPLATE_DIR ) ); + rtl::OUString aText(SfxResId(STR_ERROR_DELETE_TEMPLATE_DIR).toString()); ErrorBox( pParent, WB_OK, aText ).Execute(); } else { - String aText( SfxResId( STR_ERROR_DELETE_TEMPLATE ) ); + String aText( SfxResId(STR_ERROR_DELETE_TEMPLATE).toString() ); aText.SearchAndReplaceAscii( "$1", rName ); ErrorBox( pParent, WB_OK, aText ).Execute(); } @@ -594,7 +594,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox, else if ( bCopy ) { // the template organizer always tries copy after the move, so no error is required for move case - String aText( SfxResId( bCopy ? STR_ERROR_COPY_TEMPLATE : STR_ERROR_MOVE_TEMPLATE ) ); + String aText( SfxResId( bCopy ? STR_ERROR_COPY_TEMPLATE : STR_ERROR_MOVE_TEMPLATE ).toString() ); aText.SearchAndReplaceAscii( "$1", ( (SvTreeListBox *)pSourceBox )->GetEntryText( pSource ) ); ErrorBox( this, WB_OK, aText ).Execute(); @@ -1499,10 +1499,10 @@ String SfxOrganizeDlg_Impl::GetPath_Impl( sal_Bool bOpen, const String& rFileNam pFileDlg = new sfx2::FileDialogHelper( nDialogType, 0L ); // add "All" filter - pFileDlg->AddFilter( String( SfxResId( STR_SFX_FILTERNAME_ALL ) ), + pFileDlg->AddFilter( SfxResId(STR_SFX_FILTERNAME_ALL).toString(), DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL ) ); // add template filter - String sFilterName( SfxResId( STR_TEMPLATE_FILTER ) ); + String sFilterName( SfxResId(STR_TEMPLATE_FILTER).toString() ); String sFilterExt; // add filters of modules which are installed SvtModuleOptions aModuleOpt; @@ -1594,11 +1594,11 @@ String SfxOrganizeDlg_Impl::GetPath_Impl( sal_Bool bOpen, const String& rFileNam com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, SFXWB_MULTISELECTION ); // add "All" filter - pFileDlg->AddFilter( String( SfxResId( STR_SFX_FILTERNAME_ALL ) ), + pFileDlg->AddFilter( SfxResId(STR_SFX_FILTERNAME_ALL).toString(), DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL ) ); // add template filter - String sFilterName( SfxResId( STR_TEMPLATE_FILTER ) ); + String sFilterName( SfxResId(STR_TEMPLATE_FILTER).toString() ); String sFilterExt; // add filters of modules which are installed SvtModuleOptions aModuleOpt; @@ -2211,20 +2211,20 @@ IMPL_LINK( SfxOrganizeDlg_Impl, AddFiles_Impl, Button *, pButton ) static String sConfigExt( DEFINE_CONST_UNICODE( "*.cfg" ) ); static String sBasicExt( DEFINE_CONST_UNICODE( "*.sbl" ) ); - String sFilterName( SfxResId( RID_STR_FILTCONFIG ) ); + String sFilterName( SfxResId(RID_STR_FILTCONFIG).toString() ); sFilterName += sOpenBracket; sFilterName += sConfigExt; sFilterName += sCloseBracket; pFileDlg->AddFilter( sFilterName, sConfigExt ); - sFilterName = String( SfxResId( RID_STR_FILTBASIC ) ); + sFilterName = SfxResId(RID_STR_FILTBASIC).toString(); sFilterName += sOpenBracket; sFilterName += sBasicExt; sFilterName += sCloseBracket; pFileDlg->AddFilter( sFilterName, sBasicExt ); // set "All" filter as current - pFileDlg->SetCurrentFilter( String( SfxResId( STR_SFX_FILTERNAME_ALL ) ) ); + pFileDlg->SetCurrentFilter( SfxResId(STR_SFX_FILTERNAME_ALL).toString() ); if ( aLastDir.Len() ) pFileDlg->SetDisplayDirectory( aLastDir ); @@ -2262,7 +2262,7 @@ IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ImportHdl) if ( aPath.Len() && !aMgr.CopyTo( m_nRegion, m_nIndex, aPath ) ) { - String aText( SfxResId( STR_ERROR_COPY_TEMPLATE ) ); + String aText( SfxResId(STR_ERROR_COPY_TEMPLATE).toString() ); aText.SearchAndReplaceAscii( "$1", aPath ); ErrorBox( pDialog, WB_OK, aText ).Execute(); } @@ -2294,7 +2294,7 @@ IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ExportHdl) String aPath = String( aPaths.getArray()[0] ); if ( aPath.Len() && !aMgr.CopyFrom( pFocusBox, m_nRegion, m_nIndex, aPath ) ) { - String aText( SfxResId( STR_ERROR_COPY_TEMPLATE ) ); + String aText( SfxResId(STR_ERROR_COPY_TEMPLATE).toString() ); aText.SearchAndReplaceAscii( "$1", aPath ); ErrorBox( pDialog, WB_OK, aText ).Execute(); } @@ -2312,7 +2312,7 @@ IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ExportHdl) String aPath = aPathObj.GetMainURL( INetURLObject::NO_DECODE ); if ( aPath.Len() && !aMgr.CopyFrom( pFocusBox, m_nRegion, m_nIndex, aPath ) ) { - String aText( SfxResId( STR_ERROR_COPY_TEMPLATE ) ); + String aText( SfxResId(STR_ERROR_COPY_TEMPLATE).toString() ); aText.SearchAndReplaceAscii( "$1", aPath ); ErrorBox( pDialog, WB_OK, aText ).Execute(); } diff --git a/sfx2/source/doc/docvor.hrc b/sfx2/source/doc/docvor.hrc index c17f424a2a90..f191ddddbb20 100644 --- a/sfx2/source/doc/docvor.hrc +++ b/sfx2/source/doc/docvor.hrc @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #define IMG_OPENED_FOLDER 2 #define IMG_CLOSED_FOLDER 1 @@ -36,7 +27,6 @@ #define ID_DELETE 203 #define ID_EDIT 204 #define ID_COPY_FROM 211 -#define ID_EXPORT 221 #define ID_RESCAN 220 #define ID_COPY_TO 210 #define ID_NEW 200 @@ -55,8 +45,6 @@ #define BTN_FILES 3 #define BTN_ADDRESSTEMPLATE 4 #define LB_LEFT 1 -#define FT_DEFAULT_TEMPLATE_LABEL 20 -#define FT_DEFAULT_TEMPLATE 21 #define BTN_HELP 100 #ifdef BTN_OK diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index 8e79f753da79..e7ec525d7eaa 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -56,6 +56,7 @@ #include <com/sun/star/uno/Exception.hpp> #include <com/sun/star/datatransfer/XTransferable.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/graphic/GraphicProvider.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/io/XStream.hpp> @@ -116,7 +117,7 @@ void* GraphicHelper::getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta ) #ifdef WNT if ( pGDIMeta ) { - String aStr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".emf")); + String aStr = ::rtl::OUString(".emf"); ::utl::TempFile aTempFile( ::rtl::OUString(), &aStr, NULL, @@ -455,42 +456,33 @@ sal_Bool GraphicHelper::getThumbnailReplacement_Impl( sal_Int32 nResID, const un sal_Bool bResult = sal_False; if ( nResID && xStream.is() ) { - uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); - if ( xServiceManager.is() ) + uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + try { - try - { - uno::Reference< graphic::XGraphicProvider > xGraphProvider( - xServiceManager->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.graphic.GraphicProvider")) ), - uno::UNO_QUERY ); - if ( xGraphProvider.is() ) - { - ::rtl::OUString aURL(RTL_CONSTASCII_USTRINGPARAM("private:resource/sfx/bitmapex/")); - aURL += ::rtl::OUString::valueOf( nResID ); + uno::Reference< graphic::XGraphicProvider > xGraphProvider(graphic::GraphicProvider::create(xContext)); + ::rtl::OUString aURL("private:resource/sfx/bitmapex/"); + aURL += ::rtl::OUString::valueOf( nResID ); - uno::Sequence< beans::PropertyValue > aMediaProps( 1 ); - aMediaProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")); - aMediaProps[0].Value <<= aURL; + uno::Sequence< beans::PropertyValue > aMediaProps( 1 ); + aMediaProps[0].Name = "URL"; + aMediaProps[0].Value <<= aURL; - uno::Reference< graphic::XGraphic > xGraphic = xGraphProvider->queryGraphic( aMediaProps ); - if ( xGraphic.is() ) - { - uno::Sequence< beans::PropertyValue > aStoreProps( 2 ); - aStoreProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutputStream")); - aStoreProps[0].Value <<= xStream; - aStoreProps[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MimeType")); - aStoreProps[1].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/png")); - - xGraphProvider->storeGraphic( xGraphic, aStoreProps ); - bResult = sal_True; - } - } - } - catch(const uno::Exception&) + uno::Reference< graphic::XGraphic > xGraphic = xGraphProvider->queryGraphic( aMediaProps ); + if ( xGraphic.is() ) { + uno::Sequence< beans::PropertyValue > aStoreProps( 2 ); + aStoreProps[0].Name = "OutputStream"; + aStoreProps[0].Value <<= xStream; + aStoreProps[1].Name = "MimeType"; + aStoreProps[1].Value <<= ::rtl::OUString("image/png"); + + xGraphProvider->storeGraphic( xGraphic, aStoreProps ); + bResult = sal_True; } } + catch(const uno::Exception&) + { + } } return bResult; diff --git a/sfx2/source/doc/graphhelp.hxx b/sfx2/source/doc/graphhelp.hxx index 0fce34e13171..0c4eeb9825c1 100644 --- a/sfx2/source/doc/graphhelp.hxx +++ b/sfx2/source/doc/graphhelp.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/io/XStream.hpp> diff --git a/sfx2/source/doc/graphhelp.src b/sfx2/source/doc/graphhelp.src index 1936a8460d25..8ec236b6b11b 100644 --- a/sfx2/source/doc/graphhelp.src +++ b/sfx2/source/doc/graphhelp.src @@ -1,29 +1,20 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "doc.hrc" diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 3231bdea1a6a..25f08a21d4e6 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/document/XDocumentInfo.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/util/DateTime.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/frame/XStorable2.hpp> @@ -68,6 +69,7 @@ #include <svtools/miscopt.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/configurationhelper.hxx> #include <comphelper/mimeconfighelper.hxx> @@ -645,9 +647,8 @@ sal_Int8 ModelData_Impl::CheckSaveAcceptable( sal_Int8 nCurStatus ) && GetMediaDescr().find( aVersionCommentString ) == GetMediaDescr().end() ) { // notify the user that SaveAs is going to be done - String aString( SfxResId( STR_NEW_FILENAME_SAVE ) ); Window* pWin = SfxStoringHelper::GetModelWindow( m_xModel ); - QueryBox aMessageBox( pWin, WB_OK_CANCEL | WB_DEF_OK, aString ); + QueryBox aMessageBox( pWin, WB_OK_CANCEL | WB_DEF_OK, SfxResId(STR_NEW_FILENAME_SAVE).toString() ); if ( aMessageBox.Execute() == RET_OK ) nResult = STATUS_SAVEAS; else @@ -895,10 +896,10 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, if ( xControlAccess.is() ) { - ::rtl::OUString aCtrlText = String( SfxResId( STR_EXPORTBUTTON ) ); + ::rtl::OUString aCtrlText = SfxResId(STR_EXPORTBUTTON).toString(); xControlAccess->setLabel( ui::dialogs::CommonFilePickerElementIds::PUSHBUTTON_OK, aCtrlText ); - aCtrlText = ::rtl::OUString( String( SfxResId( STR_LABEL_FILEFORMAT ) ) ); + aCtrlText = SfxResId(STR_LABEL_FILEFORMAT).toString(); xControlAccess->setLabel( ui::dialogs::CommonFilePickerElementIds::LISTBOX_FILTER_LABEL, aCtrlText ); } } @@ -1118,11 +1119,8 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog() util::URL aURL; aURL.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SetDocumentProperties")); - uno::Reference< util::XURLTransformer > xTransformer( - m_pOwner->GetServiceFactory()->createInstance( - DEFINE_CONST_UNICODE("com.sun.star.util.URLTransformer") ), - uno::UNO_QUERY ); - if ( xTransformer.is() && xTransformer->parseStrict( aURL ) ) + uno::Reference < util::XURLTransformer > xTransformer( util::URLTransformer::create( ::comphelper::ComponentContext(m_pOwner->GetServiceFactory()).getUNOContext() ) ); + if ( xTransformer->parseStrict( aURL ) ) { uno::Reference< frame::XDispatch > xDispatch = xFrameDispatch->queryDispatch( aURL, diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 69f740c8f19c..8e0a03029013 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -33,8 +33,10 @@ #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> +#include <comphelper/componentcontext.hxx> #include <tools/urlobj.hxx> #include <tools/debug.hxx> #include <rtl/ustring.hxx> @@ -141,8 +143,7 @@ throw( uno::RuntimeException ) // we must destroy the IFrame before the parent is destroyed xWindow->addEventListener( this ); - mxFrame = uno::Reference< frame::XFrame >( mxFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Frame")) ), - uno::UNO_QUERY ); + mxFrame = uno::Reference< frame::XFrame >( mxFact->createInstance( "com.sun.star.frame.Frame" ),uno::UNO_QUERY ); uno::Reference < awt::XWindow > xWin( pWin->GetComponentInterface(), uno::UNO_QUERY ); mxFrame->initialize( xWin ); mxFrame->setName( maFrmDescr.GetName() ); @@ -155,15 +156,15 @@ throw( uno::RuntimeException ) util::URL aTargetURL; aTargetURL.Complete = ::rtl::OUString( maFrmDescr.GetURL().GetMainURL( INetURLObject::NO_DECODE ) ); - uno::Reference < util::XURLTransformer > xTrans( mxFact->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), uno::UNO_QUERY ); + uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::ComponentContext(mxFact).getUNOContext() ) ); xTrans->parseStrict( aTargetURL ); uno::Sequence < beans::PropertyValue > aProps(2); - aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginMode")); + aProps[0].Name = "PluginMode"; aProps[0].Value <<= (sal_Int16) 2; - aProps[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); + aProps[1].Name = "ReadOnly"; aProps[1].Value <<= (sal_Bool) sal_True; - uno::Reference < frame::XDispatch > xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_self")), 0 ); + uno::Reference < frame::XDispatch > xDisp = xProv->queryDispatch( aTargetURL, "_self", 0 ); if ( xDisp.is() ) xDisp->dispatch( aTargetURL, aProps ); @@ -367,7 +368,7 @@ void SAL_CALL IFrameObject::removeVetoableChangeListener(const ::rtl::OUString&, ::sal_Int16 SAL_CALL IFrameObject::execute() throw (::com::sun::star::uno::RuntimeException) { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:InsertObjectFloatingFrame")), mxObj ); + VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, ".uno:InsertObjectFloatingFrame", mxObj ); if ( pDlg ) pDlg->Execute(); return 0; diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 2696882f154d..870e9068c306 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -303,7 +303,7 @@ IMPL_LINK( SfxNewFileDialog_Impl, RegionSelect, ListBox *, pBox ) sal_uInt16 nc=aSel.Search('('); if (nc-1&&nc!=STRING_NOTFOUND) aSel.Erase(nc-1); - if (aSel.CompareIgnoreCaseToAscii( String(SfxResId(STR_STANDARD)) )==COMPARE_EQUAL) + if (aSel.CompareIgnoreCaseToAscii( SfxResId(STR_STANDARD).toString() )==COMPARE_EQUAL) aTemplateLb.InsertEntry(aNone); for (sal_uInt16 i = 0; i < nCount; ++i) aTemplateLb.InsertEntry(aTemplates.GetName(nRegion, i)); @@ -391,7 +391,7 @@ sal_uInt16 SfxNewFileDialog_Impl::GetSelectedTemplatePos() const sal_uInt16 nc=aSel.Search('('); if (nc-1&&nc!=STRING_NOTFOUND) aSel.Erase(nc-1); - if (aSel.CompareIgnoreCaseToAscii(String(SfxResId(STR_STANDARD)))!=COMPARE_EQUAL) + if (aSel.CompareIgnoreCaseToAscii(SfxResId(STR_STANDARD).toString())!=COMPARE_EQUAL) nEntry++; if (!aTemplateLb.GetSelectEntryCount()) nEntry=0; @@ -479,8 +479,8 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl( aCancelBt( pAntiImplP, SfxResId( BT_CANCEL ) ), aHelpBt( pAntiImplP, SfxResId( BT_HELP ) ), pMoreBt( new MoreButton( pAntiImplP, SfxResId( BT_MORE ) ) ), - aNone( SfxResId(STR_NONE) ), - sLoadTemplate( SfxResId(STR_LOAD_TEMPLATE)), + aNone(SfxResId(STR_NONE).toString()), + sLoadTemplate(SfxResId(STR_LOAD_TEMPLATE).toString()), nFlags(nFl), pAntiImpl( pAntiImplP ) { diff --git a/sfx2/source/doc/new.hrc b/sfx2/source/doc/new.hrc index dd8878bf0177..375620c105cb 100644 --- a/sfx2/source/doc/new.hrc +++ b/sfx2/source/doc/new.hrc @@ -1,33 +1,22 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #define BTN_PREVIEW 51 #define WIN_PREVIEW 50 -#define GB_DOCCLASS 1 -#define LB_DOCCLASS 2 #define GB_DESC 10 #define FT_DESC 11 #define FT_STYLESHEETS 19 @@ -37,7 +26,6 @@ #define FT_KEYWORDS 60 #define FT_TITLE 55 #define ED_DESC 71 -#define FT_DOCINFO 70 #define LB_REGION 21 #define BT_OK 30 #define BT_CANCEL 31 diff --git a/sfx2/source/doc/new.src b/sfx2/source/doc/new.src index a524a50bd089..3febf0331af8 100644 --- a/sfx2/source/doc/new.src +++ b/sfx2/source/doc/new.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include <sfx2/sfx.hrc> #include "doc.hrc" @@ -240,34 +231,3 @@ ModalDialog DLG_NEW_FILE 44; }; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 398cf85808f3..d96dd1adb80b 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -403,7 +403,7 @@ void SfxObjectShell::GetContent(String &rText, if ( nTextResId ) { - rText = String(SfxResId(nTextResId)); + rText = SfxResId(nTextResId).toString(); rClosedBitmap = Bitmap(SfxResId(nClosedBitmapResId)); rOpenedBitmap = Bitmap(SfxResId(nOpenedBitmapResId)); } @@ -679,7 +679,7 @@ sal_Bool SfxObjectShell::Print const sal_uInt16 nXIndent = 200; sal_uInt16 nYIndent = 200; Point aOutPos(nXIndent, nYIndent); - String aHeader(SfxResId(STR_PRINT_STYLES_HEADER)); + String aHeader(SfxResId(STR_PRINT_STYLES_HEADER).toString()); if ( pObjectName ) aHeader += *pObjectName; else @@ -940,8 +940,8 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) bLoad = sal_True; else if ( bCanUpdateFromTemplate == document::UpdateDocMode::ACCORDING_TO_CONFIG ) { - String sMessage( SfxResId( STR_QRYTEMPL_MESSAGE ) ); - sMessage.SearchAndReplace( String::CreateFromAscii("$(ARG1)"), aTemplName ); + String sMessage( SfxResId(STR_QRYTEMPL_MESSAGE).toString() ); + sMessage.SearchAndReplace( rtl::OUString("$(ARG1)"), aTemplName ); sfx2::QueryTemplateBox aBox( GetDialogParent(), sMessage ); if ( RET_YES == aBox.Execute() ) bLoad = sal_True; diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 900858c1f923..ff3510896a40 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -57,7 +57,8 @@ #include <com/sun/star/embed/XEmbedPersist.hpp> #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/container/XChild.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/ucb/SimpleFileAccess.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> #include <com/sun/star/script/provider/XScript.hpp> #include <com/sun/star/script/provider/XScriptProvider.hpp> #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp> @@ -70,9 +71,10 @@ #include <com/sun/star/task/ErrorCodeRequest.hpp> #include <unotools/securityoptions.hxx> -#include <comphelper/processfactory.hxx> #include <comphelper/componentcontext.hxx> #include <comphelper/configurationhelper.hxx> +#include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> #include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp> @@ -262,7 +264,7 @@ sal_uInt32 SfxObjectShell::GetErrorCode() const void SfxObjectShell::ResetError() { if( pImp->lErr != ERRCODE_NONE ) - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Resetting Error." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Resetting Error." ) ); pImp->lErr=0; SfxMedium * pMed = GetMedium(); @@ -404,6 +406,11 @@ sal_Bool SfxObjectShell::IsReadOnlyMedium() const return pMedium->IsReadOnly(); } +bool SfxObjectShell::IsOriginallyReadOnlyMedium() const +{ + return pMedium == 0 || pMedium->IsOriginallyReadOnly(); +} + //------------------------------------------------------------------------- void SfxObjectShell::SetReadOnlyUI( sal_Bool bReadOnly ) @@ -415,10 +422,9 @@ void SfxObjectShell::SetReadOnlyUI( sal_Bool bReadOnly ) */ { - sal_Bool bWasRO = IsReadOnly(); - pImp->bReadOnlyUI = bReadOnly; - if ( bWasRO != IsReadOnly() ) + if ( bReadOnly != pImp->bReadOnlyUI ) { + pImp->bReadOnlyUI = bReadOnly; Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) ); } } @@ -442,7 +448,7 @@ void SfxObjectShell::SetReadOnly() if ( !pMedium->HasStorage_Impl() && IsLoadingFinished() ) pMedium->CloseInStream(); - pMedium->SetOpenMode( SFX_STREAM_READONLY, pMedium->IsDirect(), sal_True ); + pMedium->SetOpenMode( SFX_STREAM_READONLY, sal_True ); pMedium->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) ); if ( !bWasROUI ) @@ -453,7 +459,7 @@ void SfxObjectShell::SetReadOnly() sal_Bool SfxObjectShell::IsReadOnly() const { - return pImp->bReadOnlyUI || IsReadOnlyMedium(); + return pImp->bReadOnlyUI || pMedium == 0; } //------------------------------------------------------------------------- @@ -1130,9 +1136,9 @@ void SfxObjectShell::CheckEncryption_Impl( const uno::Reference< task::XInteract try { uno::Reference < beans::XPropertySet > xPropSet( GetStorage(), uno::UNO_QUERY_THROW ); - xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) >>= aVersion; - xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasEncryptedEntries" ) ) ) >>= bIsEncrypted; - xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasNonEncryptedEntries" ) ) ) >>= bHasNonEncrypted; + xPropSet->getPropertyValue( ::rtl::OUString( "Version" ) ) >>= aVersion; + xPropSet->getPropertyValue( ::rtl::OUString( "HasEncryptedEntries" ) ) >>= bIsEncrypted; + xPropSet->getPropertyValue( ::rtl::OUString( "HasNonEncryptedEntries" ) ) >>= bHasNonEncrypted; } catch( uno::Exception& ) { @@ -1377,7 +1383,7 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad() ForgetMedium(); if( !DoSaveCompleted( pTmpMedium ) ) - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); else { SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False ); @@ -1402,7 +1408,7 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad() // templates are never readonly pTmpMedium->GetItemSet()->ClearItem( SID_DOC_READONLY ); - pTmpMedium->SetOpenMode( SFX_STREAM_READWRITE, sal_True, sal_True ); + pTmpMedium->SetOpenMode( SFX_STREAM_READWRITE, sal_True ); // notifications about possible changes in readonly state and document info Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) ); @@ -1584,7 +1590,7 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon { Sequence< uno::Any > aArgs( 1 ); aArgs[ 0 ] = *pCaller; - xProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Caller")), uno::makeAny( aArgs ) ); + xProps->setPropertyValue( rtl::OUString("Caller"), uno::makeAny( aArgs ) ); } } aRet = xScript->invoke( aParams, aOutParamIndex, aOutParam ); @@ -1653,8 +1659,7 @@ void SfxHeaderAttributes_Impl::SetAttribute( const SvKeyValue& rKV ) if( rKV.GetKey().CompareIgnoreCaseToAscii( "refresh" ) == COMPARE_EQUAL && rKV.GetValue().Len() ) { sal_uInt32 nTime = aValue.GetToken( 0, ';' ).ToInt32() ; - String aURL = aValue.GetToken( 1, ';' ); - aURL.EraseTrailingChars().EraseLeadingChars(); + String aURL = comphelper::string::strip(aValue.GetToken( 1, ';' ), ' '); uno::Reference<document::XDocumentProperties> xDocProps( pDoc->getDocProperties()); if( aURL.Copy(0, 4).CompareIgnoreCaseToAscii( "url=" ) == COMPARE_EQUAL ) @@ -1998,7 +2003,7 @@ sal_Bool SfxObjectShell_Impl::hasTrustedScriptingSignature( sal_Bool bAllowUIToA try { uno::Reference < beans::XPropertySet > xPropSet( rDocShell.GetStorage(), uno::UNO_QUERY_THROW ); - xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) >>= aVersion; + xPropSet->getPropertyValue( ::rtl::OUString( "Version" ) ) >>= aVersion; } catch( uno::Exception& ) { @@ -2006,7 +2011,7 @@ sal_Bool SfxObjectShell_Impl::hasTrustedScriptingSignature( sal_Bool bAllowUIToA uno::Sequence< uno::Any > aArgs( 1 ); aArgs[0] <<= aVersion; - uno::Reference< security::XDocumentDigitalSignatures > xSigner( comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), aArgs ), uno::UNO_QUERY_THROW ); + uno::Reference< security::XDocumentDigitalSignatures > xSigner( comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures" ), aArgs ), uno::UNO_QUERY_THROW ); if ( nScriptingSignatureState == SIGNATURESTATE_UNKNOWN || nScriptingSignatureState == SIGNATURESTATE_SIGNATURES_OK @@ -2116,28 +2121,28 @@ void SfxObjectShell::StoreLog() if ( pImp->m_xLogRing.is() ) { #ifdef WNT - ::rtl::OUString aFileURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/bootstrap.ini:UserInstallation}" ) ); + ::rtl::OUString aFileURL = ::rtl::OUString( "${$BRAND_BASE_DIR/program/bootstrap.ini:UserInstallation}" ); #else - ::rtl::OUString aFileURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}" ) ); + ::rtl::OUString aFileURL = ::rtl::OUString( "${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}" ); #endif ::rtl::Bootstrap::expandMacros( aFileURL ); #ifdef WNT - ::rtl::OUString aBuildID = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/setup.ini:buildid}" ) ); + ::rtl::OUString aBuildID = ::rtl::OUString( "${$BRAND_BASE_DIR/program/setup.ini:buildid}" ); #else - ::rtl::OUString aBuildID = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/setuprc:buildid}" ) ); + ::rtl::OUString aBuildID = ::rtl::OUString( "${$BRAND_BASE_DIR/program/setuprc:buildid}" ); #endif ::rtl::Bootstrap::expandMacros( aBuildID ); if ( !aFileURL.isEmpty() ) { - aFileURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/temp/document_io_logring.txt" ) ); + aFileURL += ::rtl::OUString( "/user/temp/document_io_logring.txt" ); try { - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW ); - uno::Reference< ucb::XSimpleFileAccess > xSimpleFileAccess( xFactory->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + uno::Reference< ucb::XSimpleFileAccess2 > xSimpleFileAccess(ucb::SimpleFileAccess::create(xContext)); uno::Reference< io::XStream > xStream( xSimpleFileAccess->openFileReadWrite( aFileURL ), uno::UNO_SET_THROW ); uno::Reference< io::XOutputStream > xOutStream( xStream->getOutputStream(), uno::UNO_SET_THROW ); uno::Reference< io::XTruncate > xTruncate( xOutStream, uno::UNO_QUERY_THROW ); diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 34565c86b979..a1826097b2e7 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/task/XStatusIndicator.hpp> #include <com/sun/star/task/XStatusIndicatorFactory.hpp> +#include <com/sun/star/frame/DocumentTemplates.hpp> #include <com/sun/star/frame/XDocumentTemplates.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <comphelper/processfactory.hxx> @@ -311,7 +312,7 @@ sal_Bool SfxObjectShell::APISaveAs_Impl SFX_ITEMSET_ARG( aParams, pContentTypeItem, SfxStringItem, SID_CONTENTTYPE, sal_False ); if ( pContentTypeItem ) { - const SfxFilter* pFilter = SfxFilterMatcher( String::CreateFromAscii(GetFactory().GetShortName()) ).GetFilter4Mime( pContentTypeItem->GetValue(), SFX_FILTER_EXPORT ); + const SfxFilter* pFilter = SfxFilterMatcher( rtl::OUString::createFromAscii(GetFactory().GetShortName()) ).GetFilter4Mime( pContentTypeItem->GetValue(), SFX_FILTER_EXPORT ); if ( pFilter ) aFilterName = pFilter->GetName(); } @@ -429,7 +430,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) else { aURL = DEFINE_CONST_UNICODE( "private:factory/" ); - aURL += String::CreateFromAscii( GetFactory().GetShortName() ); + aURL += rtl::OUString::createFromAscii( GetFactory().GetShortName() ); aTitle = GetTitle(); } @@ -859,10 +860,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) try { uno::Reference< frame::XStorable > xStorable( GetModel(), uno::UNO_QUERY_THROW ); - ::rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.DocumentTemplates" ) ); uno::Reference< frame::XDocumentTemplates > xTemplates( - comphelper::getProcessServiceFactory()->createInstance( aService ), - uno::UNO_QUERY_THROW ); + frame::DocumentTemplates::create(comphelper::getProcessComponentContext()) ); bOk = xTemplates->storeTemplate( aTemplateGroup, aTemplateName, xStorable ); } @@ -951,7 +950,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) bool bMediumRO = IsReadOnlyMedium(); if ( !bMediumRO && GetMedium() && bAllowSave ) rSet.Put(SfxStringItem( - nWhich, String(SfxResId(STR_SAVEDOC)))); + nWhich, SfxResId(STR_SAVEDOC).toString())); else rSet.DisableItem(nWhich); } @@ -978,7 +977,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) if ( pDoc->GetFlags() & SFXOBJECTSHELL_DONTCLOSE ) rSet.DisableItem(nWhich); else - rSet.Put(SfxStringItem(nWhich, String(SfxResId(STR_CLOSEDOC)))); + rSet.Put(SfxStringItem(nWhich, SfxResId(STR_CLOSEDOC).toString())); break; } @@ -992,7 +991,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) if ( /*!pCombinedFilters ||*/ !GetMedium() ) rSet.DisableItem( nWhich ); else - rSet.Put( SfxStringItem( nWhich, String( SfxResId( STR_SAVEASDOC ) ) ) ); + rSet.Put( SfxStringItem( nWhich, SfxResId(STR_SAVEASDOC).toString() ) ); break; } @@ -1387,7 +1386,7 @@ void SfxObjectShell::ImplSign( sal_Bool bScriptingContent ) } else { - ErrorBox( NULL, WB_OK, SfxResId( STR_XMLSEC_ODF12_EXPECTED ) ).Execute(); + ErrorBox( NULL, WB_OK, SfxResId(STR_XMLSEC_ODF12_EXPECTED).toString() ).Execute(); return; } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index d8406dcdb6c2..c2356bd70538 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -154,7 +154,7 @@ void impl_addToModelCollection(const css::uno::Reference< css::frame::XModel >& css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Reference< css::container::XSet > xModelCollection( - xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster"))), + xSMGR->createInstance(::rtl::OUString("com.sun.star.frame.GlobalEventBroadcaster")), css::uno::UNO_QUERY); if (xModelCollection.is()) { @@ -228,7 +228,7 @@ sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl( try { uno::Reference< embed::XStorage > xVersion = xDocStorage->openStorageElement( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Versions")), + ::rtl::OUString("Versions"), embed::ElementModes::READWRITE ); DBG_ASSERT( xVersion.is(), @@ -270,7 +270,7 @@ sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl( catch( uno::Exception& ) { // TODO/LATER: handle the error depending on exception - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } return bResult; @@ -302,7 +302,7 @@ sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl( aTempURL = ::rtl::OUString(); // TODO/LATER: may need error code setting based on exception - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } } @@ -340,20 +340,20 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto { try { - xProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny( aDataFlavor.MimeType ) ); + xProps->setPropertyValue( ::rtl::OUString("MediaType"), uno::makeAny( aDataFlavor.MimeType ) ); } catch( uno::Exception& ) { - const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } SvtSaveOptions aSaveOpt; SvtSaveOptions::ODFDefaultVersion nDefVersion = aSaveOpt.GetODFDefaultVersion(); uno::Sequence< beans::NamedValue > aEncryptionAlgs( 3 ); - aEncryptionAlgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StartKeyGenerationAlgorithm" ) ); - aEncryptionAlgs[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionAlgorithm" ) ); - aEncryptionAlgs[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ChecksumAlgorithm" ) ); + aEncryptionAlgs[0].Name = ::rtl::OUString( "StartKeyGenerationAlgorithm" ); + aEncryptionAlgs[1].Name = ::rtl::OUString( "EncryptionAlgorithm" ); + aEncryptionAlgs[2].Name = ::rtl::OUString( "ChecksumAlgorithm" ); // the default values, that should be used for ODF1.1 and older formats aEncryptionAlgs[0].Value <<= xml::crypto::DigestID::SHA1; aEncryptionAlgs[1].Value <<= xml::crypto::CipherID::BLOWFISH_CFB_8; @@ -364,18 +364,18 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto try { // older versions can not have this property set, it exists only starting from ODF1.2 - xProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Version" )), uno::makeAny( ODFVER_012_TEXT ) ); + xProps->setPropertyValue( ::rtl::OUString("Version" ), uno::makeAny( ODFVER_012_TEXT ) ); } catch( uno::Exception& ) { } - if ( !aSaveOpt.IsUseSHA1InODF12() ) + if ( !aSaveOpt.IsUseSHA1InODF12() && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT ) { aEncryptionAlgs[0].Value <<= xml::crypto::DigestID::SHA256; aEncryptionAlgs[2].Value <<= xml::crypto::DigestID::SHA256_1K; } - if ( !aSaveOpt.IsUseBlowfishInODF12() ) + if ( !aSaveOpt.IsUseBlowfishInODF12() && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT ) aEncryptionAlgs[1].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING; } @@ -389,7 +389,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto } catch( uno::Exception& ) { - const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } } @@ -421,13 +421,13 @@ sal_Bool SfxObjectShell::GeneralInit_Impl( const uno::Reference< embed::XStorage try { uno::Reference < beans::XPropertySet > xPropSet( xStorage, uno::UNO_QUERY_THROW ); - Any a = xPropSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ) ); + Any a = xPropSet->getPropertyValue( ::rtl::OUString("MediaType" ) ); ::rtl::OUString aMediaType; if ( !(a>>=aMediaType) || aMediaType.isEmpty() ) { if ( bTypeMustBeSetAlready ) { - SetError( ERRCODE_IO_BROKENPACKAGE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_BROKENPACKAGE, ::rtl::OUString( OSL_LOG_PREFIX ) ); return sal_False; } @@ -494,7 +494,7 @@ sal_Bool SfxObjectShell::DoInitNew( SfxMedium* pMed ) // empty documents always get their macros from the user, so there is no reason to restrict access pImp->aMacroMode.allowMacroExecution(); if ( SFX_CREATE_MODE_EMBEDDED == eCreateMode ) - SetTitle( String( SfxResId( STR_NONAME ) )); + SetTitle(SfxResId(STR_NONAME).toString()); uno::Reference< frame::XModel > xModel ( GetModel(), uno::UNO_QUERY ); if ( xModel.is() ) @@ -580,9 +580,6 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) { ModifyBlocker_Impl aBlock( this ); - if ( SFX_CREATE_MODE_EMBEDDED != eCreateMode ) - GetpApp()->ShowStatusText( SfxResId(STR_DOC_LOADING) ); - pMedium = pMed; pMedium->CanDisposeStorage_Impl( sal_True ); @@ -628,7 +625,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) { sal_uInt32 nError = HandleFilter( pMedium, this ); if ( nError != ERRCODE_NONE ) - SetError( nError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( nError, ::rtl::OUString( OSL_LOG_PREFIX ) ); if (pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_STARTPRESENTATION) pSet->Put( SfxBoolItem( SID_DOC_STARTPRESENTATION, sal_True) ); @@ -654,7 +651,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) // treat the package as broken if the mediatype was retrieved as a fallback uno::Reference< beans::XPropertySet > xStorProps( xStorage, uno::UNO_QUERY_THROW ); - xStorProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaTypeFallbackUsed" ) ) ) + xStorProps->getPropertyValue( ::rtl::OUString( "MediaTypeFallbackUsed" ) ) >>= bWarnMediaTypeFallback; if ( pRepairPackageItem && pRepairPackageItem->GetValue() ) @@ -668,12 +665,12 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) } if ( bWarnMediaTypeFallback || !xStorage->getElementNames().getLength() ) - SetError( ERRCODE_IO_BROKENPACKAGE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_BROKENPACKAGE, ::rtl::OUString( OSL_LOG_PREFIX ) ); } catch( uno::Exception& ) { // TODO/LATER: may need error code setting based on exception - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } // Load @@ -688,22 +685,19 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) SFX_ITEMSET_ARG( pMedium->GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False); if ( !pTemplateItem || !pTemplateItem->GetValue() ) bHasName = sal_True; - - if ( !IsReadOnly() && IsLoadReadonly() ) - SetReadOnlyUI(); } else - SetError( ERRCODE_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_ABORT, ::rtl::OUString( OSL_LOG_PREFIX ) ); } } else - SetError( pMed->GetLastStorageCreationState(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( pMed->GetLastStorageCreationState(), ::rtl::OUString( OSL_LOG_PREFIX ) ); } else if ( GetError() == ERRCODE_NONE && InitNew(0) ) { // Name vor ConvertFrom setzen, damit GetSbxObject() schon funktioniert bHasName = sal_True; - SetName( SfxResId( STR_NONAME ) ); + SetName( SfxResId(STR_NONAME).toString() ); if( !bHasStorage ) pMedium->GetInStream(); @@ -717,7 +711,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) if ( pMedium->GetFilter() && ( pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) ) { uno::Reference < beans::XPropertySet > xSet( GetModel(), uno::UNO_QUERY ); - ::rtl::OUString sLockUpdates(RTL_CONSTASCII_USTRINGPARAM("LockUpdates")); + ::rtl::OUString sLockUpdates("LockUpdates"); bool bSetProperty = true; try { @@ -750,15 +744,18 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) if ( bOk ) { + if ( IsReadOnlyMedium() || IsLoadReadonly() ) + SetReadOnlyUI(); + try { ::ucbhelper::Content aContent( pMedium->GetName(), com::sun::star::uno::Reference < XCommandEnvironment >() ); com::sun::star::uno::Reference < XPropertySetInfo > xProps = aContent.getProperties(); if ( xProps.is() ) { - ::rtl::OUString aAuthor( RTL_CONSTASCII_USTRINGPARAM("Author") ); - ::rtl::OUString aKeywords( RTL_CONSTASCII_USTRINGPARAM("Keywords") ); - ::rtl::OUString aSubject( RTL_CONSTASCII_USTRINGPARAM("Subject") ); + ::rtl::OUString aAuthor( "Author" ); + ::rtl::OUString aKeywords( "Keywords" ); + ::rtl::OUString aSubject( "Subject" ); Any aAny; ::rtl::OUString aValue; uno::Reference<document::XDocumentPropertiesSupplier> xDPS( @@ -805,8 +802,6 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) if ( SFX_CREATE_MODE_EMBEDDED != eCreateMode ) { - GetpApp()->HideStatusText(); - SFX_ITEMSET_ARG( pMedium->GetItemSet(), pAsTempItem, SfxBoolItem, SID_TEMPLATE, sal_False); SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPreviewItem, SfxBoolItem, SID_PREVIEW, sal_False); SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False); @@ -829,8 +824,6 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) if (bReconnectDde) ReconnectDdeLinks(*this); } - else - GetpApp()->HideStatusText(); return bOk; } @@ -848,7 +841,7 @@ sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDo if( xServiceManager.is() ) { xFilterCFG = com::sun::star::uno::Reference< XNameAccess >( - xServiceManager->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")) ), + xServiceManager->createInstance( ::rtl::OUString("com.sun.star.document.FilterFactory") ), UNO_QUERY ); } @@ -988,7 +981,7 @@ sal_Bool SfxObjectShell::DoSave() } catch( uno::Exception& ) { - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } DBG_ASSERT( bOk, "The root storage must allow to set common password!\n" ); @@ -1008,8 +1001,8 @@ sal_Bool SfxObjectShell::DoSave() if ( !xTmpStorage.is() ) throw uno::RuntimeException(); - ::rtl::OUString aBasicStorageName( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) ); - ::rtl::OUString aDialogsStorageName( RTL_CONSTASCII_USTRINGPARAM( "Dialogs" ) ); + ::rtl::OUString aBasicStorageName( "Basic" ); + ::rtl::OUString aDialogsStorageName( "Dialogs" ); if ( GetMedium()->GetStorage()->hasByName( aBasicStorageName ) ) GetMedium()->GetStorage()->copyElementTo( aBasicStorageName, xTmpStorage, aBasicStorageName ); if ( GetMedium()->GetStorage()->hasByName( aDialogsStorageName ) ) @@ -1028,7 +1021,7 @@ sal_Bool SfxObjectShell::DoSave() } catch( uno::Exception& ) { - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); bOk = sal_False; } } @@ -1082,7 +1075,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl RTL_LOGFILE_PRODUCT_CONTEXT_TRACE1(aLog, "saving \"%s\"", aString.getStr()); } - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Begin" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Begin" ) ); ModifyBlocker_Impl aMod(this); @@ -1105,7 +1098,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl // protected libraries exceed the size we can handler if ( bOwnTarget && !QuerySaveSizeExceededModules_Impl( rMedium.GetInteractionHandler() ) ) { - SetError( ERRCODE_IO_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_ABORT, ::rtl::OUString( OSL_LOG_PREFIX ) ); return sal_False; } @@ -1122,7 +1115,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl || pImp->nScriptingSignatureState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED || pImp->nScriptingSignatureState == SIGNATURESTATE_SIGNATURES_INVALID ) ) { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "MacroSignaturePreserving" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "MacroSignaturePreserving" ) ); // the checking of the library modified state iterates over the libraries, should be done only when required // currently the check is commented out since it is broken, we have to check the signature every time we save @@ -1138,7 +1131,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl try { uno::Reference < beans::XPropertySet > xPropSet( GetStorage(), uno::UNO_QUERY_THROW ); - xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) >>= aODFVersion; + xPropSet->getPropertyValue( ::rtl::OUString( "Version" ) ) >>= aODFVersion; } catch( uno::Exception& ) {} @@ -1169,7 +1162,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl && ::utl::UCBContentHelper::EqualURLs( pMedium->GetName(), rMedium.GetName() ) ) { bStoreToSameLocation = sal_True; - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Save" ) ); if ( pMedium->DocNeedsFileDateCheck() ) rMedium.CheckFileDate( pMedium->GetInitFileDate( sal_False ) ); @@ -1177,7 +1170,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( bCopyTo && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) { // export to the same location is forbidden - SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( OSL_LOG_PREFIX ) ); } else { @@ -1186,11 +1179,11 @@ sal_Bool SfxObjectShell::SaveTo_Impl const sal_Bool bDoBackup = SvtSaveOptions().IsBackup(); if ( bDoBackup ) { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "DoBackup" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "DoBackup" ) ); rMedium.DoBackup_Impl(); if ( rMedium.GetError() ) { - SetError( rMedium.GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( rMedium.GetErrorCode(), ::rtl::OUString( OSL_LOG_PREFIX ) ); rMedium.ResetError(); } } @@ -1214,7 +1207,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl // if the last step is failed the stream should stay to be transacted and should be commited on any flush // so we can forget the stream in any way and the next storage commit will flush it - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save: Own to Own" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Save: Own to Own" ) ); bNeedsDisconnectionOnFail = DisconnectStorage_Impl( *pMedium, rMedium ); @@ -1237,7 +1230,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl // just disconnect the stream from the source format // so that the target medium can use it - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save: Alien to Alien" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Save: Alien to Alien" ) ); pMedium->CloseAndRelease(); rMedium.CloseAndRelease(); @@ -1250,7 +1243,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl // format is an own one so just disconnect the source // medium - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save: Alien to Own" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Save: Alien to Own" ) ); pMedium->CloseAndRelease(); rMedium.CloseAndRelease(); @@ -1262,7 +1255,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl // an alien format, just connect the source to temporary // storage - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save: Own to Alien" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Save: Own to Alien" ) ); bNeedsDisconnectionOnFail = DisconnectStorage_Impl( *pMedium, rMedium ); @@ -1284,7 +1277,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl // but for now the framework has to be ready for it // TODO/LATER: let the medium be prepared for alien formats as well - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "SaveAs/Export" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "SaveAs/Export" ) ); rMedium.CloseAndRelease(); if ( bStorageBasedTarget ) @@ -1297,7 +1290,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl if( rMedium.GetErrorCode() || pMedium->GetErrorCode() || GetErrorCode() ) return sal_False; - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Locking" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Locking" ) ); rMedium.LockOrigFileOnDemand( sal_False, sal_False ); @@ -1326,7 +1319,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( !xProps.is() ) throw uno::RuntimeException(); - xProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), + xProps->setPropertyValue( ::rtl::OUString("MediaType"), uno::makeAny( aDataFlavor.MimeType ) ); } catch( uno::Exception& ) @@ -1351,14 +1344,14 @@ sal_Bool SfxObjectShell::SaveTo_Impl if( bOwnTarget && !( pFilter->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) ) { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing in own format." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing in own format." ) ); uno::Reference< embed::XStorage > xMedStorage = rMedium.GetStorage(); if ( !xMedStorage.is() ) { // no saving without storage, unlock UI and return Lock_Impl( this, sal_False ); pImp->bForbidReload = bOldStat; - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing failed, still no error set." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing failed, still no error set." ) ); return sal_False; } @@ -1375,7 +1368,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl catch( uno::Exception& ) { OSL_FAIL( "Setting of common encryption key failed!" ); - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } } else @@ -1394,18 +1387,18 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( xMedStorage == GetStorage() ) { OSL_ENSURE( !pVersionItem, "This scenario is impossible currently!\n" ); - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Should be impossible." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Should be impossible." ) ); // usual save procedure bOk = Save(); } else { // save to target - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save as own format." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Save as own format." ) ); bOk = SaveAsOwnFormat( rMedium ); if ( bOk && pVersionItem ) { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "pVersionItem != NULL" ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "pVersionItem != NULL" ) ); aTmpVersionURL = CreateTempCopyOfStorage_Impl( xMedStorage ); bOk = !aTmpVersionURL.isEmpty(); } @@ -1417,7 +1410,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl { // store the thumbnail representation image // the thumbnail is not stored in case of encrypted document - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Thumbnail creation." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Thumbnail creation." ) ); if ( !GenerateAndStoreThumbnail( bPasswdProvided, sal_False, pFilter->IsOwnTemplateFormat(), @@ -1432,14 +1425,14 @@ sal_Bool SfxObjectShell::SaveTo_Impl { if ( pImp->bIsSaving || pImp->bPreserveVersions ) { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Preserve versions." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Preserve versions." ) ); try { Sequence < util::RevisionTag > aVersions = rMedium.GetVersionList(); if ( aVersions.getLength() ) { // copy the version streams - ::rtl::OUString aVersionsName( RTL_CONSTASCII_USTRINGPARAM( "Versions" ) ); + ::rtl::OUString aVersionsName( "Versions" ); uno::Reference< embed::XStorage > xNewVerStor = xMedStorage->openStorageElement( aVersionsName, embed::ElementModes::READWRITE ); @@ -1462,7 +1455,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl } catch( uno::Exception& ) { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Preserve versions has failed." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Preserve versions has failed." ) ); OSL_FAIL( "Couldn't copy versions!\n" ); bOk = sal_False; // TODO/LATER: a specific error could be set @@ -1515,7 +1508,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl } else { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing in alien format." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing in alien format." ) ); // it's a "SaveAs" in an alien format if ( rMedium.GetFilter() && ( rMedium.GetFilter()->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) ) bOk = ExportTo( rMedium ); @@ -1544,7 +1537,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl uno::Reference< security::XDocumentDigitalSignatures > xDDSigns; if ( bOk && bTryToPreserveScriptSignature ) { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Copying scripting signature." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Copying scripting signature." ) ); // if the scripting code was not changed and it is signed the signature should be preserved // unfortunately at this point we have only information whether the basic code has changed or not @@ -1557,7 +1550,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl try { uno::Reference < beans::XPropertySet > xPropSet( rMedium.GetStorage(), uno::UNO_QUERY_THROW ); - aArgs[0] = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ); + aArgs[0] = xPropSet->getPropertyValue( ::rtl::OUString( "Version" ) ); } catch( uno::Exception& ) { @@ -1566,7 +1559,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl xDDSigns = uno::Reference< security::XDocumentDigitalSignatures >( comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), + "com.sun.star.security.DocumentDigitalSignatures" ), aArgs ), uno::UNO_QUERY_THROW ); @@ -1585,14 +1578,14 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( !xReadOrig.is() ) throw uno::RuntimeException(); uno::Reference< embed::XStorage > xMetaInf = xReadOrig->openStorageElement( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ), + ::rtl::OUString( "META-INF" ), embed::ElementModes::READ ); uno::Reference< embed::XStorage > xTarget = rMedium.GetZipStorageToSign_Impl( sal_False ); if ( !xTarget.is() ) throw uno::RuntimeException(); uno::Reference< embed::XStorage > xTargetMetaInf = xTarget->openStorageElement( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ), + ::rtl::OUString( "META-INF" ), embed::ElementModes::READWRITE ); if ( xMetaInf.is() && xTargetMetaInf.is() ) @@ -1637,7 +1630,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl rMedium.CloseZipStorage_Impl(); } - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Medium commit." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Medium commit." ) ); // transfer data to its destinated location // the medium commits the storage or the stream it is based on @@ -1646,7 +1639,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( bOk ) { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing is successful." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing is successful." ) ); // if the target medium is an alien format and the "old" medium was an own format and the "old" medium // has a name, the object storage must be exchanged, because now we need a new temporary storage @@ -1667,7 +1660,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl // copy storage of old medium to new temporary storage and take this over if( !ConnectTmpStorage_Impl( pMedium->GetStorage(), pMedium ) ) { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Process after storing has failed." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Process after storing has failed." ) ); bOk = sal_False; } } @@ -1675,7 +1668,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl } else { - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing has failed." ) ) ); + AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing has failed." ) ); // in case the document storage was connected to backup temporarely it must be disconnected now if ( bNeedsDisconnectionOnFail ) @@ -1695,9 +1688,9 @@ sal_Bool SfxObjectShell::SaveTo_Impl com::sun::star::uno::Reference < XPropertySetInfo > xProps = aContent.getProperties(); if ( xProps.is() ) { - ::rtl::OUString aAuthor( RTL_CONSTASCII_USTRINGPARAM("Author") ); - ::rtl::OUString aKeywords( RTL_CONSTASCII_USTRINGPARAM("Keywords") ); - ::rtl::OUString aSubject( RTL_CONSTASCII_USTRINGPARAM("Subject") ); + ::rtl::OUString aAuthor( "Author" ); + ::rtl::OUString aKeywords( "Keywords" ); + ::rtl::OUString aSubject( "Subject" ); Any aAny; uno::Reference<document::XDocumentPropertiesSupplier> xDPS( @@ -1857,7 +1850,7 @@ sal_Bool SfxObjectShell::ConnectTmpStorage_Impl( if ( !bResult ) { // TODO/LATER: may need error code setting based on exception - SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( OSL_LOG_PREFIX ) ); } } @@ -1879,7 +1872,7 @@ sal_Bool SfxObjectShell::DoSaveObjectAs( SfxMedium& rMedium, sal_Bool bCommit ) uno::Reference < beans::XPropertySet > xPropSet( xNewStor, uno::UNO_QUERY ); if ( xPropSet.is() ) { - Any a = xPropSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ) ); + Any a = xPropSet->getPropertyValue( ::rtl::OUString("MediaType" ) ); ::rtl::OUString aMediaType; if ( !(a>>=aMediaType) || aMediaType.isEmpty() ) { @@ -1913,7 +1906,7 @@ sal_Bool SfxObjectShell::DoSaveAs( SfxMedium& rMedium ) { // here only root storages are included, which are stored via temp file rMedium.CreateTempFileNoCopy(); - SetError(rMedium.GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError(rMedium.GetErrorCode(), ::rtl::OUString( OSL_LOG_PREFIX ) ); if ( GetError() ) return sal_False; @@ -1923,7 +1916,7 @@ sal_Bool SfxObjectShell::DoSaveAs( SfxMedium& rMedium ) sal_Bool bRet = SaveTo_Impl( rMedium, NULL ); if ( !bRet ) - SetError(rMedium.GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError(rMedium.GetErrorCode(), ::rtl::OUString( OSL_LOG_PREFIX ) ); return bRet; } @@ -2199,7 +2192,7 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert ) com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aArgs ( lDescriptor.getLength() ); com::sun::star::beans::PropertyValue * pNewValue = aArgs.getArray(); const com::sun::star::beans::PropertyValue * pOldValue = lDescriptor.getConstArray(); - const OUString sInputStream ( RTL_CONSTASCII_USTRINGPARAM ( "InputStream" ) ); + const OUString sInputStream ( "InputStream" ); sal_Bool bHasInputStream = sal_False; sal_Bool bHasBaseURL = sal_False; @@ -2225,13 +2218,13 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert ) if ( !bHasBaseURL ) { aArgs.realloc ( ++nEnd ); - aArgs[nEnd-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "DocumentBaseURL" ) ); + aArgs[nEnd-1].Name = ::rtl::OUString( "DocumentBaseURL" ); aArgs[nEnd-1].Value <<= rMedium.GetBaseURL(); } if ( bInsert ) { aArgs.realloc( ++nEnd ); - aArgs[nEnd-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "InsertMode" ) ); + aArgs[nEnd-1].Name = ::rtl::OUString( "InsertMode" ); aArgs[nEnd-1].Value <<= (sal_Bool) sal_True; } @@ -2297,8 +2290,8 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) com::sun::star::beans::PropertyValue * pNewValue = aArgs.getArray(); // put in the REAL file name, and copy all PropertyValues - const OUString sOutputStream ( RTL_CONSTASCII_USTRINGPARAM ( "OutputStream" ) ); - const OUString sStream ( RTL_CONSTASCII_USTRINGPARAM ( "StreamForOutput" ) ); + const OUString sOutputStream ( "OutputStream" ); + const OUString sStream ( "StreamForOutput" ); sal_Bool bHasOutputStream = sal_False; sal_Bool bHasStream = sal_False; sal_Bool bHasBaseURL = sal_False; @@ -2336,7 +2329,7 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) if ( !bHasBaseURL ) { aArgs.realloc ( ++nEnd ); - aArgs[nEnd-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "DocumentBaseURL" ) ); + aArgs[nEnd-1].Name = ::rtl::OUString( "DocumentBaseURL" ); aArgs[nEnd-1].Value <<= rMedium.GetBaseURL( sal_True ); } @@ -2421,11 +2414,11 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) // create a medium as a copy; this medium is only for writingm, because it // uses the same name as the original one writing is done through a copy, // that will be transferred to the target (of course after calling HandsOff) - SfxMedium* pMediumTmp = new SfxMedium( pRetrMedium->GetName(), pRetrMedium->GetOpenMode(), pRetrMedium->IsDirect(), pFilter, pSet ); + SfxMedium* pMediumTmp = new SfxMedium( pRetrMedium->GetName(), pRetrMedium->GetOpenMode(), pFilter, pSet ); pMediumTmp->SetLongName( pRetrMedium->GetLongName() ); if ( pMediumTmp->GetErrorCode() != ERRCODE_NONE ) { - SetError( pMediumTmp->GetError(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( pMediumTmp->GetError(), ::rtl::OUString( OSL_LOG_PREFIX ) ); delete pMediumTmp; return sal_False; } @@ -2451,7 +2444,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) pMediumTmp->GetItemSet()->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL ); } - SetError(pMediumTmp->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError(pMediumTmp->GetErrorCode(), ::rtl::OUString( OSL_LOG_PREFIX ) ); sal_Bool bOpen( sal_False ); bOpen = DoSaveCompleted( pMediumTmp ); @@ -2462,7 +2455,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) else { // transfer error code from medium to objectshell - SetError( pMediumTmp->GetError(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( pMediumTmp->GetError(), ::rtl::OUString( OSL_LOG_PREFIX ) ); // reconnect to object storage DoSaveCompleted( 0 ); @@ -2486,7 +2479,7 @@ sal_Bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet ) { if ( IsReadOnly() ) { - SetError( ERRCODE_SFX_DOCUMENTREADONLY, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_SFX_DOCUMENTREADONLY, ::rtl::OUString( OSL_LOG_PREFIX ) ); return sal_False; } @@ -2501,10 +2494,10 @@ sal_Bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet ) String aFilterName; const SfxFilter *pFilter = NULL; if ( pFilterItem ) - pFilter = SfxFilterMatcher( String::CreateFromAscii( GetFactory().GetShortName()) ).GetFilter4FilterName( aFilterName ); + pFilter = SfxFilterMatcher( rtl::OUString::createFromAscii( GetFactory().GetShortName()) ).GetFilter4FilterName( aFilterName ); SfxMedium *pMed = new SfxMedium( - pSalvageItem->GetValue(), STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, sal_False, pFilter ); + pSalvageItem->GetValue(), STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, pFilter ); SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False ); if ( pPasswordItem ) @@ -2532,11 +2525,11 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl { if( aURL.HasError() ) { - SetError( ERRCODE_IO_INVALIDPARAMETER, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_INVALIDPARAMETER, ::rtl::OUString( OSL_LOG_PREFIX ) ); return sal_False; } - if ( aURL != INetURLObject( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:stream" ) ) ) ) + if ( aURL != INetURLObject( ::rtl::OUString( "private:stream" ) ) ) { // Is there already a Document with this name? SfxObjectShell* pDoc = 0; @@ -2554,7 +2547,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl if ( pDoc ) { // Then error message: "already opened" - SetError(ERRCODE_SFX_ALREADYOPEN, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )); + SetError(ERRCODE_SFX_ALREADYOPEN, ::rtl::OUString( OSL_LOG_PREFIX )); return sal_False; } } @@ -2570,7 +2563,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl || !pFilter->CanExport() || (!bSaveTo && !pFilter->CanImport()) ) { - SetError( ERRCODE_IO_INVALIDPARAMETER, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( ERRCODE_IO_INVALIDPARAMETER, ::rtl::OUString( OSL_LOG_PREFIX ) ); return sal_False; } @@ -2589,10 +2582,10 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl sal_Bool bWasReadonly = IsReadOnly(); - if ( aURL == aActName && aURL != INetURLObject( OUString(RTL_CONSTASCII_USTRINGPARAM("private:stream")) ) + if ( aURL == aActName && aURL != INetURLObject( OUString("private:stream") ) && IsReadOnly() ) { - SetError(ERRCODE_SFX_DOCUMENTREADONLY, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )); + SetError(ERRCODE_SFX_DOCUMENTREADONLY, ::rtl::OUString( OSL_LOG_PREFIX )); return sal_False; } @@ -2710,7 +2703,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl pParams = pMergedParams; // create a medium for the target URL - SfxMedium *pNewFile = new SfxMedium( rFileName, STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, sal_False, 0, pParams ); + SfxMedium *pNewFile = new SfxMedium( rFileName, STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, 0, pParams ); // set filter; if no filter is given, take the default filter of the factory if ( aFilterName.Len() ) @@ -2721,7 +2714,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl if ( pNewFile->GetErrorCode() != ERRCODE_NONE ) { // creating temporary file failed ( f.e. floppy disk not inserted! ) - SetError( pNewFile->GetError(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( pNewFile->GetError(), ::rtl::OUString( OSL_LOG_PREFIX ) ); delete pNewFile; return sal_False; } @@ -2744,7 +2737,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl bOk = sal_True; // transfer a possible error from the medium to the document - SetError( pNewFile->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( pNewFile->GetErrorCode(), ::rtl::OUString( OSL_LOG_PREFIX ) ); // notify the document that saving was done successfully if ( !bCopyTo ) @@ -2765,7 +2758,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl // and the DoSaveCompleted call should not be able to fail in general DBG_ASSERT( !bCopyTo, "Error while reconnecting to medium, can't be handled!"); - SetError( pNewFile->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( pNewFile->GetErrorCode(), ::rtl::OUString( OSL_LOG_PREFIX ) ); if ( !bCopyTo ) { @@ -2784,7 +2777,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl } else { - SetError( pNewFile->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + SetError( pNewFile->GetErrorCode(), ::rtl::OUString( OSL_LOG_PREFIX ) ); // reconnect to the old storage DoSaveCompleted( 0 ); @@ -2901,7 +2894,7 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, Windo if ( eOption != -1 && SvtSecurityOptions().IsOptionSet( eOption ) ) { - String sMessage( SfxResId( STR_HIDDENINFO_CONTAINS ) ); + String sMessage( SfxResId(STR_HIDDENINFO_CONTAINS).toString() ); sal_uInt16 nWantedStates = HIDDENINFORMATION_RECORDEDCHANGES | HIDDENINFORMATION_NOTES; if ( eFact != WhenPrinting ) nWantedStates |= HIDDENINFORMATION_DOCUMENTVERSIONS; @@ -2910,19 +2903,19 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, Windo if ( ( nStates & HIDDENINFORMATION_RECORDEDCHANGES ) == HIDDENINFORMATION_RECORDEDCHANGES ) { - sMessage += String( SfxResId( STR_HIDDENINFO_RECORDCHANGES ) ); + sMessage += SfxResId(STR_HIDDENINFO_RECORDCHANGES).toString(); sMessage += '\n'; bWarning = true; } if ( ( nStates & HIDDENINFORMATION_NOTES ) == HIDDENINFORMATION_NOTES ) { - sMessage += String( SfxResId( STR_HIDDENINFO_NOTES ) ); + sMessage += SfxResId(STR_HIDDENINFO_NOTES).toString(); sMessage += '\n'; bWarning = true; } if ( ( nStates & HIDDENINFORMATION_DOCUMENTVERSIONS ) == HIDDENINFORMATION_DOCUMENTVERSIONS ) { - sMessage += String( SfxResId( STR_HIDDENINFO_DOCVERSIONS ) ); + sMessage += SfxResId(STR_HIDDENINFO_DOCVERSIONS).toString(); sMessage += '\n'; bWarning = true; } @@ -2930,7 +2923,7 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, Windo if ( bWarning ) { sMessage += '\n'; - sMessage += String( SfxResId( nResId ) ); + sMessage += SfxResId(nResId).toString(); WarningBox aWBox( pParent, WB_YES_NO | WB_DEF_NO, sMessage ); nRet = aWBox.Execute(); } @@ -3037,6 +3030,7 @@ uno::Reference< embed::XStorage > SfxObjectShell::GetStorage() catch( uno::Exception& ) { // TODO/LATER: error handling? + DBG_UNHANDLED_EXCEPTION(); } } @@ -3215,7 +3209,7 @@ sal_Bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed:: if ( xSource->isStorageElement( aSubElements[nInd] ) ) { ::rtl::OUString aMediaType; - ::rtl::OUString aMediaTypePropName( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); + ::rtl::OUString aMediaTypePropName( "MediaType" ); sal_Bool bGotMediaType = sal_False; try @@ -3354,7 +3348,7 @@ sal_Bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< e else if ( xSource->isStorageElement( aSubElements[nInd] ) ) { ::rtl::OUString aMediaType; - ::rtl::OUString aMediaTypePropName( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); + ::rtl::OUString aMediaTypePropName( "MediaType" ); sal_Bool bGotMediaType = sal_False; try @@ -3451,12 +3445,12 @@ sal_Bool SfxObjectShell::GenerateAndStoreThumbnail( sal_Bool bEncrypted, try { uno::Reference< embed::XStorage > xThumbnailStor = - xStor->openStorageElement( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Thumbnails")), + xStor->openStorageElement( ::rtl::OUString("Thumbnails"), embed::ElementModes::READWRITE ); if ( xThumbnailStor.is() ) { uno::Reference< io::XStream > xStream = xThumbnailStor->openStreamElement( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("thumbnail.png")), + ::rtl::OUString("thumbnail.png"), embed::ElementModes::READWRITE ); if ( xStream.is() && WriteThumbnail( bEncrypted, bSigned, bIsTemplate, xStream ) ) @@ -3489,8 +3483,8 @@ sal_Bool SfxObjectShell::WriteThumbnail( sal_Bool bEncrypted, uno::Reference < beans::XPropertySet > xSet( xStream, uno::UNO_QUERY ); if ( xSet.is() ) - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), - uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/png")) ) ); + xSet->setPropertyValue( ::rtl::OUString("MediaType"), + uno::makeAny( ::rtl::OUString("image/png") ) ); if ( bEncrypted ) { sal_uInt16 nResID = GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl( diff --git a/sfx2/source/doc/objuno.cxx b/sfx2/source/doc/objuno.cxx index f95a8b9a8e39..a4ec4404cdf1 100644 --- a/sfx2/source/doc/objuno.cxx +++ b/sfx2/source/doc/objuno.cxx @@ -47,7 +47,6 @@ #include <com/sun/star/document/XCompatWriterDocProperties.hpp> #include <unotools/configmgr.hxx> -#include <tools/inetdef.hxx> #include <unotools/bootstrap.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <osl/mutex.hxx> @@ -382,7 +381,7 @@ void SfxDocumentInfoObject_Impl::Reset(uno::Reference<document::XDocumentPropert names.push_back(props[i].Name); } const ::rtl::OUString sInfo( - String( SfxResId( STR_DOCINFO_INFOFIELD ) )); + SfxResId(STR_DOCINFO_INFOFIELD).toString()); for (sal_Int32 i = oldLength; i < FOUR; ++i) { ::rtl::OUString sName(sInfo); sal_Int32 idx = sName.indexOfAsciiL("%1", 2); @@ -391,13 +390,13 @@ void SfxDocumentInfoObject_Impl::Reset(uno::Reference<document::XDocumentPropert : sName + ::rtl::OUString::valueOf(i+1); while (std::find(names.begin(), names.end(), name) != names.end()) { - name += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'")); + name += ::rtl::OUString("'"); } // FIXME there is a race condition here try { xPropContainer->addProperty(name, beans::PropertyAttribute::REMOVEABLE, - uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")))); + uno::makeAny(::rtl::OUString(""))); } catch (const uno::RuntimeException&) { throw; } catch (const uno::Exception&) { @@ -440,14 +439,14 @@ SfxDocumentInfoObject::initialize(const uno::Sequence< uno::Any > & aArguments) uno::Any any = aArguments[0]; uno::Reference<document::XDocumentProperties> xDoc; if (!(any >>= xDoc) || !xDoc.is()) throw lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentInfoObject::initialize: no XDocumentProperties given")), + ::rtl::OUString( + "SfxDocumentInfoObject::initialize: no XDocumentProperties given"), *this, 0); _pImp->Reset(xDoc); } else { throw lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxDocumentInfoObject::initialize: no argument given")), + ::rtl::OUString( + "SfxDocumentInfoObject::initialize: no argument given"), *this, 0); } } @@ -866,7 +865,7 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co _pImp->m_xDocProps->setAutoloadSecs(60); // default } else if ( !bBoolVal && (0 != _pImp->m_xDocProps->getAutoloadSecs()) ) { _pImp->m_xDocProps->setAutoloadSecs(0); - _pImp->m_xDocProps->setAutoloadURL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(""))); + _pImp->m_xDocProps->setAutoloadURL(::rtl::OUString("")); } break; default: @@ -1116,7 +1115,7 @@ void SAL_CALL SfxDocumentInfoObject::setUserFieldName(sal_Int16 nIndex, const : try { xPropContainer->addProperty(aName, beans::PropertyAttribute::REMOVEABLE, - uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")))); + uno::makeAny(::rtl::OUString(""))); _pImp->m_UserDefined[nIndex] = aName; } catch (const beans::PropertyExistException&) { _pImp->m_UserDefined[nIndex] = aName; @@ -1192,8 +1191,8 @@ SfxStandaloneDocumentInfoObject::SfxStandaloneDocumentInfoObject( const ::com::s , _xFactory( xFactory ) { uno::Reference< lang::XInitialization > xDocProps( - _xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.document.DocumentProperties"))), uno::UNO_QUERY_THROW); + _xFactory->createInstance( ::rtl::OUString( + "com.sun.star.document.DocumentProperties")), uno::UNO_QUERY_THROW); uno::Any a; a <<= xDocProps; uno::Sequence<uno::Any> args(1); @@ -1271,8 +1270,8 @@ void SAL_CALL SfxStandaloneDocumentInfoObject::loadFromURL(const ::rtl::OUStrin ::osl::ClearableMutexGuard aGuard( _pImp->_aMutex ); uno::Reference< document::XDocumentProperties > xDocProps( - _xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.document.DocumentProperties"))), uno::UNO_QUERY_THROW); + _xFactory->createInstance( ::rtl::OUString( + "com.sun.star.document.DocumentProperties")), uno::UNO_QUERY_THROW); _pImp->Reset(xDocProps); aGuard.clear(); @@ -1282,9 +1281,9 @@ void SAL_CALL SfxStandaloneDocumentInfoObject::loadFromURL(const ::rtl::OUStrin try { uno::Sequence<beans::PropertyValue> medium(2); - medium[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL")); + medium[0].Name = ::rtl::OUString("DocumentBaseURL"); medium[0].Value <<= aURL; - medium[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")); + medium[1].Name = ::rtl::OUString("URL"); medium[1].Value <<= aURL; _pImp->m_xDocProps->loadFromStorage(xStorage, medium); _pImp->Reset(_pImp->m_xDocProps); @@ -1297,7 +1296,7 @@ void SAL_CALL SfxStandaloneDocumentInfoObject::loadFromURL(const ::rtl::OUStrin else { uno::Reference < document::XStandaloneDocumentInfo > xBinary( _xFactory->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.BinaryStandaloneDocumentInfo" ) ) ), uno::UNO_QUERY ); + ::rtl::OUString("com.sun.star.document.BinaryStandaloneDocumentInfo" ) ), uno::UNO_QUERY ); if ( xBinary.is() ) { xBinary->loadFromURL( aURL ); @@ -1322,9 +1321,9 @@ void SAL_CALL SfxStandaloneDocumentInfoObject::storeIntoURL(const ::rtl::OUStri try { uno::Sequence<beans::PropertyValue> medium(2); - medium[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL")); + medium[0].Name = ::rtl::OUString("DocumentBaseURL"); medium[0].Value <<= aURL; - medium[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")); + medium[1].Name = ::rtl::OUString("URL"); medium[1].Value <<= aURL; _pImp->m_xDocProps->storeToStorage(xStorage, medium); @@ -1345,7 +1344,7 @@ void SAL_CALL SfxStandaloneDocumentInfoObject::storeIntoURL(const ::rtl::OUStri else { uno::Reference < document::XStandaloneDocumentInfo > xBinary( _xFactory->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.BinaryStandaloneDocumentInfo" ) ) ), uno::UNO_QUERY ); + ::rtl::OUString("com.sun.star.document.BinaryStandaloneDocumentInfo" ) ), uno::UNO_QUERY ); if ( xBinary.is() ) { Copy( this, xBinary ); diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 9e20d837b85d..6e82028f0299 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -144,7 +144,7 @@ static VBAConstantNameMap s_aRegisteredVBAConstants; if( xProps.is() ) try { ::rtl::OUString aConstName; - xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobalConstantName" ) ) ) >>= aConstName; + xProps->getPropertyValue( ::rtl::OUString( "VBAGlobalConstantName" ) ) >>= aConstName; return ::rtl::OUStringToOString( aConstName, RTL_TEXTENCODING_ASCII_US ); } catch (const uno::Exception&) // not supported @@ -288,7 +288,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) { SfxObjectShell* pDoc = &_rDocShell; SfxObjectShellArr_Impl &rArr = SFX_APP()->GetObjectShells_Impl(); - rArr.C40_INSERT( SfxObjectShell, pDoc, rArr.Count() ); + rArr.push_back( pDoc ); bInList = sal_True; } @@ -481,10 +481,9 @@ sal_Bool SfxObjectShell::Close() // remove from Document list SfxApplication *pSfxApp = SFX_APP(); SfxObjectShellArr_Impl &rDocs = pSfxApp->GetObjectShells_Impl(); - const SfxObjectShell *pThis = this; - sal_uInt16 nPos = rDocs.GetPos(pThis); - if ( nPos < rDocs.Count() ) - rDocs.Remove( nPos ); + SfxObjectShellArr_Impl::iterator it = std::find( rDocs.begin(), rDocs.end(), this ); + if ( it != rDocs.end() ) + rDocs.erase( it ); pImp->bInList = sal_False; } } @@ -505,9 +504,9 @@ SfxObjectShell* SfxObjectShell::GetFirst SfxObjectShellArr_Impl &rDocs = SFX_APP()->GetObjectShells_Impl(); // seach for a SfxDocument of the specified type - for ( sal_uInt16 nPos = 0; nPos < rDocs.Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < rDocs.size(); ++nPos ) { - SfxObjectShell* pSh = rDocs.GetObject( nPos ); + SfxObjectShell* pSh = rDocs[ nPos ]; if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() ) continue; @@ -533,14 +532,14 @@ SfxObjectShell* SfxObjectShell::GetNext // refind the specified predecessor sal_uInt16 nPos; - for ( nPos = 0; nPos < rDocs.Count(); ++nPos ) - if ( rDocs.GetObject(nPos) == &rPrev ) + for ( nPos = 0; nPos < rDocs.size(); ++nPos ) + if ( rDocs[nPos] == &rPrev ) break; // search for the next SfxDocument of the specified type - for ( ++nPos; nPos < rDocs.Count(); ++nPos ) + for ( ++nPos; nPos < rDocs.size(); ++nPos ) { - SfxObjectShell* pSh = rDocs.GetObject( nPos ); + SfxObjectShell* pSh = rDocs[ nPos ]; if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() ) continue; @@ -652,7 +651,7 @@ sal_uInt16 SfxObjectShell::PrepareClose const SfxPoolItem *pPoolItem; if ( IsSaveVersionOnClose() ) { - SfxStringItem aItem( SID_DOCINFO_COMMENTS, String( SfxResId( STR_AUTOMATICVERSION ) ) ); + SfxStringItem aItem( SID_DOCINFO_COMMENTS, SfxResId(STR_AUTOMATICVERSION).toString() ); SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); const SfxPoolItem* ppArgs[] = { &aItem, &aWarnItem, 0 }; pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs ); @@ -661,7 +660,7 @@ sal_uInt16 SfxObjectShell::PrepareClose { SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); const SfxPoolItem* ppArgs[] = { &aWarnItem, 0 }; - pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs ); + pPoolItem = pFrame->GetBindings().ExecuteSynchron( IsReadOnlyMedium() ? SID_SAVEASDOC : SID_SAVEDOC, ppArgs ); } if ( !pPoolItem || pPoolItem->ISA(SfxVoidItem) || ( pPoolItem->ISA(SfxBoolItem) && !( (const SfxBoolItem*) pPoolItem )->GetValue() ) ) @@ -999,7 +998,7 @@ String SfxObjectShell::GetServiceNameFromFactory( const String& rFact ) { //! Remove everything behind name! String aFact( rFact ); - String aPrefix = String::CreateFromAscii( "private:factory/" ); + String aPrefix = rtl::OUString("private:factory/"); if ( aPrefix.Len() == aFact.Match( aPrefix ) ) aFact.Erase( 0, aPrefix.Len() ); sal_uInt16 nPos = aFact.Search( '?' ); @@ -1021,46 +1020,46 @@ String SfxObjectShell::GetServiceNameFromFactory( const String& rFact ) if ( aFact.EqualsAscii("swriter") ) { - aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument")); + aServiceName = ::rtl::OUString("com.sun.star.text.TextDocument"); } else if ( aFact.EqualsAscii("sweb") || aFact.EqualsAscii("swriter/web") ) { - aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.WebDocument")); + aServiceName = ::rtl::OUString("com.sun.star.text.WebDocument"); } else if ( aFact.EqualsAscii("sglobal") || aFact.EqualsAscii("swriter/globaldocument") ) { - aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.GlobalDocument")); + aServiceName = ::rtl::OUString("com.sun.star.text.GlobalDocument"); } else if ( aFact.EqualsAscii("scalc") ) { - aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument")); + aServiceName = ::rtl::OUString("com.sun.star.sheet.SpreadsheetDocument"); } else if ( aFact.EqualsAscii("sdraw") ) { - aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DrawingDocument")); + aServiceName = ::rtl::OUString("com.sun.star.drawing.DrawingDocument"); } else if ( aFact.EqualsAscii("simpress") ) { - aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PresentationDocument")); + aServiceName = ::rtl::OUString("com.sun.star.presentation.PresentationDocument"); } else if ( aFact.EqualsAscii("schart") ) { - aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart.ChartDocument")); + aServiceName = ::rtl::OUString("com.sun.star.chart.ChartDocument"); } else if ( aFact.EqualsAscii("smath") ) { - aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.formula.FormulaProperties")); + aServiceName = ::rtl::OUString("com.sun.star.formula.FormulaProperties"); } #ifndef DISABLE_SCRIPTING else if ( aFact.EqualsAscii("sbasic") ) { - aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.BasicIDE")); + aServiceName = ::rtl::OUString("com.sun.star.script.BasicIDE"); } #endif #ifndef DISABLE_DBCONNECTIVITY else if ( aFact.EqualsAscii("sdatabase") ) { - aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument")); + aServiceName = ::rtl::OUString("com.sun.star.sdb.OfficeDatabaseDocument"); } #endif @@ -1103,7 +1102,7 @@ Reference<lang::XComponent> SfxObjectShell::CreateAndLoadComponent( const SfxIte SFX_ITEMSET_ARG(&rSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False); SFX_ITEMSET_ARG(&rSet, pTargetItem, SfxStringItem, SID_TARGETNAME, sal_False); ::rtl::OUString aURL; - ::rtl::OUString aTarget(RTL_CONSTASCII_USTRINGPARAM("_blank")); + ::rtl::OUString aTarget("_blank"); if ( pFileNameItem ) aURL = pFileNameItem->GetValue(); if ( pTargetItem ) @@ -1116,7 +1115,7 @@ Reference<lang::XComponent> SfxObjectShell::CreateAndLoadComponent( const SfxIte } else xLoader = uno::Reference < frame::XComponentLoader >( comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), uno::UNO_QUERY ); + ::rtl::OUString("com.sun.star.frame.Desktop") ), uno::UNO_QUERY ); Reference <lang::XComponent> xComp; try diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 6a8cf4676b89..5e768b4fa359 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -361,7 +361,7 @@ String SfxOleStringHelper::ImplLoadString16( SvStream& rStrm ) const rStrm.SeekRel( 2 ); // create string from character array aBuffer.push_back( 0 ); - aValue = String( &aBuffer.front() ); + aValue = rtl::OUString( &aBuffer.front() ); } return aValue; } diff --git a/sfx2/source/doc/ownsubfilterservice.cxx b/sfx2/source/doc/ownsubfilterservice.cxx index 9556ab7b14e2..ad4d83af1c59 100644 --- a/sfx2/source/doc/ownsubfilterservice.cxx +++ b/sfx2/source/doc/ownsubfilterservice.cxx @@ -52,15 +52,15 @@ OwnSubFilterService::~OwnSubFilterService() uno::Sequence< ::rtl::OUString > SAL_CALL OwnSubFilterService::impl_getStaticSupportedServiceNames() { uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.OwnSubFilter")); - aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.document.OwnSubFilter")); + aRet[0] = ::rtl::OUString("com.sun.star.document.OwnSubFilter"); + aRet[1] = ::rtl::OUString("com.sun.star.comp.document.OwnSubFilter"); return aRet; } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OwnSubFilterService::impl_getStaticImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.document.OwnSubFilter")); + return ::rtl::OUString("com.sun.star.comp.document.OwnSubFilter"); } //------------------------------------------------------------------------- diff --git a/sfx2/source/doc/plugin.cxx b/sfx2/source/doc/plugin.cxx index 0f706c6da911..5f86248c285f 100644 --- a/sfx2/source/doc/plugin.cxx +++ b/sfx2/source/doc/plugin.cxx @@ -28,10 +28,12 @@ #include "plugin.hxx" +#include <com/sun/star/plugin/PluginManager.hpp> #include <com/sun/star/plugin/XPluginManager.hpp> #include <com/sun/star/plugin/PluginMode.hpp> #include <com/sun/star/awt/XControl.hpp> +#include <comphelper/componentcontext.hxx> #include <rtl/ustring.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <svtools/miscopt.hxx> @@ -101,9 +103,7 @@ sal_Bool SAL_CALL PluginObject::load( const uno::Reference < frame::XFrame >& xFrame ) throw( uno::RuntimeException ) { - uno::Reference< plugin::XPluginManager > xPMgr( mxFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.plugin.PluginManager")) ), uno::UNO_QUERY ); - if (!xPMgr.is() ) - return sal_False; + uno::Reference< plugin::XPluginManager > xPMgr( plugin::PluginManager::create(comphelper::ComponentContext(mxFact).getUNOContext()) ); if ( SvtMiscOptions().IsPluginsEnabled() ) { @@ -145,9 +145,9 @@ throw( uno::RuntimeException ) uno::Reference< beans::XPropertySet > xProp( xModel, ::uno::UNO_QUERY ); if( xProp.is() ) { - uno::Any aValue = xProp->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) ); + uno::Any aValue = xProp->getPropertyValue( ::rtl::OUString( "URL" ) ); aValue >>= maURL; - aValue = xProp->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TYPE" ) ) ); + aValue = xProp->getPropertyValue( ::rtl::OUString( "TYPE" ) ); aValue >>= maMimeType; } } diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 33b33a679104..2728c03169f5 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -655,7 +655,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& aCheckedArgs[nProps++].Value <<= sFileURL; // and append the local filename aCheckedArgs.realloc( aCheckedArgs.getLength()+1 ); - aCheckedArgs[nProps].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LocalFileName")); + aCheckedArgs[nProps].Name = rtl::OUString("LocalFileName"); aCheckedArgs[nProps++].Value <<= ::rtl::OUString( sTemp ); } else @@ -671,7 +671,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& aCheckedArgs[nProps++].Value <<= sTemp; // and append the local filename aCheckedArgs.realloc( aCheckedArgs.getLength()+1 ); - aCheckedArgs[nProps].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LocalFileName")); + aCheckedArgs[nProps].Name = rtl::OUString("LocalFileName"); aCheckedArgs[nProps++].Value <<= ::rtl::OUString( sPath ); } else @@ -689,7 +689,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& pUCBPrintTempFile->EnableKillingFile(); //FIXME: does it work? - aCheckedArgs[nProps].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LocalFileName")); + aCheckedArgs[nProps].Name = rtl::OUString("LocalFileName"); aCheckedArgs[nProps++].Value <<= ::rtl::OUString( pUCBPrintTempFile->GetFileName() ); sUcbUrl = sURL; } @@ -714,7 +714,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& sal_Bool bTemp = sal_Bool(); if ( rProp.Value >>= bTemp ) { - aCheckedArgs[nProps].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Collate")); + aCheckedArgs[nProps].Name = rtl::OUString("Collate"); aCheckedArgs[nProps++].Value <<= bTemp; } else diff --git a/sfx2/source/doc/printhelper.hxx b/sfx2/source/doc/printhelper.hxx index d5b5ba83dffd..e8f3164176b1 100644 --- a/sfx2/source/doc/printhelper.hxx +++ b/sfx2/source/doc/printhelper.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "sal/config.h" #include "sfx2/dllapi.h" diff --git a/sfx2/source/doc/querytemplate.cxx b/sfx2/source/doc/querytemplate.cxx index f6a0e2690901..b5ce118c659e 100644 --- a/sfx2/source/doc/querytemplate.cxx +++ b/sfx2/source/doc/querytemplate.cxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "querytemplate.hxx" @@ -42,9 +33,9 @@ QueryTemplateBox::QueryTemplateBox( Window* pParent, const String& rMessage ) : SetImage( QueryBox::GetStandardImage() ); SetHelpId( HID_QUERY_LOAD_TEMPLATE ); - AddButton( String( SfxResId( STR_QRYTEMPL_UPDATE_BTN ) ), RET_YES, + AddButton( SfxResId( STR_QRYTEMPL_UPDATE_BTN ).toString(), RET_YES, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); - AddButton( String( SfxResId( STR_QRYTEMPL_KEEP_BTN ) ), RET_NO, BUTTONDIALOG_CANCELBUTTON ); + AddButton( SfxResId(STR_QRYTEMPL_KEEP_BTN).toString(), RET_NO, BUTTONDIALOG_CANCELBUTTON ); } } // end of namespace sfx2 diff --git a/sfx2/source/doc/querytemplate.hxx b/sfx2/source/doc/querytemplate.hxx index ef27654cc922..dc0a78cd1f15 100644 --- a/sfx2/source/doc/querytemplate.hxx +++ b/sfx2/source/doc/querytemplate.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX2_QUERYTEMPLATE_HXX #define _SFX2_QUERYTEMPLATE_HXX diff --git a/sfx2/source/doc/sfxacldetect.cxx b/sfx2/source/doc/sfxacldetect.cxx index 235ec032e347..2cfabed7b0f3 100644 --- a/sfx2/source/doc/sfxacldetect.cxx +++ b/sfx2/source/doc/sfxacldetect.cxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index fa2e64b3e692..4d40e3b894c8 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -292,8 +292,8 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument const uno::Reference<frame:: XTransientDocumentsDocumentContentFactory> xTDDCF( xMsf->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame." - "TransientDocumentsDocumentContentFactory")), + ::rtl::OUString("com.sun.star.frame." + "TransientDocumentsDocumentContentFactory"), xContext), uno::UNO_QUERY_THROW); const uno::Reference<ucb::XContent> xContent( @@ -307,7 +307,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument OSL_ENSURE(!uri.isEmpty(), "GetDMA: empty uri?"); if (!uri.isEmpty() && !uri.endsWithAsciiL("/", 1)) { - uri = uri + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + uri = uri + ::rtl::OUString("/"); } m_xDocumentMetadata = new ::sfx2::DocumentMetadataAccess( @@ -481,12 +481,9 @@ SfxSaveGuard::SfxSaveGuard(const uno::Reference< frame::XModel >& xM , m_pData (pData ) , m_pFramesLock(0 ) { - static ::rtl::OUString MSG_1(RTL_CONSTASCII_USTRINGPARAM("Object already disposed.")); - static ::rtl::OUString MSG_2(RTL_CONSTASCII_USTRINGPARAM("Concurrent save requests on the same document are not possible.")); - if ( m_pData->m_bClosed ) throw ::com::sun::star::lang::DisposedException( - MSG_1, + ::rtl::OUString("Object already disposed."), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >()); if ( @@ -494,7 +491,7 @@ SfxSaveGuard::SfxSaveGuard(const uno::Reference< frame::XModel >& xM m_pData->m_bSaving ) throw ::com::sun::star::io::IOException( - MSG_2, + ::rtl::OUString("Concurrent save requests on the same document are not possible."), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >()); m_pData->m_bSaving = sal_True; @@ -907,12 +904,12 @@ uno::Reference< document::XDocumentInfo > SAL_CALL SfxBaseModel::getDocumentInfo } catch (uno::RuntimeException &) { throw; } catch (const uno::Exception & e) { - throw lang::WrappedTargetRuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "SfxBaseModel::getDocumentInfo: cannot initialize")), *this, + throw lang::WrappedTargetRuntimeException(::rtl::OUString( + "SfxBaseModel::getDocumentInfo: cannot initialize"), *this, uno::makeAny(e)); } try { - rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("MediaType")); + rtl::OUString aName("MediaType"); uno::Reference < beans::XPropertySet > xSet( getDocumentStorage(), uno::UNO_QUERY_THROW ); uno::Any aMediaType = xSet->getPropertyValue( aName ); @@ -1114,13 +1111,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::c aRectSeq[3] = aTmpRect.Bottom(); seqArgsNew.realloc( ++nNewLength ); - seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WinExtent")); + seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString("WinExtent"); seqArgsNew[ nNewLength - 1 ].Value <<= aRectSeq; if ( !m_pData->m_aPreusedFilterName.isEmpty() ) { seqArgsNew.realloc( ++nNewLength ); - seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreusedFilterName")); + seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString("PreusedFilterName"); seqArgsNew[ nNewLength - 1 ].Value <<= m_pData->m_aPreusedFilterName; } @@ -1136,7 +1133,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::c aBorderSeq[3] = aBorder.Bottom(); seqArgsNew.realloc( ++nNewLength ); - seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentBorder")); + seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString("DocumentBorder"); seqArgsNew[ nNewLength - 1 ].Value <<= aBorderSeq; } @@ -1473,8 +1470,6 @@ void SAL_CALL SfxBaseModel::removeModifyListener(const uno::Reference< XMODIFYLI void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::CloseVetoException, uno::RuntimeException) { - static ::rtl::OUString MSG_1(RTL_CONSTASCII_USTRINGPARAM("Cant close while saving.")); - SolarMutexGuard aGuard; if ( impl_isDisposed() || m_pData->m_bClosed || m_pData->m_bClosing ) return; @@ -1503,7 +1498,7 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::Clo if (bDeliverOwnership) m_pData->m_bSuicide = sal_True; throw util::CloseVetoException( - MSG_1, + ::rtl::OUString("Cant close while saving."), static_cast< ::com::sun::star::util::XCloseable* >(this)); } @@ -1643,7 +1638,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa if ( m_pData->m_pObjectShell.Is() ) { - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "storeSelf" ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "storeSelf" ) ); SfxSaveGuard aSaveGuard(this, m_pData, sal_False); for ( sal_Int32 nInd = 0; nInd < aSeqArgs.getLength(); nInd++ ) @@ -1652,10 +1647,10 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa if ( aSeqArgs[nInd].Name != "VersionComment" && aSeqArgs[nInd].Name != "Author" && aSeqArgs[nInd].Name != "InteractionHandler" && aSeqArgs[nInd].Name != "StatusIndicator" ) { - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "unexpected parameter for storeSelf, might be no problem if SaveAs is executed." ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "unexpected parameter for storeSelf, might be no problem if SaveAs is executed." ) ); m_pData->m_pObjectShell->StoreLog(); - ::rtl::OUString aMessage( RTL_CONSTASCII_USTRINGPARAM( "Unexpected MediaDescriptor parameter: " ) ); + ::rtl::OUString aMessage( "Unexpected MediaDescriptor parameter: " ); aMessage += aSeqArgs[nInd].Name; throw lang::IllegalArgumentException( aMessage, uno::Reference< uno::XInterface >(), 1 ); } @@ -1697,14 +1692,14 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa if ( bRet ) { - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "successful saving." ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "successful saving." ) ); m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl(); SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOCDONE), m_pData->m_pObjectShell ) ); } else { - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing failed!" ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing failed!" ) ); m_pData->m_pObjectShell->StoreLog(); // write the contents of the logger to the file @@ -1739,7 +1734,7 @@ void SAL_CALL SfxBaseModel::storeAsURL( const ::rtl::OUString& if ( m_pData->m_pObjectShell.Is() ) { - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "storeAsURL" ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "storeAsURL" ) ); SfxSaveGuard aSaveGuard(this, m_pData, sal_False); impl_store( rURL, rArgs, sal_False ); @@ -1778,7 +1773,7 @@ void SAL_CALL SfxBaseModel::storeToURL( const ::rtl::OUString& if ( m_pData->m_pObjectShell.Is() ) { - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "storeToURL" ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "storeToURL" ) ); SfxSaveGuard aSaveGuard(this, m_pData, sal_False); impl_store( rURL, rArgs, sal_True ); } @@ -2269,55 +2264,55 @@ uno::Sequence< DATAFLAVOR > SAL_CALL SfxBaseModel::getTransferDataFlavors() uno::Sequence< DATAFLAVOR > aFlavorSeq( nSuppFlavors ); aFlavorSeq[0].MimeType = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) ); - aFlavorSeq[0].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GDIMetaFile" ) ); + ::rtl::OUString( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ); + aFlavorSeq[0].HumanPresentableName = ::rtl::OUString( "GDIMetaFile" ); aFlavorSeq[0].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 ); aFlavorSeq[1].MimeType = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) ); - aFlavorSeq[1].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GDIMetaFile" ) ); + ::rtl::OUString( "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" ); + aFlavorSeq[1].HumanPresentableName = ::rtl::OUString( "GDIMetaFile" ); aFlavorSeq[1].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 ); aFlavorSeq[2].MimeType = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ) ); - aFlavorSeq[2].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enhanced Windows MetaFile" ) ); + ::rtl::OUString( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ); + aFlavorSeq[2].HumanPresentableName = ::rtl::OUString( "Enhanced Windows MetaFile" ); aFlavorSeq[2].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 ); aFlavorSeq[3].MimeType = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ) ); - aFlavorSeq[3].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Windows MetaFile" ) ); + ::rtl::OUString( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ); + aFlavorSeq[3].HumanPresentableName = ::rtl::OUString( "Windows MetaFile" ); aFlavorSeq[3].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 ); aFlavorSeq[4].MimeType = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" ) ); - aFlavorSeq[4].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Star Object Descriptor (XML)" ) ); + ::rtl::OUString( "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" ); + aFlavorSeq[4].HumanPresentableName = ::rtl::OUString( "Star Object Descriptor (XML)" ); aFlavorSeq[4].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 ); aFlavorSeq[5].MimeType = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"" ) ); - aFlavorSeq[5].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Star Embed Source (XML)" ) ); + ::rtl::OUString( "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"" ); + aFlavorSeq[5].HumanPresentableName = ::rtl::OUString( "Star Embed Source (XML)" ); aFlavorSeq[5].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 ); aFlavorSeq[6].MimeType = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" ) ); - aFlavorSeq[6].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bitmap" ) ); + ::rtl::OUString( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" ); + aFlavorSeq[6].HumanPresentableName = ::rtl::OUString( "Bitmap" ); aFlavorSeq[6].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 ); aFlavorSeq[7].MimeType = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "image/png" ) ); - aFlavorSeq[7].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PNG" ) ); + ::rtl::OUString( "image/png" ); + aFlavorSeq[7].HumanPresentableName = ::rtl::OUString( "PNG" ); aFlavorSeq[7].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 ); if ( nSuppFlavors == 10 ) { aFlavorSeq[8].MimeType = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ) ); - aFlavorSeq[8].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enhanced Windows MetaFile" ) ); + ::rtl::OUString( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ); + aFlavorSeq[8].HumanPresentableName = ::rtl::OUString( "Enhanced Windows MetaFile" ); aFlavorSeq[8].DataType = getCppuType( (const sal_uInt64*) 0 ); aFlavorSeq[9].MimeType = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ) ); - aFlavorSeq[9].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Windows MetaFile" ) ); + ::rtl::OUString( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ); + aFlavorSeq[9].HumanPresentableName = ::rtl::OUString( "Windows MetaFile" ); aFlavorSeq[9].DataType = getCppuType( (const sal_uInt64*) 0 ); } @@ -2515,7 +2510,7 @@ void SAL_CALL SfxBaseModel::removeDocumentEventListener( const uno::Reference< d void SAL_CALL SfxBaseModel::notifyDocumentEvent( const ::rtl::OUString&, const uno::Reference< frame::XController2 >&, const uno::Any& ) throw ( lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException ) { - throw lang::NoSupportException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SfxBaseModel controlls all the sent notifications itself!" ) ), uno::Reference< uno::XInterface >() ); + throw lang::NoSupportException( ::rtl::OUString( "SfxBaseModel controlls all the sent notifications itself!" ), uno::Reference< uno::XInterface >() ); } //________________________________________________________________________________________________________ @@ -2540,7 +2535,7 @@ void addTitle_Impl( Sequence < ::com::sun::star::beans::PropertyValue >& rSeq, c if ( nArg == nCount ) { rSeq.realloc( nCount+1 ); - rSeq[nCount].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ); + rSeq[nCount].Name = ::rtl::OUString( "Title" ); rSeq[nCount].Value <<= rTitle; } } @@ -2569,7 +2564,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , && m_pData->m_pObjectShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) { uno::Reference< XSTORAGE > xConfigStorage; - rtl::OUString aUIConfigFolderName( RTL_CONSTASCII_USTRINGPARAM( "Configurations2" )); + rtl::OUString aUIConfigFolderName( "Configurations2" ); xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, com::sun::star::embed::ElementModes::READWRITE ); if ( !xConfigStorage.is() ) @@ -2745,7 +2740,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL // this is the same file URL as the current document location, try to use storeOwn if possible ::comphelper::SequenceAsHashMap aArgHash( seqArguments ); - ::rtl::OUString aFilterString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) ); + ::rtl::OUString aFilterString( "FilterName" ); ::rtl::OUString aFilterName = aArgHash.getUnpackedValueOrDefault( aFilterString, ::rtl::OUString() ); if ( !aFilterName.isEmpty() ) { @@ -2756,7 +2751,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL if ( pFilter && aFilterName.equals( pFilter->GetFilterName() ) ) { aArgHash.erase( aFilterString ); - aArgHash.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) ); + aArgHash.erase( ::rtl::OUString( "URL" ) ); try { @@ -2771,13 +2766,13 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL // TODO/LATER: need a new interaction for this case if ( m_pData->m_pObjectShell->IsDocShared() ) { - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't store shared document!" ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Can't store shared document!" ) ); m_pData->m_pObjectShell->StoreLog(); - uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionData" ) ), uno::Sequence< beans::NamedValue >() ); + uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( "EncryptionData" ), uno::Sequence< beans::NamedValue >() ); if ( !aNewEncryptionData.getLength() ) { - ::rtl::OUString aNewPassword = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Password" ) ), ::rtl::OUString() ); + ::rtl::OUString aNewPassword = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( "Password" ), ::rtl::OUString() ); aNewEncryptionData = ::comphelper::OStorageHelper::CreatePackageEncryptionData( aNewPassword ); } @@ -2789,7 +2784,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL else { // if the password is changed a special error should be used in case of shared document - throw task::ErrorCodeIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant change password for shared document." ) ), uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE ); + throw task::ErrorCodeIOException( ::rtl::OUString( "Cant change password for shared document." ), uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE ); } } } @@ -2814,11 +2809,11 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL if ( pCopyStreamItem && pCopyStreamItem->GetValue() && !bSaveTo ) { - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Misuse of CopyStreamIfPossible!" ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Misuse of CopyStreamIfPossible!" ) ); m_pData->m_pObjectShell->StoreLog(); throw frame::IllegalArgumentIOException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CopyStreamIfPossible parameter is not acceptable for storeAsURL() call!") ), + ::rtl::OUString( "CopyStreamIfPossible parameter is not acceptable for storeAsURL() call!"), uno::Reference< uno::XInterface >() ); } @@ -2893,7 +2888,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL sal_uInt32 nErrCode = m_pData->m_pObjectShell->GetErrorCode(); if ( !bRet && !nErrCode ) { - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing has failed, no error is set!" ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing has failed, no error is set!" ) ); nErrCode = ERRCODE_IO_CANTWRITE; } m_pData->m_pObjectShell->ResetError(); @@ -2914,7 +2909,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL } } - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing succeeded!" ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing succeeded!" ) ); if ( !bSaveTo ) { m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl(); @@ -2933,7 +2928,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL else { // let the logring be stored to the related file - m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing failed!" ) ) ); + m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing failed!" ) ); m_pData->m_pObjectShell->StoreLog(); m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash ); @@ -3301,8 +3296,8 @@ static void ConvertSlotsToCommands( SfxObjectShell* pDoc, uno::Reference< contai { Any aAny; SfxModule* pModule( pDoc->GetFactory().GetModule() ); - rtl::OUString aSlotCmd( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); - rtl::OUString aUnoCmd( RTL_CONSTASCII_USTRINGPARAM( ".uno:" )); + rtl::OUString aSlotCmd( "slot:" ); + rtl::OUString aUnoCmd( ".uno:" ); uno::Sequence< beans::PropertyValue > aSeqPropValue; for ( sal_Int32 i = 0; i < rToolbarDefinition->getCount(); i++ ) @@ -3343,7 +3338,7 @@ uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfig { uno::Reference< ui::XUIConfigurationManager > xNewUIConfMan( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.UIConfigurationManager"))), + ::rtl::OUString("com.sun.star.ui.UIConfigurationManager")), uno::UNO_QUERY ); Reference< ui::XUIConfigurationStorage > xUIConfigStorage( xNewUIConfMan, uno::UNO_QUERY ); @@ -3351,14 +3346,14 @@ uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfig { uno::Reference< XSTORAGE > xConfigStorage; - rtl::OUString aUIConfigFolderName( RTL_CONSTASCII_USTRINGPARAM( "Configurations2" )); + rtl::OUString aUIConfigFolderName( "Configurations2" ); // First try to open with READWRITE and then READ xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, embed::ElementModes::READWRITE ); if ( xConfigStorage.is() ) { - rtl::OUString aMediaTypeProp( RTL_CONSTASCII_USTRINGPARAM( "MediaType" )); + rtl::OUString aMediaTypeProp( "MediaType" ); rtl::OUString aUIConfigMediaType( - RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.xml.ui.configuration" ) ); + "application/vnd.sun.xml.ui.configuration" ); rtl::OUString aMediaType; uno::Reference< beans::XPropertySet > xPropSet( xConfigStorage, uno::UNO_QUERY ); Any a = xPropSet->getPropertyValue( aMediaTypeProp ); @@ -3380,7 +3375,7 @@ uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfig { // Import old UI configuration from OOo 1.x uno::Reference< XSTORAGE > xOOo1ConfigStorage; - rtl::OUString aOOo1UIConfigFolderName( RTL_CONSTASCII_USTRINGPARAM( "Configurations" )); + rtl::OUString aOOo1UIConfigFolderName( "Configurations" ); // Try to open with READ xOOo1ConfigStorage = getDocumentSubStorage( aOOo1UIConfigFolderName, embed::ElementModes::READ ); @@ -3412,7 +3407,7 @@ uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfig { try { - rtl::OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( "UIName" )); + rtl::OUString aPropName( "UIName" ); Any aAny( aCustomTbxTitle ); xPropSet->setPropertyValue( aPropName, aAny ); } @@ -3511,8 +3506,8 @@ embed::VisualRepresentation SAL_CALL SfxBaseModel::getPreferredVisualRepresentat SfxModelGuard aGuard( *this ); datatransfer::DataFlavor aDataFlavor( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" )), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GDIMetaFile")), + ::rtl::OUString("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ), + ::rtl::OUString("GDIMetaFile"), ::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) ); embed::VisualRepresentation aVisualRepresentation; @@ -3739,7 +3734,7 @@ css::uno::Reference< css::frame::XTitle > SfxBaseModel::impl_getTitleHelper () if ( ! m_pData->m_xTitleHelper.is ()) { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory (); - static const ::rtl::OUString SERVICENAME_DESKTOP(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")); + const ::rtl::OUString SERVICENAME_DESKTOP("com.sun.star.frame.Desktop"); css::uno::Reference< css::frame::XUntitledNumbers > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::frame::XModel > xThis (static_cast< css::frame::XModel* >(this), css::uno::UNO_QUERY_THROW); @@ -3765,7 +3760,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl m_pData->m_xNumberedControllers = css::uno::Reference< css::frame::XUntitledNumbers >(static_cast< ::cppu::OWeakObject* >(pHelper), css::uno::UNO_QUERY_THROW); pHelper->setOwner (xThis); - pHelper->setUntitledPrefix (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : "))); + pHelper->setUntitledPrefix (::rtl::OUString(" : ")); } return m_pData->m_xNumberedControllers; @@ -3792,7 +3787,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl = aContent.getProperties(); if ( xProps.is() ) { - ::rtl::OUString aServerTitle( RTL_CONSTASCII_USTRINGPARAM("TitleOnServer") ); + ::rtl::OUString aServerTitle( "TitleOnServer" ); if ( xProps->hasPropertyByName( aServerTitle ) ) { uno::Any aAny = aContent.getPropertyValue( aServerTitle ); @@ -3800,24 +3795,24 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl } } } - catch (ucb::ContentCreationException &) + catch (const ucb::ContentCreationException &) { } - catch (ucb::CommandAbortedException &) + catch (const ucb::CommandAbortedException &) { } SFX_ITEMSET_ARG( pMedium->GetItemSet(), pRepairedDocItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False ); if ( pRepairedDocItem && pRepairedDocItem->GetValue() ) - aResult += String( SfxResId(STR_REPAIREDDOCUMENT) ); + aResult += SfxResId(STR_REPAIREDDOCUMENT).toString(); } if ( m_pData->m_pObjectShell->IsReadOnlyUI() || (pMedium && pMedium->IsReadOnly()) ) - aResult += ::rtl::OUString( String( SfxResId(STR_READONLY) ) ); + aResult += SfxResId(STR_READONLY).toString(); else if ( m_pData->m_pObjectShell->IsDocShared() ) - aResult += ::rtl::OUString( String( SfxResId(STR_SHARED) ) ); + aResult += SfxResId(STR_SHARED).toString(); if ( m_pData->m_pObjectShell->GetDocumentSignatureState() == SIGNATURESTATE_SIGNATURES_OK ) - aResult += String( SfxResId( RID_XMLSEC_DOCUMENTSIGNED ) ); + aResult += SfxResId(RID_XMLSEC_DOCUMENTSIGNED).toString(); } return aResult; @@ -4148,8 +4143,8 @@ SfxBaseModel::getRDFRepository() throw (uno::RuntimeException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->getRDFRepository(); @@ -4163,8 +4158,8 @@ SfxBaseModel::getStringValue() throw (uno::RuntimeException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->getStringValue(); @@ -4178,8 +4173,8 @@ SfxBaseModel::getNamespace() throw (uno::RuntimeException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->getNamespace(); @@ -4192,8 +4187,8 @@ SfxBaseModel::getLocalName() throw (uno::RuntimeException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->getLocalName(); @@ -4209,8 +4204,8 @@ throw (uno::RuntimeException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->getElementByMetadataReference(i_rReference); @@ -4224,8 +4219,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->getElementByURI(i_xURI); @@ -4240,8 +4235,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->getMetadataGraphsWithType(i_xType); @@ -4257,8 +4252,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->addMetadataFile(i_rFileName, i_rTypes); @@ -4278,8 +4273,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->importMetadataFile(i_Format, @@ -4296,8 +4291,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->removeMetadataFile(i_xGraphName); @@ -4312,8 +4307,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->addContentOrStylesFile(i_rFileName); @@ -4328,8 +4323,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->removeContentOrStylesFile(i_rFileName); @@ -4348,8 +4343,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA( m_pData->CreateDMAUninitialized()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } try { @@ -4375,8 +4370,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->storeMetadataToStorage(i_xStorage); @@ -4393,8 +4388,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA( m_pData->CreateDMAUninitialized()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } try { @@ -4419,8 +4414,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "model has no document metadata")), *this ); + throw uno::RuntimeException( ::rtl::OUString( + "model has no document metadata"), *this ); } return xDMA->storeMetadataToMedium(i_rMedium); diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx index 7a2441bfe1e8..7a9bd9094045 100644 --- a/sfx2/source/doc/sfxmodelfactory.cxx +++ b/sfx2/source/doc/sfxmodelfactory.cxx @@ -28,11 +28,9 @@ #include "sfx2/sfxmodelfactory.hxx" -/** === begin UNO includes === **/ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/lang/XInitialization.hpp> -/** === end UNO includes === **/ #include <comphelper/namedvaluecollection.hxx> #include <cppuhelper/implbase2.hxx> diff --git a/sfx2/source/doc/syspath.cxx b/sfx2/source/doc/syspath.cxx index 231d6fc1466a..612dc3ab5628 100644 --- a/sfx2/source/doc/syspath.cxx +++ b/sfx2/source/doc/syspath.cxx @@ -1,32 +1,21 @@ /* -*- 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 2008 by Sun Microsystems, Inc. -* -* 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. -* -************************************************************************/ - -// Comment out precompiled statement due to redefinition errors +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "syspath.hxx" diff --git a/sfx2/source/doc/syspath.hxx b/sfx2/source/doc/syspath.hxx index 7287032ef74d..f3690ac13703 100644 --- a/sfx2/source/doc/syspath.hxx +++ b/sfx2/source/doc/syspath.hxx @@ -1,30 +1,21 @@ /* -*- 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 2008 by Sun Microsystems, Inc. -* -* 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. -* -************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef __SYSPATH_HXX__ #define __SYSPATH_HXX__ diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx index 66911b46d977..c5c40b0b756a 100644 --- a/sfx2/source/doc/syspathw32.cxx +++ b/sfx2/source/doc/syspathw32.cxx @@ -1,30 +1,21 @@ /* -*- 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 2008 by Sun Microsystems, Inc. -* -* 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. -* -************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ diff --git a/sfx2/source/doc/templatelocnames.src b/sfx2/source/doc/templatelocnames.src index 03c3caf661ad..6c0f563d6dc1 100644 --- a/sfx2/source/doc/templatelocnames.src +++ b/sfx2/source/doc/templatelocnames.src @@ -30,252 +30,103 @@ // Do not translate STR_TEMPLATE_NAME*_DEF names!! String STR_TEMPLATE_NAME1_DEF { - Text = "Blue Border" ; + Text = "Abstract Green" ; }; String STR_TEMPLATE_NAME2_DEF { - Text = "Black and White" ; + Text = "Abstract Red" ; }; String STR_TEMPLATE_NAME3_DEF { - Text = "Blue and Grey" ; + Text = "Abstract Yellow" ; }; String STR_TEMPLATE_NAME4_DEF { - Text = "Blue Lines and Gradients" ; + Text = "Bright Blue" ; }; String STR_TEMPLATE_NAME5_DEF { - Text = "Blue with Bottom Title " ; + Text = "DNA" ; }; String STR_TEMPLATE_NAME6_DEF { - Text = "Notebook" ; + Text = "Inspiration" ; }; String STR_TEMPLATE_NAME7_DEF { - Text = "Brown" ; + Text = "Lush Green" ; }; String STR_TEMPLATE_NAME8_DEF { - Text = "Characters with Glow" ; + Text = "Metropolis" ; }; String STR_TEMPLATE_NAME9_DEF { - Text = "Forest" ; + Text = "Sunset" ; }; String STR_TEMPLATE_NAME10_DEF { - Text = "Fresco" ; + Text = "Vintage" ; }; -String STR_TEMPLATE_NAME11_DEF -{ - Text = "Glacier" ; -}; - -String STR_TEMPLATE_NAME12_DEF -{ - Text = "Green with White Lines" ; -}; - -String STR_TEMPLATE_NAME13_DEF -{ - Text = "Keyboard" ; -}; - -String STR_TEMPLATE_NAME14_DEF -{ - Text = "Light Blue Shapes" ; -}; - -String STR_TEMPLATE_NAME15_DEF -{ - Text = "Numbers on Dark Background" ; -}; - -String STR_TEMPLATE_NAME16_DEF -{ - Text = "Blue Step Gradients" ; -}; - -String STR_TEMPLATE_NAME17_DEF -{ - Text = "White Blue and Lightnings" ; -}; - -String STR_TEMPLATE_NAME18_DEF -{ - Text = "Noise Paper" ; -}; - -String STR_TEMPLATE_NAME19_DEF -{ - Text = "Red Noise Shapes" ; -}; - -String STR_TEMPLATE_NAME20_DEF -{ - Text = "Rounded Rectangles" ; -}; - -String STR_TEMPLATE_NAME21_DEF -{ - Text = "Blue and Red Gradient" ; -}; - -String STR_TEMPLATE_NAME22_DEF -{ - Text = "Technical Polygon" ; -}; - -String STR_TEMPLATE_NAME23_DEF -{ - Text = "Tunnel" ; -}; - -String STR_TEMPLATE_NAME24_DEF -{ - Text = "Water" ; -}; - -String STR_TEMPLATE_NAME25_DEF -{ - Text = "Wine" ; -}; ///////////////////////////////////////////////// String STR_TEMPLATE_NAME1 { - Text [ en-US ] = "Blue Border" ; + Text [ en-US ] = "Abstract Green" ; }; String STR_TEMPLATE_NAME2 { - Text [ en-US ] = "Black and White" ; + Text [ en-US ] = "Abstract Red" ; }; String STR_TEMPLATE_NAME3 { - Text [ en-US ] = "Blue and Grey" ; + Text [ en-US ] = "Abstract Yellow" ; }; String STR_TEMPLATE_NAME4 { - Text [ en-US ] = "Blue Lines and Gradients" ; + Text [ en-US ] = "Bright Blue" ; }; String STR_TEMPLATE_NAME5 { - Text [ en-US ] = "Blue with Bottom Title" ; + Text [ en-US ] = "DNA" ; }; String STR_TEMPLATE_NAME6 { - Text [ en-US ] = "Notebook" ; + Text [ en-US ] = "Inspiration" ; }; String STR_TEMPLATE_NAME7 { - Text [ en-US ] = "Brown" ; + Text [ en-US ] = "Lush Green" ; }; String STR_TEMPLATE_NAME8 { - Text [ en-US ] = "Characters with Glow" ; + Text [ en-US ] = "Metropolis" ; }; String STR_TEMPLATE_NAME9 { - Text [ en-US ] = "Forest" ; + Text [ en-US ] = "Sunset" ; }; String STR_TEMPLATE_NAME10 { - Text [ en-US ] = "Fresco" ; -}; - -String STR_TEMPLATE_NAME11 -{ - Text [ en-US ] = "Glacier" ; -}; - -String STR_TEMPLATE_NAME12 -{ - Text [ en-US ] = "Green with White Lines" ; -}; - -String STR_TEMPLATE_NAME13 -{ - Text [ en-US ] = "Keyboard" ; -}; - -String STR_TEMPLATE_NAME14 -{ - Text [ en-US ] = "Light Blue Shapes" ; -}; - -String STR_TEMPLATE_NAME15 -{ - Text [ en-US ] = "Numbers on Dark Background" ; -}; - -String STR_TEMPLATE_NAME16 -{ - Text [ en-US ] = "Blue Step Gradients" ; -}; - -String STR_TEMPLATE_NAME17 -{ - Text [ en-US ] = "White Blue and Lightnings" ; -}; - -String STR_TEMPLATE_NAME18 -{ - Text [ en-US ] = "Noise Paper" ; -}; - -String STR_TEMPLATE_NAME19 -{ - Text [ en-US ] = "Red Noise Shapes" ; -}; - -String STR_TEMPLATE_NAME20 -{ - Text [ en-US ] = "Rounded Rectangles" ; -}; - -String STR_TEMPLATE_NAME21 -{ - Text [ en-US ] = "Blue and Red Gradient" ; -}; - -String STR_TEMPLATE_NAME22 -{ - Text [ en-US ] = "Technical Polygon" ; -}; - -String STR_TEMPLATE_NAME23 -{ - Text [ en-US ] = "Tunnel" ; -}; - -String STR_TEMPLATE_NAME24 -{ - Text [ en-US ] = "Water" ; -}; - -String STR_TEMPLATE_NAME25 -{ - Text [ en-US ] = "Wine" ; + Text [ en-US ] = "Vintage" ; }; diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx new file mode 100644 index 000000000000..d5906089ea1b --- /dev/null +++ b/sfx2/source/doc/zoomitem.cxx @@ -0,0 +1,180 @@ +/* -*- 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 <tools/stream.hxx> +#include <basic/sbxvar.hxx> + +#include <sfx2/zoomitem.hxx> +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/beans/PropertyValue.hpp> + +// ----------------------------------------------------------------------- + +TYPEINIT1_FACTORY(SvxZoomItem,SfxUInt16Item, new SvxZoomItem); + +#define ZOOM_PARAM_VALUE "Value" +#define ZOOM_PARAM_VALUESET "ValueSet" +#define ZOOM_PARAM_TYPE "Type" +#define ZOOM_PARAMS 3 + +// ----------------------------------------------------------------------- + +SvxZoomItem::SvxZoomItem +( + SvxZoomType eZoomType, + sal_uInt16 nVal, + sal_uInt16 _nWhich +) +: SfxUInt16Item( _nWhich, nVal ), + nValueSet( SVX_ZOOM_ENABLE_ALL ), + eType( eZoomType ) +{ +} + +// ----------------------------------------------------------------------- + +SvxZoomItem::SvxZoomItem( const SvxZoomItem& rOrig ) +: SfxUInt16Item( rOrig.Which(), rOrig.GetValue() ), + nValueSet( rOrig.GetValueSet() ), + eType( rOrig.GetType() ) +{ +} + +// ----------------------------------------------------------------------- + +SvxZoomItem::~SvxZoomItem() +{ +} + +// ----------------------------------------------------------------------- + +SfxPoolItem* SvxZoomItem::Clone( SfxItemPool * /*pPool*/ ) const +{ + return new SvxZoomItem( *this ); +} + +// ----------------------------------------------------------------------- + +SfxPoolItem* SvxZoomItem::Create( SvStream& rStrm, sal_uInt16 /*nVersion*/ ) const +{ + sal_uInt16 nValue; + sal_uInt16 nValSet; + sal_Int8 nType; + rStrm >> nValue >> nValSet >> nType; + SvxZoomItem* pNew = new SvxZoomItem( (SvxZoomType)nType, nValue, Which() ); + pNew->SetValueSet( nValSet ); + return pNew; +} + +// ----------------------------------------------------------------------- + +SvStream& SvxZoomItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) const +{ + rStrm << (sal_uInt16)GetValue() + << nValueSet + << (sal_Int8)eType; + return rStrm; +} + +// ----------------------------------------------------------------------- + +int SvxZoomItem::operator==( const SfxPoolItem& rAttr ) const +{ + DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); + + SvxZoomItem& rItem = (SvxZoomItem&)rAttr; + + return ( GetValue() == rItem.GetValue() && + nValueSet == rItem.GetValueSet() && + eType == rItem.GetType() ); +} + +bool SvxZoomItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const +{ +// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + nMemberId &= ~CONVERT_TWIPS; + + assert(nMemberId == 0); + + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSeq( ZOOM_PARAMS ); + aSeq[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_VALUE )); + aSeq[0].Value <<= sal_Int32( GetValue() ); + aSeq[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_VALUESET )); + aSeq[1].Value <<= sal_Int16( nValueSet ); + aSeq[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_TYPE )); + aSeq[2].Value <<= sal_Int16( eType ); + rVal <<= aSeq; + + return true; +} + +bool SvxZoomItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) +{ + nMemberId &= ~CONVERT_TWIPS; + assert(nMemberId == 0); + + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSeq; + if (( rVal >>= aSeq ) && ( aSeq.getLength() == ZOOM_PARAMS )) + { + sal_Int32 nValueTmp( 0 ); + sal_Int16 nValueSetTmp( 0 ); + sal_Int16 nTypeTmp( 0 ); + sal_Bool bAllConverted( sal_True ); + sal_Int16 nConvertedCount( 0 ); + for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ ) + { + if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUE )) + { + bAllConverted &= ( aSeq[i].Value >>= nValueTmp ); + ++nConvertedCount; + } + else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUESET )) + { + bAllConverted &= ( aSeq[i].Value >>= nValueSetTmp ); + ++nConvertedCount; + } + else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_TYPE )) + { + bAllConverted &= ( aSeq[i].Value >>= nTypeTmp ); + ++nConvertedCount; + } + } + + if ( bAllConverted && nConvertedCount == ZOOM_PARAMS ) + { + SetValue( (sal_uInt16)nValueTmp ); + nValueSet = nValueSetTmp; + eType = SvxZoomType( nTypeTmp ); + return true; + } + } + + return false; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx index b62fba0ca866..48c0ca942ae6 100644 --- a/sfx2/source/explorer/nochaos.cxx +++ b/sfx2/source/explorer/nochaos.cxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include <svl/itempool.hxx> diff --git a/sfx2/source/inc/alienwarn.hxx b/sfx2/source/inc/alienwarn.hxx index e34a2d2846bf..eb3fe2fc69c1 100644 --- a/sfx2/source/inc/alienwarn.hxx +++ b/sfx2/source/inc/alienwarn.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_ALIENWARN_HXX #define _SFX_ALIENWARN_HXX diff --git a/sfx2/source/inc/appbas.hxx b/sfx2/source/inc/appbas.hxx index 6f3809d5674c..9443afde6bd5 100644 --- a/sfx2/source/inc/appbas.hxx +++ b/sfx2/source/inc/appbas.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_APPBAS_HXX #define _SFX_APPBAS_HXX diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx index 938773027d1c..315cf8f46b0d 100644 --- a/sfx2/source/inc/appdata.hxx +++ b/sfx2/source/inc/appdata.hxx @@ -53,7 +53,8 @@ class SfxFilterMatcher; class SfxStatusDispatcher; class SfxDdeTriggerTopic_Impl; class SfxDocumentTemplates; -class SfxFrameArr_Impl; +class SfxFrame; +typedef ::std::vector<SfxFrame*> SfxFrameArr_Impl; class SvtSaveOptions; class SvtHelpOptions; class SfxObjectFactory; diff --git a/sfx2/source/inc/doctemplates.hxx b/sfx2/source/inc/doctemplates.hxx index f34f0fde4aeb..390d2b722b47 100644 --- a/sfx2/source/inc/doctemplates.hxx +++ b/sfx2/source/inc/doctemplates.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_DOCTEMPLATES_HXX_ #define _SFX_DOCTEMPLATES_HXX_ @@ -58,7 +49,6 @@ #define XLOCALIZABLE ::com::sun::star::lang::XLocalizable #define XMODEL ::com::sun::star::frame::XModel #define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory -#define XNAMEACCESS ::com::sun::star::container::XNameAccess #define XSERVICEINFO ::com::sun::star::lang::XServiceInfo #define XSTORABLE ::com::sun::star::frame::XStorable diff --git a/sfx2/source/inc/docundomanager.hxx b/sfx2/source/inc/docundomanager.hxx index 4fb93d9a8151..14a29e33cdcb 100644 --- a/sfx2/source/inc/docundomanager.hxx +++ b/sfx2/source/inc/docundomanager.hxx @@ -1,38 +1,28 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +/* + * This file is part of the LibreOffice project. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * OpenOffice.org - a multi-platform office productivity suite + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef DOCUMENT_UNDO_MANAGER_HXX #define DOCUMENT_UNDO_MANAGER_HXX #include "sfx2/sfxbasemodel.hxx" -/** === begin UNO includes === **/ #include <com/sun/star/document/XUndoManager.hpp> -/** === end UNO includes === **/ #include <cppuhelper/implbase1.hxx> diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx index 4a43c1f88854..63184fe1fb3f 100644 --- a/sfx2/source/inc/eventsupplier.hxx +++ b/sfx2/source/inc/eventsupplier.hxx @@ -70,13 +70,11 @@ namespace comphelper #define XEVENTBROADCASTER ::com::sun::star::document::XEventBroadcaster #define XDOCEVENTLISTENER ::com::sun::star::document::XEventListener #define XEVENTSSUPPLIER ::com::sun::star::document::XEventsSupplier -#define XJOBEXECUTOR ::com::sun::star::task::XJobExecutor #define EVENTOBJECT ::com::sun::star::lang::EventObject #define ILLEGALARGUMENTEXCEPTION ::com::sun::star::lang::IllegalArgumentException #define WRAPPEDTARGETEXCEPTION ::com::sun::star::lang::WrappedTargetException #define ANY ::com::sun::star::uno::Any #define REFERENCE ::com::sun::star::uno::Reference -#define WEAKREFERENCE ::com::sun::star::uno::WeakReference #define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException #define SEQUENCE ::com::sun::star::uno::Sequence #define UNOTYPE ::com::sun::star::uno::Type diff --git a/sfx2/source/inc/fltfnc.hxx b/sfx2/source/inc/fltfnc.hxx index d9f10a52882d..0c2d984c6c0c 100644 --- a/sfx2/source/inc/fltfnc.hxx +++ b/sfx2/source/inc/fltfnc.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFXFLTFNC_HXX #define _SFXFLTFNC_HXX diff --git a/sfx2/source/inc/fltoptint.hxx b/sfx2/source/inc/fltoptint.hxx index 4c5c570cefa5..4530fcbcd1b7 100644 --- a/sfx2/source/inc/fltoptint.hxx +++ b/sfx2/source/inc/fltoptint.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef SFX2_FLTOPTINT_HXX #define SFX2_FLTOPTINT_HXX diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc index ef5c168c36f0..303e6f249322 100644 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_HELPID_HRC #define _SFX_HELPID_HRC @@ -33,49 +24,18 @@ // Help-Ids ----------------------------------------------------------------- -#define HID_FILTER_SELECT "SFX2_HID_FILTER_SELECT" -#define HID_USERDEFBMP "SFX2_HID_USERDEFBMP" #define HID_DOCINFO_EDT "SFX2_HID_DOCINFO_EDT" #define HID_PASSWD "SFX2_HID_PASSWD" #define HID_PRINTMONITOR "SFX2_HID_PRINTMONITOR" -#define HID_CONFIG_OBJECTBAR "SFX2_HID_CONFIG_OBJECTBAR" #define HID_MANAGE_STYLES "SFX2_HID_MANAGE_STYLES" #define HID_CONFIG_EVENT "SFX2_HID_CONFIG_EVENT" #define HID_DOCINFODESC "SFX2_HID_DOCINFODESC" #define HID_DOCINFODOC "SFX2_HID_DOCINFODOC" #define HID_DOCINFOUSER "SFX2_HID_DOCINFOUSER" -#define HID_BOOKMARKPROPS "SFX2_HID_BOOKMARKPROPS" -#define HID_BOOKGROUPPROPS "SFX2_HID_BOOKGROUPPROPS" -#define HID_BOOKFILEPROPS "SFX2_HID_BOOKFILEPROPS" -#define HID_NEWS_SERVERPROPS "SFX2_HID_NEWS_SERVERPROPS" -#define HID_NEWS_RULEPAGE "SFX2_HID_NEWS_RULEPAGE" -#define HID_MAILINTRAYPROPS "SFX2_HID_MAILINTRAYPROPS" #define HID_DOCINFORELOAD "SFX2_HID_DOCINFORELOAD" -#define HID_NEWS_GROUPPAGE "SFX2_HID_NEWS_GROUPPAGE" -#define HID_NEWS_SERVERPAGE "SFX2_HID_NEWS_SERVERPAGE" -#define HID_EXPLORERCONTROL "SFX2_HID_EXPLORERCONTROL" #define HID_BROWSERCONTROL "SFX2_HID_BROWSERCONTROL" #define HID_CTL_ORGANIZER_LEFT "SFX2_HID_CTL_ORGANIZER_LEFT" #define HID_CTL_ORGANIZER_RIGHT "SFX2_HID_CTL_ORGANIZER_RIGHT" -#define HID_EXPLMAILSRV_GENERAL_PAGE "SFX2_HID_EXPLMAILSRV_GENERAL_PAGE" -#define HID_EXPLMAILSRV_PROTOCOL_PAGE "SFX2_HID_EXPLMAILSRV_PROTOCOL_PAGE" -#define HID_EXPLMAILSRV_DATAMATCH_PAGE "SFX2_HID_EXPLMAILSRV_DATAMATCH_PAGE" -#define HID_EXPLMAILSRV_SENDJOURNAL_PAGE "SFX2_HID_EXPLMAILSRV_SENDJOURNAL_PAGE" -#define HID_EXPLMAIL_GENERAL_PAGE "SFX2_HID_EXPLMAIL_GENERAL_PAGE" -#define HID_NEWS_CTL_RULES "SFX2_HID_NEWS_CTL_RULES" -#define HID_NEWS_CTL_GROUPS "SFX2_HID_NEWS_CTL_GROUPS" -#define HID_CONFIG_OBJECTBAR_CTL "SFX2_HID_CONFIG_OBJECTBAR_CTL" -#define HID_NEWS_QUICKSEARCH "SFX2_HID_NEWS_QUICKSEARCH" -#define HID_NEWS_SERVERVIEWPROPS "SFX2_HID_NEWS_SERVERVIEWPROPS" -#define HID_NEWS_SHOWARTICLEPROPS "SFX2_HID_NEWS_SHOWARTICLEPROPS" -#define HID_NEWS_SHOWGROUPPROPS "SFX2_HID_NEWS_SHOWGROUPPROPS" -#define HID_NEWS_USER "SFX2_HID_NEWS_USER" -#define HID_MULTISELECTION_GENERAL_PAGE "SFX2_HID_MULTISELECTION_GENERAL_PAGE" -#define HID_LINK_GENERAL_PAGE "SFX2_HID_LINK_GENERAL_PAGE" -#define HID_LINK_ADDRESS_PAGE "SFX2_HID_LINK_ADDRESS_PAGE" -#define HID_FOLDER_GENERAL_PAGE "SFX2_HID_FOLDER_GENERAL_PAGE" -#define HID_FILE_GENERAL_PAGE "SFX2_HID_FILE_GENERAL_PAGE" -#define HID_FTP_GENERAL_PAGE "SFX2_HID_FTP_GENERAL_PAGE" #define HID_PRINT_OPTIONS "SFX2_HID_PRINT_OPTIONS" #define HID_PREVIEW_FRAME "SFX2_HID_PREVIEW_FRAME" #define HID_DOCINFO_FRAME "SFX2_HID_DOCINFO_FRAME" @@ -83,22 +43,13 @@ #define HID_APP_WIN "SFX2_HID_APP_WIN" #define HID_TEMPLATE_FMT "SFX2_HID_TEMPLATE_FMT" #define HID_TEMPLATE_FILTER "SFX2_HID_TEMPLATE_FILTER" -#define HID_FTPSERVER_PAGE "SFX2_HID_FTPSERVER_PAGE" -#define HID_DLG_SFX_EXP_SEARCH "SFX2_HID_DLG_SFX_EXP_SEARCH" -#define HID_TP_SFX_EXP_SEARCH_CRITERIA "SFX2_HID_TP_SFX_EXP_SEARCH_CRITERIA" -#define HID_TP_SFX_EXP_SEARCH_PLACE "SFX2_HID_TP_SFX_EXP_SEARCH_PLACE" #define HID_SEARCH_DLG_TABLB "SFX2_HID_SEARCH_DLG_TABLB" #define HID_TEMPLDLG_NEWBYEXAMPLE "SFX2_HID_TEMPLDLG_NEWBYEXAMPLE" #define HID_TEMPLDLG_UPDATEBYEXAMPLE "SFX2_HID_TEMPLDLG_UPDATEBYEXAMPLE" #define HID_TEMPLDLG_WATERCAN "SFX2_HID_TEMPLDLG_WATERCAN" #define HID_DESKTOP "SFX2_HID_DESKTOP" -#define HID_EXPLORERTOOLSTOOLBOX "SFX2_HID_EXPLORERTOOLSTOOLBOX" -#define HID_EXPLOREROBJECTTOOLBOX "SFX2_HID_EXPLOREROBJECTTOOLBOX" -#define HID_RECORDINGTOOLBOX "SFX2_HID_RECORDINGTOOLBOX" #define HID_FULLSCREENTOOLBOX "SFX2_HID_FULLSCREENTOOLBOX" #define HID_HELPBAR "SFX2_HID_HELPBAR" -#define HID_ENVTOOLBOX "SFX2_HID_ENVTOOLBOX" -#define HID_FRAMESETEDIT_TOOLBOX "SFX2_HID_FRAMESETEDIT_TOOLBOX" #define HID_NAVIGATOR_WINDOW "SFX2_HID_NAVIGATOR_WINDOW" #define HID_TABDLG_RESET_BTN "SFX2_HID_TABDLG_RESET_BTN" #define HID_TABDLG_STANDARD_BTN "SFX2_HID_TABDLG_STANDARD_BTN" @@ -106,8 +57,6 @@ #define HID_TEMPLDLG_TOOLBOX_LEFT "SFX2_HID_TEMPLDLG_TOOLBOX_LEFT" #define HID_TEMPLDLG_TOOLBOX_RIGHT "SFX2_HID_TEMPLDLG_TOOLBOX_RIGHT" #define HID_EXPLORER_SRCH_COUNT "SFX2_HID_EXPLORER_SRCH_COUNT" -#define HID_BEAMER_SORT_ASCENDING "SFX2_HID_BEAMER_SORT_ASCENDING" -#define HID_BEAMER_SORT_DESCENDING "SFX2_HID_BEAMER_SORT_DESCENDING" #define HID_EXPLORER_SRCH_LATEST_COUNT "SFX2_HID_EXPLORER_SRCH_LATEST_COUNT" #define HID_CONFIG_EVENT_OFFICE_BASED "SFX2_HID_CONFIG_EVENT_OFFICE_BASED" #define HID_CONFIG_EVENT_DOCUMENT_BASED "SFX2_HID_CONFIG_EVENT_DOCUMENT_BASED" @@ -123,123 +72,31 @@ #define HID_STYLIST_EDIT "SFX2_HID_STYLIST_EDIT" #define HID_STYLIST_DELETE "SFX2_HID_STYLIST_DELETE" #define HID_EXPLORERMENU_ARRANGEICONS "SFX2_HID_EXPLORERMENU_ARRANGEICONS" -#define HID_EXPLORERMENU_ARRANGEICONS_ONGRID "SFX2_HID_EXPLORERMENU_ARRANGEICONS_ONGRID" -#define HID_EXPLORERMENU_FIXEDICONPOS "SFX2_HID_EXPLORERMENU_FIXEDICONPOS" -#define HID_EXPLORERMENU_OPEN "SFX2_HID_EXPLORERMENU_OPEN" -#define HID_EXPLORERMENU_PRINT "SFX2_HID_EXPLORERMENU_PRINT" -#define HID_EXPLORERMENU_SEARCH "SFX2_HID_EXPLORERMENU_SEARCH" -#define HID_EXPLORERMENU_COPY "SFX2_HID_EXPLORERMENU_COPY" -#define HID_EXPLORERMENU_DELETE "SFX2_HID_EXPLORERMENU_DELETE" -#define HID_EXPLORERMENU_CREATELINK "SFX2_HID_EXPLORERMENU_CREATELINK" -#define HID_EXPLORERMENU_EDITPROPERTIES "SFX2_HID_EXPLORERMENU_EDITPROPERTIES" -#define HID_EXPLORERMENU_DOWNLOAD "SFX2_HID_EXPLORERMENU_DOWNLOAD" #define HID_EXPLORERMENU_STDTEMPLATE "SFX2_HID_EXPLORERMENU_STDTEMPLATE" -#define HID_EXPLORERDLG_FILELIST "SFX2_HID_EXPLORERDLG_FILELIST" -#define HID_PDFOLDERS_WORKPLACE "SFX2_HID_PDFOLDERS_WORKPLACE" -#define HID_PDFOLDERS_EXPLORER "SFX2_HID_PDFOLDERS_EXPLORER" -#define HID_PDFOLDERS_STANDARD "SFX2_HID_PDFOLDERS_STANDARD" -#define HID_PDFOLDERS_ROOT "SFX2_HID_PDFOLDERS_ROOT" -#define HID_PDFOLDERS_DESKTOP "SFX2_HID_PDFOLDERS_DESKTOP" -#define HID_CNTMENU_REMOVE_GROUP "SFX2_HID_CNTMENU_REMOVE_GROUP" -#define HID_CNTMENU_CLEAR_CACHE "SFX2_HID_CNTMENU_CLEAR_CACHE" -#define HID_CNT_SYNC_INFO_DLG "SFX2_HID_CNT_SYNC_INFO_DLG" -#define HID_CNT_REMOVE_REMOVEDLIST "SFX2_HID_CNT_REMOVE_REMOVEDLIST" -#define HID_CNT_ABORT_DIALOG "SFX2_HID_CNT_ABORT_DIALOG" -#define HID_CNT_PAGE_PRJ_DATAEXCHANGE "SFX2_HID_CNT_PAGE_PRJ_DATAEXCHANGE" -#define HID_CHAOSDOC_OBJECTBAR_FILE "SFX2_HID_CHAOSDOC_OBJECTBAR_FILE" -#define HID_CHAOSDOC_OBJECTBAR_MESSAGE "SFX2_HID_CHAOSDOC_OBJECTBAR_MESSAGE" -#define HID_CHAOSDOC_MN_PART_OPEN "SFX2_HID_CHAOSDOC_MN_PART_OPEN" -#define HID_CHAOSDOC_MN_PART_DELETE "SFX2_HID_CHAOSDOC_MN_PART_DELETE" -#define HID_CHAOSDOC_MN_PART_RENAME "SFX2_HID_CHAOSDOC_MN_PART_RENAME" -#define HID_CHAOSDOC_MN_PART_SAVEAS "SFX2_HID_CHAOSDOC_MN_PART_SAVEAS" #define HID_EXPLORER_DOCVIEW_ICON "SFX2_HID_EXPLORER_DOCVIEW_ICON" #define HID_EXPLORER_DOCVIEW_DETAILS "SFX2_HID_EXPLORER_DOCVIEW_DETAILS" #define HID_CHAOSDOC_WIN "SFX2_HID_CHAOSDOC_WIN" #define HID_CHAOSDOC_WIN_HEADER "SFX2_HID_CHAOSDOC_WIN_HEADER" #define HID_CHAOSDOC_WIN_PARTS "SFX2_HID_CHAOSDOC_WIN_PARTS" #define HID_CHAOSDOC_WIN_BODY "SFX2_HID_CHAOSDOC_WIN_BODY" -#define HID_CNT_INSERT_COLUMN "SFX2_HID_CNT_INSERT_COLUMN" -#define HID_CNT_REMOVE_COLUMN "SFX2_HID_CNT_REMOVE_COLUMN" -#define HID_CNT_OPT_WIDTH "SFX2_HID_CNT_OPT_WIDTH" -#define HID_CNT_SORT_ASC "SFX2_HID_CNT_SORT_ASC" -#define HID_CNT_SORT_DESC "SFX2_HID_CNT_SORT_DESC" -#define HID_CNT_RULEPG_OPEN_DIR "SFX2_HID_CNT_RULEPG_OPEN_DIR" -#define HID_CHAOSDOC_MN_HEADER_ADDRESSBOOK "SFX2_HID_CHAOSDOC_MN_HEADER_ADDRESSBOOK" -#define HID_CHAOSDOC_MN_HEADER_COPYLINK "SFX2_HID_CHAOSDOC_MN_HEADER_COPYLINK" -#define HID_CLEAN_CACHE "SFX2_HID_CLEAN_CACHE" -#define HID_SBOX_LOCATION "SFX2_HID_SBOX_LOCATION" -#define HID_SBOX_SUBSCRIBTION "SFX2_HID_SBOX_SUBSCRIBTION" -#define HID_SBOX_CDF_SUBSCRIBTION "SFX2_HID_SBOX_CDF_SUBSCRIBTION" -#define HID_SBOX_SCHEDULE "SFX2_HID_SBOX_SCHEDULE" -#define HID_SBOX_NOTIFICATION "SFX2_HID_SBOX_NOTIFICATION" -#define HID_SBOX_SDC_GENERAL "SFX2_HID_SBOX_SDC_GENERAL" #define HID_BRWBOX_HEADERBAR "SFX2_HID_BRWBOX_HEADERBAR" -#define HID_CANNOT_CREATE_BMK_HERE "SFX2_HID_CANNOT_CREATE_BMK_HERE" -#define HID_CREATE_BOOKMARK "SFX2_HID_CREATE_BOOKMARK" #define HID_TASKBAR "SFX2_HID_TASKBAR" #define HID_TASKBUTTONBAR "SFX2_HID_TASKBUTTONBAR" #define HID_TASKTOOLBAR "SFX2_HID_TASKTOOLBAR" -#define HID_CHAOSDOC_SHOW_FSYS_EXTENSION "SFX2_HID_CHAOSDOC_SHOW_FSYS_EXTENSION" -#define HID_CNT_FILE "SFX2_HID_CNT_FILE" -#define HID_CHAOSDOC_MN_BODY_OPENLINK "SFX2_HID_CHAOSDOC_MN_BODY_OPENLINK" -#define HID_CHAOSDOC_MN_BODY_OPENLINK_BLANK "SFX2_HID_CHAOSDOC_MN_BODY_OPENLINK_BLANK" -#define HID_CHAOSDOC_MN_BODY_DOWNLOAD "SFX2_HID_CHAOSDOC_MN_BODY_DOWNLOAD" -#define HID_CHAOSDOC_MN_BODY_ADDBOOKMARK "SFX2_HID_CHAOSDOC_MN_BODY_ADDBOOKMARK" -#define HID_OPEN_MENU_CNT "SFX2_HID_OPEN_MENU_CNT" -#define HID_CNT_OPEN_AS_TEMPLATE "SFX2_HID_CNT_OPEN_AS_TEMPLATE" -#define HID_CNT_OPEN_AS_DOC "SFX2_HID_CNT_OPEN_AS_DOC" -#define HID_PDFOLDERS_TEMPLATE "SFX2_HID_PDFOLDERS_TEMPLATE" -#define HID_EXPLORER_ROOT "SFX2_HID_EXPLORER_ROOT" -#define HID_RESET_URL "SFX2_HID_RESET_URL" -#define HID_PHONE_DIALOG "SFX2_HID_PHONE_DIALOG" -#define HID_QB_RESOLVE_LINK "SFX2_HID_QB_RESOLVE_LINK" -#define HID_CHAOSDOC_MN_HEADER_FLAG_BOLD "SFX2_HID_CHAOSDOC_MN_HEADER_FLAG_BOLD" -#define HID_CHAOSDOC_MN_HEADER_FLAG_ITALIC "SFX2_HID_CHAOSDOC_MN_HEADER_FLAG_ITALIC" -#define HID_CHAOSDOC_MN_HEADER_BIG_HEADER "SFX2_HID_CHAOSDOC_MN_HEADER_BIG_HEADER" -#define HID_CHAOSDOC_MN_HEADER_TEMPLATE_HEADER "SFX2_HID_CHAOSDOC_MN_HEADER_TEMPLATE_HEADER" -#define HID_CNT_MARK_THREAD_MARKED "SFX2_HID_CNT_MARK_THREAD_MARKED" -#define HID_CNT_MARK_THREAD_UNMARKED "SFX2_HID_CNT_MARK_THREAD_UNMARKED" #define HID_CNT_DLG_SEARCH_BT_SHOW "SFX2_HID_CNT_DLG_SEARCH_BT_SHOW" #define HID_CNT_DLG_SEARCH_BT_UPDATE "SFX2_HID_CNT_DLG_SEARCH_BT_UPDATE" #define HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE "SFX2_HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE" #define HID_CNT_DLG_SEARCH_BT_STOP "SFX2_HID_CNT_DLG_SEARCH_BT_STOP" #define HID_CNT_PAGE_HEADER "SFX2_HID_CNT_PAGE_HEADER" -#define HID_CNT_DLG_ADDRESS "SFX2_HID_CNT_DLG_ADDRESS" -#define HID_EXPLORERMENU_AUTO_ARRANGEICONS "SFX2_HID_EXPLORERMENU_AUTO_ARRANGEICONS" -#define HID_EXPLORERMENU_AUTO_ADJUSTICONS "SFX2_HID_EXPLORERMENU_AUTO_ADJUSTICONS" -#define HID_EXPLORERMENU_FREE_POSITIONING "SFX2_HID_EXPLORERMENU_FREE_POSITIONING" -#define HID_CNT_TARGET_MENU "SFX2_HID_CNT_TARGET_MENU" #define HID_CNT_PAGE_DESCRIPTION "SFX2_HID_CNT_PAGE_DESCRIPTION" #define HID_CNT_LB_HEADER "SFX2_HID_CNT_LB_HEADER" #define HID_CNT_LB_DESCRIPTION "SFX2_HID_CNT_LB_DESCRIPTION" -#define HID_GROUPVIEW_BIG_SYMBOLS "SFX2_HID_GROUPVIEW_BIG_SYMBOLS" -#define HID_GROUPVIEW_SMALL_SYMBOLS "SFX2_HID_GROUPVIEW_SMALL_SYMBOLS" -#define HID_GROUPVIEW_ADD_GROUP "SFX2_HID_GROUPVIEW_ADD_GROUP" -#define HID_GROUPVIEW_REMOVE_GROUP "SFX2_HID_GROUPVIEW_REMOVE_GROUP" -#define HID_GROUPVIEW_RENAME_GROUP "SFX2_HID_GROUPVIEW_RENAME_GROUP" -#define HID_GROUPVIEW_ADD_BOOKMARK "SFX2_HID_GROUPVIEW_ADD_BOOKMARK" -#define HID_GROUPVIEW_TREE "SFX2_HID_GROUPVIEW_TREE" -#define HID_GROUPVIEW_ADD_AS_FOLDER "SFX2_HID_GROUPVIEW_ADD_AS_FOLDER" -#define HID_GROUPVIEW_ADD_AS_BMK "SFX2_HID_GROUPVIEW_ADD_AS_BMK" -#define HID_GROUPVIEW_REMOVE_BMK "SFX2_HID_GROUPVIEW_REMOVE_BMK" #define HID_GROUPVIEW_CONTENT_BIG "SFX2_HID_GROUPVIEW_CONTENT_BIG" #define HID_GROUPVIEW_CONTENT_SMALL "SFX2_HID_GROUPVIEW_CONTENT_SMALL" #define HID_GROUPVIEW_CONTENT_TREE "SFX2_HID_GROUPVIEW_CONTENT_TREE" -#define HID_GROUPVIEW_SHOW_DOCS "SFX2_HID_GROUPVIEW_SHOW_DOCS" -#define HID_EDIT_TEMPLATE "SFX2_HID_EDIT_TEMPLATE" -#define HID_PDFOLDERS_GRAPHICS "SFX2_HID_PDFOLDERS_GRAPHICS" -#define HID_PDFOLDERS_GROUPS "SFX2_HID_PDFOLDERS_GROUPS" -#define HID_OPEN_CHOOSE_FILTER "SFX2_HID_OPEN_CHOOSE_FILTER" -#define HID_PDFOLDERS_BOOKMARKS "SFX2_HID_PDFOLDERS_BOOKMARKS" -#define HID_PDFOLDERS_FAVORITES_ADD "SFX2_HID_PDFOLDERS_FAVORITES_ADD" -#define HID_PDFOLDERS_FAVORITES_REMOVE "SFX2_HID_PDFOLDERS_FAVORITES_REMOVE" -#define HID_PDFOLDERS_HISTORY "SFX2_HID_PDFOLDERS_HISTORY" -#define HID_CNT_CB_FORCE_BODY_EXPORT "SFX2_HID_CNT_CB_FORCE_BODY_EXPORT" -#define HID_CNT_PAGE_REPSTATE_CONTROL "SFX2_HID_CNT_PAGE_REPSTATE_CONTROL" #define HID_TASKSTATUSBAR "SFX2_HID_TASKSTATUSBAR" #define HID_CNT_PAGE_HEADER_TABBAR "SFX2_HID_CNT_PAGE_HEADER_TABBAR" #define HID_CNT_PAGE_SUBSCR_TABBAR "SFX2_HID_CNT_PAGE_SUBSCR_TABBAR" -#define HID_CHAOSDOC_MN_PART_PRINT "SFX2_HID_CHAOSDOC_MN_PART_PRINT" #define HID_STATUSINDICATOR_TEXT "SFX2_HID_STATUSINDICATOR_TEXT" #define HID_STATUSINDICATOR_PROGRESS "SFX2_HID_STATUSINDICATOR_PROGRESS" #define HID_CNT_VALUE_ADDED_NONE "SFX2_HID_CNT_VALUE_ADDED_NONE" @@ -259,14 +116,6 @@ #define HID_CNT_SENT_VIEW_SENT_ARTICLES "SFX2_HID_CNT_SENT_VIEW_SENT_ARTICLES" #define HID_CNT_SENT_VIEW_UNSENT_ARTICLES "SFX2_HID_CNT_SENT_VIEW_UNSENT_ARTICLES" #define HID_CNT_SENT_VIEW_MARKED_ARTICLES "SFX2_HID_CNT_SENT_VIEW_MARKED_ARTICLES" -#define HID_MAILWIN_SEND_BUTTON "SFX2_HID_MAILWIN_SEND_BUTTON" -#define HID_MAILWIN_CLOSE_BUTTON "SFX2_HID_MAILWIN_CLOSE_BUTTON" -#define HID_MAILWIN_ROLE_BOX "SFX2_HID_MAILWIN_ROLE_BOX" -#define HID_MAILWIN_ADDRESS_EDIT "SFX2_HID_MAILWIN_ADDRESS_EDIT" -#define HID_MAILWIN_ADDRESS_BOX "SFX2_HID_MAILWIN_ADDRESS_BOX" -#define HID_MAILWIN_SUBJECT_EDIT "SFX2_HID_MAILWIN_SUBJECT_EDIT" -#define HID_MAILWIN_FROM_EDIT "SFX2_HID_MAILWIN_FROM_EDIT" -#define HID_MAILWIN_PRIO_BOX "SFX2_HID_MAILWIN_PRIO_BOX" #define HID_TABDLG_APPLY_BTN "SFX2_HID_TABDLG_APPLY_BTN" #define HID_TP_COMMONPRINTOPTIONS "SFX2_HID_TP_COMMONPRINTOPTIONS" #define HID_HELP_WINDOW "SFX2_HID_HELP_WINDOW" @@ -293,21 +142,14 @@ #define HID_CLOSE_WARNING "SFX2_HID_CLOSE_WARNING" #define HID_DID_SAVE_PACKED_XML "SFX2_HID_DID_SAVE_PACKED_XML" #define HID_HELP_TREELISTBOX_CONTENTS "SFX2_HID_HELP_TREELISTBOX_CONTENTS" -#define HID_CUSTOMIZETOOLBOX "SFX2_HID_CUSTOMIZETOOLBOX" -#define HID_CUSTOMIZETOOLBOX_FUNCTIONS "SFX2_HID_CUSTOMIZETOOLBOX_FUNCTIONS" -#define HID_CUSTOMIZETOOLBOX_TOOLBOX "SFX2_HID_CUSTOMIZETOOLBOX_TOOLBOX" #define HID_HELP_TEXT_SELECTION_MODE "SFX2_HID_HELP_TEXT_SELECTION_MODE" #define HID_WARNING_SECURITY_HYPERLINK "SFX2_HID_WARNING_SECURITY_HYPERLINK" -#define HID_USERDEFBMP_TOOLBOX "SFX2_HID_USERDEFBMP_TOOLBOX" -#define HID_CONFIG_LOAD "SFX2_HID_CONFIG_LOAD" #define HID_CONFIG_SAVE "SFX2_HID_CONFIG_SAVE" #define HID_SEARCHDIALOG "SFX2_HID_SEARCHDIALOG" -#define HID_XMLSEC_WARNING_BROKENSIGNATURE "SFX2_HID_XMLSEC_WARNING_BROKENSIGNATURE" -#define HID_XMLSEC_QUERY_LOSINGSIGNATURE "SFX2_HID_XMLSEC_QUERY_LOSINGSIGNATURE" #define HID_XMLSEC_QUERY_SAVEBEFORESIGN "SFX2_HID_XMLSEC_QUERY_SAVEBEFORESIGN" #define HID_XMLSECDLG_MACROWARN "SFX2_HID_XMLSECDLG_MACROWARN" #define HID_XMLSEC_INFO_WRONGDOCFORMAT "SFX2_HID_XMLSEC_INFO_WRONGDOCFORMAT" diff --git a/sfx2/source/inc/hexplwnd.hxx b/sfx2/source/inc/hexplwnd.hxx deleted file mode 100644 index 501b2bbef242..000000000000 --- a/sfx2/source/inc/hexplwnd.hxx +++ /dev/null @@ -1,103 +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 _HEXPLWND_HXX -#define _HEXPLWND_HXX - -// includes -------------------------------------------------------------- - -#include <com/sun/star/beans/PropertyValues.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/beans/PropertyState.hpp> -#include <com/sun/star/beans/XPropertySetInfo.hpp> -#include <com/sun/star/beans/XMultiPropertySet.hpp> -#include <com/sun/star/beans/XFastPropertySet.hpp> -#include <com/sun/star/beans/XVetoableChangeListener.hpp> -#include <com/sun/star/beans/XPropertyState.hpp> -#include <com/sun/star/beans/XPropertyStateChangeListener.hpp> -#include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/beans/XPropertiesChangeListener.hpp> -#include <com/sun/star/beans/XPropertyChangeListener.hpp> -#include <com/sun/star/beans/XPropertyAccess.hpp> -#include <com/sun/star/beans/XPropertyContainer.hpp> -#include <com/sun/star/beans/PropertyStateChangeEvent.hpp> -#include <com/sun/star/beans/PropertyChangeEvent.hpp> -#include <com/sun/star/frame/XFrame.hpp> -#include <com/sun/star/util/URL.hpp> -#include <sfx2/childwin.hxx> -#include <sfx2/dockwin.hxx> - -// forward --------------------------------------------------------------- - -class SfxBeamerUnoFrame_Impl; - -// class SfxExplorerHorizChildWnd_Impl ----------------------------------- - -class SfxExplorerHorizChildWnd_Impl : public SfxChildWindow -{ -public: - SfxExplorerHorizChildWnd_Impl( Window* pParent, sal_uInt16 nId, - SfxBindings* pBindings, - SfxChildWinInfo* pInfo ); - - SFX_DECL_CHILDWINDOW(SfxExplorerHorizChildWnd_Impl); - - - virtual sal_Bool QueryClose(); -}; - -// class SfxExplorerDockWnd_Impl ----------------------------------------- - -class SfxExplorerHorizDockWnd_Impl : public SfxDockingWindow -{ -private: - SfxBeamerUnoFrame_Impl* _pFrame; - -protected: - virtual void GetFocus(); - virtual long Notify( NotifyEvent& rNEvt ); - -public: - SfxExplorerHorizDockWnd_Impl( SfxBindings* pBindings, - SfxChildWindow* pChildWin, - Window* pParent, const ResId& rResId ); - ~SfxExplorerHorizDockWnd_Impl(); - - virtual void FillInfo( SfxChildWinInfo& ) const; - virtual void FadeIn( sal_Bool ); - sal_Bool QueryClose(); - void SetURL( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs ); - const ::com::sun::star::util::URL& GetURL() const; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetFrameInterface(); - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& GetArgs() const; -}; - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/iframe.hxx b/sfx2/source/inc/iframe.hxx index b0a98b740a0b..1e3174fea9b7 100644 --- a/sfx2/source/inc/iframe.hxx +++ b/sfx2/source/inc/iframe.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_IFRAME_HXX #define _SFX_IFRAME_HXX diff --git a/sfx2/source/inc/mailmodel.hxx b/sfx2/source/inc/mailmodel.hxx deleted file mode 100644 index 703e53746658..000000000000 --- a/sfx2/source/inc/mailmodel.hxx +++ /dev/null @@ -1,107 +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 INCLUDED_SFX_MAILMODEL_HXX -#define INCLUDED_SFX_MAILMODEL_HXX - -#include <com/sun/star/frame/XFrame.hpp> - -// class SfxMailModel_Impl ----------------------------------------------- - -class AddressList_Impl; - -class SfxMailModel_Impl -{ -public: - enum MailPriority - { - PRIO_HIGHEST, - PRIO_HIGH, - PRIO_NORMAL, - PRIO_LOW, - PRIO_LOWEST - }; - - enum AddressRole - { - ROLE_TO, - ROLE_CC, - ROLE_BCC - }; - - enum MailDocType - { - TYPE_SELF, - TYPE_ASPDF - }; - -private: - enum SaveResult - { - SAVE_SUCCESSFULL, - SAVE_CANCELLED, - SAVE_ERROR - }; - - AddressList_Impl* mpToList; - AddressList_Impl* mpCcList; - AddressList_Impl* mpBccList; - String maFromAddress; - String maSubject; - MailPriority mePriority; - - sal_Bool mbLoadDone; - - void ClearList( AddressList_Impl* pList ); - SaveResult SaveDocumentAsFormat( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const rtl::OUString& rType, rtl::OUString& rFileNamePath ); - - DECL_LINK( DoneHdl, void* ); - -public: - enum SendMailResult - { - SEND_MAIL_OK, - SEND_MAIL_CANCELLED, - SEND_MAIL_ERROR - }; - - SfxMailModel_Impl(); - ~SfxMailModel_Impl(); - - void AddAddress( const String& rAddress, AddressRole eRole ); - void SetFromAddress( const String& rAddress ) { maFromAddress = rAddress; } - void SetSubject( const String& rSubject ) { maSubject = rSubject; } - void SetPriority( MailPriority ePrio ) { mePriority = ePrio; } - - SendMailResult Send( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const rtl::OUString& rType ); -}; - -sal_Bool CreateFromAddress_Impl( String& rFrom ); - -#endif // INCLUDED_SFX_MAILMODEL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/nfltdlg.hxx b/sfx2/source/inc/nfltdlg.hxx index 2a1e6b421bdd..72a8057e0d1d 100644 --- a/sfx2/source/inc/nfltdlg.hxx +++ b/sfx2/source/inc/nfltdlg.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFXNFLTDLG_HXX #define _SFXNFLTDLG_HXX diff --git a/sfx2/source/inc/nochaos.hxx b/sfx2/source/inc/nochaos.hxx index 473980578742..867397106e6c 100644 --- a/sfx2/source/inc/nochaos.hxx +++ b/sfx2/source/inc/nochaos.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_NOCHAOS_HXX #define _SFX_NOCHAOS_HXX diff --git a/sfx2/source/inc/openflag.hxx b/sfx2/source/inc/openflag.hxx index 7d9d881dc709..aca735aa4fb2 100644 --- a/sfx2/source/inc/openflag.hxx +++ b/sfx2/source/inc/openflag.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_OPENFLAG_HXX #define _SFX_OPENFLAG_HXX diff --git a/sfx2/source/inc/ownsubfilterservice.hxx b/sfx2/source/inc/ownsubfilterservice.hxx index 51bdaf23d35a..fb02505f1d86 100644 --- a/sfx2/source/inc/ownsubfilterservice.hxx +++ b/sfx2/source/inc/ownsubfilterservice.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _OWNSUBFILTERSERVICE_HXX_ #define _OWNSUBFILTERSERVICE_HXX_ diff --git a/sfx2/source/inc/plugin.hxx b/sfx2/source/inc/plugin.hxx index 852e32b80449..2846e0ca2c57 100644 --- a/sfx2/source/inc/plugin.hxx +++ b/sfx2/source/inc/plugin.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_PLUGIN_HXX #define _SFX_PLUGIN_HXX diff --git a/sfx2/source/inc/recfloat.hxx b/sfx2/source/inc/recfloat.hxx index c9458310e464..b1fe567b7d40 100644 --- a/sfx2/source/inc/recfloat.hxx +++ b/sfx2/source/inc/recfloat.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _RECFLOAT_HXX #define _RECFLOAT_HXX diff --git a/sfx2/source/inc/referers.hxx b/sfx2/source/inc/referers.hxx index cf58771396d1..5789587da96d 100644 --- a/sfx2/source/inc/referers.hxx +++ b/sfx2/source/inc/referers.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_REFERERS_HXX #define _SFX_REFERERS_HXX diff --git a/sfx2/source/inc/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc index f2afb54b161c..2a3cbcb631ab 100644 --- a/sfx2/source/inc/sfxlocal.hrc +++ b/sfx2/source/inc/sfxlocal.hrc @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ // local resources @@ -49,8 +40,6 @@ #define SFX_CB_PROPERTY_NAME (RID_SFX_SFXLOCAL_START + 0) #define SFX_ED_PROPERTY_VALUE (RID_SFX_SFXLOCAL_START + 1) -#define SFX_RB_PROPERTY_YES (RID_SFX_SFXLOCAL_START + 2) -#define SFX_RB_PROPERTY_NO (RID_SFX_SFXLOCAL_START + 3) #define SFX_LB_PROPERTY_TYPE (RID_SFX_SFXLOCAL_START + 4) #define SFX_PB_PROPERTY_REMOVE (RID_SFX_SFXLOCAL_START + 5) #define SFX_WIN_PROPERTY_YESNO (RID_SFX_SFXLOCAL_START + 6) diff --git a/sfx2/source/inc/sfxtypes.hxx b/sfx2/source/inc/sfxtypes.hxx index c075f2ab8083..4dd20fead15b 100644 --- a/sfx2/source/inc/sfxtypes.hxx +++ b/sfx2/source/inc/sfxtypes.hxx @@ -95,8 +95,6 @@ struct _Capper #define DBG_OUTF(x) #endif -#define TRIM(s) s.EraseLeadingChars().EraseTrailingChars() - //------------------------------------------------------------------------ #if defined(DBG_UTIL) && defined(WNT) @@ -145,18 +143,11 @@ struct StringList_Impl : private Resource : Resource( rErrIdP ),aResId(nId, *rErrIdP.GetResMgr()){} ~StringList_Impl() { FreeResource(); } - String GetString(){ return String( aResId ); } + String GetString(){ return aResId.toString(); } operator sal_Bool(){return IsAvailableRes(aResId.SetRT(RSC_STRING));} }; -#define SFX_DEL_PTRARR(pArr) \ - { \ - for ( sal_uInt16 n = (pArr)->Count(); n--; ) \ - delete (pArr)->GetObject(n); \ - DELETEX(pArr); \ - } - class SfxBoolResetter { sal_Bool& _rVar; diff --git a/sfx2/source/inc/sfxurlrelocator.hxx b/sfx2/source/inc/sfxurlrelocator.hxx index 83ade822a9cb..031ca663bb7b 100644 --- a/sfx2/source/inc/sfxurlrelocator.hxx +++ b/sfx2/source/inc/sfxurlrelocator.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_SFXURLRELOCATOR_HXX_ #define _SFX_SFXURLRELOCATOR_HXX_ diff --git a/sfx2/source/inc/slotserv.hxx b/sfx2/source/inc/slotserv.hxx index 79431630aa9a..1688ced5ec88 100644 --- a/sfx2/source/inc/slotserv.hxx +++ b/sfx2/source/inc/slotserv.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFXSLOTSERV_HXX #define _SFXSLOTSERV_HXX diff --git a/sfx2/source/inc/splitwin.hxx b/sfx2/source/inc/splitwin.hxx index 00794ae944d8..b303b2b7cf4e 100644 --- a/sfx2/source/inc/splitwin.hxx +++ b/sfx2/source/inc/splitwin.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFXSPLITWIN_HXX #define _SFXSPLITWIN_HXX diff --git a/sfx2/source/inc/tplcitem.hxx b/sfx2/source/inc/tplcitem.hxx index ee02d409ffc0..f7c30e0800e4 100644 --- a/sfx2/source/inc/tplcitem.hxx +++ b/sfx2/source/inc/tplcitem.hxx @@ -1,30 +1,21 @@ /* -*- 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. - * - ************************************************************************/ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _TPLCITEM_HXX #define _TPLCITEM_HXX diff --git a/sfx2/source/inc/tplcomp.hxx b/sfx2/source/inc/tplcomp.hxx deleted file mode 100644 index ba090e87cb67..000000000000 --- a/sfx2/source/inc/tplcomp.hxx +++ /dev/null @@ -1,217 +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 _TPLCOMP_HXX -#define _TPLCOMP_HXX - -#include <osl/mutex.hxx> -#include <com/sun/star/chaos/XCommandExecutor.hpp> -#include <com/sun/star/chaos/XStatusCallback.hpp> -#include <com/sun/star/chaos/UnknownCommandException.hpp> -#include <com/sun/star/chaos/StatusCallbackEvent.hpp> -#include <com/sun/star/chaos/XURLContent.hpp> -#include <com/sun/star/chaos/XExplorerExchange.hpp> -#include <com/sun/star/beans/PropertyValues.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/beans/PropertyState.hpp> -#include <com/sun/star/beans/XPropertySetInfo.hpp> -#include <com/sun/star/beans/XMultiPropertySet.hpp> -#include <com/sun/star/beans/XFastPropertySet.hpp> -#include <com/sun/star/beans/XVetoableChangeListener.hpp> -#include <com/sun/star/beans/XPropertyState.hpp> -#include <com/sun/star/beans/XPropertyStateChangeListener.hpp> -#include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/beans/XPropertiesChangeListener.hpp> -#include <com/sun/star/beans/XPropertyChangeListener.hpp> -#include <com/sun/star/beans/XPropertyAccess.hpp> -#include <com/sun/star/beans/XPropertyContainer.hpp> -#include <com/sun/star/beans/PropertyStateChangeEvent.hpp> -#include <com/sun/star/beans/PropertyChangeEvent.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <cppuhelper/weak.hxx> -#include <cppuhelper/interfacecontainer.hxx> - -class CntAnchor; - -class TplAnchorListener; - -// ----------------- -// - TplComponent - -// ----------------- - -class TplComponent : public ::com::sun::star::chaos::XURLContent, public ::com::sun::star::chaos::XCommandExecutor, - public ::com::sun::star::beans::XPropertySet, public ::com::sun::star::chaos::XExplorerExchange, - public ::cppu::OWeakObject, public ::com::sun::star::lang::XServiceInfo -{ -private: - - void HandleNewEvt( const ::rtl::OUString& rCommand, - const ::com::sun::star::uno::Any& rAny ); - void CreatePopupMenu( ::com::sun::star::uno::Any& rAny ) const; - -protected: - - ::rtl::OUString maURL; - ::rtl::OUString maName; - ::osl::Mutex aMutex; - ::cppu::OInterfaceContainerHelper maListeners; - TplAnchorListener* mpListener; - short mnOpenMode; - -public: - - SFX_DECL_XINTERFACE_XTYPEPROVIDER_XSERVICEINFO - - TplComponent(); - ~TplComponent(); - - // interface ::com::sun::star::ucb::XContent - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent() throw ( ::com::sun::star::uno::RuntimeException ) - { ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > aRef; return aRef; } - virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & Parent ) throw ( ::com::sun::star::uno::RuntimeException ) - {} - - // interface ::com::sun::star::chaos::XURLContent - virtual ::rtl::OUString SAL_CALL getURL() throw ( ::com::sun::star::uno::RuntimeException ) - { return maURL; } - virtual sal_Bool SAL_CALL initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XURLContent > & aParent, const ::rtl::OUString& aURL ) throw ( ::com::sun::star::uno::RuntimeException ); - - // interface ::com::sun::star::chaos::XCommandExecutor - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL queryCommands() throw ( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL cancel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rCommandId ) throw ( ::com::sun::star::uno::RuntimeException ) - {} - virtual void SAL_CALL execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Any& rArgs, - const ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XStatusCallback > & rCallback ) throw ( ::com::sun::star::uno::RuntimeException ); - - // interface ::com::sun::star::beans::XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw ( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& aPropertyName ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & aListener ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & aListener ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& aPropertyName, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& aPropertyName, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener ) throw ( ::com::sun::star::uno::RuntimeException ); - // interface ::com::sun::star::chaos::XExplorerExchange - virtual ::com::sun::star::uno::Any SAL_CALL createDataObject( sal_uInt16& nSourceOptions ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual sal_uInt16 SAL_CALL insertDataObject( const ::com::sun::star::uno::Any& pSotDataObjectPtr, - sal_uInt16 nUserAction, - sal_uInt16 nSourceOptions ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL queryInsertDataObject( const ::com::sun::star::uno::Any& pSotDataObjectPtr, - sal_uInt16 nUserAction, - sal_uInt16 nSourceOptions, - sal_uInt16& nResultingAction, - sal_uInt16& nDefaultAction ) throw ( ::com::sun::star::uno::RuntimeException ); - - - // ------------------------------------------------------------- - - void CreateNewChild( CntAnchor* pAnchor, - const String& rTitle ); - void RemoveChild( CntAnchor* pAnchor ); - void StopListening( CntAnchor* pAnchor ); - void HandleOpenEvt(); -}; - -// ------------------------ -// - TplContentsComponent - -// ------------------------ - -class TplContentsListener; - -class TplContentsComponent : public TplComponent -{ -private: - ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XURLContent > _xParent; - TplContentsListener* _pListener; - SvDataObjectRef _xObject; - sal_uInt16 _nLayout; - - void HandleOpenEvt( const ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XStatusCallback > & rJob, - const ::com::sun::star::chaos::StatusCallbackEvent& rEvt ); - void HandleNewEvt( const ::rtl::OUString& rCommand, - const ::com::sun::star::uno::Any& rAny ); - void HandleInitEvt(); - - void CreateFileName( String& rName, - String& rDirURL ); - void CreateNewTpl( const String& rFilter, - const String& rParentDir, - const String& rFileName, - const String& rDocName ); -protected: - - void CreatePopupMenu( ::com::sun::star::uno::Any& rAny ) const; - -public: - - SFX_DECL_XINTERFACE_XTYPEPROVIDER_XSERVICEINFO - - TplContentsComponent(); - ~TplContentsComponent(); - - virtual sal_Bool SAL_CALL initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XURLContent > & aParent, const ::rtl::OUString& aURL ) throw ( ::com::sun::star::uno::RuntimeException ); - - - // interface ::com::sun::star::chaos::XCommandExecutor - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL queryCommands() throw ( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Any& rArgs, - const ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XStatusCallback > & rCallback ) throw ( ::com::sun::star::uno::RuntimeException ); - - // interface ::com::sun::star::beans::XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw ( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& aPropertyName ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw ( ::com::sun::star::uno::RuntimeException ); - - // interface ::com::sun::star::chaos::XExplorerExchange - virtual ::com::sun::star::uno::Any SAL_CALL createDataObject( sal_uInt16& nSourceOptions ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual sal_uInt16 SAL_CALL insertDataObject( const ::com::sun::star::uno::Any& pSotDataObjectPtr, - sal_uInt16 nUserAction, - sal_uInt16 nSourceOptions ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL queryInsertDataObject( const ::com::sun::star::uno::Any& pSotDataObjectPtr, - sal_uInt16 nUserAction, - sal_uInt16 nSourceOptions, - sal_uInt16& nResultingAction, - sal_uInt16& nDefaultAction ) throw ( ::com::sun::star::uno::RuntimeException ); - - // ------------------------------------------------------------- - - void CreateNewChild( CntAnchor* pAnchor ); - void HandleDeleteEvt(); - void SetURL( const ::rtl::OUString& rURL); - void SetName( const ::rtl::OUString& rNewName ); -}; - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx index f4dd3c5d45f2..cf159a6dbceb 100644 --- a/sfx2/source/inc/workwin.hxx +++ b/sfx2/source/inc/workwin.hxx @@ -97,7 +97,6 @@ struct SfxStatBar_Impl #define CHILD_NOT_HIDDEN 2 // not disabled through HideChildWindow #define CHILD_FITS_IN 4 // not too large for output size of the parent #define CHILD_VISIBLE (CHILD_NOT_HIDDEN | CHILD_ACTIVE | CHILD_FITS_IN) -#define CHILD_ISVISIBLE (CHILD_NOT_HIDDEN | CHILD_ACTIVE) struct SfxChild_Impl { diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index b7a68ec1b434..e1671d51ff8e 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -75,7 +75,7 @@ SfxURLToolBoxControl_Impl::SfxURLToolBoxControl_Impl( sal_uInt16 nSlotId, sal_uI : SfxToolBoxControl( nSlotId, nId, rBox ), pAccExec( 0 ) { - addStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CurrentURL" ))); + addStatusListener( rtl::OUString( ".uno:CurrentURL" )); } SfxURLToolBoxControl_Impl::~SfxURLToolBoxControl_Impl() @@ -112,7 +112,7 @@ void SfxURLToolBoxControl_Impl::OpenURL( const String& rName, sal_Bool /*bNew*/ if ( xDispatchProvider.is() && m_xServiceManager.is() ) { URL aTargetURL; - ::rtl::OUString aTarget( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_default"))); + ::rtl::OUString aTarget( ::rtl::OUString("_default")); aTargetURL.Complete = aName; @@ -121,17 +121,17 @@ void SfxURLToolBoxControl_Impl::OpenURL( const String& rName, sal_Bool /*bNew*/ if ( xDispatch.is() ) { Sequence< PropertyValue > aArgs( 2 ); - aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer")); - aArgs[0].Value = makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ))); - aArgs[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" )); + aArgs[0].Name = ::rtl::OUString("Referer"); + aArgs[0].Value = makeAny( ::rtl::OUString(SFX_REFERER_USER )); + aArgs[1].Name = ::rtl::OUString( "FileName" ); aArgs[1].Value = makeAny( ::rtl::OUString( aName )); if ( aFilter.Len() ) { aArgs.realloc( 4 ); - aArgs[2].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterOptions")); + aArgs[2].Name = ::rtl::OUString("FilterOptions"); aArgs[2].Value = makeAny( ::rtl::OUString( aOptions )); - aArgs[3].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); + aArgs[3].Name = ::rtl::OUString("FilterName"); aArgs[3].Value = makeAny( ::rtl::OUString( aFilter )); } @@ -192,7 +192,7 @@ IMPL_LINK_NOARG(SfxURLToolBoxControl_Impl, OpenHdl) if ( m_xServiceManager.is() ) { Reference< XFramesSupplier > xDesktop( m_xServiceManager->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), + ::rtl::OUString("com.sun.star.frame.Desktop")), UNO_QUERY ); Reference< XFrame > xFrame( xDesktop->getActiveFrame(), UNO_QUERY ); if ( xFrame.is() ) diff --git a/sfx2/source/menu/menu.hrc b/sfx2/source/menu/menu.hrc index b437f797c26e..4bc4a8066b6e 100644 --- a/sfx2/source/menu/menu.hrc +++ b/sfx2/source/menu/menu.hrc @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _MNUCFG_HRC #define _MNUCFG_HRC @@ -32,10 +23,7 @@ // #defines ***************************************************************** -#define DLG_MENUCONFIG (RID_SFX_MENU_START+1) #define IBX_MNUCFG_ALREADY_INCLUDED (RID_SFX_MENU_START+2) -#define QBX_MNUCFG_UNDEFINED_FUNCTIONS (RID_SFX_MENU_START+3) -#define QBX_MNUCFG_POPUP_FUNCTIONS (RID_SFX_MENU_START+4) #define BTN_OK 1 #define BTN_CANCEL 2 @@ -49,15 +37,6 @@ #define BOX_ENTRIES 10 #define TXT_TEXT 11 #define EDT_TEXT 12 -#define TXT_FUNCTIONTEXT 13 -#define TXT_FUNCTIONINFO 14 -#define TXT_DESCRIPTIONTEXT 15 -#define TXT_DESCRIPTIONINFO 16 -#define GRP_MENU 17 -#define TXT_GROUP 18 -#define BOX_GROUP 19 -#define TXT_FUNCTION 20 -#define BOX_FUNCTION 21 #define GRP_FUNCTIONS 22 #define STR_MENU_CFGITEM RID_SFX_MENU_START+1 diff --git a/sfx2/source/menu/menu.src b/sfx2/source/menu/menu.src index 5e3d8296bb59..d7b9fb01e0a5 100644 --- a/sfx2/source/menu/menu.src +++ b/sfx2/source/menu/menu.src @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #include "menu.hrc" #include <sfx2/sfxcommands.h> @@ -89,10 +80,3 @@ String STR_MENU_THESAURUS }; // ******************************************************************* EOF - - - - - - - diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index 58d5de148c4a..18558297b860 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -220,14 +220,14 @@ void SfxMenuControl::StateChanged String aStr( ((const SfxStringItem*)pState)->GetValue() ); if ( aStr.CompareToAscii("($1)",4) == COMPARE_EQUAL ) { - String aEntry(SfxResId(STR_UPDATEDOC)); + String aEntry(SfxResId(STR_UPDATEDOC).toString()); aEntry += ' '; aEntry += aStr.Copy(4); aStr = aEntry; } else if ( aStr.CompareToAscii("($2)",4) == COMPARE_EQUAL ) { - String aEntry(SfxResId(STR_CLOSEDOC_ANDRETURN)); + String aEntry(SfxResId(STR_CLOSEDOC_ANDRETURN).toString()); aEntry += aStr.Copy(4); aStr = aEntry; } @@ -271,7 +271,7 @@ SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxB if ( pFactories ) { SfxMenuCtrlFactArr_Impl &rFactories = *pFactories; - for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory ) if ( rFactories[nFactory]->nTypeId == aSlotType && ( ( rFactories[nFactory]->nSlotId == 0 ) || ( rFactories[nFactory]->nSlotId == nId) ) ) @@ -281,7 +281,7 @@ SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxB SfxMenuCtrlFactArr_Impl &rFactories = pApp->GetMenuCtrlFactories_Impl(); - for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory ) if ( rFactories[nFactory]->nTypeId == aSlotType && ( ( rFactories[nFactory]->nSlotId == 0 ) || ( rFactories[nFactory]->nSlotId == nId) ) ) diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index b453f892fd5c..469cbb2f831c 100644 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -152,7 +152,7 @@ static Image lcl_GetImageFromPngUrl( const ::rtl::OUString &rFileUrl ) osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp ); Graphic aGraphic; - const String aFilterName( RTL_CONSTASCII_USTRINGPARAM( IMP_PNG ) ); + const String aFilterName( IMP_PNG ); if( GRFILTER_OK == GraphicFilter::LoadGraphic( aTmp, aFilterName, aGraphic ) ) { aRes = Image( aGraphic.GetBitmapEx() ); @@ -208,7 +208,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) String aItemText( linguistic::GetThesaurusReplaceText( aSynonyms[i] ) ); pThesSubMenu->InsertItem( nId, aItemText ); - ::rtl::OUString aCmd(RTL_CONSTASCII_USTRINGPARAM(".uno:ThesaurusFromContext?WordReplace:string=") ); + ::rtl::OUString aCmd(".uno:ThesaurusFromContext?WordReplace:string=" ); aCmd += aItemText; pThesSubMenu->SetItemCommand( nId, aCmd ); @@ -218,16 +218,16 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) } else // nNumSynonyms == 0 { - const String aItemText( SfxResId( STR_MENU_NO_SYNONYM_FOUND ) ); + const rtl::OUString aItemText( SfxResId(STR_MENU_NO_SYNONYM_FOUND).toString() ); pThesSubMenu->InsertItem( 1, aItemText, MIB_NOSELECT ); } pThesSubMenu->InsertSeparator(); - const String sThesaurus( SfxResId( STR_MENU_THESAURUS ) ); + const rtl::OUString sThesaurus( SfxResId(STR_MENU_THESAURUS).toString() ); pThesSubMenu->InsertItem( 100, sThesaurus ); - pThesSubMenu->SetItemCommand( 100, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:ThesaurusDialog")) ); + pThesSubMenu->SetItemCommand( 100, ::rtl::OUString(".uno:ThesaurusDialog") ); pSVMenu->InsertSeparator(); - const String sSynonyms( SfxResId( STR_MENU_SYNONYMS ) ); + const rtl::OUString sSynonyms( SfxResId(STR_MENU_SYNONYMS).toString() ); pSVMenu->InsertItem( SID_THES, sSynonyms ); pSVMenu->SetPopupMenu( SID_THES, pThesSubMenu ); } @@ -248,7 +248,7 @@ IMPL_LINK( SfxMenuManager, Select, Menu *, pSelMenu ) if ( pSlot && pSlot->pUnoName ) { aCommand = DEFINE_CONST_UNICODE(".uno:"); - aCommand += String::CreateFromAscii( pSlot->GetUnoName() ); + aCommand += rtl::OUString::createFromAscii( pSlot->GetUnoName() ); } } diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx index 21d44dc8ced5..c5665c7a59f3 100644 --- a/sfx2/source/menu/thessubmenu.cxx +++ b/sfx2/source/menu/thessubmenu.cxx @@ -79,8 +79,7 @@ SfxThesSubMenuHelper::SfxThesSubMenuHelper() { uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); m_xLngMgr = uno::Reference< linguistic2::XLinguServiceManager >( xMSF->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.linguistic2.LinguServiceManager" ))), uno::UNO_QUERY_THROW ); + OUString( "com.sun.star.linguistic2.LinguServiceManager" )), uno::UNO_QUERY_THROW ); m_xThesarus = m_xLngMgr->getThesaurus(); } catch (const uno::Exception &) @@ -154,7 +153,7 @@ String SfxThesSubMenuHelper::GetThesImplName( const lang::Locale &rLocale ) cons if (m_xLngMgr.is()) { uno::Sequence< OUString > aServiceNames = m_xLngMgr->getConfiguredServices( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.Thesaurus")), rLocale ); + OUString("com.sun.star.linguistic2.Thesaurus"), rLocale ); // there should be at most one thesaurus configured for each language DBG_ASSERT( aServiceNames.getLength() <= 1, "more than one thesaurus found. Should not be possible" ); if (aServiceNames.getLength() == 1) diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index d7eb8516477b..c2c99b2acd50 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -68,8 +68,6 @@ using namespace ::com::sun::star::uno; DBG_NAME(SfxVirtualMenu) -typedef SfxMenuControl* SfxMenuControlPtr; - class SfxMenuImageControl_Impl : public SfxControllerItem { SfxVirtualMenu* pMenu; @@ -794,7 +792,7 @@ void SfxVirtualMenu::InsertAddOnsMenuItem( Menu* pMenu ) if ( pAddonMenu && pAddonMenu->GetItemCount() > 0 ) { sal_uInt16 nItemCount = pMenu->GetItemCount(); - String aAddonsTitle( SfxResId( STR_MENU_ADDONS )); + rtl::OUString aAddonsTitle(SfxResId(STR_MENU_ADDONS).toString()); if ( nItemCount > 0 && pMenu->GetItemType( nItemCount-1 ) != MENUITEM_SEPARATOR ) pMenu->InsertSeparator(); pMenu->InsertItem( SID_ADDONS, aAddonsTitle ); diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 645f3d3de7cd..9a4f534a9fdd 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -26,12 +26,11 @@ * ************************************************************************/ - -//-------------------------------------------------------------------------------------------------------- #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/util/URL.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <tools/urlobj.hxx> #include <svl/macitem.hxx> @@ -239,12 +238,7 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg SfxViewFrame::GetFirst( pDoc ) : SfxViewFrame::Current(); - ::com::sun::star::uno::Reference - < ::com::sun::star::util::XURLTransformer > xTrans( - ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.util.URLTransformer" )) ), - UNO_QUERY ); + ::com::sun::star::uno::Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::com::sun::star::util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); ::com::sun::star::util::URL aURL; aURL.Complete = aScript; @@ -264,8 +258,8 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg xProv = ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchProvider > ( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.frame.Desktop" )) ), + rtl::OUString( + "com.sun.star.frame.Desktop" ) ), UNO_QUERY ); } @@ -484,13 +478,13 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i } else if ( !aMacroName.isEmpty() ) { - aScript = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MACRO_PRFIX ) ); + aScript = rtl::OUString( MACRO_PRFIX ); if ( aLibrary.compareTo( SFX_APP()->GetName() ) != 0 && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StarDesktop")) && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application")) ) aScript += String('.'); aScript += String('/'); aScript += aMacroName; - aScript += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MACRO_POSTFIX ) ); + aScript += rtl::OUString( MACRO_POSTFIX ); } else // wrong properties @@ -499,9 +493,9 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i if (!aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("document"))) { if ( aLibrary.isEmpty() || (pDoc && ( String(aLibrary) == pDoc->GetTitle( SFX_TITLE_APINAME ) || String(aLibrary) == pDoc->GetTitle() )) ) - aLibrary = String::CreateFromAscii("document"); + aLibrary = rtl::OUString("document"); else - aLibrary = String::CreateFromAscii("application"); + aLibrary = rtl::OUString("application"); } o_normalizedDescriptor.put( PROP_SCRIPT, aScript ); @@ -549,7 +543,7 @@ css::uno::Any SAL_CALL ModelCollectionEnumeration::nextElement() ::osl::ResettableMutexGuard aLock(m_aLock); if (m_pEnumerationIt == m_lModels.end()) throw css::container::NoSuchElementException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("End of model enumeration reached.")), + ::rtl::OUString("End of model enumeration reached."), static_cast< css::container::XEnumeration* >(this)); css::uno::Reference< css::frame::XModel > xModel(*m_pEnumerationIt, UNO_QUERY); ++m_pEnumerationIt; @@ -575,7 +569,7 @@ SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const com::sun::star::uno::Reference pImp = new GlobalEventConfig(); m_xEvents = pImp; m_xJobExecutorListener = css::uno::Reference< css::document::XEventListener >( - xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.JobExecutor"))), + xSMGR->createInstance(::rtl::OUString("com.sun.star.task.JobExecutor")), UNO_QUERY); m_refCount--; } @@ -698,7 +692,7 @@ void SAL_CALL SfxGlobalEvents_Impl::insert( const css::uno::Any& aElement ) aElement >>= xDoc; if (!xDoc.is()) throw css::lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Cant locate at least the model parameter.")), + ::rtl::OUString("Cant locate at least the model parameter."), static_cast< css::container::XSet* >(this), 0); @@ -735,7 +729,7 @@ void SAL_CALL SfxGlobalEvents_Impl::remove( const css::uno::Any& aElement ) aElement >>= xDoc; if (!xDoc.is()) throw css::lang::IllegalArgumentException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Cant locate at least the model parameter.")), + ::rtl::OUString("Cant locate at least the model parameter."), static_cast< css::container::XSet* >(this), 0); diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index c74c66e0d209..874b99de9030 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -28,6 +28,7 @@ #include <svl/stritem.hxx> #include <com/sun/star/util/URL.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> @@ -86,8 +87,7 @@ svt::StatusbarController* SAL_CALL SfxStatusBarControllerFactory( util::URL aTargetURL; aTargetURL.Complete = aCommandURL; - uno::Reference < util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), uno::UNO_QUERY ); + uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aTargetURL ); SfxObjectShell* pObjShell = NULL; @@ -653,7 +653,7 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl if ( pFactories ) { SfxStbCtrlFactArr_Impl &rFactories = *pFactories; - for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory ) if ( rFactories[nFactory]->nTypeId == aSlotType && ( ( rFactories[nFactory]->nSlotId == 0 ) || ( rFactories[nFactory]->nSlotId == nSlotID) ) ) @@ -662,7 +662,7 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl } SfxStbCtrlFactArr_Impl &rFactories = pApp->GetStbCtrlFactories_Impl(); - for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory ) if ( rFactories[nFactory]->nTypeId == aSlotType && ( ( rFactories[nFactory]->nSlotId == 0 ) || ( rFactories[nFactory]->nSlotId == nSlotID) ) ) diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 25ef143b4c30..137d08015e72 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -36,6 +36,7 @@ #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/util/URL.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> @@ -143,7 +144,7 @@ svt::ToolboxController* SAL_CALL SfxToolBoxControllerFactory( const Reference< X URL aTargetURL; aTargetURL.Complete = aCommandURL; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); + Reference < XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aTargetURL ); if ( !aTargetURL.Arguments.isEmpty() ) return NULL; @@ -336,7 +337,7 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn { SfxTbxCtrlFactArr_Impl &rFactories = *pFactories; sal_uInt16 nFactory; - const sal_uInt16 nCount = rFactories.Count(); + const sal_uInt16 nCount = rFactories.size(); // search for a factory with the given slot id for( nFactory = 0; nFactory < nCount; ++nFactory ) @@ -363,7 +364,7 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn SfxTbxCtrlFactArr_Impl &rFactories = pApp->GetTbxCtrlFactories_Impl(); sal_uInt16 nFactory; - const sal_uInt16 nCount = rFactories.Count(); + const sal_uInt16 nCount = rFactories.size(); for( nFactory = 0; nFactory < nCount; ++nFactory ) if( (rFactories[nFactory]->nTypeId == aSlotType) && (rFactories[nFactory]->nSlotId == nSlotId) ) @@ -437,9 +438,7 @@ void SfxToolBoxControl::Dispatch( { ::com::sun::star::util::URL aTargetURL; aTargetURL.Complete = rCommand; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), - UNO_QUERY ); + Reference < XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aTargetURL ); Reference < XDispatch > xDispatch = rProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 ); @@ -708,7 +707,7 @@ throw (::com::sun::star::uno::RuntimeException) { try { - xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceURL" ))) >>= aSubToolBarResName; + xPropSet->getPropertyValue( ::rtl::OUString( "ResourceURL" )) >>= aSubToolBarResName; } catch ( com::sun::star::beans::UnknownPropertyException& ) { @@ -742,7 +741,7 @@ throw (::com::sun::star::uno::RuntimeException) Reference< ::com::sun::star::beans::XPropertySet > xProp( xUIElement, UNO_QUERY ); if ( xSubToolBar.is() && xProp.is() ) { - rtl::OUString aPersistentString( RTL_CONSTASCII_USTRINGPARAM( "Persistent" )); + rtl::OUString aPersistentString( "Persistent" ); try { Window* pTbxWindow = VCLUnoHelper::GetWindow( xSubToolBar ); @@ -758,7 +757,7 @@ throw (::com::sun::star::uno::RuntimeException) xLayoutManager->setElementPos( aSubToolBarResName, aEvent.FloatingPosition ); xLayoutManager->showElement( aSubToolBarResName ); - xProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Persistent" )), a ); + xProp->setPropertyValue( rtl::OUString( "Persistent" ), a ); } } catch ( ::com::sun::star::uno::RuntimeException& ) @@ -803,18 +802,17 @@ void SfxToolBoxControl::createAndPositionSubToolBar( const ::rtl::OUString& rSub { xUIEementFactory = Reference< XUIElementFactory >( xServiceManager->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.ui.UIElementFactoryManager" ))), + rtl::OUString( "com.sun.star.ui.UIElementFactoryManager" )), UNO_QUERY ); xWeakUIElementFactory = xUIEementFactory; } Sequence< PropertyValue > aPropSeq( 3 ); - aPropSeq[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" )); + aPropSeq[0].Name = rtl::OUString( "Frame" ); aPropSeq[0].Value <<= xFrame; - aPropSeq[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Persistent" )); + aPropSeq[1].Name = rtl::OUString( "Persistent" ); aPropSeq[1].Value <<= sal_False; - aPropSeq[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PopupMode" )); + aPropSeq[2].Name = rtl::OUString( "PopupMode" ); aPropSeq[2].Value <<= sal_True; try @@ -1551,7 +1549,7 @@ void SfxAppToolBoxControl_Impl::SetImage( const String &rURL ) if ( bBig && aImage.GetSizePixel() != aBigSize ) { BitmapEx aScaleBmpEx( aImage.GetBitmapEx() ); - aScaleBmpEx.Scale( aBigSize, BMP_SCALE_INTERPOLATE ); + aScaleBmpEx.Scale( aBigSize, BMP_SCALE_BEST ); GetToolBox().SetItemImage( GetId(), Image( aScaleBmpEx ) ); } else @@ -1604,7 +1602,7 @@ void SfxAppToolBoxControl_Impl::Select( sal_Bool bMod1 ) aTargetURL.Complete = aLastURL; getURLTransformer()->parseStrict( aTargetURL ); - ::rtl::OUString aTarget( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_default"))); + ::rtl::OUString aTarget( ::rtl::OUString("_default")); if ( pMenu ) { ::framework::MenuConfiguration::Attributes* pMenuAttributes = @@ -1620,8 +1618,8 @@ void SfxAppToolBoxControl_Impl::Select( sal_Bool bMod1 ) { Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer")); - aArgs[0].Value = makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER )) ); + aArgs[0].Name = ::rtl::OUString("Referer"); + aArgs[0].Value = makeAny( ::rtl::OUString(SFX_REFERER_USER ) ); ExecuteInfo* pExecuteInfo = new ExecuteInfo; pExecuteInfo->xDispatch = xDispatch; @@ -1651,9 +1649,7 @@ long Select_Impl( void* /*pHdl*/, void* pVoid ) URL aTargetURL; aTargetURL.Complete = aURL; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), - UNO_QUERY ); + Reference < XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aTargetURL ); Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); @@ -1664,7 +1660,7 @@ long Select_Impl( void* /*pHdl*/, void* pVoid ) xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(), 0 ); else { - ::rtl::OUString aTargetFrame( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")) ); + ::rtl::OUString aTargetFrame( ::rtl::OUString("_blank") ); ::framework::MenuConfiguration::Attributes* pMenuAttributes = (::framework::MenuConfiguration::Attributes*)pMenu->GetUserValue( pMenu->GetCurItemId() ); diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 9edb55017af3..0591cdf32307 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -100,7 +100,7 @@ void SfxFrame::Construct_Impl() pImp = new SfxFrame_Impl( this ); if ( !pFramesArr_Impl ) pFramesArr_Impl = new SfxFrameArr_Impl; - pFramesArr_Impl->Insert( this, pFramesArr_Impl->Count() ); + pFramesArr_Impl->push_back( this ); } //-------------------------------------------------------------------- @@ -110,7 +110,9 @@ SfxFrame::~SfxFrame() RemoveTopFrame_Impl( this ); DELETEZ( pWindow ); - pFramesArr_Impl->Remove( pFramesArr_Impl->GetPos( this ) ); + SfxFrameArr_Impl::iterator it = std::find( pFramesArr_Impl->begin(), pFramesArr_Impl->end(), this ); + if ( it != pFramesArr_Impl->end() ) + pFramesArr_Impl->erase( it ); if ( pParentFrame ) { @@ -122,7 +124,7 @@ SfxFrame::~SfxFrame() if ( pChildArr ) { - DBG_ASSERT( !pChildArr->Count(), "Children are not removed!" ); + DBG_ASSERT( pChildArr->empty(), "Children are not removed!" ); delete pChildArr; } @@ -195,7 +197,7 @@ sal_Bool SfxFrame::DocIsModified_Impl() pImp->pCurrentViewFrame->GetObjectShell()->IsModified() ) return sal_True; for( sal_uInt16 nPos = GetChildFrameCount(); nPos--; ) - if( pChildArr->GetObject( nPos )->DocIsModified_Impl() ) + if( (*pChildArr)[ nPos ]->DocIsModified_Impl() ) return sal_True; return sal_False; } @@ -235,7 +237,7 @@ sal_uInt16 SfxFrame::PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing ) { // if this frame has child frames, ask them too for( sal_uInt16 nPos = GetChildFrameCount(); nRet == RET_OK && nPos--; ) - nRet = pChildArr->GetObject( nPos )->PrepareClose_Impl( bUI, bForBrowsing ); + nRet = (*pChildArr)[ nPos ]->PrepareClose_Impl( bUI, bForBrowsing ); } pImp->bPrepClosing = sal_False; @@ -252,9 +254,9 @@ sal_uInt16 SfxFrame::PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing ) SfxFrame* SfxFrame::GetChildFrame( sal_uInt16 nPos ) const { - if ( pChildArr && pChildArr->Count() > nPos ) + if ( pChildArr && pChildArr->size() > nPos ) { - DBG_ASSERT( nPos < pChildArr->Count(), "Wrong Index!"); + DBG_ASSERT( nPos < pChildArr->size(), "Wrong Index!"); return (*pChildArr)[nPos]; } @@ -264,8 +266,9 @@ SfxFrame* SfxFrame::GetChildFrame( sal_uInt16 nPos ) const void SfxFrame::RemoveChildFrame_Impl( SfxFrame* pFrame ) { DBG_ASSERT( pChildArr, "Unknown Frame!"); - sal_uInt16 nPos = pChildArr->GetPos(pFrame); - pChildArr->Remove( nPos ); + SfxFrameArr_Impl::iterator it = std::find( pChildArr->begin(), pChildArr->end(), pFrame ); + if ( it != pChildArr->end() ) + pChildArr->erase( it ); }; SfxFrame& SfxFrame::GetTopFrame() const @@ -288,7 +291,7 @@ void SfxFrame::SetIsClosing_Impl() sal_uInt16 SfxFrame::GetChildFrameCount() const { - return pChildArr ? pChildArr->Count() : 0; + return pChildArr ? pChildArr->size() : 0; } void SfxFrame::CancelTransfers( sal_Bool /*bCancelLoadEnv*/ ) @@ -384,7 +387,7 @@ void SfxFrame::GetViewData_Impl() if ( pChildArr ) { // For Framesets also the data from the ChildViews hace to be processed - sal_uInt16 nCount = pChildArr->Count(); + sal_uInt16 nCount = pChildArr->size(); for ( sal_uInt16 n=nCount; n>0; n--) { SfxFrame* pFrame = (*pChildArr)[n-1]; @@ -484,7 +487,7 @@ void SfxFrame::GetTargetList( TargetList& rList ) const SfxViewFrame* pView = GetCurrentViewFrame(); if( pView && pView->GetViewShell() && pChildArr ) { - sal_uInt16 nCount = pChildArr->Count(); + sal_uInt16 nCount = pChildArr->size(); for ( sal_uInt16 n=0; n<nCount; n++) { SfxFrame* pFrame = (*pChildArr)[n]; @@ -511,13 +514,15 @@ sal_Bool SfxFrame::IsParent( SfxFrame *pFrame ) const void SfxFrame::InsertTopFrame_Impl( SfxFrame* pFrame ) { SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames; - rArr.Insert( pFrame, rArr.Count() ); + rArr.push_back( pFrame ); } void SfxFrame::RemoveTopFrame_Impl( SfxFrame* pFrame ) { SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames; - rArr.Remove( rArr.GetPos( pFrame ) ); + SfxFrameArr_Impl::iterator it = std::find( rArr.begin(), rArr.end(), pFrame ); + if ( it != rArr.end() ) + rArr.erase( it ); } SfxFrameItem::SfxFrameItem( sal_uInt16 nWhichId, SfxViewFrame *p ) @@ -686,9 +691,9 @@ SfxFrame* SfxFrameIterator::NextSibling_Impl( SfxFrame& rPrev ) if ( &rPrev != pFrame ) { SfxFrameArr_Impl& rArr = *rPrev.pParentFrame->pChildArr; - sal_uInt16 nPos = rArr.GetPos( &rPrev ); - if ( nPos+1 < rArr.Count() ) - pRet = rArr[nPos+1]; + SfxFrameArr_Impl::iterator it = std::find( rArr.begin(), rArr.end(), &rPrev ); + if ( it != rArr.end() && (++it) != rArr.end() ) + pRet = *it; if ( !pRet && rPrev.pParentFrame->pParentFrame ) pRet = NextSibling_Impl( *rPrev.pParentFrame ); @@ -928,14 +933,14 @@ SfxFrame* SfxFrame::GetFirst() { if ( !pFramesArr_Impl ) return 0; - return pFramesArr_Impl->Count() ? pFramesArr_Impl->GetObject(0) : 0; + return pFramesArr_Impl->empty() ? 0 : pFramesArr_Impl->front(); } SfxFrame* SfxFrame::GetNext( SfxFrame& rFrame ) { - sal_uInt16 nPos = pFramesArr_Impl->GetPos( &rFrame ); - if ( nPos+1 < pFramesArr_Impl->Count() ) - return pFramesArr_Impl->GetObject(nPos+1); + SfxFrameArr_Impl::iterator it = std::find( pFramesArr_Impl->begin(), pFramesArr_Impl->end(), &rFrame ); + if ( it != pFramesArr_Impl->end() && (++it) != pFramesArr_Impl->end() ) + return *it; else return NULL; } diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index c8f7f271868f..7aeab2f8b4cd 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -46,7 +46,6 @@ #include "sfx2/viewsh.hxx" #include "sfx2/viewfac.hxx" -/** === begin UNO includes === **/ #include <com/sun/star/container/XContainerQuery.hpp> #include <com/sun/star/document/XTypeDetection.hpp> #include <com/sun/star/frame/XFrame.hpp> @@ -55,7 +54,6 @@ #include <com/sun/star/task/XInteractionHandler2.hpp> #include <com/sun/star/document/XViewDataSupplier.hpp> #include <com/sun/star/container/XIndexAccess.hpp> -/** === end UNO includes === **/ #include <comphelper/interaction.hxx> #include <comphelper/namedvaluecollection.hxx> @@ -438,7 +436,7 @@ void SfxFrameLoader_Impl::impl_removeLoaderArguments( ::comphelper::NamedValueCo }; ::comphelper::NamedValueCollection aViewArgs; - for ( size_t i=0; i < SAL_N_ELEMENTS( pKnownViewArgs ); ++i ) + for ( size_t i=0; i < sizeof( pKnownViewArgs ) / sizeof( pKnownViewArgs[0] ); ++i ) { if ( io_rDescriptor.has( pKnownViewArgs[i] ) ) { @@ -695,14 +693,14 @@ UNOSEQUENCE< rtl::OUString > SfxFrameLoader_Impl::impl_getStaticSupportedService { UNOMUTEXGUARD aGuard( UNOMUTEX::getGlobalMutex() ); UNOSEQUENCE< rtl::OUString > seqServiceNames( 1 ); - seqServiceNames.getArray() [0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.SynchronousFrameLoader" )); + seqServiceNames.getArray() [0] = ::rtl::OUString( "com.sun.star.frame.SynchronousFrameLoader" ); return seqServiceNames ; } /* Helper for XServiceInfo */ rtl::OUString SfxFrameLoader_Impl::impl_getStaticImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.office.FrameLoader" )); + return ::rtl::OUString( "com.sun.star.comp.office.FrameLoader" ); } /* Helper for registry */ diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx index b49f9dd777a4..32eefc6fa810 100644 --- a/sfx2/source/view/impframe.hxx +++ b/sfx2/source/view/impframe.hxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_IMPFRAME_HXX #define _SFX_IMPFRAME_HXX @@ -43,13 +34,6 @@ class SfxObjectShell; #include <sfx2/viewsh.hxx> #include <sfx2/sfxuno.hxx> -#ifndef FRAME_SEARCH_PARENT -#define FRAME_SEARCH_PARENT 0x00000001 -#define FRAME_SEARCH_SELF 0x00000002 -#define FRAME_SEARCH_CHILDREN 0x00000004 -#define FRAME_SEARCH_CREATE 0x00000008 -#endif - class SfxFrame_Impl : public SfxBroadcaster, public SvCompatWeakBase { public: diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx index 16fe88a346fd..9308894575e7 100644 --- a/sfx2/source/view/impviewframe.hxx +++ b/sfx2/source/view/impviewframe.hxx @@ -87,6 +87,7 @@ public: bActive( sal_False ), pFrame( p ) { + SetBorderStyle( WINDOW_BORDER_TOPBOTTOM ); p->GetFrame().GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER ); } diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index ec198973c59a..3bdae69e426f 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -255,15 +255,13 @@ void SAL_CALL SfxInPlaceClient_Impl::saveObject() // set non-reschedule progress to prevent problems when asynchronous calls are made // during storing of the embedded object uno::Reference< lang::XInitialization > xInit( - xSrvMgr->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.framework.StatusIndicatorFactory" ))), - uno::UNO_QUERY_THROW ); + xSrvMgr->createInstance( "com.sun.star.comp.framework.StatusIndicatorFactory" ), uno::UNO_QUERY_THROW ); beans::PropertyValue aProperty; uno::Sequence< uno::Any > aArgs( 2 ); - aProperty.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableReschedule" )); + aProperty.Name = "DisableReschedule"; aProperty.Value = uno::makeAny( sal_True ); aArgs[0] = uno::makeAny( aProperty ); - aProperty.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" )); + aProperty.Name = "Frame"; aProperty.Value = uno::makeAny( xFrame ); aArgs[1] = uno::makeAny( aProperty ); @@ -276,7 +274,7 @@ void SAL_CALL SfxInPlaceClient_Impl::saveObject() { uno::Reference< task::XStatusIndicatorFactory > xStatusIndicatorFactory( xInit, uno::UNO_QUERY_THROW ); xStatusIndicator = xStatusIndicatorFactory->createStatusIndicator(); - xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IndicatorInterception" )), uno::makeAny( xStatusIndicator )); + xPropSet->setPropertyValue( "IndicatorInterception" , uno::makeAny( xStatusIndicator )); } catch ( const uno::RuntimeException& ) { @@ -305,7 +303,7 @@ void SAL_CALL SfxInPlaceClient_Impl::saveObject() if ( xPropSet.is() ) { xStatusIndicator.clear(); - xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IndicatorInterception" )), uno::makeAny( xStatusIndicator )); + xPropSet->setPropertyValue( "IndicatorInterception" , uno::makeAny( xStatusIndicator )); } } catch ( const uno::RuntimeException& ) @@ -420,7 +418,7 @@ uno::Reference< ::com::sun::star::frame::XLayoutManager > SAL_CALL SfxInPlaceCli uno::Reference< ::com::sun::star::frame::XLayoutManager > xMan; try { - uno::Any aAny = xFrame->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ); + uno::Any aAny = xFrame->getPropertyValue( "LayoutManager" ); aAny >>= xMan; } catch ( uno::Exception& ) @@ -917,14 +915,14 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) uno::Reference< lang::XMultiServiceFactory > xEmptyFactory; SfxStoringHelper aHelper( xEmptyFactory ); uno::Sequence< beans::PropertyValue > aDispatchArgs( 1 ); - aDispatchArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SaveTo" ) ); + aDispatchArgs[0].Name = "SaveTo"; aDispatchArgs[0].Value <<= (sal_Bool)sal_True; aHelper.GUIStoreModel( xEmbModel, - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SaveAs" ) ), + "SaveAs", aDispatchArgs, sal_False, - ::rtl::OUString() ); + "" ); } catch( const task::ErrorCodeIOException& aErrorEx ) { diff --git a/sfx2/source/view/orgmgr.cxx b/sfx2/source/view/orgmgr.cxx index ab1d2248256d..71507cf36ac4 100644 --- a/sfx2/source/view/orgmgr.cxx +++ b/sfx2/source/view/orgmgr.cxx @@ -751,7 +751,7 @@ void SfxOrganizeMgr::SaveAll(Window *pParent) { if(!pTemplates->DeleteObjectShell(i, j)) { - String aText = String(SfxResId(STR_ERROR_SAVE_TEMPLATE)); + String aText = SfxResId(STR_ERROR_SAVE_TEMPLATE).toString(); aText += pTemplates->GetName(i, j); ErrorBox aBox(pParent, WinBits(WB_OK_CANCEL | WB_DEF_CANCEL), @@ -768,7 +768,7 @@ void SfxOrganizeMgr::SaveAll(Window *pParent) _FileListEntry *pEntry = (*pImpl->pDocList)[i]; if(!pEntry->DeleteObjectShell()) { - String aText(SfxResId(STR_ERROR_SAVE_TEMPLATE)); + String aText(SfxResId(STR_ERROR_SAVE_TEMPLATE).toString()); aText += pEntry->aBaseName; ErrorBox aBox(pParent, WinBits(WB_OK_CANCEL | WB_DEF_CANCEL), aText); if(RET_CANCEL == aBox.Execute()) diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 810b25071ae1..77eb34cd0672 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -222,7 +222,7 @@ SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent, pPage ( NULL ) { - SetText( SfxResId( STR_PRINT_OPTIONS_TITLE ) ); + SetText( SfxResId(STR_PRINT_OPTIONS_TITLE).toString() ); // Insert TabPage pPage = pViewSh->CreatePrintOptionsPage( this, *pOptions ); diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index d1bab1090826..9848c94cafb2 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -93,20 +93,14 @@ #define OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper #define OINTERFACECONTAINERHELPER ::cppu::OInterfaceContainerHelper -#define XFRAMEACTIONLISTENER ::com::sun::star::frame::XFrameActionListener #define XCLOSELISTENER ::com::sun::star::util::XCloseListener #define FRAMEACTIONEVENT ::com::sun::star::frame::FrameActionEvent #define EVENTOBJECT ::com::sun::star::lang::EventObject #define OTYPECOLLECTION ::cppu::OTypeCollection #define OIMPLEMENTATIONID ::cppu::OImplementationId -#define MUTEXGUARD ::osl::MutexGuard -#define UNOQUERY ::com::sun::star::uno::UNO_QUERY -#define MAPPING ::com::sun::star::uno::Mapping -#define XSTATUSINDICATORSUPPLIER ::com::sun::star::task::XStatusIndicatorSupplier #define XCOMPONENT ::com::sun::star::lang::XComponent #define XINTERFACE ::com::sun::star::uno::XInterface #define XKEYHANDLER ::com::sun::star::awt::XKeyHandler -#define XMOUSECLICKHANDLER ::com::sun::star::awt::XMouseClickHandler #define TIMEOUT_START_RESCHEDULE 10L /* 10th s */ @@ -412,7 +406,7 @@ void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::queryClosing( const EV pShell->TakeFrameOwnerShip_Impl(); } - throw com::sun::star::util::CloseVetoException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Controller disagree ...")),static_cast< ::cppu::OWeakObject*>(this)); + throw com::sun::star::util::CloseVetoException(::rtl::OUString("Controller disagree ..."),static_cast< ::cppu::OWeakObject*>(this)); } } } @@ -1217,7 +1211,7 @@ throw (::com::sun::star::uno::RuntimeException) SfxViewFrame* pViewFrame( m_pData->m_pViewShell->GetFrame() ); SfxSlotPool* pPool( &SfxSlotPool::GetSlotPool( pViewFrame )); - rtl::OUString aCmdPrefix( RTL_CONSTASCII_USTRINGPARAM( ".uno:" )); + rtl::OUString aCmdPrefix( ".uno:" ); SfxSlotPool* pSlotPool = pPool ? pPool : &SFX_SLOTPOOL(); for ( sal_uInt16 i=0; i<pSlotPool->GetGroupCount(); i++ ) @@ -1297,8 +1291,8 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) { uno::Reference< beans::XPropertySet > xFrameProps( m_pData->m_xFrame, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xLayouterProps( - xFrameProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) ), uno::UNO_QUERY_THROW ); - xLayouterProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreserveContentSize" ) ), uno::makeAny( sal_True ) ); + xFrameProps->getPropertyValue( ::rtl::OUString( "LayoutManager" ) ), uno::UNO_QUERY_THROW ); + xLayouterProps->setPropertyValue( ::rtl::OUString( "PreserveContentSize" ), uno::makeAny( sal_True ) ); } catch (const uno::Exception&) { diff --git a/sfx2/source/view/userinputinterception.cxx b/sfx2/source/view/userinputinterception.cxx index 23449126772c..31669042319b 100644 --- a/sfx2/source/view/userinputinterception.cxx +++ b/sfx2/source/view/userinputinterception.cxx @@ -29,10 +29,8 @@ #include "sfx2/userinputinterception.hxx" -/** === begin UNO includes === **/ #include <com/sun/star/awt/MouseButton.hpp> #include <com/sun/star/awt/KeyModifier.hpp> -/** === end UNO includes === **/ #include <cppuhelper/interfacecontainer.hxx> #include <cppuhelper/weak.hxx> diff --git a/sfx2/source/view/view.hrc b/sfx2/source/view/view.hrc index adcc3a811b92..02132e1198c8 100644 --- a/sfx2/source/view/view.hrc +++ b/sfx2/source/view/view.hrc @@ -1,29 +1,20 @@ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ #ifndef _SFX_VIEW_HRC #define _SFX_VIEW_HRC @@ -64,8 +55,6 @@ #define MSG_QUERY_OPENASTEMPLATE (RID_SFX_VIEW_START+41) #define MSG_CANT_CLOSE (RID_SFX_VIEW_START+42) -#define TP_FRAMEPROPERTIES (RID_SFX_VIEW_START+44) - #define FT_FRAMENAME 3 #define ED_FRAMENAME 4 #define FT_URL 5 @@ -89,32 +78,12 @@ #define GB_WIDTH 23 #define GB_HEIGHT 24 -#define RB_PIXELWIDTH 25 -#define RB_PERCENTWIDTH 26 -#define RB_RELATIVEWIDTH 27 -#define RB_PIXELHEIGHT 28 -#define RB_PERCENTHEIGHT 29 -#define RB_RELATIVEHEIGHT 30 -#define FT_WIDTHCOMMENT 31 -#define FT_HEIGHTCOMMENT 32 #define FT_WIDTH 33 -#define NM_WIDTH 34 -#define CB_WIDTHFIXED 35 -#define CB_HEIGHTFIXED 36 #define FT_HEIGHT 37 -#define NM_HEIGHT 38 - -#define FT_FRAMESPACING 39 -#define NM_FRAMESPACING 40 -#define CB_FRAMESPACING_INHERIT 41 -#define FT_FRAMESPACINGCOLOR 42 -#define ED_FRAMESPACINGCOLOR 43 -#define CB_FRAMESPACINGCOLOR_INHERIT 44 -#define GB_FRAMESET 45 + #define FL_SEP_LEFT 46 #define FL_SEP_RIGHT 47 -#define STR_FRAME_FILEDLG (RID_SFX_VIEW_START+46) #endif diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx index 948811542633..9def56c2f0d2 100644 --- a/sfx2/source/view/viewfac.cxx +++ b/sfx2/source/view/viewfac.cxx @@ -26,8 +26,6 @@ * ************************************************************************/ -// INCLUDE --------------------------------------------------------------- - #include <sfx2/app.hxx> #include "sfx2/viewfac.hxx" #include <rtl/ustrbuf.hxx> @@ -56,7 +54,7 @@ String SfxViewFactory::GetAPIViewName() const return m_sViewName; if ( GetOrdinal() == 0 ) - return String::CreateFromAscii( "Default" ); + return rtl::OUString( "Default" ); return GetLegacyViewName(); } @@ -68,7 +66,7 @@ SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, fnCreate(fnC), fnInit(fnI), nOrd(nOrdinal), - m_sViewName( String::CreateFromAscii( asciiViewName ) ) + m_sViewName( rtl::OUString::createFromAscii( asciiViewName ) ) { DBG_CTOR(SfxViewFactory, 0); } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 34929e20702c..14cca707bcbf 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -58,6 +58,7 @@ #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/frame/XModel2.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> @@ -216,7 +217,7 @@ static sal_Bool AskPasswordToModify_Impl( const uno::Reference< task::XInteracti else { // the binary format - bResult = ( SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ).equals( pFilter->GetServiceName() ) ) == nPasswordHash ); + bResult = ( SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(), ::rtl::OUString( "com.sun.star.text.TextDocument" ).equals( pFilter->GetServiceName() ) ) == nPasswordHash ); } } else @@ -251,7 +252,7 @@ public: void InsertViewFrame( SfxViewFrame* pFrame ) { StartListening( *pFrame ); - C40_INSERT( SfxViewFrame, pFrame, Count() ); + push_back( pFrame ); } void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); }; @@ -267,9 +268,9 @@ void SfxViewNotificatedFrameList_Impl::Notify( SfxBroadcaster& rBC, const SfxHin SfxViewFrame* pFrame = (SfxViewFrame*) &rBC; if( pFrame ) { - sal_uInt16 nPos = C40_GETPOS( SfxViewFrame, pFrame ); - if( nPos != USHRT_MAX ) - Remove( nPos ); + iterator it = std::find( begin(), end(), pFrame ); + if( it != end() ) + erase( it ); } break; } @@ -365,7 +366,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) SfxAllItemSet aSet( pApp->GetPool() ); aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetURLObject().GetMainURL(INetURLObject::NO_DECODE) ) ); aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) ); - aSet.Put( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_blank") ) ); + aSet.Put( SfxStringItem( SID_TARGETNAME, rtl::OUString("_blank") ) ); SFX_ITEMSET_ARG( pMed->GetItemSet(), pReferer, SfxStringItem, SID_REFERER, sal_False ); if ( pReferer ) aSet.Put( *pReferer ); @@ -405,6 +406,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) } } nOpenMode = SFX_STREAM_READONLY; + pSh->SetReadOnlyUI(true); } else { @@ -424,12 +426,20 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) pSh->SetModifyPasswordEntered(); } - nOpenMode = SFX_STREAM_READWRITE; - pSh->SetReadOnlyUI( sal_False ); + nOpenMode = pSh->IsOriginallyReadOnlyMedium() ? SFX_STREAM_READONLY : SFX_STREAM_READWRITE; // if only the view was in the readonly mode then there is no need to do the reload - if ( !pSh->IsReadOnly() ) + if ( !pSh->IsReadOnlyMedium() ) + { + // SetReadOnlyUI causes recomputation of window title, using + // open mode among other things, so call SetOpenMode before + // SetReadOnlyUI: + pMed->SetOpenMode( nOpenMode ); + pSh->SetReadOnlyUI( sal_False ); return; + } + + pSh->SetReadOnlyUI( sal_False ); } if ( rReq.IsAPI() ) @@ -472,7 +482,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) pMed->CloseAndRelease(); pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) ); - pMed->SetOpenMode( nOpenMode, pMed->IsDirect() ); + pMed->SetOpenMode( nOpenMode ); pMed->CompleteReOpen(); if ( nOpenMode & STREAM_WRITE ) @@ -493,7 +503,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) else { pMed->ResetError(); - pMed->SetOpenMode( SFX_STREAM_READONLY, pMed->IsDirect() ); + pMed->SetOpenMode( SFX_STREAM_READONLY ); pMed->ReOpen(); pSh->DoSaveCompleted( pMed ); } @@ -580,8 +590,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) SID_FILE_NAME, sal_False); // Open as editable? sal_Bool bForEdit = !pSh->IsReadOnly(); - if ( rReq.GetSlot() == SID_EDITDOC ) - bForEdit = !bForEdit; // If possible ask the User sal_Bool bDo = ( GetViewShell()->PrepareClose() != sal_False ); @@ -650,9 +658,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // let the current security settings be checked again pNewSet->Put( SfxUInt16Item( SID_MACROEXECMODE, document::MacroExecMode::USE_CONFIG ) ); - if ( rReq.GetSlot() == SID_EDITDOC || !bForEdit ) + if ( pSh->IsOriginallyReadOnlyMedium() ) // edit mode is switched or reload of readonly document - pNewSet->Put( SfxBoolItem( SID_DOC_READONLY, !bForEdit ) ); + pNewSet->Put( SfxBoolItem( SID_DOC_READONLY, true ) ); else // Reload of file opened for writing pNewSet->ClearItem( SID_DOC_READONLY ); @@ -689,7 +697,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) if (!pInteractionItem) { - Reference < ::com::sun::star::task::XInteractionHandler > xHdl( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.uui.UUIInteractionHandler"))), UNO_QUERY ); + Reference < ::com::sun::star::task::XInteractionHandler > xHdl( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString("com.sun.star.comp.uui.UUIInteractionHandler")), UNO_QUERY ); if (xHdl.is()) pNewSet->Put( SfxUnoAnyItem(SID_INTERACTIONHANDLER,::com::sun::star::uno::makeAny(xHdl)) ); } @@ -759,7 +767,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) { SfxAllItemSet aSet( pApp->GetPool() ); aSet.Put( SfxStringItem( SID_FILE_NAME, pMedium->GetName() ) ); - aSet.Put( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_blank") ) ); + aSet.Put( SfxStringItem( SID_TARGETNAME, rtl::OUString("_blank") ) ); if ( pSavedOptions ) aSet.Put( *pSavedOptions ); if ( pSavedReferer ) @@ -778,12 +786,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) xNewObj->SetModifyPasswordEntered( sal_False ); xNewObj->SetReadOnly(); } - else if ( rReq.GetSlot() == SID_EDITDOC && bForEdit && !xNewObj->IsReadOnlyMedium() ) + else if ( rReq.GetSlot() == SID_EDITDOC ) { - // the filter might request setting of the document to readonly state - // but in case of SID_EDITDOC it should not happen if the document - // can be opened for editing - xNewObj->SetReadOnlyUI( sal_False ); + xNewObj->SetReadOnlyUI( !bForEdit ); } if ( xNewObj->IsDocShared() ) @@ -990,7 +995,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) if ( pShUndoMgr && pShUndoMgr->GetUndoActionCount() ) { - String aTmp( SvtResId( STR_UNDO ) ); + String aTmp(SvtResId(STR_UNDO).toString()); aTmp+= pShUndoMgr->GetUndoActionComment(0); rSet.Put( SfxStringItem( SID_UNDO, aTmp ) ); } @@ -999,7 +1004,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) if ( pShUndoMgr && pShUndoMgr->GetRedoActionCount() ) { - String aTmp( SvtResId(STR_REDO) ); + String aTmp(SvtResId(STR_REDO).toString()); aTmp += pShUndoMgr->GetRedoActionComment(0); rSet.Put( SfxStringItem( SID_REDO, aTmp ) ); } @@ -1009,7 +1014,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) if ( pShUndoMgr && pTarget && pShUndoMgr->GetRepeatActionCount() && pShUndoMgr->CanRepeat(*pTarget) ) { - String aTmp( SvtResId(STR_REPEAT) ); + String aTmp(SvtResId(STR_REPEAT).toString()); aTmp += pShUndoMgr->GetRepeatActionComment(*pTarget); rSet.Put( SfxStringItem( SID_REPEAT, aTmp ) ); } @@ -1427,9 +1432,8 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) pDispatcher->Flush(); } - SfxViewFrame *pThis = this; // this due to the sick Array syntax SfxViewFrameArr_Impl &rViewArr = SFX_APP()->GetViewFrames_Impl(); - rViewArr.C40_INSERT(SfxViewFrame, pThis, rViewArr.Count() ); + rViewArr.push_back( this ); } SfxViewFrame::SfxViewFrame @@ -1486,8 +1490,8 @@ SfxViewFrame::~SfxViewFrame() // Unregister from the Frame List. SfxApplication *pSfxApp = SFX_APP(); SfxViewFrameArr_Impl &rFrames = pSfxApp->GetViewFrames_Impl(); - const SfxViewFrame *pThis = this; - rFrames.Remove( rFrames.GetPos(pThis) ); + SfxViewFrameArr_Impl::iterator it = std::find( rFrames.begin(), rFrames.end(), this ); + rFrames.erase( it ); // Delete Member KillDispatcher_Impl(); @@ -1534,9 +1538,9 @@ SfxViewFrame* SfxViewFrame::GetFirst SfxViewFrameArr_Impl &rFrames = pSfxApp->GetViewFrames_Impl(); // search for a SfxDocument of the specified type - for ( sal_uInt16 nPos = 0; nPos < rFrames.Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < rFrames.size(); ++nPos ) { - SfxViewFrame *pFrame = rFrames.GetObject(nPos); + SfxViewFrame *pFrame = rFrames[nPos]; if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) && ( !bOnlyIfVisible || pFrame->IsVisible() ) ) @@ -1560,14 +1564,14 @@ SfxViewFrame* SfxViewFrame::GetNext // refind the specified predecessor sal_uInt16 nPos; - for ( nPos = 0; nPos < rFrames.Count(); ++nPos ) - if ( rFrames.GetObject(nPos) == &rPrev ) + for ( nPos = 0; nPos < rFrames.size(); ++nPos ) + if ( rFrames[nPos] == &rPrev ) break; // search for a Frame of the specified type - for ( ++nPos; nPos < rFrames.Count(); ++nPos ) + for ( ++nPos; nPos < rFrames.size(); ++nPos ) { - SfxViewFrame *pFrame = rFrames.GetObject(nPos); + SfxViewFrame *pFrame = rFrames[nPos]; if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) && ( !bOnlyIfVisible || pFrame->IsVisible() ) ) @@ -1584,24 +1588,6 @@ SfxProgress* SfxViewFrame::GetProgress() const } //-------------------------------------------------------------------- -void SfxViewFrame::ShowStatusText( const String& /*rText*/) -{ -} - -//-------------------------------------------------------------------- -void SfxViewFrame::HideStatusText() -{ -} - -//-------------------------------------------------------------------- -#ifdef ENABLE_INIMANAGER//MUSTINI -SfxIniManager* SfxViewFrame::GetIniManager() const -{ - return SFX_APP()->GetAppIniManager(); -} -#endif - -//-------------------------------------------------------------------- void SfxViewFrame::DoAdjustPosSizePixel //! divide on Inner.../Outer... ( SfxViewShell* pSh, @@ -1972,12 +1958,12 @@ SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc else aTransformLoadArgs.remove( "Hidden" ); - ::rtl::OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) ); + ::rtl::OUString sURL( "private:object" ); if ( sURL.isEmpty() ) sURL = i_rDoc.GetFactory().GetFactoryURL(); Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW ); - xLoader->loadComponentFromURL( sURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_self")), 0, + xLoader->loadComponentFromURL( sURL, ::rtl::OUString("_self"), 0, aTransformLoadArgs.getPropertyValues() ); SfxViewShell* pViewShell = SfxViewShell::Get( i_rFrame->getController() ); @@ -2218,7 +2204,7 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl return sal_False; } - DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().Count() == SFX_APP()->GetViewShells_Impl().Count(), "Inconsistent view arrays!" ); + DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().size() == SFX_APP()->GetViewShells_Impl().size(), "Inconsistent view arrays!" ); return sal_True; } @@ -2346,16 +2332,16 @@ void SfxViewFrame::ExecView_Impl */ sal_Bool impl_maxOpenDocCountReached() { - static ::rtl::OUString SERVICE_DESKTOP(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")); + static ::rtl::OUString SERVICE_DESKTOP("com.sun.star.frame.Desktop"); try { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey( xSMGR, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Misc")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MaxOpenDocuments")), + ::rtl::OUString("org.openoffice.Office.Common/"), + ::rtl::OUString("Misc"), + ::rtl::OUString("MaxOpenDocuments"), ::comphelper::ConfigurationHelper::E_READONLY); // NIL means: count of allowed documents = infinite ! @@ -2647,7 +2633,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro ) String aLocation; Reference< XMultiServiceFactory > xSMgr = ::comphelper::getProcessServiceFactory(); Reference< com::sun::star::uri::XUriReferenceFactory > xFactory( xSMgr->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uri.UriReferenceFactory")) ), UNO_QUERY ); + ::rtl::OUString("com.sun.star.uri.UriReferenceFactory") ), UNO_QUERY ); if ( xFactory.is() ) { Reference< com::sun::star::uri::XVndSunStarScriptUrl > xUrl( xFactory->parse( aScriptURL ), UNO_QUERY ); @@ -2664,7 +2650,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro ) aMacroName = aName.getToken( 0, cTok, nIndex ); // get location - ::rtl::OUString aLocKey(RTL_CONSTASCII_USTRINGPARAM("location")); + ::rtl::OUString aLocKey("location"); if ( xUrl->hasParameter( aLocKey ) ) aLocation = xUrl->getParameter( aLocKey ); } @@ -2818,7 +2804,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) case SID_RECORDMACRO : { // try to find any active recorder on this frame - ::rtl::OUString sProperty(RTL_CONSTASCII_USTRINGPARAM("DispatchRecorderSupplier")); + ::rtl::OUString sProperty("DispatchRecorderSupplier"); com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame( GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); @@ -2863,11 +2849,11 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) com::sun::star::uno::UNO_QUERY); xRecorder = com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder >( - xFactory->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchRecorder"))), + xFactory->createInstance(rtl::OUString("com.sun.star.frame.DispatchRecorder")), com::sun::star::uno::UNO_QUERY); xSupplier = com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorderSupplier >( - xFactory->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchRecorderSupplier"))), + xFactory->createInstance(rtl::OUString("com.sun.star.frame.DispatchRecorderSupplier")), com::sun::star::uno::UNO_QUERY); xSupplier->setDispatchRecorder(xRecorder); @@ -2894,7 +2880,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) { try { - Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + Any aValue = xPropSet->getPropertyValue( rtl::OUString( "LayoutManager" )); aValue >>= xLayoutManager; } catch ( Exception& ) @@ -2904,7 +2890,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) if ( xLayoutManager.is() ) { - rtl::OUString aStatusbarResString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" )); + rtl::OUString aStatusbarResString( "private:resource/statusbar/statusbar" ); // Evaluate parameter. SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, rReq.GetSlot(), sal_False); sal_Bool bShow( sal_True ); @@ -2948,7 +2934,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) { try { - Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + Any aValue = xPropSet->getPropertyValue( rtl::OUString( "LayoutManager" )); aValue >>= xLayoutManager; } catch ( Exception& ) @@ -2965,7 +2951,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) try { xLMPropSet->setPropertyValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HideCurrentUI" )), + ::rtl::OUString( "HideCurrentUI" ), makeAny( bNewFullScreenMode )); } catch ( ::com::sun::star::beans::UnknownPropertyException& ) @@ -3016,7 +3002,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) { SvtMiscOptions aMiscOptions; const char* pName = GetObjectShell()->GetFactory().GetShortName(); - if ( !aMiscOptions.IsExperimentalMode() || + if ( !aMiscOptions.IsMacroRecorderMode() || ( strcmp(pName,"swriter") && strcmp(pName,"scalc") ) ) { rSet.DisableItem( nWhich ); @@ -3024,7 +3010,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) break; } - ::rtl::OUString sProperty(RTL_CONSTASCII_USTRINGPARAM("DispatchRecorderSupplier")); + ::rtl::OUString sProperty("DispatchRecorderSupplier"); com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet( GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); @@ -3042,14 +3028,14 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) { SvtMiscOptions aMiscOptions; const char* pName = GetObjectShell()->GetFactory().GetShortName(); - if ( !aMiscOptions.IsExperimentalMode() || + if ( !aMiscOptions.IsMacroRecorderMode() || ( strcmp(pName,"swriter") && strcmp(pName,"scalc") ) ) { rSet.DisableItem( nWhich ); break; } - ::rtl::OUString sProperty(RTL_CONSTASCII_USTRINGPARAM("DispatchRecorderSupplier")); + ::rtl::OUString sProperty("DispatchRecorderSupplier"); com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet( GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); @@ -3068,13 +3054,13 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); com::sun::star::uno::Any aProp = xSet->getPropertyValue( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )) ); + rtl::OUString( "LayoutManager" ) ); if ( !( aProp >>= xLayoutManager )) rSet.Put( SfxBoolItem( nWhich, sal_False )); else { - rtl::OUString aStatusbarResString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" )); + rtl::OUString aStatusbarResString( "private:resource/statusbar/statusbar" ); sal_Bool bShow = xLayoutManager->isElementVisible( aStatusbarResString ); rSet.Put( SfxBoolItem( nWhich, bShow )); } @@ -3153,20 +3139,22 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq ) else { ::com::sun::star::util::URL aTargetURL; - aTargetURL.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".component:DB/DataSourceBrowser")); - Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); + aTargetURL.Complete = ::rtl::OUString(".component:DB/DataSourceBrowser"); + Reference < ::com::sun::star::util::XURLTransformer > xTrans( + ::com::sun::star::util::URLTransformer::create( + ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aTargetURL ); Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); Reference < ::com::sun::star::frame::XDispatch > xDisp; if ( xProv.is() ) - xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_beamer")), 31 ); + xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString("_beamer"), 31 ); if ( xDisp.is() ) { Sequence < ::com::sun::star::beans::PropertyValue > aArgs(1); ::com::sun::star::beans::PropertyValue* pArg = aArgs.getArray(); - pArg[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer")); - pArg[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:user")); + pArg[0].Name = rtl::OUString("Referer"); + pArg[0].Value <<= ::rtl::OUString("private:user"); xDisp->dispatch( aTargetURL, aArgs ); } } diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 7f2e6ca2c057..f5611793a277 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -131,7 +131,7 @@ void SfxViewFrame::UpdateTitle() DBG_CHKTHIS(SfxViewFrame, 0); const SfxObjectFactory &rFact = GetObjectShell()->GetFactory(); - pImp->aFactoryName = String::CreateFromAscii( rFact.GetShortName() ); + pImp->aFactoryName = rtl::OUString::createFromAscii(rFact.GetShortName()); SfxObjectShell *pObjSh = GetObjectShell(); if ( !pObjSh ) @@ -230,11 +230,11 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) } SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, GetPool() ); - String aFact = String::CreateFromAscii("private:factory/"); + String aFact = rtl::OUString("private:factory/"); aFact += aFactName; aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aFact ) ); aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, &GetFrame() ) ); - aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_blank" ) ) ); + aReq.AppendItem( SfxStringItem( SID_TARGETNAME, rtl::OUString( "_blank" ) ) ); SFX_APP()->ExecuteSlot( aReq ); const SfxViewFrameItem* pItem = PTR_CAST( SfxViewFrameItem, aReq.GetReturnValue() ); if ( pItem ) @@ -307,7 +307,7 @@ void SfxViewFrame::GetState_Impl( SfxItemSet &rSet ) { if ( pImp->aFactoryName.Len() ) { - String aFact = String::CreateFromAscii("private:factory/"); + String aFact = rtl::OUString("private:factory/"); aFact += pImp->aFactoryName; rSet.Put( SfxStringItem( nWhich, aFact ) ); } diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 405390b6b455..cb8a2e8a994d 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -137,14 +137,14 @@ SfxPrinterController::SfxPrinterController( const boost::shared_ptr<Printer>& i_ // initialize extra ui options if( mxRenderable.is() ) { - for (sal_Int32 nProp=0; nProp<rProps.getLength(); nProp++) + for (sal_Int32 nProp=0; nProp < rProps.getLength(); ++nProp) setValue( rProps[nProp].Name, rProps[nProp].Value ); Sequence< beans::PropertyValue > aRenderOptions( 3 ); - aRenderOptions[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ExtraPrintUIOptions" ) ); - aRenderOptions[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "View" ) ); + aRenderOptions[0].Name = rtl::OUString( "ExtraPrintUIOptions" ); + aRenderOptions[1].Name = rtl::OUString( "View" ); aRenderOptions[1].Value = i_rViewProp; - aRenderOptions[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) ); + aRenderOptions[2].Name = rtl::OUString( "IsPrinter" ); aRenderOptions[2].Value <<= sal_True; try { @@ -169,10 +169,10 @@ SfxPrinterController::SfxPrinterController( const boost::shared_ptr<Printer>& i_ } // set some job parameters - setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsApi" ) ), makeAny( i_bApi ) ); - setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDirect" ) ), makeAny( i_bDirect ) ); - setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) ), makeAny( sal_True ) ); - setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "View" ) ), i_rViewProp ); + setValue( rtl::OUString( "IsApi" ), makeAny( i_bApi ) ); + setValue( rtl::OUString( "IsDirect" ), makeAny( i_bDirect ) ); + setValue( rtl::OUString( "IsPrinter" ), makeAny( sal_True ) ); + setValue( rtl::OUString( "View" ), i_rViewProp ); } void SfxPrinterController::Notify( SfxBroadcaster& , const SfxHint& rHint ) @@ -195,7 +195,7 @@ SfxPrinterController::~SfxPrinterController() const Any& SfxPrinterController::getSelectionObject() const { - const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) ); + const beans::PropertyValue* pVal = getValue( rtl::OUString( "PrintSelectionOnly" ) ); if( pVal ) { sal_Bool bSel = sal_False; @@ -204,7 +204,7 @@ const Any& SfxPrinterController::getSelectionObject() const } sal_Int32 nChoice = 0; - pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) ); + pVal = getValue( rtl::OUString( "PrintContent" ) ); if( pVal ) pVal->Value >>= nChoice; return (nChoice > 1) ? maSelection : maCompleteSelection; @@ -222,7 +222,7 @@ Sequence< beans::PropertyValue > SfxPrinterController::getMergedOptions() const } Sequence< beans::PropertyValue > aRenderOptions( 1 ); - aRenderOptions[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ); + aRenderOptions[ 0 ].Name = rtl::OUString( "RenderDevice" ); aRenderOptions[ 0 ].Value <<= mxDevice; aRenderOptions = getJobProperties( aRenderOptions ); @@ -343,7 +343,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt case view::PrintableState_JOB_FAILED : { // "real" problem (not simply printing cancelled by user) - String aMsg( SfxResId( STR_NOSTARTPRINTER ) ); + rtl::OUString aMsg( SfxResId(STR_NOSTARTPRINTER).toString() ); if ( !m_bApi ) ErrorBox( mpViewShell->GetWindow(), WB_OK | WB_DEF_OK, aMsg ).Execute(); // intentionally no break @@ -517,21 +517,21 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter ) bSizeToDoc; // Message and Flags for page format, summaries changes - String aMsg; + rtl::OUString aMsg; sal_uInt16 nNewOpt=0; if( bOriChg && bPgSzChg ) { - aMsg = String(SfxResId(STR_PRINT_NEWORISIZE)); + aMsg = SfxResId(STR_PRINT_NEWORISIZE).toString(); nNewOpt = SFX_PRINTER_CHG_ORIENTATION | SFX_PRINTER_CHG_SIZE; } else if (bOriChg ) { - aMsg = String(SfxResId(STR_PRINT_NEWORI)); + aMsg = SfxResId(STR_PRINT_NEWORI).toString(); nNewOpt = SFX_PRINTER_CHG_ORIENTATION; } else if (bPgSzChg) { - aMsg = String(SfxResId(STR_PRINT_NEWSIZE)); + aMsg = SfxResId(STR_PRINT_NEWSIZE).toString(); nNewOpt = SFX_PRINTER_CHG_SIZE; } @@ -633,15 +633,15 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro pImp->m_pPrinterController = pController; SfxObjectShell *pObjShell = GetObjectShell(); - pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ), + pController->setValue( rtl::OUString( "JobName" ), makeAny( rtl::OUString( pObjShell->GetTitle(0) ) ) ); // FIXME: job setup SfxPrinter* pDocPrt = GetPrinter(sal_False); JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : GetJobSetup(); if( bIsDirect ) - aJobSetup.SetValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ), - String( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) ); + aJobSetup.SetValue( String( "IsQuickJob" ), + String( "true" ) ); Printer::PrintJob( pController, aJobSetup ); } @@ -654,19 +654,23 @@ Printer* SfxViewShell::GetActivePrinter() const void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) { - sal_uInt16 nDialogRet = RET_CANCEL; + sal_uInt16 nDialogRet = RET_CANCEL; SfxPrinter* pPrinter = 0; SfxDialogExecutor_Impl* pExecutor = 0; bool bSilent = false; - sal_Bool bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count(); + + // does the function have been called by the user interface or by an API call + sal_Bool bIsAPI = rReq.IsAPI(); if ( bIsAPI ) { + // the function have been called by the API + + // Should it be visible on the user interface, + // should it launch popup dialogue ? SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, sal_False); bSilent = pSilentItem && pSilentItem->GetValue(); } - //FIXME: how to transport "bPrintOnHelp"? - // no help button in dialogs if called from the help window // (pressing help button would exchange the current page inside the help // document that is going to be printed!) @@ -678,27 +682,20 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) const sal_uInt16 nId = rReq.GetSlot(); switch( nId ) { - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case SID_PRINTDOC: - case SID_PRINTDOCDIRECT: + case SID_PRINTDOC: // display the printer selection and properties dialogue : File > Print… + case SID_PRINTDOCDIRECT: // Print the document directly, without displaying the dialogue { SfxObjectShell* pDoc = GetObjectShell(); // derived class may decide to abort this - if( !pDoc->QuerySlotExecutable( nId ) ) + if( pDoc == NULL || !pDoc->QuerySlotExecutable( nId ) ) { rReq.SetReturnValue( SfxBoolItem( 0, sal_False ) ); return; } - bool bDetectHidden = ( !bSilent && pDoc ); - if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES ) - break; - - SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, sal_False); - sal_Bool bSelection = pSelectItem && pSelectItem->GetValue(); - if( pSelectItem && rReq.GetArgs()->Count() == 1 ) - bIsAPI = sal_False; + if ( !bSilent && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES ) + return; uno::Sequence < beans::PropertyValue > aProps; if ( bIsAPI ) @@ -714,29 +711,42 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) // bool Asynchron // bool Collate // bool Silent + + // the TransformItems function overwrite aProps TransformItems( nId, *rReq.GetArgs(), aProps, GetInterface()->GetSlot(nId) ); - for ( sal_Int32 nProp=0; nProp<aProps.getLength(); nProp++ ) + + for ( sal_Int32 nProp=0; nProp < aProps.getLength(); ++nProp ) { if ( aProps[nProp].Name == "Copies" ) - aProps[nProp]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CopyCount")); + { + aProps[nProp]. Name = rtl::OUString("CopyCount"); + } else if ( aProps[nProp].Name == "RangeText" ) - aProps[nProp]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Pages")); - if ( aProps[nProp].Name == "Asynchron" ) { - aProps[nProp]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wait")); + aProps[nProp]. Name = rtl::OUString("Pages"); + } + else if ( aProps[nProp].Name == "Asynchron" ) + { + aProps[nProp]. Name = rtl::OUString("Wait"); sal_Bool bAsynchron = sal_False; aProps[nProp].Value >>= bAsynchron; aProps[nProp].Value <<= (sal_Bool) (!bAsynchron); } - if ( aProps[nProp].Name == "Silent" ) + else if ( aProps[nProp].Name == "Silent" ) { - aProps[nProp]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MonitorVisible")); + aProps[nProp]. Name = rtl::OUString("MonitorVisible"); sal_Bool bPrintSilent = sal_False; aProps[nProp].Value >>= bPrintSilent; aProps[nProp].Value <<= (sal_Bool) (!bPrintSilent); } } } + + // we will add the "PrintSelectionOnly" or "HideHelpButton" properties + // we have to increase the capacity of aProps + sal_Int32 nLen = aProps.getLength(); + aProps.realloc( nLen + 1 ); + // HACK: writer sets the SID_SELECTION item when printing directly and expects // to get only the selection document in that case (see getSelectionObject) // however it also reacts to the PrintContent property. We need this distinction here, too, @@ -744,11 +754,19 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) // it would be better if writer handled this internally if( nId == SID_PRINTDOCDIRECT ) { - sal_Int32 nLen = aProps.getLength(); - aProps.realloc( nLen + 1 ); - aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ); + // should we print only the selection or the whole document + SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, sal_False); + sal_Bool bSelection = ( pSelectItem != NULL && pSelectItem->GetValue() ); + + aProps[nLen].Name = rtl::OUString( "PrintSelectionOnly" ); aProps[nLen].Value = makeAny( bSelection ); } + else // if nId == SID_PRINTDOC ; nothing to do with the previous HACK + { + // should the printer selection and properties dialogue display an help button + aProps[nLen].Name = rtl::OUString( "HideHelpButton" ); + aProps[nLen].Value = makeAny( bPrintOnHelp ); + } ExecPrint( aProps, bIsAPI, (nId == SID_PRINTDOCDIRECT) ); @@ -756,8 +774,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) rReq.Done(); break; } - - case SID_SETUPPRINTER : + case SID_SETUPPRINTER : // display the printer settings dialogue : File > Printer Settings… case SID_PRINTER_NAME : // only for recorded macros { // get printer and printer settings from the document @@ -771,7 +788,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) pPrinter = new SfxPrinter( pDocPrinter->GetOptions().Clone(), ((const SfxStringItem*) pPrinterItem)->GetValue() ); // if printer is unknown, it can't be used - now printer from document will be used - if ( !pPrinter->IsOriginal() ) + if ( !pPrinter->IsKnown() ) DELETEZ(pPrinter); } @@ -780,7 +797,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) // just set a recorded printer name if ( pPrinter ) SetPrinter( pPrinter, SFX_PRINTER_PRINTER ); - break; + return; } // no PrinterName parameter in ItemSet or the PrinterName points to an unknown printer @@ -791,23 +808,23 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) if( !pPrinter || !pPrinter->IsValid() ) { // no valid printer either in ItemSet or at the document - if ( bSilent ) - { - rReq.SetReturnValue(SfxBoolItem(0,sal_False)); - break; - } - else - ErrorBox( NULL, WB_OK | WB_DEF_OK, String( SfxResId( STR_NODEFPRINTER ) ) ).Execute(); + if ( !bSilent ) + ErrorBox( NULL, WB_OK | WB_DEF_OK, SfxResId(STR_NODEFPRINTER).toString() ).Execute(); + + rReq.SetReturnValue(SfxBoolItem(0,sal_False)); + + break; } // FIXME: printer isn't used for printing anymore! if( pPrinter->IsPrinting() ) { - // if printer is busy, abort printing + // if printer is busy, abort configuration if ( !bSilent ) - InfoBox( NULL, String( SfxResId( STR_ERROR_PRINTER_BUSY ) ) ).Execute(); + InfoBox( NULL, SfxResId(STR_ERROR_PRINTER_BUSY).toString() ).Execute(); rReq.SetReturnValue(SfxBoolItem(0,sal_False)); - break; + + return; } // if no arguments are given, retrieve them from a dialog @@ -879,14 +896,10 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) if ( SID_PRINTDOC == nId ) rReq.SetReturnValue(SfxBoolItem(0,sal_False)); if ( nId == SID_SETUPPRINTER ) - { rReq.AppendItem( SfxBoolItem( SID_DIALOG_RETURN, sal_False ) ); - } } } } - - break; } } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index d4cb20b1ece2..89bc6afeea59 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -245,7 +245,7 @@ static ::rtl::OUString RetrieveLabelFromCommand( { xModuleManager = css::uno::Reference< css::frame::XModuleManager >( xSMGR->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ))), + ::rtl::OUString( "com.sun.star.frame.ModuleManager" )), css::uno::UNO_QUERY_THROW ); s_xModuleManager = xModuleManager; } @@ -256,7 +256,7 @@ static ::rtl::OUString RetrieveLabelFromCommand( { xNameAccess = css::uno::Reference< css::container::XNameAccess >( xSMGR->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.UICommandDescription" ))), + ::rtl::OUString( "com.sun.star.frame.UICommandDescription" )), css::uno::UNO_QUERY_THROW ); s_xNameAccess = xNameAccess; } @@ -326,9 +326,9 @@ static ::rtl::OUString impl_retrieveFilterNameFromTypeAndModule( { // Retrieve filter from type css::uno::Sequence< css::beans::NamedValue > aQuery( 2 ); - aQuery[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" )); + aQuery[0].Name = rtl::OUString( "Type" ); aQuery[0].Value = css::uno::makeAny( rType ); - aQuery[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentService" )); + aQuery[1].Name = rtl::OUString( "DocumentService" ); aQuery[1].Value = css::uno::makeAny( rModuleIdentifier ); css::uno::Reference< css::container::XEnumeration > xEnumeration = @@ -339,11 +339,11 @@ static ::rtl::OUString impl_retrieveFilterNameFromTypeAndModule( { ::comphelper::SequenceAsHashMap aFilterPropsHM( xEnumeration->nextElement() ); ::rtl::OUString aFilterName = aFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), + ::rtl::OUString("Name"), ::rtl::OUString() ); sal_Int32 nFilterFlags = aFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Flags")), + ::rtl::OUString("Flags"), sal_Int32( 0 ) ); if ( nFilterFlags & nFlags ) @@ -369,7 +369,7 @@ enum ETypeFamily ::rtl::OUString impl_searchFormatTypeForApp(const css::uno::Reference< css::frame::XFrame >& xFrame , ETypeFamily eTypeFamily) { - static ::rtl::OUString SERVICENAME_MODULEMANAGER(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")); + static ::rtl::OUString SERVICENAME_MODULEMANAGER("com.sun.star.frame.ModuleManager"); try { @@ -384,32 +384,32 @@ enum ETypeFamily case E_MS_DOC: { if ( sModule == "com.sun.star.text.TextDocument" ) - sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "writer_MS_Word_97" )); + sType = ::rtl::OUString( "writer_MS_Word_97" ); else if ( sModule == "com.sun.star.sheet.SpreadsheetDocument" ) - sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "calc_MS_Excel_97" )); + sType = ::rtl::OUString( "calc_MS_Excel_97" ); else if ( sModule == "com.sun.star.drawing.DrawingDocument" ) - sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress_MS_PowerPoint_97" )); + sType = ::rtl::OUString( "impress_MS_PowerPoint_97" ); else if ( sModule == "com.sun.star.presentation.PresentationDocument" ) - sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress_MS_PowerPoint_97" )); + sType = ::rtl::OUString( "impress_MS_PowerPoint_97" ); } break; case E_OOO_DOC: { if ( sModule == "com.sun.star.text.TextDocument" ) - sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "writer8" )); + sType = ::rtl::OUString( "writer8" ); else if ( sModule == "com.sun.star.sheet.SpreadsheetDocument" ) - sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "calc8" )); + sType = ::rtl::OUString( "calc8" ); else if ( sModule == "com.sun.star.drawing.DrawingDocument" ) - sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "draw8" )); + sType = ::rtl::OUString( "draw8" ); else if ( sModule == "com.sun.star.presentation.PresentationDocument" ) - sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress8" )); + sType = ::rtl::OUString( "impress8" ); } break; } @@ -481,20 +481,20 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) { try { - Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + Any aValue = xPropSet->getPropertyValue( rtl::OUString( "LayoutManager" )); aValue >>= xLayoutManager; if ( xLayoutManager.is() ) { - rtl::OUString aTextResString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/textobjectbar" )); + rtl::OUString aTextResString( "private:resource/toolbar/textobjectbar" ); uno::Reference< ui::XUIElement > xElement = xLayoutManager->getElement( aTextResString ); if(!xElement.is()) { - rtl::OUString aFrameResString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/frameobjectbar" )); + rtl::OUString aFrameResString( "private:resource/toolbar/frameobjectbar" ); xElement = xLayoutManager->getElement( aFrameResString ); } if(!xElement.is()) { - rtl::OUString aOleResString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/oleobjectbar" )); + rtl::OUString aOleResString( "private:resource/toolbar/oleobjectbar" ); xElement = xLayoutManager->getElement( aOleResString ); } if(xElement.is()) @@ -558,7 +558,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) if ( pMailRecipient ) { String aRecipient( pMailRecipient->GetValue() ); - String aMailToStr( String::CreateFromAscii( "mailto:" )); + String aMailToStr(rtl::OUString("mailto:")); if ( aRecipient.Search( aMailToStr ) == 0 ) aRecipient = aRecipient.Erase( 0, aMailToStr.Len() ); @@ -575,7 +575,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) eResult = aModel.SaveAndSend( xFrame, rtl::OUString() ); else if ( nId == SID_MAIL_SENDDOCASPDF ) - eResult = aModel.SaveAndSend( xFrame, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf_Portable_Document_Format" ))); + eResult = aModel.SaveAndSend( xFrame, rtl::OUString( "pdf_Portable_Document_Format" )); else if ( nId == SID_MAIL_SENDDOCASMS ) { @@ -607,7 +607,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case SID_WEBHTML: { - static const char HTML_DOCUMENT_TYPE[] = "writer_web_HTML"; + static const char HTML_DOCUMENT_TYPE[] = "generic_HTML"; static const char HTML_GRAPHIC_TYPE[] = "graphic_HTML"; const sal_Int32 FILTERFLAG_EXPORT = 0x00000002; @@ -615,7 +615,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) css::uno::Reference < css::frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() ); css::uno::Reference< css::frame::XModel > xModel; - const rtl::OUString aModuleManager( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" )); + const rtl::OUString aModuleManager( "com.sun.star.frame.ModuleManager" ); css::uno::Reference< css::frame::XModuleManager > xModuleManager( xSMGR->createInstance( aModuleManager ), css::uno::UNO_QUERY_THROW ); if ( !xModuleManager.is() ) { @@ -648,9 +648,9 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) if ( xModel.is() && xStorable.is() ) { rtl::OUString aFilterName; - rtl::OUString aTypeName( RTL_CONSTASCII_USTRINGPARAM( HTML_DOCUMENT_TYPE )); + rtl::OUString aTypeName( HTML_DOCUMENT_TYPE ); rtl::OUString aFileName; - rtl::OUString aExtension( RTL_CONSTASCII_USTRINGPARAM( "htm" )); + rtl::OUString aExtension( "htm" ); rtl::OUString aLocation = xStorable->getLocation(); INetURLObject aFileObj( aLocation ); @@ -660,7 +660,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) css::uno::Reference< css::container::XContainerQuery > xContainerQuery( xSMGR->createInstance( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" ))), + "com.sun.star.document.FilterFactory" )), css::uno::UNO_QUERY_THROW ); // Retrieve filter from type @@ -670,7 +670,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) { // Draw/Impress uses a different type. 2nd chance try to use alternative type name aFilterName = impl_retrieveFilterNameFromTypeAndModule( - xContainerQuery, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( HTML_GRAPHIC_TYPE )), aModule, nFilterFlags ); + xContainerQuery, ::rtl::OUString( HTML_GRAPHIC_TYPE ), aModule, nFilterFlags ); } // No filter found => error @@ -685,7 +685,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) if ( !bHasLocation ) { // Create a default file name with the correct extension - const rtl::OUString aPreviewFileName( RTL_CONSTASCII_USTRINGPARAM( "webpreview" )); + const rtl::OUString aPreviewFileName( "webpreview" ); aFileName = aPreviewFileName; } else @@ -708,7 +708,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) rtl::OUString aFileURL = aFilePathObj.GetMainURL( INetURLObject::NO_DECODE ); css::uno::Sequence< css::beans::PropertyValue > aArgs( 1 ); - aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" )); + aArgs[0].Name = rtl::OUString( "FilterName" ); aArgs[0].Value = css::uno::makeAny( aFilterName ); // Store document in the html format @@ -841,7 +841,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet ) ::rtl::OUStringBuffer aBuffer( 60 ); aBuffer.append( RetrieveLabelFromCommand( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrintDefault" )), + ::rtl::OUString( ".uno:PrintDefault" ), xFrame )); aBuffer.appendAscii(RTL_CONSTASCII_STRINGPARAM(" (")); aBuffer.append( aPrinterName ); @@ -1297,9 +1297,8 @@ SfxViewShell::SfxViewShell StartListening(*pViewFrame->GetObjectShell()); // Insert into list - const SfxViewShell *pThis = this; // due to the sick Array syntax SfxViewShellArr_Impl &rViewArr = SFX_APP()->GetViewShells_Impl(); - rViewArr.Insert(pThis, rViewArr.Count() ); + rViewArr.push_back(this); } //-------------------------------------------------------------------- @@ -1311,7 +1310,8 @@ SfxViewShell::~SfxViewShell() // Remove from list const SfxViewShell *pThis = this; SfxViewShellArr_Impl &rViewArr = SFX_APP()->GetViewShells_Impl(); - rViewArr.Remove( rViewArr.GetPos(pThis) ); + SfxViewShellArr_Impl::iterator it = std::find( rViewArr.begin(), rViewArr.end(), pThis ); + rViewArr.erase( it ); if ( pImp->xClipboardListener.is() ) { @@ -1544,17 +1544,17 @@ SfxViewShell* SfxViewShell::GetFirst // search for a SfxViewShell of the specified type SfxViewShellArr_Impl &rShells = SFX_APP()->GetViewShells_Impl(); SfxViewFrameArr_Impl &rFrames = SFX_APP()->GetViewFrames_Impl(); - for ( sal_uInt16 nPos = 0; nPos < rShells.Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < rShells.size(); ++nPos ) { - SfxViewShell *pShell = rShells.GetObject(nPos); + SfxViewShell *pShell = rShells[nPos]; if ( pShell ) { // sometimes dangling SfxViewShells exist that point to a dead SfxViewFrame // these ViewShells shouldn't be accessible anymore // a destroyed ViewFrame is not in the ViewFrame array anymore, so checking this array helps - for ( sal_uInt16 n=0; n<rFrames.Count(); ++n ) + for ( sal_uInt16 n=0; n<rFrames.size(); ++n ) { - SfxViewFrame *pFrame = rFrames.GetObject(n); + SfxViewFrame *pFrame = rFrames[n]; if ( pFrame == pShell->GetViewFrame() ) { // only ViewShells with a valid ViewFrame will be returned @@ -1582,21 +1582,21 @@ SfxViewShell* SfxViewShell::GetNext SfxViewShellArr_Impl &rShells = SFX_APP()->GetViewShells_Impl(); SfxViewFrameArr_Impl &rFrames = SFX_APP()->GetViewFrames_Impl(); sal_uInt16 nPos; - for ( nPos = 0; nPos < rShells.Count(); ++nPos ) - if ( rShells.GetObject(nPos) == &rPrev ) + for ( nPos = 0; nPos < rShells.size(); ++nPos ) + if ( rShells[nPos] == &rPrev ) break; - for ( ++nPos; nPos < rShells.Count(); ++nPos ) + for ( ++nPos; nPos < rShells.size(); ++nPos ) { - SfxViewShell *pShell = rShells.GetObject(nPos); + SfxViewShell *pShell = rShells[nPos]; if ( pShell ) { // sometimes dangling SfxViewShells exist that point to a dead SfxViewFrame // these ViewShells shouldn't be accessible anymore // a destroyed ViewFrame is not in the ViewFrame array anymore, so checking this array helps - for ( sal_uInt16 n=0; n<rFrames.Count(); ++n ) + for ( sal_uInt16 n=0; n<rFrames.size(); ++n ) { - SfxViewFrame *pFrame = rFrames.GetObject(n); + SfxViewFrame *pFrame = rFrames[n]; if ( pFrame == pShell->GetViewFrame() ) { // only ViewShells with a valid ViewFrame will be returned @@ -1626,9 +1626,9 @@ void SfxViewShell::Notify( SfxBroadcaster& rBC, { // avoid access to dangling ViewShells SfxViewFrameArr_Impl &rFrames = SFX_APP()->GetViewFrames_Impl(); - for ( sal_uInt16 n=0; n<rFrames.Count(); ++n ) + for ( sal_uInt16 n=0; n<rFrames.size(); ++n ) { - SfxViewFrame *frame = rFrames.GetObject(n); + SfxViewFrame *frame = rFrames[n]; if ( frame == GetViewFrame() && &rBC == GetObjectShell() ) { SfxItemSet* pSet = GetObjectShell()->GetMedium()->GetItemSet(); |