diff options
50 files changed, 190 insertions, 125 deletions
diff --git a/include/formula/formula.hxx b/include/formula/formula.hxx index 82e8246bc9b0..4c9d37e807b0 100644 --- a/include/formula/formula.hxx +++ b/include/formula/formula.hxx @@ -25,6 +25,7 @@ #include <formula/formuladllapi.h> #include <formula/IFunctionDescription.hxx> +#include <o3tl/deleter.hxx> #include <rtl/ustring.hxx> #include <sal/types.h> #include <sfx2/basedlgs.hxx> @@ -69,7 +70,7 @@ public: virtual void dispose() override; private: - ::std::unique_ptr<FormulaDlg_Impl> m_pImpl; + std::unique_ptr<FormulaDlg_Impl, o3tl::default_delete<FormulaDlg_Impl>> m_pImpl; protected: @@ -99,7 +100,7 @@ public: virtual ~FormulaDlg() override; virtual void dispose() override; private: - ::std::unique_ptr<FormulaDlg_Impl> m_pImpl; + std::unique_ptr<FormulaDlg_Impl, o3tl::default_delete<FormulaDlg_Impl>> m_pImpl; DECL_LINK( UpdateFocusHdl, Timer*, void ); protected: diff --git a/include/o3tl/deleter.hxx b/include/o3tl/deleter.hxx new file mode 100644 index 000000000000..5b5e67929a15 --- /dev/null +++ b/include/o3tl/deleter.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_O3TL_DELETER_HXX +#define INCLUDED_O3TL_DELETER_HXX + +#include <com/sun/star/uno/Exception.hpp> + +namespace o3tl { + +/** To markup std::unique_ptr that coverity warns might throw exceptions + which won't throw in practice, or where std::terminate is + an acceptable response if they do +*/ +template<typename T> struct default_delete +{ + void operator() (T* p) noexcept + { +#if defined(__COVERITY__) + try + { + delete p; + } + catch (const css::uno::Exception& e) + { + SAL_WARN("vcl.app", "Fatal exception: " << e.Message); + std::terminate(); + } + catch (const std::exception& e) + { + SAL_WARN("vcl.app", "Fatal exception: " << e.what()); + std::terminate(); + } +#else + delete p; +#endif + } +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/ivctrl.hxx b/include/svtools/ivctrl.hxx index 3cb0171f35cf..3d7a4842ca91 100644 --- a/include/svtools/ivctrl.hxx +++ b/include/svtools/ivctrl.hxx @@ -27,6 +27,7 @@ #include <tools/contnr.hxx> #include <vcl/image.hxx> #include <vcl/seleng.hxx> +#include <o3tl/deleter.hxx> #include <o3tl/typed_flags_set.hxx> class Point; @@ -189,7 +190,7 @@ class SVT_DLLPUBLIC SvtIconChoiceCtrl : public Control friend class SvxIconChoiceCtrl_Impl; Link<SvtIconChoiceCtrl*,void> _aClickIconHdl; - std::unique_ptr<SvxIconChoiceCtrl_Impl> _pImpl; + std::unique_ptr<SvxIconChoiceCtrl_Impl, o3tl::default_delete<SvxIconChoiceCtrl_Impl>> _pImpl; protected: diff --git a/include/svtools/templatefoldercache.hxx b/include/svtools/templatefoldercache.hxx index 842f19111b99..cee6bcbecc1b 100644 --- a/include/svtools/templatefoldercache.hxx +++ b/include/svtools/templatefoldercache.hxx @@ -22,9 +22,9 @@ #include <svtools/svtdllapi.h> #include <sal/types.h> +#include <o3tl/deleter.hxx> #include <memory> - namespace svt { @@ -60,7 +60,7 @@ namespace svt class SVT_DLLPUBLIC TemplateFolderCache { private: - std::unique_ptr<TemplateFolderCacheImpl> m_pImpl; + std::unique_ptr<TemplateFolderCacheImpl, o3tl::default_delete<TemplateFolderCacheImpl>> m_pImpl; public: /** ctor. diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index 1b7532fd34ee..532088359184 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -48,6 +48,7 @@ #include <cppuhelper/interfacecontainer.h> #include <comphelper/refcountedmutex.hxx> #include <comphelper/sequenceashashmap.hxx> +#include <o3tl/deleter.hxx> #include <rtl/ref.hxx> #include <list> @@ -86,7 +87,7 @@ struct SotElement_Impl bool m_bIsStorage; std::unique_ptr<OStorage_Impl> m_xStorage; - std::unique_ptr<OWriteStream_Impl> m_xStream; + std::unique_ptr<OWriteStream_Impl, o3tl::default_delete<OWriteStream_Impl>> m_xStream; public: SotElement_Impl(const OUString& rName, bool bStor, bool bNew); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 35ea5104b090..a2a073a68ab2 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -36,6 +36,7 @@ #include "typedstrdata.hxx" #include "calcmacros.hxx" #include "calcconfig.hxx" +#include <o3tl/deleter.hxx> #include <svl/hint.hxx> #include <tools/gen.hxx> #include <svl/zforlist.hxx> @@ -2386,6 +2387,8 @@ private: void SetNeedsListeningGroups( const std::vector<ScAddress>& rPosArray ); }; +typedef std::unique_ptr<ScDocument, o3tl::default_delete<ScDocument>> ScDocumentUniquePtr; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/funcuno.hxx b/sc/inc/funcuno.hxx index cf0dc8065a1b..174975c8a1f9 100644 --- a/sc/inc/funcuno.hxx +++ b/sc/inc/funcuno.hxx @@ -26,8 +26,8 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <cppuhelper/implbase.hxx> #include <svl/lstner.hxx> +#include "document.hxx" -class ScDocument; class ScDocOptions; css::uno::Reference< css::uno::XInterface > SAL_CALL @@ -37,7 +37,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL class ScTempDocCache { private: - std::unique_ptr<ScDocument> xDoc; + ScDocumentUniquePtr xDoc; bool bInUse; public: diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 21278e9385ce..02ac5a86acbc 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3500,7 +3500,7 @@ void Test::testCopyPasteTranspose() ScDocument aNewClipDoc(SCDOCMODE_CLIP); copyToClip(m_pDoc, aSrcRange, &aNewClipDoc); - ::std::unique_ptr<ScDocument> pTransClip(new ScDocument(SCDOCMODE_CLIP)); + ScDocumentUniquePtr pTransClip(new ScDocument(SCDOCMODE_CLIP)); aNewClipDoc.TransposeClip(pTransClip.get(), InsertDeleteFlags::ALL, false); ScRange aDestRange = ScRange(3,1,1,3,3,1);//target: Sheet2.D2:D4 @@ -5953,7 +5953,7 @@ void Test::testDeleteContents() aMark.SelectOneTable(0); aMark.SetMarkArea(aRange); - std::unique_ptr<ScDocument> pUndoDoc(new ScDocument(SCDOCMODE_UNDO)); + ScDocumentUniquePtr pUndoDoc(new ScDocument(SCDOCMODE_UNDO)); pUndoDoc->InitUndo(m_pDoc, 0, 0); m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::CONTENTS, false, *pUndoDoc, &aMark); ScUndoDeleteContents aUndo(&getDocShell(), aMark, aRange, std::move(pUndoDoc), false, InsertDeleteFlags::CONTENTS, true); diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx index 8a72cb88d88d..4244861528ad 100644 --- a/sc/qa/unit/ucalc_sharedformula.cxx +++ b/sc/qa/unit/ucalc_sharedformula.cxx @@ -1764,7 +1764,7 @@ void Test::testSharedFormulaUpdateOnReplacement() ScMarkData aMark; aMark.SelectOneTable(0); aMark.SetMultiMarkArea(aUndoRange); - std::unique_ptr<ScDocument> pUndoDoc(new ScDocument(SCDOCMODE_UNDO)); + ScDocumentUniquePtr pUndoDoc(new ScDocument(SCDOCMODE_UNDO)); pUndoDoc->InitUndo(m_pDoc, 0, 0); m_pDoc->CopyToDocument(aUndoRange, InsertDeleteFlags::CONTENTS, false, *pUndoDoc, &aMark); ScUndoDeleteContents aUndo(&getDocShell(), aMark, aUndoRange, std::move(pUndoDoc), false, InsertDeleteFlags::CONTENTS, true); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 94b96c051836..dc1aa2b1c28f 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3232,7 +3232,7 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark, SCROW nStartRow = rSrcArea.aStart.Row(); SCCOL nEndCol = rSrcArea.aEnd.Col(); SCROW nEndRow = rSrcArea.aEnd.Row(); - std::unique_ptr<ScDocument> pMixDoc; + ScDocumentUniquePtr pMixDoc; bool bDoMix = ( bSkipEmpty || nFunction != ScPasteFunc::NONE ) && ( nFlags & InsertDeleteFlags::CONTENTS ); bool bOldAutoCalc = GetAutoCalc(); @@ -3289,7 +3289,7 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark, if (ValidTab(nSrcTab) && nSrcTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nSrcTab]) { - std::unique_ptr<ScDocument> pMixDoc; + ScDocumentUniquePtr pMixDoc; bool bDoMix = ( bSkipEmpty || nFunction != ScPasteFunc::NONE ) && ( nFlags & InsertDeleteFlags::CONTENTS ); bool bOldAutoCalc = GetAutoCalc(); diff --git a/sc/source/filter/inc/XclExpChangeTrack.hxx b/sc/source/filter/inc/XclExpChangeTrack.hxx index 4eede908e7aa..77c6e398874a 100644 --- a/sc/source/filter/inc/XclExpChangeTrack.hxx +++ b/sc/source/filter/inc/XclExpChangeTrack.hxx @@ -26,6 +26,7 @@ #include <rtl/uuid.h> #include "bigrange.hxx" #include "chgtrack.hxx" +#include "document.hxx" #include "xelink.hxx" #include "ftools.hxx" #include "excrecds.hxx" @@ -597,7 +598,7 @@ class XclExpChangeTrack : protected XclExpRoot XclExpChTrTabIdBuffer* pTabIdBuffer; TabIdBufferType maBuffers; - std::unique_ptr<ScDocument> xTempDoc; // empty document + ScDocumentUniquePtr xTempDoc; // empty document XclExpChTrHeader* pHeader; // header record for last GUID sal_uInt8 aGUID[ 16 ]; // GUID for action info records diff --git a/sc/source/ui/dataprovider/htmldataprovider.hxx b/sc/source/ui/dataprovider/htmldataprovider.hxx index 69398632846f..db438760ea85 100644 --- a/sc/source/ui/dataprovider/htmldataprovider.hxx +++ b/sc/source/ui/dataprovider/htmldataprovider.hxx @@ -24,7 +24,7 @@ private: ScDocument* mpDocument; rtl::Reference<HTMLFetchThread> mxHTMLFetchThread; - std::unique_ptr<ScDocument> mpDoc; + ScDocumentUniquePtr mpDoc; public: diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 96fc5982fc13..0bb9aa4fed3b 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1157,7 +1157,7 @@ bool isEditable(ScDocShell& rDocShell, const ScRangeList& rRanges, bool bApi) return true; } -void createUndoDoc(std::unique_ptr<ScDocument>& pUndoDoc, ScDocument* pDoc, const ScRange& rRange) +void createUndoDoc(ScDocumentUniquePtr& pUndoDoc, ScDocument* pDoc, const ScRange& rRange) { SCTAB nTab = rRange.aStart.Tab(); pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); @@ -1241,8 +1241,8 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb if (!isEditable(rDocShell, aRanges, bApi)) return false; - std::unique_ptr<ScDocument> pOldUndoDoc; - std::unique_ptr<ScDocument> pNewUndoDoc; + ScDocumentUniquePtr pOldUndoDoc; + ScDocumentUniquePtr pNewUndoDoc; ScDPObject aUndoDPObj(*pOldObj); // for undo or revert on failure @@ -1352,7 +1352,7 @@ bool ScDBDocFunc::RemovePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) } } - std::unique_ptr<ScDocument> pOldUndoDoc; + ScDocumentUniquePtr pOldUndoDoc; std::unique_ptr<ScDPObject> pUndoDPObj; if (bRecord) @@ -1403,7 +1403,7 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool if (!isEditable(rDocShell, ScRange(rDPObj.GetOutRange().aStart), bApi)) return false; - std::unique_ptr<ScDocument> pNewUndoDoc; + ScDocumentUniquePtr pNewUndoDoc; ScDocument& rDoc = rDocShell.GetDocument(); if (bRecord && !rDoc.IsUndoEnabled()) @@ -1516,8 +1516,8 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) if (!isEditable(rDocShell, rDPObj.GetOutRange(), bApi)) return false; - std::unique_ptr<ScDocument> pOldUndoDoc; - std::unique_ptr<ScDocument> pNewUndoDoc; + ScDocumentUniquePtr pOldUndoDoc; + ScDocumentUniquePtr 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 8cdfa9f12de8..dfbc54582c6b 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -583,7 +583,7 @@ bool ScDocFunc::DeleteContents( ScMarkData aMultiMark = rMark; aMultiMark.SetMarking(false); // for MarkToMulti - std::unique_ptr<ScDocument> pUndoDoc; + ScDocumentUniquePtr pUndoDoc; bool bMulti = aMultiMark.IsMultiMarked(); aMultiMark.MarkToMulti(); aMultiMark.GetMultiMarkArea( aMarkRange ); @@ -688,7 +688,7 @@ bool ScDocFunc::DeleteCell( // To keep track of all non-empty cells within the deleted area. std::shared_ptr<ScSimpleUndo::DataSpansType> pDataSpans; - std::unique_ptr<ScDocument> pUndoDoc; + ScDocumentUniquePtr pUndoDoc; if (bRecord) { pUndoDoc = sc::DocFuncUtil::createDeleteContentsUndoDoc(rDoc, rMark, rPos, nFlags, false); @@ -2737,7 +2737,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, SCTAB nDestEndTab = nDestTab+nSrcTabCount-1; SCTAB nTab; - std::unique_ptr<ScDocument> pClipDoc = o3tl::make_unique<ScDocument>(SCDOCMODE_CLIP); + ScDocumentUniquePtr pClipDoc(new ScDocument(SCDOCMODE_CLIP)); ScMarkData aSourceMark; for (nTab=nStartTab; nTab<=nEndTab; nTab++) diff --git a/sc/source/ui/docshell/docfuncutil.cxx b/sc/source/ui/docshell/docfuncutil.cxx index 1eede21b952d..f00fa56608fb 100644 --- a/sc/source/ui/docshell/docfuncutil.cxx +++ b/sc/source/ui/docshell/docfuncutil.cxx @@ -42,11 +42,11 @@ bool DocFuncUtil::hasProtectedTab( const ScDocument& rDoc, const ScMarkData& rMa return false; } -std::unique_ptr<ScDocument> DocFuncUtil::createDeleteContentsUndoDoc( +ScDocumentUniquePtr DocFuncUtil::createDeleteContentsUndoDoc( ScDocument& rDoc, const ScMarkData& rMark, const ScRange& rRange, InsertDeleteFlags nFlags, bool bOnlyMarked ) { - std::unique_ptr<ScDocument> pUndoDoc(new ScDocument(SCDOCMODE_UNDO)); + ScDocumentUniquePtr pUndoDoc(new ScDocument(SCDOCMODE_UNDO)); SCTAB nTab = rRange.aStart.Tab(); pUndoDoc->InitUndo(&rDoc, nTab, nTab); SCTAB nTabCount = rDoc.GetTableCount(); @@ -76,7 +76,7 @@ std::unique_ptr<ScDocument> DocFuncUtil::createDeleteContentsUndoDoc( void DocFuncUtil::addDeleteContentsUndo( svl::IUndoManager* pUndoMgr, ScDocShell* pDocSh, const ScMarkData& rMark, - const ScRange& rRange, std::unique_ptr<ScDocument>&& pUndoDoc, InsertDeleteFlags nFlags, + const ScRange& rRange, ScDocumentUniquePtr&& pUndoDoc, InsertDeleteFlags nFlags, const std::shared_ptr<ScSimpleUndo::DataSpansType>& pSpans, bool bMulti, bool bDrawUndo ) { diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx index c8ba3a48b6d4..aa508dca8ef0 100644 --- a/sc/source/ui/docshell/documentlinkmgr.cxx +++ b/sc/source/ui/docshell/documentlinkmgr.cxx @@ -22,7 +22,7 @@ #include <ddelink.hxx> #include <strings.hrc> #include <scresid.hxx> - +#include <o3tl/deleter.hxx> #include <svx/svdoole2.hxx> #include <vcl/layout.hxx> @@ -33,7 +33,7 @@ namespace sc { struct DocumentLinkManagerImpl { SfxObjectShell* mpShell; - std::unique_ptr<DataStream> mpDataStream; + std::unique_ptr<DataStream, o3tl::default_delete<DataStream>> mpDataStream; std::unique_ptr<sfx2::LinkManager> mpLinkManager; DocumentLinkManagerImpl(const DocumentLinkManagerImpl&) = delete; diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 3fe47e3ef4ee..7a6dca99ad89 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -2152,7 +2152,7 @@ bool ScImportExport::Doc2Dif( SvStream& rStrm ) bool ScImportExport::Dif2Doc( SvStream& rStrm ) { SCTAB nTab = aRange.aStart.Tab(); - std::unique_ptr<ScDocument> pImportDoc( new ScDocument( SCDOCMODE_UNDO ) ); + ScDocumentUniquePtr pImportDoc( new ScDocument( SCDOCMODE_UNDO ) ); pImportDoc->InitUndo( pDoc, nTab, nTab ); // for DIF in the clipboard, IBM_850 is always used diff --git a/sc/source/ui/inc/dataprovider.hxx b/sc/source/ui/inc/dataprovider.hxx index 30e871ee6b0c..c9188eadf6a6 100644 --- a/sc/source/ui/inc/dataprovider.hxx +++ b/sc/source/ui/inc/dataprovider.hxx @@ -109,7 +109,7 @@ class CSVDataProvider : public DataProvider { rtl::Reference<CSVFetchThread> mxCSVFetchThread; ScDocument* mpDocument; - std::unique_ptr<ScDocument> mpDoc; + ScDocumentUniquePtr mpDoc; void Refresh(); diff --git a/sc/source/ui/inc/docfuncutil.hxx b/sc/source/ui/inc/docfuncutil.hxx index dba17c80464a..74d83757d492 100644 --- a/sc/source/ui/inc/docfuncutil.hxx +++ b/sc/source/ui/inc/docfuncutil.hxx @@ -25,13 +25,13 @@ public: static bool hasProtectedTab( const ScDocument& rDoc, const ScMarkData& rMark ); - static std::unique_ptr<ScDocument> createDeleteContentsUndoDoc( + static ScDocumentUniquePtr createDeleteContentsUndoDoc( ScDocument& rDoc, const ScMarkData& rMark, const ScRange& rRange, InsertDeleteFlags nFlags, bool bOnlyMarked ); static void addDeleteContentsUndo( svl::IUndoManager* pUndoMgr, ScDocShell* pDocSh, const ScMarkData& rMark, - const ScRange& rRange, std::unique_ptr<ScDocument>&& pUndoDoc, InsertDeleteFlags nFlags, + const ScRange& rRange, ScDocumentUniquePtr&& pUndoDoc, InsertDeleteFlags nFlags, const std::shared_ptr<ScSimpleUndo::DataSpansType>& pSpans, bool bMulti, bool bDrawUndo ); diff --git a/sc/source/ui/inc/spelldialog.hxx b/sc/source/ui/inc/spelldialog.hxx index af7c7bcb5ff6..f68a6e59906d 100644 --- a/sc/source/ui/inc/spelldialog.hxx +++ b/sc/source/ui/inc/spelldialog.hxx @@ -22,13 +22,13 @@ #include <memory> #include <svx/SpellDialogChildWindow.hxx> +#include "document.hxx" class ScConversionEngineBase; class ScSelectionState; class ScTabViewShell; class ScViewData; class ScRangeList; -class ScDocShell; class ScDocument; /** Specialized spell check dialog child window for Calc. @@ -73,12 +73,11 @@ private: private: typedef ::std::unique_ptr< ScConversionEngineBase > ScConvEnginePtr; - typedef ::std::unique_ptr< ScDocument > ScDocumentPtr; typedef ::std::unique_ptr< ScSelectionState > ScSelectionStatePtr; ScConvEnginePtr mxEngine; - ScDocumentPtr mxUndoDoc; - ScDocumentPtr mxRedoDoc; + ScDocumentUniquePtr mxUndoDoc; + ScDocumentUniquePtr mxRedoDoc; ScSelectionStatePtr mxOldSel; /// For cursor position in selection tools::SvRef< ScRangeList > mxOldRangeList; /// Original selection range for comparison. diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 7fd417808646..35fa4d61357a 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SC_SOURCE_UI_INC_TABVWSH_HXX #include <formula/errorcodes.hxx> +#include <o3tl/deleter.hxx> #include <svx/fmshell.hxx> #include <svtools/htmlcfg.hxx> #include <sfx2/viewsh.hxx> @@ -115,7 +116,7 @@ private: FmFormShell* pFormShell; - std::unique_ptr<ScInputHandler> mpInputHandler; // for OLE input cell + std::unique_ptr<ScInputHandler, o3tl::default_delete<ScInputHandler>> mpInputHandler; // for OLE input cell ::editeng::SvxBorderLine* pCurFrameLine; diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx index 7239f911d081..5115bc173d20 100644 --- a/sc/source/ui/inc/undoblk.hxx +++ b/sc/source/ui/inc/undoblk.hxx @@ -153,7 +153,7 @@ public: private: ScMarkData aMarkData; - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; ScRange aExtendedRange; sal_uLong nStartChangeAction; @@ -254,7 +254,7 @@ public: ScUndoDeleteContents( ScDocShell* pNewDocShell, const ScMarkData& rMark, const ScRange& rRange, - std::unique_ptr<ScDocument>&& pNewUndoDoc, bool bNewMulti, + ScDocumentUniquePtr&& pNewUndoDoc, bool bNewMulti, InsertDeleteFlags nNewFlags, bool bObjects ); virtual ~ScUndoDeleteContents() override; @@ -272,7 +272,7 @@ private: ScRange aRange; ScMarkData aMarkData; - std::unique_ptr<ScDocument> pUndoDoc; // Block mark and deleted data + ScDocumentUniquePtr pUndoDoc; // Block mark and deleted data SdrUndoAction* pDrawUndo; // Deleted objects sal_uLong nStartChangeAction; sal_uLong nEndChangeAction; @@ -304,7 +304,7 @@ public: private: ScRange aRange; ScMarkData aMarkData; - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; // Block mark and deleted data sal_uLong nStartChangeAction; sal_uLong nEndChangeAction; @@ -413,7 +413,7 @@ public: private: ScRange aSource; ScMarkData aMarkData; - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; FillDir eFillDir; FillCmd eFillCmd; @@ -444,7 +444,7 @@ public: private: ScCellMergeOption maOption; bool mbMergeContents; // Merge contents in Redo(). - std::unique_ptr<ScDocument> mxUndoDoc; // when data is merged + ScDocumentUniquePtr mxUndoDoc; // when data is merged SdrUndoAction* mpDrawUndo; void DoChange( bool bUndo ) const; @@ -467,7 +467,7 @@ public: virtual OUString GetComment() const override; private: - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; // deleted data ScMarkData aMarkData; bool bSize; @@ -526,7 +526,7 @@ public: private: ScRange aRange; - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; // Deleted data ScRefAddress theFormulaCell; ScRefAddress theFormulaEnd; @@ -609,8 +609,8 @@ public: virtual OUString GetComment() const override; private: - std::unique_ptr<ScDocument> xUndoDoc; - std::unique_ptr<ScDocument> xRedoDoc; + ScDocumentUniquePtr xUndoDoc; + ScDocumentUniquePtr xRedoDoc; void DoChange( ScDocument* pSrcDoc ) const; }; @@ -631,8 +631,8 @@ public: private: void DoChange(ScDocument* pDoc); - std::unique_ptr<ScDocument> mpUndoDoc; - std::unique_ptr<ScDocument> mpRedoDoc; + ScDocumentUniquePtr mpUndoDoc; + ScDocumentUniquePtr mpRedoDoc; ScRange maRange; }; @@ -652,8 +652,8 @@ public: private: void DoChange(const ScDocument* pDoc); - std::unique_ptr<ScDocument> mpUndoDoc; - std::unique_ptr<ScDocument> mpRedoDoc; + ScDocumentUniquePtr mpUndoDoc; + ScDocumentUniquePtr mpRedoDoc; SCTAB mnTab; }; @@ -674,7 +674,7 @@ public: virtual OUString GetComment() const override; private: - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; ScRange aRange; ScMarkData aMarkData; @@ -700,7 +700,7 @@ public: private: ScMarkData aMarkData; - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; OUString aStyleName; ScRange aRange; @@ -722,8 +722,8 @@ public: virtual OUString GetComment() const override; private: - std::unique_ptr<ScDocument> xUndoDoc; - std::unique_ptr<ScDocument> xRedoDoc; + ScDocumentUniquePtr xUndoDoc; + ScDocumentUniquePtr xRedoDoc; }; class ScUndoEnterMatrix: public ScBlockUndo @@ -743,7 +743,7 @@ public: virtual OUString GetComment() const override; private: - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; OUString aFormula; sal_uLong nStartChangeAction; @@ -837,8 +837,8 @@ private: OUString aNewOpt; OUString aNewArea; ScRange aNewRange; - std::unique_ptr<ScDocument> xUndoDoc; - std::unique_ptr<ScDocument> xRedoDoc; + ScDocumentUniquePtr xUndoDoc; + ScDocumentUniquePtr xRedoDoc; sal_uLong nOldRefresh; sal_uLong nNewRefresh; bool bWithInsert; @@ -862,7 +862,7 @@ public: private: ScMarkData aMarkData; - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; bool bIsIncrement; }; @@ -883,7 +883,7 @@ public: private: ScMarkData aMarkData; - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; TransliterationFlags nTransliterationType; @@ -905,7 +905,7 @@ public: private: ScMarkData aMarkData; - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; std::unique_ptr<sal_uInt16[]> pWhich; @@ -927,7 +927,7 @@ public: private: SCTAB nTab; - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; }; @@ -956,7 +956,7 @@ private: void SetCurTab(); std::vector<ScCellMergeOption> maOptions; - std::unique_ptr<ScDocument> pUndoDoc; + ScDocumentUniquePtr pUndoDoc; }; class ScUndoBorder: public ScBlockUndo @@ -976,7 +976,7 @@ public: virtual OUString GetComment() const override; private: - std::unique_ptr<ScDocument> xUndoDoc; + ScDocumentUniquePtr xUndoDoc; std::unique_ptr<ScRangeList> xRanges; std::unique_ptr<SvxBoxItem> xOuter; std::unique_ptr<SvxBoxInfoItem> xInner; diff --git a/sc/source/ui/inc/undodat.hxx b/sc/source/ui/inc/undodat.hxx index 7f60385d32af..46542158bbbb 100644 --- a/sc/source/ui/inc/undodat.hxx +++ b/sc/source/ui/inc/undodat.hxx @@ -60,7 +60,7 @@ private: SCCOLROW nStart; SCCOLROW nEnd; SCTAB nTab; - std::unique_ptr<ScDocument> + ScDocumentUniquePtr pUndoDoc; bool bColumns; sal_uInt16 nLevel; @@ -113,7 +113,7 @@ private: SCCOLROW nStart; SCCOLROW nEnd; SCTAB nTab; - std::unique_ptr<ScDocument> xUndoDoc; + ScDocumentUniquePtr xUndoDoc; std::unique_ptr<ScOutlineTable> xUndoTable; bool bColumns; sal_uInt16 nLevel; @@ -138,7 +138,7 @@ public: private: ScAddress aBlockStart; ScAddress aBlockEnd; - std::unique_ptr<ScDocument> xUndoDoc; + ScDocumentUniquePtr xUndoDoc; std::unique_ptr<ScOutlineTable> xUndoTable; bool bShow; }; @@ -161,7 +161,7 @@ public: private: ScAddress aBlockStart; ScAddress aBlockEnd; - std::unique_ptr<ScDocument> xUndoDoc; + ScDocumentUniquePtr xUndoDoc; std::unique_ptr<ScOutlineTable> xUndoTable; }; @@ -183,7 +183,7 @@ public: private: ScAddress aBlockStart; ScAddress aBlockEnd; - std::unique_ptr<ScDocument> xUndoDoc; + ScDocumentUniquePtr xUndoDoc; std::unique_ptr<ScOutlineTable> xUndoTable; }; @@ -206,7 +206,7 @@ private: SCTAB nTab; ScSubTotalParam aParam; // The original passed parameter SCROW nNewEndRow; // Size of result - std::unique_ptr<ScDocument> xUndoDoc; + ScDocumentUniquePtr xUndoDoc; std::unique_ptr<ScOutlineTable> xUndoTable; std::unique_ptr<ScRangeName> xUndoRange; std::unique_ptr<ScDBCollection> xUndoDB; @@ -232,7 +232,7 @@ private: SdrUndoAction* pDrawUndo; SCTAB nTab; ScQueryParam aQueryParam; - std::unique_ptr<ScDocument> xUndoDoc; + ScDocumentUniquePtr xUndoDoc; std::unique_ptr<ScDBCollection> xUndoDB; // due to source and target range ScRange aOldDest; ScRange aAdvSource; @@ -302,8 +302,8 @@ private: ScImportParam aImportParam; SCCOL nEndCol; SCROW nEndRow; - std::unique_ptr<ScDocument> xUndoDoc; - std::unique_ptr<ScDocument> xRedoDoc; + ScDocumentUniquePtr xUndoDoc; + ScDocumentUniquePtr xRedoDoc; std::unique_ptr<ScDBData> xUndoDBData; std::unique_ptr<ScDBData> xRedoDBData; SCCOL nFormulaCols; @@ -332,7 +332,7 @@ private: ScAddress aBlockEnd; SCROW nNewEndRow; ScAddress aCursorPos; - std::unique_ptr<ScDocument> xUndoDoc; + ScDocumentUniquePtr xUndoDoc; std::unique_ptr<ScOutlineTable> xUndoTable; std::unique_ptr<ScRangeName> xUndoRange; std::unique_ptr<ScDBCollection> xUndoDB; @@ -357,8 +357,8 @@ public: virtual OUString GetComment() const override; private: - std::unique_ptr<ScDocument> xOldUndoDoc; - std::unique_ptr<ScDocument> xNewUndoDoc; + ScDocumentUniquePtr xOldUndoDoc; + ScDocumentUniquePtr xNewUndoDoc; std::unique_ptr<ScDPObject> xOldDPObject; std::unique_ptr<ScDPObject> xNewDPObject; bool bAllowMove; @@ -382,7 +382,7 @@ public: private: ScArea aDestArea; - std::unique_ptr<ScDocument> xUndoDoc; + ScDocumentUniquePtr xUndoDoc; ScConsolidateParam aParam; bool bInsRef; SCSIZE nInsertCount; @@ -440,8 +440,8 @@ public: private: std::unique_ptr<ScMarkData> mxMarkData; - std::unique_ptr<ScDocument> xUndoDoc; - std::unique_ptr<ScDocument> xRedoDoc; + ScDocumentUniquePtr xUndoDoc; + ScDocumentUniquePtr xRedoDoc; std::unique_ptr<ScRefUndoData> xRefUndoData; std::unique_ptr<ScRefUndoData> xRefRedoData; sal_uLong nStartChangeAction; diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx index ee2ade721dda..901c406730a9 100644 --- a/sc/source/ui/inc/undotab.hxx +++ b/sc/source/ui/inc/undotab.hxx @@ -269,7 +269,7 @@ public: private: SCTAB nTab; SCTAB nCount; - std::unique_ptr<ScDocument> xRedoDoc; + ScDocumentUniquePtr xRedoDoc; SdrUndoAction* pDrawUndo; void DoChange() const; diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 3b7de1a31273..b033116e47e0 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1394,7 +1394,7 @@ void ScUndoDragDrop::Redo() BeginRedo(); ScDocument& rDoc = pDocShell->GetDocument(); - std::unique_ptr<ScDocument> pClipDoc(new ScDocument( SCDOCMODE_CLIP )); + ScDocumentUniquePtr pClipDoc(new ScDocument( SCDOCMODE_CLIP )); EnableDrawAdjust( &rDoc, false ); //! include in ScBlockUndo? diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 604a662009c2..7828532b92c9 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -64,7 +64,7 @@ ScUndoDeleteContents::ScUndoDeleteContents( ScDocShell* pNewDocShell, const ScMarkData& rMark, const ScRange& rRange, - std::unique_ptr<ScDocument>&& pNewUndoDoc, bool bNewMulti, + ScDocumentUniquePtr&& pNewUndoDoc, bool bNewMulti, InsertDeleteFlags nNewFlags, bool bObjects ) : ScSimpleUndo( pNewDocShell ), aRange ( rRange ), diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 8fb5c3d57b8e..c91134f3a6c3 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -141,7 +141,7 @@ static bool lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange, rSrcRange.aEnd.Row() - rSrcRange.aStart.Row() + rDestPos.Row(), nDestTab ) ); - std::unique_ptr<ScDocument> pClipDoc(new ScDocument( SCDOCMODE_CLIP )); + ScDocumentUniquePtr pClipDoc(new ScDocument( SCDOCMODE_CLIP )); ScMarkData aSourceMark; aSourceMark.SelectOneTable( nSrcTab ); // for CopyToClip aSourceMark.SetMarkArea( rSrcRange ); diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 6cc144191db4..e2016d2acce9 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -783,9 +783,9 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) break; case SID_DATA_PROVIDER: { - std::shared_ptr<ScDocument> pDoc = std::make_shared<ScDocument>(); - pDoc->InsertTab(0, "test"); - ScopedVclPtrInstance< ScDataProviderDlg > aDialog( pTabViewShell->GetDialogParent(), pDoc); + std::shared_ptr<ScDocument> xDoc(new ScDocument, o3tl::default_delete<ScDocument>()); + xDoc->InsertTab(0, "test"); + ScopedVclPtrInstance< ScDataProviderDlg > aDialog( pTabViewShell->GetDialogParent(), xDoc); if (aDialog->Execute() == RET_OK) { // handle the import here diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 0b65d959edc4..2cc79ac57080 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -1998,7 +1998,7 @@ void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet SCTAB nNewTab = GetViewData().GetTabNo(); - std::unique_ptr<ScDocument> pInsDoc(new ScDocument(SCDOCMODE_CLIP)); + ScDocumentUniquePtr pInsDoc(new ScDocument(SCDOCMODE_CLIP)); pInsDoc->ResetClip( pDoc, nNewTab ); for (SCROW nRow = 0; nRow < nRowSize; ++nRow) { diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 077877beee44..c94993a43bbc 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -32,7 +32,7 @@ #include <tools/multisel.hxx> #include <vcl/waitobj.hxx> #include <vcl/settings.hxx> -#include <o3tl/make_unique.hxx> +#include <o3tl/deleter.hxx> #include "preview.hxx" #include "prevwsh.hxx" @@ -389,11 +389,11 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) { ScPrintOptions aOptions = pScMod->GetPrintOptions(); - std::unique_ptr<ScPrintFunc> pPrintFunc; + std::unique_ptr<ScPrintFunc, o3tl::default_delete<ScPrintFunc>> pPrintFunc; if (bStateValid) - pPrintFunc = o3tl::make_unique<ScPrintFunc>( this, pDocShell, aState, &aOptions ); + pPrintFunc.reset(new ScPrintFunc(this, pDocShell, aState, &aOptions)); else - pPrintFunc = o3tl::make_unique<ScPrintFunc>( this, pDocShell, nTab, nFirstAttr[nTab], nTotalPages, nullptr, &aOptions ); + pPrintFunc.reset(new ScPrintFunc(this, pDocShell, nTab, nFirstAttr[nTab], nTotalPages, nullptr, &aOptions)); pPrintFunc->SetOffset(aOffset); pPrintFunc->SetManualZoom(nZoom); diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 3442c54618dc..b8d5ecfd30f5 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1339,7 +1339,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH, if (pBorderData) { - std::unique_ptr<ScDocument> pBorderDoc(new ScDocument( SCDOCMODE_UNDO )); + ScDocumentUniquePtr pBorderDoc(new ScDocument( SCDOCMODE_UNDO )); pBorderDoc->InitUndo( pDoc, 0,0, true,true ); if (pBorderData) pBorderDoc->ApplyAttr( 0,0,0, *pBorderData ); diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 5f15c438b891..2cf0b789062f 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1498,8 +1498,7 @@ void ScTabViewShell::Construct( TriState nForceDesignMode ) // use the InputHandler of the App). // As an intermediate solution each View gets its own InputHandler, // which only yields problems if two Views are in one task window. - - mpInputHandler = o3tl::make_unique<ScInputHandler>(); + mpInputHandler.reset(new ScInputHandler); // old version: // if ( !GetViewFrame()->ISA(SfxTopViewFrame) ) // OLE or Plug-In diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 0e5dc1edbcf0..55fe8f091d05 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -798,7 +798,7 @@ void ScViewFunc::EnterBlock( const OUString& rString, const EditTextObject* pDat ScAddress aPos( nCol, nRow, nTab ); - std::unique_ptr<ScDocument> pInsDoc(new ScDocument( SCDOCMODE_CLIP )); + ScDocumentUniquePtr pInsDoc(new ScDocument( SCDOCMODE_CLIP )); pInsDoc->ResetClip( pDoc, nTab ); if (aNewStr[0] == '=') // Formula ? @@ -1746,7 +1746,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, //! account for bAttrib during Undo !!! - std::unique_ptr<ScDocument> pUndoDoc; + ScDocumentUniquePtr pUndoDoc; std::unique_ptr<ScMarkData> pUndoMark; OUString aUndoStr; if (bAddUndo) diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 4294c55c1a07..1df722ed79f8 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -309,7 +309,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b // TODO: What's this for? break; - ::std::unique_ptr<ScDocument> pDocClip(new ScDocument(SCDOCMODE_CLIP)); + ScDocumentUniquePtr pDocClip(new ScDocument(SCDOCMODE_CLIP)); // Check for geometrical feasibility of the ranges. bool bValidRanges = true; @@ -926,7 +926,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, ScDocShellRef aTransShellRef; // for objects in xTransClip - must remain valid as long as xTransClip ScDocument* pOrigClipDoc = nullptr; - ::std::unique_ptr< ScDocument > xTransClip; + ScDocumentUniquePtr xTransClip; if ( bTranspose ) { SCCOL nX; @@ -1279,7 +1279,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, // copy from clipboard // save original data in case of calculation - std::unique_ptr<ScDocument> pMixDoc; + ScDocumentUniquePtr pMixDoc; if (nFunction != ScPasteFunc::NONE) { bSkipEmpty = false; @@ -1485,7 +1485,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( return false; } - ::std::unique_ptr<ScDocument> pTransClip(new ScDocument(SCDOCMODE_CLIP)); + ScDocumentUniquePtr pTransClip(new ScDocument(SCDOCMODE_CLIP)); pClipDoc->TransposeClip(pTransClip.get(), nFlags, bAsLink); pClipDoc = pTransClip.release(); SCCOL nTempColSize = nColSize; @@ -1542,7 +1542,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( } bool bRowInfo = ( aMarkedRange.aStart.Col()==0 && aMarkedRange.aEnd.Col()==MAXCOL ); - ::std::unique_ptr<ScDocument> pUndoDoc; + ScDocumentUniquePtr pUndoDoc; if (pDoc->IsUndoEnabled()) { pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); @@ -1550,7 +1550,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( pDoc->CopyToDocument(aMarkedRange, nUndoFlags, false, *pUndoDoc, &aMark); } - ::std::unique_ptr<ScDocument> pMixDoc; + ScDocumentUniquePtr pMixDoc; if ( bSkipEmpty || nFunction != ScPasteFunc::NONE) { if ( nFlags & InsertDeleteFlags::CONTENTS ) @@ -1693,7 +1693,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( return false; } - std::unique_ptr<ScDocument> pUndoDoc; + ScDocumentUniquePtr pUndoDoc; if (pDoc->IsUndoEnabled()) { pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); @@ -1705,7 +1705,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( } } - std::unique_ptr<ScDocument> pMixDoc; + ScDocumentUniquePtr pMixDoc; if (bSkipEmpty || nFunction != ScPasteFunc::NONE) { if (nFlags & InsertDeleteFlags::CONTENTS) @@ -1923,7 +1923,7 @@ bool ScViewFunc::LinkBlock( const ScRange& rSource, const ScAddress& rDestPos ) // run with paste ScDocument* pDoc = GetViewData().GetDocument(); - std::unique_ptr<ScDocument> pClipDoc(new ScDocument( SCDOCMODE_CLIP )); + ScDocumentUniquePtr pClipDoc(new ScDocument( SCDOCMODE_CLIP )); pDoc->CopyTabToClip( rSource.aStart.Col(), rSource.aStart.Row(), rSource.aEnd.Col(), rSource.aEnd.Row(), rSource.aStart.Tab(), pClipDoc.get() ); diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 411a7979ee78..d3baacf6ba34 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -140,7 +140,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, ScMarkData aSrcMark; aSrcMark.SelectOneTable( nSrcTab ); // for CopyToClip - std::unique_ptr<ScDocument> pClipDoc(new ScDocument( SCDOCMODE_CLIP )); + ScDocumentUniquePtr pClipDoc(new ScDocument( SCDOCMODE_CLIP )); SCCOL nFirstCol, nLastCol; SCROW nFirstRow, nLastRow; diff --git a/sd/source/ui/framework/module/ToolBarModule.hxx b/sd/source/ui/framework/module/ToolBarModule.hxx index 933f064bd65e..d0e1ebed80b6 100644 --- a/sd/source/ui/framework/module/ToolBarModule.hxx +++ b/sd/source/ui/framework/module/ToolBarModule.hxx @@ -27,6 +27,7 @@ #include <com/sun/star/frame/XController.hpp> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> +#include <o3tl/deleter.hxx> #include <memory> namespace sd { @@ -71,7 +72,7 @@ private: css::uno::Reference< css::drawing::framework::XConfigurationController> mxConfigurationController; ViewShellBase* mpBase; - std::unique_ptr<ToolBarManager::UpdateLock> mpToolBarManagerLock; + std::unique_ptr<ToolBarManager::UpdateLock, o3tl::default_delete<ToolBarManager::UpdateLock>> mpToolBarManagerLock; bool mbMainViewSwitchUpdatePending; void HandleUpdateStart(); diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index 03deeed1b511..4461dfade3bb 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -97,7 +97,7 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq ) OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); - std::unique_ptr< OutlineViewModelChangeGuard > aGuard; + std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard; if (OutlineView* pView = dynamic_cast<OutlineView*>(mpView)) { @@ -232,7 +232,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq) } OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); - std::unique_ptr< OutlineViewModelChangeGuard > aGuard; + std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard; if (OutlineView* pView = dynamic_cast<OutlineView*>(mpView)) { pOLV = pView->GetViewByWindow(mpViewShell->GetActiveWindow()); diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx index b342d506f4ce..14cb95413f78 100644 --- a/sd/source/ui/func/fuoltext.cxx +++ b/sd/source/ui/func/fuoltext.cxx @@ -211,7 +211,7 @@ bool FuOutlineText::KeyInput(const KeyEvent& rKEvt) { mpWindow->GrabFocus(); - std::unique_ptr< OutlineViewModelChangeGuard > aGuard; + std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard; if( (nKeyGroup != KEYGROUP_CURSOR) && (nKeyGroup != KEYGROUP_FKEYS) ) aGuard.reset( new OutlineViewModelChangeGuard( *pOutlineView ) ); diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx index 945fcbae93c8..60dc8569e17b 100644 --- a/sd/source/ui/inc/OutlineView.hxx +++ b/sd/source/ui/inc/OutlineView.hxx @@ -23,6 +23,7 @@ #include <memory> #include <vcl/image.hxx> #include <editeng/lrspitem.hxx> +#include <o3tl/deleter.hxx> #include "View.hxx" class SdPage; @@ -204,7 +205,7 @@ private: DECL_LINK(EventMultiplexerListener, sd::tools::EventMultiplexerEvent&, void); /** holds a model guard during drag and drop between BeginMovingHdl and EndMovingHdl */ - std::unique_ptr< OutlineViewModelChangeGuard > maDragAndDropModelGuard; + std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> maDragAndDropModelGuard; vcl::Font maPageNumberFont; vcl::Font maBulletFont; diff --git a/sd/source/ui/inc/ViewShellImplementation.hxx b/sd/source/ui/inc/ViewShellImplementation.hxx index 2e2d797df415..65222ff5fe5f 100644 --- a/sd/source/ui/inc/ViewShellImplementation.hxx +++ b/sd/source/ui/inc/ViewShellImplementation.hxx @@ -23,7 +23,7 @@ #include "ViewShell.hxx" #include "ViewShellManager.hxx" #include "ToolBarManager.hxx" - +#include <o3tl/deleter.hxx> #include <memory> class SvxIMapDlg; @@ -73,7 +73,7 @@ public: void Release (bool bForce = false); DECL_LINK(TimeoutCallback, Timer *, void); private: - ::std::unique_ptr<ToolBarManager::UpdateLock> mpLock; + ::std::unique_ptr<ToolBarManager::UpdateLock, o3tl::default_delete<ToolBarManager::UpdateLock>> mpLock; /** The timer is used both as a safe guard to unlock the update lock when Release() is not called explicitly. It is also used to defer the release of the lock to a time when the UI is not diff --git a/sd/source/ui/inc/ViewShellManager.hxx b/sd/source/ui/inc/ViewShellManager.hxx index 932d835a1eab..c9e89ee86aa9 100644 --- a/sd/source/ui/inc/ViewShellManager.hxx +++ b/sd/source/ui/inc/ViewShellManager.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SD_SOURCE_UI_INC_VIEWSHELLMANAGER_HXX #include "ShellFactory.hxx" +#include <o3tl/deleter.hxx> #include <memory> class FmFormShell; @@ -182,7 +183,7 @@ public: private: class Implementation; - ::std::unique_ptr<ViewShellManager::Implementation> mpImpl; + std::unique_ptr<ViewShellManager::Implementation, o3tl::default_delete<ViewShellManager::Implementation>> mpImpl; bool mbValid; void LockUpdate(); diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index 5eea4cd46dde..0a3fbfe812e7 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -58,6 +58,7 @@ #include "app.hrc" #include "sdresid.hxx" #include "strings.hrc" +#include <o3tl/deleter.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> #include <svx/svdpagv.hxx> @@ -303,7 +304,7 @@ protected: virtual bool ProcessDragEvent (SelectionFunction::EventDescriptor& rDescriptor) override; private: - std::unique_ptr<DragAndDropContext> mpDragAndDropContext; + std::unique_ptr<DragAndDropContext, o3tl::default_delete<DragAndDropContext>> mpDragAndDropContext; }; //===== SelectionFunction ===================================================== diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx index 4e852081de01..57bf311e23ce 100644 --- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx @@ -29,6 +29,7 @@ #include "View.hxx" #include <sfx2/viewfrm.hxx> #include "pres.hxx" +#include <o3tl/deleter.hxx> #include <tools/gen.hxx> #include <svx/svdmodel.hxx> #include <vcl/region.hxx> @@ -224,7 +225,7 @@ private: std::shared_ptr<PageObjectPainter> mpPageObjectPainter; vcl::Region maRedrawRegion; SharedILayerPainter mpBackgroundPainter; - std::unique_ptr<ToolTip> mpToolTip; + std::unique_ptr<ToolTip, o3tl::default_delete<ToolTip>> mpToolTip; bool mbIsRearrangePending; ::std::vector<Link<LinkParamNone*,void>> maVisibilityChangeListeners; diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index b2ede96f664f..8aecd998617e 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/ui/UIElementType.hpp> #include <osl/mutex.hxx> +#include <o3tl/deleter.hxx> #include <o3tl/enumrange.hxx> #include <rtl/ref.hxx> #include <sfx2/app.hxx> @@ -316,7 +317,7 @@ private: */ ::std::unique_ptr<LayouterLock> mpSynchronousLayouterLock; ::std::unique_ptr<LayouterLock> mpAsynchronousLayouterLock; - ::std::unique_ptr<ViewShellManager::UpdateLock> mpViewShellManagerLock; + ::std::unique_ptr<ViewShellManager::UpdateLock, o3tl::default_delete<ViewShellManager::UpdateLock>> mpViewShellManagerLock; ImplSVEvent * mnPendingUpdateCall; ImplSVEvent * mnPendingSetValidCall; ToolBarRules maToolBarRules; diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index f453acd062ed..e113cf9b6409 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -87,7 +87,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) sal_uInt16 nSlot = rReq.GetSlot(); OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); - std::unique_ptr< OutlineViewModelChangeGuard > aGuard; + std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard; if( dynamic_cast< const OutlineView *>( mpView ) != nullptr) { diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index 1509e5822201..97d1f7319558 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -351,7 +351,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) { sal_uInt16 nSId = rReq.GetSlot(); - std::unique_ptr< OutlineViewModelChangeGuard > aGuard; + std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard; if (nSId != SID_OUTLINE_BULLET && nSId != FN_SVX_SET_BULLET && nSId != FN_SVX_SET_NUMBER) { aGuard.reset( new OutlineViewModelChangeGuard(*pOlView) ); diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index fba7fe04696b..ea8d4fa7c75c 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -416,7 +416,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq) bool bPreviewState = false; sal_uLong nSlot = rReq.GetSlot(); - std::unique_ptr< OutlineViewModelChangeGuard > aGuard; + std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard; if( pOlView && ( (nSlot == SID_TRANSLITERATE_SENTENCE_CASE) || (nSlot == SID_TRANSLITERATE_TITLE_CASE) || diff --git a/sw/inc/list.hxx b/sw/inc/list.hxx index d3ef07c8ea4c..a5698c3cb1e5 100644 --- a/sw/inc/list.hxx +++ b/sw/inc/list.hxx @@ -20,6 +20,7 @@ #ifndef INCLUDED_SW_INC_LIST_HXX #define INCLUDED_SW_INC_LIST_HXX +#include <o3tl/deleter.hxx> #include <rtl/ustring.hxx> #include <memory> @@ -58,7 +59,7 @@ class SwList SwList( const SwList& ) = delete; SwList& operator=( const SwList& ) = delete; - std::unique_ptr<SwListImpl> mpListImpl; + std::unique_ptr<SwListImpl, o3tl::default_delete<SwListImpl>> mpListImpl; }; #endif // INCLUDED_SW_INC_LIST_HXX diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index 030d8ffda666..4a0bd4568151 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -24,6 +24,7 @@ #include <hintids.hxx> #include <comphelper/string.hxx> +#include <o3tl/deleter.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <vcl/msgbox.hxx> @@ -156,7 +157,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel) #if HAVE_FEATURE_DBCONNECTIVITY // Create DB-Manager - std::unique_ptr<SwDBManager> pDBManager(new SwDBManager(nullptr)); + std::unique_ptr<SwDBManager, o3tl::default_delete<SwDBManager>> pDBManager(new SwDBManager(nullptr)); #endif // Read SwLabItem from Config diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 3f0ebad4116a..1f206ea72bd4 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -32,6 +32,7 @@ #include <comphelper/servicehelper.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/string.hxx> +#include <o3tl/deleter.hxx> #include <unotools/ucbstreamhelper.hxx> #include <sot/filelist.hxx> #include <svx/svxdlg.hxx> @@ -1187,7 +1188,7 @@ bool SwTransferable::PasteData( TransferableDataHelper& rData, bool bPasteSelection, RndStdIds nAnchorType ) { SwWait aWait( *rSh.GetView().GetDocShell(), false ); - std::unique_ptr<SwTrnsfrActionAndUndo> pAction; + std::unique_ptr<SwTrnsfrActionAndUndo, o3tl::default_delete<SwTrnsfrActionAndUndo>> pAction; SwModule* pMod = SW_MOD(); bool bRet = false; |