[Libreoffice-commits] .: 2 commits - sc/inc sc/source
Joseph Powers
jpowers at kemper.freedesktop.org
Wed Dec 1 20:08:03 PST 2010
sc/inc/document.hxx | 44 +++++++++++++--------------
sc/inc/tabopparams.hxx | 11 +-----
sc/source/core/data/cell.cxx | 2 -
sc/source/core/data/documen2.cxx | 12 +++----
sc/source/core/data/document.cxx | 14 +++-----
sc/source/core/tool/interpr4.cxx | 35 +++++++--------------
sc/source/filter/xcl97/XclExpChangeTrack.cxx | 38 ++++++++++++-----------
7 files changed, 69 insertions(+), 87 deletions(-)
New commits:
commit 95b419dfeea83549ed021d9b1ccc0da0649779ab
Author: Joseph Powers <jpowers27 at cox.net>
Date: Wed Dec 1 19:34:58 2010 -0800
Remove DECLARE_LIST() from class ScDocument
The list wasn't needed. You could only have 1 item in the list at any one
time; so, I just replaced it with a pointer.
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 719aa5e..7b7785a 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -140,7 +140,7 @@ class ScLookupCache;
struct ScLookupCacheMapImpl;
class SfxUndoManager;
class ScFormulaParserPool;
-struct ScClipParam;
+struct ScClipParam;
struct ScClipRangeNameData;
class ScRowBreakIterator;
struct ScSetStringParam;
@@ -315,7 +315,7 @@ private:
mxVbaEvents;
public:
- ScTabOpList aTableOpList; // list of ScInterpreterTableOpParams currently in use
+ ScInterpreterTableOpParams* aTableOpList; // ScInterpreterTableOpParams currently in use
ScInterpreterTableOpParams aLastTableOpParams; // remember last params
private:
@@ -492,7 +492,7 @@ public:
// Wang Xu Ming -- 2009-8-17
// DataPilot Migration - Cache&&Performance
SC_DLLPUBLIC ScDPTableDataCache* GetDPObjectCache( long nID );
- SC_DLLPUBLIC ScDPTableDataCache* GetUsedDPObjectCache ( ScRange rRange );
+ SC_DLLPUBLIC ScDPTableDataCache* GetUsedDPObjectCache ( ScRange rRange );
SC_DLLPUBLIC long AddDPObjectCache( ScDPTableDataCache* pData );
SC_DLLPUBLIC void RemoveDPObjectCache( long nID );
SC_DLLPUBLIC void RemoveUnusedDPObjectCaches();
@@ -747,7 +747,7 @@ public:
ULONG nFormatIndex, BOOL bForceTab = FALSE);
// return TRUE = Zahlformat gesetzt
SC_DLLPUBLIC BOOL SetString(
- SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
+ SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
ScSetStringParam* pParam = NULL );
SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError);
@@ -891,12 +891,12 @@ public:
BOOL IsForcedFormulaPending() const { return bForcedFormulaPending; }
// if CalcFormulaTree() is currently running
BOOL IsCalculatingFormulaTree() { return bCalculatingFormulaTree; }
-
+
USHORT GetErrCode( const ScAddress& ) const;
/** Shrink a range to only include data area.
- This is not the actually used area within the
- selection, but the bounds of the sheet's data area
+ This is not the actually used area within the
+ selection, but the bounds of the sheet's data area
instead. */
bool ShrinkToDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow ) const;
@@ -918,10 +918,10 @@ public:
SC_DLLPUBLIC BOOL GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) const;
- /**
- * Find the maximum column position that contains printable data for the
- * specified row range. The final column position must be equal or less
- * than the initial value of rEndCol.
+ /**
+ * Find the maximum column position that contains printable data for the
+ * specified row range. The final column position must be equal or less
+ * than the initial value of rEndCol.
*/
void ExtendPrintArea( OutputDevice* pDev, SCTAB nTab,
SCCOL nStartCol, SCROW nStartRow,
@@ -1007,7 +1007,7 @@ public:
SCTAB nTab, USHORT nDelFlag);
void DeleteAreaTab(const ScRange& rRange, USHORT nDelFlag);
- void CopyToClip(const ScClipParam& rClipParam, ScDocument* pClipDoc,
+ void CopyToClip(const ScClipParam& rClipParam, ScDocument* pClipDoc,
const ScMarkData* pMarks = NULL, bool bAllTabs = false, bool bKeepScenarioFlags = false,
bool bIncludeObjects = false, bool bCloneNoteCaptions = true);
@@ -1041,8 +1041,8 @@ public:
BOOL bSkipAttrForEmpty = FALSE,
const ScRangeList * pDestRanges = NULL );
- void CopyMultiRangeFromClip(const ScAddress& rDestPos, const ScMarkData& rMark,
- sal_uInt16 nInsFlag, ScDocument* pClipDoc,
+ void CopyMultiRangeFromClip(const ScAddress& rDestPos, const ScMarkData& rMark,
+ sal_uInt16 nInsFlag, ScDocument* pClipDoc,
bool bResetCut = true, bool bAsLink = false,
bool bIncludeFiltered = true,
bool bSkipAttrForEmpty = false);
@@ -1348,10 +1348,10 @@ public:
SCROW LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
SCROW CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
- /**
- * Write all column row flags to table's flag data, because not all column
- * row attributes are stored in the flag data members. This is necessary
- * for ods export.
+ /**
+ * Write all column row flags to table's flag data, because not all column
+ * row attributes are stored in the flag data members. This is necessary
+ * for ods export.
*/
void SyncColRowFlags();
@@ -1799,9 +1799,9 @@ public:
private: // CLOOK-Impl-Methoden
- /**
- * Use this class as a locale variable to merge number formatter from
- * another document, and set NULL pointer to pFormatExchangeList when
+ /**
+ * Use this class as a locale variable to merge number formatter from
+ * another document, and set NULL pointer to pFormatExchangeList when
* done.
*/
class NumFmtMergeHandler
diff --git a/sc/inc/tabopparams.hxx b/sc/inc/tabopparams.hxx
index 875aad8..b4a3d29 100644
--- a/sc/inc/tabopparams.hxx
+++ b/sc/inc/tabopparams.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -62,7 +62,6 @@ struct ScInterpreterTableOpParams
, aOld2( r.aOld2 )
, aNew2( r.aNew2 )
, aFormulaPos( r.aFormulaPos )
- //! never copied! , aNotifiedFormulaCells( r.aNotifiedFormulaCells )
, aNotifiedFormulaPos( r.aNotifiedFormulaPos )
, bValid( r.bValid )
, bRefresh( r.bRefresh )
@@ -77,8 +76,6 @@ struct ScInterpreterTableOpParams
aOld2 = r.aOld2;
aNew2 = r.aNew2;
aFormulaPos = r.aFormulaPos;
- //! never copied! aNotifiedFormulaCells = r.aNotifiedFormulaCells;
- //! instead, empty anything eventually present
::std::vector< ScFormulaCell* >().swap( aNotifiedFormulaCells );
aNotifiedFormulaPos = r.aNotifiedFormulaPos;
bValid = r.bValid;
@@ -94,13 +91,9 @@ struct ScInterpreterTableOpParams
aOld1 == r.aOld1 &&
aOld2 == r.aOld2 &&
aFormulaPos == r.aFormulaPos ;
- // aNotifiedFormula(Cells|Pos), aNew1, aNew2, bRefresh,
- // bCollectNotifications are not compared
}
};
-DECLARE_LIST( ScTabOpList, ScInterpreterTableOpParams* )
-
-#endif // SC_TABOPPARAMS_HXX
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index d437593..7405666 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index f1c91d3..ee69f31 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -129,6 +129,7 @@ ScDocument::ScDocument( ScDocumentMode eMode,
SfxObjectShell* pDocShell ) :
xServiceManager( ::comphelper::getProcessServiceFactory() ),
mpUndoManager( NULL ),
+ aTableOpList( NULL ),
pEditEngine( NULL ),
pNoteEngine( NULL ),
pNoteItemPool( NULL ),
@@ -190,7 +191,6 @@ ScDocument::ScDocument( ScDocumentMode eMode,
bIsUndo( eMode == SCDOCMODE_UNDO ),
bIsVisible( FALSE ),
bIsEmbedded( FALSE ),
-// bNoSetDirty( TRUE ),
bNoSetDirty( FALSE ),
bInsertingFromOtherDoc( FALSE ),
bLoadingMedium( false ),
@@ -267,12 +267,12 @@ ScDocument::ScDocument( ScDocumentMode eMode,
}
sfx2::LinkManager* ScDocument::GetLinkManager() const
-{
+{
if ( bAutoCalc && !pLinkManager && pShell)
{
pLinkManager = new sfx2::LinkManager( pShell );
}
- return pLinkManager;
+ return pLinkManager;
}
@@ -1095,7 +1095,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
aLibName = pSrcShell->GetBasicManager()->GetName();
pStarBASIC = pSrcShell->GetBasicManager()->GetLib( aLibName );
}
-
+
String sCodeName;
String sSource;
uno::Reference< script::XLibraryContainer > xLibContainer = pSrcShell->GetBasicContainer();
@@ -1113,7 +1113,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
rtl::OUString sRTLSource;
xLib->getByName( sSrcCodeName ) >>= sRTLSource;
sSource = sRTLSource;
- }
+ }
VBA_InsertModule( *this, nDestPos, sCodeName, sSource );
}
}
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 36ba363..a4df4d0 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -2737,7 +2737,7 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceT
}
-BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
+BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
ScSetStringParam* pParam )
{
if ( ValidTab(nTab) && pTab[nTab] )
@@ -3081,10 +3081,9 @@ void ScDocument::InterpretDirtyCells( const ScRangeList& rRanges )
}
}
-
void ScDocument::AddTableOpFormulaCell( ScFormulaCell* pCell )
{
- ScInterpreterTableOpParams* p = aTableOpList.Last();
+ ScInterpreterTableOpParams* p = aTableOpList;
if ( p && p->bCollectNotifications )
{
if ( p->bRefresh )
@@ -3099,7 +3098,6 @@ void ScDocument::AddTableOpFormulaCell( ScFormulaCell* pCell )
}
}
-
void ScDocument::CalcAll()
{
ClearLookupCaches(); // Ensure we don't deliver zombie data.
@@ -3619,7 +3617,7 @@ bool ScDocument::RowHidden(SCROW nRow, SCTAB nTab, SCROW& rLastRow)
{
if (!ValidTab(nTab) || !pTab[nTab])
{
- rLastRow = nRow;
+ rLastRow = nRow;
return false;
}
@@ -3639,7 +3637,7 @@ bool ScDocument::ColHidden(SCCOL nCol, SCTAB nTab, SCCOL& rLastCol)
{
if (!ValidTab(nTab) || !pTab[nTab])
{
- rLastCol = nCol;
+ rLastCol = nCol;
return false;
}
@@ -3819,7 +3817,7 @@ SCCOL ScDocument::GetNextDifferentChangedCol( SCTAB nTab, SCCOL nStart) const
SCROW ScDocument::GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart, bool bCareManualSize) const
{
const ScBitMaskCompressedArray< SCROW, BYTE> * pRowFlagsArray;
- if ( ValidTab(nTab) && pTab[nTab] && ((pRowFlagsArray = pTab[nTab]->GetRowFlagsArray()) != NULL) &&
+ if ( ValidTab(nTab) && pTab[nTab] && ((pRowFlagsArray = pTab[nTab]->GetRowFlagsArray()) != NULL) &&
pTab[nTab]->mpRowHeights && pTab[nTab]->mpHiddenRows )
{
size_t nIndex; // ignored
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 7b8f0e8..84e4986 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -97,25 +97,20 @@ using ::std::auto_ptr;
// Funktionen fuer den Zugriff auf das Document
//-------------------------------------------------------------------------
-
void ScInterpreter::ReplaceCell( ScAddress& rPos )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ReplaceCell" );
- ScInterpreterTableOpParams* pTOp = pDok->aTableOpList.First();
- while (pTOp)
+ ScInterpreterTableOpParams* pTOp = pDok->aTableOpList;
+ if ( pTOp )
{
if ( rPos == pTOp->aOld1 )
{
rPos = pTOp->aNew1;
- return ;
}
else if ( rPos == pTOp->aOld2 )
{
rPos = pTOp->aNew2;
- return ;
}
- else
- pTOp = pDok->aTableOpList.Next();
}
}
@@ -124,29 +119,24 @@ void ScInterpreter::ReplaceCell( SCCOL& rCol, SCROW& rRow, SCTAB& rTab )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ReplaceCell" );
ScAddress aCellPos( rCol, rRow, rTab );
- ScInterpreterTableOpParams* pTOp = pDok->aTableOpList.First();
- while (pTOp)
+ ScInterpreterTableOpParams* pTOp = pDok->aTableOpList;
+ if ( pTOp )
{
if ( aCellPos == pTOp->aOld1 )
{
rCol = pTOp->aNew1.Col();
rRow = pTOp->aNew1.Row();
rTab = pTOp->aNew1.Tab();
- return ;
}
else if ( aCellPos == pTOp->aOld2 )
{
rCol = pTOp->aNew2.Col();
rRow = pTOp->aNew2.Row();
rTab = pTOp->aNew2.Tab();
- return ;
}
- else
- pTOp = pDok->aTableOpList.Next();
}
}
-
BOOL ScInterpreter::IsTableOpInRange( const ScRange& rRange )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::IsTableOpInRange" );
@@ -154,14 +144,13 @@ BOOL ScInterpreter::IsTableOpInRange( const ScRange& rRange )
return FALSE; // not considered to be a range in TableOp sense
// we can't replace a single cell in a range
- ScInterpreterTableOpParams* pTOp = pDok->aTableOpList.First();
- while (pTOp)
+ ScInterpreterTableOpParams* pTOp = pDok->aTableOpList;
+ if ( pTOp )
{
if ( rRange.In( pTOp->aOld1 ) )
return TRUE;
if ( rRange.In( pTOp->aOld2 ) )
return TRUE;
- pTOp = pDok->aTableOpList.Next();
}
return FALSE;
}
@@ -1183,7 +1172,7 @@ void ScInterpreter::PopSingleRef(SCCOL& rCol, SCROW &rRow, SCTAB& rTab)
break;
case svSingleRef:
SingleRefToVars( static_cast<ScToken*>(p)->GetSingleRef(), rCol, rRow, rTab);
- if ( pDok->aTableOpList.Count() > 0 )
+ if ( pDok->aTableOpList )
ReplaceCell( rCol, rRow, rTab );
break;
default:
@@ -1214,7 +1203,7 @@ void ScInterpreter::PopSingleRef( ScAddress& rAdr )
SCTAB nTab;
SingleRefToVars( static_cast<ScToken*>(p)->GetSingleRef(), nCol, nRow, nTab);
rAdr.Set( nCol, nRow, nTab );
- if ( pDok->aTableOpList.Count() > 0 )
+ if ( pDok->aTableOpList )
ReplaceCell( rAdr );
}
break;
@@ -1236,7 +1225,7 @@ void ScInterpreter::DoubleRefToVars( const ScToken* p,
const ScComplexRefData& rCRef = p->GetDoubleRef();
SingleRefToVars( rCRef.Ref1, rCol1, rRow1, rTab1);
SingleRefToVars( rCRef.Ref2, rCol2, rRow2, rTab2);
- if ( pDok->aTableOpList.Count() > 0 && !bDontCheckForTableOp )
+ if ( pDok->aTableOpList && !bDontCheckForTableOp )
{
ScRange aRange( rCol1, rRow1, rTab1, rCol2, rRow2, rTab2 );
if ( IsTableOpInRange( aRange ) )
@@ -1321,7 +1310,7 @@ void ScInterpreter::DoubleRefToRange( const ScComplexRefData & rCRef,
rRange.aStart.Set( nCol, nRow, nTab );
SingleRefToVars( rCRef.Ref2, nCol, nRow, nTab);
rRange.aEnd.Set( nCol, nRow, nTab );
- if ( pDok->aTableOpList.Count() > 0 && !bDontCheckForTableOp )
+ if ( pDok->aTableOpList && !bDontCheckForTableOp )
{
if ( IsTableOpInRange( rRange ) )
SetError( errIllegalParameter );
@@ -3370,7 +3359,7 @@ void ScInterpreter::ScTableOp()
PopSingleRef( pTableOp->aFormulaPos );
pTableOp->bValid = TRUE;
- pDok->aTableOpList.Insert( pTableOp );
+ pDok->aTableOpList = pTableOp;
pDok->IncInterpreterTableOpLevel();
BOOL bReuseLastParams = (pDok->aLastTableOpParams == *pTableOp);
@@ -3407,8 +3396,8 @@ void ScInterpreter::ScTableOp()
GetCellString( aCellString, pFCell );
PushString( aCellString );
}
+ pDok->aTableOpList = NULL;
- pDok->aTableOpList.Remove( pTableOp );
// set dirty again once more to be able to recalculate original
for ( ::std::vector< ScFormulaCell* >::const_iterator iBroadcast(
pTableOp->aNotifiedFormulaCells.begin() );
commit 4ba62b896932756861024843c89e96eb92a55ce6
Author: Joseph Powers <jpowers27 at cox.net>
Date: Wed Dec 1 18:50:57 2010 -0800
remove a compiler warning
The compiler was thinking that you could get to the end without a return.
It was wrong... but this will shut it up.
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 37e311c..381ea84 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -949,24 +949,26 @@ static const char* lcl_GetType( XclExpChTrData* pData )
{
switch( pData->nType )
{
- case EXC_CHTR_TYPE_RK:
- case EXC_CHTR_TYPE_DOUBLE:
- return "n";
- break;
- case EXC_CHTR_TYPE_FORMULA:
- {
- ScFormulaCell* pFormulaCell = const_cast< ScFormulaCell* >( pData->mpFormulaCell );
- const char* sType;
- OUString sValue;
- XclXmlUtils::GetFormulaTypeAndValue( *pFormulaCell, sType, sValue );
- return sType;
- }
- break;
- case EXC_CHTR_TYPE_STRING:
- return "inlineStr";
- default:
- return "*unknown*";
+ case EXC_CHTR_TYPE_RK:
+ case EXC_CHTR_TYPE_DOUBLE:
+ return "n";
+ break;
+ case EXC_CHTR_TYPE_FORMULA:
+ {
+ ScFormulaCell* pFormulaCell = const_cast< ScFormulaCell* >( pData->mpFormulaCell );
+ const char* sType;
+ OUString sValue;
+ XclXmlUtils::GetFormulaTypeAndValue( *pFormulaCell, sType, sValue );
+ return sType;
+ }
+ break;
+ case EXC_CHTR_TYPE_STRING:
+ return "inlineStr";
+ break;
+ default:
+ break;
}
+ return "*unknown*";
}
static void lcl_WriteCell( XclExpXmlStream& rStrm, sal_Int32 nElement, const ScAddress& rPosition, XclExpChTrData* pData )
More information about the Libreoffice-commits
mailing list