Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


Hello List,

As this weak coder starts out on a trek to help out, here are 3 minor patches against calc/sc/source/core/data/attarray.cxx. I tried to keep them separated logically, but wasn't quite perfect about it.

$ pwd
[...]/clone/calc

$ git log -3 -p > calc_attarray_minor_changes.patch

Cheers,

Kevin
commit 110c5f4dfdfda9b102ee5b13118da9ff5d81e257
Author: Kevin Hunter <hunteke@earlham.edu>
Date:   Mon Oct 18 14:45:46 2010 -0400

    Unused code removal
    
    - Removed code that was commented out.  (We have change revision
      since awhile now ...)
    - A couple of missed translations.
    - Actually remove vim line for tabs, as alluded to in previous
      commit

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index da1d574..f538cb9 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -356,7 +356,7 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern
 
             SCSIZE ni = 0;      // number of entries in beginning
             SCSIZE nx = 0;      // track position
-            SCROW ns = 0;      // start row of track position
+            SCROW  ns = 0;      // start row of track position
             if ( nStartRow > 0 )
             {
                 // skip beginning
@@ -511,7 +511,6 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern
                 pDocument->SetStreamValid(nTab, FALSE);
         }
     }
-// InfoBox(0, String(nCount) + String(" Eintraege") ).Execute();
 
 #ifdef DBG_UTIL
     TestData();
@@ -527,7 +526,7 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
         SCROW nStart=0;
         if (!Search( nStartRow, nPos ))
         {
-            DBG_ERROR("Search-Fehler");
+            DBG_ERROR("Search Failure");
             return;
         }
 
@@ -625,7 +624,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
         SCROW nStart=0;
         if (!Search( nStartRow, nPos ))
         {
-            DBG_ERROR("Search-Fehler");
+            DBG_ERROR("Search failure");
             return;
         }
 
@@ -824,8 +823,6 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac
             }
             else
             {
-                // Remove this unexplained crash (Calc1 import)
-                // pDocument->GetPool()->Remove(*pNewPattern);
                 nStart = pData[nPos].nRow + 1;
                 ++nPos;
             }
@@ -1066,7 +1063,7 @@ void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* 
pLine
             pPattern = (ScPatternAttr*) pData[i].pPattern;
             lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, FALSE,
                             nEndRow - Min( pData[i].nRow, (SCROW)(nEndRow-1) ) );
-            // nDistBottom her always > 0
+            // nDistBottom here always > 0
         }
 
         pPattern = GetPattern( nEndRow );
@@ -1124,10 +1121,6 @@ BOOL ScAttrArray::ApplyFrame(
         SfxItemPoolCache aCache( pDocument->GetPool(), &aNewFrame );
         ApplyCacheArea( nStartRow, nEndRow, &aCache );
 
-/*        ScPatternAttr* pNewPattern = (ScPatternAttr*) pPattern->Clone();
-        pNewPattern->GetItemSet().Put( aNewFrame );
-        SetPatternArea( nStartRow, nEndRow, pNewPattern, TRUE );
-*/
         return TRUE;
     }
 }
@@ -1185,12 +1178,10 @@ long lcl_LineSize( const SvxBorderLine& rLine )
         DBG_ASSERT( rLine.GetOutWidth() && rLine.GetInWidth(),
                         "Line has a distance, but only a width?" );
 
-//        nTotal += ( nDist > 40 ) ? ( nDist / 2 ) : 20;
         nTotal += ( nDist > 20 ) ? nDist : 20;
         nTotal += ( nWidth > 20 ) ? nWidth : 20;
     }
     else if (nWidth)
-//        nTotal += ( nWidth > 40 ) ? ( nWidth / 2 ) : 20;
         nTotal += ( nWidth > 20 ) ? nWidth  : 20;
 
         // also halved ???
