From e430d82ec56f34fb5ae45a50eb12cd03c7e40ba3 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 21 Sep 2021 17:09:28 +0200 Subject: SvNumberformat: preserve error position if already set ImpSvNumberformatScan::ScanType() may already return an error position in which case FinalScan() is not executed but nResultStringsCnt is set only there and otherwise 0, so after ScanFormat() force a different error position only if both are 0. This in the dialog positions the error selection correctly instead of after the first character. Change-Id: Icb87b212fe8465da8f885514ffa3a3ecc7cd69a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122399 Reviewed-by: Eike Rathke Tested-by: Jenkins --- svl/source/numbers/zformat.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'svl') diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 22a377a6cc69..0f618e75ca02 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -1112,7 +1112,7 @@ SvNumberformat::SvNumberformat(OUString& rString, } sal_Int32 nStrPos = pSc->ScanFormat( sStr); sal_uInt16 nCnt = pSc->GetResultStringsCnt(); - if (nCnt == 0) // error + if (nCnt == 0 && nStrPos == 0) // error { nStrPos = 1; } -- cgit