From c4c56de1b0e62ec866b519b2b24c5e805f0a86d3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 5 Jun 2018 14:16:23 +0200 Subject: 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 Reviewed-by: Noel Grandin --- vcl/source/gdi/pdfwriter_impl.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'vcl/source/gdi/pdfwriter_impl.cxx') 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(); -- cgit v1.2.3