summaryrefslogtreecommitdiff
path: root/xmlhelp/source/cxxhelp/provider/databases.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmlhelp/source/cxxhelp/provider/databases.cxx')
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx102
1 files changed, 45 insertions, 57 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 7ee812e94837..ccc74daa5084 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -39,6 +39,12 @@
#include <algorithm>
#include <string.h>
+// EDIT FROM HERE
+
+#include <HelpIndexer.hxx>
+
+// EDIT ENDS HERE
+
// Extensible help
#include "com/sun/star/deployment/ExtensionManager.hpp"
#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
@@ -2115,78 +2121,60 @@ rtl::OUString IndexFolderIterator::implGetIndexFolderFromPackage( bool& o_rbTemp
// TEST
//bIsWriteAccess = false;
- Reference< script::XInvocation > xInvocation;
- Reference< XMultiComponentFactory >xSMgr( m_xContext->getServiceManager(), UNO_QUERY );
+// EDIT FROM HERE
try
{
- xInvocation = Reference< script::XInvocation >(
- m_xContext->getServiceManager()->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.help.HelpIndexer" )), m_xContext ) , UNO_QUERY );
-
- if( xInvocation.is() )
- {
- Sequence<uno::Any> aParamsSeq( bIsWriteAccess ? 6 : 8 );
-
- aParamsSeq[0] = uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "-lang" )) );
-
- rtl::OUString aLang;
- sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' );
- if( nLastSlash != -1 )
- aLang = aLangURL.copy( nLastSlash + 1 );
- else
- aLang = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "en" ));
- aParamsSeq[1] = uno::makeAny( aLang );
+ rtl::OUString aLang;
+ sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' );
+ if( nLastSlash != -1 )
+ aLang = aLangURL.copy( nLastSlash + 1 );
+ else
+ aLang = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "en" ));
- aParamsSeq[2] = uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "-mod" )) );
- aParamsSeq[3] = uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "help" )) );
+ rtl::OUString aMod(RTL_CONSTASCII_USTRINGPARAM("help"));
- rtl::OUString aZipDir = aLangURL;
- if( !bIsWriteAccess )
+ rtl::OUString aZipDir = aLangURL;
+ if( !bIsWriteAccess )
+ {
+ rtl::OUString aTempFileURL;
+ ::osl::FileBase::RC eErr = ::osl::File::createTempFile( 0, 0, &aTempFileURL );
+ if( eErr == ::osl::FileBase::E_None )
{
- rtl::OUString aTempFileURL;
- ::osl::FileBase::RC eErr = ::osl::File::createTempFile( 0, 0, &aTempFileURL );
- if( eErr == ::osl::FileBase::E_None )
+ rtl::OUString aTempDirURL = aTempFileURL;
+ try
{
- rtl::OUString aTempDirURL = aTempFileURL;
- try
- {
- m_xSFA->kill( aTempDirURL );
- }
- catch (Exception &)
- {}
- m_xSFA->createFolder( aTempDirURL );
-
- aZipDir = aTempDirURL;
- o_rbTemporary = true;
+ m_xSFA->kill( aTempDirURL );
}
+ catch (Exception &)
+ {}
+ m_xSFA->createFolder( aTempDirURL );
+
+ aZipDir = aTempDirURL;
+ o_rbTemporary = true;
}
+ }
- aParamsSeq[4] = uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "-zipdir" )) );
- rtl::OUString aSystemPath;
- osl::FileBase::getSystemPathFromFileURL( aZipDir, aSystemPath );
- aParamsSeq[5] = uno::makeAny( aSystemPath );
+ rtl::OUString aTargetDir;
+ osl::FileBase::getSystemPathFromFileURL( aZipDir, aTargetDir );
- if( !bIsWriteAccess )
- {
- aParamsSeq[6] = uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "-srcdir" )) );
- rtl::OUString aSrcDirVal;
- osl::FileBase::getSystemPathFromFileURL( aLangURL, aSrcDirVal );
- aParamsSeq[7] = uno::makeAny( aSrcDirVal );
- }
+ rtl::OUString aSourceDir;
+ osl::FileBase::getSystemPathFromFileURL( aLangURL, aSourceDir );
- Sequence< sal_Int16 > aOutParamIndex;
- Sequence< uno::Any > aOutParam;
- uno::Any aRet = xInvocation->invoke( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "createIndex" )),
- aParamsSeq, aOutParamIndex, aOutParam );
+ rtl::OUString aCaption(RTL_CONSTASCII_USTRINGPARAM("/caption"));
+ rtl::OUString aContent(RTL_CONSTASCII_USTRINGPARAM("/content"));
- if( bIsWriteAccess )
- aIndexFolder = implGetFileFromPackage( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ".idxl" )), xPackage );
- else
- aIndexFolder = aZipDir + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/help.idxl" ));
- }
+ HelpIndexer aIndexer(aLang, aMod, aSourceDir + aCaption, aSourceDir + aContent, aTargetDir);
+
+ if( bIsWriteAccess )
+ aIndexFolder = implGetFileFromPackage( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ".idxl" )), xPackage );
+ else
+ aIndexFolder = aZipDir + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/help.idxl" ));
}
catch (Exception &)
{}
+
+// EDIT UNTIL HERE
+
}
}