rename rStyleIdx -> gnStyleIdx

to make it obvious we are dealing with nasty global state here

Change-Id: I7f2193600a6459c3a5cd51fece8151ac46aebe7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166242
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2024-04-18 10:52:21 +02:00
parent 8df17c3401
commit 2f3b47ec80
3 changed files with 6 additions and 6 deletions

View file

@ -16,7 +16,7 @@
#include <vector>
#include <memory>
extern sal_Int32 rStyleIdx; // Holds index of the <extlst> <cfRule> style (Will be reset by finalize import)
extern sal_Int32 gnStyleIdx; // Holds index of the <extlst> <cfRule> style (Will be reset by finalize import)
struct ScDataBarFormatData;
namespace oox { class AttributeList; }

View file

@ -1354,7 +1354,7 @@ void CondFormatBuffer::finalizeImport()
++nExtCFIndex;
}
rStyleIdx = 0; // Resets <extlst> <cfRule> style index.
gnStyleIdx = 0; // Resets <extlst> <cfRule> style index.
}
CondFormatRef CondFormatBuffer::importCondFormatting( SequenceInputStream& rStrm )

View file

@ -30,7 +30,7 @@
using ::oox::core::ContextHandlerRef;
using ::oox::xls::CondFormatBuffer;
sal_Int32 rStyleIdx = 0;
sal_Int32 gnStyleIdx = 0; // Holds index of the <extlst> <cfRule> style (Will be reset by finalize import)
namespace oox::xls {
@ -292,10 +292,10 @@ void ExtConditionalFormattingContext::onEndElement()
maModel.eOperator = ScConditionMode::Direct;
}
if (Dxf* pDxf = getStyles().getExtDxfs().get(rStyleIdx).get())
if (Dxf* pDxf = getStyles().getExtDxfs().get(gnStyleIdx).get())
pDxf->finalizeImport();
maModel.aStyle = getStyles().createExtDxfStyle(rStyleIdx);
rStyleIdx++;
maModel.aStyle = getStyles().createExtDxfStyle(gnStyleIdx);
gnStyleIdx++;
nFormulaCount = 0;
maModels.push_back(maModel);
}