summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Ollier <adr.ollier@hotmail.fr>2019-05-09 19:41:35 +0200
committerTomaž Vajngerl <quikee@gmail.com>2019-07-01 02:01:35 +0200
commit19057bca87abf09ec6701c1d28084faa24ba9c3f (patch)
treecd8e73093249b8341f3875d496258b016526dcee
parent7968c970953267d024b42ac891be3428cf52eb72 (diff)
tdf#74702 partial cleanup of OutDevType
makes OutputDevice::ImplClearFontData clean Change-Id: Iee0683bd4567f85e20d5017b8eaa8a46490678db Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/72084 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--include/vcl/outdev.hxx5
-rw-r--r--include/vcl/window.hxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx3
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx10
-rw-r--r--vcl/source/outdev/font.cxx17
-rw-r--r--vcl/source/outdev/outdev.cxx4
-rw-r--r--vcl/source/window/window3.cxx7
7 files changed, 30 insertions, 18 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 15491e8d2807..52b5602d69b0 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1274,13 +1274,16 @@ protected:
virtual void SetFontOrientation( LogicalFontInstance* const pFontInstance ) const;
virtual long GetFontExtLeading() const;
+ virtual void ImplClearFontData(bool bNewFontLists);
+ void ReleaseFontCache();
+ void ReleaseFontCollection();
+
private:
typedef void ( OutputDevice::* FontUpdateHandler_t )( bool );
SAL_DLLPRIVATE bool ImplNewFont() const;
- SAL_DLLPRIVATE void ImplClearFontData( bool bNewFontLists );
SAL_DLLPRIVATE void ImplRefreshFontData( bool bNewFontLists );
SAL_DLLPRIVATE static void ImplUpdateFontDataForAllFrames( FontUpdateHandler_t pHdl, bool bNewFontLists );
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 3b28f9a503a0..433ace0b73c9 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -741,6 +741,8 @@ protected:
virtual void InitClipRegion() override;
+ void ImplClearFontData(bool bNewFontLists) override;
+
// FIXME: this is a hack to workaround missing layout functionality
SAL_DLLPRIVATE void ImplAdjustNWFSizes();
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 923454d424be..b5a0f5ff87e1 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -593,6 +593,9 @@ public:
static void convertLineInfoToExtLineInfo( const LineInfo& rIn, PDFWriter::ExtLineInfo& rOut );
+protected:
+ void ImplClearFontData(bool bNewFontLists) override;
+
private:
MapMode m_aMapMode; // PDFWriterImpl scaled units
std::vector< PDFPage > m_aPages;
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 5e5c0e5fbf6a..5db8a6b1677c 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -2015,4 +2015,14 @@ static bool lcl_canUsePDFAxialShading(const Gradient& rGradient) {
return rGradient.GetSteps() <= 0;
}
+void PDFWriterImpl::ImplClearFontData(bool bNewFontLists)
+{
+ VirtualDevice::ImplClearFontData(bNewFontLists);
+ if (bNewFontLists && AcquireGraphics())
+ {
+ ReleaseFontCollection();
+ ReleaseFontCache();
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 22fd7b4e0d9c..0467f2f7c1ae 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -513,23 +513,6 @@ void OutputDevice::ImplClearFontData( const bool bNewFontLists )
{
if (mxFontCollection && mxFontCollection != pSVData->maGDIData.mxScreenFontList)
mxFontCollection->Clear();
-
- if (GetOutDevType() == OUTDEV_PDF)
- {
- mxFontCollection.reset();
- mxFontCache.reset();
- }
- }
-
- // also update child windows if needed
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- vcl::Window* pChild = static_cast<vcl::Window*>(this)->mpWindowImpl->mpFirstChild;
- while ( pChild )
- {
- pChild->ImplClearFontData( true );
- pChild = pChild->mpWindowImpl->mpNext;
- }
}
}
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index ef512a80d6e4..a7fa60287a29 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -729,4 +729,8 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
return bDrawn;
}
+void OutputDevice::ReleaseFontCache() { mxFontCache.reset(); }
+
+void OutputDevice::ReleaseFontCollection() { mxFontCollection.reset(); }
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx
index 283aee05918e..492839f05415 100644
--- a/vcl/source/window/window3.cxx
+++ b/vcl/source/window/window3.cxx
@@ -20,6 +20,7 @@
#include <vcl/window.hxx>
#include <vcl/waitobj.hxx>
#include <vcl/button.hxx>
+#include <window.h>
WaitObject::~WaitObject()
{
@@ -58,6 +59,12 @@ void Window::ImplAdjustNWFSizes()
}
}
+void Window::ImplClearFontData(bool bNewFontLists)
+{
+ OutputDevice::ImplClearFontData(bNewFontLists);
+ for (Window* pChild = mpWindowImpl->mpFirstChild; pChild; pChild = pChild->mpWindowImpl->mpNext)
+ pChild->ImplClearFontData(bNewFontLists);
+}
} /* namespace vcl */