[PATCH] Replace ScfNoCopy with boost::noncopyable

Nigel Hawkins n.hawkins at gmx.com
Wed Nov 10 05:27:57 PST 2010


Make boost::noncopyable references private
---
 sc/source/filter/inc/fprogressbar.hxx |    3 ++-
 sc/source/filter/inc/ftools.hxx       |   15 ++-------------
 sc/source/filter/inc/xehelper.hxx     |    3 ++-
 sc/source/filter/inc/xicontent.hxx    |    4 +++-
 sc/source/filter/inc/xihelper.hxx     |    5 +++--
 sc/source/filter/inc/xistyle.hxx      |   11 ++++++-----
 sc/source/filter/inc/xlpage.hxx       |    3 ++-
 7 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/sc/source/filter/inc/fprogressbar.hxx b/sc/source/filter/inc/fprogressbar.hxx
index 751c9c6..11e0657 100644
--- a/sc/source/filter/inc/fprogressbar.hxx
+++ b/sc/source/filter/inc/fprogressbar.hxx
@@ -29,6 +29,7 @@
 #ifndef SC_FPROGRESSBAR_HXX
 #define SC_FPROGRESSBAR_HXX
 
+#include <boost/noncopyable.hpp>
 #include "globstr.hrc"
 #include "ftools.hxx"
 #include "scdllapi.h"
@@ -111,7 +112,7 @@ const sal_Int32 SCF_INV_SEGMENT = -1;
         // not allowed (second segment active):   aProgress.Progress();
         // not allowed (first segment not empty): aProgress.GetSegmentProgressBar( nSeg1 );
  */
