summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-12-15 17:01:01 +0900
committerTomaž Vajngerl <quikee@gmail.com>2020-12-21 10:49:38 +0100
commit2ef9531771ba0eda64259d25d3440963c1b0932e (patch)
tree315853ee9605177322e867c8f2d98c909bc84967
parent0df9ea8d654103256a67f4a6977468bd01a00f01 (diff)
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@gmail.com>
-rw-r--r--vcl/source/gdi/vectorgraphicdata.cxx8
1 files changed, 4 insertions, 4 deletions
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());
}
}