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>
This commit is contained in:
Miklos Vajna
2018-01-16 23:10:44 +01:00
parent 0b25dc8231
commit 9b3904357b
11 changed files with 37 additions and 39 deletions

View File

@@ -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");

View File

@@ -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;

View File

@@ -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));
}

View File

@@ -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.

View File

@@ -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));
}

View File

@@ -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

View File

@@ -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);

View File

@@ -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;

View File

@@ -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:

View File

@@ -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;

View File

@@ -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;