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>
46 #include <osl/module.hxx>
47 #include <tools/stream.hxx>
48 #include <vcl/gdimtf.hxx>
50 #include "../source/filter/igif/gifread.hxx"
51 #include "../source/filter/ixbm/xbmread.hxx"
52 #include "../source/filter/ixpm/xpmread.hxx"
53 #include "../source/filter/jpeg/jpeg.hxx"
55 using namespace ::com::sun::star::uno
;
56 using namespace ::com::sun::star::lang
;
59 #ifndef DISABLE_DYNLOADING
60 extern "C" { static void thisModule() {} }
63 typedef bool (*FFilterCall
)(SvStream
&rStream
);
65 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc
, argv
)
72 fprintf(stderr
, "Usage: fftester <filename> <wmf|jpg>\n");
76 setenv("SAL_USE_VCLPLUGIN", "svp", 1);
77 setenv("JPEGMEM", "768M", 1);
78 setenv("SC_MAX_MATRIX_ELEMENTS", "60000000", 1);
79 setenv("SC_NO_THREADED_CALCULATION", "1", 1);
80 setenv("SAL_WMF_COMPLEXCLIP_VIA_REGION", "1", 1);
81 setenv("SAL_DISABLE_PRINTERLIST", "1", 1);
82 setenv("SAL_DISABLE_DEFAULTPRINTER", "1", 1);
83 setenv("SAL_NO_FONT_LOOKUP", "1", 1);
85 OUString
in(argv
[1], strlen(argv
[1]), RTL_TEXTENCODING_UTF8
);
87 osl::File::getFileURLFromSystemPath(in
, out
);
89 tools::extendApplicationEnvironment();
91 Reference
< XComponentContext
> xContext
= defaultBootstrap_InitialComponentContext();
92 Reference
< XMultiServiceFactory
> xServiceManager( xContext
->getServiceManager(), UNO_QUERY
);
93 if( !xServiceManager
.is() )
94 Application::Abort( "Failed to bootstrap" );
95 comphelper::setProcessServiceFactory( xServiceManager
);
96 utl::ConfigManager::EnableFuzzing();
98 // initialise unconfigured UCB:
99 css::uno::Reference
<css::ucb::XUniversalContentBroker
> xUcb(comphelper::getProcessServiceFactory()->
100 createInstance("com.sun.star.ucb.UniversalContentBroker"), css::uno::UNO_QUERY_THROW
);
101 css::uno::Sequence
<css::uno::Any
> aArgs(1);
102 aArgs
[0] <<= OUString("NoConfig");
103 css::uno::Reference
<css::ucb::XContentProvider
> xFileProvider(comphelper::getProcessServiceFactory()->
104 createInstanceWithArguments("com.sun.star.ucb.FileContentProvider", aArgs
), css::uno::UNO_QUERY_THROW
);
105 xUcb
->registerContentProvider(xFileProvider
, "file", true);
107 Application::EnableHeadlessMode(false);
110 if (strcmp(argv
[2], "wmf") == 0 || strcmp(argv
[2], "emf") == 0)
112 GDIMetaFile aGDIMetaFile
;
113 SvFileStream
aFileStream(out
, StreamMode::READ
);
114 ret
= static_cast<int>(ReadWindowMetafile(aFileStream
, aGDIMetaFile
));
116 else if (strcmp(argv
[2], "jpg") == 0)
119 SvFileStream
aFileStream(out
, StreamMode::READ
);
120 ret
= static_cast<int>(ImportJPEG(aFileStream
, aGraphic
, GraphicFilterImportFlags::NONE
, nullptr));
122 else if (strcmp(argv
[2], "gif") == 0)
124 SvFileStream
aFileStream(out
, StreamMode::READ
);
126 ret
= static_cast<int>(ImportGIF(aFileStream
, aGraphic
));
128 else if (strcmp(argv
[2], "xbm") == 0)
131 SvFileStream
aFileStream(out
, StreamMode::READ
);
132 ret
= static_cast<int>(ImportXBM(aFileStream
, aGraphic
));
134 else if (strcmp(argv
[2], "xpm") == 0)
137 SvFileStream
aFileStream(out
, StreamMode::READ
);
138 ret
= static_cast<int>(ImportXPM(aFileStream
, aGraphic
));
140 else if (strcmp(argv
[2], "png") == 0)
142 SvFileStream
aFileStream(out
, StreamMode::READ
);
143 vcl::PNGReader
aReader(aFileStream
);
144 ret
= static_cast<int>(!!aReader
.Read());
146 else if (strcmp(argv
[2], "bmp") == 0)
149 SvFileStream
aFileStream(out
, StreamMode::READ
);
150 ret
= static_cast<int>(ReadDIB(aTarget
, aFileStream
, true));
152 else if (strcmp(argv
[2], "svm") == 0)
154 GDIMetaFile aGDIMetaFile
;
155 SvFileStream
aFileStream(out
, StreamMode::READ
);
156 ReadGDIMetaFile(aFileStream
, aGDIMetaFile
);
158 #ifndef DISABLE_DYNLOADING
159 else if (strcmp(argv
[2], "pcd") == 0)
161 static PFilterCall
pfnImport(nullptr);
164 osl::Module aLibrary
;
165 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
166 pfnImport
= reinterpret_cast<PFilterCall
>(
167 aLibrary
.getFunctionSymbol("icdGraphicImport"));
171 SvFileStream
aFileStream(out
, StreamMode::READ
);
172 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
174 else if (strcmp(argv
[2], "dxf") == 0)
176 static PFilterCall
pfnImport(nullptr);
179 osl::Module aLibrary
;
180 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
181 pfnImport
= reinterpret_cast<PFilterCall
>(
182 aLibrary
.getFunctionSymbol("idxGraphicImport"));
186 SvFileStream
aFileStream(out
, StreamMode::READ
);
187 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
189 else if (strcmp(argv
[2], "met") == 0)
191 static PFilterCall
pfnImport(nullptr);
194 osl::Module aLibrary
;
195 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
196 pfnImport
= reinterpret_cast<PFilterCall
>(
197 aLibrary
.getFunctionSymbol("imeGraphicImport"));
201 SvFileStream
aFileStream(out
, StreamMode::READ
);
202 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
204 else if ((strcmp(argv
[2], "pbm") == 0) || strcmp(argv
[2], "ppm") == 0)
206 static PFilterCall
pfnImport(nullptr);
209 osl::Module aLibrary
;
210 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
211 pfnImport
= reinterpret_cast<PFilterCall
>(
212 aLibrary
.getFunctionSymbol("ipbGraphicImport"));
216 SvFileStream
aFileStream(out
, StreamMode::READ
);
217 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
219 else if (strcmp(argv
[2], "psd") == 0)
221 static PFilterCall
pfnImport(nullptr);
224 osl::Module aLibrary
;
225 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
226 pfnImport
= reinterpret_cast<PFilterCall
>(
227 aLibrary
.getFunctionSymbol("ipdGraphicImport"));
231 SvFileStream
aFileStream(out
, StreamMode::READ
);
232 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
234 else if (strcmp(argv
[2], "eps") == 0)
236 static PFilterCall
pfnImport(nullptr);
239 osl::Module aLibrary
;
240 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
241 pfnImport
= reinterpret_cast<PFilterCall
>(
242 aLibrary
.getFunctionSymbol("ipsGraphicImport"));
246 SvFileStream
aFileStream(out
, StreamMode::READ
);
247 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
249 else if (strcmp(argv
[2], "pct") == 0)
251 static PFilterCall
pfnImport(nullptr);
254 osl::Module aLibrary
;
255 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
256 pfnImport
= reinterpret_cast<PFilterCall
>(
257 aLibrary
.getFunctionSymbol("iptGraphicImport"));
261 SvFileStream
aFileStream(out
, StreamMode::READ
);
262 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
264 else if (strcmp(argv
[2], "pcx") == 0)
266 static PFilterCall
pfnImport(nullptr);
269 osl::Module aLibrary
;
270 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
271 pfnImport
= reinterpret_cast<PFilterCall
>(
272 aLibrary
.getFunctionSymbol("ipxGraphicImport"));
276 SvFileStream
aFileStream(out
, StreamMode::READ
);
277 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
279 else if (strcmp(argv
[2], "ras") == 0)
281 static PFilterCall
pfnImport(nullptr);
284 osl::Module aLibrary
;
285 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
286 pfnImport
= reinterpret_cast<PFilterCall
>(
287 aLibrary
.getFunctionSymbol("iraGraphicImport"));
291 SvFileStream
aFileStream(out
, StreamMode::READ
);
292 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
294 else if (strcmp(argv
[2], "tga") == 0)
296 static PFilterCall
pfnImport(nullptr);
299 osl::Module aLibrary
;
300 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
301 pfnImport
= reinterpret_cast<PFilterCall
>(
302 aLibrary
.getFunctionSymbol("itgGraphicImport"));
306 SvFileStream
aFileStream(out
, StreamMode::READ
);
307 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
309 else if (strcmp(argv
[2], "tif") == 0)
311 static PFilterCall
pfnImport(nullptr);
314 osl::Module aLibrary
;
315 aLibrary
.loadRelative(&thisModule
, "libgielo.so");
316 pfnImport
= reinterpret_cast<PFilterCall
>(
317 aLibrary
.getFunctionSymbol("itiGraphicImport"));
321 SvFileStream
aFileStream(out
, StreamMode::READ
);
322 ret
= static_cast<int>((*pfnImport
)(aFileStream
, aGraphic
, nullptr));
324 else if ((strcmp(argv
[2], "doc") == 0) || (strcmp(argv
[2], "ww8") == 0))
326 static FFilterCall
pfnImport(nullptr);
329 osl::Module aLibrary
;
330 aLibrary
.loadRelative(&thisModule
, "libmswordlo.so", SAL_LOADMODULE_LAZY
);
331 pfnImport
= reinterpret_cast<FFilterCall
>(
332 aLibrary
.getFunctionSymbol("TestImportWW8"));
335 SvFileStream
aFileStream(out
, StreamMode::READ
);
336 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
338 else if (strcmp(argv
[2], "ww6") == 0)
340 static FFilterCall
pfnImport(nullptr);
343 osl::Module aLibrary
;
344 aLibrary
.loadRelative(&thisModule
, "libmswordlo.so", SAL_LOADMODULE_LAZY
);
345 pfnImport
= reinterpret_cast<FFilterCall
>(
346 aLibrary
.getFunctionSymbol("TestImportWW6"));
349 SvFileStream
aFileStream(out
, StreamMode::READ
);
350 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
352 else if (strcmp(argv
[2], "ww2") == 0)
354 static FFilterCall
pfnImport(nullptr);
357 osl::Module aLibrary
;
358 aLibrary
.loadRelative(&thisModule
, "libmswordlo.so", SAL_LOADMODULE_LAZY
);
359 pfnImport
= reinterpret_cast<FFilterCall
>(
360 aLibrary
.getFunctionSymbol("TestImportWW2"));
363 SvFileStream
aFileStream(out
, StreamMode::READ
);
364 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
366 else if (strcmp(argv
[2], "rtf") == 0)
368 static FFilterCall
pfnImport(nullptr);
371 osl::Module aLibrary
;
372 aLibrary
.loadRelative(&thisModule
, "libmswordlo.so", SAL_LOADMODULE_LAZY
);
373 pfnImport
= reinterpret_cast<FFilterCall
>(
374 aLibrary
.getFunctionSymbol("TestImportRTF"));
377 SvFileStream
aFileStream(out
, StreamMode::READ
);
378 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
380 else if (strcmp(argv
[2], "html") == 0)
382 static FFilterCall
pfnImport(nullptr);
385 osl::Module aLibrary
;
386 aLibrary
.loadRelative(&thisModule
, "libswlo.so", SAL_LOADMODULE_LAZY
);
387 pfnImport
= reinterpret_cast<FFilterCall
>(
388 aLibrary
.getFunctionSymbol("TestImportHTML"));
391 SvFileStream
aFileStream(out
, StreamMode::READ
);
392 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
394 else if (strcmp(argv
[2], "fodt") == 0)
396 static FFilterCall
pfnImport(nullptr);
399 osl::Module aLibrary
;
400 aLibrary
.loadRelative(&thisModule
, "libswlo.so", SAL_LOADMODULE_LAZY
);
401 pfnImport
= reinterpret_cast<FFilterCall
>(
402 aLibrary
.getFunctionSymbol("TestImportFODT"));
405 SvFileStream
aFileStream(out
, StreamMode::READ
);
406 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
408 else if (strcmp(argv
[2], "docx") == 0)
410 static FFilterCall
pfnImport(nullptr);
413 osl::Module aLibrary
;
414 aLibrary
.loadRelative(&thisModule
, "libswlo.so", SAL_LOADMODULE_LAZY
);
415 pfnImport
= reinterpret_cast<FFilterCall
>(
416 aLibrary
.getFunctionSymbol("TestImportDOCX"));
419 SvFileStream
aFileStream(out
, StreamMode::READ
);
420 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
422 else if (strcmp(argv
[2], "fods") == 0)
424 static FFilterCall
pfnImport(nullptr);
427 osl::Module aLibrary
;
428 aLibrary
.loadRelative(&thisModule
, "libsclo.so", SAL_LOADMODULE_LAZY
);
429 pfnImport
= reinterpret_cast<FFilterCall
>(
430 aLibrary
.getFunctionSymbol("TestImportFODS"));
433 SvFileStream
aFileStream(out
, StreamMode::READ
);
434 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
436 else if (strcmp(argv
[2], "xlsx") == 0)
438 static FFilterCall
pfnImport(nullptr);
441 osl::Module aLibrary
;
442 aLibrary
.loadRelative(&thisModule
, "libsclo.so", SAL_LOADMODULE_LAZY
);
443 pfnImport
= reinterpret_cast<FFilterCall
>(
444 aLibrary
.getFunctionSymbol("TestImportXLSX"));
447 SvFileStream
aFileStream(out
, StreamMode::READ
);
448 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
450 else if (strcmp(argv
[2], "fodp") == 0)
452 static FFilterCall
pfnImport(nullptr);
455 osl::Module aLibrary
;
456 aLibrary
.loadRelative(&thisModule
, "libsdlo.so", SAL_LOADMODULE_LAZY
);
457 pfnImport
= reinterpret_cast<FFilterCall
>(
458 aLibrary
.getFunctionSymbol("TestImportFODP"));
461 SvFileStream
aFileStream(out
, StreamMode::READ
);
462 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
464 else if (strcmp(argv
[2], "pptx") == 0)
466 static FFilterCall
pfnImport(nullptr);
469 osl::Module aLibrary
;
470 aLibrary
.loadRelative(&thisModule
, "libsdlo.so", SAL_LOADMODULE_LAZY
);
471 pfnImport
= reinterpret_cast<FFilterCall
>(
472 aLibrary
.getFunctionSymbol("TestImportPPTX"));
475 SvFileStream
aFileStream(out
, StreamMode::READ
);
476 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
478 else if (strcmp(argv
[2], "xls") == 0)
480 static FFilterCall
pfnImport(nullptr);
483 osl::Module aLibrary
;
484 aLibrary
.loadRelative(&thisModule
, "libscfiltlo.so", SAL_LOADMODULE_LAZY
);
485 pfnImport
= reinterpret_cast<FFilterCall
>(
486 aLibrary
.getFunctionSymbol("TestImportXLS"));
489 SvFileStream
aFileStream(out
, StreamMode::READ
);
490 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
492 else if (strcmp(argv
[2], "wks") == 0)
494 static FFilterCall
pfnImport(nullptr);
497 osl::Module aLibrary
;
498 aLibrary
.loadRelative(&thisModule
, "libscfiltlo.so", SAL_LOADMODULE_LAZY
);
499 pfnImport
= reinterpret_cast<FFilterCall
>(
500 aLibrary
.getFunctionSymbol("TestImportWKS"));
503 SvFileStream
aFileStream(out
, StreamMode::READ
);
504 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
506 else if (strcmp(argv
[2], "hwp") == 0)
508 static FFilterCall
pfnImport(nullptr);
511 osl::Module aLibrary
;
512 aLibrary
.loadRelative(&thisModule
, "libhwplo.so", SAL_LOADMODULE_LAZY
);
513 pfnImport
= reinterpret_cast<FFilterCall
>(
514 aLibrary
.getFunctionSymbol("TestImportHWP"));
517 SvFileStream
aFileStream(out
, StreamMode::READ
);
518 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
520 else if (strcmp(argv
[2], "602") == 0)
522 static FFilterCall
pfnImport(nullptr);
525 osl::Module aLibrary
;
526 aLibrary
.loadRelative(&thisModule
, "libt602filterlo.so", SAL_LOADMODULE_LAZY
);
527 pfnImport
= reinterpret_cast<FFilterCall
>(
528 aLibrary
.getFunctionSymbol("TestImport602"));
531 SvFileStream
aFileStream(out
, StreamMode::READ
);
532 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
534 else if (strcmp(argv
[2], "lwp") == 0)
536 static FFilterCall
pfnImport(nullptr);
539 osl::Module aLibrary
;
540 aLibrary
.loadRelative(&thisModule
, "liblwpftlo.so", SAL_LOADMODULE_LAZY
);
541 pfnImport
= reinterpret_cast<FFilterCall
>(
542 aLibrary
.getFunctionSymbol("TestImportLWP"));
545 SvFileStream
aFileStream(out
, StreamMode::READ
);
546 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
548 else if (strcmp(argv
[2], "ppt") == 0)
550 static FFilterCall
pfnImport(nullptr);
553 osl::Module aLibrary
;
554 aLibrary
.loadRelative(&thisModule
, "libsdfiltlo.so", SAL_LOADMODULE_LAZY
);
555 pfnImport
= reinterpret_cast<FFilterCall
>(
556 aLibrary
.getFunctionSymbol("TestImportPPT"));
559 SvFileStream
aFileStream(out
, StreamMode::READ
);
560 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
562 else if (strcmp(argv
[2], "cgm") == 0)
564 static FFilterCall
pfnImport(nullptr);
567 osl::Module aLibrary
;
568 aLibrary
.loadRelative(&thisModule
, "libsdlo.so", SAL_LOADMODULE_LAZY
);
569 pfnImport
= reinterpret_cast<FFilterCall
>(
570 aLibrary
.getFunctionSymbol("TestImportCGM"));
573 SvFileStream
aFileStream(out
, StreamMode::READ
);
574 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
576 else if (strcmp(argv
[2], "qpw") == 0)
578 static FFilterCall
pfnImport(nullptr);
581 osl::Module aLibrary
;
582 aLibrary
.loadRelative(&thisModule
, "libscfiltlo.so", SAL_LOADMODULE_LAZY
);
583 pfnImport
= reinterpret_cast<FFilterCall
>(
584 aLibrary
.getFunctionSymbol("TestImportQPW"));
587 SvFileStream
aFileStream(out
, StreamMode::READ
);
588 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
590 else if (strcmp(argv
[2], "dif") == 0)
592 static FFilterCall
pfnImport(nullptr);
595 osl::Module aLibrary
;
596 aLibrary
.loadRelative(&thisModule
, "libscfiltlo.so", SAL_LOADMODULE_LAZY
);
597 pfnImport
= reinterpret_cast<FFilterCall
>(
598 aLibrary
.getFunctionSymbol("TestImportDIF"));
601 SvFileStream
aFileStream(out
, StreamMode::READ
);
602 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
604 else if (strcmp(argv
[2], "sc-rtf") == 0)
606 static FFilterCall
pfnImport(nullptr);
609 osl::Module aLibrary
;
610 aLibrary
.loadRelative(&thisModule
, "libscfiltlo.so", SAL_LOADMODULE_LAZY
);
611 pfnImport
= reinterpret_cast<FFilterCall
>(
612 aLibrary
.getFunctionSymbol("TestImportCalcRTF"));
615 SvFileStream
aFileStream(out
, StreamMode::READ
);
616 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
618 else if (strcmp(argv
[2], "slk") == 0)
620 static FFilterCall
pfnImport(nullptr);
623 osl::Module aLibrary
;
624 aLibrary
.loadRelative(&thisModule
, "libsclo.so", SAL_LOADMODULE_LAZY
);
625 pfnImport
= reinterpret_cast<FFilterCall
>(
626 aLibrary
.getFunctionSymbol("TestImportSLK"));
629 SvFileStream
aFileStream(out
, StreamMode::READ
);
630 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
632 else if (strcmp(argv
[2], "ole") == 0)
634 static FFilterCall
pfnImport(nullptr);
637 osl::Module aLibrary
;
638 aLibrary
.loadRelative(&thisModule
, "libsotlo.so", SAL_LOADMODULE_LAZY
);
639 pfnImport
= reinterpret_cast<FFilterCall
>(
640 aLibrary
.getFunctionSymbol("TestImportOLE2"));
643 SvFileStream
aFileStream(out
, StreamMode::READ
);
644 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
646 else if (strcmp(argv
[2], "mml") == 0)
648 static FFilterCall
pfnImport(nullptr);
651 osl::Module aLibrary
;
652 aLibrary
.loadRelative(&thisModule
, "libsmlo.so", SAL_LOADMODULE_LAZY
);
653 pfnImport
= reinterpret_cast<FFilterCall
>(
654 aLibrary
.getFunctionSymbol("TestImportMML"));
657 SvFileStream
aFileStream(out
, StreamMode::READ
);
658 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
660 else if (strcmp(argv
[2], "mtp") == 0)
662 static FFilterCall
pfnImport(nullptr);
665 osl::Module aLibrary
;
666 aLibrary
.loadRelative(&thisModule
, "libsmlo.so", SAL_LOADMODULE_LAZY
);
667 pfnImport
= reinterpret_cast<FFilterCall
>(
668 aLibrary
.getFunctionSymbol("TestImportMathType"));
671 SvFileStream
aFileStream(out
, StreamMode::READ
);
672 ret
= static_cast<int>((*pfnImport
)(aFileStream
));
674 else if (strcmp(argv
[2], "sft") == 0)
676 SvFileStream
aFileStream(out
, StreamMode::READ
);
677 std::vector
<sal_uInt8
> aData(aFileStream
.remainingSize());
678 aFileStream
.ReadBytes(aData
.data(), aData
.size());
679 (void)vcl::Font::identifyFont(aData
.data(), aData
.size());
692 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */