sw/qa/core/data/ww6/pass/ofz34898-1.doc |binary sw/source/filter/ww8/ww8graf.cxx | 22 ++++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-)
New commits: commit 09c58a90693dca506a17c93bccb292349bb20d28 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Jun 20 20:48:07 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Jun 21 10:24:22 2021 +0200 ofz#34898 Timeout we expect the editengine to be able to select a preexisting range of text to convert into the symbol char, typically range is of length 1 Change-Id: I13f56e716a00e243bf1c578580dc0ba31755e581 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117522 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/core/data/ww6/pass/ofz34898-1.doc b/sw/qa/core/data/ww6/pass/ofz34898-1.doc new file mode 100644 index 000000000000..544dd0d55896 Binary files /dev/null and b/sw/qa/core/data/ww6/pass/ofz34898-1.doc differ diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 06c568776143..b5835a0da9e5 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -660,12 +660,22 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp, if (!m_bSymbol && bDoingSymbol) { bDoingSymbol = false; - OUStringBuffer sTemp; - comphelper::string::padToLength(sTemp, - nTextStart - nStartReplace, cReplaceSymbol); - m_pDrawEditEngine->QuickInsertText(sTemp.makeStringAndClear(), - GetESelection(*m_pDrawEditEngine, nStartReplace - nStartCp, - nTextStart - nStartCp ) ); + + ESelection aReplaceSel(GetESelection(*m_pDrawEditEngine, nStartReplace - nStartCp, + nTextStart - nStartCp)); + + sal_Int32 nParaCount = m_pDrawEditEngine->GetParagraphCount(); + bool bBadSelection = aReplaceSel.nStartPara >= nParaCount || aReplaceSel.nEndPara >= nParaCount; + + SAL_WARN_IF(bBadSelection, "sw.ww8", "editengine has different amount of text than expected"); + + if (!bBadSelection) + { + OUStringBuffer sTemp; + comphelper::string::padToLength(sTemp, + nTextStart - nStartReplace, cReplaceSymbol); + m_pDrawEditEngine->QuickInsertText(sTemp.makeStringAndClear(), aReplaceSel); + } } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits