summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-10 15:47:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-11 09:09:39 +0200
commit08b79ade4f2e2fa98487696591123f71a7521dff (patch)
tree2186cbc090333119cc9d4d76a3119d52c412ec8a
parentfc1e3801134629c4aa88e6181e72ace409d24618 (diff)
handle empty tools::Rectangle in sw
Change-Id: I44c4b5a6d4f0aada0ed95d8cd4d05366958c6207 Reviewed-on: https://gerrit.libreoffice.org/72124 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/uibase/uiview/view.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index c48a59c22841..67fce780a56a 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1527,13 +1527,17 @@ void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSe
aVector.push_back(comphelper::makePropertyValue("ViewTop", convertTwipToMm100 ( rRect.Top() )));
- aVector.push_back(comphelper::makePropertyValue("VisibleLeft", convertTwipToMm100 ( rVis.Left() )));
+ auto visibleLeft = convertTwipToMm100 ( rVis.Left() );
+ aVector.push_back(comphelper::makePropertyValue("VisibleLeft", visibleLeft));
- aVector.push_back(comphelper::makePropertyValue("VisibleTop", convertTwipToMm100 ( rVis.Top() )));
+ auto visibleTop = convertTwipToMm100 ( rVis.Top() );
+ aVector.push_back(comphelper::makePropertyValue("VisibleTop", visibleTop));
- aVector.push_back(comphelper::makePropertyValue("VisibleRight", convertTwipToMm100 ( rVis.Right() )));
+ auto visibleRight = rVis.IsWidthEmpty() ? visibleLeft : convertTwipToMm100 ( rVis.Right() );
+ aVector.push_back(comphelper::makePropertyValue("VisibleRight", visibleRight));
- aVector.push_back(comphelper::makePropertyValue("VisibleBottom", convertTwipToMm100 ( rVis.Bottom() )));
+ auto visibleBottom = rVis.IsHeightEmpty() ? visibleTop : convertTwipToMm100 ( rVis.Bottom() );
+ aVector.push_back(comphelper::makePropertyValue("VisibleBottom", visibleBottom));
const sal_Int16 nZoomType = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetZoomType());
aVector.push_back(comphelper::makePropertyValue("ZoomType", nZoomType));