@@ -1779,9 +1770,6 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, 
ScFlatBo
         SCROW nEnd = pData[nPos].nRow;
         if (pData[nPos].pPattern->GetStyleSheet() == pStyleSheet)
         {
-//         for (SCROW nRow = nStart; nRow <= nEnd; nRow++)
-//            pUsed[nRow] = TRUE;
-
             rUsedRows.setTrue(nStart, nEnd);
 
             if (bReset)
@@ -2248,7 +2236,7 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& 
rAttrArray
     {
         if ((pData[i].nRow >= nStartRow) && ((i==0) ? TRUE : pData[i-1].nRow < nEndRow))
         {
-            // Kopieren (bPutToPool=TRUE)
+            // copy (bPutToPool=TRUE)
             rAttrArray.SetPatternArea( nStart, Min( (SCROW)pData[i].nRow, (SCROW)nEndRow ),
                                         pData[i].pPattern, TRUE );
         }
@@ -2577,5 +2565,3 @@ void ScAttrArray::Load( SvStream& /* rStream */ )
 #endif // SC_ROWLIMIT_STREAM_ACCESS
 }
 #endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

commit e2fe24f399c01c7c40624571ab7929e68fa1f6be
Author: Kevin Hunter <hunteke@earlham.edu>
Date:   Mon Oct 18 14:34:15 2010 -0400

    Remove certain innappropriate tabs
    
    - Unless tabs are used consistently and *only* at the beginning of a
      line, then they don't play nice on all text editors and tab-width
      preferences.  Forcing a tab width is not conducive to community
      programming.  Similarly, remove vim tabwidth settings.

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 557f7fc..da1d574 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -139,10 +139,10 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, BOOL bAlloc )
 {
     if (pData)
     {
-        ScDocumentPool*         pDocPool = pDocument->GetPool();
+        ScDocumentPool*  pDocPool = pDocument->GetPool();
         const ScPatternAttr* pOldPattern;
-        ScAddress                       aAdrStart( nCol, 0, nTab );
-        ScAddress                       aAdrEnd  ( nCol, 0, nTab );
+        ScAddress        aAdrStart( nCol, 0, nTab );
+        ScAddress        aAdrEnd  ( nCol, 0, nTab );
 
         for (SCSIZE i=0; i<nCount; i++)
         {
@@ -234,13 +234,14 @@ BOOL ScAttrArray::Concat(SCSIZE nPos)
 
 BOOL ScAttrArray::Search( SCROW nRow, SCSIZE& nIndex ) const
 {
-    long       nLo             = 0;
-    long       nHi             = static_cast<long>(nCount) - 1;
-    long       nStartRow       = 0;
-    long       nEndRow         = 0;
-    long       i                       = 0;
-    BOOL       bFound          = (nCount == 1);
-    if (pData)
+    long nLo       = 0;
+    long nHi       = static_cast<long>(nCount) - 1;
+    long nStartRow = 0;
+    long nEndRow   = 0;
+    long i         = 0;
+    BOOL bFound    = (nCount == 1);
+
+    if ( pData )
     {
         while ( !bFound && nLo <= nHi )
         {
@@ -510,7 +511,7 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern
                 pDocument->SetStreamValid(nTab, FALSE);
         }
     }
-//     InfoBox(0, String(nCount) + String(" Eintraege") ).Execute();
+// InfoBox(0, String(nCount) + String(" Eintraege") ).Execute();
 
 #ifdef DBG_UTIL
     TestData();
@@ -630,21 +631,21 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
 
         do
         {
-            const ScPatternAttr*       pOldPattern = pData[nPos].pPattern;
-            const SfxItemSet&       rOldSet = pOldPattern->GetItemSet();
-            const SfxPoolItem*      pBoxItem = 0;
-            SfxItemState            eState = rOldSet.GetItemState( ATTR_BORDER, TRUE, &pBoxItem );
-            const SfxPoolItem*      pTLBRItem = 0;
-            SfxItemState            eTLBRState = rOldSet.GetItemState( ATTR_BORDER_TLBR, TRUE, 
&pTLBRItem );
-            const SfxPoolItem*      pBLTRItem = 0;
-            SfxItemState            eBLTRState = rOldSet.GetItemState( ATTR_BORDER_BLTR, TRUE, 
&pBLTRItem );
+            const ScPatternAttr*  pOldPattern = pData[nPos].pPattern;
+            const SfxItemSet&     rOldSet = pOldPattern->GetItemSet();
+            const SfxPoolItem*    pBoxItem = 0;
+            SfxItemState          eState = rOldSet.GetItemState( ATTR_BORDER, TRUE, &pBoxItem );
+            const SfxPoolItem*    pTLBRItem = 0;
+            SfxItemState          eTLBRState = rOldSet.GetItemState( ATTR_BORDER_TLBR, TRUE, 
&pTLBRItem );
+            const SfxPoolItem*    pBLTRItem = 0;
+            SfxItemState          eBLTRState = rOldSet.GetItemState( ATTR_BORDER_BLTR, TRUE, 
&pBLTRItem );
 
             if ( (SFX_ITEM_SET == eState) || (SFX_ITEM_SET == eTLBRState) || (SFX_ITEM_SET == 
eBLTRState) )
             {
-                ScPatternAttr* pNewPattern = new ScPatternAttr(*pOldPattern);
+                ScPatternAttr*  pNewPattern = new ScPatternAttr(*pOldPattern);
                 SfxItemSet&     rNewSet = pNewPattern->GetItemSet();
-                SCROW                  nY1 = nStart;
-                SCROW                  nY2 = pData[nPos].nRow;
+                SCROW           nY1 = nStart;
+                SCROW           nY2 = pData[nPos].nRow;
 
                 SvxBoxItem*     pNewBoxItem = pBoxItem ? (SvxBoxItem*)pBoxItem->Clone() : 0;
                 SvxLineItem*    pNewTLBRItem = pTLBRItem ? (SvxLineItem*)pTLBRItem->Clone() : 0;
@@ -654,12 +655,16 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
 
                 if ( !pLine )
                 {
-                    if( pNewBoxItem )
+                    if ( pNewBoxItem )
                     {
-                        if ( pNewBoxItem->GetTop() )    pNewBoxItem->SetLine( NULL, BOX_LINE_TOP );
-                        if ( pNewBoxItem->GetBottom() ) pNewBoxItem->SetLine( NULL, 
BOX_LINE_BOTTOM );
-                        if ( pNewBoxItem->GetLeft() )   pNewBoxItem->SetLine( NULL, BOX_LINE_LEFT 
);
-                        if ( pNewBoxItem->GetRight() )  pNewBoxItem->SetLine( NULL, BOX_LINE_RIGHT 
);
+                        if ( pNewBoxItem->GetTop() )
+                            pNewBoxItem->SetLine( NULL, BOX_LINE_TOP );
+                        if ( pNewBoxItem->GetBottom() )
+                            pNewBoxItem->SetLine( NULL, BOX_LINE_BOTTOM );
+                        if ( pNewBoxItem->GetLeft() )
+                            pNewBoxItem->SetLine( NULL, BOX_LINE_LEFT );
+                        if ( pNewBoxItem->GetRight() )
+                            pNewBoxItem->SetLine( NULL, BOX_LINE_RIGHT );
                     }
                     if ( pNewTLBRItem && pNewTLBRItem->GetLine() )
                         pNewTLBRItem->SetLine( 0 );
@@ -858,7 +863,7 @@ void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource )
     const SfxPoolItem* pOldItem;
     for (USHORT nId=ATTR_PATTERN_START; nId<=ATTR_PATTERN_END; nId++)
     {
-        //     pMergeSet has no parent
+        // pMergeSet has no parent
         SfxItemState eOldState = rMergeSet.GetItemState( nId, FALSE, &pOldItem );
 
         if ( eOldState == SFX_ITEM_DEFAULT )
@@ -1075,11 +1080,12 @@ void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* 
pLine
 
 // ApplyFrame - on an entry into the array
 
-BOOL ScAttrArray::ApplyFrame( const SvxBoxItem*                pBoxItem,
-                              const SvxBoxInfoItem* pBoxInfoItem,
-                              SCROW nStartRow, SCROW nEndRow,
-                              BOOL bLeft, SCCOL nDistRight, BOOL bTop, SCROW nDistBottom )
-{
+BOOL ScAttrArray::ApplyFrame(
+  const SvxBoxItem*  pBoxItem, const SvxBoxInfoItem* pBoxInfoItem,
+  SCROW nStartRow,             SCROW nEndRow,
+  BOOL bLeft,                  SCCOL nDistRight,
+  BOOL bTop,                   SCROW nDistBottom
+) {
     DBG_ASSERT( pBoxItem && pBoxInfoItem, "Linienattribute fehlen!" );
 
     const ScPatternAttr* pPattern = GetPattern( nStartRow );
@@ -1118,7 +1124,7 @@ BOOL ScAttrArray::ApplyFrame( const SvxBoxItem*           pBoxItem,
         SfxItemPoolCache aCache( pDocument->GetPool(), &aNewFrame );
         ApplyCacheArea( nStartRow, nEndRow, &aCache );
 
-/*             ScPatternAttr* pNewPattern = (ScPatternAttr*) pPattern->Clone();
+/*        ScPatternAttr* pNewPattern = (ScPatternAttr*) pPattern->Clone();
         pNewPattern->GetItemSet().Put( aNewFrame );
         SetPatternArea( nStartRow, nEndRow, pNewPattern, TRUE );
 */
@@ -1179,12 +1185,12 @@ long lcl_LineSize( const SvxBorderLine& rLine )
         DBG_ASSERT( rLine.GetOutWidth() && rLine.GetInWidth(),
                         "Line has a distance, but only a width?" );
 
-//             nTotal += ( nDist > 40 ) ? ( nDist / 2 ) : 20;
+//        nTotal += ( nDist > 40 ) ? ( nDist / 2 ) : 20;
         nTotal += ( nDist > 20 ) ? nDist : 20;
         nTotal += ( nWidth > 20 ) ? nWidth : 20;
     }
     else if (nWidth)
-//             nTotal += ( nWidth > 40 ) ? ( nWidth / 2 ) : 20;
+//        nTotal += ( nWidth > 40 ) ? ( nWidth / 2 ) : 20;
         nTotal += ( nWidth > 20 ) ? nWidth  : 20;
 
         // also halved ???
@@ -1465,8 +1471,8 @@ BOOL ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
 
         pPattern = pData[nIndex].pPattern;
         pItem = (const ScMergeAttr*) &pPattern->GetItem( ATTR_MERGE );
-        SCsCOL nCountX = pItem->GetColMerge();
-        SCsROW nCountY = pItem->GetRowMerge();
+        SCsCOL nCountX = pItem->GetColMerge();
+        SCsROW nCountY = pItem->GetRowMerge();
         if (nCountX>1 || nCountY>1)
         {
             const ScMergeAttr* pAttr = (const ScMergeAttr*)
@@ -1480,13 +1486,13 @@ BOOL ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
             SCCOL nMergeEndCol = nThisCol + nCountX - 1;
             SCROW nMergeEndRow = nThisEnd + nCountY - 1;
 
-            //!        ApplyAttr fuer Bereiche !!!
+            // ApplyAttr for areas
 
             for (SCROW nThisRow = nThisStart; nThisRow <= nThisEnd; nThisRow++)
                 pDocument->ApplyAttr( nThisCol, nThisRow, nTab, *pAttr );
 
-            ScPatternAttr*     pNewPattern = new ScPatternAttr( pDocument->GetPool() );
-            SfxItemSet*                pSet = &pNewPattern->GetItemSet();
+            ScPatternAttr*  pNewPattern = new ScPatternAttr( pDocument->GetPool() );
+            SfxItemSet*     pSet = &pNewPattern->GetItemSet();
             pSet->Put( *pFlagAttr );
             pDocument->ApplyPatternAreaTab( nThisCol, nThisStart, nMergeEndCol, nMergeEndRow,
                                                 nTab, *pNewPattern );
@@ -1516,13 +1522,13 @@ void ScAttrArray::DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow)
 void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow,
                         const ScPatternAttr* pWantedPattern, BOOL bDefault )
 {
-    const ScPatternAttr*       pOldPattern;
-    const ScMergeFlagAttr*     pItem;
+    const ScPatternAttr*    pOldPattern;
+    const ScMergeFlagAttr*  pItem;
 
-    SCSIZE     nIndex;
-    SCROW      nRow;
-    SCROW      nThisRow;
-    BOOL       bFirstUse = TRUE;
+    SCSIZE  nIndex;
+    SCROW   nRow;
+    SCROW   nThisRow;
+    BOOL    bFirstUse = TRUE;
 
     Search( nStartRow, nIndex );
     nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
@@ -1538,12 +1544,12 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow,
 
             if (pItem->IsOverlapped() || pItem->HasAutoFilter())
             {
-                //     #108045# default-constructing a ScPatternAttr for DeleteArea doesn't work
-                //     because it would have no cell style information.
-                //     Instead, the document's GetDefPattern is copied. Since it is passed as
-                //     pWantedPattern, no special treatment of default is needed here anymore.
-                ScPatternAttr* pNewPattern = new ScPatternAttr( *pWantedPattern );
-                SfxItemSet*            pSet = &pNewPattern->GetItemSet();
+                // #108045# default-constructing a ScPatternAttr for DeleteArea doesn't work
+                // because it would have no cell style information.
+                // Instead, the document's GetDefPattern is copied. Since it is passed as
+                // pWantedPattern, no special treatment of default is needed here anymore.
+                ScPatternAttr*  pNewPattern = new ScPatternAttr( *pWantedPattern );
+                SfxItemSet*     pSet = &pNewPattern->GetItemSet();
                 pSet->Put( *pItem );
                 SetPatternArea( nThisRow, nAttrRow, pNewPattern, TRUE );
                 delete pNewPattern;
@@ -1574,11 +1580,11 @@ BOOL ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, INT16 nFlags )
 {
     const ScPatternAttr* pOldPattern;
 
-    INT16      nOldValue;
-    SCSIZE     nIndex;
-    SCROW      nRow;
-    SCROW      nThisRow;
-    BOOL       bChanged = FALSE;
+    INT16   nOldValue;
+    SCSIZE  nIndex;
+    SCROW   nRow;
+    SCROW   nThisRow;
+    BOOL    bChanged = FALSE;
 
     Search( nStartRow, nIndex );
     nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
@@ -1611,11 +1617,11 @@ BOOL ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, INT16 nFlags 
)
 {
     const ScPatternAttr* pOldPattern;
 
-    INT16      nOldValue;
-    SCSIZE     nIndex;
-    SCROW      nRow;
-    SCROW      nThisRow;
-    BOOL       bChanged = FALSE;
+    INT16   nOldValue;
+    SCSIZE  nIndex;
+    SCROW   nRow;
+    SCROW   nThisRow;
+    BOOL    bChanged = FALSE;
 
     Search( nStartRow, nIndex );
     nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
@@ -1648,9 +1654,9 @@ void ScAttrArray::ClearItems( SCROW nStartRow, SCROW nEndRow, const USHORT* 
pWhi
 {
     const ScPatternAttr* pOldPattern;
 
-    SCSIZE     nIndex;
-    SCROW      nRow;
-    SCROW      nThisRow;
+    SCSIZE  nIndex;
+    SCROW   nRow;
+    SCROW   nThisRow;
 
     Search( nStartRow, nIndex );
     nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
@@ -1773,8 +1779,8 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, 
ScFlatBo
         SCROW nEnd = pData[nPos].nRow;
         if (pData[nPos].pPattern->GetStyleSheet() == pStyleSheet)
         {
-//                     for (SCROW nRow = nStart; nRow <= nEnd; nRow++)
-//                             pUsed[nRow] = TRUE;
+//         for (SCROW nRow = nStart; nRow <= nEnd; nRow++)
+//            pUsed[nRow] = TRUE;
 
             rUsedRows.setTrue(nStart, nEnd);
 
@@ -1807,8 +1813,8 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, 
ScFlatBo
 BOOL ScAttrArray::IsStyleSheetUsed( const ScStyleSheet& rStyle,
         BOOL bGatherAllStyles ) const
 {
-    BOOL       bIsUsed = FALSE;
-    SCSIZE     nPos    = 0;
+    BOOL    bIsUsed = FALSE;
+    SCSIZE  nPos    = 0;
 
     while ( nPos < nCount )
     {
@@ -1857,7 +1863,7 @@ BOOL ScAttrArray::GetFirstVisibleAttr( SCROW& rFirstRow ) const
     SCSIZE nVisStart = 1;
     while ( nVisStart < nCount && 
pData[nVisStart].pPattern->IsVisibleEqual(*pData[nVisStart-1].pPattern) )
         ++nVisStart;
-    if ( nVisStart >= nCount || pData[nVisStart-1].nRow > 0 )  // more than 1 row?
+    if ( nVisStart >= nCount || pData[nVisStart-1].nRow > 0 )  // more than 1 row?
         nStart = nVisStart;
 
     while ( nStart < nCount && !bFound )
@@ -2054,7 +2060,7 @@ BOOL ScAttrArray::TestInsertRow( SCSIZE nSize ) const
 
     if (pData)
     {
-        // MAXROW + 1 - nSize  = 1st row pushed out
+        // MAXROW + 1 - nSize  = 1st row pushed out
 
         SCSIZE nFirstLost = nCount-1;
         while ( nFirstLost && pData[nFirstLost-1].nRow >= sal::static_int_cast<SCROW>(MAXROW + 1 - 
nSize) )
@@ -2196,9 +2202,9 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow)
     const ScPatternAttr* pDefPattern = pDocument->GetDefPattern();
     const ScPatternAttr* pOldPattern;
 
-    SCSIZE     nIndex;
-    SCROW      nRow;
-    SCROW      nThisRow;
+    SCSIZE  nIndex;
+    SCROW   nRow;
+    SCROW   nThisRow;
 
     Search( nStartRow, nIndex );
     nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
@@ -2242,7 +2248,7 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& 
rAttrArray
     {
         if ((pData[i].nRow >= nStartRow) && ((i==0) ? TRUE : pData[i-1].nRow < nEndRow))
         {
-            // Kopieren (bPutToPool=TRUE)
+            // Kopieren (bPutToPool=TRUE)
             rAttrArray.SetPatternArea( nStart, Min( (SCROW)pData[i].nRow, (SCROW)nEndRow ),
                                         pData[i].pPattern, TRUE );
         }

commit bd16e76577dd97b046d28a41dac27ee4409fa086
Author: Kevin Hunter <hunteke@earlham.edu>
Date:   Mon Oct 18 14:27:40 2010 -0400

    Comment and debug translation
    
    - Translated German comments to English
    - Minor, minor code formatting changes

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 6337dc0..557f7fc 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.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
@@ -81,7 +81,7 @@ ScAttrArray::ScAttrArray( SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc ) :
     if (pData)
     {
         pData[0].nRow = MAXROW;
-        pData[0].pPattern = pDocument->GetDefPattern();                // ohne Put !!!
+        pData[0].pPattern = pDocument->GetDefPattern(); // no put
     }
 }
 
@@ -146,7 +146,7 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, BOOL bAlloc )
 
         for (SCSIZE i=0; i<nCount; i++)
         {
-            // ueberpruefen, ob Attributierung die Textbreite der Zelle aendert
+            // ensure that attributing changes text width of cell
             pOldPattern = pData[i].pPattern;
             BOOL bNumFormatChanged;
             if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged,
@@ -159,7 +159,7 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, BOOL bAlloc )
                 DBGOUTPUT("Reset");
 #endif
             }
-            // bedingtes Format gesetzt oder geloescht?
+            // conditional format or deleted?
             if ( &pPattern->GetItem(ATTR_CONDITIONAL) != &pOldPattern->GetItem(ATTR_CONDITIONAL) )
             {
                 pDocument->ConditionalChanged( ((const SfxUInt32Item&)
@@ -188,7 +188,7 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, BOOL bAlloc )
         else
         {
             nCount = nLimit = 0;
-            pData = NULL;                              // muss sofort wieder belegt werden !
+            pData = NULL;        // should be immediately occupied again
         }
     }
 }
@@ -370,8 +370,8 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern
                 }
             }
 
-            // ueberpruefen, ob Attributierung die Textbreite der Zelle aendert
-            // oder bedingte Formate neu gesetzt oder geloescht werden
+            // ensure that attributing changes text width of cell
+            // otherwise, conditional formats need to be reset or deleted
             while ( ns <= nEndRow )
             {
                 const SfxItemSet& rNewSet = pPattern->GetItemSet();
@@ -557,9 +557,8 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
             }
             else
             {
-                // ueberpruefen, ob Attributierung die Textbreite der Zelle aendert
-                // bedingte Formate in Vorlagen gibt es (noch) nicht
-
+              // ensure attributing changes text width of cell; otherwise
+              // there aren't (yet) template format changes
                 const SfxItemSet& rNewSet = pNewPattern->GetItemSet();
                 const SfxItemSet& rOldSet = pOldPattern->GetItemSet();
 
@@ -597,21 +596,20 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, 
ScStyleSheet*
 }
 
 
-    // const wird weggecastet, weil es sonst
-    // zu ineffizient/kompliziert wird!
-#define SET_LINECOLOR(dest,c)                                          \
-    if ((dest))                                                                                \
-    {                                                                                          \
-        ((SvxBorderLine*)(dest))->SetColor((c));       \
+    // const cast, otherwise it will be to innefficient/complicated
+#define SET_LINECOLOR(dest,c)                    \
+    if ((dest))                                  \
+    {                                            \
+        ((SvxBorderLine*)(dest))->SetColor((c)); \
     }
 
-#define SET_LINE(dest,src)                                                             \
-    if ((dest))                                                                                    
    \
-    {                                                                                              
    \
-        SvxBorderLine* pCast = (SvxBorderLine*)(dest); \
-        pCast->SetOutWidth((src)->GetOutWidth());              \
-        pCast->SetInWidth ((src)->GetInWidth());               \
-        pCast->SetDistance((src)->GetDistance());              \
+#define SET_LINE(dest,src)                             \
+    if ((dest))                                        \
+    {                                                  \
+        SvxBorderLine* pCast = (SvxBorderLine*)(dest); \
+        pCast->SetOutWidth((src)->GetOutWidth());      \
+        pCast->SetInWidth( (src)->GetInWidth() );      \
+        pCast->SetDistance((src)->GetDistance());      \
     }
 
 void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
@@ -652,7 +650,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
                 SvxLineItem*    pNewTLBRItem = pTLBRItem ? (SvxLineItem*)pTLBRItem->Clone() : 0;
                 SvxLineItem*    pNewBLTRItem = pBLTRItem ? (SvxLineItem*)pBLTRItem->Clone() : 0;
 
-                // Linienattribute holen und mit Parametern aktualisieren
+                // fetch line and update attributes with parameters
 
                 if ( !pLine )
                 {
@@ -663,9 +661,9 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
                         if ( pNewBoxItem->GetLeft() )   pNewBoxItem->SetLine( NULL, BOX_LINE_LEFT 
);
                         if ( pNewBoxItem->GetRight() )  pNewBoxItem->SetLine( NULL, BOX_LINE_RIGHT 
);
                     }
-                    if( pNewTLBRItem && pNewTLBRItem->GetLine() )
+                    if ( pNewTLBRItem && pNewTLBRItem->GetLine() )
                         pNewTLBRItem->SetLine( 0 );
-                    if( pNewBLTRItem && pNewBLTRItem->GetLine() )
+                    if ( pNewBLTRItem && pNewBLTRItem->GetLine() )
                         pNewBLTRItem->SetLine( 0 );
                 }
                 else
@@ -673,26 +671,26 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
                     if ( bColorOnly )
                     {
                         Color aColor( pLine->GetColor() );
-                        if( pNewBoxItem )
+                        if ( pNewBoxItem )
                         {
                             SET_LINECOLOR( pNewBoxItem->GetTop(),    aColor );
                             SET_LINECOLOR( pNewBoxItem->GetBottom(), aColor );
                             SET_LINECOLOR( pNewBoxItem->GetLeft(),   aColor );
-                            SET_LINECOLOR( pNewBoxItem->GetRight(),   aColor );
+                            SET_LINECOLOR( pNewBoxItem->GetRight(),  aColor );
                         }
-                        if( pNewTLBRItem )
+                        if ( pNewTLBRItem )
                             SET_LINECOLOR( pNewTLBRItem->GetLine(), aColor );
-                        if( pNewBLTRItem )
+                        if ( pNewBLTRItem )
                             SET_LINECOLOR( pNewBLTRItem->GetLine(), aColor );
                     }
                     else
                     {
-                        if( pNewBoxItem )
+                        if ( pNewBoxItem )
                         {
                             SET_LINE( pNewBoxItem->GetTop(),    pLine );
                             SET_LINE( pNewBoxItem->GetBottom(), pLine );
                             SET_LINE( pNewBoxItem->GetLeft(),   pLine );
-                            SET_LINE( pNewBoxItem->GetRight(),   pLine );
+                            SET_LINE( pNewBoxItem->GetRight(),  pLine );
                         }
                         if( pNewTLBRItem )
                             SET_LINE( pNewTLBRItem->GetLine(), pLine );
@@ -708,14 +706,14 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
 
                 if ( nY1 < nStartRow || nY2 > nEndRow )
                 {
-                    if (nY1 < nStartRow) nY1=nStartRow;
-                    if (nY2 > nEndRow) nY2=nEndRow;
+                    if (nY1 < nStartRow) nY1 = nStartRow;
+                    if (nY2 > nEndRow)   nY2 = nEndRow;
                     SetPatternArea( nY1, nY2, pNewPattern, TRUE );
                     Search( nStart, nPos );
                 }
                 else
                 {
-                        //! aus Pool loeschen?
+                        // remove from pool?
                     pDocument->GetPool()->Remove(*pData[nPos].pPattern);
                     pData[nPos].pPattern = (const ScPatternAttr*)
                                 &pDocument->GetPool()->Put(*pNewPattern);
@@ -756,12 +754,12 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, 
SfxItemPoolCac
         SCROW nStart=0;
         if (!Search( nStartRow, nPos ))
         {
-            DBG_ERROR("Search-Fehler");
+            DBG_ERROR("Search Failure");
             return;
         }
 
         ScAddress aAdrStart( nCol, 0, nTab );
-        ScAddress aAdrEnd  ( nCol, 0, nTab );
+        ScAddress aAdrEnd(   nCol, 0, nTab );
 
         do
         {
@@ -777,14 +775,14 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, 
SfxItemPoolCac
 
                 if ( nY1 < nStartRow || nY2 > nEndRow )
                 {
-                    if (nY1 < nStartRow) nY1=nStartRow;
-                    if (nY2 > nEndRow) nY2=nEndRow;
+                    if (nY1 < nStartRow) nY1 = nStartRow;
+                    if (nY2 > nEndRow)   nY2 = nEndRow;
                     SetPatternArea( nY1, nY2, pNewPattern, false, pDataArray );
                     Search( nStart, nPos );
                 }
                 else
                 {
-                    // ueberpruefen, ob Attributierung die Textbreite der Zelle aendert
+                    // ensure attributing changes text-width of cell
 
                     const SfxItemSet& rNewSet = pNewPattern->GetItemSet();
                     const SfxItemSet& rOldSet = pOldPattern->GetItemSet();
@@ -801,7 +799,7 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac
 #endif
                     }
 
-                    // bedingte Formate neu gesetzt oder geloescht ?
+                    // Reset conditional formats or delete ?
 
                     if ( &rNewSet.Get(ATTR_CONDITIONAL) != &rOldSet.Get(ATTR_CONDITIONAL) )
                     {
@@ -821,8 +819,8 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac
             }
             else
             {
-//!!!!!!!!!!!!!!!!!! mit diesem Remove gibt es Abstuerze (Calc1 Import)
-//!                            pDocument->GetPool()->Remove(*pNewPattern);
+                // Remove this unexplained crash (Calc1 import)
+                // pDocument->GetPool()->Remove(*pNewPattern);
                 nStart = pData[nPos].nRow + 1;
                 ++nPos;
             }
@@ -860,10 +858,10 @@ void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource )
     const SfxPoolItem* pOldItem;
     for (USHORT nId=ATTR_PATTERN_START; nId<=ATTR_PATTERN_END; nId++)
     {
-        //     pMergeSet hat keinen Parent
+        //     pMergeSet has no parent
         SfxItemState eOldState = rMergeSet.GetItemState( nId, FALSE, &pOldItem );
 
-        if ( eOldState == SFX_ITEM_DEFAULT )                           // Default
+        if ( eOldState == SFX_ITEM_DEFAULT )
         {
             SfxItemState eNewState = rSource.GetItemState( nId, TRUE, &pNewItem );
             if ( eNewState == SFX_ITEM_SET )
@@ -872,21 +870,21 @@ 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 )
         {
             SfxItemState eNewState = rSource.GetItemState( nId, TRUE, &pNewItem );
             if ( eNewState == SFX_ITEM_SET )
             {
-                if ( pNewItem != pOldItem )                                    // beide gepuhlt
+                if ( pNewItem != pOldItem )
                     rMergeSet.InvalidateItem( nId );
             }
-            else                       // Default
+            else  // Default
             {
                 if ( *pOldItem != rSource.GetPool()->GetDefaultItem(nId) )
                     rMergeSet.InvalidateItem( nId );
             }
         }
-        //     Dontcare bleibt Dontcare
+        // Dontcare remains Dontcare
     }
 }
 
@@ -900,13 +898,13 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow,
         SCROW nStart=0;
         if (!Search( nStartRow, nPos ))
         {
-            DBG_ERROR("Search-Fehler");
+            DBG_ERROR("Search failure");
             return;
         }
 
         do
         {
-            // gleiche Patterns muessen nicht mehrfach angesehen werden
+            // similar patterns must not be repeated
 
             const ScPatternAttr* pPattern = pData[nPos].pPattern;
             if ( pPattern != rState.pOld1 && pPattern != rState.pOld2 )
@@ -914,9 +912,6 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow,
                 const SfxItemSet& rThisSet = pPattern->GetItemSet();
                 if (rState.pItemSet)
                 {
-                    // (*ppSet)->MergeValues( rThisSet, FALSE );
-                    // geht nicht, weil die Vorlagen nicht beruecksichtigt werden
-
                     if (bDeep)
                         lcl_MergeDeep( *rState.pItemSet, rThisSet );
                     else
@@ -924,7 +919,7 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow,
                 }
                 else
                 {
-                    // erstes Pattern - in Set ohne Parent kopieren
+                    // first pattern - copied from parent
                     rState.pItemSet = new SfxItemSet( *rThisSet.GetPool(), rThisSet.GetRanges() );
                     rState.pItemSet->Set( rThisSet, bDeep );
                 }
@@ -942,19 +937,19 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow,
 
 
 
-//                     Umrandung zusammenbauen
+// assemble border
 
 BOOL lcl_TestAttr( const SvxBorderLine* pOldLine, const SvxBorderLine* pNewLine,
                             BYTE& rModified, const SvxBorderLine*& rpNew )
 {
     if (rModified == SC_LINE_DONTCARE)
-        return FALSE;                                          // weiter geht's nicht
+        return FALSE;               // don't go again
 
     if (rModified == SC_LINE_EMPTY)
     {
         rModified = SC_LINE_SET;
         rpNew = pNewLine;
-        return TRUE;                                           // zum ersten mal gesetzt
+        return TRUE;                // initial value
     }
 
     if (pOldLine == pNewLine)
@@ -972,7 +967,7 @@ BOOL lcl_TestAttr( const SvxBorderLine* pOldLine, const SvxBorderLine* pNewLine,
 
     rModified = SC_LINE_DONTCARE;
     rpNew = NULL;
-    return TRUE;                                                       // andere Linie -> dontcare
+    return TRUE;              // another line -> don't care
 }
 
 
@@ -980,7 +975,7 @@ void lcl_MergeToFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
                                 ScLineFlags& rFlags, const ScPatternAttr* pPattern,
                                 BOOL bLeft, SCCOL nDistRight, BOOL bTop, SCROW nDistBottom )
 {
-    // rechten/unteren Rahmen setzen, wenn Zelle bis zum Ende zusammengefasst:
+    // right/bottom border set when connected together
     const ScMergeAttr& rMerge = (const ScMergeAttr&)pPattern->GetItem(ATTR_MERGE);
     if ( rMerge.GetColMerge() == nDistRight + 1 )
         nDistRight = 0;
@@ -988,9 +983,9 @@ void lcl_MergeToFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
         nDistBottom = 0;
 
     const SvxBoxItem* pCellFrame = (SvxBoxItem*) &pPattern->GetItemSet().Get( ATTR_BORDER );
-    const SvxBorderLine* pLeftAttr      = pCellFrame->GetLeft();
-    const SvxBorderLine* pRightAttr     = pCellFrame->GetRight();
-    const SvxBorderLine* pTopAttr       = pCellFrame->GetTop();
+    const SvxBorderLine* pLeftAttr   = pCellFrame->GetLeft();
+    const SvxBorderLine* pRightAttr  = pCellFrame->GetRight();
+    const SvxBorderLine* pTopAttr    = pCellFrame->GetTop();
     const SvxBorderLine* pBottomAttr = pCellFrame->GetBottom();
     const SvxBorderLine* pNew;
 
@@ -1066,7 +1061,7 @@ void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* 
pLine
             pPattern = (ScPatternAttr*) pData[i].pPattern;
             lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, FALSE,
                             nEndRow - Min( pData[i].nRow, (SCROW)(nEndRow-1) ) );
-            // nDistBottom hier immer > 0
+            // nDistBottom her always > 0
         }
 
         pPattern = GetPattern( nEndRow );
@@ -1075,11 +1070,10 @@ void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* 
pLine
 }
 
 //
-//     Rahmen anwenden
+// apply border
 //
 
-//     ApplyFrame - auf einen Eintrag im Array
-
+// ApplyFrame - on an entry into the array
 
 BOOL ScAttrArray::ApplyFrame( const SvxBoxItem*                pBoxItem,
                               const SvxBoxInfoItem* pBoxInfoItem,
@@ -1092,7 +1086,7 @@ BOOL ScAttrArray::ApplyFrame( const SvxBoxItem*           pBoxItem,
     const SvxBoxItem* pOldFrame = (const SvxBoxItem*)
                                   &pPattern->GetItemSet().Get( ATTR_BORDER );
 
-    // rechten/unteren Rahmen setzen, wenn Zelle bis zum Ende zusammengefasst:
+    // right/bottom border set when connected together
     const ScMergeAttr& rMerge = (const ScMergeAttr&)pPattern->GetItem(ATTR_MERGE);
     if ( rMerge.GetColMerge() == nDistRight + 1 )
         nDistRight = 0;
@@ -1143,7 +1137,7 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const 
SvxBoxInf
         ApplyFrame( pLineOuter, pLineInner, nStartRow, nStartRow, bLeft, nDistRight,
                         TRUE, nEndRow-nStartRow );
 
-        if ( nEndRow > nStartRow+1 )                           // innerer Teil vorhanden?
+        if ( nEndRow > nStartRow+1 )     // inner part available?
         {
             SCSIZE nStartIndex;
             SCSIZE nEndIndex;
@@ -1174,8 +1168,8 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const 
SvxBoxInf
 
 long lcl_LineSize( const SvxBorderLine& rLine )
 {
-    // nur eine Linie -> halbe Breite, min. 20
-    // doppelte Linie -> halber Abstand + eine Linie (je min. 20)
+    // only one line -> half width, min. 20
+    // double line   -> half line spacing + (per min. 20)
 
     long nTotal = 0;
     USHORT nWidth = Max( rLine.GetOutWidth(), rLine.GetInWidth() );
@@ -1183,7 +1177,7 @@ long lcl_LineSize( const SvxBorderLine& rLine )
     if (nDist)
     {
         DBG_ASSERT( rLine.GetOutWidth() && rLine.GetInWidth(),
-                        "Linie hat Abstand, aber nur eine Breite ???" );
+                        "Line has a distance, but only a width?" );
 
 //             nTotal += ( nDist > 40 ) ? ( nDist / 2 ) : 20;
         nTotal += ( nDist > 20 ) ? nDist : 20;
@@ -1193,7 +1187,7 @@ long lcl_LineSize( const SvxBorderLine& rLine )
 //             nTotal += ( nWidth > 40 ) ? ( nWidth / 2 ) : 20;
         nTotal += ( nWidth > 20 ) ? nWidth  : 20;
 
-        //!    auch halbieren ???
+        // also halved ???
 
     return nTotal;
 }
@@ -1212,7 +1206,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
     const SvxBorderLine* pLine = 0;
     long nCmp;
 
-    // oben
+    // top
 
     pItem = (const SvxBoxItem*) &pData[nStartIndex].pPattern->GetItem(ATTR_BORDER);
     pLine = pItem->GetTop();
@@ -1224,7 +1218,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
         bFound = TRUE;
     }
 
-    // unten
+    // down
 
     if ( nEndIndex != nStartIndex )
         pItem = (const SvxBoxItem*) &pData[nEndIndex].pPattern->GetItem(ATTR_BORDER);
@@ -1242,8 +1236,6 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
         {
             pItem = (const SvxBoxItem*) &pData[i].pPattern->GetItem(ATTR_BORDER);
 
-            // links
-
             if (bLeft)
             {
                 pLine = pItem->GetLeft();
@@ -1256,8 +1248,6 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
                 }
             }
 
-            // rechts
-
             if (bRight)
             {
                 pLine = pItem->GetRight();
@@ -1274,7 +1264,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
     return bFound;
 }
 
-//     Testen, ob Bereich bestimmtes Attribut enthaelt
+// Test if field contains specific attribute
 
 bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const
 {
@@ -1389,9 +1379,7 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const
     return bFound;
 }
 
-//     Bereich um evtl. enthaltene Zusammenfassungen erweitern
-//     und evtl. MergeFlag anpassen (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, BOOL bAttrs )
@@ -1408,8 +1396,8 @@ BOOL ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
     {
         pPattern = pData[i].pPattern;
         pItem = (const ScMergeAttr*) &pPattern->GetItem( ATTR_MERGE );
-        SCsCOL nCountX = pItem->GetColMerge();
-        SCsROW nCountY = pItem->GetRowMerge();
+        SCsCOL nCountX = pItem->GetColMerge();
+        SCsROW nCountY = pItem->GetRowMerge();
         if (nCountX>1 || nCountY>1)
         {
             SCROW nThisRow = (i>0) ? pData[i-1].nRow+1 : 0;
@@ -1446,7 +1434,7 @@ BOOL ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
                     pDocument->ApplyFlagsTab( nThisCol+1, nThisRow+1, nMergeEndCol, nMergeEndRow,
                                 nTab, SC_MF_HOR | SC_MF_VER );
 
-                Search( nThisRow, i );                                 // Daten wurden veraendert
+                Search( nThisRow, i );    // Data changed
                 Search( nStartRow, nStartIndex );
                 Search( nEndRow, nEndIndex );
             }
@@ -1486,7 +1474,7 @@ BOOL ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
             const ScMergeFlagAttr* pFlagAttr = (const ScMergeFlagAttr*)
                                             &pDocument->GetPool()->GetDefaultItem( ATTR_MERGE_FLAG 
);
 
-            DBG_ASSERT( nCountY==1 || nThisStart==nThisEnd, "was'n hier los?" );
+            DBG_ASSERT( nCountY==1 || nThisStart==nThisEnd, "What's up?" );
 
             SCCOL nThisCol = nCol;
             SCCOL nMergeEndCol = nThisCol + nCountX - 1;
@@ -1504,20 +1492,20 @@ BOOL ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
                                                 nTab, *pNewPattern );
             delete pNewPattern;
 
-            Search( nThisEnd, nIndex );                                        // Daten wurden 
veraendert !!!
+            Search( nThisEnd, nIndex );    // data changed
         }
 
         ++nIndex;
         if ( nIndex < nCount )
             nThisStart = pData[nIndex-1].nRow+1;
         else
-            nThisStart = MAXROW+1;             // Ende
+            nThisStart = MAXROW+1;   // End
     }
 
     return bFound;
 }
 
-            //         Bereich loeschen, aber Merge-Flags stehenlassen
+// Remove field, but leave MergeFlags
 
 void ScAttrArray::DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow)
 {
@@ -1541,7 +1529,7 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow,
     while ( nThisRow <= nEndRow )
     {
         pOldPattern = pData[nIndex].pPattern;
-        if (pOldPattern != pWantedPattern)                                                     //! 
else-Zweig ?
+        if (pOldPattern != pWantedPattern)
         {
             if (nThisRow < nStartRow) nThisRow = nStartRow;
             nRow = pData[nIndex].nRow;
@@ -1567,12 +1555,13 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow,
                     if (bFirstUse)
                         bFirstUse = FALSE;
                     else
-                        pDocument->GetPool()->Put( *pWantedPattern );          // im Pool ist es 
schon!
+                        // it's in the pool
+                        pDocument->GetPool()->Put( *pWantedPattern );
                 }
                 SetPatternArea( nThisRow, nAttrRow, pWantedPattern );
             }
 
-            Search( nThisRow, nIndex );                                        // Daten wurden 
veraendert !!!
+            Search( nThisRow, nIndex );   // data changed
         }
 
         ++nIndex;
@@ -1606,7 +1595,7 @@ BOOL ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, INT16 nFlags )
             ScPatternAttr aNewPattern(*pOldPattern);
             aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue | nFlags ) );
             SetPatternArea( nThisRow, nAttrRow, &aNewPattern, TRUE );
-            Search( nThisRow, nIndex );                                                            
            // Daten wurden veraendert !!!
+            Search( nThisRow, nIndex );  // data changed
             bChanged = TRUE;
         }
 
@@ -1643,7 +1632,7 @@ BOOL ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, INT16 nFlags )
             ScPatternAttr aNewPattern(*pOldPattern);
             aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue & ~nFlags ) );
             SetPatternArea( nThisRow, nAttrRow, &aNewPattern, TRUE );
-            Search( nThisRow, nIndex );                                                            
            // Daten wurden veraendert !!!
+            Search( nThisRow, nIndex );  // data changed
             bChanged = TRUE;
         }
 
@@ -1678,7 +1667,7 @@ void ScAttrArray::ClearItems( SCROW nStartRow, SCROW nEndRow, const USHORT* 
pWhi
             nRow = pData[nIndex].nRow;
             SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
             SetPatternArea( nThisRow, nAttrRow, &aNewPattern, TRUE );
-            Search( nThisRow, nIndex );                                                            
            // Daten wurden veraendert !!!
+            Search( nThisRow, nIndex );  // data changed
         }
 
         ++nIndex;
@@ -1735,11 +1724,11 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, BOOL 
bIncrement
             SetPatternArea( nThisStart, nAttrRow, &aNewPattern, TRUE );
 
             nThisStart = nThisEnd + 1;
-            Search( nThisStart, nIndex );                              // Daten wurden veraendert 
!!!
+            Search( nThisStart, nIndex ); // data changed
         }
         else
         {
-            nThisStart = pData[nIndex].nRow + 1;               // weiterzaehlen...
+            nThisStart = pData[nIndex].nRow + 1;
             ++nIndex;
         }
     }
