mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-30 01:38:07 +00:00
DVI: Avoid unnecessary string operations if DEBUG_RENDER is not enabled
This commit is contained in:
parent
57bc499c9a
commit
d90db4502a
1 changed files with 3 additions and 2 deletions
|
@ -602,13 +602,14 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
|
|||
in the array */
|
||||
if (space_encountered &&
|
||||
(currentlyDrawnPage->textBoxList.size() > last_space_index)) {
|
||||
QString lastword(currentlyDrawnPage->textBoxList[last_space_index].text);
|
||||
for (int lidx = last_space_index+1; lidx<currentlyDrawnPage->textBoxList.size(); ++lidx) {
|
||||
// merge two adjacent boxes which are part of the same word
|
||||
lastword += currentlyDrawnPage->textBoxList[lidx].text;
|
||||
currentlyDrawnPage->textBoxList[lidx-1].box.setRight(currentlyDrawnPage->textBoxList[lidx].box.x());
|
||||
}
|
||||
#ifdef DEBUG_RENDER
|
||||
QString lastword(currentlyDrawnPage->textBoxList[last_space_index].text);
|
||||
for (int lidx = last_space_index+1; lidx<currentlyDrawnPage->textBoxList.size(); ++lidx)
|
||||
lastword += currentlyDrawnPage->textBoxList[lidx].text;
|
||||
kDebug(kvs::dvi) << "space encountered: '" << lastword << "'";
|
||||
#endif
|
||||
last_space_index = currentlyDrawnPage->textBoxList.size();
|
||||
|
|
Loading…
Reference in a new issue