summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-03-19 09:54:38 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-03-22 06:45:08 +0100
commit157b2fa62490df3143be1317f752ce405ee60000 (patch)
tree36f3c2ee8b8fa8f21b3656fe770388cbe18ba1fa /sc
parent000bb6af72e934d7f0fd2291cea919437cfd5e2f (diff)
Convert tools/table.hxx usage to std::map in ScEEImport class
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/inc/eeimport.hxx6
-rw-r--r--sc/source/filter/inc/htmlpars.hxx1
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx18
3 files changed, 12 insertions, 13 deletions
diff --git a/sc/source/filter/inc/eeimport.hxx b/sc/source/filter/inc/eeimport.hxx
index ed74cc22c140..cc3e6811e26b 100644
--- a/sc/source/filter/inc/eeimport.hxx
+++ b/sc/source/filter/inc/eeimport.hxx
@@ -32,15 +32,17 @@
#include "address.hxx"
#include "filter.hxx"
#include "scdllapi.h"
+#include <map>
class ScDocument;
class ScEEParser;
class ScTabEditEngine;
class SvStream;
-class Table;
struct ScEEParseEntry;
+typedef std::map<SCROW, long> RowHeightMap;
+
class ScEEImport : public ScEEAbsImport
{
protected:
@@ -48,7 +50,7 @@ protected:
ScDocument* mpDoc;
ScEEParser* mpParser;
ScTabEditEngine* mpEngine;
- Table* mpRowHeights;
+ RowHeightMap maRowHeights;
sal_Bool GraphicSize( SCCOL nCol, SCROW nRow, SCTAB nTab,
ScEEParseEntry* );
diff --git a/sc/source/filter/inc/htmlpars.hxx b/sc/source/filter/inc/htmlpars.hxx
index b8846c46e10d..24032b3bbc4a 100644
--- a/sc/source/filter/inc/htmlpars.hxx
+++ b/sc/source/filter/inc/htmlpars.hxx
@@ -39,6 +39,7 @@
#include "rangelst.hxx"
#include "eeparser.hxx"
+#include "tools/table.hxx"
const sal_uInt32 SC_HTML_FONTSIZES = 7; // wie Export, HTML-Options
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index d34e135ef0b6..6b8df270f604 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -52,7 +52,6 @@
#include <unotools/syslocale.hxx>
#include <unotools/charclass.hxx>
#include <comphelper/string.hxx>
-#include <tools/table.hxx>
#include "eeimport.hxx"
#include "global.hxx"
@@ -79,8 +78,7 @@ extern void ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& rPage )
ScEEImport::ScEEImport( ScDocument* pDocP, const ScRange& rRange ) :
maRange( rRange ),
mpDoc( pDocP ),
- mpParser( NULL ),
- mpRowHeights( new Table )
+ mpParser( NULL )
{
const ScPatternAttr* pPattern = mpDoc->GetPattern(
maRange.aStart.Col(), maRange.aStart.Row(), maRange.aStart.Tab() );
@@ -95,7 +93,6 @@ ScEEImport::~ScEEImport()
// Reihenfolge wichtig, sonst knallt's irgendwann irgendwo in irgendeinem Dtor!
// Ist gewaehrleistet, da ScEEImport Basisklasse ist
delete mpEngine; // nach Parser!
- delete mpRowHeights;
}
@@ -458,11 +455,12 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
mpDoc->SetOptimalHeight( 0, nEndRow, 0,
static_cast< sal_uInt16 >( ScGlobal::nLastRowHeightExtra ), &aVirtDev,
nPPTX, nPPTY, aZoom, aZoom, false );
- if ( mpRowHeights->Count() )
+ if ( !maRowHeights.empty() )
{
for ( SCROW nRow = nStartRow; nRow <= nEndRow; nRow++ )
{
- sal_uInt16 nHeight = (sal_uInt16)(sal_uLong) mpRowHeights->Get( nRow );
+ RowHeightMap::const_iterator it = maRowHeights.find( nRow );
+ sal_uInt16 nHeight = it == maRowHeights.end() ? 0 : it->second;
if ( nHeight > mpDoc->GetRowHeight( nRow, nTab ) )
mpDoc->SetRowHeight( nRow, nTab, nHeight );
}
@@ -541,13 +539,11 @@ sal_Bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, SCTAB /*nTab*/, ScEEPa
nHeight = 1; // fuer eindeutigen Vergleich
for ( SCROW nR = nRow; nR < nRow + nRowSpan; nR++ )
{
- long nRowHeight = (long) mpRowHeights->Get( nR );
+ RowHeightMap::const_iterator it2 = maRowHeights.find( nR );
+ long nRowHeight = it2 == maRowHeights.end() ? 0 : it2->second;
if ( nHeight > nRowHeight )
{
- if ( nRowHeight )
- mpRowHeights->Replace( nR, (void*)nHeight );
- else
- mpRowHeights->Insert( nR, (void*)nHeight );
+ maRowHeights[ nR ] = nHeight;
}
}
return bHasGraphics;