summaryrefslogtreecommitdiff
path: root/l10ntools/source
diff options
context:
space:
mode:
Diffstat (limited to 'l10ntools/source')
-rw-r--r--l10ntools/source/export2.cxx5
-rw-r--r--l10ntools/source/help/HelpLinker.cxx23
-rw-r--r--l10ntools/source/help/compilehelp.hxx1
-rw-r--r--l10ntools/source/localize.cxx2
-rw-r--r--l10ntools/source/merge.cxx3
-rw-r--r--l10ntools/source/xrmlex.l55
-rw-r--r--l10ntools/source/xrmmerge.cxx77
7 files changed, 83 insertions, 83 deletions
diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx
index 8a384b415b6f..fc8f823b7deb 100644
--- a/l10ntools/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -703,11 +703,6 @@ void Export::getRandomName( ByteString& sRandStr )
DirEntry Export::GetTempFile()
/*****************************************************************************/
{
-#if defined(WNT) || defined(OS2)
- String sTempDir( Export::GetEnv( "TEMP" ), RTL_TEXTENCODING_ASCII_US );
-#else
- String sTempDir( String::CreateFromAscii( "/tmp" ));
-#endif
rtl::OUString* sTempFilename = new rtl::OUString();
// Create a temp file
diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx
index 9eed9132a5ec..94139f89de1e 100644
--- a/l10ntools/source/help/HelpLinker.cxx
+++ b/l10ntools/source/help/HelpLinker.cxx
@@ -245,7 +245,11 @@ class HelpLinker
{
public:
void main(std::vector<std::string> &args,
- std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL )
+// std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL )
+ std::string* pExtensionPath = NULL,
+ std::string* pDestination = NULL,
+ const rtl::OUString* pOfficeHelpPath = NULL )
+
throw( HelpProcessingException );
HelpLinker()
@@ -269,6 +273,7 @@ private:
std::string lang;
std::string hid;
std::string extensionPath;
+ std::string extensionDestination;
bool bExtensionMode;
fs::path indexDirName;
Stringtable hidlistTranslation;
@@ -396,7 +401,8 @@ void HelpLinker::link() throw( HelpProcessingException )
if( bExtensionMode )
{
- indexDirParentName = sourceRoot;
+ //indexDirParentName = sourceRoot;
+ indexDirParentName = extensionDestination;
}
else
{
@@ -752,8 +758,9 @@ void HelpLinker::link() throw( HelpProcessingException )
void HelpLinker::main( std::vector<std::string> &args,
- std::string* pExtensionPath, const rtl::OUString* pOfficeHelpPath )
- throw( HelpProcessingException )
+ std::string* pExtensionPath, std::string* pDestination,
+ const rtl::OUString* pOfficeHelpPath )
+ throw( HelpProcessingException )
{
rtl::OUString aOfficeHelpPath;
@@ -764,7 +771,7 @@ void HelpLinker::main( std::vector<std::string> &args,
bExtensionMode = true;
extensionPath = *pExtensionPath;
sourceRoot = fs::path(extensionPath);
-
+ extensionDestination = *pDestination;
aOfficeHelpPath = *pOfficeHelpPath;
}
if (args.size() > 0 && args[0][0] == '@')
@@ -1069,6 +1076,7 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp
const rtl::OUString& aExtensionName,
const rtl::OUString& aExtensionLanguageRoot,
sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles,
+ const rtl::OUString& aDestination,
HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo
)
{
@@ -1102,13 +1110,16 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp
rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() );
const char* pExtensionPath = aOExtensionLanguageRoot.getStr();
std::string aStdStrExtensionPath = pExtensionPath;
+ rtl::OString aODestination = rtl::OUStringToOString(aDestination, fs::getThreadTextEncoding());
+ const char* pDestination = aODestination.getStr();
+ std::string aStdStrDestination = pDestination;
// Set error handler
xmlSetStructuredErrorFunc( NULL, (xmlStructuredErrorFunc)StructuredXMLErrorFunction );
try
{
HelpLinker* pHelpLinker = new HelpLinker();
- pHelpLinker->main( args, &aStdStrExtensionPath, &aOfficeHelpPath );
+ pHelpLinker->main( args, &aStdStrExtensionPath, &aStdStrDestination, &aOfficeHelpPath );
delete pHelpLinker;
}
catch( const HelpProcessingException& e )
diff --git a/l10ntools/source/help/compilehelp.hxx b/l10ntools/source/help/compilehelp.hxx
index 472b15231639..9c59083bf038 100644
--- a/l10ntools/source/help/compilehelp.hxx
+++ b/l10ntools/source/help/compilehelp.hxx
@@ -72,6 +72,7 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp
const rtl::OUString& aExtensionName,
const rtl::OUString& aExtensionLanguageRoot,
sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles,
+ const rtl::OUString& aDestination,
HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo
);
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index 1d1428ff2dc0..6cecb0972cb7 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -66,7 +66,7 @@ const char *ExeTable[][5] = {
{ "xcs", "cfgex", "-UTF8 -e -f", "negative", "iso" },
{ "xrm", "xrmex", "-UTF8 -e", "negative", "iso" },
{ "xhp", "helpex", " -e", "negative", "noiso" },
- //{ "properties", "jpropex", " -e", "negative", "noiso" },
+ { "properties", "jpropex", " -e", "negative", "noiso" },
{ "NULL", "NULL", "NULL", "NULL", "NULL" }
};
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index e15a5c8a28fa..eb68215c791e 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -351,7 +351,7 @@ MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive
sLID = pResData->sId;
pResData->sGId = sGID;
pResData->sId = sLID;
-
+ //printf("MergeData:: Search gid=%s lid=%s filename=%s \n", pResData->sGId.GetBuffer(),pResData->sId.GetBuffer(),pResData->sFilename.GetBuffer() );
ByteString sKey = CreateKey( pResData->sResTyp , pResData->sGId , pResData->sId , pResData->sFilename , bCaseSensitive );
//printf("DBG: Searching [%s]\n",sKey.GetBuffer());
@@ -361,6 +361,7 @@ MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive
//printf("DBG: Found[%s]\n",sKey.GetBuffer());
return aMap[ sKey ];
}
+ //Dump();
pResData->sGId = sOldG;
pResData->sId = sOldL;
//printf("DBG: Found[%s]\n",sKey.GetBuffer());
diff --git a/l10ntools/source/xrmlex.l b/l10ntools/source/xrmlex.l
index c28aede4c6c1..4770a851c741 100644
--- a/l10ntools/source/xrmlex.l
+++ b/l10ntools/source/xrmlex.l
@@ -55,54 +55,55 @@ int bText=0;
%%
-"<Readme"[^\>]*\> {
- WorkOnTokenSet( XRM_README_START, yytext );
+"<p "[^\>]*xml:lang[^\>]*\> {
+ WorkOnTokenSet( XRM_TEXT_START , yytext );
}
-"</Readme>" {
- WorkOnTokenSet( XRM_README_END, yytext );
+"</p>" {
+ WorkOnTokenSet( XRM_TEXT_END, yytext );
}
-"<apochelp"[^\>]*\> {
- WorkOnTokenSet( XRM_README_START, yytext );
+"<h1 "[^\>]*xml:lang[^\>]*\> {
+ WorkOnTokenSet( XRM_TEXT_START , yytext );
}
-"</apochelp>" {
- WorkOnTokenSet( XRM_README_END, yytext );
+"</h1>" {
+ WorkOnTokenSet( XRM_TEXT_END, yytext );
}
-
-"<Section"[^\>]*\> {
- WorkOnTokenSet( XRM_SECTION_START, yytext );
+"<h2 "[^\>]*xml:lang[^\>]*\> {
+ WorkOnTokenSet( XRM_TEXT_START , yytext );
}
-"</Section>" {
- WorkOnTokenSet( XRM_SECTION_END, yytext );
+"</h2>" {
+ WorkOnTokenSet( XRM_TEXT_END, yytext );
}
-
-"<Paragraph"[^\>]*\> {
- WorkOnTokenSet( XRM_PARAGRAPH_START, yytext );
+"<h3 "[^\>]*xml:lang[^\>]*\> {
+ WorkOnTokenSet( XRM_TEXT_START , yytext );
}
-"</Paragraph>" {
- WorkOnTokenSet( XRM_PARAGRAPH_END, yytext );
+"</h3>" {
+ WorkOnTokenSet( XRM_TEXT_END, yytext );
}
-
-"<Text"[^\>]*\> {
- WorkOnTokenSet( XRM_TEXT_START, yytext );
+"<h4 "[^\>]*xml:lang[^\>]*\> {
+ WorkOnTokenSet( XRM_TEXT_START , yytext );
}
-"</Text>" {
+"</h4>" {
WorkOnTokenSet( XRM_TEXT_END, yytext );
}
-
-"<List"[^\>]*\> {
- WorkOnTokenSet( XRM_LIST_START, yytext );
+"<h5 "[^\>]*xml:lang[^\>]*\> {
+ WorkOnTokenSet( XRM_TEXT_START , yytext );
}
-"</List>" {
- WorkOnTokenSet( XRM_LIST_END, yytext );
+"</h5>" {
+ WorkOnTokenSet( XRM_TEXT_END, yytext );
}
+
+
+
+
+
"<!--" {
char c1 = 0, c2 = 0, c3 = input();
char pChar[2];
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index 149fd560fe3b..b77f75ea04e5 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -268,7 +268,7 @@ extern FILE *GetXrmFile()
int WorkOnTokenSet( int nTyp, char *pTokenText )
/*****************************************************************************/
{
-// printf("Typ = %d , text = '%s'\n",nTyp , pTokenText );
+ //printf("Typ = %d , text = '%s'\n",nTyp , pTokenText );
pParser->Execute( nTyp, pTokenText );
return 1;
@@ -346,10 +346,10 @@ int XRMResParser::Execute( int nToken, char * pToken )
sLID = "";
sGID += ".";
sGID += GetAttribute( rToken, "id" );
- if ( GetAttribute( rToken, "localized" ) == "false" )
+// if ( GetAttribute( rToken, "localized" ) == "false" )
// sLocalized += "0";
- sLocalized = false;
- else
+// sLocalized = false;
+// else
// sLocalized += "1";
sLocalized = true;
break;
@@ -368,47 +368,32 @@ int XRMResParser::Execute( int nToken, char * pToken )
}
break;
- case XRM_TEXT_START:
-// if ( sLocalized.GetChar( sLocalized.Len() - 1 ) == '1' ) {
- if ( sLocalized ) {
-
+ case XRM_TEXT_START:{
+ //printf("->XRM_TEXT_START\n");
ByteString sNewLID = GetAttribute( rToken, "id" );
if ( sNewLID != sLID ) {
- EndOfText( sCurrentOpenTag, sCurrentCloseTag );
+ //EndOfText( sCurrentOpenTag, sCurrentCloseTag );
sLID = sNewLID;
}
bText = TRUE;
sCurrentText = "";
sCurrentOpenTag = rToken;
Output( rToken );
+ //printf("<-XRM_TEXT_START\n");
}
break;
case XRM_TEXT_END: {
-// if ( sLocalized.GetChar( sLocalized.Len() - 1 ) == '1' ) {
- if( sLocalized ){
sCurrentCloseTag = rToken;
-
+ //printf("->XRM_TEXT_END\n");
ByteString sLang = GetAttribute( sCurrentOpenTag, "xml:lang" );
- if( sLang.EqualsIgnoreCaseAscii("de") ){
- ULONG nLen = 0;
- while ( sCurrentText.Len() != nLen )
- {
- nLen = sCurrentText.Len();
- sCurrentText.SearchAndReplaceAll( "\n\t", "\n" );
- sCurrentText.SearchAndReplaceAll( "\n ", "\n" );
- }
- sCurrentText.SearchAndReplaceAll( "\n", " " );
- sCurrentCloseTag = rToken;
- }
WorkOnText( sCurrentOpenTag, sCurrentText );
Output( sCurrentText );
-
- //fprintf( stdout, "%s %s\n", sGID.GetBuffer(), sLID.GetBuffer());
- //fprintf( stdout, "%s\n\n", sCurrentText.GetBuffer());
-
+ EndOfText( sCurrentOpenTag, sCurrentCloseTag );// <---
bText = FALSE;
- }
+ rToken = ByteString("");
+ sCurrentText = ByteString("");
+ //printf("<-XRM_TEXT_END");
}
break;
@@ -429,8 +414,9 @@ int XRMResParser::Execute( int nToken, char * pToken )
}
if ( !bText )
+ {
Output( rToken );
-
+ }
return 0;
}
@@ -598,15 +584,19 @@ void XRMResExport::EndOfText(
sCur = aLanguages[ n ];
ByteString sAct = pResData->sText[ sCur ];
- Export::UnquotHTML( sAct );
+ //Export::UnquotHTML( sAct );
sAct.EraseAllChars( 0x0A );
ByteString sOutput( sPrj ); sOutput += "\t";
sOutput += sPath;
sOutput += "\t0\t";
sOutput += "readmeitem\t";
- sOutput += pResData->sGId; sOutput += "\t";
- sOutput += pResData->sId; sOutput += "\t\t\t0\t";
+ sOutput += pResData->sId;
+ // USE LID AS GID OR MERGE DON'T WORK
+ //sOutput += pResData->sGId;
+ sOutput += "\t";
+ sOutput += pResData->sId;
+ sOutput += "\t\t\t0\t";
sOutput += sCur;
sOutput += "\t";
@@ -615,7 +605,8 @@ void XRMResExport::EndOfText(
sOutput.SearchAndReplaceAll( sSearch, "_" );
//if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sPrj ) ) )
- pOutputStream->WriteLine( sOutput );
+ if( sAct.Len() > 1 )
+ pOutputStream->WriteLine( sOutput );
}
}
delete pResData;
@@ -666,12 +657,14 @@ void XRMResMerge::WorkOnText(
if ( pMergeDataFile ) {
if ( !pResData ) {
ByteString sPlatform( "" );
- pResData = new ResData( sPlatform, GetGID() , sFilename );
+// pResData = new ResData( sPlatform, GetGID() , sFilename );
+ pResData = new ResData( sPlatform, GetLID() , sFilename );
pResData->sId = GetLID();
+
pResData->sResTyp = "readmeitem";
}
- PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData );
+ PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData );
if ( pEntrys ) {
ByteString sContent;
if ( Export::isAllowed( sLang ) &&
@@ -682,7 +675,7 @@ void XRMResMerge::WorkOnText(
{
rText = sContent;
ConvertStringToXMLFormat( rText );
- Export::QuotHTMLXRM( rText );
+ //Export::QuotHTMLXRM( rText );
}
}
}
@@ -692,7 +685,8 @@ void XRMResMerge::WorkOnText(
void XRMResMerge::Output( const ByteString& rOutput )
/*****************************************************************************/
{
- if ( pOutputStream )
+ //printf("W: %s\n",rOutput.GetBuffer());
+ if ( pOutputStream && rOutput.Len() > 0 )
pOutputStream->Write( rOutput.GetBuffer(), rOutput.Len());
}
@@ -703,6 +697,8 @@ void XRMResMerge::EndOfText(
)
/*****************************************************************************/
{
+
+ Output( rCloseTag );
if ( pMergeDataFile && pResData ) {
PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData );
if ( pEntrys ) {
@@ -710,18 +706,13 @@ void XRMResMerge::EndOfText(
for( unsigned int n = 0; n < aLanguages.size(); n++ ){
sCur = aLanguages[ n ];
ByteString sContent;
-//<<<<<<< xrmmerge.cxx
if ( !sCur.EqualsIgnoreCaseAscii("en-US") &&
- // ( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && Export::isMergingGermanAllowed( sPrj ) )) &&
-//=======
-// if ( Export::isAllowed( sCur ) &&
-//>>>>>>> 1.17
( pEntrys->GetText(
sContent, STRING_TYP_TEXT, sCur, TRUE )) &&
( sContent != "-" ) && ( sContent.Len()))
{
ByteString sText( sContent );
- Export::QuotHTMLXRM( sText );
+ //Export::QuotHTMLXRM( sText );
ByteString sAdditionalLine( "\t" );
sAdditionalLine += rOpenTag;