Another hidden vector.
Some checks failed
CI / ubuntu-latest-html-tests (push) Has been cancelled
CI / ubuntu-latest-no-tls (push) Has been cancelled
CI / ubuntu-latest-mbedtls2 (push) Has been cancelled
CI / ubuntu-latest-openssl-3 (push) Has been cancelled
CI / ubuntu-latest-with-old-std (push) Has been cancelled
CI / ubuntu-20-04-openssl-1-1 (push) Has been cancelled
CI / alpine-mbedtls-3_6_0 (push) Has been cancelled
CI / macOS-13-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-3 (push) Has been cancelled
CI / freebsd-14-openssl-3 (push) Has been cancelled
CI / windows-mbedtls (push) Has been cancelled

This commit is contained in:
2025-08-05 02:30:28 -04:00
parent dec64ad9f8
commit 9cb76d2b22

View File

@ -1421,9 +1421,9 @@ int Textblock::hyphenateWord (int wordIndex, int *addIndex1)
if (numBreaks > 0) { if (numBreaks > 0) {
Word origWord = *hyphenatedWord; Word origWord = *hyphenatedWord;
core::Requisition *wordSize = new core::Requisition[numBreaks + 1]; std::vector< core::Requisition > wordSize( numBreaks + 1 );
calcTextSizes (origWord.content.text, strlen (origWord.content.text), calcTextSizes (origWord.content.text, strlen (origWord.content.text),
origWord.style, numBreaks, breakPos, wordSize); origWord.style, numBreaks, breakPos, wordSize.data());
PRINTF ("[%p] %d words ...\n", this, words->size ()); PRINTF ("[%p] %d words ...\n", this, words->size ());
words->insert (wordIndex, numBreaks); words->insert (wordIndex, numBreaks);
@ -1506,7 +1506,6 @@ int Textblock::hyphenateWord (int wordIndex, int *addIndex1)
origWord.spaceStyle->unref (); origWord.spaceStyle->unref ();
free (breakPos); free (breakPos);
delete[] wordSize;
} else { } else {
words->getRef(wordIndex)->flags &= ~Word::CAN_BE_HYPHENATED; words->getRef(wordIndex)->flags &= ~Word::CAN_BE_HYPHENATED;
} }