[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - lotuswordpro/source
Caolán McNamara
caolanm at redhat.com
Mon Mar 27 12:07:34 UTC 2017
lotuswordpro/source/filter/lwpframelayout.cxx | 7 ++++++-
lotuswordpro/source/filter/lwpframelayout.hxx | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 17c7bdd3422dcfc1c434eca0f13b9d5b9a95c7dc
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Mar 26 21:21:22 2017 +0100
ofz#944 avoid recurse to death
(cherry picked from commit 7eb92eea21e2af47b17c9901107f6e4833567928)
Change-Id: I27ed8cf5e8296a1ad91c33614913fc7af4a56d45
Reviewed-on: https://gerrit.libreoffice.org/35725
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx
index 7f593e4a2cd7..0aef51df395c 100644
--- a/lotuswordpro/source/filter/lwpframelayout.cxx
+++ b/lotuswordpro/source/filter/lwpframelayout.cxx
@@ -761,7 +761,7 @@ void LwpFrameLink::Read(LwpObjectStream* pStrm)
}
LwpFrameLayout::LwpFrameLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
- : LwpPlacableLayout(objHdr, pStrm), m_pFrame(nullptr)
+ : LwpPlacableLayout(objHdr, pStrm), m_pFrame(nullptr), m_bGettingMaxWidth(false)
{
}
@@ -946,6 +946,10 @@ double LwpFrameLayout::GetWidth()
*/
double LwpFrameLayout::GetMaxWidth()
{
+ if (m_bGettingMaxWidth)
+ throw std::runtime_error("recursive GetMaxWidth");
+
+ m_bGettingMaxWidth = true;
double fActualWidth = 0;
rtl::Reference<LwpVirtualLayout> xLayout(GetContainerLayout());
LwpMiddleLayout* pParent = dynamic_cast<LwpMiddleLayout*>(xLayout.get());
@@ -974,6 +978,7 @@ double LwpFrameLayout::GetMaxWidth()
fActualWidth = fParentWidth - fXOffset - fParentMarginRight - fWrapRight;
}
+ m_bGettingMaxWidth = false;
return fActualWidth;
}
diff --git a/lotuswordpro/source/filter/lwpframelayout.hxx b/lotuswordpro/source/filter/lwpframelayout.hxx
index e39606098b65..ec705d300db7 100644
--- a/lotuswordpro/source/filter/lwpframelayout.hxx
+++ b/lotuswordpro/source/filter/lwpframelayout.hxx
@@ -141,6 +141,7 @@ private:
private:
LwpFrameLink m_Link;
LwpFrame* m_pFrame;
+ bool m_bGettingMaxWidth;
};
/**
More information about the Libreoffice-commits
mailing list