diff options
author | László Németh <nemeth@numbertext.org> | 2020-09-16 13:06:32 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-09-18 11:40:19 +0200 |
commit | d676d2c22f1d092c9978ffc1595b8356d8db1f7a (patch) | |
tree | 94679ff81736620f7ac80307a0ec9700ba0a0bc0 /writerfilter | |
parent | 4b94023c5caf2b5cbffca2ff2f3abf7597d0cbb0 (diff) |
tdf#123382 DOCX import: fix range IDs in column A
Range IDs ABOVE, BELOW, LEFT and RIGHT weren't recognized
in the first table column. Also the original formula was
not grab-bagged in the first table cell (A1), according to
the limitation of isInTable().
Follow-up of commit 436cf6d31deb7f9594a5da52ec7883d7e3d34344
(tdf#123355 DOCX import: fix cell range ABOVE, BELOW) and
commit 82189fdc93ac337e1de3379d678eca6b7654e6fc
(tdf133647 tdf123386 tdf123389 fix DOCX table formula export).
Change-Id: Ic7d9c63a5ca989328f7ed33e25e1eda45296b3a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102849
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 8b4d9dd2b51e..42024b048c45 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -75,6 +75,9 @@ using namespace ::std; #define CNF_LAST_ROW_FIRST_COLUMN 0x001 #define CNF_ALL 0xFFF +// total number of table columns +#define MAXTABLECELLS 63 + DomainMapperTableHandler::DomainMapperTableHandler( css::uno::Reference<css::text::XTextAppendAndConvert> const& xText, DomainMapper_Impl& rDMapper_Impl) @@ -1229,8 +1232,7 @@ static void lcl_convertFormulaRanges(const uno::Reference<text::XTextTable> & xT sal_Int32 nRows = xTableRows->getCount(); for (sal_Int32 nRow = 0; nRow < nRows; ++nRow) { - sal_Int16 nCol = 0; - while (++nCol) + for (sal_Int16 nCol = 0; nCol < MAXTABLECELLS; ++nCol) { try { diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 4e5b17863d41..000a0f50a238 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -4334,7 +4334,7 @@ void DomainMapper_Impl::handleFieldFormula xFieldProperties->setPropertyValue("IsShowFormula", uno::makeAny(false)); // grab-bag the original and converted formula - if (getTableManager().isInTable()) + if (hasTableManager()) { TablePropertyMapPtr pPropMap(new TablePropertyMap()); pPropMap->Insert(PROP_CELL_FORMULA, uno::makeAny(command.copy(1)), true, CELL_GRAB_BAG); |