summaryrefslogtreecommitdiff
path: root/xmloff/source/text
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-05-27 13:00:10 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-06-08 14:50:55 +0200
commit95ebd24a629b4c8cd62cc20c0701683512cc8fa0 (patch)
tree8bdeab41e8b4d0092f639e62fd3e20ae8243f199 /xmloff/source/text
parentc4f615b359be56e88e4fbf9aaaf30affb29d57e2 (diff)
editengine-columns: ODF support [API CHANGE]
This uses existing ODF markup, as used by Writer's text frame: style::columns child element of style:graphic-properties, its fo:column-count and fo:column-gap attributes. No ODF extension is required. Since currently only columns with same width and spacing are implemented, without additional settings, style:column child elements are exported, but ignored on import. This adds new property to css::drawing::TextProperties service: TextColumns (of type css::text::XTextColumns). Change-Id: I7e63293e5814b281ceec8a9632e696322d3629e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116035 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmloff/source/text')
-rw-r--r--xmloff/source/text/XMLTextColumnsExport.cxx2
-rw-r--r--xmloff/source/text/txtprhdl.cxx3
2 files changed, 5 insertions, 0 deletions
diff --git a/xmloff/source/text/XMLTextColumnsExport.cxx b/xmloff/source/text/XMLTextColumnsExport.cxx
index 13f06fde36e6..017045d5f635 100644
--- a/xmloff/source/text/XMLTextColumnsExport.cxx
+++ b/xmloff/source/text/XMLTextColumnsExport.cxx
@@ -61,6 +61,8 @@ void XMLTextColumnsExport::exportXML( const Any& rAny )
{
Reference < XTextColumns > xColumns;
rAny >>= xColumns;
+ if (!xColumns)
+ return;
const Sequence < TextColumn > aColumns = xColumns->getColumns();
sal_Int32 nCount = aColumns.getLength();
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx
index addb880a1b3b..b8dc0a8a550f 100644
--- a/xmloff/source/text/txtprhdl.cxx
+++ b/xmloff/source/text/txtprhdl.cxx
@@ -656,6 +656,9 @@ bool XMLTextColumnsPropertyHandler::equals(
Reference < XTextColumns > xColumns2;
r2 >>= xColumns2;
+ if (!xColumns1 || !xColumns2)
+ return (!xColumns1 && !xColumns2);
+
if( xColumns1->getColumnCount() != xColumns2->getColumnCount() ||
xColumns1->getReferenceValue() != xColumns2->getReferenceValue() )
return false;