diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-08-23 15:04:08 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-08-23 15:04:08 +0200 |
commit | 258f905e8c6b1853884f730ab0e36a544bfd7b76 (patch) | |
tree | 812254806beb1a7af7271469e7148b667b2d96de /sc/source/core/data/dptablecache.cxx | |
parent | bc212c565cdc252d2a01e5221a75868b3f01d230 (diff) |
recreated tag OOO_BUILD_3_2_98_1 which had these commits:
commit aa08e6374f2a8f11105d84c3d651696be34ef78b (tag: refs/tags/OOO_BUILD_3_2_98_1)
Author: Petr Mladek <pmladek@walk.suse.cz>
Date: Wed Sep 15 19:03:24 2010 +0200
Release ooo-build-3.2.98.1, tag OOO_BUILD_3_2_98_1 (3.3-alpha1)
commit eb4914f043304ba7d164733509794104c7ea5b33
Merge: 5ada805 0815e6f
Author: Jan Holesovsky <kendy@suse.cz>
Date: Tue Sep 7 09:33:00 2010 +0200
Merge commit 'ooo/OOO330_m6'
commit 0815e6f3086d4513fb1dfed2a0ff8e83a3589afc (tag: refs/tags/ooo/OOO330_m7, tag: refs/tags/ooo/OOO330_m6)
Merge: 51cfacc 1d0dc69
Author: Ivo Hinkelmann <ihi@openoffice.org>
Date: Thu Aug 26 13:52:56 2010 +0200
CWS-TOOLING: integrate CWS calc58
commit 51cfacc73ee6162c82dbb735448f5321a2a57269
Merge: 1f33e95 8676b47
Author: Ivo Hinkelmann <ihi@openoffice.org>
Date: Wed Aug 25 12:49:35 2010 +0200
CWS-TOOLING: integrate CWS mib18
commit 1d0dc690de7aa8ef1fd93d26578251248fd66d9a
Author: Thomas Benisch <tbe@openoffice.org>
Date: Fri Aug 20 13:23:46 2010 +0200
calc58: #i113948# office crashes after resizing chart
chart2/source/model/main/ChartModel.cxx | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
commit db48b114e54b6ceaebd4d77fbb0de1d41a0d69ca
Author: Thomas Benisch <tbe@openoffice.org>
Date: Fri Aug 20 13:03:55 2010 +0200
calc58: #i113946# undo does not work for deleting shapes
.../controller/main/ChartController_Tools.cxx | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
commit 3fa83707418cb221c94dcbe32864e5555b618159
Author: Eike Rathke [er] <eike.rathke@oracle.com>
Date: Thu Aug 19 17:12:37 2010 +0200
calc58: #i113879# add ScMatrix::CloneIfConst() and regard only temporary matrices created by the interpreter as mutable
sc/inc/scmatrix.hxx | 11 ++++++++++-
sc/source/core/tool/interpr4.cxx | 7 ++++++-
sc/source/core/tool/interpr5.cxx | 21 +++++++++++++--------
sc/source/core/tool/scmatrix.cxx | 5 +++++
4 files changed, 34 insertions(+), 10 deletions(-)
commit baac8ebc6989a5771b5d1903e5e8f4014ecafeac
Author: Eike Rathke [er] <eike.rathke@oracle.com>
Date: Wed Aug 18 18:56:10 2010 +0200
calc58: #i113739# make N return 0 for all strings again
sc/source/core/tool/interpr1.cxx | 23 +++++++----------------
sc/source/core/tool/interpr4.cxx | 6 ++++++
2 files changed, 13 insertions(+), 16 deletions(-)
commit ac9660fc7e47b2a7eecdb0c749ee46f592a70635
Author: Eike Rathke [er] <eike.rathke@oracle.com>
Date: Wed Aug 18 16:52:22 2010 +0200
calc58: #i113820# make TEXT treat string results and inline strings identical to referenced cell text
sc/source/core/tool/interpr1.cxx | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
commit 8676b47d16a1670a4d6ebbc610e8a00abd2367f7
Merge: 6423ab8 1f33e95
Author: Daniel Rentz <dr@openoffice.org>
Date: Fri Aug 13 11:29:46 2010 +0200
mib18: rebase to OOO330m4
commit 6423ab81e71f7090d61e81b8992878ce7de43f27
Merge: 6e0de89 772dd5e
Author: Andreas Bregas <ab@openoffice.org>
Date: Wed Aug 11 08:28:57 2010 +0200
mib18: Merge
commit 772dd5e59b0b28c3e24cac6ae52ea0141b39c240
Author: Daniel Rentz <dr@openoffice.org>
Date: Tue Aug 10 20:18:10 2010 +0200
mib18: adjusted service name to match VBA symbol
sc/source/ui/vba/vbaglobals.cxx | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
commit 9725c306fd4502fc6de7d4acf5c302427310a20d
Author: Michael E. Bohn <mbn@openoffice.org>
Date: Tue Aug 10 18:14:58 2010 +0200
mib18: #163259# implementation of global symbol Excel
sc/source/ui/vba/vbaglobals.cxx | 9 +++++++++
sc/source/ui/vba/vbaglobals.hxx | 1 +
2 files changed, 10 insertions(+), 0 deletions(-)
commit ff7c55aff1293fb51c8ab268d0f478480b0c5685
Merge: 80722e0 6e0de89
Author: Michael E. Bohn <mbn@openoffice.org>
Date: Tue Aug 10 16:57:47 2010 +0200
heads merged
commit 80722e0f75ad7d3204f39a580df2f48412e001c3
Author: Michael E. Bohn <mbn@openoffice.org>
Date: Tue Aug 10 16:55:52 2010 +0200
mib18: #163120# adding the entrypoint for symbol Debug
sc/source/ui/vba/vbaglobals.cxx | 19 +++++++++++++++++++
sc/source/ui/vba/vbaglobals.hxx | 2 +-
2 files changed, 20 insertions(+), 1 deletions(-)
commit 6e0de8945fbfbee500e0fc9bfa26aaa67abeafa4
Author: Daniel Rentz <dr@openoffice.org>
Date: Tue Aug 10 11:52:54 2010 +0200
mib18: #163243# enable regular expressions in VBA symbol Range.Find
sc/source/ui/vba/vbarange.cxx | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
commit d0093c4e1b54648d1e09c16b389519fdf2564f6e
Author: Daniel Rentz <dr@openoffice.org>
Date: Tue Aug 10 10:27:30 2010 +0200
mib18: #163246# add VBA symbol Worksheet.ProtectScenarios
sc/source/ui/vba/vbaworksheet.cxx | 10 ++++++++--
sc/source/ui/vba/vbaworksheet.hxx | 1 +
2 files changed, 9 insertions(+), 2 deletions(-)
commit b9876f93ddc6eaa0e5cf4aaf62cd19d3a08776c4
Author: Michael E. Bohn <mbn@openoffice.org>
Date: Tue Aug 10 06:57:53 2010 +0200
mib18: #163148# creation og basic modules in library Standard during Workbooks.add
sc/source/ui/vba/vbaworkbooks.cxx | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
commit 80e4fe02a80b90182180c409d2f4f803562e02b8
Merge: 36f7091 81cec49
Author: Andreas Bregas <ab@openoffice.org>
Date: Fri Aug 6 09:39:35 2010 +0200
mib18: Merge
commit 81cec496df67c85bb1b64ef7d15c9f73987882a0
Author: Daniel Rentz <dr@openoffice.org>
Date: Thu Aug 5 15:43:06 2010 +0200
mib18: #162503# do not create a new Worksheet object in Workbook.ActiveSheet but return existing object supporting VBA module access
sc/source/ui/vba/vbaworkbook.cxx | 19 +++++++++++--------
sc/source/ui/vba/vbaworksheets.cxx | 2 +-
2 files changed, 12 insertions(+), 9 deletions(-)
commit 36f709143ffc8056ece58e93e155a6dab9831cd9
Author: Daniel Rentz <dr@openoffice.org>
Date: Wed Aug 4 18:13:02 2010 +0200
mib18: #162938# add VBA symbol Worksheet.AutoFilterMode
sc/source/ui/vba/vbaworksheet.cxx | 37 ++++++++++++++++++++++++++++++++++++-
sc/source/ui/vba/vbaworksheet.hxx | 5 +++++
2 files changed, 41 insertions(+), 1 deletions(-)
commit c650f967f769e4da07f669f60e1f7a636d7e9614
Author: Daniel Rentz <dr@openoffice.org>
Date: Wed Aug 4 16:00:21 2010 +0200
mib18: #163200# full rework of VBA symbols Application.Intersect and Application.Union
sc/source/ui/vba/makefile.mk | 92 +++---
sc/source/ui/vba/vbaapplication.cxx | 599 ++++++++++++++---------------------
2 files changed, 281 insertions(+), 410 deletions(-)
commit 5fa3d6e55b2ab5aac185c10293f8c6a1b7264e63
Author: Daniel Rentz <dr@openoffice.org>
Date: Wed Aug 4 09:59:00 2010 +0200
mib18: #163198# VBA Names collection must return VBA Name objects
sc/source/ui/vba/vbanames.cxx | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
commit 783c57ec2174b11b06ec29ecb1ae6b9b87996bf6
Author: Daniel Rentz <dr@openoffice.org>
Date: Wed Aug 4 09:58:00 2010 +0200
mib18: #163195# set correct parent for range returned by VBA ActiveCell symbol
sc/source/ui/vba/vbaapplication.cxx | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
commit 32876274fc8fae906bdb52e76059ddedadfa8572
Author: Daniel Rentz <dr@openoffice.org>
Date: Wed Aug 4 09:56:54 2010 +0200
mib18: #162937# extract all integer and floating values from an 'Any' for Boolean parameters
sc/source/ui/vba/vbarange.cxx | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
commit faa445a0730322e8522999ffb30fdde97bb9b9b9
Author: Daniel Rentz <dr@openoffice.org>
Date: Wed Aug 4 09:54:13 2010 +0200
mib18: #162039# clear covered cells when merging via VBA MergeCells symbol
sc/source/ui/vba/vbarange.cxx | 27 ++++++++++++++++++++++++---
1 files changed, 24 insertions(+), 3 deletions(-)
Notes
Notes:
split repo tag: calc_OOO_BUILD_3_2_98_1
Diffstat (limited to 'sc/source/core/data/dptablecache.cxx')
-rwxr-xr-x | sc/source/core/data/dptablecache.cxx | 180 |
1 files changed, 90 insertions, 90 deletions
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx index 8f25b70e41b6..f350e86496a0 100755 --- a/sc/source/core/data/dptablecache.cxx +++ b/sc/source/core/data/dptablecache.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright IBM Corporation 2009. * Copyright 2009 by Sun Microsystems, Inc. * @@ -57,7 +57,7 @@ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::UNO_QUERY_THROW; // ----------------------------------------------------------------------- -namespace +namespace { BOOL lcl_isDate( ULONG nNumType ) { @@ -91,7 +91,7 @@ namespace rIndex = nLo; return bFound; } - + ScDPItemData* lcl_GetItemValue(const Reference<sdbc::XRow>& xRow, sal_Int32 nType, long nCol, const Date& rNullDate ) { @@ -106,7 +106,7 @@ namespace case sdbc::DataType::BOOLEAN: { nNumType = NUMBERFORMAT_LOGICAL; - fValue = xRow->getBoolean(nCol) ? 1 : 0; + fValue = xRow->getBoolean(nCol) ? 1 : 0; return new ScDPItemData( rStr, fValue,TRUE,nNumType); } //break; @@ -186,7 +186,7 @@ namespace ScDPItemData::ScDPItemData( const String& rS, double fV/* = 0.0*/, BOOL bHV/* = FALSE*/, const ULONG nNumFormatP /*= 0*/ , BOOL bData/* = TRUE*/) : nNumFormat( nNumFormatP ), aString(rS), fValue(fV), mbFlag( (MK_VAL*!!bHV) | (MK_DATA*!!bData) | (MK_ERR*!!FALSE) | (MK_DATE*!!lcl_isDate( nNumFormat ) ) ) -{ +{ } ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nDocTab ): @@ -194,9 +194,9 @@ ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nD { String aDocStr; pDoc->GetString( nCol, nRow, nDocTab, aDocStr ); - + SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); - + ScAddress aPos( nCol, nRow, nDocTab ); ScBaseCell* pCell = pDoc->GetCell( aPos ); @@ -223,7 +223,7 @@ ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nD BOOL ScDPItemData::IsCaseInsEqual( const ScDPItemData& r ) const { //TODO: indified Date? //! pass Transliteration? - //! inline? + //! inline? return IsValue() ? ( r.IsValue() && rtl::math::approxEqual( fValue, r.fValue ) ) : ( !r.IsValue() && ScGlobal::GetpTransliteration()->isEqual( aString, r.aString ) ); @@ -251,7 +251,7 @@ BOOL ScDPItemData::operator==( const ScDPItemData& r ) const // Identify date if ( IsDate() != r.IsDate() ) return FALSE; - else + else if ( r.IsValue() ) return rtl::math::approxEqual( fValue, r.fValue ); else @@ -299,7 +299,7 @@ sal_Int32 ScDPItemData::Compare( const ScDPItemData& rA, // //Wang Xu Ming SODC_17561 #ifdef DEBUG -void ScDPItemData::dump() const +void ScDPItemData::dump() const { DBG_TRACE1( "Numberformat= %o", nNumFormat ); DBG_TRACESTR(aString ); @@ -319,64 +319,64 @@ TypedStrData* ScDPItemData::CreateTypeString( ) sal_uInt8 ScDPItemData::GetType() const { - + if ( IsHasErr() ) return SC_VALTYPE_ERROR; else if ( !IsHasData() ) return SC_VALTYPE_EMPTY; else if ( IsValue()) return SC_VALTYPE_VALUE; - else + else return SC_VALTYPE_STRING; } -BOOL ScDPItemData::IsHasData() const +BOOL ScDPItemData::IsHasData() const { return !!(mbFlag&MK_DATA); } -BOOL ScDPItemData::IsHasErr() const -{ - return !!(mbFlag&MK_ERR); +BOOL ScDPItemData::IsHasErr() const +{ + return !!(mbFlag&MK_ERR); } -BOOL ScDPItemData::IsValue() const -{ +BOOL ScDPItemData::IsValue() const +{ return !!(mbFlag&MK_VAL); } -String ScDPItemData::GetString() const -{ +String ScDPItemData::GetString() const +{ return aString; } -double ScDPItemData::GetValue() const -{ +double ScDPItemData::GetValue() const +{ return fValue; } -ULONG ScDPItemData::GetNumFormat() const -{ +ULONG ScDPItemData::GetNumFormat() const +{ return nNumFormat; } -BOOL ScDPItemData::HasStringData() const +BOOL ScDPItemData::HasStringData() const -{ +{ return IsHasData()&&!IsHasErr()&&!IsValue(); } BOOL ScDPItemData::IsDate() const -{ - return !!(mbFlag&MK_DATE); +{ + return !!(mbFlag&MK_DATE); } BOOL ScDPItemData::HasDatePart() const { - return !!(mbFlag&MK_DATEPART); + return !!(mbFlag&MK_DATEPART); } -void ScDPItemData::SetDate( BOOL b ) +void ScDPItemData::SetDate( BOOL b ) { - b ? ( mbFlag |= MK_DATE ) : ( mbFlag &= ~MK_DATE ); + b ? ( mbFlag |= MK_DATE ) : ( mbFlag &= ~MK_DATE ); } // ----------------------------------------------------------------------- @@ -388,7 +388,7 @@ BOOL ScDPTableDataCache::operator== ( const ScDPTableDataCache& r ) const if ( GetColumnCount() == r.GetColumnCount() ) { for ( SCCOL i = 0 ; i < GetColumnCount(); i++ ) - { //check dim names + { //check dim names if ( GetDimensionName( i ) != r.GetDimensionName( i ) ) return FALSE; //check rows count @@ -402,12 +402,12 @@ BOOL ScDPTableDataCache::operator== ( const ScDPTableDataCache& r ) const { if ( *( GetDimMemberValues( i )[j] ) == *( r.GetDimMemberValues( i )[j] ) ) continue; - else + else return FALSE; } } - else - return FALSE; + else + return FALSE; //check source table index for ( SCROW k=0 ; k < GetRowCount(); k ++ ) { @@ -415,7 +415,7 @@ BOOL ScDPTableDataCache::operator== ( const ScDPTableDataCache& r ) const continue; else return FALSE; - } + } } } return TRUE; @@ -444,7 +444,7 @@ ScDPTableDataCache::~ScDPTableDataCache() for ( ULONG row = 0 ; row < mpTableDataValues[nCol].size(); row++ ) delete mpTableDataValues[nCol][row]; } - for ( nCol =0; nCol < mrLabelNames.size(); nCol++ ) + for ( nCol =0; nCol < mrLabelNames.size(); nCol++ ) delete mrLabelNames[nCol]; // End Comments @@ -462,15 +462,15 @@ ScDPTableDataCache::~ScDPTableDataCache() // ----------------------------------------------------------------------- void ScDPTableDataCache::AddRow( ScDPItemData* pRow, USHORT nCount ) -{ +{ DBG_ASSERT( pRow , " empty pointer" ); if ( !mrLabelNames.size() ) { mnColumnCount= nCount; mpTableDataValues = new std::vector<ScDPItemData*>[ mnColumnCount ]; - mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; - mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; - mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; + mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; for ( USHORT i = 0; i < nCount ; i ++ ) AddLabel( new ScDPItemData( pRow[i] ) ); @@ -492,10 +492,10 @@ bool ScDPTableDataCache::IsValid() const namespace { -/** - * While the macro interpret level is incremented, the formula cells are - * (semi-)guaranteed to be interpreted. - */ +/** + * While the macro interpret level is incremented, the formula cells are + * (semi-)guaranteed to be interpreted. + */ class MacroInterpretIncrementer { public: @@ -517,20 +517,20 @@ private: // ----------------------------------------------------------------------- bool ScDPTableDataCache::InitFromDoc( ScDocument* pDoc, const ScRange& rRange ) { - // Make sure the formula cells within the data range are interpreted + // Make sure the formula cells within the data range are interpreted // during this call, for this method may be called from the interpretation // of GETPIVOTDATA, which disables nested formula interpretation without // increasing the macro level. MacroInterpretIncrementer aMacroInc(pDoc); // - SCROW nStartRow = rRange.aStart.Row(); // start of data + SCROW nStartRow = rRange.aStart.Row(); // start of data SCROW nEndRow = rRange.aEnd.Row(); USHORT nStartCol = rRange.aStart.Col(); USHORT nEndCol = rRange.aEnd.Col(); USHORT nDocTab = rRange.aStart.Tab(); - - //init + + //init long nOldColumCount = mnColumnCount; mnColumnCount = nEndCol - nStartCol + 1; if ( IsValid() ) @@ -547,11 +547,11 @@ bool ScDPTableDataCache::InitFromDoc( ScDocument* pDoc, const ScRange& rRange ) delete [] mpIndexOrder; mrLabelNames.clear(); } - + mpTableDataValues = new std::vector<ScDPItemData*>[ mnColumnCount ]; - mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; - mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; - mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; + mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; //check valid for ( SCROW nRow = nStartRow; nRow <= nEndRow; nRow ++ ) { @@ -598,9 +598,9 @@ bool ScDPTableDataCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowS // Get column titles and types. mrLabelNames.reserve(mnColumnCount); mpTableDataValues = new std::vector<ScDPItemData*>[ mnColumnCount ]; - mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; - mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; - mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; + mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; std::vector<sal_Int32> aColTypes(mnColumnCount); @@ -615,7 +615,7 @@ bool ScDPTableDataCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowS Reference<sdbc::XRow> xRow(xRowSet, UNO_QUERY_THROW); xRowSet->first(); do - { + { for (sal_Int32 nCol = 0; nCol < mnColumnCount; ++nCol) { ScDPItemData * pNew = lcl_GetItemValue( xRow, aColTypes[nCol], nCol+1, rNullDate ); @@ -646,12 +646,12 @@ ULONG ScDPTableDataCache::GetDimNumType( SCCOL nDim) const } // ----------------------------------------------------------------------- -bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOOL *pSpecial) +bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOOL *pSpecial) { //Copied and modified from ScTable::ValidQuery if (!rParam.GetEntry(0).bDoQuery) return TRUE; - BOOL bMatchWholeCell = mpDoc->GetDocOptions().IsMatchWholeCell(); - + BOOL bMatchWholeCell = mpDoc->GetDocOptions().IsMatchWholeCell(); + //--------------------------------------------------------------- const SCSIZE nFixedBools = 32; @@ -661,8 +661,8 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO BOOL* pPasst = ( nEntryCount <= nFixedBools ? &aBool[0] : new BOOL[nEntryCount] ); BOOL* pTest = ( nEntryCount <= nFixedBools ? &aTest[0] : new BOOL[nEntryCount] ); - long nPos = -1; - SCSIZE i = 0; + long nPos = -1; + SCSIZE i = 0; CollatorWrapper* pCollator = (rParam.bCaseSens ? ScGlobal::GetCaseCollator() : ScGlobal::GetCollator() ); ::utl::TransliterationWrapper* pTransliteration = (rParam.bCaseSens ? @@ -672,8 +672,8 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO { ScQueryEntry& rEntry = rParam.GetEntry(i); // we can only handle one single direct query - SCROW nId = GetItemDataId( (SCCOL)rEntry.nField, nRow, FALSE ); - const ScDPItemData* pCellData = GetItemDataById( (SCCOL)rEntry.nField, nId); + SCROW nId = GetItemDataId( (SCCOL)rEntry.nField, nRow, FALSE ); + const ScDPItemData* pCellData = GetItemDataById( (SCCOL)rEntry.nField, nId); BOOL bOk = FALSE; BOOL bTestEqual = FALSE; @@ -686,9 +686,9 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO bOk = pCellData->IsHasData(); } else if ( !rEntry.bQueryByString && pCellData->IsValue() ) - { // by Value + { // by Value double nCellVal = pCellData->GetValue(); - + switch (rEntry.eOp) { case SC_EQUAL : @@ -718,8 +718,8 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO || (rEntry.bQueryByString && pCellData->HasStringData() ) ) - { // by String - String aCellStr = pCellData->GetString(); + { // by String + String aCellStr = pCellData->GetString(); BOOL bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL) || (rEntry.eOp == SC_NOT_EQUAL))); @@ -859,7 +859,7 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO // ----------------------------------------------------------------------- bool ScDPTableDataCache::IsRowEmpty( SCROW nRow ) const { - return mbEmptyRow[ nRow ]; + return mbEmptyRow[ nRow ]; } @@ -873,10 +873,10 @@ BOOL ScDPTableDataCache::AddData(long nDim, ScDPItemData* pitemData) { DBG_ASSERT( IsValid(), " IsValid() == false " ); DBG_ASSERT( nDim < mnColumnCount && nDim >=0 , "dimension out of bound" ); - SCROW nIndex = 0; - - BOOL bInserted = FALSE; + SCROW nIndex = 0; + BOOL bInserted = FALSE; + pitemData->SetDate( lcl_isDate( GetNumType( pitemData->nNumFormat ) ) ); if ( !lcl_Search( mpTableDataValues[nDim], mpGlobalOrder[nDim], *pitemData, nIndex ) ) @@ -898,7 +898,7 @@ BOOL ScDPTableDataCache::AddData(long nDim, ScDPItemData* pitemData) if ( pitemData->IsHasData() ) mbEmptyRow[ nCurRow ] = FALSE; - if ( !bInserted ) + if ( !bInserted ) delete pitemData; return TRUE; @@ -910,7 +910,7 @@ String ScDPTableDataCache::GetDimensionName( USHORT nColumn ) const DBG_ASSERT( /* nColumn>=0 && */ nColumn < mrLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName"); DBG_ASSERT( mrLabelNames.size() == static_cast <USHORT> (mnColumnCount+1), "ScDPTableDataCache::GetDimensionName"); if ( static_cast<size_t>(nColumn+1) < mrLabelNames.size() ) - { + { return mrLabelNames[nColumn+1]->aString; } else @@ -918,11 +918,11 @@ String ScDPTableDataCache::GetDimensionName( USHORT nColumn ) const } void ScDPTableDataCache::AddLabel(ScDPItemData *pData) -{ +{ DBG_ASSERT( IsValid(), " IsValid() == false " ); if ( mrLabelNames.size() == 0 ) - mrLabelNames.push_back( new ScDPItemData( ScGlobal::GetRscString(STR_PIVOT_DATA) ) ); + mrLabelNames.push_back( new ScDPItemData( ScGlobal::GetRscString(STR_PIVOT_DATA) ) ); //reset name if needed @@ -946,7 +946,7 @@ void ScDPTableDataCache::AddLabel(ScDPItemData *pData) while ( !bFound ); pData->aString = strNewName; - mrLabelNames.push_back( pData ); + mrLabelNames.push_back( pData ); } SCROW ScDPTableDataCache::GetItemDataId(USHORT nDim, SCROW nRow, BOOL bRepeatIfEmpty) const @@ -955,7 +955,7 @@ SCROW ScDPTableDataCache::GetItemDataId(USHORT nDim, SCROW nRow, BOOL bRepeatIfE DBG_ASSERT( /* nDim >= 0 && */ nDim < mnColumnCount, "ScDPTableDataCache::GetItemDataId " ); if ( bRepeatIfEmpty ) - { + { while ( nRow >0 && !mpTableDataValues[nDim][ mpSourceData[nDim][nRow] ]->IsHasData() ) --nRow; } @@ -993,7 +993,7 @@ SCROW ScDPTableDataCache::GetSortedItemDataId(SCCOL nDim, SCROW nOrder) const DBG_ASSERT ( IsValid(), "IsValid"); DBG_ASSERT( nDim>=0 && nDim < mnColumnCount, "nDim < mnColumnCount"); DBG_ASSERT( nOrder >= 0 && (size_t) nOrder < mpGlobalOrder[nDim].size(), "nOrder < mpGlobalOrder[nDim].size()" ); - + return mpGlobalOrder[nDim][nOrder]; } @@ -1016,7 +1016,7 @@ ULONG ScDPTableDataCache::GetNumberFormat( long nDim ) const return mpTableDataValues[nDim][0]->nNumFormat; } -BOOL ScDPTableDataCache::IsDateDimension( long nDim ) const +BOOL ScDPTableDataCache::IsDateDimension( long nDim ) const { if ( nDim >= mnColumnCount ) return false; @@ -1050,7 +1050,7 @@ SCCOL ScDPTableDataCache::GetDimensionIndex(String sName) const } SCROW ScDPTableDataCache::GetIdByItemData(long nDim, String sItemData ) const -{ +{ if ( nDim < mnColumnCount && nDim >=0 ) { for ( size_t n = 0; n< mpTableDataValues[nDim].size(); n++ ) @@ -1059,13 +1059,13 @@ SCROW ScDPTableDataCache::GetIdByItemData(long nDim, String sItemData ) const return n; } } - + ScDPItemData rData ( sItemData ); return GetRowCount() +maAdditionalDatas.getDataId(rData); } SCROW ScDPTableDataCache::GetIdByItemData( long nDim, const ScDPItemData& rData ) const -{ +{ if ( nDim < mnColumnCount && nDim >=0 ) { for ( size_t n = 0; n< mpTableDataValues[nDim].size(); n++ ) @@ -1087,7 +1087,7 @@ SCROW ScDPTableDataCache::GetAdditionalItemID( const ScDPItemData& rData ) { return GetRowCount() + maAdditionalDatas.insertData( rData ); } - + SCROW ScDPTableDataCache::GetOrder(long nDim, SCROW nIndex) const { @@ -1111,15 +1111,15 @@ SCROW ScDPTableDataCache::GetOrder(long nDim, SCROW nIndex) const ScDocument* ScDPTableDataCache::GetDoc() const { - return mpDoc; + return mpDoc; }; -long ScDPTableDataCache::GetColumnCount() const +long ScDPTableDataCache::GetColumnCount() const { - return mnColumnCount; + return mnColumnCount; } -long ScDPTableDataCache::GetId() const +long ScDPTableDataCache::GetId() const { - return mnID; + return mnID; } - + |