[Libreoffice-commits] core.git: sw/source

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 17 21:50:00 UTC 2021


 sw/source/core/txtnode/fntcache.cxx |   18 ------------------
 1 file changed, 18 deletions(-)

New commits:
commit 9d02d86e8a9111b7a689062eb9a856146a9e80b1
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Mar 12 14:08:11 2021 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Mar 17 22:49:05 2021 +0100

    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 at collabora.com>

diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index b0ed8eb4d72b..2327ce0de4ce 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -591,24 +591,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
-        tools::Long nTmp;
-        if( pOut->GetMapMode().GetScaleX().IsValid() &&
-            pOut->GetMapMode().GetScaleY().IsValid() &&
-            pOut->GetMapMode().GetScaleX() == pOut->GetMapMode().GetScaleY() )
-        {
-            nTmp = tools::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());


More information about the Libreoffice-commits mailing list