Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi there,

another bits of unused code removed.

Regards,
Petr

From e31c211d2ebb7cde8a260ec0bcef5359c0c1db8f Mon Sep 17 00:00:00 2001
From: Petr Vorel <petr.vorel@gmail.com>
Date: Tue, 27 Mar 2012 11:03:09 +0200
Subject: [PATCH] remove unused code (oox, sc)

---
 oox/inc/oox/dump/dumperbase.hxx           |    4 --
 oox/inc/oox/mathml/importutils.hxx        |    4 --
 oox/inc/oox/ppt/pptshape.hxx              |    1 -
 oox/source/dump/dumperbase.cxx            |    5 ---
 oox/source/mathml/importutils.cxx         |   10 -----
 oox/source/ppt/pptshape.cxx               |    7 ----
 sc/source/filter/inc/addressconverter.hxx |    1 -
 sc/source/filter/inc/biffoutputstream.hxx |   14 --------
 sc/source/filter/inc/sheetdatabuffer.hxx  |   10 -----
 sc/source/filter/oox/addressconverter.cxx |    6 ---
 sc/source/filter/oox/biffoutputstream.cxx |   23 -------------
 sc/source/filter/oox/sheetdatabuffer.cxx  |   52 +----------------------------
 unusedcode.easy                           |   12 -------
 13 files changed, 1 insertions(+), 148 deletions(-)

diff --git a/oox/inc/oox/dump/dumperbase.hxx b/oox/inc/oox/dump/dumperbase.hxx
index 534776b..5989c1e 100644
--- a/oox/inc/oox/dump/dumperbase.hxx
+++ b/oox/inc/oox/dump/dumperbase.hxx
@@ -1860,10 +1860,6 @@ public:
                             const BinaryInputStreamRef& rxStrm,
                             const ::rtl::OUString& rSysFileName );
 
-    explicit            XmlStreamObject(
-                            const OutputObjectBase& rParent,
-                            const BinaryInputStreamRef& rxStrm );
-
 protected:
     virtual void        implDumpText( TextInputStream& rTextStrm );
 };
diff --git a/oox/inc/oox/mathml/importutils.hxx b/oox/inc/oox/mathml/importutils.hxx
index 9b90681..fc0e276 100644
--- a/oox/inc/oox/mathml/importutils.hxx
+++ b/oox/inc/oox/mathml/importutils.hxx
@@ -213,10 +213,6 @@ public:
     */
     bool findTag( int token );
     /**
-     Skips the given element (i.e. reads up to and including the matching closing tag).
-    */
-    void skipElement( int token );
-    /**
      Handle the current (unexpected) tag.
     */
     void handleUnexpectedTag();
diff --git a/oox/inc/oox/ppt/pptshape.hxx b/oox/inc/oox/ppt/pptshape.hxx
index e06fda6..07ab723 100644
--- a/oox/inc/oox/ppt/pptshape.hxx
+++ b/oox/inc/oox/ppt/pptshape.hxx
@@ -67,7 +67,6 @@ public:
 
     static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, 
std::vector< oox::drawingml::ShapePtr >& rShapes );
     static oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< 
oox::drawingml::ShapePtr >& rShapes );
-    static oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 
nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes );
 
     static oox::drawingml::TextListStylePtr getSubTypeTextListStyle( const SlidePersist& 
rSlidePersist, sal_Int32 nSubType );
 
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index f078111..366090c 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -2920,11 +2920,6 @@ XmlStreamObject::XmlStreamObject( const ObjectBase& rParent,
     TextStreamObjectBase::construct( rParent, rxStrm, RTL_TEXTENCODING_UTF8, rSysFileName );
 }
 
