diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-07-01 09:20:18 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-07-03 14:46:04 +0000 |
commit | 4ca9473d824fe37c2a63d48917cbaee79f5811e1 (patch) | |
tree | fd75a1a5549e00f5d2eaf960622a18a287879c40 /sdext | |
parent | 7fa28a17f658c2bd15a359a5153e77667b925a20 (diff) |
Work around const-ness issues in the GooString API
cf. <https://gerrit.libreoffice.org/#/c/16357> "Revert the removal of cast to
build on old poppler"
Change-Id: I75184cec64b4f32e0cf9adedeb84c8591be4fc73
(cherry picked from commit b51ba9e383243e8248d6da1b71a5b06d841d165b)
Reviewed-on: https://gerrit.libreoffice.org/16643
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx index f4fa810ebaa9..b5dd4e4328b0 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx @@ -103,13 +103,13 @@ namespace pdfi isUnderline(rSrc.isUnderline), size(rSrc.size) { - familyName.append(const_cast<GooString*>(&rSrc.familyName)); + familyName.append(&rSrc.getFamilyName()); } FontAttributes& operator=( const FontAttributes& rSrc ) { familyName.clear(); - familyName.append(const_cast<GooString*>(&rSrc.familyName)); + familyName.append(&rSrc.getFamilyName()); isEmbedded = rSrc.isEmbedded; isBold = rSrc.isBold; @@ -122,8 +122,7 @@ namespace pdfi bool operator==(const FontAttributes& rFont) const { - return familyName.cmp( - const_cast<GooString*>(&rFont.familyName))==0 && + return getFamilyName().cmp(&rFont.getFamilyName())==0 && isEmbedded == rFont.isEmbedded && isBold == rFont.isBold && isItalic == rFont.isItalic && @@ -137,6 +136,11 @@ namespace pdfi bool isItalic; bool isUnderline; double size; + + private: + // Work around const-ness issues in the GooString API: + GooString & getFamilyName() const + { return const_cast<GooString &>(familyName); } }; class PDFOutDev : public OutputDev |