Blame SOURCES/0001-Revert-tdf-69060-lock-refreshing-font-data-when-load.patch

eac0b7
From d7ed56975a828eac321959e4510ee14560847b1f Mon Sep 17 00:00:00 2001
eac0b7
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
eac0b7
Date: Wed, 28 Oct 2020 14:25:11 +0000
eac0b7
Subject: [PATCH] Revert "tdf#69060: lock refreshing font data when loading a
eac0b7
 document"
eac0b7
eac0b7
This reverts commit 98d71c4e0847797a4ba9229a8e6d832a8a3d5e0f.
eac0b7
---
eac0b7
 include/vcl/outdev.hxx      |  3 ---
eac0b7
 include/vcl/svapp.hxx       | 11 -----------
eac0b7
 sfx2/source/doc/objstor.cxx |  4 ----
eac0b7
 vcl/inc/svdata.hxx          |  3 ---
eac0b7
 vcl/source/app/svapp.cxx    |  5 -----
eac0b7
 vcl/source/outdev/font.cxx  | 32 +-------------------------------
eac0b7
 6 files changed, 1 insertion(+), 57 deletions(-)
eac0b7
eac0b7
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
eac0b7
index cd3c84d13305..55b466b42464 100644
eac0b7
--- a/include/vcl/outdev.hxx
eac0b7
+++ b/include/vcl/outdev.hxx
eac0b7
@@ -1278,9 +1278,6 @@ public:
eac0b7
     //If bNewFontLists is true then drop and refetch lists of system fonts
eac0b7
     SAL_DLLPRIVATE static void  ImplUpdateAllFontData( bool bNewFontLists );
eac0b7
 
eac0b7
-    // Lock font updates for all output devices
eac0b7
-    static void LockFontUpdates(bool bLock);
eac0b7
-
eac0b7
 protected:
eac0b7
     SAL_DLLPRIVATE const LogicalFontInstance* GetFontInstance() const;
eac0b7
     SAL_DLLPRIVATE long GetEmphasisAscent() const { return mnEmphasisAscent; }
eac0b7
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
eac0b7
index 16b8015b923a..4f7b9d6def31 100644
eac0b7
--- a/include/vcl/svapp.hxx
eac0b7
+++ b/include/vcl/svapp.hxx
eac0b7
@@ -1326,17 +1326,6 @@ public:
eac0b7
 
eac0b7
     ///@}
eac0b7
 
eac0b7
-    /** Lock font updates for all output devices
eac0b7
-
eac0b7
-     @remark When performing operations that might involve multiple registration of fonts, such as
eac0b7
-        opening/closing documents with multiple embedded fonts, then each font addition/removal
eac0b7
-        might cause an event that initiates a rebuild of each OutputDevice's font lists.
eac0b7
-
eac0b7
-        Locking font updates disables processing such events, and unlocking causes a single such
eac0b7
-        processing for all OutputDevices.
eac0b7
-    */
eac0b7
-    static void LockFontUpdates(bool bLock);
eac0b7
-
eac0b7
     // For vclbootstrapprotector:
eac0b7
     static void setDeInitHook(Link<LinkParamNone*,void> const & hook);
eac0b7
 
eac0b7
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
eac0b7
index 6d7b3f99ee69..ac9f4242a1bc 100644
eac0b7
--- a/sfx2/source/doc/objstor.cxx
eac0b7
+++ b/sfx2/source/doc/objstor.cxx
eac0b7
@@ -582,10 +582,6 @@ bool SfxObjectShell::ImportFromGeneratedStream_Impl(
eac0b7
 bool SfxObjectShell::DoLoad( SfxMedium *pMed )
eac0b7
 {
eac0b7
     ModifyBlocker_Impl aBlock( this );
eac0b7
-    struct FontLockGuard {
eac0b7
-        FontLockGuard() { Application::LockFontUpdates(true); }
eac0b7
-        ~FontLockGuard() { Application::LockFontUpdates(false); }
eac0b7
-    } aFontLockGuard;
eac0b7
 
eac0b7
     pMedium = pMed;
eac0b7
     pMedium->CanDisposeStorage_Impl( true );
eac0b7
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
eac0b7
index e41ec23488b3..dc10f3102ede 100644
eac0b7
--- a/vcl/inc/svdata.hxx
eac0b7
+++ b/vcl/inc/svdata.hxx
eac0b7
@@ -338,9 +338,6 @@ struct ImplSVData
eac0b7
     VclPtr<WorkWindow>      mpDefaultWin;                   // Default-Window
eac0b7
     bool                    mbDeInit = false;               // Is VCL deinitializing
eac0b7
     std::unique_ptr<SalSystem> mpSalSystem;                 // SalSystem interface
eac0b7
-    int                     mnFontUpdatesLockCount = 0;     // avoid repeated font updates
eac0b7
-    bool                    mbFontUpdatesPending = false;   // need to update font data after unlock
eac0b7
-    bool                    mbFontUpdatesNewLists = false;  // generate new font lists
eac0b7
     bool                    mbResLocaleSet = false;         // SV-Resource-Manager
eac0b7
     std::locale             maResLocale;                    // Resource locale
eac0b7
     ImplSchedulerContext    maSchedCtx;                     // indepen data for class Scheduler
eac0b7
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
eac0b7
index c4c3be9699e3..de4eac9687fc 100644
eac0b7
--- a/vcl/source/app/svapp.cxx
eac0b7
+++ b/vcl/source/app/svapp.cxx
eac0b7
@@ -1036,11 +1036,6 @@ void Application::RemoveUserEvent( ImplSVEvent * nUserEvent )
eac0b7
     }
eac0b7
 }
