diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-01-11 00:06:49 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-01-11 05:38:52 +0100 |
commit | 98d71c4e0847797a4ba9229a8e6d832a8a3d5e0f (patch) | |
tree | 97012c315567a679abc827873746afa5fa90bdd0 /include | |
parent | 284a7f60fff72c4d8c011ff60ea2e40163cd25c3 (diff) |
tdf#69060: lock refreshing font data when loading a document
This accumulates all calls to OutputDevice::ImplRefreshAllFontData
while loading document's model, to avoid multiple updates for each
imported font. After loading, OutputDevice::ImplRefreshAllFontData
is executed once.
Change-Id: I5b23a2b8a3765dee9061b6479665d04c2ba11cbf
Reviewed-on: https://gerrit.libreoffice.org/47112
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/outdev.hxx | 3 | ||||
-rw-r--r-- | include/vcl/svapp.hxx | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 1d4a936e22a6..3fa9d2167d27 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1263,6 +1263,9 @@ 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 ac1c0ddfb848..712f75a0f09d 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1365,6 +1365,17 @@ 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); |