sw/source/core/crsr/pam.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit f7a570fd5d64ba2964a33ac4c5ecfe9f236d316b Author: Pranam Lashkari <[email protected]> AuthorDate: Fri Feb 16 00:59:49 2024 +0530 Commit: Pranam Lashkari <[email protected]> CommitDate: Fri Feb 16 14:00:05 2024 +0100 avoid using subView on empty OUString it causes assertion failure rtl::OUString SwPaM::GetText() const: Assertion `(nEnd-nStart) == (aTmpStr.getLength() - nStart)' failed Change-Id: Ie479f224e8a1516735f96c3a09181d4c46dba10d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163461 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Gökay ŞATIR <[email protected]> (cherry picked from commit 0b0b70772f2d9836010e523bff0132b626713862) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163499 Reviewed-by: Pranam Lashkari <[email protected]> diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 25bf8d0ef68e..14552d33a912 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -1325,7 +1325,7 @@ OUString SwPaM::GetText() const } const OUString& aTmpStr = pTextNode->GetText(); - if (bIsStartNode || bIsEndNode) + if (aTmpStr.getLength() > 0 && (bIsStartNode || bIsEndNode)) { // Handle corner cases of start/end node(s) const sal_Int32 nStart = bIsStartNode