@@ -1759,7 +1748,7 @@ SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, BOOL bUp ) const
             if (bUp)
             {
                 if (nIndex==0)
-                    return -1;                                 // nichts gefunden
+                    return -1;   // not found
                 --nIndex;
                 nRet = pData[nIndex].nRow;
             }
@@ -1768,7 +1757,7 @@ SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, BOOL bUp ) const
                 nRet = pData[nIndex].nRow+1;
                 ++nIndex;
                 if (nIndex>=nCount)
-                    return MAXROW+1;                   // nichts gefunden
+                    return MAXROW +1; // not found
             }
         }
     }
@@ -1805,7 +1794,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, 
ScFlatBo
                 if (Concat(nPos))
                 {
                     Search(nStart, nPos);
-                    --nPos;                                                    // wegen ++ am Ende
+                    --nPos;   // because at end
                 }
             }
         }
@@ -1996,7 +1985,7 @@ BOOL ScAttrArray::IsVisibleEqual( const ScAttrArray& rOther,
 
 BOOL ScAttrArray::IsAllEqual( const ScAttrArray& rOther, SCROW nStartRow, SCROW nEndRow ) const
 {
-    //!        mit IsVisibleEqual zusammenfassen?
+    // summarised with IsVisibleEqual
 
     BOOL bEqual = TRUE;
     SCSIZE nThisPos = 0;
@@ -2033,8 +2022,8 @@ BOOL ScAttrArray::IsAllEqual( const ScAttrArray& rOther, SCROW nStartRow, 
SCROW
 
 BOOL ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
 {
-    // horizontal zusammengefasste duerfen nicht herausgeschoben werden
-    // (ob die ganze Zusammenfassung betroffen ist, ist hier nicht zu erkennen)
+    // Horizontal aggregate are not allowed to be moved out; if whole summary,
+    // here is not recognized
 
     BOOL bTest = TRUE;
     if (!IsEmpty())
@@ -2048,10 +2037,10 @@ BOOL ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
             if ( ((const ScMergeFlagAttr&)pData[nIndex].pPattern->
                         GetItem(ATTR_MERGE_FLAG)).IsHorOverlapped() )
             {
-                bTest = FALSE;                                         // darf nicht 
herausgeschoben werden
+                bTest = FALSE;  // may not be pushed out
                 break;
             }
-            if ( pData[nIndex].nRow >= nEndRow )       // Ende des Bereichs
+            if ( pData[nIndex].nRow >= nEndRow ) // end of range
                 break;
         }
     }
@@ -2061,12 +2050,11 @@ BOOL ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
 
 BOOL ScAttrArray::TestInsertRow( SCSIZE nSize ) const
 {
-    // wenn die erste herausgeschobene Zeile vertikal ueberlappt ist,
-    // wuerde eine kaputte Zusammenfassung uebrigbleiben
+    // if 1st row pushed out is vertically overlapped, summary would be broken
 
     if (pData)
     {
-        //     MAXROW + 1 - nSize      = erste herausgeschobene Zeile
+        // MAXROW + 1 - nSize  = 1st row pushed out
 
         SCSIZE nFirstLost = nCount-1;
         while ( nFirstLost && pData[nFirstLost-1].nRow >= sal::static_int_cast<SCROW>(MAXROW + 1 - 
nSize) )
@@ -2086,12 +2074,11 @@ void ScAttrArray::InsertRow( SCROW nStartRow, SCSIZE nSize )
     if (!pData)
         return;
 
-    SCROW nSearch = nStartRow > 0 ? nStartRow - 1 : 0;         // Vorgaenger erweitern
+    SCROW nSearch = nStartRow > 0 ? nStartRow - 1 : 0;  // expand predecessor
     SCSIZE nIndex;
     Search( nSearch, nIndex );
 
-    // ein gesetztes ScMergeAttr darf nicht ausgedehnt werden
-    // (darum hinterher wieder loeschen)
+    // set ScMergeAttr may not be extended (so behind delete again)
 
     BOOL bDoMerge = ((const ScMergeAttr&) pData[nIndex].pPattern->GetItem(ATTR_MERGE)).IsMerged();
 
@@ -2100,29 +2087,29 @@ void ScAttrArray::InsertRow( SCROW nStartRow, SCSIZE nSize )
     for (i = nIndex; i < nCount-1; i++)
     {
         SCROW nNew = pData[i].nRow + nSize;
-        if ( nNew >= MAXROW )                                  // Ende erreicht ?
+        if ( nNew >= MAXROW )    // at end?
         {
             nNew = MAXROW;
             if (!nRemove)
-                nRemove = i+1;                                 // folgende loeschen
+                nRemove = i+1;  // remove the following?
         }
         pData[i].nRow = nNew;
     }
 
-    // muessen Eintraege am Ende geloescht werden?
+    // Remove entries at end ?
 
     if (nRemove && nRemove < nCount)
         DeleteRange( nRemove, nCount-1 );
 
-    if (bDoMerge)                      // ausgedehntes ScMergeAttr wieder reparieren
+    if (bDoMerge)   // extensively repair (again) ScMergeAttr
     {
-            //!        ApplyAttr fuer Bereiche !!!
+            //  ApplyAttr for areas
 
         const SfxPoolItem& rDef = pDocument->GetPool()->GetDefaultItem( ATTR_MERGE );
         for (SCSIZE nAdd=0; nAdd<nSize; nAdd++)
             pDocument->ApplyAttr( nCol, nStartRow+nAdd, nTab, rDef );
 
-        //     im eingefuegten Bereich ist nichts zusammengefasst
+        // reply inserts in this area not summarized
     }
 
     // Don't duplicate the merge flags in the inserted row.
@@ -2175,9 +2162,8 @@ void ScAttrArray::DeleteRow( SCROW nStartRow, SCSIZE nSize )
             if (pData[i].nRow >= nStartRow)
                 pData[i].nRow -= nSize;
 
-//             unten nicht Default-Pattern nachschieben, um Druckbereiche erkennen zu koennen
-//             stattdessen nur Merge-Flags loeschen
-
+    // Below does not follow the pattern to detect pressure ranges;
+    // instead, only remove merge flags.
         RemoveFlags( MAXROW-nSize+1, MAXROW, SC_MF_HOR | SC_MF_VER | SC_MF_AUTO );
     }
 }
@@ -2196,12 +2182,12 @@ void ScAttrArray::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex )
 
 void ScAttrArray::DeleteArea(SCROW nStartRow, SCROW nEndRow)
 {
-    RemoveAreaMerge( nStartRow, nEndRow );                     // von zusammengefassten auch die 
Flags loeschen
+    RemoveAreaMerge( nStartRow, nEndRow );  // remove from combined flags
 
     if ( !HasAttrib( nStartRow, nEndRow, HASATTR_OVERLAPPED | HASATTR_AUTOFILTER) )
         SetPatternArea( nStartRow, nEndRow, pDocument->GetDefPattern() );
     else
-        DeleteAreaSafe( nStartRow, nEndRow );          // Merge-Flags stehenlassen
+        DeleteAreaSafe( nStartRow, nEndRow );  // leave merge flags
 }
 
 
@@ -2222,7 +2208,7 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow)
     {
         pOldPattern = pData[nIndex].pPattern;
 
-        if ( pOldPattern->GetItemSet().Count() )               // harte Attribute ?
+        if ( pOldPattern->GetItemSet().Count() )  // hard attributes ?
         {
             nRow = pData[nIndex].nRow;
             SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
@@ -2238,7 +2224,7 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow)
             else
                 SetPatternArea( nThisRow, nAttrRow, &aNewPattern, TRUE );
 
-            Search( nThisRow, nIndex );                                                            
            // Daten wurden veraendert !!!
+            Search( nThisRow, nIndex );  // data changed
         }
 
         ++nIndex;
