ooo-build r11653 - in trunk: . patches/src680



Author: strba
Date: Wed Feb 20 21:10:51 2008
New Revision: 11653
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11653&view=rev

Log:
update the t602 import filter incorporating upstream improvements

Added:
   trunk/patches/src680/cws-t602import01-filter.diff
   trunk/patches/src680/cws-t602import01-scp2.diff
Removed:
   trunk/patches/src680/cws-t602import01.diff
Modified:
   trunk/ChangeLog
   trunk/patches/src680/apply

Modified: trunk/patches/src680/apply
==============================================================================
--- trunk/patches/src680/apply	(original)
+++ trunk/patches/src680/apply	Wed Feb 20 21:10:51 2008
@@ -259,7 +259,8 @@
 libwps.diff
 
 # T602 import filter
-cws-t602import01.diff
+cws-t602import01-filter.diff
+cws-t602import01-scp2.diff
 
 # removal of nas, sndfile, portaudio
 cws-unifysound01-avmedia.diff

Added: trunk/patches/src680/cws-t602import01-filter.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/cws-t602import01-filter.diff	Wed Feb 20 21:10:51 2008
@@ -0,0 +1,2020 @@
+--- filter/prj/build.lst	30 Oct 2006 08:51:08 -0000	1.25
++++ filter/prj/build.lst	13 Apr 2007 08:04:20 -0000	1.25.88.2
+@@ -1,4 +1,4 @@
+-fl	filter	:	svtools unotools goodies xmloff svx javaunohelper jvmaccess XALAN:xalan LIBXSLT:libxslt NULL
++fl	filter	:	svtools unotools goodies xmloff cppu tools cppuhelper sal svx javaunohelper jvmaccess XALAN:xalan LIBXSLT:libxslt NULL
+ fl	filter									usr1	-	all	fl_mkout			NULL
+ fl	filter\prj								get		-	all	fl_prj				NULL
+ fl	filter\inc								nmake	-	all	fl_inc				NULL
+@@ -14,6 +14,7 @@ fl	filter\source\xsltfilter				nmake	-	a
+ fl	filter\source\xsltvalidate				nmake	-	all fl_xsltvalidate fl_xsltfilter	fl_inc NULL
+ fl	filter\source\xsltdialog				nmake	-	all fl_xsltdialog fl_flash		fl_inc NULL
+ fl  filter\source\docbook                   nmake   -   all fl_docbook          fl_inc NULL
++fl  filter\source\t602                      nmake   -   all fl_t602             fl_inc NULL
+ fl  filter\source\config\cache              nmake   -   all fl_config           fl_inc NULL
+ fl  filter\source\config\tools\utils        nmake   -   all fl_fcfg_utils       fl_inc NULL
+ fl  filter\source\config\tools\merge        nmake   -   all fl_fcfg_merge fl_fcfg_utils fl_xsltvalidate fl_inc NULL
+--- filter/source/config/fragments/fcfg_writer.mk	13 Jul 2006 09:12:35 -0000	1.9
++++ filter/source/config/fragments/fcfg_writer.mk	12 Apr 2007 10:27:50 -0000	1.9.136.1
+@@ -47,6 +47,7 @@ T4_WRITER = \
+     $(T4_WRITER_BINFILTER) \
+     writer_WordPerfect_Document \
+     writer_MS_Works_Document \
++    writer_T602_Document \
+     writer_Text \
+     writer_Text_encoded \
+     writer_JustSystem_Ichitaro_10 \
+@@ -81,6 +82,7 @@ F4_WRITER = \
+ 	$(F4_WRITER_BINFILTER) \
+ 	WordPerfect \
+ 	MS_Works \
++	T602Document \
+ 	Text \
+ 	Text__encoded_ \
+ 	writer_JustSystem_Ichitaro_10 \
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ filter/source/config/fragments/filters/T602Document.xcu	12 Apr 2007 10:27:50 -0000	1.1.2.1
+@@ -0,0 +1,13 @@
++	<node oor:name="T602Document" oor:op="replace">
++		<prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value></prop>
++		<prop oor:name="UIComponent"/>
++		<prop oor:name="FilterService"><value>com.sun.star.comp.Writer.T602ImportFilter</value></prop>
++		<prop oor:name="UserData"><value>602</value></prop>
++		<prop oor:name="UIName">
++			<value xml:lang="x-default">T602 Document</value>
++		</prop>
++		<prop oor:name="FileFormatVersion"><value>0</value></prop>
++		<prop oor:name="Type"><value>writer_T602_Document</value></prop>
++		<prop oor:name="TemplateName"/>
++		<prop oor:name="DocumentService"><value>com.sun.star.text.TextDocument</value></prop>
++	</node>
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ filter/source/config/fragments/types/writer_T602_Document.xcu	12 Apr 2007 10:27:50 -0000	1.1.2.1
+@@ -0,0 +1,12 @@
++	<node oor:name="writer_T602_Document" oor:op="replace" >
++		<prop oor:name="DetectService"><value>com.sun.star.comp.Writer.T602ImportFilter</value></prop>
++		<prop oor:name="URLPattern"/>
++		<prop oor:name="Extensions"><value>602 txt</value></prop>
++		<prop oor:name="MediaType"><value>application/x-t602</value></prop>
++		<prop oor:name="Preferred"><value>true</value></prop>
++		<prop oor:name="PreferredFilter"><value>T602Document</value></prop>
++		<prop oor:name="UIName">
++			<value>T602 Document</value>
++		</prop>
++		<prop oor:name="ClipboardFormat"/>
++	</node>
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ filter/source/t602/filterenv.cxx	20 Feb 2008 18:58:09 -0000	1.1.2.6
+@@ -0,0 +1,133 @@
++ /*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  $RCSfile$
++ *
++ *  $Revision$
++ *
++ *  last change: $Author$ $Date$
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2004-2007 Milan Broz <mbroz redhat com>
++ *    Copyright 2007 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library 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 for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++
++#include <osl/mutex.hxx>
++#include <osl/thread.h>
++#include <cppuhelper/factory.hxx>
++
++#include <com/sun/star/lang/XSingleServiceFactory.hpp>
++
++#include "t602filter.hxx"
++
++using namespace ::rtl;
++using namespace ::cppu;
++using namespace ::com::sun::star::uno;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::registry;
++
++using namespace T602ImportFilter;
++
++extern "C"
++{
++//==================================================================================================
++void SAL_CALL component_getImplementationEnvironment(
++	const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
++{
++	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
++}
++//==================================================================================================
++sal_Bool SAL_CALL component_writeInfo(
++	void * /* pServiceManager */, void * pRegistryKey )
++{
++	if (pRegistryKey)
++	{
++		try
++		{
++            sal_Int32 nPos = 0;
++            Reference< XRegistryKey > xNewKey(
++				reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( T602ImportFilter_getImplementationName() ) );
++            xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
++
++			const Sequence< OUString > & rSNL = T602ImportFilter_getSupportedServiceNames();
++			const OUString * pArray = rSNL.getConstArray();
++			for ( nPos = rSNL.getLength(); nPos--; )
++				xNewKey->createKey( pArray[nPos] );
++
++			xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( T602ImportFilterDialog_getImplementationName() );
++            xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
++
++			const Sequence< OUString > & rSNL2 = T602ImportFilterDialog_getSupportedServiceNames();
++			pArray = rSNL2.getConstArray();
++			for ( nPos = rSNL2.getLength(); nPos--; )
++				xNewKey->createKey( pArray[nPos] );
++
++			return sal_True;
++		}
++		catch (InvalidRegistryException &)
++		{
++			OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
++		}
++	}
++	return sal_False;
++}
++//==================================================================================================
++void * SAL_CALL component_getFactory(
++	const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
++{
++	void * pRet = 0;
++
++    OUString implName = OUString::createFromAscii( pImplName );
++	if ( pServiceManager && implName.equals(T602ImportFilter_getImplementationName()) )
++	{
++		Reference< XSingleServiceFactory > xFactory( createSingleFactory(
++			reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
++			OUString::createFromAscii( pImplName ),
++			T602ImportFilter_createInstance, T602ImportFilter_getSupportedServiceNames() ) );
++
++		if (xFactory.is())
++		{
++			xFactory->acquire();
++			pRet = xFactory.get();
++		}
++	}
++	else if ( pServiceManager && implName.equals(T602ImportFilterDialog_getImplementationName()) )
++	{
++		Reference< XSingleServiceFactory > xFactory( createSingleFactory(
++			reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
++			OUString::createFromAscii( pImplName ),
++			T602ImportFilterDialog_createInstance, T602ImportFilterDialog_getSupportedServiceNames() ) );
++
++		if (xFactory.is())
++		{
++			xFactory->acquire();
++			pRet = xFactory.get();
++		}
++	}
++
++
++	return pRet;
++}
++}
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ filter/source/t602/makefile.mk	23 Aug 2007 12:19:40 -0000	1.1.2.3
+@@ -0,0 +1,72 @@
++#*************************************************************************
++#
++#   OpenOffice.org - a multi-platform office productivity suite
++#
++#   Copyright (C) 2007   Fridrich Strba (fstrba novell com)
++#
++#   $RCSfile$
++#
++#   $Revision$
++#
++#   last change: $Author$ $Date$
++#
++#   The Contents of this file are made available subject to
++#   the terms of GNU Lesser General Public License Version 2.1.
++#
++#
++#     GNU Lesser General Public License Version 2.1
++#     =============================================
++#     Copyright 2005 by Sun Microsystems, Inc.
++#     901 San Antonio Road, Palo Alto, CA 94303, USA
++#
++#     This library is free software; you can redistribute it and/or
++#     modify it under the terms of the GNU Lesser General Public
++#     License version 2.1, as published by the Free Software Foundation.
++#
++#     This library 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 for more details.
++#
++#     You should have received a copy of the GNU Lesser General Public
++#     License along with this library; if not, write to the Free Software
++#     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++#     MA  02111-1307  USA
++#
++#*************************************************************************
++PRJ	= ..$/..
++PRJNAME = filter
++TARGET  =t602filter
++ENABLE_EXCEPTIONS=TRUE
++LIBTARGET=NO
++
++# --- Settings -----------------------------------------------------
++.INCLUDE: settings.mk
++
++SRS1NAME = $(TARGET)
++SRC1FILES = $(SRS1NAME).src
++
++RESLIB1NAME=$(SRS1NAME)
++RESLIB1SRSFILES= $(SRS)$/$(RESLIB1NAME).srs
++
++SLOFILES=$(SLO)$/t602filter.obj \
++         $(SLO)$/filterenv.obj
++
++LIBNAME=$(TARGET)
++SHL1TARGETDEPN=makefile.mk
++SHL1OBJS=$(SLOFILES)
++SHL1TARGET=$(LIBNAME)$(UPD)$(DLLPOSTFIX)
++SHL1IMPLIB=i$(LIBNAME)
++SHL1VERSIONMAP=$(LIBNAME).map
++#SHL1DEF=$(MISC)$/$(SHL1TARGET).def
++DEF1NAME=$(SHL1TARGET)
++
++SHL1STDLIBS= \
++    $(XMLOFFLIB) \
++	$(CPPULIB) \
++	$(CPPUHELPERLIB) \
++    $(SALLIB) \
++    $(TOOLSLIB)
++
++# --- Targets ------------------------------------------------------
++.INCLUDE :  target.mk
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ filter/source/t602/t602filter.cxx	20 Feb 2008 19:35:02 -0000	1.1.2.9
+@@ -0,0 +1,1273 @@
++ /*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  Copyright (C) 2004-2007 Milan Broz (asi seznam cz)
++ *  Copyright (C) 2007 Novell, Inc. (http://www.novell.com)
++ *
++ *  $RCSfile$
++ *
++ *  $Revision$
++ *
++ *  last change: $Author$ $Date$
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2004-2007 Milan Broz <mbroz redhat com>
++ *    Copyright 2007 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library 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 for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++
++#include "t602filter.hxx"
++#include "t602filter.hrc"
++
++#include <ctype.h>
++#include <stdio.h>
++
++#include <cppuhelper/factory.hxx>
++#include <cppuhelper/bootstrap.hxx>
++#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
++#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
++#include <com/sun/star/text/XTextDocument.hpp>
++#include <com/sun/star/container/XNameContainer.hpp>
++#include <com/sun/star/awt/XControl.hpp>
++#include <com/sun/star/awt/XDialog.hpp>
++#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
++
++using namespace ::rtl;
++using namespace ::cppu;
++using namespace ::osl;
++using namespace ::com::sun::star;
++using namespace ::com::sun::star::uno;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::registry;
++using namespace ::com::sun::star::container;
++using namespace ::com::sun::star::beans;
++using namespace ::com::sun::star::awt;
++using namespace ::com::sun::star::xml::sax;
++using namespace ::com::sun::star::document;
++using com::sun::star::io::XInputStream;
++
++namespace T602ImportFilter {
++
++    unsigned char kam2lat[129] =
++        //    0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
++        "\xAC\x81\x82\xD4\x84\xD2\x9B\x9F\xD8\xB7\x91\xD6\x96\x92\x8E\xB5"  // 8
++        "\x90\xA7\xA6\x93\x94\xE0\x85\xE9\xEC\x99\x9A\xE6\x95\xED\xFC\x9C"  // 9
++        "\xA0\xA1\xA2\xA3\xE5\xD5\xDE\xE2\xE7\xFD\xEA\xE8\xCE\xF5\xAE\xAF"  // A
++        "\x80\x80\x83\xB3\xB4\xE1\x87\x88\x89\x8A\x8B\x8C\x8F\x97\x8D\xBF"  // B
++        "\xC0\xC1\xC2\xC3\xC4\xC5\xCF\x98\x9D\x9E\xA4\xA5\xA8\xA9\x86\xF3"  // C
++        "\xCD\xB1\xB2\xB6\xB8\xB9\xBA\xBB\xF7\xD9\xDA\xDB\xDC\xF8\xF9\xDF"  // D
++        "\xD0\xD1\xD3\xD7\xAA\xAB\xDD\xB0\xE3\xE4\xEB\xEE\xEF\xF0\xF2\xF4"  // E
++        "\xBC\xBD\xBE\xC6\xC7\xC8\xF6\xC9\xCA\xFA\xFB\xCB\xF1\xCC\xFE\xFF"; // F
++
++    unsigned char koi2lat[129] =
++        //    0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
++        "\x80\x83\x86\xF5\xE1\x87\x88\x89\x8A\x8B\x8C\x8F\x97\xCF\xCF\x98"  // 8
++        "\x9D\x9E\xA4\xA5\xA8\xA9\xDB\xDC\xDF\xB1\xB2\xB6\xB8\xB9\xBA\xBB"  // 9
++        "\xBC\xBD\xBE\xC6\xC7\xC8\xF6\xC9\xCA\xCB\xCC\xCD\xCE\xAD\xAE\xAF"  // A
++        "\xD0\xD1\xD3\xD7\xAA\xAB\xDD\xB0\xE3\xE4\xEB\xEE\xEF\xF0\xF2\xF4"  // B
++        "\xDA\xA0\xC0\x9F\xD4\xD8\xEA\xC4\x81\xA1\x85\x92\x96\x94\xE5\xA2"  // C
++        "\x93\x84\xFD\xE7\x9C\xA3\xC3\x82\xF7\xEC\xA7\xC2\xF3\xF8\xF9\xC5"  // D
++        "\xBF\xB5\xD9\xAC\xD2\xB7\xE8\xB3\x9A\xD6\xDE\x91\x95\x99\xD5\xE0"  // E
++        "\xE2\x8E\xFC\xE6\x9B\xE9\xB4\x90\xFA\xED\xA6\xC1\xF1\xFB\xFE\xFF"; // F
++
++    unsigned char lat2UNC[257] =
++        //    0       1       2       3       4       5       6       7
++        //    8       9       A       B       C       D       E       F
++        "\x00\xe7\x00\xfc\x00\xe9\x00\xf9\x00\xe4\x01\x6f\x00\xe8\x00\xa3"  // 8
++        "\x00\xc6\x00\xd8\x00\xc5\x00\xe6\x00\xf8\x00\xc4\x00\xc4\x00\xe5"
++        "\x00\xc9\x01\x39\x00\xf4\x00\xf4\x00\xf6\x01\x3d\x01\x3e\x00\x20"  // 9
++        "\x00\xf2\x00\xd6\x00\xdc\x01\x64\x01\x65\x00\xec\x20\xa7\x01\x0d"
++        "\x00\xe1\x00\xed\x00\xf3\x00\xfa\x00\xa1\x00\xd1\x01\x7d\x01\x7e"  // A
++        "\x00\xbf\x00\xf1\x22\x11\x03\xc3\x01\x0c\x00\xa7\x00\xbb\x00\xab"
++        "\x25\x91\x25\x92\x25\x93\x25\x02\x25\x24\x00\xc1\x00\xc2\x01\x1a"  // B
++        "\x00\x20\x00\x20\x00\x20\x00\x20\x22\x61\x00\xb1\x22\x65\x25\x10"
++        "\x25\x14\x25\x34\x25\x2c\x25\x1c\x25\x00\x25\x3c\x22\x64\x23\x20"  // C
++        "\x23\x21\x22\x48\x00\xba\x22\x1a\x00\xb2\x00\xbd\x00\xbc\x00\xa4"
++        "\x03\xb1\x03\xb2\x01\x0e\x03\x93\x01\x0f\x01\x47\x00\xcd\x03\xc0"  // D
++        "\x01\x1b\x25\x18\x25\x0c\x25\x88\x25\x84\x00\xb5\x01\x6e\x25\x80"
++        "\x00\xd3\x00\xdf\x00\xd4\x03\xa6\x03\x98\x01\x48\x01\x60\x01\x61"  // E
++        "\x01\x54\x00\xda\x01\x55\x03\xa9\x00\xfd\x00\xdd\x03\xb4\x22\x1e"
++        "\x00\xf8\x02\xdd\x03\xb5\x02\xc7\x22\x29\x00\xa7\x00\xf7\x00\xe0"  // F
++        "\x00\xb4\x00\xb0\x00\xc0\x02\xc6\x01\x58\x01\x59\x00\x20\x00\x20";
++
++    unsigned char rus2UNC[257] =
++        //    0       1       2       3       4       5       6       7
++        //    8       9       A       B       C       D       E       F
++        "\x04\x11\x00\xfc\x00\xe9\x04\x12\x00\xe4\x01\x6f\x04\x13\x04\x14"  // 8
++        "\x04\x01\x04\x16\x04\x17\x04\x18\x04\x19\x00\xc4\x00\xc4\x04\x1a"
++        "\x00\xc9\x01\x39\x01\x3a\x00\xf4\x00\xf6\x01\x3d\x01\x3e\x00\x20"  // 9
++        "\x04\x1c\x00\xd6\x00\xdc\x01\x64\x01\x65\x04\x1d\x04\x1f\x01\x0a"
++        "\x00\xe1\x00\xed\x00\xf3\x00\xfa\x04\x20\x04\x22\x01\x7d\x01\x7e"  // A
++        "\x04\x23\x04\x24\x04\x43\x04\x44\x01\x0c\x00\xa7\x04\x3b\x04\x3c"
++        "\x04\x47\x04\x26\x04\x27\x25\x02\x25\x24\x00\xc1\x04\x28\x01\x1a"  // B
++        "\x04\x29\x04\x2a\x04\x2b\x04\x2c\x04\x2d\x04\x2e\x04\x2f\x25\x10"
++        "\x25\x14\x25\x34\x25\x2c\x25\x1c\x25\x00\x25\x3c\x04\x31\x04\x32"  // C
++        "\x04\x33\x04\x51\x04\x36\x04\x37\x04\x38\x04\x39\x04\x3a\x04\x1b"
++        "\x04\x3d\x04\x3f\x01\x0e\x04\x40\x01\x0f\x01\x47\x00\xcd\x04\x42"  // D
++        "\x01\x1b\x25\x18\x25\x0c\x25\x88\x25\x84\x04\x46\x01\x6e\x25\x80"
++        "\x00\xd3\x00\xdf\x00\xd4\x04\x48\x04\x49\x01\x48\x01\x60\x01\x61"  // E
++        "\x01\x54\x00\xda\x01\x55\x04\x4a\x00\xfd\x00\xdd\x04\x4b\x04\x4c"
++        "\x04\x4d\x02\xdd\x04\x4e\x02\xc7\x04\x4f\x00\xa7\x04\x34\x00\xe0"  // F
++        "\x00\xb4\x00\xb0\x00\xc0\x02\xc6\x01\x58\x01\x59\x00\x20\x00\x20";
++
++#define _AddAtt(_nam, _val) \
++    mpAttrList->AddAttribute(OUString::createFromAscii( _nam ),\
++    OUString::createFromAscii( _val ) );
++
++#define _Start(_nam) \
++    mxHandler->startElement(OUString::createFromAscii(_nam), mAttrList);\
++    mpAttrList->Clear();
++
++#define _End(_nam) \
++    mxHandler->endElement(OUString::createFromAscii(_nam));
++
++#define _Chars(_ch) \
++    mxHandler->characters(OUString::createFromAscii((sal_Char *) _ch) );
++
++inistruct ini;
++
++T602ImportFilter::T602ImportFilter(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory > &r ) :
++    mxMSF( r ) {}
++
++T602ImportFilter::~T602ImportFilter()
++{
++}
++
++// XExtendedTypeDetection
++::rtl::OUString T602ImportFilter::detect( Sequence<PropertyValue>& Descriptor)
++    throw(RuntimeException)
++{
++	// checks for filter or type name would be necessary in case we want to use the filter also for "602" files
++	// without the magic bytes at the beginning; I leave the code as comment in case of
++	// ::rtl::OUString aFilterName, aTypeName;
++    sal_Int32 nLength = Descriptor.getLength();
++    const PropertyValue * pValue = Descriptor.getConstArray();
++    for ( sal_Int32 i = 0 ; i < nLength; i++)
++    {
++        if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) )
++            pValue[i].Value >>= mxInputStream;
++/*        else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "FilterName" ) ) )
++            pValue[i].Value >>= aFilterName;
++        else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "TypeName" ) ) )
++            pValue[i].Value >>= aTypeName; */
++    }
++
++    if (!mxInputStream.is())
++        return ::rtl::OUString();
++
++/*    if ( aFilterName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "T602Document" ) )  || 
++		   aTypeName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "writer_T602_Document" ) ) )
++		// preselection by type (extension) or filter name: no reason to check type
++        return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "writer_T602_Document" ) ); */
++
++    ::com::sun::star::uno::Sequence< sal_Int8 > aData;
++    size_t numBytes = 4;
++    size_t numBytesRead = 0;
++
++    numBytesRead = mxInputStream->readSomeBytes (aData, numBytes);
++
++    if ((numBytesRead != numBytes) || (aData[0] != '@') ||
++        (aData[1] != 'C') || (aData[2] != 'T') || (aData[3] != ' '))
++        return ::rtl::OUString();
++
++    return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "writer_T602_Document" ) );;
++}
++
++// XFilter
++sal_Bool SAL_CALL T602ImportFilter::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
++	throw (RuntimeException)
++{
++	return importImpl ( aDescriptor );
++}
++
++// XImporter
++void SAL_CALL T602ImportFilter::setTargetDocument( const Reference< ::com::sun::star::lang::XComponent >& xDoc )
++	throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException)
++{
++	mxDoc = xDoc;
++}
++
++// XInitialization
++void SAL_CALL T602ImportFilter::initialize( const Sequence< Any >& aArguments )
++    throw (Exception, RuntimeException)
++{
++    Sequence < PropertyValue > aAnySeq;
++    sal_Int32 nLength = aArguments.getLength();
++    if ( nLength && ( aArguments[0] >>= aAnySeq ) )
++    {
++        const PropertyValue * pValue = aAnySeq.getConstArray();
++        nLength = aAnySeq.getLength();
++        for ( sal_Int32 i = 0 ; i < nLength; i++)
++        {
++            if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "Type" ) ) )
++            {
++                pValue[i].Value >>= msFilterName;
++                break;
++            }
++        }
++    }
++}
++
++// Other functions
++
++void T602ImportFilter::inschr(unsigned char ch)
++{
++    Reference < XAttributeList > mAttrList ( mpAttrList );
++
++    if(!ini.showcomm&&pst.comment) return;
++
++    if(ch==' ') {
++        setfnt(chngul,true);
++        pst.wasspace++;
++        return;
++    }
++
++    if(pst.wasspace > 0)
++        if(ini.reformatpars) {
++            if(!pst.wasfdash)
++                inschrdef(' ');
++            pst.wasfdash = false;
++        } else {
++            char s[20];
++            sprintf(s,"%i",pst.wasspace);
++            _AddAtt("text:c",s);
++            _Start("text:s");
++            _End("text:s");
++        }
++
++        pst.wasspace = 0;
++        setfnt(chngul,true);
++        inschrdef(ch);
++}
++
++sal_Bool SAL_CALL T602ImportFilter::importImpl( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
++    throw (RuntimeException)
++{
++    Reset602();
++
++    sal_Int32 nLength = aDescriptor.getLength();
++    const PropertyValue * pValue = aDescriptor.getConstArray();
++    OUString sURL;
++    for ( sal_Int32 i = 0 ; i < nLength; i++)
++    {
++        if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) )
++            pValue[i].Value >>= mxInputStream;
++    }
++
++    if ( !mxInputStream.is() )
++    {
++        OSL_ASSERT( 0 );
++        return sal_False;
++    }
++
++    // An XML import service: what we push sax messages to..
++    OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.XMLImporter" ) );
++
++    mxHandler = Reference< XDocumentHandler >( mxMSF->createInstance( sXMLImportService ), UNO_QUERY );
++
++    // The XImporter sets up an empty target document for XDocumentHandler to write to..
++    Reference < XImporter > xImporter(mxHandler, UNO_QUERY);
++    xImporter->setTargetDocument(mxDoc);
++
++    char fs[32], fs2[32];
++    sprintf(fs, "%ipt", ini.fontsize);
++    sprintf(fs2,"%ipt", 2*ini.fontsize);
++
++    mpAttrList = new SvXMLAttributeList;
++
++    Reference < XAttributeList > mAttrList ( mpAttrList );
++
++    mxHandler->startDocument();
++
++	_AddAtt("xmlns:office", "http://openoffice.org/2000/office";);
++	_AddAtt("xmlns:style", "http://openoffice.org/2000/style";);
++	_AddAtt("xmlns:text", "http://openoffice.org/2000/text";);
++	_AddAtt("xmlns:table", "http://openoffice.org/2000/table";);
++	_AddAtt("xmlns:draw", "http://openoffice.org/2000/draw";);
++	_AddAtt("xmlns:fo", "http://www.w3.org/1999/XSL/Format";);
++	_AddAtt("xmlns:xlink", "http://www.w3.org/1999/xlink";);
++	_AddAtt("xmlns:number", "http://openoffice.org/2000/datastyle";);
++	_AddAtt("xmlns:svg", "http://www.w3.org/2000/svg";);
++	_AddAtt("xmlns:chart", "http://openoffice.org/2000/chart";);
++	_AddAtt("xmlns:dr3d", "http://openoffice.org/2000/dr3d";);
++	_AddAtt("xmlns:math", "http://www.w3.org/1998/Math/MathML";);
++	_AddAtt("xmlns:form", "http://openoffice.org/2000/form";);
++	_AddAtt("xmlns:script", "http://openoffice.org/2000/script";);
++	_AddAtt("office:class", "text");
++	_AddAtt("office:version", "1.0");
++    _Start("office:document-content");
++
++    _Start("office:font-decls");
++    _AddAtt("style:name","Courier New");
++    _AddAtt("fo:font-family","Courier New");
++    _AddAtt("style:font-pitch","fixed");
++    _Start("style:font-decl");
++    _End("style:font-decl");
++    _End("office:font-decls");
++
++    _Start("office:automatic-styles");
++
++    // Standardni text
++    _AddAtt("style:name","P1");
++    _AddAtt("style:family","paragraph");
++    _AddAtt("style:parent-style-name","Standard");
++    _Start("style:style");
++    _AddAtt("style:font-name","Courier New");
++    _AddAtt("fo:font-size",fs);
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // Standardni text - konec stranky
++    _AddAtt("style:name","P2");
++    _AddAtt("style:family","paragraph");
++    _AddAtt("style:parent-style-name","Standard");
++    _Start("style:style");
++    _AddAtt("style:font-name","Courier New");
++    _AddAtt("fo:font-size",fs);
++    _AddAtt("fo:break-before","page");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T1 Normalni text
++    _AddAtt("style:name","T1");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T2 Tucny text
++    _AddAtt("style:name","T2");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _AddAtt("fo:font-weight","bold");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T3 Kurziva
++    _AddAtt("style:name","T3");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _AddAtt("fo:font-style","italic");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T4 Siroky text
++    _AddAtt("style:name","T4");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _AddAtt("fo:font-weight","bold");
++    _AddAtt("style:text-scale","200%");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T5 Vysoky text
++    _AddAtt("style:name","T5");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _AddAtt("fo:font-size",fs2);
++    _AddAtt("fo:font-weight","bold");
++    _AddAtt("style:text-scale","50%");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T6 Velky text
++    _AddAtt("style:name","T6");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _AddAtt("fo:font-size",fs2);
++    _AddAtt("fo:font-weight","bold");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T7 Podtrzeny text
++    _AddAtt("style:name","T7");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _AddAtt("style:text-underline","single");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T8 Podtrzena tucny text
++    _AddAtt("style:name","T8");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _AddAtt("fo:font-weight","bold");
++    _AddAtt("style:text-underline","single");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T9 Podtrzena kurziva
++    _AddAtt("style:name","T9");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _AddAtt("fo:font-style","italic");
++    _AddAtt("style:text-underline","single");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T10 Horni index
++    _AddAtt("style:name","T10");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _AddAtt("style:text-position","27% 100%");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    // T11 Dolni index
++    _AddAtt("style:name","T11");
++    _AddAtt("style:family","text");
++    _Start("style:style");
++    _AddAtt("style:text-position","-27% 100%");
++    _Start("style:properties");
++    _End("style:properties");
++    _End("style:style");
++
++    _End("office:automatic-styles");
++
++    _Start("office:styles");
++    _End("office:styles");
++
++    _Start("office:body");
++
++    Read602();
++
++    _End("office:body");
++    _End("office:document-content");
++
++    mxHandler->endDocument();
++
++    return sal_True;
++}
++
++void T602ImportFilter::Reset602()
++{
++    node = START;
++
++    format602.mt = 0;
++    format602.mb = 0;
++    format602.tb = 0;
++    format602.ct = 0;
++    format602.pn = 1;
++    format602.lh = 1;
++    format602.lm = 6;
++    format602.rm = 60;
++    format602.pl = 60;
++
++    ini.showcomm    = false;
++    ini.forcecode   = false;
++    ini.xcode    = KAM;
++    ini.ruscode    = false;
++    ini.reformatpars= false;
++    ini.fontsize    = 10;
++
++    fst.nowfnt    = fst.oldfnt    = standard;
++    fst.uline    = fst.olduline    = false;
++
++    pst.pars    = 0;
++    pst.comment    = false;
++    pst.wasspace    = 0;
++    pst.ccafterln    = false;
++    pst.willbeeop    = false;
++    pst.waspar    = false;
++    pst.wasfdash    = false;
++}
++
++void T602ImportFilter::inschrdef(unsigned char ch)
++{
++    static sal_Unicode xch[2];
++
++    xch[1] = 0;
++
++    if(ch > 127) {
++
++        switch(ini.xcode) {
++            case L2 : break;
++            case KOI: ch = koi2lat[ch-128]; break;
++            case KAM: ch = kam2lat[ch-128]; break;
++            default : ch = kam2lat[ch-128];
++        }
++
++        if(ini.ruscode)
++            xch[0] = (rus2UNC[(ch-128)*2] << 8) + rus2UNC[(ch-128)*2+1];
++        else
++            xch[0] = (lat2UNC[(ch-128)*2] << 8) + lat2UNC[(ch-128)*2+1];
++    } else
++        xch[0] = ch;
++
++    pst.waspar = false;
++    mxHandler->characters(OUString(xch));
++}
++
++void T602ImportFilter::wrtfnt()
++{
++    Reference < XAttributeList > mAttrList ( mpAttrList );
++    char *style = "P1";
++
++    switch(fst.nowfnt) {
++        case standard : style = (char*)(fst.uline ? "T7" : "T1"); break;
++        case fat      : style = (char*)(fst.uline ? "T8" : "T2"); break;
++        case cursive  : style = (char*)(fst.uline ? "T9" : "T3"); break;
++        case bold     : style = "T4"; break;
++        case tall     : style = "T5"; break;
++        case big      : style = "T6"; break;
++        case lindex   : style = "T11";break;
++        case hindex   : style = "T10";break;
++        default       : style = "T1"; break;
++    }
++
++    _End("text:span");
++    _AddAtt("text:style-name", style);
++    _Start("text:span");
++}
++
++void T602ImportFilter::setfnt(fonts fnt,bool mustwrite)
++{
++    if( fnt == fst.oldfnt &&
++        fnt == fst.nowfnt &&
++        !mustwrite )
++        fst.nowfnt = standard;
++    else
++        if (fnt != chngul) fst.nowfnt = fnt;
++
++        if(mustwrite)
++            if(fst.oldfnt != fst.nowfnt || fst.olduline != fst.uline) {
++                wrtfnt();
++                fst.oldfnt = fst.nowfnt;
++                fst.olduline = fst.uline;
++            }
++}
++
++unsigned char T602ImportFilter::Readchar602()
++{
++    static Sequence< sal_Int8 > aData;
++
++    return (mxInputStream->readBytes(aData, 1) > 0) ?
++        ((unsigned char *) aData.getConstArray())[0] : 0;
++}
++
++void T602ImportFilter::par602(bool endofpage)
++{
++    sal_Int16 endp;
++    Reference < XAttributeList > mAttrList ( mpAttrList );
++
++    if(!endofpage || !pst.waspar) {
++        if(ini.showcomm||!pst.comment) {
++            if(pst.waspar||ini.reformatpars) {
++                _End("text:span");
++                _End("text:p");
++                _AddAtt("text:style-name", "P1");
++                _Start("text:p");
++                _Start("text:span");
++                wrtfnt();
++            } else {
++                _Start("text:line-break");
++                _End("text:line-break");
++            }
++        }
++
++        pst.waspar = true;
++    }
++
++    if(!pst.comment) {
++        switch(format602.lh) {
++            case 3: pst.pars += 4; break;
++            case 4: pst.pars += 3; break;
++            case 6: pst.pars += 2; break;
++            default: pst.pars +=2; break;
++        }
++        endp = format602.pl-format602.mt-format602.mb;
++        if(((pst.pars+1)/2) >= endp || endofpage) {
++            pst.pars = 0;
++            if(!ini.reformatpars) {
++                _End("text:span");
++                _End("text:p");
++                _AddAtt("text:style-name", "P2");
++                _Start("text:p");
++                _Start("text:span");
++                wrtfnt();
++            }
++        }
++    }
++}
++
++sal_Int16 T602ImportFilter::readnum(unsigned char *ch, bool show)
++{
++    unsigned char buff[21];
++    sal_Int16 i=0;
++
++    while((i<20) && *ch && (*ch!='\n') && (*ch!=','))
++    {
++        *ch = Readchar602();
++        if(show) inschr(*ch);
++        buff[i++] = *ch;
++    }
++    buff[i]='\0';
++
++    // mba: cast from unsigned char via int to sal_Int16 seems to be safe
++	return (sal_Int16) atoi((char *)buff);
++}
++
++unsigned char T602ImportFilter::Setformat602(char *cmd)
++{
++    unsigned char ch;
++    sal_Int16 i;
++
++    ch = Readchar602();
++
++         if (cmd[0]=='M' && cmd[1]=='T') format602.mt = readnum(&ch,false);
++    else if (cmd[0]=='M' && cmd[1]=='B') format602.mb = readnum(&ch,false);
++    // else if (cmd[0]=='T' && cmd[1]=='B') {}
++    // else if (cmd[0]=='H' && cmd[1]=='E') {}
++    // else if (cmd[0]=='F' && cmd[1]=='O') {}
++    else if (cmd[0]=='C' && cmd[1]=='T') {
++        format602.ct = readnum(&ch,false);
++        if (!ini.forcecode)
++            switch(format602.ct) {
++                case 0:  ini.xcode = KAM; break;
++                case 1:  ini.xcode = L2;  break;
++                case 2:  ini.xcode = KOI; break;
++                default: ini.xcode = KAM; break;
++            }
++        }
++    else if (cmd[0]=='P' && cmd[1]=='N')  format602.pn = readnum(&ch,false);
++    else if (cmd[0]=='L' && cmd[1]=='H')  format602.lh = readnum(&ch,false);
++    // else if(cmd[0]=='S' && cmd[1]=='T') {} //styl
++    else if (cmd[0]=='L' && cmd[1]=='M')  format602.lm = readnum(&ch,false);
++    else if (cmd[0]=='R' && cmd[1]=='M')  format602.rm = readnum(&ch,false);
++    else if (cmd[0]=='P' && cmd[1]=='L')  format602.pl = readnum(&ch,false);
++    else if (cmd[0]=='P' && cmd[1]=='A') { if(pst.pars) par602(true); }
++    else if (cmd[0]=='C' && cmd[1]=='P') {
++        i = readnum(&ch,false);
++        if ((i+pst.pars/2) > (format602.pl-format602.mt-format602.mb))
++            if(pst.pars) par602(true);
++    }
++    while (ch && (ch != '\n')) ch = Readchar602();
++    return ch;
++}
++
++tnode T602ImportFilter::PointCmd602(unsigned char *ch)
++{
++    char pcmd[2];
++
++    // warning: uChar -> char
++	pcmd[0] = (char) toupper(*ch); inschr(*ch);
++    *ch = Readchar602();
++    if (!*ch) return EEND;
++    if (*ch=='\n') return EOL;
++    if (!isalpha(*ch)) return (*ch<32) ? SETCH : WRITE;
++
++	// warning: uChar -> char
++    pcmd[1] = (char) toupper(*ch); inschr(*ch);
++
++         if (pcmd[0]=='P' && pcmd[1]=='A') { if (pst.pars) pst.willbeeop = true; }
++    else if (pcmd[0]=='C' && pcmd[1]=='P') { if (pst.pars) pst.willbeeop = true; }
++    else if (pcmd[0]=='P' && pcmd[1]=='I') {
++        while (*ch && (*ch != '\n') && (*ch != ','))
++            { *ch = Readchar602(); inschr(*ch); }
++        if (!*ch) return EEND;
++        if (*ch=='\n') return EOL;
++        if (*ch==',') { *ch = Readchar602(); inschr(*ch); }
++        pst.pars += (readnum(ch,true)*2);
++        if (!*ch) return EEND;
++        if (*ch=='\n') return EOL;
++    }
++    // else if(pcmd[0]=='K'&&pcmd[1]=='P') {}
++    // else if(pcmd[0]=='H'&&pcmd[1]=='E') {}
++    // else if(pcmd[0]=='F'&&pcmd[1]=='O') {}
++
++    return READCH;
++}
++
++
++void T602ImportFilter::Read602()
++{
++    unsigned char ch=0;
++    char cmd602[3];
++
++    Reference < XAttributeList > mAttrList ( mpAttrList );
++
++    if (node==QUIT) return;
++
++    _AddAtt("text:style-name", "P1");
++    _Start("text:p");
++    _AddAtt("text:style-name", "T1");
++    _Start("text:span");
++
++    if (node==START) { node = EOL; }
++
++    while (node != EEND) {
++        switch (node) {
++        case READCH:
++            ch = Readchar602();
++            if (ch == 0) node = EEND;
++            else if (ch == '\n') {
++                if(!pst.willbeeop) par602(false);
++                node = EOL;
++            } else if (ch < 32) node = SETCH;
++            else node = WRITE;
++            break;
++        case EOL:
++            ch = Readchar602();
++            pst.comment = false;
++            if (pst.willbeeop) par602(true);
++            pst.willbeeop = false;
++            if(ch == 0) node = EEND;
++            else if (ch == '@') node = EXPCMD;
++            else if (ch == '\n') { par602(false); node = EOL; }
++            else if (ch < 32) {pst.ccafterln = true; node = SETCH; break;}
++            else node = WRITE;
++            if (ch == '.') { pst.comment = true; node = POCMD; }
++            pst.ccafterln = false;
++            break;
++
++        case POCMD: inschr('.');
++            ch = Readchar602();
++            if(ch == 0) node = EEND;
++            else if(isalpha(ch)) node = PointCmd602(&ch);
++            else if(ch <32) node=SETCH;
++            else node = WRITE;
++            break;
++
++        case EXPCMD: ch = Readchar602();
++            if(ch == 0) {inschr('@'); node = EEND; }
++            else if(isupper(ch)) {
++                cmd602[0] = ch;
++                ch = Readchar602();
++                cmd602[1] = ch;
++                cmd602[2] = '\0';
++                if(isupper(ch)) node = SETCMD;   //nedodelano
++                else { inschr('@'); _Chars(cmd602); node = READCH; }
++            } else {
++                inschr('@');
++                if(ch<32) node = SETCH;
++                else node = WRITE;}
++            break;
++
++        case SETCMD:
++            ch = Setformat602(cmd602);
++            if(ch == 0) node = EEND;
++            else if(ch == '\n') node = EOL;
++            else node = READCH;
++            break;
++
++        case SETCH :
++			// warning: potentially uninitialized
++            switch(ch) {
++            case '\t' : _Start("text:tab-stop");
++                    _End("text:tab-stop");
++                    break;
++            case 0x03 : break; //condensed
++            case 0x01 : break; //elite
++            case 0x11 : break; //uzv1
++            case 0x12 : break; //uzv2
++            case 0x15 : break; //uzv3
++            case 0x17 : break; //uzv4
++            case 0x18 : break; //uzv5
++            case 0x19 : break; //uzv6
++            case 0x13 : fst.uline = !fst.uline;break;
++            case 0x02 : setfnt(fat,false);     break;
++            case 0x04 : setfnt(cursive,false); break;
++            case 0x0f : setfnt(bold,false);    break;
++            case 0x10 : setfnt(tall,false);    break;
++            case 0x1d : setfnt(big,false);     break;
++            case 0x14 : setfnt(hindex,false);  break;
++            case 0x16 : setfnt(lindex,false);  break;
++            default   : break;
++            }
++            if(pst.ccafterln) node = EOL;
++            else node = READCH;
++            break;
++
++        case WRITE :
++            switch(ch) {
++            case 0x8d:
++                ch = Readchar602();
++                if( ch == 0x0a) {
++                    if(ini.reformatpars) inschr(' ');
++                    else par602(false); //formatovaci radek
++                    node = EOL;
++                } else {
++                    inschr(0x8d);//inschr(' ');
++                    if(ch == 0) node = EEND;
++                    else if(ch == '\n') {
++                        if(!pst.willbeeop) par602(false);
++                        node = EOL; }
++                    else if(ch < 32) node = SETCH;
++                    else node = WRITE;
++                }
++                break;
++            case 0xfe:
++                if (ini.showcomm||!pst.comment) inschr(' ');
++                node = READCH;
++                break;
++            case 0xad:
++                ch = Readchar602();
++                if( ch==0x8d ) {
++                    if(ini.showcomm||!pst.comment) { //formatovaci pomlcka
++                        if(!ini.reformatpars)
++                            inschr('-');
++                        else {
++                            pst.wasspace--;
++                            pst.wasfdash = true;
++                        }
++                    }
++                    node=WRITE;
++                } else {
++                    inschr(0xad);
++                    if(ch == 0) node = EEND;
++                    else if(ch == '\n') {
++                        if(!pst.willbeeop) par602(false);
++                        node = EOL; }
++                    else if(ch < 32) node = SETCH;
++                    else node = WRITE;
++                }
++                break;
++            default:
++                inschr(ch);
++                node = READCH;
++                break;
++            }
++            break;
++        default: break;
++        }
++    }
++
++    _End("text:p");
++    node = QUIT;
++}
++
++// XServiceInfo
++OUString SAL_CALL T602ImportFilter::getImplementationName(  )
++    throw (RuntimeException)
++{
++    return T602ImportFilter_getImplementationName();
++}
++
++sal_Bool SAL_CALL T602ImportFilter::supportsService( const OUString& rServiceName )
++    throw (RuntimeException)
++{
++    return T602ImportFilter_supportsService( rServiceName );
++}
++
++Sequence< OUString > SAL_CALL T602ImportFilter::getSupportedServiceNames(  )
++    throw (RuntimeException)
++{
++    return T602ImportFilter_getSupportedServiceNames();
++}
++
++#define IMPLEMENTATION_NAME "com.sun.star.comp.Writer.T602ImportFilter"
++
++OUString T602ImportFilter_getImplementationName ()
++    throw (RuntimeException)
++{
++    return OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
++}
++
++#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
++#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
++sal_Bool SAL_CALL T602ImportFilter_supportsService( const OUString& ServiceName )
++    throw (RuntimeException)
++{
++    return (ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) ) ||
++        ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME2 ) ) );
++}
++
++Sequence< OUString > SAL_CALL T602ImportFilter_getSupportedServiceNames(  )
++    throw (RuntimeException)
++{
++    Sequence < OUString > aRet(2);
++    OUString* pArray = aRet.getArray();
++    pArray[0] =  OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME1 ) );
++    pArray[1] =  OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME2 ) );
++    return aRet;
++}
++#undef SERVICE_NAME2
++#undef SERVICE_NAME1
++#undef IMPLEMENTATION_NAME
++
++Reference< XInterface > SAL_CALL T602ImportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr)
++    throw( Exception )
++{
++    return (cppu::OWeakObject*) new T602ImportFilter( rSMgr );
++}
++
++/* Reference < XInterface > SAL_CALL CreateInstance( const Reference< XMultiServiceFactory > &r)
++throw ( Exception )
++{
++    return Reference< XInterface > (( OWeakObject *) new T602ImportFilter(r));
++}
++
++Sequence < OUString > getSupportedServiceNames()
++throw ( RuntimeException )
++{
++    static Sequence < OUString > *pNames = 0;
++    if( ! pNames ) {
++        MutexGuard guard( Mutex::getGlobalMutex() );
++        if( !pNames ) {
++            static Sequence< OUString > seqNames(2);
++            seqNames.getArray()[0] = OUString::createFromAscii(IMPLEMENTATION_NAME);
++            pNames = &seqNames;
++        }
++    }
++    return *pNames;
++}*/
++
++T602ImportFilterDialog::T602ImportFilterDialog(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory > &r ) :
++    mxMSF( r ), mpResMgr( NULL ) {}
++
++T602ImportFilterDialog::~T602ImportFilterDialog()
++{
++    if (mpResMgr)
++    	delete mpResMgr;
++}
++
++// XLocalizable
++
++void SAL_CALL T602ImportFilterDialog::setLocale( const Locale& eLocale )
++	throw(::com::sun::star::uno::RuntimeException)
++{
++	meLocale = eLocale;
++	initLocale();
++}
++
++Locale SAL_CALL T602ImportFilterDialog::getLocale()
++	throw(::com::sun::star::uno::RuntimeException)
++{
++	return meLocale;
++}
++
++sal_Bool T602ImportFilterDialog::OptionsDlg()
++{
++    sal_Bool ret = sal_False;
++
++    Any any;
++#define _propInt(_prop,_nam,_val) \
++    any <<= (sal_Int32)_val;\
++    _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
++#define _propShort(_prop,_nam,_val) \
++    any <<= (sal_Int16)_val;\
++    _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
++#define _propBool(_prop,_nam,_val) \
++    any <<= (sal_Bool)_val;\
++    _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
++#define _propString(_prop,_nam,_val) \
++    any <<= OUString::createFromAscii(_val);\
++    _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
++#define _propStringFromResId(_prop,_nam,_val) \
++    any <<= getResStr(_val);\
++    _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
++#define _propGet(_prop,_nam) \
++    _prop->getPropertyValue(OUString::createFromAscii(_nam));
++#define _InstCtx(_path,_ctx)\
++    rServiceManager->createInstanceWithContext(\
++    OUString::createFromAscii(_path),_ctx);
++#define _Inst(_path)\
++    xMultiServiceFactory->createInstance(OUString::createFromAscii(_path) );
++#define _Insert(_cont,_nam,_obj) \
++    any <<= _obj;\
++    _cont->insertByName( OUString::createFromAscii(_nam), any );
++
++    Reference < XComponentContext > rComponentContext = defaultBootstrap_InitialComponentContext();
++    Reference < XMultiComponentFactory > rServiceManager = rComponentContext->getServiceManager();
++    Reference < XInterface > rInstance = _InstCtx("com.sun.star.awt.UnoControlDialogModel", rComponentContext );
++
++    Reference <XMultiServiceFactory> xMultiServiceFactory (rInstance,UNO_QUERY);
++
++    Reference < XPropertySet > xPSetDialog( rInstance, UNO_QUERY );
++    _propInt(xPSetDialog,"PositionX",100);
++    _propInt(xPSetDialog,"PositionY",100);
++    _propInt(xPSetDialog,"Width",130);
++    _propInt(xPSetDialog,"Height",90);
++    _propStringFromResId(xPSetDialog,"Title", T602FILTER_STR_IMPORT_DIALOG_TITLE);
++
++#define T602DLG_OK_BUTTON    "ok_button"
++#define T602DLG_CANCEL_BUTTON    "cancel_button"
++#define T602DLG_CODE_LB        "code_lb"
++#define T602DLG_AZBUKA_CB    "azbuka_cb"
++#define T602DLG_COMMENT_CB    "comment_cb"
++#define T602DLG_REFORMAT_CB    "reformat_cb"
++#define T602DLG_CODE_TXT    "code_txt"
++
++    Reference < XInterface > TextModel = _Inst("com.sun.star.awt.UnoControlFixedTextModel");
++    Reference < XPropertySet > xPSetText( TextModel, UNO_QUERY );
++    _propInt(xPSetText,"PositionX",10);
++    _propInt(xPSetText,"PositionY",8);
++    _propInt(xPSetText,"Width",30);
++    _propInt(xPSetText,"Height",14);
++    _propString(xPSetText,"Name",T602DLG_CODE_TXT);
++    _propStringFromResId(xPSetText,"Label",T602FILTER_STR_ENCODING_LABEL);
++
++    Reference < XInterface > ListBoxModel = _Inst("com.sun.star.awt.UnoControlListBoxModel");
++    Reference < XPropertySet > xPSetCodeLB( ListBoxModel, UNO_QUERY );
++    _propInt(xPSetCodeLB,"PositionX",40);
++    _propInt(xPSetCodeLB,"PositionY",5);
++    _propInt(xPSetCodeLB,"Width",85);
++    _propInt(xPSetCodeLB,"Height",14);
++    _propString(xPSetCodeLB,"Name",T602DLG_CODE_LB);
++    _propShort(xPSetCodeLB,"TabIndex",1);
++    _propBool(xPSetCodeLB,"Dropdown",true);
++    _propBool(xPSetCodeLB,"MultiSelection",false);
++
++    Sequence< OUString > ous(4);
++    ous[0] = getResStr(T602FILTER_STR_ENCODING_AUTO);
++    ous[1] = getResStr(T602FILTER_STR_ENCODING_CP852);
++    ous[2] = getResStr(T602FILTER_STR_ENCODING_CP895);
++    ous[3] = getResStr(T602FILTER_STR_ENCODING_KOI8CS2);
++    any <<= ous;
++    xPSetCodeLB->setPropertyValue(OUString::createFromAscii("StringItemList"), any);
++
++    Sequence < sal_Int16 > shr(1);
++    shr[0] = ini.forcecode ? ((sal_Int16) ini.xcode) + 1 : 0;
++    any <<= shr;
++    xPSetCodeLB->setPropertyValue(OUString::createFromAscii("SelectedItems"), any);
++
++    Reference < XInterface > AzbCheckBoxModel = _Inst("com.sun.star.awt.UnoControlCheckBoxModel");
++    Reference < XPropertySet > xPSetAzbukaCB( AzbCheckBoxModel, UNO_QUERY );
++    _propInt(xPSetAzbukaCB,"PositionX",10);
++    _propInt(xPSetAzbukaCB,"PositionY",25);
++    _propInt(xPSetAzbukaCB,"Width",100);
++    _propInt(xPSetAzbukaCB,"Height",14);
++    _propString(xPSetAzbukaCB,"Name",T602DLG_AZBUKA_CB);
++    _propShort(xPSetAzbukaCB,"TabIndex",2);
++    _propStringFromResId(xPSetAzbukaCB,"Label",T602FILTER_STR_CYRILLIC_MODE);
++    _propShort(xPSetAzbukaCB,"State",ini.ruscode);
++
++    Reference < XInterface > RefCheckBoxModel = _Inst("com.sun.star.awt.UnoControlCheckBoxModel");
++    Reference < XPropertySet > xPSetRefCB( RefCheckBoxModel, UNO_QUERY );
++    _propInt(xPSetRefCB,"PositionX",10);
++    _propInt(xPSetRefCB,"PositionY",40);
++    _propInt(xPSetRefCB,"Width",100);
++    _propInt(xPSetRefCB,"Height",14);
++    _propString(xPSetRefCB,"Name",T602DLG_REFORMAT_CB);
++    _propShort(xPSetRefCB,"TabIndex",3);
++    _propStringFromResId(xPSetRefCB,"Label",T602FILTER_STR_REFORMAT_TEXT);
++    _propShort(xPSetRefCB,"State",ini.reformatpars);
++
++    Reference < XInterface > CommCheckBoxModel = _Inst("com.sun.star.awt.UnoControlCheckBoxModel");
++    Reference < XPropertySet > xPSetCommCB( CommCheckBoxModel, UNO_QUERY );
++    _propInt(xPSetCommCB,"PositionX",10);
++    _propInt(xPSetCommCB,"PositionY",55);
++    _propInt(xPSetCommCB,"Width",100);
++    _propInt(xPSetCommCB,"Height",14);
++    _propString(xPSetCommCB,"Name",T602DLG_COMMENT_CB);
++    _propShort(xPSetCommCB,"TabIndex",4);
++    _propStringFromResId(xPSetCommCB,"Label",T602FILTER_STR_DOT_COMMANDS);
++    _propShort(xPSetCommCB,"State",ini.showcomm);
++
++    Reference < XInterface > CancelButtonModel = _Inst("com.sun.star.awt.UnoControlButtonModel");
++    Reference < XPropertySet > xPSetCancelButton( CancelButtonModel, UNO_QUERY );
++    _propInt(xPSetCancelButton,"PositionX",10);
++    _propInt(xPSetCancelButton,"PositionY",70);
++    _propInt(xPSetCancelButton,"Width",50);
++    _propInt(xPSetCancelButton,"Height",14);
++    _propString(xPSetCancelButton,"Name",T602DLG_CANCEL_BUTTON);
++    _propShort(xPSetCancelButton,"TabIndex",5);
++    _propShort(xPSetCancelButton,"PushButtonType",2);
++    _propStringFromResId(xPSetCancelButton,"Label",T602FILTER_STR_CANCEL_BUTTON);
++
++    Reference < XInterface > OkButtonModel = _Inst("com.sun.star.awt.UnoControlButtonModel");
++    Reference < XPropertySet > xPSetOkButton( OkButtonModel, UNO_QUERY );
++    _propInt(xPSetOkButton,"PositionX",70);
++    _propInt(xPSetOkButton,"PositionY",70);
++    _propInt(xPSetOkButton,"Width",50);
++    _propInt(xPSetOkButton,"Height",14);
++    _propString(xPSetOkButton,"Name",T602DLG_OK_BUTTON);
++    _propShort(xPSetOkButton,"TabIndex",0);
++    _propShort(xPSetOkButton,"PushButtonType",1);
++    _propStringFromResId(xPSetOkButton,"Label",T602FILTER_STR_OK_BUTTON);
++    _propBool(xPSetOkButton,"DefaultButton",true);
++
++    Reference < XNameContainer > xNameCont (rInstance,UNO_QUERY);
++
++    _Insert(xNameCont, T602DLG_OK_BUTTON, OkButtonModel);
++    _Insert(xNameCont, T602DLG_CANCEL_BUTTON, CancelButtonModel);
++    _Insert(xNameCont, T602DLG_AZBUKA_CB, AzbCheckBoxModel);
++    _Insert(xNameCont, T602DLG_REFORMAT_CB, RefCheckBoxModel);
++    _Insert(xNameCont, T602DLG_COMMENT_CB, CommCheckBoxModel);
++    _Insert(xNameCont, T602DLG_CODE_LB, ListBoxModel);
++    _Insert(xNameCont, T602DLG_CODE_TXT, TextModel);
++
++    Reference< XInterface > dialog = _InstCtx("com.sun.star.awt.UnoControlDialog",rComponentContext);
++
++    Reference < XControl > xControl (dialog,UNO_QUERY);
++    Reference < XControlModel > xControlModel (rInstance,UNO_QUERY);
++
++    if(!xControl.is())
++        sal_False;
++
++    xControl->setModel( xControlModel );
++
++    Reference< XInterface > toolkit = _InstCtx("com.sun.star.awt.ExtToolkit", rComponentContext);
++
++    Reference < XToolkit > xToolkit (toolkit,UNO_QUERY);
++    Reference < XWindow > xWindow (xControl,UNO_QUERY);
++
++    if(!xWindow.is())
++        return sal_False;
++
++    xWindow->setVisible( false );
++    xControl->createPeer( xToolkit, NULL );
++
++    Reference < XDialog > xDialog (dialog,UNO_QUERY);
++
++    if(!xDialog.is())
++        return sal_False;
++
++    ret = ( xDialog->execute() != 0 );
++    if ( ret ) {
++
++        sal_Int16 tt = 0;
++
++        any = _propGet(xPSetAzbukaCB, "State"); any >>= tt; ini.ruscode      = tt;
++        any = _propGet(xPSetRefCB,    "State"); any >>= tt; ini.reformatpars = tt;
++        any = _propGet(xPSetCommCB,   "State"); any >>= tt; ini.showcomm     = tt;
++
++        any = _propGet(xPSetCodeLB,   "SelectedItems"); any >>= shr;
++
++        if( shr[0] > 0 ) {
++            ini.xcode = (tcode)(shr[0]-1);
++            ini.forcecode = true;
++        } else {
++            ini.forcecode = false;
++        }
++    }
++
++    Reference < XComponent > xComponent (dialog,UNO_QUERY);
++
++    xComponent->dispose();
++
++    return ret;
++}
++
++void T602ImportFilterDialog::initLocale()
++{
++	rtl::OString aModName( "t602filter" );
++	aModName += rtl::OString::valueOf( sal_Int32( SUPD ) );
++
++	mpResMgr = ResMgr::CreateResMgr( aModName.getStr(), meLocale );
++}
++
++ResMgr* T602ImportFilterDialog::getResMgr()
++{
++	if( !mpResMgr )
++		initLocale();
++	return mpResMgr;
++}
++
++void SAL_CALL T602ImportFilterDialog::setTitle( const ::rtl::OUString& )
++            throw (::com::sun::star::uno::RuntimeException)
++{
++}
++
++sal_Int16 SAL_CALL T602ImportFilterDialog::execute()
++            throw (::com::sun::star::uno::RuntimeException)
++{
++    if (OptionsDlg())
++		return com::sun::star::ui::dialogs::ExecutableDialogResults::OK;
++	else
++		return com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL;
++}
++
++rtl::OUString T602ImportFilterDialog::getResStr( sal_Int16 resid )
++{
++	rtl::OUString sStr = String( ResId( resid, *getResMgr() ) );
++	return sStr;
++}
++
++uno::Sequence<beans::PropertyValue> SAL_CALL T602ImportFilterDialog::getPropertyValues() throw(uno::RuntimeException)
++{
++	return uno::Sequence<beans::PropertyValue>();
++}
++
++void SAL_CALL T602ImportFilterDialog::setPropertyValues( const uno::Sequence<beans::PropertyValue>& )
++					throw(beans::UnknownPropertyException, beans::PropertyVetoException,
++							lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
++{
++}
++
++
++// XServiceInfo
++OUString SAL_CALL T602ImportFilterDialog::getImplementationName(  )
++    throw (RuntimeException)
++{
++    return T602ImportFilterDialog_getImplementationName();
++}
++
++sal_Bool SAL_CALL T602ImportFilterDialog::supportsService( const OUString& rServiceName )
++    throw (RuntimeException)
++{
++    return T602ImportFilterDialog_supportsService( rServiceName );
++}
++
++Sequence< OUString > SAL_CALL T602ImportFilterDialog::getSupportedServiceNames(  )
++    throw (RuntimeException)
++{
++    return T602ImportFilterDialog_getSupportedServiceNames();
++}
++
++#define IMPLEMENTATION_NAME "com.sun.star.comp.Writer.T602ImportFilterDialog"
++
++OUString T602ImportFilterDialog_getImplementationName ()
++    throw (RuntimeException)
++{
++    return OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
++}
++
++#define SERVICE_NAME "com.sun.star.ui.dialogs.FilterOptionsDialog"
++sal_Bool SAL_CALL T602ImportFilterDialog_supportsService( const OUString& ServiceName )
++    throw (RuntimeException)
++{
++    return ( ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) ) );
++}
++
++Sequence< OUString > SAL_CALL T602ImportFilterDialog_getSupportedServiceNames(  )
++    throw (RuntimeException)
++{
++    Sequence < OUString > aRet(1);
++    OUString* pArray = aRet.getArray();
++    pArray[0] =  OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
++    return aRet;
++}
++#undef SERVICE_NAME
++
++Reference< XInterface > SAL_CALL T602ImportFilterDialog_createInstance( const Reference< XMultiServiceFactory > & rSMgr)
++    throw( Exception )
++{
++    return (cppu::OWeakObject*) new T602ImportFilterDialog( rSMgr );
++}
++
++}
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ filter/source/t602/t602filter.hrc	23 Aug 2007 12:41:20 -0000	1.1.2.3
+@@ -0,0 +1,56 @@
++ /*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  Copyright (C) 2007 Novell, Inc. (http://www.novell.com)
++ *
++ *  $RCSfile$
++ *
++ *  $Revision$
++ *
++ *  last change: $Author$ $Date$
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2004-2007 Milan Broz <mbroz redhat com>
++ *    Copyright 2007 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library 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 for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++
++#ifndef T602FILTER_HRC
++#define T602FILTER_HRC
++
++#define T602FILTER_RES_START 1000
++
++#define T602FILTER_STR_IMPORT_DIALOG_TITLE      (T602FILTER_RES_START)
++#define T602FILTER_STR_ENCODING_LABEL           (T602FILTER_RES_START+1)
++#define T602FILTER_STR_ENCODING_AUTO            (T602FILTER_RES_START+2)
++#define T602FILTER_STR_ENCODING_CP852           (T602FILTER_RES_START+3)
++#define T602FILTER_STR_ENCODING_CP895           (T602FILTER_RES_START+4)
++#define T602FILTER_STR_ENCODING_KOI8CS2         (T602FILTER_RES_START+5)
++#define T602FILTER_STR_CYRILLIC_MODE            (T602FILTER_RES_START+6)
++#define T602FILTER_STR_REFORMAT_TEXT            (T602FILTER_RES_START+7)
++#define T602FILTER_STR_DOT_COMMANDS             (T602FILTER_RES_START+8)
++#define T602FILTER_STR_CANCEL_BUTTON            (T602FILTER_RES_START+9)
++#define T602FILTER_STR_OK_BUTTON                (T602FILTER_RES_START+10)
++
++#endif // T602FILTER_HRC
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ filter/source/t602/t602filter.hxx	20 Feb 2008 18:58:09 -0000	1.1.2.7
+@@ -0,0 +1,298 @@
++ /*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  Copyright (C) 2004-2007 Milan Broz (asi seznam cz)
++ *  Copyright (C) 2007 Novell, Inc. (http://www.novell.com)
++ *
++ *  $RCSfile$
++ *
++ *  $Revision$
++ *
++ *  last change: $Author$ $Date$
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2004-2007 Milan Broz <mbroz redhat com>
++ *    Copyright 2007 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library 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 for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++
++#ifndef _T602FILTER_HXX
++#define _T602FILTER_HXX
++
++#include <com/sun/star/document/XFilter.hpp>
++#include <com/sun/star/document/XImporter.hpp>
++#include <com/sun/star/document/XExtendedFilterDetection.hpp>
++#include <com/sun/star/io/XInputStream.hpp>
++#include <com/sun/star/lang/XInitialization.hpp>
++#include <com/sun/star/lang/XServiceInfo.hpp>
++#include <com/sun/star/lang/XLocalizable.hpp>
++#include <com/sun/star/beans/XPropertyAccess.hpp>
++#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
++#include <cppuhelper/implbase5.hxx>
++#include <cppuhelper/implbase4.hxx>
++#include <xmloff/attrlist.hxx>
++#include <tools/resmgr.hxx>
++
++namespace T602ImportFilter {
++
++typedef enum {L2,KAM,KOI} tcode;
++
++typedef enum {
++        standard,   // default
++        fat,        // bold
++        cursive,    // italic
++        bold,       // wide
++        tall,       // high
++        big,        // big
++        lindex,     // lower index
++        hindex,     // upper index
++        err,        // not set yet
++        chngul      // change underline
++} fonts;
++
++typedef enum {START,READCH,EOL,POCMD,EXPCMD,SETCMD,SETCH,WRITE,EEND,QUIT} tnode;
++
++::rtl::OUString getImplementationName()
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++::com::sun::star::uno::Sequence < ::rtl::OUString > getSupportedServiceNames()
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++
++::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > SAL_CALL
++    CreateInstance( const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &r)
++    throw ( ::com::sun::star::uno::Exception );
++
++
++//
++// class T602ImportFilter
++//
++
++struct inistruct 
++{
++        bool showcomm;      // true   show comment lines
++        bool forcecode;     // false  the user has changed the encoding with something else than @CT
++        tcode xcode;        // KAM    encoding set - forced
++        bool ruscode;       // false  Russian tables turned on
++        bool reformatpars;  // false  Reformat paragraphs (whitespaces and line breaks)
++        sal_Int16 fontsize;       // font size in points
++
++		inistruct()
++			: showcomm( true )
++			, forcecode( false )
++			, xcode ( KAM )
++			, ruscode ( false )
++			, reformatpars ( false )
++			, fontsize (10)
++		{
++		};
++};
++
++class T602ImportFilterDialog : public cppu::WeakImplHelper4 <
++		com::sun::star::ui::dialogs::XExecutableDialog,
++		com::sun::star::lang::XLocalizable,
++		com::sun::star::lang::XServiceInfo,
++		com::sun::star::beans::XPropertyAccess
++>
++{
++    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
++	com::sun::star::lang::Locale meLocale;
++    ResMgr *mpResMgr;
++    sal_Bool OptionsDlg();
++    ResMgr* getResMgr();
++    rtl::OUString getResStr( sal_Int16 resid );
++    void initLocale();
++
++    ~T602ImportFilterDialog();
++
++	// XExecutableDialog
++       virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle )
++            throw (::com::sun::star::uno::RuntimeException);
++       virtual sal_Int16 SAL_CALL execute()
++            throw (::com::sun::star::uno::RuntimeException);
++
++	// XLocalizable
++        virtual void SAL_CALL setLocale( const com::sun::star::lang::Locale& eLocale )
++            throw(::com::sun::star::uno::RuntimeException);
++        virtual com::sun::star::lang::Locale SAL_CALL getLocale()
++            throw(::com::sun::star::uno::RuntimeException);
++
++    // XServiceInfo
++        virtual ::rtl::OUString SAL_CALL getImplementationName(  )
++            throw (::com::sun::star::uno::RuntimeException);
++        virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
++            throw (::com::sun::star::uno::RuntimeException);
++        virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  )
++            throw (::com::sun::star::uno::RuntimeException);
++
++	// XPropertyAccess
++		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
++							SAL_CALL getPropertyValues() throw (::com::sun::star::uno::RuntimeException);
++		virtual void SAL_CALL	setPropertyValues( const ::com::sun::star::uno::Sequence<
++									::com::sun::star::beans::PropertyValue >& aProps )
++								throw (::com::sun::star::beans::UnknownPropertyException,
++										::com::sun::star::beans::PropertyVetoException,
++										::com::sun::star::lang::IllegalArgumentException,
++										::com::sun::star::lang::WrappedTargetException,
++										::com::sun::star::uno::RuntimeException);
++
++public:
++	T602ImportFilterDialog(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory > &r );
++
++};
++
++
++class T602ImportFilter : public cppu::WeakImplHelper5 <
++    com::sun::star::document::XFilter,
++    com::sun::star::document::XImporter,
++    com::sun::star::document::XExtendedFilterDetection,
++    com::sun::star::lang::XInitialization,
++    com::sun::star::lang::XServiceInfo    
++>
++{
++private:
++//    ::com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xInputStream;
++    ::com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler> mxHandler;
++    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
++    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
++    ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > mxInputStream;
++    ::rtl::OUString msFilterName;
++
++    SvXMLAttributeList *mpAttrList;
++
++    tnode node;         // START
++
++    struct {
++        sal_Int16   mt;       // row for header
++        sal_Int16   mb;       // row for footer
++        sal_Int16   tb;       // tabs
++        sal_Int16   ct;       // encoding (0-kamenik, 1-latin2, 2-koi8)
++        sal_Int16   pn;       // from page number
++        sal_Int16   lh;       // linespacing 3-2x, 4-1.5x, 6-1x
++        sal_Int16   lm;       // left border
++        sal_Int16   rm;       // right border
++        sal_Int16   pl;       // page length
++    } format602;
++
++    // Initialisation constants - they are not changed during the conversion
++
++    inistruct ini;
++
++    // Font state - changes based on font
++
++    struct {
++        fonts nowfnt;     // current font
++        fonts oldfnt;     // previous font
++        bool uline;       // underlined
++        bool olduline;    // previous value of uline (font change)
++    } fst;
++
++    // Paragraph state
++
++    struct {
++        sal_Int16 pars;            //       the number of line endings times linespacing on the current page
++        bool comment;        //       in comments
++        sal_Int16 wasspace;        // 0     there was a space - for reformatting
++        bool wasfdash;       // 0     formatting dash
++        bool ccafterln;      // false
++        bool willbeeop;      // false
++        bool waspar;         // false
++    } pst;
++
++    void Reset602();
++    unsigned char Readchar602();
++    void Read602();
++    void par602(bool endofpage);
++    void inschr(unsigned char ch);
++    void inschrdef(unsigned char ch);
++    unsigned char Setformat602(char *cmd);
++    sal_Int16 readnum(unsigned char *ch, bool show);
++    tnode PointCmd602(unsigned char *ch);
++    void setfnt(fonts fnt,bool mustwrite);
++    void wrtfnt();
++
++    sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
++        throw (::com::sun::star::uno::RuntimeException);
++
++    public:
++        T602ImportFilter(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory > &r );
++        ~T602ImportFilter();
++
++    // XFilter
++        virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
++            throw (::com::sun::star::uno::RuntimeException);
++        virtual void SAL_CALL cancel(  )
++            throw (::com::sun::star::uno::RuntimeException) {};
++
++    // XImporter
++        virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
++            throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
++
++    // XExtendedTypeDetection
++        virtual ::rtl::OUString SAL_CALL detect(
++            com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& Descriptor )
++            throw( com::sun::star::uno::RuntimeException );
++
++    // XInitialization
++        virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
++            throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
++
++    // XServiceInfo
++        virtual ::rtl::OUString SAL_CALL getImplementationName(  )
++            throw (::com::sun::star::uno::RuntimeException);
++        virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
++            throw (::com::sun::star::uno::RuntimeException);
++        virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  )
++            throw (::com::sun::star::uno::RuntimeException);
++};
++
++::rtl::OUString T602ImportFilter_getImplementationName()
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++sal_Bool SAL_CALL T602ImportFilter_supportsService( const ::rtl::OUString& ServiceName )
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL T602ImportFilter_getSupportedServiceNames(  )
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
++SAL_CALL T602ImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
++    throw ( ::com::sun::star::uno::Exception );
++
++::rtl::OUString T602ImportFilterDialog_getImplementationName()
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++sal_Bool SAL_CALL T602ImportFilterDialog_supportsService( const ::rtl::OUString& ServiceName )
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL T602ImportFilterDialog_getSupportedServiceNames(  )
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
++SAL_CALL T602ImportFilterDialog_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
++    throw ( ::com::sun::star::uno::Exception );
++
++}
++
++#endif
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ filter/source/t602/t602filter.map	13 Apr 2007 08:04:23 -0000	1.1.2.1
+@@ -0,0 +1,8 @@
++T602IMP_1_0 {
++	global:
++		component_getImplementationEnvironment;
++		component_writeInfo;
++		component_getFactory;
++	local:
++		*;
++};
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ filter/source/t602/t602filter.src	4 Nov 2007 15:52:37 -0000	1.1.2.8
+@@ -0,0 +1,94 @@
++ /*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  Copyright (C) 2007 Novell, Inc. (http://www.novell.com)
++ *
++ *  $RCSfile$
++ *
++ *  $Revision$
++ *
++ *  last change: $Author$ $Date$
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2004-2007 Milan Broz <mbroz redhat com>
++ *    Copyright 2007 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library 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 for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++
++#include "t602filter.hrc"
++
++String T602FILTER_STR_IMPORT_DIALOG_TITLE
++{
++    Text [ en-US ] = "Settings for T602 import";
++};
++
++String T602FILTER_STR_ENCODING_LABEL
++{
++    Text [ en-US ] = "Encoding";
++};
++
++String T602FILTER_STR_ENCODING_AUTO
++{
++    Text [ en-US ] = "Automatic";
++};
++
++String T602FILTER_STR_ENCODING_CP852
++{
++    Text [ en-US ] = "CP852 (Latin2)";
++};
++
++String T602FILTER_STR_ENCODING_CP895
++{
++    Text [ en-US ] = "CP895 (KEYB2CS, Kamenicky)";
++};
++
++String T602FILTER_STR_ENCODING_KOI8CS2
++{
++    Text [ en-US ] = "KOI8 CS2";
++};
++
++String T602FILTER_STR_CYRILLIC_MODE
++{
++    Text [ en-US ] = "Mode for Russian language (Cyrillic)";
++};
++
++String T602FILTER_STR_REFORMAT_TEXT
++{
++    Text [ en-US ] = "Reformat the text";
++};
++
++String T602FILTER_STR_DOT_COMMANDS
++{
++    Text [ en-US ] = "Display dot commands";
++};
++
++String T602FILTER_STR_CANCEL_BUTTON
++{
++    Text [ en-US ] = "Cancel";
++};
++
++String T602FILTER_STR_OK_BUTTON
++{
++    Text [ en-US ] = "OK";
++};

Added: trunk/patches/src680/cws-t602import01-scp2.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/cws-t602import01-scp2.diff	Wed Feb 20 21:10:51 2008
@@ -0,0 +1,29 @@
+--- scp2/source/ooo/file_library_ooo.scp	26 Mar 2007 14:30:18 -0000	1.227
++++ scp2/source/ooo/file_library_ooo.scp	13 Apr 2007 08:44:50 -0000	1.227.4.2
+@@ -1371,6 +1371,8 @@ End
+ 
+ STD_UNO_LIB_FILE_PATCH(gid_File_Lib_Msworks,msworks)
+
++STD_UNO_LIB_FILE_PATCH(gid_File_Lib_T602Filter,t602filter)
++
+ #if !defined(MACOSX) && ( !defined(SYSTEM_MOZILLA) && !defined(WITHOUT_MOZILLA) )
+ 
+ File gid_File_Lib_Mozabdrv
+--- scp2/source/ooo/file_resource_ooo.scp	23 Jan 2007 08:09:31 -0000	1.50
++++ scp2/source/ooo/file_resource_ooo.scp	13 Apr 2007 08:44:51 -0000	1.50.76.1
+@@ -156,3 +156,5 @@ STD_RES_FILE_PATCH( gid_File_Res_XMLSecu
+ 
+ STD_RES_FILE_PATCH( gid_File_Res_UpdChk, updchk )
+ 
++STD_RES_FILE_PATCH( gid_File_Res_T602Filter, t602filter )
++
+--- scp2/source/writer/module_writer.scp	2 Jan 2007 15:31:51 -0000	1.17
++++ scp2/source/writer/module_writer.scp	13 Apr 2007 08:44:51 -0000	1.17.110.2
+@@ -54,6 +54,7 @@ Module gid_Module_Prg_Wrt_Bin
+     gid_File_Lib_Swui,
+     gid_File_Lib_Wpft,
+     gid_File_Lib_Msworks,
++    gid_File_Lib_T602Filter,
+     gid_File_Share_Config_Sofficecfg_Writer_Menubar_Xml,
+     gid_File_Share_Config_Sofficecfg_Writerweb_Menubar_Xml,
+     gid_File_Share_Config_Sofficecfg_Writerglobal_Menubar_Xml,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]