[Libreoffice-commits] .: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jan 24 07:55:37 PST 2013


 sc/source/core/data/cell.cxx  |   52 +++++++++------------------
 sc/source/core/data/cell2.cxx |   79 ++++++++++++++++++++----------------------
 2 files changed, 56 insertions(+), 75 deletions(-)

New commits:
commit 5af61a8bb6fa890349334b6a22eb02a0dd79a90a
Author: Philipp Weissenbacher <p.weissenbacher at gmail.com>
Date:   Wed Jan 23 00:32:36 2013 +0100

    Translate German comments, fix some ws
    
    Change-Id: I962077a8c7d533c7eaf6d5ba68ec18966e5760a1
    Reviewed-on: https://gerrit.libreoffice.org/1817
    Reviewed-by: Radek Doulík <rodo at novell.com>
    Tested-by: Radek Doulík <rodo at novell.com>

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 2b0366c..8df14f1 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1143,25 +1143,18 @@ void ScFormulaCell::CalcAfterLoad()
             pDocument->AddSubTotalCell(this);
     }
 
-    // irgendwie koennen unter os/2 mit rotter FPU-Exception /0 ohne Err503 gespeichert
-    // werden, woraufhin spaeter im NumberFormatter die BLC Lib bei einem fabs(-NAN) abstuerzt
-    //(#32739#) hier fuer alle Systeme ausbuegeln, damit da auch Err503 steht
-
-    // somehow we can under os / 2 store without Err503 with rotter FPU / 0, followed later
-    // in the BLC Lib NumberFormatter a fabs (NAN) is crashing (# 32739 #) iron out here for all
-    // the systems, so there is also Err503
-
+    // On OS/2 with broken FPU exception, we can somehow store /0 without Err503. Later on in
+    // the BLC Lib NumberFormatter crashes when doing a fabs (NAN) (# 32739 #).
+    // We iron this out here for all systems, such that we also have an Err503 here.
     if ( aResult.IsValue() && !::rtl::math::isFinite( aResult.GetDouble() ) )
     {
-        OSL_FAIL("Formelzelle INFINITY !!! Woher kommt das Dokument?");
+        OSL_FAIL("Formula cell INFINITY!!! Where does this document come from?");
         aResult.SetResultError( errIllegalFPOperation );
         bDirty = true;
     }
-    // DoubleRefs bei binaeren Operatoren waren vor v5.0 immer Matrix,
-    // jetzt nur noch wenn in Matrixformel, sonst implizite Schnittmenge
 
-    // Double Refs in binary operators were always in front of Matrix v5.0, now only when in an
-    // array formula, otherwise an implicit intersection
+    // DoubleRefs for binary operators were always a Matrix before version v5.0.
+    // Now this is only the case when when in an array formula, otherwise it's an implicit intersection
     if ( pDocument->GetSrcVersion() < SC_MATRIX_DOUBLEREF &&
             GetMatrixFlag() == MM_NONE && pCode->HasMatrixDoubleRefOps() )
     {
@@ -1169,9 +1162,8 @@ void ScFormulaCell::CalcAfterLoad()
         SetMatColsRows( 1, 1);
     }
 
-    // Must the cells be calculated? After Load cells can contain an error code, and then start
-    // the listener and ggbf. Recalculate if not RECALCMODE_NORMAL
-
+    // Do the cells need to be calculated? After Load cells can contain an error code, and then start
+    // the listener and Recalculate (if needed) if not RECALCMODE_NORMAL
     if( !bNewCompiled || !pCode->GetCodeError() )
     {
         StartListeningTo( pDocument );
@@ -1179,16 +1171,11 @@ void ScFormulaCell::CalcAfterLoad()
             bDirty = true;
     }
     if ( pCode->IsRecalcModeAlways() )
