sw/qa/extras/ooxmlexport/data/tdf154703_framePr.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 6 ++++++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-)
New commits: commit 31ea6305b6a763ee48f639562313d9bd109a2923 Author: Justin Luth <[email protected]> AuthorDate: Sat Apr 8 08:22:45 2023 -0400 Commit: Justin Luth <[email protected]> CommitDate: Sat Apr 8 20:10:09 2023 +0200 tdf#154703 writerfilter framePr: avoid exception with hasValue I'm assuming that because the range has multiple border definitions in the various paragraphs that the left border was considered undefined. Whatever the reason, a (void) uno::Any as a border was causing the conversion to fail. No matching existing unit tests found. make CppunitTest_sw_ooxmlexport18 CPPUNIT_TEST_NAME=testTdf154703_framePr Change-Id: I02fabfd035cad0f2094b023936ff1d33ed7f3fb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150156 Reviewed-by: Justin Luth <[email protected]> Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlexport/data/tdf154703_framePr.docx b/sw/qa/extras/ooxmlexport/data/tdf154703_framePr.docx new file mode 100644 index 000000000000..2ec5b493ecd3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf154703_framePr.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index b871961406c3..6f84d9784250 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -159,6 +159,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154129_framePr1, "tdf154129_framePr1.docx") } } +DECLARE_OOXMLEXPORT_TEST(testTdf154703_framePr, "tdf154703_framePr.docx") +{ + // the frame conversion had been failing, so it imported as plain text only. + CPPUNIT_ASSERT_EQUAL(1, getShapes()); +} + DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak, "tdf153613_anchoredAfterPgBreak.docx") { const auto& pLayout = parseLayoutDump(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 775b2194bd2d..5e8d2712a13c 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1559,9 +1559,10 @@ static void lcl_MoveBorderPropertiesToFrame(std::vector<beans::PropertyValue>& r beans::PropertyValue aValue; aValue.Name = sPropertyName; aValue.Value = xTextRangeProperties->getPropertyValue(sPropertyName); - rFrameProperties.push_back(aValue); if( nProperty < 4 ) xTextRangeProperties->setPropertyValue( sPropertyName, uno::Any(table::BorderLine2())); + if (aValue.Value.hasValue()) + rFrameProperties.push_back(aValue); } } catch( const uno::Exception& )
