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 ...@@ -133,11 +133,11 @@ void DXFPalette::SetColor(sal_uInt8 nIndex, sal_uInt8 nRed, sal_uInt8 nGreen, sa
DXFRepresentation::DXFRepresentation() DXFRepresentation::DXFRepresentation()
: mEnc(RTL_TEXTENCODING_DONTKNOW) : mEnc(RTL_TEXTENCODING_DONTKNOW)
, mbInCalc(false)
{ {
setGlobalLineTypeScale(1.0); setGlobalLineTypeScale(1.0);
} }
DXFRepresentation::~DXFRepresentation() DXFRepresentation::~DXFRepresentation()
{ {
} }
...@@ -297,6 +297,10 @@ void DXFRepresentation::ReadHeader(DXFGroupReader & rDGR) ...@@ -297,6 +297,10 @@ void DXFRepresentation::ReadHeader(DXFGroupReader & rDGR)
void DXFRepresentation::CalcBoundingBox(const DXFEntities & rEntities, void DXFRepresentation::CalcBoundingBox(const DXFEntities & rEntities,
DXFBoundingBox & rBox) DXFBoundingBox & rBox)
{ {
if (mbInCalc)
return;
mbInCalc = true;
DXFBasicEntity * pBE=rEntities.pFirst; DXFBasicEntity * pBE=rEntities.pFirst;
while (pBE!=nullptr) { while (pBE!=nullptr) {
switch (pBE->eType) { switch (pBE->eType) {
...@@ -441,6 +445,7 @@ void DXFRepresentation::CalcBoundingBox(const DXFEntities & rEntities, ...@@ -441,6 +445,7 @@ void DXFRepresentation::CalcBoundingBox(const DXFEntities & rEntities,
} }
pBE=pBE->pSucc; pBE=pBE->pSucc;
} }
mbInCalc = false;
} }
namespace { namespace {
......
...@@ -92,6 +92,8 @@ public: ...@@ -92,6 +92,8 @@ public:
double mfGlobalLineTypeScale; // $LTSCALE double mfGlobalLineTypeScale; // $LTSCALE
bool mbInCalc; // guard for self-recursive bounding box calc
DXFRepresentation(); DXFRepresentation();
~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