diff options
Diffstat (limited to 'sc')
87 files changed, 312 insertions, 484 deletions
diff --git a/sc/inc/chartlock.hxx b/sc/inc/chartlock.hxx index 497942bfadba..c5383a645ad6 100644 --- a/sc/inc/chartlock.hxx +++ b/sc/inc/chartlock.hxx @@ -65,7 +65,7 @@ public: private: ScDocument* mpDoc; Timer maTimer; - std::auto_ptr< ScChartLockGuard > mapScChartLockGuard; + std::unique_ptr< ScChartLockGuard > mapScChartLockGuard; DECL_LINK(TimeoutHdl, void *); diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx index 675d19915674..2230b81c9c8e 100644 --- a/sc/inc/dociter.hxx +++ b/sc/inc/dociter.hxx @@ -172,8 +172,8 @@ private: SCCOL mnCols; }; - ::std::auto_ptr<ScDBQueryParamBase> mpParam; - ::std::auto_ptr<DataAccess> mpData; + ::std::unique_ptr<ScDBQueryParamBase> mpParam; + ::std::unique_ptr<DataAccess> mpData; public: ScDBQueryDataIterator(ScDocument* pDocument, ScDBQueryParamBase* pParam); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 9c462d7536dc..1d14b9f0382b 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -290,7 +290,7 @@ private: ScDBCollection* pDBCollection; ScDPCollection* pDPCollection; ScChartCollection* pChartCollection; - std::auto_ptr< ScTemporaryChartLock > apTemporaryChartLock; + std::unique_ptr< ScTemporaryChartLock > apTemporaryChartLock; ScPatternAttr* pSelectionAttr; // Attributes of a block ScFormulaCell* pFormulaTree; // formula tree (start) ScFormulaCell* pEOFormulaTree; // formula tree (end), last cell @@ -311,14 +311,14 @@ private: ScFieldEditEngine* pCacheFieldEditEngine; - ::std::auto_ptr<ScDocProtection> pDocProtection; - ::std::auto_ptr<ScClipParam> mpClipParam; + ::std::unique_ptr<ScDocProtection> pDocProtection; + ::std::unique_ptr<ScClipParam> mpClipParam; - ::std::auto_ptr<ScExternalRefManager> pExternalRefMgr; - ::std::auto_ptr<ScMacroManager> mpMacroMgr; + ::std::unique_ptr<ScExternalRefManager> pExternalRefMgr; + ::std::unique_ptr<ScMacroManager> mpMacroMgr; // mutable for lazy construction - mutable ::std::auto_ptr< ScFormulaParserPool > + mutable ::std::unique_ptr< ScFormulaParserPool > mxFormulaParserPool; /// Pool for all external formula parsers used by this document. OUString aDocName; // optional: name of document @@ -338,7 +338,7 @@ private: ScLookupCacheMapImpl* pLookupCacheMapImpl; // cache for lookups like VLOOKUP and MATCH - SfxItemSet* pPreviewFont; // convert to std::auto_ptr or whatever + SfxItemSet* pPreviewFont; // convert to std::unique_ptr or whatever ScStyleSheet* pPreviewCellStyle; ScMarkData maPreviewSelection; sal_Int64 nUnoObjectId; // counted up for UNO objects diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx index c3e636f07c96..f57b516b5ef9 100644 --- a/sc/inc/dptabsrc.hxx +++ b/sc/inc/dptabsrc.hxx @@ -119,9 +119,7 @@ private: bool bResultOverflow; bool bPageFiltered; // set if page field filters have been applied to cache table - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<OUString> mpGrandTotalName; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<OUString> mpGrandTotalName; void CreateRes_Impl(); void FillMemberResults(); diff --git a/sc/inc/editsrc.hxx b/sc/inc/editsrc.hxx index ffc9e43870e1..8625b706ff29 100644 --- a/sc/inc/editsrc.hxx +++ b/sc/inc/editsrc.hxx @@ -133,14 +133,10 @@ public: class ScAccessibilityEditSource : public SvxEditSource { private: - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr < ScAccessibleTextData > mpAccessibleTextData; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr < ScAccessibleTextData > mpAccessibleTextData; public: - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ScAccessibilityEditSource( ::std::auto_ptr < ScAccessibleTextData > pAccessibleCellTextData ); - SAL_WNODEPRECATED_DECLARATIONS_POP + ScAccessibilityEditSource( ::std::unique_ptr < ScAccessibleTextData > && pAccessibleCellTextData ); virtual ~ScAccessibilityEditSource(); virtual SvxEditSource* Clone() const SAL_OVERRIDE; diff --git a/sc/inc/macromgr.hxx b/sc/inc/macromgr.hxx index ecbf08f30c0a..fbf78ae50e47 100644 --- a/sc/inc/macromgr.hxx +++ b/sc/inc/macromgr.hxx @@ -42,7 +42,7 @@ private: NameBoolMap mhFuncToVolatile; com::sun::star::uno::Reference< com::sun::star::container::XContainerListener > mxContainerListener; - ::std::auto_ptr<ScUserMacroDepTracker> mpDepTracker; + ::std::unique_ptr<ScUserMacroDepTracker> mpDepTracker; ScDocument* mpDoc; }; diff --git a/sc/inc/scextopt.hxx b/sc/inc/scextopt.hxx index 30b0dadc2fcc..8edc960782fa 100644 --- a/sc/inc/scextopt.hxx +++ b/sc/inc/scextopt.hxx @@ -114,7 +114,7 @@ public: void SetCodeName( SCTAB nTab, const OUString& rCodeName ); private: - ::std::auto_ptr< ScExtDocOptionsImpl > mxImpl; + ::std::unique_ptr< ScExtDocOptionsImpl > mxImpl; }; #endif diff --git a/sc/inc/segmenttree.hxx b/sc/inc/segmenttree.hxx index f1775fd34126..72d45b63afb6 100644 --- a/sc/inc/segmenttree.hxx +++ b/sc/inc/segmenttree.hxx @@ -76,9 +76,7 @@ public: SCROW findLastNotOf(bool bValue) const; private: - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScFlatBoolSegmentsImpl> mpImpl; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScFlatBoolSegmentsImpl> mpImpl; }; class ScFlatBoolColSegments @@ -101,9 +99,7 @@ public: void insertSegment(SCCOL nCol, SCCOL nSize, bool bSkipStartBoundary); private: - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScFlatBoolSegmentsImpl> mpImpl; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScFlatBoolSegmentsImpl> mpImpl; }; class ScFlatUInt16SegmentsImpl; @@ -150,9 +146,7 @@ public: void enableTreeSearch(bool bEnable); private: - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScFlatUInt16SegmentsImpl> mpImpl; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScFlatUInt16SegmentsImpl> mpImpl; }; #endif diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 1cc3b636ad56..efcfc8ecbf79 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3522,7 +3522,7 @@ void Test::testCopyPasteTranspose() ScDocument aNewClipDoc(SCDOCMODE_CLIP); copyToClip(m_pDoc, aSrcRange, &aNewClipDoc); - ::std::auto_ptr<ScDocument> pTransClip; + ::std::unique_ptr<ScDocument> pTransClip; pTransClip.reset(new ScDocument(SCDOCMODE_CLIP)); aNewClipDoc.TransposeClip(pTransClip.get(), IDF_ALL, false); ScDocument* pTransposedClip = pTransClip.release(); diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index c16b059671e8..fdce24063336 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -156,10 +156,6 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : pChangeViewSettings( NULL ), pScriptTypeData( NULL ), pCacheFieldEditEngine( NULL ), - pDocProtection( NULL ), - mpClipParam( NULL), - pExternalRefMgr( NULL ), - mpMacroMgr( NULL ), pViewOptions( NULL ), pDocOptions( NULL ), pExtDocOptions( NULL ), diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 387747c860f6..472d8eba4dd5 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -68,12 +68,14 @@ #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> #include <comphelper/types.hxx> +#include <o3tl/ptr_container.hxx> #include <sal/macros.h> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include <svl/zforlist.hxx> #include <vcl/msgbox.hxx> +#include <utility> #include <vector> #include <memory> @@ -2385,9 +2387,9 @@ bool ScDPObject::FillLabelData(ScPivotParam& rParam) for (sal_Int32 nDim = 0; nDim < nDimCount; ++nDim) { - std::auto_ptr<ScDPLabelData> pNewLabel(new ScDPLabelData); + std::unique_ptr<ScDPLabelData> pNewLabel(new ScDPLabelData); FillLabelDataForDimension(xDims, nDim, *pNewLabel); - rParam.maLabelArray.push_back(pNewLabel); + o3tl::ptr_container::push_back(rParam.maLabelArray, std::move(pNewLabel)); } return true; @@ -2866,9 +2868,7 @@ const ScDPCache* ScDPCollection::SheetCaches::getCache(const ScRange& rRange, co } // Not cached. Create a new cache. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDPCache> pCache(new ScDPCache(mpDoc)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDPCache> pCache(new ScDPCache(mpDoc)); pCache->InitFromDoc(mpDoc, rRange); if (pDimData) pDimData->WriteToCache(*pCache); @@ -2890,7 +2890,7 @@ const ScDPCache* ScDPCollection::SheetCaches::getCache(const ScRange& rRange, co } const ScDPCache* p = pCache.get(); - maCaches.insert(nIndex, pCache); + o3tl::ptr_container::insert(maCaches, nIndex, std::move(pCache)); return p; } @@ -3037,15 +3037,13 @@ const ScDPCache* ScDPCollection::NameCaches::getCache( // already cached. return itr->second; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDPCache> pCache(new ScDPCache(mpDoc)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDPCache> pCache(new ScDPCache(mpDoc)); pCache->InitFromDoc(mpDoc, rRange); if (pDimData) pDimData->WriteToCache(*pCache); const ScDPCache* p = pCache.get(); - maCaches.insert(rName, pCache); + o3tl::ptr_container::insert(maCaches, rName, std::move(pCache)); return p; } @@ -3126,9 +3124,7 @@ const ScDPCache* ScDPCollection::DBCaches::getCache( if (!xRowSet.is()) return NULL; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDPCache> pCache(new ScDPCache(mpDoc)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDPCache> pCache(new ScDPCache(mpDoc)); SvNumberFormatter aFormat( comphelper::getProcessComponentContext(), ScGlobal::eLnge); DBConnector aDB(*pCache, xRowSet, *aFormat.GetNullDate()); if (!aDB.isValid()) @@ -3146,7 +3142,7 @@ const ScDPCache* ScDPCollection::DBCaches::getCache( ::comphelper::disposeComponent(xRowSet); const ScDPCache* p = pCache.get(); - maCaches.insert(aType, pCache); + o3tl::ptr_container::insert(maCaches, aType, std::move(pCache)); return p; } @@ -3500,10 +3496,10 @@ void ScDPCollection::CopyToTab( SCTAB nOld, SCTAB nNew ) ScAddress& e = aOutRange.aEnd; s.SetTab(nNew); e.SetTab(nNew); - std::auto_ptr<ScDPObject> pNew(new ScDPObject(rObj)); + std::unique_ptr<ScDPObject> pNew(new ScDPObject(rObj)); pNew->SetOutRange(aOutRange); mpDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE); - aAdded.push_back(pNew); + o3tl::ptr_container::push_back(aAdded, std::move(pNew)); } maTables.transfer(maTables.end(), aAdded.begin(), aAdded.end(), aAdded); diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index 51b524f71246..2afe33f214fc 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -53,7 +53,7 @@ using namespace com::sun::star; using namespace com::sun::star::sheet; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Any; -using ::std::auto_ptr; +using ::std::unique_ptr; #define SC_DPSAVEMODE_DONTKNOW 2 @@ -1360,7 +1360,7 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData) // this member instance already exists. nothing to do. continue; - auto_ptr<ScDPSaveMember> pNewMember(new ScDPSaveMember(aMemName)); + unique_ptr<ScDPSaveMember> pNewMember(new ScDPSaveMember(aMemName)); pNewMember->SetIsVisible(true); iter->AddMember(pNewMember.release()); } diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index dc10d439e2ee..95d221ec47a0 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -111,8 +111,7 @@ ScDPSource::ScDPSource( ScDPTableData* pD ) : pColResults( NULL ), pRowResults( NULL ), bResultOverflow( false ), - bPageFiltered( false ), - mpGrandTotalName(NULL) + bPageFiltered( false ) { pData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty ); } diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index c1d56b0ac948..9eeabbfb49d5 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -446,8 +446,8 @@ ScNoteCaptionCreator::ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& r struct ScCaptionInitData { - typedef ::std::auto_ptr< SfxItemSet > SfxItemSetPtr; - typedef ::std::auto_ptr< OutlinerParaObject > OutlinerParaObjPtr; + typedef ::std::unique_ptr< SfxItemSet > SfxItemSetPtr; + typedef ::std::unique_ptr< OutlinerParaObject > OutlinerParaObjPtr; SfxItemSetPtr mxItemSet; /// Caption object formatting. OutlinerParaObjPtr mxOutlinerObj; /// Text object with all text portion formatting. diff --git a/sc/source/core/inc/cellkeytranslator.hxx b/sc/source/core/inc/cellkeytranslator.hxx index d756a22d00b9..33a50a642f62 100644 --- a/sc/source/core/inc/cellkeytranslator.hxx +++ b/sc/source/core/inc/cellkeytranslator.hxx @@ -75,7 +75,7 @@ private: OpCode eOpCode = ocNone); void addToMap(const TransItem* pItems, const ::com::sun::star::lang::Locale& rLocale); - static ::std::auto_ptr<ScCellKeywordTranslator> spInstance; + static ::std::unique_ptr<ScCellKeywordTranslator> spInstance; ScCellKeywordHashMap maStringNameMap; ::utl::TransliterationWrapper maTransWrapper; }; diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx index ea57d06feb8c..6bb32545b413 100644 --- a/sc/source/core/tool/cellkeytranslator.cxx +++ b/sc/source/core/tool/cellkeytranslator.cxx @@ -73,7 +73,7 @@ ScCellKeyword::ScCellKeyword(const sal_Char* pName, OpCode eOpCode, const lang:: { } -::std::auto_ptr<ScCellKeywordTranslator> ScCellKeywordTranslator::spInstance(NULL); +::std::unique_ptr<ScCellKeywordTranslator> ScCellKeywordTranslator::spInstance; static void lclMatchKeyword(OUString& rName, const ScCellKeywordHashMap& aMap, OpCode eOpCode = ocNone, const lang::Locale* pLocale = NULL) diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index c5ba011739ff..e96e5b894dec 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <o3tl/ptr_container.hxx> #include <unotools/transliterationwrapper.hxx> #include "dbdata.hxx" @@ -31,8 +34,9 @@ #include "sortparam.hxx" #include <memory> +#include <utility> -using ::std::auto_ptr; +using ::std::unique_ptr; using ::std::unary_function; using ::std::for_each; using ::std::find_if; @@ -685,13 +689,11 @@ ScDBData* ScDBCollection::NamedDBs::findByUpperName(const OUString& rName) bool ScDBCollection::NamedDBs::insert(ScDBData* p) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScDBData> pData(p); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScDBData> pData(p); if (!pData->GetIndex()) pData->SetIndex(mrParent.nEntryIndex++); - pair<DBsType::iterator, bool> r = maDBs.insert(pData); + pair<DBsType::iterator, bool> r = o3tl::ptr_container::insert(maDBs, std::move(pData)); if (r.second && p->HasImportParam() && !p->HasImportSelection()) { @@ -767,23 +769,19 @@ ScDBData* ScDBCollection::AnonDBs::getByRange(const ScRange& rRange) { // Insert a new db data. They all have identical names. OUString aName(STR_DB_GLOBAL_NONAME); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDBData> pNew(new ScDBData( + ::std::unique_ptr<ScDBData> pNew(new ScDBData( aName, rRange.aStart.Tab(), rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row(), true, false)); - SAL_WNODEPRECATED_DECLARATIONS_POP pData = pNew.get(); - maDBs.push_back(pNew); + o3tl::ptr_container::push_back(maDBs, std::move(pNew)); } return const_cast<ScDBData*>(pData); } void ScDBCollection::AnonDBs::insert(ScDBData* p) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDBData> pNew(p); - SAL_WNODEPRECATED_DECLARATIONS_POP - maDBs.push_back(pNew); + ::std::unique_ptr<ScDBData> pNew(p); + o3tl::ptr_container::push_back(maDBs, std::move(pNew)); } bool ScDBCollection::AnonDBs::empty() const diff --git a/sc/source/core/tool/doubleref.cxx b/sc/source/core/tool/doubleref.cxx index 2499c71f4105..5451eb1692a4 100644 --- a/sc/source/core/tool/doubleref.cxx +++ b/sc/source/core/tool/doubleref.cxx @@ -31,7 +31,7 @@ #include <memory> #include <vector> -using ::std::auto_ptr; +using ::std::unique_ptr; using ::std::vector; namespace { @@ -356,7 +356,7 @@ SCCOL ScDBInternalRange::findFieldColumn(const OUString& rStr, sal_uInt16* pErr) ScDBQueryParamBase* ScDBInternalRange::createQueryParam(const ScDBRangeBase* pQueryRef) const { - auto_ptr<ScDBQueryParamInternal> pParam(new ScDBQueryParamInternal); + unique_ptr<ScDBQueryParamInternal> pParam(new ScDBQueryParamInternal); // Set the database range first. const ScAddress& s = maRange.aStart; @@ -451,7 +451,7 @@ SCCOL ScDBExternalRange::findFieldColumn(const OUString& rStr, sal_uInt16* pErr) ScDBQueryParamBase* ScDBExternalRange::createQueryParam(const ScDBRangeBase* pQueryRef) const { - auto_ptr<ScDBQueryParamMatrix> pParam(new ScDBQueryParamMatrix); + unique_ptr<ScDBQueryParamMatrix> pParam(new ScDBQueryParamMatrix); pParam->mpMatrix = mpMatrix; fillQueryOptions(pParam.get()); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index d9e8e3651254..7c7dff39d349 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -81,7 +81,7 @@ ScTokenStack* ScInterpreter::pGlobalStack = NULL; bool ScInterpreter::bGlobalStackInUse = false; using namespace formula; -using ::std::auto_ptr; +using ::std::unique_ptr; void ScInterpreter::ScIfJump() { @@ -6626,9 +6626,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( bool& rMissingField ) if ( GetByte() == 3 ) { // First, get the query criteria range. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDBRangeBase> pQueryRef( PopDBDoubleRef() ); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDBRangeBase> pQueryRef( PopDBDoubleRef() ); if (!pQueryRef.get()) return NULL; @@ -6690,9 +6688,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( bool& rMissingField ) if (nGlobalError) return NULL; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScDBRangeBase> pDBRef( PopDBDoubleRef() ); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScDBRangeBase> pDBRef( PopDBDoubleRef() ); if (nGlobalError || !pDBRef.get()) return NULL; @@ -6724,9 +6720,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( bool& rMissingField ) if (!ValidCol(nField)) return NULL; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScDBQueryParamBase> pParam( pDBRef->createQueryParam(pQueryRef.get()) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScDBQueryParamBase> pParam( pDBRef->createQueryParam(pQueryRef.get()) ); if (pParam.get()) { @@ -6767,9 +6761,7 @@ void ScInterpreter::DBIterator( ScIterFunc eFunc ) bool bNull = true; sal_uLong nCount = 0; bool bMissingField = false; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { if (!pQueryParam->IsValidFieldIndex()) @@ -6834,9 +6826,7 @@ void ScInterpreter::ScDBSum() void ScInterpreter::ScDBCount() { bool bMissingField = true; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { sal_uLong nCount = 0; @@ -6894,9 +6884,7 @@ void ScInterpreter::ScDBCount() void ScInterpreter::ScDBCount2() { bool bMissingField = true; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { if (!pQueryParam->IsValidFieldIndex()) @@ -6952,9 +6940,7 @@ void ScInterpreter::GetDBStVarParams( double& rVal, double& rValCount ) rValCount = 0.0; double fSum = 0.0; bool bMissingField = false; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { if (!pQueryParam->IsValidFieldIndex()) diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index e65e08b15d9b..7909202f0c87 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -76,7 +76,7 @@ using namespace com::sun::star; using namespace formula; -using ::std::auto_ptr; +using ::std::unique_ptr; #define ADDIN_MAXSTRLEN 256 @@ -2427,9 +2427,7 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( void ScInterpreter::ScDBGet() { bool bMissingField = false; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (!pQueryParam.get()) { // Failed to create query param. diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index ec074de98c15..7e7786d063ff 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -32,7 +32,7 @@ #include <vector> #include <memory> -using ::std::auto_ptr; +using ::std::unique_ptr; using ::std::find_if; using ::std::vector; using ::com::sun::star::uno::Any; @@ -110,7 +110,7 @@ private: private: const XclExpSupbook& mrSupbook; - auto_ptr<ScTokenArray> mpArray; + unique_ptr<ScTokenArray> mpArray; }; // List of external names ===================================================== diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index b0ec5bdfdf22..610b4e2684f5 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -21,6 +21,7 @@ #include <algorithm> #include <memory> +#include <utility> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/drawing/Direction3D.hpp> @@ -74,6 +75,7 @@ #include <com/sun/star/chart2/data/XDataSink.hpp> #include <com/sun/star/chart2/data/LabeledDataSequence.hpp> +#include <o3tl/ptr_container.hxx> #include <sfx2/objsh.hxx> #include <svx/svdpage.hxx> #include <svx/unoapi.hxx> @@ -122,7 +124,7 @@ using ::formula::FormulaToken; using ::formula::StackVar; using ::boost::shared_ptr; using ::std::pair; -using ::std::auto_ptr; +using ::std::unique_ptr; namespace cssc = ::com::sun::star::chart; namespace cssc2 = ::com::sun::star::chart2; @@ -2102,12 +2104,10 @@ void XclImpChSeries::ReadChSerTrendLine( XclImpStream& rStrm ) void XclImpChSeries::ReadChSerErrorBar( XclImpStream& rStrm ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<XclImpChSerErrorBar> pErrorBar(new XclImpChSerErrorBar(GetChRoot())); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<XclImpChSerErrorBar> pErrorBar(new XclImpChSerErrorBar(GetChRoot())); pErrorBar->ReadChSerErrorBar(rStrm); sal_uInt8 nBarType = pErrorBar->GetBarType(); - maErrorBars.insert(nBarType, pErrorBar); + o3tl::ptr_container::insert(maErrorBars, nBarType, std::move(pErrorBar)); } XclImpChDataFormatRef XclImpChSeries::CreateDataFormat( sal_uInt16 nPointIdx, sal_uInt16 nFormatIdx ) @@ -2763,19 +2763,15 @@ void XclImpChTypeGroup::ReadChDropBar( XclImpStream& rStrm ) { if (maDropBars.find(EXC_CHDROPBAR_UP) == maDropBars.end()) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<XclImpChDropBar> p(new XclImpChDropBar(EXC_CHDROPBAR_UP)); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<XclImpChDropBar> p(new XclImpChDropBar(EXC_CHDROPBAR_UP)); p->ReadRecordGroup(rStrm); - maDropBars.insert(EXC_CHDROPBAR_UP, p); + o3tl::ptr_container::insert(maDropBars, EXC_CHDROPBAR_UP, std::move(p)); } else if(maDropBars.find(EXC_CHDROPBAR_DOWN) == maDropBars.end()) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<XclImpChDropBar> p(new XclImpChDropBar(EXC_CHDROPBAR_DOWN)); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<XclImpChDropBar> p(new XclImpChDropBar(EXC_CHDROPBAR_DOWN)); p->ReadRecordGroup(rStrm); - maDropBars.insert(EXC_CHDROPBAR_DOWN, p); + o3tl::ptr_container::insert(maDropBars, EXC_CHDROPBAR_DOWN, std::move(p)); } } @@ -3814,11 +3810,9 @@ void XclImpChChart::ReadChDefaultText( XclImpStream& rStrm ) sal_uInt16 nTextId = rStrm.ReaduInt16(); if( (rStrm.GetNextRecId() == EXC_ID_CHTEXT) && rStrm.StartNextRecord() ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<XclImpChText> pText(new XclImpChText(GetChRoot())); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<XclImpChText> pText(new XclImpChText(GetChRoot())); pText->ReadRecordGroup(rStrm); - maDefTexts.insert(nTextId, pText); + o3tl::ptr_container::insert(maDefTexts, nTextId, std::move(pText)); } } @@ -3966,16 +3960,12 @@ void XclImpChChart::Convert( const Reference<XChartDocument>& xChartDoc, ScDocument& rDoc = GetRoot().GetDoc(); if( ScChartListenerCollection* pChartCollection = rDoc.GetChartListenerCollection() ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< ::std::vector< ScTokenRef > > xRefTokens( new ::std::vector< ScTokenRef > ); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< ::std::vector< ScTokenRef > > xRefTokens( new ::std::vector< ScTokenRef > ); for( XclImpChSeriesVec::const_iterator aIt = maSeries.begin(), aEnd = maSeries.end(); aIt != aEnd; ++aIt ) (*aIt)->FillAllSourceLinks( *xRefTokens ); if( !xRefTokens->empty() ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< ScChartListener > xListener( new ScChartListener( rObjName, &rDoc, xRefTokens.release() ) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< ScChartListener > xListener( new ScChartListener( rObjName, &rDoc, xRefTokens.release() ) ); xListener->SetUsed( true ); xListener->StartListeningTo(); pChartCollection->insert( xListener.release() ); diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 491517a9f210..79c78ead74c9 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -60,9 +60,10 @@ #include "documentimport.hxx" #include <memory> +#include <utility> using ::com::sun::star::uno::Sequence; -using ::std::auto_ptr; +using ::std::unique_ptr; // Shared string table ======================================================== @@ -240,11 +241,9 @@ OUString XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm ) OSL_ENSURE( aGuid == XclTools::maGuidStdLink, "XclImpHyperlink::ReadEmbeddedData - unknown header GUID" ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< OUString > xLongName; // link / file name - ::std::auto_ptr< OUString > xShortName; // 8.3-representation of file name - ::std::auto_ptr< OUString > xTextMark; // text mark - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< OUString > xLongName; // link / file name + ::std::unique_ptr< OUString > xShortName; // 8.3-representation of file name + ::std::unique_ptr< OUString > xTextMark; // text mark // description (ignore) if( ::get_flag( nFlags, EXC_HLINK_DESCR ) ) @@ -320,7 +319,7 @@ OUString XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm ) OSL_ENSURE( rStrm.GetRecLeft() == 0, "XclImpHyperlink::ReadEmbeddedData - record size mismatch" ); if( !xLongName.get() && xShortName.get() ) - xLongName = xShortName; + xLongName = std::move(xShortName); else if( !xLongName.get() && xTextMark.get() ) xLongName.reset( new OUString ); @@ -625,9 +624,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) const ScAddress& rPos = maRanges.front()->aStart; // assured above that maRanges is not empty ExcelToSc& rFmlaConv = GetOldFmlaConverter(); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< ScTokenArray > xTokArr1; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< ScTokenArray > xTokArr1; if( nFmlaSize1 > 0 ) { const ScTokenArray* pTokArr = 0; @@ -638,9 +635,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) xTokArr1.reset( pTokArr->Clone() ); } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< ScTokenArray > pTokArr2; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< ScTokenArray > pTokArr2; if( nFmlaSize2 > 0 ) { const ScTokenArray* pTokArr = 0; @@ -762,9 +757,7 @@ void XclImpValidationManager::ReadDV( XclImpStream& rStrm ) // first formula // string list is single tStr token with NUL separators -> replace them with LF rStrm.SetNulSubstChar( '\n' ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< ScTokenArray > xTokArr1; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< ScTokenArray > xTokArr1; sal_uInt16 nLen = 0; rStrm >> nLen; @@ -781,9 +774,7 @@ void XclImpValidationManager::ReadDV( XclImpStream& rStrm ) rStrm.SetNulSubstChar(); // back to default // second formula - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< ScTokenArray > xTokArr2; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< ScTokenArray > xTokArr2; nLen = 0; rStrm >> nLen; @@ -1192,9 +1183,7 @@ void XclImpDocProtectBuffer::Apply() const // If neither is set then the document is not protected at all. return; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScDocProtection> pProtect(new ScDocProtection); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScDocProtection> pProtect(new ScDocProtection); pProtect->setProtected(true); if (mnPassHash) @@ -1290,9 +1279,7 @@ void XclImpSheetProtectBuffer::Apply() const // This sheet is (for whatever reason) not protected. continue; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScTableProtection> pProtect(new ScTableProtection); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScTableProtection> pProtect(new ScTableProtection); pProtect->setProtected(true); // 16-bit hash password diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index 7e95368e7874..6a98771e76be 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -227,7 +227,7 @@ void XclImpStringHelper::SetToDocument( if (rString.GetText().isEmpty()) return; - ::std::auto_ptr< EditTextObject > pTextObj( lclCreateTextObject( rRoot, rString, EXC_FONTITEM_EDITENG, nXFIndex ) ); + ::std::unique_ptr< EditTextObject > pTextObj( lclCreateTextObject( rRoot, rString, EXC_FONTITEM_EDITENG, nXFIndex ) ); if (pTextObj.get()) { diff --git a/sc/source/filter/ftools/fprogressbar.cxx b/sc/source/filter/ftools/fprogressbar.cxx index bc3980d30a4f..1dfc9055a960 100644 --- a/sc/source/filter/ftools/fprogressbar.cxx +++ b/sc/source/filter/ftools/fprogressbar.cxx @@ -22,7 +22,6 @@ #include "progress.hxx" ScfProgressBar::ScfProgressSegment::ScfProgressSegment( sal_Size nSize ) : - mxProgress( 0 ), mnSize( nSize ), mnPos( 0 ) { diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 00ce6f1b7253..48e1d96e7996 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -17,8 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <utility> + #include <boost/shared_ptr.hpp> #include <comphelper/string.hxx> +#include <o3tl/ptr_container.hxx> #include "scitems.hxx" #include <editeng/eeitem.hxx> @@ -84,10 +89,8 @@ void ScHTMLStyles::add(const char* pElemName, size_t nElemName, const char* pCla if (itrElem == maElemProps.end()) { // new element - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<NamePropsType> p(new NamePropsType); - SAL_WNODEPRECATED_DECLARATIONS_POP - std::pair<ElemsType::iterator, bool> r = maElemProps.insert(aElem, p); + std::unique_ptr<NamePropsType> p(new NamePropsType); + std::pair<ElemsType::iterator, bool> r = o3tl::ptr_container::insert(maElemProps, aElem, std::move(p)); if (!r.second) // insertion failed. return; @@ -170,10 +173,8 @@ void ScHTMLStyles::insertProp( if (itr == rStore.end()) { // new element - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<PropsType> p(new PropsType); - SAL_WNODEPRECATED_DECLARATIONS_POP - std::pair<NamePropsType::iterator, bool> r = rStore.insert(aName, p); + std::unique_ptr<PropsType> p(new PropsType); + std::pair<NamePropsType::iterator, bool> r = o3tl::ptr_container::insert(rStore, aName, std::move(p)); if (!r.second) // insertion failed. return; @@ -2140,9 +2141,7 @@ void ScHTMLTable::DataOn( const ImportInfo& rInfo ) { // read needed options from the <td> tag ScHTMLSize aSpanSize( 1, 1 ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<OUString> pValStr, pNumStr; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<OUString> pValStr, pNumStr; const HTMLOptions& rOptions = static_cast<HTMLParser*>(rInfo.pParser)->GetOptions(); HTMLOptions::const_iterator itr = rOptions.begin(), itrEnd = rOptions.end(); sal_uInt32 nNumberFormat = NUMBERFORMAT_ENTRY_NOT_FOUND; diff --git a/sc/source/filter/inc/connectionsbuffer.hxx b/sc/source/filter/inc/connectionsbuffer.hxx index 00cd1d03c73c..03f36d927929 100644 --- a/sc/source/filter/inc/connectionsbuffer.hxx +++ b/sc/source/filter/inc/connectionsbuffer.hxx @@ -62,7 +62,7 @@ struct WebPrModel /** Common properties of an external data connection. */ struct ConnectionModel { - typedef ::std::auto_ptr< WebPrModel > WebPrModelPtr; + typedef ::std::unique_ptr< WebPrModel > WebPrModelPtr; WebPrModelPtr mxWebPr; /// Special settings for web queries. OUString maName; /// Unique name of this connection. diff --git a/sc/source/filter/inc/defnamesbuffer.hxx b/sc/source/filter/inc/defnamesbuffer.hxx index 4adc1b7c164f..09f1579387fc 100644 --- a/sc/source/filter/inc/defnamesbuffer.hxx +++ b/sc/source/filter/inc/defnamesbuffer.hxx @@ -136,8 +136,8 @@ private: void implImportBiffFormula(); private: - typedef ::std::auto_ptr< StreamDataSequence > StreamDataSeqPtr; - typedef ::std::auto_ptr< BiffInputStreamPos > BiffStreamPosPtr; + typedef ::std::unique_ptr< StreamDataSequence > StreamDataSeqPtr; + typedef ::std::unique_ptr< BiffInputStreamPos > BiffStreamPosPtr; ScRangeData* mpScRangeData; /// ScRangeData of the defined name. sal_Int32 mnTokenIndex; /// Name index used in API token array. diff --git a/sc/source/filter/inc/drawingfragment.hxx b/sc/source/filter/inc/drawingfragment.hxx index 1afd26f20f35..4e36ad63a199 100644 --- a/sc/source/filter/inc/drawingfragment.hxx +++ b/sc/source/filter/inc/drawingfragment.hxx @@ -112,7 +112,7 @@ protected: virtual void onEndElement() SAL_OVERRIDE; private: - typedef ::std::auto_ptr< ShapeAnchor > ShapeAnchorRef; + typedef ::std::unique_ptr< ShapeAnchor > ShapeAnchorRef; ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxDrawPage; /// Drawing page of this sheet. diff --git a/sc/source/filter/inc/formulaparser.hxx b/sc/source/filter/inc/formulaparser.hxx index 47d0cf25dc79..9bc058d5ed5a 100644 --- a/sc/source/filter/inc/formulaparser.hxx +++ b/sc/source/filter/inc/formulaparser.hxx @@ -139,7 +139,7 @@ public: OUString importMacroName( const OUString& rFormulaString ); private: - ::std::auto_ptr< FormulaParserImpl > mxImpl; + ::std::unique_ptr< FormulaParserImpl > mxImpl; }; } // namespace xls diff --git a/sc/source/filter/inc/fprogressbar.hxx b/sc/source/filter/inc/fprogressbar.hxx index 1c9d3f74f8d3..5b2a8441285c 100644 --- a/sc/source/filter/inc/fprogressbar.hxx +++ b/sc/source/filter/inc/fprogressbar.hxx @@ -152,7 +152,7 @@ private: /** Contains all data of a segment of the progress bar. */ struct ScfProgressSegment { - typedef ::std::auto_ptr< ScfProgressBar > ScfProgressBarPtr; + typedef ::std::unique_ptr< ScfProgressBar > ScfProgressBarPtr; ScfProgressBarPtr mxProgress; /// Pointer to sub progress bar for this segment. sal_Size mnSize; /// Size of this segment. @@ -162,7 +162,7 @@ private: ~ScfProgressSegment(); }; - typedef ::std::auto_ptr< ScProgress > ScProgressPtr; + typedef ::std::unique_ptr< ScProgress > ScProgressPtr; typedef boost::ptr_vector< ScfProgressSegment > ScfSegmentList; ScfSegmentList maSegments; /// List of progress segments. @@ -216,7 +216,7 @@ private: void Init( SfxObjectShell* pDocShell, const OUString& rText ); private: - typedef ::std::auto_ptr< ScfSimpleProgressBar > ScfSimpleProgressBarPtr; + typedef ::std::unique_ptr< ScfSimpleProgressBar > ScfSimpleProgressBarPtr; ScfSimpleProgressBarPtr mxProgress; /// The used progress bar. SvStream& mrStrm; /// The used stream. diff --git a/sc/source/filter/inc/htmlpars.hxx b/sc/source/filter/inc/htmlpars.hxx index b24ab983d6f8..d39737a776bc 100644 --- a/sc/source/filter/inc/htmlpars.hxx +++ b/sc/source/filter/inc/htmlpars.hxx @@ -464,12 +464,12 @@ protected: void RecalcDocPos( const ScHTMLPos& rBasePos ); private: - typedef ::std::auto_ptr< ScHTMLTableMap > ScHTMLTableMapPtr; - typedef ::std::auto_ptr< SfxItemSet > SfxItemSetPtr; + typedef ::std::unique_ptr< ScHTMLTableMap > ScHTMLTableMapPtr; + typedef ::std::unique_ptr< SfxItemSet > SfxItemSetPtr; typedef ::std::vector< SCCOLROW > ScSizeVec; typedef ::std::list< ScHTMLEntry* > ScHTMLEntryList; typedef ::std::map< ScHTMLPos, ScHTMLEntryList > ScHTMLEntryMap; - typedef ::std::auto_ptr< ScHTMLEntry > ScHTMLEntryPtr; + typedef ::std::unique_ptr< ScHTMLEntry > ScHTMLEntryPtr; /** Returns true, if the current cell does not contain an entry yet. */ bool IsEmptyCell() const; @@ -632,7 +632,7 @@ private: DECL_LINK( HTMLImportHdl, const ImportInfo* ); private: - typedef ::std::auto_ptr< ScHTMLGlobalTable > ScHTMLGlobalTablePtr; + typedef ::std::unique_ptr< ScHTMLGlobalTable > ScHTMLGlobalTablePtr; OUStringBuffer maTitle; /// The title of the document. ScHTMLGlobalTablePtr mxGlobTable; /// Contains the entire imported document. diff --git a/sc/source/filter/inc/pagesettings.hxx b/sc/source/filter/inc/pagesettings.hxx index dc5b93a7ba56..f9a9ff2e9391 100644 --- a/sc/source/filter/inc/pagesettings.hxx +++ b/sc/source/filter/inc/pagesettings.hxx @@ -168,7 +168,7 @@ private: const OUString& rContent ); private: - typedef ::std::auto_ptr< HeaderFooterParser > HeaderFooterParserPtr; + typedef ::std::unique_ptr< HeaderFooterParser > HeaderFooterParserPtr; HeaderFooterParserPtr mxHFParser; HFHelperData maHeaderData; HFHelperData maFooterData; diff --git a/sc/source/filter/inc/stylesbuffer.hxx b/sc/source/filter/inc/stylesbuffer.hxx index b2e11864f6b8..88e9db812435 100644 --- a/sc/source/filter/inc/stylesbuffer.hxx +++ b/sc/source/filter/inc/stylesbuffer.hxx @@ -672,7 +672,7 @@ public: const ::ScPatternAttr& createPattern( bool bSkipPoolDefs = false ); private: - typedef ::std::auto_ptr< ::ScPatternAttr > ScPatternAttrPtr; + typedef ::std::unique_ptr< ::ScPatternAttr > ScPatternAttrPtr; ScPatternAttrPtr mpPattern; /// Calc item set. diff --git a/sc/source/filter/inc/themebuffer.hxx b/sc/source/filter/inc/themebuffer.hxx index 0617c2128762..84ff9eaf1cc1 100644 --- a/sc/source/filter/inc/themebuffer.hxx +++ b/sc/source/filter/inc/themebuffer.hxx @@ -41,7 +41,7 @@ public: inline const FontModel& getDefaultFontModel() const { return *mxDefFontModel; } private: - typedef ::std::auto_ptr< FontModel > FontModelPtr; + typedef ::std::unique_ptr< FontModel > FontModelPtr; FontModelPtr mxDefFontModel; }; diff --git a/sc/source/filter/inc/worksheetfragment.hxx b/sc/source/filter/inc/worksheetfragment.hxx index 1f37603f4133..5c68ff55f185 100644 --- a/sc/source/filter/inc/worksheetfragment.hxx +++ b/sc/source/filter/inc/worksheetfragment.hxx @@ -44,7 +44,7 @@ private: void importDataValidation( SequenceInputStream& rStrm ); private: - ::std::auto_ptr< ValidationModel > mxValModel; + ::std::unique_ptr< ValidationModel > mxValModel; }; class WorksheetFragment : public WorksheetFragmentBase diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx index 795208c96f34..1b90097cbccf 100644 --- a/sc/source/filter/inc/xcl97esc.hxx +++ b/sc/source/filter/inc/xcl97esc.hxx @@ -41,10 +41,8 @@ private: virtual SvStream* ImplQueryPictureStream() SAL_OVERRIDE; private: - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< ::utl::TempFile > mxPicTempFile; - ::std::auto_ptr< SvStream > mxPicStrm; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< ::utl::TempFile > mxPicTempFile; + ::std::unique_ptr< SvStream > mxPicStrm; }; class XclObj; diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx index 4cc35769d6fc..e84241ef2478 100644 --- a/sc/source/filter/inc/xcl97rec.hxx +++ b/sc/source/filter/inc/xcl97rec.hxx @@ -159,7 +159,7 @@ public: class XclObjComment : public XclObj { ScAddress maScPos; - std::auto_ptr< SdrCaptionObj > + std::unique_ptr< SdrCaptionObj > mpCaption; bool mbVisible; Rectangle maFrom; diff --git a/sc/source/filter/inc/xehelper.hxx b/sc/source/filter/inc/xehelper.hxx index f15a74acc23b..7facf2250029 100644 --- a/sc/source/filter/inc/xehelper.hxx +++ b/sc/source/filter/inc/xehelper.hxx @@ -59,9 +59,7 @@ public: void Progress(); private: - SAL_WNODEPRECATED_DECLARATIONS_PUSH - typedef ::std::auto_ptr< ScfProgressBar > ScfProgressBarPtr; - SAL_WNODEPRECATED_DECLARATIONS_POP + typedef ::std::unique_ptr< ScfProgressBar > ScfProgressBarPtr; ScfProgressBarPtr mxProgress; /// Progress bar implementation. ScfProgressBar* mpSubProgress; /// Current sub progress bar. diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx index 9d8453b64b6c..fd7f3e79d6eb 100644 --- a/sc/source/filter/inc/xestyle.hxx +++ b/sc/source/filter/inc/xestyle.hxx @@ -266,7 +266,7 @@ struct XclExpNumFmt }; class SvNumberFormatter; -typedef ::std::auto_ptr< SvNumberFormatter > SvNumberFormatterPtr; +typedef ::std::unique_ptr< SvNumberFormatter > SvNumberFormatterPtr; /** Stores all number formats used in the document. */ class XclExpNumFmtBuffer : public XclExpRecordBase, protected XclExpRoot diff --git a/sc/source/filter/inc/xicontent.hxx b/sc/source/filter/inc/xicontent.hxx index ba9ff3b1ba92..2e376f94c51a 100644 --- a/sc/source/filter/inc/xicontent.hxx +++ b/sc/source/filter/inc/xicontent.hxx @@ -133,7 +133,7 @@ public: void Apply(); private: - typedef ::std::auto_ptr< ScConditionalFormat > ScCondFmtPtr; + typedef ::std::unique_ptr< ScConditionalFormat > ScCondFmtPtr; ScRangeList maRanges; /// Destination cell ranges. ScCondFmtPtr mxScCondFmt; /// Calc conditional format. diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx index ce49f0e9ccd7..3e54efe7dc0f 100644 --- a/sc/source/filter/inc/xihelper.hxx +++ b/sc/source/filter/inc/xihelper.hxx @@ -177,7 +177,7 @@ public: sal_Int32 GetTotalHeight() const; private: // types - typedef ::std::auto_ptr< XclFontData > XclFontDataPtr; + typedef ::std::unique_ptr< XclFontData > XclFontDataPtr; /** Enumerates the supported header/footer portions. */ enum XclImpHFPortion { EXC_HF_LEFT, EXC_HF_CENTER, EXC_HF_RIGHT, EXC_HF_PORTION_COUNT }; @@ -313,7 +313,7 @@ public: sal_uInt16 GetScError() const; protected: - typedef ::std::auto_ptr< const ScTokenArray > ScTokenArrayPtr; + typedef ::std::unique_ptr< const ScTokenArray > ScTokenArrayPtr; OUString maStr; /// Cached value is a string. double mfValue; /// Cached value is a double. diff --git a/sc/source/filter/inc/xilink.hxx b/sc/source/filter/inc/xilink.hxx index f3fb721ea2d1..4da2a7025063 100644 --- a/sc/source/filter/inc/xilink.hxx +++ b/sc/source/filter/inc/xilink.hxx @@ -149,8 +149,8 @@ public: sal_uInt32 GetStorageId() const { return mnStorageId; } private: - typedef ::std::auto_ptr< XclImpCachedMatrix > XclImpCachedMatrixPtr; - typedef ::std::auto_ptr< ScTokenArray > TokenArrayPtr; + typedef ::std::unique_ptr< XclImpCachedMatrix > XclImpCachedMatrixPtr; + typedef ::std::unique_ptr< ScTokenArray > TokenArrayPtr; XclImpCachedMatrixPtr mxDdeMatrix; /// Cached results of the DDE link. MOper* mpMOper; /// Cached values for OLE link @@ -219,7 +219,7 @@ public: const OUString& GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 nExtName ) const; private: - typedef ::std::auto_ptr< XclImpLinkManagerImpl > XclImpLinkMgrImplPtr; + typedef ::std::unique_ptr< XclImpLinkManagerImpl > XclImpLinkMgrImplPtr; XclImpLinkMgrImplPtr mxImpl; }; diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx index 6255b99e44dc..dd08823d0482 100644 --- a/sc/source/filter/inc/xistyle.hxx +++ b/sc/source/filter/inc/xistyle.hxx @@ -428,7 +428,7 @@ private: void SetUsedFlags( sal_uInt8 nUsedFlags ); private: - typedef ::std::auto_ptr< ScPatternAttr > ScPatternAttrPtr; + typedef ::std::unique_ptr< ScPatternAttr > ScPatternAttrPtr; ScPatternAttrPtr mpPattern; /// Calc item set. ScStyleSheet* mpStyleSheet; /// Calc cell style sheet. diff --git a/sc/source/filter/inc/xlpage.hxx b/sc/source/filter/inc/xlpage.hxx index 9d395ce570cc..f5333b96fcbf 100644 --- a/sc/source/filter/inc/xlpage.hxx +++ b/sc/source/filter/inc/xlpage.hxx @@ -91,7 +91,7 @@ class SvxBrushItem; /** Contains all page (print) settings for a single sheet. */ struct XclPageData : private boost::noncopyable { - typedef ::std::auto_ptr< SvxBrushItem > SvxBrushItemPtr; + typedef ::std::unique_ptr< SvxBrushItem > SvxBrushItemPtr; ScfUInt16Vec maHorPageBreaks; /// Horizontal page breaks. ScfUInt16Vec maVerPageBreaks; /// Vertical page breaks. diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 3b9665ac4cfa..06ecc600b27b 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -236,28 +236,28 @@ private: void recalcFormulaCells(); private: - typedef ::std::auto_ptr< ScEditEngineDefaulter > EditEngineDefaulterPtr; - typedef ::std::auto_ptr< FormulaBuffer > FormulaBufferPtr; - typedef ::std::auto_ptr< SegmentProgressBar > ProgressBarPtr; - typedef ::std::auto_ptr< WorkbookSettings > WorkbookSettPtr; - typedef ::std::auto_ptr< ViewSettings > ViewSettingsPtr; - typedef ::std::auto_ptr< WorksheetBuffer > WorksheetBfrPtr; + typedef ::std::unique_ptr< ScEditEngineDefaulter > EditEngineDefaulterPtr; + typedef ::std::unique_ptr< FormulaBuffer > FormulaBufferPtr; + typedef ::std::unique_ptr< SegmentProgressBar > ProgressBarPtr; + typedef ::std::unique_ptr< WorkbookSettings > WorkbookSettPtr; + typedef ::std::unique_ptr< ViewSettings > ViewSettingsPtr; + typedef ::std::unique_ptr< WorksheetBuffer > WorksheetBfrPtr; typedef ::boost::shared_ptr< ThemeBuffer > ThemeBfrRef; - typedef ::std::auto_ptr< StylesBuffer > StylesBfrPtr; - typedef ::std::auto_ptr< SharedStringsBuffer > SharedStrBfrPtr; - typedef ::std::auto_ptr< ExternalLinkBuffer > ExtLinkBfrPtr; - typedef ::std::auto_ptr< DefinedNamesBuffer > DefNamesBfrPtr; - typedef ::std::auto_ptr< TableBuffer > TableBfrPtr; - typedef ::std::auto_ptr< ScenarioBuffer > ScenarioBfrPtr; - typedef ::std::auto_ptr< ConnectionsBuffer > ConnectionsBfrPtr; - typedef ::std::auto_ptr< PivotCacheBuffer > PivotCacheBfrPtr; - typedef ::std::auto_ptr< PivotTableBuffer > PivotTableBfrPtr; - typedef ::std::auto_ptr< FormulaParser > FormulaParserPtr; - typedef ::std::auto_ptr< UnitConverter > UnitConvPtr; - typedef ::std::auto_ptr< AddressConverter > AddressConvPtr; - typedef ::std::auto_ptr< oox::drawingml::chart::ChartConverter > ExcelChartConvPtr; - typedef ::std::auto_ptr< PageSettingsConverter > PageSettConvPtr; - typedef ::std::auto_ptr< BiffCodecHelper > BiffCodecHelperPtr; + typedef ::std::unique_ptr< StylesBuffer > StylesBfrPtr; + typedef ::std::unique_ptr< SharedStringsBuffer > SharedStrBfrPtr; + typedef ::std::unique_ptr< ExternalLinkBuffer > ExtLinkBfrPtr; + typedef ::std::unique_ptr< DefinedNamesBuffer > DefNamesBfrPtr; + typedef ::std::unique_ptr< TableBuffer > TableBfrPtr; + typedef ::std::unique_ptr< ScenarioBuffer > ScenarioBfrPtr; + typedef ::std::unique_ptr< ConnectionsBuffer > ConnectionsBfrPtr; + typedef ::std::unique_ptr< PivotCacheBuffer > PivotCacheBfrPtr; + typedef ::std::unique_ptr< PivotTableBuffer > PivotTableBfrPtr; + typedef ::std::unique_ptr< FormulaParser > FormulaParserPtr; + typedef ::std::unique_ptr< UnitConverter > UnitConvPtr; + typedef ::std::unique_ptr< AddressConverter > AddressConvPtr; + typedef ::std::unique_ptr< oox::drawingml::chart::ChartConverter > ExcelChartConvPtr; + typedef ::std::unique_ptr< PageSettingsConverter > PageSettConvPtr; + typedef ::std::unique_ptr< BiffCodecHelper > BiffCodecHelperPtr; OUString maCellStyles; /// Style family name for cell styles. OUString maPageStyles; /// Style family name for page styles. diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 7ba4bafe63f2..69f018f83b9f 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -369,8 +369,8 @@ private: void UpdateRowProgress( const CellRangeAddress& rUsedArea, sal_Int32 nRow ); private: - typedef ::std::auto_ptr< VmlDrawing > VmlDrawingPtr; - typedef ::std::auto_ptr< BiffSheetDrawing > BiffSheetDrawingPtr; + typedef ::std::unique_ptr< VmlDrawing > VmlDrawingPtr; + typedef ::std::unique_ptr< BiffSheetDrawing > BiffSheetDrawingPtr; const OUString maSheetCellRanges; /// Service name for a SheetCellRanges object. const OUString maUrlTextField; /// Service name for a URL text field. diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index b378c4a1b3e2..216f3c5c6583 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -410,7 +410,7 @@ void XclEscherEx::EndDocument() XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor ) { - ::std::auto_ptr< XclExpOcxControlObj > xOcxCtrl; + ::std::unique_ptr< XclExpOcxControlObj > xOcxCtrl; Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( xShape ); if( xCtrlModel.is() ) @@ -440,7 +440,7 @@ XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape, XclExpTbxControlObj* XclEscherEx::CreateTBXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor ) { - ::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pChildAnchor ) ); + ::std::unique_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pChildAnchor ) ); if( xTbxCtrl->GetObjType() == EXC_OBJTYPE_UNKNOWN ) xTbxCtrl.reset(); diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx index a5540680ec4a..6f3ce9045385 100644 --- a/sc/source/filter/xml/XMLTableShapeResizer.cxx +++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx @@ -35,7 +35,7 @@ #include <vector> using namespace ::com::sun::star; -using ::std::auto_ptr; +using ::std::unique_ptr; using ::std::vector; ScMyOLEFixer::ScMyOLEFixer(ScXMLImport& rTempImport) @@ -82,9 +82,7 @@ void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc, if (!pCollection) return; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<ScTokenRef> > pRefTokens(new vector<ScTokenRef>); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr< vector<ScTokenRef> > pRefTokens(new vector<ScTokenRef>); const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep); ScRefTokenHelper::compileRangeRepresentation( *pRefTokens, aRangeStr, pDoc, cSep, pDoc->GetGrammar()); diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index e2ac747035eb..10e1049860d7 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -900,8 +900,8 @@ void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos) if( pObject ) { // rescue settings from drawing object before the shape is removed - ::std::auto_ptr< SfxItemSet > xItemSet( new SfxItemSet( pObject->GetMergedItemSet() ) ); - ::std::auto_ptr< OutlinerParaObject > xOutlinerObj; + ::std::unique_ptr< SfxItemSet > xItemSet( new SfxItemSet( pObject->GetMergedItemSet() ) ); + ::std::unique_ptr< OutlinerParaObject > xOutlinerObj; if( OutlinerParaObject* pOutlinerObj = pObject->GetOutlinerParaObject() ) xOutlinerObj.reset( new OutlinerParaObject( *pOutlinerObj ) ); Rectangle aCaptionRect; diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index 38db1b30e1e6..51d650642c77 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -288,10 +288,8 @@ ScDBData* ScXMLDatabaseRangeContext::ConvertToDBData(const OUString& rName) ScDocument* pDoc = GetScImport().GetDocument(); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDBData> pData( + ::std::unique_ptr<ScDBData> pData( new ScDBData(rName, maRange.aStart.Tab(), maRange.aStart.Col(), maRange.aStart.Row(), maRange.aEnd.Col(), maRange.aEnd.Row(), bByRow, bHasHeader)); - SAL_WNODEPRECATED_DECLARATIONS_POP pData->SetAutoFilter(bAutoFilter); pData->SetKeepFmt(bKeepFormats); @@ -448,9 +446,7 @@ void ScXMLDatabaseRangeContext::EndElement() if (meRangeType == ScDBCollection::SheetAnonymous) { OUString aName(STR_DB_LOCAL_NONAME); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDBData> pData(ConvertToDBData(aName)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDBData> pData(ConvertToDBData(aName)); if (pData.get()) { @@ -465,9 +461,7 @@ void ScXMLDatabaseRangeContext::EndElement() else if (meRangeType == ScDBCollection::GlobalAnonymous) { OUString aName(STR_DB_GLOBAL_NONAME); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDBData> pData(ConvertToDBData(aName)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDBData> pData(ConvertToDBData(aName)); if (pData.get()) { @@ -483,9 +477,7 @@ void ScXMLDatabaseRangeContext::EndElement() } else if (meRangeType == ScDBCollection::GlobalNamed) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDBData> pData(ConvertToDBData(sDatabaseRangeName)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDBData> pData(ConvertToDBData(sDatabaseRangeName)); if (pData.get()) { diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 1b9d10ab874d..73080e950b71 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <o3tl/ptr_container.hxx> #include <svl/zforlist.hxx> #include <sal/macros.h> @@ -92,6 +95,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <memory> +#include <utility> #define SC_LOCALE "Locale" #define SC_STANDARDFORMAT "StandardFormat" @@ -2396,13 +2400,13 @@ bool ScXMLImport::GetValidation(const OUString& sName, ScMyImportValidation& aVa void ScXMLImport::AddNamedExpression(SCTAB nTab, ScMyNamedExpression* pNamedExp) { - ::std::auto_ptr<ScMyNamedExpression> p(pNamedExp); + ::std::unique_ptr<ScMyNamedExpression> p(pNamedExp); SheetNamedExpMap::iterator itr = maSheetNamedExpressions.find(nTab); if (itr == maSheetNamedExpressions.end()) { // No chain exists for this sheet. Create one. - ::std::auto_ptr<ScMyNamedExpressions> pNew(new ScMyNamedExpressions); - ::std::pair<SheetNamedExpMap::iterator, bool> r = maSheetNamedExpressions.insert(nTab, pNew); + ::std::unique_ptr<ScMyNamedExpressions> pNew(new ScMyNamedExpressions); + ::std::pair<SheetNamedExpMap::iterator, bool> r = o3tl::ptr_container::insert(maSheetNamedExpressions, nTab, std::move(pNew)); if (!r.second) // insertion failed. return; @@ -2410,7 +2414,7 @@ void ScXMLImport::AddNamedExpression(SCTAB nTab, ScMyNamedExpression* pNamedExp) itr = r.first; } ScMyNamedExpressions& r = *itr->second; - r.push_back(p); + o3tl::ptr_container::push_back(r, std::move(p)); } ScXMLChangeTrackingImportHelper* ScXMLImport::GetChangeTrackingImportHelper() diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index 548763e966d7..8376558d282c 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -141,7 +141,6 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ), - pExternalRefInfo(NULL), nStartOffset(-1), bStartFormPage(false), bPrintEntireSheet(true) diff --git a/sc/source/filter/xml/xmltabi.hxx b/sc/source/filter/xml/xmltabi.hxx index 01c906529a97..62bd8c034c64 100644 --- a/sc/source/filter/xml/xmltabi.hxx +++ b/sc/source/filter/xml/xmltabi.hxx @@ -40,7 +40,7 @@ struct ScXMLExternalTabData class ScXMLTableContext : public SvXMLImportContext { OUString sPrintRanges; - ::std::auto_ptr<ScXMLExternalTabData> pExternalRefInfo; + ::std::unique_ptr<ScXMLExternalTabData> pExternalRefInfo; sal_Int32 nStartOffset; bool bStartFormPage; bool bPrintEntireSheet; diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 2989da515245..a15e3f978dbe 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <utility> + #include "AccessibleCell.hxx" #include "scitems.hxx" #include <editeng/eeitem.hxx> @@ -388,20 +392,18 @@ ScDocument* ScAccessibleCell::GetDocument(ScTabViewShell* pViewShell) return pDoc; } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -::std::auto_ptr< SvxEditSource > ScAccessibleCell::CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos) +::std::unique_ptr< SvxEditSource > ScAccessibleCell::CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos) { if (IsFormulaMode()) { - return ::std::auto_ptr< SvxEditSource >(); + return ::std::unique_ptr< SvxEditSource >(); } - ::std::auto_ptr < ScAccessibleTextData > pAccessibleCellTextData + ::std::unique_ptr < ScAccessibleTextData > pAccessibleCellTextData ( new ScAccessibleCellTextData( pViewShell, aCell, eSplitPos, this ) ); - ::std::auto_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessibleCellTextData)); + ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(std::move(pAccessibleCellTextData))); return pEditSource; } -SAL_WNODEPRECATED_DECLARATIONS_POP void ScAccessibleCell::FillDependends(utl::AccessibleRelationSetHelper* pRelationSet) { diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index f23a91bba5e5..bb924f2befaf 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <utility> + #include "AccessibleCsvControl.hxx" #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleRelationType.hpp> @@ -1383,7 +1387,7 @@ ScAccessibleCsvCell::ScAccessibleCsvCell( const OUString& rCellText, sal_Int32 nRow, sal_Int32 nColumn ) : ScAccessibleCsvControl( rGrid.GetAccessible(), rGrid, nCellRole ), - AccessibleStaticTextBase( SvxEditSourcePtr( NULL ) ), + AccessibleStaticTextBase( SvxEditSourcePtr() ), maCellText( rCellText ), mnLine( nRow ? (nRow + rGrid.GetFirstVisLine() - 1) : CSV_LINE_HEADER ), mnColumn( lcl_GetGridColumn( nColumn ) ), @@ -1399,7 +1403,7 @@ ScAccessibleCsvCell::~ScAccessibleCsvCell() void SAL_CALL ScAccessibleCsvCell::disposing() { SolarMutexGuard aGuard; - SetEditSource( SvxEditSourcePtr( NULL ) ); + SetEditSource( SvxEditSourcePtr() ); ScAccessibleCsvControl::disposing(); } @@ -1565,19 +1569,17 @@ Rectangle ScAccessibleCsvCell::implGetBoundingBox() const return aRect; } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -::std::auto_ptr< SvxEditSource > ScAccessibleCsvCell::implCreateEditSource() +::std::unique_ptr< SvxEditSource > ScAccessibleCsvCell::implCreateEditSource() { ScCsvGrid& rGrid = implGetGrid(); Rectangle aBoundRect( implGetBoundingBox() ); aBoundRect -= implGetRealPos(); - ::std::auto_ptr< ScAccessibleTextData > pCsvTextData( new ScAccessibleCsvTextData( + ::std::unique_ptr< ScAccessibleTextData > pCsvTextData( new ScAccessibleCsvTextData( &rGrid, rGrid.GetEditEngine(), maCellText, aBoundRect, implGetRealSize() ) ); - ::std::auto_ptr< SvxEditSource > pEditSource( new ScAccessibilityEditSource( pCsvTextData ) ); + ::std::unique_ptr< SvxEditSource > pEditSource( new ScAccessibilityEditSource( std::move(pCsvTextData) ) ); return pEditSource; } -SAL_WNODEPRECATED_DECLARATIONS_POP /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index 9a4013aba71d..f57792315988 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -142,11 +142,9 @@ ScNotesChildren::~ScNotesChildren() { ::accessibility::AccessibleTextHelper* pTextHelper = NULL; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr < ScAccessibleTextData > pAccessiblePreviewHeaderCellTextData + ::std::unique_ptr < ScAccessibleTextData > pAccessiblePreviewHeaderCellTextData (new ScAccessibleNoteTextData(mpViewShell, rString, aCellPos, bMarkNote)); - SAL_WNODEPRECATED_DECLARATIONS_POP - ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessiblePreviewHeaderCellTextData)); + ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(std::move(pAccessiblePreviewHeaderCellTextData))); pTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource)); diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx index 364ddab5fbe0..0020a70e89cd 100644 --- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx +++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx @@ -357,9 +357,7 @@ void ScAccessibleEditObject::CreateTextHelper() { if (!mpTextHelper) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr < ScAccessibleTextData > pAccessibleTextData; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr < ScAccessibleTextData > pAccessibleTextData; if (meObjectType == CellInEditMode || meObjectType == EditControl) { pAccessibleTextData.reset @@ -371,7 +369,7 @@ void ScAccessibleEditObject::CreateTextHelper() (new ScAccessibleEditLineTextData(NULL, mpWindow)); } - ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessibleTextData)); + ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(std::move(pAccessibleTextData))); mpTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource)); mpTextHelper->SetEventSource(this); mpTextHelper->SetFocus(mbHasFocus); diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index b261af665925..88403d803f26 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -300,11 +300,9 @@ void ScAccessiblePageHeaderArea::CreateTextHelper() { if (!mpTextHelper) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr < ScAccessibleTextData > pAccessibleHeaderTextData + ::std::unique_ptr < ScAccessibleTextData > pAccessibleHeaderTextData (new ScAccessibleHeaderTextData(mpViewShell, mpEditObj, mbHeader, meAdjust)); - SAL_WNODEPRECATED_DECLARATIONS_POP - ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessibleHeaderTextData)); + ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(std::move(pAccessibleHeaderTextData))); mpTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource)); mpTextHelper->SetEventSource(this); diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx index ef0f0cfae5cf..b6f2dd557df4 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx @@ -283,11 +283,9 @@ void ScAccessiblePreviewCell::CreateTextHelper() { if (!mpTextHelper) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr < ScAccessibleTextData > pAccessiblePreviewCellTextData + ::std::unique_ptr < ScAccessibleTextData > pAccessiblePreviewCellTextData (new ScAccessiblePreviewCellTextData(mpViewShell, maCellAddress)); - SAL_WNODEPRECATED_DECLARATIONS_POP - ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessiblePreviewCellTextData)); + ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(std::move(pAccessiblePreviewCellTextData))); mpTextHelper = new ::accessibility::AccessibleTextHelper( std::move(pEditSource) ); mpTextHelper->SetEventSource( this ); diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index b42a305861f5..cea59f9facf5 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -427,11 +427,9 @@ void ScAccessiblePreviewHeaderCell::CreateTextHelper() { if (!mpTextHelper) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr < ScAccessibleTextData > pAccessiblePreviewHeaderCellTextData + ::std::unique_ptr < ScAccessibleTextData > pAccessiblePreviewHeaderCellTextData (new ScAccessiblePreviewHeaderCellTextData(mpViewShell, OUString(getAccessibleName()), maCellPos, mbColumnHeader, mbRowHeader)); - SAL_WNODEPRECATED_DECLARATIONS_POP - ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessiblePreviewHeaderCellTextData)); + ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(std::move(pAccessiblePreviewHeaderCellTextData))); mpTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource)); mpTextHelper->SetEventSource(this); diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index b61ce4dc1cf5..b478f679049c 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -1349,7 +1349,7 @@ void ScCsvGrid::ImplDrawTrackingRect( sal_uInt32 nColIndex ) ScAccessibleCsvControl* ScCsvGrid::ImplCreateAccessible() { - std::auto_ptr<ScAccessibleCsvControl> pControl(new ScAccessibleCsvGrid( *this )); + std::unique_ptr<ScAccessibleCsvControl> pControl(new ScAccessibleCsvGrid( *this )); pControl->Init(); return pControl.release(); } diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index fe843b585edc..2b438ce93c72 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1143,15 +1143,13 @@ bool isEditable(ScDocShell& rDocShell, const ScRangeList& rRanges, bool bApi) return true; } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -void createUndoDoc(std::auto_ptr<ScDocument>& pUndoDoc, ScDocument* pDoc, const ScRange& rRange) +void createUndoDoc(std::unique_ptr<ScDocument>& pUndoDoc, ScDocument* pDoc, const ScRange& rRange) { SCTAB nTab = rRange.aStart.Tab(); pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); pUndoDoc->InitUndo(pDoc, nTab, nTab); pDoc->CopyToDocument(rRange, IDF_ALL, false, pUndoDoc.get()); } -SAL_WNODEPRECATED_DECLARATIONS_POP bool checkNewOutputRange(ScDPObject& rDPObj, ScDocShell& rDocShell, ScRange& rNewOut, bool bApi) { @@ -1229,10 +1227,8 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb if (!isEditable(rDocShell, aRanges, bApi)) return false; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ScDocument> pOldUndoDoc; - std::auto_ptr<ScDocument> pNewUndoDoc; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ScDocument> pOldUndoDoc; + std::unique_ptr<ScDocument> pNewUndoDoc; ScDPObject aUndoDPObj(*pOldObj); // for undo or revert on failure @@ -1311,10 +1307,8 @@ bool ScDBDocFunc::RemovePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) if (!isEditable(rDocShell, rDPObj.GetOutRange(), bApi)) return false; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ScDocument> pOldUndoDoc; - std::auto_ptr<ScDPObject> pUndoDPObj; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ScDocument> pOldUndoDoc; + std::unique_ptr<ScDPObject> pUndoDPObj; if (bRecord) pUndoDPObj.reset(new ScDPObject(rDPObj)); // copy old settings for undo @@ -1365,18 +1359,14 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool if (!isEditable(rDocShell, ScRange(rDPObj.GetOutRange().aStart), bApi)) return false; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ScDocument> pNewUndoDoc; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ScDocument> pNewUndoDoc; ScDocument& rDoc = rDocShell.GetDocument(); if (bRecord && !rDoc.IsUndoEnabled()) bRecord = false; // output range must be set at pNewObj - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ScDPObject> pDestObj(new ScDPObject(rDPObj)); - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ScDPObject> pDestObj(new ScDPObject(rDPObj)); ScDPObject& rDestObj = *pDestObj; @@ -1469,10 +1459,8 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) if (!isEditable(rDocShell, rDPObj.GetOutRange(), bApi)) return false; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ScDocument> pOldUndoDoc; - std::auto_ptr<ScDocument> pNewUndoDoc; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ScDocument> pOldUndoDoc; + std::unique_ptr<ScDocument> pNewUndoDoc; ScDPObject aUndoDPObj(rDPObj); // For undo or revert on failure. diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index b220f716afc4..c20992abf876 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -86,6 +86,7 @@ #include <rowheightcontext.hxx> #include <memory> +#include <utility> #include <basic/basmgr.hxx> #include <boost/scoped_array.hpp> #include <boost/scoped_ptr.hpp> @@ -967,9 +968,7 @@ bool ScDocFunc::SetStringOrEditCell( const ScAddress& rPos, const OUString& rStr bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, bool bInteraction ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ScFormulaCell> xCell(pCell); - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ScFormulaCell> xCell(pCell); ScDocShellModificator aModificator( rDocShell ); ScDocument& rDoc = rDocShell.GetDocument(); @@ -3649,14 +3648,12 @@ void ScDocFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect ) OSL_ENSURE(pProtect, "ScDocFunc::Unprotect: ScTableProtection pointer is NULL!"); if (pProtect) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScTableProtection> p(new ScTableProtection(*pProtect)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScTableProtection> p(new ScTableProtection(*pProtect)); p->setProtected(true); // just in case ... rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoTabProtect(&rDocShell, nTab, p) ); + new ScUndoTabProtect(&rDocShell, nTab, std::move(p)) ); - // ownership of auto_ptr now transferred to ScUndoTabProtect. + // ownership of unique_ptr now transferred to ScUndoTabProtect. } } @@ -3681,13 +3678,11 @@ bool ScDocFunc::Protect( SCTAB nTab, const OUString& rPassword, bool /*bApi*/ ) OSL_ENSURE(pProtect, "ScDocFunc::Unprotect: ScDocProtection pointer is NULL!"); if (pProtect) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDocProtection> p(new ScDocProtection(*pProtect)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDocProtection> p(new ScDocProtection(*pProtect)); p->setProtected(true); // just in case ... rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDocProtect(&rDocShell, p) ); - // ownership of auto_ptr is transferred to ScUndoDocProtect. + new ScUndoDocProtect(&rDocShell, std::move(p)) ); + // ownership of unique_ptr is transferred to ScUndoDocProtect. } } } @@ -3705,13 +3700,11 @@ bool ScDocFunc::Protect( SCTAB nTab, const OUString& rPassword, bool /*bApi*/ ) OSL_ENSURE(pProtect, "ScDocFunc::Unprotect: ScTableProtection pointer is NULL!"); if (pProtect) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScTableProtection> p(new ScTableProtection(*pProtect)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScTableProtection> p(new ScTableProtection(*pProtect)); p->setProtected(true); // just in case ... rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoTabProtect(&rDocShell, nTab, p) ); - // ownership of auto_ptr now transferred to ScUndoTabProtect. + new ScUndoTabProtect(&rDocShell, nTab, std::move(p)) ); + // ownership of unique_ptr now transferred to ScUndoTabProtect. } } } @@ -3737,9 +3730,7 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi ) return true; // save the protection state before unprotect (for undo). - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDocProtection> pProtectCopy(new ScDocProtection(*pDocProtect)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDocProtection> pProtectCopy(new ScDocProtection(*pDocProtect)); if (!pDocProtect->verifyPassword(rPassword)) { @@ -3756,8 +3747,8 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi ) { pProtectCopy->setProtected(false); rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDocProtect(&rDocShell, pProtectCopy) ); - // ownership of auto_ptr now transferred to ScUndoDocProtect. + new ScUndoDocProtect(&rDocShell, std::move(pProtectCopy)) ); + // ownership of unique_ptr now transferred to ScUndoDocProtect. } } else @@ -3770,9 +3761,7 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi ) return true; // save the protection state before unprotect (for undo). - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScTableProtection> pProtectCopy(new ScTableProtection(*pTabProtect)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScTableProtection> pProtectCopy(new ScTableProtection(*pTabProtect)); if (!pTabProtect->verifyPassword(rPassword)) { if (!bApi) @@ -3788,8 +3777,8 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi ) { pProtectCopy->setProtected(false); rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoTabProtect(&rDocShell, nTab, pProtectCopy) ); - // ownership of auto_ptr now transferred to ScUndoTabProtect. + new ScUndoTabProtect(&rDocShell, nTab, std::move(pProtectCopy)) ); + // ownership of unique_ptr now transferred to ScUndoTabProtect. } } diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index 06186c769aac..c1ac7036c9b4 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -60,7 +60,7 @@ using com::sun::star::container::XNameContainer; using com::sun::star::uno::Reference; using com::sun::star::uno::UNO_QUERY; -using ::std::auto_ptr; +using ::std::unique_ptr; using ::std::vector; // former viewfunc/dbfunc methods @@ -891,10 +891,8 @@ bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, bool bCopy, bool bRec if (bRecord) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<SCTAB> > pSrcList(new vector<SCTAB>(1, nSrcTab)); - auto_ptr< vector<SCTAB> > pDestList(new vector<SCTAB>(1, nDestTab)); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr< vector<SCTAB> > pSrcList(new vector<SCTAB>(1, nSrcTab)); + unique_ptr< vector<SCTAB> > pDestList(new vector<SCTAB>(1, nDestTab)); GetUndoManager()->AddUndoAction( new ScUndoCopyTab(this, pSrcList.release(), pDestList.release())); } @@ -961,10 +959,8 @@ bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, bool bCopy, bool bRec } else if (bRecord) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<SCTAB> > pSrcList(new vector<SCTAB>(1, nSrcTab)); - auto_ptr< vector<SCTAB> > pDestList(new vector<SCTAB>(1, nDestTab)); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr< vector<SCTAB> > pSrcList(new vector<SCTAB>(1, nSrcTab)); + unique_ptr< vector<SCTAB> > pDestList(new vector<SCTAB>(1, nDestTab)); GetUndoManager()->AddUndoAction( new ScUndoMoveTab(this, pSrcList.release(), pDestList.release())); } diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index bfed0655d84f..6449cbcae873 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -61,7 +61,7 @@ #include <boost/scoped_ptr.hpp> -using ::std::auto_ptr; +using ::std::unique_ptr; using ::com::sun::star::uno::Any; using ::std::vector; using ::std::find; @@ -1476,9 +1476,7 @@ static ScTokenArray* convertToTokenArray( ::boost::scoped_ptr<ScRange> pUsedRange; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScTokenArray> pArray(new ScTokenArray); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScTokenArray> pArray(new ScTokenArray); bool bFirstTab = true; vector<ScExternalRefCache::SingleRangeData>::iterator itrCache = rCacheData.begin(), itrCacheEnd = rCacheData.end(); @@ -1580,9 +1578,7 @@ static ScTokenArray* lcl_fillEmptyMatrix(const ScRange& rRange) ScMatrixRef xMat = new ScMatrix(nC, nR); ScMatrixToken aToken(xMat); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScTokenArray> pArray(new ScTokenArray); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScTokenArray> pArray(new ScTokenArray); pArray->AddToken(aToken); return pArray.release(); } @@ -2359,9 +2355,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt // make medium hidden to prevent assertion from progress bar pSet->Put( SfxBoolItem(SID_HIDDEN, true) ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<SfxMedium> pMedium(new SfxMedium(aFile, STREAM_STD_READ, pFilter, pSet)); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<SfxMedium> pMedium(new SfxMedium(aFile, STREAM_STD_READ, pFilter, pSet)); if (pMedium->GetError() != ERRCODE_NONE) return NULL; diff --git a/sc/source/ui/inc/AccessibleCell.hxx b/sc/source/ui/inc/AccessibleCell.hxx index 01cfd99f858b..03b8b22762ac 100644 --- a/sc/source/ui/inc/AccessibleCell.hxx +++ b/sc/source/ui/inc/AccessibleCell.hxx @@ -171,7 +171,7 @@ private: ScDocument* GetDocument(ScTabViewShell* mpViewShell); - ::std::auto_ptr< SvxEditSource > CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos); + ::std::unique_ptr< SvxEditSource > CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos); void FillDependends(utl::AccessibleRelationSetHelper* pRelationSet); void FillPrecedents(utl::AccessibleRelationSetHelper* pRelationSet); diff --git a/sc/source/ui/inc/AccessibleCsvControl.hxx b/sc/source/ui/inc/AccessibleCsvControl.hxx index fc0b6ce0244c..a26a8739d7be 100644 --- a/sc/source/ui/inc/AccessibleCsvControl.hxx +++ b/sc/source/ui/inc/AccessibleCsvControl.hxx @@ -538,7 +538,7 @@ class ScAccessibleCsvCell : public ScAccessibleCsvControl, public accessibility: protected: typedef ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > PropertyValueSeq; - typedef ::std::auto_ptr< SvxEditSource > SvxEditSourcePtr; + typedef ::std::unique_ptr< SvxEditSource > SvxEditSourcePtr; private: OUString maCellText; /// The text contents of this cell. @@ -630,7 +630,7 @@ private: Rectangle implGetBoundingBox() const; /** Creates the edit source the text helper needs. */ - ::std::auto_ptr< SvxEditSource > implCreateEditSource(); + ::std::unique_ptr< SvxEditSource > implCreateEditSource(); }; #endif diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx index 61cd3ae7c9a3..b6971378c017 100644 --- a/sc/source/ui/inc/AccessibleText.hxx +++ b/sc/source/ui/inc/AccessibleText.hxx @@ -282,8 +282,8 @@ private: class ScAccessibleCsvTextData : public ScAccessibleTextData { private: - typedef ::std::auto_ptr< SvxTextForwarder > TextForwarderPtr; - typedef ::std::auto_ptr< ScCsvViewForwarder > ViewForwarderPtr; + typedef ::std::unique_ptr< SvxTextForwarder > TextForwarderPtr; + typedef ::std::unique_ptr< ScCsvViewForwarder > ViewForwarderPtr; vcl::Window* mpWindow; EditEngine* mpEditEngine; diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index b189a2820492..6fcff6bd3752 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -44,12 +44,12 @@ class ScRangeList; class ScFormulaReferenceHelper { IAnyRefDialog* m_pDlg; - ::std::auto_ptr<ScCompiler> pRefComp; + ::std::unique_ptr<ScCompiler> pRefComp; formula::RefEdit* pRefEdit; // active input field formula::RefButton* pRefBtn; // associated button vcl::Window* m_pWindow; SfxBindings* m_pBindings; - ::std::auto_ptr<Accelerator> + ::std::unique_ptr<Accelerator> pAccel; // for Enter/Escape ::std::vector<vcl::Window*> m_aHiddenWidgets; // vector of hidden Controls sal_Int32 m_nOldBorderWidth; // border width for expanded dialog diff --git a/sc/source/ui/inc/csvgrid.hxx b/sc/source/ui/inc/csvgrid.hxx index 1b6024872806..bab6dda53287 100644 --- a/sc/source/ui/inc/csvgrid.hxx +++ b/sc/source/ui/inc/csvgrid.hxx @@ -73,7 +73,7 @@ typedef ::std::vector< ScCsvColState > ScCsvColStateVec; class SC_DLLPUBLIC ScCsvGrid : public ScCsvControl, public utl::ConfigurationListener { private: - typedef ::std::auto_ptr< ScEditEngineDefaulter > ScEditEnginePtr; + typedef ::std::unique_ptr< ScEditEngineDefaulter > ScEditEnginePtr; VirtualDevice maBackgrDev; /// Grid background, headers, cell texts. VirtualDevice maGridDev; /// Data grid with selection and cursor. diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index e9ac66ca69fd..0c04545e1478 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -285,7 +285,7 @@ protected: bool IsPointerAtResizePos(); private: ScPosWnd aWndPos; - std::auto_ptr<ScTextWndBase> pRuntimeWindow; + std::unique_ptr<ScTextWndBase> pRuntimeWindow; ScTextWndBase& aTextWindow; ScInputHandler* pInputHdl; OUString aTextOk; diff --git a/sc/source/ui/inc/spelldialog.hxx b/sc/source/ui/inc/spelldialog.hxx index d2a359e0e6a4..4c537106d36f 100644 --- a/sc/source/ui/inc/spelldialog.hxx +++ b/sc/source/ui/inc/spelldialog.hxx @@ -72,10 +72,10 @@ private: bool IsSelectionChanged(); private: - typedef ::std::auto_ptr< ScConversionEngineBase > ScConvEnginePtr; - typedef ::std::auto_ptr< ScDocument > ScDocumentPtr; - typedef ::std::auto_ptr< ScSelectionState > ScSelectionStatePtr; - typedef ::std::auto_ptr< ScRangeList > ScRangeListPtr; + typedef ::std::unique_ptr< ScConversionEngineBase > ScConvEnginePtr; + typedef ::std::unique_ptr< ScDocument > ScDocumentPtr; + typedef ::std::unique_ptr< ScSelectionState > ScSelectionStatePtr; + typedef ::std::unique_ptr< ScRangeList > ScRangeListPtr; ScConvEnginePtr mxEngine; ScDocumentPtr mxUndoDoc; diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx index b9f573b3955b..fe43d95b16e3 100644 --- a/sc/source/ui/inc/undotab.hxx +++ b/sc/source/ui/inc/undotab.hxx @@ -347,9 +347,7 @@ private: class ScUndoDocProtect : public ScSimpleUndo { public: - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ScUndoDocProtect(ScDocShell* pShell, ::std::auto_ptr<ScDocProtection> pProtectSettings); - SAL_WNODEPRECATED_DECLARATIONS_POP + ScUndoDocProtect(ScDocShell* pShell, ::std::unique_ptr<ScDocProtection> && pProtectSettings); virtual ~ScUndoDocProtect(); virtual void Undo() SAL_OVERRIDE; @@ -360,9 +358,7 @@ public: virtual OUString GetComment() const SAL_OVERRIDE; private: - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDocProtection> mpProtectSettings; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDocProtection> mpProtectSettings; void DoProtect(bool bProtect); }; @@ -372,10 +368,8 @@ private: class ScUndoTabProtect : public ScSimpleUndo { public: - SAL_WNODEPRECATED_DECLARATIONS_PUSH ScUndoTabProtect(ScDocShell* pShell, SCTAB nTab, - ::std::auto_ptr<ScTableProtection> pProtectSettings); - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ScTableProtection> && pProtectSettings); virtual ~ScUndoTabProtect(); virtual void Undo() SAL_OVERRIDE; @@ -387,9 +381,7 @@ public: private: SCTAB mnTab; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScTableProtection> mpProtectSettings; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScTableProtection> mpProtectSettings; void DoProtect(bool bProtect); }; diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index c402daf3d240..0d06e7507067 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -50,7 +50,6 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi , pRefBtn (NULL) , m_pWindow(NULL) , m_pBindings(_pBindings) - , pAccel( NULL ) , m_nOldBorderWidth (0) , nRefTab(0) , mnOldEditWidthReq( -1 ) diff --git a/sc/source/ui/undo/undorangename.cxx b/sc/source/ui/undo/undorangename.cxx index 790661fcd42f..6cb3d6c8b27a 100644 --- a/sc/source/ui/undo/undorangename.cxx +++ b/sc/source/ui/undo/undorangename.cxx @@ -13,11 +13,13 @@ #include "docfunc.hxx" #include "sc.hrc" +#include <o3tl/ptr_container.hxx> #include <sfx2/app.hxx> #include <memory> +#include <utility> -using ::std::auto_ptr; +using ::std::unique_ptr; ScUndoAllRangeNames::ScUndoAllRangeNames( ScDocShell* pDocSh, @@ -28,19 +30,15 @@ ScUndoAllRangeNames::ScUndoAllRangeNames( std::map<OUString, ScRangeName*>::const_iterator itr, itrEnd; for (itr = rOldNames.begin(), itrEnd = rOldNames.end(); itr != itrEnd; ++itr) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScRangeName> p(new ScRangeName(*itr->second)); - SAL_WNODEPRECATED_DECLARATIONS_POP - maOldNames.insert(itr->first, p); + unique_ptr<ScRangeName> p(new ScRangeName(*itr->second)); + o3tl::ptr_container::insert(maOldNames, itr->first, std::move(p)); } boost::ptr_map<OUString, ScRangeName>::const_iterator it, itEnd; for (it = rNewNames.begin(), itEnd = rNewNames.end(); it != itEnd; ++it) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScRangeName> p(new ScRangeName(*it->second)); - SAL_WNODEPRECATED_DECLARATIONS_POP - maNewNames.insert(it->first, p); + unique_ptr<ScRangeName> p(new ScRangeName(*it->second)); + o3tl::ptr_container::insert(maNewNames, it->first, std::move(p)); } } diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 713305cac85c..826876b14b33 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -47,6 +47,7 @@ #include "drwlayer.hxx" #include "scresid.hxx" +#include <utility> #include <vector> #include <boost/scoped_ptr.hpp> @@ -54,7 +55,7 @@ extern bool bDrawIsInUndo; // somewhere as member! using namespace com::sun::star; using ::com::sun::star::uno::Sequence; -using ::std::auto_ptr; +using ::std::unique_ptr; using ::std::vector; using ::boost::shared_ptr; @@ -1182,13 +1183,11 @@ OUString ScUndoShowHideTab::GetComment() const return ScGlobal::GetRscString( nId ); } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -ScUndoDocProtect::ScUndoDocProtect(ScDocShell* pShell, auto_ptr<ScDocProtection> pProtectSettings) : +ScUndoDocProtect::ScUndoDocProtect(ScDocShell* pShell, unique_ptr<ScDocProtection> && pProtectSettings) : ScSimpleUndo(pShell), - mpProtectSettings(pProtectSettings) + mpProtectSettings(std::move(pProtectSettings)) { } -SAL_WNODEPRECATED_DECLARATIONS_POP ScUndoDocProtect::~ScUndoDocProtect() { @@ -1201,9 +1200,7 @@ void ScUndoDocProtect::DoProtect(bool bProtect) if (bProtect) { // set protection. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScDocProtection> pCopy(new ScDocProtection(*mpProtectSettings)); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScDocProtection> pCopy(new ScDocProtection(*mpProtectSettings)); pCopy->setProtected(true); rDoc.SetDocProtection(pCopy.get()); } @@ -1253,14 +1250,12 @@ OUString ScUndoDocProtect::GetComment() const return ScGlobal::GetRscString( nId ); } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -ScUndoTabProtect::ScUndoTabProtect(ScDocShell* pShell, SCTAB nTab, auto_ptr<ScTableProtection> pProtectSettings) : +ScUndoTabProtect::ScUndoTabProtect(ScDocShell* pShell, SCTAB nTab, unique_ptr<ScTableProtection> && pProtectSettings) : ScSimpleUndo(pShell), mnTab(nTab), - mpProtectSettings(pProtectSettings) + mpProtectSettings(std::move(pProtectSettings)) { } -SAL_WNODEPRECATED_DECLARATIONS_POP ScUndoTabProtect::~ScUndoTabProtect() { @@ -1273,9 +1268,7 @@ void ScUndoTabProtect::DoProtect(bool bProtect) if (bProtect) { // set protection. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScTableProtection> pCopy(new ScTableProtection(*mpProtectSettings)); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScTableProtection> pCopy(new ScTableProtection(*mpProtectSettings)); pCopy->setProtected(true); rDoc.SetTabProtection(mnTab, pCopy.get()); } diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 46d3faee3789..9283ffe026ce 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <utility> + #include "chart2uno.hxx" #include "miscuno.hxx" #include "document.hxx" @@ -66,7 +70,7 @@ using namespace ::com::sun::star; using namespace ::formula; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Reference; -using ::std::auto_ptr; +using ::std::unique_ptr; using ::std::vector; using ::std::list; using ::std::distance; @@ -185,9 +189,7 @@ vector<ScTokenRef>* TokenTable::getColRanges(SCCOL nCol) const if( mnRowCount<=0 ) return NULL; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>); sal_uInt32 nLast = getIndex(nCol, mnRowCount-1); for (sal_uInt32 i = getIndex(nCol, 0); i <= nLast; ++i) { @@ -208,9 +210,7 @@ vector<ScTokenRef>* TokenTable::getRowRanges(SCROW nRow) const if( mnColCount<=0 ) return NULL; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>); sal_uInt32 nLast = getIndex(mnColCount-1, nRow); for (sal_uInt32 i = getIndex(0, nRow); i <= nLast; i += mnRowCount) { @@ -226,9 +226,7 @@ vector<ScTokenRef>* TokenTable::getRowRanges(SCROW nRow) const vector<ScTokenRef>* TokenTable::getAllRanges() const { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>); sal_uInt32 nStop = mnColCount*mnRowCount; for (sal_uInt32 i = 0; i < nStop; i++) { @@ -713,9 +711,7 @@ void Chart2Positioner::createPositionMap() glueState(); bool bNoGlue = (meGlue == GLUETYPE_NONE); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<FormulaTokenMapMap> pCols(new FormulaTokenMapMap); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<FormulaTokenMapMap> pCols(new FormulaTokenMapMap); FormulaTokenMap* pCol = NULL; SCROW nNoGlueRow = 0; for (vector<ScTokenRef>::const_iterator itr = mrRefTokens.begin(), itrEnd = mrRefTokens.end(); @@ -1052,9 +1048,8 @@ sal_Bool SAL_CALL ScChart2DataProvider::createDataSourcePossible( const uno::Seq namespace { -SAL_WNODEPRECATED_DECLARATIONS_PUSH Reference< chart2::data::XLabeledDataSequence > lcl_createLabeledDataSequenceFromTokens( - auto_ptr< vector< ScTokenRef > > pValueTokens, auto_ptr< vector< ScTokenRef > > pLabelTokens, + unique_ptr< vector< ScTokenRef > > && pValueTokens, unique_ptr< vector< ScTokenRef > > && pLabelTokens, ScDocument* pDoc, const Reference< chart2::data::XDataProvider >& xDP, bool bIncludeHiddenCells ) { Reference< chart2::data::XLabeledDataSequence > xResult; @@ -1086,7 +1081,6 @@ Reference< chart2::data::XLabeledDataSequence > lcl_createLabeledDataSequenceFro } return xResult; } -SAL_WNODEPRECATED_DECLARATIONS_POP /** * Check the current list of reference tokens, and add the upper left @@ -1531,21 +1525,17 @@ ScChart2DataProvider::createDataSource( // Fill Categories if( bCategories ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<ScTokenRef> > pValueTokens(NULL); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr< vector<ScTokenRef> > pValueTokens; if (bOrientCol) pValueTokens.reset(pChartMap->getAllRowHeaderRanges()); else pValueTokens.reset(pChartMap->getAllColHeaderRanges()); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<ScTokenRef> > pLabelTokens( + unique_ptr< vector<ScTokenRef> > pLabelTokens( pChartMap->getLeftUpperCornerRanges()); - SAL_WNODEPRECATED_DECLARATIONS_POP Reference< chart2::data::XLabeledDataSequence > xCategories = lcl_createLabeledDataSequenceFromTokens( - pValueTokens, pLabelTokens, m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transferred! + std::move(pValueTokens), std::move(pLabelTokens), m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transferred! if ( xCategories.is() ) { aSeqs.push_back( xCategories ); @@ -1556,10 +1546,8 @@ ScChart2DataProvider::createDataSource( sal_Int32 nCount = bOrientCol ? pChartMap->getDataColCount() : pChartMap->getDataRowCount(); for (sal_Int32 i = 0; i < nCount; ++i) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<ScTokenRef> > pValueTokens(NULL); - auto_ptr< vector<ScTokenRef> > pLabelTokens(NULL); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr< vector<ScTokenRef> > pValueTokens; + unique_ptr< vector<ScTokenRef> > pLabelTokens; if (bOrientCol) { pValueTokens.reset(pChartMap->getDataColRanges(static_cast<SCCOL>(i))); @@ -1571,7 +1559,7 @@ ScChart2DataProvider::createDataSource( pLabelTokens.reset(pChartMap->getRowHeaderRanges(static_cast<SCROW>(i))); } Reference< chart2::data::XLabeledDataSequence > xChartSeries = lcl_createLabeledDataSequenceFromTokens( - pValueTokens, pLabelTokens, m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transferred! + std::move(pValueTokens), std::move(pLabelTokens), m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transferred! if ( xChartSeries.is() && xChartSeries->getValues().is() && xChartSeries->getValues()->getData().getLength() ) { aSeqs.push_back( xChartSeries ); @@ -2904,9 +2892,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint OSL_ENSURE(m_pRangeIndices->size() == static_cast<size_t>(aRanges.size()), "range list and range index list have different sizes."); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScRangeList> pUndoRanges; - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScRangeList> pUndoRanges; if ( m_pDocument->HasUnoRefUndo() ) pUndoRanges.reset(new ScRangeList(aRanges)); @@ -3355,9 +3341,7 @@ uno::Reference< util::XCloneable > SAL_CALL ScChart2DataSequence::createClone() { SolarMutexGuard aGuard; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<ScTokenRef> > pTokensNew; - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr< vector<ScTokenRef> > pTokensNew; if (m_pTokens.get()) { // Clone tokens. @@ -3371,9 +3355,7 @@ uno::Reference< util::XCloneable > SAL_CALL ScChart2DataSequence::createClone() } } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr<ScChart2DataSequence> p(new ScChart2DataSequence(m_pDocument, m_xDataProvider, pTokensNew.release(), m_bIncludeHiddenCells)); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr<ScChart2DataSequence> p(new ScChart2DataSequence(m_pDocument, m_xDataProvider, pTokensNew.release(), m_bIncludeHiddenCells)); p->CopyData(*this); Reference< util::XCloneable > xClone(p.release()); diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx index d642c8a13e20..ff9d594f43b3 100644 --- a/sc/source/ui/unoobj/editsrc.cxx +++ b/sc/source/ui/unoobj/editsrc.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <utility> + #include "editsrc.hxx" #include "scitems.hxx" @@ -238,23 +242,19 @@ void ScSimpleEditSource::UpdateData() // nothing } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -ScAccessibilityEditSource::ScAccessibilityEditSource( ::std::auto_ptr < ScAccessibleTextData > pAccessibleCellTextData ) - : mpAccessibleTextData(pAccessibleCellTextData) +ScAccessibilityEditSource::ScAccessibilityEditSource( ::std::unique_ptr < ScAccessibleTextData > && pAccessibleCellTextData ) + : mpAccessibleTextData(std::move(pAccessibleCellTextData)) { } -SAL_WNODEPRECATED_DECLARATIONS_POP ScAccessibilityEditSource::~ScAccessibilityEditSource() { } -SAL_WNODEPRECATED_DECLARATIONS_PUSH SvxEditSource* ScAccessibilityEditSource::Clone() const { - return new ScAccessibilityEditSource(::std::auto_ptr < ScAccessibleTextData > (mpAccessibleTextData->Clone())); + return new ScAccessibilityEditSource(::std::unique_ptr < ScAccessibleTextData > (mpAccessibleTextData->Clone())); } -SAL_WNODEPRECATED_DECLARATIONS_POP SvxTextForwarder* ScAccessibilityEditSource::GetTextForwarder() { diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 859117a4b4bb..0d88e64a15eb 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -585,7 +585,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance( ScCompiler* pComp = new ScCompiler(&rDoc,aAddress); pComp->SetGrammar( rDoc.GetGrammar() ); SAL_WNODEPRECATED_DECLARATIONS_PUSH - xRet.set(static_cast<sheet::XFormulaOpCodeMapper*>(new ScFormulaOpCodeMapperObj(::std::auto_ptr<formula::FormulaCompiler> (pComp)))); + xRet.set(static_cast<sheet::XFormulaOpCodeMapper*>(new ScFormulaOpCodeMapperObj(::std::unique_ptr<formula::FormulaCompiler> (pComp)))); SAL_WNODEPRECATED_DECLARATIONS_POP break; } diff --git a/sc/source/ui/vba/vbaaxis.hxx b/sc/source/ui/vba/vbaaxis.hxx index bda2494755b0..6f10b66d5285 100644 --- a/sc/source/ui/vba/vbaaxis.hxx +++ b/sc/source/ui/vba/vbaaxis.hxx @@ -34,9 +34,7 @@ class ScVbaAxis : public ScVbaAxis_BASE bool bCrossesAreCustomized; ScVbaChart* getChartPtr() throw( css::uno::RuntimeException ); bool isValueAxis() throw( css::script::BasicErrorException ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ov::ShapeHelper> oShapeHelper; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ov::ShapeHelper> oShapeHelper; public: ScVbaAxis( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet, sal_Int32 _nType, sal_Int32 _nGroup ); diff --git a/sc/source/ui/vba/vbachartobject.hxx b/sc/source/ui/vba/vbachartobject.hxx index e79bfaa53b03..ae202e42e221 100644 --- a/sc/source/ui/vba/vbachartobject.hxx +++ b/sc/source/ui/vba/vbachartobject.hxx @@ -43,9 +43,7 @@ class ScVbaChartObject : public ChartObjectImpl_BASE css::uno::Reference< css::drawing::XShape > xShape; css::uno::Reference< css::container::XNamed > xNamed; OUString sPersistName; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ov::ShapeHelper> oShapeHelper; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ov::ShapeHelper> oShapeHelper; css::uno::Reference< css::container::XNamed > xNamedShape; OUString getPersistName(); css::uno::Reference< css::drawing::XShape > setShape() throw ( css::script::BasicErrorException ); diff --git a/sc/source/ui/vba/vbatitle.hxx b/sc/source/ui/vba/vbatitle.hxx index 8a96eab29c77..650540b26db7 100644 --- a/sc/source/ui/vba/vbatitle.hxx +++ b/sc/source/ui/vba/vbatitle.hxx @@ -39,9 +39,7 @@ typedef InheritedHelperInterfaceImpl< Ifc1 > BaseClass; protected: css::uno::Reference< css::drawing::XShape > xTitleShape; css::uno::Reference< css::beans::XPropertySet > xShapePropertySet; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ov::ShapeHelper> oShapeHelper; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ov::ShapeHelper> oShapeHelper; ScVbaPalette m_Palette; public: TitleImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& _xTitleShape ) : BaseClass( xParent, xContext ), xTitleShape( _xTitleShape ) diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index f36db76e22b3..e0d5b7a604e1 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -683,7 +683,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, Normal)); mpAutoFilterPopup->setPopupEndAction( new AutoFilterPopupEndAction(this, ScAddress(nCol, nRow, nTab))); - std::auto_ptr<AutoFilterData> pData(new AutoFilterData); + std::unique_ptr<AutoFilterData> pData(new AutoFilterData); pData->maPos = ScAddress(nCol, nRow, nTab); Point aPos = pViewData->GetScrPos(nCol, nRow, eWhich); diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 6578bd62963d..efd991534abd 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -53,7 +53,7 @@ using namespace com::sun::star; using ::com::sun::star::sheet::DataPilotFieldOrientation; using ::std::vector; -using ::std::auto_ptr; +using ::std::unique_ptr; using ::boost::unordered_map; // STATIC DATA ----------------------------------------------------------- @@ -438,7 +438,7 @@ private: void ScGridWindow::DPLaunchFieldPopupMenu( const Point& rScrPos, const Size& rScrSize, const ScAddress& rPos, ScDPObject* pDPObj) { - auto_ptr<DPFieldPopupData> pDPData(new DPFieldPopupData); + unique_ptr<DPFieldPopupData> pDPData(new DPFieldPopupData); sal_uInt16 nOrient; pDPData->mnDim = pDPObj->GetHeaderDim(rPos, nOrient); diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 2e60bfacdf3f..df5fb973cb6e 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -93,7 +93,7 @@ using namespace com::sun::star; using ::editeng::SvxBorderLine; using ::std::vector; -using ::std::auto_ptr; +using ::std::unique_ptr; // STATIC DATA --------------------------------------------------------------- @@ -1515,10 +1515,8 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, //! account for bAttrib during Undo !!! - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ScDocument> pUndoDoc; - std::auto_ptr<ScMarkData> pUndoMark; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ScDocument> pUndoDoc; + std::unique_ptr<ScMarkData> pUndoMark; OUString aUndoStr; if (bAddUndo) { @@ -2539,12 +2537,10 @@ void ScViewFunc::MoveTable( // Move or copy within the same document. SCTAB nTabCount = pDoc->GetTableCount(); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - auto_ptr< vector<SCTAB> > pSrcTabs(new vector<SCTAB>); - auto_ptr< vector<SCTAB> > pDestTabs(new vector<SCTAB>); - auto_ptr< vector<OUString> > pTabNames(new vector<OUString>); - auto_ptr< vector<OUString> > pDestNames(NULL); - SAL_WNODEPRECATED_DECLARATIONS_POP + unique_ptr< vector<SCTAB> > pSrcTabs(new vector<SCTAB>); + unique_ptr< vector<SCTAB> > pDestTabs(new vector<SCTAB>); + unique_ptr< vector<OUString> > pTabNames(new vector<OUString>); + unique_ptr< vector<OUString> > pDestNames; pSrcTabs->reserve(nTabCount); pDestTabs->reserve(nTabCount); pTabNames->reserve(nTabCount); diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index fd2dee266295..2c05bbd8468e 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -291,9 +291,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b // TODO: What's this for? break; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDocument> pDocClip(new ScDocument(SCDOCMODE_CLIP)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDocument> pDocClip(new ScDocument(SCDOCMODE_CLIP)); // Check for geometrical feasibility of the ranges. bool bValidRanges = true; @@ -849,9 +847,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, ScDocShellRef aTransShellRef; // for objects in xTransClip - must remain valid as long as xTransClip ScDocument* pOrigClipDoc = NULL; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< ScDocument > xTransClip; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< ScDocument > xTransClip; if ( bTranspose ) { SCCOL nX; @@ -1412,9 +1408,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( return false; } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDocument> pTransClip(new ScDocument(SCDOCMODE_CLIP)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDocument> pTransClip(new ScDocument(SCDOCMODE_CLIP)); pClipDoc->TransposeClip(pTransClip.get(), nFlags, bAsLink); pClipDoc = pTransClip.release(); SCCOL nTempColSize = nColSize; @@ -1470,9 +1464,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( return false; } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDocument> pUndoDoc; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDocument> pUndoDoc; if (pDoc->IsUndoEnabled()) { pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); @@ -1480,9 +1472,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( pDoc->CopyToDocument(aMarkedRange, nUndoFlags, false, pUndoDoc.get(), &aMark, true); } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<ScDocument> pMixDoc; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<ScDocument> pMixDoc; if ( bSkipEmpty || nFunction ) { if ( nFlags & IDF_CONTENTS ) @@ -1620,9 +1610,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( return false; } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr<ScDocument> pUndoDoc; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr<ScDocument> pUndoDoc; if (pDoc->IsUndoEnabled()) { pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); |