diff options
-rw-r--r-- | sdext/source/pdfimport/wrapper/wrapper.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index ff0930521f85..bb15a5806412 100644 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -146,6 +146,7 @@ class Parser typedef std::unordered_map< sal_Int64, FontAttributes > FontMapType; + ScopedVclPtr<VirtualDevice> m_xDev; const uno::Reference<uno::XComponentContext> m_xContext; const ContentSinkSharedPtr m_pSink; const oslFileHandle m_pErr; @@ -668,13 +669,12 @@ void Parser::readFont() } - static vcl::DeleteOnDeinit< VclPtr<VirtualDevice> > vDev( new VclPtr<VirtualDevice> ); - if (!vDev.get()->get()) - (*vDev.get()) = VclPtr<VirtualDevice>::Create(); + if (!m_xDev) + m_xDev.disposeAndReset(VclPtr<VirtualDevice>::Create()); vcl::Font font(aResult.familyName, Size(0, 1000)); - (*vDev.get())->SetFont(font); - FontMetric metric((*vDev.get())->GetFontMetric()); + m_xDev->SetFont(font); + FontMetric metric(m_xDev->GetFontMetric()); aResult.ascent = metric.GetAscent() / 1000.0; m_aFontMap[nFontID] = aResult; |