summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-26 21:21:22 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-03-26 21:21:22 +0100
commit7eb92eea21e2af47b17c9901107f6e4833567928 (patch)
treedc6ac27e404cba82fe3edfd33e6f676e2318e560 /lotuswordpro
parent80c18d5dd33d0681c58816d7536fe3e7d1297b9e (diff)
ofz#944 avoid recurse to death
Change-Id: I27ed8cf5e8296a1ad91c33614913fc7af4a56d45
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpframelayout.cxx7
-rw-r--r--lotuswordpro/source/filter/lwpframelayout.hxx1
2 files changed, 7 insertions, 1 deletions
diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx
index c4de8630c4be..c26d61f75378 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)
{
}
@@ -945,6 +945,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());
@@ -973,6 +977,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 527e5fbd50b5..734fe88ae35f 100644
--- a/lotuswordpro/source/filter/lwpframelayout.hxx
+++ b/lotuswordpro/source/filter/lwpframelayout.hxx
@@ -141,6 +141,7 @@ private:
private:
LwpFrameLink m_Link;
std::unique_ptr<LwpFrame> m_pFrame;
+ bool m_bGettingMaxWidth;
};
/**