aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Decoration.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Decoration.cxx')
-rw-r--r--src/Decoration.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Decoration.cxx b/src/Decoration.cxx
index 24632d7c1..b489c3c02 100644
--- a/src/Decoration.cxx
+++ b/src/Decoration.cxx
@@ -28,7 +28,7 @@ Decoration::~Decoration() {
}
bool Decoration::Empty() {
- return rs.Runs() == 1;
+ return (rs.Runs() == 1) && (rs.AllSameAs(0));
}
DecorationList::DecorationList() : currentIndicator(0), currentValue(1), current(0),
@@ -148,7 +148,7 @@ void DecorationList::DeleteRange(int position, int deleteLength) {
void DecorationList::DeleteAnyEmpty() {
Decoration *deco = root;
while (deco) {
- if (deco->Empty()) {
+ if ((lengthDocument == 0) || deco->Empty()) {
Delete(deco->indicator);
deco = root;
} else {