@@ -2246,7 +2232,8 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow)
     }
 }
 
-        // Verschieben innerhalb eines Dokuments
+
+// move within a document
 
 void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray)
 {
@@ -2265,12 +2252,12 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& 
rAttrArray
 }
 
 
-        // Kopieren zwischen Dokumenten (Clipboard)
+// copy between documents (Clipboard)
 
 void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray,
                                 INT16 nStripFlags )
 {
-    nStartRow -= nDy;          // Source
+    nStartRow -= nDy;   // Source
     nEndRow -= nDy;
 
     SCROW nDestStart = Max((long)((long)nStartRow + nDy), (long) 0);
@@ -2289,7 +2276,7 @@ void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, 
ScAttrArra
 
             if (IsDefaultItem( pOldPattern ))
             {
-                //     am Default muss nichts veraendert werden
+                // default: nothing changed
 
                 pNewPattern = (const ScPatternAttr*)
                                 &pDestDocPool->GetDefaultItem( ATTR_PATTERN );
@@ -2325,18 +2312,19 @@ void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, 
ScAttrArra
                             Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern);
         }
 
-        // when pasting from clipboard and skipping filtered rows, the adjusted end position
-        // can be negative
+        // when pasting from clipboard and skipping filtered rows, the adjusted
+        // end position can be negative
         nDestStart = Max((long)nDestStart, (long)(pData[i].nRow + nDy + 1));
     }
 }
 
