Kaydet (Commit) 2b0244db authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Removed unnecessary SvLibrary

Change-Id: I42e64af8ed88e652341707d5f9d2da3daaa0f9bb
üst 4ae4c57c
...@@ -98,12 +98,6 @@ ...@@ -98,12 +98,6 @@
</node> </node>
</node> </node>
<node oor:name="Libraries" oor:op="fuse" oor:mandatory="true">
<node oor:name="InternalPaths">
<node oor:name="$(progpath)/libraries" oor:op="fuse" />
</node>
</node>
<node oor:name="Gallery" oor:op="fuse" oor:mandatory="true"> <node oor:name="Gallery" oor:op="fuse" oor:mandatory="true">
<node oor:name="InternalPaths"> <node oor:name="InternalPaths">
<node oor:name="$(insturl)/share/gallery" oor:op="fuse" /> <node oor:name="$(insturl)/share/gallery" oor:op="fuse" />
......
...@@ -106,7 +106,6 @@ ...@@ -106,7 +106,6 @@
#include "sfx2/stbitem.hxx" #include "sfx2/stbitem.hxx"
#include "eventsupplier.hxx" #include "eventsupplier.hxx"
#include <sfx2/dockwin.hxx> #include <sfx2/dockwin.hxx>
#include <tools/svlibrary.hxx>
#ifdef DBG_UTIL #ifdef DBG_UTIL
#include <sfx2/mnuitem.hxx> #include <sfx2/mnuitem.hxx>
......
...@@ -74,7 +74,6 @@ ...@@ -74,7 +74,6 @@
#include <sfx2/fcontnr.hxx> #include <sfx2/fcontnr.hxx>
#include "helper.hxx" // SfxContentHelper::Kill() #include "helper.hxx" // SfxContentHelper::Kill()
#include "sfxpicklist.hxx" #include "sfxpicklist.hxx"
#include <tools/svlibrary.hxx>
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::frame; using namespace ::com::sun::star::frame;
......
...@@ -124,7 +124,6 @@ ...@@ -124,7 +124,6 @@
#include <sfx2/dialogs.hrc> #include <sfx2/dialogs.hrc>
#include "sorgitm.hxx" #include "sorgitm.hxx"
#include "sfx2/sfxhelp.hxx" #include "sfx2/sfxhelp.hxx"
#include <tools/svlibrary.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::beans; using namespace ::com::sun::star::beans;
......
...@@ -67,7 +67,6 @@ ...@@ -67,7 +67,6 @@
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/util/XMacroExpander.hpp> #include <com/sun/star/util/XMacroExpander.hpp>
#include <rtl/uri.hxx> #include <rtl/uri.hxx>
#include <tools/svlibrary.hxx>
using namespace utl; using namespace utl;
using rtl::OUString; using rtl::OUString;
...@@ -162,9 +161,11 @@ Filters::~Filters() ...@@ -162,9 +161,11 @@ Filters::~Filters()
oslGenericFunction Filters::GetMswordLibSymbol( const char *pSymbol ) oslGenericFunction Filters::GetMswordLibSymbol( const char *pSymbol )
{ {
static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "msword" ) ) );
if (!msword_.is()) if (!msword_.is())
SvLibrary::LoadModule( msword_, aLibName, &thisModule, SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ); {
bool ok = msword_.loadRelative( &thisModule, SVLIBRARY( "msword" ), SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY );
SAL_WARN_IF(!ok, "sw", "failed to load msword library");
}
if (msword_.is()) if (msword_.is())
return msword_.getFunctionSymbol( ::rtl::OUString::createFromAscii( pSymbol ) ); return msword_.getFunctionSymbol( ::rtl::OUString::createFromAscii( pSymbol ) );
return NULL; return NULL;
......
...@@ -81,7 +81,6 @@ $(eval $(call gb_Library_add_exception_objects,tl,\ ...@@ -81,7 +81,6 @@ $(eval $(call gb_Library_add_exception_objects,tl,\
tools/source/generic/poly2 \ tools/source/generic/poly2 \
tools/source/generic/svborder \ tools/source/generic/svborder \
tools/source/generic/toolsin \ tools/source/generic/toolsin \
tools/source/generic/svlibrary \
tools/source/inet/inetmime \ tools/source/inet/inetmime \
tools/source/inet/inetmsg \ tools/source/inet/inetmsg \
tools/source/inet/inetstrm \ tools/source/inet/inetstrm \
......
...@@ -82,7 +82,6 @@ $(eval $(call gb_Package_add_file,tools_inc,inc/tools/solarmutex.hxx,tools/solar ...@@ -82,7 +82,6 @@ $(eval $(call gb_Package_add_file,tools_inc,inc/tools/solarmutex.hxx,tools/solar
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/stream.hxx,tools/stream.hxx)) $(eval $(call gb_Package_add_file,tools_inc,inc/tools/stream.hxx,tools/stream.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/string.hxx,tools/string.hxx)) $(eval $(call gb_Package_add_file,tools_inc,inc/tools/string.hxx,tools/string.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/svborder.hxx,tools/svborder.hxx)) $(eval $(call gb_Package_add_file,tools_inc,inc/tools/svborder.hxx,tools/svborder.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/svlibrary.hxx,tools/svlibrary.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/tempfile.hxx,tools/tempfile.hxx)) $(eval $(call gb_Package_add_file,tools_inc,inc/tools/tempfile.hxx,tools/tempfile.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/tenccvt.hxx,tools/tenccvt.hxx)) $(eval $(call gb_Package_add_file,tools_inc,inc/tools/tenccvt.hxx,tools/tenccvt.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/time.hxx,tools/time.hxx)) $(eval $(call gb_Package_add_file,tools_inc,inc/tools/time.hxx,tools/time.hxx))
......
/* -*- 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 _SVLIBRARY_HXX
#define _SVLIBRARY_HXX
#include "tools/toolsdllapi.h"
#include <osl/module.hxx>
#include <rtl/ustring.hxx>
class TOOLS_DLLPUBLIC SvLibrary
{
public:
static bool LoadModule( osl::Module&, const rtl::OUString& rLibName, ::oslGenericFunction baseModule, ::sal_Int32 mode = SAL_LOADMODULE_DEFAULT );
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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/svlibrary.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <comphelper/processfactory.hxx>
#include <tools/string.hxx>
#include <rtl/uri.hxx>
using namespace com::sun::star;
static uno::Sequence< rtl::OUString > GetMultiPaths_Impl()
{
uno::Sequence< rtl::OUString > aRes;
uno::Sequence< rtl::OUString > aInternalPaths;
uno::Sequence< rtl::OUString > aUserPaths;
bool bSuccess = true;
uno::Reference< lang::XMultiServiceFactory > xMgr( comphelper::getProcessServiceFactory() );
if (xMgr.is())
{
try
{
String aInternal;
aInternal.AppendAscii("Libraries");
String aUser;
aUser.AppendAscii("Libraries");
aInternal .AppendAscii( "_internal" );
aUser .AppendAscii( "_user" );
uno::Reference< beans::XPropertySet > xPathSettings( xMgr->createInstance(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.PathSettings" )) ), uno::UNO_QUERY_THROW );
xPathSettings->getPropertyValue( aInternal ) >>= aInternalPaths;
xPathSettings->getPropertyValue( aUser ) >>= aUserPaths;
}
catch (const uno::Exception &)
{
bSuccess = false;
}
}
if (bSuccess)
{
sal_Int32 nMaxEntries = aInternalPaths.getLength() + aUserPaths.getLength();
aRes.realloc( nMaxEntries );
rtl::OUString *pRes = aRes.getArray();
sal_Int32 nCount = 0; // number of actually added entries
for (int i = 0; i < 2; ++i)
{
const uno::Sequence< rtl::OUString > &rPathSeq = i == 0 ? aUserPaths : aInternalPaths;
const rtl::OUString *pPathSeq = rPathSeq.getConstArray();
for (sal_Int32 k = 0; k < rPathSeq.getLength(); ++k)
{
const bool bAddUser = (&rPathSeq == &aUserPaths);
const bool bAddInternal = (&rPathSeq == &aInternalPaths);
if ((bAddUser || bAddInternal) && !pPathSeq[k].isEmpty())
pRes[ nCount++ ] = pPathSeq[k];
}
}
aRes.realloc( nCount );
}
return aRes;
}
bool SvLibrary::LoadModule( osl::Module& rModule, const rtl::OUString& rLibName, ::oslGenericFunction baseModule, ::sal_Int32 mode )
{
static uno::Sequence < rtl::OUString > aPaths = GetMultiPaths_Impl();
bool bLoaded = false;
for (sal_Int32 n=0; n<aPaths.getLength(); n++)
{
rtl::OUString aMod = aPaths[n];
if ( aPaths[n].indexOfAsciiL("vnd.sun.star.expand",19) == 0)
{
uno::Reference< uno::XComponentContext > xComponentContext = comphelper::getProcessComponentContext();
uno::Reference< util::XMacroExpander > xMacroExpander;
xComponentContext->getValueByName(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.util.theMacroExpander") ) )
>>= xMacroExpander;
aMod = aMod.copy( sizeof("vnd.sun.star.expand:") -1 );
aMod = ::rtl::Uri::decode( aMod, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
aMod = xMacroExpander->expandMacros( aMod );
}
aMod += ::rtl::OUString( sal_Unicode('/') );
aMod += rLibName;
bLoaded = rModule.load( aMod, mode );
if ( bLoaded )
break;
}
if (!bLoaded )
bLoaded = rModule.loadRelative( baseModule, rLibName, mode );
return bLoaded;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment