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


Hi, i'm not sure if this patch is correct so please review. I deleted
BiffInputStream::sizeBase(), skipByteString(bool) and skipUniString()
methods listed in unusedcode.easy. But also deleted another two methods
(skipUniStringBody and skipUniStringChars ) because these two methods are
used only by previously deleted methods.

I can't find other calls to these methods using "git grep". Also, source
code compiles whithout problems, but I don't know if can be safely deleted
or maybe keept until unusedcode.easy be generated again.

Thanks.
From 4dc225f6785a58f258ce7b78fcacf22a5d4b6be4 Mon Sep 17 00:00:00 2001
From: Santiago Martinez <smvarela@gmail.com>
Date: Mon, 27 Feb 2012 20:32:50 +0100
Subject: [PATCH] Remove unused code in BiffInputStream.

---
 oox/inc/oox/xls/biffinputstream.hxx |   28 ------------------------
 oox/source/xls/biffinputstream.cxx  |   40 -----------------------------------
 2 files changed, 0 insertions(+), 68 deletions(-)

diff --git a/oox/inc/oox/xls/biffinputstream.hxx b/oox/inc/oox/xls/biffinputstream.hxx
index 2f6f537..c05186c 100644
--- a/oox/inc/oox/xls/biffinputstream.hxx
+++ b/oox/inc/oox/xls/biffinputstream.hxx
@@ -254,8 +254,6 @@ public:
 
     /** Returns the absolute position in the wrapped binary stream. */
     sal_Int64           tellBase() const;
-    /** Returns the total size of the wrapped binary stream. */
-    sal_Int64           sizeBase() const;
 
     // BinaryInputStream interface (stream read access) -----------------------
 
@@ -295,13 +293,6 @@ public:
      */
     ::rtl::OUString     readByteStringUC( bool b16BitLen, rtl_TextEncoding eTextEnc, bool 
bAllowNulChars = false );
 
-    /** Ignores 8/16 bit string length and character array.
-        @param b16BitLen
-            True = Read 16-bit string length field before the character array.
-            False = Read 8-bit string length field before the character array.
-     */
-    void                skipByteString( bool b16BitLen );
-
     // Unicode strings --------------------------------------------------------
 
     /** Reads nChars characters of a BIFF8 string, and returns the string.
@@ -332,25 +323,6 @@ public:
      */
     ::rtl::OUString     readUniString( bool bAllowNulChars = false );
 
-    /** Ignores nChars characters of a BIFF8 string.
-        @param nChars  Number of characters to skip in the stream.
-        @param b16BitChars
-            True = The character array contains 16-bit characters.
-            False = The character array contains truncated 8-bit characters.
-     */
-    void                skipUniStringChars( sal_uInt16 nChars, bool b16BitChars );
-
-    /** Ignores 8-bit flags, extended header, nChar characters, extended data
-        of a BIFF8 string.
-        @param nChars  Number of characters to skip in the stream.
-     */
-    void                skipUniStringBody( sal_uInt16 nChars );
-
-    /** Ignores 16-bit character count, 8-bit flags, extended header, character
-        array, extended data of a BIFF8 string.
-     */
-    void                skipUniString();
-
     // ------------------------------------------------------------------------
 private:
     /** Initializes all members after base stream has been seeked to new record. */
diff --git a/oox/source/xls/biffinputstream.cxx b/oox/source/xls/biffinputstream.cxx
index 5634ae4..d238bb3 100644
--- a/oox/source/xls/biffinputstream.cxx
+++ b/oox/source/xls/biffinputstream.cxx
@@ -291,11 +291,6 @@ sal_Int64 BiffInputStream::tellBase() const
     return maRecBuffer.getBaseStream().tell();
 }
 
-sal_Int64 BiffInputStream::sizeBase() const
-{
-    return maRecBuffer.getBaseStream().size();
-}
-
 // BinaryInputStream interface (stream read access) ---------------------------
 
 sal_Int32 BiffInputStream::readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t 
nAtomSize )
@@ -368,11 +363,6 @@ OUString BiffInputStream::readByteStringUC( bool b16BitLen, rtl_TextEncoding 
eTe
     return OStringToOUString( readByteString( b16BitLen, bAllowNulChars ), eTextEnc );
 }
 
-void BiffInputStream::skipByteString( bool b16BitLen )
-{
-    skip( b16BitLen ? readuInt16() : readuInt8() );
-}
-
 // Unicode strings ------------------------------------------------------------
 
 OUString BiffInputStream::readUniStringChars( sal_uInt16 nChars, bool b16BitChars, bool 
bAllowNulChars )
@@ -418,36 +408,6 @@ OUString BiffInputStream::readUniString( bool bAllowNulChars )
     return readUniStringBody( readuInt16(), bAllowNulChars );
 }
 
-void BiffInputStream::skipUniStringChars( sal_uInt16 nChars, bool b16BitChars )
-{
-    sal_Int32 nCharsLeft = nChars;
-    while( !mbEof && (nCharsLeft > 0) )
-    {
-        // skip the character array
-        sal_Int32 nSkipSize = b16BitChars ? getMaxRawReadSize( 2 * nCharsLeft, 2 ) : 
getMaxRawReadSize( nCharsLeft, 1 );
-        skip( nSkipSize );
-
-        // prepare for next CONTINUE record
-        nCharsLeft -= (b16BitChars ? (nSkipSize / 2) : nSkipSize);
-        if( nCharsLeft > 0 )
-            jumpToNextStringContinue( b16BitChars );
-    }
-}
-
-void BiffInputStream::skipUniStringBody( sal_uInt16 nChars )
-{
-    bool b16BitChars;
-    sal_Int32 nAddSize;
-    readUniStringHeader( b16BitChars, nAddSize );
-    skipUniStringChars( nChars, b16BitChars );
-    skip( nAddSize );
-}
-
-void BiffInputStream::skipUniString()
-{
-    skipUniStringBody( readuInt16() );
-}
-
 // private --------------------------------------------------------------------
 
 void BiffInputStream::setupRecord()
-- 
1.7.7.6


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.