summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorAdrien Ollier <adr.ollier@hotmail.fr>2019-07-04 05:06:10 +0200
committerTomaž Vajngerl <quikee@gmail.com>2019-08-08 13:02:38 +0200
commit7e88bc73030c7708f1a8b47491070aae5b73aac1 (patch)
tree92b6f50e007ff5f9c5a3b781e9150d1d0aff6fce /vcl
parent502f0690c362518681723e029d810762f652c675 (diff)
tdf#74702: removes GetOutDevType() from OutputDevice::ImplRefreshFontData
Change-Id: I8a51afe0979d83862bbe384e6d67702f4687072d Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/75068 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx1
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx10
-rw-r--r--vcl/source/outdev/font.cxx31
-rw-r--r--vcl/source/window/window3.cxx8
4 files changed, 29 insertions, 21 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index cd8f5eac31bb..7dd40d96e039 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -594,6 +594,7 @@ public:
protected:
void ImplClearFontData(bool bNewFontLists) override;
+ void ImplRefreshFontData(bool bNewFontLists) override;
vcl::Region ClipToDeviceBounds(vcl::Region aRegion) const override;
void DrawHatchLine_DrawLine(const Point& rStartPoint, const Point& rEndPoint) override;
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index a060cd580fe0..4dbc13bc6079 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -2027,9 +2027,19 @@ void PDFWriterImpl::ImplClearFontData(bool bNewFontLists)
}
}
+void PDFWriterImpl::ImplRefreshFontData(bool bNewFontLists)
+{
+ if (bNewFontLists && AcquireGraphics())
+ {
+ SetFontCollectionFromSVData();
+ ResetNewFontCache();
+ }
+}
+
vcl::Region PDFWriterImpl::ClipToDeviceBounds(vcl::Region aRegion) const
{
return aRegion;
}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index dbecc1d550fe..a306d1a2ae98 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -523,29 +523,8 @@ void OutputDevice::RefreshFontData( const bool bNewFontLists )
void OutputDevice::ImplRefreshFontData( const bool bNewFontLists )
{
- ImplSVData* pSVData = ImplGetSVData();
-
if (bNewFontLists && AcquireGraphics())
- {
- if (GetOutDevType() == OUTDEV_PDF)
- {
- mxFontCollection = pSVData->maGDIData.mxScreenFontList->Clone();
- mxFontCache.reset(new ImplFontCache);
- }
- else
mpGraphics->GetDevFontList( mxFontCollection.get() );
- }
-
- // also update child windows if needed
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- vcl::Window* pChild = static_cast<vcl::Window*>(this)->mpWindowImpl->mpFirstChild;
- while ( pChild )
- {
- pChild->ImplRefreshFontData( true );
- pChild = pChild->mpWindowImpl->mpNext;
- }
- }
}
void OutputDevice::ImplUpdateFontData()
@@ -1486,4 +1465,14 @@ sal_Int32 OutputDevice::HasGlyphs( const vcl::Font& rTempFont, const OUString& r
return -1;
}
+void OutputDevice::SetFontCollectionFromSVData()
+{
+ mxFontCollection = ImplGetSVData()->maGDIData.mxScreenFontList->Clone();
+}
+
+void OutputDevice::ResetNewFontCache()
+{
+ mxFontCache.reset(new ImplFontCache{});
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx
index 492839f05415..c3412e0dda46 100644
--- a/vcl/source/window/window3.cxx
+++ b/vcl/source/window/window3.cxx
@@ -65,6 +65,14 @@ void Window::ImplClearFontData(bool bNewFontLists)
for (Window* pChild = mpWindowImpl->mpFirstChild; pChild; pChild = pChild->mpWindowImpl->mpNext)
pChild->ImplClearFontData(bNewFontLists);
}
+
+void Window::ImplRefreshFontData(bool bNewFontLists)
+{
+ OutputDevice::ImplRefreshFontData(bNewFontLists);
+ for (Window* pChild = mpWindowImpl->mpFirstChild; pChild; pChild = pChild->mpWindowImpl->mpNext)
+ pChild->ImplRefreshFontData(bNewFontLists);
+}
+
} /* namespace vcl */