-class ScfProgressBar : ScfNoCopy
+class ScfProgressBar : private boost::noncopyable
 {
 public:
     explicit            ScfProgressBar( SfxObjectShell* pDocShell, const String& rText );
diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index 394c213..ab11beb 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -37,6 +37,7 @@
 #include <tools/list.hxx>
 #include <tools/debug.hxx>
 #include <oox/helper/helper.hxx>
+#include <boost/noncopyable.hpp>
 #include "filter.hxx"
 #include "scdllapi.h"
 
@@ -138,20 +139,8 @@ void insert_value( Type& rnBitField, InsertType nValue, sal_uInt8 nStartBit, sal
 
 // ============================================================================
 
-/** Deriving from this class prevents copy construction. */
-class ScfNoCopy
-{
-private:
-                        ScfNoCopy( const ScfNoCopy& );
-    ScfNoCopy&          operator=( const ScfNoCopy& );
-protected:
-    inline              ScfNoCopy() {}
-};
-
-// ----------------------------------------------------------------------------
-
 /** Deriving from this class prevents construction in general. */
-class ScfNoInstance : private ScfNoCopy {};
+class ScfNoInstance : private boost::noncopyable {};
 
 // ============================================================================
 
diff --git a/sc/source/filter/inc/xehelper.hxx b/sc/source/filter/inc/xehelper.hxx
index e82eaca..fe27f6e 100644
--- a/sc/source/filter/inc/xehelper.hxx
+++ b/sc/source/filter/inc/xehelper.hxx
@@ -29,6 +29,7 @@
 #ifndef SC_XEHELPER_HXX
 #define SC_XEHELPER_HXX
 
+#include <boost/noncopyable.hpp>
 #include "xladdress.hxx"
 #include "xeroot.hxx"
 #include "xestring.hxx"
@@ -364,7 +365,7 @@ class EditEngine;
     Known but unsupported control sequences:
     &G                      picture
  */
-class XclExpHFConverter : protected XclExpRoot, ScfNoCopy
+class XclExpHFConverter : protected XclExpRoot, private boost::noncopyable
 {
 public:
     explicit            XclExpHFConverter( const XclExpRoot& rRoot );
diff --git a/sc/source/filter/inc/xicontent.hxx b/sc/source/filter/inc/xicontent.hxx
index 982cfae..904ea2e 100644
--- a/sc/source/filter/inc/xicontent.hxx
+++ b/sc/source/filter/inc/xicontent.hxx
@@ -38,6 +38,8 @@
 
 #include <map>
 #include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/noncopyable.hpp>
+
 
 /* ============================================================================
 Classes to import the big Excel document contents (related to several cells or
@@ -193,7 +195,7 @@ private:
 // Web queries ================================================================
 
 /** Stores the data of one web query. */
-class XclImpWebQuery : ScfNoCopy
+class XclImpWebQuery : private boost::noncopyable
 {
 public:
     explicit            XclImpWebQuery( const ScRange& rDestRange );
diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx
index 6ee969c..eeb12e8 100644
--- a/sc/source/filter/inc/xihelper.hxx
+++ b/sc/source/filter/inc/xihelper.hxx
@@ -30,6 +30,7 @@
 #define SC_XIHELPER_HXX
 
 #include <editeng/editdata.hxx>
+#include <boost/noncopyable.hpp>
 #include "scmatrix.hxx"
 #include "xladdress.hxx"
 #include "xiroot.hxx"
@@ -165,7 +166,7 @@ struct XclFontData;
     Known but unsupported control sequences:
     &G                      picture
  */
-class XclImpHFConverter : protected XclImpRoot, ScfNoCopy
+class XclImpHFConverter : protected XclImpRoot, private boost::noncopyable
 {
 public:
     explicit            XclImpHFConverter( const XclImpRoot& rRoot );
@@ -288,7 +289,7 @@ class ScTokenArray;
 
 /** This class stores one cached value of a cached value list (used for instance in
     CRN, EXTERNNAME, tArray). */
-class XclImpCachedValue : ScfNoCopy
+class XclImpCachedValue : boost::noncopyable
 {
 public:
     /** Creates a cached value and reads contents from stream and stores it with its array address. */
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index d8e7f37..cceb76e 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -31,6 +31,7 @@
 
 #include <list>
 #include <tools/mempool.hxx>
+#include <boost/noncopyable.hpp>
 #include "rangelst.hxx"
 #include "patattr.hxx"
 #include "xladdress.hxx"
@@ -168,7 +169,7 @@ private:
 // ----------------------------------------------------------------------------
 
 /** Stores the data of all fonts occurred in an Excel file. */
-class XclImpFontBuffer : protected XclImpRoot, ScfNoCopy
+class XclImpFontBuffer : protected XclImpRoot, private boost::noncopyable
 {
 public:
     explicit            XclImpFontBuffer( const XclImpRoot& rRoot );
@@ -392,7 +393,7 @@ inline bool operator!=( const XclImpXFIndex& rLeft, const XclImpXFIndex& rRight
 // ----------------------------------------------------------------------------
 
 /** Contains all data of a XF record and a Calc item set. */
-class XclImpXF : public XclXFBase, protected XclImpRoot, ScfNoCopy
+class XclImpXF : public XclXFBase, protected XclImpRoot, private boost::noncopyable
 {
 public:
     explicit            XclImpXF( const XclImpRoot& rRoot );
@@ -480,7 +481,7 @@ private:
 
 /** Contains all XF records occured in the file.
     @descr  This class is able to read XF records (BIFF2 - BIFF8) and STYLE records (BIFF8). */
-class XclImpXFBuffer : protected XclImpRoot, ScfNoCopy
+class XclImpXFBuffer : protected XclImpRoot, private boost::noncopyable
 {
 public:
     explicit            XclImpXFBuffer( const XclImpRoot& rRoot );
@@ -564,7 +565,7 @@ inline bool XclImpXFRange::Contains( SCROW nScRow ) const
 // ----------------------------------------------------------------------------
 
 /** Contains the XF indexes for every used cell in a column. */
-class XclImpXFRangeColumn : ScfNoCopy
+class XclImpXFRangeColumn : private boost::noncopyable
 {
 public:
     inline explicit     XclImpXFRangeColumn() {}
@@ -601,7 +602,7 @@ private:
 // ----------------------------------------------------------------------------
 
 /** Contains the XF indexes for every used cell in a single sheet. */
-class XclImpXFRangeBuffer : protected XclImpRoot, ScfNoCopy
+class XclImpXFRangeBuffer : protected XclImpRoot, private boost::noncopyable
 {
 public:
     explicit            XclImpXFRangeBuffer( const XclImpRoot& rRoot );
diff --git a/sc/source/filter/inc/xlpage.hxx b/sc/source/filter/inc/xlpage.hxx
index 2accb86..67d1c3b 100644
--- a/sc/source/filter/inc/xlpage.hxx
+++ b/sc/source/filter/inc/xlpage.hxx
@@ -30,6 +30,7 @@
 #define SC_XLPAGE_HXX
 
 #include <tools/gen.hxx>
+#include <boost/noncopyable.hpp>
 #include "xltools.hxx"
 
 // Constants and Enumerations =================================================
@@ -100,7 +101,7 @@ class SvxBrushItem;
 class SfxPrinter;
 
 /** Contains all page (print) settings for a single sheet. */
-struct XclPageData : ScfNoCopy
+struct XclPageData : private boost::noncopyable
 {
     typedef ::std::auto_ptr< SvxBrushItem > SvxBrushItemPtr;
 
-- 
1.7.0.4


--=-D9T9B4qRUxaqRFx9FtQX--



More information about the LibreOffice mailing list