-XmlStreamObject::XmlStreamObject( const OutputObjectBase& rParent, const BinaryInputStreamRef& 
rxStrm )
-{
-    TextStreamObjectBase::construct( rParent, rxStrm, RTL_TEXTENCODING_UTF8 );
-}
-
 void XmlStreamObject::implDumpText( TextInputStream& rTextStrm )
 {
     /*  Buffers a start element and the following element text. Needed to dump
diff --git a/oox/source/mathml/importutils.cxx b/oox/source/mathml/importutils.cxx
index ab9d224..41a254d 100644
--- a/oox/source/mathml/importutils.cxx
+++ b/oox/source/mathml/importutils.cxx
@@ -114,11 +114,6 @@ static OUString tokenToString( int token )
 
 } // namespace
 
-bool XmlStream::AttributeList::hasAttribute( int token ) const
-{
-    return attrs.find( token ) != attrs.end();
-}
-
 rtl::OUString XmlStream::AttributeList::attribute( int token, const rtl::OUString& def ) const
 {
     std::map< int, rtl::OUString >::const_iterator find = attrs.find( token );
@@ -304,11 +299,6 @@ bool XmlStream::findTagInternal( int token, bool silent )
     return false;
 }
 
-void XmlStream::skipElement( int token )
-{
-    return skipElementInternal( token, true ); // no debug about skipping if called from outside
-}
-
 void XmlStream::skipElementInternal( int token, bool silent )
 {
     int closing = ( token & ~TAG_OPENING ) | TAG_CLOSING; // make it a closing tag
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index a72a10c..2b017f0 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -423,13 +423,6 @@ oox::drawingml::ShapePtr PPTShape::findPlaceholderByIndex( const sal_Int32 
nIdx,
     return aShapePtr;
 }
 
-// if nFirstPlaceholder can't be found, it will be searched for nSecondPlaceholder
-oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 
nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
-{
-    oox::drawingml::ShapePtr pPlaceholder = findPlaceholder( nFirstPlaceholder, rShapes );
-    return !nSecondPlaceholder || pPlaceholder.get() ? pPlaceholder : findPlaceholder( 
nSecondPlaceholder, rShapes );
-}
-
 } }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/addressconverter.hxx b/sc/source/filter/inc/addressconverter.hxx
index e8108c7..3d2934d 100644
--- a/sc/source/filter/inc/addressconverter.hxx
+++ b/sc/source/filter/inc/addressconverter.hxx
@@ -133,7 +133,6 @@ struct BinRange
 
     inline sal_Int32    getColCount() const { return maLast.mnCol - maFirst.mnCol + 1; }
     inline sal_Int32    getRowCount() const { return maLast.mnRow - maFirst.mnRow + 1; }
-    bool                contains( const BinAddress& rAddr ) const;
 
     void                read( SequenceInputStream& rStrm );
     void                read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = 
false );
diff --git a/sc/source/filter/inc/biffoutputstream.hxx b/sc/source/filter/inc/biffoutputstream.hxx
index f7a6462..7ea14a1 100644
--- a/sc/source/filter/inc/biffoutputstream.hxx
+++ b/sc/source/filter/inc/biffoutputstream.hxx
@@ -46,10 +46,6 @@ namespace prv {
 class BiffOutputRecordBuffer
 {
 public:
-    explicit            BiffOutputRecordBuffer(
-                            BinaryOutputStream& rOutStrm,
-                            sal_uInt16 nMaxRecSize );
-
     /** Returns the wrapped binary base stream. */
     inline const BinaryOutputStream& getBaseStream() const { return mrOutStrm; }
 
@@ -86,8 +82,6 @@ private:
     maximum size of BIFF record contents (e.g. 2080 bytes in BIFF2-BIFF5, or
     8224 bytes in BIFF8).
 
-    To start writing a record, call startRecord() with the record identifier.
-
     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
     specific data pieces must not be split into the current and a following
@@ -100,17 +94,9 @@ class BiffOutputStream : public BinaryOutputStream
 public:
     // record control ---------------------------------------------------------
 
-    /** Starts a new record. */
-    void                startRecord( sal_uInt16 nRecId );
-
     /** Sets size of data portion in bytes. 0 or 1 means no portions are used. */
     void                setPortionSize( sal_uInt8 nSize );
 
-    // BinaryStreamBase interface (seeking) -----------------------------------
-
-    /** Returns the absolute position in the wrapped binary stream. */
-    sal_Int64           tellBase() const;
-
     // BinaryOutputStream interface (stream write access) ---------------------
 
     /** Writes the passed data sequence. */
diff --git a/sc/source/filter/inc/sheetdatabuffer.hxx b/sc/source/filter/inc/sheetdatabuffer.hxx
index ac7fc81..05ccc19 100644
--- a/sc/source/filter/inc/sheetdatabuffer.hxx
+++ b/sc/source/filter/inc/sheetdatabuffer.hxx
@@ -95,14 +95,6 @@ struct DataTableModel
 class CellBlock : public WorksheetHelper
 {
 public:
-    explicit            CellBlock( const WorksheetHelper& rHelper, const ValueRange& rColSpan, 
sal_Int32 nRow );
-
-    /** Returns true, if the end index of the passed colspan is greater than
-        the own column end index, or if the passed range has the same end index
-        but the start indexes do not match. */
-    bool                isBefore( const ValueRange& rColSpan ) const;
-    /** Returns true, if the cell block can be expanded with the passed colspan. */
-    bool                isExpandable( const ValueRange& rColSpan ) const;
     /** Returns true, if the own colspan contains the passed column. */
     bool                contains( sal_Int32 nCol ) const;
 
@@ -114,8 +106,6 @@ public:
                             const RichStringRef& rxString,
                             const Font* pFirstPortionFont );
 
-    /** Appends a new row to the cell buffer array. */
-    void                startNextRow();
     /** Writes all buffered cells into the Calc sheet. */
     void                finalizeImport();
 
diff --git a/sc/source/filter/oox/addressconverter.cxx b/sc/source/filter/oox/addressconverter.cxx
index 9f0c09c..e566f07 100644
--- a/sc/source/filter/oox/addressconverter.cxx
+++ b/sc/source/filter/oox/addressconverter.cxx
@@ -148,12 +148,6 @@ void BinAddress::write( BiffOutputStream& rStrm, bool bCol16Bit, bool bRow32Bit
 
 // ============================================================================
 
-bool BinRange::contains( const BinAddress& rAddr ) const
-{
-    return  (maFirst.mnCol <= rAddr.mnCol) && (rAddr.mnCol <= maLast.mnCol) &&
-            (maFirst.mnRow <= rAddr.mnRow) && (rAddr.mnRow <= maLast.mnRow);
-}
-
 void BinRange::read( SequenceInputStream& rStrm )
 {
     rStrm >> maFirst.mnRow >> maLast.mnRow >> maFirst.mnCol >> maLast.mnCol;
diff --git a/sc/source/filter/oox/biffoutputstream.cxx b/sc/source/filter/oox/biffoutputstream.cxx
index 0b2524c..7fd233d 100644
--- a/sc/source/filter/oox/biffoutputstream.cxx
+++ b/sc/source/filter/oox/biffoutputstream.cxx
@@ -35,16 +35,6 @@ namespace xls {
 
 namespace prv {
 
-BiffOutputRecordBuffer::BiffOutputRecordBuffer( BinaryOutputStream& rOutStrm, sal_uInt16 
nMaxRecSize ) :
-    mrOutStrm( rOutStrm ),
-    mnMaxRecSize( nMaxRecSize ),
-    mnRecId( BIFF_ID_UNKNOWN ),
-    mbInRec( false )
-{
-    OSL_ENSURE( mrOutStrm.isSeekable(), "BiffOutputRecordBuffer::BiffOutputRecordBuffer - stream 
must be seekable" );
-    maData.reserve( SAL_MAX_UINT16 );
-}
-
 void BiffOutputRecordBuffer::startRecord( sal_uInt16 nRecId )
 {
     OSL_ENSURE( !mbInRec, "BiffOutputRecordBuffer::startRecord - another record still open" );
@@ -87,12 +77,6 @@ void BiffOutputRecordBuffer::fill( sal_uInt8 nValue, sal_uInt16 nBytes )
 
 // record control -------------------------------------------------------------
 
-void BiffOutputStream::startRecord( sal_uInt16 nRecId )
-{
-    maRecBuffer.startRecord( nRecId );
-    setPortionSize( 1 );
-}
-
 void BiffOutputStream::setPortionSize( sal_uInt8 nSize )
 {
     OSL_ENSURE( mnPortionPos == 0, "BiffOutputStream::setPortionSize - block operation inside 
portion" );
@@ -100,13 +84,6 @@ void BiffOutputStream::setPortionSize( sal_uInt8 nSize )
     mnPortionPos = 0;
 }
 
-// BinaryStreamBase interface (seeking) ---------------------------------------
-
-sal_Int64 BiffOutputStream::tellBase() const
-{
-    return maRecBuffer.getBaseStream().tell();
-}
-
 // BinaryOutputStream interface (stream write access) -------------------------
 
 void BiffOutputStream::writeData( const StreamDataSequence& rData, size_t nAtomSize )
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index fbae5b1..b0f778d 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -117,28 +117,6 @@ const sal_Int32 CELLBLOCK_MAXROWS  = 16;    /// Number of rows in a cell block.
 
 } // namespace
 
-CellBlock::CellBlock( const WorksheetHelper& rHelper, const ValueRange& rColSpan, sal_Int32 nRow ) 
:
-    WorksheetHelper( rHelper ),
-    maRange( rHelper.getSheetIndex(), rColSpan.mnFirst, nRow, rColSpan.mnLast, nRow ),
-    mnRowLength( rColSpan.mnLast - rColSpan.mnFirst + 1 ),
-    mnFirstFreeIndex( 0 )
-{
-    maCellArray.realloc( 1 );
-    maCellArray[ 0 ].realloc( mnRowLength );
-    mpCurrCellRow = maCellArray[ 0 ].getArray();
-}
-
-bool CellBlock::isExpandable( const ValueRange& rColSpan ) const
-{
-    return (maRange.StartColumn == rColSpan.mnFirst) && (maRange.EndColumn == rColSpan.mnLast);
-}
-
-bool CellBlock::isBefore( const ValueRange& rColSpan ) const
-{
-    return (maRange.EndColumn < rColSpan.mnLast) ||
-        ((maRange.EndColumn == rColSpan.mnLast) && (maRange.StartColumn != rColSpan.mnFirst));
-}
-
 bool CellBlock::contains( sal_Int32 nCol ) const
 {
     return (maRange.StartColumn <= nCol) && (nCol <= maRange.EndColumn);
@@ -149,30 +127,6 @@ void CellBlock::insertRichString( const CellAddress& rAddress, const 
RichStringR
     maRichStrings.push_back( RichStringCell( rAddress, rxString, pFirstPortionFont ) );
 }
 
-void CellBlock::startNextRow()
-{
-    // fill last cells in current row with empty strings (placeholder for empty cells)
-    fillUnusedCells( mnRowLength );
-    // flush if the cell block reaches maximum size
-    if( maCellArray.getLength() == CELLBLOCK_MAXROWS )
-    {
-        finalizeImport();
-        maRange.StartRow = ++maRange.EndRow;
-        maCellArray.realloc( 1 );
-        mpCurrCellRow = maCellArray[ 0 ].getArray();
-    }
-    else
-    {
-        // prepare next row
-        ++maRange.EndRow;
-        sal_Int32 nRowCount = maCellArray.getLength();
-        maCellArray.realloc( nRowCount + 1 );
-        maCellArray[ nRowCount ].realloc( mnRowLength );
-        mpCurrCellRow = maCellArray[ nRowCount ].getArray();
-    }
-    mnFirstFreeIndex = 0;
-}
-
 Any& CellBlock::getCellAny( sal_Int32 nCol )
 {
     OSL_ENSURE( contains( nCol ), "CellBlock::getCellAny - invalid column" );
@@ -275,11 +229,7 @@ CellBlock* CellBlockBuffer::getCellBlock( const CellAddress& rCellAddr )
             {
                 const ValueRange& rColSpan = *aVIt;
                 /*  Finalize and remove all cell blocks up to end of the column
-                    range (cell blocks are keyed by end column index).
-                    CellBlock::isBefore() returns true, if the end index of the
-                    passed colspan is greater than the column end index of the
-                    cell block, or if the passed range has the same end index
-                    but the start indexes do not match. */
+                    range (cell blocks are keyed by end column index). */
                 while( (aMIt != maCellBlocks.end()) && aMIt->second->isBefore( rColSpan ) )
                 {
                     aMIt->second->finalizeImport();
diff --git a/unusedcode.easy b/unusedcode.easy
index 04c33ac..54ba512 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -874,20 +874,8 @@ oox::dump::StringHelper::appendIndexedText(rtl::OUStringBuffer&, rtl::OUString 
c
 oox::dump::StringHelper::appendToken(rtl::OUStringBuffer&, long, unsigned short)
 oox::dump::StringHelper::prependToken(rtl::OUStringBuffer&, long, unsigned short)
 oox::dump::TextStreamObjectBase::construct(oox::dump::InputObjectBase const&, unsigned short)
-oox::dump::XmlStreamObject::XmlStreamObject(oox::dump::OutputObjectBase const&, 
oox::dump::BinaryInputStreamRef const&)
-oox::formulaimport::XmlStream::AttributeList::hasAttribute(int) const
-oox::formulaimport::XmlStream::skipElement(int)
-oox::ppt::PPTShape::findPlaceholder(int, int, 
std::__debug::vector<boost::shared_ptr<oox::drawingml::Shape>, 
std::allocator<boost::shared_ptr<oox::drawingml::Shape> > >&)
-oox::xls::BiffOutputStream::startRecord(unsigned short)
-oox::xls::BiffOutputStream::tellBase() const
 oox::xls::BinAddress::write(oox::xls::BiffOutputStream&, bool, bool) const
-oox::xls::BinRange::contains(oox::xls::BinAddress const&) const
 oox::xls::BinRangeList::write(oox::xls::BiffOutputStream&, bool, bool) const
-oox::xls::CellBlock::CellBlock(oox::xls::WorksheetHelper const&, oox::ValueRange const&, int)
-oox::xls::CellBlock::isBefore(oox::ValueRange const&) const
-oox::xls::CellBlock::isExpandable(oox::ValueRange const&) const
-oox::xls::CellBlock::startNextRow()
-oox::xls::prv::BiffOutputRecordBuffer::BiffOutputRecordBuffer(oox::BinaryOutputStream&, unsigned 
short)
 psp::PrinterGfx::DrawBitmap(Rectangle const&, Rectangle const&, psp::PrinterBmp const&, 
psp::PrinterBmp const&)
 psp::PrinterGfx::DrawMask(Rectangle const&, Rectangle const&, psp::PrinterBmp const&, 
psp::PrinterColor&)
 psp::PrinterGfx::GetGlyphBoundRect(unsigned short, Rectangle&)
-- 
1.7.9.1


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.