summaryrefslogtreecommitdiff
path: root/vcl/source/outdev/font.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/outdev/font.cxx')
-rw-r--r--vcl/source/outdev/font.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 769eca76a457..62dcfc59f60a 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -140,8 +140,26 @@ Size OutputDevice::GetDevFontSize( const vcl::Font& rFont, int nSizeIndex ) cons
return aSize;
}
+namespace
+{
+ struct UpdateFontsGuard
+ {
+ UpdateFontsGuard()
+ {
+ OutputDevice::ImplClearAllFontData(true);
+ }
+
+ ~UpdateFontsGuard()
+ {
+ OutputDevice::ImplRefreshAllFontData(true);
+ }
+ };
+}
+
bool OutputDevice::AddTempDevFont( const OUString& rFileURL, const OUString& rFontName )
{
+ UpdateFontsGuard aUpdateFontsGuard;
+
ImplInitFontList();
if( !mpGraphics && !AcquireGraphics() )
@@ -154,8 +172,7 @@ bool OutputDevice::AddTempDevFont( const OUString& rFileURL, const OUString& rFo
if( mpAlphaVDev )
mpAlphaVDev->AddTempDevFont( rFileURL, rFontName );
- ImplClearFontData(true);
- mpFontCache->Invalidate();
+ OutputDevice::ImplRefreshAllFontData(true);
return true;
}