-        // Flags stehenlassen
-        //! mit CopyArea zusammenfassen !!!
+
+// leave flags
+// summarized with CopyArea
 
 void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray )
 {
-    nStartRow -= nDy;          // Source
+    nStartRow -= nDy;  // Source
     nEndRow -= nDy;
 
     SCROW nDestStart = Max((long)((long)nStartRow + nDy), (long) 0);
@@ -2368,8 +2356,8 @@ void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, 
ScAttr
                             Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern, FALSE);
         }
 
-        // when pasting from clipboard and skipping filtered rows, the adjusted end position
-        // can be negative
+        // when pasting from clipboard and skipping filtered rows, the adjusted
+        // end position can be negative
         nDestStart = Max((long)nDestStart, (long)(pData[i].nRow + nDy + 1));
     }
 }
@@ -2432,7 +2420,7 @@ SCsROW ScAttrArray::SearchStyle( SCsROW nRow, const ScStyleSheet* 
pSearchStyle,
         }
     }
 
-    DBG_ASSERT( bFound || !ValidRow(nRow), "interner Fehler in ScAttrArray::SearchStyle" );
+    DBG_ASSERT( bFound || !ValidRow(nRow), "Internal failure in in ScAttrArray::SearchStyle" );
 
     return nRow;
 }
