summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-02-22 12:28:06 +0100
committerMichael Stahl <mstahl@redhat.com>2018-02-26 11:43:14 +0100
commitbd2e7b2a5bcb8f7838c7de828d0ecdd071ee4c64 (patch)
tree4e2a522eb457236bbb92e260bbd0cba319508e73
parented2a66a2ccace13c3d85490300cd623109214b0e (diff)
tdf#115883 DOCX import: catch RuntimeException from SwXFrame
getPropertyValue("Surround") for a non-inserted frame can throw, but hasPropertyValue("Surround") still returns true. So fix the regression by just catching the exception, assuming that in that case no increased spacing is needed. Change-Id: I49a78ce8d41b4e1cc7d23721d5dc70f7550c94af Reviewed-on: https://gerrit.libreoffice.org/50175 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 5e1a50cc433a865da677faf7d502ba41858e45f6) Reviewed-on: https://gerrit.libreoffice.org/50348 Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf115883.docxbin0 -> 33313 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx6
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx9
3 files changed, 14 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf115883.docx b/sw/qa/extras/ooxmlimport/data/tdf115883.docx
new file mode 100644
index 000000000000..f90ac638d7a4
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf115883.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 61ef9aeaeb63..d879dab4495a 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -684,6 +684,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf105975formula, "tdf105975.docx")
CPPUNIT_ASSERT_EQUAL(OUString("25"), xEnumerationAccess->getPresentation(false).trim());
}
+DECLARE_OOXMLIMPORT_TEST(testTdf115883, "tdf115883.docx")
+{
+ // Import failed due to an unhandled exception when getting the Surround
+ // property of a not yet inserted frame.
+}
+
DECLARE_OOXMLIMPORT_TEST(testTdf75573, "tdf75573_page1frame.docx")
{
// the problem was that the frame was discarded
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index db2f20980bb3..708b80a55c4f 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1219,7 +1219,14 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
}
rPendingFloatingTables.clear();
- HandleIncreasedAnchoredObjectSpacing(rDM_Impl);
+ try
+ {
+ HandleIncreasedAnchoredObjectSpacing(rDM_Impl);
+ }
+ catch (const uno::Exception& rException)
+ {
+ SAL_WARN("writerfilter", "HandleIncreasedAnchoredObjectSpacing() failed: " << rException);
+ }
if ( m_nLnnMod )
{