[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Nov 12 06:07:58 PST 2010


 sc/source/filter/inc/ftools.hxx    |   15 +++++++--------
 sc/source/filter/inc/xehelper.hxx  |   18 +++++++++++++++---
 sc/source/filter/inc/xicontent.hxx |   28 ++++++++++++++++++++++------
 sc/source/filter/inc/xihelper.hxx  |   15 +++++++++++++--
 sc/source/filter/inc/xltools.hxx   |   12 +++++++++---
 5 files changed, 66 insertions(+), 22 deletions(-)

New commits:
commit 4e90bb878d2a65111199e3e762261c32081af4ff
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Fri Nov 12 09:06:11 2010 -0500

    Replace ScfNoInstance with boost::noncopyable and private constructor.

diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index ab11beb..d7af66d 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -139,11 +139,6 @@ void insert_value( Type& rnBitField, InsertType nValue, sal_uInt8 nStartBit, sal
 
 // ============================================================================
 
-/** Deriving from this class prevents construction in general. */
-class ScfNoInstance : private boost::noncopyable {};
-
-// ============================================================================
-
 /** Simple shared pointer (NOT thread-save, but faster than boost::shared_ptr). */
 template< typename Type >
 class ScfRef
@@ -258,7 +253,7 @@ class SotStorageStreamRef;
 class SvStream;
 
 /** Contains static methods used anywhere in the filters. */
-class ScfTools : ScfNoInstance
+class ScfTools : boost::noncopyable
 {
 public:
 
@@ -389,6 +384,10 @@ private:
     static const String& GetHTMLIndexPrefix();
     /** Returns the prefix for table names. */
     static const String& GetHTMLNamePrefix();
+    /** We don't want anybody to instantiate this class, since it is just a
+        collection of static items. To enforce this, the default constructor
+        is made private */
+    ScfTools();
 };
 
 // Containers =================================================================
@@ -507,8 +506,8 @@ class ScFormatFilterPluginImpl : public ScFormatFilterPlugin {
     virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
                  const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, UINT32 nDifOption = SC_DIFOPT_EXCEL );
     virtual FltError ScImportRTF( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange );
-    virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, 
-                                   double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE, 
+    virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange,
+                                   double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE,
                                    SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true );
 
     virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange );
diff --git a/sc/source/filter/inc/xehelper.hxx b/sc/source/filter/inc/xehelper.hxx
index fe27f6e..3df5374 100644
--- a/sc/source/filter/inc/xehelper.hxx
+++ b/sc/source/filter/inc/xehelper.hxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -220,7 +220,7 @@ class ScPatternAttr;
 /** This class provides methods to create an XclExpString.
     @descr  The string can be created from an edit engine text object or
     directly from a Calc edit cell. */
-class XclExpStringHelper : ScfNoInstance
+class XclExpStringHelper : boost::noncopyable
 {
 public:
     /** Creates a new unformatted string from the passed string.
@@ -330,6 +330,12 @@ public:
     /** Returns the script type first text portion different to WEAK, or the system
         default script type, if there is only weak script in the passed string. */
     static sal_Int16    GetLeadingScriptType( const XclExpRoot& rRoot, const String& rString );
+
+private:
+    /** We don't want anybody to instantiate this class, since it is just a
+        collection of static methods. To enforce this, the default constructor
+        is made private */
+    XclExpStringHelper();
 };
 
 // Header/footer conversion ===================================================
@@ -398,7 +404,7 @@ private:
 /** This class contains static methods to encode a file URL.
     @descr  Excel stores URLs in a format that contains special control characters,
     i.e. for directory separators or volume names. */
-class XclExpUrlHelper : ScfNoInstance
+class XclExpUrlHelper : boost::noncopyable
 {
 public:
     /** Encodes and returns the URL passed in rAbsUrl to an Excel like URL.
@@ -406,6 +412,12 @@ public:
     static String       EncodeUrl( const XclExpRoot& rRoot, const String& rAbsUrl, const String* pTableName = 0 );
     /** Encodes and returns the passed DDE link to an Excel like DDE link. */
     static String       EncodeDde( const String& rApplic, const String rTopic );
+
+private:
+    /** We don't want anybody to instantiate this class, since it is just a
+        collection of static methods. To enforce this, the default constructor
+        is made private */
+    XclExpUrlHelper();
 };
 
 // ----------------------------------------------------------------------------
diff --git a/sc/source/filter/inc/xicontent.hxx b/sc/source/filter/inc/xicontent.hxx
index 904ea2e..5002e97 100644
--- a/sc/source/filter/inc/xicontent.hxx
+++ b/sc/source/filter/inc/xicontent.hxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -40,7 +40,6 @@
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <boost/noncopyable.hpp>
 
-
 /* ============================================================================
 Classes to import the big Excel document contents (related to several cells or
 globals for the document).
@@ -86,7 +85,7 @@ private:
 // Hyperlinks =================================================================
 
 /** Provides importing hyperlinks and inserting them into a document. */
-class XclImpHyperlink : ScfNoInstance
+class XclImpHyperlink : private boost::noncopyable
 {
 public:
     /** Reads a HLINK record and inserts it into the document.
@@ -102,17 +101,29 @@ public:
     /** Convert the sheet name with invalid character(s) in URL when the URL is
         to a location within the same document (e.g. #'Sheet&Name'.A1). */
     static void         ConvertToValidTabName(String& rName);
+
+private:
+    /** We don't want anybody to instantiate this class, since it is just a
+        collection of static methods. To enforce this, the default constructor
+        is made private */
+    XclImpHyperlink();
 };
 
 // Label ranges ===============================================================
 
 /** Provides importing label ranges and inserting them into a document. */
