summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-08-17 14:00:54 +0200
committerLászló Németh <nemeth@numbertext.org>2020-08-17 23:30:21 +0200
commit82189fdc93ac337e1de3379d678eca6b7654e6fc (patch)
tree69d804ea4a0df683ecefa426ff47f6d7114f4f94 /writerfilter
parent7da32109ecf9a269764603f8a8855268d5b1f8e3 (diff)
tdf133647 tdf123386 tdf123389 fix DOCX table formula export
Keep original DOCX table formula during round-trip using grab-bagging. This is a temporary solution until fixing formula export and a proposed solution for formula cannot be converted. Follow-up of commit 68e74bdf63e992666016c790e8e4cfd5b28d6abe (tdf133647 tdf123386 tdf123389 Improved .docx table formula import). Change-Id: Ia4759e250c06e9cc0495fb0b57fccd1ee1f50da9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100872 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/Library_writerfilter.mk6
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx8
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx2
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx2
4 files changed, 15 insertions, 3 deletions
diff --git a/writerfilter/Library_writerfilter.mk b/writerfilter/Library_writerfilter.mk
index cbda03e9dcdd..add7c20bb2ea 100644
--- a/writerfilter/Library_writerfilter.mk
+++ b/writerfilter/Library_writerfilter.mk
@@ -51,9 +51,9 @@ $(eval $(call gb_Library_use_libraries,writerfilter,\
$(eval $(call gb_Library_use_externals,writerfilter,\
boost_headers \
- icui18n \
- icuuc \
- icu_headers \
+ icui18n \
+ icuuc \
+ icu_headers \
libxml2 \
))
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 4e8afddc8d50..1d23295fd759 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4286,6 +4286,14 @@ void DomainMapper_Impl::handleFieldFormula
// we don't copy the = symbol from the command
OUString formula = convertFieldFormula(command.copy(1));
+ // grab-bag the original and converted formula
+ if (getTableManager().isInTable())
+ {
+ TablePropertyMapPtr pPropMap(new TablePropertyMap());
+ pPropMap->Insert(PROP_CELL_FORMULA, uno::makeAny(command.copy(1)), true, CELL_GRAB_BAG);
+ pPropMap->Insert(PROP_CELL_FORMULA_CONVERTED, uno::makeAny(formula), true, CELL_GRAB_BAG);
+ getTableManager().cellProps(pPropMap);
+ }
xFieldProperties->setPropertyValue(getPropertyName(PROP_CONTENT), uno::makeAny(formula));
xFieldProperties->setPropertyValue(getPropertyName(PROP_NUMBER_FORMAT), uno::makeAny(sal_Int32(0)));
xFieldProperties->setPropertyValue("IsShowFormula", uno::makeAny(false));
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index 7428097f0953..3aafab2c9354 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -355,6 +355,8 @@ OUString getPropertyName( PropertyIds eId )
case PROP_DATATABLE_NAME: sName = "DataTableName"; break;
case PROP_DATACOLUMN_NAME: sName = "DataColumnName"; break;
case PROP_CHAR_TRANSPARENCE: sName = "CharTransparence"; break;
+ case PROP_CELL_FORMULA: sName = "CellFormula"; break;
+ case PROP_CELL_FORMULA_CONVERTED: sName = "CellFormulaConverted"; break;
}
assert(sName.getLength()>0);
return sName;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index c1c0e25698d6..5eed2297ff0d 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -357,6 +357,8 @@ enum PropertyIds
,PROP_DATATABLE_NAME
,PROP_DATACOLUMN_NAME
,PROP_CHAR_TRANSPARENCE
+ ,PROP_CELL_FORMULA
+ ,PROP_CELL_FORMULA_CONVERTED
};
//Returns the UNO string equivalent to eId.