[PATCH 2/2] remove unused code (oox, sc)

Petr Vorel petr.vorel at gmail.com
Sat Mar 17 14:00:18 PDT 2012


---
 sc/source/filter/inc/biffhelper.hxx       |    4 --
 sc/source/filter/inc/biffoutputstream.hxx |    8 ---
 sc/source/filter/inc/drawingmanager.hxx   |    6 --
 sc/source/filter/oox/biffhelper.cxx       |   21 --------
 sc/source/filter/oox/biffoutputstream.cxx |   14 -----
 sc/source/filter/oox/drawingmanager.cxx   |   79 -----------------------------
 unusedcode.easy                           |    7 ---
 7 files changed, 0 insertions(+), 139 deletions(-)

diff --git a/sc/source/filter/inc/biffhelper.hxx b/sc/source/filter/inc/biffhelper.hxx
index be8303f..5f390fa 100644
--- a/sc/source/filter/inc/biffhelper.hxx
+++ b/sc/source/filter/inc/biffhelper.hxx
@@ -607,8 +607,6 @@ public:
 
     /** Converts the passed packed number to a double. */
     static double       calcDoubleFromRk( sal_Int32 nRkValue );
-    /** Converts the passed double to a packed number, returns true on success. */
-    static bool         calcRkFromDouble( sal_Int32& ornRkValue, double fValue );
 
     /** Converts the passed BIFF error to a double containing the respective Calc error code. */
     static double       calcDoubleFromError( sal_uInt8 nErrorCode );
@@ -616,8 +614,6 @@ public:
     /** Returns a text encoding from an Windows code page.
         @return  The corresponding text encoding or RTL_TEXTENCODING_DONTKNOW. */
     static rtl_TextEncoding calcTextEncodingFromCodePage( sal_uInt16 nCodePage );
-    /** Returns a Windows code page from a text encoding. */
-    static sal_uInt16   calcCodePageFromTextEncoding( rtl_TextEncoding eTextEnc );
 
     // BIFF12 import ----------------------------------------------------------
 
diff --git a/sc/source/filter/inc/biffoutputstream.hxx b/sc/source/filter/inc/biffoutputstream.hxx
index 75440e1..a38bfdf 100644
--- a/sc/source/filter/inc/biffoutputstream.hxx
+++ b/sc/source/filter/inc/biffoutputstream.hxx
@@ -87,7 +87,6 @@ private:
     8224 bytes in BIFF8).
 
     To start writing a record, call startRecord() with the record identifier.
-    Each record must be closed by calling endRecord().
 
     If some data exceeds the record size limit, a CONTINUE record will be
     started automatically and the new data will be written to this record. If
