fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / filter / source / t602 / t602filter.cxx
blob4ef5b6deeecf3e480073dfdb10faa733aad87306
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "t602filter.hxx"
21 #include "t602filter.hrc"
23 #include <ctype.h>
24 #include <stdio.h>
26 #include <cppuhelper/factory.hxx>
27 #include <cppuhelper/bootstrap.hxx>
28 #include <com/sun/star/awt/Toolkit.hpp>
29 #include <com/sun/star/bridge/XUnoUrlResolver.hpp>
30 #include <com/sun/star/beans/XPropertySet.hpp>
31 #include <com/sun/star/ucb/XSimpleFileAccess.hpp>
32 #include <com/sun/star/text/XTextDocument.hpp>
33 #include <com/sun/star/container/XNameContainer.hpp>
34 #include <com/sun/star/awt/XControl.hpp>
35 #include <com/sun/star/awt/XDialog.hpp>
36 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
38 using namespace ::rtl;
39 using namespace ::cppu;
40 using namespace ::osl;
41 using namespace ::com::sun::star;
42 using namespace ::com::sun::star::uno;
43 using namespace ::com::sun::star::lang;
44 using namespace ::com::sun::star::registry;
45 using namespace ::com::sun::star::container;
46 using namespace ::com::sun::star::beans;
47 using namespace ::com::sun::star::awt;
48 using namespace ::com::sun::star::xml::sax;
49 using namespace ::com::sun::star::document;
50 using com::sun::star::io::XInputStream;
52 namespace T602ImportFilter {
54 unsigned char kam2lat[129] =
55 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
56 "\xAC\x81\x82\xD4\x84\xD2\x9B\x9F\xD8\xB7\x91\xD6\x96\x92\x8E\xB5" // 8
57 "\x90\xA7\xA6\x93\x94\xE0\x85\xE9\xEC\x99\x9A\xE6\x95\xED\xFC\x9C" // 9
58 "\xA0\xA1\xA2\xA3\xE5\xD5\xDE\xE2\xE7\xFD\xEA\xE8\xCE\xF5\xAE\xAF" // A
59 "\x80\x80\x83\xB3\xB4\xE1\x87\x88\x89\x8A\x8B\x8C\x8F\x97\x8D\xBF" // B
60 "\xC0\xC1\xC2\xC3\xC4\xC5\xCF\x98\x9D\x9E\xA4\xA5\xA8\xA9\x86\xF3" // C
61 "\xCD\xB1\xB2\xB6\xB8\xB9\xBA\xBB\xF7\xD9\xDA\xDB\xDC\xF8\xF9\xDF" // D
62 "\xD0\xD1\xD3\xD7\xAA\xAB\xDD\xB0\xE3\xE4\xEB\xEE\xEF\xF0\xF2\xF4" // E
63 "\xBC\xBD\xBE\xC6\xC7\xC8\xF6\xC9\xCA\xFA\xFB\xCB\xF1\xCC\xFE\xFF"; // F
65 unsigned char koi2lat[129] =
66 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
67 "\x80\x83\x86\xF5\xE1\x87\x88\x89\x8A\x8B\x8C\x8F\x97\xCF\xCF\x98" // 8
68 "\x9D\x9E\xA4\xA5\xA8\xA9\xDB\xDC\xDF\xB1\xB2\xB6\xB8\xB9\xBA\xBB" // 9
69 "\xBC\xBD\xBE\xC6\xC7\xC8\xF6\xC9\xCA\xCB\xCC\xCD\xCE\xAD\xAE\xAF" // A
70 "\xD0\xD1\xD3\xD7\xAA\xAB\xDD\xB0\xE3\xE4\xEB\xEE\xEF\xF0\xF2\xF4" // B
71 "\xDA\xA0\xC0\x9F\xD4\xD8\xEA\xC4\x81\xA1\x85\x92\x96\x94\xE5\xA2" // C
72 "\x93\x84\xFD\xE7\x9C\xA3\xC3\x82\xF7\xEC\xA7\xC2\xF3\xF8\xF9\xC5" // D
73 "\xBF\xB5\xD9\xAC\xD2\xB7\xE8\xB3\x9A\xD6\xDE\x91\x95\x99\xD5\xE0" // E
74 "\xE2\x8E\xFC\xE6\x9B\xE9\xB4\x90\xFA\xED\xA6\xC1\xF1\xFB\xFE\xFF"; // F
76 unsigned char lat2UNC[257] =
77 // 0 1 2 3 4 5 6 7
78 // 8 9 A B C D E F
79 "\x00\xe7\x00\xfc\x00\xe9\x00\xf9\x00\xe4\x01\x6f\x00\xe8\x00\xa3" // 8
80 "\x00\xc6\x00\xd8\x00\xc5\x00\xe6\x00\xf8\x00\xc4\x00\xc4\x00\xe5"
81 "\x00\xc9\x01\x39\x00\xf4\x00\xf4\x00\xf6\x01\x3d\x01\x3e\x00\x20" // 9
82 "\x00\xf2\x00\xd6\x00\xdc\x01\x64\x01\x65\x00\xec\x20\xa7\x01\x0d"
83 "\x00\xe1\x00\xed\x00\xf3\x00\xfa\x00\xa1\x00\xd1\x01\x7d\x01\x7e" // A
84 "\x00\xbf\x00\xf1\x22\x11\x03\xc3\x01\x0c\x00\xa7\x00\xbb\x00\xab"
85 "\x25\x91\x25\x92\x25\x93\x25\x02\x25\x24\x00\xc1\x00\xc2\x01\x1a" // B
86 "\x00\x20\x00\x20\x00\x20\x00\x20\x22\x61\x00\xb1\x22\x65\x25\x10"
87 "\x25\x14\x25\x34\x25\x2c\x25\x1c\x25\x00\x25\x3c\x22\x64\x23\x20" // C
88 "\x23\x21\x22\x48\x00\xba\x22\x1a\x00\xb2\x00\xbd\x00\xbc\x00\xa4"
89 "\x03\xb1\x03\xb2\x01\x0e\x03\x93\x01\x0f\x01\x47\x00\xcd\x03\xc0" // D
90 "\x01\x1b\x25\x18\x25\x0c\x25\x88\x25\x84\x00\xb5\x01\x6e\x25\x80"
91 "\x00\xd3\x00\xdf\x00\xd4\x03\xa6\x03\x98\x01\x48\x01\x60\x01\x61" // E
92 "\x01\x54\x00\xda\x01\x55\x03\xa9\x00\xfd\x00\xdd\x03\xb4\x22\x1e"
93 "\x00\xf8\x02\xdd\x03\xb5\x02\xc7\x22\x29\x00\xa7\x00\xf7\x00\xe0" // F
94 "\x00\xb4\x00\xb0\x00\xc0\x02\xc6\x01\x58\x01\x59\x00\x20\x00\x20";
96 unsigned char rus2UNC[257] =
97 // 0 1 2 3 4 5 6 7
98 // 8 9 A B C D E F
99 "\x04\x11\x00\xfc\x00\xe9\x04\x12\x00\xe4\x01\x6f\x04\x13\x04\x14" // 8
100 "\x04\x01\x04\x16\x04\x17\x04\x18\x04\x19\x00\xc4\x00\xc4\x04\x1a"
101 "\x00\xc9\x01\x39\x01\x3a\x00\xf4\x00\xf6\x01\x3d\x01\x3e\x00\x20" // 9
102 "\x04\x1c\x00\xd6\x00\xdc\x01\x64\x01\x65\x04\x1d\x04\x1f\x01\x0a"
103 "\x00\xe1\x00\xed\x00\xf3\x00\xfa\x04\x20\x04\x22\x01\x7d\x01\x7e" // A
104 "\x04\x23\x04\x24\x04\x43\x04\x44\x01\x0c\x00\xa7\x04\x3b\x04\x3c"
105 "\x04\x47\x04\x26\x04\x27\x25\x02\x25\x24\x00\xc1\x04\x28\x01\x1a" // B
106 "\x04\x29\x04\x2a\x04\x2b\x04\x2c\x04\x2d\x04\x2e\x04\x2f\x25\x10"
107 "\x25\x14\x25\x34\x25\x2c\x25\x1c\x25\x00\x25\x3c\x04\x31\x04\x32" // C
108 "\x04\x33\x04\x51\x04\x36\x04\x37\x04\x38\x04\x39\x04\x3a\x04\x1b"
109 "\x04\x3d\x04\x3f\x01\x0e\x04\x40\x01\x0f\x01\x47\x00\xcd\x04\x42" // D
110 "\x01\x1b\x25\x18\x25\x0c\x25\x88\x25\x84\x04\x46\x01\x6e\x25\x80"
111 "\x00\xd3\x00\xdf\x00\xd4\x04\x48\x04\x49\x01\x48\x01\x60\x01\x61" // E
112 "\x01\x54\x00\xda\x01\x55\x04\x4a\x00\xfd\x00\xdd\x04\x4b\x04\x4c"
113 "\x04\x4d\x02\xdd\x04\x4e\x02\xc7\x04\x4f\x00\xa7\x04\x34\x00\xe0" // F
114 "\x00\xb4\x00\xb0\x00\xc0\x02\xc6\x01\x58\x01\x59\x00\x20\x00\x20";
116 #define _AddAtt(_nam, _val) \
117 mpAttrList->AddAttribute(OUString::createFromAscii( _nam ),\
118 OUString::createFromAscii( _val ) );
120 #define _Start(_nam) \
121 mxHandler->startElement(OUString::createFromAscii(_nam), mAttrList);\
122 mpAttrList->Clear();
124 #define _End(_nam) \
125 mxHandler->endElement(OUString::createFromAscii(_nam));
127 #define _Chars(_ch) \
128 mxHandler->characters(OUString::createFromAscii((sal_Char *) _ch) );
130 inistruct ini;
132 T602ImportFilter::T602ImportFilter(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory > &r ) :
133 mxMSF( r ) {}
135 T602ImportFilter::~T602ImportFilter()
139 // XExtendedTypeDetection
140 OUString T602ImportFilter::detect( Sequence<PropertyValue>& Descriptor)
141 throw(RuntimeException)
143 sal_Int32 nLength = Descriptor.getLength();
144 const PropertyValue * pValue = Descriptor.getConstArray();
145 for ( sal_Int32 i = 0 ; i < nLength; i++)
147 if ( pValue[i].Name == "InputStream" )
148 pValue[i].Value >>= mxInputStream;
151 if (!mxInputStream.is())
152 return OUString();
154 ::com::sun::star::uno::Sequence< sal_Int8 > aData;
155 const size_t numBytes = 4;
156 size_t numBytesRead = 0;
158 numBytesRead = mxInputStream->readSomeBytes (aData, numBytes);
160 if ((numBytesRead != numBytes) || (aData[0] != '@') ||
161 (aData[1] != 'C') || (aData[2] != 'T') || (aData[3] != ' '))
162 return OUString();
164 return OUString( "writer_T602_Document" );
167 // XFilter
168 sal_Bool SAL_CALL T602ImportFilter::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
169 throw (RuntimeException)
171 return importImpl ( aDescriptor );
174 // XImporter
175 void SAL_CALL T602ImportFilter::setTargetDocument( const Reference< ::com::sun::star::lang::XComponent >& xDoc )
176 throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException)
178 mxDoc = xDoc;
181 // XInitialization
182 void SAL_CALL T602ImportFilter::initialize( const Sequence< Any >& aArguments )
183 throw (Exception, RuntimeException)
185 Sequence < PropertyValue > aAnySeq;
186 sal_Int32 nLength = aArguments.getLength();
187 if ( nLength && ( aArguments[0] >>= aAnySeq ) )
189 const PropertyValue * pValue = aAnySeq.getConstArray();
190 nLength = aAnySeq.getLength();
191 for ( sal_Int32 i = 0 ; i < nLength; i++)
193 if ( pValue[i].Name == "Type" )
195 pValue[i].Value >>= msFilterName;
196 break;
202 // Other functions
204 void T602ImportFilter::inschr(unsigned char ch)
206 Reference < XAttributeList > mAttrList ( mpAttrList );
208 if(!ini.showcomm&&pst.comment) return;
210 if(ch==' ') {
211 setfnt(chngul,true);
212 pst.wasspace++;
213 return;
216 if(pst.wasspace > 0) {
217 if(ini.reformatpars) {
218 if(!pst.wasfdash)
219 inschrdef(' ');
220 pst.wasfdash = false;
221 } else {
222 char s[20];
223 sprintf(s,"%i",pst.wasspace);
224 _AddAtt("text:c",s);
225 _Start("text:s");
226 _End("text:s");
230 pst.wasspace = 0;
231 setfnt(chngul,true);
232 inschrdef(ch);
235 sal_Bool SAL_CALL T602ImportFilter::importImpl( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
236 throw (RuntimeException)
238 Reset602();
240 sal_Int32 nLength = aDescriptor.getLength();
241 const PropertyValue * pValue = aDescriptor.getConstArray();
242 for ( sal_Int32 i = 0 ; i < nLength; i++)
244 if ( pValue[i].Name == "InputStream" )
245 pValue[i].Value >>= mxInputStream;
248 if ( !mxInputStream.is() )
250 OSL_ASSERT( 0 );
251 return sal_False;
254 // An XML import service: what we push sax messages to..
255 OUString sXMLImportService ( "com.sun.star.comp.Writer.XMLImporter" );
257 mxHandler = Reference< XDocumentHandler >( mxMSF->createInstance( sXMLImportService ), UNO_QUERY );
259 // The XImporter sets up an empty target document for XDocumentHandler to write to..
260 Reference < XImporter > xImporter(mxHandler, UNO_QUERY);
261 xImporter->setTargetDocument(mxDoc);
263 char fs[32], fs2[32];
264 sprintf(fs, "%ipt", ini.fontsize);
265 sprintf(fs2,"%ipt", 2*ini.fontsize);
267 mpAttrList = new SvXMLAttributeList;
269 Reference < XAttributeList > mAttrList ( mpAttrList );
271 mxHandler->startDocument();
273 _AddAtt("xmlns:office", "http://openoffice.org/2000/office");
274 _AddAtt("xmlns:style", "http://openoffice.org/2000/style");
275 _AddAtt("xmlns:text", "http://openoffice.org/2000/text");
276 _AddAtt("xmlns:table", "http://openoffice.org/2000/table");
277 _AddAtt("xmlns:draw", "http://openoffice.org/2000/draw");
278 _AddAtt("xmlns:fo", "http://www.w3.org/1999/XSL/Format");
279 _AddAtt("xmlns:xlink", "http://www.w3.org/1999/xlink");
280 _AddAtt("xmlns:number", "http://openoffice.org/2000/datastyle");
281 _AddAtt("xmlns:svg", "http://www.w3.org/2000/svg");
282 _AddAtt("xmlns:chart", "http://openoffice.org/2000/chart");
283 _AddAtt("xmlns:dr3d", "http://openoffice.org/2000/dr3d");
284 _AddAtt("xmlns:math", "http://www.w3.org/1998/Math/MathML");
285 _AddAtt("xmlns:form", "http://openoffice.org/2000/form");
286 _AddAtt("xmlns:script", "http://openoffice.org/2000/script");
287 _AddAtt("office:class", "text");
288 _AddAtt("office:version", "1.0");
289 _Start("office:document-content");
291 _Start("office:font-decls");
292 _AddAtt("style:name","Courier New");
293 _AddAtt("fo:font-family","Courier New");
294 _AddAtt("style:font-pitch","fixed");
295 _Start("style:font-decl");
296 _End("style:font-decl");
297 _End("office:font-decls");
299 _Start("office:automatic-styles");
301 // Standardni text
302 _AddAtt("style:name","P1");
303 _AddAtt("style:family","paragraph");
304 _AddAtt("style:parent-style-name","Standard");
305 _Start("style:style");
306 _AddAtt("style:font-name","Courier New");
307 _AddAtt("fo:font-size",fs);
308 _Start("style:properties");
309 _End("style:properties");
310 _End("style:style");
312 // Standardni text - konec stranky
313 _AddAtt("style:name","P2");
314 _AddAtt("style:family","paragraph");
315 _AddAtt("style:parent-style-name","Standard");
316 _Start("style:style");
317 _AddAtt("style:font-name","Courier New");
318 _AddAtt("fo:font-size",fs);
319 _AddAtt("fo:break-before","page");
320 _Start("style:properties");
321 _End("style:properties");
322 _End("style:style");
324 // T1 Normalni text
325 _AddAtt("style:name","T1");
326 _AddAtt("style:family","text");
327 _Start("style:style");
328 _Start("style:properties");
329 _End("style:properties");
330 _End("style:style");
332 // T2 Tucny text
333 _AddAtt("style:name","T2");
334 _AddAtt("style:family","text");
335 _Start("style:style");
336 _AddAtt("fo:font-weight","bold");
337 _Start("style:properties");
338 _End("style:properties");
339 _End("style:style");
341 // T3 Kurziva
342 _AddAtt("style:name","T3");
343 _AddAtt("style:family","text");
344 _Start("style:style");
345 _AddAtt("fo:font-style","italic");
346 _Start("style:properties");
347 _End("style:properties");
348 _End("style:style");
350 // T4 Siroky text
351 _AddAtt("style:name","T4");
352 _AddAtt("style:family","text");
353 _Start("style:style");
354 _AddAtt("fo:font-weight","bold");
355 _AddAtt("style:text-scale","200%");
356 _Start("style:properties");
357 _End("style:properties");
358 _End("style:style");
360 // T5 Vysoky text
361 _AddAtt("style:name","T5");
362 _AddAtt("style:family","text");
363 _Start("style:style");
364 _AddAtt("fo:font-size",fs2);
365 _AddAtt("fo:font-weight","bold");
366 _AddAtt("style:text-scale","50%");
367 _Start("style:properties");
368 _End("style:properties");
369 _End("style:style");
371 // T6 Velky text
372 _AddAtt("style:name","T6");
373 _AddAtt("style:family","text");
374 _Start("style:style");
375 _AddAtt("fo:font-size",fs2);
376 _AddAtt("fo:font-weight","bold");
377 _Start("style:properties");
378 _End("style:properties");
379 _End("style:style");
381 // T7 Podtrzeny text
382 _AddAtt("style:name","T7");
383 _AddAtt("style:family","text");
384 _Start("style:style");
385 _AddAtt("style:text-underline","single");
386 _Start("style:properties");
387 _End("style:properties");
388 _End("style:style");
390 // T8 Podtrzena tucny text
391 _AddAtt("style:name","T8");
392 _AddAtt("style:family","text");
393 _Start("style:style");
394 _AddAtt("fo:font-weight","bold");
395 _AddAtt("style:text-underline","single");
396 _Start("style:properties");
397 _End("style:properties");
398 _End("style:style");
400 // T9 Podtrzena kurziva
401 _AddAtt("style:name","T9");
402 _AddAtt("style:family","text");
403 _Start("style:style");
404 _AddAtt("fo:font-style","italic");
405 _AddAtt("style:text-underline","single");
406 _Start("style:properties");
407 _End("style:properties");
408 _End("style:style");
410 // T10 Horni index
411 _AddAtt("style:name","T10");
412 _AddAtt("style:family","text");
413 _Start("style:style");
414 _AddAtt("style:text-position","27% 100%");
415 _Start("style:properties");
416 _End("style:properties");
417 _End("style:style");
419 // T11 Dolni index
420 _AddAtt("style:name","T11");
421 _AddAtt("style:family","text");
422 _Start("style:style");
423 _AddAtt("style:text-position","-27% 100%");
424 _Start("style:properties");
425 _End("style:properties");
426 _End("style:style");
428 _End("office:automatic-styles");
430 _Start("office:styles");
431 _End("office:styles");
433 _Start("office:body");
435 Read602();
437 _End("office:body");
438 _End("office:document-content");
440 mxHandler->endDocument();
442 return sal_True;
445 void T602ImportFilter::Reset602()
447 node = START;
449 format602.mt = 0;
450 format602.mb = 0;
451 format602.tb = 0;
452 format602.ct = 0;
453 format602.pn = 1;
454 format602.lh = 1;
455 format602.lm = 6;
456 format602.rm = 60;
457 format602.pl = 60;
459 ini.showcomm = false;
460 ini.forcecode = false;
461 ini.xcode = KAM;
462 ini.ruscode = false;
463 ini.reformatpars= false;
464 ini.fontsize = 10;
466 fst.nowfnt = fst.oldfnt = standard;
467 fst.uline = fst.olduline = false;
469 pst.pars = 0;
470 pst.comment = false;
471 pst.wasspace = 0;
472 pst.ccafterln = false;
473 pst.willbeeop = false;
474 pst.waspar = false;
475 pst.wasfdash = false;
478 void T602ImportFilter::inschrdef(unsigned char ch)
480 static sal_Unicode xch[2];
482 xch[1] = 0;
484 if(ch > 127) {
486 switch(ini.xcode) {
487 case L2 : break;
488 case KOI: ch = koi2lat[ch-128]; break;
489 case KAM: ch = kam2lat[ch-128]; break;
490 default : ch = kam2lat[ch-128];
493 if(ini.ruscode)
494 xch[0] = (rus2UNC[(ch-128)*2] << 8) + rus2UNC[(ch-128)*2+1];
495 else
496 xch[0] = (lat2UNC[(ch-128)*2] << 8) + lat2UNC[(ch-128)*2+1];
497 } else
498 xch[0] = ch;
500 pst.waspar = false;
501 mxHandler->characters(OUString(xch));
504 void T602ImportFilter::wrtfnt()
506 Reference < XAttributeList > mAttrList ( mpAttrList );
507 const sal_Char *style = "P1";
509 switch(fst.nowfnt) {
510 case standard : style = (char*)(fst.uline ? "T7" : "T1"); break;
511 case fat : style = (char*)(fst.uline ? "T8" : "T2"); break;
512 case cursive : style = (char*)(fst.uline ? "T9" : "T3"); break;
513 case bold : style = "T4"; break;
514 case tall : style = "T5"; break;
515 case big : style = "T6"; break;
516 case lindex : style = "T11";break;
517 case hindex : style = "T10";break;
518 default : style = "T1"; break;
521 _End("text:span");
522 _AddAtt("text:style-name", style);
523 _Start("text:span");
526 void T602ImportFilter::setfnt(fonts fnt,bool mustwrite)
528 if (fnt == fst.oldfnt && fnt == fst.nowfnt && !mustwrite)
529 fst.nowfnt = standard;
530 else if (fnt != chngul)
531 fst.nowfnt = fnt;
533 if (mustwrite && (fst.oldfnt != fst.nowfnt || fst.olduline != fst.uline))
535 wrtfnt();
536 fst.oldfnt = fst.nowfnt;
537 fst.olduline = fst.uline;
541 unsigned char T602ImportFilter::Readchar602()
543 static Sequence< sal_Int8 > aData;
545 return (mxInputStream->readBytes(aData, 1) > 0) ?
546 ((unsigned char *) aData.getConstArray())[0] : 0;
549 void T602ImportFilter::par602(bool endofpage)
551 sal_Int16 endp;
552 Reference < XAttributeList > mAttrList ( mpAttrList );
554 if(!endofpage || !pst.waspar) {
555 if(ini.showcomm||!pst.comment) {
556 if(pst.waspar||ini.reformatpars) {
557 _End("text:span");
558 _End("text:p");
559 _AddAtt("text:style-name", "P1");
560 _Start("text:p");
561 _Start("text:span");
562 wrtfnt();
563 } else {
564 _Start("text:line-break");
565 _End("text:line-break");
569 pst.waspar = true;
572 if(!pst.comment) {
573 switch(format602.lh) {
574 case 3: pst.pars += 4; break;
575 case 4: pst.pars += 3; break;
576 case 6: pst.pars += 2; break;
577 default: pst.pars +=2; break;
579 endp = format602.pl-format602.mt-format602.mb;
580 if(((pst.pars+1)/2) >= endp || endofpage) {
581 pst.pars = 0;
582 if(!ini.reformatpars) {
583 _End("text:span");
584 _End("text:p");
585 _AddAtt("text:style-name", "P2");
586 _Start("text:p");
587 _Start("text:span");
588 wrtfnt();
594 sal_Int16 T602ImportFilter::readnum(unsigned char *ch, bool show)
596 unsigned char buff[21];
597 sal_Int16 i=0;
599 while((i<20) && *ch && (*ch!='\n') && (*ch!=','))
601 *ch = Readchar602();
602 if(show) inschr(*ch);
603 buff[i++] = *ch;
605 buff[i]='\0';
607 // mba: cast from unsigned char via int to sal_Int16 seems to be safe
608 return (sal_Int16) atoi((char *)buff);
611 unsigned char T602ImportFilter::Setformat602(char *cmd)
613 unsigned char ch;
614 sal_Int16 i;
616 ch = Readchar602();
618 if (cmd[0]=='M' && cmd[1]=='T') format602.mt = readnum(&ch,false);
619 else if (cmd[0]=='M' && cmd[1]=='B') format602.mb = readnum(&ch,false);
620 // else if (cmd[0]=='T' && cmd[1]=='B') {}
621 // else if (cmd[0]=='H' && cmd[1]=='E') {}
622 // else if (cmd[0]=='F' && cmd[1]=='O') {}
623 else if (cmd[0]=='C' && cmd[1]=='T') {
624 format602.ct = readnum(&ch,false);
625 if (!ini.forcecode)
626 switch(format602.ct) {
627 case 0: ini.xcode = KAM; break;
628 case 1: ini.xcode = L2; break;
629 case 2: ini.xcode = KOI; break;
630 default: ini.xcode = KAM; break;
633 else if (cmd[0]=='P' && cmd[1]=='N') format602.pn = readnum(&ch,false);
634 else if (cmd[0]=='L' && cmd[1]=='H') format602.lh = readnum(&ch,false);
635 // else if(cmd[0]=='S' && cmd[1]=='T') {} //styl
636 else if (cmd[0]=='L' && cmd[1]=='M') format602.lm = readnum(&ch,false);
637 else if (cmd[0]=='R' && cmd[1]=='M') format602.rm = readnum(&ch,false);
638 else if (cmd[0]=='P' && cmd[1]=='L') format602.pl = readnum(&ch,false);
639 else if (cmd[0]=='P' && cmd[1]=='A') { if(pst.pars) par602(true); }
640 else if (cmd[0]=='C' && cmd[1]=='P') {
641 i = readnum(&ch,false);
642 if ((i+pst.pars/2) > (format602.pl-format602.mt-format602.mb))
643 if(pst.pars) par602(true);
645 while (ch && (ch != '\n')) ch = Readchar602();
646 return ch;
649 tnode T602ImportFilter::PointCmd602(unsigned char *ch)
651 char pcmd[2];
653 // warning: uChar -> char
654 pcmd[0] = (char) toupper(*ch); inschr(*ch);
655 *ch = Readchar602();
656 if (!*ch) return EEND;
657 if (*ch=='\n') return EOL;
658 if (!isalpha(*ch)) return (*ch<32) ? SETCH : WRITE;
660 // warning: uChar -> char
661 pcmd[1] = (char) toupper(*ch); inschr(*ch);
663 if (pcmd[0]=='P' && pcmd[1]=='A') { if (pst.pars) pst.willbeeop = true; }
664 else if (pcmd[0]=='C' && pcmd[1]=='P') { if (pst.pars) pst.willbeeop = true; }
665 else if (pcmd[0]=='P' && pcmd[1]=='I') {
666 while (*ch && (*ch != '\n') && (*ch != ','))
667 { *ch = Readchar602(); inschr(*ch); }
668 if (!*ch) return EEND;
669 if (*ch=='\n') return EOL;
670 if (*ch==',') { *ch = Readchar602(); inschr(*ch); }
671 pst.pars += (readnum(ch,true)*2);
672 if (!*ch) return EEND;
673 if (*ch=='\n') return EOL;
675 // else if(pcmd[0]=='K'&&pcmd[1]=='P') {}
676 // else if(pcmd[0]=='H'&&pcmd[1]=='E') {}
677 // else if(pcmd[0]=='F'&&pcmd[1]=='O') {}
679 return READCH;
683 void T602ImportFilter::Read602()
685 unsigned char ch=0;
686 char cmd602[3] = {0};
688 Reference < XAttributeList > mAttrList ( mpAttrList );
690 if (node==QUIT) return;
692 _AddAtt("text:style-name", "P1");
693 _Start("text:p");
694 _AddAtt("text:style-name", "T1");
695 _Start("text:span");
697 if (node==START) { node = EOL; }
699 while (node != EEND) {
700 switch (node) {
701 case READCH:
702 ch = Readchar602();
703 if (ch == 0) node = EEND;
704 else if (ch == '\n') {
705 if(!pst.willbeeop) par602(false);
706 node = EOL;
707 } else if (ch < 32) node = SETCH;
708 else node = WRITE;
709 break;
710 case EOL:
711 ch = Readchar602();
712 pst.comment = false;
713 if (pst.willbeeop) par602(true);
714 pst.willbeeop = false;
715 if(ch == 0) node = EEND;
716 else if (ch == '@') node = EXPCMD;
717 else if (ch == '\n') { par602(false); node = EOL; }
718 else if (ch < 32) {pst.ccafterln = true; node = SETCH; break;}
719 else node = WRITE;
720 if (ch == '.') { pst.comment = true; node = POCMD; }
721 pst.ccafterln = false;
722 break;
724 case POCMD: inschr('.');
725 ch = Readchar602();
726 if(ch == 0) node = EEND;
727 else if(isalpha(ch)) node = PointCmd602(&ch);
728 else if(ch <32) node=SETCH;
729 else node = WRITE;
730 break;
732 case EXPCMD: ch = Readchar602();
733 if(ch == 0) {inschr('@'); node = EEND; }
734 else if(isupper(ch)) {
735 cmd602[0] = ch;
736 ch = Readchar602();
737 cmd602[1] = ch;
738 cmd602[2] = '\0';
739 if(isupper(ch)) node = SETCMD; //nedodelano
740 else { inschr('@'); _Chars(cmd602); node = READCH; }
741 } else {
742 inschr('@');
743 if(ch<32) node = SETCH;
744 else node = WRITE;}
745 break;
747 case SETCMD:
748 ch = Setformat602(cmd602);
749 if(ch == 0) node = EEND;
750 else if(ch == '\n') node = EOL;
751 else node = READCH;
752 break;
754 case SETCH :
755 // warning: potentially uninitialized
756 switch(ch) {
757 case '\t' : _Start("text:tab-stop");
758 _End("text:tab-stop");
759 break;
760 case 0x03 : break; //condensed
761 case 0x01 : break; //elite
762 case 0x11 : break; //uzv1
763 case 0x12 : break; //uzv2
764 case 0x15 : break; //uzv3
765 case 0x17 : break; //uzv4
766 case 0x18 : break; //uzv5
767 case 0x19 : break; //uzv6
768 case 0x13 : fst.uline = !fst.uline;break;
769 case 0x02 : setfnt(fat,false); break;
770 case 0x04 : setfnt(cursive,false); break;
771 case 0x0f : setfnt(bold,false); break;
772 case 0x10 : setfnt(tall,false); break;
773 case 0x1d : setfnt(big,false); break;
774 case 0x14 : setfnt(hindex,false); break;
775 case 0x16 : setfnt(lindex,false); break;
776 default : break;
778 if(pst.ccafterln) node = EOL;
779 else node = READCH;
780 break;
782 case WRITE :
783 switch(ch) {
784 case 0x8d:
785 ch = Readchar602();
786 if( ch == 0x0a) {
787 if(ini.reformatpars) inschr(' ');
788 else par602(false); //formatovaci radek
789 node = EOL;
790 } else {
791 inschr(0x8d);//inschr(' ');
792 if(ch == 0) node = EEND;
793 else if(ch == '\n') {
794 if(!pst.willbeeop) par602(false);
795 node = EOL; }
796 else if(ch < 32) node = SETCH;
797 else node = WRITE;
799 break;
800 case 0xfe:
801 if (ini.showcomm||!pst.comment) inschr(' ');
802 node = READCH;
803 break;
804 case 0xad:
805 ch = Readchar602();
806 if( ch==0x8d ) {
807 if(ini.showcomm||!pst.comment) { //formatovaci pomlcka
808 if(!ini.reformatpars)
809 inschr('-');
810 else {
811 pst.wasspace--;
812 pst.wasfdash = true;
815 node=WRITE;
816 } else {
817 inschr(0xad);
818 if(ch == 0) node = EEND;
819 else if(ch == '\n') {
820 if(!pst.willbeeop) par602(false);
821 node = EOL; }
822 else if(ch < 32) node = SETCH;
823 else node = WRITE;
825 break;
826 default:
827 inschr(ch);
828 node = READCH;
829 break;
831 break;
832 default: break;
836 _End("text:span");
837 _End("text:p");
838 node = QUIT;
841 // XServiceInfo
842 OUString SAL_CALL T602ImportFilter::getImplementationName( )
843 throw (RuntimeException)
845 return T602ImportFilter_getImplementationName();
848 sal_Bool SAL_CALL T602ImportFilter::supportsService( const OUString& rServiceName )
849 throw (RuntimeException)
851 return T602ImportFilter_supportsService( rServiceName );
854 Sequence< OUString > SAL_CALL T602ImportFilter::getSupportedServiceNames( )
855 throw (RuntimeException)
857 return T602ImportFilter_getSupportedServiceNames();
860 #define IMPLEMENTATION_NAME "com.sun.star.comp.Writer.T602ImportFilter"
862 OUString T602ImportFilter_getImplementationName ()
863 throw (RuntimeException)
865 return OUString ( IMPLEMENTATION_NAME );
868 #define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
869 #define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
870 sal_Bool SAL_CALL T602ImportFilter_supportsService( const OUString& ServiceName )
871 throw (RuntimeException)
873 return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
876 Sequence< OUString > SAL_CALL T602ImportFilter_getSupportedServiceNames( )
877 throw (RuntimeException)
879 Sequence < OUString > aRet(2);
880 OUString* pArray = aRet.getArray();
881 pArray[0] = OUString ( SERVICE_NAME1 );
882 pArray[1] = OUString ( SERVICE_NAME2 );
883 return aRet;
885 #undef SERVICE_NAME2
886 #undef SERVICE_NAME1
887 #undef IMPLEMENTATION_NAME
889 Reference< XInterface > SAL_CALL T602ImportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr)
890 throw( Exception )
892 return (cppu::OWeakObject*) new T602ImportFilter( rSMgr );
895 T602ImportFilterDialog::T602ImportFilterDialog(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory > &r ) :
896 mxMSF( r ), mpResMgr( NULL ) {}
898 T602ImportFilterDialog::~T602ImportFilterDialog()
900 if (mpResMgr)
901 delete mpResMgr;
904 // XLocalizable
906 void SAL_CALL T602ImportFilterDialog::setLocale( const Locale& eLocale )
907 throw(::com::sun::star::uno::RuntimeException)
909 meLocale = eLocale;
910 initLocale();
913 Locale SAL_CALL T602ImportFilterDialog::getLocale()
914 throw(::com::sun::star::uno::RuntimeException)
916 return meLocale;
919 sal_Bool T602ImportFilterDialog::OptionsDlg()
921 sal_Bool ret = sal_False;
923 Any any;
924 #define _propInt(_prop,_nam,_val) \
925 any <<= (sal_Int32)_val;\
926 _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
927 #define _propShort(_prop,_nam,_val) \
928 any <<= (sal_Int16)_val;\
929 _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
930 #define _propBool(_prop,_nam,_val) \
931 any <<= (sal_Bool)_val;\
932 _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
933 #define _propString(_prop,_nam,_val) \
934 any <<= OUString::createFromAscii(_val);\
935 _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
936 #define _propStringFromResId(_prop,_nam,_val) \
937 any <<= getResStr(_val);\
938 _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
939 #define _propGet(_prop,_nam) \
940 _prop->getPropertyValue(OUString::createFromAscii(_nam));
941 #define _InstCtx(_path,_ctx)\
942 rServiceManager->createInstanceWithContext(\
943 OUString::createFromAscii(_path),_ctx);
944 #define _Inst(_path)\
945 xMultiServiceFactory->createInstance(OUString::createFromAscii(_path) );
946 #define _Insert(_cont,_nam,_obj) \
947 any <<= _obj;\
948 _cont->insertByName( OUString::createFromAscii(_nam), any );
950 Reference < XComponentContext > rComponentContext = defaultBootstrap_InitialComponentContext();
951 Reference < XMultiComponentFactory > rServiceManager = rComponentContext->getServiceManager();
952 Reference < XInterface > rInstance = _InstCtx("com.sun.star.awt.UnoControlDialogModel", rComponentContext );
954 Reference <XMultiServiceFactory> xMultiServiceFactory (rInstance,UNO_QUERY);
956 Reference < XPropertySet > xPSetDialog( rInstance, UNO_QUERY );
957 _propInt(xPSetDialog,"PositionX",100);
958 _propInt(xPSetDialog,"PositionY",100);
959 _propInt(xPSetDialog,"Width",130);
960 _propInt(xPSetDialog,"Height",90);
961 _propStringFromResId(xPSetDialog,"Title", T602FILTER_STR_IMPORT_DIALOG_TITLE);
963 #define T602DLG_OK_BUTTON "ok_button"
964 #define T602DLG_CANCEL_BUTTON "cancel_button"
965 #define T602DLG_CODE_LB "code_lb"
966 #define T602DLG_AZBUKA_CB "azbuka_cb"
967 #define T602DLG_COMMENT_CB "comment_cb"
968 #define T602DLG_REFORMAT_CB "reformat_cb"
969 #define T602DLG_CODE_TXT "code_txt"
971 Reference < XInterface > TextModel = _Inst("com.sun.star.awt.UnoControlFixedTextModel");
972 Reference < XPropertySet > xPSetText( TextModel, UNO_QUERY );
973 _propInt(xPSetText,"PositionX",10);
974 _propInt(xPSetText,"PositionY",8);
975 _propInt(xPSetText,"Width",30);
976 _propInt(xPSetText,"Height",14);
977 _propString(xPSetText,"Name",T602DLG_CODE_TXT);
978 _propStringFromResId(xPSetText,"Label",T602FILTER_STR_ENCODING_LABEL);
980 Reference < XInterface > ListBoxModel = _Inst("com.sun.star.awt.UnoControlListBoxModel");
981 Reference < XPropertySet > xPSetCodeLB( ListBoxModel, UNO_QUERY );
982 _propInt(xPSetCodeLB,"PositionX",40);
983 _propInt(xPSetCodeLB,"PositionY",5);
984 _propInt(xPSetCodeLB,"Width",85);
985 _propInt(xPSetCodeLB,"Height",14);
986 _propString(xPSetCodeLB,"Name",T602DLG_CODE_LB);
987 _propShort(xPSetCodeLB,"TabIndex",1);
988 _propBool(xPSetCodeLB,"Dropdown",true);
989 _propBool(xPSetCodeLB,"MultiSelection",false);
991 Sequence< OUString > ous(4);
992 ous[0] = getResStr(T602FILTER_STR_ENCODING_AUTO);
993 ous[1] = getResStr(T602FILTER_STR_ENCODING_CP852);
994 ous[2] = getResStr(T602FILTER_STR_ENCODING_CP895);
995 ous[3] = getResStr(T602FILTER_STR_ENCODING_KOI8CS2);
996 any <<= ous;
997 xPSetCodeLB->setPropertyValue(OUString( "StringItemList" ), any);
999 Sequence < sal_Int16 > shr(1);
1000 shr[0] = ini.forcecode ? ((sal_Int16) ini.xcode) + 1 : 0;
1001 any <<= shr;
1002 xPSetCodeLB->setPropertyValue(OUString( "SelectedItems" ), any);
1004 Reference < XInterface > AzbCheckBoxModel = _Inst("com.sun.star.awt.UnoControlCheckBoxModel");
1005 Reference < XPropertySet > xPSetAzbukaCB( AzbCheckBoxModel, UNO_QUERY );
1006 _propInt(xPSetAzbukaCB,"PositionX",10);
1007 _propInt(xPSetAzbukaCB,"PositionY",25);
1008 _propInt(xPSetAzbukaCB,"Width",100);
1009 _propInt(xPSetAzbukaCB,"Height",14);
1010 _propString(xPSetAzbukaCB,"Name",T602DLG_AZBUKA_CB);
1011 _propShort(xPSetAzbukaCB,"TabIndex",2);
1012 _propStringFromResId(xPSetAzbukaCB,"Label",T602FILTER_STR_CYRILLIC_MODE);
1013 _propShort(xPSetAzbukaCB,"State",ini.ruscode);
1015 Reference < XInterface > RefCheckBoxModel = _Inst("com.sun.star.awt.UnoControlCheckBoxModel");
1016 Reference < XPropertySet > xPSetRefCB( RefCheckBoxModel, UNO_QUERY );
1017 _propInt(xPSetRefCB,"PositionX",10);
1018 _propInt(xPSetRefCB,"PositionY",40);
1019 _propInt(xPSetRefCB,"Width",100);
1020 _propInt(xPSetRefCB,"Height",14);
1021 _propString(xPSetRefCB,"Name",T602DLG_REFORMAT_CB);
1022 _propShort(xPSetRefCB,"TabIndex",3);
1023 _propStringFromResId(xPSetRefCB,"Label",T602FILTER_STR_REFORMAT_TEXT);
1024 _propShort(xPSetRefCB,"State",ini.reformatpars);
1026 Reference < XInterface > CommCheckBoxModel = _Inst("com.sun.star.awt.UnoControlCheckBoxModel");
1027 Reference < XPropertySet > xPSetCommCB( CommCheckBoxModel, UNO_QUERY );
1028 _propInt(xPSetCommCB,"PositionX",10);
1029 _propInt(xPSetCommCB,"PositionY",55);
1030 _propInt(xPSetCommCB,"Width",100);
1031 _propInt(xPSetCommCB,"Height",14);
1032 _propString(xPSetCommCB,"Name",T602DLG_COMMENT_CB);
1033 _propShort(xPSetCommCB,"TabIndex",4);
1034 _propStringFromResId(xPSetCommCB,"Label",T602FILTER_STR_DOT_COMMANDS);
1035 _propShort(xPSetCommCB,"State",ini.showcomm);
1037 Reference < XInterface > CancelButtonModel = _Inst("com.sun.star.awt.UnoControlButtonModel");
1038 Reference < XPropertySet > xPSetCancelButton( CancelButtonModel, UNO_QUERY );
1039 _propInt(xPSetCancelButton,"PositionX",10);
1040 _propInt(xPSetCancelButton,"PositionY",70);
1041 _propInt(xPSetCancelButton,"Width",50);
1042 _propInt(xPSetCancelButton,"Height",14);
1043 _propString(xPSetCancelButton,"Name",T602DLG_CANCEL_BUTTON);
1044 _propShort(xPSetCancelButton,"TabIndex",5);
1045 _propShort(xPSetCancelButton,"PushButtonType",2);
1046 _propStringFromResId(xPSetCancelButton,"Label",T602FILTER_STR_CANCEL_BUTTON);
1048 Reference < XInterface > OkButtonModel = _Inst("com.sun.star.awt.UnoControlButtonModel");
1049 Reference < XPropertySet > xPSetOkButton( OkButtonModel, UNO_QUERY );
1050 _propInt(xPSetOkButton,"PositionX",70);
1051 _propInt(xPSetOkButton,"PositionY",70);
1052 _propInt(xPSetOkButton,"Width",50);
1053 _propInt(xPSetOkButton,"Height",14);
1054 _propString(xPSetOkButton,"Name",T602DLG_OK_BUTTON);
1055 _propShort(xPSetOkButton,"TabIndex",0);
1056 _propShort(xPSetOkButton,"PushButtonType",1);
1057 _propStringFromResId(xPSetOkButton,"Label",T602FILTER_STR_OK_BUTTON);
1058 _propBool(xPSetOkButton,"DefaultButton",true);
1060 Reference < XNameContainer > xNameCont (rInstance,UNO_QUERY);
1062 _Insert(xNameCont, T602DLG_OK_BUTTON, OkButtonModel);
1063 _Insert(xNameCont, T602DLG_CANCEL_BUTTON, CancelButtonModel);
1064 _Insert(xNameCont, T602DLG_AZBUKA_CB, AzbCheckBoxModel);
1065 _Insert(xNameCont, T602DLG_REFORMAT_CB, RefCheckBoxModel);
1066 _Insert(xNameCont, T602DLG_COMMENT_CB, CommCheckBoxModel);
1067 _Insert(xNameCont, T602DLG_CODE_LB, ListBoxModel);
1068 _Insert(xNameCont, T602DLG_CODE_TXT, TextModel);
1070 Reference< XInterface > dialog = _InstCtx("com.sun.star.awt.UnoControlDialog",rComponentContext);
1072 Reference < XControl > xControl (dialog,UNO_QUERY);
1073 Reference < XControlModel > xControlModel (rInstance,UNO_QUERY);
1075 if(!xControl.is())
1076 return sal_False;
1078 xControl->setModel( xControlModel );
1080 Reference < XToolkit > xToolkit = Toolkit::create( rComponentContext );
1081 Reference < XWindow > xWindow (xControl,UNO_QUERY);
1083 if(!xWindow.is())
1084 return sal_False;
1086 xWindow->setVisible( false );
1087 xControl->createPeer( xToolkit, NULL );
1089 Reference < XDialog > xDialog (dialog,UNO_QUERY);
1091 if(!xDialog.is())
1092 return sal_False;
1094 ret = ( xDialog->execute() != 0 );
1095 if ( ret ) {
1097 sal_Int16 tt = 0;
1099 any = _propGet(xPSetAzbukaCB, "State"); any >>= tt; ini.ruscode = tt;
1100 any = _propGet(xPSetRefCB, "State"); any >>= tt; ini.reformatpars = tt;
1101 any = _propGet(xPSetCommCB, "State"); any >>= tt; ini.showcomm = tt;
1103 any = _propGet(xPSetCodeLB, "SelectedItems"); any >>= shr;
1105 if( shr[0] > 0 ) {
1106 ini.xcode = (tcode)(shr[0]-1);
1107 ini.forcecode = true;
1108 } else {
1109 ini.forcecode = false;
1113 Reference < XComponent > xComponent (dialog,UNO_QUERY);
1115 xComponent->dispose();
1117 return ret;
1120 void T602ImportFilterDialog::initLocale()
1122 OString aModName( "t602filter" );
1123 aModName += OString::valueOf( sal_Int32( SUPD ) );
1125 mpResMgr = ResMgr::CreateResMgr( aModName.getStr(), LanguageTag( meLocale) );
1128 ResMgr* T602ImportFilterDialog::getResMgr()
1130 if( !mpResMgr )
1131 initLocale();
1132 return mpResMgr;
1135 void SAL_CALL T602ImportFilterDialog::setTitle( const OUString& )
1136 throw (::com::sun::star::uno::RuntimeException)
1140 sal_Int16 SAL_CALL T602ImportFilterDialog::execute()
1141 throw (::com::sun::star::uno::RuntimeException)
1143 if (OptionsDlg())
1144 return com::sun::star::ui::dialogs::ExecutableDialogResults::OK;
1145 else
1146 return com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL;
1149 OUString T602ImportFilterDialog::getResStr( sal_Int16 resid )
1151 OUString sStr( ResId( resid, *getResMgr() ) );
1152 return sStr;
1155 uno::Sequence<beans::PropertyValue> SAL_CALL T602ImportFilterDialog::getPropertyValues() throw(uno::RuntimeException)
1157 return uno::Sequence<beans::PropertyValue>();
1160 void SAL_CALL T602ImportFilterDialog::setPropertyValues( const uno::Sequence<beans::PropertyValue>& )
1161 throw(beans::UnknownPropertyException, beans::PropertyVetoException,
1162 lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1167 // XServiceInfo
1168 OUString SAL_CALL T602ImportFilterDialog::getImplementationName( )
1169 throw (RuntimeException)
1171 return T602ImportFilterDialog_getImplementationName();
1174 sal_Bool SAL_CALL T602ImportFilterDialog::supportsService( const OUString& rServiceName )
1175 throw (RuntimeException)
1177 return T602ImportFilterDialog_supportsService( rServiceName );
1180 Sequence< OUString > SAL_CALL T602ImportFilterDialog::getSupportedServiceNames( )
1181 throw (RuntimeException)
1183 return T602ImportFilterDialog_getSupportedServiceNames();
1186 #define IMPLEMENTATION_NAME "com.sun.star.comp.Writer.T602ImportFilterDialog"
1188 OUString T602ImportFilterDialog_getImplementationName ()
1189 throw (RuntimeException)
1191 return OUString ( IMPLEMENTATION_NAME );
1194 #define SERVICE_NAME "com.sun.star.ui.dialogs.FilterOptionsDialog"
1195 sal_Bool SAL_CALL T602ImportFilterDialog_supportsService( const OUString& ServiceName )
1196 throw (RuntimeException)
1198 return ServiceName == SERVICE_NAME;
1201 Sequence< OUString > SAL_CALL T602ImportFilterDialog_getSupportedServiceNames( )
1202 throw (RuntimeException)
1204 Sequence < OUString > aRet(1);
1205 OUString* pArray = aRet.getArray();
1206 pArray[0] = OUString ( SERVICE_NAME );
1207 return aRet;
1209 #undef SERVICE_NAME
1211 Reference< XInterface > SAL_CALL T602ImportFilterDialog_createInstance( const Reference< XMultiServiceFactory > & rSMgr)
1212 throw( Exception )
1214 return (cppu::OWeakObject*) new T602ImportFilterDialog( rSMgr );
1219 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */