[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2022-11-21 Thread Stephan Bergmann (via logerrit)
 l10ntools/inc/xmlparse.hxx|2 +-
 l10ntools/source/xmlparse.cxx |   12 +++-
 2 files changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 337691db0e3f928ed6dff489fc6305a9a5e0b493
Author: Stephan Bergmann 
AuthorDate: Mon Nov 21 11:51:35 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Nov 22 08:14:09 2022 +0100

Simplify previous fix

...e735de2051143347b7283c85ad80b0e2412522dc "Avoid some unnecessary, wrong
downcasts during `make translations"

Change-Id: If6110e16698302b3d43b2192cf0f0e0d0fddb57b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143026
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 0495883a5311..8e7d320affc5 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -161,7 +161,7 @@ public:
 void Write( OString const  );
 void Write( std::ofstream , XMLNode *pCur = nullptr );
 
-bool CheckExportStatus( XMLParentNode *pCur = nullptr );
+bool CheckExportStatus( XMLChildNode *pCur = nullptr );
 
 XMLFile& operator=(const XMLFile& rObj);
 
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index bcf5d37154cb..30da2bebf509 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -473,7 +473,7 @@ void XMLFile::SearchL10NElements( XMLChildNode *pCur )
 }
 }
 
-bool XMLFile::CheckExportStatus( XMLParentNode *pCur )
+bool XMLFile::CheckExportStatus( XMLChildNode *pCur )
 {
 static bool bStatusExport = true;
 
@@ -489,7 +489,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur )
 for ( size_t i = 0; i < GetChildList()->size(); i++ )
 {
 XMLChildNode* pElement = (*GetChildList())[ i ];
-if( pElement->GetNodeType() ==  XMLNodeType::ELEMENT ) 
CheckExportStatus( static_cast(pElement) );//, i);
+if( pElement->GetNodeType() ==  XMLNodeType::ELEMENT ) 
CheckExportStatus( pElement );//, i);
 }
 }
 }
@@ -520,13 +520,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur )
 else if ( pElement->GetChildList() )
 {
 for (size_t k = 0; k < pElement->GetChildList()->size(); 
++k)
-{
-auto const child = (*pElement->GetChildList())[k];
-auto const type = child->GetNodeType();
-if (type != XMLNodeType::DATA && type != 
XMLNodeType::COMMENT) {
-CheckExportStatus( 
static_cast(child) );
-}
-}
+CheckExportStatus( (*pElement->GetChildList())[k] );
 }
 }
 break;


[Libreoffice-commits] core.git: l10ntools/inc

2022-06-23 Thread Andrea Gelmini (via logerrit)
 l10ntools/inc/xmlparse.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 4eeb12bb83d5d90eadd14ab5e57950613fcc5fc3
Author: Andrea Gelmini 
AuthorDate: Thu Jun 23 12:57:12 2022 +0200
Commit: Julien Nabet 
CommitDate: Thu Jun 23 20:48:07 2022 +0200

Removed duplicated include

Change-Id: I1bf4b53e07cd8f0e3311620242d012c1ea1956e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136312
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index a1fc321c05ec..0495883a5311 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2022-06-23 Thread Noel Grandin (via logerrit)
 l10ntools/inc/cfgmerge.hxx |9 +
 l10ntools/inc/export.hxx   |4 ++--
 l10ntools/inc/helpmerge.hxx|2 +-
 l10ntools/inc/lngmerge.hxx |2 +-
 l10ntools/inc/propmerge.hxx|2 +-
 l10ntools/inc/treemerge.hxx|2 +-
 l10ntools/inc/xmlparse.hxx |   25 +
 l10ntools/inc/xrmmerge.hxx |4 ++--
 l10ntools/source/cfgmerge.cxx  |   10 +-
 l10ntools/source/helpmerge.cxx |5 +++--
 l10ntools/source/lngmerge.cxx  |5 +++--
 l10ntools/source/merge.cxx |   11 ++-
 l10ntools/source/propmerge.cxx |7 ---
 l10ntools/source/treemerge.cxx |5 +++--
 l10ntools/source/xmlparse.cxx  |9 +
 l10ntools/source/xrmmerge.cxx  |9 +
 16 files changed, 60 insertions(+), 51 deletions(-)

New commits:
commit 6cac364376785bfc82fabf7f9ae82c94d3b2825f
Author: Noel Grandin 
AuthorDate: Wed Jun 22 09:09:57 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Jun 23 08:54:00 2022 +0200

clang-tidy modernize-pass-by-value in l10ntools

Change-Id: Icf07a0f3784f0f39fa6b141a24aa25fddab71901
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136272
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx
index 12e5cace11f2..a2f59e1e6e8f 100644
--- a/l10ntools/inc/cfgmerge.hxx
+++ b/l10ntools/inc/cfgmerge.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "po.hxx"
 #include "export.hxx"
@@ -50,8 +51,8 @@ private:
 
 OStringHashMap sText;
 public:
-CfgStackData(const OString , const OString )
-: sTagType( rTag ), sIdentifier( rId )
+CfgStackData(OString _sTag, OString _sId)
+: sTagType(std::move( _sTag )), sIdentifier(std::move( _sId ))
 {}
 
 const OString () const { return sTagType; }
@@ -145,7 +146,7 @@ protected:
 public:
 CfgExport(
 const OString ,
-const OString 
+OString sFilePath
 );
 virtual ~CfgExport() override;
 };
@@ -172,7 +173,7 @@ protected:
 public:
 CfgMerge(
 const OString , const OString ,
-const OString , const OString  );
+OString sFilename, const OString  );
 virtual ~CfgMerge() override;
 };
 
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 3f46c552f575..251d059ac2c6 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -54,8 +54,8 @@ typedef std::unordered_map
 class ResData
 {
 public:
-ResData( const OString  );
-ResData( const OString  , const OString  );
+ResData( OString rGId );
+ResData( OString sGId , OString sFilename );
 
 OString sResTyp;
 OString sId;
diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 9420f2356b2f..9da891e6b0f2 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -44,7 +44,7 @@ private:
 #endif
 
 public:
-HelpParser( const OString  );
+HelpParser( OString sHelpFile );
 
 /// Method append a PO file with the content of a parsed XML file
 /// @PRECOND rHelpFile is valid
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index 7b60e4ff231b..430fdd13936f 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -50,7 +50,7 @@ private:
 static void WritePO(PoOfstream , OStringHashMap _inout,
 const OString , const OString );
 public:
-LngParser(const OString );
+LngParser(OString sLngFile);
 ~LngParser();
 
 void CreatePO( const OString  );
diff --git a/l10ntools/inc/propmerge.hxx b/l10ntools/inc/propmerge.hxx
index 7e9eb594da2a..cc9764cccb06 100644
--- a/l10ntools/inc/propmerge.hxx
+++ b/l10ntools/inc/propmerge.hxx
@@ -30,7 +30,7 @@ private:
 
 public:
 PropParser(
-const OString& rInputFile, const OString& rLang,
+OString sInputFile, OString sLang,
 const bool bMergeMode );
 ~PropParser();
 
diff --git a/l10ntools/inc/treemerge.hxx b/l10ntools/inc/treemerge.hxx
index 8e87188d8b69..7f1a72fc7fe3 100644
--- a/l10ntools/inc/treemerge.hxx
+++ b/l10ntools/inc/treemerge.hxx
@@ -29,7 +29,7 @@ private:
 
 public:
 /// Parse tree file
-TreeParser( const OString& rInputFile, const OString& rLang );
+TreeParser( const OString& rInputFile, OString sLang );
 ~TreeParser();
 
 bool isInitialized() const { return m_bIsInitialized; }
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 9a8b1e673213..a1fc321c05ec 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -24,6 +24,8 @@
 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
@@ -54,10 +56,10 @@ private:
 public:
 /// creates an attribute
 XMLAttribute(
-const OString ,// attributes name
-const OString // attributes data
+OString _sName,// attributes name
+OString _sValue// attributes data
 )
-: m_sName( rName ), m_sValue( rValue ) {}
+

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2022-04-13 Thread Noel Grandin (via logerrit)
 l10ntools/inc/export.hxx  |6 +++---
 l10ntools/inc/po.hxx  |2 +-
 l10ntools/source/helpex.cxx   |2 +-
 l10ntools/source/localize.cxx |8 
 l10ntools/source/merge.cxx|   16 
 l10ntools/source/po.cxx   |6 +++---
 6 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 74957c7d2f3697fbf2b6f4d6a31c61d5d7df039b
Author: Noel Grandin 
AuthorDate: Wed Apr 13 13:54:22 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 16:11:27 2022 +0200

use more string_view in l10ntools

Change-Id: I93958e8e2dc1e172413ff697d6b6be975cff064d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132956
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 64091d6cc5b8..3f46c552f575 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -120,11 +120,11 @@ class MergeDataFile
 void InsertEntry(std::string_view rTYP, std::string_view rGID,
 std::string_view rLID, const OString ,
 const OString , const OString ,
-const OString , const OString ,
+const OString , std::string_view sFilename,
 bool bFirstLang, bool bCaseSensitive);
 public:
 explicit MergeDataFile(
-const OString , const OString& rFile,
+const OString , std::string_view rFile,
 bool bCaseSensitive, bool bWithQtz = true );
 ~MergeDataFile();
 
@@ -135,7 +135,7 @@ class MergeDataFile
 MergeEntrys *GetMergeEntrysCaseSensitive( ResData *pResData );
 
 static OString CreateKey(std::string_view rTYP, std::string_view rGID,
-std::string_view rLID, const OString& rFilename, bool 
bCaseSensitive);
+std::string_view rLID, std::string_view rFilename, bool 
bCaseSensitive);
 };
 
 
diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx
index 8267525133b7..9b33d2b7788e 100644
--- a/l10ntools/inc/po.hxx
+++ b/l10ntools/inc/po.hxx
@@ -46,7 +46,7 @@ public:
 enum Exception { NOSOURCFILE, NORESTYPE, NOGROUPID, NOSTRING, 
WRONGHELPTEXT };
 
 PoEntry();
-PoEntry( const OString& rSourceFile, std::string_view 
rResType, std::string_view rGroupId,
+PoEntry( std::string_view rSourceFile, std::string_view 
rResType, std::string_view rGroupId,
  std::string_view rLocalId, std::string_view 
rHelpText, const OString& rText,
  const TYPE eType );
 ~PoEntry();
diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx
index e9f744a95bbc..97e574fc7dde 100644
--- a/l10ntools/source/helpex.cxx
+++ b/l10ntools/source/helpex.cxx
@@ -81,7 +81,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 std::unique_ptr pMergeDataFile;
 if( aArgs.m_sLanguage != "qtz")
 {
-pMergeDataFile.reset(new MergeDataFile(aArgs.m_sMergeSrc, 
OString(), false, false ));
+pMergeDataFile.reset(new MergeDataFile(aArgs.m_sMergeSrc, 
"", false, false ));
 }
 std::string sTemp;
 aInput >> sTemp;
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index d89f89150d04..2ec0123616f4 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -116,7 +116,7 @@ void handleCommand(
 }
 
 void InitPoFile(
-std::string_view rProject, const OString& rInPath,
+std::string_view rProject, std::string_view rInPath,
 std::string_view rPotDir, const OString& rOutPath )
 {
 //Create directory for po file
@@ -150,9 +150,9 @@ void InitPoFile(
 throw false; //TODO
 }
 
-const sal_Int32 nProjectInd = rInPath.indexOf(rProject);
-const OString relativPath =
-rInPath.copy(nProjectInd, rInPath.lastIndexOf('/')- nProjectInd);
+const size_t nProjectInd = rInPath.find(rProject);
+const std::string_view relativPath =
+rInPath.substr(nProjectInd, rInPath.rfind('/')- nProjectInd);
 
 PoHeader aTmp(relativPath);
 aPoOutPut.writeHeader(aTmp);
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 78334c70c8fe..8a6964c61fa4 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -32,12 +32,12 @@
 
 namespace
 {
-OString lcl_NormalizeFilename(const OString& rFilename)
+OString lcl_NormalizeFilename(std::string_view rFilename)
 {
-return rFilename.copy(
+return OString(rFilename.substr(
 std::max(
-rFilename.lastIndexOf( '\\' ),
-rFilename.lastIndexOf( '/' ))+1);
+rFilename.rfind( '\\' ),
+rFilename.rfind( '/' ))+1));
 };
 
 bool lcl_ReadPoChecked(
@@ -111,7 +111,7 @@ OString MergeEntrys::GetQTZText(const ResData& rResData, 
std::string_view rOrigT
 
 
 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2020-11-16 Thread Stephan Bergmann (via logerrit)
 l10ntools/inc/helper.hxx|4 
 l10ntools/source/helper.cxx |   12 +---
 2 files changed, 5 insertions(+), 11 deletions(-)

New commits:
commit 9ac55ae5423c3a70438765057c071def18864c1e
Author: Stephan Bergmann 
AuthorDate: Mon Nov 16 13:43:27 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Nov 16 21:45:23 2020 +0100

Clean up --disable-assert-always-abort loplugin:stringviewparam

(457d76327a57303124804a201d58b52ba23ccefe "loplugin:stringviewparam
(l10ntools)")

Change-Id: Iebe0f61de4fd4d4744b47d17d8e3ff3f80217d18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105929
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/l10ntools/inc/helper.hxx b/l10ntools/inc/helper.hxx
index ff81f5792105..621218a0c1b7 100644
--- a/l10ntools/inc/helper.hxx
+++ b/l10ntools/inc/helper.hxx
@@ -28,11 +28,7 @@ OString escapeAll(
 const OString& rText, const OString& rUnEscaped, const OString& rEscaped );
 /// Unescape all given character in the text
 OString unEscapeAll(
-#ifdef DEBUG
-const OString& rText, const OString& rEscaped, const OString& rUnEscaped  
);
-#else
 const OString& rText, const OString& rEscaped, std::string_view rUnEscaped 
 );
-#endif
 
 /// Convert special characters to XML entity references
 OString QuotHTML( const OString  );
diff --git a/l10ntools/source/helper.cxx b/l10ntools/source/helper.cxx
index 22f5cc5df506..053375085911 100644
--- a/l10ntools/source/helper.cxx
+++ b/l10ntools/source/helper.cxx
@@ -7,6 +7,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
+
+#include 
+
 #include 
 
 namespace helper {
@@ -31,15 +35,9 @@ OString escapeAll(
 
 
 OString unEscapeAll(
-#ifdef DEBUG
-const OString& rText, const OString& rEscaped, const OString& rUnEscaped)
-#else
 const OString& rText, const OString& rEscaped, std::string_view rUnEscaped)
-#endif
 {
-#ifdef DEBUG
-assert( rEscaped.getLength() == 2*rUnEscaped.getLength() );
-#endif
+assert( o3tl::make_unsigned(rEscaped.getLength()) == 2*rUnEscaped.length() 
);
 OStringBuffer sReturn;
 const sal_Int32 nLength = rText.getLength();
 for ( sal_Int32 nIndex = 0; nIndex < nLength; ++nIndex )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2020-11-14 Thread Julien Nabet (via logerrit)
 l10ntools/inc/helper.hxx|4 
 l10ntools/source/helper.cxx |6 ++
 2 files changed, 10 insertions(+)

New commits:
commit 457d76327a57303124804a201d58b52ba23ccefe
Author: Julien Nabet 
AuthorDate: Sat Nov 14 09:58:49 2020 +0100
Commit: Julien Nabet 
CommitDate: Sat Nov 14 19:16:12 2020 +0100

loplugin:stringviewparam (l10ntools)

Change-Id: I9102a00e19af87de4f666d1759551be3af311fe0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105828
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/l10ntools/inc/helper.hxx b/l10ntools/inc/helper.hxx
index a6eed4ff59d3..ff81f5792105 100644
--- a/l10ntools/inc/helper.hxx
+++ b/l10ntools/inc/helper.hxx
@@ -28,7 +28,11 @@ OString escapeAll(
 const OString& rText, const OString& rUnEscaped, const OString& rEscaped );
 /// Unescape all given character in the text
 OString unEscapeAll(
+#ifdef DEBUG
 const OString& rText, const OString& rEscaped, const OString& rUnEscaped  
);
+#else
+const OString& rText, const OString& rEscaped, std::string_view rUnEscaped 
 );
+#endif
 
 /// Convert special characters to XML entity references
 OString QuotHTML( const OString  );
diff --git a/l10ntools/source/helper.cxx b/l10ntools/source/helper.cxx
index b842755c27f6..22f5cc5df506 100644
--- a/l10ntools/source/helper.cxx
+++ b/l10ntools/source/helper.cxx
@@ -31,9 +31,15 @@ OString escapeAll(
 
 
 OString unEscapeAll(
+#ifdef DEBUG
 const OString& rText, const OString& rEscaped, const OString& rUnEscaped)
+#else
+const OString& rText, const OString& rEscaped, std::string_view rUnEscaped)
+#endif
 {
+#ifdef DEBUG
 assert( rEscaped.getLength() == 2*rUnEscaped.getLength() );
+#endif
 OStringBuffer sReturn;
 const sal_Int32 nLength = rText.getLength();
 for ( sal_Int32 nIndex = 0; nIndex < nLength; ++nIndex )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source solenv/clang-format

2020-11-12 Thread Philipp Hofer (via logerrit)
 l10ntools/inc/cfglex.hxx|6 +++---
 l10ntools/source/lngex.cxx  |   17 -
 solenv/clang-format/excludelist |2 --
 3 files changed, 11 insertions(+), 14 deletions(-)

New commits:
commit 635bc2ea81fd9493a2997e89c2de5aa7d8405578
Author: Philipp Hofer 
AuthorDate: Thu Nov 12 13:04:58 2020 +0100
Commit: Mike Kaganski 
CommitDate: Fri Nov 13 08:21:52 2020 +0100

tdf#123936 Formatting files in module l10ntools with clang-format

Change-Id: I5f8c2aec02e160a22e9ff484170303927f0c9c05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105686
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/l10ntools/inc/cfglex.hxx b/l10ntools/inc/cfglex.hxx
index bc474a09bba7..af0324f64220 100644
--- a/l10ntools/inc/cfglex.hxx
+++ b/l10ntools/inc/cfglex.hxx
@@ -24,10 +24,10 @@
 
 #include 
 
-extern "C" void workOnTokenSet( int, char* );
-extern "C" FILE * init(int, char **);
+extern "C" void workOnTokenSet(int, char*);
+extern "C" FILE* init(int, char**);
 
-void yyerror(char const *);
+void yyerror(char const*);
 
 #endif
 
diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx
index 0d8bc6b9361f..7435c063ed1c 100644
--- a/l10ntools/source/lngex.cxx
+++ b/l10ntools/source/lngex.cxx
@@ -23,21 +23,20 @@
 
 #include 
 
-SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
-
+SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
+{
 common::HandledArgs aArgs;
-if ( !common::handleArguments(argc, argv, aArgs) )
+if (!common::handleArguments(argc, argv, aArgs))
 {
-common::writeUsage("ulfex","*.ulf");
+common::writeUsage("ulfex", "*.ulf");
 return 1;
 }
 
-LngParser aParser( aArgs.m_sInputFile );
-if ( aArgs.m_bMergeMode )
-aParser.Merge(
-aArgs.m_sMergeSrc, aArgs.m_sOutputFile, aArgs.m_sLanguage );
+LngParser aParser(aArgs.m_sInputFile);
+if (aArgs.m_bMergeMode)
+aParser.Merge(aArgs.m_sMergeSrc, aArgs.m_sOutputFile, 
aArgs.m_sLanguage);
 else
-aParser.CreatePO( aArgs.m_sOutputFile );
+aParser.CreatePO(aArgs.m_sOutputFile);
 
 return 0;
 }
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 78ce6e8527d8..01d6908c98b8 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -7442,7 +7442,6 @@ jvmfwk/source/framework.hxx
 jvmfwk/source/fwkbase.cxx
 jvmfwk/source/fwkutil.cxx
 jvmfwk/source/libxmlutil.cxx
-l10ntools/inc/cfglex.hxx
 l10ntools/inc/cfgmerge.hxx
 l10ntools/inc/common.hxx
 l10ntools/inc/export.hxx
@@ -7462,7 +7461,6 @@ l10ntools/source/helper.cxx
 l10ntools/source/helpex.cxx
 l10ntools/source/helpmerge.cxx
 l10ntools/source/idxdict/idxdict.cxx
-l10ntools/source/lngex.cxx
 l10ntools/source/lngmerge.cxx
 l10ntools/source/localize.cxx
 l10ntools/source/merge.cxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc lingucomponent/source lotuswordpro/source

2019-08-12 Thread Andrea Gelmini (via logerrit)
 l10ntools/inc/xmlparse.hxx  |2 +-
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx |2 +-
 lotuswordpro/source/filter/lwplayout.cxx|4 ++--
 lotuswordpro/source/filter/lwptools.cxx |4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit a4bf57b27b2c5e47e10a3d46c9a6535828dedefd
Author: Andrea Gelmini 
AuthorDate: Sun Aug 11 19:52:42 2019 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 12 16:08:03 2019 +0200

Fix typos

Change-Id: I72cc7132721706b3a5e06480efbae42065c36661
Reviewed-on: https://gerrit.libreoffice.org/77319
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 039b7f8ac387..2b68055b1446 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -190,7 +190,7 @@ private:
 std::vector  m_vOrder;
 };
 
-/// An Utility class for XML
+/// A Utility class for XML
 class XMLUtil
 {
 public:
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx 
b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index da2d19a8fde6..396f39e9f05f 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -129,7 +129,7 @@ Sequence< Locale > SAL_CALL Thesaurus::getLocales()
 
 // to prefer dictionaries with configuration entries we will only
 // use those old style dictionaries that add a language that
-// is not yet supported by the list od new style dictionaries
+// is not yet supported by the list of new style dictionaries
 MergeNewStyleDicsAndOldStyleDics( aDics, aOldStyleDics );
 
 sal_Int32 numthes = aDics.size();
diff --git a/lotuswordpro/source/filter/lwplayout.cxx 
b/lotuswordpro/source/filter/lwplayout.cxx
index bcc9482dc0ea..82607a17cd05 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -901,7 +901,7 @@ enumXFTextDir LwpMiddleLayout::GetTextDirection()
 return eTextDir;
 }
 /**
- * @descr: Get back ground color.
+ * @descr: Get background color.
 */
 LwpColor* LwpMiddleLayout::GetBackColor()
 {
@@ -1976,7 +1976,7 @@ void LwpPlacableLayout::Read()
 sal_uInt16 count = pStrm->QuickReaduInt16();
 if(count)
 {
-// temporily added by  to avoid assertion
+// temporarily added by  to avoid assertion
 while (count)
 {
 LwpPoint aPoint;
diff --git a/lotuswordpro/source/filter/lwptools.cxx 
b/lotuswordpro/source/filter/lwptools.cxx
index bd8ad0e067ba..8ce2e9676d63 100644
--- a/lotuswordpro/source/filter/lwptools.cxx
+++ b/lotuswordpro/source/filter/lwptools.cxx
@@ -262,7 +262,7 @@ std::unique_ptr 
LwpTools::GetSystemDateStyle(bool bLongFormat)
 if (pattern == nullptr)
 return nullptr;
 // 3 parse pattern string,per icu date/time format syntax, there are 20 
letters reserved
-// as patter letter,each represent a element in date/time and its repeat 
numbers represent
+// as patter letter,each represent an element in date/time and its repeat 
numbers represent
 // different format: for example: M produces '1',MM produces '01', MMM 
produces 'Jan',  produces 'Januaray'
 // letter other than these letters is regard as text in the format, for 
example ','in 'Jan,2005'
 // we parse pattern string letter by letter and get the time format.
@@ -650,7 +650,7 @@ std::unique_ptr LwpTools::GetSystemTimeStyle()
 if (pattern == nullptr)
 return nullptr;
 // 3 parse pattern string,per icu date/time format syntax, there are 20 
letters reserved
-// as patter letter,each represent a element in date/time and its repeat 
numbers represent
+// as patter letter,each represent an element in date/time and its repeat 
numbers represent
 // different format: for example: M produces '1',MM produces '01', MMM 
produces 'Jan',  produces 'Januaray'
 // letter other than these letters is regard as text in the format, for 
example ','in 'Jan,2005'
 // we parse pattern string letter by letter and get the time format.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2019-03-18 Thread Libreoffice Gerrit user
 l10ntools/inc/export.hxx   |   72 --
 l10ntools/source/merge.cxx |   95 -
 2 files changed, 12 insertions(+), 155 deletions(-)

New commits:
commit dc2329fb66dc38f62a21b1afaca38529d7e40fa9
Author: Stephan Bergmann 
AuthorDate: Mon Mar 18 18:34:39 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Mar 18 21:24:23 2019 +0100

Remove broken MergeDataHashMap optimization

...which apparently didn't take into account that inserting into a
std::unordered_map may invalidate iterators, which now started to cause 
build
failures like

> [PRP] dictionaries/hu_HU/dialog/hu_HU_de
> warn:sal.osl:25175:25175:sal/osl/unx/thread.cxx:1026: 
RTL_TEXTENCODING_DONTKNOW -> _ASCII_US
> .../gcc/trunk/inst/include/c++/9.0.1/debug/safe_iterator.h:307:
> In function:
> __gnu_debug::_Safe_iterator<_Iterator, _Sequence, _Category>::pointer
> __gnu_debug::_Safe_iterator<_Iterator, _Sequence,
> _Category>::operator->() const [with _Iterator =
> std::__detail::_Node_iterator std::unique_ptr >, false, true>; _Sequence =
> std::__debug::unordered_map 
>;
> _Category = std::forward_iterator_tag;
> __gnu_debug::_Safe_iterator<_Iterator, _Sequence, _Category>::pointer 
=
> std::pair >*]
>
> Error: attempt to dereference a singular iterator.
>
> Objects involved in the operation:
> iterator "this" @ 0x0x5a8228 {
>   type = std::__detail::_Node_iterator > >, false, true> 
(mutable iterator);
>   state = singular;
>   references sequence with type 
'std::__debug::unordered_map >, std::hash, 
std::equal_to, std::allocator > > > >' @ 0x0x5a81c8
> }
> /bin/sh: line 1: 25175 Aborted (core dumped) 
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/program" 
$W/LinkTarget/Executable/propex -i 
$S/dictionaries/hu_HU/dialog/hu_HU_en_US.properties -l de -m ${MERGEINPUT} -o 
$W/PropertiesTranslateTarget/dictionaries/hu_HU/dialog/hu_HU_de.properties
> make[1]: *** [.../solenv/gbuild/Dictionary.mk:88: 
.../workdir/PropertiesTranslateTarget/dictionaries/hu_HU/dialog/hu_HU_de.properties]
 Error 134

with trunk libstdc++ in debug mode.

Both classes MergeData and MergeDataHashMap became redundant.

Change-Id: I771548a6155e14037d84acfd74cd13566a26a8d7
Reviewed-on: https://gerrit.libreoffice.org/69395
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 658faaf0450e..b6d958695b8d 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -119,74 +119,6 @@ public:
 
 };
 
-
-// class MergeDataHashMap
-
-
-class MergeData;
-
-/** Container for MergeData
-
-  This class is an HashMap with a hidden insertion
-  order. The class can used just like a simple
-  HashMap, but good to know that it's use is
-  more effective if the accessing(find) order
-  match with the insertion order.
-
-  In the most case, this match is good.
-  (e.g. reading PO files of different languages,
-  executables merging)
-*/
-class MergeDataHashMap
-{
-private:
-typedef std::unordered_map> 
HashMap_t;
-
-public:
-MergeDataHashMap()
-: bFirstSearch(true)
-, aLastInsertion(m_aHashMap.end())
-, aLastFound(m_aHashMap.end())
-, aFirstInOrder(m_aHashMap.end())
-{
-}
-
-typedef HashMap_t::iterator iterator;
-typedef HashMap_t::const_iterator const_iterator;
-
-std::pair insert(const OString& rKey, 
std::unique_ptr pMergeData);
-iterator const & find(const OString& rKey);
-
-iterator end() {return m_aHashMap.end();}
-
-private:
-bool bFirstSearch;
-HashMap_t m_aHashMap;
-iterator aLastInsertion;
-iterator aLastFound;
-iterator aFirstInOrder;
-};
-
-
-// class MergeData
-
-
-/// Purpose: holds information of data to merge (one resource)
-class MergeData
-{
-friend class MergeDataHashMap;
-
-std::unique_ptr pMergeEntrys;
-MergeDataHashMap::iterator m_aNextData;
-
-public:
-MergeData();
-~MergeData();
-MergeEntrys* GetMergeEntries() { return pMergeEntrys.get();}
-
-};
-
-
 // class MergeDataFile
 
 
@@ -194,10 +126,10 @@ public:
 class MergeDataFile
 {
 private:
-MergeDataHashMap aMap;
+std::unordered_map> aMap;
 std::set aLanguageSet;
 
-MergeData *GetMergeData( ResData *pResData , bool bCaseSensitive = 
false );
+MergeEntrys *GetMergeData( ResData *pResData , bool bCaseSensitive = 
false );
 void InsertEntry(const OString , const OString ,
 const OString , const OString ,
 const OString , const OString ,
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index eeef73a6dc5b..aff23bafdd07 100644
--- 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2019-02-28 Thread Libreoffice Gerrit user
 l10ntools/inc/cfglex.hxx  |2 ++
 l10ntools/inc/xrmlex.hxx  |2 ++
 l10ntools/source/cfgmerge.cxx |2 --
 l10ntools/source/xrmmerge.cxx |2 --
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 372f8519168d74cd5c1c1199ec3a07a8ae3f1edf
Author: Stephan Bergmann 
AuthorDate: Wed Feb 27 15:29:28 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Feb 28 21:59:24 2019 +0100

loplugin:unreffun

Change-Id: I983394e10e1a316fe01bd3925913e5e65f944b68
Reviewed-on: https://gerrit.libreoffice.org/68470
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/l10ntools/inc/cfglex.hxx b/l10ntools/inc/cfglex.hxx
index f55477d2a59d..bc474a09bba7 100644
--- a/l10ntools/inc/cfglex.hxx
+++ b/l10ntools/inc/cfglex.hxx
@@ -27,6 +27,8 @@
 extern "C" void workOnTokenSet( int, char* );
 extern "C" FILE * init(int, char **);
 
+void yyerror(char const *);
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/inc/xrmlex.hxx b/l10ntools/inc/xrmlex.hxx
index 7e283118d218..483b6dbaaf01 100644
--- a/l10ntools/inc/xrmlex.hxx
+++ b/l10ntools/inc/xrmlex.hxx
@@ -33,6 +33,8 @@ extern "C" bool GetOutputFile( int argc, char* argv[]);
 extern "C" FILE *GetXrmFile();
 extern "C" const char* getFilename();
 
+void yyerror( const char * );
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index dd0ddf2a9529..ebe8487aa599 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -34,8 +34,6 @@
 #include 
 #include 
 
-void yyerror(char const *);
-
 namespace {
 
 namespace global {
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index ceafbe2129f1..4670dc7c3ab2 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -37,8 +37,6 @@
 
 using namespace std;
 
-void yyerror( const char * );
-
 // set of global variables
 static bool bMergeMode;
 static bool bDisplayName;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2018-10-08 Thread Libreoffice Gerrit user
 l10ntools/inc/srclex.hxx  |   35 --
 l10ntools/source/srclex.l |  241 --
 2 files changed, 276 deletions(-)

New commits:
commit f5bafb4d9824956984d3bd2e1bc868996beca7fc
Author: Andras Timar 
AuthorDate: Sun Oct 7 11:40:48 2018 +0200
Commit: Andras Timar 
CommitDate: Mon Oct 8 09:50:12 2018 +0200

l10ntools: remove unused srclex

Change-Id: I464309a2409485b34bd9662372bedd897b41e474
Reviewed-on: https://gerrit.libreoffice.org/61490
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/l10ntools/inc/srclex.hxx b/l10ntools/inc/srclex.hxx
deleted file mode 100644
index 0789d97351c2..
--- a/l10ntools/inc/srclex.hxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_L10NTOOLS_INC_SRCLEX_HXX
-#define INCLUDED_L10NTOOLS_INC_SRCLEX_HXX
-
-#include 
-
-#include 
-
-extern "C" int WorkOnTokenSet( int, char* );
-extern "C" FILE * init(int, char **);
-extern "C" int SetError();
-extern "C" int GetError();
-extern "C" void Close();
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/srclex.l b/l10ntools/source/srclex.l
deleted file mode 100644
index 8fbb58361319..
--- a/l10ntools/source/srclex.l
+++ /dev/null
@@ -1,241 +0,0 @@
-
-%{
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-/*
- * lexer for parsing resource source files (*.src)
- */
-
-#include "sal/config.h"
-
-/* enlarge token buffer to tokenize whole strings */
-#undef YYLMAX
-#define YYLMAX 64000
-
-/* to enable debug output define LEXDEBUG */
-#define LEXDEBUG   1
-#ifdef LEXDEBUG
-#define OUTPUT fprintf
-#else
-#define OUTPUT(Par1,Par2);
-#endif
-
-/* table of possible token ids */
-#include "tokens.h"
-#include 
-#include 
-
-#include "sal/main.h"
-
-#include "srclex.hxx"
-
-#define YY_NO_UNISTD_H
-
-/* forwards */
-void YYWarning();
-%}
-
-%option yylineno
-%option never-interactive
-
-%p 24000
-%e 1200
-%n 500
-
-%%
-
-^[\t ]*"#pragma".* {
-   WorkOnTokenSet( PRAGMA, yytext );
-}
-
-^[ \t]*\n {
-   WorkOnTokenSet( EMPTYLINE, yytext );
-}
-
-[\t ]+ |
-^[\t ]*"#include".*|
-^[\t ]*"#undef".*  |
-"//".* |
-";"|
-"<"|
-">"|
-\n {
-   WorkOnTokenSet( IGNOREDTOKENS, yytext );
-}
-"/*"   {
-   char c1 = 0;
-   int c2 = yyinput();
-   char pChar[2];
-   pChar[1] = 0x00;
-   pChar[0] = c2;
-
-   WorkOnTokenSet( COMMENT, yytext );
-   WorkOnTokenSet( COMMENT, pChar );
-   for(;;) {
-   if ( c2 == EOF )
-   break;
-   if ( c1 == '*' && c2 == '/' )
-   break;
-   c1 = c2;
-   c2 = yyinput();
-   pChar[0] = c2;
-   WorkOnTokenSet( COMMENT, pChar );
-   }
-}
-
-^[\t ]*"#ifndef".+$|
-^[\t ]*"#ifdef".+$ |
-^[\t ]*"#if".+$|
-^[\t ]*"#elif".*$  |
-^[\t ]*"#else".*$  |
-^[\t ]*"#endif".*$ {
-   WorkOnTokenSet( CONDITION, yytext );
-}
-
-[a-zA-Z]+[\t ]+[^={\n]+[\t ] {
-/* defined Res */
-   WorkOnTokenSet( DEFINEDRES, yytext );
-}
-
-[a-zA-Z]+[ \t]+[^={;\n]+\n[ 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2018-09-30 Thread Libreoffice Gerrit user
 l10ntools/inc/po.hxx|1 +
 l10ntools/source/po.cxx |8 
 2 files changed, 9 insertions(+)

New commits:
commit 2a47dd078bf448f34f05a56a647410a66da00eea
Author: Andras Timar 
AuthorDate: Sun Sep 30 16:55:41 2018 +0200
Commit: Andras Timar 
CommitDate: Sun Sep 30 21:58:09 2018 +0200

pocheck: we need to access msgctxt of a PO entry

Change-Id: I43978811056692623344239d2c6e4763fa7de16b
Reviewed-on: https://gerrit.libreoffice.org/61165
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx
index 52c644f176cb..e213f47e177a 100644
--- a/l10ntools/inc/po.hxx
+++ b/l10ntools/inc/po.hxx
@@ -58,6 +58,7 @@ public:
 OString getLocalId() const;
 OString getResourceType() const;///< Get the type of component 
from which entry is extracted
 TYPEgetType() const;///< Get the type of entry
+OString const & getMsgCtxt() const;
 OString const & getMsgId() const;
 OString const & getMsgStr() const;
 boolisFuzzy() const;
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index e87fe66f25f1..a0cdf2172df2 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -354,6 +354,14 @@ bool PoEntry::isFuzzy() const
 return m_pGenPo->isFuzzy();
 }
 
+// Get message context
+const OString& PoEntry::getMsgCtxt() const
+{
+assert( m_bIsInitialized );
+return m_pGenPo->getMsgCtxt();
+
+}
+
 // Get translation string in merge format
 OString const & PoEntry::getMsgId() const
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc

2018-07-27 Thread Libreoffice Gerrit user
 l10ntools/inc/xmlparse.hxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 228b9801f1ec440cf3090a6f2ff24722c5bc26d0
Author: Stephan Bergmann 
AuthorDate: Fri Jul 27 09:36:05 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jul 27 12:54:32 2018 +0200

l10ntools: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)

...by explicitly defaulting the copy/move functions (and, where needed in 
turn,
also a default ctor) for classes that have a user-declared dtor that does
nothing other than an implicitly-defined one would do, but needs to be user-
declared because it is virtual and potentially serves as a key function to
emit the vtable, or is non-public, etc.

Change-Id: I4b3833ceb9da0a83be45c808f163dfad97f9c946
Reviewed-on: https://gerrit.libreoffice.org/58164
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 027076f39725..d07dd1b86afb 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -82,6 +82,11 @@ protected:
 public:
 virtual XMLNodeType GetNodeType() const = 0;
 virtual ~XMLNode(){}
+
+XMLNode(XMLNode const &) = default;
+XMLNode(XMLNode &&) = default;
+XMLNode & operator =(XMLNode const &) = default;
+XMLNode & operator =(XMLNode &&) = default;
 };
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source sal/osl sot/source

2018-07-26 Thread Libreoffice Gerrit user
 l10ntools/inc/helpmerge.hxx  |2 +-
 l10ntools/inc/lngmerge.hxx   |4 ++--
 l10ntools/inc/xmlparse.hxx   |2 +-
 l10ntools/source/helpmerge.cxx   |7 +++
 l10ntools/source/lngmerge.cxx|6 ++
 l10ntools/source/xmlparse.cxx|3 +--
 sal/osl/unx/file.cxx |8 
 sot/source/sdstor/stgdir.cxx |   12 ++--
 sot/source/sdstor/stgelem.cxx|3 +--
 sot/source/sdstor/stgelem.hxx|2 +-
 sot/source/sdstor/ucbstorage.cxx |8 
 11 files changed, 22 insertions(+), 35 deletions(-)

New commits:
commit ba42d00ed5a04850f88abdf184a4855db7cf2700
Author: Noel Grandin 
AuthorDate: Wed Jul 25 13:56:57 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 26 08:31:55 2018 +0200

loplugin:returnconstant in sal,l10ntools,sot

Change-Id: I3f4e4efa8ea839f48b9700ebc26c7e5ab279ce49
Reviewed-on: https://gerrit.libreoffice.org/57975
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 5837cc2f7765..99c9270df9fe 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -52,7 +52,7 @@ public:
 const OString& sLanguage , MergeDataFile* pMergeDataFile );
 
 private:
-bool MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile , 
const OString& sLanguage , OString const & sPath );
+void MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile , 
const OString& sLanguage , OString const & sPath );
 
 static void ProcessHelp( LangHashMap* aLangHM , const OString& sCur , 
ResData *pResData , MergeDataFile* pMergeDataFile );
 };
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index 35c7868b01a3..56eaec71b11d 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -54,8 +54,8 @@ public:
 LngParser(const OString );
 ~LngParser();
 
-bool CreatePO( const OString  );
-bool Merge(const OString , const OString ,
+void CreatePO( const OString  );
+void Merge(const OString , const OString ,
  const OString  );
 };
 
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 04f150d5d674..027076f39725 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -157,7 +157,7 @@ public:
 
 XMLHashMap* GetStrings(){ return m_pXMLStrings.get(); }
 void Write( OString const  );
-bool Write( std::ofstream , XMLNode *pCur = nullptr );
+void Write( std::ofstream , XMLNode *pCur = nullptr );
 
 bool CheckExportStatus( XMLParentNode *pCur = nullptr );
 
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 92f5171e5e67..0a2e3c3dfd52 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -156,12 +156,12 @@ bool HelpParser::Merge( const OString ,
 SAL_WARN("l10ntools", "could not parse " << sHelpFile);
 return false;
 }
-bool hasNoError = MergeSingleFile( xmlfile , pMergeDataFile , rLanguage , 
rDestinationFile );
+MergeSingleFile( xmlfile , pMergeDataFile , rLanguage , rDestinationFile );
 delete xmlfile;
-return hasNoError;
+return true;
 }
 
-bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile* 
pMergeDataFile , const OString& sLanguage ,
+void HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile* 
pMergeDataFile , const OString& sLanguage ,
   OString const & sPath )
 {
 file->Extract();
@@ -189,7 +189,6 @@ bool HelpParser::MergeSingleFile( XMLFile* file , 
MergeDataFile* pMergeDataFile
  }
 
 file->Write(sPath);
-return true;
 }
 
 /* ProcessHelp method: search for en-US entry and replace it with the current 
language*/
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index f5215e4d14b2..39f98747e99c 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -79,7 +79,7 @@ LngParser::~LngParser()
 {
 }
 
-bool LngParser::CreatePO( const OString  )
+void LngParser::CreatePO( const OString  )
 {
 PoOfstream aPOStream( rPOFile, PoOfstream::APP );
 if (!aPOStream.isOpen()) {
@@ -109,7 +109,6 @@ bool LngParser::CreatePO( const OString  )
 Text.erase("x-comment");
 }
 aPOStream.close();
-return true;
 }
 
 void LngParser::WritePO(PoOfstream ,
@@ -145,7 +144,7 @@ void LngParser::ReadLine(const OString _in,
 }
 }
 
-bool LngParser::Merge(
+void LngParser::Merge(
 const OString ,
 const OString ,
 const OString  )
@@ -290,7 +289,6 @@ bool LngParser::Merge(
 aDestination << mvLines[i] << '\n';
 
 aDestination.close();
-return true;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index f8faf8538089..462c4d2e1ce9 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -164,7 +164,7 @@ void XMLFile::Write( OString const  

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source xmlhelp/util

2017-06-23 Thread Gabor Kelemen
 l10ntools/inc/xmlparse.hxx |4 
 l10ntools/source/gLexXhp.l |5 -
 l10ntools/source/helpmerge.cxx |   10 ++
 l10ntools/source/xmlparse.cxx  |   11 +--
 xmlhelp/util/compact.xsl   |2 --
 5 files changed, 3 insertions(+), 29 deletions(-)

New commits:
commit c9b9224018c5a6acc9b6790db0f321fb8913f8ff
Author: Gabor Kelemen 
Date:   Mon Jun 12 22:08:55 2017 +0200

Remove support for the oldref attribute in l10ntools

Now that oldref and l10n attributes were removed from
helpcontent in commit eb9ec1c794a0d3b8522375c7a87ac3ee999c8a66
we can as well drop support of these from l10ntools and xmlhelp

Change-Id: Ib6fe30e93f0d7e976bb675beee9395ab543af99c
Reviewed-on: https://gerrit.libreoffice.org/38715
Tested-by: Jenkins 
Reviewed-by: Andras Timar 

diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 22ec04469316..037a3843326a 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -203,7 +203,6 @@ private:
 OString m_sElementName;
 std::unique_ptr m_pAttributes;
 OString m_sId;
-OString m_sOldRef;
 OString m_sLanguageId;
 int m_nPos;
 
@@ -239,9 +238,6 @@ public:
 void SetId  ( OString const & sTheId )  { m_sId = sTheId; }
 void SetLanguageId  ( OString const & sLangId ) { m_sLanguageId = 
sLangId; }
 void SetPos ( int nPos ){ m_nPos = nPos; }
-void SetOldRef  ( OString const & sOldRef ) { m_sOldRef = 
sOldRef; }
-
-const OString& GetOldref() const   { return m_sOldRef;  }
 };
 
 /** Holds character data
diff --git a/l10ntools/source/gLexXhp.l b/l10ntools/source/gLexXhp.l
index b8577a44dfa4..93888471d07f 100644
--- a/l10ntools/source/gLexXhp.l
+++ b/l10ntools/source/gLexXhp.l
@@ -82,11 +82,6 @@ IDENT [\.a-zA-Z0-9_-]+
 
 
 
-"oldref="{SP}\"{SP}{IDENT}{SP}\" {
-LOCptr->setRef(yytext);
-}
-
-
 "first, pXMLElement->GetOldref(), OString(), data);
+posm->first, OString(), OString(), data);
 
 pXMLElement=nullptr;
 }
@@ -202,8 +202,6 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const 
OString& sCur , ResDa
 XMLElement*   pXMLElement = nullptr;
 MergeEntrys   *pEntrys= nullptr;
 
-OString sLId;
-
 pEntrys = nullptr;
 
 if( !sCur.equalsIgnoreAsciiCase("en-US") ){
@@ -214,9 +212,6 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const 
OString& sCur , ResDa
 }
 if( pXMLElement != nullptr )
 {
-sLId= pXMLElement->GetOldref();
-pResData->sId =  sLId;
-
 OString sNewText;
 OString sNewdata;
 OString sSourceText(
@@ -264,8 +259,7 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const 
OString& sCur , ResDa
 {
 SAL_WARN(
 "l10ntools",
-"Can't find GID=" << pResData->sGId << " LID="
-<< pResData->sId << " TYP=" << pResData->sResTyp);
+"Can't find GID=" << pResData->sGId << " TYP=" << 
pResData->sResTyp);
 }
 pXMLElement->ChangeLanguageTag(sCur);
 }
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index 7717b22d3157..ae93b44437f9 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -39,7 +39,6 @@ using namespace osl;
 
 #define XML_LANG"xml-lang"
 #define ID  "id"
-#define OLDREF  "oldref"
 
 
 // class XMLChildNode
@@ -446,7 +445,7 @@ void XMLFile::SearchL10NElements( XMLChildNode *pCur, int 
nPos )
 bool bInsert = true;
 XMLElement *pElement = static_cast(pCur);
 const OString sName(pElement->GetName().toAsciiLowerCase());
-OString sLanguage, sTmpStrVal, sOldref;
+OString sLanguage, sTmpStrVal;
 if ( pElement->GetAttributeList())
 {
 for ( size_t j = 0 , cnt = 
pElement->GetAttributeList()->size(); j < cnt && bInsert; ++j )
@@ -464,14 +463,9 @@ void XMLFile::SearchL10NElements( XMLChildNode *pCur, int 
nPos )
 {
 sLanguage=(*pElement->GetAttributeList())[ j 
]->GetValue();
 }
-if (sTmpStr == OLDREF) // Get the "oldref" Attribute
-{
-sOldref=(*pElement->GetAttributeList())[ j 
]->GetValue();
-}
 }
 pElement->SetLanguageId( sLanguage );
 pElement->SetId( sTmpStrVal );
-pElement->SetOldRef( sOldref );
 pElement->SetPos( nPos );
 }
 
@@ -555,7 +549,6 @@ XMLElement::XMLElement(
 : XMLParentNode( 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-05-22 Thread Noel Grandin
 l10ntools/inc/export.hxx|   15 +---
 l10ntools/source/export.cxx |   52 ++--
 2 files changed, 33 insertions(+), 34 deletions(-)

New commits:
commit c093af75202f6c9d8e6ae7d8e933b82da6f2c11b
Author: Noel Grandin 
Date:   Thu May 19 15:49:47 2016 +0200

Convert LIST to scoped enum

Change-Id: Ia8a1dbf0277c553e8bd7b3a1da5b9f865f076608
Reviewed-on: https://gerrit.libreoffice.org/25195
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 52d0ea1..6372f90 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -99,11 +99,10 @@ public:
 // class Export
 
 
-#define LIST_NON0x
-#define LIST_STRING 0x0001
-#define LIST_FILTER 0x0002
-#define LIST_ITEM   0x0004
-#define LIST_PAIRED 0x0005
+enum class ExportListType {
+NONE, String, Filter, Item, Paired
+};
+
 #define STRING_TYP_TEXT 0x0010
 #define STRING_TYP_QUICKHELPTEXT0x0040
 #define STRING_TYP_TITLE0x0080
@@ -127,8 +126,8 @@ private:
 
 bool bDefine;   // cur. res. in a define?
 bool bNextMustBeDefineEOL;  ///< define but no \ at lineend
-std::size_t nLevel; // res. recursiv? how deep?
-sal_uInt16 nList;   ///< cur. res. is List
+std::size_t nLevel; // res. recursive? how deep?
+ExportListType nList;   ///< cur. res. is List
 std::size_t nListIndex;
 std::size_t nListLevel;
 bool bMergeMode;
@@ -142,7 +141,7 @@ private:
 ParserQueue* pParseQueue;
 
 void WriteData( ResData *pResData, bool bCreateNew = false ); ///< called 
before dest. cur ResData
-void WriteExportList( ResData *pResData, ExportList& rExportList, const 
sal_uInt16 nTyp );
+void WriteExportList( ResData *pResData, ExportList& rExportList, const 
ExportListType nTyp );
 
 OString FullId();///< creates cur. GID
 
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 57fdd43..fd7fe64 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -48,21 +48,21 @@ std::unique_ptr< Export > exporter;
 
 }
 
-OString lcl_GetListTyp( const sal_uInt16 nTyp, const bool bUpperCamelCase )
+OString lcl_GetListTyp( const ExportListType nTyp, const bool bUpperCamelCase )
 {
 OString sType;
 switch (nTyp)
 {
-case LIST_STRING:
+case ExportListType::String:
 sType = bUpperCamelCase ? "StringList" : "stringlist";
 break;
-case LIST_FILTER:
+case ExportListType::Filter:
 sType = bUpperCamelCase ? "FilterList" : "filterlist";
 break;
-case LIST_ITEM:
+case ExportListType::Item:
 sType = bUpperCamelCase ? "ItemList" : "itemlist";
 break;
-case LIST_PAIRED:
+case ExportListType::Paired:
 sType = bUpperCamelCase ? "PairedList" : "pairedlist";
 break;
 default: break;
@@ -196,7 +196,7 @@ Export::Export(const OString )
 bDefine( false ),
 bNextMustBeDefineEOL( false ),
 nLevel( 0 ),
-nList( LIST_NON ),
+nList( ExportListType::NONE ),
 nListIndex( 0 ),
 nListLevel( 0 ),
 bMergeMode( false ),
@@ -220,7 +220,7 @@ Export::Export(
 bDefine( false ),
 bNextMustBeDefineEOL( false ),
 nLevel( 0 ),
-nList( LIST_NON ),
+nList( ExportListType::NONE ),
 nListIndex( 0 ),
 nListLevel( 0 ),
 bMergeMode( true ),
@@ -247,7 +247,7 @@ void Export::Init()
 bDefine = false;
 bNextMustBeDefineEOL = false;
 nLevel = 0;
-nList = LIST_NON;
+nList = ExportListType::NONE;
 nListIndex = 0;
 for ( size_t i = 0, n = aResStack.size(); i < n;  ++i )
 delete aResStack[ i ];
@@ -442,7 +442,7 @@ void Export::Execute( int nToken, const char * pToken )
 break;
 case LEVELUP: {
 // push
-if ( nList )
+if ( nList != ExportListType::NONE )
 {
 nListLevel++;
 break;
@@ -463,7 +463,7 @@ void Export::Execute( int nToken, const char * pToken )
 break;
 case LEVELDOWN: {
 // pop
-if ( !nList || !nListLevel ) {
+if ( nList == ExportListType::NONE || !nListLevel ) {
 if ( nLevel ) {
 if ( bDefine && (nLevel == 1 )) {
 bDefine = false;
@@ -476,9 +476,9 @@ void Export::Execute( int nToken, const char * pToken )
 aResStack.erase( it );
 nLevel--;
 

[Libreoffice-commits] core.git: l10ntools/inc linguistic/source lotuswordpro/source

2016-05-19 Thread Noel Grandin
 l10ntools/inc/xmlparse.hxx  |1 
 linguistic/source/defs.hxx  |9 --
 lotuswordpro/source/filter/bento.hxx|   15 
 lotuswordpro/source/filter/lwpobj.hxx   |2 
 lotuswordpro/source/filter/lwpslvlist.hxx   |   83 
 lotuswordpro/source/filter/lwpsortopt.hxx   |1 
 lotuswordpro/source/filter/lwptabrack.cxx   |1 
 lotuswordpro/source/filter/lwpusrdicts.hxx  |1 
 lotuswordpro/source/filter/utlist.hxx   |   11 ---
 lotuswordpro/source/filter/xfilter/xfbreaks.hxx |6 -
 lotuswordpro/source/filter/xfilter/xfchange.cxx |   13 ---
 lotuswordpro/source/filter/xfilter/xfchange.hxx |   10 --
 lotuswordpro/source/filter/xfilter/xflist.hxx   |   18 -
 13 files changed, 171 deletions(-)

New commits:
commit 808c2b9ff52bea3c1e0580e7ac2aa75406d6e2d1
Author: Noel Grandin 
Date:   Wed May 18 15:04:07 2016 +0200

loplugin:unusedmethods in l10ntools to lotuswordpro

Change-Id: Ibda82734821f3faa9388f7508e6a3e39e5b5007d
Reviewed-on: https://gerrit.libreoffice.org/25106
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 7b0daae..4d1000c 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -216,7 +216,6 @@ protected:
 void Print(XMLNode *pCur, OStringBuffer& rBuffer, bool bRootelement) const;
 public:
 /// create an element node
-XMLElement(){}
 XMLElement(
 const OString ,// the element name
 XMLParentNode *pParent   // parent node of this element
diff --git a/linguistic/source/defs.hxx b/linguistic/source/defs.hxx
index 213f812..a42cd89 100644
--- a/linguistic/source/defs.hxx
+++ b/linguistic/source/defs.hxx
@@ -67,21 +67,13 @@ struct LangSvcEntries_Spell : public LangSvcEntries
 {
 css::uno::Sequence< css::uno::Reference< css::linguistic2::XSpellChecker > 
>  aSvcRefs;
 
-LangSvcEntries_Spell() : LangSvcEntries() {}
 explicit LangSvcEntries_Spell( const css::uno::Sequence< OUString > 
 ) : LangSvcEntries( rSvcImplNames ) {}
 };
 
-struct LangSvcEntries_Grammar : public LangSvcEntries
-{
-LangSvcEntries_Grammar() : LangSvcEntries() {}
-explicit LangSvcEntries_Grammar( const OUString  ) : 
LangSvcEntries( rSvcImplName ) {}
-};
-
 struct LangSvcEntries_Hyph : public LangSvcEntries
 {
 css::uno::Sequence< css::uno::Reference< css::linguistic2::XHyphenator > > 
 aSvcRefs;
 
-LangSvcEntries_Hyph() : LangSvcEntries() {}
 explicit LangSvcEntries_Hyph( const OUString  ) : 
LangSvcEntries( rSvcImplName ) {}
 };
 
@@ -89,7 +81,6 @@ struct LangSvcEntries_Thes : public LangSvcEntries
 {
 css::uno::Sequence< css::uno::Reference< css::linguistic2::XThesaurus > >  
aSvcRefs;
 
-LangSvcEntries_Thes() : LangSvcEntries() {}
 explicit LangSvcEntries_Thes( const css::uno::Sequence< OUString > 
 ) : LangSvcEntries( rSvcImplNames ) {}
 };
 
diff --git a/lotuswordpro/source/filter/bento.hxx 
b/lotuswordpro/source/filter/bento.hxx
index 2094a7f..1530f03 100644
--- a/lotuswordpro/source/filter/bento.hxx
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -162,9 +162,6 @@ public: // Methods
 cpNamedObject = pObj;
 }
 
-CBenNamedObjectListElmt(pCBenNamedObject pNamedObject,
-  pCBenNamedObjectListElmt pPrev) : CUtListElmt(pPrev)
-  { cpNamedObject = pNamedObject; }
 pCBenNamedObject GetNamedObject() { return cpNamedObject; }
 
 private: // Data
@@ -276,12 +273,6 @@ public: // Internal methods
 cpProperty = pProperty;
 }
 
-CBenValue(pCBenProperty pProperty, BenObjectID TypeID) :
-  CBenIDListElmt(TypeID)
-{
-cpProperty = pProperty;
-cpReferencedList = nullptr;
-}
 inline pCBenValueSegment GetNextValueSegment(pCBenValueSegment
   pCurrValueSegment);
 inline pLtcBenContainer GetContainer();
@@ -329,12 +320,6 @@ public: // Internal methods
   unsigned short Size) : CUtListElmt(>GetValueSegments())
   { cpValue = pValue; cImmediate = true;
   UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; }
-CBenValueSegment(BenContainerPos Pos, unsigned long Size)
-  { cpValue = nullptr; cImmediate = false; cPos = Pos;
-  cSize = Size; }
-CBenValueSegment(const void  * pImmData, unsigned short Size)
-  { cpValue = nullptr; cImmediate = true;
-  UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; }
 bool IsImmediate() { return cImmediate; }
 BenContainerPos GetPosition() { return cPos; }
 unsigned long GetSize() { return cSize; }
diff --git a/lotuswordpro/source/filter/lwpobj.hxx 
b/lotuswordpro/source/filter/lwpobj.hxx
index 7556a47..041e3e1 100644
--- a/lotuswordpro/source/filter/lwpobj.hxx
+++ b/lotuswordpro/source/filter/lwpobj.hxx
@@ -80,8 +80,6 @@ class LwpFoundry;
 */
 class LwpObject: public salhelper::SimpleReferenceObject
 {
-private:
-   

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-05-02 Thread jan Iversen
 l10ntools/inc/gConvSrc.hxx|7 ++--
 l10ntools/source/gConvSrc.cxx |   65 ++
 l10ntools/source/gDiff.sh |9 +
 l10ntools/source/gLexSrc.l|   57 ++--
 l10ntools/source/gRun.sh  |2 -
 5 files changed, 83 insertions(+), 57 deletions(-)

New commits:
commit 6a3139493857631784f64419048ee258cd0c4493
Author: jan Iversen 
Date:   Mon May 2 16:50:50 2016 +

genlang macro support for .src files

Added macro detection in .src filter
Updated gDiff and gRun scripts with enhancements

Change-Id: I3ef72e8ccee65d03fe5080e27699ceebb079

diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx
index 77922c9..605fffb 100644
--- a/l10ntools/inc/gConvSrc.hxx
+++ b/l10ntools/inc/gConvSrc.hxx
@@ -39,16 +39,19 @@ class convert_src : public convert_gen
 void setCmd(string& syyText);
 void startBlock();
 void stopBlock();
+void defMacro();
+void endMacro();
 
 //void setId (char *syyText, bool bIde);
 //void setText   (char *syyText);
-//void setMacro  (char *syyText);
 //void setList   (char *syyText);
 //void setListItem   (char const *syyText, bool bIsStart);
 //void setNL (char *syyText, bool bMacro);
 
 private:
 vector mcStack;
+int  miLevel;
+bool mbMacroActive;
 void doExecute() override;
 #if 0
 string  msValue;
@@ -58,13 +61,11 @@ class convert_src : public convert_gen
 string  msGroup;
 bool mbEnUs;
 bool mbExpectName;
-bool mbExpectMacro;
 bool mbAutoPush;
 bool mbValuePresent;
 bool mbInList;
 bool mbInListItem;
 int  miListCount;
-int  miMacroLevel;
 
 static void trim(string& sText);
 void buildKey(string& sKey);
diff --git a/l10ntools/source/gConvSrc.cxx b/l10ntools/source/gConvSrc.cxx
index 20085a0..213a3d2 100644
--- a/l10ntools/source/gConvSrc.cxx
+++ b/l10ntools/source/gConvSrc.cxx
@@ -29,13 +29,13 @@ using namespace std;
 
 
 convert_src::convert_src(l10nMem& crMemory)
-: convert_gen(crMemory)
+: convert_gen(crMemory),
+  miLevel(0),
+  mbMacroActive(false)
 #if 0
-,
   mbExpectValue(false),
   mbEnUs(false),
   mbExpectName(false),
-  mbExpectMacro(false),
   mbAutoPush(false),
   mbValuePresent(false),
   mbInList(false),
@@ -62,11 +62,11 @@ void convert_src::setValue(string& syyText)
 for (int i = 0; i < stackSize; i++)
 cout << mcStack[i] << "\n";
 }
-string subid = (stackSize > 3) ? mcStack[2] : mcStack[0];
-l10nMem::keyToLower(subid);
+string subid = (stackSize > 3) ? mcStack[stackSize - 1] : "";
+string stringid = mcStack[stackSize - 2];
+l10nMem::keyToLower(stringid);
 
-mcMemory.setSourceKey(miLineNo, msSourceFile, mcStack[1], cleanValue, "", 
subid, mcStack[stackSize-1], false);
-mcStack.pop_back();
+mcMemory.setSourceKey(miLineNo, msSourceFile, mcStack[1], cleanValue, "", 
stringid, subid, false);
 }
 
 
@@ -98,19 +98,51 @@ void convert_src::setCmd(string& syyText)
 
 void convert_src::startBlock()
 {
+unsigned int cnt = 2 * ++miLevel;
+
+while (cnt > mcStack.size())
+mcStack.push_back("");
 }
 
 
 
 void convert_src::stopBlock()
 {
+if (miLevel > 0)
+miLevel--;
+
 // check for correct node/prop relations
-if (mcStack.size())
-mcStack.pop_back();
+if (mcStack.size()) {
+if (miLevel) {
+mcStack.pop_back();
+mcStack.pop_back();
+}
+else
+mcStack.clear();
+}
 }
 
 
 
+void convert_src::defMacro()
+{
+if (!miLevel)
+miLevel++;
+mbMacroActive = true;
+}
+
+
+
+void convert_src::endMacro()
+{
+if (mbMacroActive) {
+mbMacroActive = false;
+miLevel = 0;
+mcStack.clear();
+}
+}
+
+
 #if 0
 void convert_src::setId(char *syyText, bool bId)
 {
@@ -135,21 +167,6 @@ void convert_src::setText(char *syyText)
 
 
 #if 0
-void convert_src::setMacro(char *syyText)
-{
-msCmd = copySource(syyText);
-mbExpectName =
-mbExpectMacro =
-mbAutoPush = true;
-miMacroLevel = mcStack.size();
-mcStack.push_back("");
-trim(msCmd);
-}
-#endif
-
-
-
-#if 0
 void convert_src::setList(char *syyText)
 {
 msCmd = copySource(syyText);
diff --git a/l10ntools/source/gDiff.sh b/l10ntools/source/gDiff.sh

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-05-02 Thread jan Iversen
 l10ntools/inc/gConvSrc.hxx|   32 ---
 l10ntools/source/gConvSrc.cxx |  174 +++-
 l10ntools/source/gLexSrc.l|  182 ++
 l10ntools/source/gRun.sh  |2 
 4 files changed, 218 insertions(+), 172 deletions(-)

New commits:
commit 8aed53c10425fab4813b439abe3ee60939dc9a14
Author: jan Iversen 
Date:   Mon May 2 11:46:13 2016 +

genLang .src conversion, first version.

LO uses the .src quite differently, so a new implementation
was made.

The unused old functions are hanging in a #if 0, and will
be removed later.

Change-Id: Ic466a1b97f9f65c9f658612bd2aa325396e929c3

diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx
index 3f3f9a2..77922c9 100644
--- a/l10ntools/inc/gConvSrc.hxx
+++ b/l10ntools/inc/gConvSrc.hxx
@@ -28,26 +28,29 @@ extern int srclex(void);
 class convert_src : public convert_gen
 {
 public:
-bool mbExpectValue;
+//bool mbExpectValue;
 
 convert_src(l10nMem& crMemory);
 ~convert_src() override {};
 
-void setValue  (char *syyText, char *sbuildValue);
-void setLang   (char *syyText, bool bEnUs);
-void setId (char *syyText, bool bIde);
-void setText   (char *syyText);
-void setName   (char *syyText);
-void setCmd(char *syyText);
-void setMacro  (char *syyText);
-void setList   (char *syyText);
-void setListItem   (char const *syyText, bool bIsStart);
-void setNL (char *syyText, bool bMacro);
-void startBlock(char *syyText);
-void stopBlock (char *syyText);
+void setValue(string& syyText);
+bool setLang(string& syyText);
+void setName(string& syyText);
+void setCmd(string& syyText);
+void startBlock();
+void stopBlock();
+
+//void setId (char *syyText, bool bIde);
+//void setText   (char *syyText);
+//void setMacro  (char *syyText);
+//void setList   (char *syyText);
+//void setListItem   (char const *syyText, bool bIsStart);
+//void setNL (char *syyText, bool bMacro);
 
 private:
 vector mcStack;
+void doExecute() override;
+#if 0
 string  msValue;
 string  msName;
 string  msTextName;
@@ -62,9 +65,10 @@ class convert_src : public convert_gen
 bool mbInListItem;
 int  miListCount;
 int  miMacroLevel;
-void doExecute() override;
+
 static void trim(string& sText);
 void buildKey(string& sKey);
 void insertLanguagePart(string& sKey, string& sTextType);
+#endif
 };
 #endif
diff --git a/l10ntools/source/gConvSrc.cxx b/l10ntools/source/gConvSrc.cxx
index 2be9ce6..20085a0 100644
--- a/l10ntools/source/gConvSrc.cxx
+++ b/l10ntools/source/gConvSrc.cxx
@@ -29,7 +29,9 @@ using namespace std;
 
 
 convert_src::convert_src(l10nMem& crMemory)
-: convert_gen(crMemory),
+: convert_gen(crMemory)
+#if 0
+,
   mbExpectValue(false),
   mbEnUs(false),
   mbExpectName(false),
@@ -38,6 +40,7 @@ convert_src::convert_src(l10nMem& crMemory)
   mbValuePresent(false),
   mbInList(false),
   mbInListItem(false)
+#endif
 {
 }
 
@@ -50,112 +53,116 @@ void convert_src::doExecute()
 
 
 
-void convert_src::setValue(char *syyText, char *sbuildValue)
+void convert_src::setValue(string& syyText)
 {
-copySource(syyText);
-
-if (mbInList && !mbInListItem) {
-setListItem("", true);
-setListItem("", false);
+int stackSize = mcStack.size();
+string cleanValue = syyText.substr(1, syyText.size() - 1);
+{
+cout << "test value\n";
+for (int i = 0; i < stackSize; i++)
+cout << mcStack[i] << "\n";
 }
-msValue= sbuildValue;
-if (mbInListItem)
-msGroup = msValue;
-mbValuePresent = true;
-mbExpectValue  = false;
+string subid = (stackSize > 3) ? mcStack[2] : mcStack[0];
+l10nMem::keyToLower(subid);
+
+mcMemory.setSourceKey(miLineNo, msSourceFile, mcStack[1], cleanValue, "", 
subid, mcStack[stackSize-1], false);
+mcStack.pop_back();
 }
 
 
 
-void convert_src::setLang(char *syyText, bool bEnUs)
+bool convert_src::setLang(string& syyText)
 {
-string useText = copySource(syyText) + " is no en-US language";
+if (syyText == "en-US")
+return true;
+else if (syyText != "x-comment")
+l10nMem::showError(syyText + " non legal language");
+return false;
+}
+
+
 
-mbEnUs = bEnUs;
-if (!bEnUs && mbExpectValue)
-

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-04-04 Thread jan iversen
 l10ntools/inc/gConv.hxx|2 +-
 l10ntools/inc/gConvPo.hxx  |1 +
 l10ntools/inc/gConvSrc.hxx |3 ++-
 l10ntools/inc/gL10nMem.hxx |7 +--
 l10ntools/source/export.cxx|4 ++--
 l10ntools/source/gConv.cxx |2 +-
 l10ntools/source/gConvPo.cxx   |   17 ++---
 l10ntools/source/gConvSrc.cxx  |   21 -
 l10ntools/source/gConvTree.cxx |6 +++---
 l10ntools/source/gConvUlf.cxx  |2 +-
 l10ntools/source/gConvXcs.cxx  |2 +-
 l10ntools/source/gConvXcu.cxx  |6 +++---
 l10ntools/source/gConvXhp.cxx  |4 ++--
 l10ntools/source/gConvXrm.cxx  |2 +-
 l10ntools/source/gDiff.sh  |9 +
 l10ntools/source/gL10nMem.cxx  |   26 --
 l10ntools/source/gLang.cxx |   22 +++---
 l10ntools/source/gTest.sh  |6 ++
 l10ntools/source/lngmerge.cxx  |2 +-
 l10ntools/source/merge.cxx |4 ++--
 l10ntools/source/po.cxx|8 
 l10ntools/source/treemerge.cxx |6 +++---
 l10ntools/source/xmlparse.cxx  |6 +++---
 23 files changed, 104 insertions(+), 64 deletions(-)

New commits:
commit 2ef9d5de7df7b38e091af7bd7276e68812493cc0
Author: jan iversen 
Date:   Mon Apr 4 19:37:01 2016 +0200

genlang, update to satisfy clang.

changes due a log from clang tinderbox.

minor changes to interpret more files

Change-Id: I3821aab91dc21e74c870628a4f2265ab61d37cca

diff --git a/l10ntools/inc/gConv.hxx b/l10ntools/inc/gConv.hxx
index 3b5c1d1..a3229127 100644
--- a/l10ntools/inc/gConv.hxx
+++ b/l10ntools/inc/gConv.hxx
@@ -63,7 +63,7 @@ class convert_gen
 
 // utility functions for converters
 void writeSourceFile(const string& line);
-bool createDir(const string& sDir, const string& sFile);
+static bool createDir(const string& sDir, const string& sFile);
 private:
 ofstream mcOutputFile;
 static bool checkAccess(string& sFile);
diff --git a/l10ntools/inc/gConvPo.hxx b/l10ntools/inc/gConvPo.hxx
index 53257c2..ebf1ee3 100644
--- a/l10ntools/inc/gConvPo.hxx
+++ b/l10ntools/inc/gConvPo.hxx
@@ -54,6 +54,7 @@ class convert_po : public convert_gen
   const string& sText,
   const string& sComment,
   const string& sResource,
+  const string& sGroup,
   bool   bFuzzy);
 void endSave();
 
diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx
index 4aaa8bf..3f3f9a2 100644
--- a/l10ntools/inc/gConvSrc.hxx
+++ b/l10ntools/inc/gConvSrc.hxx
@@ -52,6 +52,7 @@ class convert_src : public convert_gen
 string  msName;
 string  msTextName;
 string  msCmd;
+string  msGroup;
 bool mbEnUs;
 bool mbExpectName;
 bool mbExpectMacro;
@@ -62,7 +63,7 @@ class convert_src : public convert_gen
 int  miListCount;
 int  miMacroLevel;
 void doExecute() override;
-void trim(string& sText);
+static void trim(string& sText);
 void buildKey(string& sKey);
 void insertLanguagePart(string& sKey, string& sTextType);
 };
diff --git a/l10ntools/inc/gL10nMem.hxx b/l10ntools/inc/gL10nMem.hxx
index f2c116c..c657c82 100644
--- a/l10ntools/inc/gL10nMem.hxx
+++ b/l10ntools/inc/gL10nMem.hxx
@@ -57,6 +57,7 @@ class l10nMem
   const string& sText,
   const string& sComment,
   const string& sResource,
+  const string& sGroup,
   bool  bIsFuzzy);
 void setSourceKey(int   iLineNo,
   const string& sFilename,
@@ -64,6 +65,7 @@ class l10nMem
   const string& sText,
   const string& sComment,
   const string& sResource,
+  const string& sGroup,
   bool  bMustExist);
 
 void saveTemplates(const string& sTargetDir,
@@ -88,7 +90,6 @@ class l10nMem
 int  miCurFileInx;
 int  miCurLangInx;
 int  miCurENUSinx;
-bool mbNeedWrite;
 bool mbConvertMode;
 bool mbStrictMode;
 vector  mcENUSlist;
@@ -111,7 +112,8 @@ class l10nMem
  const string& sKey,
  const string& sMsgId,
  const string& sComment,
- const string& sResource);
+ const string& sResource,
+ const string& sGroup);
 void loadLangKey(int   iLineNo,
  const string& sSourceFile,
  const string& sKey,
@@ -130,6 +132,7 @@ class l10nMem
   

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-03-26 Thread jan iversen
 l10ntools/inc/gConv.hxx   |3 +-
 l10ntools/inc/gConvPo.hxx |5 +++
 l10ntools/inc/gConvSrc.hxx|3 ++
 l10ntools/inc/gL10nMem.hxx|2 -
 l10ntools/source/gConv.cxx|   45 -
 l10ntools/source/gConvPo.cxx  |   56 --
 l10ntools/source/gConvSrc.cxx |   15 +--
 l10ntools/source/gConvXcu.cxx |5 +++
 l10ntools/source/gL10nMem.cxx |8 +++---
 l10ntools/source/gLexPo.l |   46 ++
 l10ntools/source/gLexSrc.l|   46 ++
 l10ntools/source/gLexTree.l   |   36 ++-
 l10ntools/source/gLexUi.l |   44 +
 l10ntools/source/gLexUlf.l|   38 +++-
 l10ntools/source/gLexXcs.l|   38 +++-
 l10ntools/source/gLexXcu.l|   40 +++---
 l10ntools/source/gLexXhp.l|   35 ++
 l10ntools/source/gLexXml.l|   44 +
 l10ntools/source/gLexXrm.l|   35 +++---
 l10ntools/source/gRun.sh  |   10 +++
 20 files changed, 150 insertions(+), 404 deletions(-)

New commits:
commit 83f9151b13b0bb4ad670f9c4a9f02dbb06f233af
Author: jan iversen 
Date:   Sat Mar 26 20:54:55 2016 +0100

genlang, clenaup top of Lex files

Duplicate functions in lex files removed
Top part simplified and made identical.

Change-Id: I7288bfdbeba9d1ec96b5d2bc7b21dd65337cd8d7

diff --git a/l10ntools/inc/gConv.hxx b/l10ntools/inc/gConv.hxx
index 86d84a7..d329a5a 100644
--- a/l10ntools/inc/gConv.hxx
+++ b/l10ntools/inc/gConv.hxx
@@ -42,7 +42,8 @@ class convert_gen
 virtual void doExecute() = 0;
 
 // utility functions for converters
-void lexRead(char *sBuf, int *nResult, int nMax_size);
+int lexRead(char *sBuf, int nMax_size);
+static void lexStrncpy(char* s1, const char * s2, int n);
 string& copySource(char const *yyText, bool bDoClear = true);
 
 protected:
diff --git a/l10ntools/inc/gConvPo.hxx b/l10ntools/inc/gConvPo.hxx
index 31c037d..5be3657 100644
--- a/l10ntools/inc/gConvPo.hxx
+++ b/l10ntools/inc/gConvPo.hxx
@@ -22,6 +22,10 @@
 
 
 
+extern int polex(void);
+
+
+
 class convert_po : public convert_gen
 {
 public:
@@ -61,5 +65,6 @@ class convert_po : public convert_gen
 filebuf outBuffer;
 
 void doExecute() override;
+string genKeyId(const string& text);
 };
 #endif
diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx
index 65bd5eb..4aaa8bf 100644
--- a/l10ntools/inc/gConvSrc.hxx
+++ b/l10ntools/inc/gConvSrc.hxx
@@ -21,6 +21,9 @@
 #include "gConv.hxx"
 
 
+extern int srclex(void);
+
+
 
 class convert_src : public convert_gen
 {
diff --git a/l10ntools/inc/gL10nMem.hxx b/l10ntools/inc/gL10nMem.hxx
index 635f4fb..f2c116c 100644
--- a/l10ntools/inc/gL10nMem.hxx
+++ b/l10ntools/inc/gL10nMem.hxx
@@ -39,7 +39,7 @@ class l10nMem
 static void showWarning(const string& sText, int iLineNo = 0);
 static void showDebug  (const string& sText, int iLineNo = 0);
 static void showVerbose(const string& sText, int iLineNo = 0);
-static void keyToUpper (string& sKey);
+static void keyToLower (string& sKey);
 
 void setModuleName(const string& sModuleName);
 const string& getModuleName(void);
diff --git a/l10ntools/source/gConv.cxx b/l10ntools/source/gConv.cxx
index 9104431..1070e88 100644
--- a/l10ntools/source/gConv.cxx
+++ b/l10ntools/source/gConv.cxx
@@ -191,29 +191,38 @@ bool convert_gen::prepareFile()
 
 
 
-void convert_gen::lexRead(char *sBuf, int *nResult, int nMax_size)
+int convert_gen::lexRead(char *sBuf, int nMax_size)
 {
+int nResult = 0;
+
 // did we hit eof
-if (miSourceReadIndex == -1) {
-*nResult = 0;
-return;
+if (miSourceReadIndex != -1) {
+// assume we can copy all that are left.
+nResult = msSourceBuffer.size() - miSourceReadIndex;
+
+// space enough for the whole line ?
+if (nResult <= nMax_size) {
+msSourceBuffer.copy(sBuf, nResult, miSourceReadIndex);
+l10nMem::showDebug(sBuf);
+miSourceReadIndex = -1;
+}
+else {
+msSourceBuffer.copy(sBuf, nMax_size, miSourceReadIndex);
+l10nMem::showDebug(sBuf);
+nResult = nMax_size;
+miSourceReadIndex += nMax_size;
+}
 }
+return nResult;
+}
 
-// assume we can copy all that are left.
-*nResult = msSourceBuffer.size() - miSourceReadIndex;
 
-// space enough for the whole line ?
-if (*nResult <= nMax_size) {
-msSourceBuffer.copy(sBuf, *nResult, miSourceReadIndex);
-l10nMem::showDebug(sBuf);
-miSourceReadIndex = -1;
-}
-else {
-msSourceBuffer.copy(sBuf, nMax_size, miSourceReadIndex);
-   

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-03-23 Thread jan iversen
 l10ntools/inc/gConv.hxx|2 +-
 l10ntools/inc/gConvPo.hxx  |3 +--
 l10ntools/inc/gConvProp.hxx|2 +-
 l10ntools/inc/gConvSrc.hxx |2 +-
 l10ntools/inc/gConvTree.hxx|4 +++-
 l10ntools/inc/gConvUi.hxx  |6 +-
 l10ntools/inc/gConvUlf.hxx |5 -
 l10ntools/inc/gConvXcs.hxx |6 +-
 l10ntools/inc/gConvXcu.hxx |9 -
 l10ntools/inc/gConvXhp.hxx |6 +-
 l10ntools/inc/gConvXrm.hxx |6 +-
 l10ntools/source/gConv.cxx |2 +-
 l10ntools/source/gConvPo.cxx   |   12 +++-
 l10ntools/source/gConvSrc.cxx  |7 ---
 l10ntools/source/gConvTree.cxx |1 -
 l10ntools/source/gConvUi.cxx   |5 +++--
 l10ntools/source/gConvUlf.cxx  |1 -
 l10ntools/source/gConvXcs.cxx  |1 -
 l10ntools/source/gConvXcu.cxx  |1 -
 l10ntools/source/gConvXhp.cxx  |4 +++-
 l10ntools/source/gConvXrm.cxx  |1 -
 l10ntools/source/gL10nMem.cxx  |4 +++-
 l10ntools/source/gLang.cxx |5 +++--
 23 files changed, 63 insertions(+), 32 deletions(-)

New commits:
commit 11231f9179db9821effc884e8adade48fdf89938
Author: jan iversen 
Date:   Wed Mar 23 17:12:11 2016 +0100

genlang,  removed clang problems

The clang plugin does not not like
   for (;;) ;
(most compilers do not complain, when using the ' ')

Also a virtual destructor need "override" in the
implementing class.

Change-Id: Ib99702f11dbd24595935594ee97c136c8e604aff

diff --git a/l10ntools/inc/gConv.hxx b/l10ntools/inc/gConv.hxx
index d51f2bf..86d84a7 100644
--- a/l10ntools/inc/gConv.hxx
+++ b/l10ntools/inc/gConv.hxx
@@ -65,6 +65,6 @@ class convert_gen
 bool createDir(const string& sDir, const string& sFile);
 private:
 ofstream mcOutputFile;
-bool checkAccess(string& sFile);
+static bool checkAccess(string& sFile);
 };
 #endif
diff --git a/l10ntools/inc/gConvPo.hxx b/l10ntools/inc/gConvPo.hxx
index 69c62d0..31c037d 100644
--- a/l10ntools/inc/gConvPo.hxx
+++ b/l10ntools/inc/gConvPo.hxx
@@ -16,7 +16,6 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-
 #ifndef GCONPO_HXX
 #define GCONPO_HXX
 #include "gConv.hxx"
@@ -31,7 +30,7 @@ class convert_po : public convert_gen
 
 
 convert_po(l10nMem& crMemory);
-~convert_po()  {};
+~convert_po() override {};
 
 void startLook ();
 void setValue  (char *syyText, int iLineCnt);
diff --git a/l10ntools/inc/gConvProp.hxx b/l10ntools/inc/gConvProp.hxx
index b9e5b7c..d65531e 100644
--- a/l10ntools/inc/gConvProp.hxx
+++ b/l10ntools/inc/gConvProp.hxx
@@ -26,7 +26,7 @@ class convert_prop : public convert_gen
 {
 public:
 convert_prop(l10nMem& crMemory) : convert_gen(crMemory) {};
-~convert_prop() {};
+~convert_prop() override {};
 
 private:
 void doExecute() override;
diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx
index dd41895..65bd5eb 100644
--- a/l10ntools/inc/gConvSrc.hxx
+++ b/l10ntools/inc/gConvSrc.hxx
@@ -28,7 +28,7 @@ class convert_src : public convert_gen
 bool mbExpectValue;
 
 convert_src(l10nMem& crMemory);
-~convert_src() {};
+~convert_src() override {};
 
 void setValue  (char *syyText, char *sbuildValue);
 void setLang   (char *syyText, bool bEnUs);
diff --git a/l10ntools/inc/gConvTree.hxx b/l10ntools/inc/gConvTree.hxx
index fff9248..bd9adb3 100644
--- a/l10ntools/inc/gConvTree.hxx
+++ b/l10ntools/inc/gConvTree.hxx
@@ -21,6 +21,8 @@
 #include "gConv.hxx"
 
 
+extern int treelex(void);
+
 
 class convert_tree : public convert_gen
 {
@@ -40,7 +42,7 @@ class convert_tree : public convert_gen
 } STATE_VAL;
 
 convert_tree(l10nMem& crMemory);
-~convert_tree();
+~convert_tree() override;
 
 void setString(char *yytext);
 void setState(char *yytext, STATE_TAG eNewStateTag, STATE_VAL 
eNewStateVAL, char *sModule);
diff --git a/l10ntools/inc/gConvUi.hxx b/l10ntools/inc/gConvUi.hxx
index ffc9531..be4a443 100644
--- a/l10ntools/inc/gConvUi.hxx
+++ b/l10ntools/inc/gConvUi.hxx
@@ -22,11 +22,15 @@
 
 
 
+extern int uilex(void);
+
+
+
 class convert_ui : public convert_gen
 {
 public:
 convert_ui(l10nMem& crMemory);
-~convert_ui() {};
+~convert_ui() override {};
 
 
 private:
diff --git a/l10ntools/inc/gConvUlf.hxx b/l10ntools/inc/gConvUlf.hxx
index 7053059..85902e4 100644
--- a/l10ntools/inc/gConvUlf.hxx
+++ b/l10ntools/inc/gConvUlf.hxx
@@ -22,11 +22,14 @@
 
 
 
+extern int ulflex(void);
+
+
 class convert_ulf : public convert_gen
 {
 public:
 convert_ulf(l10nMem& crMemory) : convert_gen(crMemory) {};
-~convert_ulf() {};
+~convert_ulf() override {};
 
 void setKey(char *syyText);
 void setText(char *syyText, bool bIsEnUs);
diff --git 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-03-19 Thread Chirag Manwani
 l10ntools/inc/xmlparse.hxx|   24 +---
 l10ntools/source/xmlparse.cxx |   60 +-
 2 files changed, 43 insertions(+), 41 deletions(-)

New commits:
commit 5b3fee11f4019820cc1212a0441020609418dbf1
Author: Chirag Manwani 
Date:   Wed Mar 16 17:23:23 2016 +0530

tdf#84938 Replaced #defined constants with enum class

Change-Id: I2078f15f03fbadab8a0253763d779c3eb7cdf448
Reviewed-on: https://gerrit.libreoffice.org/23302
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 29397bf..54bba22 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -38,11 +38,13 @@
 class XMLParentNode;
 class XMLElement;
 
-#define XML_NODE_TYPE_FILE  0x001
-#define XML_NODE_TYPE_ELEMENT   0x002
-#define XML_NODE_TYPE_DATA  0x003
-#define XML_NODE_TYPE_COMMENT   0x004
-#define XML_NODE_TYPE_DEFAULT   0x005
+enum class XMLNodeType{
+XFILE   = 0x001,
+ELEMENT = 0x002,
+DATA= 0x003,
+COMMENT = 0x004,
+DEFAULT = 0x005
+};
 
 /** Holds data of Attributes
  */
@@ -77,7 +79,7 @@ protected:
 XMLNode(){}
 
 public:
-virtual sal_uInt16 GetNodeType() const = 0;
+virtual XMLNodeType GetNodeType() const = 0;
 virtual ~XMLNode(){}
 };
 
@@ -166,7 +168,7 @@ public:
 
 XMLFile& operator=(const XMLFile& rObj);
 
-virtual sal_uInt16 GetNodeType() const override { return 
XML_NODE_TYPE_FILE; }
+virtual XMLNodeType GetNodeType() const override { return 
XMLNodeType::XFILE; }
 
 /// returns file name
 OString GetName() const { return m_sFileName; }
@@ -224,7 +226,7 @@ public:
 XMLElement(const XMLElement&);
 
 XMLElement& operator=(const XMLElement& rObj);
-virtual sal_uInt16 GetNodeType() const override { return 
XML_NODE_TYPE_ELEMENT; }
+virtual XMLNodeType GetNodeType() const override { return 
XMLNodeType::ELEMENT; }
 
 /// returns element name
 OString GetName() const { return m_sElementName; }
@@ -265,7 +267,7 @@ public:
 
 // Default copy constructor and copy operator work well.
 
-virtual sal_uInt16 GetNodeType() const override { return 
XML_NODE_TYPE_DATA; }
+virtual XMLNodeType GetNodeType() const override { return 
XMLNodeType::DATA; }
 
 /// returns the data
 OString GetData() const { return m_sData; }
@@ -291,7 +293,7 @@ public:
 
 // Default copy constructor and copy operator work well.
 
-virtual sal_uInt16 GetNodeType() const override { return 
XML_NODE_TYPE_COMMENT; }
+virtual XMLNodeType GetNodeType() const override { return 
XMLNodeType::COMMENT; }
 
 /// returns the comment
 OString GetComment() const { return m_sComment; }
@@ -314,7 +316,7 @@ public:
 
 // Default copy constructor and copy operator work well.
 
-virtual sal_uInt16 GetNodeType() const override { return 
XML_NODE_TYPE_DEFAULT; }
+virtual XMLNodeType GetNodeType() const override { return 
XMLNodeType::DEFAULT; }
 
 /// returns the comment
 OString GetDefault() const { return m_sDefault; }
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index 714ef1d..97d6012 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -94,13 +94,13 @@ XMLParentNode::XMLParentNode( const XMLParentNode& rObj)
 {
 switch(pNode->GetNodeType())
 {
-case XML_NODE_TYPE_ELEMENT:
+case XMLNodeType::ELEMENT:
 AddChild( new XMLElement( *static_cast(pNode) ) ); break;
-case XML_NODE_TYPE_DATA:
+case XMLNodeType::DATA:
 AddChild( new XMLData   ( *static_cast   
(pNode) ) ); break;
-case XML_NODE_TYPE_COMMENT:
+case XMLNodeType::COMMENT:
 AddChild( new XMLComment( *static_cast(pNode) ) ); break;
-case XML_NODE_TYPE_DEFAULT:
+case XMLNodeType::DEFAULT:
 AddChild( new XMLDefault( *static_cast(pNode) ) ); break;
 default:fprintf(stdout,"XMLParentNode::XMLParentNode( 
const XMLParentNode& rObj) strange obj");
 }
@@ -173,14 +173,14 @@ bool XMLFile::Write( ofstream  , XMLNode *pCur )
 else {
 switch( pCur->GetNodeType())
 {
-case XML_NODE_TYPE_FILE:
+case XMLNodeType::XFILE:
 {
 if( GetChildList())
 for ( size_t i = 0; i < GetChildList()->size(); i++ )
 Write( rStream, (*GetChildList())[ i ] );
 }
 break;
-case XML_NODE_TYPE_ELEMENT:
+case XMLNodeType::ELEMENT:
 {
 XMLElement 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-03-14 Thread jan iversen
 l10ntools/inc/gConv.hxx|   90 +++
 l10ntools/inc/gConvDB.hxx  |   28 --
 l10ntools/inc/gConvPo.hxx  |   75 ++
 l10ntools/inc/gConvProp.hxx|   21 -
 l10ntools/inc/gConvSrc.hxx |   79 ++
 l10ntools/inc/gConvTree.hxx|   81 ++
 l10ntools/inc/gConvUlf.hxx |   31 --
 l10ntools/inc/gConvXcs.hxx |   32 --
 l10ntools/inc/gConvXcu.hxx |   42 +--
 l10ntools/inc/gConvXhp.hxx |   82 ++
 l10ntools/inc/gConvXrm.hxx |   46 +--
 l10ntools/inc/gL10nMem.hxx |  202 +++-
 l10ntools/source/gConv.cxx |  322 --
 l10ntools/source/gConvDB.cxx   |   89 +++
 l10ntools/source/gConvPo.cxx   |  216 +++--
 l10ntools/source/gConvProp.cxx |6 
 l10ntools/source/gConvSrc.cxx  |  340 ---
 l10ntools/source/gConvTree.cxx |  264 +
 l10ntools/source/gConvUlf.cxx  |   64 +
 l10ntools/source/gConvXcs.cxx  |  143 +--
 l10ntools/source/gConvXcu.cxx  |  209 +++-
 l10ntools/source/gConvXhp.cxx  |  506 ++---
 l10ntools/source/gConvXrm.cxx  |  145 +--
 l10ntools/source/gL10nMem.cxx  |  254 +---
 l10ntools/source/gLang.cxx |   12 
 l10ntools/source/gLexPo.l  |   94 +++
 l10ntools/source/gLexSrc.l |  156 ++--
 l10ntools/source/gLexTree.l|   56 ++--
 l10ntools/source/gLexUlf.l |   57 ++--
 l10ntools/source/gLexXcs.l |   33 +-
 l10ntools/source/gLexXcu.l |   46 +--
 l10ntools/source/gLexXhp.l |   54 ++--
 l10ntools/source/gLexXrm.l |   34 +-
 33 files changed, 1747 insertions(+), 2162 deletions(-)

New commits:
commit 885eb42469f9191f7df270dfd1c8bda5dcec0e2f
Author: jan iversen 
Date:   Tue Mar 15 01:54:42 2016 +0100

genLang update

Decoration removed

Indent etc. updated to LO standard

License in generate pot files changed to LO standard.

this commit is a pure text edit, NO functional changes.

Change-Id: Ie0a26d3cff470dd5f91241ca6b962b17851c9d5b

diff --git a/l10ntools/inc/gConv.hxx b/l10ntools/inc/gConv.hxx
index b9507ac..710d0ff 100644
--- a/l10ntools/inc/gConv.hxx
+++ b/l10ntools/inc/gConv.hxx
@@ -16,7 +16,6 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-
 #ifndef GCON_HXX
 #define GCON_HXX
 #include 
@@ -24,58 +23,59 @@
 
 class convert_gen
 {
-public:
-static convert_gen *mcImpl;
+public:
+static convert_gen *mcImpl;
+
+convert_gen(l10nMem& cMemory);
+virtual ~convert_gen();
 
-convert_gen(l10nMem&   cMemory);
-virtual ~convert_gen();
+// Create instance
+static convert_gen& createInstance(l10nMem&   cMemory,
+   const std::string& sSourceDir,
+   const std::string& sTargetDir,
+   const std::string& sSourceFile);
 
-// Create instance
-static convert_gen& createInstance(l10nMem&   cMemory,
-const std::string& sSourceDir,
-const std::string& sTargetDir,
-const std::string& sSourceFile);
+// do extract/merge
+bool execute(const bool bMerge, const bool bKid);
 
-// do extract/merge
-bool execute(const bool bMerge, const bool bKid);
+// all converters MUST implement this function
+virtual void execute() = 0;
 
-// all converters MUST implement this function
-virtual void execute() = 0;
+// ONLY po should implement these functions
+virtual void startSave(const std::string& sLanguage,
+   const std::string& sFile);
+virtual void save(const std::string& sFileName,
+  const std::string& sKey,
+  const std::string& sENUStext,
+  const std::string& sText,
+  bool   bFuzzy);
+virtual void endSave();
+static bool checkAccess(std::string& sFile);
+static bool createDir(std::string& sDir, std::string& sFile);
 
-// ONLY po should implement these functions
-virtual void startSave(const std::string& sLanguage,
-const std::string& sFile);
-virtual void save(const std::string& sFileName,
-const std::string& sKey,
-const std::string& sENUStext,
-const std::string& sText,
-bool   bFuzzy);
-virtual void endSave();
-static bool checkAccess(std::string& sFile);
-static bool createDir(std::string& sDir, std::string& sFile);
+// utility functions for converters
+void lexRead(char *sBuf, int *nResult, int nMax_size);
+std::string& copySource(char const *yyText, bool bDoClear = true);
 
-// utility functions for converters
-void lexRead(char 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-03-11 Thread Jan Iversen
 l10ntools/inc/gLang.hxx |   36 ---
 l10ntools/source/gConv.cxx  |5 
 l10ntools/source/gLang.cxx  |  464 ++--
 l10ntools/source/gLexPo.l   |   12 -
 l10ntools/source/gLexSrc.l  |   13 -
 l10ntools/source/gLexTree.l |   13 -
 l10ntools/source/gLexUlf.l  |   13 -
 l10ntools/source/gLexXcs.l  |   13 -
 l10ntools/source/gLexXcu.l  |   13 -
 l10ntools/source/gLexXhp.l  |   13 -
 l10ntools/source/gLexXrm.l  |   13 -
 11 files changed, 468 insertions(+), 140 deletions(-)

New commits:
commit 00badb6fb53aa28f4184aaecd8455dcd5267c5f8
Author: Jan Iversen 
Date:   Fri Mar 11 10:39:47 2016 +0100

update genLang (l10ntools)

Upgrade gLang to LO standard
Compilation of genLang module is disabled for now
activate manually by adding to Module_l10ntools.mk

Change-Id: Ib82cae6a013d10d158ec5faa81ace512c0096a39

diff --git a/l10ntools/inc/gLang.hxx b/l10ntools/inc/gLang.hxx
index be1422b..ed35538 100644
--- a/l10ntools/inc/gLang.hxx
+++ b/l10ntools/inc/gLang.hxx
@@ -113,7 +113,7 @@ class convert_gen
 ~convert_gen();
 
 // do extract/merge
-bool execute(const bool bMerge);
+bool execute(const bool bMerge, const bool bKid);
 
 // ONLY po should implement these functions
 void startSave(const std::string& sLanguage,
@@ -127,38 +127,4 @@ class convert_gen
 static bool checkAccess(std::string& sFile);
 static bool createDir(std::string& sDir, std::string& sFile);
 };
-
-
-
-/   C L A S S   D E F I N I T I O N   /
-class handler
-{
-  public:
-handler();
-~handler();
-
-void checkCommandLine(int argc, char *argv[]);
-void run();
-
-  private:
-enum {DO_CONVERT, DO_CONVERT_POT, DO_EXTRACT, DO_EXTRACT_KID, DO_MERGE} 
meWorkMode;
-l10nMem  mcMemory;
-std::string  msModuleName;
-std::string  msPoOutDir;
-std::string  msPoDir;
-std::string  msSourceDir;
-std::string  msTargetDir;
-bool mbForceSave;
-std::vector mvSourceFiles;
-std::vector mvLanguages;
-
-void runConvert(bool bPot);
-void runExtract(bool bKid);
-void runMerge();
-
-void showUsage(std::string& sErr);
-void showManual();
-void loadL10MEM(bool onlyTemplates);
-void readFileWithSources();
-};
 #endif
diff --git a/l10ntools/source/gConv.cxx b/l10ntools/source/gConv.cxx
index 15b5625..ff16706 100644
--- a/l10ntools/source/gConv.cxx
+++ b/l10ntools/source/gConv.cxx
@@ -103,10 +103,13 @@ convert_gen::~convert_gen()
 
 
 /**   I M P L E M E N T A T I O N   **/
-bool convert_gen::execute(const bool bMerge)
+bool convert_gen::execute(const bool bMerge, const bool bKid)
 {
   convert_gen_impl::mcImpl->mbMergeMode  = bMerge;
 
+  if (bKid)
+  throw l10nMem::showError("not implemented");
+
   // and load file
   if (!convert_gen_impl::mcImpl->prepareFile())
 return false;
diff --git a/l10ntools/source/gLang.cxx b/l10ntools/source/gLang.cxx
index 9a3105a..696d861 100644
--- a/l10ntools/source/gLang.cxx
+++ b/l10ntools/source/gLang.cxx
@@ -16,33 +16,463 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-
 #include "gLang.hxx"
+#include 
+
+
+
+class handler
+{
+public:
+handler()  {};
+~handler() {};
+
+void showRunTimeError(std::string sErr);
+void showUsage(std::stringsErr);
+void checkCommandLine(int argc, char *argv[]);
+void run();
+
+private:
+bool mbForceSave;
+bool mbDebug;
+bool mbVerbose;
+bool mbSave;
+enum {DO_CONVERT, DO_EXTRACT, DO_MERGE_KID, DO_MERGE} meWorkMode;
+std::string  msTargetDir;
+std::string  msPoDir;
+std::string  msPotDir;
+std::vector mvSourceFiles;
+std::vector mvLanguages;
+l10nMem  mcMemory;
+
+void showManual();
+void loadL10MEM(bool onlyTemplates);
+void runConvert();
+void runExtract();
+void runMerge(bool bKid);
+};
+
+
+
+void handler::showRunTimeError(std::string sErr)
+{
+std::cerr << "runtime error: "
+  << (sErr.size() ? sErr : "No description")
+  << std::endl;
+exit(-1);
+}
+
+
+
+void handler::showUsage(std::string sErr)
+{
+if (sErr.size())
+std::cerr << "commandline error: " << sErr << std::endl;
+
+std::cout << "syntax oveview, use \"genLang help\" for full description\n"
+ "   genLang  \n"
+ "is one of\n"
+ "  convert   convert old pot/po files to new format\n"
+ "  extract   extract pot templates from sources\n"
+ "  help  show manual\n"
+ "  

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-03-08 Thread Michael Stahl
 l10ntools/inc/helpmerge.hxx|2 +-
 l10ntools/source/helpmerge.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 466c03f9566344b24aaa70b374daf46054914290
Author: Michael Stahl 
Date:   Tue Mar 8 15:18:33 2016 +0100

Revert "tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals"

In a build --with-lang=2 languages this generates millions of lines of
output, it prints for > 2 minutes straight.  Our build system is not a
terminal benchmark, and i have no idea what the problem with
"OSL_DEBUG_LEVEL > 1" conditionals is anyway, so revert it for now.

This reverts commit 3f80f144cff8d8ddd1d33e7b8ca6dbe2ad8d8491.

diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index dcc3130..89c8543 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -31,7 +31,7 @@ class HelpParser
 private:
 OString sHelpFile;
 
-#if OSL_DEBUG_LEVEL > 0
+#if OSL_DEBUG_LEVEL > 2
 /// Debugmethod, prints the content of the map to stdout
 static void Dump(LangHashMap* rElem_in , const OString & sKey_in);
 
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 6766036..c5fda05 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -46,7 +46,7 @@
 #include "helper.hxx"
 #include "po.hxx"
 
-#if OSL_DEBUG_LEVEL > 0
+#if OSL_DEBUG_LEVEL > 2
 void HelpParser::Dump(XMLHashMap* rElem_in)
 {
 for(XMLHashMap::iterator pos = rElem_in->begin();pos != rElem_in->end(); 
++pos)
@@ -180,7 +180,7 @@ bool HelpParser::MergeSingleFile( XMLFile* file , 
MergeDataFile* pMergeDataFile
 {
 posm = aXMLStrHM->find( *pos );
 LangHashMap*  aLangHM = posm->second;
-#if OSL_DEBUG_LEVEL > 0
+#if OSL_DEBUG_LEVEL > 2
 printf("*DUMPING 
HASHMAP***");
 Dump(aXMLStrHM);
 printf("DBG: sHelpFile = %s\n",sHelpFile.getStr() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-03-08 Thread Rohan Kumar
 l10ntools/inc/helpmerge.hxx|2 +-
 l10ntools/source/helpmerge.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 3f80f144cff8d8ddd1d33e7b8ca6dbe2ad8d8491
Author: Rohan Kumar 
Date:   Mon Mar 7 23:38:58 2016 +0530

tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals

I removed OSL_DEBUG_LEVEL > 1 conditionals, replaced them with
OSL_DEBUG_LEVEL > 0 as suggested in updated easy hack

Change-Id: I4af8cd2a9bf9980fc98967d499d1fc30642251f4
Reviewed-on: https://gerrit.libreoffice.org/23010
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 89c8543..dcc3130 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -31,7 +31,7 @@ class HelpParser
 private:
 OString sHelpFile;
 
-#if OSL_DEBUG_LEVEL > 2
+#if OSL_DEBUG_LEVEL > 0
 /// Debugmethod, prints the content of the map to stdout
 static void Dump(LangHashMap* rElem_in , const OString & sKey_in);
 
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index c5fda05..6766036 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -46,7 +46,7 @@
 #include "helper.hxx"
 #include "po.hxx"
 
-#if OSL_DEBUG_LEVEL > 2
+#if OSL_DEBUG_LEVEL > 0
 void HelpParser::Dump(XMLHashMap* rElem_in)
 {
 for(XMLHashMap::iterator pos = rElem_in->begin();pos != rElem_in->end(); 
++pos)
@@ -180,7 +180,7 @@ bool HelpParser::MergeSingleFile( XMLFile* file , 
MergeDataFile* pMergeDataFile
 {
 posm = aXMLStrHM->find( *pos );
 LangHashMap*  aLangHM = posm->second;
-#if OSL_DEBUG_LEVEL > 2
+#if OSL_DEBUG_LEVEL > 0
 printf("*DUMPING 
HASHMAP***");
 Dump(aXMLStrHM);
 printf("DBG: sHelpFile = %s\n",sHelpFile.getStr() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2016-03-03 Thread Stephan Bergmann
 l10ntools/inc/gConv.hxx|2 +-
 l10ntools/inc/gConvDB.hxx  |4 ++--
 l10ntools/inc/gConvPo.hxx  |   10 +-
 l10ntools/inc/gConvProp.hxx|4 ++--
 l10ntools/inc/gConvSrc.hxx |6 +++---
 l10ntools/inc/gConvTree.hxx|4 ++--
 l10ntools/inc/gConvUlf.hxx |4 ++--
 l10ntools/inc/gConvXcs.hxx |4 ++--
 l10ntools/inc/gConvXcu.hxx |4 ++--
 l10ntools/inc/gConvXhp.hxx |4 ++--
 l10ntools/inc/gConvXrm.hxx |4 ++--
 l10ntools/source/gConv.cxx |   10 +-
 l10ntools/source/gConvDB.cxx   |2 +-
 l10ntools/source/gConvProp.cxx |4 ++--
 l10ntools/source/gConvSrc.cxx  |8 
 l10ntools/source/gConvTree.cxx |4 ++--
 l10ntools/source/gConvUlf.cxx  |2 +-
 l10ntools/source/gConvXcs.cxx  |4 ++--
 l10ntools/source/gConvXcu.cxx  |2 +-
 l10ntools/source/gConvXhp.cxx  |8 
 l10ntools/source/gConvXrm.cxx  |2 +-
 l10ntools/source/gL10nMem.cxx  |   10 +-
 22 files changed, 53 insertions(+), 53 deletions(-)

New commits:
commit a39fb49535bbcdecd0a605250f82335aee690937
Author: Stephan Bergmann 
Date:   Thu Mar 3 09:43:06 2016 +0100

various loplugin warnings

Change-Id: I9078ba18d8897a89a472fe75385542dac0c6bf78

diff --git a/l10ntools/inc/gConv.hxx b/l10ntools/inc/gConv.hxx
index 5b79e4a..7287a49 100644
--- a/l10ntools/inc/gConv.hxx
+++ b/l10ntools/inc/gConv.hxx
@@ -76,7 +76,7 @@ class convert_gen_impl
 // utility functions for converters
 void lexRead(char *sBuf, int *nResult, int nMax_size);
 void writeSourceFile(const std::string& line);
-std::string& copySource (char *yyText, bool bDoClear = true);
+std::string& copySource (char const *yyText, bool bDoClear = true);
 
   protected:
 std::string  msSourceBuffer, msCopyText;
diff --git a/l10ntools/inc/gConvDB.hxx b/l10ntools/inc/gConvDB.hxx
index 54dba4e..0cbb746 100644
--- a/l10ntools/inc/gConvDB.hxx
+++ b/l10ntools/inc/gConvDB.hxx
@@ -36,14 +36,14 @@ class convert_db : public convert_gen_impl
 {
   public:
 convert_db(l10nMem& crMemory);
-~convert_db();
+virtual ~convert_db();
 
   private:
 static const int NUMFIELD = 16;
 std::string  msFields[NUMFIELD];
 int  miSize;
 
-void execute();
+void execute() override;
 bool collectLine();
 };
 #endif
diff --git a/l10ntools/inc/gConvPo.hxx b/l10ntools/inc/gConvPo.hxx
index 7d2d8f2..b467064 100644
--- a/l10ntools/inc/gConvPo.hxx
+++ b/l10ntools/inc/gConvPo.hxx
@@ -40,7 +40,7 @@ class convert_po : public convert_gen_impl
 
 
 convert_po(l10nMem& crMemory);
-~convert_po();
+virtual ~convert_po();
 
 void startLook ();
 void setValue  (char *syyText, int iLineCnt);
@@ -57,15 +57,15 @@ class convert_po : public convert_gen_impl
 bool mbFuzzy;
 std::filebuf outBuffer;
 
-void execute();
+void execute() override;
 
 void startSave(const std::string& sLanguage,
-   const std::string& sFile);
+   const std::string& sFile) override;
 void save(const std::string& sFileName,
   const std::string& sKey,
   const std::string& sENUStext,
   const std::string& sText,
-  bool   bFuzzy);
-void endSave();
+  bool   bFuzzy) override;
+void endSave() override;
 };
 #endif
diff --git a/l10ntools/inc/gConvProp.hxx b/l10ntools/inc/gConvProp.hxx
index ce2ee38..8b1c281 100644
--- a/l10ntools/inc/gConvProp.hxx
+++ b/l10ntools/inc/gConvProp.hxx
@@ -36,10 +36,10 @@ class convert_prop : public convert_gen_impl
 {
   public:
 convert_prop(l10nMem& crMemory);
-~convert_prop();
+virtual ~convert_prop();
 
 
   private:
-void execute();
+void execute() override;
 };
 #endif
diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx
index e8de370..e9a2139 100644
--- a/l10ntools/inc/gConvSrc.hxx
+++ b/l10ntools/inc/gConvSrc.hxx
@@ -37,7 +37,7 @@ class convert_src : public convert_gen_impl
 bool mbExpectValue;
 
 convert_src(l10nMem& crMemory);
-~convert_src();
+virtual ~convert_src();
 
 void setValue  (char *syyText, char *sbuildValue);
 void setLang   (char *syyText, bool bEnUs);
@@ -47,7 +47,7 @@ class convert_src : public convert_gen_impl
 void setCmd(char *syyText);
 void setMacro  (char *syyText);
 void setList   (char *syyText);
-void setListItem   (char *syyText, bool bIsStart);
+void setListItem   (char const *syyText, bool bIsStart);
 void setNL (char *syyText, bool bMacro);
 void startBlock(char *syyText);
 void stopBlock (char *syyText);
@@ -67,7 +67,7 @@ class convert_src : public convert_gen_impl
 bool mbInListItem;
 int  miListCount;
 int  miMacroLevel;
-void execute();
+void execute() override;

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2015-08-03 Thread Stephan Bergmann
 l10ntools/inc/export.hxx|3 +--
 l10ntools/inc/xrmmerge.hxx  |1 -
 l10ntools/source/export.cxx |6 ++
 3 files changed, 3 insertions(+), 7 deletions(-)

New commits:
commit f493f4b9327eba14fc6ceb4eced81cf7ed682955
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Aug 3 20:46:40 2015 +0200

-Werror,-Wunused-private-field

Change-Id: I10206d2a9673296e1c3c7e813e4696d80cbb2bfc

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 9badf8b..c99e0b8 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -139,7 +139,6 @@ private:
 bool bError;// any errors while export?
 bool bReadOver;
 OString sFilename;
-OString sLanguages;
 
 std::vectorOString aLanguages;
 
@@ -172,7 +171,7 @@ private:
 
 public:
 Export( const OString rOutput );
-Export(const OString rMergeSource, const OString rOutput, const OString 
rLanguage, bool bUTF8BOM);
+Export(const OString rMergeSource, const OString rOutput, bool bUTF8BOM);
 ~Export();
 
 void Init();
diff --git a/l10ntools/inc/xrmmerge.hxx b/l10ntools/inc/xrmmerge.hxx
index 9138369..df2ddaf 100644
--- a/l10ntools/inc/xrmmerge.hxx
+++ b/l10ntools/inc/xrmmerge.hxx
@@ -30,7 +30,6 @@ class XRMResParser
 {
 private:
 OString sGID;
-OString sLID;
 
 bool bError;
 bool bText;
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index ee4fc43..6b002ef 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -94,7 +94,7 @@ FILE * init(int argc, char ** argv)
 
 if (aArgs.m_bMergeMode) {
 global::exporter.reset(new Export(aArgs.m_sMergeSrc, 
aArgs.m_sOutputFile,
-  aArgs.m_sLanguage, 
aArgs.m_bUTF8BOM));
+  aArgs.m_bUTF8BOM));
 } else {
 global::exporter.reset(new Export(aArgs.m_sOutputFile));
 }
@@ -203,7 +203,6 @@ Export::Export(const OString rOutput)
 bError( false ),
 bReadOver( false ),
 sFilename( global::inputPathname ),
-sLanguages( OString() ),
 pParseQueue( new ParserQueue( *this ) )
 {
 aOutput.mPo = new PoOfstream( rOutput, PoOfstream::APP );
@@ -216,7 +215,7 @@ Export::Export(const OString rOutput)
 
 Export::Export(
 const OString rMergeSource, const OString rOutput,
-const OString rLanguage, bool bUTF8BOM)
+bool bUTF8BOM)
 :
 bDefine( false ),
 bNextMustBeDefineEOL( false ),
@@ -229,7 +228,6 @@ Export::Export(
 bError( false ),
 bReadOver( false ),
 sFilename( global::inputPathname ),
-sLanguages( rLanguage ),
 pParseQueue( new ParserQueue( *this ) )
 {
 aOutput.mSimple = new std::ofstream();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2014-09-08 Thread Douglas Mencken
 l10ntools/inc/export.hxx|6 --
 l10ntools/source/export.cxx |6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 5aeb852efcabdd51545d5d41c92f4bf3cef1d663
Author: Douglas Mencken dougmenc...@gmail.com
Date:   Sun Sep 7 03:48:53 2014 -0400

l10ntools-transex3: make pParseQueue field private

Change-Id: Ieefed6e939e12b668a635eb8d7e70def2d52a85d
Reviewed-on: https://gerrit.libreoffice.org/11315
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 4415e30..2010293 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -145,6 +145,8 @@ private:
 
 std::vectorOString aLanguages;
 
+ParserQueue* pParseQueue;
+
 bool WriteData( ResData *pResData, bool bCreateNew = false ); /// called 
before dest. cur ResData
 bool WriteExportList( ResData *pResData, ExportList rExportList, const 
sal_uInt16 nTyp );
 
@@ -179,13 +181,13 @@ public:
 
 void Init();
 int Execute( int nToken, const char * pToken ); /// called from lexer
+
 void SetError() { bError = true; }
 bool GetError() { return bError; }
-ParserQueue* pParseQueue; // public!!
+ParserQueue* GetParseQueue() { return pParseQueue; }
 };
 
 
-
 // class MergeEntrys
 
 
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 6f8c8b8..170d76f 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -108,16 +108,16 @@ int Parse( int nTyp, const char *pTokenText ){
 global::exporter-Execute( nTyp , pTokenText );
 return 1;
 }
+
 void Close(){
-global::exporter-pParseQueue-Close();
+global::exporter-GetParseQueue()-Close();
 global::exporter.reset();
 // avoid nontrivial Export dtor being executed during exit
 }
 
 int WorkOnTokenSet( int nTyp, char *pTokenText )
 {
-
-global::exporter-pParseQueue-Push( QueueEntry( nTyp , 
OString(pTokenText) ) );
+global::exporter-GetParseQueue()-Push( QueueEntry( nTyp , 
OString(pTokenText) ) );
 return 1;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc

2014-09-08 Thread Douglas Mencken
 l10ntools/inc/helper.hxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 06622ec4baa6a7f4a4aa194e5ad9a6d01be54ca8
Author: Douglas Mencken dougmenc...@gmail.com
Date:   Sun Sep 7 03:50:29 2014 -0400

l10ntools/inc/helper.hxx: bin unused header cassert

Change-Id: Ib2c43d9b158423c023a5bfd4da324554aa04902e
Reviewed-on: https://gerrit.libreoffice.org/11316
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/l10ntools/inc/helper.hxx b/l10ntools/inc/helper.hxx
index 72391f7..a588693 100644
--- a/l10ntools/inc/helper.hxx
+++ b/l10ntools/inc/helper.hxx
@@ -15,8 +15,6 @@
 #include sal/config.h
 #include sal/types.h
 
-#include cassert
-
 #include libxml/parser.h
 
 #include rtl/string.hxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2014-06-11 Thread Stephan Bergmann
 l10ntools/inc/xmlparse.hxx|2 +-
 l10ntools/source/xmlparse.cxx |6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit fb22eb425735b2741c3cb77d9a1700b663acd11b
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jun 11 23:47:11 2014 +0200

Fix XMLFile::SearchL10NElements signature

Change-Id: I34134f75ac5571a635256d349bf5a2f67ef8ef06

diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index cabce41..bca92c1 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -155,7 +155,7 @@ public:
 virtual ~XMLFile();
 
 void Print( XMLNode *pCur = NULL, sal_uInt16 nLevel = 0 );
-virtual void SearchL10NElements( XMLParentNode *pCur, int pos = 0 );
+virtual void SearchL10NElements( XMLChildNode *pCur, int pos = 0 );
 void Extract( XMLFile *pCur = NULL );
 
 XMLHashMap* GetStrings(){ return m_pXMLStrings; }
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index 1a7559b..0e74383 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -442,7 +442,7 @@ XMLFile XMLFile::operator=(const XMLFile rObj)
 return *this;
 }
 
-void XMLFile::SearchL10NElements( XMLParentNode *pCur, int nPos )
+void XMLFile::SearchL10NElements( XMLChildNode *pCur, int nPos )
 {
 bool bInsert = true;
 if ( !pCur )
@@ -460,7 +460,7 @@ void XMLFile::SearchL10NElements( XMLParentNode *pCur, int 
nPos )
 {
 pElement = (*GetChildList())[ i ];
 if( pElement-GetNodeType() ==  XML_NODE_TYPE_ELEMENT )
-SearchL10NElements( (XMLParentNode*) pElement , i);
+SearchL10NElements( pElement , i);
 }
 }
 }
@@ -503,7 +503,7 @@ void XMLFile::SearchL10NElements( XMLParentNode *pCur, int 
nPos )
 else if ( bInsert  pElement-GetChildList() )
 {
 for ( size_t k = 0; k  pElement-GetChildList()-size(); 
k++ )
-SearchL10NElements( 
(XMLParentNode*)(*pElement-GetChildList())[ k ], k);
+SearchL10NElements( (*pElement-GetChildList())[ k ], 
k);
 }
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc lotuswordpro/source rsc/inc

2014-06-01 Thread Jens Carl
 l10ntools/inc/helpmerge.hxx|5 +
 lotuswordpro/source/filter/clone.hxx   |5 +
 lotuswordpro/source/filter/lwpsdwfileloader.hxx|6 ++
 lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx  |6 ++
 lotuswordpro/source/filter/lwpunoheader.hxx|5 +
 lotuswordpro/source/filter/xfilter/xffontworkstyle.hxx |7 ---
 rsc/inc/rscarray.hxx   |3 ++-
 rsc/inc/rsclex.hxx |5 +
 8 files changed, 38 insertions(+), 4 deletions(-)

New commits:
commit 7610a80ad1a47f2401b4d6aca9d4f77e5be7c630
Author: Jens Carl j.car...@gmx.de
Date:   Fri May 30 20:32:57 2014 +

fdo#68849: Add header guards to all include files

Added header guards to files in directories l10ntools/, lotuswordpro/, and 
rsc/

Change-Id: I9c034d4bb5c92d78378bda4658d43a8b603d5281
Reviewed-on: https://gerrit.libreoffice.org/9581
Reviewed-by: Thomas Arnhold tho...@arnhold.org
Tested-by: Thomas Arnhold tho...@arnhold.org

diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 604817f..9787d18 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#ifndef INCLUDED_L10NTOOLS_INC_HELPMERGE_HXX
+#define INCLUDED_L10NTOOLS_INC_HELPMERGE_HXX
+
 #include xmlparse.hxx
 #include rtl/ustring.hxx
 #include rtl/ustrbuf.hxx
@@ -56,4 +59,6 @@ private:
 void ProcessHelp( LangHashMap* aLangHM , const OString sCur , ResData 
*pResData , MergeDataFile* pMergeDataFile );
 };
 
+#endif // INCLUDED_L10NTOOLS_INC_HELPMERGE_HXX
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/lotuswordpro/source/filter/clone.hxx 
b/lotuswordpro/source/filter/clone.hxx
index 7db1dec..bc2f7fb 100644
--- a/lotuswordpro/source/filter/clone.hxx
+++ b/lotuswordpro/source/filter/clone.hxx
@@ -7,6 +7,9 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_CLONE_HXX
+#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_CLONE_HXX
+
 namespace detail
 {
 
@@ -63,4 +66,6 @@ T* clone(T* const other)
 return other ? ::detail::clonerT, 
::detail::has_cloneT::value::clone(other) : 0;
 }
 
+#endif // INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_CLONE_HXX
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/lotuswordpro/source/filter/lwpsdwfileloader.hxx 
b/lotuswordpro/source/filter/lwpsdwfileloader.hxx
index 41369f6..3d6e52c 100644
--- a/lotuswordpro/source/filter/lwpsdwfileloader.hxx
+++ b/lotuswordpro/source/filter/lwpsdwfileloader.hxx
@@ -58,6 +58,10 @@
  * Mar 2005 revised for new processing procedure.
  * Jan 2005 created
  /
+
+#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPSDWFILELOADER_HXX
+#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPSDWFILELOADER_HXX
+
 #include assert.h
 #include tools/stream.hxx
 #include lwpheader.hxx
@@ -83,4 +87,6 @@ public:
 // end add
 };
 
+#endif // INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPSDWFILELOADER_HXX
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx 
b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx
index e810aab..5611ae8 100644
--- a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx
+++ b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx
@@ -58,6 +58,10 @@
  * Mar 2005 revised for new processing procedure.
  * Jan 2005 created
  /
+
+#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPSDWGROUPLOADERV0102_HXX
+#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPSDWGROUPLOADERV0102_HXX
+
 #include tools/stream.hxx
 #include lwpheader.hxx
 #include assert.h
@@ -86,4 +90,6 @@ public:
 // end add
 };
 
+#endif // INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPSDWGROUPLOADERV0102_HXX
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/lotuswordpro/source/filter/lwpunoheader.hxx 
b/lotuswordpro/source/filter/lwpunoheader.hxx
index 60230c6..252 100644
--- a/lotuswordpro/source/filter/lwpunoheader.hxx
+++ b/lotuswordpro/source/filter/lwpunoheader.hxx
@@ -62,6 +62,9 @@
  Jan 2005   Created
  /
 
+#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPUNOHEADER_HXX
+#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPUNOHEADER_HXX
+
 #include cppuhelper/implbase1.hxx
 #include cppuhelper/implbase3.hxx
 #include cppuhelper/factory.hxx
@@ -74,4 +77,6 @@
 
 #include xfilter/xfglobal.hxx
 
+#endif // INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPUNOHEADER_HXX
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/lotuswordpro/source/filter/xfilter/xffontworkstyle.hxx 

[Libreoffice-commits] core.git: l10ntools/inc

2014-05-22 Thread Stephan Bergmann
 l10ntools/inc/cfgmerge.hxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit ace815b451242b13f492887b004d14337362ae58
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu May 22 14:17:32 2014 +0200

Fix memory leak in cfgex tool

Change-Id: Ic8c410a805fa06777c1a85de646df2dcd5b6506a

diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx
index b938a11..1eb5f55 100644
--- a/l10ntools/inc/cfgmerge.hxx
+++ b/l10ntools/inc/cfgmerge.hxx
@@ -74,13 +74,13 @@ public:
 ~CfgStack();
 
 CfgStackData *Push(const OString rTag, const OString rId);
-CfgStackData *Pop()
+void Pop()
 {
-if (maList.empty())
-return NULL;
-CfgStackData* temp = maList.back();
-maList.pop_back();
-return temp;
+if (!maList.empty())
+{
+delete maList.back();
+maList.pop_back();
+}
 }
 
 CfgStackData *GetStackData();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2014-05-22 Thread Stephan Bergmann
 l10ntools/inc/xrmlex.hxx  |2 +-
 l10ntools/source/xrmlex.l |5 +
 l10ntools/source/xrmmerge.cxx |8 +++-
 3 files changed, 5 insertions(+), 10 deletions(-)

New commits:
commit 407db844120ead0d57118c40ab5e6acc1bad736d
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu May 22 18:51:57 2014 +0200

Fix memory leak in xrmex tool

Change-Id: I102566a95b5b34daf60730ffef290913caf28eb2

diff --git a/l10ntools/inc/xrmlex.hxx b/l10ntools/inc/xrmlex.hxx
index 2b15928..e109243 100644
--- a/l10ntools/inc/xrmlex.hxx
+++ b/l10ntools/inc/xrmlex.hxx
@@ -30,7 +30,7 @@ extern C int InitXrmExport( const char * );
 extern C int EndXrmExport();
 extern C int GetError();
 extern C int SetError();
-extern C char *GetOutputFile( int argc, char* argv[]);
+extern C bool GetOutputFile( int argc, char* argv[]);
 extern C FILE *GetXrmFile();
 extern C int isQuiet();
 extern C const char* getFilename();
diff --git a/l10ntools/source/xrmlex.l b/l10ntools/source/xrmlex.l
index f91405f..c29406e 100644
--- a/l10ntools/source/xrmlex.l
+++ b/l10ntools/source/xrmlex.l
@@ -205,12 +205,9 @@ void yyerror ( const char *s )
 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
/* error level */
int nRetValue = 0;
-   char *pOutput;
FILE *pFile;
 
-   pOutput = GetOutputFile( argc, argv );
-
-   if ( !pOutput )
+   if ( !GetOutputFile( argc, argv ) )
{
return 1;
}
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index 37190fb..510fc1a 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -54,7 +54,7 @@ XRMResParser *pParser = NULL;
 extern C {
 // the whole interface to lexer is in this extern C section
 
-extern char *GetOutputFile( int argc, char* argv[])
+extern bool GetOutputFile( int argc, char* argv[])
 {
 bDisplayName = false;
 bExtensionDescription = false;
@@ -67,15 +67,13 @@ extern char *GetOutputFile( int argc, char* argv[])
 sInputFileName = aArgs.m_sInputFile;
 sOutputFile = aArgs.m_sOutputFile;
 sMergeSrc = aArgs.m_sMergeSrc;
-char *pReturn = new char[ sOutputFile.getLength() + 1 ];
-std::strcpy( pReturn, sOutputFile.getStr());
-return pReturn;
+return true;
 }
 else
 {
 // command line is not valid
 common::writeUsage(xrmex,*.xrm/*.xml);
-return NULL;
+return false;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2014-04-08 Thread Stephan Bergmann
 l10ntools/inc/xrmlex.hxx  |   40 
 l10ntools/source/xrmlex.l |   15 ++-
 l10ntools/source/xrmmerge.cxx |4 ++--
 3 files changed, 44 insertions(+), 15 deletions(-)

New commits:
commit 52e359d82dbf239e5fd72c5f20d31b206c72d3e7
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Apr 8 10:17:38 2014 +0200

Clean up function declarations

Change-Id: Ie1360857dc4ed3102c709c1ef5b5929e5d5d5d7b

diff --git a/l10ntools/inc/xrmlex.hxx b/l10ntools/inc/xrmlex.hxx
new file mode 100644
index 000..3711ca6
--- /dev/null
+++ b/l10ntools/inc/xrmlex.hxx
@@ -0,0 +1,40 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_L10NTOOLS_SOURCE_XRMLEX_HXX
+#define INCLUDED_L10NTOOLS_SOURCE_XRMLEX_HXX
+
+#include sal/config.h
+
+#include stdio.h
+
+extern C int WorkOnTokenSet( int, char* );
+extern C int Argument( char * );
+extern C int InitXrmExport( const char * );
+extern C int EndXrmExport();
+extern C int GetError();
+extern C int SetError();
+extern C char *GetOutputFile( int argc, char* argv[]);
+extern C FILE *GetXrmFile();
+extern C int isQuiet();
+extern C const char* getFilename();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/xrmlex.l b/l10ntools/source/xrmlex.l
index 3017a7f..f91405f 100644
--- a/l10ntools/source/xrmlex.l
+++ b/l10ntools/source/xrmlex.l
@@ -37,6 +37,7 @@
 
 /* table of possible token ids */
 #include tokens.h
+#include xrmlex.hxx
 #include stdlib.h
 #include stdio.h
 
@@ -53,18 +54,6 @@
 #endif
 #define YY_NO_UNISTD_H
 
-/* external functions (C++ code, declared as extern C */
-extern C int WorkOnTokenSet( int, char* );
-extern C int Argument( char * );
-extern C int InitXrmExport( char * , char * );
-extern C int EndXrmExport();
-extern C int GetError();
-extern C int SetError();
-extern C char *GetOutputFile( int argc, char* argv[]);
-extern C FILE *GetXrmFile();
-extern C int isQuiet();
-extern C char* getFilename();
-
 /* forwards */
 void YYWarning();
 
@@ -226,7 +215,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
return 1;
}
pFile = GetXrmFile();
-   InitXrmExport( pOutput , getFilename() );
+   InitXrmExport( getFilename() );
 
 if ( !pFile )
return 1;
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index deeccf7..f3705fa 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -26,6 +26,7 @@
 #include common.hxx
 #include export.hxx
 #include po.hxx
+#include xrmlex.hxx
 #include xrmmerge.hxx
 #include tokens.h
 #include helper.hxx
@@ -36,7 +37,6 @@
 using namespace std;
 
 void yyerror( const char * );
-void YYWarning( const char * );
 
 // set of global variables
 bool bMergeMode;
@@ -78,7 +78,7 @@ extern char *GetOutputFile( int argc, char* argv[])
 }
 }
 
-int InitXrmExport( char*, char* pFilename)
+int InitXrmExport( const char* pFilename)
 {
 // instanciate Export
 OString sFilename( pFilename );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2014-02-26 Thread Alexander Wilms
 l10ntools/inc/cfgmerge.hxx|8 
 l10ntools/inc/export.hxx  |   24 
 l10ntools/source/cfgmerge.cxx |   20 ++--
 l10ntools/source/export.cxx   |8 
 l10ntools/source/lngmerge.cxx |4 ++--
 l10ntools/source/localize.cxx |8 
 l10ntools/source/merge.cxx|   20 ++--
 l10ntools/source/po.cxx   |   16 
 l10ntools/source/pocheck.cxx  |4 ++--
 l10ntools/source/xmlparse.cxx |   16 
 l10ntools/source/xrmmerge.cxx |   12 ++--
 11 files changed, 70 insertions(+), 70 deletions(-)

New commits:
commit 1a8ba677082ad093f478ed723feea9280b43
Author: Alexander Wilms f.alexander.wi...@gmail.com
Date:   Tue Feb 25 19:15:53 2014 +0100

Remove visual noise from l10ntools

Change-Id: Ia10056ae9e1b9adfe74f299afac5c3c84fa8cea7
Reviewed-on: https://gerrit.libreoffice.org/8278
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx
index d5d5e54..491ebc9 100644
--- a/l10ntools/inc/cfgmerge.hxx
+++ b/l10ntools/inc/cfgmerge.hxx
@@ -31,9 +31,9 @@
 typedef boost::unordered_mapOString, OString, OStringHash OStringHashMap;
 
 
-//
+
 // class CfgStackData
-//
+
 
 class CfgStackData
 {
@@ -60,9 +60,9 @@ public:
 
 };
 
-//
+
 // class CfgStack
-//
+
 
 class CfgStack
 {
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index b66a556..7e5b3be 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -55,9 +55,9 @@ typedef boost::unordered_mapOString, bool, OStringHash
 #define SOURCE_LANGUAGE en-US
 #define X_COMMENT x-comment
 
-//
+
 // class ResData
-//
+
 
 #define ID_LEVEL_NULL   0x
 #define ID_LEVEL_TEXT   0x0002
@@ -98,9 +98,9 @@ public:
 };
 
 
-//
+
 // class Export
-//
+
 
 #define LIST_NON0x
 #define LIST_STRING 0x0001
@@ -185,9 +185,9 @@ public:
 };
 
 
-//
+
 // class MergeEntrys
-//
+
 
 /// Purpose: holds information of data to merge
 class MergeEntrys
@@ -224,9 +224,9 @@ public:
 
 };
 
-//
+
 // class MergeDataHashMap
-//
+
 
 class MergeData;
 
@@ -271,9 +271,9 @@ class MergeDataHashMap
 HashMap_t m_aHashMap;
 };
 
-//
+
 // class MergeData
-//
+
 
 /// Purpose: holds information of data to merge (one resource)
 class MergeData
@@ -296,9 +296,9 @@ public:
 bool operator==( ResData *pData );
 };
 
-//
+
 // class MergeDataFile
-//
+
 
 /// Purpose: holds information of data to merge, read from PO file
 class MergeDataFile
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index 74e4e1b..cc44dd3 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -84,9 +84,9 @@ void workOnTokenSet(int nTyp, char * pTokenText) {
 
 }
 
-//
+
 // class CfgStackData
-//
+
 
 CfgStackData* CfgStack::Push(const OString rTag, const OString rId)
 {
@@ -95,9 +95,9 @@ CfgStackData* CfgStack::Push(const OString rTag, const 
OString rId)
 return pD;
 }
 
-//
+
 // class CfgStack
-//
+
 
 CfgStack::~CfgStack()
 {
@@ -127,9 +127,9 @@ CfgStackData *CfgStack::GetStackData()
 return 0;
 }
 
-//
+
 // class CfgParser
-//
+
 
 CfgParser::CfgParser()
 : pStackData( NULL ),
@@ -329,9 +329,9 @@ void CfgParser::Error(const OString rError)
 yyerror(rError.getStr());
 }
 
-//
+
 // class CfgExport
-//
+
 
 CfgExport::CfgExport(
 const OString rOutputFile,
@@ -389,9 +389,9 @@ void CfgExport::WorkOnText(
 }
 
 
-//
+
 // class CfgMerge
-//
+
 
 CfgMerge::CfgMerge(
 const OString rMergeSource, const OString rOutputFile,
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 76cb144..37f34f9 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -142,9 +142,9 @@ int GetError()
 }
 }
 
-//
+
 // class ResData
-//
+
 
 bool ResData::SetId( const OString rId, sal_uInt16 nLevel )
 {
@@ -172,9 +172,9 @@ bool ResData::SetId( const OString rId, sal_uInt16 nLevel )
 return false;
 }
 
-//
+
 // class Export
-//
+
 
 namespace
 {
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 7171f65..2e3a4d6 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -44,9 +44,9 @@ static void lcl_RemoveUTF8ByteOrderMarker( OString rString )
 
 }
 
-//
+
 // class LngParser
-//
+
 LngParser::LngParser(const OString rLngFile)
 : nError( LNG_OK )
 , pLines( NULL )
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index 659f689..9d055d5 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -323,17 +323,17 @@ bool includeProject(const OString rProject) {
 }
 
 /// Handle one directory in the hierarchy.
-///
+/
 /// Ignores symlinks and instead explicitly descends into clone/* or src/*,
 /// as the Cygwin symlinks are not supported by osl::Directory on Windows.

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source solenv/gbuild

2013-09-14 Thread Tomofumi Yagi
 l10ntools/inc/common.hxx  |2 ++
 l10ntools/inc/export.hxx  |4 +++-
 l10ntools/source/common.cxx   |9 +++--
 l10ntools/source/export.cxx   |8 +---
 solenv/gbuild/AllLangResTarget.mk |3 ++-
 5 files changed, 19 insertions(+), 7 deletions(-)

New commits:
commit fff70bf98c7a5a63aa0db11e93a3512c6a9a9359
Author: Tomofumi Yagi ya...@mknada.sakura.ne.jp
Date:   Sat Sep 7 10:04:30 2013 +0900

fdo#68790: fix build error on Win when system locale==Japanese(Japan)

This patch modifies transex3.
Modified transex3 outputs a file with BOM(if MergeMode is true).
*.[hs]rc files with BOM avoid this problem.
This problem is that MSVC interprets UTF-8 source code without BOM as
 local codepage when system locale is Japanese(Japan).

Change-Id: I3e12499a91a954236f48e6d7e360d26c93d19ed6
Reviewed-on: https://gerrit.libreoffice.org/5851
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Kohei Yoshida libreoff...@kohei.us
Reviewed-by: Kohei Yoshida libreoff...@kohei.us

diff --git a/l10ntools/inc/common.hxx b/l10ntools/inc/common.hxx
index 5a12bbb..047d2f4 100644
--- a/l10ntools/inc/common.hxx
+++ b/l10ntools/inc/common.hxx
@@ -28,12 +28,14 @@ struct HandledArgs
 OString m_sMergeSrc;
 OString m_sLanguage;
 bool m_bMergeMode;
+bool m_bUTF8BOM;
 HandledArgs()
 : m_sInputFile( OString() )
 , m_sOutputFile( OString() )
 , m_sMergeSrc( OString() )
 , m_sLanguage( OString() )
 , m_bMergeMode( false )
+, m_bUTF8BOM( false )
 {}
 };
 
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 595c027..b9d2603 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -226,9 +226,11 @@ private:
 
 void CutComment( OString rText );
 
+void WriteUTF8ByteOrderMarkToOutput() { *aOutput.mSimple  '\xEF'  
'\xBB'  '\xBF'; }
+
 public:
 Export( const OString rOutput );
-Export(const OString rMergeSource, const OString rOutput, const OString 
rLanguage);
+Export(const OString rMergeSource, const OString rOutput, const OString 
rLanguage, bool bUTF8BOM);
 ~Export();
 
 void Init();
diff --git a/l10ntools/source/common.cxx b/l10ntools/source/common.cxx
index db86845..78274b8 100644
--- a/l10ntools/source/common.cxx
+++ b/l10ntools/source/common.cxx
@@ -43,6 +43,10 @@ bool handleArguments(
 {
 nState = STATE_LANGUAGES;
 }
+else if ( OString( argv[ i ] ).toAsciiUpperCase() == -B )
+{
+o_aHandledArgs.m_bUTF8BOM = true;
+}
 else
 {
 switch ( nState )
@@ -90,12 +94,13 @@ void writeUsage(const OString rName, const OString 
rFileType)
 {
 std::cout
   Syntax:   rName.getStr()
-  -i FileIn -o FileOut [-m DataBase] [-l Lang]\n
+  -i FileIn -o FileOut [-m DataBase] [-l Lang] [-b]\n
   FileIn:   Source files (  rFileType.getStr()  )\n
   FileOut:  Destination file (*.*)\n
   DataBase: Mergedata (*.po)\n
   Lang: Restrict the handled language; one element of\n
-  (de, en-US, ...) or all\n;
+  (de, en-US, ...) or all\n
+  -b:   Add UTF-8 Byte Order Mark to FileOut(use with -m option)\n;
 }
 
 void writePoEntry(
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index b439389..864e7b2 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -69,8 +69,8 @@ FILE * init(int argc, char ** argv) {
 }
 
 if (aArgs.m_bMergeMode) {
-global::exporter.reset(
-new Export(aArgs.m_sMergeSrc, aArgs.m_sOutputFile, 
aArgs.m_sLanguage));
+global::exporter.reset(new Export(aArgs.m_sMergeSrc, 
aArgs.m_sOutputFile,
+  aArgs.m_sLanguage, 
aArgs.m_bUTF8BOM));
 } else {
 global::exporter.reset(new Export(aArgs.m_sOutputFile));
 }
@@ -198,7 +198,7 @@ Export::Export(const OString rOutput)
 
 Export::Export(
 const OString rMergeSource, const OString rOutput,
-const OString rLanguage )
+const OString rLanguage, bool bUTF8BOM)
 :
 bDefine( sal_False ),
 bNextMustBeDefineEOL( sal_False ),
@@ -218,6 +218,8 @@ Export::Export(
 {
 aOutput.mSimple = new std::ofstream();
 aOutput.mSimple-open(rOutput.getStr(), std::ios_base::out | 
std::ios_base::trunc);
+
+if ( bUTF8BOM ) WriteUTF8ByteOrderMarkToOutput();
 }
 
 void Export::Init()
diff --git a/solenv/gbuild/AllLangResTarget.mk 
b/solenv/gbuild/AllLangResTarget.mk
index 6721a98..ac7a9af 100644
--- a/solenv/gbuild/AllLangResTarget.mk
+++ b/solenv/gbuild/AllLangResTarget.mk
@@ -50,7 +50,8 @@ $(call gb_Helper_abbreviate_dirs,\
-i $(3) \
-o $(1) \
-m $${MERGEINPUT} \
-   -l all)  \
+   -l all \
+   $(if $(filter MSC,$(COM)),$(if $(strip 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source solenv/gbuild

2013-05-02 Thread Zolnai Tamás
 l10ntools/inc/export.hxx   |   64 -
 l10ntools/source/cfgmerge.cxx  |   15 -
 l10ntools/source/export.cxx|  496 ++---
 l10ntools/source/helpmerge.cxx |   15 -
 l10ntools/source/merge.cxx |   84 +-
 l10ntools/source/xrmmerge.cxx  |   14 -
 solenv/gbuild/HelpTarget.mk|2 
 7 files changed, 267 insertions(+), 423 deletions(-)

New commits:
commit c7ef2522272579a12eecddded0cbed6d222d3742
Author: Zolnai Tamás zolnaitamas2...@gmail.com
Date:   Thu May 2 12:09:35 2013 +0200

Make localization a bit more effective

1. get rid of some unefficiency
The old executables used to parse items which has
other language than en-US. To this items executables
search MergeEntrys(read from po) and change the content if
possible. This mixed localization method not need any longer.
-cfgex: cfgmerge:WorkOnText()
-xrmex: xrmmerge:WorkOnText()
-transex3: export:PrepareTextToMerge()

2. Change the container of MergeData to get a bit efficiency.
The new MergeDataHashMap is exploit that in most case the
insertion and search happen in the same order.(similar to fifo)
So add an iterator-chain to define an insertion order in the
original hashmap.
Every call of find it is a hint that the next element, to
the last found one, is the searched one. If not than search
such like in a HasMap.

3. Set up some order in helpex
Helpex is the only one, which was not used to merge strings
in the same order as export, so change it to work effective
with the new HashMap.
Helpex works with all file of a specific directory and po
files contain the strings of these files in lexical order
 so use the same order for merge.(HelpTarget.mk)

4. Make export use MergeDataHashMap a bit more effective
-The same MergeData contains strings to all language,
so it need to get only once.
-Just text entrys have MergeData, others not need to
search for it. (e.g. bitmap)

Plus delete some unused code.

Change-Id: I6ec80cd2323ffea8f783d0b59dc89ca7eac3c205

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 7a6f911..a7f8ea1 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -52,9 +52,6 @@ typedef boost::unordered_mapOString, OString, OStringHash
 typedef boost::unordered_mapOString, bool, OStringHash
 OStringBoolHashMap;
 
-typedef boost::unordered_mapOString, MergeData*, OStringHash
-MergeDataHashMap;
-
 #define SOURCE_LANGUAGE en-US
 #define X_COMMENT x-comment
 #define LIST_REFID  LIST_REFID
@@ -193,7 +190,6 @@ private:
 bool bSkipFile;
 sal_Bool bMergeMode;
 OString sMergeSrc;
-OString sLastListLine;
 sal_Bool bError;// any errors while export?
 sal_Bool bReadOver;
 sal_Bool bDontWriteOutput;
@@ -219,8 +215,12 @@ private:
 void CleanValue( OString rValue );
 OString GetText(const OString rSource, int nToken);
 
-sal_Bool PrepareTextToMerge(OString rText, sal_uInt16 nTyp,
-OString rLangIndex, ResData *pResData);
+/**
+  Get all MergeEntrys for the ExportList identified by pResData
+  Check whether list can merge and load all needed MergeEntry from 
DataBase.
+*/
+bool GetAllMergeEntrysOfList(ResData *pResData, std::vectorMergeEntrys* 
o_vMergeEntrys, ExportList* o_pList);
+
 void ResData2Output( MergeEntrys *pEntry, sal_uInt16 nType, const OString 
rTextType );
 void MergeRest( ResData *pResData, sal_uInt16 nMode = MERGE_MODE_NORMAL );
 void ConvertMergeContent( OString rText );
@@ -277,10 +277,56 @@ public:
 bTitleFirst[ rId ] = true;
 }
 sal_Bool GetText( OString rReturn, sal_uInt16 nTyp, const OString 
nLangIndex, sal_Bool bDel = sal_False );
+
+/**
+  Generate QTZ string with ResData
+  For executable which works one language and without PO files.
+*/
 static OString GetQTZText(const ResData rResData, const OString 
rOrigText);
 
 };
 
+/** Container for MergeData
+
+  This class is an HashMap with a hidden insertion
+  order. The class can used just like a simple
+  HashMap, but good to know that it's use is
+  more effective if the accessing(find) order
+  match with the insertion order.
+
+  In the most case, this match is good.
+  (e.g. reading PO files of different languages,
+  executables merging)
+*/
+class MergeDataHashMap
+{
+private:
+typedef boost::unordered_mapOString, MergeData*, OStringHash 
HashMap_t;
+
+public:
+MergeDataHashMap():bFirstSearch(true){};
+~MergeDataHashMap(){};
+
+typedef HashMap_t::iterator iterator;
+typedef HashMap_t::const_iterator const_iterator;
+
+std::pairiterator,bool insert(const OString rKey, MergeData* 
pMergeData);
+iterator find(const OString rKey);
+
+iterator begin() {return m_aHashMap.begin();}
+iterator end() {return m_aHashMap.end();}
+
+

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2013-05-02 Thread Zolnai Tamás
 l10ntools/inc/cfgmerge.hxx |   19 ++
 l10ntools/inc/common.hxx   |7 ++--
 l10ntools/inc/export.hxx   |   70 
 l10ntools/inc/helper.hxx   |9 -
 l10ntools/inc/lngmerge.hxx |   14 ++--
 l10ntools/inc/po.hxx   |   10 ++---
 l10ntools/inc/propmerge.hxx|   10 +++--
 l10ntools/inc/treemerge.hxx|   18 ++
 l10ntools/inc/xmlparse.hxx |   25 ++
 l10ntools/inc/xrmmerge.hxx |   17 -
 l10ntools/source/cfgmerge.cxx  |   30 ++---
 l10ntools/source/export.cxx|   39 --
 l10ntools/source/merge.cxx |   10 ++---
 l10ntools/source/po.cxx|   69 ---
 l10ntools/source/treemerge.cxx |   15 +++-
 l10ntools/source/xrmmerge.cxx  |   71 +
 16 files changed, 151 insertions(+), 282 deletions(-)

New commits:
commit 29400c568a84339066ef238e836cfeb19f732873
Author: Zolnai Tamás zolnaitamas2...@gmail.com
Date:   Thu May 2 15:06:23 2013 +0200

Some code scrubing

Add doxygen documentation for classes and methods
Delete useless comments.
Add include guards where missing.
Delete some useless typedef.

Change-Id: I9bba16560790239d7775fcd40981465e70e5d437

diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx
index 9710008..03addd1 100644
--- a/l10ntools/inc/cfgmerge.hxx
+++ b/l10ntools/inc/cfgmerge.hxx
@@ -64,12 +64,10 @@ public:
 // class CfgStack
 //
 
-typedef std::vector CfgStackData*  CfgStackList;
-
 class CfgStack
 {
 private:
-CfgStackList maList;
+std::vector CfgStackData*  maList;
 
 public:
 CfgStack() {}
@@ -92,10 +90,7 @@ public:
 size_t size() const { return maList.size(); }
 };
 
-//
-// class CfgParser
-//
-
+/// Parser for *.xcu files
 class CfgParser
 {
 protected:
@@ -136,10 +131,7 @@ public:
 int Execute( int nToken, char * pToken );
 };
 
-//
-// class CfgExport
-//
-
+/// Export strings from *.xcu files
 class CfgExport : public CfgParser
 {
 private:
@@ -162,10 +154,7 @@ public:
 ~CfgExport();
 };
 
-//
-// class CfgMerge
-//
-
+/// Merge strings to *.xcu files
 class CfgMerge : public CfgParser
 {
 private:
diff --git a/l10ntools/inc/common.hxx b/l10ntools/inc/common.hxx
index 93f2d00..5a12bbb 100644
--- a/l10ntools/inc/common.hxx
+++ b/l10ntools/inc/common.hxx
@@ -7,7 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/// Methods used by all of executables
+// Methods used by all of executables
 
 #ifndef INCLUDED_L10NTOOLS_SOURCE_COMMON_HXX
 #define INCLUDED_L10NTOOLS_SOURCE_COMMON_HXX
@@ -20,7 +20,7 @@
 
 namespace common {
 
-//result type of handleArguments()
+/// Result type of handleArguments()
 struct HandledArgs
 {
 OString m_sInputFile;
@@ -37,10 +37,13 @@ struct HandledArgs
 {}
 };
 
+/// Handle command line parameters
 bool handleArguments(int argc, char * argv[], HandledArgs o_aHandledArgs);
 
+/// Write out a help about usage
 void writeUsage(const OString rName, const OString rFileType);
 
+/// Write out a PoEntry with attention to excaptions
 void writePoEntry(
 const OString rExecutable, PoOfstream rPoStream, const OString 
rSourceFile,
 const OString rResType, const OString rGroupId, const OString rLocalId,
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index a7f8ea1..d23cc6f 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -30,9 +30,9 @@
 #include osl/file.h
 
 #include boost/unordered_map.hpp
-#include iterator /* std::iterator*/
-#include set  /* std::set*/
-#include vector   /* std::vector*/
+#include iterator
+#include set
+#include vector
 #include queue
 #include string
 
@@ -44,7 +44,6 @@
 #define NO_TRANSLATE_ISOx-no-translate
 
 class MergeEntrys;
-class MergeData;
 
 typedef boost::unordered_mapOString, OString, OStringHash
 OStringHashMap;
@@ -56,17 +55,18 @@ typedef boost::unordered_mapOString, bool, OStringHash
 #define X_COMMENT x-comment
 #define LIST_REFID  LIST_REFID
 
-typedef OStringHashMap ExportListEntry;
-typedef ::std::vector ExportListEntry*  ExportListBase;
-
 //
 // class ExportList
 //
 
+typedef OStringHashMap ExportListEntry;
+
+
+/// Container for parse different types of string lists
 class ExportList
 {
 private:
-ExportListBase maList;
+std::vector ExportListEntry*  maList;
 std::size_t nSourceLanguageListEntryCount;
 
 public:
@@ -85,13 +85,9 @@ public:
 #define REFID_NONE 0x
 
 //
-// struct ResData
+// class ResData
 //
 
-/**
-* Purpose: holds mandatory data to export a single res (used with ResStack)
-**/
-
 #define ID_LEVEL_NULL   0x
 #define ID_LEVEL_AUTOID 0x0001
 #define ID_LEVEL_TEXT   0x0002
@@ -100,6 +96,8 @@ public:
 #define ID_LEVEL_IDENTIFIER 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2013-04-21 Thread Zolnai Tamás
 l10ntools/inc/export.hxx   |5 -
 l10ntools/source/merge.cxx |8 
 2 files changed, 13 deletions(-)

New commits:
commit 2d8e4f91feeba58dbe4dc38e484a3be0f578ae9f
Author: Zolnai Tamás zolnaitamas2...@gmail.com
Date:   Sun Apr 21 19:09:27 2013 +0200

Delete more unused member from export

Change-Id: Icebd32c7ac2144f99827ca48cca7bbcaf10814c4

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index a1a2e8c..7a6f911 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -128,16 +128,12 @@ public:
 OString sFilename;
 
 OStringHashMap sText;
-sal_uInt16 nTextRefId;
 
 OStringHashMap sHelpText;
-sal_uInt16 nHelpTextRefId;
 
 OStringHashMap sQuickHelpText;
-sal_uInt16 nQuickHelpTextRefId;
 
 OStringHashMap sTitle;
-sal_uInt16 nTitleRefId;
 
 OString sTextTyp;
 
@@ -322,7 +318,6 @@ public:
 class MergeDataFile
 {
 private:
-OString sErrorLog;
 MergeDataHashMap aMap;
 std::setOString aLanguageSet;
 
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 401cba5..498962f 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -74,10 +74,6 @@ ResData::ResData( const OString rGId )
 bTitle( sal_False ),
 bList( sal_False ),
 sGId( rGId ),
-nTextRefId( REFID_NONE ),
-nHelpTextRefId( REFID_NONE ),
-nQuickHelpTextRefId( REFID_NONE ),
-nTitleRefId( REFID_NONE ),
 sTextTyp( Text ),
 pStringList( NULL ),
 pUIEntries( NULL ),
@@ -100,10 +96,6 @@ ResData::ResData( const OString rGId, const OString 
rFilename)
 bList( sal_False ),
 sGId( rGId ),
 sFilename( rFilename ),
-nTextRefId( REFID_NONE ),
-nHelpTextRefId( REFID_NONE ),
-nQuickHelpTextRefId( REFID_NONE ),
-nTitleRefId( REFID_NONE ),
 sTextTyp( Text ),
 pStringList( NULL ),
 pUIEntries( NULL ),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2013-04-20 Thread Zolnai Tamás
 l10ntools/inc/export.hxx|4 
 l10ntools/source/export.cxx |   17 -
 l10ntools/source/merge.cxx  |6 --
 3 files changed, 27 deletions(-)

New commits:
commit 9e2d2822063729f450adb734f58106bb64695ce6
Author: Zolnai Tamás zolnaitamas2...@gmail.com
Date:   Sat Apr 20 09:36:16 2013 +0200

Delete some unneeded member of ResData

nChildIndex and bRestMerges are simple unused.
nWidth is an obsolote attribute

Change-Id: I669a17cefb3dc8628ce2c8d9db8abac630fc3cde

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 35f9772..2230569 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -111,8 +111,6 @@ public:
 ~ResData();
 sal_Bool SetId(const OString rId, sal_uInt16 nLevel);
 
-sal_Int32 nWidth;
-sal_uInt16 nChildIndex;
 sal_uInt16 nIdLevel;
 sal_Bool bChild;
 sal_Bool bChildWithText;
@@ -123,8 +121,6 @@ public:
 sal_Bool bTitle;
 sal_Bool bList;
 
-sal_Bool bRestMerged;
-
 OString sResTyp;
 OString sId;
 OString sGId;
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index bf1fbce..af97a4b 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -782,23 +782,6 @@ int Export::Execute( int nToken, const char * pToken )
 case APPFONTMAPPING:
 {
 bDontWriteOutput = sal_False;
-// this is a AppfontMapping, so look if its a definition
-// of field size
-sal_Int32 n = 0;
-OString sKey(
-sToken.getToken(0, '=', n).replaceAll( , OString()).
-replaceAll(\t, OString()));
-OString sMapping = sToken.getToken(0, '=', n);
-sMapping = sMapping.getToken(1, '(');
-sMapping = sMapping.getToken(0, ')').
-replaceAll(OString(' '), OString()).
-replaceAll(OString('\t'), OString()).
-toAsciiUpperCase();
-if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM(SIZE))) {
-pResData-nWidth = sMapping.getToken(0, ',').toInt32();
-} else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM(POSSIZE))) {
-pResData-nWidth = sMapping.getToken(2, ',').toInt32();
-}
 }
 break;
 case RSCDEFINELEND:
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index f1b283f..1555adb 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -65,8 +65,6 @@ namespace
 
 ResData::ResData( const OString rGId )
 :
-nWidth( 0 ),
-nChildIndex( 0 ),
 nIdLevel( ID_LEVEL_NULL ),
 bChild( sal_False ),
 bChildWithText( sal_False ),
@@ -75,7 +73,6 @@ ResData::ResData( const OString rGId )
 bQuickHelpText( sal_False ),
 bTitle( sal_False ),
 bList( sal_False ),
-bRestMerged( sal_False ),
 sGId( rGId ),
 nTextRefId( REFID_NONE ),
 nHelpTextRefId( REFID_NONE ),
@@ -93,8 +90,6 @@ ResData::ResData( const OString rGId )
 
 ResData::ResData( const OString rGId, const OString rFilename)
 :
-nWidth( 0 ),
-nChildIndex( 0 ),
 nIdLevel( ID_LEVEL_NULL ),
 bChild( sal_False ),
 bChildWithText( sal_False ),
@@ -103,7 +98,6 @@ ResData::ResData( const OString rGId, const OString 
rFilename)
 bQuickHelpText( sal_False ),
 bTitle( sal_False ),
 bList( sal_False ),
-bRestMerged( sal_False ),
 sGId( rGId ),
 sFilename( rFilename ),
 nTextRefId( REFID_NONE ),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2013-04-15 Thread Zolnai Tamás
 l10ntools/inc/export.hxx|3 --
 l10ntools/source/export.cxx |   49 +---
 2 files changed, 2 insertions(+), 50 deletions(-)

New commits:
commit 10e3c7c428a7d231055d643e12f454c4267deab2
Author: Zolnai Tamás zolnaitamas2...@gmail.com
Date:   Mon Apr 15 17:58:24 2013 +0200

Delete remaind code of an obsolote parameter

Past: Use -l en-US, af, hu... parameter for transex
and to work with this string use InitLanguages() function.
Now: Use -l all parameter and get langauges from po files.
So InitLanguages is unneeded.

Change-Id: Ide6b3d24fb8b483c0c31034b1ffd6aba31c5e4c9

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 719102d..35f9772 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -206,7 +206,6 @@ private:
 sal_Bool bReadOver;
 sal_Bool bDontWriteOutput;
 OString sLastTextTyp;
-bool isInitialized;
 OString sFilename;
 OString sLanguages;
 
@@ -238,8 +237,6 @@ private:
 void WriteToMerged(const OString rText , bool bSDFContent);
 void SetChildWithText();
 
-void InitLanguages( bool bMergeMode = false );
-
 void CutComment( OString rText );
 
 public:
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 6a93531..bf1fbce 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -189,12 +189,10 @@ Export::Export(const OString rOutput)
 bError( sal_False ),
 bReadOver( sal_False ),
 bDontWriteOutput( sal_False ),
-isInitialized( false ),
 sFilename( global::inputPathname ),
 sLanguages( OString() ),
 pParseQueue( new ParserQueue( *this ) )
 {
-// open output stream
 aOutput.mPo = new PoOfstream( rOutput, PoOfstream::APP );
 if (!aOutput.mPo-isOpen()) {
 fprintf(stderr, ERROR : Can't open file %s\n, rOutput.getStr());
@@ -218,15 +216,10 @@ Export::Export(
 bError( sal_False ),
 bReadOver( sal_False ),
 bDontWriteOutput( sal_False ),
-isInitialized( false ),
 sFilename( global::inputPathname ),
 sLanguages( rLanguage ),
 pParseQueue( new ParserQueue( *this ) )
 {
-InitLanguages( bMergeMode );
-// used when merge is enabled
-
-// open output stream
 aOutput.mSimple = new std::ofstream();
 aOutput.mSimple-open(rOutput.getStr(), std::ios_base::out | 
std::ios_base::trunc);
 }
@@ -1442,15 +1435,7 @@ sal_Bool Export::PrepareTextToMerge(OString rText, 
sal_uInt16 nTyp,
 // search for merge data
 if ( !pMergeDataFile ){
 pMergeDataFile = new MergeDataFile( sMergeSrc, global::inputPathname, 
false );
-
-// Init Languages
-if( Export::sLanguages.equalsIgnoreAsciiCase(ALL) )
-{
-aLanguages = pMergeDataFile-GetLanguages();
-isInitialized = true;
-}
-else if( !isInitialized )InitLanguages();
-
+aLanguages = pMergeDataFile-GetLanguages();
 }
 
 MergeEntrys *pEntrys = pMergeDataFile-GetMergeEntrys( pResData );
@@ -1546,14 +1531,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 
nMode )
 {
 if ( !pMergeDataFile ){
 pMergeDataFile = new MergeDataFile( sMergeSrc, global::inputPathname, 
false );
-
-// Init Languages
-if (Export::sLanguages.equalsIgnoreAsciiCase(ALL))
-{
-aLanguages = pMergeDataFile-GetLanguages();
-isInitialized = true;
-}
-else if( !isInitialized )InitLanguages();
+aLanguages = pMergeDataFile-GetLanguages();
 
 }
 switch ( nMode ) {
@@ -1848,29 +1826,6 @@ void Export::SetChildWithText()
 }
 }
 
-void Export::InitLanguages( bool bMerge ){
-
-if( !isInitialized )
-{
-OString sTmp;
-OStringBoolHashMap aEnvLangs;
-
-sal_Int32 nIndex = 0;
-do
-{
-OString aToken = sLanguages.getToken(0, ',', nIndex);
-sTmp = aToken.getToken(0, '=').trim();
-if( bMerge  sTmp.equalsIgnoreAsciiCase(en-US) ){}
-else if( !( (sTmp[0]=='x' || sTmp[0]=='X')  sTmp[1]=='-' ) ){
-aLanguages.push_back( sTmp );
-}
-}
-while ( nIndex = 0 );
-
-isInitialized = true;
-}
-}
-
 void ParserQueue::Push( const QueueEntry aEntry )
 {
 sal_Int32 nLen = aEntry.sLine.getLength();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2013-04-13 Thread Zolnai Tamás
 l10ntools/inc/cfgmerge.hxx |3 --
 l10ntools/inc/export.hxx   |2 -
 l10ntools/inc/helpmerge.hxx|2 -
 l10ntools/inc/lngmerge.hxx |2 -
 l10ntools/source/cfgmerge.cxx  |   24 +
 l10ntools/source/export.cxx|   55 -
 l10ntools/source/helpex.cxx|2 -
 l10ntools/source/helpmerge.cxx |   39 +++--
 l10ntools/source/lngex.cxx |2 -
 l10ntools/source/lngmerge.cxx  |   22 
 l10ntools/source/localize.cxx  |1 
 l10ntools/source/uimerge.cxx   |8 -
 l10ntools/source/xrmmerge.cxx  |   17 +++-
 13 files changed, 63 insertions(+), 116 deletions(-)

New commits:
commit 4146406205ce6f939944685e1931dcd45f3de708
Author: Zolnai Tamás zolnaitamas2...@gmail.com
Date:   Sat Apr 13 07:21:07 2013 +0200

l10ntools: export use only en-US

So no need to ad it in a commandline parameter.
No need to use a vector to store languages.

Change-Id: I1f7d3bd131b5a9ff23d403cee4ac6804ae8e0a0b

diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx
index c34ba06..00838de 100644
--- a/l10ntools/inc/cfgmerge.hxx
+++ b/l10ntools/inc/cfgmerge.hxx
@@ -160,8 +160,7 @@ protected:
 public:
 CfgExport(
 const OString rOutputFile,
-const OString rFilePath,
-const OString rLanguage
+const OString rFilePath
 );
 ~CfgExport();
 };
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 10223cd..719102d 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -243,7 +243,7 @@ private:
 void CutComment( OString rText );
 
 public:
-Export(const OString rOutput, const OString rLanguage);
+Export( const OString rOutput );
 Export(const OString rMergeSource, const OString rOutput, const OString 
rLanguage);
 ~Export();
 
diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 95aad6d..1f9c90a 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -43,7 +43,7 @@ public:
 
 /// Method append a PO file with the content of a parsed XML file
 /// @PRECOND rHelpFile is valid
-static bool CreatePO( const OString rPOFile_in, const OString sHelpFile, 
const OString rLanguage,
+static bool CreatePO( const OString rPOFile_in, const OString sHelpFile,
   XMLFile *pXmlFile, const OString rGsi1 );
 
 /// Method merges the String from the POfile into XMLfile. Both Strings must
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index 8441824..0f98eac 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -53,7 +53,7 @@ public:
 sal_Bool bULFFormat);
 ~LngParser();
 
-sal_Bool CreatePO( const OString rPOFile, const OString rLanguage );
+sal_Bool CreatePO( const OString rPOFile );
 sal_Bool Merge(const OString rPOFile, const OString rDestinationFile,
  const OString rLanguage );
 };
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index dcbcfb9..d6a72ed 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -72,7 +72,7 @@ FILE * init(int argc, char ** argv) {
 } else {
 global::parser.reset(
 new CfgExport(
-aArgs.m_sOutputFile, global::inputPathname, aArgs.m_sLanguage 
));
+aArgs.m_sOutputFile, global::inputPathname ));
 }
 
 return pFile;
@@ -359,8 +359,7 @@ void CfgParser::Error(const OString rError)
 /*/
 CfgExport::CfgExport(
 const OString rOutputFile,
-const OString rFilePath,
-const OString rLanguage
+const OString rFilePath
 )
 /*/
 : sPath( rFilePath )
@@ -371,7 +370,6 @@ CfgExport::CfgExport(
 std::cerr  ERROR: Unable to open output file:   rOutputFile  
\n;
 std::exit(EXIT_FAILURE);
 }
-aLanguages.push_back( rLanguage );
 }
 
 /*/
@@ -388,7 +386,6 @@ void CfgExport::WorkOnResourceEnd()
 if ( bLocalize ) {
 if ( 
pStackData-sText[OString(RTL_CONSTASCII_STRINGPARAM(en-US))].getLength() )
 {
-OString sFallback = 
pStackData-sText[OString(RTL_CONSTASCII_STRINGPARAM(en-US))];
 OString sXComment = 
pStackData-sText[OString(RTL_CONSTASCII_STRINGPARAM(x-comment))];
 OString sLocalId = pStackData-sIdentifier;
 OString sGroupId;
@@ -400,20 +397,13 @@ void CfgExport::WorkOnResourceEnd()
 sGroupId = aStack.GetAccessPath( aStack.size() - 2 );
 }
 
-for (size_t n = 0; n  aLanguages.size(); n++)
-{
-OString sCur = aLanguages[ n ];
-
-OString sText = pStackData-sText[ sCur ];
-if 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2013-04-12 Thread Zolnai Tamás
 l10ntools/inc/export.hxx |   51 --
 l10ntools/source/cfgmerge.cxx|6 +-
 l10ntools/source/export.cxx  |   57 +
 l10ntools/source/helpmerge.cxx   |6 +-
 l10ntools/source/lngmerge.cxx|4 -
 l10ntools/source/merge.cxx   |   87 ++-
 l10ntools/source/propmerge.cxx   |4 -
 l10ntools/source/stringmerge.cxx |6 +-
 l10ntools/source/treemerge.cxx   |6 +-
 l10ntools/source/uimerge.cxx |4 -
 l10ntools/source/xrmmerge.cxx|   11 ++--
 11 files changed, 87 insertions(+), 155 deletions(-)

New commits:
commit be30e0e139ecc068665c8e46020b60356b05cfd6
Author: Zolnai Tamás zolnaitamas2...@gmail.com
Date:   Sat Apr 13 06:02:11 2013 +0200

Delete obsolote platform from l10ntools merge

Change-Id: I5e5b87355d3d6e369c8fccd7078581758abb3b10

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 0a2c10e..10223cd 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -43,7 +43,7 @@
 
 #define NO_TRANSLATE_ISOx-no-translate
 
-class PFormEntrys;
+class MergeEntrys;
 class MergeData;
 
 typedef boost::unordered_mapOString, OString, OStringHash
@@ -52,9 +52,6 @@ typedef boost::unordered_mapOString, OString, OStringHash
 typedef boost::unordered_mapOString, bool, OStringHash
 OStringBoolHashMap;
 
-typedef boost::unordered_mapOString, PFormEntrys*, OStringHash
-PFormEntrysHashMap;
-
 typedef boost::unordered_mapOString, MergeData*, OStringHash
 MergeDataHashMap;
 
@@ -109,8 +106,8 @@ public:
 class ResData
 {
 public:
-ResData(const OString rPF, const OString rGId);
-ResData(const OString rPF, const OString rGId , const OString 
rFilename);
+ResData( const OString rGId );
+ResData( const OString rGId , const OString rFilename );
 ~ResData();
 sal_Bool SetId(const OString rId, sal_uInt16 nLevel);
 
@@ -153,8 +150,6 @@ public:
 ExportList  *pItemList;
 ExportList  *pFilterList;
 ExportList  *pPairedList;
-
-OString sPForm;
 };
 
 
@@ -196,8 +191,6 @@ private:
 
 ResStack aResStack; // stack for parsing recursive
 
-OString sActPForm;   // hold cur. system
-
 sal_Bool bDefine;   // cur. res. in a define?
 sal_Bool bNextMustBeDefineEOL;  // define but no \ at lineend
 std::size_t nLevel; // res. recursiv? how deep?
@@ -237,7 +230,7 @@ private:
 
 sal_Bool PrepareTextToMerge(OString rText, sal_uInt16 nTyp,
 OString rLangIndex, ResData *pResData);
-void ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const OString 
rTextType );
+void ResData2Output( MergeEntrys *pEntry, sal_uInt16 nType, const OString 
rTextType );
 void MergeRest( ResData *pResData, sal_uInt16 nMode = MERGE_MODE_NORMAL );
 void ConvertMergeContent( OString rText );
 void ConvertExportContent( OString rText );
@@ -263,19 +256,17 @@ public:
 
 
 //
-// class PFormEntrys
+// class MergeEntrys
 //
 
-/**
-* Purpose: holds information of data to merge (one pform)
-**/
+/**
+ * Purpose: holds information of data to merge
+ */
 
-class PFormEntrys
+class MergeEntrys
 {
 friend class MergeDataFile;
 private:
-OString data_; //TODO
-OString sHelpText; // empty string
 OStringHashMap sText;
 OStringBoolHashMap bTextFirst;
 OStringHashMap sQuickHelpText;
@@ -284,7 +275,7 @@ private:
 OStringBoolHashMap bTitleFirst;
 
 public:
-PFormEntrys( const OString rPForm ) : data_( rPForm ) {};
+MergeEntrys(){};
 void InsertEntry(const OString rId, const OString rText,
 const OString rQuickHelpText, const OString rTitle)
 {
@@ -317,15 +308,11 @@ public:
 OString sGID;
 OString sLID;
 OString sFilename;
-PFormEntrysHashMap aMap;
+MergeEntrys* pMergeEntrys;
 public:
-MergeData( const OString rTyp, const OString rGID, const OString rLID , 
const OString rFilename )
-: sTyp( rTyp ), sGID( rGID ), sLID( rLID ) , sFilename( rFilename 
) {};
+MergeData( const OString rTyp, const OString rGID, const OString rLID , 
const OString rFilename );
 ~MergeData();
-PFormEntrys* GetPFormEntries();
-
-void Insert( PFormEntrys* pfEntrys );
-PFormEntrys* GetPFObject( const OString rPFO );
+MergeEntrys* GetMergeEntries();
 
 sal_Bool operator==( ResData *pData );
 };
@@ -347,10 +334,10 @@ class MergeDataFile
 
 MergeData *GetMergeData( ResData *pResData , bool bCaseSensitve = 
false );
 void InsertEntry(const OString rTYP, const OString rGID,
-const OString rLID, const OString rPFO,
-const OString nLang, const OString rTEXT,
-const OString rQHTEXT, const OString rTITLE,
-const OString sFilename, bool bCaseSensitive);
+const 

[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2013-03-27 Thread Stephan Bergmann
 l10ntools/inc/export.hxx|3 ---
 l10ntools/source/export.cxx |2 --
 2 files changed, 5 deletions(-)

New commits:
commit e0cf3babee1e8c3b4e432e591bae18b97b07c34a
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Mar 27 21:16:27 2013 +0100

-Werror,-Wunused-private-field

Change-Id: I42235ca7cd25c07af7daaf51f56a6deb60e4108e

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index e3a0913..8dc9ab8 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -182,14 +182,11 @@ public:
 
 typedef ::std::vector ResData*  ResStack;
 // forwards
-class WordTransformer;
 class ParserQueue;
 
 class Export
 {
 private:
-WordTransformer *pWordTransformer;
-
 union
 {
 std::ofstream* mSimple;
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 900e850..adce9e85 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -177,7 +177,6 @@ static sal_Int32 lcl_countOccurrences(const OString text, 
char c)
 
 Export::Export(const OString rOutput, const OString rLanguage)
 :
-pWordTransformer( NULL ),
 bDefine( sal_False ),
 bNextMustBeDefineEOL( sal_False ),
 nLevel( 0 ),
@@ -209,7 +208,6 @@ Export::Export(
 const OString rMergeSource, const OString rOutput,
 const OString rLanguage )
 :
-pWordTransformer( NULL ),
 bDefine( sal_False ),
 bNextMustBeDefineEOL( sal_False ),
 nLevel( 0 ),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2013-03-09 Thread Zolnai Tamás
 l10ntools/inc/po.hxx|1 -
 l10ntools/source/po.cxx |   36 
 2 files changed, 37 deletions(-)

New commits:
commit de69091d34d8102c0b56194d603ed9e66699d34c
Author: Zolnai Tamás zolnaitamas2...@gmail.com
Date:   Sat Mar 9 12:18:28 2013 +0100

Delete PoHeader constructor used by renewpo

Change-Id: I360a9c96eacf9b7b8bd80214a3fc4c9faa01e631

diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx
old mode 100644
new mode 100755
index 506558f..f2edb06
--- a/l10ntools/inc/po.hxx
+++ b/l10ntools/inc/po.hxx
@@ -90,7 +90,6 @@ public:
 friend class PoIfstream;
 
 PoHeader( const OString rExtSrc );
-PoHeader( std::ifstream rOldPo );
 ~PoHeader();
 };
 
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
old mode 100644
new mode 100755
index 90b7f79..99e113b
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -619,16 +619,6 @@ namespace
 strftime( pBuff, sizeof pBuff, %Y-%m-%d %H:%M%z, pNow );
 return pBuff;
 }
-
-static OString lcl_ReplaceAttribute(
-const OString rSource, const OString rOld, const OString rNew )
-{
-const sal_Int32 nFirstIndex =
-rSource.indexOf( rOld ) + rOld.getLength()+2;
-const sal_Int32 nCount =
-rSource.indexOf( \n, nFirstIndex ) - nFirstIndex;
-return rSource.replaceFirst( rSource.copy(nFirstIndex, nCount), rNew );
-}
 }
 
 //Template Constructor
@@ -653,32 +643,6 @@ PoHeader::PoHeader( const OString rExtSrc )
 m_bIsInitialized = true;
 }
 
-
-//Constructor for old headers to renew po files
-PoHeader::PoHeader(  std::ifstream rOldPo )
-: m_pGenPo( new GenPoEntry() )
-, m_bIsInitialized( false )
-{
-assert( rOldPo.is_open() );
-m_pGenPo-readFromFile( rOldPo );
-
-const OString sExtractCom = m_pGenPo-getExtractCom();
-m_pGenPo-setExtractCom(
-sExtractCom.copy( 0, sExtractCom.getLength() - 3 ) );
-
-OString sMsgStr = m_pGenPo-getMsgStr();
-sMsgStr =
-lcl_ReplaceAttribute( sMsgStr, Report-Msgid-Bugs-To,
-https://bugs.freedesktop.org/enter_bug.cgi?product=;
-LibreOfficebug_status=UNCONFIRMEDcomponent=UI );
-sMsgStr =
-lcl_ReplaceAttribute( sMsgStr, X-Generator, LibreOffice );
-sMsgStr =
-lcl_ReplaceAttribute( sMsgStr, X-Accelerator-Marker, ~ );
-m_pGenPo-setMsgStr( sMsgStr );
-m_bIsInitialized = true;
-}
-
 PoHeader::~PoHeader()
 {
 delete m_pGenPo;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits