summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slideshow/source/engine/shapes/drawshapesubsetting.cxx23
1 files changed, 21 insertions, 2 deletions
diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
index 849df8d9897c..f88a0337aa31 100644
--- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx
+++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
@@ -213,6 +213,25 @@ namespace slideshow
maCurrentSubsets.insert(maCurrentSubsets.end(), aNodesToAppend.begin(),
aNodesToAppend.end());
+ // Excluding subsets must not leave an absolutely empty maCurrentSubsets, because it
+ // would mean "non-subsetting" mode unconditionally, with whole object added to subsets.
+ // So to indicate a subset with all parts excluded, add two empty subsets (starting and
+ // ending).
+ if (maCurrentSubsets.empty())
+ {
+ if (maSubset.isEmpty())
+ {
+ maCurrentSubsets.emplace_back(0, 0);
+ maCurrentSubsets.emplace_back(maActionClassVector.size(),
+ maActionClassVector.size());
+ }
+ else
+ {
+ maCurrentSubsets.emplace_back(maSubset.getStartIndex(),
+ maSubset.getStartIndex());
+ maCurrentSubsets.emplace_back(maSubset.getEndIndex(), maSubset.getEndIndex());
+ }
+ }
}
void DrawShapeSubsetting::updateSubsets()
@@ -275,10 +294,10 @@ namespace slideshow
void DrawShapeSubsetting::initCurrentSubsets()
{
- // only add subset to vector, if it's not empty - that's
+ // only add subset to vector, if vector is empty, and subset is not empty - that's
// because the vector's content is later literally used
// for e.g. painting.
- if( !maSubset.isEmpty() )
+ if (maCurrentSubsets.empty() && !maSubset.isEmpty())
maCurrentSubsets.push_back( maSubset );
}