summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-08-16 11:00:54 +0200
committerLászló Németh <nemeth@numbertext.org>2022-08-17 18:07:24 +0200
commita18a74d6762e56a20093ca51cfd12925697c2524 (patch)
tree2ff267d05b2e64db51664aca039d96ae1639b539 /sw/source/filter/xml
parent9135cdbc1a5fa09d00aee76215ff5cd369f82756 (diff)
tdf#150200 tdf#150438 sw, DOCX: fix drop cap dash, quotation etc.
In drop cap layout, set smaller size for all glyphs positioned over the baseline, e.g. dashes (dash, en-dash, em-dash, figure dash), bullet, asterisks and quotation marks by extending the bounding box of the glyph to the baseline, like MSO does. Add "DropCapPunctuation", a new default compatibility option for this. Only old ODT files loads the old layout (which was partially broken: e.g. dashes were too long, often missing from the drop cap area or the drop cap was disabled). New ODT and imported DOCX documents use the new default layout for better typesetting and interoperability. Change-Id: I3aba0727fd15f6edb9245e31f523e12f407d189e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138356 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/filter/xml')
-rw-r--r--sw/source/filter/xml/xmlimp.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index a0b201cda9cc..971059732e14 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1300,6 +1300,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bool bEmptyDbFieldHidesPara = false;
bool bCollapseEmptyCellPara = false;
bool bAutoFirstLineIndentDisregardLineSpace = false;
+ bool bDropCapPunctuation = false;
const PropertyValue* currentDatabaseDataSource = nullptr;
const PropertyValue* currentDatabaseCommand = nullptr;
@@ -1393,6 +1394,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bCollapseEmptyCellPara = true;
else if (rValue.Name == "AutoFirstLineIndentDisregardLineSpace")
bAutoFirstLineIndentDisregardLineSpace = true;
+ else if ( rValue.Name == "DropCapPunctuation" )
+ bDropCapPunctuation = true;
}
catch( Exception& )
{
@@ -1555,6 +1558,15 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
if (!bAutoFirstLineIndentDisregardLineSpace)
xProps->setPropertyValue("AutoFirstLineIndentDisregardLineSpace", Any(false));
+ // LO 7.4 and previous versions had different drop cap punctuation: very long dashes.
+ // In order to keep backwards compatibility, DropCapPunctuation option is written to .odt
+ // files, and the default for new documents is 'true'. Files without this option
+ // are considered to be old files, so set the compatibility option too.
+ if ( !bDropCapPunctuation )
+ {
+ xProps->setPropertyValue( "DropCapPunctuation", Any( false ) );
+ }
+
SwDoc *pDoc = getDoc();
SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccess().getPrinter( false );
if( pPrinter )