-    {   // zufall(), heute(), jetzt() bleiben immer im FormulaTree, damit sie
-        // auch bei jedem F9 berechnet werden.
-
-        // accident(), today(), now() always stay in the FormulaTree, so that they
-        // can also be calculated for each F9.
+    {   // random(), today(), now() always stay in the FormulaTree, so that they are calculated
+        // for each F9
         bDirty = true;
     }
-    // Noch kein SetDirty weil noch nicht alle Listener bekannt, erst in
-    // SetDirtyAfterLoad.
-    // Still no SetDirty because all Listeners are not know, first in SetDirtyAfterLoad.
+    // No SetDirty yet, as no all Listeners are known yet (only in SetDirtyAfterLoad)
 }
 
 
@@ -1204,12 +1191,8 @@ void ScFormulaCell::Interpret()
         return;     // no double/triple processing
 
     //! HACK:
-    //  Wenn der Aufruf aus einem Reschedule im DdeLink-Update kommt, dirty stehenlassen
-    //  Besser: Dde-Link Update ohne Reschedule oder ganz asynchron !!!
-
-    //  If the call comes from a Reschedule in the DdeLink-Update, dirty let stand
-    //  Better: Dde-Link Update without Reschdule or completely asynchronously !!!
-
+    //  If the call originates from a Reschedule in DdeLink update, leave dirty
+    //  Better: Do a Dde Link Update without Reschedule or do it completely asynchronously!
     if ( pDocument->IsInDdeLinkUpdate() )
         return;
 
@@ -1551,7 +1534,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
                      p->GetStringResult() == aResult.GetString()))
             {
                 // A convergence in the first iteration doesn't necessarily
-                // mean that it's done, it may be because not all related cells
+                // mean that it's done, it may be as not all related cells
                 // of a circle changed their values yet. If the set really
                 // converges it will do so also during the next iteration. This
                 // fixes situations like of #i44115#. If this wasn't wanted an
@@ -1592,7 +1575,6 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
         {
             // #i102616# Compare anyway if the sheet is still marked unchanged for single-sheet saving
             // Also handle special cases of initial results after loading.
-
             if ( !bContentChanged && pDocument->IsStreamValid(aPos.Tab()) )
             {
                 ScFormulaResult aNewResult( p->GetResultToken().get());
@@ -1691,7 +1673,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
         if ( !pCode->IsRecalcModeAlways() )
             pDocument->RemoveFromFormulaTree( this );
 
-    //  FORCED cells also immediately tested for validity (start macro possibly)
+        //  FORCED cells also immediately tested for validity (start macro possibly)
 
         if ( pCode->IsRecalcModeForced() )
         {
@@ -1705,7 +1687,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
             }
         }
 
-        // Reschedule verlangsamt das ganze erheblich, nur bei Prozentaenderung ausfuehren
+        // Reschedule slows the whole thing down considerably, thus only execute on percent change
         ScProgress::GetInterpretProgress()->SetStateCountDownOnPercent(
             pDocument->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE );
 
@@ -1741,7 +1723,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
     }
     else
     {
-    //  Cells with compiler errors should not be marked dirty forever
+        // Cells with compiler errors should not be marked dirty forever
         OSL_ENSURE( pCode->GetCodeError(), "no UPN-Code und no errors ?!?!" );
         bDirty = false;
         bTableOpDirty = false;
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index 73c960c..2bd326c 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -995,10 +995,9 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
                 }
             }
             else if ( eUpdateRefMode == URM_MOVE )
