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

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