summaryrefslogtreecommitdiff
path: root/l10ntools/source/propmerge.cxx
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2013-03-15 15:42:05 +0100
committerZolnai Tamás <zolnaitamas2000@gmail.com>2013-03-16 12:27:32 +0100
commit15a13bafccb96e6ab0cc5a23af6dd46715fa22c5 (patch)
tree91b93ddc0f731aec2d5b19f1895545550872a119 /l10ntools/source/propmerge.cxx
parent516118b515fb577b1cc40e4b8d7dc06919b64675 (diff)
Get rid of generating temporary sdf file
Working: 1. Localize add header to po files. 2. Executables append po entries to po files. 3. Localize delete entryless po files and empty directories Plus a bunch of clean up. Change-Id: I58e300eaee4cee948203cc9d3e642ca9462d0d26
Diffstat (limited to 'l10ntools/source/propmerge.cxx')
-rw-r--r--l10ntools/source/propmerge.cxx40
1 files changed, 12 insertions, 28 deletions
diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx
index 8c2b97b6c67b..6f87a4efb7d4 100644
--- a/l10ntools/source/propmerge.cxx
+++ b/l10ntools/source/propmerge.cxx
@@ -19,19 +19,6 @@
namespace
{
- //Write out an sdf line
- static void lcl_WriteSDF(
- std::ofstream &aSDFStream, const OString& rText, const OString& rPrj,
- const OString& rActFileName, const OString& rID )
- {
- OString sOutput( rPrj ); sOutput += "\t";
- sOutput += rActFileName;
- sOutput += "\t0\tproperty\t";
- sOutput += rID; sOutput += "\t\t\t\t0\ten-US\t";
- sOutput += rText; sOutput += "\t\t\t\t";
- aSDFStream << sOutput.getStr() << std::endl;
- }
-
//Find ascii escaped unicode
static sal_Int32 lcl_IndexOfUnicode(
const OString& rSource, const sal_Int32 nFrom = 0 )
@@ -136,17 +123,15 @@ PropParser::~PropParser()
}
//Extract strings form source file
-void PropParser::Extract(
- const OString& rSDFFile, const OString& rPrj, const OString& rRoot )
+void PropParser::Extract( const OString& rPOFile )
{
assert( m_bIsInitialized );
- std::ofstream aSDFStream(
- rSDFFile.getStr(), std::ios_base::out | std::ios_base::trunc );
- if( !aSDFStream.is_open() )
+ PoOfstream aPOStream( rPOFile, PoOfstream::APP );
+ if( !aPOStream.isOpen() )
{
std::cerr
- << "Propex error: Cannot open sdffile for extract: "
- << rSDFFile.getStr() << std::endl;
+ << "Propex error: Cannot open pofile for extract: "
+ << rPOFile.getStr() << std::endl;
return;
}
@@ -156,17 +141,16 @@ void PropParser::Extract(
const sal_Int32 nEqualSign = sLine.indexOf('=');
if( nEqualSign != -1 )
{
- lcl_WriteSDF(
- aSDFStream,
- lcl_ConvertToUTF8( sLine.copy( nEqualSign + 1 ).trim() ),//Text
- rPrj,
- common::pathnameToken(
- m_sSource.getStr(), rRoot.getStr()), //FileName
- sLine.copy( 0, nEqualSign ).trim() ); //ID
+ OString sID = sLine.copy( 0, nEqualSign ).trim();
+ OString sText = lcl_ConvertToUTF8( sLine.copy( nEqualSign + 1 ).trim() );
+
+ Export::writePoEntry(
+ "Propex", aPOStream, m_sSource, "property",
+ sID, OString(), OString(), sText);
}
}
- aSDFStream.close();
+ aPOStream.close();
}
//Merge strings to source file