-class XclImpLabelranges : ScfNoInstance
+class XclImpLabelranges : private  boost::noncopyable
 {
 public:
     /** Reads a LABELRANGES record and inserts the label ranges into the document.
         @descr  Import stream must be located at start of a LABELRANGES record. */
     static void         ReadLabelranges( XclImpStream& rStrm );
+
+private:
+    /** We don't want anybody to instantiate this class, since it is just a
+        collection of static methods. To enforce this, the default constructor
+        is made private */
+    XclImpLabelranges();
 };
 
 // Conditional formatting =====================================================
@@ -258,12 +269,18 @@ private:
 // Decryption =================================================================
 
 /** Provides static functions to import stream decryption settings. */
-class XclImpDecryptHelper : ScfNoInstance
+class XclImpDecryptHelper : private boost::noncopyable
 {
 public:
     /** Reads the FILEPASS record, queries a password and sets decryption algorihm.
         @return  Error code that may cause an error message after import. */
     static ErrCode      ReadFilepass( XclImpStream& rStrm );
+
+private:
+    /** We don't want anybody to instantiate this class, since it is just a
+        collection of static methods. To enforce this, the default constructor
+        is made private */
+    XclImpDecryptHelper();
 };
 
 // ============================================================================
@@ -324,7 +341,6 @@ private:
     ProtectedSheetMap   maProtectedSheets;
 };
 
-
 // ============================================================================
 
 #endif
diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx
index eeb12e8..f57145f 100644
--- a/sc/source/filter/inc/xihelper.hxx
+++ b/sc/source/filter/inc/xihelper.hxx
@@ -112,7 +112,7 @@ class EditTextObject;
 /** This class provides methods to convert an XclImpString.
     @The string can be converted to an edit engine text object or directly
     to a Calc edit cell. */
-class XclImpStringHelper : ScfNoInstance
+class XclImpStringHelper : boost::noncopyable
 {
 public:
     /** Returns a new edit engine text object.
@@ -127,6 +127,11 @@ public:
                             const XclImpRoot& rRoot,
                             const XclImpString& rString,
                             sal_uInt16 nXFIndex = 0 );
+private:
+    /** We don't want anybody to instantiate this class, since it is just a
+        collection of static methods. To enforce this, the default constructor
+        is made private */
+    XclImpStringHelper();
 };
 
 // Header/footer conversion ===================================================
@@ -251,7 +256,7 @@ private:
 /** This class contains static methods to decode an URL stored in an Excel file.
     @descr  Excel URLs can contain a sheet name, for instance: path\[test.xls]Sheet1
     This sheet name will be extracted automatically. */
-class XclImpUrlHelper : ScfNoInstance
+class XclImpUrlHelper : boost::noncopyable
 {
 public:
     /** Decodes an encoded external document URL with optional sheet name.
@@ -281,6 +286,12 @@ public:
         For OLE object links: Decodes to class name and document URL.
         @return  true = decoding was successful, returned strings are valid (not empty). */
     static bool         DecodeLink( String& rApplic, String& rTopic, const String rEncUrl );
+
+private:
+    /** We don't want anybody to instantiate this class, since it is just a
+        collection of static methods. To enforce this, the default constructor
+        is made private */
+    XclImpUrlHelper();
 };
 
 // Cached values ==============================================================
diff --git a/sc/source/filter/inc/xltools.hxx b/sc/source/filter/inc/xltools.hxx
index 1663ad6..b34cd4c 100644
--- a/sc/source/filter/inc/xltools.hxx
+++ b/sc/source/filter/inc/xltools.hxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -31,6 +31,7 @@
 
 #include "address.hxx"
 #include "ftools.hxx"
+#include <boost/noncopyable.hpp>
 
 class SfxObjectShell;
 
@@ -89,7 +90,7 @@ class SvStream;
 class ScDocument;
 
 /** This class contains static helper methods for the Excel import and export filters. */
-class XclTools : ScfNoInstance
+class XclTools : boost::noncopyable
 {
 public:
     // GUID's -----------------------------------------------------------------
@@ -233,7 +234,7 @@ public:
     static void         SkipSubStream( XclImpStream& rStrm );
 
     // Basic macro names ------------------------------------------------------
-    
+
     /** Returns the full StarBasic macro URL from an Excel macro name. */
     static ::rtl::OUString GetSbMacroUrl( const String& rMacroName, SfxObjectShell* pDocShell = 0 );
     /** Returns the full StarBasic macro URL from an Excel module and macro name. */
@@ -250,6 +251,11 @@ private:
     static const String maCFStyleNamePrefix2;       /// Prefix for cond. formatting style names from OOX filter.
     static const ::rtl::OUString maSbMacroPrefix;   /// Prefix for StarBasic macros.
     static const ::rtl::OUString maSbMacroSuffix;   /// Suffix for StarBasic macros.
+
+    /** We don't want anybody to instantiate this class, since it is just a
+        collection of static items. To enforce this, the default constructor
+        is made private */
+    XclTools();
 };
 
 // read/write colors ----------------------------------------------------------


More information about the Libreoffice-commits mailing list