tdf#94306 Replace boost::noncopyable with plain C++11 deleted copy ctors

Replaced boost::noncopyable with play C++11 deleted copy ctors
in sc/inc/* files.

Change-Id: I2e6310f2f2bac673dd3b5d14e80ce80a98795672
Reviewed-on: https://gerrit.libreoffice.org/23059
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Steven Guo
2016-03-08 22:45:17 -08:00
committed by Stephan Bergmann
parent af23aa9a76
commit be3c2ff923
18 changed files with 89 additions and 56 deletions

View File

@@ -58,8 +58,6 @@
#include "global.hxx"
#include "zforauto.hxx"
#include <boost/noncopyable.hpp>
#include <memory>
#include <map>
@@ -72,7 +70,7 @@ logic handled and stored several writer-specific items (such as ScAutoFormatData
That logic was preserved. From _31005 onward, writer-specific data should be handled by
blobs to avoid needlessly complicating the Calc logic.
*/
struct AutoFormatSwBlob : ::boost::noncopyable
struct AutoFormatSwBlob
{
sal_uInt8 *pData;
sal_Size size;
@@ -80,7 +78,8 @@ struct AutoFormatSwBlob : ::boost::noncopyable
AutoFormatSwBlob() : pData(nullptr), size(0)
{
}
AutoFormatSwBlob(const AutoFormatSwBlob&) = delete;
const AutoFormatSwBlob& operator=(const AutoFormatSwBlob&) = delete;
~AutoFormatSwBlob()
{
Reset();

View File

@@ -16,7 +16,6 @@
#include <memory>
#include <vector>
#include <boost/noncopyable.hpp>
class ScDocument;
class ScColumn;
@@ -29,13 +28,15 @@ namespace sc {
struct ColumnBlockPosition;
class ColumnBlockPositionSet;
class ClipContextBase : private boost::noncopyable
class ClipContextBase
{
std::unique_ptr<ColumnBlockPositionSet> mpSet;
ClipContextBase(); // disabled
public:
ClipContextBase(const ClipContextBase&) = delete;
const ClipContextBase& operator=(const ClipContextBase&) = delete;
ClipContextBase(ScDocument& rDoc);
virtual ~ClipContextBase();

View File

@@ -10,11 +10,9 @@
#ifndef INCLUDED_SC_INC_COLUMNITERATOR_HXX
#define INCLUDED_SC_INC_COLUMNITERATOR_HXX
#include <boost/noncopyable.hpp>
#include "column.hxx"
class ScColumnTextWidthIterator : private boost::noncopyable
class ScColumnTextWidthIterator
{
sc::CellTextAttrStoreType& mrCellTextAttrs;
const size_t mnEnd;
@@ -25,6 +23,9 @@ class ScColumnTextWidthIterator : private boost::noncopyable
sc::celltextattr_block::iterator miDataEnd;
public:
ScColumnTextWidthIterator(const ScColumnTextWidthIterator&) = delete;
const ScColumnTextWidthIterator& operator=(const ScColumnTextWidthIterator&) = delete;
~ScColumnTextWidthIterator() = default;
ScColumnTextWidthIterator(ScColumn& rCol, SCROW nStartRow, SCROW nEndRow);
/**

View File

@@ -14,7 +14,6 @@
#include <vector>
#include <mdds/flat_segment_tree.hpp>
#include <boost/noncopyable.hpp>
class ScDocument;
class ScColumn;
@@ -47,7 +46,7 @@ struct SC_DLLPUBLIC ColRowSpan
* Structure that stores segments of boolean flags per column, and perform
* custom action on those segments.
*/
class ColumnSpanSet : private boost::noncopyable
class ColumnSpanSet
{
public:
typedef mdds::flat_segment_tree<SCROW, bool> ColumnSpansType;
@@ -88,6 +87,8 @@ public:
};
ColumnSpanSet(bool bInit);
ColumnSpanSet(const ColumnSpanSet&) = delete;
const ColumnSpanSet& operator=(const ColumnSpanSet&) = delete;
~ColumnSpanSet();
void set(SCTAB nTab, SCCOL nCol, SCROW nRow, bool bVal);

View File

@@ -39,8 +39,6 @@
#include <memory>
#include <set>
#include <boost/noncopyable.hpp>
class ScFormulaCell;
class ScTokenArray;
struct ScRefCellValue;
@@ -405,7 +403,7 @@ private:
};
// complete conditional formatting
class SC_DLLPUBLIC ScConditionalFormat: private boost::noncopyable
class SC_DLLPUBLIC ScConditionalFormat
{
ScDocument* pDoc;
sal_uInt32 nKey; // Index in attributes
@@ -417,6 +415,8 @@ class SC_DLLPUBLIC ScConditionalFormat: private boost::noncopyable
public:
ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocument);
~ScConditionalFormat();
ScConditionalFormat(const ScConditionalFormat&) = delete;
const ScConditionalFormat& operator=(const ScConditionalFormat&) = delete;
// true copy of formulas (for Ref-Undo / between documents)
ScConditionalFormat* Clone(ScDocument* pNewDoc = nullptr) const;

View File

@@ -15,7 +15,6 @@
#include <rtl/ustring.hxx>
#include <boost/noncopyable.hpp>
#include <memory>
class EditTextObject;
@@ -38,12 +37,11 @@ enum class SvtScriptType;
* position calculation, or anything else that requires expensive
* computation which are unnecessary and undesirable during import.
*/
class SC_DLLPUBLIC ScDocumentImport : private boost::noncopyable
class SC_DLLPUBLIC ScDocumentImport
{
std::unique_ptr<ScDocumentImportImpl> mpImpl;
ScDocumentImport(); // disabled
ScDocumentImport& operator=(const ScDocumentImport&); //disabled
public:
@@ -58,6 +56,8 @@ public:
};
ScDocumentImport(ScDocument& rDoc);
ScDocumentImport(const ScDocumentImport&) = delete;
const ScDocumentImport& operator=(const ScDocumentImport&) = delete;
~ScDocumentImport();
ScDocument& getDoc();

View File

@@ -10,7 +10,6 @@
#ifndef INCLUDED_SC_INC_DOCUMENTLINKMGR_HXX
#define INCLUDED_SC_INC_DOCUMENTLINKMGR_HXX
#include <boost/noncopyable.hpp>
#include <rtl/ustring.hxx>
#include <memory>
@@ -29,12 +28,14 @@ namespace sc {
class DataStream;
struct DocumentLinkManagerImpl;
class DocumentLinkManager : private boost::noncopyable
class DocumentLinkManager
{
std::unique_ptr<DocumentLinkManagerImpl> mpImpl;
public:
DocumentLinkManager( SfxObjectShell* pShell );
DocumentLinkManager(const DocumentLinkManager&) = delete;
const DocumentLinkManager& operator=(const DocumentLinkManager&) = delete;
~DocumentLinkManager();
void setDataStream( DataStream* p );

View File

@@ -24,7 +24,6 @@
#include "calcmacros.hxx"
#include <tools/date.hxx>
#include <boost/noncopyable.hpp>
#include <mdds/flat_segment_tree.hpp>
#include <memory>
@@ -41,7 +40,7 @@ struct ScDPNumGroupInfo;
* This class represents the cached data part of the datapilot cache table
* implementation.
*/
class SC_DLLPUBLIC ScDPCache : private boost::noncopyable
class SC_DLLPUBLIC ScDPCache
{
typedef std::unordered_set<OUString, OUStringHash> StringSetType;
@@ -50,17 +49,19 @@ public:
typedef std::set<ScDPObject*> ScDPObjectSet;
typedef std::vector<SCROW> IndexArrayType;
struct GroupItems : boost::noncopyable
struct GroupItems
{
ScDPItemDataVec maItems;
ScDPNumGroupInfo maInfo;
sal_Int32 mnGroupType;
GroupItems();
GroupItems(const GroupItems&) = delete;
const GroupItems& operator=(const GroupItems&) = delete;
GroupItems(const ScDPNumGroupInfo& rInfo, sal_Int32 nGroupType);
};
struct Field : boost::noncopyable
struct Field
{
/**
* Optional items for grouped field.
@@ -82,6 +83,8 @@ public:
sal_uLong mnNumFormat;
Field();
Field(const Field&) = delete;
const Field& operator=(const Field&) = delete;
};
/**
@@ -184,6 +187,8 @@ public:
size_t GetFieldCount() const;
size_t GetGroupFieldCount() const;
ScDPCache(const ScDPCache&) = delete;
const ScDPCache& operator=(const ScDPCache&) = delete;
ScDPCache(ScDocument* pDoc);
~ScDPCache();

View File

@@ -14,7 +14,6 @@
#include <map>
#include <vector>
#include <boost/noncopyable.hpp>
#include <unordered_map>
namespace com { namespace sun { namespace star { namespace sheet {
@@ -46,7 +45,7 @@ struct ScDPResultFilter
* <p>If the pivot table layout only consists of either column or row
* dimensions, the root node only has one child node.</p>
*/
class ScDPResultTree : private boost::noncopyable
class ScDPResultTree
{
public:
typedef std::vector<double> ValuesType;
@@ -58,11 +57,13 @@ private:
typedef std::map<OUString, MemberNode*> MembersType;
typedef std::map<OUString, DimensionNode*> DimensionsType;
struct DimensionNode : boost::noncopyable
struct DimensionNode
{
MembersType maChildMembers;
DimensionNode();
DimensionNode(const DimensionNode&) = delete;
const DimensionNode& operator=(const DimensionNode&) = delete;
~DimensionNode();
#if DEBUG_PIVOT_TABLE
@@ -70,12 +71,14 @@ private:
#endif
};
struct MemberNode : boost::noncopyable
struct MemberNode
{
ValuesType maValues;
DimensionsType maChildDimensions;
MemberNode();
MemberNode(const MemberNode&) = delete;
const MemberNode& operator=(const MemberNode&) = delete;
~MemberNode();
#if DEBUG_PIVOT_TABLE
@@ -98,8 +101,9 @@ private:
public:
ScDPResultTree();
ScDPResultTree(const ScDPResultTree&) = delete;
const ScDPResultTree& operator=(const ScDPResultTree&) = delete;
~ScDPResultTree();
/**
* Add a single value filter path. The filters are expected to be sorted
* by row dimension order then by column dimension order.

View File

@@ -28,8 +28,6 @@
#include <svl/zforlist.hxx>
#include <boost/noncopyable.hpp>
#include <set>
#include <unordered_set>
#include <unordered_map>
@@ -65,7 +63,7 @@ class ScDocument;
* Base class that abstracts different data source types of a datapilot
* table.
*/
class SC_DLLPUBLIC ScDPTableData : public ::boost::noncopyable
class SC_DLLPUBLIC ScDPTableData
{
// cached data for GetDatePart
long nLastDateVal;
@@ -96,6 +94,8 @@ public:
CalcInfo();
};
ScDPTableData(const ScDPTableData&) = delete;
const ScDPTableData& operator=(const ScDPTableData&) = delete;
ScDPTableData(ScDocument* pDoc);
virtual ~ScDPTableData();

View File

@@ -40,7 +40,6 @@
#include <comphelper/interfacecontainer2.hxx>
#include <osl/mutex.hxx>
#include <boost/noncopyable.hpp>
#include <memory>
class ScEditSource;
@@ -190,9 +189,11 @@ class ScEditFieldObj : public cppu::WeakImplHelper<
css::lang::XUnoTunnel,
css::lang::XServiceInfo>,
public ScMutexHelper,
public ::cppu::OComponentHelper,
private boost::noncopyable
public ::cppu::OComponentHelper
{
ScEditFieldObj(const ScEditFieldObj&) = delete;
const ScEditFieldObj& operator=(const ScEditFieldObj&) = delete;
const SfxItemPropertySet* pPropSet;
ScEditSource* mpEditSource;
ESelection aSelection;

View File

@@ -29,8 +29,6 @@
#include "colorscale.hxx"
#include "cellvalue.hxx"
#include <boost/noncopyable.hpp>
class SfxItemSet;
class SvxBrushItem;
class SvxBoxItem;
@@ -96,8 +94,13 @@ struct ScIconSetInfo
bool mbShowValue;
};
struct CellInfo : boost::noncopyable
struct CellInfo
{
CellInfo() = default;
~CellInfo() = default;
CellInfo(const CellInfo&) = delete;
const CellInfo& operator=(const CellInfo&) = delete;
ScRefCellValue maCell;
const ScPatternAttr* pPatternAttr;
@@ -139,8 +142,13 @@ struct CellInfo : boost::noncopyable
const SCCOL SC_ROTMAX_NONE = SCCOL_MAX;
struct RowInfo : boost::noncopyable
struct RowInfo
{
RowInfo() = default;
~RowInfo() = default;
RowInfo(const RowInfo&) = delete;
const RowInfo& operator=(const RowInfo&) = delete;
CellInfo* pCellInfo;
sal_uInt16 nHeight;
@@ -154,7 +162,7 @@ struct RowInfo : boost::noncopyable
bool bChanged:1; // TRUE, if not tested
};
struct ScTableInfo : boost::noncopyable
struct ScTableInfo
{
svx::frame::Array maArray;
RowInfo* mpRowInfo;
@@ -163,6 +171,8 @@ struct ScTableInfo : boost::noncopyable
explicit ScTableInfo();
~ScTableInfo();
ScTableInfo(const ScTableInfo&) = delete;
const ScTableInfo& operator=(const ScTableInfo&) = delete;
};
#endif

View File

@@ -23,8 +23,6 @@
#include <set>
#include <memory>
#include <boost/noncopyable.hpp>
#include <formula/tokenarray.hxx>
#include <osl/conditn.hxx>
#include <osl/mutex.hxx>
@@ -54,7 +52,7 @@ class ScFormulaCell;
class ScProgress;
class ScTokenArray;
struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable
struct SC_DLLPUBLIC ScFormulaCellGroup
{
private:
struct Impl;
@@ -74,6 +72,8 @@ public:
sal_uInt8 meCalcState;
ScFormulaCellGroup();
ScFormulaCellGroup(const ScFormulaCellGroup&) = delete;
const ScFormulaCellGroup& operator=(const ScFormulaCellGroup&) = delete;
~ScFormulaCellGroup();
void setCode( const ScTokenArray& rCode );

View File

@@ -27,7 +27,6 @@
#include <set>
#include <unordered_map>
#include <vector>
#include <boost/noncopyable.hpp>
class ScDocument;
class ScTokenArray;
@@ -52,7 +51,7 @@ struct FormulaGroupEntry
FormulaGroupEntry( ScFormulaCell* pCell, size_t nRow );
};
struct FormulaGroupContext : boost::noncopyable
struct FormulaGroupContext
{
typedef AlignedAllocator<double,256> DoubleAllocType;
typedef std::vector<double, DoubleAllocType> NumArrayType;
@@ -100,6 +99,8 @@ struct FormulaGroupContext : boost::noncopyable
void ensureNumArray( ColArray& rColArray, size_t nArrayLen );
FormulaGroupContext();
FormulaGroupContext(const FormulaGroupContext&) = delete;
const FormulaGroupContext& operator=(const FormulaGroupContext&) = delete;
~FormulaGroupContext();
};

View File

@@ -12,7 +12,6 @@
#include "address.hxx"
#include <boost/noncopyable.hpp>
#include <memory>
namespace sc {
@@ -21,8 +20,12 @@ namespace sc {
* Stores data imported from the file that need to be processed at the end
* of the import process.
*/
struct ImportPostProcessData : boost::noncopyable
struct ImportPostProcessData
{
ImportPostProcessData() = default;
ImportPostProcessData(const ImportPostProcessData&) = delete;
const ImportPostProcessData& operator=(const ImportPostProcessData&) = delete;
~ImportPostProcessData() = default;
/**
* Data stream data needs to be post-processed because it requires
* ScDocShell instance which is not available in the filter code.

View File

@@ -13,7 +13,6 @@
#include "address.hxx"
#include "columnspanset.hxx"
#include <boost/noncopyable.hpp>
#include <memory>
class ScDocument;
@@ -24,11 +23,13 @@ namespace sc {
struct ColumnBlockPosition;
class ColumnBlockPositionSet;
class StartListeningContext : private boost::noncopyable
class StartListeningContext
{
ScDocument& mrDoc;
std::shared_ptr<ColumnBlockPositionSet> mpSet;
public:
StartListeningContext(const StartListeningContext&) = delete;
const StartListeningContext& operator=(const StartListeningContext&) = delete;
StartListeningContext(ScDocument& rDoc);
StartListeningContext(ScDocument& rDoc, const std::shared_ptr<ColumnBlockPositionSet>& pSet);
ScDocument& getDoc() { return mrDoc;}
@@ -36,7 +37,7 @@ public:
ColumnBlockPosition* getBlockPosition(SCTAB nTab, SCCOL nCol);
};
class EndListeningContext : private boost::noncopyable
class EndListeningContext
{
ScDocument& mrDoc;
ColumnSpanSet maSet;
@@ -45,6 +46,8 @@ class EndListeningContext : private boost::noncopyable
ScAddress maPosDelta; // Add this to get the old position prior to the move.
public:
EndListeningContext(const EndListeningContext&) = delete;
const EndListeningContext& operator=(const EndListeningContext&) = delete;
EndListeningContext(ScDocument& rDoc, ScTokenArray* pOldCode = nullptr);
EndListeningContext(ScDocument& rDoc, const std::shared_ptr<ColumnBlockPositionSet>& pSet, ScTokenArray* pOldCode = nullptr);
@@ -60,12 +63,14 @@ public:
void purgeEmptyBroadcasters();
};
class PurgeListenerAction : public ColumnSpanSet::Action, private boost::noncopyable
class PurgeListenerAction : public ColumnSpanSet::Action
{
ScDocument& mrDoc;
std::unique_ptr<ColumnBlockPosition> mpBlockPos;
public:
PurgeListenerAction(const PurgeListenerAction&) = delete;
const PurgeListenerAction& operator=(const PurgeListenerAction&) = delete;
PurgeListenerAction( ScDocument& rDoc );
virtual void startColumn( SCTAB nTab, SCCOL nCol ) override;

View File

@@ -35,8 +35,6 @@
#include <memory>
#include <boost/noncopyable.hpp>
class EditEngine;
class EditTextObject;
class SvxEditEngineForwarder;
@@ -110,7 +108,7 @@ public:
// ScHeaderFooterTextData: shared data between sub objects of a ScHeaderFooterTextObj
class ScHeaderFooterTextData : private boost::noncopyable
class ScHeaderFooterTextData
{
private:
std::unique_ptr<EditTextObject> mpTextObj;
@@ -121,6 +119,9 @@ private:
bool bDataValid;
public:
ScHeaderFooterTextData() = default;
ScHeaderFooterTextData(const ScHeaderFooterTextData&) = delete;
const ScHeaderFooterTextData& operator=(const ScHeaderFooterTextData&) = delete;
ScHeaderFooterTextData(
rtl::Reference<ScHeaderFooterContentObj> const & rContent, sal_uInt16 nP, const EditTextObject* pTextObj);
~ScHeaderFooterTextData();

View File

@@ -20,8 +20,6 @@
#ifndef INCLUDED_SC_INC_UNITCONV_HXX
#define INCLUDED_SC_INC_UNITCONV_HXX
#include <boost/noncopyable.hpp>
#include <map>
class ScUnitConverterData
@@ -43,13 +41,15 @@ public:
const OUString& rFromUnit, const OUString& rToUnit );
};
class ScUnitConverter : public boost::noncopyable
class ScUnitConverter
{
typedef std::map<OUString, ScUnitConverterData> MapType;
MapType maData;
public:
ScUnitConverter();
ScUnitConverter(const ScUnitConverter&) = delete;
const ScUnitConverter& operator=(const ScUnitConverter&) = delete;
~ScUnitConverter();
bool GetValue(