[Libreoffice-commits] core.git: vcl/inc vcl/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Mon Apr 27 04:57:49 UTC 2020
vcl/inc/impgraph.hxx | 2 +-
vcl/source/gdi/impgraph.cxx | 31 ++++++++++++++++---------------
2 files changed, 17 insertions(+), 16 deletions(-)
New commits:
commit e294e29ab3bcd57c1d5d4f3fe372e26d5677a7ab
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Apr 22 19:52:19 2020 +0200
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Apr 27 06:57:07 2020 +0200
ImpGraphic: rename ImplCreateSwapInfo and simplify
ImplCreateSwapInfo changed to createSwapInfo.
Flatten the code body
Change-Id: I5865373d0b7f3cc717a9600bcf6fd198e8320e35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92947
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 24112ca03dbe..749a5b82a12e 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -116,7 +116,7 @@ private:
return mpGraphicID->getIDString();
}
- void ImplCreateSwapInfo();
+ void createSwapInfo();
void ImplClearGraphics();
void ImplClear();
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 1b0797889525..6cace1f79d79 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -384,18 +384,18 @@ const std::shared_ptr<VectorGraphicData>& ImpGraphic::getVectorGraphicData() con
return maVectorGraphicData;
}
-void ImpGraphic::ImplCreateSwapInfo()
+void ImpGraphic::createSwapInfo()
{
- if (!isSwappedOut())
- {
- maSwapInfo.maPrefMapMode = ImplGetPrefMapMode();
- maSwapInfo.maPrefSize = ImplGetPrefSize();
- maSwapInfo.mbIsAnimated = ImplIsAnimated();
- maSwapInfo.mbIsEPS = ImplIsEPS();
- maSwapInfo.mbIsTransparent = ImplIsTransparent();
- maSwapInfo.mbIsAlpha = ImplIsAlpha();
- maSwapInfo.mnAnimationLoopCount = ImplGetAnimationLoopCount();
- }
+ if (isSwappedOut())
+ return;
+
+ maSwapInfo.maPrefMapMode = ImplGetPrefMapMode();
+ maSwapInfo.maPrefSize = ImplGetPrefSize();
+ maSwapInfo.mbIsAnimated = ImplIsAnimated();
+ maSwapInfo.mbIsEPS = ImplIsEPS();
+ maSwapInfo.mbIsTransparent = ImplIsTransparent();
+ maSwapInfo.mbIsAlpha = ImplIsAlpha();
+ maSwapInfo.mnAnimationLoopCount = ImplGetAnimationLoopCount();
}
void ImpGraphic::ImplClearGraphics()
@@ -1387,12 +1387,13 @@ bool ImpGraphic::swapOut()
// Check if writing was successfull
if (bResult)
{
- // We have swapped out, so can clean memory
- mbSwapOut = true;
- mpSwapFile = std::move(pSwapFile);
- ImplCreateSwapInfo();
+ // We have swapped out, so can clean memory and prepare swap info
+ createSwapInfo();
ImplClearGraphics();
+ mpSwapFile = std::move(pSwapFile);
+ mbSwapOut = true;
+
// Signal to manager that we have swapped out
vcl::graphic::Manager::get().swappedOut(this);
}
More information about the Libreoffice-commits
mailing list