diff options
-rw-r--r-- | basic/source/inc/namecont.hxx | 2 | ||||
-rw-r--r-- | basic/source/uno/namecont.cxx | 25 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 18 | ||||
-rw-r--r-- | framework/source/fwe/classes/addonsoptions.cxx | 8 | ||||
-rw-r--r-- | framework/source/uielement/imagebuttontoolbarcontroller.cxx | 1 | ||||
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 40 |
6 files changed, 14 insertions, 80 deletions
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx index bcbd245dc0ec..c1c90d355bde 100644 --- a/basic/source/inc/namecont.hxx +++ b/basic/source/inc/namecont.hxx @@ -34,7 +34,6 @@ #include <com/sun/star/ucb/XSimpleFileAccess3.hpp> #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XInputStream.hpp> -#include <com/sun/star/util/XMacroExpander.hpp> #include <com/sun/star/util/XStringSubstitution.hpp> #include <com/sun/star/document/XStorageBasedDocument.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -231,7 +230,6 @@ class SfxLibraryContainer : public SfxLibraryContainer_BASE, public ::utl::OEven protected: ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 > mxSFI; - ::com::sun::star::uno::Reference< ::com::sun::star::util::XMacroExpander > mxMacroExpander; ::com::sun::star::uno::Reference< ::com::sun::star::util::XStringSubstitution > mxStringSubstitution; ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XModel > mxOwnerDocument; diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 09fc0e63ec06..d95596d7bfc5 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -31,7 +31,6 @@ #include <osl/mutex.hxx> #include <tools/errinf.hxx> #include <rtl/ustring.hxx> -#include <rtl/uri.hxx> #include <rtl/strbuf.hxx> #include <comphelper/getexpandeduri.hxx> #include <comphelper/processfactory.hxx> @@ -60,7 +59,6 @@ #include <com/sun/star/script/vba/VBAScriptEventId.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <com/sun/star/util/PathSubstitution.hpp> -#include <com/sun/star/util/theMacroExpander.hpp> #include <com/sun/star/deployment/ExtensionManager.hpp> #include <comphelper/storagehelper.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -92,8 +90,6 @@ using namespace osl; using com::sun::star::uno::Reference; -using ::rtl::Uri; - // #i34411: Flag for error handling during migration static bool GbMigrationSuppressErrors = false; @@ -1384,10 +1380,6 @@ throw(WrappedTargetException, RuntimeException) return true; } - - -#define EXPAND_PROTOCOL "vnd.sun.star.expand" - OUString SfxLibraryContainer::createAppLibraryFolder( SfxLibrary* pLib, const OUString& aName ) { OUString aLibDirPath = pLib->maStorageURL; @@ -2877,23 +2869,8 @@ void SAL_CALL SfxLibraryContainer::exportLibrary( const OUString& Name, const OU OUString SfxLibraryContainer::expand_url( const OUString& url ) throw(::com::sun::star::uno::RuntimeException) { - if (url.startsWith( EXPAND_PROTOCOL ":" )) + if (url.startsWithIgnoreAsciiCase( "vnd.sun.star.expand:" )) { - if( !mxMacroExpander.is() ) - { - Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(mxContext); - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !mxMacroExpander.is() ) - { - mxMacroExpander = xExpander; - } - } - - if( !mxMacroExpander.is() ) - { - return url; - } - return comphelper::getExpandedUri(mxContext, url); } else if( mxStringSubstitution.is() ) diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index dc0c16915a7e..05bb302140d1 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -65,7 +65,6 @@ #include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/loader/CannotActivateFactoryException.hpp> #include <com/sun/star/linguistic2/LinguProperties.hpp> -#include <com/sun/star/util/theMacroExpander.hpp> #include <com/sun/star/setup/UpdateCheck.hpp> #include <comphelper/getexpandeduri.hxx> #include <comphelper/processfactory.hxx> @@ -77,7 +76,6 @@ #include <osl/module.hxx> #include <osl/process.h> #include <rtl/bootstrap.hxx> -#include <rtl/uri.hxx> #include <sfx2/app.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/module.hxx> @@ -120,8 +118,6 @@ using namespace ::com::sun::star::linguistic2; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; -#define EXPAND_PROTOCOL "vnd.sun.star.expand:" - LastPageSaver* OfaTreeOptionsDialog::pLastPageSaver = NULL; // some stuff for easier changes for SvtViewOptions @@ -823,7 +819,6 @@ void OfaTreeOptionsDialog::ActivateLastSelection() SvTreeListEntry* pEntry = NULL; if ( pLastPageSaver ) { - OUString sExpand( EXPAND_PROTOCOL ); OUString sLastURL = bIsFromExtensionManager ? pLastPageSaver->m_sLastPageURL_ExtMgr : pLastPageSaver->m_sLastPageURL_Tools; if ( sLastURL.isEmpty() ) @@ -832,17 +827,8 @@ void OfaTreeOptionsDialog::ActivateLastSelection() : pLastPageSaver->m_sLastPageURL_Tools; } - // MacroExpander to convert "expand"-URL to "file"-URL - Reference< XMacroExpander > xMacroExpander; bool bMustExpand = ( INetURLObject( sLastURL ).GetProtocol() == INET_PROT_FILE ); - if ( bMustExpand ) - { - Reference< XComponentContext > xContext( - comphelper::getProcessComponentContext() ); - xMacroExpander = theMacroExpander::get(xContext); - } - SvTreeListEntry* pTemp = pTreeLB->First(); while( !pEntry && pTemp ) { @@ -851,9 +837,7 @@ void OfaTreeOptionsDialog::ActivateLastSelection() { OptionsPageInfo* pPageInfo = (OptionsPageInfo*)pTemp->GetUserData(); OUString sPageURL = pPageInfo->m_sPageURL; - if ( bMustExpand - && !sPageURL.isEmpty() - && sPageURL.startsWith( sExpand ) ) + if ( bMustExpand ) { sPageURL = comphelper::getExpandedUri( comphelper::getProcessComponentContext(), sPageURL); diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx index 45af778e3b78..a3e57c7f7608 100644 --- a/framework/source/fwe/classes/addonsoptions.cxx +++ b/framework/source/fwe/classes/addonsoptions.cxx @@ -24,10 +24,7 @@ #include <tools/stream.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> -#include <com/sun/star/util/theMacroExpander.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> #include <rtl/ustrbuf.hxx> -#include <rtl/uri.hxx> #include <comphelper/getexpandeduri.hxx> #include <comphelper/processfactory.hxx> #include <vcl/dibtools.hxx> @@ -339,7 +336,6 @@ class AddonsOptions_Impl : public ConfigItem AddonToolBars m_aCachedToolBarPartProperties; std::vector< OUString > m_aCachedToolBarPartResourceNames; Sequence< Sequence< PropertyValue > > m_aCachedHelpMenuProperties; - Reference< util::XMacroExpander > m_xMacroExpander; ImageManager m_aImageManager; Sequence< Sequence< PropertyValue > > m_aEmptyAddonToolBar; MergeMenuInstructionContainer m_aCachedMergeMenuInsContainer; @@ -410,10 +406,6 @@ AddonsOptions_Impl::AddonsOptions_Impl() m_aPropMergeStatusbarNames[ OFFSET_MERGESTATUSBAR_MERGECONTEXT ] = PROPERTYNAME_MERGESTATUSBAR_MERGECONTEXT; m_aPropMergeStatusbarNames[ OFFSET_MERGESTATUSBAR_STATUSBARITEMS ] = PROPERTYNAME_MERGESTATUSBAR_STATUSBARITEMS; - Reference< XComponentContext > xContext( - comphelper::getProcessComponentContext() ); - m_xMacroExpander = util::theMacroExpander::get(xContext); - ReadConfigurationData(); // Enable notification mechanism of our baseclass. diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx index 43ebc34c3817..820722b0d41b 100644 --- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx @@ -27,7 +27,6 @@ #include <com/sun/star/frame/XControlNotificationListener.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <rtl/uri.hxx> #include <osl/mutex.hxx> #include <comphelper/getexpandeduri.hxx> #include <comphelper/processfactory.hxx> diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index cd504ec4b4d2..9194c838a79e 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -27,7 +27,6 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/container/XNameReplace.hpp> -#include <rtl/uri.hxx> #include <rtl/instance.hxx> #include <osl/mutex.hxx> #include <i18nlangtag/mslangid.hxx> @@ -43,8 +42,6 @@ using namespace com::sun::star; -using ::rtl::Uri; - #define FILE_PROTOCOL "file:///" namespace @@ -927,33 +924,20 @@ static bool lcl_GetFileUrlFromOrigin( OUString /*out*/ &rFileUrl, const OUString &rOrigin ) { - bool bSuccess = false; - if (!rOrigin.isEmpty()) + OUString aURL( + comphelper::getExpandedUri( + comphelper::getProcessComponentContext(), rOrigin)); + if (aURL.startsWith( FILE_PROTOCOL )) { - OUString aURL( rOrigin ); - if ( aURL.startsWith( "vnd.sun.star.expand:" ) ) - { - aURL = comphelper::getExpandedUri( - comphelper::getProcessComponentContext(), aURL); - bool bIsFileUrl = aURL.startsWith( FILE_PROTOCOL ); - if (bIsFileUrl) - { - rFileUrl = aURL; - bSuccess = true; - } - else - { - SAL_WARN( - "unotools.config", "not a file URL, <" << aURL << ">" ); - } - } - else - { - SAL_WARN( - "unotools.config", "failed to get file URL, <" << aURL << ">" ); - } + rFileUrl = aURL; + return true; + } + else + { + SAL_WARN( + "unotools.config", "not a file URL, <" << aURL << ">" ); + return false; } - return bSuccess; } bool SvtLinguConfig::GetDictionaryEntry( |