1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 cp workdir/LinkTarget/Executable/fftester instdir/program
23 LD_LIBRARY_PATH=`pwd`/instdir/program instdir/program/fftester <foo> png
27 #include <tools/extendapplicationenvironment.hxx>
29 #include <cppuhelper/bootstrap.hxx>
30 #include <comphelper/processfactory.hxx>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 #include <com/sun/star/ucb/XContentProvider.hpp>
34 #include <com/sun/star/ucb/XUniversalContentBroker.hpp>
35 #include <com/sun/star/uno/XComponentContext.hpp>
36 #include <unotools/configmgr.hxx>
37 #include <vcl/dibtools.hxx>
38 #include <vcl/event.hxx>
39 #include <vcl/graphicfilter.hxx>
40 #include <vcl/pngread.hxx>
41 #include <vcl/svapp.hxx>
42 #include <vcl/wmf.hxx>
43 #include <vcl/wrkwin.hxx>
44 #include <vcl/fltcall.hxx>
45 #include <osl/file.hxx>
47 #include "../source/filter/igif/gifread.hxx"
48 #include "../source/filter/ixbm/xbmread.hxx"
49 #include "../source/filter/ixpm/xpmread.hxx"
50 #include "../source/filter/jpeg/jpeg.hxx"
52 using namespace ::com::sun::star::uno
;
53 using namespace ::com::sun::star::lang
;
56 #ifndef DISABLE_DYNLOADING
57 extern "C" { static void thisModule() {} }
60 typedef bool (*FFilterCall
)(SvStream
&rStream
);
62 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc
, argv
)
69 fprintf(stderr
, "Usage: fftester <filename> <wmf|jpg>\n");
73 setenv("SAL_USE_VCLPLUGIN", "svp", 1);
74 setenv("JPEGMEM", "768M", 1);
75 setenv("SC_MAX_MATRIX_ELEMENTS", "60000000", 1);
76 setenv("SC_NO_THREADED_CALCULATION", "1", 1);
77 setenv("SAL_WMF_COMPLEXCLIP_VIA_REGION", "1", 1);
78 setenv("SAL_DISABLE_PRINTERLIST", "1", 1);
79 setenv("SAL_DISABLE_DEFAULTPRINTER", "1", 1);
80 setenv("SAL_NO_FONT_LOOKUP", "1", 1);
82 OUString
in(argv
[1], strlen(argv
[1]), RTL_TEXTENCODING_UTF8
);
84 osl::File::getFileURLFromSystemPath(in
, out
);
86 tools::extendApplicationEnvironment();
88 Reference
< XComponentContext
> xContext
= defaultBootstrap_InitialComponentContext();
89 Reference
< XMultiServiceFactory
> xServiceManager( xContext
->getServiceManager(), UNO_QUERY
);
90 if( !xServiceManager
.is() )
91 Application::Abort( "Failed to bootstrap" );
92 comphelper::setProcessServiceFactory( xServiceManager
);
93 utl::ConfigManager::EnableFuzzing();
95 // initialise unconfigured UCB:
96 css::uno::Reference
<css::ucb::XUniversalContentBroker
> xUcb(comphelper::getProcessServiceFactory()->
97 createInstance("com.sun.star.ucb.UniversalContentBroker"), css::uno::UNO_QUERY_THROW
);
98 css::uno::Sequence
<css::uno::Any
> aArgs(1);
99 aArgs
[0] <<= OUString("NoConfig");
100 css::uno::Reference
<css::ucb::XContentProvider
> xFileProvider(comphelper::getProcessServiceFactory()->
101 createInstanceWithArguments("com.sun.star.ucb.FileContentProvider", aArgs
), css::uno::UNO_QUERY_THROW
);
102 xUcb
->registerContentProvider(xFileProvider
, "file", true);
106 Application::SetDialogCancelMode(Application::DialogCancelMode::Silent
);
108 if (strcmp(argv
[2], "wmf") == 0 || strcmp(argv
[2], "emf") == 0)
110 GDIMetaFile aGDIMetaFile
;
111 SvFileStream
aFileStream(out
, StreamMode::READ
);
112 ret
= static_cast<int>(ReadWindowMetafile(aFileStream
, aGDIMetaFile
));
114 else if (strcmp(argv
[2], "jpg") == 0)
117 SvFileStream
aFileStream(out
, StreamMode::READ
);
118 ret
= static_cast<int>(ImportJPEG(aFileStream
, aGraphic
, GraphicFilterImportFlags::NONE
, nullptr));
120 else if (strcmp(argv
[2], "gif") == 0)
122 SvFileStream
aFileStream(out
, StreamMode::READ
);
124 ret
= static_cast<int>(ImportGIF(aFileStream
, aGraphic
));
126 else if (strcmp(argv
[2], "xbm") == 0)
129 SvFileStream
aFileStream(out
, StreamMode::READ
);
130 ret
= static_cast<int>(ImportXBM(aFileStream
, aGraphic
));
132 else if (strcmp(argv
[2], "xpm") == 0)
135 SvFileStream
aFileStream(out
, StreamMode::READ
);
136 ret
= static_cast<int>(ImportXPM(aFileStream
, aGraphic
));
138 else if (strcmp(argv
[2], "png") == 0)
140 SvFileStream
aFileStream(out
, StreamMode::READ
);
141 vcl::PNGReader
aReader(aFileStream
);
142 ret
= static_cast<int>(!!aReader
.Read());
144 else if (strcmp(argv
[2], "bmp") == 0)
147 SvFileStream
aFileStream(out
, StreamMode::READ
);
148 ret
= static_cast<int>(ReadDIB(aTarget
, aFileStream
, true));
150 else if (strcmp(argv
[2], "svm") == 0)
152 GDIMetaFile aGDIMetaFile
;
153 SvFileStream
aFileStream(out
, StreamMode::READ
);
154 ReadGDIMetaFile(aFileStream
, aGDIMetaFile
);
156 #ifndef DISABLE_DYNLOADING
157 else if (strcmp(argv
[2], "pcd") == 0)
159 static PFilterCall
pfnImport(nullptr);
162 osl::Module aLibrary
;
163 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
164 pfnImport
= reinterpret_cast<PFilterCall
>(
165 aLibrary
.getFunctionSymbol("icdGraphicImport"));
169 SvFileStream
aFileStream(out
, StreamMode::READ
);
170 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
172 else if (strcmp(argv
[2], "dxf") == 0)
174 static PFilterCall
pfnImport(nullptr);
177 osl::Module aLibrary
;
178 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
179 pfnImport
= reinterpret_cast<PFilterCall
>(
180 aLibrary
.getFunctionSymbol("idxGraphicImport"));
184 SvFileStream
aFileStream(out
, StreamMode::READ
);
185 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
187 else if (strcmp(argv
[2], "met") == 0)
189 static PFilterCall
pfnImport(nullptr);
192 osl::Module aLibrary
;
193 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
194 pfnImport
= reinterpret_cast<PFilterCall
>(
195 aLibrary
.getFunctionSymbol("imeGraphicImport"));
199 SvFileStream
aFileStream(out
, StreamMode::READ
);
200 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
202 else if ((strcmp(argv
[2], "pbm") == 0) || strcmp(argv
[2], "ppm") == 0)
204 static PFilterCall
pfnImport(nullptr);
207 osl::Module aLibrary
;
208 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
209 pfnImport
= reinterpret_cast<PFilterCall
>(
210 aLibrary
.getFunctionSymbol("ipbGraphicImport"));
214 SvFileStream
aFileStream(out
, StreamMode::READ
);
215 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
217 else if (strcmp(argv
[2], "psd") == 0)
219 static PFilterCall
pfnImport(nullptr);
222 osl::Module aLibrary
;
223 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
224 pfnImport
= reinterpret_cast<PFilterCall
>(
225 aLibrary
.getFunctionSymbol("ipdGraphicImport"));
229 SvFileStream
aFileStream(out
, StreamMode::READ
);
230 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
232 else if (strcmp(argv
[2], "eps") == 0)
234 static PFilterCall
pfnImport(nullptr);
237 osl::Module aLibrary
;
238 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
239 pfnImport
= reinterpret_cast<PFilterCall
>(
240 aLibrary
.getFunctionSymbol("ipsGraphicImport"));
244 SvFileStream
aFileStream(out
, StreamMode::READ
);
245 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
247 else if (strcmp(argv
[2], "pct") == 0)
249 static PFilterCall
pfnImport(nullptr);
252 osl::Module aLibrary
;
253 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
254 pfnImport
= reinterpret_cast<PFilterCall
>(
255 aLibrary
.getFunctionSymbol("iptGraphicImport"));
259 SvFileStream
aFileStream(out
, StreamMode::READ
);
260 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
262 else if (strcmp(argv
[2], "pcx") == 0)
264 static PFilterCall
pfnImport(nullptr);
267 osl::Module aLibrary
;
268 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
269 pfnImport
= reinterpret_cast<PFilterCall
>(
270 aLibrary
.getFunctionSymbol("ipxGraphicImport"));
274 SvFileStream
aFileStream(out
, StreamMode::READ
);
275 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
277 else if (strcmp(argv
[2], "ras") == 0)
279 static PFilterCall
pfnImport(nullptr);
282 osl::Module aLibrary
;
283 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
284 pfnImport
= reinterpret_cast<PFilterCall
>(
285 aLibrary
.getFunctionSymbol("iraGraphicImport"));
289 SvFileStream
aFileStream(out
, StreamMode::READ
);
290 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
292 else if (strcmp(argv
[2], "tga") == 0)
294 static PFilterCall
pfnImport(nullptr);
297 osl::Module aLibrary
;
298 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
299 pfnImport
= reinterpret_cast<PFilterCall
>(
300 aLibrary
.getFunctionSymbol("itgGraphicImport"));
304 SvFileStream
aFileStream(out
, StreamMode::READ
);
305 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
307 else if (strcmp(argv
[2], "tif") == 0)
309 static PFilterCall
pfnImport(nullptr);
312 osl::Module aLibrary
;
313 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
314 pfnImport
= reinterpret_cast<PFilterCall
>(
315 aLibrary
.getFunctionSymbol("itiGraphicImport"));
319 SvFileStream
aFileStream(out
, StreamMode::READ
);
320 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
322 else if ((strcmp(argv
[2], "doc") == 0) || (strcmp(argv
[2], "ww8") == 0))
324 static FFilterCall
pfnImport(nullptr);
327 osl::Module aLibrary
;
328 aLibrary
.loadRelative(&thisModule
, "libmswordlo.so", SAL_LOADMODULE_LAZY
);
329 pfnImport
= reinterpret_cast<FFilterCall
>(
330 aLibrary
.getFunctionSymbol("TestImportWW8"));
333 SvFileStream
aFileStream(out
, StreamMode::READ
);
334 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
336 else if (strcmp(argv
[2], "ww6") == 0)
338 static FFilterCall
pfnImport(nullptr);
341 osl::Module aLibrary
;
342 aLibrary
.loadRelative(&thisModule
, "libmswordlo.so", SAL_LOADMODULE_LAZY
);
343 pfnImport
= reinterpret_cast<FFilterCall
>(
344 aLibrary
.getFunctionSymbol("TestImportWW6"));
347 SvFileStream
aFileStream(out
, StreamMode::READ
);
348 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
350 else if (strcmp(argv
[2], "ww2") == 0)
352 static FFilterCall
pfnImport(nullptr);
355 osl::Module aLibrary
;
356 aLibrary
.loadRelative(&thisModule
, "libmswordlo.so", SAL_LOADMODULE_LAZY
);
357 pfnImport
= reinterpret_cast<FFilterCall
>(
358 aLibrary
.getFunctionSymbol("TestImportWW2"));
361 SvFileStream
aFileStream(out
, StreamMode::READ
);
362 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
364 else if (strcmp(argv
[2], "rtf") == 0)
366 static FFilterCall
pfnImport(nullptr);
369 osl::Module aLibrary
;
370 aLibrary
.loadRelative(&thisModule
, "libmswordlo.so", SAL_LOADMODULE_LAZY
);
371 pfnImport
= reinterpret_cast<FFilterCall
>(
372 aLibrary
.getFunctionSymbol("TestImportRTF"));
375 SvFileStream
aFileStream(out
, StreamMode::READ
);
376 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
378 else if (strcmp(argv
[2], "html") == 0)
380 static FFilterCall
pfnImport(nullptr);
383 osl::Module aLibrary
;
384 aLibrary
.loadRelative(&thisModule
, "libswlo.so", SAL_LOADMODULE_LAZY
);
385 pfnImport
= reinterpret_cast<FFilterCall
>(
386 aLibrary
.getFunctionSymbol("TestImportHTML"));
389 SvFileStream
aFileStream(out
, StreamMode::READ
);
390 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
392 else if (strcmp(argv
[2], "fodt") == 0)
394 static FFilterCall
pfnImport(nullptr);
397 osl::Module aLibrary
;
398 aLibrary
.loadRelative(&thisModule
, "libswlo.so", SAL_LOADMODULE_LAZY
);
399 pfnImport
= reinterpret_cast<FFilterCall
>(
400 aLibrary
.getFunctionSymbol("TestImportFODT"));
403 SvFileStream
aFileStream(out
, StreamMode::READ
);
404 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
406 else if (strcmp(argv
[2], "docx") == 0)
408 static FFilterCall
pfnImport(nullptr);
411 osl::Module aLibrary
;
412 aLibrary
.loadRelative(&thisModule
, "libswlo.so", SAL_LOADMODULE_LAZY
);
413 pfnImport
= reinterpret_cast<FFilterCall
>(
414 aLibrary
.getFunctionSymbol("TestImportDOCX"));
417 SvFileStream
aFileStream(out
, StreamMode::READ
);
418 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
420 else if (strcmp(argv
[2], "fods") == 0)
422 static FFilterCall
pfnImport(nullptr);
425 osl::Module aLibrary
;
426 aLibrary
.loadRelative(&thisModule
, "libsclo.so", SAL_LOADMODULE_LAZY
);
427 pfnImport
= reinterpret_cast<FFilterCall
>(
428 aLibrary
.getFunctionSymbol("TestImportFODS"));
431 SvFileStream
aFileStream(out
, StreamMode::READ
);
432 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
434 else if (strcmp(argv
[2], "xlsx") == 0)
436 static FFilterCall
pfnImport(nullptr);
439 osl::Module aLibrary
;
440 aLibrary
.loadRelative(&thisModule
, "libsclo.so", SAL_LOADMODULE_LAZY
);
441 pfnImport
= reinterpret_cast<FFilterCall
>(
442 aLibrary
.getFunctionSymbol("TestImportXLSX"));
445 SvFileStream
aFileStream(out
, StreamMode::READ
);
446 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
448 else if (strcmp(argv
[2], "fodp") == 0)
450 static FFilterCall
pfnImport(nullptr);
453 osl::Module aLibrary
;
454 aLibrary
.loadRelative(&thisModule
, "libsdlo.so", SAL_LOADMODULE_LAZY
);
455 pfnImport
= reinterpret_cast<FFilterCall
>(
456 aLibrary
.getFunctionSymbol("TestImportFODP"));
459 SvFileStream
aFileStream(out
, StreamMode::READ
);
460 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
462 else if (strcmp(argv
[2], "pptx") == 0)
464 static FFilterCall
pfnImport(nullptr);
467 osl::Module aLibrary
;
468 aLibrary
.loadRelative(&thisModule
, "libsdlo.so", SAL_LOADMODULE_LAZY
);
469 pfnImport
= reinterpret_cast<FFilterCall
>(
470 aLibrary
.getFunctionSymbol("TestImportPPTX"));
473 SvFileStream
aFileStream(out
, StreamMode::READ
);
474 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
476 else if (strcmp(argv
[2], "xls") == 0)
478 static FFilterCall
pfnImport(nullptr);
481 osl::Module aLibrary
;
482 aLibrary
.loadRelative(&thisModule
, "libscfiltlo.so", SAL_LOADMODULE_LAZY
);
483 pfnImport
= reinterpret_cast<FFilterCall
>(
484 aLibrary
.getFunctionSymbol("TestImportXLS"));
487 SvFileStream
aFileStream(out
, StreamMode::READ
);
488 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
490 else if (strcmp(argv
[2], "wks") == 0)
492 static FFilterCall
pfnImport(nullptr);
495 osl::Module aLibrary
;
496 aLibrary
.loadRelative(&thisModule
, "libscfiltlo.so", SAL_LOADMODULE_LAZY
);
497 pfnImport
= reinterpret_cast<FFilterCall
>(
498 aLibrary
.getFunctionSymbol("TestImportWKS"));
501 SvFileStream
aFileStream(out
, StreamMode::READ
);
502 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
504 else if (strcmp(argv
[2], "hwp") == 0)
506 static FFilterCall
pfnImport(nullptr);
509 osl::Module aLibrary
;
510 aLibrary
.loadRelative(&thisModule
, "libhwplo.so", SAL_LOADMODULE_LAZY
);
511 pfnImport
= reinterpret_cast<FFilterCall
>(
512 aLibrary
.getFunctionSymbol("TestImportHWP"));
515 SvFileStream
aFileStream(out
, StreamMode::READ
);
516 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
518 else if (strcmp(argv
[2], "602") == 0)
520 static FFilterCall
pfnImport(nullptr);
523 osl::Module aLibrary
;
524 aLibrary
.loadRelative(&thisModule
, "libt602filterlo.so", SAL_LOADMODULE_LAZY
);
525 pfnImport
= reinterpret_cast<FFilterCall
>(
526 aLibrary
.getFunctionSymbol("TestImport602"));
529 SvFileStream
aFileStream(out
, StreamMode::READ
);
530 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
532 else if (strcmp(argv
[2], "lwp") == 0)
534 static FFilterCall
pfnImport(nullptr);
537 osl::Module aLibrary
;
538 aLibrary
.loadRelative(&thisModule
, "liblwpftlo.so", SAL_LOADMODULE_LAZY
);
539 pfnImport
= reinterpret_cast<FFilterCall
>(
540 aLibrary
.getFunctionSymbol("TestImportLWP"));
543 SvFileStream
aFileStream(out
, StreamMode::READ
);
544 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
546 else if (strcmp(argv
[2], "ppt") == 0)
548 static FFilterCall
pfnImport(nullptr);
551 osl::Module aLibrary
;
552 aLibrary
.loadRelative(&thisModule
, "libsdfiltlo.so", SAL_LOADMODULE_LAZY
);
553 pfnImport
= reinterpret_cast<FFilterCall
>(
554 aLibrary
.getFunctionSymbol("TestImportPPT"));
557 SvFileStream
aFileStream(out
, StreamMode::READ
);
558 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
560 else if (strcmp(argv
[2], "cgm") == 0)
562 static FFilterCall
pfnImport(nullptr);
565 osl::Module aLibrary
;
566 aLibrary
.loadRelative(&thisModule
, "libsdlo.so", SAL_LOADMODULE_LAZY
);
567 pfnImport
= reinterpret_cast<FFilterCall
>(
568 aLibrary
.getFunctionSymbol("TestImportCGM"));
571 SvFileStream
aFileStream(out
, StreamMode::READ
);
572 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
574 else if (strcmp(argv
[2], "qpw") == 0)
576 static FFilterCall
pfnImport(nullptr);
579 osl::Module aLibrary
;
580 aLibrary
.loadRelative(&thisModule
, "libscfiltlo.so", SAL_LOADMODULE_LAZY
);
581 pfnImport
= reinterpret_cast<FFilterCall
>(
582 aLibrary
.getFunctionSymbol("TestImportQPW"));
585 SvFileStream
aFileStream(out
, StreamMode::READ
);
586 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
588 else if (strcmp(argv
[2], "dif") == 0)
590 static FFilterCall
pfnImport(nullptr);
593 osl::Module aLibrary
;
594 aLibrary
.loadRelative(&thisModule
, "libscfiltlo.so", SAL_LOADMODULE_LAZY
);
595 pfnImport
= reinterpret_cast<FFilterCall
>(
596 aLibrary
.getFunctionSymbol("TestImportDIF"));
599 SvFileStream
aFileStream(out
, StreamMode::READ
);
600 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
602 else if (strcmp(argv
[2], "sc-rtf") == 0)
604 static FFilterCall
pfnImport(nullptr);
607 osl::Module aLibrary
;
608 aLibrary
.loadRelative(&thisModule
, "libscfiltlo.so", SAL_LOADMODULE_LAZY
);
609 pfnImport
= reinterpret_cast<FFilterCall
>(
610 aLibrary
.getFunctionSymbol("TestImportCalcRTF"));
613 SvFileStream
aFileStream(out
, StreamMode::READ
);
614 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
616 else if (strcmp(argv
[2], "slk") == 0)
618 static FFilterCall
pfnImport(nullptr);
621 osl::Module aLibrary
;
622 aLibrary
.loadRelative(&thisModule
, "libsclo.so", SAL_LOADMODULE_LAZY
);
623 pfnImport
= reinterpret_cast<FFilterCall
>(
624 aLibrary
.getFunctionSymbol("TestImportSLK"));
627 SvFileStream
aFileStream(out
, StreamMode::READ
);
628 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
630 else if (strcmp(argv
[2], "ole") == 0)
632 static FFilterCall
pfnImport(nullptr);
635 osl::Module aLibrary
;
636 aLibrary
.loadRelative(&thisModule
, "libsotlo.so", SAL_LOADMODULE_LAZY
);
637 pfnImport
= reinterpret_cast<FFilterCall
>(
638 aLibrary
.getFunctionSymbol("TestImportOLE2"));
641 SvFileStream
aFileStream(out
, StreamMode::READ
);
642 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
644 else if (strcmp(argv
[2], "mml") == 0)
646 static FFilterCall
pfnImport(nullptr);
649 osl::Module aLibrary
;
650 aLibrary
.loadRelative(&thisModule
, "libsmlo.so", SAL_LOADMODULE_LAZY
);
651 pfnImport
= reinterpret_cast<FFilterCall
>(
652 aLibrary
.getFunctionSymbol("TestImportMML"));
655 SvFileStream
aFileStream(out
, StreamMode::READ
);
656 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
658 else if (strcmp(argv
[2], "mtp") == 0)
660 static FFilterCall
pfnImport(nullptr);
663 osl::Module aLibrary
;
664 aLibrary
.loadRelative(&thisModule
, "libsmlo.so", SAL_LOADMODULE_LAZY
);
665 pfnImport
= reinterpret_cast<FFilterCall
>(
666 aLibrary
.getFunctionSymbol("TestImportMathType"));
669 SvFileStream
aFileStream(out
, StreamMode::READ
);
670 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
672 else if (strcmp(argv
[2], "sft") == 0)
674 SvFileStream
aFileStream(out
, StreamMode::READ
);
675 std::vector
<sal_uInt8
> aData(aFileStream
.remainingSize());
676 aFileStream
.ReadBytes(aData
.data(), aData
.size());
677 (void)vcl::Font::identifyFont(aData
.data(), aData
.size());
690 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */