From 63594c62024b894251e1c88d5f65980c553dec4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 3 Dec 2024 12:54:24 +0000 Subject: [PATCH] crashtesting: fix failure of forum-en-13617.odt to reload from .doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I907e282c9e7b75abca9a4c91ba12a2c57fc45f40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177733 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- starmath/source/mathtype.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index d84a11e52ceb..7a32c0be86fe 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -3120,6 +3120,7 @@ void MathType::HandleMath(SmNode *pNode) void MathType::HandleAttributes(SmNode *pNode,int nLevel) { + sal_uInt64 nOldInsertion = nInsertion; int nOldPending = 0; SmNode *pTemp = nullptr; SmTextNode *pIsText = nullptr; @@ -3193,8 +3194,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel) if ((nInsertion != 0) && nullptr != (pTemp = pNode->GetSubNode(0))) { auto nPos = pS->Tell(); - nInsertion--; - pS->Seek(nInsertion); + pS->Seek(nInsertion - 1); switch(pTemp->GetToken().eType) { case TACUTE: //Not Exportable @@ -3247,6 +3247,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel) pS->Seek(nPos); } } + nInsertion = nOldInsertion; } void MathType::HandleText(SmNode *pNode)