diff options
Diffstat (limited to 'l10ntools/source/help')
-rw-r--r-- | l10ntools/source/help/HelpIndexerTool.java | 30 | ||||
-rw-r--r-- | l10ntools/source/help/HelpLinker.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/help/makefile.mk | 2 |
3 files changed, 29 insertions, 5 deletions
diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java index 1245247c3c9a..2a49f964d48f 100644 --- a/l10ntools/source/help/HelpIndexerTool.java +++ b/l10ntools/source/help/HelpIndexerTool.java @@ -69,6 +69,7 @@ public class HelpIndexerTool String aModule = ""; String aTargetZipFileStr = ""; String aCfsName = ""; + String aSegmentName = ""; // Scan arguments boolean bLang = false; @@ -77,6 +78,7 @@ public class HelpIndexerTool boolean bSrcDir = false; boolean bOutput = false; boolean bCfsName = false; + boolean bSegmentName = false; int nArgCount = args.length; for( int i = 0 ; i < nArgCount ; i++ ) @@ -126,7 +128,7 @@ public class HelpIndexerTool } i++; } - else if( "-checkcfsname".equals(args[i]) ) + else if( "-checkcfsandsegname".equals(args[i]) ) { if( i + 1 < nArgCount ) { @@ -134,6 +136,17 @@ public class HelpIndexerTool bCfsName = true; } i++; + if( i + 1 < nArgCount ) + { + aSegmentName = "segments" + args[i + 1]; + bSegmentName = true; + } + i++; + if (!(bCfsName && bSegmentName)) + { + System.out.println("Usage: HelpIndexer -checkcfsandsegname _0 _3 (2 arguments needed)"); + System.exit( -1 ); + } } } @@ -173,12 +186,17 @@ public class HelpIndexerTool writer.close(); boolean bCfsFileOk = true; - if( bCfsName && !bExtensionMode && nRet != -1 ) + boolean bSegmentFileOk = true; + if( bCfsName && bSegmentName && !bExtensionMode && nRet != -1 ) { String aCompleteCfsFileName = aDirToZipStr + File.separator + aIndexDirName + File.separator + aCfsName; + String aCompleteSegmentFileName = aDirToZipStr + File.separator + aIndexDirName + File.separator + aSegmentName; File aCfsFile = new File( aCompleteCfsFileName ); + File aSegmentFile = new File( aCompleteSegmentFileName ); bCfsFileOk = aCfsFile.exists(); + bSegmentFileOk = aSegmentFile.exists(); System.out.println( "Checking cfs file " + aCfsName+ ": " + (bCfsFileOk ? "Found" : "Not found") ); + System.out.println( "Checking segment file " + aSegmentName+ ": " + (bSegmentFileOk ? "Found" : "Not found") ); } if( bExtensionMode ) @@ -194,7 +212,7 @@ public class HelpIndexerTool if( nRet == -1 ) deleteRecursively( aIndexDir ); - if( bCfsFileOk ) + if( bCfsFileOk && bSegmentFileOk ) System.out.println( "Zipping ..." ); File aDirToZipFile = new File( aDirToZipStr ); createZipFile( aDirToZipFile, aTargetZipFileStr ); @@ -207,6 +225,12 @@ public class HelpIndexerTool System.exit( -1 ); } + if( !bSegmentFileOk ) + { + System.out.println( "segment file check failed, terminating..." ); + System.exit( -1 ); + } + Date end = new Date(); if( !bExtensionMode ) System.out.println(end.getTime() - start.getTime() + " total milliseconds"); diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index ae2b88bfc470..9eed9132a5ec 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -1096,7 +1096,7 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp args.push_back(std::string( argv[i]) ); for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) - delete argv[iXhp + 3]; + delete[] argv[iXhp + 3]; delete[] argv; rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() ); diff --git a/l10ntools/source/help/makefile.mk b/l10ntools/source/help/makefile.mk index 50351913fe55..b66077501a8d 100644 --- a/l10ntools/source/help/makefile.mk +++ b/l10ntools/source/help/makefile.mk @@ -101,7 +101,7 @@ JAVACLASSFILES = \ $(CLASSDIR)$/$(PACKAGE)$/HelpFileDocument.class .IF "$(SYSTEM_LUCENE)" == "YES" -CLASSPATH!:=$(CLASSPATH)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR) +EXTRAJARFILES += $(LUCENE_CORE_JAR) $(LUCENE_ANALYZERS_JAR) .ELSE JARFILES += lucene-core-2.3.jar lucene-analyzers-2.3.jar .ENDIF |