diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-06-04 08:48:45 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-06-04 08:48:45 +0000 |
commit | 260a3275f1df63e74ef6309384b06b86100576ed (patch) | |
tree | dc62bdd3c1d483d64a3d551d4c95adb2f62e737f /transex3 | |
parent | 0847c5c212d126a9f0ccf265e5610ec5f81fa07b (diff) |
INTEGRATION: CWS l10nfix26 (1.22.8); FILE MERGED
2008/05/26 16:13:44 ihi 1.22.8.1: #158069# Write full file path in error message
Diffstat (limited to 'transex3')
-rw-r--r-- | transex3/source/helpmerge.cxx | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/transex3/source/helpmerge.cxx b/transex3/source/helpmerge.cxx index e7ced47fbcd0..e2e81cca1628 100644 --- a/transex3/source/helpmerge.cxx +++ b/transex3/source/helpmerge.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: helpmerge.cxx,v $ - * $Revision: 1.22 $ + * $Revision: 1.23 $ * * This file is part of OpenOffice.org. * @@ -148,8 +148,18 @@ bool HelpParser::CreateSDF( sXmlFile = String( sHelpFile , RTL_TEXTENCODING_ASCII_US ); } +// ByteString fullFilePath; + //DirEntry aFile( sXmlFile ); + //makeAbsolutePath( sHelpFile , rRoot_in); + ByteString fullFilePath = rPrj_in; + fullFilePath.Append( "\\" ); + fullFilePath.Append( makeAbsolutePath( sHelpFile , rRoot_in ) ); + fullFilePath.SearchAndReplaceAll( "\\", "/" ); - std::auto_ptr <XMLFile> file ( aParser.Execute( sXmlFile, pXmlFile ) ); + String strFullPath( fullFilePath.GetBuffer() , RTL_TEXTENCODING_ASCII_US ); + + //printf( "%s\n", fullFilePath.GetBuffer() ); + std::auto_ptr <XMLFile> file ( aParser.Execute( strFullPath , sXmlFile, pXmlFile ) ); if(file.get() == NULL){ printf("%s\n",ByteString(aParser.GetError().sMessage,RTL_TEXTENCODING_ASCII_US).GetBuffer()); @@ -168,7 +178,9 @@ bool HelpParser::CreateSDF( return false; } - DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); + ByteString sActFileName = makeAbsolutePath( sHelpFile , rRoot_in ); + +/* DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); aEntry.ToAbs(); String sFullEntry = aEntry.GetFull(); aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); @@ -178,7 +190,7 @@ bool HelpParser::CreateSDF( sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); sActFileName.SearchAndReplaceAll( "/", "\\" ); - +*/ XMLHashMap* aXMLStrHM = file->GetStrings(); LangHashMap* pElem; XMLElement* pXMLElement = NULL; @@ -261,6 +273,20 @@ bool HelpParser::CreateSDF( return TRUE; } +ByteString HelpParser::makeAbsolutePath( const ByteString& sHelpFile , const ByteString& rRoot_in ) +{ + DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); + aEntry.ToAbs(); + String sFullEntry = aEntry.GetFull(); + aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); + aEntry += DirEntry( rRoot_in ); + ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding()); + ByteString sActFileName( + sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); + + sActFileName.SearchAndReplaceAll( "/", "\\" ); + return sActFileName; +} bool HelpParser::Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , ByteString& sLanguage , MergeDataFile& aMergeDataFile ) { @@ -287,8 +313,10 @@ bool HelpParser::Merge( const ByteString &rSDFFile, const ByteString &rDestinati } OUString sOUHelpFile( sXmlFile ); + String fullFilePath; + DirEntry aFile( sXmlFile ); - XMLFile* xmlfile = ( aParser.Execute( sOUHelpFile, new XMLFile( '0' ) ) ); + XMLFile* xmlfile = ( aParser.Execute( aFile.GetFull() , sOUHelpFile, new XMLFile( '0' ) ) ); printf("Dest file %s\n",rDestinationFile.GetBuffer()); hasNoError = MergeSingleFile( xmlfile , aMergeDataFile , sLanguage , rDestinationFile ); delete xmlfile; @@ -370,7 +398,10 @@ bool HelpParser::Merge( OUString sOUHelpFile( sXmlFile ); - XMLFile* xmlfile = ( aParser.Execute( sOUHelpFile, new XMLFile( '0' ) ) ); + String fullFilePath; + DirEntry aFile( sXmlFile ); + + XMLFile* xmlfile = ( aParser.Execute( aFile.GetFull() , sOUHelpFile, new XMLFile( '0' ) ) ); xmlfile->Extract(); if( xmlfile == NULL) |