@@ -2478,10 +2466,9 @@ BOOL ScAttrArray::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow,
         return FALSE;
 }
 
-//------------------------------------------------------------------------
-//
-//                                                     Laden / Speichern
-//
+/* ****************************************************************************
+ *                                 Load / Save                                *
+ *****************************************************************************/
 
 
 #if 0
@@ -2499,7 +2486,7 @@ void ScAttrArray::Save( SvStream& /* rStream */ ) const
     {
         if ( nSaveCount > 1 && pData[nSaveCount-2].nRow >= nSaveMaxRow )
         {
-            pDocument->SetLostData();           // Warnung ausgeben
+            pDocument->SetLostData();           // warn
             do
                 --nSaveCount;
             while ( nSaveCount > 1 && pData[nSaveCount-2].nRow >= nSaveMaxRow );
@@ -2516,7 +2503,7 @@ void ScAttrArray::Save( SvStream& /* rStream */ ) const
         const ScPatternAttr* pPattern = pData[i].pPattern;
         pDocPool->StoreSurrogate( rStream, pPattern );
 
-        //     FALSE, weil ATTR_CONDITIONAL (noch) nicht in Vorlagen:
+        // FALSE, because ATTR_CONDITIONAL (still) not in templates:
         if (pPattern->GetItemSet().GetItemState(ATTR_CONDITIONAL,FALSE,&pItem) == SFX_ITEM_SET)
             pDocument->SetConditionalUsed( ((const SfxUInt32Item*)pItem)->GetValue() );
 
@@ -2537,15 +2524,15 @@ void ScAttrArray::Load( SvStream& /* rStream */ )
 
     USHORT nNewCount;
     rStream >> nNewCount;
-    if ( nNewCount > MAXROW+1 )                     // wuerde das Array zu gross?
+    if ( nNewCount > MAXROW+1 )    // Array would be too large?
     {
         pDocument->SetLostData();
         rStream.SetError( SVSTREAM_FILEFORMAT_ERROR );
         return;
     }
 
-    Reset( pDocument->GetDefPattern(), FALSE );     // loeschen
-    pData = new ScAttrEntry[nNewCount];             // neu anlegen
+    Reset( pDocument->GetDefPattern(), FALSE );     // remove
+    pData = new ScAttrEntry[nNewCount];             // edit
     for (SCSIZE i=0; i<nNewCount; i++)
     {
         rStream >> pData[i].nRow;
@@ -2555,29 +2542,30 @@ void ScAttrArray::Load( SvStream& /* rStream */ )
                                            pDocPool->LoadSurrogate( rStream, nWhich, ATTR_PATTERN 
);
         if (!pNewPattern)
         {
-            // da is was schiefgelaufen
-            DBG_ERROR("ScAttrArray::Load: Surrogat nicht im Pool");
+            // What went wrong?
+            DBG_ERROR("ScAttrArray::Load: Surrogate not in pool");
             pNewPattern = pDocument->GetDefPattern();
         }
         ScDocumentPool::CheckRef( *pNewPattern );
         pData[i].pPattern = pNewPattern;
 
-        // LoadSurrogate erhoeht auch die Ref
+        // LoadSurrogate increases Ref
     }
     nCount = nLimit = nNewCount;
 
-    if ( nCount > 1 && pData[nCount-2].nRow >= MAXROW ) // faengt ein Attribut hinter MAXROW an?
+    // begin attribute behind MAXROW?
+    if ( nCount > 1 && pData[nCount-2].nRow >= MAXROW )
     {
         pDocument->SetLostData();
         rStream.SetError( SVSTREAM_FILEFORMAT_ERROR );
         return;
     }
 
-    if ( pDocument->GetSrcMaxRow() != MAXROW )          // Ende anpassen?
+    if ( pDocument->GetSrcMaxRow() != MAXROW )   // end adapt?
     {
-        //     Ende immer auf MAXROW umsetzen (nur auf 32 Bit)
+        // Always translate end to MAXROW (on 32 bit)
 
-        DBG_ASSERT( pData[nCount-1].nRow == pDocument->GetSrcMaxRow(), "Attribut-Ende ?!?" );
+        DBG_ASSERT( pData[nCount-1].nRow == pDocument->GetSrcMaxRow(), "Attribute End ?!?" );
         pData[nCount-1].nRow = MAXROW;
     }
 #endif // SC_ROWLIMIT_STREAM_ACCESS

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.