eac0b7
 
eac0b7
-void Application::LockFontUpdates(bool bLock)
eac0b7
-{
eac0b7
-    OutputDevice::LockFontUpdates(bLock);
eac0b7
-}
eac0b7
-
eac0b7
 WorkWindow* Application::GetAppWindow()
eac0b7
 {
eac0b7
     return ImplGetSVData()->maWinData.mpAppWin;
eac0b7
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
eac0b7
index 22c61063bd21..e1fd7d107e63 100644
eac0b7
--- a/vcl/source/outdev/font.cxx
eac0b7
+++ b/vcl/source/outdev/font.cxx
eac0b7
@@ -559,16 +559,7 @@ void OutputDevice::ImplClearAllFontData(bool bNewFontLists)
eac0b7
 
eac0b7
 void OutputDevice::ImplRefreshAllFontData(bool bNewFontLists)
eac0b7
 {
eac0b7
-    auto svdata = ImplGetSVData();
eac0b7
-    DBG_TESTSOLARMUTEX();
eac0b7
-    if (!svdata->mnFontUpdatesLockCount)
eac0b7
-        ImplUpdateFontDataForAllFrames(&OutputDevice::ImplRefreshFontData, bNewFontLists);
eac0b7
-    else
eac0b7
-    {
eac0b7
-        svdata->mbFontUpdatesPending = true;
eac0b7
-        if (bNewFontLists)
eac0b7
-            svdata->mbFontUpdatesNewLists = true;
eac0b7
-    }
eac0b7
+    ImplUpdateFontDataForAllFrames( &OutputDevice::ImplRefreshFontData, bNewFontLists );
eac0b7
 }
eac0b7
 
eac0b7
 void OutputDevice::ImplUpdateAllFontData(bool bNewFontLists)
eac0b7
@@ -614,27 +605,6 @@ void OutputDevice::ImplUpdateFontDataForAllFrames( const FontUpdateHandler_t pHd
eac0b7
     }
eac0b7
 }
eac0b7
 
eac0b7
-void OutputDevice::LockFontUpdates(bool bLock)
eac0b7
-{
eac0b7
-    auto svdata = ImplGetSVData();
eac0b7
-    DBG_TESTSOLARMUTEX();
eac0b7
-    if (bLock)
eac0b7
-    {
eac0b7
-        ++svdata->mnFontUpdatesLockCount;
eac0b7
-    }
eac0b7
-    else if (svdata->mnFontUpdatesLockCount > 0)
eac0b7
-    {
eac0b7
-        --svdata->mnFontUpdatesLockCount;
eac0b7
-        if (!svdata->mnFontUpdatesLockCount && svdata->mbFontUpdatesPending)
eac0b7
-        {
eac0b7
-            ImplRefreshAllFontData(svdata->mbFontUpdatesNewLists);
eac0b7
-
eac0b7
-            svdata->mbFontUpdatesPending = false;
eac0b7
-            svdata->mbFontUpdatesNewLists = false;
eac0b7
-        }
eac0b7
-    }
eac0b7
-}
eac0b7
-
eac0b7
 void OutputDevice::BeginFontSubstitution()
eac0b7
 {
eac0b7
     ImplSVData* pSVData = ImplGetSVData();
eac0b7
-- 
eac0b7
2.26.2
eac0b7