summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-05-02 22:04:08 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-05-03 08:50:46 +0200
commitebcf27d419e41a497242c98fcfec08a2088c0720 (patch)
tree0a13bff2d08e8a0eac69a261e35c2dd99eb7e370
parentb66ba0f0f297f7190f8d969486e07ede52987188 (diff)
tdf#116801 DOCX import: char styles have no IsAutoUpdate property
See sw/source/core/unocore/unomapproperties.hxx:447, UNO_NAME_IS_AUTO_UPDATE is part of the COMMON_PARA_STYLE_PROPERTIES define. So it's not "list styles don't have this", but "only paragraph styles have this". Change-Id: I1c256b087cdc2e7e341f55d717ef8e678fc69fb4 Reviewed-on: https://gerrit.libreoffice.org/53766 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf116801.docxbin0 -> 28554 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport11.cxx12
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx4
3 files changed, 14 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf116801.docx b/sw/qa/extras/ooxmlexport/data/tdf116801.docx
new file mode 100644
index 000000000000..f904546cf38b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf116801.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 2fa19d54e65d..eb42cee254a2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -369,6 +369,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116985, "tdf116985.docx")
CPPUNIT_ASSERT(nWidth > 4000);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf116801, "tdf116801.docx")
+{
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(),
+ uno::UNO_QUERY);
+ // This raised a lang::IndexOutOfBoundsException, table was missing from
+ // the import result.
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("D1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("D1"), xCell->getString());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 3fe88227d92f..398a7ab0086f 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1200,8 +1200,8 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable )
xPropertySet->setPropertyValue("StyleInteropGrabBag", uno::makeAny(aGrabBag));
}
- // List styles don't support automatic update.
- if (pEntry->bAutoRedefine && !bListStyle)
+ // Only paragraph styles support automatic updates.
+ if (pEntry->bAutoRedefine && bParaStyle)
xPropertySet->setPropertyValue("IsAutoUpdate", uno::makeAny(true));
}
else if(pEntry->nStyleTypeCode == STYLE_TYPE_TABLE)