[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sw/qa writerfilter/source
Bakos Attila (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 8 08:24:30 UTC 2019
sw/qa/extras/ooxmlexport/data/tdf120315.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 18 +++++++++++++++
writerfilter/source/dmapper/DomainMapperTableManager.cxx | 7 ++---
3 files changed, 21 insertions(+), 4 deletions(-)
New commits:
commit d99d2ad9f7a03663ed34008c8c3582f2999512d6
Author: Bakos Attila <bakos.attilakaroly at nisz.hu>
AuthorDate: Mon Oct 28 14:03:11 2019 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Nov 8 09:23:09 2019 +0100
tdf#120315 DOCX import: fix cells merged vertically
Due to rounding mistake cells weren't merged vertically,
when their horizontal positions are different a little bit.
Change-Id: I10623719a3759b35fcd04b154590b8ac6ec3ac45
Reviewed-on: https://gerrit.libreoffice.org/81604
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit 44e44239de35c1548809c96e13bfa9d64c7ca441)
Reviewed-on: https://gerrit.libreoffice.org/81992
Reviewed-by: Attila Bakos <bakos.attilakaroly at nisz.hu>
Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf120315.docx b/sw/qa/extras/ooxmlexport/data/tdf120315.docx
new file mode 100644
index 000000000000..d3943ea0b291
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf120315.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index d6294544c68e..a0a7f4169a1f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -14,6 +14,7 @@
#include <editsh.hxx>
#include <frmatr.hxx>
+#include <com/sun/star/text/TableColumnSeparator.hpp>
class Test : public SwModelTestBase
{
@@ -31,6 +32,23 @@ protected:
};
+DECLARE_OOXMLEXPORT_TEST(testTdf120315, "tdf120315.docx")
+{
+ // tdf#120315 cells of the second column weren't vertically merged
+ // because their horizontal positions are different a little bit
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(),
+ uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<table::XTableRows> xTableRows = xTextTable->getRows();
+ CPPUNIT_ASSERT_EQUAL(getProperty<uno::Sequence<text::TableColumnSeparator>>(
+ xTableRows->getByIndex(0), "TableColumnSeparators")[0]
+ .Position,
+ getProperty<uno::Sequence<text::TableColumnSeparator>>(
+ xTableRows->getByIndex(1), "TableColumnSeparators")[2]
+ .Position);
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf108350_noFontdefaults, "tdf108350_noFontdefaults.docx")
{
uno::Reference< container::XNameAccess > paragraphStyles = getStyles("ParagraphStyles");
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 2c33628615be..368e4b59c411 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -641,7 +641,7 @@ void DomainMapperTableManager::endOfRowAction()
}
uno::Sequence< text::TableColumnSeparator > aSeparators( m_nCell.back( ) - 1 );
text::TableColumnSeparator* pSeparators = aSeparators.getArray();
- sal_Int16 nLastRelPos = 0;
+ double nLastRelPos = 0.0;
sal_uInt32 nBorderGridIndex = m_nGridBefore;
size_t nWidthsBound = m_nCell.back( ) - 1;
@@ -657,10 +657,9 @@ void DomainMapperTableManager::endOfRowAction()
for ( sal_Int32 nGridCount = *aSpansIter; nGridCount > 0; --nGridCount )
fGridWidth += (*pTableGrid)[nBorderGridIndex++];
- sal_Int16 nRelPos =
- sal::static_int_cast< sal_Int16 >((fGridWidth * 10000) / nFullWidthRelative);
+ double nRelPos = static_cast<double>((fGridWidth * 10000) / nFullWidthRelative);
- pSeparators[nBorder].Position = nRelPos + nLastRelPos;
+ pSeparators[nBorder].Position = sal::static_int_cast< sal_Int16 >( nRelPos + nLastRelPos );
pSeparators[nBorder].IsVisible = true;
nLastRelPos = nLastRelPos + nRelPos;
++aSpansIter;
More information about the Libreoffice-commits
mailing list