aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock_linebreaking.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-04-03 19:25:19 +0200
committerSebastian Geerken <devnull@localhost>2014-04-03 19:25:19 +0200
commit6aebada7acdfaaca0e27d24eb84c9398787a7e89 (patch)
tree98a8d3fc5d0a1cf5c74926bc4b77bb29233dfb97 /dw/textblock_linebreaking.cc
parent560193e2a5fce15db3c272520220877a7ee61567 (diff)
Fixed initialization problem.
Diffstat (limited to 'dw/textblock_linebreaking.cc')
-rw-r--r--dw/textblock_linebreaking.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index 3b3a55e7..d4e3343f 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -716,7 +716,7 @@ bool Textblock::wrapWordInFlow (int wordIndex, bool wrapAll)
if(newLine) {
accumulateWordData (wordIndex);
- int wordIndexEnd, breakPos =
+ int wordIndexEnd = wordIndex, breakPos =
searchBreakPos (wordIndex, firstIndex, &searchUntil, tempNewLine,
penaltyIndex, thereWillBeMoreSpace, wrapAll,
&wordListChanged, &wordIndexEnd);
@@ -825,6 +825,7 @@ bool Textblock::wrapWordInFlow (int wordIndex, bool wrapAll)
}
// *height must be initialized, but not *breakPos.
+// *wordIndexEnd must be initialized (initially to wordIndex)
void Textblock::balanceBreakPosAndHeight (int wordIndex, int firstIndex,
int *searchUntil, bool tempNewLine,
int penaltyIndex,
@@ -890,6 +891,7 @@ void Textblock::balanceBreakPosAndHeight (int wordIndex, int firstIndex,
}
}
+// *wordIndexEnd must be initialized (initially to wordIndex)
int Textblock::searchBreakPos (int wordIndex, int firstIndex, int *searchUntil,
bool tempNewLine, int penaltyIndex,
bool thereWillBeMoreSpace, bool wrapAll,
@@ -905,8 +907,6 @@ int Textblock::searchBreakPos (int wordIndex, int firstIndex, int *searchUntil,
int result;
bool lineAdded;
- *wordIndexEnd = wordIndex;
-
do {
DBG_OBJ_MSG ("construct.word", 1, "<i>searchBreakPos loop cycle</i>");
DBG_OBJ_MSG_START ();