From 93075f4df21a7d5202703e813be60f1b46996942 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 6 Jul 2017 15:57:50 +0100 Subject: crashtesting: 554 crashing documents on export to .doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit regression from... commit d72e0cadceb0b43928a9b4f18d75c9d5d30afdda Date: Mon Jun 19 15:32:16 2017 +0200 Watermark: tdf#91687 correct size in the .doc hopefully this fix is correct Change-Id: I17512ffdd4db605e79b3adb97551e6f4e3816f2f Reviewed-on: https://gerrit.libreoffice.org/39661 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara (cherry picked from commit 661fa18d424690e1c3bce4ac70a8018dabe82637) Reviewed-on: https://gerrit.libreoffice.org/40406 (cherry picked from commit fa4a86135dda98c8b2de85a677ffb3cdc8f4e28b) Reviewed-on: https://gerrit.libreoffice.org/40412 Reviewed-by: Aron Budea Tested-by: Aron Budea --- sw/source/filter/ww8/wrtw8esh.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 2e94c500cbde..fc68e76fcd0e 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -763,8 +763,10 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const // We have to export original size with padding const SfxItemSet& rSet = pObj->GetMergedItemSet(); - const SdrMetricItem* pItem = static_cast(rSet.GetItem(SDRATTR_TEXT_UPPERDIST)); - aRect.SetSize(Size(aRect.GetWidth(), aRect.GetHeight() + pItem->GetValue())); + long nHeight = aRect.GetHeight(); + if (const SdrMetricItem* pItem = static_cast(rSet.GetItem(SDRATTR_TEXT_UPPERDIST))) + nHeight += pItem->GetValue(); + aRect.SetSize(Size(aRect.GetWidth(), nHeight)); } } -- cgit v1.2.3