diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-03-11 21:47:43 +0000 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-05-13 14:14:26 +0200 |
commit | f149acd8652655c8357b5108d3d06468a2234dc9 (patch) | |
tree | f22a2269d2d525dad81dfef5dcbbc7656b6df48d | |
parent | 3176a7cf617593f402e377feb2b23b63e5d191e1 (diff) |
an inconsistent SwTextFormatInfo index, len, text length case
seen on loading sw/qa/python/testdocuments/TESTMETA.odt
maybe since:
commit 2f3684b2289a8c46dc6144064a452cc529400f28
Date: Tue Jul 31 16:00:02 2018 +0200
[API CHANGE] add some more asserts to the string functions
but probably an underlying issue since conversion from UniString
to OUString
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131407
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit eb7fbe1f3a37d89b97bd8976bdc006099578c204)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132860
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 177589cb4f8ef20ff84dbfc141b145b28e57be83)
Change-Id: If731163fbc5e05b813ccd21df65164fe476cba9a
(cherry picked from commit 39c62a03a607c5aed8d70e1851f48bcf01d62323)
-rw-r--r-- | sw/source/core/text/porfld.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 14e5320f234d..af50ee61d778 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -174,7 +174,16 @@ SwFieldSlot::SwFieldSlot( const SwTextFormatInfo* pNew, const SwFieldPortion *pP } else { - aText = (*pOldText).replaceAt(sal_Int32(nIdx), 1, aText); + TextFrameIndex nEnd(pOldText->getLength()); + if (nIdx < nEnd) + { + //sal_Int32 const nFieldLen(pPor->GetFieldLen()); + aText = (*pOldText).replaceAt(sal_Int32(nIdx), 1/*nFieldLen*/, aText); + } + else if (nIdx == nEnd) + aText = *pOldText + aText; + else + SAL_WARN("sw.core", "SwFieldSlot bad SwFieldPortion index."); } pInf->SetText( aText ); } |