[Libreoffice-commits] .: l10ntools/source
l10ntools/source/helpmerge.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 249dea425a1b8660197af53ab8a56268fddf8ce6 Author: Andras Timar ati...@suse.com Date: Tue Feb 28 15:11:22 2012 +0100 Prevent crash of helpex.exe diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 4cbf8d5..a682bfb 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -244,7 +244,6 @@ bool HelpParser::Merge( //TODO: explicit BOM handling? XMLFile* xmlfile = aParser.Execute( sXmlFile, new XMLFile( rtl::OUString('0') ) ); -xmlfile-Extract(); if( xmlfile == NULL) { @@ -252,6 +251,7 @@ bool HelpParser::Merge( exit(-1); } +xmlfile-Extract(); rtl::OString sCur; for( unsigned int n = 0; n aLanguages.size(); n++ ){ ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/helpmerge.cxx |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit f24011374972992e1d5b5eca48597d00f3df3700 Author: Stephan Bergmann sberg...@redhat.com Date: Tue Feb 28 15:26:37 2012 +0100 Better error message diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index a682bfb..6dab36a 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -97,7 +97,12 @@ bool HelpParser::CreateSDF( if(file.get() == NULL) { -printf(%s\n, rtl::OUStringToOString(aParser.GetError().sMessage, RTL_TEXTENCODING_ASCII_US).getStr()); +printf( +%s: %s\n, +sHelpFile.getStr(), +(rtl::OUStringToOString( +aParser.GetError().sMessage, RTL_TEXTENCODING_ASCII_US). + getStr())); exit(-1); } file-Extract(); ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/localize.cxx | 203 ++ 1 file changed, 109 insertions(+), 94 deletions(-) New commits: commit ad549adecb7c68f0bd741c351e818af5e59f671e Author: Stephan Bergmann sberg...@redhat.com Date: Mon Feb 27 16:08:18 2012 +0100 Make localize follow clone/* instead of symlinks ...so that it works on Windows. diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 9e0cf0b..211b647 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -282,76 +282,6 @@ void handleFile( } } -bool includeDirectory(rtl::OUString const directory) { -// Cf. OUTPATH=* in configure.in: -static AsciiString const excluded[] = { -{ RTL_CONSTASCII_STRINGPARAM(unxaig) }, -{ RTL_CONSTASCII_STRINGPARAM(unxand) }, -{ RTL_CONSTASCII_STRINGPARAM(unxdfly) }, -{ RTL_CONSTASCII_STRINGPARAM(unxfbsd) }, -{ RTL_CONSTASCII_STRINGPARAM(unxios) }, -{ RTL_CONSTASCII_STRINGPARAM(unxkfg) }, -{ RTL_CONSTASCII_STRINGPARAM(unxlng) }, -{ RTL_CONSTASCII_STRINGPARAM(unxmac) }, -{ RTL_CONSTASCII_STRINGPARAM(unxnbsd) }, -{ RTL_CONSTASCII_STRINGPARAM(unxobsd) }, -{ RTL_CONSTASCII_STRINGPARAM(unxsog) }, -{ RTL_CONSTASCII_STRINGPARAM(unxsol) }, -{ RTL_CONSTASCII_STRINGPARAM(unxubt) }, -{ RTL_CONSTASCII_STRINGPARAM(wntmsc) } }; -for (std::size_t i = 0; i != SAL_N_ELEMENTS(excluded); ++i) { -if (directory.matchAsciiL(excluded[i].string, excluded[i].length)) { -return false; -} -} -return true; -} - -void handleDirectory( -rtl::OUString const project, rtl::OUString const projectRoot, -rtl::OUString const url) -{ -osl::Directory dir(url); -if (dir.open() != osl::FileBase::E_None) { -std::cerr Error: Cannot open directory: OUStringToOString(url, RTL_TEXTENCODING_ASCII_US).getStr() std::endl; -throw false; //TODO -} -for (;;) { -osl::DirectoryItem item; -osl::FileBase::RC e = dir.getNextItem(item); -if (e == osl::FileBase::E_NOENT) { -break; -} -if (e != osl::FileBase::E_None) { -std::cerr Error: Cannot read directory\n; -throw false; //TODO -} -osl::FileStatus stat( -osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileName -| osl_FileStatus_Mask_FileURL); -if (item.getFileStatus(stat) != osl::FileBase::E_None) { -std::cerr Error: Cannot get file status\n; -throw false; //TODO -} -if (stat.getFileType() == osl::FileStatus::Directory) { -if (includeDirectory(stat.getFileName())) { -rtl::OUString pr(projectRoot); -if (!pr.isEmpty()) { -pr += rtl::OUString('/'); -} -pr += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(..)); -handleDirectory(project, pr, stat.getFileURL()); -} -} else { -handleFile(project, projectRoot, stat.getFileURL()); -} -} -if (dir.close() != osl::FileBase::E_None) { -std::cerr Error: Cannot close directory\n; -throw false; //TODO -} -} - bool includeProject(rtl::OUString const project) { static char const * projects[] = { accessibility, @@ -409,28 +339,57 @@ bool includeProject(rtl::OUString const project) { return false; } -void handleProjects(char const * root) { -rtl::OUString root16; -if (!rtl_convertStringToUString( -root16.pData, root, rtl_str_getLength(root), -osl_getThreadTextEncoding(), -(RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR - | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR - | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) -{ -std::cerr Error: Cannot convert pathname to UTF-16\n; -throw false; //TODO -} -rtl::OUString rootUrl; -if (osl::FileBase::getFileURLFromSystemPath(root16, rootUrl) -!= osl::FileBase::E_None) -{ -std::cerr Error: Cannot convert pathname to URL\n; -throw false; //TODO +bool excludeDirectory(rtl::OUString const directory) { +// Cf. OUTPATH=* in configure.in: +static AsciiString const excluded[] = { +{ RTL_CONSTASCII_STRINGPARAM(unxaig) }, +{ RTL_CONSTASCII_STRINGPARAM(unxand) }, +{ RTL_CONSTASCII_STRINGPARAM(unxdfly) }, +{ RTL_CONSTASCII_STRINGPARAM(unxfbsd) }, +{ RTL_CONSTASCII_STRINGPARAM(unxios) }, +{ RTL_CONSTASCII_STRINGPARAM(unxkfg) }, +{ RTL_CONSTASCII_STRINGPARAM(unxlng) }, +{ RTL_CONSTASCII_STRINGPARAM(unxmac) }, +{ RTL_CONSTASCII_STRINGPARAM(unxnbsd) }, +{ RTL_CONSTASCII_STRINGPARAM(unxobsd) }, +{ RTL_CONSTASCII_STRINGPARAM(unxsog) }, +{ RTL_CONSTASCII_STRINGPARAM(unxsol) }, +{
[Libreoffice-commits] .: l10ntools/source solenv/inc
l10ntools/source/help/HelpLinker.cxx |2 +- solenv/inc/_tg_zip.mk| 30 ++ solenv/inc/rules.mk |2 +- solenv/inc/tg_help.mk| 16 +--- solenv/inc/tg_zip.mk |3 +-- 5 files changed, 18 insertions(+), 35 deletions(-) New commits: commit 995b2f887bd75283d2d395d9430cd0472f7356ae Author: Andras Timar ati...@suse.com Date: Fri Feb 24 16:43:03 2012 +0100 more silent output of non-verbose help build diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index eea87d5..0103f43 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -702,7 +702,7 @@ void HelpLinker::link() throw( HelpProcessingException ) fs::path fsAdditionalFileName( additionalFileName, fs::native ); std::string aNativeStr = fsAdditionalFileName.native_file_string(); const char* pStr = aNativeStr.c_str(); -std::cerr pStr; +HCDBG(std::cerr pStr std::endl); fs::path fsTargetName( indexDirParentName / additionalFileKey ); diff --git a/solenv/inc/_tg_zip.mk b/solenv/inc/_tg_zip.mk index 2dfe467..0f04434 100644 --- a/solenv/inc/_tg_zip.mk +++ b/solenv/inc/_tg_zip.mk @@ -47,7 +47,6 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP1TARGET).dpzz : $(ZIP1TARGETN) ZIP1HELPVAR=$(BIN)/$(ZIP1TARGET) $(ZIP1DEPFILE) : -@echo # $(MISC)/$(@:f) .IF $(ZIP1DIR) != $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP1DIR) $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP1DIR))) $(command_seperator) $(ZIPDEP) $(ZIP1FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP1DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP1EXT)/)) $(foreach,j,$(ZIP1LIST) {$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP1TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}) $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f) @@ -58,7 +57,7 @@ $(ZIP1DEPFILE) : $(ZIP1TARGETN) : delzip $(ZIP1DEPS) -@echo [ZIP] $(@:f) +@echo [ building ZIP ] $(@:f) @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) .IF $(ZIP1DIR) != @@-$(GNUCOPY) -p $@ $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT) @@ -124,7 +123,6 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP2TARGET).dpzz : $(ZIP2TARGETN) ZIP2HELPVAR=$(BIN)/$(ZIP2TARGET) $(ZIP2DEPFILE) : -@echo # $(MISC)/$(@:f) .IF $(ZIP2DIR) != $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP2DIR) $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP2DIR))) $(command_seperator) $(ZIPDEP) $(ZIP2FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP2DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP2EXT)/)) $(foreach,j,$(ZIP2LIST) {$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP2TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}) $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f) @@ -135,7 +133,7 @@ $(ZIP2DEPFILE) : $(ZIP2TARGETN) : delzip $(ZIP2DEPS) -@echo [ZIP] $(@:f) +@echo [ building ZIP ] $(@:f) @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) .IF $(ZIP2DIR) != @@-$(GNUCOPY) -p $@ $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT) @@ -201,7 +199,6 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP3TARGET).dpzz : $(ZIP3TARGETN) ZIP3HELPVAR=$(BIN)/$(ZIP3TARGET) $(ZIP3DEPFILE) : -@echo # $(MISC)/$(@:f) .IF $(ZIP3DIR) != $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP3DIR) $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP3DIR))) $(command_seperator) $(ZIPDEP) $(ZIP3FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP3DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP3EXT)/)) $(foreach,j,$(ZIP3LIST) {$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP3TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}) $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f) @@ -212,7 +209,7 @@ $(ZIP3DEPFILE) : $(ZIP3TARGETN) : delzip $(ZIP3DEPS) -@echo [ZIP] $(@:f) +@echo [ building ZIP ] $(@:f) @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) .IF $(ZIP3DIR) != @@-$(GNUCOPY) -p $@ $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT) @@ -278,7 +275,6 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP4TARGET).dpzz : $(ZIP4TARGETN) ZIP4HELPVAR=$(BIN)/$(ZIP4TARGET) $(ZIP4DEPFILE) : -@echo # $(MISC)/$(@:f) .IF $(ZIP4DIR) != $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP4DIR) $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP4DIR))) $(command_seperator) $(ZIPDEP) $(ZIP4FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP4DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP4EXT)/)) $(foreach,j,$(ZIP4LIST) {$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP4TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}) $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f) @@ -289,7 +285,7 @@ $(ZIP4DEPFILE) : $(ZIP4TARGETN) : delzip $(ZIP4DEPS) -@echo [ZIP] $(@:f) +@echo [ building ZIP ] $(@:f) @@$(!eq,$?,$(?:s/delzip/zzz/)
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/helpex.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit aee538eb752325846966eb440e424126e00531af Author: Andras Timar ati...@suse.com Date: Thu Feb 23 12:36:06 2012 +0100 do not print .\n to console diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx index d7cf212..cad9c55 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -242,7 +242,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { for( vectorrtl::OString::iterator pos = filelist.begin() ; pos != filelist.end() ; ++pos ) { sHelpFile = *pos; -std::cout .\n; HelpParser aParser( sHelpFile , bUTF8 , true ); hasNoError = aParser.Merge( sSDFFile , sOutputFileX , sOutputFileY , true , aLanguages , aMergeDataFile , bCreateDir ); ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source xmlhelp/source
l10ntools/source/help/HelpIndexerTool.java |5 - xmlhelp/source/com/sun/star/help/HelpSearch.java |5 - 2 files changed, 8 insertions(+), 2 deletions(-) New commits: commit 7636d37f8f9c53d694c4fe38581f3b495d53670e Author: Andras Timar ati...@suse.com Date: Fri Feb 17 21:43:31 2012 +0100 fdo#40665 use CJKAnalyzer for ko, zh-CN, and zh-TW, too diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java index d1d0873..8e42d55 100644 --- a/l10ntools/source/help/HelpIndexerTool.java +++ b/l10ntools/source/help/HelpIndexerTool.java @@ -185,7 +185,10 @@ public class HelpIndexerTool try { -Analyzer analyzer = aLanguageStr.equals(ja) ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer(); +Analyzer analyzer = ( aLanguageStr.equals(ja) +|| aLanguageStr.equals(ko) +|| aLanguageStr.equals(zh-CN) +|| aLanguageStr.equals(zh-TW) ) ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer(); IndexWriter writer = new IndexWriter( aIndexDir, analyzer, true ); int nRet = indexDocs( writer, aModule, bExtensionMode, aCaptionFilesDir, aContentFilesDir ); if( nRet != -1 ) diff --git a/xmlhelp/source/com/sun/star/help/HelpSearch.java b/xmlhelp/source/com/sun/star/help/HelpSearch.java index dc31514..03aadea 100755 --- a/xmlhelp/source/com/sun/star/help/HelpSearch.java +++ b/xmlhelp/source/com/sun/star/help/HelpSearch.java @@ -255,7 +255,10 @@ public class HelpSearch { IndexReader reader = IndexReader.open( aIndexStr ); Searcher searcher = new IndexSearcher( reader ); -Analyzer analyzer = aLanguageStr.equals(ja) ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer(); +Analyzer analyzer = ( aLanguageStr.equals(ja) +|| aLanguageStr.equals(ko) +|| aLanguageStr.equals(zh-CN) +|| aLanguageStr.equals(zh-TW) ) ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer(); String aField; if( bCaptionOnly ) ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/xmlparse.cxx | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) New commits: commit 80ba5e7aa6935ce1966a087992ae4d13bb90a05b Author: Caolán McNamara caol...@redhat.com Date: Thu Feb 9 09:08:30 2012 + convert system path to url otherwise seg faults in building nlpsolver diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index c21d9e5..f44b6f4 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -1123,12 +1123,20 @@ XMLFile *SimpleXMLParser::Execute( const rtl::OUString rFullFileName , const rt RTL_CONSTASCII_USTRINGPARAM(ERROR: Unable to open file )); aErrorInformation.sMessage += rFileName; +rtl::OUString aFileURL; +if (osl::File::getFileURLFromSystemPath(rFileName, aFileURL) +!= osl::File::E_None) +{ +return 0; +} + oslFileHandle h; -if (osl_openFile(rFileName.pData, h, osl_File_OpenFlag_Read) +if (osl_openFile(aFileURL.pData, h, osl_File_OpenFlag_Read) != osl_File_E_None) { return 0; } + sal_uInt64 s; oslFileError e = osl_getFileSize(h, s); void * p; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/common.hxx | 113 1 file changed, 113 insertions(+) New commits: commit 1d3124675ae5a33afe2c417a198557f20dc689e0 Author: Stephan Bergmann sberg...@redhat.com Date: Wed Feb 8 22:28:53 2012 +0100 New file was missing from previous commit diff --git a/l10ntools/source/common.hxx b/l10ntools/source/common.hxx new file mode 100644 index 000..89808f7 --- /dev/null +++ b/l10ntools/source/common.hxx @@ -0,0 +1,113 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the License); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * [ Copyright (C) 2012 Red Hat, Inc., Stephan Bergmann sberg...@redhat.com + * (initial developer) ] + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the GPLv3+), or + * the GNU Lesser General Public License Version 3 or later (the LGPLv3+), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef INCLUDED_L10NTOOLS_SOURCE_COMMON_HXX +#define INCLUDED_L10NTOOLS_SOURCE_COMMON_HXX + +#include sal/config.h + +#include cstdlib +#include iostream + +#include osl/file.hxx +#include osl/process.h +#include osl/thread.h +#include rtl/string.h +#include rtl/string.hxx +#include rtl/textcvt.h +#include rtl/uri.hxx +#include rtl/ustring.h +#include rtl/ustring.hxx + +namespace common { + +inline rtl::OString pathnameToken(char const * pathname, char const * root) { +rtl::OUString cwd; +if (osl_getProcessWorkingDir(cwd.pData) != osl_Process_E_None) { +std::cerr Error: Cannot determine cwd\n; +std::exit(EXIT_FAILURE); +} +rtl::OUString full; +if (!rtl_convertStringToUString( +full.pData, pathname, rtl_str_getLength(pathname), +osl_getThreadTextEncoding(), +(RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR + | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR + | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) +{ +std::cerr Error: Cannot convert input pathname to UTF-16\n; +std::exit(EXIT_FAILURE); +} +if (osl::FileBase::getAbsoluteFileURL(cwd, full, full) +!= osl::FileBase::E_None) +{ +std::cerr Error: Cannot convert input pathname to absolute URL\n; +std::exit(EXIT_FAILURE); +} +if (root == 0) { +std::cerr Error: No project root argument\n; +std::exit(EXIT_FAILURE); +} +rtl::OUString base; +if (!rtl_convertStringToUString( +base.pData, root, rtl_str_getLength(root), +osl_getThreadTextEncoding(), +(RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR + | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR + | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) +{ +std::cerr Error: Cannot convert project root to UTF-16\n; +std::exit(EXIT_FAILURE); +} +base = rtl::Uri::convertRelToAbs(full, base); +if (full.getLength() = base.getLength() || base.isEmpty() +|| base[base.getLength() - 1] != '/' +|| full[base.getLength() - 1] != '/') +{ +std::cerr Error: Cannot extract suffix from input pathname\n; +std::exit(EXIT_FAILURE); +} +full = full.copy(base.getLength()).replace('/', '\\'); +rtl::OString suffix; +if (!full.convertToString( +suffix, osl_getThreadTextEncoding(), +(RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR + | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) +{ +std::cerr Error: Cannot convert suffix from UTF-16\n; +std::exit(EXIT_FAILURE); +} +return suffix; +} + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/helpmerge.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit b20c766ff6f9af8925bf5dad4879f9065368a0b1 Author: Stephan Bergmann sberg...@redhat.com Date: Tue Feb 7 14:40:43 2012 +0100 Freed l10ntools from tools/string; Windows redux diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index ff1c7c7..431c60b 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -437,7 +437,7 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile aMergeDataFile #if defined(UNX) rc = rename( sTempFile.getStr() , sTargetFile.getStr() ); #else -rc = MoveFileEx( sTempFile.GetBuffer() , sTargetFile.GetBuffer(), MOVEFILE_REPLACE_EXISTING ); +rc = MoveFileEx( sTempFile.getStr() , sTargetFile.getStr(), MOVEFILE_REPLACE_EXISTING ); #endif FileStat aFS( aTar ); @@ -463,7 +463,7 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile aMergeDataFile #if defined(UNX) rc = rename( sTempFileCopy.getStr() , sTargetFile.getStr() ); #else -rc = MoveFileEx( sTempFileCopy.GetBuffer() , sTargetFile.GetBuffer() , MOVEFILE_REPLACE_EXISTING ); +rc = MoveFileEx( sTempFileCopy.getStr() , sTargetFile.getStr() , MOVEFILE_REPLACE_EXISTING ); #endif aFS.Update( aTar ); ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/lngex.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c1a3961b4582e47ebcee84b3acc2a808651bcd07 Author: Josh Heidenreich josh.sickm...@gmail.com Date: Mon Feb 6 13:01:02 2012 +1030 Single-line bugfix in l10n tools to fix compile on GCC 4.4.3 (Ubuntu) diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx index e921a74..73d7221 100644 --- a/l10ntools/source/lngex.cxx +++ b/l10ntools/source/lngex.cxx @@ -74,7 +74,7 @@ sal_Bool ParseCommandLine( int argc, char* argv[]) // parse command line for( int i = 1; i argc; i++ ) { -rtl::OString sSwitch(rtl::OString(argv[i]).toAsciiUpperCase()); +rtl::OString sSwitch = rtl::OString(argv[i]).toAsciiUpperCase(); if (sSwitch.equalsL(RTL_CONSTASCII_STRINGPARAM(-I))) nState = STATE_INPUT; // next tokens specifies source files else if (sSwitch.equalsL(RTL_CONSTASCII_STRINGPARAM(-O))) ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/helpex.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2994b7b983b6df38b9cc3c778728a1bd55a671c0 Author: Loiseleur Michel michel.loisel...@free.fr Date: Thu Jan 12 14:45:02 2012 +0100 fix build error in l10ntools On gcc-4.4.3, it fixes this error : l10ntools/source/helpex.cxx:82: error: parameter may not have variably modified type 'rtl::OString [(((long unsigned int)(((long int)i) + -0x1)) + 1)]' diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx index 2680c59..f06f618 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -79,7 +79,7 @@ sal_Bool ParseCommandLine( int argc, char* argv[]) // parse command line for( int i = 1; i argc; i++ ) { -rtl::OString aArg(rtl::OString(argv[i]).toAsciiUpperCase()); +rtl::OString aArg = rtl::OString(argv[i]).toAsciiUpperCase(); if (aArg.equalsL(RTL_CONSTASCII_STRINGPARAM(-I))) nState = STATE_INPUT; // next tokens specifies source files else if (aArg.equalsL(RTL_CONSTASCII_STRINGPARAM(-O))) ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/filter/merge/FCFGMerge.java |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) New commits: commit 869cf02e7cf20dc25a55b6d3898fc94c5c0ed2ed Author: Marcel Metz mm...@adrian-broher.net Date: Mon Jan 9 11:31:03 2012 + advertise license in help output diff --git a/l10ntools/source/filter/merge/FCFGMerge.java b/l10ntools/source/filter/merge/FCFGMerge.java index ca1959b..d35e641 100644 --- a/l10ntools/source/filter/merge/FCFGMerge.java +++ b/l10ntools/source/filter/merge/FCFGMerge.java @@ -100,9 +100,12 @@ public class FCFGMerge private static void printCopyright() { java.lang.StringBuffer sOut = new java.lang.StringBuffer(256); -sOut.append(FCFGMerge\n); -sOut.append(Copyright: 2003 by Sun Microsystems, Inc.\n); -sOut.append(All Rights Reserved.\n); +sOut.append(FCFGMerge (LibreOffice)\n\n); +sOut.append(Copyright (C) 2003 Sun Microsystems, Inc.\n); +sOut.append(Copyright (C) 2012 The Document Foundation\n); +sOut.append(License LGPLv3: GNU LGPL version 3 http://www.gnu.org/licenses/lgpl.html.\n); +sOut.append(This is free software: you are free to change and redistribute it.\n); +sOut.append(There is NO WARRANTY, to the extent permitted by law.\n); System.out.println(sOut.toString()); } ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/helpmerge.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 82558fc4ea28427857ea82232e8edc5c8d6daa6d Author: Andras Timar ati...@suse.com Date: Fri Jan 6 16:32:38 2012 +0100 remove a printf diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 47d1ddf..46bee59 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -260,7 +260,6 @@ bool HelpParser::Merge( const ByteString rSDFFile, const ByteString rDestinati DirEntry aFile( sXmlFile ); XMLFile* xmlfile = ( aParser.Execute( aFile.GetFull() , sOUHelpFile, new XMLFile( '0' ) ) ); -printf(Dest file %s\n,rDestinationFile.GetBuffer()); hasNoError = MergeSingleFile( xmlfile , aMergeDataFile , rLanguage , rDestinationFile ); delete xmlfile; if( !sUsedTempFile.EqualsIgnoreCaseAscii( ) ){ ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/help/HelpIndexerTool.java | 23 --- l10ntools/source/help/HelpLinker.cxx | 17 - l10ntools/source/xmlparse.cxx |2 -- 3 files changed, 42 deletions(-) New commits: commit 8f21e3b66c2a7b0e60aa3a610509a2170e21 Author: Andras Timar ati...@suse.com Date: Wed Jan 4 17:39:45 2012 +0100 help compiler: less verbose output to console diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java index c20d9f1..d1d0873 100644 --- a/l10ntools/source/help/HelpIndexerTool.java +++ b/l10ntools/source/help/HelpIndexerTool.java @@ -185,21 +185,11 @@ public class HelpIndexerTool try { -Date start = new Date(); Analyzer analyzer = aLanguageStr.equals(ja) ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer(); IndexWriter writer = new IndexWriter( aIndexDir, analyzer, true ); -if( !bExtensionMode ) -System.out.println( Lucene: Indexing to directory ' + aIndexDir + '... ); int nRet = indexDocs( writer, aModule, bExtensionMode, aCaptionFilesDir, aContentFilesDir ); if( nRet != -1 ) -{ -if( !bExtensionMode ) -{ -System.out.println(); -System.out.println( Optimizing ... ); -} writer.optimize(); -} writer.close(); boolean bCfsFileOk = true; @@ -229,8 +219,6 @@ public class HelpIndexerTool if( nRet == -1 ) deleteRecursively( aIndexDir ); -if( bCfsFileOk bSegmentFileOk ) -System.out.println( Zipping ... ); File aDirToZipFile = new File( aDirToZipStr ); createZipFile( aDirToZipFile, aTargetZipFileStr ); deleteRecursively( aDirToZipFile ); @@ -247,10 +235,6 @@ public class HelpIndexerTool System.out.println( segment file check failed, terminating... ); System.exit( -1 ); } - -Date end = new Date(); -if( !bExtensionMode ) -System.out.println(end.getTime() - start.getTime() + total milliseconds); } catch (IOException e) { @@ -288,8 +272,6 @@ public class HelpIndexerTool HashSet aContentFilesHashSet = new HashSet( aContentFilesList ); // Loop over caption files and find corresponding content file -if( !bExtensionMode ) -System.out.println( Indexing, adding files ); int nCaptionFilesLen = aCaptionFiles.length; for( int i = 0 ; i nCaptionFilesLen ; i++ ) { @@ -298,9 +280,6 @@ public class HelpIndexerTool File aContentFile = null; if( aContentFilesHashSet.contains( aCaptionFileStr ) ) aContentFile = new File( aContentFilesDir, aCaptionFileStr ); - -if( !bExtensionMode ) -System.out.print( . ); writer.addDocument( HelpFileDocument.Document( aModule, aCaptionFile, aContentFile ) ); } @@ -314,8 +293,6 @@ public class HelpIndexerTool // Not already handled in caption files loop File aCaptionFile = null; File aContentFile = new File( aContentFilesDir, aContentFileStr ); -if( !bExtensionMode ) -System.out.print( . ); writer.addDocument( HelpFileDocument.Document( aModule, aCaptionFile, aContentFile ) ); } } diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index b754991..bf237c0 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -483,22 +483,10 @@ void HelpLinker::link() throw( HelpProcessingException ) if ( (!bExtensionMode || bIndexForExtension) !helpFiles.empty()) initIndexerPreProcessor(); -if( !bExtensionMode ) -{ -std::cout Making outputFile.native_file_string() - from helpFiles.size() input files std::endl; -} - // here we start our loop over the hzip files. HashSet::iterator end = helpFiles.end(); for (HashSet::iterator iter = helpFiles.begin(); iter != end; ++iter) { -if( !bExtensionMode ) -{ -std::cout .; -std::cout.flush(); -} - // process one file // streamTable contains the streams in the hzip file StreamTable streamTable; @@ -671,8 +659,6 @@ void HelpLinker::link() throw( HelpProcessingException ) } } // while loop over hzip files ending -if( !bExtensionMode ) -std::cout std::endl; } // try catch( const HelpProcessingException ) @@ -1040,7 +1026,6 @@ void HelpLinker::main( std::vectorstd::string args, int main(int argc,
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/filter/merge/FCFGMerge.java |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit ba5edb14040a6b268aa3db3c216fc4505a32e219 Author: Marcel Metz mm...@adrian-brother.net Date: Fri Dec 23 11:27:30 2011 -0600 reduce noise from FCFGMerge tool diff --git a/l10ntools/source/filter/merge/FCFGMerge.java b/l10ntools/source/filter/merge/FCFGMerge.java index 2c2f35b..ca1959b 100644 --- a/l10ntools/source/filter/merge/FCFGMerge.java +++ b/l10ntools/source/filter/merge/FCFGMerge.java @@ -56,8 +56,6 @@ public class FCFGMerge public static void main(java.lang.String[] sCmdLine) { -FCFGMerge.printCopyright(); - // create log object in default mode WARNINGS // If a command line parameter indicates another // level - change it! @@ -77,6 +75,7 @@ public class FCFGMerge // help requested? if (aCfg.isHelp()) { +FCFGMerge.printCopyright(); FCFGMerge.printHelp(); System.exit(-1); } ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/helpex.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit c9bc4a04064f15906ab94cd6c0b175609f3a2ad2 Author: Stephan Bergmann sberg...@redhat.com Date: Wed Dec 21 21:22:31 2011 +0100 rtl::OString::copy with count too large raises assert. diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx index 1925285..2680c59 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -213,10 +213,10 @@ int _cdecl main( int argc, char *argv[] ) }else if ( sOutputFileX.getLength() sOutputFileY.getLength() hasInputList ) { // Merge multiple files ? if ( bMergeMode ){ -ifstream aFStream( sInputFile.copy( 1 , sInputFile.getLength() ).getStr() , ios::in ); +ifstream aFStream( sInputFile.copy( 1 ).getStr() , ios::in ); if( !aFStream ){ -cerr ERROR: - helpex - Can't open the file sInputFile.copy( 1 , sInputFile.getLength() ).getStr() \n; +cerr ERROR: - helpex - Can't open the file sInputFile.copy( 1 ).getStr() \n; exit(-1); } ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/lngmerge.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 60795da6a87f751e69eaf5f731c86d45a040a97e Author: Caolán McNamara caol...@redhat.com Date: Thu Dec 1 14:55:54 2011 + fix broken .ulf translations some loon ran a little amock (*cough*) diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index a641528..f07e13e 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -189,7 +189,7 @@ void LngParser::ReadLine( const ByteString sLine_in , ByteStringHashMap rText_ { rtl::OString sLang = getToken(sLine_in, 0, '='); sLang = comphelper::string::stripStart(sLang, ' '); - sLang = comphelper::string::stripStart(sLang, ' '); + sLang = comphelper::string::stripEnd(sLang, ' '); rtl::OString sText = getToken(getToken(sLine_in, 1, '\'), 0, '\'); if (!sLang.isEmpty()) rText_inout[ sLang ] = sText; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source nlpsolver/src
l10ntools/source/localize.cxx |1 + nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/description.xml |6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit a969d2aa5d38a501887d51995b817ed6f941c743 Author: Andras Timar ati...@suse.com Date: Mon Nov 28 20:39:39 2011 +0100 enable l10n of nlpsolver diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 4969ba9..41f55eb 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -135,6 +135,7 @@ const char *ModuleList[] = { helpcontent2, instsetoo_native, mysqlc, +nlpsolver, officecfg, padmin, readlicense_oo, diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/description.xml b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/description.xml index 45fdbd8..9289756 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/description.xml +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/description.xml @@ -4,13 +4,13 @@ version value=0.9/ identifier value=com.sun.star.comp.Calc.NLPSolver/ display-name -name lang=enSolver for Nonlinear Programming/name +name lang=en-USSolver for Nonlinear Programming/name /display-name publisher -name lang=en xlink:href=http://www.documentfoundation.org;The Document Foundation/name +name lang=en-US xlink:href=http://www.documentfoundation.org;The Document Foundation/name /publisher extension-description -src lang=en xlink:href=description-en-US.txt/ +src lang=en-US xlink:href=description-en-US.txt/ /extension-description dependencies OpenOffice.org-minimal-version xmlns:d=http://openoffice.org/extensions/description/2006; d:name=OpenOffice.org 3.0 value=3.0/ ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/cfgmerge.cxx |4 l10ntools/source/helpmerge.cxx |4 l10ntools/source/merge.cxx |4 3 files changed, 12 deletions(-) New commits: commit 881a93d3ab969454d52de1af95004ff3fbd5918f Author: Andras Timar ati...@suse.com Date: Tue Nov 8 10:47:07 2011 +0100 MERGE_SOURCE_LANGUAGES is never defined, removing ifdefs diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 1fc568e..437e309 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -763,10 +763,6 @@ void CfgMerge::WorkOnText( if ( Export::isAllowed( nLangIndex ) ( sContent != - ) ( sContent.Len())) { -#ifdef MERGE_SOURCE_LANGUAGES -if( nLangIndex.EqualsIgnoreCaseAscii(de) || nLangIndex.EqualsIgnoreCaseAscii(en-US) ) -rText = sContent; -#endif Export::QuotHTML( rText ); } } diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 9e744b2..214105c 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -550,11 +550,7 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const ByteString sCur , Re pEntrys = NULL; -#ifdef MERGE_SOURCE_LANGUAGES -if( true ){ // Merge en-US! -#else if( !sCur.EqualsIgnoreCaseAscii(en-US) ){ -#endif pXMLElement = (*aLangHM)[ en-US ]; if( pXMLElement == NULL ) { diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index d98f9ea..a42f058 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -222,11 +222,7 @@ MergeDataFile::MergeDataFile( const ByteString sTITLE = sLine.GetToken( 0, '\t', rIdx ); // 13 -#ifdef MERGE_SOURCE_LANGUAGES -if( true ) -#else if( !nLANG.EqualsIgnoreCaseAscii(en-US) ) -#endif { aLanguageSet.insert(nLANG); InsertEntry( sTYP, sGID, sLID, sPFO, nLANG, sTEXT, sQHTEXT, sTITLE, filename, bCaseSensitive ); ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/export.cxx |4 1 file changed, 4 deletions(-) New commits: commit 527f070dd5738f4647eb2b7f9e629b0107aad14d Author: Andras Timar ati...@suse.com Date: Tue Nov 8 11:10:05 2011 +0100 remove unused global variables diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 672a8cf..7a3355c 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -76,10 +76,6 @@ ByteString sFile; MergeDataFile *pMergeDataFile; FILE *pTempFile; - -ByteString sStrBuffer; -bool bMarcro = false; - extern C { // the whole interface to lexer is in this extern C section ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: l10ntools/source
l10ntools/source/xrmmerge.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit e1ef3ad57dfa59c3c97e811f76351f7982f77020 Author: Andras Timar ati...@suse.com Date: Fri Oct 28 15:52:42 2011 +0200 char array should be null terminated diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index e30a3e1..b158b35 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -532,15 +532,16 @@ void XRMResExport::WorkOnDesc( ByteString sDescFileName( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); sDescFileName.SearchAndReplaceAll( description.xml, ); sDescFileName += GetAttribute( rOpenTag, xlink:href ); -ifstream::pos_type size; +int size; char * memblock; ifstream file (sDescFileName.GetBuffer(), ios::in|ios::binary|ios::ate); if (file.is_open()) { -size = file.tellg(); -memblock = new char [size]; +size = static_castint(file.tellg()); +memblock = new char [size+1]; file.seekg (0, ios::beg); file.read (memblock, size); file.close(); +memblock[size] = '\0'; rText = ByteString(memblock); rText.SearchAndReplaceAll( \n, \\n ); delete[] memblock; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits