summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 10:54:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 11:04:11 +0100
commit1d10db1003f092f48ed09a0d45994f7481b96d84 (patch)
tree5f73a2450b5bda6cbd1becfba3f013e45b6d67b3 /sc/source
parent9aeff6adce7287f7e85bc47ac9c418b93351e3d4 (diff)
loplugin:makeshared in sc
Change-Id: Ie287b5c11a1276c56f416f17ea69cddd5992b4a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87326 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/documen2.cxx2
-rw-r--r--sc/source/core/data/document.cxx2
-rw-r--r--sc/source/core/data/document10.cxx4
-rw-r--r--sc/source/core/data/documentimport.cxx2
-rw-r--r--sc/source/core/data/dpgroup.cxx18
-rw-r--r--sc/source/core/data/dpobject.cxx4
-rw-r--r--sc/source/core/data/dptabres.cxx2
-rw-r--r--sc/source/core/data/dptabsrc.cxx8
-rw-r--r--sc/source/core/data/funcdesc.cxx2
-rw-r--r--sc/source/core/data/listenercontext.cxx4
-rw-r--r--sc/source/core/data/postit.cxx4
-rw-r--r--sc/source/core/data/table3.cxx2
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx47
-rw-r--r--sc/source/core/tool/calcconfig.cxx2
-rw-r--r--sc/source/core/tool/simplerangelist.cxx2
-rw-r--r--sc/source/filter/excel/excdoc.cxx28
-rw-r--r--sc/source/filter/excel/excrecds.cxx4
-rw-r--r--sc/source/filter/excel/impop.cxx6
-rw-r--r--sc/source/filter/excel/xechart.cxx112
-rw-r--r--sc/source/filter/excel/xedbdata.cxx4
-rw-r--r--sc/source/filter/excel/xeescher.cxx12
-rw-r--r--sc/source/filter/excel/xeformula.cxx16
-rw-r--r--sc/source/filter/excel/xehelper.cxx4
-rw-r--r--sc/source/filter/excel/xelink.cxx32
-rw-r--r--sc/source/filter/excel/xename.cxx14
-rw-r--r--sc/source/filter/excel/xepivot.cxx10
-rw-r--r--sc/source/filter/excel/xeroot.cxx36
-rw-r--r--sc/source/filter/excel/xestream.cxx2
-rw-r--r--sc/source/filter/excel/xestyle.cxx40
-rw-r--r--sc/source/filter/excel/xetable.cxx64
-rw-r--r--sc/source/filter/excel/xichart.cxx149
-rw-r--r--sc/source/filter/excel/xicontent.cxx8
-rw-r--r--sc/source/filter/excel/xiescher.cxx140
-rw-r--r--sc/source/filter/excel/xiformula.cxx2
-rw-r--r--sc/source/filter/excel/xilink.cxx2
-rw-r--r--sc/source/filter/excel/xipivot.cxx12
-rw-r--r--sc/source/filter/excel/xiroot.cxx44
-rw-r--r--sc/source/filter/excel/xistyle.cxx4
-rw-r--r--sc/source/filter/excel/xlchart.cxx20
-rw-r--r--sc/source/filter/excel/xlroot.cxx18
-rw-r--r--sc/source/filter/excel/xltoolbar.cxx4
-rw-r--r--sc/source/filter/excel/xlview.cxx2
-rw-r--r--sc/source/filter/inc/autofilterbuffer.hxx2
-rw-r--r--sc/source/filter/oox/autofilterbuffer.cxx4
-rw-r--r--sc/source/filter/oox/commentsbuffer.cxx4
-rw-r--r--sc/source/filter/oox/condformatbuffer.cxx4
-rw-r--r--sc/source/filter/oox/connectionsbuffer.cxx2
-rw-r--r--sc/source/filter/oox/defnamesbuffer.cxx2
-rw-r--r--sc/source/filter/oox/drawingfragment.cxx14
-rw-r--r--sc/source/filter/oox/externallinkbuffer.cxx6
-rw-r--r--sc/source/filter/oox/formulabase.cxx6
-rw-r--r--sc/source/filter/oox/numberformatsbuffer.cxx4
-rw-r--r--sc/source/filter/oox/ooxformulaparser.cxx2
-rw-r--r--sc/source/filter/oox/pivotcachebuffer.cxx4
-rw-r--r--sc/source/filter/oox/pivottablebuffer.cxx6
-rw-r--r--sc/source/filter/oox/querytablebuffer.cxx2
-rw-r--r--sc/source/filter/oox/revisionfragment.cxx2
-rw-r--r--sc/source/filter/oox/richstring.cxx6
-rw-r--r--sc/source/filter/oox/scenariobuffer.cxx4
-rw-r--r--sc/source/filter/oox/sharedstringsbuffer.cxx2
-rw-r--r--sc/source/filter/oox/sheetdatacontext.cxx6
-rw-r--r--sc/source/filter/oox/stylesbuffer.cxx42
-rw-r--r--sc/source/filter/oox/tablebuffer.cxx2
-rw-r--r--sc/source/filter/oox/tablecolumnsbuffer.cxx4
-rw-r--r--sc/source/filter/oox/viewsettings.cxx8
-rw-r--r--sc/source/filter/oox/workbookfragment.cxx4
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx4
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx2
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx2
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx4
-rw-r--r--sc/source/filter/xml/XMLStylesImportHelper.cxx14
-rw-r--r--sc/source/filter/xml/XMLStylesImportHelper.hxx2
-rw-r--r--sc/source/ui/dataprovider/dataprovider.cxx2
-rw-r--r--sc/source/ui/dialogs/searchresults.cxx2
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx16
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx9
-rw-r--r--sc/source/ui/formdlg/formula.cxx2
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.cxx4
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx8
-rw-r--r--sc/source/ui/view/scextopt.cxx4
80 files changed, 553 insertions, 558 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index c87dab365084..4b6e7fac9b0f 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -91,7 +91,7 @@ using namespace com::sun::star;
const sal_uInt16 ScDocument::nSrcVer = SC_CURRENT_VERSION;
ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
- mpCellStringPool(new svl::SharedStringPool(*ScGlobal::pCharClass)),
+ mpCellStringPool(std::make_shared<svl::SharedStringPool>(*ScGlobal::pCharClass)),
mpDocLinkMgr(new sc::DocumentLinkManager(pDocShell)),
mbFormulaGroupCxtBlockDiscard(false),
maCalcConfig( ScInterpreter::GetGlobalConfig()),
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index a7071416eb6e..9a36ed567d90 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3526,7 +3526,7 @@ std::shared_ptr<sc::FormulaGroupContext>& ScDocument::GetFormulaGroupContext()
{
ScMutationGuard aGuard(this, ScMutationGuardFlags::CORE);
if (!mpFormulaGroupCxt)
- mpFormulaGroupCxt.reset(new sc::FormulaGroupContext);
+ mpFormulaGroupCxt = std::make_shared<sc::FormulaGroupContext>();
return mpFormulaGroupCxt;
}
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index 8b1496943081..a6626867b14c 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -470,9 +470,9 @@ class StartNeededListenersHandler
{
std::shared_ptr<sc::StartListeningContext> mpCxt;
public:
- explicit StartNeededListenersHandler( ScDocument& rDoc ) : mpCxt(new sc::StartListeningContext(rDoc)) {}
+ explicit StartNeededListenersHandler( ScDocument& rDoc ) : mpCxt(std::make_shared<sc::StartListeningContext>(rDoc)) {}
explicit StartNeededListenersHandler( ScDocument& rDoc, const std::shared_ptr<const sc::ColumnSet>& rpColSet ) :
- mpCxt(new sc::StartListeningContext(rDoc))
+ mpCxt(std::make_shared<sc::StartListeningContext>(rDoc))
{
mpCxt->setColumnSet( rpColSet);
}
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index 46d1638fbe48..2fd7f744d34c 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -647,7 +647,7 @@ public:
mrDocImpl(rDocImpl),
mnTab(nTab),
mnCol(nCol),
- mpImpl(new Impl(mrDocImpl.mnDefaultScriptNumeric))
+ mpImpl(std::make_shared<Impl>(mrDocImpl.mnDefaultScriptNumeric))
{}
std::shared_ptr<Impl> mpImpl;
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index a97ce449649c..456de9baa3d0 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -676,15 +676,15 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterio
if (rNumGrpDim.IsDateDimension())
{
// grouped by dates.
- aCri.mpFilter.reset(
- new ScDPGroupDateFilter(
- aMatchValues, pDoc->GetFormatTable()->GetNullDate(), *pNumInfo));
+ aCri.mpFilter =
+ std::make_shared<ScDPGroupDateFilter>(
+ aMatchValues, pDoc->GetFormatTable()->GetNullDate(), *pNumInfo);
}
else
{
// This dimension is grouped by numeric ranges.
- aCri.mpFilter.reset(
- new ScDPGroupNumFilter(aMatchValues, *pNumInfo));
+ aCri.mpFilter =
+ std::make_shared<ScDPGroupNumFilter>(aMatchValues, *pNumInfo);
}
aNewCriteria.push_back(aCri);
@@ -709,9 +709,9 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterio
// external number group
ScDPFilteredCache::Criterion aCri;
aCri.mnFieldIndex = nSrcDim; // use the source dimension, not the group dimension.
- aCri.mpFilter.reset(
- new ScDPGroupDateFilter(
- aMatchValues, pDoc->GetFormatTable()->GetNullDate(), *pNumInfo));
+ aCri.mpFilter =
+ std::make_shared<ScDPGroupDateFilter>(
+ aMatchValues, pDoc->GetFormatTable()->GetNullDate(), *pNumInfo);
aNewCriteria.push_back(aCri);
}
@@ -721,7 +721,7 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterio
ScDPFilteredCache::Criterion aCri;
aCri.mnFieldIndex = nSrcDim;
- aCri.mpFilter.reset(new ScDPFilteredCache::GroupFilter());
+ aCri.mpFilter = std::make_shared<ScDPFilteredCache::GroupFilter>();
ScDPFilteredCache::GroupFilter* pGrpFilter =
static_cast<ScDPFilteredCache::GroupFilter*>(aCri.mpFilter.get());
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 73b236df1f48..45736b4d4db0 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -688,7 +688,7 @@ ScDPTableData* ScDPObject::GetTableData()
if (pCache)
{
pCache->AddReference(this);
- pData.reset(new ScDatabaseDPData(pDoc, *pCache));
+ pData = std::make_shared<ScDatabaseDPData>(pDoc, *pCache);
}
}
else
@@ -709,7 +709,7 @@ ScDPTableData* ScDPObject::GetTableData()
if (pCache)
{
pCache->AddReference(this);
- pData.reset(new ScSheetDPData(pDoc, *pSheetDesc, *pCache));
+ pData = std::make_shared<ScSheetDPData>(pDoc, *pSheetDesc, *pCache);
}
}
}
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 9c2b453d8cb7..b535d5cdc08e 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -3925,7 +3925,7 @@ void ScDPResultVisibilityData::fillFieldFilters(vector<ScDPFilteredCache::Criter
long nDimIndex = itrField->second;
aCri.mnFieldIndex = static_cast<sal_Int32>(nDimIndex);
- aCri.mpFilter.reset(new ScDPFilteredCache::GroupFilter);
+ aCri.mpFilter = std::make_shared<ScDPFilteredCache::GroupFilter>();
ScDPFilteredCache::GroupFilter* pGrpFilter =
static_cast<ScDPFilteredCache::GroupFilter*>(aCri.mpFilter.get());
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index de6e778a6565..e8bbd3c91c19 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -449,8 +449,8 @@ Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<s
ScDPItemData aItem(pMembers->getByIndex(nIndex)->FillItemData());
aFilterCriteria.emplace_back( );
aFilterCriteria.back().mnFieldIndex = nCol;
- aFilterCriteria.back().mpFilter.reset(
- new ScDPFilteredCache::SingleFilter(aItem));
+ aFilterCriteria.back().mpFilter =
+ std::make_shared<ScDPFilteredCache::SingleFilter>(aItem);
}
}
}
@@ -696,7 +696,7 @@ void ScDPSource::FilterCacheByPageDimensions()
long nMemCount = pMems->getCount();
ScDPFilteredCache::Criterion aFilter;
aFilter.mnFieldIndex = static_cast<sal_Int32>(nField);
- aFilter.mpFilter.reset(new ScDPFilteredCache::GroupFilter);
+ aFilter.mpFilter = std::make_shared<ScDPFilteredCache::GroupFilter>();
ScDPFilteredCache::GroupFilter* pGrpFilter =
static_cast<ScDPFilteredCache::GroupFilter*>(aFilter.mpFilter.get());
for (long j = 0; j < nMemCount; ++j)
@@ -719,7 +719,7 @@ void ScDPSource::FilterCacheByPageDimensions()
aCriteria.emplace_back();
ScDPFilteredCache::Criterion& r = aCriteria.back();
r.mnFieldIndex = static_cast<sal_Int32>(nField);
- r.mpFilter.reset(new ScDPFilteredCache::SingleFilter(rData));
+ r.mpFilter = std::make_shared<ScDPFilteredCache::SingleFilter>(rData);
}
if (!aCriteria.empty())
{
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index a8e43efd0d04..89e07465ea67 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -1130,7 +1130,7 @@ const formula::IFunctionCategory* ScFunctionMgr::getCategory(sal_uInt32 nCategor
if ( nCategory < (MAX_FUNCCAT-1) )
{
if (m_aCategories.find(nCategory) == m_aCategories.end())
- m_aCategories[nCategory].reset(new ScFunctionCategory(aCatLists[nCategory+1].get(),nCategory)); // aCatLists[0] is "all"
+ m_aCategories[nCategory] = std::make_shared<ScFunctionCategory>(aCatLists[nCategory+1].get(),nCategory); // aCatLists[0] is "all"
return m_aCategories[nCategory].get();
}
return nullptr;
diff --git a/sc/source/core/data/listenercontext.cxx b/sc/source/core/data/listenercontext.cxx
index 46f0ecb5cc27..c9194eca0d24 100644
--- a/sc/source/core/data/listenercontext.cxx
+++ b/sc/source/core/data/listenercontext.cxx
@@ -14,7 +14,7 @@
namespace sc {
StartListeningContext::StartListeningContext(ScDocument& rDoc) :
- mrDoc(rDoc), mpSet(new ColumnBlockPositionSet(rDoc)) {}
+ mrDoc(rDoc), mpSet(std::make_shared<ColumnBlockPositionSet>(rDoc)) {}
StartListeningContext::StartListeningContext(
ScDocument& rDoc, const std::shared_ptr<ColumnBlockPositionSet>& pSet) :
@@ -36,7 +36,7 @@ ColumnBlockPosition* StartListeningContext::getBlockPosition(SCTAB nTab, SCCOL n
}
EndListeningContext::EndListeningContext(ScDocument& rDoc, ScTokenArray* pOldCode) :
- mrDoc(rDoc), maSet(false), mpPosSet(new ColumnBlockPositionSet(rDoc)),
+ mrDoc(rDoc), maSet(false), mpPosSet(std::make_shared<ColumnBlockPositionSet>(rDoc)),
mpOldCode(pOldCode), maPosDelta(0,0,0) {}
EndListeningContext::EndListeningContext(
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 754c83b24f66..f58203b886b4 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -1245,7 +1245,7 @@ ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
{
OSL_ENSURE( pItemSet && pOutlinerObj, "ScNoteUtil::CreateNoteFromObjectData - item set and outliner object expected" );
ScNoteData aNoteData( bShown );
- aNoteData.mxInitData.reset( new ScCaptionInitData );
+ aNoteData.mxInitData = std::make_shared<ScCaptionInitData>();
ScCaptionInitData& rInitData = *aNoteData.mxInitData;
rInitData.mxItemSet = std::move(pItemSet);
rInitData.mxOutlinerObj.reset( pOutlinerObj );
@@ -1279,7 +1279,7 @@ ScPostIt* ScNoteUtil::CreateNoteFromString(
if( !rNoteText.isEmpty() )
{
ScNoteData aNoteData( bShown );
- aNoteData.mxInitData.reset( new ScCaptionInitData );
+ aNoteData.mxInitData = std::make_shared<ScCaptionInitData>();
ScCaptionInitData& rInitData = *aNoteData.mxInitData;
rInitData.maSimpleText = rNoteText;
rInitData.mbDefaultPosSize = true;
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 7f881167d3d4..8f6c588cd6c7 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -849,7 +849,7 @@ class ListenerStartAction : public sc::ColumnSpanSet::ColumnAction
public:
explicit ListenerStartAction( ScDocument& rDoc ) :
mpCol(nullptr),
- mpPosSet(new sc::ColumnBlockPositionSet(rDoc)),
+ mpPosSet(std::make_shared<sc::ColumnBlockPositionSet>(rDoc)),
maStartCxt(rDoc, mpPosSet),
maEndCxt(rDoc, mpPosSet) {}
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 2a88dfc54c49..af591f871f55 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -2641,7 +2641,7 @@ static DynamicKernelArgumentRef SoPHelper( const ScCalcConfig& config,
const std::string& ts, const FormulaTreeNodeRef& ft, SlidingFunctionBase* pCodeGen,
int nResultSize )
{
- return DynamicKernelArgumentRef(new DynamicKernelSoPArguments(config, ts, ft, pCodeGen, nResultSize));
+ return std::make_shared<DynamicKernelSoPArguments>(config, ts, ft, pCodeGen, nResultSize);
}
template<class Base>
@@ -2765,9 +2765,8 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
// Function takes numbers or strings, there are both
SAL_INFO("sc.opencl", "Numbers and strings");
mvSubArguments.push_back(
- DynamicKernelArgumentRef(
- new DynamicKernelMixedSlidingArgument(mCalcConfig,
- ts, ft->Children[i], mpCodeGen, j)));
+ std::make_shared<DynamicKernelMixedSlidingArgument>(mCalcConfig,
+ ts, ft->Children[i], mpCodeGen, j));
}
else if (pDVR->GetArrays()[j].mpNumericArray &&
pCodeGen->takeNumeric() &&
@@ -2841,8 +2840,8 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
// Function takes numbers or strings, there are both
SAL_INFO("sc.opencl", "Numbers and strings");
mvSubArguments.push_back(
- DynamicKernelArgumentRef(new DynamicKernelMixedArgument(mCalcConfig,
- ts, ft->Children[i])));
+ std::make_shared<DynamicKernelMixedArgument>(mCalcConfig,
+ ts, ft->Children[i]));
}
else if (pSVR->GetArray().mpNumericArray &&
pCodeGen->takeNumeric() &&
@@ -2853,8 +2852,8 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
// they are to be treated as zero
SAL_INFO("sc.opencl", "Numbers (no strings or strings treated as zero)");
mvSubArguments.push_back(
- DynamicKernelArgumentRef(new VectorRef(mCalcConfig, ts,
- ft->Children[i])));
+ std::make_shared<VectorRef>(mCalcConfig, ts,
+ ft->Children[i]));
}
else if (pSVR->GetArray().mpNumericArray == nullptr &&
pCodeGen->takeNumeric() &&
@@ -2865,8 +2864,8 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
// strings, but they are to be treated as zero
SAL_INFO("sc.opencl", "Only strings even if want numbers but should be treated as zero");
mvSubArguments.push_back(
- DynamicKernelArgumentRef(new VectorRef(mCalcConfig, ts,
- ft->Children[i])));
+ std::make_shared<VectorRef>(mCalcConfig, ts,
+ ft->Children[i]));
}
else if (pSVR->GetArray().mpStringArray &&
pCodeGen->takeString())
@@ -2874,8 +2873,8 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
// There are strings, and the function takes strings.
SAL_INFO("sc.opencl", "Strings only");
mvSubArguments.push_back(
- DynamicKernelArgumentRef(new DynamicKernelStringArgument(mCalcConfig,
- ts, ft->Children[i])));
+ std::make_shared<DynamicKernelStringArgument>(mCalcConfig,
+ ts, ft->Children[i]));
}
else if (AllStringsAreNull(pSVR->GetArray().mpStringArray, pSVR->GetArrayLength()) &&
pSVR->GetArray().mpNumericArray == nullptr)
@@ -2884,8 +2883,8 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
// array of NANs
SAL_INFO("sc.opencl", "Only empty cells");
mvSubArguments.push_back(
- DynamicKernelArgumentRef(new VectorRef(mCalcConfig, ts,
- ft->Children[i])));
+ std::make_shared<VectorRef>(mCalcConfig, ts,
+ ft->Children[i]));
}
else
{
@@ -2898,16 +2897,16 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
{
SAL_INFO("sc.opencl", "Constant number case");
mvSubArguments.push_back(
- DynamicKernelArgumentRef(new DynamicKernelConstantArgument(mCalcConfig, ts,
- ft->Children[i])));
+ std::make_shared<DynamicKernelConstantArgument>(mCalcConfig, ts,
+ ft->Children[i]));
}
else if (pChild->GetType() == formula::svString
&& pCodeGen->takeString())
{
SAL_INFO("sc.opencl", "Constant string case");
mvSubArguments.push_back(
- DynamicKernelArgumentRef(new ConstStringArgument(mCalcConfig, ts,
- ft->Children[i])));
+ std::make_shared<ConstStringArgument>(mCalcConfig, ts,
+ ft->Children[i]));
}
else
{
@@ -3388,13 +3387,13 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
break;
case ocPi:
mvSubArguments.push_back(
- DynamicKernelArgumentRef(new DynamicKernelPiArgument(mCalcConfig, ts,
- ft->Children[i])));
+ std::make_shared<DynamicKernelPiArgument>(mCalcConfig, ts,
+ ft->Children[i]));
break;
case ocRandom:
mvSubArguments.push_back(
- DynamicKernelArgumentRef(new DynamicKernelRandomArgument(mCalcConfig, ts,
- ft->Children[i])));
+ std::make_shared<DynamicKernelRandomArgument>(mCalcConfig, ts,
+ ft->Children[i]));
break;
case ocProduct:
mvSubArguments.push_back(SoPHelper(mCalcConfig, ts,
@@ -4115,7 +4114,7 @@ const DynamicKernelArgument* SymbolTable::DeclRefArg(const ScCalcConfig& config,
// Allocate new symbols
std::stringstream ss;
ss << "tmp" << mCurId++;
- DynamicKernelArgumentRef new_arg(new T(config, ss.str(), t, pCodeGen, nResultSize));
+ DynamicKernelArgumentRef new_arg = std::make_shared<T>(config, ss.str(), t, pCodeGen, nResultSize);
mSymbols[ref] = new_arg;
mParams.push_back(new_arg);
return new_arg.get();
@@ -4148,7 +4147,7 @@ std::unique_ptr<DynamicKernel> DynamicKernel::create( const ScCalcConfig& rConfi
OpCode eOp = pCur->GetOpCode();
if (eOp != ocPush)
{
- FormulaTreeNodeRef pCurNode(new FormulaTreeNode(pCur));
+ FormulaTreeNodeRef pCurNode = std::make_shared<FormulaTreeNode>(pCur);
sal_uInt8 nParamCount = pCur->GetParamCount();
for (sal_uInt8 i = 0; i < nParamCount; i++)
{
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 72f86052c0ca..9ef2ccf13098 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -209,7 +209,7 @@ OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet& rOpCodes)
ScCalcConfig::OpCodeSet ScStringToOpCodeSet(const OUString& rOpCodes)
{
- ScCalcConfig::OpCodeSet result(new o3tl::sorted_vector< OpCode >);
+ ScCalcConfig::OpCodeSet result = std::make_shared<o3tl::sorted_vector< OpCode >>();
formula::FormulaCompiler aCompiler;
formula::FormulaCompiler::OpCodeMapPtr pOpCodeMap(aCompiler.GetOpCodeMap(css::sheet::FormulaLanguage::ENGLISH));
diff --git a/sc/source/core/tool/simplerangelist.cxx b/sc/source/core/tool/simplerangelist.cxx
index 0dacf14d0464..671f91f5669a 100644
--- a/sc/source/core/tool/simplerangelist.cxx
+++ b/sc/source/core/tool/simplerangelist.cxx
@@ -175,7 +175,7 @@ ScSimpleRangeList::RangeListRef ScSimpleRangeList::findTab(SCTAB nTab)
TabType::iterator itr = maTabs.find(nTab);
if (itr == maTabs.end())
{
- RangeListRef p(new list<Range>);
+ RangeListRef p = std::make_shared<list<Range>>();
pair<TabType::iterator, bool> r = maTabs.emplace(nTab, p);
if (!r.second)
return RangeListRef();
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 35e333fc4a7f..ca21fe210da5 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -110,7 +110,7 @@ ExcTable::ExcTable( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot ),
mnScTab( SCTAB_GLOBAL ),
nExcTab( EXC_NOTAB ),
- mxNoteList( new XclExpNoteList )
+ mxNoteList( std::make_shared<XclExpNoteList>() )
{
}
@@ -118,7 +118,7 @@ ExcTable::ExcTable( const XclExpRoot& rRoot, SCTAB nScTab ) :
XclExpRoot( rRoot ),
mnScTab( nScTab ),
nExcTab( rRoot.GetTabInfo().GetXclTab( nScTab ) ),
- mxNoteList( new XclExpNoteList )
+ mxNoteList( std::make_shared<XclExpNoteList>() )
{
}
@@ -257,7 +257,7 @@ void ExcTable::FillAsHeaderBinary( ExcBoundsheetList& rBoundsheetList )
for( nC = 0 ; nC < nScTabCount ; nC++ )
if( rTabInfo.IsExportTab( nC ) )
{
- ExcBoundsheetList::RecordRefType xBoundsheet( new ExcBundlesheet( rR, nC ) );
+ ExcBoundsheetList::RecordRefType xBoundsheet = std::make_shared<ExcBundlesheet>( rR, nC );
aRecList.AppendRecord( xBoundsheet );
rBoundsheetList.AppendRecord( xBoundsheet );
}
@@ -282,7 +282,7 @@ void ExcTable::FillAsHeaderBinary( ExcBoundsheetList& rBoundsheetList )
for( nC = 0 ; nC < nScTabCount ; nC++ )
if( rTabInfo.IsExportTab( nC ) )
{
- ExcBoundsheetList::RecordRefType xBoundsheet( new ExcBundlesheet8( rR, nC ) );
+ ExcBoundsheetList::RecordRefType xBoundsheet = std::make_shared<ExcBundlesheet8>( rR, nC );
aRecList.AppendRecord( xBoundsheet );
rBoundsheetList.AppendRecord( xBoundsheet );
}
@@ -291,7 +291,7 @@ void ExcTable::FillAsHeaderBinary( ExcBoundsheetList& rBoundsheetList )
for( SCTAB nAdd = 0; nC < static_cast<SCTAB>(nCodenames) ; nC++, nAdd++ )
{
aTmpString = lcl_GetVbaTabName( nAdd );
- ExcBoundsheetList::RecordRefType xBoundsheet( new ExcBundlesheet8( aTmpString ) );
+ ExcBoundsheetList::RecordRefType xBoundsheet = std::make_shared<ExcBundlesheet8>( aTmpString );
aRecList.AppendRecord( xBoundsheet );
rBoundsheetList.AppendRecord( xBoundsheet );
}
@@ -374,7 +374,7 @@ void ExcTable::FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList )
for( nC = 0 ; nC < nScTabCount ; nC++ )
if( rTabInfo.IsExportTab( nC ) )
{
- ExcBoundsheetList::RecordRefType xBoundsheet( new ExcBundlesheet8( rR, nC ) );
+ ExcBoundsheetList::RecordRefType xBoundsheet = std::make_shared<ExcBundlesheet8>( rR, nC );
aRecList.AppendRecord( xBoundsheet );
rBoundsheetList.AppendRecord( xBoundsheet );
}
@@ -384,7 +384,7 @@ void ExcTable::FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList )
for( SCTAB nAdd = 0; nC < static_cast<SCTAB>(nCodenames) ; nC++, nAdd++ )
{
aTmpString = lcl_GetVbaTabName( nAdd );
- ExcBoundsheetList::RecordRefType xBoundsheet( new ExcBundlesheet8( aTmpString ) );
+ ExcBoundsheetList::RecordRefType xBoundsheet = std::make_shared<ExcBundlesheet8>( aTmpString );
aRecList.AppendRecord( xBoundsheet );
rBoundsheetList.AppendRecord( xBoundsheet );
}
@@ -417,7 +417,7 @@ void ExcTable::FillAsTableBinary( SCTAB nCodeNameIdx )
GetObjectManager().StartSheet();
// cell table: DEFROWHEIGHT, DEFCOLWIDTH, COLINFO, DIMENSIONS, ROW, cell records
- mxCellTable.reset( new XclExpCellTable( GetRoot() ) );
+ mxCellTable = std::make_shared<XclExpCellTable>( GetRoot() );
//export cell notes
std::vector<sc::NoteEntry> aNotes;
@@ -558,7 +558,7 @@ void ExcTable::FillAsTableXml()
GetObjectManager().StartSheet();
// cell table: DEFROWHEIGHT, DEFCOLWIDTH, COLINFO, DIMENSIONS, ROW, cell records
- mxCellTable.reset( new XclExpCellTable( GetRoot() ) );
+ mxCellTable = std::make_shared<XclExpCellTable>( GetRoot() );
//export cell notes
std::vector<sc::NoteEntry> aNotes;
@@ -573,7 +573,7 @@ void ExcTable::FillAsTableXml()
// WSBOOL needs data from page settings, create it here, add it later
auto xPageSett = std::make_shared<XclExpPageSettings>( GetRoot() );
- XclExtLstRef xExtLst( new XclExtLst( GetRoot() ) );
+ XclExtLstRef xExtLst = std::make_shared<XclExtLst>( GetRoot() );
bool bFitToPages = xPageSett->GetPageData().mbFitToPages;
Color aTabColor = GetRoot().GetDoc().GetTabBgColor(mnScTab);
@@ -734,7 +734,7 @@ void ExcDocument::ReadDoc()
{
if( GetTabInfo().IsExportTab( nScTab ) )
{
- ExcTableList::RecordRefType xTab( new ExcTable( GetRoot(), nScTab ) );
+ ExcTableList::RecordRefType xTab = std::make_shared<ExcTable>( GetRoot(), nScTab );
maTableList.AppendRecord( xTab );
if (GetOutput() == EXC_OUTPUT_BINARY)
xTab->FillAsTableBinary(nCodeNameIdx);
@@ -746,7 +746,7 @@ void ExcDocument::ReadDoc()
}
for( ; nCodeNameIdx < nCodeNameCount; ++nScTab, ++nCodeNameIdx )
{
- ExcTableList::RecordRefType xTab( new ExcTable( GetRoot(), nScTab ) );
+ ExcTableList::RecordRefType xTab = std::make_shared<ExcTable>( GetRoot(), nScTab );
maTableList.AppendRecord( xTab );
xTab->FillAsEmptyTable( nCodeNameIdx );
}
@@ -852,8 +852,8 @@ void ExcDocument::WriteXml( XclExpXmlStream& rStrm )
if ( rCalcConfig.mbHasStringRefSyntax ||
(eConv != formula::FormulaGrammar::CONV_XL_A1) )
{
- XclExtLstRef xExtLst( new XclExtLst( GetRoot() ) );
- xExtLst->AddRecord( XclExpExtRef( new XclExpExtCalcPr( GetRoot(), eConv )) );
+ XclExtLstRef xExtLst = std::make_shared<XclExtLst>( GetRoot() );
+ xExtLst->AddRecord( std::make_shared<XclExpExtCalcPr>( GetRoot(), eConv ) );
xExtLst->SaveXml(rStrm);
}
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index b68fa71e018a..f8d1861bdea1 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -944,7 +944,7 @@ XclExpAutofilter* ExcAutoFilterRecs::GetByCol( SCCOL nCol )
if( xFilter->GetCol() == static_cast<sal_uInt16>(nCol) )
return xFilter.get();
}
- xFilter.reset( new XclExpAutofilter( GetRoot(), static_cast<sal_uInt16>(nCol) ) );
+ xFilter = std::make_shared<XclExpAutofilter>( GetRoot(), static_cast<sal_uInt16>(nCol) );
maFilterList.AppendRecord( xFilter );
return xFilter.get();
}
@@ -1005,7 +1005,7 @@ XclExpFilterManager::XclExpFilterManager( const XclExpRoot& rRoot ) :
void XclExpFilterManager::InitTabFilter( SCTAB nScTab )
{
- maFilterMap[ nScTab ].reset( new ExcAutoFilterRecs( GetRoot(), nScTab, nullptr ) );
+ maFilterMap[ nScTab ] = std::make_shared<ExcAutoFilterRecs>( GetRoot(), nScTab, nullptr );
}
XclExpRecordRef XclExpFilterManager::CreateRecord( SCTAB nScTab )
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 16676c8f0192..e200dc2aea89 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -1353,9 +1353,9 @@ void ImportExcel::PostDocLoad()
XclImpOutlineDataBuffer::XclImpOutlineDataBuffer( const XclImpRoot& rRoot, SCTAB nScTab ) :
XclImpRoot( rRoot ),
- mxColOutlineBuff( new XclImpOutlineBuffer( rRoot.GetXclMaxPos().Col() + 1 ) ),
- mxRowOutlineBuff( new XclImpOutlineBuffer( rRoot.GetXclMaxPos().Row() + 1 ) ),
- mxColRowBuff( new XclImpColRowSettings( rRoot ) ),
+ mxColOutlineBuff( std::make_shared<XclImpOutlineBuffer>( rRoot.GetXclMaxPos().Col() + 1 ) ),
+ mxRowOutlineBuff( std::make_shared<XclImpOutlineBuffer>( rRoot.GetXclMaxPos().Row() + 1 ) ),
+ mxColRowBuff( std::make_shared<XclImpColRowSettings>( rRoot ) ),
mnScTab( nScTab )
{
}
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index bd9e3d767e47..9c801579b728 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -293,7 +293,7 @@ void XclExpChRootData::FinalizeFutureRecBlock( XclExpStream& rStrm )
XclExpChRoot::XclExpChRoot( const XclExpRoot& rRoot, XclExpChChart& rChartData ) :
XclExpRoot( rRoot ),
- mxChData( new XclExpChRootData( rChartData ) )
+ mxChData( std::make_shared<XclExpChRootData>( rChartData ) )
{
}
@@ -561,7 +561,7 @@ namespace {
XclExpChLineFormatRef lclCreateLineFormat( const XclExpChRoot& rRoot,
const ScfPropertySet& rPropSet, XclChObjectType eObjType )
{
- XclExpChLineFormatRef xLineFmt( new XclExpChLineFormat( rRoot ) );
+ XclExpChLineFormatRef xLineFmt = std::make_shared<XclExpChLineFormat>( rRoot );
xLineFmt->Convert( rRoot, rPropSet, eObjType );
const XclChFormatInfo& rFmtInfo = rRoot.GetFormatInfo( eObjType );
if( rFmtInfo.mbDeleteDefFrame && xLineFmt->IsDefault( rFmtInfo.meDefFrameType ) )
@@ -731,16 +731,16 @@ void XclExpChFrameBase::ConvertFrameBase( const XclExpChRoot& rRoot,
const ScfPropertySet& rPropSet, XclChObjectType eObjType )
{
// line format
- mxLineFmt.reset( new XclExpChLineFormat( rRoot ) );
+ mxLineFmt = std::make_shared<XclExpChLineFormat>( rRoot );
mxLineFmt->Convert( rRoot, rPropSet, eObjType );
// area format (only for frame objects)
if( rRoot.GetFormatInfo( eObjType ).mbIsFrame )
{
- mxAreaFmt.reset( new XclExpChAreaFormat( rRoot ) );
+ mxAreaFmt = std::make_shared<XclExpChAreaFormat>( rRoot );
bool bComplexFill = mxAreaFmt->Convert( rRoot, rPropSet, eObjType );
if( (rRoot.GetBiff() == EXC_BIFF8) && bComplexFill )
{
- mxEscherFmt.reset( new XclExpChEscherFormat( rRoot ) );
+ mxEscherFmt = std::make_shared<XclExpChEscherFormat>( rRoot );
mxEscherFmt->Convert( rPropSet, eObjType );
if( mxEscherFmt->IsValid() )
mxAreaFmt->SetAuto( false );
@@ -754,12 +754,12 @@ void XclExpChFrameBase::SetDefaultFrameBase( const XclExpChRoot& rRoot,
XclChFrameType eDefFrameType, bool bIsFrame )
{
// line format
- mxLineFmt.reset( new XclExpChLineFormat( rRoot ) );
+ mxLineFmt = std::make_shared<XclExpChLineFormat>( rRoot );
mxLineFmt->SetDefault( eDefFrameType );
// area format (only for frame objects)
if( bIsFrame )
{
- mxAreaFmt.reset( new XclExpChAreaFormat( rRoot ) );
+ mxAreaFmt = std::make_shared<XclExpChAreaFormat>( rRoot );
mxAreaFmt->SetDefault( eDefFrameType );
mxEscherFmt.reset();
}
@@ -836,7 +836,7 @@ namespace {
XclExpChFrameRef lclCreateFrame( const XclExpChRoot& rRoot,
const ScfPropertySet& rPropSet, XclChObjectType eObjType )
{
- XclExpChFrameRef xFrame( new XclExpChFrame( rRoot, eObjType ) );
+ XclExpChFrameRef xFrame = std::make_shared<XclExpChFrame>( rRoot, eObjType );
xFrame->Convert( rPropSet );
if( xFrame->IsDeleteable() )
xFrame.reset();
@@ -1131,7 +1131,7 @@ void XclExpChFontBase::ConvertFontBase( const XclExpChRoot& rRoot, sal_uInt16 nF
{
if( const XclExpFont* pFont = rRoot.GetFontBuffer().GetFont( nFontIdx ) )
{
- XclExpChFontRef xFont( new XclExpChFont( nFontIdx ) );
+ XclExpChFontRef xFont = std::make_shared<XclExpChFont>( nFontIdx );
SetFont( xFont, pFont->GetFontData().maColor, pFont->GetFontColorId() );
}
}
@@ -1178,7 +1178,7 @@ void XclExpChText::ConvertTitle( Reference< XTitle > const & xTitle, sal_uInt16
}
mxSrcLink.reset();
- mxObjLink.reset( new XclExpChObjectLink( nTarget, XclChDataPointPos( 0, 0 ) ) );
+ mxObjLink = std::make_shared<XclExpChObjectLink>( nTarget, XclChDataPointPos( 0, 0 ) );
if( xTitle.is() )
{
@@ -1187,7 +1187,7 @@ void XclExpChText::ConvertTitle( Reference< XTitle > const & xTitle, sal_uInt16
mxFrame = lclCreateFrame( GetChRoot(), aTitleProp, EXC_CHOBJTYPE_TEXT );
// string sequence
- mxSrcLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_TITLE ) );
+ mxSrcLink = std::make_shared<XclExpChSourceLink>( GetChRoot(), EXC_CHSRCLINK_TITLE );
sal_uInt16 nFontIdx = mxSrcLink->ConvertStringSequence( xTitle->getText() );
if (pSubTitle)
{
@@ -1202,7 +1202,7 @@ void XclExpChText::ConvertTitle( Reference< XTitle > const & xTitle, sal_uInt16
ConvertRotationBase( aTitleProp, true );
// manual text position - only for main title
- mxFramePos.reset( new XclExpChFramePos( EXC_CHFRAMEPOS_PARENT ) );
+ mxFramePos = std::make_shared<XclExpChFramePos>( EXC_CHFRAMEPOS_PARENT );
if( nTarget == EXC_CHOBJLINK_TITLE )
{
Any aRelPos;
@@ -1269,7 +1269,7 @@ bool XclExpChText::ConvertDataLabel( const ScfPropertySet& rPropSet,
// create the CHFRLABELPROPS record for extended settings in BIFF8
if( bShowAny && (GetBiff() == EXC_BIFF8) )
{
- mxLabelProps.reset( new XclExpChFrLabelProps( GetChRoot() ) );
+ mxLabelProps = std::make_shared<XclExpChFrLabelProps>( GetChRoot() );
mxLabelProps->Convert( rPropSet, bShowCateg, bShowValue, bShowPercent, bShowBubble );
}
@@ -1323,12 +1323,12 @@ bool XclExpChText::ConvertDataLabel( const ScfPropertySet& rPropSet,
}
::insert_value( maData.mnFlags2, nLabelPos, 0, 4 );
// source link (contains number format)
- mxSrcLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_TITLE ) );
+ mxSrcLink = std::make_shared<XclExpChSourceLink>( GetChRoot(), EXC_CHSRCLINK_TITLE );
if( bShowValue || bShowPercent )
// percentage format wins over value format
mxSrcLink->ConvertNumFmt( rPropSet, bShowPercent );
// object link
- mxObjLink.reset( new XclExpChObjectLink( EXC_CHOBJLINK_DATA, rPointPos ) );
+ mxObjLink = std::make_shared<XclExpChObjectLink>( EXC_CHOBJLINK_DATA, rPointPos );
}
/* Return true to indicate valid label settings:
@@ -1350,10 +1350,10 @@ void XclExpChText::ConvertTrendLineEquation( const ScfPropertySet& rPropSet, con
maData.mnVAlign = EXC_CHTEXT_ALIGN_TOPLEFT;
ConvertFontBase( GetChRoot(), rPropSet );
// source link (contains number format)
- mxSrcLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_TITLE ) );
+ mxSrcLink = std::make_shared<XclExpChSourceLink>( GetChRoot(), EXC_CHSRCLINK_TITLE );
mxSrcLink->ConvertNumFmt( rPropSet, false );
// object link
- mxObjLink.reset( new XclExpChObjectLink( EXC_CHOBJLINK_DATA, rPointPos ) );
+ mxObjLink = std::make_shared<XclExpChObjectLink>( EXC_CHOBJLINK_DATA, rPointPos );
}
sal_uInt16 XclExpChText::GetAttLabelFlags() const
@@ -1409,7 +1409,7 @@ XclExpChTextRef lclCreateTitle( const XclExpChRoot& rRoot, Reference< XTitled >
if( xTitled.is() )
xTitle = xTitled->getTitleObject();
- XclExpChTextRef xText( new XclExpChText( rRoot ) );
+ XclExpChTextRef xText = std::make_shared<XclExpChText>( rRoot );
xText->ConvertTitle( xTitle, nTarget, pSubTitle );
/* Do not delete the CHTEXT group for the main title. A missing CHTEXT
will be interpreted as auto-generated title showing the series title in
@@ -1565,35 +1565,35 @@ void XclExpChDataFormat::ConvertDataSeries( const ScfPropertySet& rPropSet, cons
bool bIsFrame = rTypeInfo.IsSeriesFrameFormat();
if( !bIsFrame )
{
- mxMarkerFmt.reset( new XclExpChMarkerFormat( GetChRoot() ) );
+ mxMarkerFmt = std::make_shared<XclExpChMarkerFormat>( GetChRoot() );
mxMarkerFmt->Convert( GetChRoot(), rPropSet, maData.mnFormatIdx );
}
// pie segments
if( rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE )
{
- mxPieFmt.reset( new XclExpChPieFormat );
+ mxPieFmt = std::make_shared<XclExpChPieFormat>();
mxPieFmt->Convert( rPropSet );
}
// 3D bars (only allowed for entire series in BIFF8)
if( IsSeriesFormat() && (GetBiff() == EXC_BIFF8) && rTypeInfo.mb3dChart && (rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_BAR) )
{
- mx3dDataFmt.reset( new XclExpCh3dDataFormat );
+ mx3dDataFmt = std::make_shared<XclExpCh3dDataFormat>();
mx3dDataFmt->Convert( rPropSet );
}
// spline
if( IsSeriesFormat() && rTypeInfo.mbSpline && !bIsFrame )
- mxSeriesFmt.reset( new XclExpUInt16Record( EXC_ID_CHSERIESFORMAT, EXC_CHSERIESFORMAT_SMOOTHED ) );
+ mxSeriesFmt = std::make_shared<XclExpUInt16Record>( EXC_ID_CHSERIESFORMAT, EXC_CHSERIESFORMAT_SMOOTHED );
// data point labels
- XclExpChTextRef xLabel( new XclExpChText( GetChRoot() ) );
+ XclExpChTextRef xLabel = std::make_shared<XclExpChText>( GetChRoot() );
if( xLabel->ConvertDataLabel( rPropSet, rTypeInfo, maData.maPointPos ) )
{
// CHTEXT groups for data labels are stored in global CHCHART group
GetChartData().SetDataLabel( xLabel );
- mxAttLabel.reset( new XclExpChAttachedLabel( xLabel->GetAttLabelFlags() ) );
+ mxAttLabel = std::make_shared<XclExpChAttachedLabel>( xLabel->GetAttLabelFlags() );
}
}
@@ -1602,7 +1602,7 @@ void XclExpChDataFormat::ConvertStockSeries( const ScfPropertySet& rPropSet, boo
// set line format to invisible
SetDefaultFrameBase( GetChRoot(), EXC_CHFRAMETYPE_INVISIBLE, false );
// set symbols to invisible or to 'close' series symbol
- mxMarkerFmt.reset( new XclExpChMarkerFormat( GetChRoot() ) );
+ mxMarkerFmt = std::make_shared<XclExpChMarkerFormat>( GetChRoot() );
mxMarkerFmt->ConvertStockSymbol( GetChRoot(), rPropSet, bCloseSymbol );
}
@@ -1689,7 +1689,7 @@ bool XclExpChSerTrendLine::Convert( Reference< XRegressionCurve > const & xRegCu
// line formatting
XclChDataPointPos aPointPos( nSeriesIdx );
- mxDataFmt.reset( new XclExpChDataFormat( GetChRoot(), aPointPos, 0 ) );
+ mxDataFmt = std::make_shared<XclExpChDataFormat>( GetChRoot(), aPointPos, 0 );
mxDataFmt->ConvertLine( aCurveProp, EXC_CHOBJTYPE_TRENDLINE );
// #i83100# show equation and correlation coefficient
@@ -1700,7 +1700,7 @@ bool XclExpChSerTrendLine::Convert( Reference< XRegressionCurve > const & xRegCu
// #i83100# formatting of the equation text box
if( (maData.mnShowEquation != 0) || (maData.mnShowRSquared != 0) )
{
- mxLabel.reset( new XclExpChText( GetChRoot() ) );
+ mxLabel = std::make_shared<XclExpChText>( GetChRoot() );
mxLabel->ConvertTrendLineEquation( aEquationProp, aPointPos );
}
@@ -1826,11 +1826,11 @@ XclExpChSeries::XclExpChSeries( const XclExpChRoot& rRoot, sal_uInt16 nSeriesIdx
mnParentIdx( EXC_CHSERIES_INVALID )
{
// CHSOURCELINK records are always required, even if unused
- mxTitleLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_TITLE ) );
- mxValueLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_VALUES ) );
- mxCategLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_CATEGORY ) );
+ mxTitleLink = std::make_shared<XclExpChSourceLink>( GetChRoot(), EXC_CHSRCLINK_TITLE );
+ mxValueLink = std::make_shared<XclExpChSourceLink>( GetChRoot(), EXC_CHSRCLINK_VALUES );
+ mxCategLink = std::make_shared<XclExpChSourceLink>( GetChRoot(), EXC_CHSRCLINK_CATEGORY );
if( GetBiff() == EXC_BIFF8 )
- mxBubbleLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_BUBBLES ) );
+ mxBubbleLink = std::make_shared<XclExpChSourceLink>( GetChRoot(), EXC_CHSRCLINK_BUBBLES );
}
bool XclExpChSeries::ConvertDataSeries(
@@ -1890,7 +1890,7 @@ bool XclExpChSeries::ConvertDataSeries(
// series formatting
XclChDataPointPos aPointPos( mnSeriesIdx );
ScfPropertySet aSeriesProp( xDataSeries );
- mxSeriesFmt.reset( new XclExpChDataFormat( GetChRoot(), aPointPos, nFormatIdx ) );
+ mxSeriesFmt = std::make_shared<XclExpChDataFormat>( GetChRoot(), aPointPos, nFormatIdx );
mxSeriesFmt->ConvertDataSeries( aSeriesProp, rTypeInfo );
// trend lines
@@ -1941,7 +1941,7 @@ bool XclExpChSeries::ConvertDataSeries(
break;
aPointPos.mnPointIdx = static_cast< sal_uInt16 >( nPointIndex );
ScfPropertySet aPointProp = lclGetPointPropSet( xDataSeries, nPointIndex );
- XclExpChDataFormatRef xPointFmt( new XclExpChDataFormat( GetChRoot(), aPointPos, nFormatIdx ) );
+ XclExpChDataFormatRef xPointFmt = std::make_shared<XclExpChDataFormat>( GetChRoot(), aPointPos, nFormatIdx );
xPointFmt->ConvertDataSeries( aPointProp, rTypeInfo );
maPointFmts.AppendRecord( xPointFmt );
}
@@ -1986,7 +1986,7 @@ bool XclExpChSeries::ConvertStockSeries( css::uno::Reference< css::chart2::XData
mxTitleLink->ConvertDataSequence( xTitleSeq, true );
// series formatting
ScfPropertySet aSeriesProp( xDataSeries );
- mxSeriesFmt.reset( new XclExpChDataFormat( GetChRoot(), XclChDataPointPos( mnSeriesIdx ), nFormatIdx ) );
+ mxSeriesFmt = std::make_shared<XclExpChDataFormat>( GetChRoot(), XclChDataPointPos( mnSeriesIdx ), nFormatIdx );
mxSeriesFmt->ConvertStockSeries( aSeriesProp, bCloseSymbol );
}
}
@@ -1997,7 +1997,7 @@ bool XclExpChSeries::ConvertTrendLine( const XclExpChSeries& rParent, Reference<
{
InitFromParent( rParent );
- mxTrendLine.reset( new XclExpChSerTrendLine( GetChRoot() ) );
+ mxTrendLine = std::make_shared<XclExpChSerTrendLine>( GetChRoot() );
bool bOk = mxTrendLine->Convert( xRegCurve, mnSeriesIdx );
if( bOk )
{
@@ -2016,12 +2016,12 @@ bool XclExpChSeries::ConvertErrorBar( const XclExpChSeries& rParent, const ScfPr
{
InitFromParent( rParent );
// error bar settings
- mxErrorBar.reset( new XclExpChSerErrorBar( GetChRoot(), nBarId ) );
+ mxErrorBar = std::make_shared<XclExpChSerErrorBar>( GetChRoot(), nBarId );
bool bOk = mxErrorBar->Convert( *mxValueLink, maData.mnValueCount, rPropSet );
if( bOk )
{
// error bar formatting
- mxSeriesFmt.reset( new XclExpChDataFormat( GetChRoot(), XclChDataPointPos( mnSeriesIdx ), 0 ) );
+ mxSeriesFmt = std::make_shared<XclExpChDataFormat>( GetChRoot(), XclChDataPointPos( mnSeriesIdx ), 0 );
mxSeriesFmt->ConvertLine( rPropSet, EXC_CHOBJTYPE_ERRORBAR );
}
return bOk;
@@ -2271,7 +2271,7 @@ void XclExpChLegend::Convert( const ScfPropertySet& rPropSet )
// frame properties
mxFrame = lclCreateFrame( GetChRoot(), rPropSet, EXC_CHOBJTYPE_LEGEND );
// text properties
- mxText.reset( new XclExpChText( GetChRoot() ) );
+ mxText = std::make_shared<XclExpChText>( GetChRoot() );
mxText->ConvertLegend( rPropSet );
// legend position and size
@@ -2293,7 +2293,7 @@ void XclExpChLegend::Convert( const ScfPropertySet& rPropSet )
Reference< cssc::XChartDocument > xChart1Doc( GetChartDocument(), UNO_QUERY_THROW );
Reference< XShape > xChart1Legend( xChart1Doc->getLegend(), UNO_SET_THROW );
// coordinates in CHLEGEND record written but not used by Excel
- mxFramePos.reset( new XclExpChFramePos( EXC_CHFRAMEPOS_CHARTSIZE ) );
+ mxFramePos = std::make_shared<XclExpChFramePos>( EXC_CHFRAMEPOS_CHARTSIZE );
XclChFramePos& rFramePos = mxFramePos->GetFramePosData();
rFramePos.mnTLMode = EXC_CHFRAMEPOS_CHARTSIZE;
css::awt::Point aLegendPos = xChart1Legend->getPosition();
@@ -2312,7 +2312,7 @@ void XclExpChLegend::Convert( const ScfPropertySet& rPropSet )
maData.mnDockMode = EXC_CHLEGEND_NOTDOCKED;
// a CHFRAME record with cleared auto flags is needed
if( !mxFrame )
- mxFrame.reset( new XclExpChFrame( GetChRoot(), EXC_CHOBJTYPE_LEGEND ) );
+ mxFrame = std::make_shared<XclExpChFrame>( GetChRoot(), EXC_CHOBJTYPE_LEGEND );
mxFrame->SetAutoFlags( false, false );
}
catch( Exception& )
@@ -2409,7 +2409,7 @@ void XclExpChTypeGroup::ConvertType(
// 3d chart settings
if( maTypeInfo.mb3dChart ) // only true, if Excel chart supports 3d mode
{
- mxChart3d.reset( new XclExpChChart3d );
+ mxChart3d = std::make_shared<XclExpChChart3d>();
ScfPropertySet aDiaProp( xDiagram );
mxChart3d->Convert( aDiaProp, Is3dWallChart() );
}
@@ -2494,7 +2494,7 @@ void XclExpChTypeGroup::ConvertLegend( const ScfPropertySet& rPropSet )
{
if( rPropSet.GetBoolProperty( EXC_CHPROP_SHOW ) )
{
- mxLegend.reset( new XclExpChLegend( GetChRoot() ) );
+ mxLegend = std::make_shared<XclExpChLegend>( GetChRoot() );
mxLegend->Convert( rPropSet );
}
}
@@ -2546,7 +2546,7 @@ void XclExpChTypeGroup::CreateAllStockSeries(
if( bHasHigh && bHasLow && aTypeProp.GetBoolProperty( EXC_CHPROP_SHOWHIGHLOW ) )
{
ScfPropertySet aSeriesProp( xDataSeries );
- XclExpChLineFormatRef xLineFmt( new XclExpChLineFormat( GetChRoot() ) );
+ XclExpChLineFormatRef xLineFmt = std::make_shared<XclExpChLineFormat>( GetChRoot() );
xLineFmt->Convert( GetChRoot(), aSeriesProp, EXC_CHOBJTYPE_HILOLINE );
sal_uInt16 nKey = EXC_CHCHARTLINE_HILO;
m_ChartLines.insert(std::make_pair(nKey, std::make_unique<XclExpChLineFormat>(GetChRoot())));
@@ -2559,12 +2559,12 @@ void XclExpChTypeGroup::CreateAllStockSeries(
// white dropbar format
aTypeProp.GetProperty( xWhitePropSet, EXC_CHPROP_WHITEDAY );
ScfPropertySet aWhiteProp( xWhitePropSet );
- mxUpBar.reset( new XclExpChDropBar( GetChRoot(), EXC_CHOBJTYPE_WHITEDROPBAR ) );
+ mxUpBar = std::make_shared<XclExpChDropBar>( GetChRoot(), EXC_CHOBJTYPE_WHITEDROPBAR );
mxUpBar->Convert( aWhiteProp );
// black dropbar format
aTypeProp.GetProperty( xBlackPropSet, EXC_CHPROP_BLACKDAY );
ScfPropertySet aBlackProp( xBlackPropSet );
- mxDownBar.reset( new XclExpChDropBar( GetChRoot(), EXC_CHOBJTYPE_BLACKDROPBAR ) );
+ mxDownBar = std::make_shared<XclExpChDropBar>( GetChRoot(), EXC_CHOBJTYPE_BLACKDROPBAR );
mxDownBar->Convert( aBlackProp );
}
}
@@ -2945,7 +2945,7 @@ void XclExpChAxis::Convert( Reference< XAxis > const & xAxis, Reference< XAxis >
// axis line format -------------------------------------------------------
- mxAxisLine.reset( new XclExpChLineFormat( GetChRoot() ) );
+ mxAxisLine = std::make_shared<XclExpChLineFormat>( GetChRoot() );
mxAxisLine->Convert( GetChRoot(), aAxisProp, EXC_CHOBJTYPE_AXISLINE );
// #i58688# axis enabled
mxAxisLine->SetShowAxis( aAxisProp.GetBoolProperty( EXC_CHPROP_SHOW ) );
@@ -2955,7 +2955,7 @@ void XclExpChAxis::Convert( Reference< XAxis > const & xAxis, Reference< XAxis >
ScfPropertySet aCrossingProp( xCrossingAxis );
if( bCategoryAxis )
{
- mxLabelRange.reset( new XclExpChLabelRange( GetChRoot() ) );
+ mxLabelRange = std::make_shared<XclExpChLabelRange>( GetChRoot() );
mxLabelRange->SetTicksBetweenCateg( rTypeInfo.mbTicksBetweenCateg );
if( xAxis.is() )
{
@@ -2969,7 +2969,7 @@ void XclExpChAxis::Convert( Reference< XAxis > const & xAxis, Reference< XAxis >
}
else
{
- mxValueRange.reset( new XclExpChValueRange( GetChRoot() ) );
+ mxValueRange = std::make_shared<XclExpChValueRange>( GetChRoot() );
if( xAxis.is() )
mxValueRange->Convert( xAxis->getScaleData() );
// get position of crossing axis on this axis from passed axis object
@@ -2980,7 +2980,7 @@ void XclExpChAxis::Convert( Reference< XAxis > const & xAxis, Reference< XAxis >
// axis caption text ------------------------------------------------------
// axis ticks properties
- mxTick.reset( new XclExpChTick( GetChRoot() ) );
+ mxTick = std::make_shared<XclExpChTick>( GetChRoot() );
mxTick->Convert( aAxisProp, rTypeInfo, GetAxisType() );
// axis label formatting and rotation
@@ -3117,7 +3117,7 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > const & xDiagram, sal
const Sequence< Reference< XChartType > > aChartTypeSeq = xChartTypeCont->getChartTypes();
for( const Reference< XChartType >& rChartType : aChartTypeSeq )
{
- XclExpChTypeGroupRef xTypeGroup( new XclExpChTypeGroup( GetChRoot(), nGroupIdx ) );
+ XclExpChTypeGroupRef xTypeGroup = std::make_shared<XclExpChTypeGroup>( GetChRoot(), nGroupIdx );
xTypeGroup->ConvertType( xDiagram, rChartType, nApiAxesSetIdx, b3dChart, bSwappedAxesSet, bHasXLabels );
/* If new chart type group cannot be inserted into a combination
chart with existing type groups, insert all series into last
@@ -3205,7 +3205,7 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > const & xDiagram, sal
// the CHAXESSET record contains the inner plot area
maData.maRect = CalcChartRectFromHmm( xPositioning->calculateDiagramPositionExcludingAxes() );
// the embedded CHFRAMEPOS record contains the outer plot area
- mxFramePos.reset( new XclExpChFramePos( EXC_CHFRAMEPOS_PARENT ) );
+ mxFramePos = std::make_shared<XclExpChFramePos>( EXC_CHFRAMEPOS_PARENT );
// for pie charts, always use inner plot area size to exclude the data labels as Excel does
const XclExpChTypeGroup* pFirstTypeGroup = GetFirstTypeGroup().get();
bool bPieChart = pFirstTypeGroup && (pFirstTypeGroup->GetTypeInfo().meTypeCateg == EXC_CHTYPECATEG_PIE);
@@ -3260,7 +3260,7 @@ void XclExpChAxesSet::ConvertAxis(
sal_Int32 nCrossingAxisDim )
{
// create and convert axis object
- rxChAxis.reset( new XclExpChAxis( GetChRoot(), nAxisType ) );
+ rxChAxis = std::make_shared<XclExpChAxis>( GetChRoot(), nAxisType );
sal_Int32 nApiAxisDim = rxChAxis->GetApiAxisDimension();
sal_Int32 nApiAxesSetIdx = GetApiAxesSetIndex();
Reference< XAxis > xAxis = lclGetApiAxis( xCoordSystem, nApiAxisDim, nApiAxesSetIdx );
@@ -3313,8 +3313,8 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
maProps.mnEmptyMode = EXC_CHPROPS_EMPTY_SKIP;
// always create both axes set objects
- mxPrimAxesSet.reset( new XclExpChAxesSet( GetChRoot(), EXC_CHAXESSET_PRIMARY ) );
- mxSecnAxesSet.reset( new XclExpChAxesSet( GetChRoot(), EXC_CHAXESSET_SECONDARY ) );
+ mxPrimAxesSet = std::make_shared<XclExpChAxesSet>( GetChRoot(), EXC_CHAXESSET_PRIMARY );
+ mxSecnAxesSet = std::make_shared<XclExpChAxesSet>( GetChRoot(), EXC_CHAXESSET_SECONDARY );
if( xChartDoc.is() )
{
@@ -3369,7 +3369,7 @@ XclExpChSeriesRef XclExpChChart::CreateSeries()
sal_uInt16 nSeriesIdx = static_cast< sal_uInt16 >( maSeries.GetSize() );
if( nSeriesIdx <= EXC_CHSERIES_MAXSERIES )
{
- xSeries.reset( new XclExpChSeries( GetChRoot(), nSeriesIdx ) );
+ xSeries = std::make_shared<XclExpChSeries>( GetChRoot(), nSeriesIdx );
maSeries.AppendRecord( xSeries );
}
return xSeries;
@@ -3437,7 +3437,7 @@ XclExpChartDrawing::XclExpChartDrawing( const XclExpRoot& rRoot,
/* Create a new independent object manager with own DFF stream for the
DGCONTAINER, pass global manager as parent for shared usage of
global DFF data (picture container etc.). */
- mxObjMgr.reset( new XclExpEmbeddedObjectManager( GetObjectManager(), rChartSize, EXC_CHART_TOTALUNITS, EXC_CHART_TOTALUNITS ) );
+ mxObjMgr = std::make_shared<XclExpEmbeddedObjectManager>( GetObjectManager(), rChartSize, EXC_CHART_TOTALUNITS, EXC_CHART_TOTALUNITS );
// initialize the drawing object list
mxObjMgr->StartSheet();
// process the draw page (convert all shapes)
diff --git a/sc/source/filter/excel/xedbdata.cxx b/sc/source/filter/excel/xedbdata.cxx
index 043c1791acf6..1417c444dc8e 100644
--- a/sc/source/filter/excel/xedbdata.cxx
+++ b/sc/source/filter/excel/xedbdata.cxx
@@ -128,10 +128,10 @@ void XclExpTablesManager::Initialize()
switch( GetBiff() )
{
case EXC_BIFF5:
- pNew.reset( new XclExpTablesImpl5( GetRoot()));
+ pNew = std::make_shared<XclExpTablesImpl5>( GetRoot());
break;
case EXC_BIFF8:
- pNew.reset( new XclExpTablesImpl8( GetRoot()));
+ pNew = std::make_shared<XclExpTablesImpl8>( GetRoot());
break;
default:
assert(!"Unknown BIFF type!");
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 5bb9d0bb61f8..aaa9396048bf 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1095,7 +1095,7 @@ XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape
css::awt::Rectangle aBoundRect;
aShapeProp.GetProperty( aBoundRect, "BoundRect" );
tools::Rectangle aChartRect( Point( aBoundRect.X, aBoundRect.Y ), Size( aBoundRect.Width, aBoundRect.Height ) );
- mxChart.reset( new XclExpChart( GetRoot(), xModel, aChartRect ) );
+ mxChart = std::make_shared<XclExpChart>( GetRoot(), xModel, aChartRect );
}
XclExpChartObj::~XclExpChartObj()
@@ -1468,14 +1468,14 @@ XclExpObjectManager::XclExpObjectManager( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot )
{
InitStream( true );
- mxEscherEx.reset( new XclEscherEx( GetRoot(), *this, *mxDffStrm ) );
+ mxEscherEx = std::make_shared<XclEscherEx>( GetRoot(), *this, *mxDffStrm );
}
XclExpObjectManager::XclExpObjectManager( const XclExpObjectManager& rParent ) :
XclExpRoot( rParent.GetRoot() )
{
InitStream( false );
- mxEscherEx.reset( new XclEscherEx( GetRoot(), *this, *mxDffStrm, rParent.mxEscherEx.get() ) );
+ mxEscherEx = std::make_shared<XclEscherEx>( GetRoot(), *this, *mxDffStrm, rParent.mxEscherEx.get() );
}
XclExpObjectManager::~XclExpObjectManager()
@@ -1494,7 +1494,7 @@ std::shared_ptr< XclExpRecordBase > XclExpObjectManager::CreateDrawingGroup()
void XclExpObjectManager::StartSheet()
{
- mxObjList.reset( new XclExpObjList( GetRoot(), *mxEscherEx ) );
+ mxObjList = std::make_shared<XclExpObjList>( GetRoot(), *mxEscherEx );
}
std::shared_ptr< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( const SdrPage* pSdrPage )
@@ -1550,7 +1550,7 @@ void XclExpObjectManager::InitStream( bool bTempFile )
{
if( bTempFile )
{
- mxTempFile.reset( new ::utl::TempFile );
+ mxTempFile = std::make_shared<::utl::TempFile>();
if( mxTempFile->IsValid() )
{
mxTempFile->EnableKillingFile();
@@ -1559,7 +1559,7 @@ void XclExpObjectManager::InitStream( bool bTempFile )
}
if( !mxDffStrm.get() )
- mxDffStrm.reset( new SvMemoryStream );
+ mxDffStrm = std::make_shared<SvMemoryStream>();
mxDffStrm->SetEndian( SvStreamEndian::LITTLE );
}
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index a0e82fd160d6..f39ee5283fdf 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -167,7 +167,7 @@ XclExpFuncData::XclExpFuncData( const XclExpScToken& rTokData,
mrTokData( rTokData ),
mrFuncInfo( rFuncInfo ),
maExtFuncData( rExtFuncData ),
- mxOperands( new XclExpOperandList ),
+ mxOperands( std::make_shared<XclExpOperandList>() ),
mpParamInfo( rFuncInfo.mpParamInfos )
{
OSL_ENSURE( mrTokData.mpScToken, "XclExpFuncData::XclExpFuncData - missing core token" );
@@ -570,7 +570,7 @@ void XclExpFmlaCompImpl::Init( XclFormulaType eType )
if( mxData.get() )
maDataStack.push_back( mxData );
// new compiler working data structure
- mxData.reset( new XclExpCompData( GetConfigForType( eType ) ) );
+ mxData = std::make_shared<XclExpCompData>( GetConfigForType( eType ) );
}
void XclExpFmlaCompImpl::Init( XclFormulaType eType, const ScTokenArray& rScTokArr,
@@ -779,7 +779,7 @@ XclTokenArrayRef XclExpFmlaCompImpl::CreateTokenArray()
OSL_ENSURE( mxData->mrCfg.mbAllowArrays || mxData->maExtDataVec.empty(), "XclExpFmlaCompImpl::CreateTokenArray - unexpected extended data" );
if( !mxData->mrCfg.mbAllowArrays )
mxData->maExtDataVec.clear();
- XclTokenArrayRef xTokArr( new XclTokenArray( mxData->maTokVec, mxData->maExtDataVec, mxData->mbVolatile ) );
+ XclTokenArrayRef xTokArr = std::make_shared<XclTokenArray>( mxData->maTokVec, mxData->maExtDataVec, mxData->mbVolatile );
mxData.reset();
// compiler invoked recursively? - restore old working data
@@ -1101,7 +1101,7 @@ XclExpScToken XclExpFmlaCompImpl::ListTerm( XclExpScToken aTokData, bool bInPare
mxData->maTokVec[ nSubExprPos ] = GetTokenId( EXC_TOKID_MEMFUNC, EXC_TOKCLASS_REF );
Overwrite( nSubExprPos + 1, nSubExprSize );
// update the operand/operator stack (set the list expression as operand of the tMemFunc)
- XclExpOperandListRef xOperands( new XclExpOperandList );
+ XclExpOperandListRef xOperands = std::make_shared<XclExpOperandList>();
xOperands->AppendOperand( PopOperandPos(), EXC_PARAMCONV_VAL, false );
PushOperatorPos( nSubExprPos, xOperands );
}
@@ -2406,14 +2406,14 @@ void XclExpFmlaCompImpl::AppendOperatorTokenId( sal_uInt8 nTokenId, const XclExp
void XclExpFmlaCompImpl::AppendUnaryOperatorToken( sal_uInt8 nTokenId, sal_uInt8 nSpaces )
{
- XclExpOperandListRef xOperands( new XclExpOperandList );
+ XclExpOperandListRef xOperands = std::make_shared<XclExpOperandList>();
xOperands->AppendOperand( PopOperandPos(), EXC_PARAMCONV_RPO, true );
AppendOperatorTokenId( nTokenId, xOperands, nSpaces );
}
void XclExpFmlaCompImpl::AppendBinaryOperatorToken( sal_uInt8 nTokenId, bool bValType, sal_uInt8 nSpaces )
{
- XclExpOperandListRef xOperands( new XclExpOperandList );
+ XclExpOperandListRef xOperands = std::make_shared<XclExpOperandList>();
xOperands->AppendOperand( PopOperandPos(), EXC_PARAMCONV_RPO, bValType );
xOperands->AppendOperand( PopOperandPos(), EXC_PARAMCONV_RPO, bValType );
AppendOperatorTokenId( nTokenId, xOperands, nSpaces );
@@ -2421,7 +2421,7 @@ void XclExpFmlaCompImpl::AppendBinaryOperatorToken( sal_uInt8 nTokenId, bool bVa
void XclExpFmlaCompImpl::AppendLogicalOperatorToken( sal_uInt16 nXclFuncIdx, sal_uInt8 nOpCount )
{
- XclExpOperandListRef xOperands( new XclExpOperandList );
+ XclExpOperandListRef xOperands = std::make_shared<XclExpOperandList>();
for( sal_uInt8 nOpIdx = 0; nOpIdx < nOpCount; ++nOpIdx )
xOperands->AppendOperand( PopOperandPos(), EXC_PARAMCONV_RPX, false );
AppendOperatorTokenId( GetTokenId( EXC_TOKID_FUNCVAR, EXC_TOKCLASS_VAL ), xOperands );
@@ -2597,7 +2597,7 @@ void lclPutRangeToTokenArray( ScTokenArray& rScTokArr, const ScRange& rScRange,
XclExpFormulaCompiler::XclExpFormulaCompiler( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot ),
- mxImpl( new XclExpFmlaCompImpl( rRoot ) )
+ mxImpl( std::make_shared<XclExpFmlaCompImpl>( rRoot ) )
{
}
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index 409893e7c68c..b218b128b195 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -308,7 +308,7 @@ OUString XclExpHyperlinkHelper::ProcessUrlField( const SvxURLField& rUrlField )
// there was/is already a HLINK record
mbMultipleUrls = static_cast< bool >(mxLinkRec);
- mxLinkRec.reset( new XclExpHyperlink( GetRoot(), rUrlField, maScPos ) );
+ mxLinkRec = std::make_shared<XclExpHyperlink>( GetRoot(), rUrlField, maScPos );
if( const OUString* pRepr = mxLinkRec->GetRepr() )
aUrlRepr = *pRepr;
@@ -526,7 +526,7 @@ XclExpStringRef lclCreateFormattedString(
XclExpStringRef XclExpStringHelper::CreateString(
const XclExpRoot& rRoot, const OUString& rString, XclStrFlags nFlags, sal_uInt16 nMaxLen )
{
- XclExpStringRef xString( new XclExpString );
+ XclExpStringRef xString = std::make_shared<XclExpString>();
if( rRoot.GetBiff() == EXC_BIFF8 )
xString->Assign( rString, nFlags, nMaxLen );
else
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index 542e7ba9bd0e..a01448708cd2 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -957,7 +957,7 @@ XclExpExtNameDde::XclExpExtNameDde( const XclExpRoot& rRoot,
{
if( pResults )
{
- mxMatrix.reset( new XclExpCachedMatrix( *pResults ) );
+ mxMatrix = std::make_shared<XclExpCachedMatrix>( *pResults );
AddRecSize( mxMatrix->GetSize() );
}
}
@@ -1442,7 +1442,7 @@ XclExpExternSheetBase::XclExpExternSheetBase( const XclExpRoot& rRoot, sal_uInt1
XclExpExtNameBuffer& XclExpExternSheetBase::GetExtNameBuffer()
{
if( !mxExtNameBfr )
- mxExtNameBfr.reset( new XclExpExtNameBuffer( GetRoot() ) );
+ mxExtNameBfr = std::make_shared<XclExpExtNameBuffer>( GetRoot() );
return *mxExtNameBfr;
}
@@ -1628,7 +1628,7 @@ sal_uInt16 XclExpSupbook::InsertTabName( const OUString& rTabName, ScExternalRef
{
SAL_WARN_IF( meType != XclSupbookType::Extern, "sc.filter", "Don't insert sheet names here" );
sal_uInt16 nSBTab = ulimit_cast< sal_uInt16 >( maXctList.GetSize() );
- XclExpXctRef xXct( new XclExpXct( GetRoot(), rTabName, nSBTab, xCacheTable ) );
+ XclExpXctRef xXct = std::make_shared<XclExpXct>( GetRoot(), rTabName, nSBTab, xCacheTable );
AddRecSize( xXct->GetTabName().GetSize() );
maXctList.AppendRecord( xXct );
return nSBTab;
@@ -1782,7 +1782,7 @@ XclExpSupbookBuffer::XclExpSupbookBuffer( const XclExpRoot& rRoot ) :
maSBIndexVec.resize( nCount );
// self-ref SUPBOOK first of list
- XclExpSupbookRef xSupbook( new XclExpSupbook( GetRoot(), ::std::max( nXclCnt, nCodeCnt ) ) );
+ XclExpSupbookRef xSupbook = std::make_shared<XclExpSupbook>( GetRoot(), ::std::max( nXclCnt, nCodeCnt ) );
mnOwnDocSB = Append( xSupbook );
for( sal_uInt16 nXclTab = 0; nXclTab < nXclCnt; ++nXclTab )
maSBIndexVec[ nXclTab ].Set( mnOwnDocSB, nXclTab );
@@ -1875,7 +1875,7 @@ void XclExpSupbookBuffer::StoreCell( sal_uInt16 nFileId, const OUString& rTabNam
sal_uInt16 nSupbookId;
if (!GetSupbookUrl(xSupbook, nSupbookId, *pUrl))
{
- xSupbook.reset(new XclExpSupbook(GetRoot(), *pUrl));
+ xSupbook = std::make_shared<XclExpSupbook>(GetRoot(), *pUrl);
nSupbookId = Append(xSupbook);
}
@@ -1907,7 +1907,7 @@ void XclExpSupbookBuffer::StoreCellRange( sal_uInt16 nFileId, const OUString& rT
sal_uInt16 nSupbookId;
if (!GetSupbookUrl(xSupbook, nSupbookId, *pUrl))
{
- xSupbook.reset(new XclExpSupbook(GetRoot(), *pUrl));
+ xSupbook = std::make_shared<XclExpSupbook>(GetRoot(), *pUrl);
nSupbookId = Append(xSupbook);
}
@@ -1967,7 +1967,7 @@ bool XclExpSupbookBuffer::InsertAddIn(
XclExpSupbookRef xSupbook;
if( mnAddInSB == SAL_MAX_UINT16 )
{
- xSupbook.reset( new XclExpSupbook( GetRoot() ) );
+ xSupbook = std::make_shared<XclExpSupbook>( GetRoot() );
mnAddInSB = Append( xSupbook );
}
else
@@ -1985,7 +1985,7 @@ bool XclExpSupbookBuffer::InsertEuroTool(
OUString aUrl( "\001\010EUROTOOL.XLA" );
if( !GetSupbookUrl( xSupbook, rnSupbook, aUrl ) )
{
- xSupbook.reset( new XclExpSupbook( GetRoot(), aUrl, XclSupbookType::Eurotool ) );
+ xSupbook = std::make_shared<XclExpSupbook>( GetRoot(), aUrl, XclSupbookType::Eurotool );
rnSupbook = Append( xSupbook );
}
rnExtName = xSupbook->InsertEuroTool( rName );
@@ -1999,7 +1999,7 @@ bool XclExpSupbookBuffer::InsertDde(
XclExpSupbookRef xSupbook;
if( !GetSupbookDde( xSupbook, rnSupbook, rApplic, rTopic ) )
{
- xSupbook.reset( new XclExpSupbook( GetRoot(), rApplic, rTopic ) );
+ xSupbook = std::make_shared<XclExpSupbook>( GetRoot(), rApplic, rTopic );
rnSupbook = Append( xSupbook );
}
rnExtName = xSupbook->InsertDde( rItem );
@@ -2013,7 +2013,7 @@ bool XclExpSupbookBuffer::InsertExtName(
XclExpSupbookRef xSupbook;
if (!GetSupbookUrl(xSupbook, rnSupbook, rUrl))
{
- xSupbook.reset( new XclExpSupbook(GetRoot(), rUrl) );
+ xSupbook = std::make_shared<XclExpSupbook>(GetRoot(), rUrl);
rnSupbook = Append(xSupbook);
}
rnExtName = xSupbook->InsertExtName(rName, rArray);
@@ -2033,7 +2033,7 @@ XclExpXti XclExpSupbookBuffer::GetXti( sal_uInt16 nFileId, const OUString& rTabN
sal_uInt16 nSupbookId;
if (!GetSupbookUrl(xSupbook, nSupbookId, *pUrl))
{
- xSupbook.reset(new XclExpSupbook(GetRoot(), *pUrl));
+ xSupbook = std::make_shared<XclExpSupbook>(GetRoot(), *pUrl);
nSupbookId = Append(xSupbook);
}
aXti.mnSupbook = nSupbookId;
@@ -2306,9 +2306,9 @@ void XclExpLinkManagerImpl5::CreateInternal()
{
XclExpExtSheetRef xRec;
if( nScTab == GetCurrScTab() )
- xRec.reset( new XclExpExternSheet( GetRoot(), EXC_EXTSH_OWNTAB ) );
+ xRec = std::make_shared<XclExpExternSheet>( GetRoot(), EXC_EXTSH_OWNTAB );
else
- xRec.reset( new XclExpExternSheet( GetRoot(), rTabInfo.GetScTabName( nScTab ) ) );
+ xRec = std::make_shared<XclExpExternSheet>( GetRoot(), rTabInfo.GetScTabName( nScTab ) );
maIntTabMap[ nScTab ] = AppendInternal( xRec );
}
}
@@ -2350,7 +2350,7 @@ XclExpLinkManagerImpl5::XclExpExtSheetRef XclExpLinkManagerImpl5::FindInternal(
XclExpCodeMap::const_iterator aIt = maCodeMap.find( cCode );
if( aIt == maCodeMap.end() )
{
- xExtSheet.reset( new XclExpExternSheet( GetRoot(), cCode ) );
+ xExtSheet = std::make_shared<XclExpExternSheet>( GetRoot(), cCode );
rnExtSheet = maCodeMap[ cCode ] = AppendInternal( xExtSheet );
}
else
@@ -2532,10 +2532,10 @@ XclExpLinkManager::XclExpLinkManager( const XclExpRoot& rRoot ) :
switch( GetBiff() )
{
case EXC_BIFF5:
- mxImpl.reset( new XclExpLinkManagerImpl5( rRoot ) );
+ mxImpl = std::make_shared<XclExpLinkManagerImpl5>( rRoot );
break;
case EXC_BIFF8:
- mxImpl.reset( new XclExpLinkManagerImpl8( rRoot ) );
+ mxImpl = std::make_shared<XclExpLinkManagerImpl8>( rRoot );
break;
default:
DBG_ERROR_BIFF();
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index 01b778eb044b..b65b9fb21ef1 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -447,7 +447,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertName( SCTAB nTab, sal_uInt16 nScNameIdx,
sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, const XclTokenArrayRef& xTokArr, const ScRange& aRange )
{
- XclExpNameRef xName( new XclExpName( GetRoot(), cBuiltIn ) );
+ XclExpNameRef xName = std::make_shared<XclExpName>( GetRoot(), cBuiltIn );
xName->SetTokenArray( xTokArr );
xName->SetLocalTab( aRange.aStart.Tab() );
OUString sSymbol(aRange.Format(GetDoc(), ScRefFlags::RANGE_ABS_3D, ScAddress::Details( ::formula::FormulaGrammar::CONV_XL_A1)));
@@ -457,7 +457,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, const
sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, const XclTokenArrayRef& xTokArr, SCTAB nScTab, const ScRangeList& rRangeList )
{
- XclExpNameRef xName( new XclExpName( GetRoot(), cBuiltIn ) );
+ XclExpNameRef xName = std::make_shared<XclExpName>( GetRoot(), cBuiltIn );
xName->SetTokenArray( xTokArr );
xName->SetLocalTab( nScTab );
OUString sSymbol;
@@ -470,7 +470,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertUniqueName(
const OUString& rName, const XclTokenArrayRef& xTokArr, SCTAB nScTab )
{
OSL_ENSURE( !rName.isEmpty(), "XclExpNameManagerImpl::InsertUniqueName - empty name" );
- XclExpNameRef xName( new XclExpName( GetRoot(), GetUnusedName( rName ) ) );
+ XclExpNameRef xName = std::make_shared<XclExpName>( GetRoot(), GetUnusedName( rName ) );
xName->SetTokenArray( xTokArr );
xName->SetLocalTab( nScTab );
return Append( xName );
@@ -491,7 +491,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertRawName( const OUString& rName )
}
// create a new NAME record
- XclExpNameRef xName( new XclExpName( GetRoot(), rName ) );
+ XclExpNameRef xName = std::make_shared<XclExpName>( GetRoot(), rName );
return Append( xName );
}
@@ -510,7 +510,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertMacroCall( const OUString& rMacroName, b
}
// create a new NAME record
- XclExpNameRef xName( new XclExpName( GetRoot(), rMacroName ) );
+ XclExpNameRef xName = std::make_shared<XclExpName>( GetRoot(), rMacroName );
xName->SetMacroCall( bVBasic, bFunc );
xName->SetHidden( bHidden );
@@ -616,7 +616,7 @@ sal_uInt16 XclExpNameManagerImpl::CreateName( SCTAB nTab, const ScRangeData& rRa
otherwise a recursive call of this function from the formula compiler
with the same defined name will not find it and will create it again. */
size_t nOldListSize = maNameList.GetSize();
- XclExpNameRef xName( new XclExpName( GetRoot(), rName ) );
+ XclExpNameRef xName = std::make_shared<XclExpName>( GetRoot(), rName );
if (nTab != SCTAB_GLOBAL)
xName->SetLocalTab(nTab);
sal_uInt16 nNameIdx = Append( xName );
@@ -785,7 +785,7 @@ void XclExpNameManagerImpl::CreateUserNames()
XclExpNameManager::XclExpNameManager( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot ),
- mxImpl( new XclExpNameManagerImpl( rRoot ) )
+ mxImpl( std::make_shared<XclExpNameManagerImpl>( rRoot ) )
{
}
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index 9f87bdffab42..33d0a8aa2200 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -766,8 +766,8 @@ void XclExpPivotCache::AddGroupFields( const ScDPObject& rDPObj )
while( pGroupDim )
{
// insert the new grouping field
- XclExpPCFieldRef xNewGroupField( new XclExpPCField(
- GetRoot(), GetFieldCount(), rDPObj, *pGroupDim, *pCurrStdField ) );
+ XclExpPCFieldRef xNewGroupField = std::make_shared<XclExpPCField>(
+ GetRoot(), GetFieldCount(), rDPObj, *pGroupDim, *pCurrStdField );
maFieldList.AppendRecord( xNewGroupField );
// register new grouping field at current grouping field, building a chain
@@ -1631,12 +1631,12 @@ void XclExpPivotTableManager::CreatePivotTables()
XclExpRecordRef XclExpPivotTableManager::CreatePivotCachesRecord()
{
- return XclExpRecordRef( new XclExpPivotRecWrapper( *this, EXC_PTMGR_PIVOTCACHES ) );
+ return std::make_shared<XclExpPivotRecWrapper>( *this, EXC_PTMGR_PIVOTCACHES );
}
XclExpRecordRef XclExpPivotTableManager::CreatePivotTablesRecord( SCTAB nScTab )
{
- return XclExpRecordRef( new XclExpPivotRecWrapper( *this, nScTab ) );
+ return std::make_shared<XclExpPivotRecWrapper>( *this, nScTab );
}
void XclExpPivotTableManager::WritePivotCaches( XclExpStream& rStrm )
@@ -1680,7 +1680,7 @@ const XclExpPivotCache* XclExpPivotTableManager::CreatePivotCache( const ScDPObj
// create a new pivot cache
sal_uInt16 nNewCacheIdx = static_cast< sal_uInt16 >( maPCacheList.GetSize() );
- XclExpPivotCacheRef xNewPCache( new XclExpPivotCache( GetRoot(), rDPObj, nNewCacheIdx ) );
+ XclExpPivotCacheRef xNewPCache = std::make_shared<XclExpPivotCache>( GetRoot(), rDPObj, nNewCacheIdx );
if( xNewPCache->IsValid() )
{
maPCacheList.AppendRecord( xNewPCache );
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx
index 15082d46a226..6032c72d1c11 100644
--- a/sc/source/filter/excel/xeroot.cxx
+++ b/sc/source/filter/excel/xeroot.cxx
@@ -181,10 +181,10 @@ XclExpTablesManager& XclExpRoot::GetTablesManager()
void XclExpRoot::InitializeConvert()
{
- mrExpData.mxTabInfo.reset( new XclExpTabInfo( GetRoot() ) );
- mrExpData.mxAddrConv.reset( new XclExpAddressConverter( GetRoot() ) );
- mrExpData.mxFmlaComp.reset( new XclExpFormulaCompiler( GetRoot() ) );
- mrExpData.mxProgress.reset( new XclExpProgressBar( GetRoot() ) );
+ mrExpData.mxTabInfo = std::make_shared<XclExpTabInfo>( GetRoot() );
+ mrExpData.mxAddrConv = std::make_shared<XclExpAddressConverter>( GetRoot() );
+ mrExpData.mxFmlaComp = std::make_shared<XclExpFormulaCompiler>( GetRoot() );
+ mrExpData.mxProgress = std::make_shared<XclExpProgressBar>( GetRoot() );
GetProgressBar().Initialize();
}
@@ -195,29 +195,29 @@ void XclExpRoot::InitializeGlobals()
if( GetBiff() >= EXC_BIFF5 )
{
- mrExpData.mxPalette.reset( new XclExpPalette( GetRoot() ) );
- mrExpData.mxFontBfr.reset( new XclExpFontBuffer( GetRoot() ) );
- mrExpData.mxNumFmtBfr.reset( new XclExpNumFmtBuffer( GetRoot() ) );
- mrExpData.mxXFBfr.reset( new XclExpXFBuffer( GetRoot() ) );
- mrExpData.mxGlobLinkMgr.reset( new XclExpLinkManager( GetRoot() ) );
- mrExpData.mxNameMgr.reset( new XclExpNameManager( GetRoot() ) );
+ mrExpData.mxPalette = std::make_shared<XclExpPalette>( GetRoot() );
+ mrExpData.mxFontBfr = std::make_shared<XclExpFontBuffer>( GetRoot() );
+ mrExpData.mxNumFmtBfr = std::make_shared<XclExpNumFmtBuffer>( GetRoot() );
+ mrExpData.mxXFBfr = std::make_shared<XclExpXFBuffer>( GetRoot() );
+ mrExpData.mxGlobLinkMgr = std::make_shared<XclExpLinkManager>( GetRoot() );
+ mrExpData.mxNameMgr = std::make_shared<XclExpNameManager>( GetRoot() );
}
if( GetBiff() == EXC_BIFF8 )
{
- mrExpData.mxSst.reset( new XclExpSst );
- mrExpData.mxObjMgr.reset( new XclExpObjectManager( GetRoot() ) );
- mrExpData.mxFilterMgr.reset( new XclExpFilterManager( GetRoot() ) );
- mrExpData.mxPTableMgr.reset( new XclExpPivotTableManager( GetRoot() ) );
+ mrExpData.mxSst = std::make_shared<XclExpSst>();
+ mrExpData.mxObjMgr = std::make_shared<XclExpObjectManager>( GetRoot() );
+ mrExpData.mxFilterMgr = std::make_shared<XclExpFilterManager>( GetRoot() );
+ mrExpData.mxPTableMgr = std::make_shared<XclExpPivotTableManager>( GetRoot() );
// BIFF8: only one link manager for all sheets
mrExpData.mxLocLinkMgr = mrExpData.mxGlobLinkMgr;
- mrExpData.mxDxfs.reset( new XclExpDxfs( GetRoot() ) );
+ mrExpData.mxDxfs = std::make_shared<XclExpDxfs>( GetRoot() );
}
if( GetOutput() == EXC_OUTPUT_XML_2007 )
{
- mrExpData.mxXmlPTableMgr.reset(new XclExpXmlPivotTableManager(GetRoot()));
- mrExpData.mxTablesMgr.reset(new XclExpTablesManager(GetRoot()));
+ mrExpData.mxXmlPTableMgr = std::make_shared<XclExpXmlPivotTableManager>(GetRoot());
+ mrExpData.mxTablesMgr = std::make_shared<XclExpTablesManager>(GetRoot());
do
{
@@ -266,7 +266,7 @@ void XclExpRoot::InitializeTable( SCTAB nScTab )
if( GetBiff() == EXC_BIFF5 )
{
// local link manager per sheet
- mrExpData.mxLocLinkMgr.reset( new XclExpLinkManager( GetRoot() ) );
+ mrExpData.mxLocLinkMgr = std::make_shared<XclExpLinkManager>( GetRoot() );
}
}
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index ccfa2cfc9634..c22773e1505a 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -1007,7 +1007,7 @@ bool XclExpXmlStream::exportDocument()
aData.maMaxPos.SetCol( ::std::min( aData.maScMaxPos.Col(), aData.maXclMaxPos.Col() ) );
aData.maMaxPos.SetRow( ::std::min( aData.maScMaxPos.Row(), aData.maXclMaxPos.Row() ) );
aData.maMaxPos.SetTab( ::std::min( aData.maScMaxPos.Tab(), aData.maXclMaxPos.Tab() ) );
- aData.mpCompileFormulaCxt.reset( new sc::CompileFormulaContext(&rDoc) );
+ aData.mpCompileFormulaCxt = std::make_shared<sc::CompileFormulaContext>(&rDoc);
// set target path to get correct relative links to target document, not source
INetURLObject aPath(getFileUrl());
aData.maBasePath = aPath.GetPath() + "\\";
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 353d8148327c..6bb80bf7dc9d 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -308,7 +308,7 @@ const sal_uInt32 EXC_PAL_MAXRAWSIZE = 1024;
XclExpPaletteImpl::XclExpPaletteImpl( const XclDefaultPalette& rDefPal ) :
mrDefPal( rDefPal ),
- mxColorList( new XclListColorList ),
+ mxColorList( std::make_shared<XclListColorList>() ),
mnLastIdx( 0 )
{
// initialize maPalette with default colors
@@ -565,7 +565,7 @@ void XclExpPaletteImpl::RawReducePalette( sal_uInt32 nPass )
*/
XclListColorListRef xOldList = mxColorList;
- mxColorList.reset( new XclListColorList );
+ mxColorList = std::make_shared<XclListColorList>();
// maps old list indexes to new list indexes, used to update maColorIdDataVec
ScfUInt32Vec aListIndexMap;
@@ -751,7 +751,7 @@ XclExpPalette::XclExpPalette( const XclExpRoot& rRoot ) :
XclDefaultPalette( rRoot ),
XclExpRecord( EXC_ID_PALETTE )
{
- mxImpl.reset( new XclExpPaletteImpl( *this ) );
+ mxImpl = std::make_shared<XclExpPaletteImpl>( *this );
SetRecSize( GetColorCount() * 4 + 2 );
}
@@ -1191,7 +1191,7 @@ sal_uInt16 XclExpFontBuffer::Insert(
{
if( bAppFont )
{
- XclExpFontRef xFont( new XclExpFont( GetRoot(), rFontData, eColorType ) );
+ XclExpFontRef xFont = std::make_shared<XclExpFont>( GetRoot(), rFontData, eColorType );
maFontList.ReplaceRecord( xFont, EXC_FONT_APP );
// set width of '0' character for column width export
SetCharWidth( xFont->GetFontData() );
@@ -1283,7 +1283,7 @@ void XclExpFontBuffer::InitDefaultFonts()
break;
case EXC_BIFF8:
{
- XclExpFontRef xFont( new XclExpFont( GetRoot(), aFontData, EXC_COLOR_CELLTEXT ) );
+ XclExpFontRef xFont = std::make_shared<XclExpFont>( GetRoot(), aFontData, EXC_COLOR_CELLTEXT );
maFontList.AppendRecord( xFont );
maFontList.AppendRecord( xFont );
maFontList.AppendRecord( xFont );
@@ -2770,7 +2770,7 @@ sal_uInt32 XclExpXFBuffer::InsertCellXF( const ScPatternAttr* pPattern, sal_Int1
auto it = std::find(rPositions.begin(), rPositions.end(), EXC_XF_DEFAULTCELL);
rPositions.erase(it);
// replace default cell pattern
- XclExpXFRef xNewXF( new XclExpXF( GetRoot(), *pPattern, nScript ) );
+ XclExpXFRef xNewXF = std::make_shared<XclExpXF>( GetRoot(), *pPattern, nScript );
maXFList.ReplaceRecord( xNewXF, EXC_XF_DEFAULTCELL );
// and add new entry in find-map
maXFFindMap[ToFindKey(*xNewXF)].push_back(EXC_XF_DEFAULTCELL);
@@ -2813,7 +2813,7 @@ sal_uInt32 XclExpXFBuffer::InsertStyleXF( const SfxStyleSheetBase& rStyleSheet )
if( nXFId == EXC_XFID_NOTFOUND )
{
// built-in style XF not yet created - do it now
- XclExpXFRef xXF( new XclExpXF( GetRoot(), rStyleSheet ) );
+ XclExpXFRef xXF = std::make_shared<XclExpXF>( GetRoot(), rStyleSheet );
nXFId = AppendBuiltInXFWithStyle( xXF, nStyleId, nLevel );
// this new XF record is not predefined
maBuiltInMap[ nXFId ].mbPredefined = false;
@@ -2924,7 +2924,7 @@ void XclExpXFBuffer::InsertDefaultRecords()
// index 0: default style
if( SfxStyleSheetBase* pDefStyleSheet = GetStyleSheetPool().Find( ScResId( STR_STYLENAME_STANDARD ), SfxStyleFamily::Para ) )
{
- XclExpXFRef xDefStyle( new XclExpXF( GetRoot(), *pDefStyleSheet ) );
+ XclExpXFRef xDefStyle = std::make_shared<XclExpXF>( GetRoot(), *pDefStyleSheet );
sal_uInt32 nXFId = AppendBuiltInXFWithStyle( xDefStyle, EXC_STYLE_NORMAL );
// mark this XF as not predefined, prevents overwriting
maBuiltInMap[ nXFId ].mbPredefined = false;
@@ -2932,7 +2932,7 @@ void XclExpXFBuffer::InsertDefaultRecords()
else
{
OSL_FAIL( "XclExpXFBuffer::InsertDefaultRecords - default style not found" );
- XclExpXFRef xDefStyle( new XclExpDefaultXF( GetRoot(), false ) );
+ XclExpXFRef xDefStyle = std::make_shared<XclExpDefaultXF>( GetRoot(), false );
xDefStyle->SetAllUsedFlags( true );
AppendBuiltInXFWithStyle( xDefStyle, EXC_STYLE_NORMAL );
}
@@ -2941,18 +2941,18 @@ void XclExpXFBuffer::InsertDefaultRecords()
XclExpDefaultXF aLevelStyle( GetRoot(), false );
// RowLevel_1, ColLevel_1
aLevelStyle.SetFont( 1 );
- AppendBuiltInXF( XclExpXFRef( new XclExpDefaultXF( aLevelStyle ) ), EXC_STYLE_ROWLEVEL, 0 );
- AppendBuiltInXF( XclExpXFRef( new XclExpDefaultXF( aLevelStyle ) ), EXC_STYLE_COLLEVEL, 0 );
+ AppendBuiltInXF( std::make_shared<XclExpDefaultXF>( aLevelStyle ), EXC_STYLE_ROWLEVEL, 0 );
+ AppendBuiltInXF( std::make_shared<XclExpDefaultXF>( aLevelStyle ), EXC_STYLE_COLLEVEL, 0 );
// RowLevel_2, ColLevel_2
aLevelStyle.SetFont( 2 );
- AppendBuiltInXF( XclExpXFRef( new XclExpDefaultXF( aLevelStyle ) ), EXC_STYLE_ROWLEVEL, 1 );
- AppendBuiltInXF( XclExpXFRef( new XclExpDefaultXF( aLevelStyle ) ), EXC_STYLE_COLLEVEL, 1 );
+ AppendBuiltInXF( std::make_shared<XclExpDefaultXF>( aLevelStyle ), EXC_STYLE_ROWLEVEL, 1 );
+ AppendBuiltInXF( std::make_shared<XclExpDefaultXF>( aLevelStyle ), EXC_STYLE_COLLEVEL, 1 );
// RowLevel_3, ColLevel_3 ... RowLevel_7, ColLevel_7
aLevelStyle.SetFont( 0 );
for( sal_uInt8 nLevel = 2; nLevel < EXC_STYLE_LEVELCOUNT; ++nLevel )
{
- AppendBuiltInXF( XclExpXFRef( new XclExpDefaultXF( aLevelStyle ) ), EXC_STYLE_ROWLEVEL, nLevel );
- AppendBuiltInXF( XclExpXFRef( new XclExpDefaultXF( aLevelStyle ) ), EXC_STYLE_COLLEVEL, nLevel );
+ AppendBuiltInXF( std::make_shared<XclExpDefaultXF>( aLevelStyle ), EXC_STYLE_ROWLEVEL, nLevel );
+ AppendBuiltInXF( std::make_shared<XclExpDefaultXF>( aLevelStyle ), EXC_STYLE_COLLEVEL, nLevel );
}
// index 15: default hard cell format, placeholder to be able to add more built-in styles
@@ -2964,15 +2964,15 @@ void XclExpXFBuffer::InsertDefaultRecords()
XclExpDefaultXF aFormatStyle( GetRoot(), false );
aFormatStyle.SetFont( 1 );
aFormatStyle.SetNumFmt( 43 );
- AppendBuiltInXFWithStyle( XclExpXFRef( new XclExpDefaultXF( aFormatStyle ) ), EXC_STYLE_COMMA );
+ AppendBuiltInXFWithStyle( std::make_shared<XclExpDefaultXF>( aFormatStyle ), EXC_STYLE_COMMA );
aFormatStyle.SetNumFmt( 41 );
- AppendBuiltInXFWithStyle( XclExpXFRef( new XclExpDefaultXF( aFormatStyle ) ), EXC_STYLE_COMMA_0 );
+ AppendBuiltInXFWithStyle( std::make_shared<XclExpDefaultXF>( aFormatStyle ), EXC_STYLE_COMMA_0 );
aFormatStyle.SetNumFmt( 44 );
- AppendBuiltInXFWithStyle( XclExpXFRef( new XclExpDefaultXF( aFormatStyle ) ), EXC_STYLE_CURRENCY );
+ AppendBuiltInXFWithStyle( std::make_shared<XclExpDefaultXF>( aFormatStyle ), EXC_STYLE_CURRENCY );
aFormatStyle.SetNumFmt( 42 );
- AppendBuiltInXFWithStyle( XclExpXFRef( new XclExpDefaultXF( aFormatStyle ) ), EXC_STYLE_CURRENCY_0 );
+ AppendBuiltInXFWithStyle( std::make_shared<XclExpDefaultXF>( aFormatStyle ), EXC_STYLE_CURRENCY_0 );
aFormatStyle.SetNumFmt( 9 );
- AppendBuiltInXFWithStyle( XclExpXFRef( new XclExpDefaultXF( aFormatStyle ) ), EXC_STYLE_PERCENT );
+ AppendBuiltInXFWithStyle( std::make_shared<XclExpDefaultXF>( aFormatStyle ), EXC_STYLE_PERCENT );
// other built-in style XF records (i.e. Hyperlink styles) are created on demand
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index e1f190d3c89b..259ed5031c3f 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -149,7 +149,7 @@ XclExpArrayRef XclExpArrayBuffer::CreateArray( const ScTokenArray& rScTokArr, co
OSL_ENSURE( maRecMap.find( rScPos ) == maRecMap.end(), "XclExpArrayBuffer::CreateArray - array exists already" );
XclExpArrayRef& rxRec = maRecMap[ rScPos ];
- rxRec.reset( new XclExpArray( xTokArr, rScRange ) );
+ rxRec = std::make_shared<XclExpArray>( xTokArr, rScRange );
return rxRec;
}
@@ -274,7 +274,7 @@ XclExpShrfmlaRef XclExpShrfmlaBuffer::CreateOrExtendShrfmla(
{
// create a new record
XclTokenArrayRef xTokArr = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_SHARED, *pShrdScTokArr, &rScPos );
- xRec.reset( new XclExpShrfmla( xTokArr, rScPos ) );
+ xRec = std::make_shared<XclExpShrfmla>( xTokArr, rScPos );
maRecMap[ pShrdScTokArr ] = xRec;
}
else
@@ -522,7 +522,7 @@ XclExpTableopRef XclExpTableopBuffer::TryCreate( const ScAddress& rScPos, const
XclExpTableopRef xRec;
if( bOk )
{
- xRec.reset( new XclExpTableop( rScPos, rRefs, nScMode ) );
+ xRec = std::make_shared<XclExpTableop>( rScPos, rRefs, nScMode );
maTableopList.AppendRecord( xRec );
}
@@ -1060,7 +1060,7 @@ void XclExpFormulaCell::WriteContents( XclExpStream& rStrm )
if( !aResult.isEmpty() || (rStrm.GetRoot().GetBiff() <= EXC_BIFF5) )
{
rStrm << EXC_FORMULA_RES_STRING;
- mxStringRec.reset( new XclExpStringRec( rStrm.GetRoot(), aResult ) );
+ mxStringRec = std::make_shared<XclExpStringRec>( rStrm.GetRoot(), aResult );
}
else
rStrm << EXC_FORMULA_RES_EMPTY; // BIFF8 only
@@ -1927,7 +1927,7 @@ void XclExpRow::Finalize( const ScfUInt16Vec& rColXFIndexes, bool bProgress )
if( nFirstFreeXclCol < nNextUsedXclCol )
{
aXFId.mnCount = nNextUsedXclCol - nFirstFreeXclCol;
- XclExpCellRef xNewCell( new XclExpBlankCell( XclAddress( nFirstFreeXclCol, mnXclRow ), aXFId ) );
+ XclExpCellRef xNewCell = std::make_shared<XclExpBlankCell>( XclAddress( nFirstFreeXclCol, mnXclRow ), aXFId );
// insert the cell, InsertCell() may merge it with existing BLANK records
InsertCell( xNewCell, nPos, false );
// insert default XF indexes into aXFIndexes
@@ -2416,7 +2416,7 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE
{
mnHighestOutlineLevel = maOutlineBfr.GetLevel();
}
- RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty, bHidden, nHeight));
+ RowRef p = std::make_shared<XclExpRow>(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty, bHidden, nHeight);
maRowMap.emplace(nFrom, p);
pPrevEntry = p;
}
@@ -2436,13 +2436,13 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
maArrayBfr( rRoot ),
maShrfmlaBfr( rRoot ),
maTableopBfr( rRoot ),
- mxDefrowheight( new XclExpDefrowheight ),
- mxGuts( new XclExpGuts( rRoot ) ),
- mxNoteList( new XclExpNoteList ),
- mxMergedcells( new XclExpMergedcells( rRoot ) ),
- mxHyperlinkList( new XclExpHyperlinkList ),
- mxDval( new XclExpDval( rRoot ) ),
- mxExtLst( new XclExtLst( rRoot ) )
+ mxDefrowheight( std::make_shared<XclExpDefrowheight>() ),
+ mxGuts( std::make_shared<XclExpGuts>( rRoot ) ),
+ mxNoteList( std::make_shared<XclExpNoteList>() ),
+ mxMergedcells( std::make_shared<XclExpMergedcells>( rRoot ) ),
+ mxHyperlinkList( std::make_shared<XclExpHyperlinkList>() ),
+ mxDval( std::make_shared<XclExpDval>( rRoot ) ),
+ mxExtLst( std::make_shared<XclExtLst>( rRoot ) )
{
ScDocument& rDoc = GetDoc();
SCTAB nScTab = GetCurrScTab();
@@ -2546,8 +2546,8 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
OUString aUrl = pPattern->GetItemSet().Get(ATTR_HYPERLINK).GetValue();
if (!aUrl.isEmpty())
{
- std::shared_ptr<XclExpHyperlink> aLink;
- aLink.reset(new XclExpHyperlink(GetRoot(), SvxURLField(aUrl, aUrl), aScPos));
+ std::shared_ptr<XclExpHyperlink> aLink =
+ std::make_shared<XclExpHyperlink>(GetRoot(), SvxURLField(aUrl, aUrl), aScPos);
mxHyperlinkList->AppendRecord(aLink);
}
}
@@ -2557,35 +2557,35 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
{
sal_uInt32 nScNumFmt = pPattern->GetItemSet().Get( ATTR_VALUE_FORMAT ).GetValue();
if( rFormatter.GetType( nScNumFmt ) == SvNumFormatType::LOGICAL )
- xCell.reset( new XclExpBooleanCell(
- GetRoot(), aXclPos, pPattern, nMergeBaseXFId, fValue != 0.0 ) );
+ xCell = std::make_shared<XclExpBooleanCell>(
+ GetRoot(), aXclPos, pPattern, nMergeBaseXFId, fValue != 0.0 );
}
// try to create an RK value (compressed floating-point number)
sal_Int32 nRkValue;
if( !xCell && XclTools::GetRKFromDouble( nRkValue, fValue ) )
- xCell.reset( new XclExpRkCell(
- GetRoot(), aXclPos, pPattern, nMergeBaseXFId, nRkValue ) );
+ xCell = std::make_shared<XclExpRkCell>(
+ GetRoot(), aXclPos, pPattern, nMergeBaseXFId, nRkValue );
// else: simple floating-point number cell
if( !xCell )
- xCell.reset( new XclExpNumberCell(
- GetRoot(), aXclPos, pPattern, nMergeBaseXFId, fValue ) );
+ xCell = std::make_shared<XclExpNumberCell>(
+ GetRoot(), aXclPos, pPattern, nMergeBaseXFId, fValue );
}
break;
case CELLTYPE_STRING:
{
- xCell.reset(new XclExpLabelCell(
- GetRoot(), aXclPos, pPattern, nMergeBaseXFId, rScCell.mpString->getString()));
+ xCell = std::make_shared<XclExpLabelCell>(
+ GetRoot(), aXclPos, pPattern, nMergeBaseXFId, rScCell.mpString->getString());
}
break;
case CELLTYPE_EDIT:
{
XclExpHyperlinkHelper aLinkHelper( GetRoot(), aScPos );
- xCell.reset(new XclExpLabelCell(
- GetRoot(), aXclPos, pPattern, nMergeBaseXFId, rScCell.mpEditText, aLinkHelper));
+ xCell = std::make_shared<XclExpLabelCell>(
+ GetRoot(), aXclPos, pPattern, nMergeBaseXFId, rScCell.mpEditText, aLinkHelper);
// add a single created HLINK record to the record list
if( aLinkHelper.HasLinkRecord() )
@@ -2603,15 +2603,15 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
OUString aUrl = pPattern->GetItemSet().Get(ATTR_HYPERLINK).GetValue();
if (!aUrl.isEmpty())
{
- std::shared_ptr<XclExpHyperlink> aLink;
- aLink.reset(new XclExpHyperlink(GetRoot(), SvxURLField(aUrl, aUrl), aScPos));
+ std::shared_ptr<XclExpHyperlink> aLink =
+ std::make_shared<XclExpHyperlink>(GetRoot(), SvxURLField(aUrl, aUrl), aScPos);
mxHyperlinkList->AppendRecord(aLink);
}
}
- xCell.reset(new XclExpFormulaCell(
+ xCell = std::make_shared<XclExpFormulaCell>(
GetRoot(), aXclPos, pPattern, nMergeBaseXFId,
- *rScCell.mpFormula, maArrayBfr, maShrfmlaBfr, maTableopBfr));
+ *rScCell.mpFormula, maArrayBfr, maShrfmlaBfr, maTableopBfr);
}
break;
@@ -2620,8 +2620,8 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
[[fallthrough]];
case CELLTYPE_NONE:
{
- xCell.reset( new XclExpBlankCell(
- GetRoot(), aXclPos, nLastXclCol, pPattern, nMergeBaseXFId ) );
+ xCell = std::make_shared<XclExpBlankCell>(
+ GetRoot(), aXclPos, nLastXclCol, pPattern, nMergeBaseXFId );
}
break;
}
@@ -2700,7 +2700,7 @@ XclExpRecordRef XclExpCellTable::CreateRecord( sal_uInt16 nRecId ) const
XclExpRecordRef xRec;
switch( nRecId )
{
- case EXC_ID3_DIMENSIONS: xRec.reset( new XclExpDelegatingRecord( &const_cast<XclExpRowBuffer*>(&maRowBfr)->GetDimensions() ) ); break;
+ case EXC_ID3_DIMENSIONS: xRec = std::make_shared<XclExpDelegatingRecord>( &const_cast<XclExpRowBuffer*>(&maRowBfr)->GetDimensions() ); break;
case EXC_ID2_DEFROWHEIGHT: xRec = mxDefrowheight; break;
case EXC_ID_GUTS: xRec = mxGuts; break;
case EXC_ID_NOTE: xRec = mxNoteList; break;
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 95de26eb643f..e8c1af46abc3 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -214,7 +214,7 @@ struct XclImpChRootData : public XclChRootData
XclImpChRoot::XclImpChRoot( const XclImpRoot& rRoot, XclImpChChart& rChartData ) :
XclImpRoot( rRoot ),
- mxChData( new XclImpChRootData( rChartData ) )
+ mxChData( std::make_shared<XclImpChRootData>( rChartData ) )
{
}
@@ -520,8 +520,8 @@ void XclImpChAreaFormat::Convert( const XclImpChRoot& rRoot,
XclImpChEscherFormat::XclImpChEscherFormat( const XclImpRoot& rRoot ) :
mnDffFillType( mso_fillSolid )
{
- maData.mxItemSet.reset(
- new SfxItemSet( rRoot.GetDoc().GetDrawLayer()->GetItemPool() ) );
+ maData.mxItemSet =
+ std::make_shared<SfxItemSet>( rRoot.GetDoc().GetDrawLayer()->GetItemPool() );
}
void XclImpChEscherFormat::ReadHeaderRecord( XclImpStream& rStrm )
@@ -561,22 +561,22 @@ XclImpChFrameBase::XclImpChFrameBase( const XclChFormatInfo& rFmtInfo )
if( rFmtInfo.mbCreateDefFrame ) switch( rFmtInfo.meDefFrameType )
{
case EXC_CHFRAMETYPE_AUTO:
- mxLineFmt.reset( new XclImpChLineFormat );
+ mxLineFmt = std::make_shared<XclImpChLineFormat>();
if( rFmtInfo.mbIsFrame )
- mxAreaFmt.reset( new XclImpChAreaFormat );
+ mxAreaFmt = std::make_shared<XclImpChAreaFormat>();
break;
case EXC_CHFRAMETYPE_INVISIBLE:
{
XclChLineFormat aLineFmt;
::set_flag( aLineFmt.mnFlags, EXC_CHLINEFORMAT_AUTO, false );
aLineFmt.mnPattern = EXC_CHLINEFORMAT_NONE;
- mxLineFmt.reset( new XclImpChLineFormat( aLineFmt ) );
+ mxLineFmt = std::make_shared<XclImpChLineFormat>( aLineFmt );
if( rFmtInfo.mbIsFrame )
{
XclChAreaFormat aAreaFmt;
::set_flag( aAreaFmt.mnFlags, EXC_CHAREAFORMAT_AUTO, false );
aAreaFmt.mnPattern = EXC_PATT_NONE;
- mxAreaFmt.reset( new XclImpChAreaFormat( aAreaFmt ) );
+ mxAreaFmt = std::make_shared<XclImpChAreaFormat>( aAreaFmt );
}
}
break;
@@ -590,15 +590,15 @@ void XclImpChFrameBase::ReadSubRecord( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
case EXC_ID_CHLINEFORMAT:
- mxLineFmt.reset( new XclImpChLineFormat );
+ mxLineFmt = std::make_shared<XclImpChLineFormat>();
mxLineFmt->ReadChLineFormat( rStrm );
break;
case EXC_ID_CHAREAFORMAT:
- mxAreaFmt.reset( new XclImpChAreaFormat );
+ mxAreaFmt = std::make_shared<XclImpChAreaFormat>();
mxAreaFmt->ReadChAreaFormat( rStrm );
break;
case EXC_ID_CHESCHERFORMAT:
- mxEscherFmt.reset( new XclImpChEscherFormat( rStrm.GetRoot() ) );
+ mxEscherFmt = std::make_shared<XclImpChEscherFormat>( rStrm.GetRoot() );
mxEscherFmt->ReadRecordGroup( rStrm );
break;
}
@@ -675,7 +675,7 @@ void XclImpChFrame::UpdateObjFrame( const XclObjLineData& rLineData, const XclOb
default: aLineFmt.mnWeight = EXC_CHLINEFORMAT_HAIR;
}
::set_flag( aLineFmt.mnFlags, EXC_CHLINEFORMAT_AUTO, rLineData.IsAuto() );
- mxLineFmt.reset( new XclImpChLineFormat( aLineFmt ) );
+ mxLineFmt = std::make_shared<XclImpChLineFormat>( aLineFmt );
}
if( rFillData.IsFilled() && (!mxAreaFmt || !mxAreaFmt->HasArea()) && !mxEscherFmt )
@@ -686,7 +686,7 @@ void XclImpChFrame::UpdateObjFrame( const XclObjLineData& rLineData, const XclOb
aAreaFmt.maBackColor = rPal.GetColor( rFillData.mnBackColorIdx );
aAreaFmt.mnPattern = rFillData.mnPattern;
::set_flag( aAreaFmt.mnFlags, EXC_CHAREAFORMAT_AUTO, rFillData.IsAuto() );
- mxAreaFmt.reset( new XclImpChAreaFormat( aAreaFmt ) );
+ mxAreaFmt = std::make_shared<XclImpChAreaFormat>( aAreaFmt );
}
}
@@ -759,7 +759,7 @@ void XclImpChSourceLink::ReadChSourceLink( XclImpStream& rStrm )
// try to read a following CHSTRING record
if( (rStrm.GetNextRecId() == EXC_ID_CHSTRING) && rStrm.StartNextRecord() )
{
- mxString.reset( new XclImpString );
+ mxString = std::make_shared<XclImpString>();
rStrm.Ignore( 2 );
mxString->Read( rStrm, XclStrFlags::EightBitLength | XclStrFlags::SeparateFormats );
}
@@ -768,7 +768,7 @@ void XclImpChSourceLink::ReadChSourceLink( XclImpStream& rStrm )
void XclImpChSourceLink::SetString( const OUString& rString )
{
if( !mxString )
- mxString.reset( new XclImpString );
+ mxString = std::make_shared<XclImpString>();
mxString->SetText( rString );
}
@@ -970,11 +970,11 @@ void XclImpChText::ReadSubRecord( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
case EXC_ID_CHFRAMEPOS:
- mxFramePos.reset( new XclImpChFramePos );
+ mxFramePos = std::make_shared<XclImpChFramePos>();
mxFramePos->ReadChFramePos( rStrm );
break;
case EXC_ID_CHFONT:
- mxFont.reset( new XclImpChFont );
+ mxFont = std::make_shared<XclImpChFont>();
mxFont->ReadChFont( rStrm );
break;
case EXC_ID_CHFORMATRUNS:
@@ -982,11 +982,11 @@ void XclImpChText::ReadSubRecord( XclImpStream& rStrm )
XclImpString::ReadFormats( rStrm, maFormats );
break;
case EXC_ID_CHSOURCELINK:
- mxSrcLink.reset( new XclImpChSourceLink( GetChRoot() ) );
+ mxSrcLink = std::make_shared<XclImpChSourceLink>( GetChRoot() );
mxSrcLink->ReadChSourceLink( rStrm );
break;
case EXC_ID_CHFRAME:
- mxFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_TEXT ) );
+ mxFrame = std::make_shared<XclImpChFrame>( GetChRoot(), EXC_CHOBJTYPE_TEXT );
mxFrame->ReadRecordGroup( rStrm );
break;
case EXC_ID_CHOBJECTLINK:
@@ -1022,7 +1022,7 @@ sal_uInt16 XclImpChText::GetRotation() const
void XclImpChText::SetString( const OUString& rString )
{
if( !mxSrcLink )
- mxSrcLink.reset( new XclImpChSourceLink( GetChRoot() ) );
+ mxSrcLink = std::make_shared<XclImpChSourceLink>( GetChRoot() );
mxSrcLink->SetString( rString );
}
@@ -1221,7 +1221,7 @@ void XclImpChText::ReadChFrLabelProps( XclImpStream& rStrm )
{
if( GetBiff() == EXC_BIFF8 )
{
- mxLabelProps.reset( new XclChFrLabelProps );
+ mxLabelProps = std::make_shared<XclChFrLabelProps>();
sal_uInt16 nSepLen;
rStrm.Ignore( 12 );
mxLabelProps->mnFlags = rStrm.ReaduInt16();
@@ -1239,8 +1239,7 @@ void lclUpdateText( XclImpChTextRef& rxText, const XclImpChText* xDefText )
rxText->UpdateText( xDefText );
else if (xDefText)
{
- XclImpChTextRef xNew(new XclImpChText(*xDefText));
- rxText = xNew;
+ rxText = std::make_shared<XclImpChText>(*xDefText);
}
}
@@ -1398,23 +1397,23 @@ void XclImpChDataFormat::ReadSubRecord( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
case EXC_ID_CHMARKERFORMAT:
- mxMarkerFmt.reset( new XclImpChMarkerFormat );
+ mxMarkerFmt = std::make_shared<XclImpChMarkerFormat>();
mxMarkerFmt->ReadChMarkerFormat( rStrm );
break;
case EXC_ID_CHPIEFORMAT:
- mxPieFmt.reset( new XclImpChPieFormat );
+ mxPieFmt = std::make_shared<XclImpChPieFormat>();
mxPieFmt->ReadChPieFormat( rStrm );
break;
case EXC_ID_CHSERIESFORMAT:
- mxSeriesFmt.reset( new XclImpChSeriesFormat );
+ mxSeriesFmt = std::make_shared<XclImpChSeriesFormat>();
mxSeriesFmt->ReadChSeriesFormat( rStrm );
break;
case EXC_ID_CH3DDATAFORMAT:
- mx3dDataFmt.reset( new XclImpCh3dDataFormat );
+ mx3dDataFmt = std::make_shared<XclImpCh3dDataFormat>();
mx3dDataFmt->ReadCh3dDataFormat( rStrm );
break;
case EXC_ID_CHATTACHEDLABEL:
- mxAttLabel.reset( new XclImpChAttachedLabel( GetChRoot() ) );
+ mxAttLabel = std::make_shared<XclImpChAttachedLabel>( GetChRoot() );
mxAttLabel->ReadChAttachedLabel( rStrm );
break;
default:
@@ -1461,11 +1460,11 @@ void XclImpChDataFormat::UpdateSeriesFormat( const XclChExtTypeInfo& rTypeInfo,
/* Create missing but required formats. Existing line, area, and marker
format objects are needed to create automatic series formatting. */
if( !mxLineFmt )
- mxLineFmt.reset( new XclImpChLineFormat );
+ mxLineFmt = std::make_shared<XclImpChLineFormat>();
if( !mxAreaFmt && !mxEscherFmt )
- mxAreaFmt.reset( new XclImpChAreaFormat );
+ mxAreaFmt = std::make_shared<XclImpChAreaFormat>();
if( !mxMarkerFmt )
- mxMarkerFmt.reset( new XclImpChMarkerFormat );
+ mxMarkerFmt = std::make_shared<XclImpChMarkerFormat>();
// remove formats not used for the current chart type
RemoveUnusedFormats( rTypeInfo );
@@ -1502,7 +1501,7 @@ void XclImpChDataFormat::UpdatePointFormat( const XclChExtTypeInfo& rTypeInfo, c
void XclImpChDataFormat::UpdateTrendLineFormat()
{
if( !mxLineFmt )
- mxLineFmt.reset( new XclImpChLineFormat );
+ mxLineFmt = std::make_shared<XclImpChLineFormat>();
mxAreaFmt.reset();
mxEscherFmt.reset();
mxMarkerFmt.reset();
@@ -2107,7 +2106,7 @@ void XclImpChSeries::FillAllSourceLinks( ::std::vector< ScTokenRef >& rTokens )
void XclImpChSeries::ReadChSourceLink( XclImpStream& rStrm )
{
- XclImpChSourceLinkRef xSrcLink( new XclImpChSourceLink( GetChRoot() ) );
+ XclImpChSourceLinkRef xSrcLink = std::make_shared<XclImpChSourceLink>( GetChRoot() );
xSrcLink->ReadChSourceLink( rStrm );
switch( xSrcLink->GetDestType() )
{
@@ -2136,7 +2135,7 @@ void XclImpChSeries::ReadChSerParent( XclImpStream& rStrm )
void XclImpChSeries::ReadChSerTrendLine( XclImpStream& rStrm )
{
- XclImpChSerTrendLineRef xTrendLine( new XclImpChSerTrendLine( GetChRoot() ) );
+ XclImpChSerTrendLineRef xTrendLine = std::make_shared<XclImpChSerTrendLine>( GetChRoot() );
xTrendLine->ReadChSerTrendLine( rStrm );
maTrendLines.push_back( xTrendLine );
}
@@ -2151,7 +2150,7 @@ void XclImpChSeries::ReadChSerErrorBar( XclImpStream& rStrm )
XclImpChDataFormatRef XclImpChSeries::CreateDataFormat( sal_uInt16 nPointIdx, sal_uInt16 nFormatIdx )
{
- XclImpChDataFormatRef xDataFmt( new XclImpChDataFormat( GetChRoot() ) );
+ XclImpChDataFormatRef xDataFmt = std::make_shared<XclImpChDataFormat>( GetChRoot() );
xDataFmt->SetPointPos( XclChDataPointPos( mnSeriesIdx, nPointIdx ), nFormatIdx );
return xDataFmt;
}
@@ -2521,15 +2520,15 @@ void XclImpChLegend::ReadSubRecord( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
case EXC_ID_CHFRAMEPOS:
- mxFramePos.reset( new XclImpChFramePos );
+ mxFramePos = std::make_shared<XclImpChFramePos>();
mxFramePos->ReadChFramePos( rStrm );
break;
case EXC_ID_CHTEXT:
- mxText.reset( new XclImpChText( GetChRoot() ) );
+ mxText = std::make_shared<XclImpChText>( GetChRoot() );
mxText->ReadRecordGroup( rStrm );
break;
case EXC_ID_CHFRAME:
- mxFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_LEGEND ) );
+ mxFrame = std::make_shared<XclImpChFrame>( GetChRoot(), EXC_CHOBJTYPE_LEGEND );
mxFrame->ReadRecordGroup( rStrm );
break;
}
@@ -2539,7 +2538,7 @@ void XclImpChLegend::Finalize()
{
// legend default formatting differs in OOChart and Excel, missing frame means automatic
if( !mxFrame )
- mxFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_LEGEND ) );
+ mxFrame = std::make_shared<XclImpChFrame>( GetChRoot(), EXC_CHOBJTYPE_LEGEND );
// Update text formatting. If mxText is empty, the passed default text is used.
lclUpdateText( mxText, GetChartData().GetDefaultText( EXC_CHTEXTTYPE_LEGEND ) );
}
@@ -2678,11 +2677,11 @@ void XclImpChTypeGroup::ReadSubRecord( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
case EXC_ID_CHCHART3D:
- mxChart3d.reset( new XclImpChChart3d );
+ mxChart3d = std::make_shared<XclImpChChart3d>();
mxChart3d->ReadChChart3d( rStrm );
break;
case EXC_ID_CHLEGEND:
- mxLegend.reset( new XclImpChLegend( GetChRoot() ) );
+ mxLegend = std::make_shared<XclImpChLegend>( GetChRoot() );
mxLegend->ReadRecordGroup( rStrm );
break;
case EXC_ID_CHDEFAULTTEXT:
@@ -2845,7 +2844,7 @@ void XclImpChTypeGroup::ReadChChartLine( XclImpStream& rStrm )
void XclImpChTypeGroup::ReadChDataFormat( XclImpStream& rStrm )
{
// global series and data point format
- XclImpChDataFormatRef xDataFmt( new XclImpChDataFormat( GetChRoot() ) );
+ XclImpChDataFormatRef xDataFmt = std::make_shared<XclImpChDataFormat>( GetChRoot() );
xDataFmt->ReadRecordGroup( rStrm );
const XclChDataPointPos& rPos = xDataFmt->GetPointPos();
if( (rPos.mnSeriesIdx == 0) && (rPos.mnPointIdx == 0) &&
@@ -3242,27 +3241,27 @@ void XclImpChAxis::ReadSubRecord( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
case EXC_ID_CHLABELRANGE:
- mxLabelRange.reset( new XclImpChLabelRange( GetChRoot() ) );
+ mxLabelRange = std::make_shared<XclImpChLabelRange>( GetChRoot() );
mxLabelRange->ReadChLabelRange( rStrm );
break;
case EXC_ID_CHDATERANGE:
if( !mxLabelRange )
- mxLabelRange.reset( new XclImpChLabelRange( GetChRoot() ) );
+ mxLabelRange = std::make_shared<XclImpChLabelRange>( GetChRoot() );
mxLabelRange->ReadChDateRange( rStrm );
break;
case EXC_ID_CHVALUERANGE:
- mxValueRange.reset( new XclImpChValueRange( GetChRoot() ) );
+ mxValueRange = std::make_shared<XclImpChValueRange>( GetChRoot() );
mxValueRange->ReadChValueRange( rStrm );
break;
case EXC_ID_CHFORMAT:
mnNumFmtIdx = rStrm.ReaduInt16();
break;
case EXC_ID_CHTICK:
- mxTick.reset( new XclImpChTick( GetChRoot() ) );
+ mxTick = std::make_shared<XclImpChTick>( GetChRoot() );
mxTick->ReadChTick( rStrm );
break;
case EXC_ID_CHFONT:
- mxFont.reset( new XclImpChFont );
+ mxFont = std::make_shared<XclImpChFont>();
mxFont->ReadChFont( rStrm );
break;
case EXC_ID_CHAXISLINE:
@@ -3275,9 +3274,9 @@ void XclImpChAxis::Finalize()
{
// add default scaling, needed e.g. to adjust rotation direction of pie and radar charts
if( !mxLabelRange )
- mxLabelRange.reset( new XclImpChLabelRange( GetChRoot() ) );
+ mxLabelRange = std::make_shared<XclImpChLabelRange>( GetChRoot() );
if( !mxValueRange )
- mxValueRange.reset( new XclImpChValueRange( GetChRoot() ) );
+ mxValueRange = std::make_shared<XclImpChValueRange>( GetChRoot() );
// remove invisible grid lines completely
if( mxMajorGrid && !mxMajorGrid->HasLine() )
mxMajorGrid.reset();
@@ -3285,14 +3284,14 @@ void XclImpChAxis::Finalize()
mxMinorGrid.reset();
// default tick settings different in OOChart and Excel
if( !mxTick )
- mxTick.reset( new XclImpChTick( GetChRoot() ) );
+ mxTick = std::make_shared<XclImpChTick>( GetChRoot() );
// #i4140# different default axis line color
if( !mxAxisLine )
{
XclChLineFormat aLineFmt;
// set "show axis" flag, default if line format record is missing
::set_flag( aLineFmt.mnFlags, EXC_CHLINEFORMAT_SHOWAXIS );
- mxAxisLine.reset( new XclImpChLineFormat( aLineFmt ) );
+ mxAxisLine = std::make_shared<XclImpChLineFormat>( aLineFmt );
}
// add wall/floor frame for 3d charts
if( !mxWallFrame )
@@ -3491,7 +3490,7 @@ void XclImpChAxis::ReadChAxisLine( XclImpStream& rStrm )
{
if( pxLineFmt && (nRecId == EXC_ID_CHLINEFORMAT) )
{
- pxLineFmt->reset( new XclImpChLineFormat );
+ (*pxLineFmt) = std::make_shared<XclImpChLineFormat>();
(*pxLineFmt)->ReadChLineFormat( rStrm );
}
else if( bWallFrame && mxWallFrame )
@@ -3507,10 +3506,10 @@ void XclImpChAxis::CreateWallFrame()
switch( GetAxisType() )
{
case EXC_CHAXIS_X:
- mxWallFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_WALL3D ) );
+ mxWallFrame = std::make_shared<XclImpChFrame>( GetChRoot(), EXC_CHOBJTYPE_WALL3D );
break;
case EXC_CHAXIS_Y:
- mxWallFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_FLOOR3D ) );
+ mxWallFrame = std::make_shared<XclImpChFrame>( GetChRoot(), EXC_CHOBJTYPE_FLOOR3D );
break;
default:
mxWallFrame.reset();
@@ -3534,7 +3533,7 @@ void XclImpChAxesSet::ReadSubRecord( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
case EXC_ID_CHFRAMEPOS:
- mxFramePos.reset( new XclImpChFramePos );
+ mxFramePos = std::make_shared<XclImpChFramePos>();
mxFramePos->ReadChFramePos( rStrm );
break;
case EXC_ID_CHAXIS:
@@ -3573,11 +3572,11 @@ void XclImpChAxesSet::Finalize()
{
// always create missing axis objects
if( !mxXAxis )
- mxXAxis.reset( new XclImpChAxis( GetChRoot(), EXC_CHAXIS_X ) );
+ mxXAxis = std::make_shared<XclImpChAxis>( GetChRoot(), EXC_CHAXIS_X );
if( !mxYAxis )
- mxYAxis.reset( new XclImpChAxis( GetChRoot(), EXC_CHAXIS_Y ) );
+ mxYAxis = std::make_shared<XclImpChAxis>( GetChRoot(), EXC_CHAXIS_Y );
if( !mxZAxis && GetFirstTypeGroup()->Is3dDeepChart() )
- mxZAxis.reset( new XclImpChAxis( GetChRoot(), EXC_CHAXIS_Z ) );
+ mxZAxis = std::make_shared<XclImpChAxis>( GetChRoot(), EXC_CHAXIS_Z );
// finalize axes
if( mxXAxis ) mxXAxis->Finalize();
@@ -3593,7 +3592,7 @@ void XclImpChAxesSet::Finalize()
// #i47745# missing plot frame -> invisible border and area
if( !mxPlotFrame )
- mxPlotFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_PLOTFRAME ) );
+ mxPlotFrame = std::make_shared<XclImpChFrame>( GetChRoot(), EXC_CHOBJTYPE_PLOTFRAME );
}
}
@@ -3673,7 +3672,7 @@ void XclImpChAxesSet::ConvertTitlePositions() const
void XclImpChAxesSet::ReadChAxis( XclImpStream& rStrm )
{
- XclImpChAxisRef xAxis( new XclImpChAxis( GetChRoot() ) );
+ XclImpChAxisRef xAxis = std::make_shared<XclImpChAxis>( GetChRoot() );
xAxis->ReadRecordGroup( rStrm );
switch( xAxis->GetAxisType() )
@@ -3686,7 +3685,7 @@ void XclImpChAxesSet::ReadChAxis( XclImpStream& rStrm )
void XclImpChAxesSet::ReadChText( XclImpStream& rStrm )
{
- XclImpChTextRef xText( new XclImpChText( GetChRoot() ) );
+ XclImpChTextRef xText = std::make_shared<XclImpChText>( GetChRoot() );
xText->ReadRecordGroup( rStrm );
switch( xText->GetLinkTarget() )
@@ -3701,14 +3700,14 @@ void XclImpChAxesSet::ReadChPlotFrame( XclImpStream& rStrm )
{
if( (rStrm.GetNextRecId() == EXC_ID_CHFRAME) && rStrm.StartNextRecord() )
{
- mxPlotFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_PLOTFRAME ) );
+ mxPlotFrame = std::make_shared<XclImpChFrame>( GetChRoot(), EXC_CHOBJTYPE_PLOTFRAME );
mxPlotFrame->ReadRecordGroup( rStrm );
}
}
void XclImpChAxesSet::ReadChTypeGroup( XclImpStream& rStrm )
{
- XclImpChTypeGroupRef xTypeGroup( new XclImpChTypeGroup( GetChRoot() ) );
+ XclImpChTypeGroupRef xTypeGroup = std::make_shared<XclImpChTypeGroup>( GetChRoot() );
xTypeGroup->ReadRecordGroup( rStrm );
sal_uInt16 nGroupIdx = xTypeGroup->GetGroupIdx();
XclImpChTypeGroupMap::iterator itr = maTypeGroups.lower_bound(nGroupIdx);
@@ -3848,8 +3847,8 @@ void XclImpChAxesSet::ConvertBackground( Reference< XDiagram > const & xDiagram
XclImpChChart::XclImpChChart( const XclImpRoot& rRoot ) :
XclImpChRoot( rRoot, *this )
{
- mxPrimAxesSet.reset( new XclImpChAxesSet( GetChRoot(), EXC_CHAXESSET_PRIMARY ) );
- mxSecnAxesSet.reset( new XclImpChAxesSet( GetChRoot(), EXC_CHAXESSET_SECONDARY ) );
+ mxPrimAxesSet = std::make_shared<XclImpChAxesSet>( GetChRoot(), EXC_CHAXESSET_PRIMARY );
+ mxSecnAxesSet = std::make_shared<XclImpChAxesSet>( GetChRoot(), EXC_CHAXESSET_SECONDARY );
}
XclImpChChart::~XclImpChChart()
@@ -3867,7 +3866,7 @@ void XclImpChChart::ReadSubRecord( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
case EXC_ID_CHFRAME:
- mxFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_BACKGROUND ) );
+ mxFrame = std::make_shared<XclImpChFrame>( GetChRoot(), EXC_CHOBJTYPE_BACKGROUND );
mxFrame->ReadRecordGroup( rStrm );
break;
case EXC_ID_CHSERIES:
@@ -3904,7 +3903,7 @@ void XclImpChChart::ReadChDefaultText( XclImpStream& rStrm )
void XclImpChChart::ReadChDataFormat( XclImpStream& rStrm )
{
- XclImpChDataFormatRef xDataFmt( new XclImpChDataFormat( GetChRoot() ) );
+ XclImpChDataFormatRef xDataFmt = std::make_shared<XclImpChDataFormat>( GetChRoot() );
xDataFmt->ReadRecordGroup( rStrm );
if( xDataFmt->GetPointPos().mnSeriesIdx <= EXC_CHSERIES_MAXSERIES )
{
@@ -3923,7 +3922,7 @@ void XclImpChChart::ReadChDataFormat( XclImpStream& rStrm )
void XclImpChChart::UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData )
{
if( !mxFrame )
- mxFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_BACKGROUND ) );
+ mxFrame = std::make_shared<XclImpChFrame>( GetChRoot(), EXC_CHOBJTYPE_BACKGROUND );
mxFrame->UpdateObjFrame( rLineData, rFillData );
}
@@ -4062,7 +4061,7 @@ void XclImpChChart::Convert( const Reference<XChartDocument>& xChartDoc,
void XclImpChChart::ReadChSeries( XclImpStream& rStrm )
{
sal_uInt16 nNewSeriesIdx = static_cast< sal_uInt16 >( maSeries.size() );
- XclImpChSeriesRef xSeries( new XclImpChSeries( GetChRoot(), nNewSeriesIdx ) );
+ XclImpChSeriesRef xSeries = std::make_shared<XclImpChSeries>( GetChRoot(), nNewSeriesIdx );
xSeries->ReadRecordGroup( rStrm );
maSeries.push_back( xSeries );
}
@@ -4075,7 +4074,7 @@ void XclImpChChart::ReadChProperties( XclImpStream& rStrm )
void XclImpChChart::ReadChAxesSet( XclImpStream& rStrm )
{
- XclImpChAxesSetRef xAxesSet( new XclImpChAxesSet( GetChRoot(), EXC_CHAXESSET_NONE ) );
+ XclImpChAxesSetRef xAxesSet = std::make_shared<XclImpChAxesSet>( GetChRoot(), EXC_CHAXESSET_NONE );
xAxesSet->ReadRecordGroup( rStrm );
switch( xAxesSet->GetAxesSetId() )
{
@@ -4086,7 +4085,7 @@ void XclImpChChart::ReadChAxesSet( XclImpStream& rStrm )
void XclImpChChart::ReadChText( XclImpStream& rStrm )
{
- XclImpChTextRef xText( new XclImpChText( GetChRoot() ) );
+ XclImpChTextRef xText = std::make_shared<XclImpChText>( GetChRoot() );
xText->ReadRecordGroup( rStrm );
switch( xText->GetLinkTarget() )
{
@@ -4120,7 +4119,7 @@ void XclImpChChart::Finalize()
FinalizeDataFormats();
// #i47745# missing frame -> invisible border and area
if( !mxFrame )
- mxFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_BACKGROUND ) );
+ mxFrame = std::make_shared<XclImpChFrame>( GetChRoot(), EXC_CHOBJTYPE_BACKGROUND );
// chart title
FinalizeTitle();
}
@@ -4181,7 +4180,7 @@ void XclImpChChart::FinalizeTitle()
if( mxTitle || (!aAutoTitle.isEmpty()) )
{
if( !mxTitle )
- mxTitle.reset( new XclImpChText( GetChRoot() ) );
+ mxTitle = std::make_shared<XclImpChText>( GetChRoot() );
if( aAutoTitle.isEmpty() )
aAutoTitle = ScResId(STR_CHARTTITLE);
}
@@ -4366,7 +4365,7 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
void XclImpChart::UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData )
{
if( !mxChartData )
- mxChartData.reset( new XclImpChChart( GetRoot() ) );
+ mxChartData = std::make_shared<XclImpChChart>( GetRoot() );
mxChartData->UpdateObjFrame( rLineData, rFillData );
}
@@ -4392,13 +4391,13 @@ void XclImpChart::Convert( Reference< XModel > const & xModel, XclImpDffConverte
XclImpChartDrawing& XclImpChart::GetChartDrawing()
{
if( !mxChartDrawing )
- mxChartDrawing.reset( new XclImpChartDrawing( GetRoot(), mbOwnTab ) );
+ mxChartDrawing = std::make_shared<XclImpChartDrawing>( GetRoot(), mbOwnTab );
return *mxChartDrawing;
}
void XclImpChart::ReadChChart( XclImpStream& rStrm )
{
- mxChartData.reset( new XclImpChChart( GetRoot() ) );
+ mxChartData = std::make_shared<XclImpChChart>( GetRoot() );
mxChartData->ReadRecordGroup( rStrm );
}
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 2ab9dc703875..d37b40628be0 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -1098,7 +1098,7 @@ XclImpDecrypterRef lclReadFilepass5( XclImpStream& rStrm )
sal_uInt16 nKey(0), nHash(0);
nKey = rStrm.ReaduInt16();
nHash = rStrm.ReaduInt16();
- xDecr.reset( new XclImpBiff5Decrypter( nKey, nHash ) );
+ xDecr = std::make_shared<XclImpBiff5Decrypter>( nKey, nHash );
}
return xDecr;
}
@@ -1115,7 +1115,7 @@ XclImpDecrypterRef lclReadFilepass8_Standard( XclImpStream& rStrm )
rStrm.Read(aSalt.data(), 16);
rStrm.Read(aVerifier.data(), 16);
rStrm.Read(aVerifierHash.data(), 16);
- xDecr.reset(new XclImpBiff8StdDecrypter(aSalt, aVerifier, aVerifierHash));
+ xDecr = std::make_shared<XclImpBiff8StdDecrypter>(aSalt, aVerifier, aVerifierHash);
}
return xDecr;
}
@@ -1174,13 +1174,13 @@ XclImpDecrypterRef lclReadFilepass8_Strong(XclImpStream& rStream)
if (info.header.algIdHash != 0 && info.header.algIdHash != msfilter::ENCRYPT_HASH_SHA1)
return xDecr;
- xDecr.reset(new XclImpBiff8CryptoAPIDecrypter(
+ xDecr = std::make_shared<XclImpBiff8CryptoAPIDecrypter>(
std::vector<sal_uInt8>(info.verifier.salt,
info.verifier.salt + SAL_N_ELEMENTS(info.verifier.salt)),
std::vector<sal_uInt8>(info.verifier.encryptedVerifier,
info.verifier.encryptedVerifier + SAL_N_ELEMENTS(info.verifier.encryptedVerifier)),
std::vector<sal_uInt8>(info.verifier.encryptedVerifierHash,
- info.verifier.encryptedVerifierHash + SAL_N_ELEMENTS(info.verifier.encryptedVerifierHash))));
+ info.verifier.encryptedVerifierHash + SAL_N_ELEMENTS(info.verifier.encryptedVerifierHash)));
return xDecr;
}
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index c8478931c4e9..261a3052007a 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -195,15 +195,15 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj3( const XclImpRoot& rRoot, XclImpStr
nObjType = rStrm.ReaduInt16();
switch( nObjType )
{
- case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break;
- case EXC_OBJTYPE_LINE: xDrawObj.reset( new XclImpLineObj( rRoot ) ); break;
- case EXC_OBJTYPE_RECTANGLE: xDrawObj.reset( new XclImpRectObj( rRoot ) ); break;
- case EXC_OBJTYPE_OVAL: xDrawObj.reset( new XclImpOvalObj( rRoot ) ); break;
- case EXC_OBJTYPE_ARC: xDrawObj.reset( new XclImpArcObj( rRoot ) ); break;
- case EXC_OBJTYPE_CHART: xDrawObj.reset( new XclImpChartObj( rRoot ) ); break;
- case EXC_OBJTYPE_TEXT: xDrawObj.reset( new XclImpTextObj( rRoot ) ); break;
- case EXC_OBJTYPE_BUTTON: xDrawObj.reset( new XclImpButtonObj( rRoot ) ); break;
- case EXC_OBJTYPE_PICTURE: xDrawObj.reset( new XclImpPictureObj( rRoot ) ); break;
+ case EXC_OBJTYPE_GROUP: xDrawObj= std::make_shared<XclImpGroupObj>( rRoot ); break;
+ case EXC_OBJTYPE_LINE: xDrawObj= std::make_shared<XclImpLineObj>( rRoot ); break;
+ case EXC_OBJTYPE_RECTANGLE: xDrawObj= std::make_shared<XclImpRectObj>( rRoot ); break;
+ case EXC_OBJTYPE_OVAL: xDrawObj= std::make_shared<XclImpOvalObj>( rRoot ); break;
+ case EXC_OBJTYPE_ARC: xDrawObj= std::make_shared<XclImpArcObj>( rRoot ); break;
+ case EXC_OBJTYPE_CHART: xDrawObj= std::make_shared<XclImpChartObj>( rRoot ); break;
+ case EXC_OBJTYPE_TEXT: xDrawObj= std::make_shared<XclImpTextObj>( rRoot ); break;
+ case EXC_OBJTYPE_BUTTON: xDrawObj= std::make_shared<XclImpButtonObj>( rRoot ); break;
+ case EXC_OBJTYPE_PICTURE: xDrawObj= std::make_shared<XclImpPictureObj>( rRoot ); break;
default:
SAL_WARN("sc.filter", "XclImpDrawObjBase::ReadObj3 - unknown object type 0x" << std::hex << nObjType );
rRoot.GetTracer().TraceUnsupportedObjects();
@@ -212,7 +212,7 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj3( const XclImpRoot& rRoot, XclImpStr
if (!xDrawObj)
{
- xDrawObj.reset(new XclImpPhObj(rRoot));
+ xDrawObj = std::make_shared<XclImpPhObj>(rRoot);
}
xDrawObj->mnTab = rRoot.GetCurrScTab();
@@ -231,16 +231,16 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj4( const XclImpRoot& rRoot, XclImpStr
nObjType = rStrm.ReaduInt16();
switch( nObjType )
{
- case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break;
- case EXC_OBJTYPE_LINE: xDrawObj.reset( new XclImpLineObj( rRoot ) ); break;
- case EXC_OBJTYPE_RECTANGLE: xDrawObj.reset( new XclImpRectObj( rRoot ) ); break;
- case EXC_OBJTYPE_OVAL: xDrawObj.reset( new XclImpOvalObj( rRoot ) ); break;
- case EXC_OBJTYPE_ARC: xDrawObj.reset( new XclImpArcObj( rRoot ) ); break;
- case EXC_OBJTYPE_CHART: xDrawObj.reset( new XclImpChartObj( rRoot ) ); break;
- case EXC_OBJTYPE_TEXT: xDrawObj.reset( new XclImpTextObj( rRoot ) ); break;
- case EXC_OBJTYPE_BUTTON: xDrawObj.reset( new XclImpButtonObj( rRoot ) ); break;
- case EXC_OBJTYPE_PICTURE: xDrawObj.reset( new XclImpPictureObj( rRoot ) ); break;
- case EXC_OBJTYPE_POLYGON: xDrawObj.reset( new XclImpPolygonObj( rRoot ) ); break;
+ case EXC_OBJTYPE_GROUP: xDrawObj = std::make_shared<XclImpGroupObj>( rRoot ); break;
+ case EXC_OBJTYPE_LINE: xDrawObj = std::make_shared<XclImpLineObj>( rRoot ); break;
+ case EXC_OBJTYPE_RECTANGLE: xDrawObj = std::make_shared<XclImpRectObj>( rRoot ); break;
+ case EXC_OBJTYPE_OVAL: xDrawObj = std::make_shared<XclImpOvalObj>( rRoot ); break;
+ case EXC_OBJTYPE_ARC: xDrawObj = std::make_shared<XclImpArcObj>( rRoot ); break;
+ case EXC_OBJTYPE_CHART: xDrawObj = std::make_shared<XclImpChartObj>( rRoot ); break;
+ case EXC_OBJTYPE_TEXT: xDrawObj = std::make_shared<XclImpTextObj>( rRoot ); break;
+ case EXC_OBJTYPE_BUTTON: xDrawObj = std::make_shared<XclImpButtonObj>( rRoot ); break;
+ case EXC_OBJTYPE_PICTURE: xDrawObj = std::make_shared<XclImpPictureObj>( rRoot ); break;
+ case EXC_OBJTYPE_POLYGON: xDrawObj = std::make_shared<XclImpPolygonObj>( rRoot ); break;
default:
SAL_WARN("sc.filter", "XclImpDrawObjBase::ReadObj4 - unknown object type 0x" << std::hex << nObjType );
rRoot.GetTracer().TraceUnsupportedObjects();
@@ -249,7 +249,7 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj4( const XclImpRoot& rRoot, XclImpStr
if (!xDrawObj)
{
- xDrawObj.reset(new XclImpPhObj(rRoot));
+ xDrawObj = std::make_shared<XclImpPhObj>(rRoot);
}
xDrawObj->mnTab = rRoot.GetCurrScTab();
@@ -268,30 +268,30 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj5( const XclImpRoot& rRoot, XclImpStr
nObjType = rStrm.ReaduInt16();
switch( nObjType )
{
- case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break;
- case EXC_OBJTYPE_LINE: xDrawObj.reset( new XclImpLineObj( rRoot ) ); break;
- case EXC_OBJTYPE_RECTANGLE: xDrawObj.reset( new XclImpRectObj( rRoot ) ); break;
- case EXC_OBJTYPE_OVAL: xDrawObj.reset( new XclImpOvalObj( rRoot ) ); break;
- case EXC_OBJTYPE_ARC: xDrawObj.reset( new XclImpArcObj( rRoot ) ); break;
- case EXC_OBJTYPE_CHART: xDrawObj.reset( new XclImpChartObj( rRoot ) ); break;
- case EXC_OBJTYPE_TEXT: xDrawObj.reset( new XclImpTextObj( rRoot ) ); break;
- case EXC_OBJTYPE_BUTTON: xDrawObj.reset( new XclImpButtonObj( rRoot ) ); break;
- case EXC_OBJTYPE_PICTURE: xDrawObj.reset( new XclImpPictureObj( rRoot ) ); break;
- case EXC_OBJTYPE_POLYGON: xDrawObj.reset( new XclImpPolygonObj( rRoot ) ); break;
- case EXC_OBJTYPE_CHECKBOX: xDrawObj.reset( new XclImpCheckBoxObj( rRoot ) ); break;
- case EXC_OBJTYPE_OPTIONBUTTON: xDrawObj.reset( new XclImpOptionButtonObj( rRoot ) ); break;
- case EXC_OBJTYPE_EDIT: xDrawObj.reset( new XclImpEditObj( rRoot ) ); break;
- case EXC_OBJTYPE_LABEL: xDrawObj.reset( new XclImpLabelObj( rRoot ) ); break;
- case EXC_OBJTYPE_DIALOG: xDrawObj.reset( new XclImpDialogObj( rRoot ) ); break;
- case EXC_OBJTYPE_SPIN: xDrawObj.reset( new XclImpSpinButtonObj( rRoot ) ); break;
- case EXC_OBJTYPE_SCROLLBAR: xDrawObj.reset( new XclImpScrollBarObj( rRoot ) ); break;
- case EXC_OBJTYPE_LISTBOX: xDrawObj.reset( new XclImpListBoxObj( rRoot ) ); break;
- case EXC_OBJTYPE_GROUPBOX: xDrawObj.reset( new XclImpGroupBoxObj( rRoot ) ); break;
- case EXC_OBJTYPE_DROPDOWN: xDrawObj.reset( new XclImpDropDownObj( rRoot ) ); break;
+ case EXC_OBJTYPE_GROUP: xDrawObj = std::make_shared<XclImpGroupObj>( rRoot ); break;
+ case EXC_OBJTYPE_LINE: xDrawObj = std::make_shared<XclImpLineObj>( rRoot ); break;
+ case EXC_OBJTYPE_RECTANGLE: xDrawObj = std::make_shared<XclImpRectObj>( rRoot ); break;
+ case EXC_OBJTYPE_OVAL: xDrawObj = std::make_shared<XclImpOvalObj>( rRoot ); break;
+ case EXC_OBJTYPE_ARC: xDrawObj = std::make_shared<XclImpArcObj>( rRoot ); break;
+ case EXC_OBJTYPE_CHART: xDrawObj = std::make_shared<XclImpChartObj>( rRoot ); break;
+ case EXC_OBJTYPE_TEXT: xDrawObj = std::make_shared<XclImpTextObj>( rRoot ); break;
+ case EXC_OBJTYPE_BUTTON: xDrawObj = std::make_shared<XclImpButtonObj>( rRoot ); break;
+ case EXC_OBJTYPE_PICTURE: xDrawObj = std::make_shared<XclImpPictureObj>( rRoot ); break;
+ case EXC_OBJTYPE_POLYGON: xDrawObj = std::make_shared<XclImpPolygonObj>( rRoot ); break;
+ case EXC_OBJTYPE_CHECKBOX: xDrawObj = std::make_shared<XclImpCheckBoxObj>( rRoot ); break;
+ case EXC_OBJTYPE_OPTIONBUTTON: xDrawObj = std::make_shared<XclImpOptionButtonObj>( rRoot ); break;
+ case EXC_OBJTYPE_EDIT: xDrawObj = std::make_shared<XclImpEditObj>( rRoot ); break;
+ case EXC_OBJTYPE_LABEL: xDrawObj = std::make_shared<XclImpLabelObj>( rRoot ); break;
+ case EXC_OBJTYPE_DIALOG: xDrawObj = std::make_shared<XclImpDialogObj>( rRoot ); break;
+ case EXC_OBJTYPE_SPIN: xDrawObj = std::make_shared<XclImpSpinButtonObj>( rRoot ); break;
+ case EXC_OBJTYPE_SCROLLBAR: xDrawObj = std::make_shared<XclImpScrollBarObj>( rRoot ); break;
+ case EXC_OBJTYPE_LISTBOX: xDrawObj = std::make_shared<XclImpListBoxObj>( rRoot ); break;
+ case EXC_OBJTYPE_GROUPBOX: xDrawObj = std::make_shared<XclImpGroupBoxObj>( rRoot ); break;
+ case EXC_OBJTYPE_DROPDOWN: xDrawObj = std::make_shared<XclImpDropDownObj>( rRoot ); break;
default:
SAL_WARN("sc.filter", "XclImpDrawObjBase::ReadObj5 - unknown object type 0x" << std::hex << nObjType );
rRoot.GetTracer().TraceUnsupportedObjects();
- xDrawObj.reset( new XclImpPhObj( rRoot ) );
+ xDrawObj = std::make_shared<XclImpPhObj>( rRoot );
}
}
@@ -323,7 +323,7 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( const XclImpRoot& rRoot, XclImpStr
// in BIFF8, all simple objects support text
case EXC_OBJTYPE_LINE:
case EXC_OBJTYPE_ARC:
- xDrawObj.reset( new XclImpTextObj( rRoot ) );
+ xDrawObj = std::make_shared<XclImpTextObj>( rRoot );
// lines and arcs may be 2-dimensional
xDrawObj->SetAreaObj( false );
break;
@@ -334,24 +334,24 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( const XclImpRoot& rRoot, XclImpStr
case EXC_OBJTYPE_POLYGON:
case EXC_OBJTYPE_DRAWING:
case EXC_OBJTYPE_TEXT:
- xDrawObj.reset( new XclImpTextObj( rRoot ) );
+ xDrawObj = std::make_shared<XclImpTextObj>( rRoot );
break;
- case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break;
- case EXC_OBJTYPE_CHART: xDrawObj.reset( new XclImpChartObj( rRoot ) ); break;
- case EXC_OBJTYPE_BUTTON: xDrawObj.reset( new XclImpButtonObj( rRoot ) ); break;
- case EXC_OBJTYPE_PICTURE: xDrawObj.reset( new XclImpPictureObj( rRoot ) ); break;
- case EXC_OBJTYPE_CHECKBOX: xDrawObj.reset( new XclImpCheckBoxObj( rRoot ) ); break;
- case EXC_OBJTYPE_OPTIONBUTTON: xDrawObj.reset( new XclImpOptionButtonObj( rRoot ) ); break;
- case EXC_OBJTYPE_EDIT: xDrawObj.reset( new XclImpEditObj( rRoot ) ); break;
- case EXC_OBJTYPE_LABEL: xDrawObj.reset( new XclImpLabelObj( rRoot ) ); break;
- case EXC_OBJTYPE_DIALOG: xDrawObj.reset( new XclImpDialogObj( rRoot ) ); break;
- case EXC_OBJTYPE_SPIN: xDrawObj.reset( new XclImpSpinButtonObj( rRoot ) ); break;
- case EXC_OBJTYPE_SCROLLBAR: xDrawObj.reset( new XclImpScrollBarObj( rRoot ) ); break;
- case EXC_OBJTYPE_LISTBOX: xDrawObj.reset( new XclImpListBoxObj( rRoot ) ); break;
- case EXC_OBJTYPE_GROUPBOX: xDrawObj.reset( new XclImpGroupBoxObj( rRoot ) ); break;
- case EXC_OBJTYPE_DROPDOWN: xDrawObj.reset( new XclImpDropDownObj( rRoot ) ); break;
- case EXC_OBJTYPE_NOTE: xDrawObj.reset( new XclImpNoteObj( rRoot ) ); break;
+ case EXC_OBJTYPE_GROUP: xDrawObj = std::make_shared<XclImpGroupObj>( rRoot ); break;
+ case EXC_OBJTYPE_CHART: xDrawObj = std::make_shared<XclImpChartObj>( rRoot ); break;
+ case EXC_OBJTYPE_BUTTON: xDrawObj = std::make_shared<XclImpButtonObj>( rRoot ); break;
+ case EXC_OBJTYPE_PICTURE: xDrawObj = std::make_shared<XclImpPictureObj>( rRoot ); break;
+ case EXC_OBJTYPE_CHECKBOX: xDrawObj = std::make_shared<XclImpCheckBoxObj>( rRoot ); break;
+ case EXC_OBJTYPE_OPTIONBUTTON: xDrawObj = std::make_shared<XclImpOptionButtonObj>( rRoot ); break;
+ case EXC_OBJTYPE_EDIT: xDrawObj = std::make_shared<XclImpEditObj>( rRoot ); break;
+ case EXC_OBJTYPE_LABEL: xDrawObj = std::make_shared<XclImpLabelObj>( rRoot ); break;
+ case EXC_OBJTYPE_DIALOG: xDrawObj = std::make_shared<XclImpDialogObj>( rRoot ); break;
+ case EXC_OBJTYPE_SPIN: xDrawObj = std::make_shared<XclImpSpinButtonObj>( rRoot ); break;
+ case EXC_OBJTYPE_SCROLLBAR: xDrawObj = std::make_shared<XclImpScrollBarObj>( rRoot ); break;
+ case EXC_OBJTYPE_LISTBOX: xDrawObj = std::make_shared<XclImpListBoxObj>( rRoot ); break;
+ case EXC_OBJTYPE_GROUPBOX: xDrawObj = std::make_shared<XclImpGroupBoxObj>( rRoot ); break;
+ case EXC_OBJTYPE_DROPDOWN: xDrawObj = std::make_shared<XclImpDropDownObj>( rRoot ); break;
+ case EXC_OBJTYPE_NOTE: xDrawObj = std::make_shared<XclImpNoteObj>( rRoot ); break;
default:
SAL_WARN("sc.filter", "XclImpDrawObjBase::ReadObj8 - unknown object type 0x" << std::hex << nObjType );
@@ -363,7 +363,7 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( const XclImpRoot& rRoot, XclImpStr
if (!xDrawObj) //ensure placeholder for unknown or broken records
{
SAL_WARN( "sc.filter", "XclImpDrawObjBase::ReadObj8 import failed, substituting placeholder");
- xDrawObj.reset( new XclImpPhObj( rRoot ) );
+ xDrawObj = std::make_shared<XclImpPhObj>( rRoot );
}
xDrawObj->mnTab = rRoot.GetCurrScTab();
@@ -1420,7 +1420,7 @@ void XclImpObjTextData::ReadByteString( XclImpStream& rStrm )
mxString.reset();
if( maData.mnTextLen > 0 )
{
- mxString.reset( new XclImpString( rStrm.ReadRawByteString( maData.mnTextLen ) ) );
+ mxString = std::make_shared<XclImpString>( rStrm.ReadRawByteString( maData.mnTextLen ) );
// skip padding byte for word boundaries
if( rStrm.GetRecPos() & 1 ) rStrm.Ignore( 1 );
}
@@ -1675,7 +1675,7 @@ void XclImpChartObj::ReadChartSubStream( XclImpStream& rStrm )
}
// read chart, even if BOF record contains wrong substream identifier
- mxChart.reset( new XclImpChart( GetRoot(), mbOwnTab ) );
+ mxChart = std::make_shared<XclImpChart>( GetRoot(), mbOwnTab );
mxChart->ReadChartSubStream( rStrm );
if( mbOwnTab )
FinalizeTabChart();
@@ -1983,7 +1983,7 @@ void XclImpControlHelper::ReadCellLinkFormula( XclImpStream& rStrm, bool bWithBo
if ( !aScRanges.empty() )
{
const ScRange & rScRange = aScRanges.front();
- mxCellLink.reset( new ScAddress( rScRange.aStart ) );
+ mxCellLink = std::make_shared<ScAddress>( rScRange.aStart );
}
}
@@ -1995,7 +1995,7 @@ void XclImpControlHelper::ReadSourceRangeFormula( XclImpStream& rStrm, bool bWit
if ( !aScRanges.empty() )
{
const ScRange & rScRange = aScRanges.front();
- mxSrcRange.reset( new ScRange( rScRange ) );
+ mxSrcRange = std::make_shared<ScRange>( rScRange );
}
}
@@ -2348,7 +2348,7 @@ void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const
if ( pLeader->HasCellLink() && !pTbxObj->HasCellLink() )
{
// propagate cell link info
- pTbxObj->mxCellLink.reset( new ScAddress( *pLeader->mxCellLink ) );
+ pTbxObj->mxCellLink = std::make_shared<ScAddress>( *pLeader->mxCellLink );
pTbxObj->ApplySheetLinkProps();
}
pTbxObj = dynamic_cast< XclImpOptionButtonObj* >( GetObjectManager().GetSheetDrawing( GetTab() ).FindDrawObj( pTbxObj->mnNextInGroup ).get() );
@@ -3341,7 +3341,7 @@ OUString XclImpObjectManager::GetOleNameOverride( SCTAB nTab, sal_uInt16 nObjId
void XclImpDffConverter::StartProgressBar( std::size_t nProgressSize )
{
- mxProgress.reset( new ScfProgressBar( GetDocShell(), STR_PROGRESS_CALCULATING ) );
+ mxProgress = std::make_shared<ScfProgressBar>( GetDocShell(), STR_PROGRESS_CALCULATING );
mxProgress->AddSegment( nProgressSize );
mxProgress->Activate();
}
@@ -3354,7 +3354,7 @@ void XclImpDffConverter::Progress( std::size_t nDelta )
void XclImpDffConverter::InitializeDrawing( XclImpDrawing& rDrawing, SdrModel& rSdrModel, SdrPage& rSdrPage )
{
- XclImpDffConvDataRef xConvData( new XclImpDffConvData( rDrawing, rSdrModel, rSdrPage ) );
+ XclImpDffConvDataRef xConvData = std::make_shared<XclImpDffConvData>( rDrawing, rSdrModel, rSdrPage );
maDataStack.push_back( xConvData );
SetModel( &xConvData->mrSdrModel, 1440 );
}
@@ -4148,7 +4148,7 @@ void XclImpDrawing::ReadObj8( XclImpStream& rStrm )
void XclImpDrawing::ReadTxo( XclImpStream& rStrm )
{
- XclImpObjTextRef xTextData( new XclImpObjTextData );
+ XclImpObjTextRef xTextData = std::make_shared<XclImpObjTextData>();
maTextMap[ maDffStrm.Tell() ] = xTextData;
// 1) read the TXO record
@@ -4162,7 +4162,7 @@ void XclImpDrawing::ReadTxo( XclImpStream& rStrm )
bValid = (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord();
OSL_ENSURE( bValid, "XclImpDrawing::ReadTxo - missing CONTINUE record" );
if( bValid )
- xTextData->mxString.reset( new XclImpString( rStrm.ReadUniString( xTextData->maData.mnTextLen ) ) );
+ xTextData->mxString = std::make_shared<XclImpString>( rStrm.ReadUniString( xTextData->maData.mnTextLen ) );
}
// 3) second CONTINUE with formatting runs
@@ -4328,7 +4328,7 @@ XclImpSheetDrawing& XclImpObjectManager::GetSheetDrawing( SCTAB nScTab )
{
XclImpSheetDrawingRef& rxDrawing = maSheetDrawings[ nScTab ];
if( !rxDrawing )
- rxDrawing.reset( new XclImpSheetDrawing( GetRoot(), nScTab ) );
+ rxDrawing = std::make_shared<XclImpSheetDrawing>( GetRoot(), nScTab );
return *rxDrawing;
}
diff --git a/sc/source/filter/excel/xiformula.cxx b/sc/source/filter/excel/xiformula.cxx
index 7a5fc80557d6..a5f4d7864212 100644
--- a/sc/source/filter/excel/xiformula.cxx
+++ b/sc/source/filter/excel/xiformula.cxx
@@ -83,7 +83,7 @@ std::unique_ptr<ScTokenArray> XclImpFmlaCompImpl::CreateFormula(
XclImpFormulaCompiler::XclImpFormulaCompiler( const XclImpRoot& rRoot ) :
XclImpRoot( rRoot ),
- mxImpl( new XclImpFmlaCompImpl( rRoot ) )
+ mxImpl( std::make_shared<XclImpFmlaCompImpl>( rRoot ) )
{
}
diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx
index 3e86e5bea064..a887a5f776a4 100644
--- a/sc/source/filter/excel/xilink.cxx
+++ b/sc/source/filter/excel/xilink.cxx
@@ -566,7 +566,7 @@ XclImpSupbookTab::XclImpSupbookTab( const OUString& rTabName ) :
void XclImpSupbookTab::ReadCrn( XclImpStream& rStrm, const XclAddress& rXclPos )
{
- XclImpCrnRef crnRef( new XclImpCrn(rStrm, rXclPos) );
+ XclImpCrnRef crnRef = std::make_shared<XclImpCrn>(rStrm, rXclPos);
maCrnList.push_back( crnRef );
}
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 111811e4c361..deaa0f8c30f1 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -345,7 +345,7 @@ void XclImpPCField::ReadItem( XclImpStream& rStrm )
OSL_ENSURE( HasInlineItems() || HasPostponedItems(), "XclImpPCField::ReadItem - field does not expect items" );
// read the item
- XclImpPCItemRef xItem( new XclImpPCItem( rStrm ) );
+ XclImpPCItemRef xItem = std::make_shared<XclImpPCItem>( rStrm );
// try to insert into an item list
if( mbNumGroupInfoRead )
@@ -745,7 +745,7 @@ void XclImpPivotCache::ReadPivotCacheStream( const XclImpStream& rStrm )
sal_uInt16 nNewFieldIdx = static_cast< sal_uInt16 >( maFields.size() );
if( nNewFieldIdx < EXC_PC_MAXFIELDCOUNT )
{
- xCurrField.reset( new XclImpPCField( GetRoot(), *this, nNewFieldIdx ) );
+ xCurrField = std::make_shared<XclImpPCField>( GetRoot(), *this, nNewFieldIdx );
maFields.push_back( xCurrField );
xCurrField->ReadSxfield( aPCStrm );
if( xCurrField->HasOrigItems() )
@@ -1002,7 +1002,7 @@ void XclImpPTField::ReadSxvdex( XclImpStream& rStrm )
void XclImpPTField::ReadSxvi( XclImpStream& rStrm )
{
- XclImpPTItemRef xItem( new XclImpPTItem( GetCacheField() ) );
+ XclImpPTItemRef xItem = std::make_shared<XclImpPTItem>( GetCacheField() );
maItems.push_back( xItem );
xItem->ReadSxvi( rStrm );
}
@@ -1300,7 +1300,7 @@ void XclImpPivotTable::ReadSxvd( XclImpStream& rStrm )
if( nFieldCount < EXC_PT_MAXFIELDCOUNT )
{
// cache index for the field is equal to the SXVD record index
- mxCurrField.reset( new XclImpPTField( *this, nFieldCount ) );
+ mxCurrField = std::make_shared<XclImpPTField>( *this, nFieldCount );
maFields.push_back( mxCurrField );
mxCurrField->ReadSxvd( rStrm );
// add visible name of new field to list of visible names
@@ -1628,7 +1628,7 @@ XclImpPivotCacheRef XclImpPivotTableManager::GetPivotCache( sal_uInt16 nCacheIdx
void XclImpPivotTableManager::ReadSxidstm( XclImpStream& rStrm )
{
- XclImpPivotCacheRef xPCache( new XclImpPivotCache( GetRoot() ) );
+ XclImpPivotCacheRef xPCache = std::make_shared<XclImpPivotCache>( GetRoot() );
maPCaches.push_back( xPCache );
xPCache->ReadSxidstm( rStrm );
}
@@ -1655,7 +1655,7 @@ void XclImpPivotTableManager::ReadDConName( XclImpStream& rStrm )
void XclImpPivotTableManager::ReadSxview( XclImpStream& rStrm )
{
- XclImpPivotTableRef xPTable( new XclImpPivotTable( GetRoot() ) );
+ XclImpPivotTableRef xPTable = std::make_shared<XclImpPivotTable>( GetRoot() );
maPTables.push_back( xPTable );
xPTable->ReadSxview( rStrm );
}
diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx
index 7b761d1f3b50..8f65fba42d9e 100644
--- a/sc/source/filter/excel/xiroot.cxx
+++ b/sc/source/filter/excel/xiroot.cxx
@@ -42,7 +42,7 @@
XclImpRootData::XclImpRootData( XclBiff eBiff, SfxMedium& rMedium,
const tools::SvRef<SotStorage>& xRootStrg, ScDocument& rDoc, rtl_TextEncoding eTextEnc ) :
XclRootData( eBiff, rMedium, xRootStrg, rDoc, eTextEnc, false ),
- mxDocImport(new ScDocumentImport(rDoc)),
+ mxDocImport(std::make_shared<ScDocumentImport>(rDoc)),
mbHasCodePage( false ),
mbHasBasic( false )
{
@@ -56,34 +56,34 @@ XclImpRoot::XclImpRoot( XclImpRootData& rImpRootData ) :
XclRoot( rImpRootData ),
mrImpData( rImpRootData )
{
- mrImpData.mxAddrConv.reset( new XclImpAddressConverter( GetRoot() ) );
- mrImpData.mxFmlaComp.reset( new XclImpFormulaCompiler( GetRoot() ) );
- mrImpData.mxPalette.reset( new XclImpPalette( GetRoot() ) );
- mrImpData.mxFontBfr.reset( new XclImpFontBuffer( GetRoot() ) );
- mrImpData.mxNumFmtBfr.reset( new XclImpNumFmtBuffer( GetRoot() ) );
- mrImpData.mpXFBfr.reset( new XclImpXFBuffer( GetRoot() ) );
- mrImpData.mxXFRangeBfr.reset( new XclImpXFRangeBuffer( GetRoot() ) );
- mrImpData.mxTabInfo.reset( new XclImpTabInfo );
- mrImpData.mxNameMgr.reset( new XclImpNameManager( GetRoot() ) );
- mrImpData.mxObjMgr.reset( new XclImpObjectManager( GetRoot() ) );
+ mrImpData.mxAddrConv = std::make_shared<XclImpAddressConverter>( GetRoot() );
+ mrImpData.mxFmlaComp = std::make_shared<XclImpFormulaCompiler>( GetRoot() );
+ mrImpData.mxPalette = std::make_shared<XclImpPalette>( GetRoot() );
+ mrImpData.mxFontBfr = std::make_shared<XclImpFontBuffer>( GetRoot() );
+ mrImpData.mxNumFmtBfr = std::make_shared<XclImpNumFmtBuffer>( GetRoot() );
+ mrImpData.mpXFBfr = std::make_shared<XclImpXFBuffer>( GetRoot() );
+ mrImpData.mxXFRangeBfr = std::make_shared<XclImpXFRangeBuffer>( GetRoot() );
+ mrImpData.mxTabInfo = std::make_shared<XclImpTabInfo>();
+ mrImpData.mxNameMgr = std::make_shared<XclImpNameManager>( GetRoot() );
+ mrImpData.mxObjMgr = std::make_shared<XclImpObjectManager>( GetRoot() );
if( GetBiff() == EXC_BIFF8 )
{
- mrImpData.mxLinkMgr.reset( new XclImpLinkManager( GetRoot() ) );
- mrImpData.mxSst.reset( new XclImpSst( GetRoot() ) );
- mrImpData.mxCondFmtMgr.reset( new XclImpCondFormatManager( GetRoot() ) );
- mrImpData.mxValidMgr.reset( new XclImpValidationManager( GetRoot() ) );
+ mrImpData.mxLinkMgr = std::make_shared<XclImpLinkManager>( GetRoot() );
+ mrImpData.mxSst = std::make_shared<XclImpSst>( GetRoot() );
+ mrImpData.mxCondFmtMgr = std::make_shared<XclImpCondFormatManager>( GetRoot() );
+ mrImpData.mxValidMgr = std::make_shared<XclImpValidationManager>( GetRoot() );
// TODO still in old RootData (deleted by RootData)
GetOldRoot().pAutoFilterBuffer.reset( new XclImpAutoFilterBuffer );
- mrImpData.mxWebQueryBfr.reset( new XclImpWebQueryBuffer( GetRoot() ) );
- mrImpData.mxPTableMgr.reset( new XclImpPivotTableManager( GetRoot() ) );
- mrImpData.mxTabProtect.reset( new XclImpSheetProtectBuffer( GetRoot() ) );
- mrImpData.mxDocProtect.reset( new XclImpDocProtectBuffer( GetRoot() ) );
+ mrImpData.mxWebQueryBfr = std::make_shared<XclImpWebQueryBuffer>( GetRoot() );
+ mrImpData.mxPTableMgr = std::make_shared<XclImpPivotTableManager>( GetRoot() );
+ mrImpData.mxTabProtect = std::make_shared<XclImpSheetProtectBuffer>( GetRoot() );
+ mrImpData.mxDocProtect = std::make_shared<XclImpDocProtectBuffer>( GetRoot() );
}
- mrImpData.mxPageSett.reset( new XclImpPageSettings( GetRoot() ) );
- mrImpData.mxDocViewSett.reset( new XclImpDocViewSettings( GetRoot() ) );
- mrImpData.mxTabViewSett.reset( new XclImpTabViewSettings( GetRoot() ) );
+ mrImpData.mxPageSett = std::make_shared<XclImpPageSettings>( GetRoot() );
+ mrImpData.mxDocViewSett = std::make_shared<XclImpDocViewSettings>( GetRoot() );
+ mrImpData.mxTabViewSett = std::make_shared<XclImpTabViewSettings>( GetRoot() );
}
void XclImpRoot::SetCodePage( sal_uInt16 nCodePage )
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index b1c308673cd7..c08826573856 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -1898,7 +1898,7 @@ void XclImpXFRangeBuffer::SetXF( const ScAddress& rScPos, sal_uInt16 nXFIndex, X
if( maColumns.size() <= nIndex )
maColumns.resize( nIndex + 1 );
if( !maColumns[ nIndex ] )
- maColumns[ nIndex ].reset( new XclImpXFRangeColumn );
+ maColumns[ nIndex ] = std::make_shared<XclImpXFRangeColumn>();
// remember all Boolean cells, they will get 'Standard' number format
maColumns[ nIndex ]->SetXF( nScRow, XclImpXFIndex( nXFIndex, eMode == xlXFModeBoolCell ) );
@@ -1947,7 +1947,7 @@ void XclImpXFRangeBuffer::SetColumnDefXF( SCCOL nScCol, sal_uInt16 nXFIndex )
if( maColumns.size() <= nIndex )
maColumns.resize( nIndex + 1 );
OSL_ENSURE( !maColumns[ nIndex ], "XclImpXFRangeBuffer::SetColumnDefXF - default column of XFs already has values" );
- maColumns[ nIndex ].reset( new XclImpXFRangeColumn );
+ maColumns[ nIndex ] = std::make_shared<XclImpXFRangeColumn>();
maColumns[ nIndex ]->SetDefaultXF( XclImpXFIndex( nXFIndex ) );
}
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index b3a388ce7fb2..75e37d8ff256 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -769,7 +769,7 @@ void XclChPropSetHelper::ReadEscherProperties(
::insert_value( nEscherColor, aColor.GetGreen(), 8, 8 );
::insert_value( nEscherColor, aColor.GetRed(), 0, 8 );
sal_uInt32 nEscherOpacity = static_cast< sal_uInt32 >( (100 - nTransparency) * 655.36 );
- rEscherFmt.mxEscherSet.reset( new EscherPropertyContainer );
+ rEscherFmt.mxEscherSet = std::make_shared<EscherPropertyContainer>();
rEscherFmt.mxEscherSet->AddOpt( ESCHER_Prop_fillType, ESCHER_FillSolid );
rEscherFmt.mxEscherSet->AddOpt( ESCHER_Prop_fillColor, nEscherColor );
rEscherFmt.mxEscherSet->AddOpt( ESCHER_Prop_fillOpacity, nEscherOpacity );
@@ -790,7 +790,7 @@ void XclChPropSetHelper::ReadEscherProperties(
if( rGradientTable.GetObject( aGradientName ) >>= aGradient )
{
// convert to Escher properties
- rEscherFmt.mxEscherSet.reset( new EscherPropertyContainer );
+ rEscherFmt.mxEscherSet = std::make_shared<EscherPropertyContainer>();
rEscherFmt.mxEscherSet->CreateGradientProperties( aGradient );
}
}
@@ -807,7 +807,7 @@ void XclChPropSetHelper::ReadEscherProperties(
if( rHatchTable.GetObject( aHatchName ) >>= aHatch )
{
// convert to Escher properties
- rEscherFmt.mxEscherSet.reset( new EscherPropertyContainer );
+ rEscherFmt.mxEscherSet = std::make_shared<EscherPropertyContainer>();
rEscherFmt.mxEscherSet->CreateEmbeddedHatchProperties( aHatch, aColor, bFillBackground );
rPicFmt.mnBmpMode = EXC_CHPICFORMAT_STACK;
}
@@ -824,7 +824,7 @@ void XclChPropSetHelper::ReadEscherProperties(
if (rBitmapTable.GetObject( aBitmapName ) >>= xBitmap)
{
// convert to Escher properties
- rEscherFmt.mxEscherSet.reset( new EscherPropertyContainer );
+ rEscherFmt.mxEscherSet = std::make_shared<EscherPropertyContainer>();
rEscherFmt.mxEscherSet->CreateEmbeddedBitmapProperties( xBitmap, eApiBmpMode );
rPicFmt.mnBmpMode = (eApiBmpMode == drawing::BitmapMode_REPEAT) ?
EXC_CHPICFORMAT_STACK : EXC_CHPICFORMAT_STRETCH;
@@ -1211,8 +1211,8 @@ uno::Reference<drawing::XShape> lclGetSecYAxisTitleShape(const uno::Reference<ch
} // namespace
XclChRootData::XclChRootData()
- : mxTypeInfoProv(new XclChTypeInfoProvider)
- , mxFmtInfoProv(new XclChFormatInfoProvider)
+ : mxTypeInfoProv(std::make_shared<XclChTypeInfoProvider>())
+ , mxFmtInfoProv(std::make_shared<XclChFormatInfoProvider>())
, mnBorderGapX(0)
, mnBorderGapY(0)
, mfUnitSizeX(0.0)
@@ -1248,10 +1248,10 @@ void XclChRootData::InitConversion(const XclRoot& rRoot, const uno::Reference<ch
// create object tables
uno::Reference<lang::XMultiServiceFactory> xFactory(mxChartDoc, uno::UNO_QUERY);
- mxLineDashTable.reset(new XclChObjectTable(xFactory, SERVICE_DRAWING_DASHTABLE, "Excel line dash "));
- mxGradientTable.reset(new XclChObjectTable(xFactory, SERVICE_DRAWING_GRADIENTTABLE, "Excel gradient "));
- mxHatchTable.reset(new XclChObjectTable(xFactory, SERVICE_DRAWING_HATCHTABLE, "Excel hatch "));
- mxBitmapTable.reset(new XclChObjectTable(xFactory, SERVICE_DRAWING_BITMAPTABLE, "Excel bitmap "));
+ mxLineDashTable = std::make_shared<XclChObjectTable>(xFactory, SERVICE_DRAWING_DASHTABLE, "Excel line dash ");
+ mxGradientTable = std::make_shared<XclChObjectTable>(xFactory, SERVICE_DRAWING_GRADIENTTABLE, "Excel gradient ");
+ mxHatchTable = std::make_shared<XclChObjectTable>(xFactory, SERVICE_DRAWING_HATCHTABLE, "Excel hatch ");
+ mxBitmapTable = std::make_shared<XclChObjectTable>(xFactory, SERVICE_DRAWING_BITMAPTABLE, "Excel bitmap ");
}
void XclChRootData::FinishConversion()
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index e4c0d924841f..a4c48663aa94 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -96,9 +96,9 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium,
maScMaxPos( mrDoc.MaxCol(), mrDoc.MaxRow(), MAXTAB ),
maXclMaxPos( EXC_MAXCOL2, EXC_MAXROW2, EXC_MAXTAB2 ),
maMaxPos( EXC_MAXCOL2, EXC_MAXROW2, EXC_MAXTAB2 ),
- mxFontPropSetHlp( new XclFontPropSetHelper ),
- mxChPropSetHlp( new XclChPropSetHelper ),
- mxRD( new RootData ),
+ mxFontPropSetHlp( std::make_shared<XclFontPropSetHelper>() ),
+ mxChPropSetHlp( std::make_shared<XclChPropSetHelper>() ),
+ mxRD( std::make_shared<RootData>() ),
mfScreenPixelX( 50.0 ),
mfScreenPixelY( 50.0 ),
mnCharWidth( 110 ),
@@ -140,9 +140,9 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium,
// extended document options - always own object, try to copy existing data from document
if( const ScExtDocOptions* pOldDocOpt = mrDoc.GetExtDocOptions() )
- mxExtDocOpt.reset( new ScExtDocOptions( *pOldDocOpt ) );
+ mxExtDocOpt = std::make_shared<ScExtDocOptions>( *pOldDocOpt );
else
- mxExtDocOpt.reset( new ScExtDocOptions );
+ mxExtDocOpt = std::make_shared<ScExtDocOptions>();
// screen pixel size
try
@@ -172,7 +172,7 @@ XclRoot::XclRoot( XclRootData& rRootData ) :
#endif
// filter tracer
- mrData.mxTracer.reset( new XclTracer( GetDocUrl() ) );
+ mrData.mxTracer = std::make_shared<XclTracer>( GetDocUrl() );
}
XclRoot::XclRoot( const XclRoot& rRoot ) :
@@ -359,7 +359,7 @@ ScEditEngineDefaulter& XclRoot::GetEditEngine() const
{
if( !mrData.mxEditEngine.get() )
{
- mrData.mxEditEngine.reset( new ScEditEngineDefaulter( GetDoc().GetEnginePool() ) );
+ mrData.mxEditEngine = std::make_shared<ScEditEngineDefaulter>( GetDoc().GetEnginePool() );
ScEditEngineDefaulter& rEE = *mrData.mxEditEngine;
rEE.SetRefMapMode(MapMode(MapUnit::Map100thMM));
rEE.SetEditTextObjectPool( GetDoc().GetEditPool() );
@@ -374,7 +374,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const
{
if( !mrData.mxHFEditEngine.get() )
{
- mrData.mxHFEditEngine.reset( new ScHeaderEditEngine( EditEngine::CreatePool() ) );
+ mrData.mxHFEditEngine = std::make_shared<ScHeaderEditEngine>( EditEngine::CreatePool() );
ScHeaderEditEngine& rEE = *mrData.mxHFEditEngine;
rEE.SetRefMapMode(MapMode(MapUnit::MapTwip)); // headers/footers use twips as default metric
rEE.SetUpdateMode( false );
@@ -398,7 +398,7 @@ EditEngine& XclRoot::GetDrawEditEngine() const
{
if( !mrData.mxDrawEditEng.get() )
{
- mrData.mxDrawEditEng.reset( new EditEngine( &GetDoc().GetDrawLayer()->GetItemPool() ) );
+ mrData.mxDrawEditEng = std::make_shared<EditEngine>( &GetDoc().GetDrawLayer()->GetItemPool() );
EditEngine& rEE = *mrData.mxDrawEditEng;
rEE.SetRefMapMode(MapMode(MapUnit::Map100thMM));
rEE.SetUpdateMode( false );
diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx
index c65e1919541e..a676dd5c0429 100644
--- a/sc/source/filter/excel/xltoolbar.cxx
+++ b/sc/source/filter/excel/xltoolbar.cxx
@@ -221,13 +221,13 @@ ScTBC::Read(SvStream &rS)
sal_uInt8 tct = tbch.getTct();
if ( ( tcid != 0x0001 && tcid != 0x06CC && tcid != 0x03D8 && tcid != 0x03EC && tcid != 0x1051 ) && ( ( tct > 0 && tct < 0x0B ) || ( ( tct > 0x0B && tct < 0x10 ) || tct == 0x15 ) ) )
{
- tbcCmd.reset( new TBCCmd );
+ tbcCmd = std::make_shared<TBCCmd>();
if ( ! tbcCmd->Read( rS ) )
return false;
}
if ( tct != 0x16 )
{
- tbcd.reset( new TBCData( tbch ) );
+ tbcd = std::make_shared<TBCData>( tbch );
if ( !tbcd->Read( rS ) )
return false;
}
diff --git a/sc/source/filter/excel/xlview.cxx b/sc/source/filter/excel/xlview.cxx
index 1c0ea7125660..b5768e2df136 100644
--- a/sc/source/filter/excel/xlview.cxx
+++ b/sc/source/filter/excel/xlview.cxx
@@ -96,7 +96,7 @@ XclSelectionData& XclTabViewData::CreateSelectionData( sal_uInt8 nPane )
{
XclSelectionDataRef& rxSelData = maSelMap[ nPane ];
if( !rxSelData )
- rxSelData.reset( new XclSelectionData );
+ rxSelData = std::make_shared<XclSelectionData>();
return *rxSelData;
}
diff --git a/sc/source/filter/inc/autofilterbuffer.hxx b/sc/source/filter/inc/autofilterbuffer.hxx
index c6387e5d37d4..cd2a2b113efb 100644
--- a/sc/source/filter/inc/autofilterbuffer.hxx
+++ b/sc/source/filter/inc/autofilterbuffer.hxx
@@ -170,7 +170,7 @@ public:
/** Creates and returns the specified filter settings object. */
template< typename FilterSettingsType >
FilterSettingsBase& createFilterSettings()
- { mxSettings.reset( new FilterSettingsType( *this ) ); return *mxSettings; }
+ { mxSettings = std::make_shared<FilterSettingsType>( *this ); return *mxSettings; }
/** Returns converted UNO API filter settings representing all filter
settings of this column. */
diff --git a/sc/source/filter/oox/autofilterbuffer.cxx b/sc/source/filter/oox/autofilterbuffer.cxx
index 3ec6e3923ae0..b289d3b00553 100644
--- a/sc/source/filter/oox/autofilterbuffer.cxx
+++ b/sc/source/filter/oox/autofilterbuffer.cxx
@@ -549,7 +549,7 @@ void AutoFilter::importAutoFilter( SequenceInputStream& rStrm, sal_Int16 nSheet
FilterColumn& AutoFilter::createFilterColumn()
{
- FilterColumnVector::value_type xFilterColumn( new FilterColumn( *this ) );
+ FilterColumnVector::value_type xFilterColumn = std::make_shared<FilterColumn>( *this );
maFilterColumns.push_back( xFilterColumn );
return *xFilterColumn;
}
@@ -645,7 +645,7 @@ AutoFilterBuffer::AutoFilterBuffer( const WorkbookHelper& rHelper ) :
AutoFilter& AutoFilterBuffer::createAutoFilter()
{
- AutoFilterVector::value_type xAutoFilter( new AutoFilter( *this ) );
+ AutoFilterVector::value_type xAutoFilter = std::make_shared<AutoFilter>( *this );
maAutoFilters.push_back( xAutoFilter );
return *xAutoFilter;
}
diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx
index 58b08ec0d3c9..359cddc6cad4 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -148,7 +148,7 @@ void Comment::importComment( SequenceInputStream& rStrm )
RichStringRef const & Comment::createText()
{
- maModel.mxText.reset( new RichString( *this ) );
+ maModel.mxText = std::make_shared<RichString>( *this );
return maModel.mxText;
}
@@ -227,7 +227,7 @@ void CommentsBuffer::appendAuthor( const OUString& rAuthor )
CommentRef CommentsBuffer::createComment()
{
- CommentRef xComment( new Comment( *this ) );
+ CommentRef xComment = std::make_shared<Comment>( *this );
maComments.push_back( xComment );
return xComment;
}
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 206cdc972f7f..22b5fbde9303 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1217,7 +1217,7 @@ CondFormatRef CondFormatBuffer::importCondFormatting( SequenceInputStream& rStrm
ExtCfDataBarRuleRef CondFormatBuffer::createExtCfDataBarRule(ScDataBarFormatData* pTarget)
{
- ExtCfDataBarRuleRef extRule( new ExtCfDataBarRule( pTarget, *this ) );
+ ExtCfDataBarRuleRef extRule = std::make_shared<ExtCfDataBarRule>( pTarget, *this );
maCfRules.push_back( extRule );
return extRule;
}
@@ -1266,7 +1266,7 @@ ScConditionMode CondFormatBuffer::convertToInternalOperator( sal_Int32 nToken )
CondFormatRef CondFormatBuffer::createCondFormat()
{
- CondFormatRef xCondFmt( new CondFormat( *this ) );
+ CondFormatRef xCondFmt = std::make_shared<CondFormat>( *this );
maCondFormats.push_back( xCondFmt );
return xCondFmt;
}
diff --git a/sc/source/filter/oox/connectionsbuffer.cxx b/sc/source/filter/oox/connectionsbuffer.cxx
index 850aa2efce55..73de83ac000f 100644
--- a/sc/source/filter/oox/connectionsbuffer.cxx
+++ b/sc/source/filter/oox/connectionsbuffer.cxx
@@ -283,7 +283,7 @@ ConnectionsBuffer::ConnectionsBuffer( const WorkbookHelper& rHelper ) :
Connection& ConnectionsBuffer::createConnection()
{
- ConnectionRef xConnection( new Connection( *this ) );
+ ConnectionRef xConnection = std::make_shared<Connection>( *this );
maConnections.push_back( xConnection );
return *xConnection;
}
diff --git a/sc/source/filter/oox/defnamesbuffer.cxx b/sc/source/filter/oox/defnamesbuffer.cxx
index 89f1f4acfeea..1042510f5cf0 100644
--- a/sc/source/filter/oox/defnamesbuffer.cxx
+++ b/sc/source/filter/oox/defnamesbuffer.cxx
@@ -396,7 +396,7 @@ DefinedNameRef DefinedNamesBuffer::getByBuiltinId( sal_Unicode cBuiltinId, sal_I
DefinedNameRef DefinedNamesBuffer::createDefinedName()
{
- DefinedNameRef xDefName( new DefinedName( *this ) );
+ DefinedNameRef xDefName = std::make_shared<DefinedName>( *this );
maDefNames.push_back( xDefName );
return xDefName;
}
diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx
index ad40e29b3c3f..700a21576d6c 100644
--- a/sc/source/filter/oox/drawingfragment.cxx
+++ b/sc/source/filter/oox/drawingfragment.cxx
@@ -105,7 +105,7 @@ void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >&
getWorksheets().convertSheetNameRef( sURL );
if( !maMacroName.isEmpty() && mxShape.is() )
{
- VbaMacroAttacherRef xAttacher( new ShapeMacroAttacher( maMacroName, mxShape ) );
+ VbaMacroAttacherRef xAttacher = std::make_shared<ShapeMacroAttacher>( maMacroName, mxShape );
getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher );
}
::oox::drawingml::Shape::finalizeXShape( rFilter, rxShapes );
@@ -135,31 +135,31 @@ GroupShapeContext::GroupShapeContext( const FragmentHandler2& rParent,
{
case XDR_TOKEN( sp ):
{
- ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.CustomShape" ) );
+ ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, "com.sun.star.drawing.CustomShape" );
if( pxShape ) *pxShape = xShape;
return new ShapeContext( rParent, rxParentShape, xShape );
}
case XDR_TOKEN( cxnSp ):
{
- ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.ConnectorShape" ) );
+ ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, "com.sun.star.drawing.ConnectorShape" );
if( pxShape ) *pxShape = xShape;
return new ConnectorShapeContext( rParent, rxParentShape, xShape );
}
case XDR_TOKEN( pic ):
{
- ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" ) );
+ ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" );
if( pxShape ) *pxShape = xShape;
return new GraphicShapeContext( rParent, rxParentShape, xShape );
}
case XDR_TOKEN( graphicFrame ):
{
- ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" ) );
+ ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" );
if( pxShape ) *pxShape = xShape;
return new GraphicalObjectFrameContext( rParent, rxParentShape, xShape, rHelper.getSheetType() != WorksheetType::Chart );
}
case XDR_TOKEN( grpSp ):
{
- ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GroupShape" ) );
+ ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, "com.sun.star.drawing.GroupShape" );
if( pxShape ) *pxShape = xShape;
return new GroupShapeContext( rParent, rHelper, rxParentShape, xShape );
}
@@ -620,7 +620,7 @@ Reference< XShape > VmlDrawing::createAndInsertClientXShape( const ::oox::vml::S
if( !aMacroName.isEmpty() )
{
Reference< XIndexContainer > xFormIC = getControlForm().getXForm();
- VbaMacroAttacherRef xAttacher( new VmlControlMacroAttacher( aMacroName, xFormIC, nCtrlIndex, pClientData->mnObjType, pClientData->mnDropStyle ) );
+ VbaMacroAttacherRef xAttacher = std::make_shared<VmlControlMacroAttacher>( aMacroName, xFormIC, nCtrlIndex, pClientData->mnObjType, pClientData->mnDropStyle );
getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher );
}
}
diff --git a/sc/source/filter/oox/externallinkbuffer.cxx b/sc/source/filter/oox/externallinkbuffer.cxx
index 2f235c9bde0a..2164c7f71a23 100644
--- a/sc/source/filter/oox/externallinkbuffer.cxx
+++ b/sc/source/filter/oox/externallinkbuffer.cxx
@@ -537,7 +537,7 @@ void ExternalLink::insertExternalSheet( const OUString& rSheetName )
ExternalNameRef ExternalLink::createExternalName()
{
- ExternalNameRef xExtName( new ExternalName( *this ) );
+ ExternalNameRef xExtName = std::make_shared<ExternalName>( *this );
maExtNames.push_back( xExtName );
return xExtName;
}
@@ -558,7 +558,7 @@ void RefSheetsModel::readBiff12Data( SequenceInputStream& rStrm )
ExternalLinkBuffer::ExternalLinkBuffer( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
- mxSelfRef( new ExternalLink( rHelper ) ),
+ mxSelfRef( std::make_shared<ExternalLink>( rHelper ) ),
mbUseRefSheets( false )
{
mxSelfRef->setSelfLinkType();
@@ -653,7 +653,7 @@ LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId ) const
ExternalLinkRef ExternalLinkBuffer::createExternalLink()
{
- ExternalLinkRef xExtLink( new ExternalLink( *this ) );
+ ExternalLinkRef xExtLink = std::make_shared<ExternalLink>( *this );
maLinks.push_back( xExtLink );
return xExtLink;
}
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index dca31883b630..074d9032f3a6 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -1011,7 +1011,7 @@ FunctionProviderImpl::FunctionProviderImpl( bool bImportFilter )
void FunctionProviderImpl::initFunc(const FunctionData& rFuncData)
{
// create a function info object
- FunctionInfoRef xFuncInfo( new FunctionInfo );
+ FunctionInfoRef xFuncInfo = std::make_shared<FunctionInfo>();
if( rFuncData.mpcOdfFuncName )
xFuncInfo->maOdfFuncName = OUString::createFromAscii( rFuncData.mpcOdfFuncName );
if( rFuncData.mpcOoxFuncName )
@@ -1072,7 +1072,7 @@ void FunctionProviderImpl::initFuncs(const FunctionData* pBeg, const FunctionDat
}
FunctionProvider::FunctionProvider( bool bImportFilter ) :
- mxFuncImpl( new FunctionProviderImpl( bImportFilter ) )
+ mxFuncImpl( std::make_shared<FunctionProviderImpl>( bImportFilter ) )
{
}
@@ -1394,7 +1394,7 @@ bool OpCodeProviderImpl::initFuncOpCodes( const ApiTokenMap& rIntFuncTokenMap, c
OpCodeProvider::OpCodeProvider( const Reference< XMultiServiceFactory >& rxModelFactory,
bool bImportFilter ) :
FunctionProvider( bImportFilter ),
- mxOpCodeImpl( new OpCodeProviderImpl( getFuncs(), rxModelFactory ) )
+ mxOpCodeImpl( std::make_shared<OpCodeProviderImpl>( getFuncs(), rxModelFactory ) )
{
}
diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx
index 77f8052d0745..57a50b5d4465 100644
--- a/sc/source/filter/oox/numberformatsbuffer.cxx
+++ b/sc/source/filter/oox/numberformatsbuffer.cxx
@@ -1983,7 +1983,7 @@ NumberFormatsBuffer::NumberFormatsBuffer( const WorkbookHelper& rHelper )
NumberFormatRef NumberFormatsBuffer::createNumFmt( sal_uInt32 nNumFmtId, const OUString& rFmtCode )
{
NumberFormatRef xNumFmt;
- xNumFmt.reset( new NumberFormat( *this ) );
+ xNumFmt = std::make_shared<NumberFormat>( *this );
maNumFmts[ nNumFmtId ] = xNumFmt;
if ( nNumFmtId > mnHighestId )
mnHighestId = nNumFmtId;
@@ -2058,7 +2058,7 @@ void NumberFormatsBuffer::insertBuiltinFormats()
for( const BuiltinFormat* pBuiltin = (*aVIt)->mpFormats; pBuiltin && (pBuiltin->mnNumFmtId >= 0); ++pBuiltin )
{
NumberFormatRef& rxNumFmt = maNumFmts[ pBuiltin->mnNumFmtId ];
- rxNumFmt.reset( new NumberFormat( *this ) );
+ rxNumFmt = std::make_shared<NumberFormat>( *this );
bool bReuse = false;
if( pBuiltin->mpcFmtCode )
diff --git a/sc/source/filter/oox/ooxformulaparser.cxx b/sc/source/filter/oox/ooxformulaparser.cxx
index 73e3565933b1..85470a6049d0 100644
--- a/sc/source/filter/oox/ooxformulaparser.cxx
+++ b/sc/source/filter/oox/ooxformulaparser.cxx
@@ -147,7 +147,7 @@ Sequence< FormulaToken > SAL_CALL OOXMLFormulaParser::parseFormula(
if( !mxParserImpl )
{
Reference< XMultiServiceFactory > xModelFactory( mxComponent, UNO_QUERY_THROW );
- mxParserImpl.reset( new OOXMLFormulaParserImpl( xModelFactory ) );
+ mxParserImpl = std::make_shared<OOXMLFormulaParserImpl>( xModelFactory );
}
return mxParserImpl->parseFormula( rFormula,
ScAddress(rReferencePos.Column, rReferencePos.Row, rReferencePos.Sheet) );
diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx
index 9aca019ab8ce..a2e5d8d66360 100644
--- a/sc/source/filter/oox/pivotcachebuffer.cxx
+++ b/sc/source/filter/oox/pivotcachebuffer.cxx
@@ -980,7 +980,7 @@ void PivotCache::importPCDSheetSource( SequenceInputStream& rStrm, const Relatio
PivotCacheField& PivotCache::createCacheField()
{
- PivotCacheFieldVector::value_type xCacheField( new PivotCacheField( *this, true/*bIsDatabaseField*/ ) );
+ PivotCacheFieldVector::value_type xCacheField = std::make_shared<PivotCacheField>( *this, true/*bIsDatabaseField*/ );
maFields.push_back( xCacheField );
return *xCacheField;
}
@@ -1213,7 +1213,7 @@ PivotCache& PivotCacheBuffer::createPivotCache( sal_Int32 nCacheId )
{
maCacheIds.push_back( nCacheId );
PivotCacheMap::mapped_type& rxCache = maCaches[ nCacheId ];
- rxCache.reset( new PivotCache( *this ) );
+ rxCache = std::make_shared<PivotCache>( *this );
return *rxCache;
}
diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx
index 3f62a6313b42..8bfa5f206ed3 100644
--- a/sc/source/filter/oox/pivottablebuffer.cxx
+++ b/sc/source/filter/oox/pivottablebuffer.cxx
@@ -1185,14 +1185,14 @@ void PivotTable::importPTDataField( SequenceInputStream& rStrm )
PivotTableField& PivotTable::createTableField()
{
sal_Int32 nFieldIndex = static_cast< sal_Int32 >( maFields.size() );
- PivotTableFieldVector::value_type xTableField( new PivotTableField( *this, nFieldIndex ) );
+ PivotTableFieldVector::value_type xTableField = std::make_shared<PivotTableField>( *this, nFieldIndex );
maFields.push_back( xTableField );
return *xTableField;
}
PivotTableFilter& PivotTable::createTableFilter()
{
- PivotTableFilterVector::value_type xTableFilter( new PivotTableFilter( *this ) );
+ PivotTableFilterVector::value_type xTableFilter = std::make_shared<PivotTableFilter>( *this );
maFilters.push_back( xTableFilter );
return *xTableFilter;
}
@@ -1443,7 +1443,7 @@ PivotTableBuffer::PivotTableBuffer( const WorkbookHelper& rHelper ) :
PivotTable& PivotTableBuffer::createPivotTable()
{
- PivotTableVector::value_type xTable( new PivotTable( *this ) );
+ PivotTableVector::value_type xTable = std::make_shared<PivotTable>( *this );
maTables.push_back( xTable );
return *xTable;
}
diff --git a/sc/source/filter/oox/querytablebuffer.cxx b/sc/source/filter/oox/querytablebuffer.cxx
index d0940956699e..cd3a415815b2 100644
--- a/sc/source/filter/oox/querytablebuffer.cxx
+++ b/sc/source/filter/oox/querytablebuffer.cxx
@@ -268,7 +268,7 @@ QueryTableBuffer::QueryTableBuffer( const WorksheetHelper& rHelper ) :
QueryTable& QueryTableBuffer::createQueryTable()
{
- QueryTableVector::value_type xQueryTable( new QueryTable( *this ) );
+ QueryTableVector::value_type xQueryTable = std::make_shared<QueryTable>( *this );
maQueryTables.push_back( xQueryTable );
return *xQueryTable;
}
diff --git a/sc/source/filter/oox/revisionfragment.cxx b/sc/source/filter/oox/revisionfragment.cxx
index 70dd03b671e7..6c6edf3e4a34 100644
--- a/sc/source/filter/oox/revisionfragment.cxx
+++ b/sc/source/filter/oox/revisionfragment.cxx
@@ -74,7 +74,7 @@ protected:
{
if (nElement == XLS_TOKEN(is))
{
- mxRichString.reset(new RichString(*this));
+ mxRichString = std::make_shared<RichString>(*this);
return new RichStringContext(*this, mxRichString);
}
diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx
index 49e8d7297dc1..a27c0ff12ce6 100644
--- a/sc/source/filter/oox/richstring.cxx
+++ b/sc/source/filter/oox/richstring.cxx
@@ -64,7 +64,7 @@ void RichStringPortion::setText( const OUString& rText )
FontRef const & RichStringPortion::createFont()
{
- mxFont.reset( new Font( *this, false ) );
+ mxFont = std::make_shared<Font>( *this, false );
return mxFont;
}
@@ -417,14 +417,14 @@ std::unique_ptr<EditTextObject> RichString::convert( ScEditEngineDefaulter& rEE,
RichStringPortionRef RichString::createPortion()
{
- RichStringPortionRef xPortion( new RichStringPortion( *this ) );
+ RichStringPortionRef xPortion = std::make_shared<RichStringPortion>( *this );
maTextPortions.push_back( xPortion );
return xPortion;
}
RichStringPhoneticRef RichString::createPhonetic()
{
- RichStringPhoneticRef xPhonetic( new RichStringPhonetic( *this ) );
+ RichStringPhoneticRef xPhonetic = std::make_shared<RichStringPhonetic>( *this );
maPhonPortions.push_back( xPhonetic );
return xPhonetic;
}
diff --git a/sc/source/filter/oox/scenariobuffer.cxx b/sc/source/filter/oox/scenariobuffer.cxx
index bdb99ff94209..c8496622cad2 100644
--- a/sc/source/filter/oox/scenariobuffer.cxx
+++ b/sc/source/filter/oox/scenariobuffer.cxx
@@ -179,7 +179,7 @@ void SheetScenarios::importScenarios( SequenceInputStream& rStrm )
Scenario& SheetScenarios::createScenario()
{
bool bIsActive = maScenarios.size() == static_cast<sal_uInt32>(maModel.mnShown);
- ScenarioVector::value_type xScenario( new Scenario( *this, mnSheet, bIsActive ) );
+ ScenarioVector::value_type xScenario = std::make_shared<Scenario>( *this, mnSheet, bIsActive );
maScenarios.push_back( xScenario );
return *xScenario;
}
@@ -198,7 +198,7 @@ SheetScenarios& ScenarioBuffer::createSheetScenarios( sal_Int16 nSheet )
{
SheetScenariosMap::mapped_type& rxSheetScens = maSheetScenarios[ nSheet ];
if( !rxSheetScens )
- rxSheetScens.reset( new SheetScenarios( *this, nSheet ) );
+ rxSheetScens = std::make_shared<SheetScenarios>( *this, nSheet );
return *rxSheetScens;
}
diff --git a/sc/source/filter/oox/sharedstringsbuffer.cxx b/sc/source/filter/oox/sharedstringsbuffer.cxx
index 4162cb44b6d0..72d40c6d1bcc 100644
--- a/sc/source/filter/oox/sharedstringsbuffer.cxx
+++ b/sc/source/filter/oox/sharedstringsbuffer.cxx
@@ -28,7 +28,7 @@ SharedStringsBuffer::SharedStringsBuffer( const WorkbookHelper& rHelper ) :
RichStringRef SharedStringsBuffer::createRichString()
{
- RichStringRef xString( new RichString( *this ) );
+ RichStringRef xString = std::make_shared<RichString>( *this );
maStrings.push_back( xString );
return xString;
}
diff --git a/sc/source/filter/oox/sheetdatacontext.cxx b/sc/source/filter/oox/sheetdatacontext.cxx
index c89a37d2d908..7ca914e6ad4b 100644
--- a/sc/source/filter/oox/sheetdatacontext.cxx
+++ b/sc/source/filter/oox/sheetdatacontext.cxx
@@ -91,7 +91,7 @@ ContextHandlerRef SheetDataContext::onCreateContext( sal_Int32 nElement, const A
switch( nElement )
{
case XLS_TOKEN( is ):
- mxInlineStr.reset( new RichString( *this ) );
+ mxInlineStr = std::make_shared<RichString>( *this );
return new RichStringContext( *this, mxInlineStr );
case XLS_TOKEN( v ):
return this; // characters contain cell value
@@ -501,7 +501,7 @@ void SheetDataContext::importCellRString( SequenceInputStream& rStrm, CellType e
if( readCellHeader( rStrm, eCellType ) )
{
maCellData.mnCellType = XML_inlineStr;
- RichStringRef xString( new RichString( *this ) );
+ RichStringRef xString = std::make_shared<RichString>( *this );
xString->importString( rStrm, true );
xString->finalizeImport();
mrSheetData.setStringCell( maCellData, xString );
@@ -524,7 +524,7 @@ void SheetDataContext::importCellString( SequenceInputStream& rStrm, CellType eC
{
maCellData.mnCellType = XML_inlineStr;
// always import the string, stream will point to formula afterwards, if existing
- RichStringRef xString( new RichString( *this ) );
+ RichStringRef xString = std::make_shared<RichString>( *this );
xString->importString( rStrm, false );
xString->finalizeImport();
if( eCellType == CELLTYPE_FORMULA )
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index b080965e79b1..c0b01df8be3e 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1702,7 +1702,7 @@ Fill::Fill( const WorkbookHelper& rHelper, bool bDxf ) :
void Fill::importPatternFill( const AttributeList& rAttribs )
{
- mxPatternModel.reset( new PatternFillModel( mbDxf ) );
+ mxPatternModel = std::make_shared<PatternFillModel>( mbDxf );
mxPatternModel->mnPattern = rAttribs.getToken( XML_patternType, XML_none );
if( mbDxf )
mxPatternModel->mbPatternUsed = rAttribs.hasAttribute( XML_patternType );
@@ -1730,7 +1730,7 @@ void Fill::importBgColor( const AttributeList& rAttribs )
void Fill::importGradientFill( const AttributeList& rAttribs )
{
- mxGradientModel.reset( new GradientFillModel );
+ mxGradientModel = std::make_shared<GradientFillModel>();
mxGradientModel->mnType = rAttribs.getToken( XML_type, XML_linear );
mxGradientModel->mfAngle = rAttribs.getDouble( XML_degree, 0.0 );
mxGradientModel->mfLeft = rAttribs.getDouble( XML_left, 0.0 );
@@ -1752,7 +1752,7 @@ void Fill::importFill( SequenceInputStream& rStrm )
sal_Int32 nPattern = rStrm.readInt32();
if( nPattern == BIFF12_FILL_GRADIENT )
{
- mxGradientModel.reset( new GradientFillModel );
+ mxGradientModel = std::make_shared<GradientFillModel>();
sal_Int32 nStopCount;
rStrm.skip( 16 );
mxGradientModel->readGradient( rStrm );
@@ -1762,7 +1762,7 @@ void Fill::importFill( SequenceInputStream& rStrm )
}
else
{
- mxPatternModel.reset( new PatternFillModel( mbDxf ) );
+ mxPatternModel = std::make_shared<PatternFillModel>( mbDxf );
mxPatternModel->setBiffPattern( nPattern );
rStrm >> mxPatternModel->maPatternColor >> mxPatternModel->maFillColor;
}
@@ -1772,7 +1772,7 @@ void Fill::importDxfPattern( SequenceInputStream& rStrm )
{
SAL_WARN_IF( !mbDxf, "sc", "Fill::importDxfPattern - missing conditional formatting flag" );
if( !mxPatternModel )
- mxPatternModel.reset( new PatternFillModel( mbDxf ) );
+ mxPatternModel = std::make_shared<PatternFillModel>( mbDxf );
mxPatternModel->setBiffPattern( rStrm.readuInt8() );
mxPatternModel->mbPatternUsed = true;
}
@@ -1781,7 +1781,7 @@ void Fill::importDxfFgColor( SequenceInputStream& rStrm )
{
SAL_WARN_IF( !mbDxf, "sc", "Fill::importDxfFgColor - missing conditional formatting flag" );
if( !mxPatternModel )
- mxPatternModel.reset( new PatternFillModel( mbDxf ) );
+ mxPatternModel = std::make_shared<PatternFillModel>( mbDxf );
mxPatternModel->maPatternColor.importColor( rStrm );
mxPatternModel->mbPattColorUsed = true;
}
@@ -1790,7 +1790,7 @@ void Fill::importDxfBgColor( SequenceInputStream& rStrm )
{
SAL_WARN_IF( !mbDxf, "sc", "Fill::importDxfBgColor - missing conditional formatting flag" );
if( !mxPatternModel )
- mxPatternModel.reset( new PatternFillModel( mbDxf ) );
+ mxPatternModel = std::make_shared<PatternFillModel>( mbDxf );
mxPatternModel->maFillColor.importColor( rStrm );
mxPatternModel->mbFillColorUsed = true;
}
@@ -1799,7 +1799,7 @@ void Fill::importDxfGradient( SequenceInputStream& rStrm )
{
SAL_WARN_IF( !mbDxf, "sc", "Fill::importDxfGradient - missing conditional formatting flag" );
if( !mxGradientModel )
- mxGradientModel.reset( new GradientFillModel );
+ mxGradientModel = std::make_shared<GradientFillModel>();
mxGradientModel->readGradient( rStrm );
}
@@ -1807,7 +1807,7 @@ void Fill::importDxfStop( SequenceInputStream& rStrm )
{
SAL_WARN_IF( !mbDxf, "sc", "Fill::importDxfStop - missing conditional formatting flag" );
if( !mxGradientModel )
- mxGradientModel.reset( new GradientFillModel );
+ mxGradientModel = std::make_shared<GradientFillModel>();
mxGradientModel->readGradientStop( rStrm, true );
}
@@ -2222,21 +2222,21 @@ Dxf::Dxf( const WorkbookHelper& rHelper ) :
FontRef const & Dxf::createFont( bool bAlwaysNew )
{
if( bAlwaysNew || !mxFont )
- mxFont.reset( new Font( *this, true ) );
+ mxFont = std::make_shared<Font>( *this, true );
return mxFont;
}
BorderRef const & Dxf::createBorder( bool bAlwaysNew )
{
if( bAlwaysNew || !mxBorder )
- mxBorder.reset( new Border( *this, true ) );
+ mxBorder = std::make_shared<Border>( *this, true );
return mxBorder;
}
FillRef const & Dxf::createFill( bool bAlwaysNew )
{
if( bAlwaysNew || !mxFill )
- mxFill.reset( new Fill( *this, true ) );
+ mxFill = std::make_shared<Fill>( *this, true );
return mxFill;
}
@@ -2527,7 +2527,7 @@ CellStyleBuffer::CellStyleBuffer( const WorkbookHelper& rHelper ) :
CellStyleRef CellStyleBuffer::importCellStyle( const AttributeList& rAttribs )
{
- CellStyleRef xCellStyle( new CellStyle( *this ) );
+ CellStyleRef xCellStyle = std::make_shared<CellStyle>( *this );
xCellStyle->importCellStyle( rAttribs );
insertCellStyle( xCellStyle );
return xCellStyle;
@@ -2535,7 +2535,7 @@ CellStyleRef CellStyleBuffer::importCellStyle( const AttributeList& rAttribs )
CellStyleRef CellStyleBuffer::importCellStyle( SequenceInputStream& rStrm )
{
- CellStyleRef xCellStyle( new CellStyle( *this ) );
+ CellStyleRef xCellStyle = std::make_shared<CellStyle>( *this );
xCellStyle->importCellStyle( rStrm );
insertCellStyle( xCellStyle );
return xCellStyle;
@@ -2702,7 +2702,7 @@ StylesBuffer::StylesBuffer( const WorkbookHelper& rHelper ) :
FontRef StylesBuffer::createFont()
{
- FontRef xFont( new Font( *this, false ) );
+ FontRef xFont = std::make_shared<Font>( *this, false );
maFonts.push_back( xFont );
return xFont;
}
@@ -2719,42 +2719,42 @@ sal_Int32 StylesBuffer::nextFreeNumFmtId()
BorderRef StylesBuffer::createBorder()
{
- BorderRef xBorder( new Border( *this, false ) );
+ BorderRef xBorder = std::make_shared<Border>( *this, false );
maBorders.push_back( xBorder );
return xBorder;
}
FillRef StylesBuffer::createFill()
{
- FillRef xFill( new Fill( *this, false ) );
+ FillRef xFill = std::make_shared<Fill>( *this, false );
maFills.push_back( xFill );
return xFill;
}
XfRef StylesBuffer::createCellXf()
{
- XfRef xXf( new Xf( *this ) );
+ XfRef xXf = std::make_shared<Xf>( *this );
maCellXfs.push_back( xXf );
return xXf;
}
XfRef StylesBuffer::createStyleXf()
{
- XfRef xXf( new Xf( *this ) );
+ XfRef xXf = std::make_shared<Xf>( *this );
maStyleXfs.push_back( xXf );
return xXf;
}
DxfRef StylesBuffer::createDxf()
{
- DxfRef xDxf( new Dxf( *this ) );
+ DxfRef xDxf = std::make_shared<Dxf>( *this );
maDxfs.push_back( xDxf );
return xDxf;
}
DxfRef StylesBuffer::createExtDxf()
{
- DxfRef xDxf( new Dxf( *this ) );
+ DxfRef xDxf = std::make_shared<Dxf>( *this );
maExtDxfs.push_back( xDxf );
return xDxf;
}
diff --git a/sc/source/filter/oox/tablebuffer.cxx b/sc/source/filter/oox/tablebuffer.cxx
index 132ffbc16a7a..97e1ae35f187 100644
--- a/sc/source/filter/oox/tablebuffer.cxx
+++ b/sc/source/filter/oox/tablebuffer.cxx
@@ -156,7 +156,7 @@ TableBuffer::TableBuffer( const WorkbookHelper& rHelper ) :
Table& TableBuffer::createTable()
{
- TableVector::value_type xTable( new Table( *this ) );
+ TableVector::value_type xTable = std::make_shared<Table>( *this );
maTables.push_back( xTable );
return *xTable;
}
diff --git a/sc/source/filter/oox/tablecolumnsbuffer.cxx b/sc/source/filter/oox/tablecolumnsbuffer.cxx
index f21a869f4fe8..318befdaa951 100644
--- a/sc/source/filter/oox/tablecolumnsbuffer.cxx
+++ b/sc/source/filter/oox/tablecolumnsbuffer.cxx
@@ -70,7 +70,7 @@ void TableColumns::importTableColumns( SequenceInputStream& /*rStrm*/ )
TableColumn& TableColumns::createTableColumn()
{
- TableColumnVector::value_type xTableColumn( new TableColumn( *this ) );
+ TableColumnVector::value_type xTableColumn = std::make_shared<TableColumn>( *this );
maTableColumnVector.push_back( xTableColumn );
return *xTableColumn;
}
@@ -102,7 +102,7 @@ TableColumnsBuffer::TableColumnsBuffer( const WorkbookHelper& rHelper ) :
TableColumns& TableColumnsBuffer::createTableColumns()
{
- TableColumnsVector::value_type xTableColumns( new TableColumns( *this ) );
+ TableColumnsVector::value_type xTableColumns = std::make_shared<TableColumns>( *this );
maTableColumnsVector.push_back( xTableColumns );
return *xTableColumns;
}
diff --git a/sc/source/filter/oox/viewsettings.cxx b/sc/source/filter/oox/viewsettings.cxx
index 7bca06c08169..22294d7f812e 100644
--- a/sc/source/filter/oox/viewsettings.cxx
+++ b/sc/source/filter/oox/viewsettings.cxx
@@ -166,7 +166,7 @@ PaneSelectionModel& SheetViewModel::createPaneSelection( sal_Int32 nPaneId )
{
PaneSelectionModelMap::mapped_type& rxPaneSel = maPaneSelMap[ nPaneId ];
if( !rxPaneSel )
- rxPaneSel.reset( new PaneSelectionModel );
+ rxPaneSel = std::make_shared<PaneSelectionModel>();
return *rxPaneSel;
}
@@ -448,7 +448,7 @@ bool SheetViewSettings::isSheetRightToLeft() const
SheetViewModelRef SheetViewSettings::createSheetView()
{
- SheetViewModelRef xModel( new SheetViewModel );
+ SheetViewModelRef xModel = std::make_shared<SheetViewModel>();
maSheetViews.push_back( xModel );
return xModel;
}
@@ -558,7 +558,7 @@ void ViewSettings::finalizeImport()
SheetViewModelRef& rxActiveSheetView = maSheetViews[ nActiveSheet ];
OSL_ENSURE( rxActiveSheetView.get(), "ViewSettings::finalizeImport - missing active sheet view settings" );
if( !rxActiveSheetView )
- rxActiveSheetView.reset( new SheetViewModel );
+ rxActiveSheetView = std::make_shared<SheetViewModel>();
Reference< XIndexContainer > xContainer = IndexedPropertyValues::create( getBaseFilter().getComponentContext() );
if( xContainer.is() ) try
@@ -626,7 +626,7 @@ sal_Int16 ViewSettings::getActiveCalcSheet() const
WorkbookViewModel& ViewSettings::createWorkbookView()
{
- WorkbookViewModelRef xModel( new WorkbookViewModel );
+ WorkbookViewModelRef xModel = std::make_shared<WorkbookViewModel>();
maBookViews.push_back( xModel );
return *xModel;
}
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index f13f851abb00..1971b0abf000 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -294,7 +294,7 @@ public:
}
const ISegmentProgressBarRef& wrapProgress( const ISegmentProgressBarRef &xProgress )
{
- aSegments.push_back( ISegmentProgressBarRef( new ProgressWrapper( xProgress ) ) );
+ aSegments.push_back( std::make_shared<ProgressWrapper>( xProgress ) );
return aSegments.back();
}
virtual void Invoke() override
@@ -460,7 +460,7 @@ void WorkbookFragment::finalizeImport()
Reference< XInputStream > xInStrm = getBaseFilter().openInputStream( aVbaFragmentPath );
if( xInStrm.is() )
{
- StorageRef xPrjStrg( new ::oox::ole::OleStorage( getBaseFilter().getComponentContext(), xInStrm, false ) );
+ StorageRef xPrjStrg = std::make_shared<::oox::ole::OleStorage>( getBaseFilter().getComponentContext(), xInStrm, false );
setVbaProjectStorage( xPrjStrg );
getBaseFilter().getVbaProject().readVbaModules( *xPrjStrg );
}
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index ff67a82a8b56..f651788be555 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -558,7 +558,7 @@ void WorkbookGlobals::initialize()
mxWorkbookSettings.reset( new WorkbookSettings( *this ) );
mxViewSettings.reset( new ViewSettings( *this ) );
mxWorksheets.reset( new WorksheetBuffer( *this ) );
- mxTheme.reset( new ThemeBuffer( *this ) );
+ mxTheme = std::make_shared<ThemeBuffer>( *this );
mxStyles.reset( new StylesBuffer( *this ) );
mxSharedStrings.reset( new SharedStringsBuffer( *this ) );
mxExtLinks.reset( new ExternalLinkBuffer( *this ) );
@@ -640,7 +640,7 @@ WorkbookHelper::~WorkbookHelper()
/*static*/ WorkbookGlobalsRef WorkbookHelper::constructGlobals( ExcelFilter& rFilter )
{
- WorkbookGlobalsRef xBookGlob( new WorkbookGlobals( rFilter ) );
+ WorkbookGlobalsRef xBookGlob = std::make_shared<WorkbookGlobals>( rFilter );
if( !xBookGlob->isValid() )
xBookGlob.reset();
return xBookGlob;
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 5c0c713281be..3f2fd625b575 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1370,7 +1370,7 @@ ScDocument& WorksheetHelper::getScDocument()
/*static*/ WorksheetGlobalsRef WorksheetHelper::constructGlobals( const WorkbookHelper& rHelper,
const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, SCTAB nSheet )
{
- WorksheetGlobalsRef xSheetGlob( new WorksheetGlobals( rHelper, rxProgressBar, eSheetType, nSheet ) );
+ WorksheetGlobalsRef xSheetGlob = std::make_shared<WorksheetGlobals>( rHelper, rxProgressBar, eSheetType, nSheet );
if( !xSheetGlob->isValidSheet() )
xSheetGlob.reset();
return xSheetGlob;
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index ec83fec61fad..92fbdc2a21f9 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -641,7 +641,7 @@ ScEEParser::~ScEEParser()
void ScEEParser::NewActEntry( const ScEEParseEntry* pE )
{ // New free-flying mxActEntry
- mxActEntry.reset(new ScEEParseEntry(pPool));
+ mxActEntry = std::make_shared<ScEEParseEntry>(pPool);
mxActEntry->aSel.nStartPara = (pE ? pE->aSel.nEndPara + 1 : 0);
mxActEntry->aSel.nStartPos = 0;
}
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index dfbe894ab4f8..2fa44cb3a9b9 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -778,7 +778,7 @@ static sal_uInt8 lcl_GetVerAlignFromItemSet( const SfxItemSet& rItemSet )
}
XclTxo::XclTxo( const OUString& rString, sal_uInt16 nFontIx ) :
- mpString( new XclExpString( rString ) ),
+ mpString( std::make_shared<XclExpString>( rString ) ),
mnRotation( EXC_OBJ_ORIENT_NONE ),
mnHorAlign( EXC_OBJ_HOR_LEFT ),
mnVerAlign( EXC_OBJ_VER_TOP )
@@ -1744,7 +1744,7 @@ void XclExpFileEncryption::WriteBody( XclExpStream& rStrm )
sal_uInt8 pnDocId[16];
sal_uInt8 pnSalt[16];
sal_uInt8 pnSaltHash[16];
- XclExpEncrypterRef xEnc( new XclExpBiff8Encrypter(mrRoot) );
+ XclExpEncrypterRef xEnc = std::make_shared<XclExpBiff8Encrypter>(mrRoot);
xEnc->GetDocId(pnDocId);
xEnc->GetSalt(pnSalt);
xEnc->GetSaltDigest(pnSaltHash);
diff --git a/sc/source/filter/xml/XMLStylesImportHelper.cxx b/sc/source/filter/xml/XMLStylesImportHelper.cxx
index 527dbb6aa758..21fb889e8e43 100644
--- a/sc/source/filter/xml/XMLStylesImportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesImportHelper.cxx
@@ -55,49 +55,49 @@ void ScMyStyleRanges::AddRange(const ScRange& rRange, const sal_Int16 nType)
case util::NumberFormat::NUMBER:
{
if (!mpNumberList)
- mpNumberList.reset(new ScSimpleRangeList);
+ mpNumberList = std::make_shared<ScSimpleRangeList>();
mpNumberList->addRange(rRange);
}
break;
case util::NumberFormat::TEXT:
{
if (!mpTextList)
- mpTextList.reset(new ScSimpleRangeList);
+ mpTextList = std::make_shared<ScSimpleRangeList>();
mpTextList->addRange(rRange);
}
break;
case util::NumberFormat::TIME:
{
if (!mpTimeList)
- mpTimeList.reset(new ScSimpleRangeList);
+ mpTimeList = std::make_shared<ScSimpleRangeList>();
mpTimeList->addRange(rRange);
}
break;
case util::NumberFormat::DATETIME:
{
if (!mpDateTimeList)
- mpDateTimeList.reset(new ScSimpleRangeList);
+ mpDateTimeList = std::make_shared<ScSimpleRangeList>();
mpDateTimeList->addRange(rRange);
}
break;
case util::NumberFormat::PERCENT:
{
if (!mpPercentList)
- mpPercentList.reset(new ScSimpleRangeList);
+ mpPercentList = std::make_shared<ScSimpleRangeList>();
mpPercentList->addRange(rRange);
}
break;
case util::NumberFormat::LOGICAL:
{
if (!mpLogicalList)
- mpLogicalList.reset(new ScSimpleRangeList);
+ mpLogicalList = std::make_shared<ScSimpleRangeList>();
mpLogicalList->addRange(rRange);
}
break;
case util::NumberFormat::UNDEFINED:
{
if (!mpUndefinedList)
- mpUndefinedList.reset(new ScSimpleRangeList);
+ mpUndefinedList = std::make_shared<ScSimpleRangeList>();
mpUndefinedList->addRange(rRange);
}
break;
diff --git a/sc/source/filter/xml/XMLStylesImportHelper.hxx b/sc/source/filter/xml/XMLStylesImportHelper.hxx
index 92823a471c4a..4a8748ad12ff 100644
--- a/sc/source/filter/xml/XMLStylesImportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesImportHelper.hxx
@@ -69,7 +69,7 @@ struct ScMyCurrencyStyle
std::shared_ptr<ScSimpleRangeList> mpRanges;
ScMyCurrencyStyle() :
- mpRanges(new ScSimpleRangeList)
+ mpRanges(std::make_shared<ScSimpleRangeList>())
{}
};
diff --git a/sc/source/ui/dataprovider/dataprovider.cxx b/sc/source/ui/dataprovider/dataprovider.cxx
index 737cbdc0af4d..3d0f56265be5 100644
--- a/sc/source/ui/dataprovider/dataprovider.cxx
+++ b/sc/source/ui/dataprovider/dataprovider.cxx
@@ -128,7 +128,7 @@ void ExternalDataSource::setDBData(const OUString& rDBName)
{
if (!mpDBDataManager)
{
- mpDBDataManager.reset(new ScDBDataManager(rDBName, mpDoc));
+ mpDBDataManager = std::make_shared<ScDBDataManager>(rDBName, mpDoc);
}
else
{
diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx
index 8b896b466ab6..76cffa4664a5 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -199,7 +199,7 @@ IMPL_STATIC_LINK( SearchResultsDlg, OnShowToggled, weld::ToggleButton&, rButton,
SearchResultsDlgWrapper::SearchResultsDlgWrapper(
vcl::Window* _pParent, sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* /*pInfo*/)
: SfxChildWindow(_pParent, nId)
- , m_xDialog(new SearchResultsDlg(pBindings, _pParent->GetFrameWeld()))
+ , m_xDialog(std::make_shared<SearchResultsDlg>(pBindings, _pParent->GetFrameWeld()))
{
SetController(m_xDialog);
}
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index c164c548424e..b06fefbf687d 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -687,7 +687,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
ScMatrixToken aToken(xMat);
if (!pArray)
- pArray.reset(new ScTokenArray(mxFakeDoc.get()));
+ pArray = std::make_shared<ScTokenArray>(mxFakeDoc.get());
pArray->AddToken(aToken);
bFirstTab = false;
@@ -782,7 +782,7 @@ void ScExternalRefCache::setCellData(sal_uInt16 nFileId, const OUString& rTabNam
TableTypeRef& pTableData = rDoc.maTables[itrTabName->second];
if (!pTableData.get())
- pTableData.reset(new Table);
+ pTableData = std::make_shared<Table>();
pTableData->setCell(nCol, nRow, pToken, nFmtIndex);
pTableData->setCachedCell(nCol, nRow);
@@ -820,7 +820,7 @@ void ScExternalRefCache::setCellRangeData(sal_uInt16 nFileId, const ScRange& rRa
{
TableTypeRef& pTabData = rDoc.maTables[i];
if (!pTabData.get())
- pTabData.reset(new Table);
+ pTabData = std::make_shared<Table>();
const ScMatrixRef& pMat = rItem.mpRangeData;
SCSIZE nMatCols, nMatRows;
@@ -1318,7 +1318,7 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF
// specified table found.
if( pnIndex ) *pnIndex = nIndex;
if (bCreateNew && !rDoc.maTables[nIndex])
- rDoc.maTables[nIndex].reset(new Table);
+ rDoc.maTables[nIndex] = std::make_shared<Table>();
return rDoc.maTables[nIndex];
}
@@ -1352,7 +1352,7 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF
OUString aTabNameUpper = ScGlobal::pCharClass->uppercase(rTabName);
nIndex = rDoc.maTables.size();
if( pnIndex ) *pnIndex = nIndex;
- TableTypeRef pTab(new Table);
+ TableTypeRef pTab = std::make_shared<Table>();
rDoc.maTables.push_back(pTab);
rDoc.maTableNames.emplace_back(aTabNameUpper, rTabName);
rDoc.maTableNameIndex.emplace(aTabNameUpper, nIndex);
@@ -2004,7 +2004,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokens(
if (!pSrcDoc)
{
// Source document is not reachable. Throw a reference error.
- pArray.reset(new ScTokenArray(maRefCache.getFakeDoc()));
+ pArray = std::make_shared<ScTokenArray>(maRefCache.getFakeDoc());
pArray->AddToken(FormulaErrorToken(FormulaError::NoRef));
return pArray;
}
@@ -2248,7 +2248,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokensFromSr
if (!pSrcDoc->GetTable(rTabName, nTab1))
{
// specified table name doesn't exist in the source document.
- pArray.reset(new ScTokenArray(pSrcDoc));
+ pArray = std::make_shared<ScTokenArray>(pSrcDoc);
pArray->AddToken(FormulaErrorToken(FormulaError::NoRef));
return pArray;
}
@@ -2296,7 +2296,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokensFromSr
// register the source document with the link manager if it's a new
// source.
- ScExternalRefCache::TokenArrayRef pNew(new ScTokenArray(pSrcDoc));
+ ScExternalRefCache::TokenArrayRef pNew = std::make_shared<ScTokenArray>(pSrcDoc);
ScTokenArray aCode(*pRangeData->GetCode());
FormulaTokenArrayPlainIterator aIter(aCode);
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 069642c55268..bf26953aa665 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -328,8 +328,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
if( rMarkList.GetMark(0) != nullptr )
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- std::shared_ptr<SfxRequest> pRequest;
- pRequest.reset(new SfxRequest(rReq));
+ std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq);
if( pObj->GetObjIdentifier() == OBJ_CAPTION )
{
@@ -456,8 +455,7 @@ void ScDrawShell::ExecuteLineDlg( const SfxRequest& rReq )
const SdrObject* pObj = nullptr;
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- std::shared_ptr<SfxRequest> pRequest;
- pRequest.reset(new SfxRequest(rReq));
+ std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq);
if( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
@@ -493,8 +491,7 @@ void ScDrawShell::ExecuteAreaDlg( const SfxRequest& rReq )
ScDrawView* pView = pViewData->GetScDrawView();
bool bHasMarked = pView->AreObjectsMarked();
- std::shared_ptr<SfxRequest> pRequest;
- pRequest.reset(new SfxRequest(rReq));
+ std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq);
SfxItemSet aNewAttr( pView->GetDefaultAttr() );
if( bHasMarked )
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index f59a5b9cd9f5..624eb67cda1b 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -363,7 +363,7 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult
std::shared_ptr<formula::FormulaCompiler> ScFormulaDlg::getCompiler() const
{
if (!m_xCompiler)
- m_xCompiler.reset( new ScCompiler( m_pDoc, m_CursorPos, m_pDoc->GetGrammar()));
+ m_xCompiler = std::make_shared<ScCompiler>( m_pDoc, m_CursorPos, m_pDoc->GetGrammar());
return m_xCompiler;
}
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx
index 84f8ef182b54..d5bf831e3b83 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.cxx
+++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx
@@ -74,7 +74,7 @@ void ScRetypePassDlg::SetDataFromDocument(const ScDocument& rDoc)
DeleteSheets();
const ScDocProtection* pDocProtect = rDoc.GetDocProtection();
if (pDocProtect && pDocProtect->isProtected())
- mpDocItem.reset(new ScDocProtection(*pDocProtect));
+ mpDocItem = std::make_shared<ScDocProtection>(*pDocProtect);
SCTAB nTabCount = rDoc.GetTableCount();
maTableItems.reserve(nTabCount);
@@ -86,7 +86,7 @@ void ScRetypePassDlg::SetDataFromDocument(const ScDocument& rDoc)
const ScTableProtection* pTabProtect = rDoc.GetTabProtection(i);
if (pTabProtect && pTabProtect->isProtected())
- aTabItem.mpProtect.reset(new ScTableProtection(*pTabProtect));
+ aTabItem.mpProtect = std::make_shared<ScTableProtection>(*pTabProtect);
maTableItems.push_back(aTabItem);
maSheets.emplace_back(new PassFragment(mxSheetsBox.get()));
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 9be81221a7b2..0301ca09a229 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -814,7 +814,7 @@ class Tokens2RangeString
{
public:
Tokens2RangeString(ScDocument* pDoc, FormulaGrammar::Grammar eGram, sal_Unicode cRangeSep) :
- mpRangeStr(new OUStringBuffer),
+ mpRangeStr(std::make_shared<OUStringBuffer>()),
mpDoc(pDoc),
meGrammar(eGram),
mcRangeSep(cRangeSep),
@@ -859,7 +859,7 @@ class Tokens2RangeStringXML
{
public:
explicit Tokens2RangeStringXML(ScDocument* pDoc) :
- mpRangeStr(new OUStringBuffer),
+ mpRangeStr(std::make_shared<OUStringBuffer>()),
mpDoc(pDoc),
mbFirst(true)
{
@@ -1566,7 +1566,7 @@ class InsertTabNumber
{
public:
InsertTabNumber() :
- mpTabNumVector(new vector<SCTAB>)
+ mpTabNumVector(std::make_shared<vector<SCTAB>>())
{
}
@@ -3006,7 +3006,7 @@ class GenerateLabelStrings
public:
GenerateLabelStrings(const ScDocument* pDoc, sal_Int32 nSize, chart2::data::LabelOrigin eOrigin, bool bColumn) :
mpDoc(pDoc),
- mpLabels(new Sequence<OUString>(nSize)),
+ mpLabels(std::make_shared<Sequence<OUString>>(nSize)),
meOrigin(eOrigin),
mnCount(0),
mbColumn(bColumn) {}
diff --git a/sc/source/ui/view/scextopt.cxx b/sc/source/ui/view/scextopt.cxx
index 4f8fa5eae9dc..7e5a7fb2268a 100644
--- a/sc/source/ui/view/scextopt.cxx
+++ b/sc/source/ui/view/scextopt.cxx
@@ -105,7 +105,7 @@ ScExtTabSettings& ScExtTabSettingsCont::GetOrCreateTabSettings( SCTAB nTab )
{
ScExtTabSettingsRef& rxTabSett = maMap[ nTab ];
if( !rxTabSett )
- rxTabSett.reset( new ScExtTabSettings );
+ rxTabSett = std::make_shared<ScExtTabSettings>();
return *rxTabSett;
}
@@ -118,7 +118,7 @@ void ScExtTabSettingsCont::CopyFromMap( const ScExtTabSettingsMap& rMap )
{
maMap.clear();
for( const auto& [rTab, rxSettings] : rMap )
- maMap[ rTab ].reset( new ScExtTabSettings( *rxSettings ) );
+ maMap[ rTab ] = std::make_shared<ScExtTabSettings>( *rxSettings );
}
/** Implementation struct for ScExtDocOptions containing all members. */