summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-01-05 13:09:26 +0100
committersb <sb@openoffice.org>2010-01-05 13:09:26 +0100
commita44418ec3038019bfdffa8e1df3a0a080f74b0a9 (patch)
tree6d6c5dd4243b39d2e0c35835a656cafe0a30f066 /xmlhelp
parentd9164f354a8951ad220d5ae937517228296d1922 (diff)
parent0de34b05f3c1a0409d23b63b9e69d4d7abbe1090 (diff)
sb111: merged in DEV300_m68
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/prj/build.lst2
-rw-r--r--xmlhelp/source/com/sun/star/help/MANIFEST.MF1
-rw-r--r--xmlhelp/source/com/sun/star/help/makefile.mk12
-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.cxx51
-rw-r--r--xmlhelp/util/makefile.mk8
9 files changed, 142 insertions, 81 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/com/sun/star/help/MANIFEST.MF b/xmlhelp/source/com/sun/star/help/MANIFEST.MF
index bf0e4ab46cb2..a4c5d50fde5c 100644
--- a/xmlhelp/source/com/sun/star/help/MANIFEST.MF
+++ b/xmlhelp/source/com/sun/star/help/MANIFEST.MF
@@ -1,2 +1 @@
RegistrationClassName: com.sun.star.help.HelpComponent
-Class-Path: lucene-core-2.3.jar lucene-analyzers-2.3.jar
diff --git a/xmlhelp/source/com/sun/star/help/makefile.mk b/xmlhelp/source/com/sun/star/help/makefile.mk
index db6e619b31e3..eab2a6a08a4d 100644
--- a/xmlhelp/source/com/sun/star/help/makefile.mk
+++ b/xmlhelp/source/com/sun/star/help/makefile.mk
@@ -36,6 +36,7 @@ LIBBASENAME = helplinker
PACKAGE = com$/sun$/star$/help
TARGETTYPE=CUI
+.IF "$(SOLAR_JAVA)"!=""
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -76,14 +77,15 @@ ADDFILES = $(subst,$(SOLARBINDIR)$/help,$(CLASSDIR) $(TRANSEX3FILES))
JARFILES = ridl.jar jurt.jar unoil.jar juh.jar
.IF "$(SYSTEM_LUCENE)" == "YES"
XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR)
-COMP=fix_system_lucene
+JARCLASSPATH = file://$(LUCENE_CORE_JAR) file://$(LUCENE_ANALYZERS_JAR)
.ELSE
JARFILES += lucene-core-2.3.jar lucene-analyzers-2.3.jar
+JARCLASSPATH = lucene-core-2.3.jar lucene-analyzers-2.3.jar
.ENDIF
JARTARGET = LuceneHelpWrapper.jar
JARCOMPRESS = TRUE
-CUSTOMMANIFESTFILE = MANIFEST.MF
+CUSTOMMANIFESTFILE = MANIFEST.MF
# --- Targets ------------------------------------------------------
@@ -94,15 +96,17 @@ ALLTAR : $(ADDFILES)
.IF "$(JARTARGETN)"!=""
$(JAVATARGET) : $(ADDFILES)
$(JARTARGETN) : $(ADDFILES)
-$(JARTARGETN) : $(COMP)
.ENDIF
$(CLASSDIR)$/$(PACKAGE)$/%.class : $(SOLARBINDIR)$/help$/$(PACKAGE)$/%.class
$(MKDIRHIER) $(@:d)
$(COPY) $< $@
-
fix_system_lucene:
@echo "Fix Java Class-Path entry for Lucene libraries from system."
@$(SED) -r -e "s#^(Class-Path:).*#\1 file://$(LUCENE_CORE_JAR) file://$(LUCENE_ANALYZERS_JAR)#" \
-i ../../../../../$(INPATH)/class/HelpLinker/META-INF/MANIFEST.MF
+.ELSE
+all:
+ @echo java disabled
+.ENDIF
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 0f92d909d525..8be277e807be 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,
@@ -195,7 +194,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();
}
@@ -276,42 +274,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;
@@ -813,10 +840,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];
@@ -828,6 +851,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 )
{
@@ -1624,14 +1648,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;
@@ -1648,7 +1672,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();
@@ -1672,7 +1696,7 @@ void ExtensionIteratorBase::implGetLanguageVectorFromPackage( ::std::vector< ::r
rv.push_back( aPureEntry );
}
}
- }
+ }
}
@@ -1743,15 +1767,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 d2f270452bcc..25c74b172797 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.cxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.cxx
@@ -54,7 +54,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"
@@ -320,11 +319,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 907da892ef1e..098c032b44be 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -1006,7 +1006,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 77bf3bf490ad..29e01cb06ea8 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -38,14 +38,10 @@
#include <vos/diagnose.hxx>
#endif
#include "tvread.hxx"
-#ifdef SYSTEM_EXPAT
#include <expat.h>
-#else
-#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 <comphelper/processfactory.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -690,11 +686,32 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
rtl::OUString productName( getKey( xHierAccess,"Product/ooName" ) );
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(
+ 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 );
@@ -1099,7 +1116,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();
@@ -1123,7 +1140,7 @@ void ExtensionIteratorBase::implGetLanguageVectorFromPackage( ::std::vector< ::r
rv.push_back( aPureEntry );
}
}
- }
+ }
}
@@ -1239,14 +1256,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 \