Kaydet (Commit) 7420e350 authored tarafından Caolán McNamara's avatar Caolán McNamara

guard against self-recursive GetBoundingBox

Change-Id: If33f0e5e326604bf731d6ad50644e3a0b24ccf51
üst a658c181
This diff is collapsed.
......@@ -133,11 +133,11 @@ void DXFPalette::SetColor(sal_uInt8 nIndex, sal_uInt8 nRed, sal_uInt8 nGreen, sa
DXFRepresentation::DXFRepresentation()
: mEnc(RTL_TEXTENCODING_DONTKNOW)
, mbInCalc(false)
{
setGlobalLineTypeScale(1.0);
}
DXFRepresentation::~DXFRepresentation()
{
}
......@@ -297,6 +297,10 @@ void DXFRepresentation::ReadHeader(DXFGroupReader & rDGR)
void DXFRepresentation::CalcBoundingBox(const DXFEntities & rEntities,
DXFBoundingBox & rBox)
{
if (mbInCalc)
return;
mbInCalc = true;
DXFBasicEntity * pBE=rEntities.pFirst;
while (pBE!=nullptr) {
switch (pBE->eType) {
......@@ -441,6 +445,7 @@ void DXFRepresentation::CalcBoundingBox(const DXFEntities & rEntities,
}
pBE=pBE->pSucc;
}
mbInCalc = false;
}
namespace {
......
......@@ -92,6 +92,8 @@ public:
double mfGlobalLineTypeScale; // $LTSCALE
bool mbInCalc; // guard for self-recursive bounding box calc
DXFRepresentation();
~DXFRepresentation();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment