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

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