[Libreoffice-commits] core.git: vcl/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Mon Dec 21 09:50:23 UTC 2020
vcl/source/gdi/vectorgraphicdata.cxx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 2ef9531771ba0eda64259d25d3440963c1b0932e
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Dec 15 17:01:01 2020 +0900
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Dec 21 10:49:38 2020 +0100
vcl: reverse the if statement in VectorGraphicData::getSizeBytes
It makes more sense to fallback to an State::UNPARSED unless the
condition is satisfied and not the other way around.
Change-Id: I97c2792c8ddd293d99c6418ac0221b7331ee6b5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107992
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/source/gdi/vectorgraphicdata.cxx b/vcl/source/gdi/vectorgraphicdata.cxx
index 92d49e07de3e..a8134a60c852 100644
--- a/vcl/source/gdi/vectorgraphicdata.cxx
+++ b/vcl/source/gdi/vectorgraphicdata.cxx
@@ -278,15 +278,15 @@ void VectorGraphicData::ensureSequenceAndRange()
mbSequenceCreated = true;
}
-auto VectorGraphicData::getSizeBytes() const -> std::pair<State, size_t>
+std::pair<VectorGraphicData::State, size_t> VectorGraphicData::getSizeBytes() const
{
- if (maSequence.empty() && maVectorGraphicDataArray.hasElements())
+ if (!maSequence.empty() && maVectorGraphicDataArray.hasElements())
{
- return std::make_pair(State::UNPARSED, maVectorGraphicDataArray.getLength());
+ return std::make_pair(State::PARSED, maVectorGraphicDataArray.getLength() + mNestedBitmapSize);
}
else
{
- return std::make_pair(State::PARSED, maVectorGraphicDataArray.getLength() + mNestedBitmapSize);
+ return std::make_pair(State::UNPARSED, maVectorGraphicDataArray.getLength());
}
}
More information about the Libreoffice-commits
mailing list