[Libreoffice-commits] core.git: sc/source
Philipp Weissenbacher
p.weissenbacher at gmail.com
Sat Aug 23 18:17:24 PDT 2014
sc/source/core/data/attarray.cxx | 38 +++++----
sc/source/core/data/attrib.cxx | 66 ++++++++-------
sc/source/core/data/conditio.cxx | 162 +++++++++++++++++----------------------
sc/source/core/data/docpool.cxx | 96 +++++++++++------------
4 files changed, 176 insertions(+), 186 deletions(-)
New commits:
commit 7c2697eb1c645c6a8ad362002e9212446a458a9d
Author: Philipp Weissenbacher <p.weissenbacher at gmail.com>
Date: Sat Aug 23 23:41:33 2014 +0200
Translate German comments, fix some ws
Change-Id: I3bc8d82c5689b8a2da1374e42dd70191e2fe8ef3
Reviewed-on: https://gerrit.libreoffice.org/11099
Reviewed-by: Thomas Arnhold <thomas at arnhold.org>
Tested-by: Thomas Arnhold <thomas at arnhold.org>
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 050b486..fb8a9f4 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -889,15 +889,15 @@ static void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource )
rMergeSet.InvalidateItem( nId );
}
}
- else if ( eOldState == SFX_ITEM_SET ) // Item gesetzt
+ else if ( eOldState == SFX_ITEM_SET ) // Item set
{
SfxItemState eNewState = rSource.GetItemState( nId, true, &pNewItem );
if ( eNewState == SFX_ITEM_SET )
{
- if ( pNewItem != pOldItem ) // beide gepuhlt
+ if ( pNewItem != pOldItem ) // Both pulled
rMergeSet.InvalidateItem( nId );
}
- else // Default
+ else // Default
{
if ( *pOldItem != rSource.GetPool()->GetDefaultItem(nId) )
rMergeSet.InvalidateItem( nId );
@@ -923,7 +923,6 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow,
do
{
// similar patterns must not be repeated
-
const ScPatternAttr* pPattern = pData[nPos].pPattern;
if ( pPattern != rState.pOld1 && pPattern != rState.pOld2 )
{
@@ -1357,7 +1356,9 @@ bool ScAttrArray::IsMerged( SCROW nRow ) const
return rItem.IsMerged();
}
-// Area around any given summaries expand and adapt any MergeFlag (bRefresh)
+/**
+ * Area around any given summaries expand and adapt any MergeFlag (bRefresh)
+ */
bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
SCCOL& rPaintCol, SCROW& rPaintRow,
bool bRefresh )
@@ -1445,7 +1446,6 @@ bool ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
SCROW nMergeEndRow = nThisEnd + nCountY - 1;
// ApplyAttr for areas
-
for (SCROW nThisRow = nThisStart; nThisRow <= nThisEnd; nThisRow++)
pDocument->ApplyAttr( nThisCol, nThisRow, nTab, *pAttr );
@@ -1469,8 +1469,9 @@ bool ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
return bFound;
}
-// Remove field, but leave MergeFlags
-
+/**
+ * Remove field, but leave MergeFlags
+ */
void ScAttrArray::DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow)
{
SetPatternAreaSafe( nStartRow, nEndRow, pDocument->GetDefPattern(), true );
@@ -1492,7 +1493,7 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow,
while ( nThisRow <= nEndRow )
{
pOldPattern = pData[nIndex].pPattern;
- if (pOldPattern != pWantedPattern) //! else-Zweig ?
+ if (pOldPattern != pWantedPattern) // FIXME: else-branch?
{
if (nThisRow < nStartRow) nThisRow = nStartRow;
nRow = pData[nIndex].nRow;
@@ -1652,7 +1653,7 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, bool bIncrement
((const SvxHorJustifyItem*)pItem)->GetValue() != SVX_HOR_JUSTIFY_RIGHT ));
sal_uInt16 nOldValue = ((const SfxUInt16Item&)rOldSet.Get( ATTR_INDENT )).GetValue();
sal_uInt16 nNewValue = nOldValue;
- //to keep Increment indent from running outside the cell1659
+ // To keep Increment indent from running outside the cell1659
long nColWidth = (long)pDocument->GetColWidth(nCol,nTab);
if ( bIncrement )
{
@@ -2184,8 +2185,9 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow)
}
}
-// move within a document
-
+/**
+ * Move within a document
+ */
void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray)
{
SCROW nStart = nStartRow;
@@ -2202,8 +2204,9 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray
DeleteArea(nStartRow, nEndRow);
}
-// copy between documents (Clipboard)
-
+/**
+ * Copy between documents (Clipboard)
+ */
void ScAttrArray::CopyArea(
SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray, sal_Int16 nStripFlags) const
{
@@ -2267,9 +2270,10 @@ void ScAttrArray::CopyArea(
}
}
-// leave flags
-// summarized with CopyArea
-
+/**
+ * Leave flags
+ * summarized with CopyArea
+ */
void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray )
{
nStartRow -= nDy; // Source
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index d7affc2..ce2600e 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -51,8 +51,9 @@ TYPEINIT1(ScDoubleItem, SfxPoolItem);
TYPEINIT1(ScPageScaleToItem, SfxPoolItem);
TYPEINIT1(ScCondFormatItem, SfxPoolItem);
-// General Help Function
-
+/**
+ * General Help Function
+ */
bool ScHasPriority( const ::editeng::SvxBorderLine* pThis, const ::editeng::SvxBorderLine* pOther )
{
@@ -76,15 +77,16 @@ bool ScHasPriority( const ::editeng::SvxBorderLine* pThis, const ::editeng::SvxB
return false;
else
{
- return true; //! ???
+ return true; // FIXME: What is this?
}
}
}
-// Item - Implementierungen
-
-// Merge
+/** Item - Implementations */
+/**
+ * Merge
+ */
ScMergeAttr::ScMergeAttr():
SfxPoolItem(ATTR_MERGE),
nColMerge(0),
@@ -140,8 +142,9 @@ SfxPoolItem* ScMergeAttr::Create( SvStream& rStream, sal_uInt16 /* nVer */ ) con
return new ScMergeAttr(static_cast<SCCOL>(nCol),static_cast<SCROW>(nRow));
}
-// MergeFlag
-
+/**
+ * MergeFlag
+ */
ScMergeFlagAttr::ScMergeFlagAttr():
SfxInt16Item(ATTR_MERGE_FLAG, 0)
{
@@ -166,8 +169,9 @@ bool ScMergeFlagAttr::HasPivotPopupButton() const
return (GetValue() & SC_MF_BUTTON_POPUP) != 0;
}
-// Protection
-
+/**
+ * Protection
+ */
ScProtectionAttr::ScProtectionAttr():
SfxPoolItem(ATTR_PROTECTION),
bProtection(true),
@@ -384,8 +388,9 @@ bool ScProtectionAttr::SetHidePrint( bool bHPrint)
return true;
}
-// ScRangeItem - Tabellenbereich
-
+/**
+ * ScRangeItem - Table range
+ */
bool ScRangeItem::operator==( const SfxPoolItem& rAttr ) const
{
OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
@@ -431,8 +436,9 @@ bool ScRangeItem::GetPresentation
return true;
}
-// ScTableListItem - List from Tables (-numbers)
-
+/**
+ * ScTableListItem - List from Tables (-numbers)
+ */
ScTableListItem::ScTableListItem( const ScTableListItem& rCpy )
: SfxPoolItem ( rCpy.Which() ),
nCount ( rCpy.nCount )
@@ -536,8 +542,9 @@ bool ScTableListItem::GetPresentation
return false;
}
-// ScPageHFItem - Dates from the Head and Foot lines
-
+/**
+ * ScPageHFItem - Dates from the Head and Foot lines
+ */
ScPageHFItem::ScPageHFItem( sal_uInt16 nWhichP )
: SfxPoolItem ( nWhichP ),
pLeftArea ( NULL ),
@@ -649,7 +656,6 @@ SfxPoolItem* ScPageHFItem::Clone( SfxItemPool* ) const
static void lcl_SetSpace( OUString& rStr, const ESelection& rSel )
{
// Text replaced by a space to ensure they are positions:
-
sal_Int32 nLen = rSel.nEndPos-rSel.nStartPos;
rStr = rStr.replaceAt( rSel.nStartPos, nLen, " " );
}
@@ -717,10 +723,9 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, sal_uInt16 nVer ) const
pCenter == NULL || pCenter->GetParagraphCount() == 0 ||
pRight == NULL || pRight->GetParagraphCount() == 0 )
{
- // If successfully loaded, each object contains at least one paragraph.
- // Excel import in 5.1 created broken TextObjects (#67442#) that are
- // corrected here to avoid saving wrong files again (#90487#).
-
+ // If successfully loaded, each object contains at least one paragraph.
+ // Excel import in 5.1 created broken TextObjects (#67442#) that are
+ // corrected here to avoid saving wrong files again (#90487#).
ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), true );
if ( pLeft == NULL || pLeft->GetParagraphCount() == 0 )
{
@@ -739,7 +744,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, sal_uInt16 nVer ) const
}
}
- if ( nVer < 1 ) //old field command conversions
+ if ( nVer < 1 ) // old field command conversions
{
sal_uInt16 i;
const OUString& rDel = ScGlobal::GetRscString( STR_HFCMD_DELIMITER );
@@ -775,9 +780,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, sal_uInt16 nVer ) const
pRight = aEngine.CreateTextObject();
}
}
- else if ( nVer < 2 )
- { // not to do, SvxFileField is not exchanged for SvxExtFileField
- }
+ else if ( nVer < 2 ) {} // nothing to do: SvxFileField is not exchanged for SvxExtFileField
ScPageHFItem* pItem = new ScPageHFItem( Which() );
pItem->SetArea( pLeft, SC_HF_LEFTAREA );
@@ -817,8 +820,9 @@ void ScPageHFItem::SetArea( EditTextObject *pNew, int nArea )
}
}
-// ScViewObjectModeItem - Display Mode of View Objects
-
+/**
+ * ScViewObjectModeItem - Display Mode of View Objects
+ */
ScViewObjectModeItem::ScViewObjectModeItem( sal_uInt16 nWhichP )
: SfxEnumItem( nWhichP, VOBJ_MODE_SHOW )
{
@@ -863,11 +867,10 @@ bool ScViewObjectModeItem::GetPresentation
break;
default:
- ePres = SFX_ITEM_PRESENTATION_NAMELESS;//this always goes!
+ ePres = SFX_ITEM_PRESENTATION_NAMELESS; // Default setting!
break;
}
/* !!! fall-through !!! */
-
case SFX_ITEM_PRESENTATION_NAMELESS:
rText += ScGlobal::GetRscString(STR_VOBJ_MODE_SHOW+GetValue());
return true;
@@ -923,8 +926,9 @@ SfxPoolItem* ScViewObjectModeItem::Create(
}
}
-// double
-
+/**
+ * Double
+ */
ScDoubleItem::ScDoubleItem( sal_uInt16 nWhichP, double nVal )
: SfxPoolItem ( nWhichP ),
nValue ( nVal )
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index e04acfb..1017097 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -166,14 +166,13 @@ ScConditionEntry::ScConditionEntry( const ScConditionEntry& r ) :
bFirstRun(true),
pCondFormat(r.pCondFormat)
{
- // ScTokenArray copy ctor erzeugt flache Kopie
-
+ // ScTokenArray copy ctor creates a flat copy
if (r.pFormula1)
pFormula1 = new ScTokenArray( *r.pFormula1 );
if (r.pFormula2)
pFormula2 = new ScTokenArray( *r.pFormula2 );
- // Formelzellen werden erst bei IsValid angelegt
+ // Formula cells are created at IsValid
}
ScConditionEntry::ScConditionEntry( ScDocument* pDocument, const ScConditionEntry& r ) :
@@ -201,15 +200,14 @@ ScConditionEntry::ScConditionEntry( ScDocument* pDocument, const ScConditionEntr
bFirstRun(true),
pCondFormat(r.pCondFormat)
{
- // echte Kopie der Formeln (fuer Ref-Undo)
-
+ // Real copy of the formulas (for Ref Undo)
if (r.pFormula1)
pFormula1 = r.pFormula1->Clone();
if (r.pFormula2)
pFormula2 = r.pFormula2->Clone();
- // Formelzellen werden erst bei IsValid angelegt
- //! im Clipboard nicht - dann vorher interpretieren !!!
+ // Formula cells are created at IsValid
+ // TODO: But not in the Clipboard! So interpret beforehand!
}
ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
@@ -239,7 +237,7 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
{
Compile( rExpr1, rExpr2, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2, false );
- // Formelzellen werden erst bei IsValid angelegt
+ // Formula cells are created at IsValid
}
ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
@@ -269,20 +267,20 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
pFormula1 = new ScTokenArray( *pArr1 );
if ( pFormula1->GetLen() == 1 )
{
- // einzelne (konstante Zahl) ?
+ // Single (constant number)?
FormulaToken* pToken = pFormula1->First();
if ( pToken->GetOpCode() == ocPush )
{
if ( pToken->GetType() == svDouble )
{
nVal1 = pToken->GetDouble();
- DELETEZ(pFormula1); // nicht als Formel merken
+ DELETEZ(pFormula1); // Do not remember as formula
}
else if ( pToken->GetType() == svString )
{
bIsStr1 = true;
aStrVal1 = pToken->GetString().getString();
- DELETEZ(pFormula1); // nicht als Formel merken
+ DELETEZ(pFormula1); // Do not remember as formula
}
}
}
@@ -293,27 +291,27 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
pFormula2 = new ScTokenArray( *pArr2 );
if ( pFormula2->GetLen() == 1 )
{
- // einzelne (konstante Zahl) ?
+ // Single (constant number)?
FormulaToken* pToken = pFormula2->First();
if ( pToken->GetOpCode() == ocPush )
{
if ( pToken->GetType() == svDouble )
{
nVal2 = pToken->GetDouble();
- DELETEZ(pFormula2); // nicht als Formel merken
+ DELETEZ(pFormula2); // Do not remember as formula
}
else if ( pToken->GetType() == svString )
{
bIsStr2 = true;
aStrVal2 = pToken->GetString().getString();
- DELETEZ(pFormula2); // nicht als Formel merken
+ DELETEZ(pFormula2); // Do not remember as formula
}
}
}
bRelRef2 = lcl_HasRelRef( mpDoc, pFormula2 );
}
- // formula cells are created at IsValid
+ // Formula cells are created at IsValid
}
ScConditionEntry::~ScConditionEntry()
@@ -350,20 +348,20 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
pFormula1 = aComp.CompileString( rExpr1, rExprNmsp1 );
if ( pFormula1->GetLen() == 1 )
{
- // einzelne (konstante Zahl) ?
+ // Single (constant number)?
FormulaToken* pToken = pFormula1->First();
if ( pToken->GetOpCode() == ocPush )
{
if ( pToken->GetType() == svDouble )
{
nVal1 = pToken->GetDouble();
- DELETEZ(pFormula1); // nicht als Formel merken
+ DELETEZ(pFormula1); // Do not remember as formula
}
else if ( pToken->GetType() == svString )
{
bIsStr1 = true;
aStrVal1 = pToken->GetString().getString();
- DELETEZ(pFormula1); // nicht als Formel merken
+ DELETEZ(pFormula1); // Do not remember as formula
}
}
}
@@ -388,20 +386,20 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
pFormula2 = aComp.CompileString( rExpr2, rExprNmsp2 );
if ( pFormula2->GetLen() == 1 )
{
- // einzelne (konstante Zahl) ?
+ // Sigle (constant number)?
FormulaToken* pToken = pFormula2->First();
if ( pToken->GetOpCode() == ocPush )
{
if ( pToken->GetType() == svDouble )
{
nVal2 = pToken->GetDouble();
- DELETEZ(pFormula2); // nicht als Formel merken
+ DELETEZ(pFormula2); // Do not remember as formula
}
else if ( pToken->GetType() == svString )
{
bIsStr2 = true;
aStrVal2 = pToken->GetString().getString();
- DELETEZ(pFormula2); // nicht als Formel merken
+ DELETEZ(pFormula2); // Do not remember as formula
}
}
}
@@ -411,9 +409,12 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
}
}
-void ScConditionEntry::MakeCells( const ScAddress& rPos ) // Formelzellen anlegen
+/**
+ * Create formula cells
+ */
+void ScConditionEntry::MakeCells( const ScAddress& rPos )
{
- if ( !mpDoc->IsClipOrUndo() ) // nie im Clipboard rechnen!
+ if ( !mpDoc->IsClipOrUndo() ) // Never calculate in the Clipboard!
{
if ( pFormula1 && !pFCell1 && !bRelRef1 )
{
@@ -431,19 +432,19 @@ void ScConditionEntry::MakeCells( const ScAddress& rPos ) // Formelzel
void ScConditionEntry::SetIgnoreBlank(bool bSet)
{
- // Das Bit SC_COND_NOBLANKS wird gesetzt, wenn Blanks nicht ignoriert werden
- // (nur bei Gueltigkeit)
-
+ // The bit SC_COND_NOBLANKS is set if blanks are not ignored
+ // (only of valid)
if (bSet)
nOptions &= ~SC_COND_NOBLANKS;
else
nOptions |= SC_COND_NOBLANKS;
}
+/**
+ * Delete formula cells, so we re-complile at the next IsValid
+ */
void ScConditionEntry::CompileAll()
{
- // Formelzellen loeschen, dann wird beim naechsten IsValid neu kompiliert
-
DELETEZ(pFCell1);
DELETEZ(pFCell2);
}
@@ -451,7 +452,6 @@ void ScConditionEntry::CompileAll()
void ScConditionEntry::CompileXML()
{
// First parse the formula source position if it was stored as text
-
if ( !aSrcString.isEmpty() )
{
ScAddress aNew;
@@ -464,7 +464,6 @@ void ScConditionEntry::CompileXML()
}
// Convert the text tokens that were created during XML import into real tokens.
-
Compile( GetExpression(aSrcPos, 0, 0, eTempGrammar1),
GetExpression(aSrcPos, 1, 0, eTempGrammar2),
aStrNmsp1, aStrNmsp2, eTempGrammar1, eTempGrammar2, true );
@@ -594,12 +593,10 @@ void ScConditionEntry::UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt )
}
}
-//! als Vergleichsoperator ans TokenArray ???
-
+//FIXME: Make this a comparison operator at the TokenArray?
static bool lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 )
{
- // verglichen wird nur das nicht-RPN Array
-
+ // We only compare the non-RPN array
if ( pArr1 && pArr2 )
{
sal_uInt16 nLen = pArr1->GetLen();
@@ -612,12 +609,12 @@ static bool lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 )
{
if ( ppToken1[i] != ppToken2[i] &&
!(*ppToken1[i] == *ppToken2[i]) )
- return false; // Unterschied
+ return false; // Difference
}
- return true; // alle Eintraege gleich
+ return true; // All entries are the same
}
else
- return !pArr1 && !pArr2; // beide 0 -> gleich
+ return !pArr1 && !pArr2; // Both 0? -> the same
}
bool ScConditionEntry::operator== ( const ScConditionEntry& r ) const
@@ -632,7 +629,7 @@ bool ScConditionEntry::operator== ( const ScConditionEntry& r ) const
if ( ( pFormula1 || pFormula2 ) && ( aSrcPos != r.aSrcPos || aSrcString != r.aSrcString ) )
bEq = false;
- // wenn keine Formeln, Werte vergleichen
+ // If not formulas, compare values
if ( !pFormula1 && ( nVal1 != r.nVal1 || aStrVal1 != r.aStrVal1 || bIsStr1 != r.bIsStr1 ) )
bEq = false;
if ( !pFormula2 && ( nVal2 != r.nVal2 || aStrVal2 != r.aStrVal2 || bIsStr2 != r.bIsStr2 ) )
@@ -644,15 +641,13 @@ bool ScConditionEntry::operator== ( const ScConditionEntry& r ) const
void ScConditionEntry::Interpret( const ScAddress& rPos )
{
- // Formelzellen anlegen
- // dabei koennen neue Broadcaster (Note-Zellen) ins Dokument eingefuegt werden !!!!
-
+ // Create formula cells
+ // Note: New Broadcaster (Note cells) may be insterted into the document!
if ( ( pFormula1 && !pFCell1 ) || ( pFormula2 && !pFCell2 ) )
MakeCells( rPos );
- // Formeln auswerten
-
- bool bDirty = false; //! 1 und 2 getrennt ???
+ // Evaluate formulas
+ bool bDirty = false; // 1 and 2 separate?
boost::scoped_ptr<ScFormulaCell> pTemp1;
ScFormulaCell* pEff1 = pFCell1;
@@ -663,9 +658,9 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
}
if ( pEff1 )
{
- if (!pEff1->IsRunning()) // keine 522 erzeugen
+ if (!pEff1->IsRunning()) // Don't create 522
{
- //! Changed statt Dirty abfragen !!!
+ //! Query Changed instead of Dirty!
if (pEff1->GetDirty() && !bRelRef1 && mpDoc->GetAutoCalc())
bDirty = true;
if (pEff1->IsValue())
@@ -693,7 +688,7 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
}
if ( pEff2 )
{
- if (!pEff2->IsRunning()) // keine 522 erzeugen
+ if (!pEff2->IsRunning()) // Don't create 522
{
if (pEff2->GetDirty() && !bRelRef2 && mpDoc->GetAutoCalc())
bDirty = true;
@@ -713,13 +708,11 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
}
pTemp2.reset();
- // wenn IsRunning, bleiben die letzten Werte erhalten
-
+ // If IsRunning, the last values remain
if (bDirty && !bFirstRun)
{
- // bei bedingten Formaten neu painten
-
- DataChanged( NULL ); // alles
+ // Repaint everything for dependent formats
+ DataChanged( NULL );
}
bFirstRun = false;
@@ -992,8 +985,7 @@ bool ScConditionEntry::IsError( const ScAddress& rPos ) const
bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const
{
- // Interpret muss schon gerufen sein
-
+ // Interpret must already have been called
if ( bIsStr1 )
{
switch( eOp )
@@ -1014,23 +1006,22 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const
if ( bIsStr2 )
return false;
- double nComp1 = nVal1; // Kopie, damit vertauscht werden kann
+ double nComp1 = nVal1; // Copy, so that it can be changed
double nComp2 = nVal2;
if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN )
if ( nComp1 > nComp2 )
{
- // richtige Reihenfolge fuer Wertebereich
+ // Right order for value range
double nTemp = nComp1; nComp1 = nComp2; nComp2 = nTemp;
}
- // Alle Grenzfaelle muessen per ::rtl::math::approxEqual getestet werden!
-
+ // All corner cases need to be tested with ::rtl::math::approxEqual!
bool bValid = false;
switch (eOp)
{
case SC_COND_NONE:
- break; // immer sal_False;
+ break; // Always sal_False
case SC_COND_EQUAL:
bValid = ::rtl::math::approxEqual( nArg, nComp1 );
break;
@@ -1148,9 +1139,8 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const
bool ScConditionEntry::IsValidStr( const OUString& rArg, const ScAddress& rPos ) const
{
bool bValid = false;
- // Interpret muss schon gerufen sein
-
- if ( eOp == SC_COND_DIRECT ) // Formel ist unabhaengig vom Inhalt
+ // Interpret must already have been called
+ if ( eOp == SC_COND_DIRECT ) // Formula is independent from the content
return !::rtl::math::approxEqual( nVal1, 0.0 );
if ( eOp == SC_COND_DUPLICATE || eOp == SC_COND_NOTDUPLICATE )
@@ -1165,20 +1155,19 @@ bool ScConditionEntry::IsValidStr( const OUString& rArg, const ScAddress& rPos )
}
// If number contains condition, always false, except for "not equal".
-
if ( !bIsStr1 && (eOp != SC_COND_ERROR && eOp != SC_COND_NOERROR) )
return ( eOp == SC_COND_NOTEQUAL );
if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN )
if ( !bIsStr2 )
return false;
- OUString aUpVal1( aStrVal1 ); //! als Member? (dann auch in Interpret setzen)
+ OUString aUpVal1( aStrVal1 ); //! As a member? (Also set in Interpret)
OUString aUpVal2( aStrVal2 );
if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN )
if (ScGlobal::GetCollator()->compareString( aUpVal1, aUpVal2 ) > 0)
{
- // richtige Reihenfolge fuer Wertebereich
+ // Right order for value range
OUString aTemp( aUpVal1 ); aUpVal1 = aUpVal2; aUpVal2 = aTemp;
}
@@ -1237,16 +1226,16 @@ bool ScConditionEntry::IsValidStr( const OUString& rArg, const ScAddress& rPos )
break;
case SC_COND_BETWEEN:
case SC_COND_NOTBETWEEN:
- // Test auf NOTBETWEEN:
+ // Test for NOTBETWEEN:
bValid = ( nCompare < 0 ||
ScGlobal::GetCollator()->compareString( rArg,
aUpVal2 ) > 0 );
if ( eOp == SC_COND_BETWEEN )
bValid = !bValid;
break;
- // SC_COND_DIRECT schon oben abgefragt
+ // SC_COND_DIRECT already handled above
default:
- SAL_WARN("sc", "unbekannte Operation bei ScConditionEntry");
+ SAL_WARN("sc", "unknown operation in ScConditionEntry");
bValid = false;
break;
}
@@ -1257,7 +1246,7 @@ bool ScConditionEntry::IsValidStr( const OUString& rArg, const ScAddress& rPos )
bool ScConditionEntry::IsCellValid( ScRefCellValue& rCell, const ScAddress& rPos ) const
{
- ((ScConditionEntry*)this)->Interpret(rPos); // Formeln auswerten
+ ((ScConditionEntry*)this)->Interpret(rPos); // Evaluate formula
double nArg = 0.0;
OUString aArgStr;
@@ -1377,8 +1366,7 @@ void ScConditionEntry::SourceChanged( const ScAddress& rChanged )
if ( aProv.Ref1.IsColRel() || aProv.Ref1.IsRowRel() || aProv.Ref1.IsTabRel() ||
aProv.Ref2.IsColRel() || aProv.Ref2.IsRowRel() || aProv.Ref2.IsTabRel() )
{
- // absolut muss getroffen sein, relativ bestimmt Bereich
-
+ // Absolute must be reached, relative determines range
bool bHit = true;
SCsCOL nCol1;
SCsROW nRow1;
@@ -1433,11 +1421,10 @@ void ScConditionEntry::SourceChanged( const ScAddress& rChanged )
if ( bHit )
{
- //! begrenzen
-
+ // Limit paint!
ScRange aPaint( nCol1,nRow1,nTab1, nCol2,nRow2,nTab2 );
- // kein Paint, wenn es nur die Zelle selber ist
+ // No paint if it's the cell itself
if ( aPaint.IsValid() && (aPaint.aStart != rChanged || aPaint.aEnd != rChanged ))
DataChanged( &aPaint );
}
@@ -1447,10 +1434,12 @@ void ScConditionEntry::SourceChanged( const ScAddress& rChanged )
}
}
+/**
+ * Return a position that's adjusted to allow textual representation
+ * of expressions if possible
+ */
ScAddress ScConditionEntry::GetValidSrcPos() const
{
- // return a position that's adjusted to allow textual representation of expressions if possible
-
SCTAB nMinTab = aSrcPos.Tab();
SCTAB nMaxTab = nMinTab;
@@ -1491,7 +1480,7 @@ ScAddress ScConditionEntry::GetValidSrcPos() const
ScAddress aValidPos = aSrcPos;
SCTAB nTabCount = mpDoc->GetTableCount();
if ( nMaxTab >= nTabCount && nMinTab > 0 )
- aValidPos.SetTab( aSrcPos.Tab() - nMinTab ); // so the lowest tab ref will be on 0
+ aValidPos.SetTab( aSrcPos.Tab() - nMinTab ); // so the lowest tab ref will be on 0
if ( aValidPos.Tab() >= nTabCount )
aValidPos.SetTab( nTabCount - 1 ); // ensure a valid position even if some references will be invalid
@@ -1501,7 +1490,7 @@ ScAddress ScConditionEntry::GetValidSrcPos() const
void ScConditionEntry::DataChanged( const ScRange* /* pModified */ ) const
{
- // nix
+ //FIXME: Nothing so far
}
bool ScConditionEntry::MarkUsedExternalReferences() const
@@ -1815,8 +1804,7 @@ ScConditionalFormat::ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocume
ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const
{
- // echte Kopie der Formeln (fuer Ref-Undo / zwischen Dokumenten)
-
+ // Real copy of the formula (for Ref Undo/between documents)
if (!pNewDoc)
pNewDoc = pDoc;
@@ -1838,8 +1826,7 @@ bool ScConditionalFormat::EqualEntries( const ScConditionalFormat& r ) const
if( size() != r.size())
return false;
- //! auf gleiche Eintraege in anderer Reihenfolge testen ???
-
+ //TODO: Test for same entries in reverse order?
for (sal_uInt16 i=0; i<size(); i++)
if ( ! (maEntries == r.maEntries ) )
return false;
@@ -2165,13 +2152,12 @@ void ScConditionalFormatList::InsertNew( ScConditionalFormat* pNew )
bool ScConditionalFormatList::operator==( const ScConditionalFormatList& r ) const
{
- // fuer Ref-Undo - interne Variablen werden nicht verglichen
-
+ // For Ref Undo - internal variables are not compared
sal_uInt16 nCount = size();
bool bEqual = ( nCount == r.size() );
const_iterator locIterator = begin();
for(const_iterator itr = r.begin(); itr != r.end() && bEqual; ++itr, ++locIterator)
- if ( !locIterator->EqualEntries(*itr) ) // Eintraege unterschiedlich ?
+ if ( !locIterator->EqualEntries(*itr) ) // Entries differ?
bEqual = false;
return bEqual;
@@ -2179,8 +2165,7 @@ bool ScConditionalFormatList::operator==( const ScConditionalFormatList& r ) con
ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey )
{
- //! binaer suchen
-
+ //FIXME: Binary search
for( iterator itr = begin(); itr != end(); ++itr)
if (itr->GetKey() == nKey)
return &(*itr);
@@ -2191,8 +2176,7 @@ ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey )
const ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey ) const
{
- //! binaer suchen
-
+ //FIXME: Binary search
for ( const_iterator itr = begin(); itr != end(); ++itr)
if (itr->GetKey() == nKey)
return &(*itr);
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 6cce7c7..6e4a4bd 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -122,12 +122,12 @@ static SfxItemInfo const aItemInfos[] =
{ SID_ATTR_PARA_FORBIDDEN_RULES,SFX_ITEM_POOLABLE }, // ATTR_FORBIDDEN_RULES from 614d
{ SID_ATTR_ALIGN_HOR_JUSTIFY, SFX_ITEM_POOLABLE }, // ATTR_HOR_JUSTIFY
{ SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD, SFX_ITEM_POOLABLE }, // ATTR_HOR_JUSTIFY_METHOD
- { SID_ATTR_ALIGN_INDENT, SFX_ITEM_POOLABLE }, // ATTR_INDENT ab 350
+ { SID_ATTR_ALIGN_INDENT, SFX_ITEM_POOLABLE }, // ATTR_INDENT from 350
{ SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE }, // ATTR_VER_JUSTIFY
{ SID_ATTR_ALIGN_VER_JUSTIFY_METHOD, SFX_ITEM_POOLABLE }, // ATTR_VER_JUSTIFY_METHOD
{ SID_ATTR_ALIGN_STACKED, SFX_ITEM_POOLABLE }, // ATTR_STACKED from 680/dr14 (replaces ATTR_ORIENTATION)
- { SID_ATTR_ALIGN_DEGREES, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_VALUE ab 367
- { SID_ATTR_ALIGN_LOCKPOS, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_MODE ab 367
+ { SID_ATTR_ALIGN_DEGREES, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_VALUE from 367
+ { SID_ATTR_ALIGN_LOCKPOS, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_MODE from 367
{ SID_ATTR_ALIGN_ASIANVERTICAL, SFX_ITEM_POOLABLE }, // ATTR_VERTICAL_ASIAN from 642
{ SID_ATTR_FRAMEDIRECTION, SFX_ITEM_POOLABLE }, // ATTR_WRITINGDIR from 643
{ SID_ATTR_ALIGN_LINEBREAK, SFX_ITEM_POOLABLE }, // ATTR_LINEBREAK
@@ -138,7 +138,7 @@ static SfxItemInfo const aItemInfos[] =
{ 0, SFX_ITEM_POOLABLE }, // ATTR_MERGE
{ 0, SFX_ITEM_POOLABLE }, // ATTR_MERGE_FLAG
{ SID_ATTR_NUMBERFORMAT_VALUE, SFX_ITEM_POOLABLE }, // ATTR_VALUE_FORMAT
- { ATTR_LANGUAGE_FORMAT, SFX_ITEM_POOLABLE }, // ATTR_LANGUAGE_FORMAT ab 329, wird im Dialog mit SID_ATTR_NUMBERFORMAT_VALUE kombiniert
+ { ATTR_LANGUAGE_FORMAT, SFX_ITEM_POOLABLE }, // ATTR_LANGUAGE_FORMAT from 329, is combined with SID_ATTR_NUMBERFORMAT_VALUE in the dialog
{ SID_ATTR_BRUSH, SFX_ITEM_POOLABLE }, // ATTR_BACKGROUND
{ SID_SCATTR_PROTECTION, SFX_ITEM_POOLABLE }, // ATTR_PROTECTION
{ SID_ATTR_BORDER_OUTER, SFX_ITEM_POOLABLE }, // ATTR_BORDER
@@ -151,7 +151,7 @@ static SfxItemInfo const aItemInfos[] =
{ SID_ATTR_LRSPACE, SFX_ITEM_POOLABLE }, // ATTR_LRSPACE
{ SID_ATTR_ULSPACE, SFX_ITEM_POOLABLE }, // ATTR_ULSPACE
{ SID_ATTR_PAGE, SFX_ITEM_POOLABLE }, // ATTR_PAGE
- { 0, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PAPERTRAY, seit 303 nur noch dummy
+ { 0, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PAPERTRAY, since 303 just a dummy
{ SID_ATTR_PAGE_PAPERBIN, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PAPERBIN
{ SID_ATTR_PAGE_SIZE, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SIZE
{ SID_ATTR_PAGE_MAXSIZE, SFX_ITEM_POOLABLE }, // ATTR_PAGE_MAXSIZE
@@ -288,14 +288,14 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool)
ppPoolDefaults[ ATTR_CONDITIONAL - ATTR_STARTINDEX ] = new ScCondFormatItem;
ppPoolDefaults[ ATTR_HYPERLINK - ATTR_STARTINDEX ] = new SfxStringItem( ATTR_HYPERLINK, OUString() ) ;
- // GetRscString funktioniert erst nach ScGlobal::Init, zu erkennen am EmptyBrushItem
- //! zusaetzliche Methode ScGlobal::IsInit() oder so...
- //! oder erkennen, ob dies der Secondary-Pool fuer einen MessagePool ist
+ // GetRscString only works after ScGlobal::Init (indicated by the EmptyBrushItem)
+ // TODO: Write additional method ScGlobal::IsInit() or somesuch
+ // or detect whether this is the Secondary Pool for a MessagePool
if ( ScGlobal::GetEmptyBrushItem() )
ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ] = new ScPatternAttr( pSet, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
else
ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ] = new ScPatternAttr( pSet,
- OUString(STRING_STANDARD) ); //! without name?
+ OUString(STRING_STANDARD) ); // FIXME: without name?
ppPoolDefaults[ ATTR_LRSPACE - ATTR_STARTINDEX ] = new SvxLRSpaceItem( ATTR_LRSPACE );
ppPoolDefaults[ ATTR_ULSPACE - ATTR_STARTINDEX ] = new SvxULSpaceItem( ATTR_ULSPACE );
@@ -339,16 +339,16 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool)
if ( pSecondary )
SetSecondaryPool( pSecondary );
- // ATTR_LANGUAGE_FORMAT ab sv329 eingefuegt, VersionMap in _ScGlobal__Init
+ // ATTR_LANGUAGE_FORMAT from sv329 inserted, VersionMap in _ScGlobal__Init
SetVersionMap( 1, 100, 157, pVersionMap1 );
- // ATTR_VALIDDATA, ATTR_CONDITIONAL ab 341
+ // ATTR_VALIDDATA, ATTR_CONDITIONAL from 341
SetVersionMap( 2, 100, 158, pVersionMap2 );
- // ATTR_INDENT ab 350
+ // ATTR_INDENT from 350
SetVersionMap( 3, 100, 160, pVersionMap3 );
- // ATTR_ROTATE_VALUE, ATTR_ROTATE_MODE ab 367
+ // ATTR_ROTATE_VALUE, ATTR_ROTATE_MODE from 367
SetVersionMap( 4, 100, 161, pVersionMap4 );
// CJK, CTL, EMPHASISMARK, TWOLINES from 614
@@ -401,24 +401,24 @@ void ScDocumentPool::InitVersionMaps()
!pVersionMap9 && !pVersionMap10 &&
!pVersionMap11 && !pVersionMap12 , "InitVersionMaps call multiple times" );
- // alte WhichId's mappen
- // nicht mit ATTR_* zaehlen, falls die sich nochmal aendern
+ // Map old WhichId's
+ // Do not count with ATTR_*, if they change again
- // erste Map: ATTR_LANGUAGE_FORMAT ab sv329 eingefuegt
+ // First Map: ATTR_LANGUAGE_FORMAT from sv329 inserted
- const sal_uInt16 nMap1Start = 100; // alter ATTR_STARTINDEX
- const sal_uInt16 nMap1End = 157; // alter ATTR_ENDINDEX
+ const sal_uInt16 nMap1Start = 100; // Old ATTR_STARTINDEX
+ const sal_uInt16 nMap1End = 157; // Old ATTR_ENDINDEX
const sal_uInt16 nMap1Count = nMap1End - nMap1Start + 1;
const sal_uInt16 nMap1New = 18; // ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX
pVersionMap1 = new sal_uInt16 [ nMap1Count ];
sal_uInt16 i, j;
for ( i=0, j=nMap1Start; i < nMap1New; i++, j++ )
pVersionMap1[i] = j;
- // ein Eintrag eingefuegt...
+ // An entry inserted ...
for ( i=nMap1New, j=nMap1Start+nMap1New+1; i < nMap1Count; i++, j++ )
pVersionMap1[i] = j;
- // zweite Map: ATTR_VALIDDATA und ATTR_CONDITIONAL ab 341 eingefuegt
+ // Second Map: ATTR_VALIDDATA and ATTR_CONDITIONAL from 341 inserted
const sal_uInt16 nMap2Start = 100; // ATTR_STARTINDEX
const sal_uInt16 nMap2End = 158; // ATTR_ENDINDEX
@@ -427,11 +427,11 @@ void ScDocumentPool::InitVersionMaps()
pVersionMap2 = new sal_uInt16 [ nMap2Count ];
for ( i=0, j=nMap2Start; i < nMap2New; i++, j++ )
pVersionMap2[i] = j;
- // zwei Eintraege eingefuegt...
+ // Two entries insterted ...
for ( i=nMap2New, j=nMap2Start+nMap2New+2; i < nMap2Count; i++, j++ )
pVersionMap2[i] = j;
- // dritte Map: ATTR_INDENT ab 350 eingefuegt
+ // Third Map: ATTR_INDENT from 350 insterted
const sal_uInt16 nMap3Start = 100; // ATTR_STARTINDEX
const sal_uInt16 nMap3End = 160; // ATTR_ENDINDEX
@@ -440,11 +440,11 @@ void ScDocumentPool::InitVersionMaps()
pVersionMap3 = new sal_uInt16 [ nMap3Count ];
for ( i=0, j=nMap3Start; i < nMap3New; i++, j++ )
pVersionMap3[i] = j;
- // ein Eintrag eingefuegt...
+ // An entry insterted ...
for ( i=nMap3New, j=nMap3Start+nMap3New+1; i < nMap3Count; i++, j++ )
pVersionMap3[i] = j;
- // vierte Map: ATTR_ROTATE_VALUE und ATTR_ROTATE_MODE ab 367 eingefuegt
+ // Fourth Map: ATTR_ROTATE_VALUE and ATTR_ROTATE_MODE from 367 inserted
const sal_uInt16 nMap4Start = 100; // ATTR_STARTINDEX
const sal_uInt16 nMap4End = 161; // ATTR_ENDINDEX
@@ -453,11 +453,11 @@ void ScDocumentPool::InitVersionMaps()
pVersionMap4 = new sal_uInt16 [ nMap4Count ];
for ( i=0, j=nMap4Start; i < nMap4New; i++, j++ )
pVersionMap4[i] = j;
- // zwei Eintraege eingefuegt...
+ // Two entries inserted ...
for ( i=nMap4New, j=nMap4Start+nMap4New+2; i < nMap4Count; i++, j++ )
pVersionMap4[i] = j;
- // fifth map: CJK..., CTL..., EMPHASISMARK, TWOLINES (12 items) added in 614
+ // fifth map: CJK..., CTL..., EMPHASISMARK, TWOLINES (12 items) added in 614
const sal_uInt16 nMap5Start = 100; // ATTR_STARTINDEX
const sal_uInt16 nMap5End = 163; // ATTR_ENDINDEX
@@ -483,7 +483,7 @@ void ScDocumentPool::InitVersionMaps()
for ( i=nMap6New, j=nMap6Start+nMap6New+3; i < nMap6Count; i++, j++ )
pVersionMap6[i] = j;
- // seventh map: ATTR_FONT_WORDLINE, ATTR_FONT_RELIEF, ATTR_HYPHENATE added in 632b
+ // seventh map: ATTR_FONT_WORDLINE, ATTR_FONT_RELIEF, ATTR_HYPHENATE added in 632b
const sal_uInt16 nMap7Start = 100; // ATTR_STARTINDEX
const sal_uInt16 nMap7End = 178; // ATTR_ENDINDEX
@@ -496,7 +496,7 @@ void ScDocumentPool::InitVersionMaps()
for ( i=nMap7New, j=nMap7Start+nMap7New+3; i < nMap7Count; i++, j++ )
pVersionMap7[i] = j;
- // eighth map: ATTR_VERTICAL_ASIAN added in 642q
+ // eighth map: ATTR_VERTICAL_ASIAN added in 642q
const sal_uInt16 nMap8Start = 100; // ATTR_STARTINDEX
const sal_uInt16 nMap8End = 181; // ATTR_ENDINDEX
@@ -509,7 +509,7 @@ void ScDocumentPool::InitVersionMaps()
for ( i=nMap8New, j=nMap8Start+nMap8New+1; i < nMap8Count; i++, j++ )
pVersionMap8[i] = j;
- // 9th map: ATTR_WRITINGDIR added in 643y
+ // 9th map: ATTR_WRITINGDIR added in 643y
const sal_uInt16 nMap9Start = 100; // ATTR_STARTINDEX
const sal_uInt16 nMap9End = 182; // ATTR_ENDINDEX
@@ -597,24 +597,24 @@ void ScDocumentPool::DeleteVersionMaps()
pVersionMap1 = 0;
}
-// Fuer die Pattern-Attribute (SetItems) kann der sal_uInt16 RefCount leicht ueberlaufen
-// (z.B. 600 ganze Zeilen abwechselnd formatieren).
-// Darum wird der RefCount bei SC_MAX_POOLREF festgehalten und nicht mehr hoch- oder
-// heruntergezaehlt. Dieser RefCount wird dann erst beim naechsten Laden neu gezaehlt.
-// Die Differenz zwischen SC_MAX_POOLREF und SC_SAFE_POOLREF ist ein wenig groesser
-// als noetig, um zu erkennen, wenn der RefCount aus Versehen doch "normal" veraendert
-// wird (Assertions).
-
+/**
+ * The sal_uInt16 RefCount can overflow easily for the pattern attributes (SetItems):
+ * E.g. Alternate formatting for 600 whole cells.
+ * The RefCount is kept at SC_MAX_POOLREF and not increased/decreased anymore.
+ * This RefCount is recalculated not until the next load.
+ * The difference between SC_MAX_POOLREF and SC_SAFE_POOLREF is a little larger than it needs
+ * to be, to allow for detecting accidental "normal" changes to the RefCount (assertions).
+ */
const SfxPoolItem& ScDocumentPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
{
- if ( rItem.Which() != ATTR_PATTERN ) // nur Pattern ist special
+ if ( rItem.Which() != ATTR_PATTERN ) // Only Pattern is special
return SfxItemPool::Put( rItem, nWhich );
- // das Default-Pattern dieses Pools nicht kopieren
+ // Don't copy the default pattern of this Pool
if (&rItem == ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ])
return rItem;
- // ansonsten muss Put immer passieren, weil es ein anderer Pool sein kann
+ // Else Put must always happen, because it could be another Pool
const SfxPoolItem& rNew = SfxItemPool::Put( rItem, nWhich );
CheckRef( rNew );
return rNew;
@@ -622,7 +622,7 @@ const SfxPoolItem& ScDocumentPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWh
void ScDocumentPool::Remove( const SfxPoolItem& rItem )
{
- if ( rItem.Which() == ATTR_PATTERN ) // nur Pattern ist special
+ if ( rItem.Which() == ATTR_PATTERN ) // Only Pattern is special
{
sal_uLong nRef = rItem.GetRefCount();
if ( nRef >= (sal_uLong) SC_MAX_POOLREF && nRef <= (sal_uLong) SFX_ITEMS_OLD_MAXREF )
@@ -632,7 +632,7 @@ void ScDocumentPool::Remove( const SfxPoolItem& rItem )
OSL_FAIL("Who fiddles with my ref counts?");
SetRefCount( (SfxPoolItem&)rItem, (sal_uLong) SC_SAFE_POOLREF );
}
- return; // nicht herunterzaehlen
+ return; // Do not decrement
}
}
SfxItemPool::Remove( rItem );
@@ -643,8 +643,8 @@ void ScDocumentPool::CheckRef( const SfxPoolItem& rItem )
sal_uLong nRef = rItem.GetRefCount();
if ( nRef >= (sal_uLong) SC_MAX_POOLREF && nRef <= (sal_uLong) SFX_ITEMS_OLD_MAXREF )
{
- // beim Apply vom Cache wird evtl. um 2 hochgezaehlt (auf MAX+1 oder SAFE+2),
- // heruntergezaehlt wird nur einzeln (in LoadCompleted)
+ // At the Apply of the Cache we might increase by 2 (to MAX+1 or SAFE+2)
+ // We only decrease by 1 (in LoadCompleted)
OSL_ENSURE( nRef<=(sal_uLong)SC_MAX_POOLREF+1 || (nRef>=(sal_uLong)SC_SAFE_POOLREF-1 && nRef<=(sal_uLong)SC_SAFE_POOLREF+2),
"ScDocumentPool::CheckRef" );
SetRefCount( (SfxPoolItem&)rItem, (sal_uLong) SC_SAFE_POOLREF );
@@ -679,7 +679,7 @@ void ScDocumentPool::CellStyleCreated( const OUString& rName )
{
const OUString* pStyleName = pPattern->GetStyleName();
if ( pStyleName && *pStyleName == rName )
- pPattern->UpdateStyleSheet(); // find and store style pointer
+ pPattern->UpdateStyleSheet(); // find and store style pointer
}
}
}
@@ -751,8 +751,7 @@ static bool lcl_HFPresentation
}
aText += cpDelim;
- // nPropFirstLineOfst haben wir nicht
-
+ // We don't have a nPropFirstLineOfst
aText += EE_RESSTR(RID_SVXITEMS_LRSPACE_RIGHT);
if ( 100 != nPropRightMargin )
{
@@ -920,8 +919,7 @@ bool ScDocumentPool::GetPresentation(
SfxMapUnit ScDocumentPool::GetMetric( sal_uInt16 nWhich ) const
{
- // eigene Attribute: Twips, alles andere 1/100 mm
-
+ // Own attributes in Twips, everything else in 1/100 mm
if ( nWhich >= ATTR_STARTINDEX && nWhich <= ATTR_ENDINDEX )
return SFX_MAPUNIT_TWIP;
else
More information about the Libreoffice-commits
mailing list