diff options
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/tdf86374.docx | bin | 0 -> 13194 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/dmapper/TableManager.hxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/TablePropertiesHandler.cxx | 10 |
4 files changed, 20 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf86374.docx b/sw/qa/extras/ooxmlimport/data/tdf86374.docx Binary files differnew file mode 100644 index 000000000000..7fd772d79b3f --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/tdf86374.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 6ae2e0bdf41a..4a8d1a98954b 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2748,6 +2748,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf89702, "tdf89702.docx") CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xStyle, "CharFontName")); } +DECLARE_OOXMLIMPORT_TEST(testTdf86374, "tdf86374.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY); + // btLr text direction was imported as FIX, it should be MIN to have enough space for the additionally entered paragraphs. + CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, getProperty<sal_Int16>(xTableRows->getByIndex(0), "SizeType")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/TableManager.hxx b/writerfilter/source/dmapper/TableManager.hxx index e3760d0e627d..1a459cd1b784 100644 --- a/writerfilter/source/dmapper/TableManager.hxx +++ b/writerfilter/source/dmapper/TableManager.hxx @@ -241,6 +241,7 @@ protected: mState.resetCellProps(); } +public: TablePropertyMapPtr getRowProps() { return mState.getRowProps(); @@ -256,6 +257,7 @@ protected: mState.resetRowProps(); } +protected: void setInCell(bool bInCell) { mState.setInCell(bInCell); diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx index eb29b481f533..4db5a8c167b3 100644 --- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx +++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx @@ -90,8 +90,14 @@ namespace dmapper { const int MINLAY = 23; // sw/inc/swtypes.hxx, minimal possible size of frames. if (!pManager || !pManager->HasBtlrCell() || pMeasureHandler->getMeasureValue() > ConversionHelper::convertTwipToMM100(MINLAY)) { - // In case a cell already wanted fixed size, we should not overwrite it here. - if (!pManager || !pManager->IsRowSizeTypeInserted()) + bool bCantSplit = false; + if (pManager && pManager->getRowProps()) + { + boost::optional<PropertyMap::Property> oIsSplitAllowed = pManager->getRowProps()->getProperty(PROP_IS_SPLIT_ALLOWED); + bCantSplit = oIsSplitAllowed && !oIsSplitAllowed->second.get<bool>(); + } + // In case a cell already wanted fixed size and the row has <w:cantSplit/>, we should not overwrite it here. + if (!pManager || !pManager->IsRowSizeTypeInserted() || !bCantSplit) pPropMap->Insert( PROP_SIZE_TYPE, uno::makeAny( pMeasureHandler->GetRowHeightSizeType() ), false); else pPropMap->Insert( PROP_SIZE_TYPE, uno::makeAny(text::SizeType::FIX), false); |