[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - writerfilter/source
Mike Kaganski
mike.kaganski at collabora.com
Wed Nov 8 13:13:53 UTC 2017
writerfilter/source/dmapper/GraphicHelpers.cxx | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
New commits:
commit 9352932ec8f0582cc91f9d3b016555244d4c980d
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date: Mon May 8 16:42:55 2017 +0300
tdf#105688: findZOrder: catch exceptions from getPropertyValue
For some reason, sometimes items in GraphicZOrderHelper don't
have ZOrder property value, and so throw in getPropertyValue.
E.g., SwXFrame::getPropertyValue throws uno::RuntimeException
when its GetFrameFormat() returns nullptr.
The patch catches these to allow to proceed with fallback z-order.
Change-Id: I96140195f45364bccee7c5547d373158e2b49154
Reviewed-on: https://gerrit.libreoffice.org/37392
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit f66b76a4d20719e4c13bd755c49f8140a0e72816)
Reviewed-on: https://gerrit.libreoffice.org/44463
Reviewed-by: Aron Budea <aron.budea at collabora.com>
Tested-by: Aron Budea <aron.budea at collabora.com>
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx
index 8c4dd9c5aed8..6674af5132f4 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -273,20 +273,23 @@ sal_Int32 GraphicZOrderHelper::findZOrder( sal_Int32 relativeHeight, bool bOldSt
else
++it;
}
+ sal_Int32 itemZOrderOffset(0); // before the item
if( it == items.end()) // we're topmost
{
if( items.empty())
return 0;
- sal_Int32 itemZOrder(0);
--it;
- if( it->second->getPropertyValue(getPropertyName( PROP_Z_ORDER )) >>= itemZOrder )
- return itemZOrder + 1; // after the topmost
+ itemZOrderOffset = 1; // after the topmost
}
- else
- {
+ // SwXFrame::getPropertyValue throws uno::RuntimeException
+ // when its GetFrameFormat() returns nullptr
+ try {
sal_Int32 itemZOrder(0);
if( it->second->getPropertyValue(getPropertyName( PROP_Z_ORDER )) >>= itemZOrder )
- return itemZOrder; // before the item
+ return itemZOrder + itemZOrderOffset;
+ }
+ catch (const uno::RuntimeException&) {
+ SAL_WARN("writerfilter", "Exception when getting item z-order");
}
SAL_WARN( "writerfilter", "findZOrder() didn't find item z-order" );
return 0; // this should not(?) happen
More information about the Libreoffice-commits
mailing list