tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / writerperfect / source / writer / PagesImportFilter.cxx
blob37fbd2d556ccfec24ef1a33a202d65e2f9c58cfc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* PagesImportFilter: Sets up the filter, and calls DocumentCollector
3 * to do the actual filtering
5 * This file is part of the LibreOffice project.
7 * This Source Code Form is subject to the terms of the Mozilla Public
8 * License, v. 2.0. If a copy of the MPL was not distributed with this
9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 #include <libetonyek/libetonyek.h>
14 #include <cppuhelper/supportsservice.hxx>
16 #include "PagesImportFilter.hxx"
18 using libetonyek::EtonyekDocument;
20 bool PagesImportFilter::doImportDocument(weld::Window*, librevenge::RVNGInputStream& rInput,
21 OdtGenerator& rGenerator, utl::MediaDescriptor&)
23 return EtonyekDocument::parse(&rInput, &rGenerator);
26 bool PagesImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName)
28 EtonyekDocument::Type type = EtonyekDocument::TYPE_UNKNOWN;
29 const EtonyekDocument::Confidence confidence = EtonyekDocument::isSupported(&rInput, &type);
30 if ((confidence == EtonyekDocument::CONFIDENCE_EXCELLENT)
31 && (type == EtonyekDocument::TYPE_PAGES))
33 rTypeName = "writer_ApplePages";
34 return true;
37 return false;
40 // XServiceInfo
41 OUString SAL_CALL PagesImportFilter::getImplementationName()
43 return u"org.libreoffice.comp.Writer.PagesImportFilter"_ustr;
46 sal_Bool SAL_CALL PagesImportFilter::supportsService(const OUString& rServiceName)
48 return cppu::supportsService(this, rServiceName);
51 css::uno::Sequence<OUString> SAL_CALL PagesImportFilter::getSupportedServiceNames()
53 return { u"com.sun.star.document.ImportFilter"_ustr,
54 u"com.sun.star.document.ExtendedTypeDetection"_ustr };
57 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
58 org_libreoffice_comp_Writer_PagesImportFilter_get_implementation(
59 css::uno::XComponentContext* const context, const css::uno::Sequence<css::uno::Any>&)
61 return cppu::acquire(new PagesImportFilter(context));
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */