LibreOffice Module filter (master) 1
t602filter.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include "t602filter.hxx"
21#include <strings.hrc>
22
26#include <com/sun/star/awt/Toolkit.hpp>
27#include <com/sun/star/beans/XPropertySet.hpp>
28#include <com/sun/star/container/XNameContainer.hpp>
29#include <com/sun/star/awt/UnoControlDialog.hpp>
30#include <com/sun/star/awt/XControl.hpp>
31#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
32#include <com/sun/star/lang/XMultiServiceFactory.hpp>
33#include <osl/diagnose.h>
34#include <rtl/ref.hxx>
35#include <rtl/character.hxx>
37#include <utility>
38
39using namespace ::cppu;
40using namespace ::osl;
41using namespace ::com::sun::star;
42using namespace ::com::sun::star::uno;
43using namespace ::com::sun::star::lang;
44using namespace ::com::sun::star::registry;
45using namespace ::com::sun::star::container;
46using namespace ::com::sun::star::beans;
47using namespace ::com::sun::star::awt;
48using namespace ::com::sun::star::xml::sax;
49using namespace ::com::sun::star::document;
50using com::sun::star::io::XInputStream;
51
53
54 unsigned char const 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
64
65 unsigned char const 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
75
76 unsigned char const 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";
95
96 unsigned char const 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";
115
116#define Start_(_nam) \
117 if (mxHandler.is()) \
118 { \
119 mxHandler->startElement(_nam, xAttrList); \
120 if (mpAttrList) \
121 mpAttrList->Clear(); \
122 }
123
124#define End_(_nam) \
125 if (mxHandler.is()) \
126 { \
127 mxHandler->endElement(_nam); \
128 }
129
131
132T602ImportFilter::T602ImportFilter(css::uno::Reference<css::uno::XComponentContext > x )
133 : mxContext(std::move(x))
134 , node(tnode::START)
135{
136}
137
138T602ImportFilter::T602ImportFilter(css::uno::Reference<css::io::XInputStream> xInputStream)
139 : mxInputStream(std::move(xInputStream))
140 , node(tnode::START)
141{
142}
143
144
145T602ImportFilter::~T602ImportFilter()
146{
147}
148
149// XExtendedTypeDetection
150OUString T602ImportFilter::detect( Sequence<PropertyValue>& Descriptor)
151{
152 sal_Int32 nLength = Descriptor.getLength();
153 const PropertyValue * pValue = Descriptor.getConstArray();
154 for ( sal_Int32 i = 0 ; i < nLength; i++)
155 {
156 if ( pValue[i].Name == "InputStream" )
157 pValue[i].Value >>= mxInputStream;
158 }
159
160 if (!mxInputStream.is())
161 return OUString();
162
163 css::uno::Sequence< sal_Int8 > aData;
164 const size_t numBytes = 4;
165 size_t numBytesRead = mxInputStream->readSomeBytes (aData, numBytes);
166
167 if ((numBytesRead != numBytes) || (aData[0] != '@') ||
168 (aData[1] != 'C') || (aData[2] != 'T') || (aData[3] != ' '))
169 return OUString();
170
171 return "writer_T602_Document";
172}
173
174// XFilter
175sal_Bool SAL_CALL T602ImportFilter::filter( const Sequence< css::beans::PropertyValue >& aDescriptor )
176{
177 return importImpl ( aDescriptor );
178}
179
180// XImporter
181void SAL_CALL T602ImportFilter::setTargetDocument( const Reference< css::lang::XComponent >& xDoc )
182{
183 mxDoc = xDoc;
184}
185
186// XInitialization
187void SAL_CALL T602ImportFilter::initialize( const Sequence< Any >& /*aArguments*/ )
188{
189}
190
191// Other functions
192
193void T602ImportFilter::inschr(unsigned char ch)
194{
195 Reference < XAttributeList > xAttrList ( mpAttrList );
196
197 if(!ini.showcomm&&pst.comment) return;
198
199 if(ch==' ') {
200 setfnt(chngul,true);
201 pst.wasspace++;
202 return;
203 }
204
205 if(pst.wasspace > 0) {
206 if(ini.reformatpars) {
207 if(!pst.wasfdash)
208 inschrdef(' ');
209 pst.wasfdash = false;
210 } else {
211 if (mpAttrList)
212 mpAttrList->AddAttribute("text:c",OUString::number(pst.wasspace));
213 Start_("text:s");
214 End_("text:s");
215 }
216 }
217
218 pst.wasspace = 0;
219 setfnt(chngul,true);
220 inschrdef(ch);
221}
222
223bool T602ImportFilter::importImpl( const Sequence< css::beans::PropertyValue >& aDescriptor )
224{
225 Reset602();
226
227 sal_Int32 nLength = aDescriptor.getLength();
228 const PropertyValue * pValue = aDescriptor.getConstArray();
229 for ( sal_Int32 i = 0 ; i < nLength; i++)
230 {
231 if ( pValue[i].Name == "InputStream" )
232 pValue[i].Value >>= mxInputStream;
233 }
234
235 if ( !mxInputStream.is() )
236 {
237 OSL_ASSERT( false );
238 return false;
239 }
240
241 // An XML import service: what we push sax messages to...
242 mxHandler.set( mxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.comp.Writer.XMLImporter", mxContext ), UNO_QUERY );
243
244 // The XImporter sets up an empty target document for XDocumentHandler to write to...
245 Reference < XImporter > xImporter(mxHandler, UNO_QUERY);
246 xImporter->setTargetDocument(mxDoc);
247
248 auto const fs = OUString(OUString::number(inistruct::fontsize) + "pt");
249 auto const fs2 = OUString(OUString::number(2*inistruct::fontsize) + "pt");
250
251 mpAttrList = new comphelper::AttributeList;
252
253 Reference < XAttributeList > xAttrList ( mpAttrList );
254
255 mxHandler->startDocument();
256
257 mpAttrList->AddAttribute("xmlns:office", "http://openoffice.org/2000/office");
258 mpAttrList->AddAttribute("xmlns:style", "http://openoffice.org/2000/style");
259 mpAttrList->AddAttribute("xmlns:text", "http://openoffice.org/2000/text");
260 mpAttrList->AddAttribute("xmlns:table", "http://openoffice.org/2000/table");
261 mpAttrList->AddAttribute("xmlns:draw", "http://openoffice.org/2000/draw");
262 mpAttrList->AddAttribute("xmlns:fo", "http://www.w3.org/1999/XSL/Format");
263 mpAttrList->AddAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
264 mpAttrList->AddAttribute("xmlns:number", "http://openoffice.org/2000/datastyle");
265 mpAttrList->AddAttribute("xmlns:svg", "http://www.w3.org/2000/svg");
266 mpAttrList->AddAttribute("xmlns:chart", "http://openoffice.org/2000/chart");
267 mpAttrList->AddAttribute("xmlns:dr3d", "http://openoffice.org/2000/dr3d");
268 mpAttrList->AddAttribute("xmlns:math", "http://www.w3.org/1998/Math/MathML");
269 mpAttrList->AddAttribute("xmlns:form", "http://openoffice.org/2000/form");
270 mpAttrList->AddAttribute("xmlns:script", "http://openoffice.org/2000/script");
271 mpAttrList->AddAttribute("office:class", "text");
272 mpAttrList->AddAttribute("office:version", "1.0");
273 Start_("office:document-content");
274
275 Start_("office:font-decls");
276 mpAttrList->AddAttribute("style:name","Courier New");
277 mpAttrList->AddAttribute("fo:font-family","Courier New");
278 mpAttrList->AddAttribute("style:font-pitch","fixed");
279 Start_("style:font-decl");
280 End_("style:font-decl");
281 End_("office:font-decls");
282
283 Start_("office:automatic-styles");
284
285 // Standardni text
286 mpAttrList->AddAttribute("style:name","P1");
287 mpAttrList->AddAttribute("style:family","paragraph");
288 mpAttrList->AddAttribute("style:parent-style-name","Standard");
289 Start_("style:style");
290 mpAttrList->AddAttribute("style:font-name","Courier New");
291 mpAttrList->AddAttribute("fo:font-size",fs);
292 Start_("style:properties");
293 End_("style:properties");
294 End_("style:style");
295
296 // Standardni text - konec stranky
297 mpAttrList->AddAttribute("style:name","P2");
298 mpAttrList->AddAttribute("style:family","paragraph");
299 mpAttrList->AddAttribute("style:parent-style-name","Standard");
300 Start_("style:style");
301 mpAttrList->AddAttribute("style:font-name","Courier New");
302 mpAttrList->AddAttribute("fo:font-size",fs);
303 mpAttrList->AddAttribute("fo:break-before","page");
304 Start_("style:properties");
305 End_("style:properties");
306 End_("style:style");
307
308 // T1 Normalni text
309 mpAttrList->AddAttribute("style:name","T1");
310 mpAttrList->AddAttribute("style:family","text");
311 Start_("style:style");
312 Start_("style:properties");
313 End_("style:properties");
314 End_("style:style");
315
316 // T2 Tucny text
317 mpAttrList->AddAttribute("style:name","T2");
318 mpAttrList->AddAttribute("style:family","text");
319 Start_("style:style");
320 mpAttrList->AddAttribute("fo:font-weight","bold");
321 Start_("style:properties");
322 End_("style:properties");
323 End_("style:style");
324
325 // T3 Kurziva
326 mpAttrList->AddAttribute("style:name","T3");
327 mpAttrList->AddAttribute("style:family","text");
328 Start_("style:style");
329 mpAttrList->AddAttribute("fo:font-style","italic");
330 Start_("style:properties");
331 End_("style:properties");
332 End_("style:style");
333
334 // T4 Siroky text
335 mpAttrList->AddAttribute("style:name","T4");
336 mpAttrList->AddAttribute("style:family","text");
337 Start_("style:style");
338 mpAttrList->AddAttribute("fo:font-weight","bold");
339 mpAttrList->AddAttribute("style:text-scale","200%");
340 Start_("style:properties");
341 End_("style:properties");
342 End_("style:style");
343
344 // T5 Vysoky text
345 mpAttrList->AddAttribute("style:name","T5");
346 mpAttrList->AddAttribute("style:family","text");
347 Start_("style:style");
348 mpAttrList->AddAttribute("fo:font-size",fs2);
349 mpAttrList->AddAttribute("fo:font-weight","bold");
350 mpAttrList->AddAttribute("style:text-scale","50%");
351 Start_("style:properties");
352 End_("style:properties");
353 End_("style:style");
354
355 // T6 Velky text
356 mpAttrList->AddAttribute("style:name","T6");
357 mpAttrList->AddAttribute("style:family","text");
358 Start_("style:style");
359 mpAttrList->AddAttribute("fo:font-size",fs2);
360 mpAttrList->AddAttribute("fo:font-weight","bold");
361 Start_("style:properties");
362 End_("style:properties");
363 End_("style:style");
364
365 // T7 Podtrzeny text
366 mpAttrList->AddAttribute("style:name","T7");
367 mpAttrList->AddAttribute("style:family","text");
368 Start_("style:style");
369 mpAttrList->AddAttribute("style:text-underline","single");
370 Start_("style:properties");
371 End_("style:properties");
372 End_("style:style");
373
374 // T8 Podtrzena tucny text
375 mpAttrList->AddAttribute("style:name","T8");
376 mpAttrList->AddAttribute("style:family","text");
377 Start_("style:style");
378 mpAttrList->AddAttribute("fo:font-weight","bold");
379 mpAttrList->AddAttribute("style:text-underline","single");
380 Start_("style:properties");
381 End_("style:properties");
382 End_("style:style");
383
384 // T9 Podtrzena kurziva
385 mpAttrList->AddAttribute("style:name","T9");
386 mpAttrList->AddAttribute("style:family","text");
387 Start_("style:style");
388 mpAttrList->AddAttribute("fo:font-style","italic");
389 mpAttrList->AddAttribute("style:text-underline","single");
390 Start_("style:properties");
391 End_("style:properties");
392 End_("style:style");
393
394 // T10 Horni index
395 mpAttrList->AddAttribute("style:name","T10");
396 mpAttrList->AddAttribute("style:family","text");
397 Start_("style:style");
398 mpAttrList->AddAttribute("style:text-position","27% 100%");
399 Start_("style:properties");
400 End_("style:properties");
401 End_("style:style");
402
403 // T11 Dolni index
404 mpAttrList->AddAttribute("style:name","T11");
405 mpAttrList->AddAttribute("style:family","text");
406 Start_("style:style");
407 mpAttrList->AddAttribute("style:text-position","-27% 100%");
408 Start_("style:properties");
409 End_("style:properties");
410 End_("style:style");
411
412 End_("office:automatic-styles");
413
414 Start_("office:styles");
415 End_("office:styles");
416
417 Start_("office:body");
418
419 Read602();
420
421 End_("office:body");
422 End_("office:document-content");
423
424 mxHandler->endDocument();
425
426 return true;
427}
428
429void T602ImportFilter::test()
430{
431 Reset602();
432 Read602();
433}
434
435void T602ImportFilter::Reset602()
436{
437 node = tnode::START;
438
439 format602.mt = 0;
440 format602.mb = 0;
441 format602.tb = 0;
442 format602.ct = 0;
443 format602.pn = 1;
444 format602.lh = 1;
445 format602.lm = 6;
446 format602.rm = 60;
447 format602.pl = 60;
448
449 ini.showcomm = false;
450 ini.forcecode = false;
451 ini.xcode = KAM;
452 ini.ruscode = false;
453 ini.reformatpars= false;
454
455 fst.nowfnt = fst.oldfnt = standard;
456 fst.uline = fst.olduline = false;
457
458 pst.pars = 0;
459 pst.comment = false;
460 pst.wasspace = 0;
461 pst.ccafterln = false;
462 pst.willbeeop = false;
463 pst.waspar = false;
464 pst.wasfdash = false;
465}
466
467void T602ImportFilter::inschrdef(unsigned char ch)
468{
469 sal_Unicode xch;
470
471 if(ch > 127) {
472
473 switch(ini.xcode) {
474 case L2 : break;
475 case KOI: ch = koi2lat[ch-128]; break;
476 case KAM: ch = kam2lat[ch-128]; break;
477 default : ch = kam2lat[ch-128];
478 }
479
480 if(ini.ruscode)
481 xch = (rus2UNC[(ch-128)*2] << 8) + rus2UNC[(ch-128)*2+1];
482 else
483 xch = (lat2UNC[(ch-128)*2] << 8) + lat2UNC[(ch-128)*2+1];
484 } else
485 xch = ch;
486
487 pst.waspar = false;
488 if (mxHandler.is())
489 mxHandler->characters(OUString(xch));
490}
491
492void T602ImportFilter::wrtfnt()
493{
494 Reference < XAttributeList > xAttrList ( mpAttrList );
495 const char *style;
496
497 switch(fst.nowfnt) {
498 case standard : style = fst.uline ? "T7" : "T1"; break;
499 case fat : style = fst.uline ? "T8" : "T2"; break;
500 case cursive : style = fst.uline ? "T9" : "T3"; break;
501 case bold : style = "T4"; break;
502 case tall : style = "T5"; break;
503 case big : style = "T6"; break;
504 case lindex : style = "T11";break;
505 case hindex : style = "T10";break;
506 default : style = "T1"; break;
507 }
508
509 End_("text:span");
510 if (mpAttrList)
511 mpAttrList->AddAttribute(
512 "text:style-name", OUString::createFromAscii(style));
513 Start_("text:span");
514}
515
516void T602ImportFilter::setfnt(fonts fnt,bool mustwrite)
517{
518 if (fnt == fst.oldfnt && fnt == fst.nowfnt && !mustwrite)
519 fst.nowfnt = standard;
520 else if (fnt != chngul)
521 fst.nowfnt = fnt;
522
523 if (mustwrite && (fst.oldfnt != fst.nowfnt || fst.olduline != fst.uline))
524 {
525 wrtfnt();
526 fst.oldfnt = fst.nowfnt;
527 fst.olduline = fst.uline;
528 }
529}
530
531unsigned char T602ImportFilter::Readchar602()
532{
534
535 return (mxInputStream->readBytes(aData, 1) > 0) ?
536 reinterpret_cast<unsigned char const *>(aData.getConstArray())[0] : 0;
537}
538
539void T602ImportFilter::par602(bool endofpage)
540{
541 sal_Int16 endp;
542 Reference < XAttributeList > xAttrList ( mpAttrList );
543
544 if(!endofpage || !pst.waspar) {
545 if(ini.showcomm||!pst.comment) {
546 if(pst.waspar||ini.reformatpars) {
547 End_("text:span");
548 End_("text:p");
549 if (mpAttrList)
550 mpAttrList->AddAttribute("text:style-name", "P1");
551 Start_("text:p");
552 Start_("text:span");
553 wrtfnt();
554 } else {
555 Start_("text:line-break");
556 End_("text:line-break");
557 }
558 }
559
560 pst.waspar = true;
561 }
562
563 if(pst.comment)
564 return;
565
566 switch(format602.lh) {
567 case 3: pst.pars += 4; break;
568 case 4: pst.pars += 3; break;
569 case 6: pst.pars += 2; break;
570 default: pst.pars +=2; break;
571 }
572 endp = format602.pl-format602.mt-format602.mb;
573 if(!(((pst.pars+1)/2) >= endp || endofpage)) return;
574
575 pst.pars = 0;
576 if(!ini.reformatpars) {
577 End_("text:span");
578 End_("text:p");
579 if (mpAttrList)
580 mpAttrList->AddAttribute("text:style-name", "P2");
581 Start_("text:p");
582 Start_("text:span");
583 wrtfnt();
584 }
585}
586
587sal_Int16 T602ImportFilter::readnum(unsigned char *ch, bool show)
588{
589 unsigned char buff[21];
590 sal_Int16 i=0;
591
592 while((i<20) && *ch && (*ch!='\n') && (*ch!=','))
593 {
594 *ch = Readchar602();
595 if(show) inschr(*ch);
596 buff[i++] = *ch;
597 }
598 buff[i]='\0';
599
600 // mba: cast from unsigned char via int to sal_Int16 seems to be safe
601 return static_cast<sal_Int16>(atoi(reinterpret_cast<char const *>(buff)));
602}
603
604unsigned char T602ImportFilter::Setformat602(const char *cmd)
605{
606 unsigned char ch;
607
608 ch = Readchar602();
609
610 if (cmd[0]=='M' && cmd[1]=='T') format602.mt = readnum(&ch,false);
611 else if (cmd[0]=='M' && cmd[1]=='B') format602.mb = readnum(&ch,false);
612 // else if (cmd[0]=='T' && cmd[1]=='B') {}
613 // else if (cmd[0]=='H' && cmd[1]=='E') {}
614 // else if (cmd[0]=='F' && cmd[1]=='O') {}
615 else if (cmd[0]=='C' && cmd[1]=='T') {
616 format602.ct = readnum(&ch,false);
617 if (!ini.forcecode)
618 switch(format602.ct) {
619 case 0: ini.xcode = KAM; break;
620 case 1: ini.xcode = L2; break;
621 case 2: ini.xcode = KOI; break;
622 default: ini.xcode = KAM; break;
623 }
624 }
625 else if (cmd[0]=='P' && cmd[1]=='N') format602.pn = readnum(&ch,false);
626 else if (cmd[0]=='L' && cmd[1]=='H') format602.lh = readnum(&ch,false);
627 // else if(cmd[0]=='S' && cmd[1]=='T') {} //styl
628 else if (cmd[0]=='L' && cmd[1]=='M') format602.lm = readnum(&ch,false);
629 else if (cmd[0]=='R' && cmd[1]=='M') format602.rm = readnum(&ch,false);
630 else if (cmd[0]=='P' && cmd[1]=='L') format602.pl = readnum(&ch,false);
631 else if (cmd[0]=='P' && cmd[1]=='A') { if(pst.pars) par602(true); }
632 else if (cmd[0]=='C' && cmd[1]=='P') {
633 sal_Int16 i = readnum(&ch,false);
634 if ((i+pst.pars/2) > (format602.pl-format602.mt-format602.mb))
635 if(pst.pars) par602(true);
636 }
637 while (ch && (ch != '\n')) ch = Readchar602();
638 return ch;
639}
640
641tnode T602ImportFilter::PointCmd602(unsigned char *ch)
642{
643 char pcmd[2];
644
645 // warning: uChar -> char
646 pcmd[0] = static_cast<char>(rtl::toAsciiUpperCase(*ch)); inschr(*ch);
647 *ch = Readchar602();
648 if (!*ch) return tnode::EEND;
649 if (*ch=='\n') return tnode::EOL;
650 if (!rtl::isAsciiAlpha(*ch)) return (*ch<32) ? tnode::SETCH : tnode::WRITE;
651
652 // warning: uChar -> char
653 pcmd[1] = static_cast<char>(rtl::toAsciiUpperCase(*ch)); inschr(*ch);
654
655 if (pcmd[0]=='P' && pcmd[1]=='A') { if (pst.pars) pst.willbeeop = true; }
656 else if (pcmd[0]=='C' && pcmd[1]=='P') { if (pst.pars) pst.willbeeop = true; }
657 else if (pcmd[0]=='P' && pcmd[1]=='I') {
658 while (*ch && (*ch != '\n') && (*ch != ','))
659 { *ch = Readchar602(); inschr(*ch); }
660 if (!*ch) return tnode::EEND;
661 if (*ch=='\n') return tnode::EOL;
662 if (*ch==',') { *ch = Readchar602(); inschr(*ch); }
663 pst.pars += (readnum(ch,true)*2);
664 if (!*ch) return tnode::EEND;
665 if (*ch=='\n') return tnode::EOL;
666 }
667 // else if(pcmd[0]=='K'&&pcmd[1]=='P') {}
668 // else if(pcmd[0]=='H'&&pcmd[1]=='E') {}
669 // else if(pcmd[0]=='F'&&pcmd[1]=='O') {}
670
671 return tnode::READCH;
672}
673
674
675void T602ImportFilter::Read602()
676{
677 unsigned char ch=0;
678 char cmd602[3] = {0};
679
680 Reference < XAttributeList > xAttrList ( mpAttrList );
681
682 if (node==tnode::QUIT) return;
683
684 if (mpAttrList)
685 mpAttrList->AddAttribute("text:style-name", "P1");
686 Start_("text:p");
687 if (mpAttrList)
688 mpAttrList->AddAttribute("text:style-name", "T1");
689 Start_("text:span");
690
691 if (node==tnode::START) { node = tnode::EOL; }
692
693 while (node != tnode::EEND) {
694 switch (node) {
695 case tnode::READCH:
696 ch = Readchar602();
697 if (ch == 0) node = tnode::EEND;
698 else if (ch == '\n') {
699 if(!pst.willbeeop) par602(false);
700 node = tnode::EOL;
701 } else if (ch < 32) node = tnode::SETCH;
702 else node = tnode::WRITE;
703 break;
704 case tnode::EOL:
705 ch = Readchar602();
706 pst.comment = false;
707 if (pst.willbeeop) par602(true);
708 pst.willbeeop = false;
709 if(ch == 0) node = tnode::EEND;
710 else if (ch == '@') node = tnode::EXPCMD;
711 else if (ch == '\n') { par602(false); node = tnode::EOL; }
712 else if (ch < 32) {pst.ccafterln = true; node = tnode::SETCH; break;}
713 else node = tnode::WRITE;
714 if (ch == '.') { pst.comment = true; node = tnode::POCMD; }
715 pst.ccafterln = false;
716 break;
717
718 case tnode::POCMD: inschr('.');
719 ch = Readchar602();
720 if(ch == 0) node = tnode::EEND;
721 else if(rtl::isAsciiAlpha(ch)) node = PointCmd602(&ch);
722 else if(ch <32) node=tnode::SETCH;
723 else node = tnode::WRITE;
724 break;
725
726 case tnode::EXPCMD: ch = Readchar602();
727 if(ch == 0) {inschr('@'); node = tnode::EEND; }
728 else if(rtl::isAsciiUpperCase(ch)) {
729 cmd602[0] = ch;
730 ch = Readchar602();
731 cmd602[1] = ch;
732 cmd602[2] = '\0';
733 if(rtl::isAsciiUpperCase(ch))
734 node = tnode::SETCMD; //nedodelano
735 else {
736 inschr('@');
737 if (mxHandler.is())
738 mxHandler->characters(OUString::createFromAscii(cmd602));
739 node = tnode::READCH;
740 }
741 } else {
742 inschr('@');
743 if(ch<32) node = tnode::SETCH;
744 else node = tnode::WRITE;}
745 break;
746
747 case tnode::SETCMD:
748 ch = Setformat602(cmd602);
749 if(ch == 0) node = tnode::EEND;
750 else if(ch == '\n') node = tnode::EOL;
751 else node = tnode::READCH;
752 break;
753
754 case tnode::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;
777 }
778 if(pst.ccafterln) node = tnode::EOL;
779 else node = tnode::READCH;
780 break;
781
782 case tnode::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 = tnode::EOL;
790 } else {
791 inschr(0x8d);//inschr(' ');
792 if(ch == 0) node = tnode::EEND;
793 else if(ch < 32) node = tnode::SETCH;
794 else node = tnode::WRITE;
795 }
796 break;
797 case 0xfe:
798 if (ini.showcomm||!pst.comment) inschr(' ');
799 node = tnode::READCH;
800 break;
801 case 0xad:
802 ch = Readchar602();
803 if( ch==0x8d ) {
804 if(ini.showcomm||!pst.comment) { //formatovaci pomlcka
805 if(!ini.reformatpars)
806 inschr('-');
807 else {
808 pst.wasspace--;
809 pst.wasfdash = true;
810 }
811 }
812 node=tnode::WRITE;
813 } else {
814 inschr(0xad);
815 if(ch == 0) node = tnode::EEND;
816 else if(ch == '\n') {
817 if(!pst.willbeeop) par602(false);
818 node = tnode::EOL; }
819 else if(ch < 32) node = tnode::SETCH;
820 else node = tnode::WRITE;
821 }
822 break;
823 default:
824 inschr(ch);
825 node = tnode::READCH;
826 break;
827 }
828 break;
829 default: break;
830 }
831 }
832
833 End_("text:span");
834 End_("text:p");
835 node = tnode::QUIT;
836}
837
838// XServiceInfo
839OUString SAL_CALL T602ImportFilter::getImplementationName( )
840{
841 return "com.sun.star.comp.Writer.T602ImportFilter";
842}
843
844sal_Bool SAL_CALL T602ImportFilter::supportsService( const OUString& rServiceName )
845{
846 return cppu::supportsService( this, rServiceName );
847}
848
849Sequence< OUString > SAL_CALL T602ImportFilter::getSupportedServiceNames( )
850{
851 return { "com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection" };
852}
853
855{
856}
857
859{
860}
861
863{
864 Any any;
865#define propInt_(_prop,_nam,_val) \
866 any <<= static_cast<sal_Int32>(_val);\
867 _prop->setPropertyValue(_nam, any);
868#define propShort_(_prop,_nam,_val) \
869 any <<= static_cast<sal_Int16>(_val);\
870 _prop->setPropertyValue(_nam, any);
871#define propBool_(_prop,_nam,_val) \
872 any <<= _val;\
873 _prop->setPropertyValue(_nam, any);
874#define propString_(_prop,_nam,_val) \
875 any <<= OUString(_val);\
876 _prop->setPropertyValue(_nam, any);
877#define propStringFromResId_(_prop,_nam,_val) \
878 any <<= FilterResId(_val);\
879 _prop->setPropertyValue(_nam, any);
880#define propGet_(_prop,_nam) \
881 _prop->getPropertyValue(_nam);
882#define Inst_(_path)\
883 xMultiServiceFactory->createInstance(_path);
884#define Insert_(_cont,_nam,_obj) \
885 any <<= _obj;\
886 _cont->insertByName( _nam, any );
887
888 Reference < XComponentContext > rComponentContext = defaultBootstrap_InitialComponentContext();
889 Reference < XMultiComponentFactory > rServiceManager = rComponentContext->getServiceManager();
890 Reference < XInterface > rInstance = rServiceManager->createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", rComponentContext );
891
892 Reference <XMultiServiceFactory> xMultiServiceFactory (rInstance,UNO_QUERY);
893
894 Reference < XPropertySet > xPSetDialog( rInstance, UNO_QUERY );
895 propInt_(xPSetDialog,"PositionX",100);
896 propInt_(xPSetDialog,"PositionY",100);
897 propInt_(xPSetDialog,"Width",130);
898 propInt_(xPSetDialog,"Height",90);
899 propStringFromResId_(xPSetDialog,"Title", T602FILTER_STR_IMPORT_DIALOG_TITLE);
900
901 static constexpr OUStringLiteral T602DLG_OK_BUTTON = u"ok_button";
902 static constexpr OUStringLiteral T602DLG_CANCEL_BUTTON = u"cancel_button";
903 static constexpr OUStringLiteral T602DLG_CODE_LB = u"code_lb";
904 static constexpr OUStringLiteral T602DLG_AZBUKA_CB = u"azbuka_cb";
905 static constexpr OUStringLiteral T602DLG_COMMENT_CB = u"comment_cb";
906 static constexpr OUStringLiteral T602DLG_REFORMAT_CB = u"reformat_cb";
907 static constexpr OUStringLiteral T602DLG_CODE_TXT = u"code_txt";
908
909 Reference < XInterface > TextModel = Inst_("com.sun.star.awt.UnoControlFixedTextModel");
910 Reference < XPropertySet > xPSetText( TextModel, UNO_QUERY );
911 propInt_(xPSetText,"PositionX",10);
912 propInt_(xPSetText,"PositionY",8);
913 propInt_(xPSetText,"Width",30);
914 propInt_(xPSetText,"Height",14);
915 propString_(xPSetText,"Name",T602DLG_CODE_TXT);
916 propStringFromResId_(xPSetText,"Label",T602FILTER_STR_ENCODING_LABEL);
917
918 Reference < XInterface > ListBoxModel = Inst_("com.sun.star.awt.UnoControlListBoxModel");
919 Reference < XPropertySet > xPSetCodeLB( ListBoxModel, UNO_QUERY );
920 propInt_(xPSetCodeLB,"PositionX",40);
921 propInt_(xPSetCodeLB,"PositionY",5);
922 propInt_(xPSetCodeLB,"Width",85);
923 propInt_(xPSetCodeLB,"Height",14);
924 propString_(xPSetCodeLB,"Name",T602DLG_CODE_LB);
925 propShort_(xPSetCodeLB,"TabIndex",1);
926 propBool_(xPSetCodeLB,"Dropdown",true);
927 propBool_(xPSetCodeLB,"MultiSelection",false);
928
929 Sequence< OUString > ous
930 {
931 FilterResId(T602FILTER_STR_ENCODING_AUTO),
932 FilterResId(T602FILTER_STR_ENCODING_CP852),
933 FilterResId(T602FILTER_STR_ENCODING_CP895),
934 FilterResId(T602FILTER_STR_ENCODING_KOI8CS2)
935 };
936 any <<= ous;
937 xPSetCodeLB->setPropertyValue("StringItemList", any);
938
939 Sequence < sal_Int16 > shr{ static_cast<sal_Int16>(ini.forcecode ? ini.xcode + 1 : 0) };
940 any <<= shr;
941 xPSetCodeLB->setPropertyValue("SelectedItems", any);
942
943 Reference < XInterface > AzbCheckBoxModel = Inst_("com.sun.star.awt.UnoControlCheckBoxModel");
944 Reference < XPropertySet > xPSetAzbukaCB( AzbCheckBoxModel, UNO_QUERY );
945 propInt_(xPSetAzbukaCB,"PositionX",10);
946 propInt_(xPSetAzbukaCB,"PositionY",25);
947 propInt_(xPSetAzbukaCB,"Width",100);
948 propInt_(xPSetAzbukaCB,"Height",14);
949 propString_(xPSetAzbukaCB,"Name",T602DLG_AZBUKA_CB);
950 propShort_(xPSetAzbukaCB,"TabIndex",2);
951 propStringFromResId_(xPSetAzbukaCB,"Label",T602FILTER_STR_CYRILLIC_MODE);
952 propShort_(xPSetAzbukaCB,"State",ini.ruscode);
953
954 Reference < XInterface > RefCheckBoxModel = Inst_("com.sun.star.awt.UnoControlCheckBoxModel");
955 Reference < XPropertySet > xPSetRefCB( RefCheckBoxModel, UNO_QUERY );
956 propInt_(xPSetRefCB,"PositionX",10);
957 propInt_(xPSetRefCB,"PositionY",40);
958 propInt_(xPSetRefCB,"Width",100);
959 propInt_(xPSetRefCB,"Height",14);
960 propString_(xPSetRefCB,"Name",T602DLG_REFORMAT_CB);
961 propShort_(xPSetRefCB,"TabIndex",3);
962 propStringFromResId_(xPSetRefCB,"Label",T602FILTER_STR_REFORMAT_TEXT);
963 propShort_(xPSetRefCB,"State",ini.reformatpars);
964
965 Reference < XInterface > CommCheckBoxModel = Inst_("com.sun.star.awt.UnoControlCheckBoxModel");
966 Reference < XPropertySet > xPSetCommCB( CommCheckBoxModel, UNO_QUERY );
967 propInt_(xPSetCommCB,"PositionX",10);
968 propInt_(xPSetCommCB,"PositionY",55);
969 propInt_(xPSetCommCB,"Width",100);
970 propInt_(xPSetCommCB,"Height",14);
971 propString_(xPSetCommCB,"Name",T602DLG_COMMENT_CB);
972 propShort_(xPSetCommCB,"TabIndex",4);
973 propStringFromResId_(xPSetCommCB,"Label",T602FILTER_STR_DOT_COMMANDS);
974 propShort_(xPSetCommCB,"State",ini.showcomm);
975
976 Reference < XInterface > CancelButtonModel = Inst_("com.sun.star.awt.UnoControlButtonModel");
977 Reference < XPropertySet > xPSetCancelButton( CancelButtonModel, UNO_QUERY );
978 propInt_(xPSetCancelButton,"PositionX",10);
979 propInt_(xPSetCancelButton,"PositionY",70);
980 propInt_(xPSetCancelButton,"Width",50);
981 propInt_(xPSetCancelButton,"Height",14);
982 propString_(xPSetCancelButton,"Name",T602DLG_CANCEL_BUTTON);
983 propShort_(xPSetCancelButton,"TabIndex",5);
984 propShort_(xPSetCancelButton,"PushButtonType",2);
985 propStringFromResId_(xPSetCancelButton,"Label",T602FILTER_STR_CANCEL_BUTTON);
986
987 Reference < XInterface > OkButtonModel = Inst_("com.sun.star.awt.UnoControlButtonModel");
988 Reference < XPropertySet > xPSetOkButton( OkButtonModel, UNO_QUERY );
989 propInt_(xPSetOkButton,"PositionX",70);
990 propInt_(xPSetOkButton,"PositionY",70);
991 propInt_(xPSetOkButton,"Width",50);
992 propInt_(xPSetOkButton,"Height",14);
993 propString_(xPSetOkButton,"Name",T602DLG_OK_BUTTON);
994 propShort_(xPSetOkButton,"TabIndex",0);
995 propShort_(xPSetOkButton,"PushButtonType",1);
996 propStringFromResId_(xPSetOkButton,"Label",T602FILTER_STR_OK_BUTTON);
997 propBool_(xPSetOkButton,"DefaultButton",true);
998
999 Reference < XNameContainer > xNameCont (rInstance,UNO_QUERY);
1000
1001 Insert_(xNameCont, T602DLG_OK_BUTTON, OkButtonModel);
1002 Insert_(xNameCont, T602DLG_CANCEL_BUTTON, CancelButtonModel);
1003 Insert_(xNameCont, T602DLG_AZBUKA_CB, AzbCheckBoxModel);
1004 Insert_(xNameCont, T602DLG_REFORMAT_CB, RefCheckBoxModel);
1005 Insert_(xNameCont, T602DLG_COMMENT_CB, CommCheckBoxModel);
1006 Insert_(xNameCont, T602DLG_CODE_LB, ListBoxModel);
1007 Insert_(xNameCont, T602DLG_CODE_TXT, TextModel);
1008
1009 Reference< XUnoControlDialog > dialog = UnoControlDialog::create(rComponentContext);
1010
1011 Reference < XControlModel > xControlModel (rInstance,UNO_QUERY);
1012
1013 dialog->setModel( xControlModel );
1014
1015 Reference < XToolkit > xToolkit = Toolkit::create( rComponentContext );
1016
1017 dialog->setVisible( false );
1018 dialog->createPeer( xToolkit, nullptr );
1019
1020 bool ret = ( dialog->execute() != 0 );
1021 if ( ret ) {
1022
1023 sal_Int16 tt = 0;
1024
1025 any = propGet_(xPSetAzbukaCB, "State"); any >>= tt; ini.ruscode = tt;
1026 any = propGet_(xPSetRefCB, "State"); any >>= tt; ini.reformatpars = tt;
1027 any = propGet_(xPSetCommCB, "State"); any >>= tt; ini.showcomm = tt;
1028
1029 any = propGet_(xPSetCodeLB, "SelectedItems"); any >>= shr;
1030
1031 if( shr[0] > 0 ) {
1032 ini.xcode = static_cast<tcode>(shr[0]-1);
1033 ini.forcecode = true;
1034 } else {
1035 ini.forcecode = false;
1036 }
1037 }
1038
1039 Reference<XControl>(dialog)->dispose();
1040
1041 return ret;
1042}
1043
1044void SAL_CALL T602ImportFilterDialog::setTitle( const OUString& )
1045{
1046}
1047
1049{
1050 if (OptionsDlg())
1051 return css::ui::dialogs::ExecutableDialogResults::OK;
1052 else
1053 return css::ui::dialogs::ExecutableDialogResults::CANCEL;
1054}
1055
1056uno::Sequence<beans::PropertyValue> SAL_CALL T602ImportFilterDialog::getPropertyValues()
1057{
1058 return uno::Sequence<beans::PropertyValue>();
1059}
1060
1061void SAL_CALL T602ImportFilterDialog::setPropertyValues( const uno::Sequence<beans::PropertyValue>& )
1062{
1063}
1064
1065
1066// XServiceInfo
1068{
1069 return "com.sun.star.comp.Writer.T602ImportFilterDialog";
1070}
1071
1072sal_Bool SAL_CALL T602ImportFilterDialog::supportsService( const OUString& rServiceName )
1073{
1074 return cppu::supportsService( this, rServiceName );
1075}
1076
1078{
1079 return { "com.sun.star.ui.dialogs.FilterOptionsDialog" };
1080}
1081
1082}
1083
1084extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
1086 css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
1087{
1088 return cppu::acquire(new T602ImportFilter::T602ImportFilterDialog());
1089}
1090
1091extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
1093 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
1094{
1095 return cppu::acquire(new T602ImportFilter::T602ImportFilter(context));
1096}
1097
1098extern "C" SAL_DLLPUBLIC_EXPORT bool TestImport602(SvStream &rStream)
1099{
1100 css::uno::Reference<io::XInputStream> xStream(new utl::OSeekableInputStreamWrapper(rStream));
1103 aImport->test();
1104 return true;
1105}
1106
1107/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XInputStream > xStream
const Any & any
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< css::beans::PropertyValue > &aProps) override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPropertyValues() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL setTitle(const OUString &aTitle) override
virtual sal_Int16 SAL_CALL execute() override
uno::Reference< uno::XComponentContext > mxContext
float u
float x
constexpr OUStringLiteral aData
static inistruct ini
Definition: t602filter.cxx:130
unsigned char const kam2lat[129]
Definition: t602filter.cxx:54
unsigned char const rus2UNC[257]
Definition: t602filter.cxx:96
unsigned char const lat2UNC[257]
Definition: t602filter.cxx:76
unsigned char const koi2lat[129]
Definition: t602filter.cxx:65
Shape IDs per cluster in DGG atom.
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
CPPUHELPER_DLLPUBLIC css::uno::Reference< css::uno::XComponentContext > SAL_CALL defaultBootstrap_InitialComponentContext()
int i
Definition: gentoken.py:48
START
static const sal_Int16 fontsize
Definition: t602filter.hxx:64
#define propBool_(_prop, _nam, _val)
#define Insert_(_cont, _nam, _obj)
#define propGet_(_prop, _nam)
#define propStringFromResId_(_prop, _nam, _val)
#define propShort_(_prop, _nam, _val)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * filter_T602ImportFilterDialog_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
#define Start_(_nam)
Definition: t602filter.cxx:116
#define propString_(_prop, _nam, _val)
#define Inst_(_path)
#define propInt_(_prop, _nam, _val)
SAL_DLLPUBLIC_EXPORT bool TestImport602(SvStream &rStream)
#define End_(_nam)
Definition: t602filter.cxx:124
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * filter_T602ImportFilter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
OUString Name
unsigned char sal_Bool
sal_uInt16 sal_Unicode
rtl::Reference< FragmentHandler > mxHandler
sal_Int32 nLength