diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-23 16:59:33 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-23 16:59:33 +0100 |
commit | 932fb7b958f8e7204275cb709965b30e390c76ad (patch) | |
tree | 75f695663a97693416f8a84e140fa61805cf5bd2 /l10ntools | |
parent | bb54b94e5f48c4f6dce72f59dc6bc83f17d2c590 (diff) | |
parent | 78f80b020fe009bc48e9e5f8b7862de51f1f8381 (diff) |
Merge commit 'ooo/DEV300_m103'
Conflicts:
cppcanvas/source/mtfrenderer/implrenderer.cxx
dtrans/source/win32/dtobj/XTDataObject.cxx
dtrans/source/win32/dtobj/XTDataObject.hxx
sot/source/sdstor/stgio.cxx
tools/source/debug/debug.cxx
vcl/source/gdi/jobset.cxx
vcl/unx/kde4/KDEData.cxx
vcl/unx/kde4/KDEData.hxx
vcl/unx/kde4/KDESalDisplay.cxx
vcl/unx/kde4/KDESalFrame.cxx
vcl/unx/kde4/KDESalFrame.hxx
vcl/unx/kde4/KDESalGraphics.cxx
vcl/unx/kde4/KDESalGraphics.hxx
vcl/unx/kde4/KDESalInstance.cxx
vcl/unx/kde4/KDESalInstance.hxx
vcl/unx/kde4/KDEXLib.cxx
vcl/unx/kde4/VCLKDEApplication.cxx
vcl/unx/kde4/VCLKDEApplication.hxx
Diffstat (limited to 'l10ntools')
-rwxr-xr-x[-rw-r--r--] | l10ntools/source/help/HelpCompiler.hxx | 8 | ||||
-rw-r--r-- | l10ntools/source/help/HelpIndexerTool.java | 9 | ||||
-rwxr-xr-x[-rw-r--r--] | l10ntools/source/help/HelpLinker.cxx | 41 |
3 files changed, 51 insertions, 7 deletions
diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx index 03296d97db2f..8b063509a699 100644..100755 --- a/l10ntools/source/help/HelpCompiler.hxx +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -103,6 +103,14 @@ namespace fs HCDBG(std::cerr << "native_file_string is " << tmp.getStr() << std::endl); return std::string(tmp.getStr()); } +#ifdef WNT + wchar_t const * native_file_string_w() const + { + ::rtl::OUString ustrSystemPath; + osl::File::getSystemPathFromFileURL(data, ustrSystemPath); + return ustrSystemPath.getStr(); + } +#endif std::string native_directory_string() const { return native_file_string(); } std::string toUTF8() const { diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java index a39b5399e38d..c20d9f108ced 100644 --- a/l10ntools/source/help/HelpIndexerTool.java +++ b/l10ntools/source/help/HelpIndexerTool.java @@ -45,6 +45,15 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.Date; + +/** + When this tool is used with long path names on Windows, that is paths which start + with \\?\, then the caller must make sure that the path is unique. This is achieved + by removing '.' and '..' from the path. Paths which are created by + osl_getSystemPathFromFileURL fulfill this requirement. This is necessary because + lucene is patched to not use File.getCanonicalPath. See long_path.patch in the lucene + module. + */ public class HelpIndexerTool { public HelpIndexerTool() diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index 32de3cc5efeb..8dfb47303fd1 100644..100755 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -123,7 +123,13 @@ void IndexerPreProcessor::processDocument { fs::path fsCaptionPureTextFile_docURL = m_fsCaptionFilesDirName / aStdStr_EncodedDocPathURL; std::string aCaptionPureTextFileStr_docURL = fsCaptionPureTextFile_docURL.native_file_string(); - FILE* pFile_docURL = fopen( aCaptionPureTextFileStr_docURL.c_str(), "w" ); +#ifdef WNT //We need _wfopen to support long file paths on Windows XP + FILE* pFile_docURL = _wfopen( + fsCaptionPureTextFile_docURL.native_file_string_w(), L"w" ); +#else + FILE* pFile_docURL = fopen( + fsCaptionPureTextFile_docURL.native_file_string().c_str(), "w" ); +#endif if( pFile_docURL ) { fprintf( pFile_docURL, "%s\n", pResNodeCaption->content ); @@ -140,8 +146,13 @@ void IndexerPreProcessor::processDocument if( pResNodeContent ) { fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL; - std::string aContentPureTextFileStr_docURL = fsContentPureTextFile_docURL.native_file_string(); - FILE* pFile_docURL = fopen( aContentPureTextFileStr_docURL.c_str(), "w" ); +#ifdef WNT //We need _wfopen to support long file paths on Windows XP + FILE* pFile_docURL = _wfopen( + fsContentPureTextFile_docURL.native_file_string_w(), L"w" ); +#else + FILE* pFile_docURL = fopen( + fsContentPureTextFile_docURL.native_file_string().c_str(), "w" ); +#endif if( pFile_docURL ) { fprintf( pFile_docURL, "%s\n", pResNodeContent->content ); @@ -231,9 +242,13 @@ public: } } - void dump_DBHelp( const std::string& rFileName ) + void dump_DBHelp( const fs::path& rFileName ) { - FILE* pFile = fopen( rFileName.c_str(), "wb" ); +#ifdef WNT //We need _wfopen to support long file paths on Windows XP + FILE* pFile = _wfopen( rFileName.native_file_string_w(), L"wb" ); +#else + FILE* pFile = fopen( rFileName.native_file_string().c_str(), "wb" ); +#endif if( pFile == NULL ) return; @@ -422,9 +437,15 @@ void HelpLinker::link() throw( HelpProcessingException ) #endif fs::path helpTextFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".ht_" : ".ht"))); +#ifdef WNT + //We need _wfopen to support long file paths on Windows XP + FILE* pFileHelpText_DBHelp = _wfopen + ( helpTextFileName_DBHelp.native_file_string_w(), L"wb" ); +#else + FILE* pFileHelpText_DBHelp = fopen ( helpTextFileName_DBHelp.native_file_string().c_str(), "wb" ); - +#endif DB* dbBase(0); #ifndef DBHELP_ONLY fs::path dbBaseFileName(indexDirParentName / (mod + ".db")); @@ -434,8 +455,14 @@ void HelpLinker::link() throw( HelpProcessingException ) #endif fs::path dbBaseFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".db_" : ".db"))); +#ifdef WNT + //We need _wfopen to support long file paths on Windows XP + FILE* pFileDbBase_DBHelp = _wfopen + ( dbBaseFileName_DBHelp.native_file_string_w(), L"wb" ); +#else FILE* pFileDbBase_DBHelp = fopen ( dbBaseFileName_DBHelp.native_file_string().c_str(), "wb" ); +#endif #ifndef DBHELP_ONLY DB* keyWord(0); @@ -677,7 +704,7 @@ void HelpLinker::link() throw( HelpProcessingException ) if( pFileDbBase_DBHelp != NULL ) fclose( pFileDbBase_DBHelp ); - helpKeyword.dump_DBHelp( keyWordFileName_DBHelp.native_file_string() ); + helpKeyword.dump_DBHelp( keyWordFileName_DBHelp); if( !bExtensionMode ) { |