summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-09-17 10:46:21 +0200
committerMathias Bauer <mba@openoffice.org>2009-09-17 10:46:21 +0200
commit578685396a65e5e19051d9c7f408379c62d9adcf (patch)
tree1307a8380247e8a7e210f1f6d0ddf870ac966c08 /xmlhelp
parent874e8bf6b141f53e1536a9816cfd90cc044aeb49 (diff)
#i103496#: remove dependency on unotools
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/prj/build.lst2
-rw-r--r--xmlhelp/source/cxxhelp/provider/provider.cxx30
-rw-r--r--xmlhelp/source/treeview/tvread.cxx46
3 files changed, 59 insertions, 19 deletions
diff --git a/xmlhelp/prj/build.lst b/xmlhelp/prj/build.lst
index 08b320d8302c..6a3c15fbf972 100644
--- a/xmlhelp/prj/build.lst
+++ b/xmlhelp/prj/build.lst
@@ -1,4 +1,4 @@
-xh xmlhelp : ucbhelper LIBXSLT:libxslt unoil BERKELEYDB:berkeleydb LUCENE:lucene unotools javaunohelper NULL
+xh xmlhelp : ucbhelper LIBXSLT:libxslt unoil BERKELEYDB:berkeleydb LUCENE:lucene javaunohelper NULL
xh xmlhelp usr1 - all xh_mkout NULL
xh xmlhelp\inc nmake - all xh_inc NULL
xh xmlhelp\source\treeview nmake - all xh_treeview xh_inc NULL
diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx
index da5c4db374c1..9718d17c3844 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.cxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.cxx
@@ -55,7 +55,6 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <rtl/bootstrap.hxx>
-#include <unotools/configmgr.hxx>
#include "databases.hxx"
#include "provider.hxx"
@@ -324,11 +323,32 @@ void ContentProvider::init()
rtl::OUString setupversion(
getKey( xHierAccess,"Product/ooSetupVersion" ) );
rtl::OUString setupextension;
- utl::ConfigManager * mgr = utl::ConfigManager::GetConfigManager();
- if (mgr != NULL) {
- mgr->GetDirectConfigProperty(utl::ConfigManager::PRODUCTEXTENSION) >>=
- setupextension;
+
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
+ m_xSMgr ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), uno::UNO_QUERY_THROW);
+
+ uno::Sequence < uno::Any > lParams(1);
+ beans::PropertyValue aParam ;
+ aParam.Name = ::rtl::OUString::createFromAscii("nodepath");
+ aParam.Value <<= ::rtl::OUString::createFromAscii("/org.openoffice.Setup/Product");
+ lParams[0] = uno::makeAny(aParam);
+
+ // open it
+ uno::Reference< uno::XInterface > xCFG( xConfigProvider->createInstanceWithArguments(
+ ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"),
+ lParams) );
+
+ uno::Reference< container::XNameAccess > xDirectAccess(xCFG, uno::UNO_QUERY);
+ uno::Any aRet = xDirectAccess->getByName(::rtl::OUString::createFromAscii("ooSetupExtension"));
+
+ aRet >>= setupextension;
}
+ catch ( uno::Exception& )
+ {
+ }
+
rtl::OUString productversion(
setupversion +
rtl::OUString::createFromAscii( " " ) +
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 62ec993e485d..d610bd7e7cfb 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -44,7 +44,6 @@
#include <expat/xmlparse.h>
#endif
#include <osl/file.hxx>
-#include <unotools/configmgr.hxx>
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/PropertyState.hpp>
@@ -708,11 +707,32 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
rtl::OUString productName( getKey( xHierAccess,"Product/ooName" ) );
setupversion = getKey( xHierAccess,"Product/ooSetupVersion" );
setupextension = rtl::OUString();
- utl::ConfigManager * mgr = utl::ConfigManager::GetConfigManager();
- if (mgr != NULL) {
- mgr->GetDirectConfigProperty(utl::ConfigManager::PRODUCTEXTENSION) >>=
- setupextension;
+
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
+ xSMgr ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), uno::UNO_QUERY_THROW);
+
+ uno::Sequence < uno::Any > lParams(1);
+ beans::PropertyValue aParam ;
+ aParam.Name = ::rtl::OUString::createFromAscii("nodepath");
+ aParam.Value <<= ::rtl::OUString::createFromAscii("/org.openoffice.Setup/Product");
+ lParams[0] = uno::makeAny(aParam);
+
+ // open it
+ uno::Reference< uno::XInterface > xCFG( xConfigProvider->createInstanceWithArguments(
+ ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"),
+ lParams) );
+
+ uno::Reference< container::XNameAccess > xDirectAccess(xCFG, uno::UNO_QUERY);
+ uno::Any aRet = xDirectAccess->getByName(::rtl::OUString::createFromAscii("ooSetupExtension"));
+
+ aRet >>= setupextension;
}
+ catch ( uno::Exception& )
+ {
+ }
+
rtl::OUString productVersion( setupversion +
rtl::OUString::createFromAscii( " " ) +
setupextension );
@@ -1129,7 +1149,7 @@ void ExtensionIteratorBase::implGetLanguageVectorFromPackage( ::std::vector< ::r
{
rv.clear();
rtl::OUString aExtensionPath = xPackage->getURL();
- Sequence< rtl::OUString > aEntrySeq = m_xSFA->getFolderContents( aExtensionPath, true );
+ Sequence< rtl::OUString > aEntrySeq = m_xSFA->getFolderContents( aExtensionPath, true );
const rtl::OUString* pSeq = aEntrySeq.getConstArray();
sal_Int32 nCount = aEntrySeq.getLength();
@@ -1153,7 +1173,7 @@ void ExtensionIteratorBase::implGetLanguageVectorFromPackage( ::std::vector< ::r
rv.push_back( aPureEntry );
}
}
- }
+ }
}
@@ -1269,14 +1289,14 @@ rtl::OUString TreeFileIterator::implGetTreeFileFromPackage
::std::vector< ::rtl::OUString > av;
implGetLanguageVectorFromPackage( av, xPackage );
::std::vector< ::rtl::OUString >::const_iterator pFound = av.end();
- try
- {
- pFound = ::comphelper::Locale::getFallback( av, m_aLanguage );
- }
+ try
+ {
+ pFound = ::comphelper::Locale::getFallback( av, m_aLanguage );
+ }
catch( ::comphelper::Locale::MalFormedLocaleException& )
{}
- if( pFound != av.end() )
- aLanguage = *pFound;
+ if( pFound != av.end() )
+ aLanguage = *pFound;
}
}