Kaydet (Commit) c9195645 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in ScXMLTableRowCellContext

Change-Id: Ie2c50b08eed674c129f0f66eae502c61e565a7f8
Reviewed-on: https://gerrit.libreoffice.org/52495Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst cc203440
......@@ -32,6 +32,17 @@ public:
virtual void run() override
{
std::string fn(compiler.getSourceManager()
.getFileEntryForID(compiler.getSourceManager().getMainFileID())
->getName());
loplugin::normalizeDotDotInFilePath(fn);
// can't change these because we pass them down to the SfxItemPool stuff
if (fn == SRCDIR "/sc/source/core/data/docpool.cxx")
return;
// this just too clever for me
if (fn == SRCDIR "/sc/source/core/tool/chgtrack.cxx")
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
......
......@@ -124,8 +124,6 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
ScXMLImportContext( rImport ),
mpEditEngine(GetScImport().GetEditEngine()),
mnCurParagraph(0),
pDetectiveObjVec(nullptr),
pCellRangeSource(nullptr),
fValue(0.0),
nMergedRows(1),
nMatrixRows(0),
......@@ -298,8 +296,6 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
ScXMLTableRowCellContext::~ScXMLTableRowCellContext()
{
delete pDetectiveObjVec;
delete pCellRangeSource;
}
void ScXMLTableRowCellContext::LockSolarMutex()
......@@ -724,18 +720,18 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTableRowCellContex
{
bIsEmpty = false;
if (!pDetectiveObjVec)
pDetectiveObjVec = new ScMyImpDetectiveObjVec;
pDetectiveObjVec.reset( new ScMyImpDetectiveObjVec );
pContext = new ScXMLDetectiveContext(
rXMLImport, pDetectiveObjVec );
rXMLImport, pDetectiveObjVec.get() );
}
break;
case XML_ELEMENT( TABLE, XML_CELL_RANGE_SOURCE ):
{
bIsEmpty = false;
if (!pCellRangeSource)
pCellRangeSource = new ScMyImpCellRangeSource();
pCellRangeSource.reset(new ScMyImpCellRangeSource());
pContext = new ScXMLCellRangeSourceContext(
rXMLImport, pAttribList, pCellRangeSource );
rXMLImport, pAttribList, pCellRangeSource.get() );
}
break;
}
......
......@@ -75,8 +75,8 @@ class ScXMLTableRowCellContext : public ScXMLImportContext
FieldsType maFields;
std::unique_ptr< ScXMLAnnotationData > mxAnnotationData;
ScMyImpDetectiveObjVec* pDetectiveObjVec;
ScMyImpCellRangeSource* pCellRangeSource;
std::unique_ptr< ScMyImpDetectiveObjVec > pDetectiveObjVec;
std::unique_ptr< ScMyImpCellRangeSource > pCellRangeSource;
double fValue;
SCROW nMergedRows, nMatrixRows, nRepeatedRows;
SCCOL nMergedCols, nMatrixCols, nColsRepeated;
......
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