diff options
Diffstat (limited to 'l10ntools/source')
-rw-r--r-- | l10ntools/source/cfgmerge.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/export.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/export2.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/gsiconv.cxx | 372 | ||||
-rw-r--r-- | l10ntools/source/helpmerge.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/lngmerge.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/localize.cxx | 6 | ||||
-rw-r--r-- | l10ntools/source/makefile.mk | 22 | ||||
-rw-r--r-- | l10ntools/source/merge.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/utf8conv.cxx | 77 | ||||
-rw-r--r-- | l10ntools/source/xgfconv.cxx | 68 | ||||
-rw-r--r-- | l10ntools/source/xrmmerge.cxx | 1 |
12 files changed, 6 insertions, 546 deletions
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 5a007c175216..c4f24edeb487 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -36,7 +36,6 @@ #include "export.hxx" #include "cfgmerge.hxx" #include "tokens.h" -#include "utf8conv.hxx" extern "C" { int yyerror( char * ); } extern "C" { int YYWarning( char * ); } diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 39b9a2579c8a..69f1e967b13c 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -33,7 +33,6 @@ #include <tools/fsys.hxx> #include "export.hxx" #include "tokens.h" -#include "utf8conv.hxx" #include <iostream> #include <vector> diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx index 6e6a6d118323..587f289115a5 100644 --- a/l10ntools/source/export2.cxx +++ b/l10ntools/source/export2.cxx @@ -29,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_l10ntools.hxx" #include "export.hxx" -#include "utf8conv.hxx" #include <tools/datetime.hxx> #include <tools/isofallback.hxx> #include <stdio.h> diff --git a/l10ntools/source/gsiconv.cxx b/l10ntools/source/gsiconv.cxx deleted file mode 100644 index 06d203d1fb21..000000000000 --- a/l10ntools/source/gsiconv.cxx +++ /dev/null @@ -1,372 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_l10ntools.hxx" -#include <stdio.h> -#include <tools/fsys.hxx> -#include <tools/stream.hxx> - -// local includes -#include "utf8conv.hxx" - -#define GSI_FILE_UNKNOWN 0x0000 -#define GSI_FILE_OLDSTYLE 0x0001 -#define GSI_FILE_L10NFRAMEWORK 0x0002 - -/*****************************************************************************/ -sal_uInt16 GetGSIFileType( SvStream &rStream ) -/*****************************************************************************/ -{ - sal_uInt16 nFileType = GSI_FILE_UNKNOWN; - - sal_uLong nPos( rStream.Tell()); - rStream.Seek( STREAM_SEEK_TO_BEGIN ); - - ByteString sLine; - while( !rStream.IsEof() && !sLine.Len()) - rStream.ReadLine( sLine ); - - if( sLine.Len()) { - if( sLine.Search( "($$)" ) != STRING_NOTFOUND ) - nFileType = GSI_FILE_OLDSTYLE; - else - nFileType = GSI_FILE_L10NFRAMEWORK; - } - - rStream.Seek( nPos ); - - return nFileType; -} - -/*****************************************************************************/ -ByteString GetGSILineId( const ByteString &rLine, sal_uInt16 nFileType ) -/*****************************************************************************/ -{ - ByteString sId; - switch ( nFileType ) { - case GSI_FILE_OLDSTYLE: - sId = rLine; - sId.SearchAndReplaceAll( "($$)", "\t" ); - sId = sId.GetToken( 0, '\t' ); - break; - - case GSI_FILE_L10NFRAMEWORK: - sId = rLine.GetToken( 0, '\t' ); - sId += "\t"; - sId += rLine.GetToken( 1, '\t' ); - sId += "\t"; - sId += rLine.GetToken( 4, '\t' ); - sId += "\t"; - sId += rLine.GetToken( 5, '\t' ); - break; - } - return sId; -} - -/*****************************************************************************/ -ByteString GetGSILineLangId( const ByteString &rLine, sal_uInt16 nFileType ) -/*****************************************************************************/ -{ - ByteString sLangId; - switch ( nFileType ) { - case GSI_FILE_OLDSTYLE: - sLangId = rLine; - sLangId.SearchAndReplaceAll( "($$)", "\t" ); - sLangId = sLangId.GetToken( 2, '\t' ); - break; - - case GSI_FILE_L10NFRAMEWORK: - sLangId = rLine.GetToken( 9, '\t' ); - break; - } - return sLangId; -} - -/*****************************************************************************/ -void ConvertGSILine( sal_Bool bToUTF8, ByteString &rLine, - rtl_TextEncoding nEncoding, sal_uInt16 nFileType ) -/*****************************************************************************/ -{ - switch ( nFileType ) { - case GSI_FILE_OLDSTYLE: - if ( bToUTF8 ) - rLine = UTF8Converter::ConvertToUTF8( rLine, nEncoding ); - else - rLine = UTF8Converter::ConvertFromUTF8( rLine, nEncoding ); - break; - - case GSI_FILE_L10NFRAMEWORK: { - ByteString sConverted; - for ( sal_uInt16 i = 0; i < rLine.GetTokenCount( '\t' ); i++ ) { - ByteString sToken = rLine.GetToken( i, '\t' ); - if (( i > 9 ) && ( i < 14 )) { - if( bToUTF8 ) - sToken = UTF8Converter::ConvertToUTF8( sToken, nEncoding ); - else - sToken = UTF8Converter::ConvertFromUTF8( sToken, nEncoding ); - } - if ( i ) - sConverted += "\t"; - sConverted += sToken; - } - rLine = sConverted; - } - break; - } -} - -/*****************************************************************************/ -void Help() -/*****************************************************************************/ -{ - fprintf( stdout, "\n" ); - fprintf( stdout, "gsiconv (c)1999 by StarOffice Entwicklungs GmbH\n" ); - fprintf( stdout, "===============================================\n" ); - fprintf( stdout, "\n" ); - fprintf( stdout, "gsiconv converts strings in GSI-Files (Gutschmitt Interface) from or to UTF-8\n" ); - fprintf( stdout, "\n" ); - fprintf( stdout, "Syntax: gsiconv (-t|-f langid charset)|(-p n) filename\n" ); - fprintf( stdout, "Switches: -t => conversion from charset to UTF-8\n" ); - fprintf( stdout, " -f => conversion from UTF-8 to charset\n" ); - fprintf( stdout, " -p n => creates several files with ca. n lines\n" ); - fprintf( stdout, "\n" ); - fprintf( stdout, "Allowed charsets:\n" ); - fprintf( stdout, " MS_932 => Japanese\n" ); - fprintf( stdout, " MS_936 => Chinese Simplified\n" ); - fprintf( stdout, " MS_949 => Korean\n" ); - fprintf( stdout, " MS_950 => Chinese Traditional\n" ); - fprintf( stdout, " MS_1250 => East Europe\n" ); - fprintf( stdout, " MS_1251 => Cyrillic\n" ); - fprintf( stdout, " MS_1252 => West Europe\n" ); - fprintf( stdout, " MS_1253 => Greek\n" ); - fprintf( stdout, " MS_1254 => Turkish\n" ); - fprintf( stdout, " MS_1255 => Hebrew\n" ); - fprintf( stdout, " MS_1256 => Arabic\n" ); - fprintf( stdout, "\n" ); - fprintf( stdout, "Allowed langids:\n" ); - fprintf( stdout, " 1 => ENGLISH_US\n" ); - fprintf( stdout, " 3 => PORTUGUESE \n" ); - fprintf( stdout, " 4 => GERMAN_DE (new german style)\n" ); - fprintf( stdout, " 7 => RUSSIAN\n" ); - fprintf( stdout, " 30 => GREEK\n" ); - fprintf( stdout, " 31 => DUTCH\n" ); - fprintf( stdout, " 33 => FRENCH\n" ); - fprintf( stdout, " 34 => SPANISH\n" ); - fprintf( stdout, " 35 => FINNISH\n" ); - fprintf( stdout, " 36 => HUNGARIAN\n" ); - fprintf( stdout, " 39 => ITALIAN\n" ); - fprintf( stdout, " 42 => CZECH\n" ); - fprintf( stdout, " 44 => ENGLISH (UK)\n" ); - fprintf( stdout, " 45 => DANISH\n" ); - fprintf( stdout, " 46 => SWEDISH\n" ); - fprintf( stdout, " 47 => NORWEGIAN\n" ); - fprintf( stdout, " 49 => GERMAN (old german style)\n" ); - fprintf( stdout, " 55 => PORTUGUESE_BRAZILIAN\n" ); - fprintf( stdout, " 81 => JAPANESE\n" ); - fprintf( stdout, " 82 => KOREAN\n" ); - fprintf( stdout, " 86 => CHINESE_SIMPLIFIED\n" ); - fprintf( stdout, " 88 => CHINESE_TRADITIONAL\n" ); - fprintf( stdout, " 90 => TURKISH\n" ); - fprintf( stdout, " 96 => ARABIC\n" ); - fprintf( stdout, " 97 => HEBREW\n" ); - fprintf( stdout, "\n" ); -} - -/*****************************************************************************/ -#if defined(UNX) -int main( int argc, char *argv[] ) -#else -int _cdecl main( int argc, char *argv[] ) -#endif -/*****************************************************************************/ -{ - if (( argc != 5 ) && ( argc != 4 )) { - Help(); - exit ( 0 ); - } - - if ( argc == 4 ) { - if ( ByteString( argv[ 1 ] ) == "-p" ) { - - DirEntry aSource = DirEntry( String( argv[ 3 ], RTL_TEXTENCODING_ASCII_US )); - if ( !aSource.Exists()) { - fprintf( stderr, "\nERROR: GSI-File %s not found!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); - exit ( 2 ); - } - - DirEntry aOutput( aSource ); - - String sBase = aOutput.GetBase(); - String sExt = aOutput.GetExtension(); - - String sGSI( argv[ 3 ], RTL_TEXTENCODING_ASCII_US ); - SvFileStream aGSI( sGSI, STREAM_STD_READ ); - if ( !aGSI.IsOpen()) { - fprintf( stderr, "\nERROR: Could not open GSI-File %s!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); - exit ( 3 ); - } - - sal_uInt16 nFileType( GetGSIFileType( aGSI )); - - sal_uLong nMaxLines = (sal_uLong) ByteString( argv[ 2 ] ).ToInt64(); - if ( !nMaxLines ) { - fprintf( stderr, "\nERROR: Linecount must be at least 1!\n\n" ); - exit ( 3 ); - } - - ByteString sGSILine; - ByteString sOldId; - sal_uLong nLine = 0; - sal_uLong nOutputFile = 1; - - String sOutput( sBase ); - sOutput += String( "_", RTL_TEXTENCODING_ASCII_US ); - sOutput += String::CreateFromInt64( nOutputFile ); - if ( sExt.Len()) { - sOutput += String( ".", RTL_TEXTENCODING_ASCII_US ); - sOutput += sExt; - } - nOutputFile ++; - - aOutput.SetName( sOutput ); - SvFileStream aOutputStream( aOutput.GetFull(), STREAM_STD_WRITE | STREAM_TRUNC ); - - while ( !aGSI.IsEof()) { - - aGSI.ReadLine( sGSILine ); - ByteString sId( GetGSILineId( sGSILine, nFileType )); - - nLine++; - - if (( nLine >= nMaxLines ) && ( sId != sOldId )) { - aOutputStream.Close(); - - ByteString sText( aOutput.GetFull(), gsl_getSystemTextEncoding()); - sText += " with "; - sText += ByteString::CreateFromInt64( nLine ); - sText += " lines written."; - - fprintf( stdout, "%s\n", sText.GetBuffer()); - String sOutput1( sBase ); - sOutput1 += String( "_", RTL_TEXTENCODING_ASCII_US ); - sOutput1 += String::CreateFromInt64( nOutputFile ); - if ( sExt.Len()) { - sOutput1 += String( ".", RTL_TEXTENCODING_ASCII_US ); - sOutput1 += sExt; - } - nOutputFile ++; - - aOutput.SetName( sOutput1 ); - - aOutputStream.Open( aOutput.GetFull(), STREAM_STD_WRITE | STREAM_TRUNC ); - nLine = 0; - } - - aOutputStream.WriteLine( sGSILine ); - - sOldId = sId; - } - - aGSI.Close(); - aOutputStream.Close(); - - ByteString sText( aOutput.GetFull(), RTL_TEXTENCODING_ASCII_US ); - sText += " with "; - sText += ByteString::CreateFromInt64( nLine ); - sText += " lines written."; - } - else { - Help(); - exit( 1 ); - } - } - else { - if ( ByteString( argv[ 1 ] ) == "-t" || ByteString( argv[ 1 ] ) == "-f" ) { - rtl_TextEncoding nEncoding; - - ByteString sCurLangId( argv[ 2 ] ); - - ByteString sCharset( argv[ 3 ] ); - sCharset.ToUpperAscii(); - - if ( sCharset == "MS_932" ) nEncoding = RTL_TEXTENCODING_MS_932; - else if ( sCharset == "MS_936" ) nEncoding = RTL_TEXTENCODING_MS_936; - else if ( sCharset == "MS_949" ) nEncoding = RTL_TEXTENCODING_MS_949; - else if ( sCharset == "MS_950" ) nEncoding = RTL_TEXTENCODING_MS_950; - else if ( sCharset == "MS_1250" ) nEncoding = RTL_TEXTENCODING_MS_1250; - else if ( sCharset == "MS_1251" ) nEncoding = RTL_TEXTENCODING_MS_1251; - else if ( sCharset == "MS_1252" ) nEncoding = RTL_TEXTENCODING_MS_1252; - else if ( sCharset == "MS_1253" ) nEncoding = RTL_TEXTENCODING_MS_1253; - else if ( sCharset == "MS_1254" ) nEncoding = RTL_TEXTENCODING_MS_1254; - else if ( sCharset == "MS_1255" ) nEncoding = RTL_TEXTENCODING_MS_1255; - else if ( sCharset == "MS_1256" ) nEncoding = RTL_TEXTENCODING_MS_1256; - else if ( sCharset == "MS_1257" ) nEncoding = RTL_TEXTENCODING_MS_1257; - else if ( sCharset == "UTF8" ) nEncoding = RTL_TEXTENCODING_UTF8; - - else { - Help(); - exit ( 1 ); - } - - DirEntry aSource = DirEntry( String( argv[ 4 ], RTL_TEXTENCODING_ASCII_US )); - if ( !aSource.Exists()) { - fprintf( stderr, "\nERROR: GSI-File %s not found!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); - exit ( 2 ); - } - - String sGSI( argv[ 4 ], RTL_TEXTENCODING_ASCII_US ); - SvFileStream aGSI( sGSI, STREAM_STD_READ ); - if ( !aGSI.IsOpen()) { - fprintf( stderr, "\nERROR: Could not open GSI-File %s!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); - exit ( 3 ); - } - sal_uInt16 nFileType( GetGSIFileType( aGSI )); - - ByteString sGSILine; - while ( !aGSI.IsEof()) { - - aGSI.ReadLine( sGSILine ); - ByteString sLangId( GetGSILineLangId( sGSILine, nFileType )); - if ( sLangId == sCurLangId ) - ConvertGSILine(( ByteString( argv[ 1 ] ) == "-t" ), sGSILine, nEncoding, nFileType ); - - fprintf( stdout, "%s\n", sGSILine.GetBuffer()); - } - - aGSI.Close(); - } - else { - Help(); - exit( 1 ); - } - } - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 1905b7a9b2be..045ba7ceb299 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -34,7 +34,6 @@ #include <stdio.h> #include <stdlib.h> #include "helpmerge.hxx" -#include "utf8conv.hxx" #include <algorithm> #include <sys/types.h> #include <sys/stat.h> diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 93513e2a8bfe..e89640015773 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -32,7 +32,6 @@ // local includes #include "lngmerge.hxx" -#include "utf8conv.hxx" #include <iostream> using namespace std; // diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index c6c38aa1850f..a0c3775b9ee7 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -55,18 +55,12 @@ namespace transex3 const char *ExeTable[][5] = { { "src", "transex3", " -UTF8 -e", "negative", "noiso" }, { "hrc", "transex3", " -UTF8 -e", "positive", "noiso" }, - { "tree", "xhtex", "", "negative", "noiso" }, - { "xtx", "xtxex", "", "negative", "noiso" }, { "ulf", "ulfex", " -e", "negative", "noiso" }, - { "xrb", "xmlex", "-UTF8 -e", "negative", "iso" }, - { "xxl", "xmlex", "-UTF8 -e", "negative", "iso" }, - { "xgf", "xmlex", "-UTF8 -e -t:xgf", "negative", "iso" }, { "xcd", "cfgex", "-UTF8 -e", "negative", "iso" }, { "xcu", "cfgex", "-UTF8 -e", "negative", "iso" }, { "xcs", "cfgex", "-UTF8 -e -f", "negative", "iso" }, { "xrm", "xrmex", "-UTF8 -e", "negative", "iso" }, { "xhp", "helpex", " -e", "negative", "noiso" }, -// unused { "properties", "jpropex", " -e", "negative", "noiso" }, { "NULL", "NULL", "NULL", "NULL", "NULL" } }; diff --git a/l10ntools/source/makefile.mk b/l10ntools/source/makefile.mk index a08794f3b9ba..86bcea3cbd0e 100644 --- a/l10ntools/source/makefile.mk +++ b/l10ntools/source/makefile.mk @@ -54,7 +54,6 @@ OBJFILES= \ $(OBJ)$/export2.obj \ $(OBJ)$/merge.obj \ $(OBJ)$/srciter.obj \ - $(OBJ)$/utf8conv.obj \ $(OBJ)$/xmlparse.obj \ $(OBJ)$/helpmerge.obj \ $(OBJ)$/helpex.obj \ @@ -69,9 +68,7 @@ LIB1OBJFILES= $(OBJ)$/export.obj \ $(OBJ)$/merge.obj \ $(OBJ)$/srciter.obj \ $(OBJ)$/file.obj \ - $(OBJ)$/directory.obj \ - $(OBJ)$/utf8conv.obj - + $(OBJ)$/directory.obj APP1VERSIONMAP=exports.map @@ -85,25 +82,18 @@ APP1LIBS+= $(LB)$/$(TARGET).lib APP1DEPN= $(OBJ)$/src_yy_wrapper.obj $(LB)$/$(TARGET).lib APP2TARGET= helpex -APP2OBJS= $(OBJ)$/helpmerge.obj $(OBJ)$/xmlparse.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj $(OBJ)$/merge.obj $(OBJ)$/helpex.obj +APP2OBJS= $(OBJ)$/helpmerge.obj $(OBJ)$/xmlparse.obj $(OBJ)$/export2.obj $(OBJ)$/merge.obj $(OBJ)$/helpex.obj APP2RPATH= NONE APP2STDLIBS+=$(SALLIB) $(EXPATASCII3RDLIB) $(TOOLSLIB) # extractor and merger for *.lng and *.lng APP3TARGET= ulfex -APP3OBJS= $(OBJ)$/lngmerge.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/lngex.obj $(OBJ)$/utf8conv.obj +APP3OBJS= $(OBJ)$/lngmerge.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/lngex.obj APP3RPATH= NONE APP3STDLIBS+= \ $(TOOLSLIB) \ $(SALLIB) -# encoding converter for *.gsi -APP4TARGET= gsiconv -APP4OBJS= $(OBJ)$/utf8conv.obj $(OBJ)$/gsiconv.obj -APP4STDLIBS+= \ - $(TOOLSLIB) \ - $(SALLIB) - # tag checker for *.gsi APP5TARGET= gsicheck APP5OBJS= $(OBJ)$/gsicheck.obj $(OBJ)$/tagtest.obj @@ -113,14 +103,14 @@ APP5STDLIBS+= \ # extractor and merger for *.cfg APP6TARGET= cfgex -APP6OBJS= $(OBJ)$/cfgmerge.obj $(OBJ)$/cfg_yy_wrapper.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj +APP6OBJS= $(OBJ)$/cfgmerge.obj $(OBJ)$/cfg_yy_wrapper.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj APP6STDLIBS+= \ $(TOOLSLIB) \ $(SALLIB) # extractor and merger for *.xrm APP7TARGET= xrmex -APP7OBJS= $(OBJ)$/xrmmerge.obj $(OBJ)$/xrm_yy_wrapper.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj +APP7OBJS= $(OBJ)$/xrmmerge.obj $(OBJ)$/xrm_yy_wrapper.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj APP7RPATH= NONE APP7STDLIBS+= \ $(TOOLSLIB) \ @@ -130,7 +120,7 @@ APP7STDLIBS+= \ APP9TARGET= localize_sl EXCEPTIONSFILES= \ $(OBJ)$/localize.obj -APP9OBJS= $(OBJ)$/localize.obj $(OBJ)$/utf8conv.obj $(OBJ)$/srciter.obj $(OBJ)$/export2.obj $(OBJ)$/file.obj $(OBJ)$/directory.obj +APP9OBJS= $(OBJ)$/localize.obj $(OBJ)$/srciter.obj $(OBJ)$/export2.obj $(OBJ)$/file.obj $(OBJ)$/directory.obj APP9STDLIBS+= \ $(TOOLSLIB) \ diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 6576a94fcf8f..35a61211bdbb 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -31,7 +31,6 @@ #include <stdio.h> #include <tools/fsys.hxx> #include "export.hxx" -#include "utf8conv.hxx" #include <iostream> using namespace std; diff --git a/l10ntools/source/utf8conv.cxx b/l10ntools/source/utf8conv.cxx deleted file mode 100644 index 72dd18aa7398..000000000000 --- a/l10ntools/source/utf8conv.cxx +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_l10ntools.hxx" -#include "utf8conv.hxx" - -// -// class UTF8Converter -// - -#define MAX_CONV_BUFFER_SIZE 0xFF00 - -#define TO_CVTFLAGS (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |\ - RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |\ - RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT) - -#define FROM_CVTFLAGS (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_DEFAULT |\ - RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT |\ - RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE |\ - RTL_UNICODETOTEXT_FLAGS_PRIVATE_MAPTO0) - -/*****************************************************************************/ -void UTF8Converter::Convert( ByteString &rBuffer, - rtl_TextEncoding nSourceENC, rtl_TextEncoding nDestENC ) -/*****************************************************************************/ -{ - String sTemp( rBuffer, nSourceENC ); - rBuffer = ByteString( sTemp, nDestENC ); -} - -/*****************************************************************************/ -ByteString UTF8Converter::ConvertToUTF8( - const ByteString &rASCII, rtl_TextEncoding nEncoding ) -/*****************************************************************************/ -{ - ByteString sReturn( rASCII ); - Convert( sReturn, nEncoding, RTL_TEXTENCODING_UTF8 ); - return sReturn; -} - -/*****************************************************************************/ -ByteString UTF8Converter::ConvertFromUTF8( - const ByteString &rUTF8, rtl_TextEncoding nEncoding ) -/*****************************************************************************/ -{ - ByteString sReturn( rUTF8 ); - Convert( sReturn, RTL_TEXTENCODING_UTF8, nEncoding ); - return sReturn; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/l10ntools/source/xgfconv.cxx b/l10ntools/source/xgfconv.cxx deleted file mode 100644 index 82d928b33008..000000000000 --- a/l10ntools/source/xgfconv.cxx +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -#include <stdio.h> - -#include "export.hxx" -#include "utf8conv.hxx" - -/*****************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_l10ntools.hxx" -#if defined(UNX) -int main( int argc, char *argv[] ) -#else -int _cdecl main( int argc, char *argv[] ) -#endif -/*****************************************************************************/ -{ - if ( argc != 3 ) { - fprintf( stderr, "xgfconv InputFile OutputFile\n" ); - return ( 5 ); - } - - ByteString sInput( argv[ 1 ] ); - ByteString sOutput( argv[ 2 ] ); - - SvFileStream aInput( String( sInput, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); - if ( !aInput.IsOpen()) { - fprintf( stderr, "ERROR: Unable to open input file!\n" ); - return ( 5 ); - } - - SvFileStream aOutput( String( sOutput, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC ); - if ( !aOutput.IsOpen()) { - fprintf( stderr, "ERROR: Unable to open output file!\n" ); - aInput.Close(); - return ( 5 ); - } - - ByteString sLine; - sal_Bool bFirst = sal_True; - while ( !aInput.IsEof()) { - aInput.ReadLine( sLine ); - ByteString sLangId = sLine.GetToken( 0, '\t' ); - ByteString sFile = sLine.GetToken( 1, '\t' ); - ByteString sText = sLine.Copy( sLangId.Len() + sFile.Len() + 2 ); - - sal_uInt16 nLangId = sLangId.ToInt32(); - CharSet aCharSet = Export::GetCharSet( nLangId ); - if ( aCharSet != 0xFFFF && sText.Len()) { - sText = UTF8Converter::ConvertToUTF8( sText, aCharSet ); - ByteString sOutput = sFile; - sOutput += "\t"; - sOutput += sText; - if ( !bFirst ) { - ByteString sEmpty; - aOutput.WriteLine( sEmpty ); - } - else - bFirst = sal_False; - aOutput.Write( sOutput.GetBuffer(), sOutput.Len()); - } - } - aInput.Close(); - aOutput.Close(); - return ( 0 ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index c333f3d2060b..875fd457cf93 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -35,7 +35,6 @@ // local includes #include "export.hxx" #include "xrmmerge.hxx" -#include "utf8conv.hxx" #include "tokens.h" #include <iostream> #include <vector> |