[Libreoffice-commits] .: Branch 'libreoffice-3-6' - l10ntools/source

2012-11-04 Thread Libreoffice Gerrit user
 l10ntools/source/lngmerge.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit f28d71c29b83a0899922c8f32da0fa05458882e2
Author: Andras Timar 
Date:   Sat Nov 3 00:35:14 2012 +0100

 escape quotes, unescape double escaped quotes fdo#56648

Change-Id: Id4135db2ec40865cddab533da15b2705dc7b73d5

diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 6541bd9..3a7a8d5 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -271,7 +271,8 @@ sal_Bool LngParser::Merge(
 
 rtl::OString sText1( sLang );
 sText1 += " = \"";
-sText1 += sNewText;
+// escape quotes, unescape double escaped 
quotes fdo#56648
+sText1 += 
sNewText.replaceAll("\"","\\\"").replaceAll("\"","\\\"");
 sText1 += "\"";
 *pLine = sText1;
 Text[ sLang ] = sNewText;
@@ -306,7 +307,8 @@ sal_Bool LngParser::Merge(
 rtl::OString sLine;
 sLine += sCur;
 sLine += " = \"";
-sLine += sNewText;
+// escape quotes, unescape double escaped quotes 
fdo#56648
+sLine += 
sNewText.replaceAll("\"","\\\"").replaceAll("\"","\\\"");
 sLine += "\"";
 
 nLastLangPos++;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-6' - l10ntools/source xmlhelp/source

2012-09-07 Thread Libreoffice Gerrit user
 l10ntools/source/help/LuceneHelper.hxx|8 
 xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx |6 ++
 2 files changed, 14 insertions(+)

New commits:
commit a251a353300e27625741338b6290a109c5588952
Author: Caolán McNamara 
Date:   Fri Aug 24 11:01:51 2012 +0100

Related: fdo#53337 Maybe this is a typeinfo visibility problem

Change-Id: I024de5b400d0f7a443d4cce7bfe4e88841e6049b
Signed-off-by: Michael Meeks 

diff --git a/l10ntools/source/help/LuceneHelper.hxx 
b/l10ntools/source/help/LuceneHelper.hxx
index c990647..a0248f8 100644
--- a/l10ntools/source/help/LuceneHelper.hxx
+++ b/l10ntools/source/help/LuceneHelper.hxx
@@ -35,9 +35,17 @@
 #pragma warning(disable : 4068 4263 4264 4266)
 #endif
 
+#if defined(__GNUC__) && defined(HAVE_GCC_VISIBILITY_FEATURE)
+#  pragma GCC visibility push (default)
+#endif
+
 #include 
 #include 
 
+#if defined(__GNUC__) && defined(HAVE_GCC_VISIBILITY_FEATURE)
+#  pragma GCC visibility pop
+#endif
+
 #if defined _MSC_VER
 #pragma warning(pop)
 #endif
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx 
b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
index 240edff..4f221f6 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
@@ -40,7 +40,13 @@
 #pragma warning(disable : 4068 4263 4264 4266)
 #endif
 
+#if defined(__GNUC__) && defined(HAVE_GCC_VISIBILITY_FEATURE)
+#  pragma GCC visibility push (default)
+#endif
 #include 
+#if defined(__GNUC__) && defined(HAVE_GCC_VISIBILITY_FEATURE)
+#  pragma GCC visibility pop
+#endif
 
 #if defined _MSC_VER
 #pragma warning(pop)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-6' - l10ntools/source

2012-08-11 Thread Andras Timar
 l10ntools/source/help/HelpCompiler.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit cd656ac11743a6472f5a5fafe9b97d3fe5d11e0e
Author: Ivan Timofeev 
Date:   Tue Aug 7 10:06:04 2012 +0400

fix crash on start

Change-Id: Ieee907d38711761f4770b802f54bd38c4e807807

diff --git a/l10ntools/source/help/HelpCompiler.cxx 
b/l10ntools/source/help/HelpCompiler.cxx
index e28ac92..2a5fda5 100644
--- a/l10ntools/source/help/HelpCompiler.cxx
+++ b/l10ntools/source/help/HelpCompiler.cxx
@@ -55,9 +55,12 @@ HelpCompiler::HelpCompiler(StreamTable &in_streamTable, 
const fs::path &in_input
 {
 xmlKeepBlanksDefaultValue = 0;
 char* guitmp = getenv("GUI");
-gui = (strcmp(guitmp, "UNX") ? gui : "UNIX");
-gui = (strcmp(guitmp, "MAC") ? gui : "MAC");
-gui = (strcmp(guitmp, "WNT") ? gui : "WIN");
+if (guitmp)
+{
+gui = (strcmp(guitmp, "UNX") ? gui : "UNIX");
+gui = (strcmp(guitmp, "MAC") ? gui : "MAC");
+gui = (strcmp(guitmp, "WNT") ? gui : "WIN");
+}
 }
 
 xmlDocPtr HelpCompiler::getSourceDocument(const fs::path &filePath)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-6' - l10ntools/source

2012-07-25 Thread Michael Stahl
 l10ntools/source/help/HelpIndexer.cxx  |   77 +++--
 l10ntools/source/help/HelpIndexer_main.cxx |   12 
 2 files changed, 44 insertions(+), 45 deletions(-)

New commits:
commit e906bcc0c976a8565d05fbf6ef5cdda01642e611
Author: Caolán McNamara 
Date:   Mon Jul 9 13:41:34 2012 +0100

Resolves: fdo#51572 catch CLuceneError throws and extract the error message

I can't reproduce fdo#51572, but catching the exception in
HelpIndexer::indexDocuments should resolve it anyway and make it non-fatal.
Collect the error message for retrieval via HelpIndexer::getErrorMessage

Change-Id: Id557b9f5ff968c398f76969591f5ee765e56aa5a
(cherry picked from commit 4c912d3d8bd1ae01131e90fb4a2d8371a53ee888)

Signed-off-by: Michael Stahl 

diff --git a/l10ntools/source/help/HelpIndexer.cxx 
b/l10ntools/source/help/HelpIndexer.cxx
index 3c595b4..72a0d04 100644
--- a/l10ntools/source/help/HelpIndexer.cxx
+++ b/l10ntools/source/help/HelpIndexer.cxx
@@ -34,7 +34,7 @@
 #include 
 #include 
 #include 
-
+#include 
 #include 
 
 #include "LuceneHelper.hxx"
@@ -51,44 +51,51 @@ HelpIndexer::HelpIndexer(rtl::OUString const &lang, 
rtl::OUString const &module,
 d_contentDir = srcDir + 
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/content"));
 }
 
-bool HelpIndexer::indexDocuments() {
-if (!scanForFiles()) {
+bool HelpIndexer::indexDocuments()
+{
+if (!scanForFiles())
 return false;
-}
 
-rtl::OUString sLang = d_lang.getToken(0, '-');
-bool bUseCJK = sLang == "ja" || sLang == "ko" || sLang == "zh";
-
-// Construct the analyzer appropriate for the given language
-lucene::analysis::Analyzer *analyzer;
-if (bUseCJK)
-analyzer = new lucene::analysis::LanguageBasedAnalyzer(L"cjk");
-else
-analyzer = new lucene::analysis::standard::StandardAnalyzer();
-
-rtl::OUString ustrSystemPath;
-osl::File::getSystemPathFromFileURL(d_indexDir, ustrSystemPath);
-
-rtl::OString indexDirStr = rtl::OUStringToOString(ustrSystemPath, 
osl_getThreadTextEncoding());
-lucene::index::IndexWriter writer(indexDirStr.getStr(), analyzer, true);
-//Double limit of tokens allowed, otherwise we'll get a too-many-tokens
-//exception for ja help. Could alternative ignore the exception and get
-//truncated results as per java-Lucene apparently
-
writer.setMaxFieldLength(lucene::index::IndexWriter::DEFAULT_MAX_FIELD_LENGTH*2);
-
-// Index the identified help files
-Document doc;
-for (std::set::iterator i = d_files.begin(); i != 
d_files.end(); ++i) {
-helpDocument(*i, &doc);
-writer.addDocument(&doc);
-doc.clear();
-}
-writer.optimize();
+try
+{
+rtl::OUString sLang = d_lang.getToken(0, '-');
+bool bUseCJK = sLang == "ja" || sLang == "ko" || sLang == "zh";
+
+// Construct the analyzer appropriate for the given language
+boost::scoped_ptr analyzer;
+if (bUseCJK)
+analyzer.reset(new 
lucene::analysis::LanguageBasedAnalyzer(L"cjk"));
+else
+analyzer.reset(new lucene::analysis::standard::StandardAnalyzer());
 
-// Optimize the index
-writer.optimize();
+rtl::OUString ustrSystemPath;
+osl::File::getSystemPathFromFileURL(d_indexDir, ustrSystemPath);
+
+rtl::OString indexDirStr = rtl::OUStringToOString(ustrSystemPath, 
osl_getThreadTextEncoding());
+lucene::index::IndexWriter writer(indexDirStr.getStr(), 
analyzer.get(), true);
+//Double limit of tokens allowed, otherwise we'll get a too-many-tokens
+//exception for ja help. Could alternative ignore the exception and get
+//truncated results as per java-Lucene apparently
+
writer.setMaxFieldLength(lucene::index::IndexWriter::DEFAULT_MAX_FIELD_LENGTH*2);
+
+// Index the identified help files
+Document doc;
+for (std::set::iterator i = d_files.begin(); i != 
d_files.end(); ++i) {
+helpDocument(*i, &doc);
+writer.addDocument(&doc);
+doc.clear();
+}
+writer.optimize();
+
+// Optimize the index
+writer.optimize();
+}
+catch (CLuceneError &e)
+{
+d_error = rtl::OUString::createFromAscii(e.what());
+return false;
+}
 
-delete analyzer;
 return true;
 }
 
diff --git a/l10ntools/source/help/HelpIndexer_main.cxx 
b/l10ntools/source/help/HelpIndexer_main.cxx
index bf42a4c..48e0f3e 100644
--- a/l10ntools/source/help/HelpIndexer_main.cxx
+++ b/l10ntools/source/help/HelpIndexer_main.cxx
@@ -99,16 +99,8 @@ int main(int argc, char **argv) {
 rtl::OUString(module.c_str(), module.size(), 
osl_getThreadTextEncoding()),
 sDir, sDir);
 
-try
-{
-if (!indexer.indexDocuments()) {
-std::cerr << rtl::OUStringToOString(indexer.getErrorMessage(), 
osl_getThreadTextEncoding()).getStr()  << std::endl;
-return 2;
-}
- 

[Libreoffice-commits] .: Branch 'libreoffice-3-6' - l10ntools/source

2012-07-15 Thread Andras Timar
 l10ntools/source/localize.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 525d2dab0e02c40dad8258958b2877e16f54976e
Author: Andras Timar 
Date:   Sun Jul 15 17:51:53 2012 +0200

fdo#52090 update Danish dictionaries (2012.07.14)

Change-Id: Ia05018afcfcba044e568e9262ccb90324c2807f5
Signed-off-by: Andras Timar 

diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index 81d4875..a54d096 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -116,6 +116,9 @@ bool passesNegativeList(rtl::OUString const & url) {
 "/dictionaries/da_DK/help/da/"
 "org.openoffice.da.hunspell.dictionaries/page1.xhp") },
 { RTL_CONSTASCII_STRINGPARAM(
+"/dictionaries/da_DK/help/da/"
+"org.openoffice.da.hunspell.dictionaries/page2.xhp") },
+{ RTL_CONSTASCII_STRINGPARAM(
 "/dictionaries/hu_HU/help/hu/"
 "org.openoffice.hu.hunspell.dictionaries/page1.xhp") },
 { RTL_CONSTASCII_STRINGPARAM("/hidother.src") },
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits