summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-01-25 20:04:27 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-26 06:26:30 +0000
commit2640ec898a043c42f62a46f8381cb43cb33d91c2 (patch)
tree6996286f7198781fc1336038cf9e6a89e284a715 /sc
parent0d172a803054801ff42296c65cfca844ad5e8f6b (diff)
NameBuffer is dead
all getters are gone since commit 96d44c9b077a6cc8068067a795dc63248ab90fea Date: Wed Jul 22 10:20:03 2015 +0200 loplugin:unusedmethods sc Change-Id: I26b1ac6b24680d0a6045e9a93d40fbbd2caa6a4b Reviewed-on: https://gerrit.libreoffice.org/33542 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/excdoc.cxx33
-rw-r--r--sc/source/filter/excel/excform.cxx1
-rw-r--r--sc/source/filter/excel/exctools.cxx1
-rw-r--r--sc/source/filter/excel/impop.cxx6
-rw-r--r--sc/source/filter/excel/namebuff.cxx16
-rw-r--r--sc/source/filter/inc/excdoc.hxx4
-rw-r--r--sc/source/filter/inc/imp_op.hxx2
-rw-r--r--sc/source/filter/inc/namebuff.hxx34
8 files changed, 9 insertions, 88 deletions
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 6f3b2ad3d6ef..e12f10712a29 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -34,7 +34,6 @@
#include "formulacell.hxx"
#include "dociter.hxx"
#include "document.hxx"
-#include "rangenam.hxx"
#include "dbdata.hxx"
#include "global.hxx"
#include "globstr.hrc"
@@ -137,7 +136,6 @@ ExcTable::ExcTable( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot ),
mnScTab( SCTAB_GLOBAL ),
nExcTab( EXC_NOTAB ),
- pTabNames( new NameBuffer( nullptr, 16 ) ),
mxNoteList( new XclExpNoteList )
{
}
@@ -146,7 +144,6 @@ ExcTable::ExcTable( const XclExpRoot& rRoot, SCTAB nScTab ) :
XclExpRoot( rRoot ),
mnScTab( nScTab ),
nExcTab( rRoot.GetTabInfo().GetXclTab( nScTab ) ),
- pTabNames( new NameBuffer( nullptr, 16 ) ),
mxNoteList( new XclExpNoteList )
{
}
@@ -174,9 +171,6 @@ void ExcTable::FillAsHeaderBinary( ExcBoundsheetList& rBoundsheetList )
else
Add( new ExcBofW8 );
- SCTAB nC;
- OUString aTmpString;
- SCTAB nScTabCount = rTabInfo.GetScTabCount();
sal_uInt16 nExcTabCount = rTabInfo.GetXclTabCount();
sal_uInt16 nCodenames = static_cast< sal_uInt16 >( GetExtDocOptions().GetCodeNameCount() );
@@ -229,15 +223,6 @@ void ExcTable::FillAsHeaderBinary( ExcBoundsheetList& rBoundsheetList )
Add( new XclExpUInt16Record( EXC_ID_FNGROUPCOUNT, 14 ) );
- // first setup table names and contents
-
- for( nC = 0 ; nC < nScTabCount ; nC++ )
- if( rTabInfo.IsExportTab( nC ) )
- {
- rDoc.GetName( nC, aTmpString );
- *pTabNames << aTmpString;
- }
-
if ( GetBiff() <= EXC_BIFF5 )
{
// global link table: EXTERNCOUNT, EXTERNSHEET, NAME
@@ -290,6 +275,8 @@ void ExcTable::FillAsHeaderBinary( ExcBoundsheetList& rBoundsheetList )
aRecList.AppendRecord( CreateRecord( EXC_ID_XFLIST ) );
aRecList.AppendRecord( CreateRecord( EXC_ID_PALETTE ) );
+ SCTAB nC;
+ SCTAB nScTabCount = rTabInfo.GetScTabCount();
if( GetBiff() <= EXC_BIFF5 )
{
// Bundlesheet
@@ -326,6 +313,7 @@ void ExcTable::FillAsHeaderBinary( ExcBoundsheetList& rBoundsheetList )
rBoundsheetList.AppendRecord( xBoundsheet );
}
+ OUString aTmpString;
for( SCTAB nAdd = 0; nC < static_cast<SCTAB>(nCodenames) ; nC++, nAdd++ )
{
aTmpString = lcl_GetVbaTabName( nAdd );
@@ -362,24 +350,12 @@ void ExcTable::FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList )
ScDocument& rDoc = GetDoc();
XclExpTabInfo& rTabInfo = GetTabInfo();
- SCTAB nC;
- OUString aTmpString;
- SCTAB nScTabCount = rTabInfo.GetScTabCount();
sal_uInt16 nExcTabCount = rTabInfo.GetXclTabCount();
sal_uInt16 nCodenames = static_cast< sal_uInt16 >( GetExtDocOptions().GetCodeNameCount() );
rR.pTabId = new XclExpChTrTabId( std::max( nExcTabCount, nCodenames ) );
Add( rR.pTabId );
- // first setup table names and contents
-
- for( nC = 0 ; nC < nScTabCount ; nC++ )
- if( rTabInfo.IsExportTab( nC ) )
- {
- rDoc.GetName( nC, aTmpString );
- *pTabNames << aTmpString;
- }
-
Add( new XclExpXmlStartSingleElementRecord( XML_workbookPr ) );
Add( new XclExpBoolRecord(0x0040, false, XML_backupFile ) ); // BACKUP
Add( new XclExpBoolRecord(0x008D, false, XML_showObjects ) ); // HIDEOBJ
@@ -418,6 +394,8 @@ void ExcTable::FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList )
lcl_AddBookviews( aRecList, *this );
// Bundlesheet
+ SCTAB nC;
+ SCTAB nScTabCount = rTabInfo.GetScTabCount();
aRecList.AppendNewRecord( new XclExpXmlStartElementRecord( XML_sheets ) );
for( nC = 0 ; nC < nScTabCount ; nC++ )
if( rTabInfo.IsExportTab( nC ) )
@@ -428,6 +406,7 @@ void ExcTable::FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList )
}
aRecList.AppendNewRecord( new XclExpXmlEndElementRecord( XML_sheets ) );
+ OUString aTmpString;
for( SCTAB nAdd = 0; nC < static_cast<SCTAB>(nCodenames) ; nC++, nAdd++ )
{
aTmpString = lcl_GetVbaTabName( nAdd );
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index 67e7657f3428..fe09f4adf931 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -29,6 +29,7 @@
#include <svl/sharedstringpool.hxx>
#include "imp_op.hxx"
+#include "namebuff.hxx"
#include "root.hxx"
#include "xltracer.hxx"
#include "xihelper.hxx"
diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx
index 2fd9e6d0b301..8f1ad2b6326c 100644
--- a/sc/source/filter/excel/exctools.cxx
+++ b/sc/source/filter/excel/exctools.cxx
@@ -38,6 +38,7 @@
#include "root.hxx"
#include "imp_op.hxx"
#include "excimp8.hxx"
+#include "namebuff.hxx"
#include "otlnbuff.hxx"
#include "xcl97rec.hxx"
#include "formel.hxx"
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 01b5b736951e..16837e0809ec 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -62,6 +62,7 @@
#include "postit.hxx"
#include "fapihelper.hxx"
+#include "namebuff.hxx"
#include "xltools.hxx"
#include "xltable.hxx"
#include "xlview.hxx"
@@ -129,9 +130,6 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
pExcRoot->pShrfmlaBuff = new SharedFormulaBuffer( pExcRoot ); //&aShrfrmlaBuff;
pExcRoot->pExtNameBuff = new ExtNameBuff ( *this );
- pExtNameBuff = new NameBuffer( pExcRoot ); //prevent empty rootdata
- pExtNameBuff->SetBase( 1 );
-
pOutlineListBuffer = new XclImpOutlineListBuffer( );
// ab Biff8
@@ -157,8 +155,6 @@ ImportExcel::~ImportExcel()
{
GetDoc().SetSrcCharSet( GetTextEncoding() );
- delete pExtNameBuff;
-
delete pOutlineListBuffer;
delete pFormConv;
diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx
index 211cf25593cd..d2dce76c2c22 100644
--- a/sc/source/filter/excel/namebuff.cxx
+++ b/sc/source/filter/excel/namebuff.cxx
@@ -47,22 +47,6 @@ sal_uInt32 StringHashEntry::MakeHashCode( const OUString& r )
return n;
}
-NameBuffer::~NameBuffer()
-{
- std::vector<StringHashEntry*>::iterator pIter;
- for ( pIter = maHashes.begin(); pIter != maHashes.end(); ++pIter )
- delete *pIter;
-}
-
-//void NameBuffer::operator <<( const SpString &rNewString )
-void NameBuffer::operator <<( const OUString &rNewString )
-{
- OSL_ENSURE( maHashes.size() + nBase < 0xFFFF,
- "*NameBuffer::GetLastIndex(): Ich hab' die Nase voll!" );
-
- maHashes.push_back( new StringHashEntry( rNewString ) );
-}
-
SharedFormulaBuffer::SharedFormulaBuffer( RootData* pRD ) : ExcRoot(pRD) {}
SharedFormulaBuffer::~SharedFormulaBuffer()
diff --git a/sc/source/filter/inc/excdoc.hxx b/sc/source/filter/inc/excdoc.hxx
index 19c5ad57b377..f7716668616e 100644
--- a/sc/source/filter/inc/excdoc.hxx
+++ b/sc/source/filter/inc/excdoc.hxx
@@ -30,8 +30,6 @@
class SvStream;
-class NameBuffer;
-
class XclExpChangeTrack;
// class ExcTable -
@@ -52,8 +50,6 @@ private:
SCTAB mnScTab; // table number SC document
sal_uInt16 nExcTab; // table number Excel document
- std::unique_ptr<NameBuffer> pTabNames;
-
XclExpNoteListRef mxNoteList;
// re-create and forget pRec; delete is done by ExcTable itself!
diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx
index 76cde1f0a4bc..7740bfa280b2 100644
--- a/sc/source/filter/inc/imp_op.hxx
+++ b/sc/source/filter/inc/imp_op.hxx
@@ -25,7 +25,6 @@
#include "xistream.hxx"
#include "xistyle.hxx"
#include "flttypes.hxx"
-#include "namebuff.hxx"
#include "root.hxx"
#include "otlnbuff.hxx"
#include "colrowst.hxx"
@@ -100,7 +99,6 @@ protected:
ScfUInt32Vec maSheetOffsets;
ScRange maScOleSize; /// Visible range if embedded.
- NameBuffer* pExtNameBuff; // ... external names (Ind.-Basis=1)
ExcelToSc* pFormConv; // formula-converter
XclImpOutlineBuffer* pColOutlineBuff;
diff --git a/sc/source/filter/inc/namebuff.hxx b/sc/source/filter/inc/namebuff.hxx
index a4247b18aef9..18e8a75ec5da 100644
--- a/sc/source/filter/inc/namebuff.hxx
+++ b/sc/source/filter/inc/namebuff.hxx
@@ -33,12 +33,10 @@
#include <unordered_map>
class ScTokenArray;
-class NameBuffer;
class StringHashEntry
{
private:
- friend class NameBuffer;
OUString aString;
sal_uInt32 nHash;
@@ -79,38 +77,6 @@ inline bool StringHashEntry::operator ==( const StringHashEntry& r ) const
return ( nHash == r.nHash && aString == r.aString );
}
-class NameBuffer : public ExcRoot
-{
-private:
- sal_uInt16 nBase; // Index-Base
- std::vector<StringHashEntry*> maHashes;
-
-public:
-
- inline NameBuffer( RootData* );
- inline NameBuffer( RootData*, sal_uInt16 nNewBase );
-
- virtual ~NameBuffer();
- inline void SetBase( sal_uInt16 nNewBase );
- void operator <<( const OUString& rNewString );
-};
-
-inline NameBuffer::NameBuffer( RootData* p ) : ExcRoot( p )
-{
- nBase = 0;
-}
-
-inline NameBuffer::NameBuffer( RootData* p, sal_uInt16 nNewBase ) : ExcRoot( p )
-{
- nBase = nNewBase;
-}
-
-
-inline void NameBuffer::SetBase( sal_uInt16 nNewBase )
-{
- nBase = nNewBase;
-}
-
/**
* Store and manage shared formula tokens.
*/