diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-28 15:16:17 +0000 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-29 11:51:17 +0100 |
commit | 1bf0997d459909d0d72b168b342939237ed92a99 (patch) | |
tree | f6ed483362d2174e3b5324498859bb966e5da12b | |
parent | d578bd6582131e52c1752f16f21ba2164ccdc970 (diff) |
tdf#137643 Revert "lock refreshing font data when loading a document"
from tdf#69060, to replace with an alternative solution
This reverts commit 98d71c4e0847797a4ba9229a8e6d832a8a3d5e0f.
and
This reverts commit 64d8e5f8db70f4f913abb902b41f4cff8dd1cdad.
Change-Id: I384e994b54aa1bfc735c6ab591b9b1410058451f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104950
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | include/vcl/outdev.hxx | 3 | ||||
-rw-r--r-- | include/vcl/svapp.hxx | 11 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 4 | ||||
-rw-r--r-- | vcl/inc/svdata.hxx | 3 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 5 | ||||
-rw-r--r-- | vcl/source/outdev/font.cxx | 32 |
6 files changed, 1 insertions, 57 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 26a2920b86e1..42b2d4cdfedb 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1289,9 +1289,6 @@ public: //If bNewFontLists is true then drop and refetch lists of system fonts SAL_DLLPRIVATE static void ImplUpdateAllFontData( bool bNewFontLists ); - // Lock font updates for all output devices - static void LockFontUpdates(bool bLock); - protected: SAL_DLLPRIVATE const LogicalFontInstance* GetFontInstance() const; SAL_DLLPRIVATE long GetEmphasisAscent() const { return mnEmphasisAscent; } diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 6d520bb1d32d..c73060e9e443 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1314,17 +1314,6 @@ public: ///@} - /** Lock font updates for all output devices - - @remark When performing operations that might involve multiple registration of fonts, such as - opening/closing documents with multiple embedded fonts, then each font addition/removal - might cause an event that initiates a rebuild of each OutputDevice's font lists. - - Locking font updates disables processing such events, and unlocking causes a single such - processing for all OutputDevices. - */ - static void LockFontUpdates(bool bLock); - // For vclbootstrapprotector: static void setDeInitHook(Link<LinkParamNone*,void> const & hook); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index fd405517265f..a336822aa546 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -567,10 +567,6 @@ bool SfxObjectShell::ImportFromGeneratedStream_Impl( bool SfxObjectShell::DoLoad( SfxMedium *pMed ) { ModifyBlocker_Impl aBlock( this ); - struct FontLockGuard { - FontLockGuard() { Application::LockFontUpdates(true); } - ~FontLockGuard() { Application::LockFontUpdates(false); } - } aFontLockGuard; pMedium = pMed; pMedium->CanDisposeStorage_Impl( true ); diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 59daa93cca67..46a4a20cffb0 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -384,9 +384,6 @@ struct ImplSVData VclPtr<WorkWindow> mpDefaultWin; // Default-Window bool mbDeInit = false; // Is VCL deinitializing std::unique_ptr<SalSystem> mpSalSystem; // SalSystem interface - int mnFontUpdatesLockCount = 0; // avoid repeated font updates - bool mbFontUpdatesPending = false; // need to update font data after unlock - bool mbFontUpdatesNewLists = false; // generate new font lists bool mbResLocaleSet = false; // SV-Resource-Manager std::locale maResLocale; // Resource locale ImplSchedulerContext maSchedCtx; // Data for class Scheduler diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index faf2d6f90ab0..720fb32d4eba 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1047,11 +1047,6 @@ void Application::RemoveUserEvent( ImplSVEvent * nUserEvent ) } } -void Application::LockFontUpdates(bool bLock) -{ - OutputDevice::LockFontUpdates(bLock); -} - vcl::Window* Application::GetFocusWindow() { return ImplGetSVData()->mpWinData->mpFocusWin; diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 59ce4ef52a99..57ebcb40939c 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -560,16 +560,7 @@ void OutputDevice::ImplClearAllFontData(bool bNewFontLists) void OutputDevice::ImplRefreshAllFontData(bool bNewFontLists) { - auto svdata = ImplGetSVData(); - DBG_TESTSOLARMUTEX(); - if (!svdata->mnFontUpdatesLockCount) - ImplUpdateFontDataForAllFrames(&OutputDevice::ImplRefreshFontData, bNewFontLists); - else - { - svdata->mbFontUpdatesPending = true; - if (bNewFontLists) - svdata->mbFontUpdatesNewLists = true; - } + ImplUpdateFontDataForAllFrames( &OutputDevice::ImplRefreshFontData, bNewFontLists ); } void OutputDevice::ImplUpdateAllFontData(bool bNewFontLists) @@ -615,27 +606,6 @@ void OutputDevice::ImplUpdateFontDataForAllFrames( const FontUpdateHandler_t pHd } } -void OutputDevice::LockFontUpdates(bool bLock) -{ - auto svdata = ImplGetSVData(); - DBG_TESTSOLARMUTEX(); - if (bLock) - { - ++svdata->mnFontUpdatesLockCount; - } - else if (svdata->mnFontUpdatesLockCount > 0) - { - --svdata->mnFontUpdatesLockCount; - if (!svdata->mnFontUpdatesLockCount && svdata->mbFontUpdatesPending) - { - ImplRefreshAllFontData(svdata->mbFontUpdatesNewLists); - - svdata->mbFontUpdatesPending = false; - svdata->mbFontUpdatesNewLists = false; - } - } -} - void OutputDevice::BeginFontSubstitution() { ImplSVData* pSVData = ImplGetSVData(); |