summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-08-17 14:00:54 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-09-02 15:50:03 +0200
commit8f1cb34bdb523e17478de2b0ef7d745c29743df7 (patch)
tree48c6f77463322241c5417b7b0578ace615b6ad93 /writerfilter
parente5480bff53f3bd32fc922544f7d1c15854218ffc (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> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101758
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 ddef7048aeb8..0f468e43937e 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4262,6 +4262,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 e30aeb813e1c..aa95e538316b 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -358,6 +358,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.