[Libreoffice-commits] core.git: sc/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Wed Jul 27 06:49:51 UTC 2016


 sc/source/filter/inc/biffhelper.hxx         |   18 ++++++++----------
 sc/source/filter/inc/workbookhelper.hxx     |    3 ---
 sc/source/filter/oox/externallinkbuffer.cxx |    5 ++---
 sc/source/filter/oox/pivotcachebuffer.cxx   |    8 +++-----
 sc/source/filter/oox/workbookhelper.cxx     |    9 ---------
 5 files changed, 13 insertions(+), 30 deletions(-)

New commits:
commit e73c4d5013d7a0bf7d72db1773d7125ab91cf269
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Sat Jul 16 20:31:48 2016 +0200

    sc: meBiff is always set to BiffType::BIFF_UNKNOWN
    
    remove meBeff and GetBiff().
    adapt uses.
    remove enum BiffType, because only use is gone.
    keep BiffType symbols as comment for documetation.
    
    Change-Id: I7019a21b80fd5b5f0b92458f83dd9e34bc704731
    Reviewed-on: https://gerrit.libreoffice.org/27253
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sc/source/filter/inc/biffhelper.hxx b/sc/source/filter/inc/biffhelper.hxx
index 2e2c82d..ad19114 100644
--- a/sc/source/filter/inc/biffhelper.hxx
+++ b/sc/source/filter/inc/biffhelper.hxx
@@ -246,16 +246,14 @@ const sal_Int32 BIFF12_ID_XF                = 0x002F;
 
 // BIFF2-BIFF8 record identifiers =============================================
 
-/** An enumeration for all binary Excel file format types (BIFF types). */
-enum BiffType
-{
-    BIFF2 = 0,                  /// MS Excel 2.1.
-    BIFF3,                      /// MS Excel 3.0.
-    BIFF4,                      /// MS Excel 4.0.
-    BIFF5,                      /// MS Excel 5.0, MS Excel 7.0 (95).
-    BIFF8,                      /// MS Excel 8.0 (97), 9.0 (2000), 10.0 (XP), 11.0 (2003).
-    BIFF_UNKNOWN                /// Unknown BIFF version.
-};
+/** all binary Excel file format types (BIFF types).
+    BIFF2                      /// MS Excel 2.1.
+    BIFF3                      /// MS Excel 3.0.
+    BIFF4                      /// MS Excel 4.0.
+    BIFF5                      /// MS Excel 5.0, MS Excel 7.0 (95).
+    BIFF8                      /// MS Excel 8.0 (97), 9.0 (2000), 10.0 (XP), 11.0 (2003).
+    BIFF_UNKNOWN               /// Unknown BIFF version.
+*/
 
 /** unused -- keep for documentation */
 //const sal_uInt16 BIFF2_MAXRECSIZE           = 2080;
diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx
index 6ea3007..af4ea9f 100644
--- a/sc/source/filter/inc/workbookhelper.hxx
+++ b/sc/source/filter/inc/workbookhelper.hxx
@@ -265,9 +265,6 @@ public:
 
     // BIFF2-BIFF8 specific (MUST NOT be called in OOXML/BIFF12 filter) -------
 
-    /** Returns the BIFF type in binary filter. */
-    BiffType            getBiff() const;
-
     /** Returns the text encoding used to import/export byte strings. */
     rtl_TextEncoding    getTextEncoding() const;
 
