Simplify using designated initializers
[LibreOffice.git] / writerperfect / source / draw / ZMFImportFilter.cxx
blob15e8719b7bb7670a2647fedb0a87cbf841ae8367
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ZMFImportFilter: Sets up the filter, and calls OdgExporter
3 * to do the actual filtering
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 */
10 #include <libzmf/libzmf.h>
12 #include <cppuhelper/supportsservice.hxx>
14 #include "ZMFImportFilter.hxx"
16 using com::sun::star::uno::Sequence;
17 using com::sun::star::uno::XComponentContext;
18 using com::sun::star::uno::XInterface;
20 bool ZMFImportFilter::doImportDocument(weld::Window*, librevenge::RVNGInputStream& rInput,
21 OdgGenerator& rGenerator, utl::MediaDescriptor&)
23 return libzmf::ZMFDocument::parse(&rInput, &rGenerator);
26 bool ZMFImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName)
28 if (libzmf::ZMFDocument::isSupported(&rInput))
30 rTypeName = "draw_ZMF_Document";
31 return true;
34 return false;
37 // XServiceInfo
38 OUString SAL_CALL ZMFImportFilter::getImplementationName()
40 return u"org.libreoffice.comp.Draw.ZMFImportFilter"_ustr;
43 sal_Bool SAL_CALL ZMFImportFilter::supportsService(const OUString& rServiceName)
45 return cppu::supportsService(this, rServiceName);
48 Sequence<OUString> SAL_CALL ZMFImportFilter::getSupportedServiceNames()
50 return { u"com.sun.star.document.ImportFilter"_ustr,
51 u"com.sun.star.document.ExtendedTypeDetection"_ustr };
54 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
55 org_libreoffice_comp_Draw_ZMFImportFilter_get_implementation(
56 css::uno::XComponentContext* const context, const css::uno::Sequence<css::uno::Any>&)
58 return cppu::acquire(new ZMFImportFilter(context));
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */