summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-07-16 21:07:38 +0200
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2016-08-03 12:14:19 +0000
commit219a4707ee8a90f87b91f4ddebe26d9c62b9ff62 (patch)
treed67ab94b4e9701a5a99dde20bbacee275e0772c4 /sc
parent61062608a27ceaef5424203d849f88c7fb77b8d0 (diff)
sc: remove unused code
which was used for import of old BIFF formats commit e73c4d5013d7a0bf7d72db1773d7125ab91cf269 removed use of readUniString which lead to a cascade -> readUniStringBody -> readUniStringHeader -> readUniStringChars -> jumpToNextStringContinue skipRecordBlock got unused with commit 45e4f9e99b75ef8a125228bc42df7fb98af9d7bc LinkSheetRange getSheetRange(sal_Int32, sal_Int16, sal_Int16 ) const; is obsolete since commit c4cb83504faa1d241a116001fd27f7148de300ba Change-Id: I14c49280ca6f5087852d4c5a26e23a4a12fd9338 Reviewed-on: https://gerrit.libreoffice.org/27254 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/inc/biffhelper.hxx18
-rw-r--r--sc/source/filter/inc/biffinputstream.hxx41
-rw-r--r--sc/source/filter/inc/externallinkbuffer.hxx2
-rw-r--r--sc/source/filter/oox/biffhelper.cxx9
-rw-r--r--sc/source/filter/oox/biffinputstream.cxx79
-rw-r--r--sc/source/filter/oox/externallinkbuffer.cxx8
6 files changed, 1 insertions, 156 deletions
diff --git a/sc/source/filter/inc/biffhelper.hxx b/sc/source/filter/inc/biffhelper.hxx
index ad1911469660..834b3272f5c7 100644
--- a/sc/source/filter/inc/biffhelper.hxx
+++ b/sc/source/filter/inc/biffhelper.hxx
@@ -583,7 +583,6 @@ const sal_uInt8 BIFF_DATATYPE_ERROR = 16;
const sal_uInt8 BIFF_BOOLERR_BOOL = 0;
const sal_uInt8 BIFF_BOOLERR_ERROR = 1;
-*/
// BIFF8 unicode strings ------------------------------------------------------
@@ -591,6 +590,7 @@ const sal_uInt8 BIFF_STRF_16BIT = 0x01;
const sal_uInt8 BIFF_STRF_PHONETIC = 0x04;
const sal_uInt8 BIFF_STRF_RICH = 0x08;
const sal_uInt8 BIFF_STRF_UNKNOWN = 0xF2;
+*/
/** Static helper functions for BIFF filters. */
class BiffHelper
@@ -614,22 +614,6 @@ public:
/** Returns true, if the current record of the stream is a BOF record. */
static bool isBofRecord( BiffInputStream& rStrm );
- /** Skips a block of records up to the specified end record.
-
- Skips all records until next end record. When this function returns,
- the stream points to the end record, and the next call of the function
- startNextRecord() at the stream will start the record following the end
- record.
-
- The identifier of the record that is active while this function is
- called is used as start record identifier. This identifier is used to
- correctly skip embedded record blocks with the same start and end
- record identifier.
-
- @return True = stream points to the end record.
- */
- static bool skipRecordBlock( BiffInputStream& rStrm, sal_uInt16 nEndRecId );
-
private:
BiffHelper() = delete;
~BiffHelper() = delete;
diff --git a/sc/source/filter/inc/biffinputstream.hxx b/sc/source/filter/inc/biffinputstream.hxx
index 996c567efcd9..b1350571b2f9 100644
--- a/sc/source/filter/inc/biffinputstream.hxx
+++ b/sc/source/filter/inc/biffinputstream.hxx
@@ -243,36 +243,6 @@ public:
*/
OUString readByteStringUC( bool b16BitLen, rtl_TextEncoding eTextEnc, bool bAllowNulChars = false );
- // Unicode strings --------------------------------------------------------
-
- /** Reads nChars characters of a BIFF8 string, and returns the string.
- @param nChars Number of characters to read from the stream.
- @param b16BitChars
- True = The character array contains 16-bit characters.
- False = The character array contains truncated 8-bit characters.
- @param bAllowNulChars
- True = NUL characters are inserted into the imported string.
- False = NUL characters are replaced by question marks (default).
- */
- OUString readUniStringChars( sal_uInt16 nChars, bool b16BitChars, bool bAllowNulChars = false );
-
- /** Reads 8-bit flags, extended header, nChar characters, extended data of
- a BIFF8 string, and returns the string.
- @param nChars Number of characters to read from the stream.
- @param bAllowNulChars
- True = NUL characters are inserted into the imported string.
- False = NUL characters are replaced by question marks (default).
- */
- OUString readUniStringBody( sal_uInt16 nChars, bool bAllowNulChars = false );
-
- /** Reads 16-bit character count, 8-bit flags, extended header, character
- array, extended data of a BIFF8 string, and returns the string.
- @param bAllowNulChars
- True = NUL characters are inserted into the imported string.
- False = NUL characters are replaced by question marks (default).
- */
- OUString readUniString( bool bAllowNulChars = false );
-
private:
/** Initializes all members after base stream has been sought to new record. */
void setupRecord();
@@ -290,14 +260,6 @@ private:
of CONTINUE records must be enabled.
@return True if next CONTINUE record has been found and initialized. */
bool jumpToNextContinue();
- /** Goes to start of the next CONTINUE record while reading strings.
- @descr Stream must be located at the end of a raw record. If reading
- has been started in a CONTINUE record, jumps to an existing following
- CONTINUE record, even if handling of CONTINUE records is disabled (this
- is a special handling for TXO string data). Reads additional Unicode
- flag byte at start of the new raw record and sets or resets rb16BitChars.
- @return True if next CONTINUE record has been found and initialized. */
- bool jumpToNextStringContinue( bool& rb16BitChars );
/** Calculates the complete length of the current record including CONTINUE
records, stores the length in mnComplRecSize. */
void calcRecordLength();
@@ -305,9 +267,6 @@ private:
/** Returns the maximum size of raw data possible to read in one block. */
sal_uInt16 getMaxRawReadSize( sal_Int32 nBytes, size_t nAtomSize ) const;
- /** Reads the BIFF8 Unicode string header fields. */
- void readUniStringHeader( bool& orb16BitChars, sal_Int32& ornAddSize );
-
private:
prv::BiffInputRecordBuffer maRecBuffer; /// Raw record data buffer.
diff --git a/sc/source/filter/inc/externallinkbuffer.hxx b/sc/source/filter/inc/externallinkbuffer.hxx
index cfc647b5bbaa..498e13a2caa5 100644
--- a/sc/source/filter/inc/externallinkbuffer.hxx
+++ b/sc/source/filter/inc/externallinkbuffer.hxx
@@ -312,8 +312,6 @@ public:
/** Returns the external link for the passed reference identifier. */
ExternalLinkRef getExternalLink( sal_Int32 nRefId, bool bUseRefSheets = true ) const;
- /** Returns the sheet range for the specified reference (BIFF2-BIFF5 only). */
- LinkSheetRange getSheetRange( sal_Int32 nRefId, sal_Int16 nTabId1, sal_Int16 nTabId2 ) const;
/** Returns the sheet range for the specified reference (BIFF8 only). */
LinkSheetRange getSheetRange( sal_Int32 nRefId ) const;
diff --git a/sc/source/filter/oox/biffhelper.cxx b/sc/source/filter/oox/biffhelper.cxx
index ebbf63143004..1c86026fb97b 100644
--- a/sc/source/filter/oox/biffhelper.cxx
+++ b/sc/source/filter/oox/biffhelper.cxx
@@ -119,15 +119,6 @@ union DecodedDouble
(rStrm.getRecId() == BIFF5_ID_BOF);
}
-/*static*/ bool BiffHelper::skipRecordBlock( BiffInputStream& rStrm, sal_uInt16 nEndRecId )
-{
- sal_uInt16 nStartRecId = rStrm.getRecId();
- while( rStrm.startNextRecord() && (rStrm.getRecId() != nEndRecId) )
- if( rStrm.getRecId() == nStartRecId )
- skipRecordBlock( rStrm, nEndRecId );
- return !rStrm.isEof() && (rStrm.getRecId() == nEndRecId);
-}
-
} // namespace xls
} // namespace oox
diff --git a/sc/source/filter/oox/biffinputstream.cxx b/sc/source/filter/oox/biffinputstream.cxx
index 685784b012c3..6b54834fe2a5 100644
--- a/sc/source/filter/oox/biffinputstream.cxx
+++ b/sc/source/filter/oox/biffinputstream.cxx
@@ -329,51 +329,6 @@ OUString BiffInputStream::readByteStringUC( bool b16BitLen, rtl_TextEncoding eTe
return OStringToOUString( readByteString( b16BitLen, bAllowNulChars ), eTextEnc );
}
-// Unicode strings ------------------------------------------------------------
-
-OUString BiffInputStream::readUniStringChars( sal_uInt16 nChars, bool b16BitChars, bool bAllowNulChars )
-{
- OUStringBuffer aBuffer;
- aBuffer.ensureCapacity( nChars );
-
- /* This function has to react on CONTINUE records which repeat the flags
- field in their first byte and may change the 8bit/16bit character mode,
- thus a plain call to readCompressedUnicodeArray() cannot be used here. */
- sal_Int32 nCharsLeft = nChars;
- while( !mbEof && (nCharsLeft > 0) )
- {
- /* Read the character array from the remaining part of the current raw
- record. First, calculate the maximum number of characters that can
- be read without triggering to start a following CONTINUE record. */
- sal_Int32 nRawChars = b16BitChars ? (getMaxRawReadSize( nCharsLeft * 2, 2 ) / 2) : getMaxRawReadSize( nCharsLeft, 1 );
- aBuffer.append( readCompressedUnicodeArray( nRawChars, !b16BitChars, bAllowNulChars ) );
-
- /* Prepare for next CONTINUE record. Calling jumpToNextStringContinue()
- reads the leading byte in the following CONTINUE record and updates
- the b16BitChars flag. */
- nCharsLeft -= nRawChars;
- if( nCharsLeft > 0 )
- jumpToNextStringContinue( b16BitChars );
- }
-
- return aBuffer.makeStringAndClear();
-}
-
-OUString BiffInputStream::readUniStringBody( sal_uInt16 nChars, bool bAllowNulChars )
-{
- bool b16BitChars;
- sal_Int32 nAddSize;
- readUniStringHeader( b16BitChars, nAddSize );
- OUString aString = readUniStringChars( nChars, b16BitChars, bAllowNulChars );
- skip( nAddSize );
- return aString;
-}
-
-OUString BiffInputStream::readUniString( bool bAllowNulChars )
-{
- return readUniStringBody( readuInt16(), bAllowNulChars );
-}
-
// private --------------------------------------------------------------------
void BiffInputStream::setupRecord()
@@ -422,30 +377,6 @@ bool BiffInputStream::jumpToNextContinue()
return !mbEof;
}
-bool BiffInputStream::jumpToNextStringContinue( bool& rb16BitChars )
-{
- OSL_ENSURE( maRecBuffer.getRecLeft() == 0, "BiffInputStream::jumpToNextStringContinue - alignment error" );
-
- if( mbCont && (getRemaining() > 0) )
- {
- jumpToNextContinue();
- }
- else if( mnRecId == BIFF_ID_CONT )
- {
- /* CONTINUE handling is off, but we have started reading in a CONTINUE
- record -> start next CONTINUE for TXO import. We really start a new
- record here - no chance to return to string origin. */
- mbEof = mbEof || (maRecBuffer.getNextRecId() != BIFF_ID_CONT) || !maRecBuffer.startNextRecord();
- if( !mbEof )
- setupRecord();
- }
-
- // trying to read the flags invalidates stream, if no CONTINUE record has been found
- sal_uInt8 nFlags = readuInt8();
- rb16BitChars = getFlag( nFlags, BIFF_STRF_16BIT );
- return !mbEof;
-}
-
void BiffInputStream::calcRecordLength()
{
sal_Int64 nCurrPos = tell(); // save current position in record
@@ -468,16 +399,6 @@ sal_uInt16 BiffInputStream::getMaxRawReadSize( sal_Int32 nBytes, size_t nAtomSiz
return nMaxSize;
}
-void BiffInputStream::readUniStringHeader( bool& orb16BitChars, sal_Int32& ornAddSize )
-{
- sal_uInt8 nFlags = readuInt8();
- OSL_ENSURE( !getFlag( nFlags, BIFF_STRF_UNKNOWN ), "BiffInputStream::readUniStringHeader - unknown flags" );
- orb16BitChars = getFlag( nFlags, BIFF_STRF_16BIT );
- sal_uInt16 nFontCount = getFlag( nFlags, BIFF_STRF_RICH ) ? readuInt16() : 0;
- sal_Int32 nPhoneticSize = getFlag( nFlags, BIFF_STRF_PHONETIC ) ? readInt32() : 0;
- ornAddSize = 4 * nFontCount + ::std::max< sal_Int32 >( 0, nPhoneticSize );
-}
-
} // namespace xls
} // namespace oox
diff --git a/sc/source/filter/oox/externallinkbuffer.cxx b/sc/source/filter/oox/externallinkbuffer.cxx
index c4d5a46de2ac..45444ee28ace 100644
--- a/sc/source/filter/oox/externallinkbuffer.cxx
+++ b/sc/source/filter/oox/externallinkbuffer.cxx
@@ -647,14 +647,6 @@ ExternalLinkRef ExternalLinkBuffer::getExternalLink( sal_Int32 nRefId, bool bUse
return xExtLink;
}
-LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId, sal_Int16 nTabId1, sal_Int16 nTabId2 ) const
-{
- LinkSheetRange aSheetRange;
- if( const ExternalLink* pExtLink = getExternalLink( nRefId ).get() )
- pExtLink->getSheetRange( aSheetRange, nTabId1, nTabId2 );
- return aSheetRange;
-}
-
LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId ) const
{
OSL_ENSURE( mbUseRefSheets, "ExternalLinkBuffer::getSheetRange - wrong BIFF version" );