diff --git a/sc/source/filter/oox/externallinkbuffer.cxx b/sc/source/filter/oox/externallinkbuffer.cxx
index 6d921ca..c4d5a46 100644
--- a/sc/source/filter/oox/externallinkbuffer.cxx
+++ b/sc/source/filter/oox/externallinkbuffer.cxx
@@ -435,7 +435,7 @@ sal_Int32 ExternalLink::getDocumentLinkIndex() const
 sal_Int32 ExternalLink::getSheetCacheIndex( sal_Int32 nTabId ) const
 {
     OSL_ENSURE( meLinkType == LINKTYPE_EXTERNAL, "ExternalLink::getSheetCacheIndex - invalid link type" );
-    OSL_ENSURE( (nTabId == 0) || (getBiff() == BIFF8),
+    OSL_ENSURE( nTabId == 0,
         "ExternalLink::getSheetCacheIndex - invalid sheet index" );
     return ContainerHelper::getVectorElement( maSheetCaches, nTabId, -1 );
 }
@@ -649,7 +649,6 @@ ExternalLinkRef ExternalLinkBuffer::getExternalLink( sal_Int32 nRefId, bool bUse
 
 LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId, sal_Int16 nTabId1, sal_Int16 nTabId2 ) const
 {
-    OSL_ENSURE( getBiff() <= BIFF5, "ExternalLinkBuffer::getSheetRange - wrong BIFF version" );
     LinkSheetRange aSheetRange;
     if( const ExternalLink* pExtLink = getExternalLink( nRefId ).get() )
         pExtLink->getSheetRange( aSheetRange, nTabId1, nTabId2 );
@@ -658,7 +657,7 @@ LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId, sal_Int16 nT
 
 LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId ) const
 {
-    OSL_ENSURE( mbUseRefSheets || (getBiff() == BIFF8), "ExternalLinkBuffer::getSheetRange - wrong BIFF version" );
+    OSL_ENSURE( mbUseRefSheets, "ExternalLinkBuffer::getSheetRange - wrong BIFF version" );
     LinkSheetRange aSheetRange;
     if( const ExternalLink* pExtLink = getExternalLink( nRefId ).get() )
         if( const RefSheetsModel* pRefSheets = getRefSheets( nRefId ) )
diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx
index 019b029..7de3dbb 100644
--- a/sc/source/filter/oox/pivotcachebuffer.cxx
+++ b/sc/source/filter/oox/pivotcachebuffer.cxx
@@ -235,7 +235,7 @@ void PivotCacheItem::readIndex( SequenceInputStream& rStrm )
 
 void PivotCacheItem::readString( BiffInputStream& rStrm, const WorkbookHelper& rHelper )
 {
-    maValue <<= (rHelper.getBiff() == BIFF8) ? rStrm.readUniString() : rStrm.readByteStringUC( true, rHelper.getTextEncoding() );
+    maValue <<= rStrm.readByteStringUC( true, rHelper.getTextEncoding() );
     mnType = XML_s;
 }
 
@@ -634,7 +634,7 @@ void PivotCacheField::importPCDField( BiffInputStream& rStrm )
     maFieldGroupModel.mnBaseField    = rStrm.readuInt16();
     rStrm.skip( 2 );    // number of unique items (either shared or group)
     rStrm >> nGroupItems >> nBaseItems >> nSharedItems;
-    maFieldModel.maName = (getBiff() == BIFF8) ? rStrm.readUniString() : rStrm.readByteStringUC( true, getTextEncoding() );
+    maFieldModel.maName = rStrm.readByteStringUC( true, getTextEncoding() );
 
     maFieldModel.mbServerField          = getFlag( nFlags, BIFF_PCDFIELD_SERVERFIELD );
     maFieldModel.mbUniqueList           = !getFlag( nFlags, BIFF_PCDFIELD_NOUNIQUEITEMS );
@@ -1176,9 +1176,7 @@ void PivotCache::importPCDefinition( BiffInputStream& rStrm )
     rStrm.skip( 6 );    // total field count, report record count, (repeated) cache type
     rStrm >> nUserNameLen;
     if( nUserNameLen != BIFF_PC_NOSTRING )
-        maDefModel.maRefreshedBy = (getBiff() == BIFF8) ?
-            rStrm.readUniString( nUserNameLen ) :
-            rStrm.readCharArrayUC( nUserNameLen, getTextEncoding() );
+        maDefModel.maRefreshedBy = rStrm.readCharArrayUC( nUserNameLen, getTextEncoding() );
 
     maDefModel.mbInvalid          = getFlag( nFlags, BIFF_PCDEFINITION_INVALID );
     maDefModel.mbSaveData         = getFlag( nFlags, BIFF_PCDEFINITION_SAVEDATA );
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 2af4dcb..4c30296 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -224,8 +224,6 @@ public:
 
     // BIFF2-BIFF8 specific ---------------------------------------------------
 
-    /** Returns the BIFF type in binary filter. */
-    inline BiffType     getBiff() const { return meBiff; }
     /** Returns the text encoding used to import/export byte strings. */
     inline rtl_TextEncoding getTextEncoding() const { return meTextEnc; }
     /** Returns the codec helper that stores the encoder/decoder object. */
@@ -303,7 +301,6 @@ private:
 
     // BIFF2-BIFF8 specific
     BiffCodecHelperPtr  mxCodecHelper;          /// Encoder/decoder helper.
-    BiffType            meBiff;                 /// BIFF version for BIFF import/export.
     rtl_TextEncoding    meTextEnc;              /// BIFF byte string text encoding.
     ScDocument* mpDoc;
     ScDocShell* mpDocShell;
@@ -314,7 +311,6 @@ WorkbookGlobals::WorkbookGlobals( ExcelFilter& rFilter ) :
     mrBaseFilter( rFilter ),
     mrExcelFilter( rFilter ),
     mpOoxFilter( &rFilter ),
-    meBiff( BIFF_UNKNOWN ),
     mpDoc(nullptr),
     mpDocShell(nullptr)
 {
@@ -974,11 +970,6 @@ bool WorkbookHelper::importOoxFragment( const rtl::Reference<FragmentHandler>& r
 
 // BIFF specific --------------------------------------------------------------
 
-BiffType WorkbookHelper::getBiff() const
-{
-    return mrBookGlob.getBiff();
-}
-
 rtl_TextEncoding WorkbookHelper::getTextEncoding() const
 {
     return mrBookGlob.getTextEncoding();


More information about the Libreoffice-commits mailing list