diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-05 14:16:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-08 22:29:50 +0200 |
commit | c4c56de1b0e62ec866b519b2b24c5e805f0a86d3 (patch) | |
tree | a8a5b3c67b72804a27fd2f1aea39451691a3fa0c /vcl/source/gdi/pdfwriter_impl.cxx | |
parent | d865866ec5cf6966757c9f2abd24b18a39f2f924 (diff) |
hold LogicalFontInstance with rtl::Reference
instead of manual reference counting.
Also the releasing of not-currently-in-use LogicalFontInstance objects
from the cache is made less aggressive - we now only flush entries until
we have less than CACHE_SIZE instances, instead of flushing the whole
cache.
Change-Id: Ib235b132776b5f09ae8ae93a933c2eebe5fa9610
Reviewed-on: https://gerrit.libreoffice.org/55384
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/gdi/pdfwriter_impl.cxx')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 7fee16967ea5..29ee93f50c95 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -6777,7 +6777,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool // This includes ascent / descent. aRectangle.setHeight(aRefDevFontMetric.GetLineHeight()); - LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance; + LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance.get(); if (pFontInstance->mnOrientation) { // Adapt rectangle for rotated text. @@ -7267,7 +7267,7 @@ void PDFWriterImpl::drawLine( const Point& rStart, const Point& rStop, const Lin void PDFWriterImpl::drawWaveTextLine( OStringBuffer& aLine, long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove ) { // note: units in pFontInstance are ref device pixel - LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance; + LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance.get(); long nLineHeight = 0; long nLinePos = 0; @@ -7337,7 +7337,7 @@ void PDFWriterImpl::drawWaveTextLine( OStringBuffer& aLine, long nWidth, FontLin void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove ) { // note: units in pFontInstance are ref device pixel - LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance; + LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance.get(); long nLineHeight = 0; long nLinePos = 0; long nLinePos2 = 0; @@ -7508,7 +7508,7 @@ void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, Fon void PDFWriterImpl::drawStrikeoutLine( OStringBuffer& aLine, long nWidth, FontStrikeout eStrikeout, Color aColor ) { // note: units in pFontInstance are ref device pixel - LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance; + LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance.get(); long nLineHeight = 0; long nLinePos = 0; long nLinePos2 = 0; @@ -7605,7 +7605,7 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik aRect.SetBottom( rPos.Y()+aRefDevFontMetric.GetDescent() ); aRect.SetTop( rPos.Y()-aRefDevFontMetric.GetAscent() ); - LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance; + LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance.get(); if (pFontInstance->mnOrientation) { tools::Polygon aPoly( aRect ); @@ -7640,7 +7640,7 @@ void PDFWriterImpl::drawTextLine( const Point& rPos, long nWidth, FontStrikeout updateGraphicsState(); // note: units in pFontInstance are ref device pixel - LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance; + LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance.get(); Color aUnderlineColor = m_aCurrentPDFState.m_aTextLineColor; Color aOverlineColor = m_aCurrentPDFState.m_aOverlineColor; Color aStrikeoutColor = m_aCurrentPDFState.m_aFont.GetColor(); |