summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-26 21:21:22 +0100
committerAndras Timar <andras.timar@collabora.com>2017-04-23 21:24:04 +0200
commit4ff9af22d0a77117500702528b750b0da8e61b0b (patch)
treefd1455a61401e221765117e7f6b72fef8dfd02a7 /lotuswordpro
parent5b7073790b28fd35300d466304b9c18bd8f7cb73 (diff)
ofz#944 avoid recurse to death
(cherry picked from commit 7eb92eea21e2af47b17c9901107f6e4833567928) Reviewed-on: https://gerrit.libreoffice.org/35725 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 17c7bdd3422dcfc1c434eca0f13b9d5b9a95c7dc) (cherry picked from commit 565078087944bcfa6e306c5ce3d4abc290d0adaa) 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 b9b5712f26c6..f163f43d87ae 100644
--- a/lotuswordpro/source/filter/lwpframelayout.cxx
+++ b/lotuswordpro/source/filter/lwpframelayout.cxx
@@ -766,7 +766,7 @@ void LwpFrameLink::Read(LwpObjectStream* pStrm)
}
LwpFrameLayout::LwpFrameLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
- : LwpPlacableLayout(objHdr, pStrm), m_pFrame(NULL)
+ : LwpPlacableLayout(objHdr, pStrm), m_pFrame(nullptr), m_bGettingMaxWidth(false)
{
}
@@ -951,6 +951,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());
@@ -979,6 +983,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 a686377148df..5e0a0ff387be 100644
--- a/lotuswordpro/source/filter/lwpframelayout.hxx
+++ b/lotuswordpro/source/filter/lwpframelayout.hxx
@@ -147,6 +147,7 @@ private:
private:
LwpFrameLink m_Link;
LwpFrame* m_pFrame;
+ bool m_bGettingMaxWidth;
};
/**