Kaydet (Commit) 48b5b764 authored tarafından Miklos Vajna's avatar Miklos Vajna

bnc#865381 DOCX import: fix btLr cell direction when having vertical merge

Change-Id: I527955671e1100f05da717bffe002131baaf0291
üst e5cb1989
......@@ -1100,6 +1100,16 @@ DECLARE_OOXMLIMPORT_TEST(testTbLrHeight, "tblr-height.docx")
CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, getProperty<sal_Int16>(xTableRows->getByIndex(0), "SizeType"));
}
DECLARE_OOXMLIMPORT_TEST(testBnc865381, "bnc865381.docx")
{
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(), uno::UNO_QUERY);
// Second row has a vertically merged cell, make sure size type is MIN in that case (otherwise B2 is not readable).
CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, getProperty<sal_Int16>(xTableRows->getByIndex(1), "SizeType"));
}
DECLARE_OOXMLIMPORT_TEST(testFdo53985, "fdo53985.docx")
{
// Unhandled excetion prevented import of the rest of the document.
......
......@@ -346,10 +346,14 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
SAL_INFO( "writerfilter", "Have inserted textDirection " << nIntValue );
// We're faking a text direction, so don't allow multiple lines.
TablePropertyMapPtr pRowPropMap( new TablePropertyMap );
pRowPropMap->Insert(PROP_SIZE_TYPE, uno::makeAny(text::SizeType::FIX));
m_bRowSizeTypeInserted = true;
insertRowProps(pRowPropMap);
if (!getCellProps() || getCellProps()->find(PROP_VERTICAL_MERGE) == getCellProps()->end())
{
// Though in case there will be a vertical merge, don't do this, it hides text that is supposed to be visible.
TablePropertyMapPtr pRowPropMap( new TablePropertyMap );
pRowPropMap->Insert(PROP_SIZE_TYPE, uno::makeAny(text::SizeType::FIX));
m_bRowSizeTypeInserted = true;
insertRowProps(pRowPropMap);
}
}
break;
case 4: // lrTbV
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment