0 is ok for ParaTabStopDefaultDistance

since introduction of ParaTabStopDefaultDistance cced51a1ed
tdf#102261: introduce editeng paragraph tab stop default distance

Adds mnDefaultDistance to SvxTabStopItem that if defined
will set a paragraph wide tab stop default distance and
override the document wide setting.

Also makes editeng consider mnDefaultDistance while getting
tab stop default distance.

The goal is to avoid:
warn:xmloff:580503:580503:xmloff/source/core/xmlerror.cxx:163: An error or a warning has occurred during XML import/export!
Error-Id: 0x20040001
    Flags: 2 ERROR
    Class: 4 API
    Number: 1
Parameters:
    0: ParaTabStopDefaultDistance
Exception-Message: at /home/julien/lo/libreoffice/svx/source/unodraw/unopool.cxx:190
Position:
    Public Identifier:
    System Identifier:
    Row, Column: 2,12943

To reproduce this:
Open a new Writer document.
Go to Form → Text Box.
Draw a text box.
Right mouse click on the box → Control properties.
General → Border Color: Set to something like "Green" (not: Default).
Save the file and close the file.
Reopen the file

(from https://bugs.documentfoundation.org/show_bug.cgi?id=155029
Form control: Border color of Text controls won't be saved)

Change-Id: I8252b1f0c4633a1588edbdc682c6faa48f6b25cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151070
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet
2023-04-27 20:14:55 +02:00
parent 233057d982
commit 1f36f5dedf
+1 -1
View File
@@ -977,7 +977,7 @@ bool SvxTabStopItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
return false;
if (bConvert)
nNewDefaultDistance = o3tl::toTwips(nNewDefaultDistance, o3tl::Length::mm100);
if (nNewDefaultDistance <= 0)
if (nNewDefaultDistance < 0)
return false;
mnDefaultDistance = nNewDefaultDistance;
break;