diff options
author | sb <sb@openoffice.org> | 2010-01-05 13:09:26 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-01-05 13:09:26 +0100 |
commit | 3802bb155e4431f6830fe7fa931f96fcc4e4af05 (patch) | |
tree | 07e6b9e3d5185bc613c7883f96807245a167a58e /xmlhelp | |
parent | 218d284b4d8073e2582d09dd9b2f9cbb0aa240d6 (diff) | |
parent | 680e0f04cd5ffb447d9525200e7a3fadb2a760d6 (diff) |
sb111: merged in DEV300_m68
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/prj/build.lst | 2 | ||||
-rw-r--r-- | xmlhelp/source/com/sun/star/help/MANIFEST.MF | 1 | ||||
-rw-r--r-- | xmlhelp/source/com/sun/star/help/makefile.mk | 12 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 114 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/provider.cxx | 140 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 2 | ||||
-rw-r--r-- | xmlhelp/source/treeview/makefile.mk | 3 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 51 | ||||
-rw-r--r-- | xmlhelp/util/makefile.mk | 8 |
9 files changed, 197 insertions, 136 deletions
diff --git a/xmlhelp/prj/build.lst b/xmlhelp/prj/build.lst index 3f468f593a..6fd64bb017 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 bf0e4ab46c..a4c5d50fde 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 db6e619b31..eab2a6a08a 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 f88392a3db..ef31192b45 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 258a402790..c49f5daea0 100644 --- a/xmlhelp/source/cxxhelp/provider/provider.cxx +++ b/xmlhelp/source/cxxhelp/provider/provider.cxx @@ -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 @@ -51,10 +51,9 @@ #include <com/sun/star/container/XContainer.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameReplace.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> +#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" @@ -72,7 +71,7 @@ using namespace chelp; //========================================================================= //========================================================================= -ContentProvider::ContentProvider( +ContentProvider::ContentProvider( const uno::Reference< lang::XMultiServiceFactory >& rSMgr ) : ::ucbhelper::ContentProviderImplHelper( rSMgr ), isInitialized( false ), @@ -193,8 +192,8 @@ ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider ); //========================================================================= // virtual -uno::Reference< ucb::XContent > SAL_CALL -ContentProvider::queryContent( +uno::Reference< ucb::XContent > SAL_CALL +ContentProvider::queryContent( const uno::Reference< ucb::XContentIdentifier >& xCanonicId ) throw( ucb::IllegalIdentifierException, uno::RuntimeException ) { @@ -203,43 +202,43 @@ ContentProvider::queryContent( { // Wrong URL-scheme throw ucb::IllegalIdentifierException(); } - + { osl::MutexGuard aGuard( m_aMutex ); if( !isInitialized ) init(); } - + if( !m_pDatabases ) throw uno::RuntimeException(); - + rtl::OUString aOUString( m_pDatabases->getInstallPathAsURL() ); rtl::OString aOString( aOUString.getStr(), aOUString.getLength(), RTL_TEXTENCODING_UTF8 ); - + // Check, if a content with given id already exists... uno::Reference< ucb::XContent > xContent = queryExistingContent( xCanonicId ).get(); if ( xContent.is() ) return xContent; - + xContent = new Content( m_xSMgr, this, xCanonicId, m_pDatabases ); // register new content registerNewContent( xContent ); // Further checks - + if ( !xContent->getIdentifier().is() ) throw ucb::IllegalIdentifierException(); - + return xContent; } void SAL_CALL ContentProvider::dispose() - throw ( uno::RuntimeException) + throw ( uno::RuntimeException) { if(m_xContainer.is()) { @@ -249,7 +248,7 @@ ContentProvider::dispose() } void SAL_CALL -ContentProvider::elementReplaced(const container::ContainerEvent& Event) +ContentProvider::elementReplaced(const container::ContainerEvent& Event) throw (uno::RuntimeException) { if(!m_pDatabases) @@ -259,25 +258,25 @@ ContentProvider::elementReplaced(const container::ContainerEvent& Event) Event.Accessor >>= accessor; if(accessor.compareToAscii("HelpStyleSheet")) return; - + rtl::OUString replacedElement,element; Event.ReplacedElement >>= replacedElement; Event.Element >>= element; - + if(replacedElement == element) return; - + m_pDatabases->changeCSS(element); } void ContentProvider::init() { osl::MutexGuard aGuard( m_aMutex ); - + isInitialized = true; - uno::Reference< lang::XMultiServiceFactory > sProvider( + uno::Reference< lang::XMultiServiceFactory > sProvider( getConfiguration() ); - uno::Reference< container::XHierarchicalNameAccess > xHierAccess( + uno::Reference< container::XHierarchicalNameAccess > xHierAccess( getHierAccess( sProvider, "org.openoffice.Office.Common" ) ); @@ -287,14 +286,14 @@ void ContentProvider::init() instPath = rtl::OUString::createFromAscii( "$(instpath)/help" ); // replace anything like $(instpath); subst( instPath ); - + rtl::OUString stylesheet( getKey( xHierAccess,"Help/HelpStyleSheet" ) ); - try + try { // now adding as configuration change listener for the stylesheet uno::Reference< container::XNameAccess> xAccess( - xHierAccess, uno::UNO_QUERY ); - if( xAccess.is() ) + xHierAccess, uno::UNO_QUERY ); + if( xAccess.is() ) { uno::Any aAny = xAccess->getByName( rtl::OUString::createFromAscii( "Help" ) ); @@ -302,37 +301,58 @@ void ContentProvider::init() if( m_xContainer.is() ) m_xContainer->addContainerListener( this ); } - } - catch( uno::Exception const & ) + } + catch( uno::Exception const & ) { } - + /** * now determing * productname, * productversion, */ - + xHierAccess = getHierAccess( sProvider, "org.openoffice.Setup" ); - rtl::OUString productname( + rtl::OUString productname( getKey( xHierAccess,"Product/ooName" ) ); - rtl::OUString setupversion( + 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; } - rtl::OUString productversion( - setupversion + + catch ( uno::Exception& ) + { + } + + rtl::OUString productversion( + setupversion + rtl::OUString::createFromAscii( " " ) + setupextension ); - + uno::Sequence< rtl::OUString > aImagesZipPaths( 2 ); xHierAccess = getHierAccess( sProvider, "org.openoffice.Office.Common" ); - + rtl::OUString aPath( getKey( xHierAccess, "Path/Current/UserConfig" ) ); subst( aPath ); aImagesZipPaths[ 0 ] = aPath; @@ -350,18 +370,18 @@ void ContentProvider::init() ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xContext; OSL_ASSERT( xContext.is() ); } - + sal_Bool showBasic = getBooleanKey(xHierAccess,"Help/ShowBasic"); - m_pDatabases = new Databases( showBasic, + m_pDatabases = new Databases( showBasic, instPath, aImagesZipPaths, productname, productversion, stylesheet, - xContext ); + xContext ); } -uno::Reference< lang::XMultiServiceFactory > +uno::Reference< lang::XMultiServiceFactory > ContentProvider::getConfiguration() const { uno::Reference< lang::XMultiServiceFactory > sProvider; @@ -370,7 +390,7 @@ ContentProvider::getConfiguration() const try { rtl::OUString sProviderService = - rtl::OUString::createFromAscii( + rtl::OUString::createFromAscii( "com.sun.star.configuration.ConfigurationProvider" ); sProvider = uno::Reference< lang::XMultiServiceFactory >( @@ -382,31 +402,31 @@ ContentProvider::getConfiguration() const OSL_ENSURE( sProvider.is(), "cant instantiate configuration" ); } } - + return sProvider; } uno::Reference< container::XHierarchicalNameAccess > -ContentProvider::getHierAccess( +ContentProvider::getHierAccess( const uno::Reference< lang::XMultiServiceFactory >& sProvider, const char* file ) const { uno::Reference< container::XHierarchicalNameAccess > xHierAccess; - + if( sProvider.is() ) { uno::Sequence< uno::Any > seq( 1 ); rtl::OUString sReaderService( - rtl::OUString::createFromAscii( + rtl::OUString::createFromAscii( "com.sun.star.configuration.ConfigurationAccess" ) ); - - seq[ 0 ] <<= rtl::OUString::createFromAscii( file ); - + + seq[ 0 ] <<= rtl::OUString::createFromAscii( file ); + try { - xHierAccess = - uno::Reference< container::XHierarchicalNameAccess >( - sProvider->createInstanceWithArguments( + xHierAccess = + uno::Reference< container::XHierarchicalNameAccess >( + sProvider->createInstanceWithArguments( sReaderService, seq ), uno::UNO_QUERY ); } @@ -420,7 +440,7 @@ ContentProvider::getHierAccess( rtl::OUString -ContentProvider::getKey( +ContentProvider::getKey( const uno::Reference< container::XHierarchicalNameAccess >& xHierAccess, const char* key ) const { @@ -474,8 +494,8 @@ void ContentProvider::subst( rtl::OUString& instpath ) const { xCfgMgr = uno::Reference< frame::XConfigManager >( - m_xSMgr->createInstance( - rtl::OUString::createFromAscii( + m_xSMgr->createInstance( + rtl::OUString::createFromAscii( "com.sun.star.config.SpecialConfigManager" ) ), uno::UNO_QUERY ); } @@ -485,9 +505,9 @@ void ContentProvider::subst( rtl::OUString& instpath ) const "cant instantiate the special config manager " ); } } - + OSL_ENSURE( xCfgMgr.is(), "specialconfigmanager not found\n" ); - + if( xCfgMgr.is() ) instpath = xCfgMgr->substituteVariables( instpath ); } diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index eee00cafe3..bdc1814b68 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 8334f233a0..4541a1745b 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 aafa55ddad..4a95b30516 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 8b2a951713..a16e7958d7 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 \ |