diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-17 15:15:05 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-18 08:35:34 +0200 |
commit | b442d5dd3c230a8a1dabaa7cc0333911ba456859 (patch) | |
tree | 1a6ec9b9f165b95703a29e81637b1bfa91c2ed79 /sc | |
parent | 6d47aa90fcdc72f79d904e3af36ea6de0134d764 (diff) |
use unique_ptr for pImpl in sc/
Change-Id: I2516c83f8dfca1f1217be7dcb2a28f5dcd2f704e
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/arealink.hxx | 3 | ||||
-rw-r--r-- | sc/inc/bulkdatahint.hxx | 3 | ||||
-rw-r--r-- | sc/inc/cellvalues.hxx | 5 | ||||
-rw-r--r-- | sc/inc/documentimport.hxx | 3 | ||||
-rw-r--r-- | sc/inc/documentlinkmgr.hxx | 3 | ||||
-rw-r--r-- | sc/inc/formulacell.hxx | 3 | ||||
-rw-r--r-- | sc/inc/listenerquery.hxx | 3 | ||||
-rw-r--r-- | sc/inc/scmatrix.hxx | 2 | ||||
-rw-r--r-- | sc/inc/tablink.hxx | 3 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 1 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.hxx | 3 | ||||
-rw-r--r-- | sc/source/core/data/cellvalues.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documentimport.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/tool/bulkdatahint.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/tool/listenerquery.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/tool/scmatrix.cxx | 1 | ||||
-rw-r--r-- | sc/source/filter/inc/revisionfragment.hxx | 5 | ||||
-rw-r--r-- | sc/source/filter/oox/revisionfragment.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/arealink.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/docshell/documentlinkmgr.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/docshell/tablink.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/cellsh.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 1 |
24 files changed, 26 insertions, 28 deletions
diff --git a/sc/inc/arealink.hxx b/sc/inc/arealink.hxx index c014e34ba2f5..4f15f791f0cd 100644 --- a/sc/inc/arealink.hxx +++ b/sc/inc/arealink.hxx @@ -25,6 +25,7 @@ #include "address.hxx" #include <sfx2/lnkbase.hxx> #include "scdllapi.h" +#include <memory> class SfxObjectShell; struct AreaLink_Impl; @@ -33,7 +34,7 @@ class Dialog; class SC_DLLPUBLIC ScAreaLink : public ::sfx2::SvBaseLink, public ScRefreshTimer { private: - AreaLink_Impl* pImpl; + std::unique_ptr<AreaLink_Impl> pImpl; OUString aFileName; OUString aFilterName; OUString aOptions; diff --git a/sc/inc/bulkdatahint.hxx b/sc/inc/bulkdatahint.hxx index 450a19f08931..4b375848f87b 100644 --- a/sc/inc/bulkdatahint.hxx +++ b/sc/inc/bulkdatahint.hxx @@ -11,6 +11,7 @@ #define INCLUDED_SC_BULKDATAHINT_HXX #include <simplehintids.hxx> +#include <memory> class ScDocument; @@ -21,7 +22,7 @@ class ColumnSpanSet; class BulkDataHint : public SfxSimpleHint { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; BulkDataHint( const BulkDataHint& ) = delete; BulkDataHint& operator= ( const BulkDataHint& ) = delete; diff --git a/sc/inc/cellvalues.hxx b/sc/inc/cellvalues.hxx index 6aaf32673868..7c132b00fce2 100644 --- a/sc/inc/cellvalues.hxx +++ b/sc/inc/cellvalues.hxx @@ -12,6 +12,7 @@ #include "address.hxx" #include <global.hxx> +#include <memory> class ScColumn; @@ -40,7 +41,7 @@ struct CellValueSpan */ class CellValues { - CellValuesImpl* mpImpl; + std::unique_ptr<CellValuesImpl> mpImpl; CellValues( const CellValues& ) = delete; CellValues& operator= ( const CellValues& ) = delete; @@ -86,7 +87,7 @@ class TableValues { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; TableValues( const TableValues& ) = delete; TableValues& operator= ( const TableValues& ) = delete; diff --git a/sc/inc/documentimport.hxx b/sc/inc/documentimport.hxx index 5567260c47b4..66ffaac8e6c8 100644 --- a/sc/inc/documentimport.hxx +++ b/sc/inc/documentimport.hxx @@ -16,6 +16,7 @@ #include <rtl/ustring.hxx> #include <boost/noncopyable.hpp> +#include <memory> class EditTextObject; class ScDocument; @@ -39,7 +40,7 @@ enum class SvtScriptType; */ class SC_DLLPUBLIC ScDocumentImport : boost::noncopyable { - ScDocumentImportImpl* mpImpl; + std::unique_ptr<ScDocumentImportImpl> mpImpl; ScDocumentImport(); // disabled ScDocumentImport& operator=(const ScDocumentImport&); //disabled diff --git a/sc/inc/documentlinkmgr.hxx b/sc/inc/documentlinkmgr.hxx index 0af5cf896c63..f5ba279423a1 100644 --- a/sc/inc/documentlinkmgr.hxx +++ b/sc/inc/documentlinkmgr.hxx @@ -12,6 +12,7 @@ #include <boost/noncopyable.hpp> #include <rtl/ustring.hxx> +#include <memory> class ScDocument; class SfxObjectShell; @@ -30,7 +31,7 @@ struct DocumentLinkManagerImpl; class DocumentLinkManager : boost::noncopyable { - DocumentLinkManagerImpl* mpImpl; + std::unique_ptr<DocumentLinkManagerImpl> mpImpl; public: DocumentLinkManager( ScDocument& rDoc, SfxObjectShell* pShell ); diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index 5f1c43a0fd95..5a6f87b1eb25 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SC_INC_FORMULACELL_HXX #include <set> +#include <memory> #include <boost/noncopyable.hpp> @@ -56,7 +57,7 @@ struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable { private: struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; public: diff --git a/sc/inc/listenerquery.hxx b/sc/inc/listenerquery.hxx index afe6b8a1e090..f69283cb93a0 100644 --- a/sc/inc/listenerquery.hxx +++ b/sc/inc/listenerquery.hxx @@ -15,6 +15,7 @@ #include <unordered_map> #include <vector> +#include <memory> class ScRangeList; @@ -51,7 +52,7 @@ private: class QueryRange : public SvtListener::QueryBase { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; QueryRange( const QueryRange& ) = delete; QueryRange& operator= ( const QueryRange& ) = delete; diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index c6513815fa44..883550d77b80 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -115,7 +115,7 @@ class SC_DLLPUBLIC ScMatrix { friend class ScMatrixImpl; - ScMatrixImpl* pImpl; + std::unique_ptr<ScMatrixImpl> pImpl; mutable size_t nRefCnt; // reference count // only delete via Delete() diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx index 147f3d2bd8a0..de2490e86da6 100644 --- a/sc/inc/tablink.hxx +++ b/sc/inc/tablink.hxx @@ -25,6 +25,7 @@ #include <sfx2/lnkbase.hxx> #include <sfx2/objsh.hxx> +#include <memory> class ScDocShell; struct TableLink_Impl; @@ -32,7 +33,7 @@ struct TableLink_Impl; class ScTableLink : public ::sfx2::SvBaseLink, public ScRefreshTimer { private: - TableLink_Impl* pImpl; + std::unique_ptr<TableLink_Impl> pImpl; OUString aFileName; OUString aFilterName; OUString aOptions; diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 4700c6c4a39d..66890c97e898 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -148,7 +148,6 @@ Test::Test() : Test::~Test() { - delete m_pImpl; } ScDocShell& Test::getDocShell() diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx index b1a6af2fb1df..9ea7f4ba9cdd 100644 --- a/sc/qa/unit/ucalc.hxx +++ b/sc/qa/unit/ucalc.hxx @@ -13,6 +13,7 @@ #include "helper/qahelper.hxx" #include "document.hxx" #include <stringutil.hxx> +#include <memory> struct TestImpl; class ScUndoPaste; @@ -688,7 +689,7 @@ public: CPPUNIT_TEST_SUITE_END(); private: - TestImpl* m_pImpl; + std::unique_ptr<TestImpl> m_pImpl; ScDocument *m_pDoc; }; diff --git a/sc/source/core/data/cellvalues.cxx b/sc/source/core/data/cellvalues.cxx index 5056be872d03..bdee2b95afac 100644 --- a/sc/source/core/data/cellvalues.cxx +++ b/sc/source/core/data/cellvalues.cxx @@ -61,7 +61,6 @@ CellValues::CellValues() : CellValues::~CellValues() { - delete mpImpl; } void CellValues::transferFrom( ScColumn& rCol, SCROW nRow, size_t nLen ) @@ -316,7 +315,6 @@ TableValues::TableValues( const ScRange& rRange ) : TableValues::~TableValues() { - delete mpImpl; } const ScRange& TableValues::getRange() const diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx index 2af6fdb9780e..14dfef5394b2 100644 --- a/sc/source/core/data/documentimport.cxx +++ b/sc/source/core/data/documentimport.cxx @@ -77,9 +77,9 @@ struct ScDocumentImportImpl ScDocumentImport::Attrs::Attrs() : mpData(nullptr), mnSize(0), mbLatinNumFmtOnly(false) {} ScDocumentImport::ScDocumentImport(ScDocument& rDoc) : mpImpl(new ScDocumentImportImpl(rDoc)) {} + ScDocumentImport::~ScDocumentImport() { - delete mpImpl; } ScDocument& ScDocumentImport::getDoc() diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index b6b6ad9d0994..abdab5d88e55 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -559,7 +559,6 @@ ScFormulaCellGroup::~ScFormulaCellGroup() SAL_INFO( "sc.core.formulacell", "ScFormulaCellGroup dtor this " << this); delete mpCode; delete mpCompiledFormula; - delete mpImpl; } void ScFormulaCellGroup::setCode( const ScTokenArray& rCode ) diff --git a/sc/source/core/tool/bulkdatahint.cxx b/sc/source/core/tool/bulkdatahint.cxx index 78c238444c1f..72ac7c025a2b 100644 --- a/sc/source/core/tool/bulkdatahint.cxx +++ b/sc/source/core/tool/bulkdatahint.cxx @@ -26,7 +26,6 @@ BulkDataHint::BulkDataHint( ScDocument& rDoc, const ColumnSpanSet* pSpans ) : BulkDataHint::~BulkDataHint() { - delete mpImpl; } void BulkDataHint::setSpans( const ColumnSpanSet* pSpans ) diff --git a/sc/source/core/tool/listenerquery.cxx b/sc/source/core/tool/listenerquery.cxx index faa3bbb4e3a0..e31b759b9521 100644 --- a/sc/source/core/tool/listenerquery.cxx +++ b/sc/source/core/tool/listenerquery.cxx @@ -79,7 +79,6 @@ QueryRange::QueryRange() : QueryRange::~QueryRange() { - delete mpImpl; } void QueryRange::add( const ScRange& rRange ) diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index e6bb3b80f919..2af2df361e50 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -2254,7 +2254,6 @@ ScMatrix::ScMatrix( size_t nC, size_t nR, const std::vector<double>& rInitVals ) ScMatrix::~ScMatrix() { - delete pImpl; } ScMatrix* ScMatrix::Clone() const diff --git a/sc/source/filter/inc/revisionfragment.hxx b/sc/source/filter/inc/revisionfragment.hxx index ee4e2757e334..9e13ba861b0a 100644 --- a/sc/source/filter/inc/revisionfragment.hxx +++ b/sc/source/filter/inc/revisionfragment.hxx @@ -11,6 +11,7 @@ #define INCLUDED_SC_OOX_XLS_REVISIONFRAGMENT_HXX #include <excelhandlers.hxx> +#include <memory> class ScChangeTrack; @@ -19,7 +20,7 @@ namespace oox { namespace xls { class RevisionHeadersFragment : public WorkbookFragmentBase { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; public: explicit RevisionHeadersFragment( @@ -44,7 +45,7 @@ private: class RevisionLogFragment : public WorkbookFragmentBase { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; public: explicit RevisionLogFragment( diff --git a/sc/source/filter/oox/revisionfragment.cxx b/sc/source/filter/oox/revisionfragment.cxx index 7b7861d235f1..9631049c6912 100644 --- a/sc/source/filter/oox/revisionfragment.cxx +++ b/sc/source/filter/oox/revisionfragment.cxx @@ -201,7 +201,6 @@ RevisionHeadersFragment::RevisionHeadersFragment( RevisionHeadersFragment::~RevisionHeadersFragment() { - delete mpImpl; } oox::core::ContextHandlerRef RevisionHeadersFragment::onCreateContext( @@ -340,7 +339,6 @@ RevisionLogFragment::RevisionLogFragment( RevisionLogFragment::~RevisionLogFragment() { - delete mpImpl; } oox::core::ContextHandlerRef RevisionLogFragment::onCreateContext( diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index 533deb7c4e5e..2dfba9596477 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -80,7 +80,6 @@ ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const OUString& rFile, ScAreaLink::~ScAreaLink() { StopRefreshTimer(); - delete pImpl; } void ScAreaLink::Edit(vcl::Window* pParent, const Link<SvBaseLink&,void>& /* rEndEditHdl */ ) diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx index 6a39a349ae92..87bcae28ccc4 100644 --- a/sc/source/ui/docshell/documentlinkmgr.cxx +++ b/sc/source/ui/docshell/documentlinkmgr.cxx @@ -61,7 +61,6 @@ DocumentLinkManager::DocumentLinkManager( ScDocument& rDoc, SfxObjectShell* pShe DocumentLinkManager::~DocumentLinkManager() { - delete mpImpl; } void DocumentLinkManager::setDataStream( DataStream* p ) diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index d5e211415f20..2b2572c3a7ad 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -101,7 +101,6 @@ ScTableLink::~ScTableLink() for (SCTAB nTab=0; nTab<nCount; nTab++) if (rDoc.IsLinked(nTab) && aFileName.equals(rDoc.GetLinkDoc(nTab))) rDoc.SetLink( nTab, ScLinkMode::NONE, "", "", "", "", 0 ); - delete pImpl; } void ScTableLink::Edit( vcl::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl ) diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx index ff2db0c1fdaa..d81f822bdd9e 100644 --- a/sc/source/ui/inc/cellsh.hxx +++ b/sc/source/ui/inc/cellsh.hxx @@ -26,6 +26,7 @@ #include <svx/svdmark.hxx> #include <unotools/caserotate.hxx> #include <tools/link.hxx> +#include <memory> #include "formatsh.hxx" #include "address.hxx" @@ -49,7 +50,7 @@ struct CellShell_Impl class ScCellShell: public ScFormatShell { private: - CellShell_Impl* pImpl; + std::unique_ptr<CellShell_Impl> pImpl; bool bPastePossible; void GetPossibleClipboardFormats( SvxClipboardFormatItem& rFormats ); diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 9d35c9706e5a..877f38822640 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -98,7 +98,6 @@ ScCellShell::~ScCellShell() delete pImpl->m_pLinkedDlg; delete pImpl->m_pRequest; - delete pImpl; } void ScCellShell::GetBlockState( SfxItemSet& rSet ) |