-            {   // bei Move/D&D neu kompilieren wenn ColRowName verschoben wurde
-                // oder diese Zelle auf einen zeigt und verschoben wurde
-                // During Move/D&D was recompiled, when ColRowName had been delayed
-                bColRowNameCompile = bCompile;      // evtl. aus Copy-ctor
+            {   // Recomplie for Move/D&D when ColRowName was moved or this Cell
+                // points to one and was moved.
+                bColRowNameCompile = bCompile;      // Possibly from Copy ctor
                 if ( !bColRowNameCompile )
                 {
                     bool bMoved = (aPos != aOldPos);
@@ -1052,7 +1051,7 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
         }
 
         bool bNeedDirty = false;
-        // NeedDirty bei Aenderungen ausser Copy und Move/Insert ohne RelNames
+        // NeedDirty for changes except for Copy and Move/Insert without RelNames
         if ( bRangeModified || pRangeData || bColRowNameCompile ||
                 (bValChanged && eUpdateRefMode != URM_COPY &&
                  (eUpdateRefMode != URM_MOVE || bHasRelName) &&
@@ -1063,10 +1062,10 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
             bNeedDirty = false;
         if (pUndoDoc && (bValChanged || pRangeData || bOnRefMove))
         {
-            //  Copy the cell to aUndoPos, which is its current position in the document,
-            //  so this works when UpdateReference is called before moving the cells
-            //  (InsertCells/DeleteCells - aPos is changed above) as well as when UpdateReference
-            //  is called after moving the cells (MoveBlock/PasteFromClip - aOldPos is changed).
+            // Copy the cell to aUndoPos, which is its current position in the document,
+            // so this works when UpdateReference is called before moving the cells
+            // (InsertCells/DeleteCells - aPos is changed above) as well as when UpdateReference
+            // is called after moving the cells (MoveBlock/PasteFromClip - aOldPos is changed).
 
             // If there is already a formula cell in the undo document, don't overwrite it,
             // the first (oldest) is the important cell.
@@ -1116,9 +1115,9 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
             }
         }
         if ( bNeedDirty && (!(eUpdateRefMode == URM_INSDEL && bHasRelName) || pRangeData) )
-        {   // Referenzen abgeschnitten, ungueltig o.ae.?
+        {   // Cut off references, invalid or similar?
             bool bOldAutoCalc = pDocument->GetAutoCalc();
-            // no Interpret in SubMinimalRecalc because of evntual wrong reference
+            // No Interpret in SubMinimalRecalc because of eventual wrong reference
             pDocument->SetAutoCalc( false );
             SetDirty();
             pDocument->SetAutoCalc( bOldAutoCalc );
@@ -1136,15 +1135,15 @@ void ScFormulaCell::UpdateInsertTab(SCTAB nTable, SCTAB nNewSheets)
     if( pCode->GetNextReferenceRPN() && !pDocument->IsClipOrUndo() )
     {
         EndListeningTo( pDocument );
-        // IncTab _nach_ EndListeningTo und _vor_ Compiler UpdateInsertTab !
+        // IncTab _after_ EndListeningTo and _before_ Compiler UpdateInsertTab!
         if ( bPosChanged )
             aPos.IncTab(nNewSheets);
         ScRangeData* pRangeData;
         ScCompiler aComp(pDocument, aPos, *pCode);
         aComp.SetGrammar(pDocument->GetGrammar());
         pRangeData = aComp.UpdateInsertTab( nTable, false, nNewSheets );
-        if (pRangeData)                     // Shared Formula against real Formula
-        {                                   // exchange
+        if (pRangeData) // Exchange Shared Formula with real Formula
+        {
             bool bRefChanged;
             pDocument->RemoveFromFormulaTree( this );   // update formula count
             delete pCode;
@@ -1172,15 +1171,15 @@ bool ScFormulaCell::UpdateDeleteTab(SCTAB nTable, bool bIsMove, SCTAB nSheets)
     if( pCode->GetNextReferenceRPN() && !pDocument->IsClipOrUndo() )
     {
         EndListeningTo( pDocument );
-        // IncTab _after_ EndListeningTo und _before_ Compiler UpdateDeleteTab !
+        // IncTab _after_ EndListeningTo und _before_ Compiler UpdateDeleteTab!
         if ( bPosChanged )
             aPos.IncTab(-1*nSheets);
         ScRangeData* pRangeData;
         ScCompiler aComp(pDocument, aPos, *pCode);
         aComp.SetGrammar(pDocument->GetGrammar());
         pRangeData = aComp.UpdateDeleteTab(nTable, bIsMove, false, bRefChanged, nSheets);
-        if (pRangeData)                     // Shared Formula against real Formula
-        {                                   // exchange
+        if (pRangeData) // Exchange Shared Formula with real Formula
+        {
             pDocument->RemoveFromFormulaTree( this );   // update formula count
             delete pCode;
             pCode = pRangeData->GetCode()->Clone();
@@ -1192,7 +1191,7 @@ bool ScFormulaCell::UpdateDeleteTab(SCTAB nTable, bool bIsMove, SCTAB nSheets)
             // If the shared formula contained a named range/formula containing
             // an absolute reference to a sheet, those have to be readjusted.
             aComp2.UpdateInsertTab( nTable,true, nSheets );
-            // bRefChanged kann beim letzten UpdateDeleteTab zurueckgesetzt worden sein
+            // bRefChanged could have been reset at the last UpdateDeleteTab
             bRefChanged = true;
             bCompile = true;
         }
@@ -1216,8 +1215,8 @@ void ScFormulaCell::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo )
         ScCompiler aComp(pDocument, aPos, *pCode);
         aComp.SetGrammar(pDocument->GetGrammar());
         pRangeData = aComp.UpdateMoveTab( nOldPos, nNewPos, false );
-        if (pRangeData)                     // Shared Formula gegen echte Formel
-        {                                   // exchange
+        if (pRangeData) // Exchange Shared Formula with real Formula
+        {
             pDocument->RemoveFromFormulaTree( this );   // update formula count
             delete pCode;
             pCode = pRangeData->GetCode()->Clone();
@@ -1299,7 +1298,7 @@ void ScFormulaCell::UpdateCompile( bool bForceIfNameInUse )
     CompileTokenArray();
 }
 
-//  Reference transposition is only called in Clipboard Document
+// Reference transposition is only called in Clipboard Document
 void ScFormulaCell::TransposeReference()
 {
     bool bFound = false;
@@ -1342,7 +1341,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
     EndListeningTo( pDocument );
 
     ScAddress aOldPos = aPos;
-    bool bPosChanged = false;           // If this cell has been moved
+    bool bPosChanged = false; // Whether this cell has been moved
 
     ScRange aDestRange( rDest, ScAddress(
                 static_cast<SCCOL>(rDest.Col() + rSource.aEnd.Row() - rSource.aStart.Row()),
@@ -1350,7 +1349,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
                 rDest.Tab() + rSource.aEnd.Tab() - rSource.aStart.Tab() ) );
     if ( aDestRange.In( aOldPos ) )
     {
-        //  Count back Positions
+        // Count back Positions
         SCsCOL nRelPosX = aOldPos.Col();
         SCsROW nRelPosY = aOldPos.Row();
         SCsTAB nRelPosZ = aOldPos.Tab();
@@ -1382,7 +1381,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
         {
             t->CalcAbsIfRel( aOldPos );
             bool bMod;
-            {   // own scope for SingleDoubleRefModifier dtor if SingleRef
+            {   // Own scope for SingleDoubleRefModifier dtor if SingleRef
                 SingleDoubleRefModifier aMod( *t );
                 ScComplexRefData& rRef = aMod.Ref();
                 bMod = (ScRefUpdate::UpdateTranspose( pDocument, rSource,
@@ -1396,9 +1395,9 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
         }
     }
 
-    if (pShared)            // Shared Formula against real Formula exchange
+    if (pShared) // Exchange Shared Formula with real Formula
     {
-        pDocument->RemoveFromFormulaTree( this );   // update formula count
+        pDocument->RemoveFromFormulaTree( this ); // update formula count
         delete pCode;
         pCode = new ScTokenArray( *pShared->GetCode() );
         bRefChanged = true;
@@ -1409,7 +1408,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
             {
                 t->CalcAbsIfRel( aOldPos );
                 bool bMod;
-                {   // own scope for SingleDoubleRefModifier dtor if SingleRef
+                {   // Own scope for SingleDoubleRefModifier dtor if SingleRef
                     SingleDoubleRefModifier aMod( *t );
                     ScComplexRefData& rRef = aMod.Ref();
                     bMod = (ScRefUpdate::UpdateTranspose( pDocument, rSource,
@@ -1432,11 +1431,11 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
         }
 
         bCompile = true;
-        CompileTokenArray();                // also call StartListeningTo
+        CompileTokenArray(); // also call StartListeningTo
         SetDirty();
     }
     else
-        StartListeningTo( pDocument );      // Listener as previous
+        StartListeningTo( pDocument ); // Listener as previous
 
     delete pOld;
 }
@@ -1467,7 +1466,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY
         {
             t->CalcAbsIfRel( aPos );
             bool bMod;
-            {   // own scope for SingleDoubleRefModifier dtor if SingleRef
+            {   // Own scope for SingleDoubleRefModifier dtor if SingleRef
                 SingleDoubleRefModifier aMod( *t );
                 ScComplexRefData& rRef = aMod.Ref();
                 bMod = (ScRefUpdate::UpdateGrow( rArea,nGrowX,nGrowY,
@@ -1481,9 +1480,9 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY
         }
     }
 
-    if (pShared)            // Shared Formula gegen echte Formel austauschen
+    if (pShared) // Exchange Shared Formula with real Formula
     {
-        pDocument->RemoveFromFormulaTree( this );   // update formula count
+        pDocument->RemoveFromFormulaTree( this ); // Update formula count
         delete pCode;
         pCode = new ScTokenArray( *pShared->GetCode() );
         bRefChanged = true;
@@ -1494,7 +1493,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY
             {
                 t->CalcAbsIfRel( aPos );
                 bool bMod;
-                {   // own scope for SingleDoubleRefModifier dtor if SingleRef
+                {   // Own scope for SingleDoubleRefModifier dtor if SingleRef
                     SingleDoubleRefModifier aMod( *t );
                     ScComplexRefData& rRef = aMod.Ref();
                     bMod = (ScRefUpdate::UpdateGrow( rArea,nGrowX,nGrowY,
@@ -1509,11 +1508,11 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY
     if (bRefChanged)
     {
         bCompile = true;
-        CompileTokenArray();                // also call StartListeningTo
+        CompileTokenArray(); // Also call StartListeningTo
         SetDirty();
     }
     else
-        StartListeningTo( pDocument );      // Listener as previous
+        StartListeningTo( pDocument ); // Listener as previous
 }
 
 static void lcl_FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes, ScTokenArray* pCode, ScRangeName* pNames)
@@ -1564,7 +1563,7 @@ void ScFormulaCell::CompileDBFormula()
 
 void ScFormulaCell::CompileDBFormula( bool bCreateFormulaString )
 {
-    // two phases must be called after each other
+    // Two phases must be called after each other
     // 1. Formula String with old generated names
     // 2. Formula String with new generated names
     if ( bCreateFormulaString )
@@ -1575,14 +1574,14 @@ void ScFormulaCell::CompileDBFormula( bool bCreateFormulaString )
         {
             switch ( p->GetOpCode() )
             {
-                case ocBad:             // DB-Area eventually goes bad
+                case ocBad:             // DB Area eventually goes bad
                 case ocColRowName:      // in case of the same names
-                case ocDBArea:          // DB-Area
+                case ocDBArea:          // DB Area
                     bRecompile = true;
                 break;
                 case ocName:
                     if ( p->GetIndex() >= SC_START_INDEX_DB_COLL )
-                        bRecompile = true;  // DB-Area
+                        bRecompile = true;  // DB Area
                 break;
                 default:
                     ; // nothing
@@ -1615,7 +1614,7 @@ void ScFormulaCell::CompileDBFormula( bool bCreateFormulaString )
 
 void ScFormulaCell::CompileNameFormula( bool bCreateFormulaString )
 {
-    // two phases must be called after each other
+    // Two phases must be called after each other
     // 1. Formula String with old generated names
     // 2. Formula String with new generated names
     if ( bCreateFormulaString )


More information about the Libreoffice-commits mailing list