summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-03-12 14:08:11 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-03-23 15:57:13 +0100
commitc72de55d0b7a26bb06c4e550b2e4c402ea8676bc (patch)
tree7679150fd23862352b130b1a41b3cd39ab2b49f3
parentimprove font caching in SwFntObj (diff)
downloadcore-c72de55d0b7a26bb06c4e550b2e4c402ea8676bc.tar.gz
core-c72de55d0b7a26bb06c4e550b2e4c402ea8676bc.zip
do not disable Writer font caching on zoom mismatch
This code disables font caching for some cases, e.g. when exporting to PDF if the zoom is set to anything else than 100%, or also when loading a document. It unfortunately comes from the OOo initial import, so it's impossible to find out why it should be needed. SwFntObj instances are created only using SwFntAccess ctor, which checks any SwFntObj it tries to reuse, so if this some additional factor to consider when reusing SwFntObj, then it can be checked there. But when I remove the code, I cannot see any breakage. Tests pass, normal rendering is fine, document thumbnail is fine, printing is fine, PDF export is fine, embedding in a spreadsheet is fine. We had a look at this with Miklos and concluded that it is not needed (until proven otherwise, in which case it'll be also known why it would be needed). Change-Id: I59d375229a265a4353c1da6dd067d892dd4ecfb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112589 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--sw/source/core/txtnode/fntcache.cxx18
1 files changed, 0 insertions, 18 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 206e95340a0f..7cc9cf35714b 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -589,24 +589,6 @@ void SwFntObj::CreateScrFont( const SwViewShell& rSh, const OutputDevice& rOut )
m_pScrFont = m_pPrtFont;
}
- // check zoom factor, e.g. because of PrtOle2 during export
- {
- // In case the zoom factor of the output device differs from the
- // one in the ViewOptions, this Font must not be cached,
- // hence set zoom factor to an invalid value
- long nTmp;
- if( pOut->GetMapMode().GetScaleX().IsValid() &&
- pOut->GetMapMode().GetScaleY().IsValid() &&
- pOut->GetMapMode().GetScaleX() == pOut->GetMapMode().GetScaleY() )
- {
- nTmp = long(100 * pOut->GetMapMode().GetScaleX());
- }
- else
- nTmp = 0;
- if( nTmp != m_nZoom )
- m_nZoom = USHRT_MAX - 1;
- }
-
m_nScrAscent = static_cast<sal_uInt16>(pOut->GetFontMetric().GetAscent());
if ( USHRT_MAX == m_nScrHeight )
m_nScrHeight = static_cast<sal_uInt16>(pOut->GetTextHeight());