@@ -99,18 +98,11 @@ private:
 class BiffOutputStream : public BinaryOutputStream
 {
 public:
-    explicit            BiffOutputStream(
-                            BinaryOutputStream& rOutStream,
-                            sal_uInt16 nMaxRecSize );
-
     // record control ---------------------------------------------------------
 
     /** Starts a new record. */
     void                startRecord( sal_uInt16 nRecId );
 
-    /** Finishes the current record. Must be called for every started record. */
-    void                endRecord();
-
     /** Sets size of data portion in bytes. 0 or 1 means no portions are used. */
     void                setPortionSize( sal_uInt8 nSize );
 
diff --git a/sc/source/filter/inc/drawingmanager.hxx b/sc/source/filter/inc/drawingmanager.hxx
index a7580a3..c597b03 100644
--- a/sc/source/filter/inc/drawingmanager.hxx
+++ b/sc/source/filter/inc/drawingmanager.hxx
@@ -125,8 +125,6 @@ public:
     static BiffDrawingObjectRef importObjBiff4( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
     /** Reads the BIFF5 OBJ record, returns a new drawing object. */
     static BiffDrawingObjectRef importObjBiff5( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
-    /** Reads the BIFF8 OBJ record, returns a new drawing object. */
-    static BiffDrawingObjectRef importObjBiff8( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
 
     /** Sets whether this is an area object (then its width and height must be greater than 0). */
     inline void         setAreaObj( bool bAreaObj ) { mbAreaObj = bAreaObj; }
@@ -452,10 +450,6 @@ public:
                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
                             const ::com::sun::star::awt::Rectangle& rShapeRect ) = 0;
 
-protected:
-    /** Appends a new drawing object to the list of raw objects (without DFF data). */
-    void                appendRawObject( const BiffDrawingObjectRef& rxDrawingObj );
-
 private:
     typedef RefMap< sal_uInt16, BiffDrawingObjectBase > BiffDrawingObjectMapById;
     typedef ::std::vector< sal_uInt16 >                 BiffObjIdVector;
diff --git a/sc/source/filter/oox/biffhelper.cxx b/sc/source/filter/oox/biffhelper.cxx
index d71249d..9ec1a98 100644
--- a/sc/source/filter/oox/biffhelper.cxx
+++ b/sc/source/filter/oox/biffhelper.cxx
@@ -212,20 +212,6 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm,
     return aDecDbl.mfValue;
 }
 
-/*static*/ bool BiffHelper::calcRkFromDouble( sal_Int32& ornRkValue, double fValue )
-{
-    if( lclCalcRkFromDouble( ornRkValue, fValue ) )
-        return true;
-
-    if( lclCalcRkFromDouble( ornRkValue, fValue * 100 ) )
-    {
-        ornRkValue |= BIFF_RK_100FLAG;
-        return true;
-    }
-
-    return false;
-}
-
 /*static*/ double BiffHelper::calcDoubleFromError( sal_uInt8 nErrorCode )
 {
     sal_uInt16 nApiError = 0x7FFF;
@@ -261,13 +247,6 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm,
     return eTextEnc;
 }
 
-/*static*/ sal_uInt16 BiffHelper::calcCodePageFromTextEncoding( rtl_TextEncoding eTextEnc )
-{
-    sal_uInt32 nCodePage = rtl_getWindowsCodePageFromTextEncoding( eTextEnc );
-    OSL_ENSURE( (0 < nCodePage) && (nCodePage <= SAL_MAX_UINT16), "BiffHelper::calcCodePageFromTextEncoding - unknown text encoding" );
-    return static_cast< sal_uInt16 >( (nCodePage == 0) ? 1252 : nCodePage );
-}
-
 // BIFF12 import --------------------------------------------------------------
 
 /*static*/ OUString BiffHelper::readString( SequenceInputStream& rStrm, bool b32BitLen, bool bAllowNulChars )
diff --git a/sc/source/filter/oox/biffoutputstream.cxx b/sc/source/filter/oox/biffoutputstream.cxx
index 88bded6..8914cf1 100644
--- a/sc/source/filter/oox/biffoutputstream.cxx
+++ b/sc/source/filter/oox/biffoutputstream.cxx
@@ -85,14 +85,6 @@ void BiffOutputRecordBuffer::fill( sal_uInt8 nValue, sal_uInt16 nBytes )
 
 // ============================================================================
 
-BiffOutputStream::BiffOutputStream( BinaryOutputStream& rOutStream, sal_uInt16 nMaxRecSize ) :
-    BinaryStreamBase( true ),
-    maRecBuffer( rOutStream, nMaxRecSize ),
-    mnPortionSize( 0 ),
-    mnPortionPos( 0 )
-{
-}
-
 // record control -------------------------------------------------------------
 
 void BiffOutputStream::startRecord( sal_uInt16 nRecId )
@@ -101,12 +93,6 @@ void BiffOutputStream::startRecord( sal_uInt16 nRecId )
     setPortionSize( 1 );
 }
 
-void BiffOutputStream::endRecord()
-{
-    setPortionSize( 1 );
-    maRecBuffer.endRecord();
-}
-
 void BiffOutputStream::setPortionSize( sal_uInt8 nSize )
 {
     OSL_ENSURE( mnPortionPos == 0, "BiffOutputStream::setPortionSize - block operation inside portion" );
diff --git a/sc/source/filter/oox/drawingmanager.cxx b/sc/source/filter/oox/drawingmanager.cxx
index 5ba29e2..a1cfef9 100644
--- a/sc/source/filter/oox/drawingmanager.cxx
+++ b/sc/source/filter/oox/drawingmanager.cxx
@@ -389,69 +389,6 @@ BiffDrawingObjectBase::~BiffDrawingObjectBase()
     return xDrawingObj;
 }
 
-/*static*/ BiffDrawingObjectRef BiffDrawingObjectBase::importObjBiff8( const WorksheetHelper& rHelper, BiffInputStream& rStrm )
-{
-    BiffDrawingObjectRef xDrawingObj;
-
-    if( rStrm.getRemaining() >= 10 )
-    {
-        sal_uInt16 nSubRecId, nSubRecSize, nObjType;
-        rStrm >> nSubRecId >> nSubRecSize >> nObjType;
-        OSL_ENSURE( nSubRecId == BIFF_ID_OBJCMO, "BiffDrawingObjectBase::importObjBiff8 - OBJCMO subrecord expected" );
-        if( (nSubRecId == BIFF_ID_OBJCMO) && (nSubRecSize >= 6) )
-        {
-            switch( nObjType )
-            {
-#if 0
-                // in BIFF8, all simple objects support text
-                case BIFF_OBJTYPE_LINE:
-                case BIFF_OBJTYPE_ARC:
-                    xDrawingObj.reset( new XclImpTextObj( rHelper ) );
-                    // lines and arcs may be 2-dimensional
-                    xDrawingObj->setAreaObj( false );
-                break;
-
-                // in BIFF8, all simple objects support text
-                case BIFF_OBJTYPE_RECTANGLE:
-                case BIFF_OBJTYPE_OVAL:
-                case BIFF_OBJTYPE_POLYGON:
-                case BIFF_OBJTYPE_DRAWING:
-                case BIFF_OBJTYPE_TEXT:
-                    xDrawingObj.reset( new XclImpTextObj( rHelper ) );
-                break;
-#endif
-
-                case BIFF_OBJTYPE_GROUP:        xDrawingObj.reset( new BiffGroupObject( rHelper ) );        break;
-#if 0
-                case BIFF_OBJTYPE_CHART:        xDrawingObj.reset( new XclImpChartObj( rHelper ) );         break;
-                case BIFF_OBJTYPE_BUTTON:       xDrawingObj.reset( new XclImpButtonObj( rHelper ) );        break;
-                case BIFF_OBJTYPE_PICTURE:      xDrawingObj.reset( new XclImpPictureObj( rHelper ) );       break;
-                case BIFF_OBJTYPE_CHECKBOX:     xDrawingObj.reset( new XclImpCheckBoxObj( rHelper ) );      break;
-                case BIFF_OBJTYPE_OPTIONBUTTON: xDrawingObj.reset( new XclImpOptionButtonObj( rHelper ) );  break;
-                case BIFF_OBJTYPE_EDIT:         xDrawingObj.reset( new XclImpEditObj( rHelper ) );          break;
-                case BIFF_OBJTYPE_LABEL:        xDrawingObj.reset( new XclImpLabelObj( rHelper ) );         break;
-                case BIFF_OBJTYPE_DIALOG:       xDrawingObj.reset( new XclImpDialogObj( rHelper ) );        break;
-                case BIFF_OBJTYPE_SPIN:         xDrawingObj.reset( new XclImpSpinButtonObj( rHelper ) );    break;
-                case BIFF_OBJTYPE_SCROLLBAR:    xDrawingObj.reset( new XclImpScrollBarObj( rHelper ) );     break;
-                case BIFF_OBJTYPE_LISTBOX:      xDrawingObj.reset( new XclImpListBoxObj( rHelper ) );       break;
-                case BIFF_OBJTYPE_GROUPBOX:     xDrawingObj.reset( new XclImpGroupBoxObj( rHelper ) );      break;
-                case BIFF_OBJTYPE_DROPDOWN:     xDrawingObj.reset( new XclImpDropDownObj( rHelper ) );      break;
-                case BIFF_OBJTYPE_NOTE:         xDrawingObj.reset( new XclImpNoteObj( rHelper ) );          break;
-#endif
-
-                default:
-#if 0
-                    OSL_ENSURE( false, "BiffDrawingObjectBase::importObjBiff8 - unknown object type" );
-#endif
-                    xDrawingObj.reset( new BiffPlaceholderObject( rHelper ) );
-            }
-        }
-    }
-
-    xDrawingObj->importObjBiff8( rStrm );
-    return xDrawingObj;
-}
-
 Reference< XShape > BiffDrawingObjectBase::convertAndInsert( BiffDrawingBase& rDrawing,
         const Reference< XShapes >& rxShapes, const Rectangle* pParentRect ) const
 {
@@ -1285,14 +1222,6 @@ void BiffDrawingBase::importObj( BiffInputStream& rStrm )
     }
 }
 
