diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-07-28 16:40:09 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-08-07 16:50:35 +0200 |
commit | 1e2f9219883452ef7da37c3c984b3e3d2939656b (patch) | |
tree | d1414af1325ab9f90e37305800e3a748d90ddf9d /dw/textblock_linebreaking.cc | |
parent | 0220c850a043af46385d6cd6cf4ffa9ceb5696e3 (diff) |
Fix pedantic warnings
Reviewed-by: dogma
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; } |