summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml/xmlimp.cxx
diff options
context:
space:
mode:
authorKevin Suo <suokunlong@126.com>2021-11-22 00:01:34 +0800
committerMiklos Vajna <vmiklos@collabora.com>2022-01-03 08:35:21 +0100
commit86cffd61c1f01a18f4016bb09c8d63a581f5cded (patch)
treeeb168f7460119f5d9110e6d047ff1b28d73a3ca4 /sw/source/filter/xml/xmlimp.cxx
parent3aaf8506b3ee0d4a1bb86be7c6ca4d9402467d49 (diff)
tdf#129448: Auto first-line indent should not be effected by line space
Previously, if you set the first line indent to auto, then if you change the line height, the first line indent will also change. I do not see a reason to change the first line indent value in case of change in line spacing, even for English language. Some languages (e.g. Chinese) may have set the auto first line indent to be 2 characters of the current font, but if the first line indent changes when line height changes, then this 2-character rule is not possible. For compatibility with old documents, a compatability flag 'AutoFirstLineIndentDisregardLineSpace' is added in this patch, thus this patch only has effect to new ODF documents. DOC/DOCX documents will also benefit from this patch, no matter old or new, because, as Miklos Vajna has pointed out, Word does not have the auto first line height feature. Change-Id: I1e2ddc33cce4ff9b3b2b4122445894f724d5bcd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125627 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/filter/xml/xmlimp.cxx')
-rw-r--r--sw/source/filter/xml/xmlimp.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 36932bb9622f..6afabdd855e3 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1302,6 +1302,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bool bSubtractFlysAnchoredAtFlys = false;
bool bEmptyDbFieldHidesPara = false;
bool bCollapseEmptyCellPara = false;
+ bool bAutoFirstLineIndentDisregardLineSpace = false;
const PropertyValue* currentDatabaseDataSource = nullptr;
const PropertyValue* currentDatabaseCommand = nullptr;
@@ -1393,6 +1394,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bEmptyDbFieldHidesPara = true;
else if (rValue.Name == "CollapseEmptyCellPara")
bCollapseEmptyCellPara = true;
+ else if (rValue.Name == "AutoFirstLineIndentDisregardLineSpace")
+ bAutoFirstLineIndentDisregardLineSpace = true;
}
catch( Exception& )
{
@@ -1552,6 +1555,9 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
if (!bCollapseEmptyCellPara)
xProps->setPropertyValue("CollapseEmptyCellPara", makeAny(false));
+ if (!bAutoFirstLineIndentDisregardLineSpace)
+ xProps->setPropertyValue("AutoFirstLineIndentDisregardLineSpace", makeAny(false));
+
SwDoc *pDoc = getDoc();
SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccess().getPrinter( false );
if( pPrinter )