summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-12-23 17:52:46 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-01-02 07:47:51 +0000
commite73c961a7fb23246dc4a9c27d7ed0808b9ba74b5 (patch)
tree33bd42601e5db667ce6849e5351e9c030c692bad
parent7241c14d95f01ef4db9da94b3e6588bd917b14cb (diff)
tdf#104876 writerfilter: m_bTableSizeTypeInserted = false here
fixes commit cbd0fbc287051f918e4adb32b3e9b58dfbf8059d which removed the insertion code with the explanation saying we should simply not do anything, and that'll lead to the right behavior, don't try to be smart and try to set TABLE_WIDTH here but still left the flag set, falsely indicating that the tableSizeType had been inserted. Change-Id: I0720083c992d1d03a5fe259d5b4b177a0c8108f8 TODO: the table size still isn't correct. Reviewed-on: https://gerrit.libreoffice.org/32385 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport8.cxx3
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx4
2 files changed, 6 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 6987e381c0d1..7e0b03ffe026 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -1732,6 +1732,9 @@ DECLARE_OOXMLEXPORT_TEST(testHidemark, "hidemark.docx")
CPPUNIT_ASSERT_EQUAL(convertTwipToMm100(MINLAY), getProperty<sal_Int64>(xTableRows->getByIndex(1), "Height"));
// Size type was MIN, should be FIX to avoid considering the end of paragraph marker.
CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, getProperty<sal_Int16>(xTableRows->getByIndex(1), "SizeType"));
+
+ //tdf#104876: Width was not recognized during import when table size was 'auto'
+ CPPUNIT_ASSERT_MESSAGE("table size is less than 7000?",sal_Int32(7000) > getProperty<sal_Int32>(xTextTable, "Width"));
}
DECLARE_OOXMLEXPORT_TEST(testBnc891663, "bnc891663.docx")
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index ef71cdc302ab..1c1a3c10fcde 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -157,6 +157,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
{
pPropMap->setValue( TablePropertyMap::TABLE_WIDTH_TYPE, text::SizeType::FIX );
pPropMap->setValue( TablePropertyMap::TABLE_WIDTH, m_nTableWidth );
+ m_bTableSizeTypeInserted = true;
}
else if( sal::static_int_cast<Id>(pMeasureHandler->getUnit()) == NS_ooxml::LN_Value_ST_TblWidth_pct )
{
@@ -165,6 +166,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
nPercent = 100;
pPropMap->setValue( TablePropertyMap::TABLE_WIDTH_TYPE, text::SizeType::VARIABLE );
pPropMap->setValue( TablePropertyMap::TABLE_WIDTH, nPercent );
+ m_bTableSizeTypeInserted = true;
}
else if( sal::static_int_cast<Id>(pMeasureHandler->getUnit()) == NS_ooxml::LN_Value_ST_TblWidth_auto )
{
@@ -192,9 +194,9 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
// Set the width type of table with 'Auto' and set the width value to 0 (as per grid values)
pPropMap->setValue( TablePropertyMap::TABLE_WIDTH_TYPE, text::SizeType::VARIABLE );
pPropMap->setValue( TablePropertyMap::TABLE_WIDTH, 0 );
+ m_bTableSizeTypeInserted = true;
}
}
- m_bTableSizeTypeInserted = true;
}
#ifdef DEBUG_WRITERFILTER
pPropMap->dumpXml();