From 43cd683230bc05d294b1bd64f1e7932feccdd3fb Mon Sep 17 00:00:00 2001 From: Jonathan Clark Date: Mon, 21 Oct 2024 11:31:46 -0600 Subject: tdf#36709 Add loext:text-indent supporting font-relative units This change adds an ODF font-relative first-line indent paragraph style attribute as a LibreOffice extension. The corresponding ODF standard change is tracked by OFFICE-4165. This change only implements what is minimally necessary to serialize, deserialize, and check for ODF files containing this attribute. Further changes are necessary. * Added cssLength to schema, which is equivalent to length but also allows ic and em as units. * Added loext:text-indent to schema as a paragraph style attribute. This attribute is equivalent to fo:text-indent, but accepts cssLength instead of length. * Added XML_TYPE_UNIT_MEASURE to the ODF parser, which currently accepts only the font-relative measures and forces fallback in other cases. * Added loext:text-indent to the ODF parser. This attribute accepts font-relative metrics, and will behave as an import-only alias for fo:text-indent in other cases. * Updated SvxFirstLineIndentItem to handle unit-denominated measures. * Added proof-of-concept indentation handler to Writer. This implementation is incomplete and temporary, and will be revised in future changes. Change-Id: I7eb5c7382093cb18a9b0afbf93dacb34ba1d35ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175941 Tested-by: Jenkins Reviewed-by: Jonathan Clark --- xmloff/inc/xmlbahdl.hxx | 10 ++++++++++ xmloff/inc/xmlprop.hxx | 1 + 2 files changed, 11 insertions(+) (limited to 'xmloff/inc') diff --git a/xmloff/inc/xmlbahdl.hxx b/xmloff/inc/xmlbahdl.hxx index 09e392d6cc6b..7736d6d2f432 100644 --- a/xmloff/inc/xmlbahdl.hxx +++ b/xmloff/inc/xmlbahdl.hxx @@ -68,6 +68,16 @@ public: virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; }; +/** + PropertyHandler for the XML-data-type: XML_TYPE_UNIT_MEASURE +*/ +class XMLUnitMeasurePropHdl : public XMLPropertyHandler +{ +public: + bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; + bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; +}; + /** PropertyHandler for the XML-data-type: XML_TYPE_PERCENT */ diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx index b7acca175a1d..8f47e328ff44 100644 --- a/xmloff/inc/xmlprop.hxx +++ b/xmloff/inc/xmlprop.hxx @@ -489,6 +489,7 @@ inline constexpr OUString PROP_ParaContextMargin = u"ParaContextMargin"_ustr; inline constexpr OUString PROP_ParaExpandSingleWord = u"ParaExpandSingleWord"_ustr; inline constexpr OUString PROP_ParaFirstLineIndent = u"ParaFirstLineIndent"_ustr; inline constexpr OUString PROP_ParaFirstLineIndentRelative = u"ParaFirstLineIndentRelative"_ustr; +inline constexpr OUString PROP_ParaFirstLineIndentUnit = u"ParaFirstLineIndentUnit"_ustr; inline constexpr OUString PROP_ParaHyphenationMaxHyphens = u"ParaHyphenationMaxHyphens"_ustr; inline constexpr OUString PROP_ParaHyphenationMaxLeadingChars = u"ParaHyphenationMaxLeadingChars"_ustr; -- cgit