summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/prj/build.lst2
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx114
-rw-r--r--xmlhelp/source/cxxhelp/provider/provider.cxx30
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx2
-rw-r--r--xmlhelp/source/treeview/makefile.mk3
-rw-r--r--xmlhelp/source/treeview/tvread.cxx46
-rw-r--r--xmlhelp/util/makefile.mk8
7 files changed, 133 insertions, 72 deletions
diff --git a/xmlhelp/prj/build.lst b/xmlhelp/prj/build.lst
index 3f468f593a1a..6fd64bb01730 100644
--- a/xmlhelp/prj/build.lst
+++ b/xmlhelp/prj/build.lst
@@ -1,4 +1,4 @@
-xh xmlhelp : ucbhelper transex3 LIBXSLT:libxslt unoil BERKELEYDB:berkeleydb svtools LUCENE:lucene unotools javaunohelper NULL
+xh xmlhelp : comphelper ucbhelper LIBXSLT:libxslt unoil BERKELEYDB:berkeleydb LUCENE:lucene javaunohelper transex3 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/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 1de0bc80ee73..467dd1539fed 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -40,7 +40,6 @@
#include <rtl/memory.h>
#include <com/sun/star/lang/Locale.hpp>
#include <rtl/ustrbuf.hxx>
-#include <svtools/miscopt.hxx>
#include "inputstream.hxx"
#include <algorithm>
#include <string.h>
@@ -52,6 +51,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/beans/Optional.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
@@ -149,7 +149,6 @@ struct ImplPackageSequenceHolder
static ImplPackageSequenceHolder* GpPackageSequenceHolder = NULL;
-
Databases::Databases( sal_Bool showBasic,
const rtl::OUString& instPath,
const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths,
@@ -200,7 +199,6 @@ Databases::Databases( sal_Bool showBasic,
m_xSFA = Reference< ucb::XSimpleFileAccess >(
m_xSMgr->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
m_xContext ), UNO_QUERY_THROW );
-
GpPackageSequenceHolder = new ImplPackageSequenceHolder();
}
@@ -281,42 +279,71 @@ static bool impl_getZipFile(
rtl::OString Databases::getImagesZipFileURL()
{
- sal_Int16 nSymbolsStyle = SvtMiscOptions().GetCurrentSymbolsStyle();
- if ( !m_aImagesZipFileURL.getLength() || ( m_nSymbolsStyle != nSymbolsStyle ) )
+ //sal_Int16 nSymbolsStyle = SvtMiscOptions().GetCurrentSymbolsStyle();
+ sal_Int16 nSymbolsStyle = 0;
+ try
{
- m_nSymbolsStyle = nSymbolsStyle;
-
- rtl::OUString aImageZip;
- rtl::OUString aSymbolsStyleName = SvtMiscOptions().GetCurrentSymbolsStyleName();
- bool bFound = false;
+ uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
+ m_xSMgr ->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"), m_xContext), uno::UNO_QUERY_THROW);
+
+ // set root path
+ uno::Sequence < uno::Any > lParams(1);
+ beans::PropertyValue aParam ;
+ aParam.Name = ::rtl::OUString::createFromAscii("nodepath");
+ aParam.Value <<= ::rtl::OUString::createFromAscii("org.openoffice.Office.Common");
+ lParams[0] = uno::makeAny(aParam);
+
+ // open it
+ uno::Reference< uno::XInterface > xCFG( xConfigProvider->createInstanceWithArguments(
+ ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"),
+ lParams) );
+
+ bool bChanged = false;
+ uno::Reference< container::XHierarchicalNameAccess > xAccess(xCFG, uno::UNO_QUERY_THROW);
+ uno::Any aResult = xAccess->getByHierarchicalName(::rtl::OUString::createFromAscii("Misc/SymbolSet"));
+ if ( (aResult >>= nSymbolsStyle) && m_nSymbolsStyle != nSymbolsStyle )
+ {
+ m_nSymbolsStyle = nSymbolsStyle;
+ bChanged = true;
+ }
- if ( aSymbolsStyleName.getLength() != 0 )
+ if ( !m_aImagesZipFileURL.getLength() || bChanged )
{
- rtl::OUString aZipName = rtl::OUString::createFromAscii( "images_" );
- aZipName += aSymbolsStyleName;
- aZipName += rtl::OUString::createFromAscii( ".zip" );
+ rtl::OUString aImageZip, aSymbolsStyleName;
+ aResult = xAccess->getByHierarchicalName(::rtl::OUString::createFromAscii("Misc/SymbolStyle"));
+ aResult >>= aSymbolsStyleName;
- bFound = impl_getZipFile( m_aImagesZipPaths, aZipName, aImageZip );
- }
+ bool bFound = false;
+ if ( aSymbolsStyleName.getLength() != 0 )
+ {
+ rtl::OUString aZipName = rtl::OUString::createFromAscii( "images_" );
+ aZipName += aSymbolsStyleName;
+ aZipName += rtl::OUString::createFromAscii( ".zip" );
- if ( ! bFound )
- bFound = impl_getZipFile( m_aImagesZipPaths, rtl::OUString::createFromAscii( "images.zip" ), aImageZip );
+ bFound = impl_getZipFile( m_aImagesZipPaths, aZipName, aImageZip );
+ }
- if ( ! bFound )
- aImageZip = rtl::OUString();
+ if ( ! bFound )
+ bFound = impl_getZipFile( m_aImagesZipPaths, rtl::OUString::createFromAscii( "images.zip" ), aImageZip );
- m_aImagesZipFileURL = rtl::OUStringToOString(
- rtl::Uri::encode(
- aImageZip,
- rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 ), RTL_TEXTENCODING_UTF8 );
+ if ( ! bFound )
+ aImageZip = rtl::OUString();
+
+ m_aImagesZipFileURL = rtl::OUStringToOString(
+ rtl::Uri::encode(
+ aImageZip,
+ rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 ), RTL_TEXTENCODING_UTF8 );
+ }
+ }
+ catch ( NoSuchElementException const & )
+ {
}
return m_aImagesZipFileURL;
}
-
void Databases::replaceName( rtl::OUString& oustring ) const
{
sal_Int32 idx = -1,idx1 = -1,idx2 = -1,k = 0,off;
@@ -818,10 +845,6 @@ void KeywordInfo::KeywordElement::init( Databases *pDatabases,Db* pDb,const rtl:
for( sal_uInt32 i = 0; i < id.size(); ++i )
{
- // the following object must live longer than the
- // pointer returned by aDBData.getData()
- DBData aDBData;
-
listId[i] = id[i];
listAnchor[i] = anchor[i];
@@ -833,6 +856,7 @@ void KeywordInfo::KeywordElement::init( Databases *pDatabases,Db* pDb,const rtl:
DBHelp* pDBHelp = pDb->getDBHelp();
if( pDBHelp != NULL )
{
+ DBData aDBData;
bool bSuccess = pDBHelp->getValueForKey( idi, aDBData );
if( bSuccess )
{
@@ -1629,14 +1653,14 @@ rtl::OUString ExtensionIteratorBase::implGetFileFromPackage(
::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;
}
}
return aFile;
@@ -1653,7 +1677,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();
@@ -1677,7 +1701,7 @@ void ExtensionIteratorBase::implGetLanguageVectorFromPackage( ::std::vector< ::r
rv.push_back( aPureEntry );
}
}
- }
+ }
}
@@ -1748,15 +1772,15 @@ Db* DataBaseIterator::implGetDbFromPackage( Reference< deployment::XPackage > xP
::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() )
+ if( pFound != av.end() )
{
- aUsedLanguage = *pFound;
+ aUsedLanguage = *pFound;
pRetDb = m_rDatabases.getBerkeley( aHelpFilesBaseName, aUsedLanguage, m_bHelpText, &aExtensionPath );
}
}
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/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index c8685645c6fd..b9521c85dc89 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -1015,7 +1015,7 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
::rtl::OUString aExtensionPath;
rtl::OUString aJar = urlParam->get_jar();
- bool bAddExtensionPath = false;
+ bool bAddExtensionPath = false;
sal_Int32 nQuestionMark1 = aJar.indexOf( sal_Unicode('?') );
sal_Int32 nQuestionMark2 = aJar.lastIndexOf( sal_Unicode('?') );
if( nQuestionMark1 != -1 && nQuestionMark2 != -1 && nQuestionMark1 != nQuestionMark2 )
diff --git a/xmlhelp/source/treeview/makefile.mk b/xmlhelp/source/treeview/makefile.mk
index 8334f233a0ef..4541a1745b53 100644
--- a/xmlhelp/source/treeview/makefile.mk
+++ b/xmlhelp/source/treeview/makefile.mk
@@ -61,8 +61,7 @@ SHL1STDLIBS=\
$(CPPULIB) \
$(COMPHELPERLIB) \
$(EXPATASCII3RDLIB) \
- $(SALLIB) \
- $(UNOTOOLSLIB)
+ $(SALLIB)
SHL1VERSIONMAP= $(TARGET).map
DEF1NAME=$(SHL1TARGET)
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;
}
}
diff --git a/xmlhelp/util/makefile.mk b/xmlhelp/util/makefile.mk
index 8b2a95171345..a16e7958d796 100644
--- a/xmlhelp/util/makefile.mk
+++ b/xmlhelp/util/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -64,10 +64,8 @@ SHL1STDLIBS= \
$(SALLIB) \
$(EXPATASCII3RDLIB) \
$(UCBHELPERLIB) \
- $(SVTOOLLIB) \
- $(BERKELEYLIB) \
- $(XSLTLIB) \
- $(UNOTOOLSLIB)
+ $(BERKELEYLIB) \
+ $(XSLTLIB)
SHL1LIBS = \
$(SLB)$/jaqe.lib \