[fbreader] Don't undo text styles that we haven't applied
This commit is contained in:
parent
139460734b
commit
99d4a63e93
1 changed files with 8 additions and 7 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2004-2010 Geometer Plus <contact@geometerplus.com>
|
* Copyright (C) 2004-2010 Geometer Plus <contact@geometerplus.com>
|
||||||
|
* Copyright (C) 2018 Slava Monich <slava.monich@jolla.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -47,17 +48,17 @@ void ZLTextArea::Style::setTextStyle(shared_ptr<ZLTextStyle> style, unsigned cha
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZLTextArea::Style::applyControl(const ZLTextControlElement &control) {
|
void ZLTextArea::Style::applyControl(const ZLTextControlElement &control) {
|
||||||
if (control.isStart()) {
|
|
||||||
const ZLTextStyleDecoration *decoration = ZLTextStyleCollection::Instance().decoration(control.textKind());
|
const ZLTextStyleDecoration *decoration = ZLTextStyleCollection::Instance().decoration(control.textKind());
|
||||||
if (decoration != 0) {
|
if (decoration != 0) {
|
||||||
|
if (control.isStart()) {
|
||||||
setTextStyle(decoration->createDecoratedStyle(myTextStyle), myBidiLevel);
|
setTextStyle(decoration->createDecoratedStyle(myTextStyle), myBidiLevel);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (myTextStyle->isDecorated()) {
|
if (myTextStyle->isDecorated()) {
|
||||||
setTextStyle(((ZLTextDecoratedStyle&)*myTextStyle).base(), myBidiLevel);
|
setTextStyle(((ZLTextDecoratedStyle&)*myTextStyle).base(), myBidiLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ZLTextArea::Style::applyControl(const ZLTextStyleElement &control) {
|
void ZLTextArea::Style::applyControl(const ZLTextStyleElement &control) {
|
||||||
setTextStyle(new ZLTextForcedStyle(myTextStyle, control.entry()), myBidiLevel);
|
setTextStyle(new ZLTextForcedStyle(myTextStyle, control.entry()), myBidiLevel);
|
||||||
|
|
Loading…
Reference in a new issue