diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-01-16 23:10:44 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-01-17 09:05:02 +0100 |
commit | 9b3904357be1fc4775fe5fb516d82c7c1ee53a1e (patch) | |
tree | 24d96201892e5b5ae6ebf7c429d51a07ba68ae8c /writerperfect/source | |
parent | 0b25dc8231b51ef1fdb03274387851d1379a03b5 (diff) |
EPUB export: various small cleanups
Change-Id: Iaa921257720adc6a65c8598b1105a4d7249778e6
Reviewed-on: https://gerrit.libreoffice.org/48021
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerperfect/source')
-rw-r--r-- | writerperfect/source/writer/EPUBExportDialog.cxx | 4 | ||||
-rw-r--r-- | writerperfect/source/writer/EPUBExportDialog.hxx | 2 | ||||
-rw-r--r-- | writerperfect/source/writer/EPUBExportFilter.cxx | 8 | ||||
-rw-r--r-- | writerperfect/source/writer/EPUBExportFilter.hxx | 4 | ||||
-rw-r--r-- | writerperfect/source/writer/EPUBExportUIComponent.cxx | 6 | ||||
-rw-r--r-- | writerperfect/source/writer/EPUBExportUIComponent.hxx | 4 | ||||
-rw-r--r-- | writerperfect/source/writer/EPUBPackage.cxx | 4 | ||||
-rw-r--r-- | writerperfect/source/writer/EPUBPackage.hxx | 2 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/xmlfmt.cxx | 2 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/xmlimp.cxx | 22 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/xmlmetai.hxx | 18 |
11 files changed, 37 insertions, 39 deletions
diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx b/writerperfect/source/writer/EPUBExportDialog.cxx index fd449970fa7b..2add78c6389f 100644 --- a/writerperfect/source/writer/EPUBExportDialog.cxx +++ b/writerperfect/source/writer/EPUBExportDialog.cxx @@ -68,9 +68,9 @@ sal_Int32 PositionToVersion(sal_Int32 nPosition) namespace writerperfect { -EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap &rFilterData, const uno::Reference<uno::XComponentContext> &xContext) +EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap &rFilterData, uno::Reference<uno::XComponentContext> xContext) : ModalDialog(pParent, "EpubDialog", "writerperfect/ui/exportepub.ui"), - mxContext(xContext), + mxContext(std::move(xContext)), mrFilterData(rFilterData) { get(m_pVersion, "versionlb"); diff --git a/writerperfect/source/writer/EPUBExportDialog.hxx b/writerperfect/source/writer/EPUBExportDialog.hxx index 8f84779aa8cc..8180e4a24366 100644 --- a/writerperfect/source/writer/EPUBExportDialog.hxx +++ b/writerperfect/source/writer/EPUBExportDialog.hxx @@ -27,7 +27,7 @@ namespace writerperfect class EPUBExportDialog : public ModalDialog { public: - EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap &rFilterData, const css::uno::Reference<css::uno::XComponentContext> &xContext); + EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap &rFilterData, css::uno::Reference<css::uno::XComponentContext> xContext); ~EPUBExportDialog() override; void dispose() override; diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx b/writerperfect/source/writer/EPUBExportFilter.cxx index 7c1bd1a6d796..b25118350193 100644 --- a/writerperfect/source/writer/EPUBExportFilter.cxx +++ b/writerperfect/source/writer/EPUBExportFilter.cxx @@ -34,8 +34,8 @@ using namespace com::sun::star; namespace writerperfect { -EPUBExportFilter::EPUBExportFilter(const uno::Reference<uno::XComponentContext> &xContext) - : mxContext(xContext) +EPUBExportFilter::EPUBExportFilter(uno::Reference<uno::XComponentContext> xContext) + : mxContext(std::move(xContext)) { } @@ -143,7 +143,7 @@ void EPUBExportFilter::CreateMetafiles(std::vector<std::pair<uno::Sequence<sal_I // Get the CSS pixel size of the page (mm100 -> pixel using 96 DPI, independent from system DPI). Size aCss(static_cast<double>(aLogic.getWidth()) / 26.4583, static_cast<double>(aLogic.getHeight()) / 26.4583); Graphic aGraphic = aRenderer.renderToGraphic(nPage, aDocumentSizePixel, aCss, COL_WHITE); - GDIMetaFile &rGDIMetaFile = const_cast<GDIMetaFile &>(aGraphic.GetGDIMetaFile()); + auto &rGDIMetaFile = const_cast<GDIMetaFile &>(aGraphic.GetGDIMetaFile()); // Set preferred map unit and size on the metafile, so the SVG size // will be correct in MM. @@ -188,7 +188,7 @@ uno::Sequence<OUString> EPUBExportFilter::getSupportedServiceNames() return aRet; } -extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface *com_sun_star_comp_Writer_EPUBExportFilter_get_implementation(uno::XComponentContext *pContext, uno::Sequence<uno::Any> const &) +extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface *com_sun_star_comp_Writer_EPUBExportFilter_get_implementation(uno::XComponentContext *pContext, uno::Sequence<uno::Any> const &/*rSeq*/) { return cppu::acquire(new EPUBExportFilter(pContext)); } diff --git a/writerperfect/source/writer/EPUBExportFilter.hxx b/writerperfect/source/writer/EPUBExportFilter.hxx index b736c9f4494b..188139a32843 100644 --- a/writerperfect/source/writer/EPUBExportFilter.hxx +++ b/writerperfect/source/writer/EPUBExportFilter.hxx @@ -36,7 +36,7 @@ class EPUBExportFilter : public cppu::WeakImplHelper css::uno::Reference<css::lang::XComponent> mxSourceDocument; public: - EPUBExportFilter(const css::uno::Reference<css::uno::XComponentContext> &xContext); + EPUBExportFilter(css::uno::Reference<css::uno::XComponentContext> xContext); // XFilter sal_Bool SAL_CALL filter(const css::uno::Sequence<css::beans::PropertyValue> &rDescriptor) override; @@ -47,7 +47,7 @@ public: // XServiceInfo OUString SAL_CALL getImplementationName() override; - sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override; + sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override; css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; /// Gives the default EPUB version. diff --git a/writerperfect/source/writer/EPUBExportUIComponent.cxx b/writerperfect/source/writer/EPUBExportUIComponent.cxx index e33fdab01972..66d8506fa771 100644 --- a/writerperfect/source/writer/EPUBExportUIComponent.cxx +++ b/writerperfect/source/writer/EPUBExportUIComponent.cxx @@ -22,8 +22,8 @@ using namespace com::sun::star; namespace writerperfect { -EPUBExportUIComponent::EPUBExportUIComponent(const uno::Reference<uno::XComponentContext> &xContext) - : mxContext(xContext) +EPUBExportUIComponent::EPUBExportUIComponent(uno::Reference<uno::XComponentContext> xContext) + : mxContext(std::move(xContext)) { } @@ -82,7 +82,7 @@ sal_Int16 EPUBExportUIComponent::execute() return ui::dialogs::ExecutableDialogResults::CANCEL; } -extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface *com_sun_star_comp_Writer_EPUBExportUIComponent_get_implementation(uno::XComponentContext *pCtx, uno::Sequence<uno::Any> const &) +extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface *com_sun_star_comp_Writer_EPUBExportUIComponent_get_implementation(uno::XComponentContext *pCtx, uno::Sequence<uno::Any> const &/*rSeq*/) { return cppu::acquire(new EPUBExportUIComponent(pCtx)); } diff --git a/writerperfect/source/writer/EPUBExportUIComponent.hxx b/writerperfect/source/writer/EPUBExportUIComponent.hxx index 202b2d29b523..3ef6d7cc1b2f 100644 --- a/writerperfect/source/writer/EPUBExportUIComponent.hxx +++ b/writerperfect/source/writer/EPUBExportUIComponent.hxx @@ -30,7 +30,7 @@ class EPUBExportUIComponent : public cppu::WeakImplHelper > { public: - EPUBExportUIComponent(const css::uno::Reference<css::uno::XComponentContext> &xContext); + EPUBExportUIComponent(css::uno::Reference<css::uno::XComponentContext> xContext); // XPropertyAccess css::uno::Sequence<css::beans::PropertyValue> SAL_CALL getPropertyValues() override; @@ -38,7 +38,7 @@ public: // XServiceInfo OUString SAL_CALL getImplementationName() override; - sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override; + sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override; css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; // XExecutableDialog diff --git a/writerperfect/source/writer/EPUBPackage.cxx b/writerperfect/source/writer/EPUBPackage.cxx index 0e34400171da..147a44b09454 100644 --- a/writerperfect/source/writer/EPUBPackage.cxx +++ b/writerperfect/source/writer/EPUBPackage.cxx @@ -24,8 +24,8 @@ using namespace com::sun::star; namespace writerperfect { -EPUBPackage::EPUBPackage(const uno::Reference<uno::XComponentContext> &xContext, const uno::Sequence<beans::PropertyValue> &rDescriptor) - : mxContext(xContext) +EPUBPackage::EPUBPackage(uno::Reference<uno::XComponentContext> xContext, const uno::Sequence<beans::PropertyValue> &rDescriptor) + : mxContext(std::move(xContext)) { // Extract the output stream from the descriptor. utl::MediaDescriptor aMediaDesc(rDescriptor); diff --git a/writerperfect/source/writer/EPUBPackage.hxx b/writerperfect/source/writer/EPUBPackage.hxx index 20bd5007a84d..5cb5f6dbefce 100644 --- a/writerperfect/source/writer/EPUBPackage.hxx +++ b/writerperfect/source/writer/EPUBPackage.hxx @@ -30,7 +30,7 @@ class EPUBPackage : public libepubgen::EPUBPackage css::uno::Reference<css::xml::sax::XWriter> mxOutputWriter; public: - explicit EPUBPackage(const css::uno::Reference<css::uno::XComponentContext> &xContext, const css::uno::Sequence<css::beans::PropertyValue> &rDescriptor); + explicit EPUBPackage(css::uno::Reference<css::uno::XComponentContext> xContext, const css::uno::Sequence<css::beans::PropertyValue> &rDescriptor); ~EPUBPackage() override; diff --git a/writerperfect/source/writer/exp/xmlfmt.cxx b/writerperfect/source/writer/exp/xmlfmt.cxx index 333ad7751c35..266b2ee110c9 100644 --- a/writerperfect/source/writer/exp/xmlfmt.cxx +++ b/writerperfect/source/writer/exp/xmlfmt.cxx @@ -118,7 +118,7 @@ private: class XMLFontFaceFormatContext : public XMLImportContext { public: - XMLFontFaceFormatContext(XMLImport &rImport, XMLFontFaceUriContext &rFontUri); + XMLFontFaceFormatContext(XMLImport &rImport, XMLFontFaceUriContext &rFontFaceUri); void SAL_CALL startElement(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override; private: diff --git a/writerperfect/source/writer/exp/xmlimp.cxx b/writerperfect/source/writer/exp/xmlimp.cxx index 55e922aeaace..811e604a3801 100644 --- a/writerperfect/source/writer/exp/xmlimp.cxx +++ b/writerperfect/source/writer/exp/xmlimp.cxx @@ -131,8 +131,8 @@ OUString FindCoverImage(const OUString &rDocumentBaseURL, OUString &rMimeType, c // File exists. return aRet; } - else - aRet.clear(); + + aRet.clear(); } } @@ -260,17 +260,15 @@ rtl::Reference<XMLImportContext> XMLOfficeDocContext::CreateChildContext(const O { if (mrImport.GetPageMetafiles().empty()) return new XMLBodyContext(mrImport); - else + + // Ignore text from doc model in the fixed layout case, instead + // insert the page metafiles. + bool bFirst = true; + for (const auto &rPage : mrImport.GetPageMetafiles()) { - // Ignore text from doc model in the fixed layout case, instead - // insert the page metafiles. - bool bFirst = true; - for (const auto &rPage : mrImport.GetPageMetafiles()) - { - HandleFixedLayoutPage(rPage.first, rPage.second, bFirst); - if (bFirst) - bFirst = false; - } + HandleFixedLayoutPage(rPage.first, rPage.second, bFirst); + if (bFirst) + bFirst = false; } } return nullptr; diff --git a/writerperfect/source/writer/exp/xmlmetai.hxx b/writerperfect/source/writer/exp/xmlmetai.hxx index fab55277f0e5..d69818a8648b 100644 --- a/writerperfect/source/writer/exp/xmlmetai.hxx +++ b/writerperfect/source/writer/exp/xmlmetai.hxx @@ -40,24 +40,24 @@ class XMPParser: public cppu::WeakImplHelper { public: explicit XMPParser(librevenge::RVNGPropertyList &rMetaData); - virtual ~XMPParser() override; + ~XMPParser() override; // XDocumentHandler - virtual void SAL_CALL startDocument() override; + void SAL_CALL startDocument() override; - virtual void SAL_CALL endDocument() override; + void SAL_CALL endDocument() override; - virtual void SAL_CALL startElement(const OUString &aName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override; + void SAL_CALL startElement(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override; - virtual void SAL_CALL endElement(const OUString &aName) override; + void SAL_CALL endElement(const OUString &rName) override; - virtual void SAL_CALL characters(const OUString &aChars) override; + void SAL_CALL characters(const OUString &rChars) override; - virtual void SAL_CALL ignorableWhitespace(const OUString &aWhitespaces) override; + void SAL_CALL ignorableWhitespace(const OUString &aWhitespaces) override; - virtual void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override; + void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override; - virtual void SAL_CALL setDocumentLocator(const css::uno::Reference<css::xml::sax::XLocator> &xLocator) override; + void SAL_CALL setDocumentLocator(const css::uno::Reference<css::xml::sax::XLocator> &xLocator) override; private: librevenge::RVNGPropertyList &mrMetaData; |