diff options
Diffstat (limited to 'dw/textblock_linebreaking.cc')
-rw-r--r-- | dw/textblock_linebreaking.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc index c02453f7..713ad530 100644 --- a/dw/textblock_linebreaking.cc +++ b/dw/textblock_linebreaking.cc @@ -1421,7 +1421,7 @@ int Textblock::hyphenateWord (int wordIndex, int *addIndex1) if (numBreaks > 0) { Word origWord = *hyphenatedWord; - core::Requisition wordSize[numBreaks + 1]; + core::Requisition *wordSize = new core::Requisition[numBreaks + 1]; calcTextSizes (origWord.content.text, strlen (origWord.content.text), origWord.style, numBreaks, breakPos, wordSize); @@ -1506,8 +1506,10 @@ int Textblock::hyphenateWord (int wordIndex, int *addIndex1) origWord.spaceStyle->unref (); free (breakPos); - } else + delete[] wordSize; + } else { words->getRef(wordIndex)->flags &= ~Word::CAN_BE_HYPHENATED; + } return numBreaks; } |