include/vcl/outdev.hxx | 10 ++++++---- vcl/source/gdi/pdfwriter_impl.cxx | 14 ++++++++++++++ vcl/source/gdi/pdfwriter_impl.hxx | 1 + vcl/source/outdev/font.cxx | 9 --------- 4 files changed, 21 insertions(+), 13 deletions(-)
New commits: commit 9a58ec3f6f65da27e3b26e1173b6661b743e66a4 Author: Chris Sherlock <chris.sherloc...@gmail.com> AuthorDate: Sun Mar 7 11:19:29 2021 +1100 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sat Aug 28 14:10:51 2021 +0200 tdf#74702 vcl: remove GetOutDevType() from ImplNewFont() Change-Id: I59a14b0c392098761f9304708f4859f7e2381c14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115469 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 011fc5445e0c..144a52308a3e 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -177,8 +177,6 @@ private: mutable VclPtr<OutputDevice> mpNextGraphics; ///< Next output device in list GDIMetaFile* mpMetaFile; mutable rtl::Reference<LogicalFontInstance> mpFontInstance; - mutable std::shared_ptr<ImplFontCache> mxFontCache; - mutable std::shared_ptr<PhysicalFontCollection> mxFontCollection; mutable std::unique_ptr<ImplDeviceFontList> mpDeviceFontList; mutable std::unique_ptr<ImplDeviceFontSizeList> mpDeviceFontSizeList; std::vector<OutDevState> maOutDevStateStack; @@ -253,6 +251,10 @@ private: mutable bool mbRefPoint : 1; mutable bool mbEnableRTL : 1; +protected: + mutable std::shared_ptr<PhysicalFontCollection> mxFontCollection; + mutable std::shared_ptr<ImplFontCache> mxFontCache; + /** @name Initialization and accessor functions */ ///@{ @@ -1178,12 +1180,12 @@ protected: void SetFontCollectionFromSVData(); void ResetNewFontCache(); + SAL_DLLPRIVATE bool ImplNewFont() const; + private: typedef void ( OutputDevice::* FontUpdateHandler_t )( bool ); - SAL_DLLPRIVATE bool ImplNewFont() const; - SAL_DLLPRIVATE static void ImplUpdateFontDataForAllFrames( FontUpdateHandler_t pHdl, bool bNewFontLists ); static diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 41fc6b88d4ef..a099ef87bde1 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -68,6 +68,7 @@ #include <vcl/filter/pdfdocument.hxx> #include <comphelper/hash.hxx> +#include <svdata.hxx> #include <bitmap/BitmapWriteAccess.hxx> #include <fontsubset.hxx> #include <PhysicalFontFace.hxx> @@ -1341,6 +1342,19 @@ void PDFWriterImpl::dispose() VirtualDevice::dispose(); } +bool PDFWriterImpl::ImplNewFont() const +{ + const ImplSVData* pSVData = ImplGetSVData(); + + if( mxFontCollection == pSVData->maGDIData.mxScreenFontList + || mxFontCache == pSVData->maGDIData.mxScreenFontCache ) + { + const_cast<vcl::PDFWriterImpl&>(*this).ImplUpdateFontData(); + } + + return OutputDevice::ImplNewFont(); +} + void PDFWriterImpl::setupDocInfo() { std::vector< sal_uInt8 > aId; diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 43a55ad23196..e594d6332683 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -643,6 +643,7 @@ public: static void convertLineInfoToExtLineInfo( const LineInfo& rIn, PDFWriter::ExtLineInfo& rOut ); protected: + bool ImplNewFont() const; void ImplClearFontData(bool bNewFontLists) override; void ImplRefreshFontData(bool bNewFontLists) override; vcl::Region ClipToDeviceBounds(vcl::Region aRegion) const override; diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 1db0ad16207f..bfaa0226b1ce 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -914,15 +914,6 @@ bool OutputDevice::ImplNewFont() const { DBG_TESTSOLARMUTEX(); - // get correct font list on the PDF writer if necessary - if (GetOutDevType() == OUTDEV_PDF) - { - const ImplSVData* pSVData = ImplGetSVData(); - if( mxFontCollection == pSVData->maGDIData.mxScreenFontList - || mxFontCache == pSVData->maGDIData.mxScreenFontCache ) - const_cast<OutputDevice&>(*this).ImplUpdateFontData(); - } - if ( !mbNewFont ) return true;