-void BiffDrawingBase::setSkipObj( sal_uInt16 nObjId )
-{
-    /*  Store identifiers of objects to be skipped in a separate list (the OBJ
-        record may not be read yet). In the finalization phase, all objects
-        registered here will be skipped. */
-    maSkipObjs.push_back( nObjId );
-}
-
 void BiffDrawingBase::finalizeImport()
 {
     Reference< XShapes > xShapes( mxDrawPage, UNO_QUERY );
@@ -1330,14 +1259,6 @@ Reference< XShape > BiffDrawingBase::createAndInsertXShape( const OUString& rSer
     return xShape;
 }
 
-// protected ------------------------------------------------------------------
-
-void BiffDrawingBase::appendRawObject( const BiffDrawingObjectRef& rxDrawingObj )
-{
-    OSL_ENSURE( rxDrawingObj.get(), "BiffDrawingBase::appendRawObject - unexpected empty object reference" );
-    maRawObjs.append( rxDrawingObj );
-}
-
 // ============================================================================
 
 BiffSheetDrawing::BiffSheetDrawing( const WorksheetHelper& rHelper ) :
diff --git a/unusedcode.easy b/unusedcode.easy
index 140ed4d..539ae0f 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -904,13 +904,6 @@ oox::dump::biff::BiffObjectBase::dumpRowRange(oox::dump::String const&, bool)
 oox::dump::biff::FormulaObject::dumpCellFormula(oox::dump::String const&, unsigned short)
 oox::formulaimport::XmlStream::AttributeList::hasAttribute(int) const
 oox::formulaimport::XmlStream::skipElement(int)
-oox::xls::BiffDrawingBase::appendRawObject(boost::shared_ptr<oox::xls::BiffDrawingObjectBase> const&)
-oox::xls::BiffDrawingBase::setSkipObj(unsigned short)
-oox::xls::BiffDrawingObjectBase::importObjBiff8(oox::xls::WorksheetHelper const&, oox::xls::BiffInputStream&)
-oox::xls::BiffHelper::calcCodePageFromTextEncoding(unsigned short)
-oox::xls::BiffHelper::calcRkFromDouble(int&, double)
-oox::xls::BiffOutputStream::BiffOutputStream(oox::BinaryOutputStream&, unsigned short)
-oox::xls::BiffOutputStream::endRecord()
 oox::xls::BiffOutputStream::fill(unsigned char, int, unsigned long)
 oox::xls::BiffOutputStream::sizeBase() const
 oox::xls::BiffOutputStream::startRecord(unsigned short)
-- 
1.7.9.1


--k1lZvvs/B4yU6o8G--


More information about the LibreOffice mailing list