diff options
Diffstat (limited to 'sc/source/core/data')
69 files changed, 3917 insertions, 3917 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index f3443312bd4e..79eb1be8db4a 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1,7 +1,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 @@ -77,7 +77,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(); // ohne Put !!! } } @@ -135,10 +135,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++) { @@ -184,7 +184,7 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, BOOL bAlloc ) else { nCount = nLimit = 0; - pData = NULL; // muss sofort wieder belegt werden ! + pData = NULL; // muss sofort wieder belegt werden ! } } } @@ -230,12 +230,12 @@ 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); + 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 ) @@ -477,7 +477,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(); @@ -566,19 +566,19 @@ 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)); \ +#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, @@ -599,7 +599,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow, do { - const ScPatternAttr* pOldPattern = pData[nPos].pPattern; + const ScPatternAttr* pOldPattern = pData[nPos].pPattern; const SfxItemSet& rOldSet = pOldPattern->GetItemSet(); const SfxPoolItem* pBoxItem = 0; SfxItemState eState = rOldSet.GetItemState( ATTR_BORDER, TRUE, &pBoxItem ); @@ -610,10 +610,10 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow, 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; @@ -789,7 +789,7 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac else { //!!!!!!!!!!!!!!!!!! mit diesem Remove gibt es Abstuerze (Calc1 Import) -//! pDocument->GetPool()->Remove(*pNewPattern); +//! pDocument->GetPool()->Remove(*pNewPattern); nStart = pData[nPos].nRow + 1; ++nPos; } @@ -812,10 +812,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 hat keinen Parent SfxItemState eOldState = rMergeSet.GetItemState( nId, FALSE, &pOldItem ); - if ( eOldState == SFX_ITEM_DEFAULT ) // Default + if ( eOldState == SFX_ITEM_DEFAULT ) // Default { SfxItemState eNewState = rSource.GetItemState( nId, TRUE, &pNewItem ); if ( eNewState == SFX_ITEM_SET ) @@ -824,21 +824,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 ) // Item gesetzt { SfxItemState eNewState = rSource.GetItemState( nId, TRUE, &pNewItem ); if ( eNewState == SFX_ITEM_SET ) { - if ( pNewItem != pOldItem ) // beide gepuhlt + if ( pNewItem != pOldItem ) // beide gepuhlt rMergeSet.InvalidateItem( nId ); } - else // Default + else // Default { if ( *pOldItem != rSource.GetPool()->GetDefaultItem(nId) ) rMergeSet.InvalidateItem( nId ); } } - // Dontcare bleibt Dontcare + // Dontcare bleibt Dontcare } } @@ -858,7 +858,7 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow, do { - // gleiche Patterns muessen nicht mehrfach angesehen werden + // gleiche Patterns muessen nicht mehrfach angesehen werden const ScPatternAttr* pPattern = pData[nPos].pPattern; if ( pPattern != rState.pOld1 && pPattern != rState.pOld2 ) @@ -866,8 +866,8 @@ 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 + // (*ppSet)->MergeValues( rThisSet, FALSE ); + // geht nicht, weil die Vorlagen nicht beruecksichtigt werden if (bDeep) lcl_MergeDeep( *rState.pItemSet, rThisSet ); @@ -876,7 +876,7 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow, } else { - // erstes Pattern - in Set ohne Parent kopieren + // erstes Pattern - in Set ohne Parent kopieren rState.pItemSet = new SfxItemSet( *rThisSet.GetPool(), rThisSet.GetRanges() ); rState.pItemSet->Set( rThisSet, bDeep ); } @@ -894,19 +894,19 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow, -// Umrandung zusammenbauen +// Umrandung zusammenbauen 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; // weiter geht's nicht if (rModified == SC_LINE_EMPTY) { rModified = SC_LINE_SET; rpNew = pNewLine; - return TRUE; // zum ersten mal gesetzt + return TRUE; // zum ersten mal gesetzt } if (pOldLine == pNewLine) @@ -924,7 +924,7 @@ BOOL lcl_TestAttr( const SvxBorderLine* pOldLine, const SvxBorderLine* pNewLine, rModified = SC_LINE_DONTCARE; rpNew = NULL; - return TRUE; // andere Linie -> dontcare + return TRUE; // andere Linie -> dontcare } @@ -932,7 +932,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: + // rechten/unteren Rahmen setzen, wenn Zelle bis zum Ende zusammengefasst: const ScMergeAttr& rMerge = (const ScMergeAttr&)pPattern->GetItem(ATTR_MERGE); if ( rMerge.GetColMerge() == nDistRight + 1 ) nDistRight = 0; @@ -940,9 +940,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; @@ -1027,13 +1027,13 @@ void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLine } // -// Rahmen anwenden +// Rahmen anwenden // -// ApplyFrame - auf einen Eintrag im Array +// ApplyFrame - auf einen Eintrag im Array -BOOL ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem, +BOOL ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem, const SvxBoxInfoItem* pBoxInfoItem, SCROW nStartRow, SCROW nEndRow, BOOL bLeft, SCCOL nDistRight, BOOL bTop, SCROW nDistBottom ) @@ -1044,7 +1044,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: + // rechten/unteren Rahmen setzen, wenn Zelle bis zum Ende zusammengefasst: const ScMergeAttr& rMerge = (const ScMergeAttr&)pPattern->GetItem(ATTR_MERGE); if ( rMerge.GetColMerge() == nDistRight + 1 ) nDistRight = 0; @@ -1076,7 +1076,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 ); */ @@ -1095,7 +1095,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 ) // innerer Teil vorhanden? { SCSIZE nStartIndex; SCSIZE nEndIndex; @@ -1126,8 +1126,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) + // nur eine Linie -> halbe Breite, min. 20 + // doppelte Linie -> halber Abstand + eine Linie (je min. 20) long nTotal = 0; USHORT nWidth = Max( rLine.GetOutWidth(), rLine.GetInWidth() ); @@ -1137,15 +1137,15 @@ long lcl_LineSize( const SvxBorderLine& rLine ) DBG_ASSERT( rLine.GetOutWidth() && rLine.GetInWidth(), "Linie hat Abstand, aber nur eine Breite ???" ); -// 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; - //! auch halbieren ??? + //! auch halbieren ??? return nTotal; } @@ -1164,7 +1164,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, const SvxBorderLine* pLine = 0; long nCmp; - // oben + // oben pItem = (const SvxBoxItem*) &pData[nStartIndex].pPattern->GetItem(ATTR_BORDER); pLine = pItem->GetTop(); @@ -1176,7 +1176,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, bFound = TRUE; } - // unten + // unten if ( nEndIndex != nStartIndex ) pItem = (const SvxBoxItem*) &pData[nEndIndex].pPattern->GetItem(ATTR_BORDER); @@ -1194,7 +1194,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, { pItem = (const SvxBoxItem*) &pData[i].pPattern->GetItem(ATTR_BORDER); - // links + // links if (bLeft) { @@ -1208,7 +1208,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, } } - // rechts + // rechts if (bRight) { @@ -1226,7 +1226,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, return bFound; } -// Testen, ob Bereich bestimmtes Attribut enthaelt +// Testen, ob Bereich bestimmtes Attribut enthaelt bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const { @@ -1341,8 +1341,8 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const return bFound; } -// Bereich um evtl. enthaltene Zusammenfassungen erweitern -// und evtl. MergeFlag anpassen (bRefresh) +// Bereich um evtl. enthaltene Zusammenfassungen erweitern +// und evtl. MergeFlag anpassen (bRefresh) BOOL ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCCOL& rPaintCol, SCROW& rPaintRow, @@ -1360,8 +1360,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; @@ -1398,7 +1398,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 ); // Daten wurden veraendert Search( nStartRow, nStartIndex ); Search( nEndRow, nEndIndex ); } @@ -1429,8 +1429,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*) @@ -1444,32 +1444,32 @@ BOOL ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow) SCCOL nMergeEndCol = nThisCol + nCountX - 1; SCROW nMergeEndRow = nThisEnd + nCountY - 1; - //! ApplyAttr fuer Bereiche !!! + //! ApplyAttr fuer Bereiche !!! 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 ); delete pNewPattern; - Search( nThisEnd, nIndex ); // Daten wurden veraendert !!! + Search( nThisEnd, nIndex ); // Daten wurden veraendert !!! } ++nIndex; if ( nIndex < nCount ) nThisStart = pData[nIndex-1].nRow+1; else - nThisStart = MAXROW+1; // Ende + nThisStart = MAXROW+1; // Ende } return bFound; } - // Bereich loeschen, aber Merge-Flags stehenlassen + // Bereich loeschen, aber Merge-Flags stehenlassen void ScAttrArray::DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow) { @@ -1480,20 +1480,20 @@ 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; while ( nThisRow <= nEndRow ) { pOldPattern = pData[nIndex].pPattern; - if (pOldPattern != pWantedPattern) //! else-Zweig ? + if (pOldPattern != pWantedPattern) //! else-Zweig ? { if (nThisRow < nStartRow) nThisRow = nStartRow; nRow = pData[nIndex].nRow; @@ -1502,12 +1502,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; @@ -1519,12 +1519,12 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow, if (bFirstUse) bFirstUse = FALSE; else - pDocument->GetPool()->Put( *pWantedPattern ); // im Pool ist es schon! + pDocument->GetPool()->Put( *pWantedPattern ); // im Pool ist es schon! } SetPatternArea( nThisRow, nAttrRow, pWantedPattern ); } - Search( nThisRow, nIndex ); // Daten wurden veraendert !!! + Search( nThisRow, nIndex ); // Daten wurden veraendert !!! } ++nIndex; @@ -1537,11 +1537,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; @@ -1558,7 +1558,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 ); // Daten wurden veraendert !!! bChanged = TRUE; } @@ -1574,11 +1574,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; @@ -1595,7 +1595,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 ); // Daten wurden veraendert !!! bChanged = TRUE; } @@ -1611,9 +1611,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; @@ -1630,7 +1630,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 ); // Daten wurden veraendert !!! } ++nIndex; @@ -1687,11 +1687,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 ); // Daten wurden veraendert !!! } else { - nThisStart = pData[nIndex].nRow + 1; // weiterzaehlen... + nThisStart = pData[nIndex].nRow + 1; // weiterzaehlen... ++nIndex; } } @@ -1711,7 +1711,7 @@ SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, BOOL bUp ) const if (bUp) { if (nIndex==0) - return -1; // nichts gefunden + return -1; // nichts gefunden --nIndex; nRet = pData[nIndex].nRow; } @@ -1720,7 +1720,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; // nichts gefunden } } } @@ -1736,8 +1736,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); @@ -1757,7 +1757,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBo if (Concat(nPos)) { Search(nStart, nPos); - --nPos; // wegen ++ am Ende + --nPos; // wegen ++ am Ende } } } @@ -1770,8 +1770,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 ) { @@ -1810,7 +1810,7 @@ BOOL ScAttrArray::IsEmpty() const //UNUSED2008-05 SCROW ScAttrArray::GetFirstEntryPos() const //UNUSED2008-05 { //UNUSED2008-05 DBG_ASSERT( nCount, "nCount = 0" ); -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 if ( pData[0].pPattern != pDocument->GetDefPattern() ) //UNUSED2008-05 return 0; //UNUSED2008-05 else @@ -1821,15 +1821,15 @@ BOOL ScAttrArray::IsEmpty() const //UNUSED2008-05 return pData[0].nRow + 1; //UNUSED2008-05 } //UNUSED2008-05 } -//UNUSED2008-05 -//UNUSED2008-05 +//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 SCROW ScAttrArray::GetLastEntryPos( BOOL bIncludeBottom ) const //UNUSED2008-05 { //UNUSED2008-05 DBG_ASSERT( nCount, "nCount == 0" ); -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 if (bIncludeBottom) //UNUSED2008-05 bIncludeBottom = ( pData[nCount-1].pPattern != pDocument->GetDefPattern() ); -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 if (bIncludeBottom) //UNUSED2008-05 return MAXROW; //UNUSED2008-05 else @@ -1855,7 +1855,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 ) @@ -1983,7 +1983,7 @@ BOOL ScAttrArray::IsVisibleEqual( const ScAttrArray& rOther, BOOL ScAttrArray::IsAllEqual( const ScAttrArray& rOther, SCROW nStartRow, SCROW nEndRow ) const { - //! mit IsVisibleEqual zusammenfassen? + //! mit IsVisibleEqual zusammenfassen? BOOL bEqual = TRUE; SCSIZE nThisPos = 0; @@ -2020,8 +2020,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 zusammengefasste duerfen nicht herausgeschoben werden + // (ob die ganze Zusammenfassung betroffen ist, ist hier nicht zu erkennen) BOOL bTest = TRUE; if (!IsEmpty()) @@ -2035,10 +2035,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; // darf nicht herausgeschoben werden break; } - if ( pData[nIndex].nRow >= nEndRow ) // Ende des Bereichs + if ( pData[nIndex].nRow >= nEndRow ) // Ende des Bereichs break; } } @@ -2048,12 +2048,12 @@ 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 + // wenn die erste herausgeschobene Zeile vertikal ueberlappt ist, + // wuerde eine kaputte Zusammenfassung uebrigbleiben if (pData) { - // MAXROW + 1 - nSize = erste herausgeschobene Zeile + // MAXROW + 1 - nSize = erste herausgeschobene Zeile SCSIZE nFirstLost = nCount-1; while ( nFirstLost && pData[nFirstLost-1].nRow >= sal::static_int_cast<SCROW>(MAXROW + 1 - nSize) ) @@ -2073,12 +2073,12 @@ 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; // Vorgaenger erweitern SCSIZE nIndex; Search( nSearch, nIndex ); - // ein gesetztes ScMergeAttr darf nicht ausgedehnt werden - // (darum hinterher wieder loeschen) + // ein gesetztes ScMergeAttr darf nicht ausgedehnt werden + // (darum hinterher wieder loeschen) BOOL bDoMerge = ((const ScMergeAttr&) pData[nIndex].pPattern->GetItem(ATTR_MERGE)).IsMerged(); @@ -2087,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 ) // Ende erreicht ? { nNew = MAXROW; if (!nRemove) - nRemove = i+1; // folgende loeschen + nRemove = i+1; // folgende loeschen } pData[i].nRow = nNew; } - // muessen Eintraege am Ende geloescht werden? + // muessen Eintraege am Ende geloescht werden? if (nRemove && nRemove < nCount) DeleteRange( nRemove, nCount-1 ); - if (bDoMerge) // ausgedehntes ScMergeAttr wieder reparieren + if (bDoMerge) // ausgedehntes ScMergeAttr wieder reparieren { - //! ApplyAttr fuer Bereiche !!! + //! ApplyAttr fuer Bereiche !!! 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 + // im eingefuegten Bereich ist nichts zusammengefasst } // Don't duplicate the merge flags in the inserted row. @@ -2162,8 +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 +// unten nicht Default-Pattern nachschieben, um Druckbereiche erkennen zu koennen +// stattdessen nur Merge-Flags loeschen RemoveFlags( MAXROW-nSize+1, MAXROW, SC_MF_HOR | SC_MF_VER | SC_MF_AUTO ); } @@ -2183,12 +2183,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 ); // von zusammengefassten auch die Flags loeschen if ( !HasAttrib( nStartRow, nEndRow, HASATTR_OVERLAPPED | HASATTR_AUTOFILTER) ) SetPatternArea( nStartRow, nEndRow, pDocument->GetDefPattern() ); else - DeleteAreaSafe( nStartRow, nEndRow ); // Merge-Flags stehenlassen + DeleteAreaSafe( nStartRow, nEndRow ); // Merge-Flags stehenlassen } @@ -2197,9 +2197,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; @@ -2209,7 +2209,7 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow) { pOldPattern = pData[nIndex].pPattern; - if ( pOldPattern->GetItemSet().Count() ) // harte Attribute ? + if ( pOldPattern->GetItemSet().Count() ) // harte Attribute ? { nRow = pData[nIndex].nRow; SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow ); @@ -2225,7 +2225,7 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow) else SetPatternArea( nThisRow, nAttrRow, &aNewPattern, TRUE ); - Search( nThisRow, nIndex ); // Daten wurden veraendert !!! + Search( nThisRow, nIndex ); // Daten wurden veraendert !!! } ++nIndex; @@ -2242,7 +2242,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 ); } @@ -2257,7 +2257,7 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray 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); @@ -2276,7 +2276,7 @@ void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArra if (IsDefaultItem( pOldPattern )) { - // am Default muss nichts veraendert werden + // am Default muss nichts veraendert werden pNewPattern = (const ScPatternAttr*) &pDestDocPool->GetDefaultItem( ATTR_PATTERN ); @@ -2323,7 +2323,7 @@ void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArra 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); @@ -2467,7 +2467,7 @@ BOOL ScAttrArray::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, //------------------------------------------------------------------------ // -// Laden / Speichern +// Laden / Speichern // @@ -2503,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, weil ATTR_CONDITIONAL (noch) nicht in Vorlagen: if (pPattern->GetItemSet().GetItemState(ATTR_CONDITIONAL,FALSE,&pItem) == SFX_ITEM_SET) pDocument->SetConditionalUsed( ((const SfxUInt32Item*)pItem)->GetValue() ); @@ -2562,7 +2562,7 @@ void ScAttrArray::Load( SvStream& /* rStream */ ) if ( pDocument->GetSrcMaxRow() != MAXROW ) // Ende anpassen? { - // Ende immer auf MAXROW umsetzen (nur auf 32 Bit) + // Ende immer auf MAXROW umsetzen (nur auf 32 Bit) DBG_ASSERT( pData[nCount-1].nRow == pDocument->GetSrcMaxRow(), "Attribut-Ende ?!?" ); pData[nCount-1].nRow = MAXROW; @@ -2578,7 +2578,7 @@ void ScAttrArray::Load( SvStream& /* rStream */ ) //UNUSED2008-05 const ULONG nFlags = FONTTOSUBSFONT_IMPORT | FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS; //UNUSED2008-05 SCSIZE nIndex = 0; //UNUSED2008-05 SCROW nThisRow = 0; -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 while ( nThisRow <= MAXROW ) //UNUSED2008-05 { //UNUSED2008-05 const ScPatternAttr* pOldPattern = pData[nIndex].pPattern; diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 301883197fb8..1b0662445b77 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -1,7 +1,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 @@ -53,30 +53,30 @@ #include "sc.hrc" #include "globstr.hrc" -#include "textuno.hxx" // ScHeaderFooterContentObj +#include "textuno.hxx" // ScHeaderFooterContentObj using namespace com::sun::star; //------------------------------------------------------------------------ -TYPEINIT1(ScMergeAttr, SfxPoolItem); +TYPEINIT1(ScMergeAttr, SfxPoolItem); TYPEINIT1_AUTOFACTORY(ScProtectionAttr, SfxPoolItem); -TYPEINIT1(ScRangeItem, SfxPoolItem); -TYPEINIT1(ScTableListItem, SfxPoolItem); -TYPEINIT1(ScPageHFItem, SfxPoolItem); +TYPEINIT1(ScRangeItem, SfxPoolItem); +TYPEINIT1(ScTableListItem, SfxPoolItem); +TYPEINIT1(ScPageHFItem, SfxPoolItem); TYPEINIT1(ScViewObjectModeItem, SfxEnumItem); -TYPEINIT1(ScDoubleItem, SfxPoolItem); +TYPEINIT1(ScDoubleItem, SfxPoolItem); TYPEINIT1(ScPageScaleToItem, SfxPoolItem); //------------------------------------------------------------------------ // -// allgemeine Hilfsfunktionen +// allgemeine Hilfsfunktionen // BOOL ScHasPriority( const SvxBorderLine* pThis, const SvxBorderLine* pOther ) { -// DBG_ASSERT( pThis || pOther, "LineAttr == 0" ); +// DBG_ASSERT( pThis || pOther, "LineAttr == 0" ); if (!pThis) return FALSE; @@ -98,14 +98,14 @@ BOOL ScHasPriority( const SvxBorderLine* pThis, const SvxBorderLine* pOther ) return FALSE; else { - return TRUE; //! ??? + return TRUE; //! ??? } } } // -// Item - Implementierungen +// Item - Implementierungen // //------------------------------------------------------------------------ @@ -172,8 +172,8 @@ SfxPoolItem* ScMergeAttr::Clone( SfxItemPool * ) const SfxPoolItem* ScMergeAttr::Create( SvStream& rStream, USHORT /* nVer */ ) const { - INT16 nCol; - INT16 nRow; + INT16 nCol; + INT16 nRow; rStream >> nCol; rStream >> nRow; return new ScMergeAttr(static_cast<SCCOL>(nCol),static_cast<SCROW>(nRow)); @@ -231,8 +231,8 @@ ScProtectionAttr::ScProtectionAttr(const ScProtectionAttr& rItem): { bProtection = rItem.bProtection; bHideFormula = rItem.bHideFormula; - bHideCell = rItem.bHideCell; - bHidePrint = rItem.bHidePrint; + bHideCell = rItem.bHideCell; + bHidePrint = rItem.bHidePrint; } ScProtectionAttr::~ScProtectionAttr() @@ -320,11 +320,11 @@ String ScProtectionAttr::GetValueText() const String aStrNo ( ScGlobal::GetRscString(STR_NO) ); sal_Unicode cDelim = ','; - aValue = '('; - aValue += (bProtection ? aStrYes : aStrNo); aValue += cDelim; - aValue += (bHideFormula ? aStrYes : aStrNo); aValue += cDelim; - aValue += (bHideCell ? aStrYes : aStrNo); aValue += cDelim; - aValue += (bHidePrint ? aStrYes : aStrNo); + aValue = '('; + aValue += (bProtection ? aStrYes : aStrNo); aValue += cDelim; + aValue += (bHideFormula ? aStrYes : aStrNo); aValue += cDelim; + aValue += (bHideCell ? aStrYes : aStrNo); aValue += cDelim; + aValue += (bHidePrint ? aStrYes : aStrNo); aValue += ')'; return aValue; @@ -341,9 +341,9 @@ SfxItemPresentation ScProtectionAttr::GetPresentation const IntlWrapper* /* pIntl */ ) const { - String aStrYes ( ScGlobal::GetRscString(STR_YES) ); - String aStrNo ( ScGlobal::GetRscString(STR_NO) ); - String aStrSep = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( ": " )); + String aStrYes ( ScGlobal::GetRscString(STR_YES) ); + String aStrNo ( ScGlobal::GetRscString(STR_NO) ); + String aStrSep = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( ": " )); String aStrDelim = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( ", " )); switch ( ePres ) @@ -358,12 +358,12 @@ SfxItemPresentation ScProtectionAttr::GetPresentation case SFX_ITEM_PRESENTATION_COMPLETE: rText = ScGlobal::GetRscString(STR_PROTECTION); rText += aStrSep; - rText += (bProtection ? aStrYes : aStrNo); rText += aStrDelim; - rText += ScGlobal::GetRscString(STR_FORMULAS); rText += aStrSep; - rText += (!bHideFormula ? aStrYes : aStrNo); rText += aStrDelim; - rText += ScGlobal::GetRscString(STR_HIDE); rText += aStrSep; - rText += (bHideCell ? aStrYes : aStrNo); rText += aStrDelim; - rText += ScGlobal::GetRscString(STR_PRINT); rText += aStrSep; + rText += (bProtection ? aStrYes : aStrNo); rText += aStrDelim; + rText += ScGlobal::GetRscString(STR_FORMULAS); rText += aStrSep; + rText += (!bHideFormula ? aStrYes : aStrNo); rText += aStrDelim; + rText += ScGlobal::GetRscString(STR_HIDE); rText += aStrSep; + rText += (bHideCell ? aStrYes : aStrNo); rText += aStrDelim; + rText += ScGlobal::GetRscString(STR_PRINT); rText += aStrSep; rText += (!bHidePrint ? aStrYes : aStrNo); break; @@ -443,7 +443,7 @@ BOOL ScProtectionAttr::SetHidePrint( BOOL bHPrint) } // ----------------------------------------------------------------------- -// ScRangeItem - Tabellenbereich +// ScRangeItem - Tabellenbereich // ----------------------------------------------------------------------- int ScRangeItem::operator==( const SfxPoolItem& rAttr ) const @@ -467,7 +467,7 @@ SfxItemPresentation ScRangeItem::GetPresentation SfxItemPresentation ePres, SfxMapUnit /* eCoreUnit */, SfxMapUnit /* ePresUnit */, - String& rText, + String& rText, const IntlWrapper* /* pIntl */ ) const { @@ -478,7 +478,7 @@ SfxItemPresentation ScRangeItem::GetPresentation case SFX_ITEM_PRESENTATION_COMPLETE: rText = ScGlobal::GetRscString(STR_AREA); rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " )); -// break;// Durchfallen !!! +// break;// Durchfallen !!! case SFX_ITEM_PRESENTATION_NAMELESS: { @@ -499,12 +499,12 @@ SfxItemPresentation ScRangeItem::GetPresentation } // ----------------------------------------------------------------------- -// ScTableListItem - Liste von Tabellen(-nummern) +// ScTableListItem - Liste von Tabellen(-nummern) // ----------------------------------------------------------------------- ScTableListItem::ScTableListItem( const ScTableListItem& rCpy ) - : SfxPoolItem ( rCpy.Which() ), - nCount ( rCpy.nCount ) + : SfxPoolItem ( rCpy.Which() ), + nCount ( rCpy.nCount ) { if ( nCount > 0 ) { @@ -560,12 +560,12 @@ int ScTableListItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - ScTableListItem& rCmp = (ScTableListItem&)rAttr; - BOOL bEqual = (nCount == rCmp.nCount); + ScTableListItem& rCmp = (ScTableListItem&)rAttr; + BOOL bEqual = (nCount == rCmp.nCount); if ( nCount > 0 ) { - USHORT i=0; + USHORT i=0; bEqual = ( pTabArr && rCmp.pTabArr ); @@ -590,9 +590,9 @@ SfxPoolItem* ScTableListItem::Clone( SfxItemPool* ) const SfxItemPresentation ScTableListItem::GetPresentation ( SfxItemPresentation ePres, - SfxMapUnit /* eCoreUnit */, - SfxMapUnit /* ePresUnit */, - String& rText, + SfxMapUnit /* eCoreUnit */, + SfxMapUnit /* ePresUnit */, + String& rText, const IntlWrapper* /* pIntl */ ) const { @@ -637,7 +637,7 @@ SfxItemPresentation ScTableListItem::GetPresentation //UNUSED2009-05 { //UNUSED2009-05 for ( USHORT i=0; i<nCount; i++ ) //UNUSED2009-05 aList.Insert( new SCTAB( pTabArr[i] ) ); -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 return ( nCount > 0 ); //UNUSED2009-05 } @@ -646,13 +646,13 @@ SfxItemPresentation ScTableListItem::GetPresentation //UNUSED2009-05 void ScTableListItem::SetTableList( const List& rList ) //UNUSED2009-05 { //UNUSED2009-05 nCount = (USHORT)rList.Count(); -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 delete [] pTabArr; -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 if ( nCount > 0 ) //UNUSED2009-05 { //UNUSED2009-05 pTabArr = new SCTAB [nCount]; -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 for ( USHORT i=0; i<nCount; i++ ) //UNUSED2009-05 pTabArr[i] = *( (SCTAB*)rList.GetObject( i ) ); //UNUSED2009-05 } @@ -667,19 +667,19 @@ SfxItemPresentation ScTableListItem::GetPresentation ScPageHFItem::ScPageHFItem( USHORT nWhichP ) : SfxPoolItem ( nWhichP ), - pLeftArea ( NULL ), + pLeftArea ( NULL ), pCenterArea ( NULL ), - pRightArea ( NULL ) + pRightArea ( NULL ) { } //------------------------------------------------------------------------ ScPageHFItem::ScPageHFItem( const ScPageHFItem& rItem ) - : SfxPoolItem ( rItem ), - pLeftArea ( NULL ), + : SfxPoolItem ( rItem ), + pLeftArea ( NULL ), pCenterArea ( NULL ), - pRightArea ( NULL ) + pRightArea ( NULL ) { if ( rItem.pLeftArea ) pLeftArea = rItem.pLeftArea->Clone(); @@ -771,7 +771,7 @@ int ScPageHFItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); - const ScPageHFItem& r = (const ScPageHFItem&)rItem; + const ScPageHFItem& r = (const ScPageHFItem&)rItem; return ScGlobal::EETextObjEqual(pLeftArea, r.pLeftArea) && ScGlobal::EETextObjEqual(pCenterArea, r.pCenterArea) @@ -845,13 +845,13 @@ BOOL lcl_ConvertFields(EditEngine& rEng, const String* pCommands) return bChange; } -#define SC_FIELD_COUNT 6 +#define SC_FIELD_COUNT 6 SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const { - EditTextObject* pLeft = EditTextObject::Create(rStream); + EditTextObject* pLeft = EditTextObject::Create(rStream); EditTextObject* pCenter = EditTextObject::Create(rStream); - EditTextObject* pRight = EditTextObject::Create(rStream); + EditTextObject* pRight = EditTextObject::Create(rStream); DBG_ASSERT( pLeft && pCenter && pRight, "Error reading ScPageHFItem" ); @@ -859,9 +859,9 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT 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 ) @@ -881,7 +881,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const } } - if ( nVer < 1 ) // alte Feldbefehle umsetzen + if ( nVer < 1 ) // alte Feldbefehle umsetzen { USHORT i; const String& rDel = ScGlobal::GetRscString( STR_HFCMD_DELIMITER ); @@ -918,11 +918,11 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const } } else if ( nVer < 2 ) - { // nichts tun, SvxFileField nicht gegen SvxExtFileField austauschen + { // nichts tun, SvxFileField nicht gegen SvxExtFileField austauschen } ScPageHFItem* pItem = new ScPageHFItem( Which() ); - pItem->SetArea( pLeft, SC_HF_LEFTAREA ); + pItem->SetArea( pLeft, SC_HF_LEFTAREA ); pItem->SetArea( pCenter, SC_HF_CENTERAREA ); pItem->SetArea( pRight, SC_HF_RIGHTAREA ); @@ -937,18 +937,18 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const //UNUSED2009-05 USHORT nConvPara; //UNUSED2009-05 xub_StrLen nConvPos; //UNUSED2009-05 BOOL bConvert; -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 public: //UNUSED2009-05 ScFieldChangerEditEngine( SfxItemPool* pEnginePool, BOOL bDeleteEnginePool ); //UNUSED2009-05 virtual ~ScFieldChangerEditEngine() {} -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 virtual String CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, //UNUSED2009-05 USHORT nPos, Color*& rTxtColor, //UNUSED2009-05 Color*& rFldColor ); -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 BOOL ConvertFields(); //UNUSED2009-05 }; -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 ScFieldChangerEditEngine::ScFieldChangerEditEngine( SfxItemPool* pEnginePoolP, //UNUSED2009-05 BOOL bDeleteEnginePoolP ) : //UNUSED2009-05 ScEditEngineDefaulter( pEnginePoolP, bDeleteEnginePoolP ), @@ -958,7 +958,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const //UNUSED2009-05 bConvert( FALSE ) //UNUSED2009-05 { //UNUSED2009-05 } -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 String ScFieldChangerEditEngine::CalcFieldValue( const SvxFieldItem& rField, //UNUSED2009-05 USHORT nPara, USHORT nPos, Color*& /* rTxtColor */, Color*& /* rFldColor */ ) //UNUSED2009-05 { @@ -971,7 +971,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const //UNUSED2009-05 } //UNUSED2009-05 return EMPTY_STRING; //UNUSED2009-05 } -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 BOOL ScFieldChangerEditEngine::ConvertFields() //UNUSED2009-05 { //UNUSED2009-05 BOOL bConverted = FALSE; @@ -1015,16 +1015,16 @@ void ScPageHFItem::SetArea( EditTextObject *pNew, int nArea ) { switch ( nArea ) { - case SC_HF_LEFTAREA: delete pLeftArea; pLeftArea = pNew; break; + case SC_HF_LEFTAREA: delete pLeftArea; pLeftArea = pNew; break; case SC_HF_CENTERAREA: delete pCenterArea; pCenterArea = pNew; break; - case SC_HF_RIGHTAREA: delete pRightArea; pRightArea = pNew; break; + case SC_HF_RIGHTAREA: delete pRightArea; pRightArea = pNew; break; default: DBG_ERROR( "New Area?" ); } } //----------------------------------------------------------------------- -// ScViewObjectModeItem - Darstellungsmodus von ViewObjekten +// ScViewObjectModeItem - Darstellungsmodus von ViewObjekten //----------------------------------------------------------------------- ScViewObjectModeItem::ScViewObjectModeItem( USHORT nWhichP ) @@ -1052,11 +1052,11 @@ SfxItemPresentation ScViewObjectModeItem::GetPresentation SfxItemPresentation ePres, SfxMapUnit /* eCoreUnit */, SfxMapUnit /* ePresUnit */, - String& rText, + String& rText, const IntlWrapper* /* pIntl */ -) const +) const { - String aDel = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(": ")); + String aDel = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(": ")); rText.Erase(); switch ( ePres ) @@ -1083,7 +1083,7 @@ SfxItemPresentation ScViewObjectModeItem::GetPresentation ePres = SFX_ITEM_PRESENTATION_NAMELESS;//das geht immer! break; } -// break; // DURCHFALLEN!!! +// break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ScGlobal::GetRscString(STR_VOBJ_MODE_SHOW+GetValue()); @@ -1131,8 +1131,8 @@ USHORT ScViewObjectModeItem::GetVersion( USHORT /* nFileVersion */ ) const //------------------------------------------------------------------------ SfxPoolItem* ScViewObjectModeItem::Create( - SvStream& rStream, - USHORT nVersion ) const + SvStream& rStream, + USHORT nVersion ) const { if ( nVersion == 0 ) { @@ -1152,19 +1152,19 @@ SfxPoolItem* ScViewObjectModeItem::Create( } // ----------------------------------------------------------------------- -// double +// double // ----------------------------------------------------------------------- ScDoubleItem::ScDoubleItem( USHORT nWhichP, double nVal ) : SfxPoolItem ( nWhichP ), - nValue ( nVal ) + nValue ( nVal ) { } //------------------------------------------------------------------------ ScDoubleItem::ScDoubleItem( const ScDoubleItem& rItem ) - : SfxPoolItem ( rItem ) + : SfxPoolItem ( rItem ) { nValue = rItem.nValue; } diff --git a/sc/source/core/data/autonamecache.cxx b/sc/source/core/data/autonamecache.cxx index c9abd4aa90b8..dd080362afdd 100644 --- a/sc/source/core/data/autonamecache.cxx +++ b/sc/source/core/data/autonamecache.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 540fb577a79b..7e7653ee50c8 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -1,7 +1,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 @@ -92,9 +92,9 @@ static SCSIZE nBcaSlotsRow = BCA_SLOTS_ROW; static SCSIZE nBcaSlots = BCA_SLOTS_DEFINE; #else // Logarithmic or any other distribution. -// Upper sheet part usually is more populated and referenced and gets fine +// Upper sheet part usually is more populated and referenced and gets fine // grained resolution, larger data in larger hunks. -// Could be further enhanced by also applying a different distribution of +// Could be further enhanced by also applying a different distribution of // column slots. static SCSIZE initSlotDistribution( ScSlotDistribution & rSD, SCSIZE & rBSR ) { @@ -184,9 +184,9 @@ bool ScBroadcastAreaSlot::StartListeningArea( const ScRange& rRange, return false; if ( !rpArea ) { - // Even if most times the area doesn't exist yet and immediately trying - // to new and insert it would save an attempt to find it, on mass - // operations like identical large [HV]LOOKUP() areas the new/delete + // Even if most times the area doesn't exist yet and immediately trying + // to new and insert it would save an attempt to find it, on mass + // operations like identical large [HV]LOOKUP() areas the new/delete // would add quite some penalty for all but the first formula cell. ScBroadcastAreas::const_iterator aIter( FindBroadcastArea( rRange)); if (aIter != aBroadcastAreaTbl.end()) @@ -284,7 +284,7 @@ BOOL ScBroadcastAreaSlot::AreaBroadcast( const ScHint& rHint) const return FALSE; BOOL bIsBroadcasted = FALSE; const ScAddress& rAddress = rHint.GetAddress(); - for (ScBroadcastAreas::const_iterator aIter( aBroadcastAreaTbl.begin()); + for (ScBroadcastAreas::const_iterator aIter( aBroadcastAreaTbl.begin()); aIter != aBroadcastAreaTbl.end(); /* increment in body */ ) { ScBroadcastArea* pArea = *aIter; @@ -312,7 +312,7 @@ BOOL ScBroadcastAreaSlot::AreaBroadcastInRange( const ScRange& rRange, if (aBroadcastAreaTbl.empty()) return FALSE; BOOL bIsBroadcasted = FALSE; - for (ScBroadcastAreas::const_iterator aIter( aBroadcastAreaTbl.begin()); + for (ScBroadcastAreas::const_iterator aIter( aBroadcastAreaTbl.begin()); aIter != aBroadcastAreaTbl.end(); /* increment in body */ ) { ScBroadcastArea* pArea = *aIter; @@ -421,7 +421,7 @@ void ScBroadcastAreaSlot::UpdateRemoveArea( ScBroadcastArea* pArea ) void ScBroadcastAreaSlot::UpdateInsert( ScBroadcastArea* pArea ) { - ::std::pair< ScBroadcastAreas::iterator, bool > aPair = + ::std::pair< ScBroadcastAreas::iterator, bool > aPair = aBroadcastAreaTbl.insert( pArea ); if (aPair.second) pArea->IncRef(); @@ -572,9 +572,9 @@ void ScBroadcastAreaSlotMachine::StartListeningArea( const ScRange& rRange, *pp = new ScBroadcastAreaSlot( pDoc, this ); if (!pArea) { - // If the call to StartListeningArea didn't create the - // ScBroadcastArea, listeners were added to an already - // existing identical area that doesn't need to be inserted + // If the call to StartListeningArea didn't create the + // ScBroadcastArea, listeners were added to an already + // existing identical area that doesn't need to be inserted // to slots again. if (!(*pp)->StartListeningArea( rRange, pListener, pArea)) bDone = true; @@ -620,7 +620,7 @@ void ScBroadcastAreaSlotMachine::EndListeningArea( const ScRange& rRange, ScBroadcastArea* pArea = NULL; if (nOff == 0 && nEnd == nBcaSlots-1) { - // Slightly optimized for 0,0,MAXCOL,MAXROW calls as they + // Slightly optimized for 0,0,MAXCOL,MAXROW calls as they // happen for insertion and deletion of sheets. ScBroadcastAreaSlot** const pStop = ppSlots + nEnd; do @@ -661,7 +661,7 @@ BOOL ScBroadcastAreaSlotMachine::AreaBroadcast( const ScHint& rHint ) const TableSlotsMap::const_iterator iTab( aTableSlotsMap.find( rAddress.Tab())); if (iTab == aTableSlotsMap.end()) return FALSE; - ScBroadcastAreaSlot* pSlot = (*iTab).second->getAreaSlot( + ScBroadcastAreaSlot* pSlot = (*iTab).second->getAreaSlot( ComputeSlotOffset( rAddress)); if ( pSlot ) return pSlot->AreaBroadcast( rHint ); @@ -711,7 +711,7 @@ void ScBroadcastAreaSlotMachine::DelBroadcastAreasInRange( ScBroadcastAreaSlot** pp = ppSlots + nOff; if (nOff == 0 && nEnd == nBcaSlots-1) { - // Slightly optimized for 0,0,MAXCOL,MAXROW calls as they + // Slightly optimized for 0,0,MAXCOL,MAXROW calls as they // happen for insertion and deletion of sheets. ScBroadcastAreaSlot** const pStop = ppSlots + nEnd; do @@ -751,7 +751,7 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas( ScBroadcastAreaSlot** pp = ppSlots + nOff; if (nOff == 0 && nEnd == nBcaSlots-1) { - // Slightly optimized for 0,0,MAXCOL,MAXROW calls as they + // Slightly optimized for 0,0,MAXCOL,MAXROW calls as they // happen for insertion and deletion of sheets. ScBroadcastAreaSlot** const pStop = ppSlots + nEnd; do @@ -771,7 +771,7 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas( } } - // Updating an area's range will modify the hash key, remove areas from all + // Updating an area's range will modify the hash key, remove areas from all // affected slots. Will be reinserted later with the updated range. ScBroadcastArea* pChain = pUpdateChain; while (pChain) @@ -801,7 +801,7 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas( ComputeNextSlot( nOff, nBreak, pp, nStart, ppSlots, nRowBreak); } } - + } // shift sheets @@ -900,7 +900,7 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas( pArea->SetUpdateChainNext( NULL ); pArea->SetInUpdateChain( FALSE ); - // Delete if not inserted to any slot. RemoveBulkArea(pArea) was + // Delete if not inserted to any slot. RemoveBulkArea(pArea) was // already executed in UpdateRemove(). if (!pArea->GetRef()) delete pArea; diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index aa492630ab0e..1ea4b225943d 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -1,7 +1,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 @@ -77,7 +77,7 @@ const USHORT nMemPoolNoteCell = (0x1000 - 64) / sizeof(ScNoteCell); IMPL_FIXEDMEMPOOL_NEWDEL( ScValueCell, nMemPoolValueCell, nMemPoolValueCell ) IMPL_FIXEDMEMPOOL_NEWDEL( ScFormulaCell, nMemPoolFormulaCell, nMemPoolFormulaCell ) IMPL_FIXEDMEMPOOL_NEWDEL( ScStringCell, nMemPoolStringCell, nMemPoolStringCell ) -IMPL_FIXEDMEMPOOL_NEWDEL( ScNoteCell, nMemPoolNoteCell, nMemPoolNoteCell ) +IMPL_FIXEDMEMPOOL_NEWDEL( ScNoteCell, nMemPoolNoteCell, nMemPoolNoteCell ) #endif // ============================================================================ @@ -240,7 +240,7 @@ void ScBaseCell::StartListeningTo( ScDocument* pDoc ) && !((ScFormulaCell*)this)->IsInChangeTrack() ) { - pDoc->SetDetectiveDirty(TRUE); // es hat sich was geaendert... + pDoc->SetDetectiveDirty(TRUE); // es hat sich was geaendert... ScFormulaCell* pFormCell = (ScFormulaCell*)this; ScTokenArray* pArr = pFormCell->GetCode(); @@ -273,9 +273,9 @@ void ScBaseCell::StartListeningTo( ScDocument* pDoc ) if ( rRef1.Valid() && rRef2.Valid() ) { if ( t->GetOpCode() == ocColRowNameAuto ) - { // automagically + { // automagically if ( rRef1.IsColRel() ) - { // ColName + { // ColName pDoc->StartListeningArea( ScRange ( rRef1.nCol, rRef1.nRow, @@ -285,7 +285,7 @@ void ScBaseCell::StartListeningTo( ScDocument* pDoc ) rRef2.nTab ), pFormCell ); } else - { // RowName + { // RowName pDoc->StartListeningArea( ScRange ( rRef1.nCol, rRef1.nRow, @@ -316,7 +316,7 @@ void ScBaseCell::StartListeningTo( ScDocument* pDoc ) } } -// pArr gesetzt -> Referenzen von anderer Zelle nehmen +// pArr gesetzt -> Referenzen von anderer Zelle nehmen // dann muss auch aPos uebergeben werden! void ScBaseCell::EndListeningTo( ScDocument* pDoc, ScTokenArray* pArr, @@ -326,7 +326,7 @@ void ScBaseCell::EndListeningTo( ScDocument* pDoc, ScTokenArray* pArr, && !((ScFormulaCell*)this)->IsInChangeTrack() ) { - pDoc->SetDetectiveDirty(TRUE); // es hat sich was geaendert... + pDoc->SetDetectiveDirty(TRUE); // es hat sich was geaendert... ScFormulaCell* pFormCell = (ScFormulaCell*)this; if( pFormCell->GetCode()->IsRecalcModeAlways() ) @@ -363,9 +363,9 @@ void ScBaseCell::EndListeningTo( ScDocument* pDoc, ScTokenArray* pArr, if ( rRef1.Valid() && rRef2.Valid() ) { if ( t->GetOpCode() == ocColRowNameAuto ) - { // automagically + { // automagically if ( rRef1.IsColRel() ) - { // ColName + { // ColName pDoc->EndListeningArea( ScRange ( rRef1.nCol, rRef1.nRow, @@ -375,7 +375,7 @@ void ScBaseCell::EndListeningTo( ScDocument* pDoc, ScTokenArray* pArr, rRef2.nTab ), pFormCell ); } else - { // RowName + { // RowName pDoc->EndListeningArea( ScRange ( rRef1.nCol, rRef1.nRow, @@ -472,13 +472,13 @@ String ScBaseCell::GetStringData() const ((const ScEditCell*)this)->GetString( aStr ); break; case CELLTYPE_FORMULA: - ((ScFormulaCell*)this)->GetString( aStr ); // an der Formelzelle nicht-const + ((ScFormulaCell*)this)->GetString( aStr ); // an der Formelzelle nicht-const break; } return aStr; } -// static +// static BOOL ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 ) { CellType eType1 = CELLTYPE_NONE; @@ -502,14 +502,14 @@ BOOL ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 ) if ( eType1 != eType2 ) return FALSE; - switch ( eType1 ) // beide Typen gleich + switch ( eType1 ) // beide Typen gleich { - case CELLTYPE_NONE: // beide leer + case CELLTYPE_NONE: // beide leer return TRUE; - case CELLTYPE_VALUE: // wirklich Value-Zellen + case CELLTYPE_VALUE: // wirklich Value-Zellen return ( ((const ScValueCell*)pCell1)->GetValue() == ((const ScValueCell*)pCell2)->GetValue() ); - case CELLTYPE_STRING: // String oder Edit + case CELLTYPE_STRING: // String oder Edit { String aText1; if ( pCell1->GetCellType() == CELLTYPE_STRING ) @@ -525,14 +525,14 @@ BOOL ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 ) } case CELLTYPE_FORMULA: { - //! eingefuegte Zeilen / Spalten beruecksichtigen !!!!! - //! Vergleichsfunktion an der Formelzelle ??? - //! Abfrage mit ScColumn::SwapRow zusammenfassen! + //! eingefuegte Zeilen / Spalten beruecksichtigen !!!!! + //! Vergleichsfunktion an der Formelzelle ??? + //! Abfrage mit ScColumn::SwapRow zusammenfassen! ScTokenArray* pCode1 = ((ScFormulaCell*)pCell1)->GetCode(); ScTokenArray* pCode2 = ((ScFormulaCell*)pCell2)->GetCode(); - if (pCode1->GetLen() == pCode2->GetLen()) // nicht-UPN + if (pCode1->GetLen() == pCode2->GetLen()) // nicht-UPN { BOOL bEqual = TRUE; USHORT nLen = pCode1->GetLen(); @@ -549,7 +549,7 @@ BOOL ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 ) return TRUE; } - return FALSE; // unterschiedlich lang oder unterschiedliche Tokens + return FALSE; // unterschiedlich lang oder unterschiedliche Tokens } default: DBG_ERROR("huch, was fuer Zellen???"); @@ -623,7 +623,7 @@ ScStringCell::~ScStringCell() // ============================================================================ // -// ScFormulaCell +// ScFormulaCell // ScFormulaCell::ScFormulaCell() : @@ -757,8 +757,8 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons pCode->ReadjustRelative3DReferences( rCell.aPos, aPos ); // evtl. Fehler zuruecksetzen und neu kompilieren - // nicht im Clipboard - da muss das Fehlerflag erhalten bleiben - // Spezialfall Laenge=0: als Fehlerzelle erzeugt, dann auch Fehler behalten + // nicht im Clipboard - da muss das Fehlerflag erhalten bleiben + // Spezialfall Laenge=0: als Fehlerzelle erzeugt, dann auch Fehler behalten if ( pCode->GetCodeError() && !pDocument->IsClipboard() && pCode->GetLen() ) { pCode->SetCodeError( 0 ); @@ -932,7 +932,7 @@ void ScFormulaCell::Compile( const String& rFormula, BOOL bNoListening, if( !pCode->GetCodeError() ) { if ( !pCode->GetLen() && aResult.GetHybridFormula().Len() && rFormula == aResult.GetHybridFormula() ) - { // #65994# nicht rekursiv CompileTokenArray/Compile/CompileTokenArray + { // #65994# nicht rekursiv CompileTokenArray/Compile/CompileTokenArray if ( rFormula.GetChar(0) == '=' ) pCode->AddBad( rFormula.GetBuffer() + 1 ); else @@ -992,7 +992,7 @@ void ScFormulaCell::CompileTokenArray( BOOL bNoListening ) void ScFormulaCell::CompileXML( ScProgress& rProgress ) { if ( cMatrixFlag == MM_REFERENCE ) - { // is already token code via ScDocFunc::EnterMatrix, ScDocument::InsertMatrixFormula + { // is already token code via ScDocFunc::EnterMatrix, ScDocument::InsertMatrixFormula // just establish listeners StartListeningTo( pDocument ); return ; @@ -1036,8 +1036,8 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress ) SetScriptType( SC_SCRIPTTYPE_UNKNOWN ); } - // Same as in Load: after loading, it must be known if ocMacro is in any formula - // (for macro warning, CompileXML is called at the end of loading XML file) + // Same as in Load: after loading, it must be known if ocMacro is in any formula + // (for macro warning, CompileXML is called at the end of loading XML file) if ( !pDocument->GetHasMacroFunc() && pCode->HasOpCodeRPN( ocMacro ) ) pDocument->SetHasMacroFunc( TRUE ); } @@ -1096,7 +1096,7 @@ void ScFormulaCell::CalcAfterLoad() bDirty = TRUE; } if ( pCode->IsRecalcModeAlways() ) - { // zufall(), heute(), jetzt() bleiben immer im FormulaTree, damit sie + { // zufall(), heute(), jetzt() bleiben immer im FormulaTree, damit sie // auch bei jedem F9 berechnet werden. bDirty = TRUE; } @@ -1209,9 +1209,9 @@ void ScFormulaCell::Interpret() if (!IsDirtyOrInTableOpDirty() || pDocument->GetRecursionHelper().IsInReturn()) 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 !!! + //! HACK: + // Wenn der Aufruf aus einem Reschedule im DdeLink-Update kommt, dirty stehenlassen + // Besser: Dde-Link Update ohne Reschedule oder ganz asynchron !!! if ( pDocument->IsInDdeLinkUpdate() ) return; @@ -1782,9 +1782,9 @@ ULONG ScFormulaCell::GetStandardFormat( SvNumberFormatter& rFormatter, ULONG nFo return nFormatIndex; //! not ScFormulaCell::IsValue(), that could reinterpret the formula again. if ( aResult.IsValue() ) - return ScGlobal::GetStandardFormat( aResult.GetDouble(), rFormatter, nFormat, nFormatType ); + return ScGlobal::GetStandardFormat( aResult.GetDouble(), rFormatter, nFormat, nFormatType ); else - return ScGlobal::GetStandardFormat( rFormatter, nFormat, nFormatType ); + return ScGlobal::GetStandardFormat( rFormatter, nFormat, nFormatType ); } @@ -1905,7 +1905,7 @@ void ScFormulaCell::AddRecalcMode( ScRecalcMode nBits ) if ( (nBits & RECALCMODE_EMASK) != RECALCMODE_NORMAL ) bDirty = TRUE; if ( nBits & RECALCMODE_ONLOAD_ONCE ) - { // OnLoadOnce nur zum Dirty setzen nach Filter-Import + { // OnLoadOnce nur zum Dirty setzen nach Filter-Import nBits = (nBits & ~RECALCMODE_EMASK) | RECALCMODE_NORMAL; } pCode->AddRecalcMode( nBits ); diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index 1aab26acf3aa..c056c399e7e3 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -1,7 +1,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 @@ -225,7 +225,7 @@ lcl_checkRangeDimensions( const bool bSameCols(lcl_checkRangeDimension(rRef1, rRef2, lcl_GetCol)); const bool bSameRows(lcl_checkRangeDimension(rRef1, rRef2, lcl_GetRow)); const bool bSameTabs(lcl_checkRangeDimension(rRef1, rRef2, lcl_GetTab)); - + // Test if exactly two dimensions are equal if (!(bSameCols ^ bSameRows ^ bSameTabs) && (bSameCols || bSameRows || bSameTabs)) @@ -677,9 +677,9 @@ ScFormulaCell::HasRefListExpressibleAsOneReference(ScRange& rRange) const intersection must be empty set. */ - // Detect the simple case of exactly one reference in advance without all + // Detect the simple case of exactly one reference in advance without all // overhead. - // #i107741# Doing so actually makes outlines using SUBTOTAL(x;reference) + // #i107741# Doing so actually makes outlines using SUBTOTAL(x;reference) // work again, where the function does not have only references. if (HasOneReference( rRange)) return true; diff --git a/sc/source/core/data/clipparam.cxx b/sc/source/core/data/clipparam.cxx index 9ab5995ca26c..34cdef3600c8 100644 --- a/sc/source/core/data/clipparam.cxx +++ b/sc/source/core/data/clipparam.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index e9fd26ced939..98f7b4c8b393 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1,7 +1,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 @@ -49,18 +49,18 @@ #include "compiler.hxx" #include "brdcst.hxx" #include "markdata.hxx" -#include "detfunc.hxx" // for Notes in Sort/Swap +#include "detfunc.hxx" // for Notes in Sort/Swap #include "postit.hxx" //#pragma optimize ( "", off ) -// nur Search ohne Optimierung! +// nur Search ohne Optimierung! // STATIC DATA ----------------------------------------------------------- using namespace formula; inline BOOL IsAmbiguousScriptNonZero( BYTE nScript ) { - //! move to a header file + //! move to a header file return ( nScript != SCRIPTTYPE_LATIN && nScript != SCRIPTTYPE_ASIAN && nScript != SCRIPTTYPE_COMPLEX && @@ -140,24 +140,24 @@ USHORT ScColumn::GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, USHORT nMask ) c if ( nEdges ) { if ( nEdges & 8 ) - bOpen = TRUE; // obere Kante oeffnet, weitersehen + bOpen = TRUE; // obere Kante oeffnet, weitersehen else if ( !bOpen ) - return nEdges | 32; // es gibt was, was nicht geoeffnet wurde + return nEdges | 32; // es gibt was, was nicht geoeffnet wurde else if ( nEdges & 1 ) - return nEdges; // mittendrin + return nEdges; // mittendrin // (nMask & 16 und (4 und nicht 16)) oder // (nMask & 4 und (16 und nicht 4)) if ( ((nMask & 16) && (nEdges & 4) && !(nEdges & 16)) || ((nMask & 4) && (nEdges & 16) && !(nEdges & 4)) ) - return nEdges; // nur linke/rechte Kante + return nEdges; // nur linke/rechte Kante if ( nEdges & 2 ) - bOpen = FALSE; // untere Kante schliesst + bOpen = FALSE; // untere Kante schliesst } } nIndex++; } if ( bOpen ) - nEdges |= 32; // es geht noch weiter + nEdges |= 32; // es geht noch weiter return nEdges; } } @@ -189,21 +189,21 @@ BOOL ScColumn::HasSelectionMatrixFragment(const ScMarkData& rMark) const if ( nEdges ) { if ( nEdges & 8 ) - bOpen = TRUE; // obere Kante oeffnet, weitersehen + bOpen = TRUE; // obere Kante oeffnet, weitersehen else if ( !bOpen ) - return TRUE; // es gibt was, was nicht geoeffnet wurde + return TRUE; // es gibt was, was nicht geoeffnet wurde else if ( nEdges & 1 ) - bFound = TRUE; // mittendrin, alles selektiert? + bFound = TRUE; // mittendrin, alles selektiert? // (4 und nicht 16) oder (16 und nicht 4) if ( (((nEdges & 4) | 16) ^ ((nEdges & 16) | 4)) ) - bFound = TRUE; // nur linke/rechte Kante, alles selektiert? + bFound = TRUE; // nur linke/rechte Kante, alles selektiert? if ( nEdges & 2 ) - bOpen = FALSE; // untere Kante schliesst + bOpen = FALSE; // untere Kante schliesst if ( bFound ) - { // alles selektiert? + { // alles selektiert? if ( aCurOrg != aOrg ) - { // neue Matrix zu pruefen? + { // neue Matrix zu pruefen? aCurOrg = aOrg; ScFormulaCell* pFCell; if ( ((ScFormulaCell*)pCell)->GetMatrixFlag() @@ -221,7 +221,7 @@ BOOL ScColumn::HasSelectionMatrixFragment(const ScMarkData& rMark) const bFound = FALSE; } else - bFound = FALSE; // war schon + bFound = FALSE; // war schon } } } @@ -435,7 +435,7 @@ void ScColumn::ApplyPattern( SCROW nRow, const ScPatternAttr& rPatAttr ) const ScPatternAttr* pPattern = pAttrArray->GetPattern( nRow ); - // TRUE = alten Eintrag behalten + // TRUE = alten Eintrag behalten ScPatternAttr* pNewPattern = (ScPatternAttr*) &aCache.ApplyTo( *pPattern, TRUE ); ScDocumentPool::CheckRef( *pPattern ); @@ -566,7 +566,7 @@ const ScStyleSheet* ScColumn::GetSelectionStyle( const ScMarkData& rMark, BOOL& pNewStyle = pPattern->GetStyleSheet(); rFound = TRUE; if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) - bEqual = FALSE; // unterschiedliche + bEqual = FALSE; // unterschiedliche pStyle = pNewStyle; } } @@ -575,7 +575,7 @@ const ScStyleSheet* ScColumn::GetSelectionStyle( const ScMarkData& rMark, BOOL& } -const ScStyleSheet* ScColumn::GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRow2 ) const +const ScStyleSheet* ScColumn::GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRow2 ) const { rFound = FALSE; @@ -593,7 +593,7 @@ const ScStyleSheet* ScColumn::GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRo pNewStyle = pPattern->GetStyleSheet(); rFound = TRUE; if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) - bEqual = FALSE; // unterschiedliche + bEqual = FALSE; // unterschiedliche pStyle = pNewStyle; } @@ -644,8 +644,8 @@ void ScColumn::SetPatternArea( SCROW nStartRow, SCROW nEndRow, void ScColumn::ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr ) { - // um nur ein neues SetItem zu erzeugen, brauchen wir keinen SfxItemPoolCache. - //! Achtung: der SfxItemPoolCache scheint zuviele Refs fuer das neue SetItem zu erzeugen ?? + // um nur ein neues SetItem zu erzeugen, brauchen wir keinen SfxItemPoolCache. + //! Achtung: der SfxItemPoolCache scheint zuviele Refs fuer das neue SetItem zu erzeugen ?? ScDocumentPool* pDocPool = pDocument->GetPool(); @@ -657,7 +657,7 @@ void ScColumn::ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr ) if ( pNewPattern != pOldPattern ) pAttrArray->SetPattern( nRow, pNewPattern ); else - pDocPool->Remove( *pNewPattern ); // ausser Spesen nichts gewesen + pDocPool->Remove( *pNewPattern ); // ausser Spesen nichts gewesen delete pTemp; @@ -667,7 +667,7 @@ void ScColumn::ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr ) const ScPatternAttr* pPattern = pAttrArray->GetPattern( nRow ); - // TRUE = alten Eintrag behalten + // TRUE = alten Eintrag behalten ScPatternAttr* pNewPattern = (ScPatternAttr*) &aCache.ApplyTo( *pPattern, TRUE ); ScDocumentPool::CheckRef( *pPattern ); @@ -712,25 +712,25 @@ BOOL ScColumn::Search( SCROW nRow, SCSIZE& nIndex ) const } long nOldLo, nOldHi; - long nLo = nOldLo = 0; - long nHi = nOldHi = Min(static_cast<long>(nCount)-1, static_cast<long>(nRow) ); - long i = 0; - BOOL bFound = FALSE; + long nLo = nOldLo = 0; + long nHi = nOldHi = Min(static_cast<long>(nCount)-1, static_cast<long>(nRow) ); + long i = 0; + BOOL bFound = FALSE; // quite continuous distribution? => interpolating search - BOOL bInterpol = (static_cast<SCSIZE>(nMaxRow - nMinRow) < nCount * 2); - SCROW nR; + BOOL bInterpol = (static_cast<SCSIZE>(nMaxRow - nMinRow) < nCount * 2); + SCROW nR; while ( !bFound && nLo <= nHi ) { if ( !bInterpol || nHi - nLo < 3 ) - i = (nLo+nHi) / 2; // no effort, no division by zero + i = (nLo+nHi) / 2; // no effort, no division by zero else - { // interpolating search - long nLoRow = pItems[nLo].nRow; // no unsigned underflow upon substraction + { // interpolating search + long nLoRow = pItems[nLo].nRow; // no unsigned underflow upon substraction i = nLo + (long)((long)(nRow - nLoRow) * (nHi - nLo) / (pItems[nHi].nRow - nLoRow)); if ( i < 0 || static_cast<SCSIZE>(i) >= nCount ) - { // oops ... + { // oops ... i = (nLo+nHi) / 2; bInterpol = FALSE; } @@ -814,7 +814,7 @@ void ScColumn::Resize( SCSIZE nSize ) pItems = pNewItems; } -// SwapRow zum Sortieren +// SwapRow zum Sortieren namespace { @@ -929,7 +929,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) ScTokenArray* pCode1 = pFmlaCell1->GetCode(); ScTokenArray* pCode2 = pFmlaCell2->GetCode(); - if (pCode1->GetLen() == pCode2->GetLen()) // nicht-UPN + if (pCode1->GetLen() == pCode2->GetLen()) // nicht-UPN { BOOL bEqual = TRUE; USHORT nLen = pCode1->GetLen(); @@ -956,8 +956,8 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) } } - // hier kein UpdateReference wegen #30529# - mitsortiert werden nur noch relative Referenzen -// long dy = (long)nRow2 - (long)nRow1; + // hier kein UpdateReference wegen #30529# - mitsortiert werden nur noch relative Referenzen +// long dy = (long)nRow2 - (long)nRow1; /* Create clone of pCell1 at position of pCell2 (pCell1 exists always, see variable swapping above). Do not clone the note, but move pointer of @@ -1073,12 +1073,12 @@ BOOL ScColumn::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const bTest = (pItems[i].nRow < nStartRow) || (pItems[i].nRow > nEndRow) || pItems[i].pCell->IsBlank(); - // AttrArray testet nur zusammengefasste + // AttrArray testet nur zusammengefasste if ((bTest) && (pAttrArray)) bTest = pAttrArray->TestInsertCol(nStartRow, nEndRow); - //! rausgeschobene Attribute bei Undo beruecksichtigen + //! rausgeschobene Attribute bei Undo beruecksichtigen return bTest; } @@ -1098,7 +1098,7 @@ BOOL ScColumn::TestInsertRow( SCSIZE nSize ) const return pAttrArray->TestInsertRow( nSize ); #if 0 - //! rausgeschobene Attribute bei Undo beruecksichtigen + //! rausgeschobene Attribute bei Undo beruecksichtigen if ( nSize > static_cast<SCSIZE>(MAXROW) ) return FALSE; @@ -1119,7 +1119,7 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize ) { pAttrArray->InsertRow( nStartRow, nSize ); - //! Search + //! Search if ( !pItems || !nCount ) return; @@ -1130,7 +1130,7 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize ) return ; BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden SCSIZE nNewCount = nCount; BOOL bCountChanged = FALSE; @@ -1238,8 +1238,8 @@ void ScColumn::CopyToClip(SCROW nRow1, SCROW nRow2, ScColumn& rColumn, BOOL bKee nEndIndex = i; ++nBlockCount; - // im Clipboard muessen interpretierte Zellen stehen, um andere Formate - // (Text, Grafik...) erzueugen zu koennen + // im Clipboard muessen interpretierte Zellen stehen, um andere Formate + // (Text, Grafik...) erzueugen zu koennen if ( pItems[i].pCell->GetCellType() == CELLTYPE_FORMULA ) { @@ -1293,7 +1293,7 @@ void ScColumn::CopyToColumn(SCROW nRow1, SCROW nRow2, USHORT nFlags, BOOL bMarke if ( (nFlags & IDF_ATTRIB) != 0 ) { if ( (nFlags & IDF_STYLES) != IDF_STYLES ) - { // StyleSheets im Zieldokument bleiben erhalten + { // StyleSheets im Zieldokument bleiben erhalten // z.B. DIF und RTF Clipboard-Import for ( SCROW nRow = nRow1; nRow <= nRow2; nRow++ ) { @@ -1350,7 +1350,7 @@ void ScColumn::UndoToColumn(SCROW nRow1, SCROW nRow2, USHORT nFlags, BOOL bMarke if (nRow1 > 0) CopyToColumn( 0, nRow1-1, IDF_FORMULA, FALSE, rColumn ); - CopyToColumn( nRow1, nRow2, nFlags, bMarked, rColumn, pMarkData ); //! bMarked ???? + CopyToColumn( nRow1, nRow2, nFlags, bMarked, rColumn, pMarkData ); //! bMarked ???? if (nRow2 < MAXROW) CopyToColumn( nRow2+1, MAXROW, IDF_FORMULA, FALSE, rColumn ); @@ -1376,14 +1376,14 @@ void ScColumn::CopyUpdated( const ScColumn& rPosCol, ScColumn& rDestCol ) const } } - // Dummy: - // CopyToColumn( 0,MAXROW, IDF_FORMULA, FALSE, rDestCol, NULL, FALSE ); + // Dummy: + // CopyToColumn( 0,MAXROW, IDF_FORMULA, FALSE, rDestCol, NULL, FALSE ); } void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol ) { - // Dies ist die Szenario-Tabelle, die Daten werden hineinkopiert + // Dies ist die Szenario-Tabelle, die Daten werden hineinkopiert ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW ); SCROW nStart = -1, nEnd = -1; @@ -1396,7 +1396,7 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol ) ((ScColumn&)rSrcCol). CopyToColumn( nStart, nEnd, IDF_CONTENTS, FALSE, *this ); - // UpdateUsed nicht noetig, schon in TestCopyScenario passiert + // UpdateUsed nicht noetig, schon in TestCopyScenario passiert SCsTAB nDz = nTab - rSrcCol.nTab; UpdateReference(URM_COPY, nCol, nStart, nTab, @@ -1405,7 +1405,7 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol ) UpdateCompile(); } - //! CopyToColumn "const" machen !!! + //! CopyToColumn "const" machen !!! pPattern = aAttrIter.Next( nStart, nEnd ); } @@ -1414,7 +1414,7 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol ) void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const { - // Dies ist die Szenario-Tabelle, die Daten werden in die andere kopiert + // Dies ist die Szenario-Tabelle, die Daten werden in die andere kopiert ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW ); SCROW nStart = -1, nEnd = -1; @@ -1427,7 +1427,7 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const ((ScColumn*)this)-> CopyToColumn( nStart, nEnd, IDF_CONTENTS, FALSE, rDestCol ); - // UpdateUsed nicht noetig, schon in TestCopyScenario passiert + // UpdateUsed nicht noetig, schon in TestCopyScenario passiert SCsTAB nDz = rDestCol.nTab - nTab; rDestCol.UpdateReference(URM_COPY, rDestCol.nCol, nStart, rDestCol.nTab, @@ -1436,7 +1436,7 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const rDestCol.UpdateCompile(); } - //! CopyToColumn "const" machen !!! + //! CopyToColumn "const" machen !!! pPattern = aAttrIter.Next( nStart, nEnd ); } @@ -1581,7 +1581,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) ScAddress aAdr( nCol, 0, nTab ); ScHint aHint( SC_HINT_DYING, aAdr, NULL ); // areas only ScAddress& rAddress = aHint.GetAddress(); - ScNoteCell* pNoteCell = new ScNoteCell; // Dummy like in DeleteRange + ScNoteCell* pNoteCell = new ScNoteCell; // Dummy like in DeleteRange // #121990# must iterate backwards, because indexes of following cells become invalid for (EntryPosPairs::reverse_iterator it( aEntries.rbegin()); @@ -1617,13 +1617,13 @@ void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW ScRange aRange( ScAddress( nCol1, nRow1, nTab1 ), ScAddress( nCol2, nRow2, nTab2 ) ); if ( eUpdateRefMode == URM_COPY && nRow1 == nRow2 ) - { // z.B. eine einzelne Zelle aus dem Clipboard eingefuegt + { // z.B. eine einzelne Zelle aus dem Clipboard eingefuegt SCSIZE nIndex; if ( Search( nRow1, nIndex ) ) { ScFormulaCell* pCell = (ScFormulaCell*) pItems[nIndex].pCell; if( pCell->GetCellType() == CELLTYPE_FORMULA) - pCell->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc ); + pCell->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc ); } } else @@ -1685,7 +1685,7 @@ void ScColumn::UpdateTranspose( const ScRange& rSource, const ScAddress& rDest, SCROW nRow = pItems[i].nRow; ((ScFormulaCell*)pCell)->UpdateTranspose( rSource, rDest, pUndoDoc ); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener geloescht/eingefuegt? + Search( nRow, i ); // Listener geloescht/eingefuegt? } } } @@ -1702,7 +1702,7 @@ void ScColumn::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY ) SCROW nRow = pItems[i].nRow; ((ScFormulaCell*)pCell)->UpdateGrow( rArea, nGrowX, nGrowY ); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener geloescht/eingefuegt? + Search( nRow, i ); // Listener geloescht/eingefuegt? } } } @@ -1728,7 +1728,7 @@ void ScColumn::UpdateInsertTabOnlyCells( SCTAB nTable) SCROW nRow = pItems[i].nRow; pCell->UpdateInsertTab(nTable); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener geloescht/eingefuegt? + Search( nRow, i ); // Listener geloescht/eingefuegt? } } } @@ -1745,7 +1745,7 @@ void ScColumn::UpdateInsertTabAbs(SCTAB nTable) SCROW nRow = pItems[i].nRow; pCell->UpdateInsertTabAbs(nTable); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener geloescht/eingefuegt? + Search( nRow, i ); // Listener geloescht/eingefuegt? } } } @@ -1769,7 +1769,7 @@ void ScColumn::UpdateDeleteTab( SCTAB nTable, BOOL bIsMove, ScColumn* pRefUndo ) BOOL bChanged = pOld->UpdateDeleteTab(nTable, bIsMove); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener geloescht/eingefuegt? + Search( nRow, i ); // Listener geloescht/eingefuegt? if (pRefUndo) { @@ -1795,7 +1795,7 @@ void ScColumn::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo ) SCROW nRow = pItems[i].nRow; pCell->UpdateMoveTab( nOldPos, nNewPos, nTabNo ); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener geloescht/eingefuegt? + Search( nRow, i ); // Listener geloescht/eingefuegt? } } } @@ -1812,7 +1812,7 @@ void ScColumn::UpdateCompile( BOOL bForceIfNameInUse ) SCROW nRow = pItems[i].nRow; p->UpdateCompile( bForceIfNameInUse ); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener geloescht/eingefuegt? + Search( nRow, i ); // Listener geloescht/eingefuegt? } } } @@ -1887,7 +1887,7 @@ void ScColumn::SetDirty() { // wird nur dokumentweit verwendet, kein FormulaTrack BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for (SCSIZE i=0; i<nCount; i++) { ScFormulaCell* p = (ScFormulaCell*) pItems[i].pCell; @@ -1903,11 +1903,11 @@ void ScColumn::SetDirty() void ScColumn::SetDirty( const ScRange& rRange ) -{ // broadcastet alles innerhalb eines Range, mit FormulaTrack +{ // broadcastet alles innerhalb eines Range, mit FormulaTrack if ( !pItems || !nCount ) return ; BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden SCROW nRow2 = rRange.aEnd.Row(); ScAddress aPos( nCol, 0, nTab ); ScHint aHint( SC_HINT_DATACHANGED, aPos, NULL ); @@ -1936,7 +1936,7 @@ void ScColumn::SetTableOpDirty( const ScRange& rRange ) if ( !pItems || !nCount ) return ; BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // no multiple recalculation + pDocument->SetAutoCalc( FALSE ); // no multiple recalculation SCROW nRow2 = rRange.aEnd.Row(); ScAddress aPos( nCol, 0, nTab ); ScHint aHint( SC_HINT_TABLEOPDIRTY, aPos, NULL ); @@ -1963,7 +1963,7 @@ void ScColumn::SetTableOpDirty( const ScRange& rRange ) void ScColumn::SetDirtyAfterLoad() { BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for (SCSIZE i=0; i<nCount; i++) { ScFormulaCell* p = (ScFormulaCell*) pItems[i].pCell; @@ -1996,7 +1996,7 @@ void ScColumn::SetDirtyAfterLoad() void ScColumn::SetRelNameDirty() { BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for (SCSIZE i=0; i<nCount; i++) { ScFormulaCell* p = (ScFormulaCell*) pItems[i].pCell; @@ -2026,7 +2026,7 @@ void ScColumn::CalcAll() if ( pFCell->GetCode()->IsRecalcModeNormal() ) nNewVal = pFCell->GetValue(); else - nNewVal = nOldVal; // random(), jetzt() etc. + nNewVal = nOldVal; // random(), jetzt() etc. DBG_ASSERT( nOldVal==nNewVal, "CalcAll: nOldVal != nNewVal" ); #endif } @@ -2049,7 +2049,7 @@ void ScColumn::CompileAll() ((ScFormulaCell*)pCell)->SetCompile( TRUE ); ((ScFormulaCell*)pCell)->CompileTokenArray(); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener geloescht/eingefuegt? + Search( nRow, i ); // Listener geloescht/eingefuegt? } } } @@ -2066,7 +2066,7 @@ void ScColumn::CompileXML( ScProgress& rProgress ) SCROW nRow = pItems[i].nRow; ((ScFormulaCell*)pCell)->CompileXML( rProgress ); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener geloescht/eingefuegt? + Search( nRow, i ); // Listener geloescht/eingefuegt? } } } @@ -2103,7 +2103,7 @@ void ScColumn::ResetChanged( SCROW nStartRow, SCROW nEndRow ) BOOL ScColumn::HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) const { - // used in GetOptimalHeight - ambiguous script type counts as edit cell + // used in GetOptimalHeight - ambiguous script type counts as edit cell SCROW nRow = 0; SCSIZE nIndex; @@ -2133,7 +2133,7 @@ SCsROW ScColumn::SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle, { if (rMark.IsMultiMarked()) return pAttrArray->SearchStyle( nRow, pSearchStyle, bUp, - (ScMarkArray*) rMark.GetArray()+nCol ); //! const + (ScMarkArray*) rMark.GetArray()+nCol ); //! const else return -1; } @@ -2149,7 +2149,7 @@ BOOL ScColumn::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, const ScStyleShe { if (rMark.IsMultiMarked()) return pAttrArray->SearchStyleRange( rRow, rEndRow, pSearchStyle, bUp, - (ScMarkArray*) rMark.GetArray()+nCol ); //! const + (ScMarkArray*) rMark.GetArray()+nCol ); //! const else return FALSE; } diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 2adf6d926f0f..f585e5612334 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1,7 +1,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 @@ -63,7 +63,7 @@ #include "editutil.hxx" #include "subtotal.hxx" #include "markdata.hxx" -#include "compiler.hxx" // ScTokenArray GetCodeLen +#include "compiler.hxx" // ScTokenArray GetCodeLen #include "dbcolect.hxx" #include "fillinfo.hxx" #include "segmenttree.hxx" @@ -73,13 +73,13 @@ // ----------------------------------------------------------------------- // factor from font size to optimal cell height (text width) -#define SC_ROT_BREAK_FACTOR 6 +#define SC_ROT_BREAK_FACTOR 6 // ----------------------------------------------------------------------- inline BOOL IsAmbiguousScript( BYTE nScript ) { - //! move to a header file + //! move to a header file return ( nScript != SCRIPTTYPE_LATIN && nScript != SCRIPTTYPE_ASIAN && nScript != SCRIPTTYPE_COMPLEX ); @@ -88,7 +88,7 @@ inline BOOL IsAmbiguousScript( BYTE nScript ) // ----------------------------------------------------------------------------------------- // -// Datei-Operationen +// Datei-Operationen // // ----------------------------------------------------------------------------------------- @@ -182,7 +182,7 @@ inline BOOL IsAmbiguousScript( BYTE nScript ) // ----------------------------------------------------------------------------------------- - // GetNeededSize: optimale Hoehe / Breite in Pixeln + // GetNeededSize: optimale Hoehe / Breite in Pixeln long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY, @@ -199,11 +199,11 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, if (!pPattern) pPattern = pAttrArray->GetPattern( nRow ); - // zusammengefasst? - // Merge nicht in bedingter Formatierung + // zusammengefasst? + // Merge nicht in bedingter Formatierung - const ScMergeAttr* pMerge = (const ScMergeAttr*)&pPattern->GetItem(ATTR_MERGE); - const ScMergeFlagAttr* pFlag = (const ScMergeFlagAttr*)&pPattern->GetItem(ATTR_MERGE_FLAG); + const ScMergeAttr* pMerge = (const ScMergeAttr*)&pPattern->GetItem(ATTR_MERGE); + const ScMergeFlagAttr* pFlag = (const ScMergeFlagAttr*)&pPattern->GetItem(ATTR_MERGE_FLAG); if ( bWidth ) { @@ -220,12 +220,12 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, return 0; } - // bedingte Formatierung + // bedingte Formatierung const SfxItemSet* pCondSet = NULL; if ( ((const SfxUInt32Item&)pPattern->GetItem(ATTR_CONDITIONAL)).GetValue() ) pCondSet = pDocument->GetCondResult( nCol, nRow, nTab ); - // Zeilenumbruch? + // Zeilenumbruch? const SfxPoolItem* pCondItem; SvxCellHorJustify eHorJust; @@ -248,7 +248,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, // Cell has a value. Disable line break. bBreak = false; - // get other attributes from pattern and conditional formatting + // get other attributes from pattern and conditional formatting SvxCellOrientation eOrient = pPattern->GetCellOrientation( pCondSet ); BOOL bAsianVertical = ( eOrient == SVX_ORIENTATION_STACKED && @@ -256,7 +256,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, if ( bAsianVertical ) bBreak = false; - if ( bWidth && bBreak ) // after determining bAsianVertical (bBreak may be reset) + if ( bWidth && bBreak ) // after determining bAsianVertical (bBreak may be reset) return 0; long nRotate = 0; @@ -278,7 +278,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, pPattern->GetItem(ATTR_ROTATE_MODE)).GetValue(); if ( nRotate == 18000 ) - eRotMode = SVX_ROTATE_MODE_STANDARD; // keinen Ueberlauf + eRotMode = SVX_ROTATE_MODE_STANDARD; // keinen Ueberlauf } } @@ -309,8 +309,8 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, BYTE nScript = pDocument->GetScriptType( nCol, nRow, nTab, pCell ); if (nScript == 0) nScript = ScGlobal::GetDefaultScriptType(); - // also call SetFont for edit cells, because bGetFont may be set only once - // bGetFont is set also if script type changes + // also call SetFont for edit cells, because bGetFont may be set only once + // bGetFont is set also if script type changes if (rOptions.bGetFont) { Fraction aFontZoom = ( eOrient == SVX_ORIENTATION_STANDARD ) ? rZoomX : rZoomY; @@ -328,7 +328,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, IsAmbiguousScript( nScript ) || ((eCellType == CELLTYPE_FORMULA) && ((ScFormulaCell*)pCell)->IsMultilineResult()) ); - if (!bEditEngine) // direkte Ausgabe + if (!bEditEngine) // direkte Ausgabe { String aValStr; Color* pColor; @@ -339,7 +339,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, TRUE, rOptions.bFormula, ftCheck ); if (aValStr.Len()) { - // SetFont ist nach oben verschoben + // SetFont ist nach oben verschoben Size aSize( pDev->GetTextWidth( aValStr ), pDev->GetTextHeight() ); if ( eOrient != SVX_ORIENTATION_STANDARD ) @@ -350,9 +350,9 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, } else if ( nRotate ) { - //! unterschiedliche Skalierung X/Y beruecksichtigen + //! unterschiedliche Skalierung X/Y beruecksichtigen - double nRealOrient = nRotate * F_PI18000; // nRotate sind 1/100 Grad + double nRealOrient = nRotate * F_PI18000; // nRotate sind 1/100 Grad double nCosAbs = fabs( cos( nRealOrient ) ); double nSinAbs = fabs( sin( nRealOrient ) ); long nHeight = (long)( aSize.Height() * nCosAbs + aSize.Width() * nSinAbs ); @@ -363,18 +363,18 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, { nWidth = (long) ( pDocument->GetColWidth( nCol,nTab ) * nPPT ); bAddMargin = FALSE; - // nur nach rechts: - //! unterscheiden nach Ausrichtung oben/unten (nur Text/ganze Hoehe) + // nur nach rechts: + //! unterscheiden nach Ausrichtung oben/unten (nur Text/ganze Hoehe) if ( pPattern->GetRotateDir( pCondSet ) == SC_ROTDIR_RIGHT ) nWidth += (long)( pDocument->GetRowHeight( nRow,nTab ) * nPPT * nCosAbs / nSinAbs ); } else - nWidth = (long)( aSize.Height() / nSinAbs ); //! begrenzen? + nWidth = (long)( aSize.Height() / nSinAbs ); //! begrenzen? if ( bBreak && !rOptions.bTotalSize ) { - // #47744# limit size for line break + // #47744# limit size for line break long nCmp = pDev->GetFont().GetSize().Height() * SC_ROT_BREAK_FACTOR; if ( nHeight > nCmp ) nHeight = nCmp; @@ -398,18 +398,18 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, (long) ( pMargin->GetBottomMargin() * nPPT ); } - // Zeilenumbruch ausgefuehrt ? + // Zeilenumbruch ausgefuehrt ? if ( bBreak && !bWidth ) { - // Test mit EditEngine zur Sicherheit schon bei 90% - // (wegen Rundungsfehlern und weil EditEngine teilweise anders formatiert) + // Test mit EditEngine zur Sicherheit schon bei 90% + // (wegen Rundungsfehlern und weil EditEngine teilweise anders formatiert) long nDocPixel = (long) ( ( pDocument->GetColWidth( nCol,nTab ) - pMargin->GetLeftMargin() - pMargin->GetRightMargin() - nIndent ) * nPPT ); - nDocPixel = (nDocPixel * 9) / 10; // zur Sicherheit + nDocPixel = (nDocPixel * 9) / 10; // zur Sicherheit if ( aSize.Width() > nDocPixel ) bEditEngine = TRUE; } @@ -418,7 +418,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, if (bEditEngine) { - // der Font wird bei !bEditEngine nicht jedesmal neu gesetzt + // der Font wird bei !bEditEngine nicht jedesmal neu gesetzt Font aOldFont = pDev->GetFont(); MapMode aHMMMode( MAP_100TH_MM, Point(), rZoomX, rZoomY ); @@ -436,8 +436,8 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, SfxItemSet* pSet = new SfxItemSet( pEngine->GetEmptyItemSet() ); pPattern->FillEditItemSet( pSet, pCondSet ); -// no longer needed, are setted with the text (is faster) -// pEngine->SetDefaults( pSet ); +// no longer needed, are setted with the text (is faster) +// pEngine->SetDefaults( pSet ); if ( ((const SfxBoolItem&)pSet->Get(EE_PARA_HYPHENATE)).GetValue() ) { @@ -454,9 +454,9 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, BOOL bTextWysiwyg = ( pDev->GetOutDevType() == OUTDEV_PRINTER ); if ( bTextWysiwyg ) { - // #95593# if text is formatted for printer, don't use PixelToLogic, - // to ensure the exact same paper width (and same line breaks) as in - // ScEditUtil::GetEditArea, used for output. + // #95593# if text is formatted for printer, don't use PixelToLogic, + // to ensure the exact same paper width (and same line breaks) as in + // ScEditUtil::GetEditArea, used for output. fWidthFactor = HMM_PER_TWIPS; } @@ -469,7 +469,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, nDocWidth += (long) ( pDocument->GetColWidth(nCol+nColAdd,nTab) * fWidthFactor ); nDocWidth -= (long) ( pMargin->GetLeftMargin() * fWidthFactor ) + (long) ( pMargin->GetRightMargin() * fWidthFactor ) - + 1; // Ausgabebereich ist Breite-1 Pixel (wegen Gitterlinien) + + 1; // Ausgabebereich ist Breite-1 Pixel (wegen Gitterlinien) if ( nIndent ) nDocWidth -= (long) ( nIndent * fWidthFactor ); @@ -514,10 +514,10 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, bEdWidth = !bEdWidth; if ( nRotate ) { - //! unterschiedliche Skalierung X/Y beruecksichtigen + //! unterschiedliche Skalierung X/Y beruecksichtigen Size aSize( pEngine->CalcTextWidth(), pEngine->GetTextHeight() ); - double nRealOrient = nRotate * F_PI18000; // nRotate sind 1/100 Grad + double nRealOrient = nRotate * F_PI18000; // nRotate sind 1/100 Grad double nCosAbs = fabs( cos( nRealOrient ) ); double nSinAbs = fabs( sin( nRealOrient ) ); long nHeight = (long)( aSize.Height() * nCosAbs + aSize.Width() * nSinAbs ); @@ -533,7 +533,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, nPPT * nCosAbs / nSinAbs ); } else - nWidth = (long)( aSize.Height() / nSinAbs ); //! begrenzen? + nWidth = (long)( aSize.Height() / nSinAbs ); //! begrenzen? aSize = Size( nWidth, nHeight ); Size aPixSize = pDev->LogicToPixel( aSize, aHMMMode ); @@ -545,7 +545,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, if ( bBreak && !rOptions.bTotalSize ) { - // #47744# limit size for line break + // #47744# limit size for line break long nCmp = aOldFont.GetSize().Height() * SC_ROT_BREAK_FACTOR; if ( nValue > nCmp ) nValue = nCmp; @@ -560,7 +560,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, nValue = pDev->LogicToPixel(Size( pEngine->CalcTextWidth(), 0 ), aHMMMode).Width(); } - else // Hoehe + else // Hoehe { nValue = pDev->LogicToPixel(Size( 0, pEngine->GetTextHeight() ), aHMMMode).Height(); @@ -582,13 +582,13 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, if ( bAsianVertical && pDev->GetOutDevType() != OUTDEV_PRINTER ) { - // add 1pt extra (default margin value) for line breaks with SetVertical + // add 1pt extra (default margin value) for line breaks with SetVertical nValue += (long) ( 20 * nPPT ); } } } - // EditEngine is cached and re-used, so the old vertical flag must be restored + // EditEngine is cached and re-used, so the old vertical flag must be restored pEngine->SetVertical( bEngineVertical ); pDocument->DisposeFieldEditEngine(pEngine); @@ -599,9 +599,9 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, if (bWidth) { - // Platz fuer Autofilter-Button - // 20 * nZoom/100 - // bedingte Formatierung hier nicht interessant + // Platz fuer Autofilter-Button + // 20 * nZoom/100 + // bedingte Formatierung hier nicht interessant INT16 nFlags = ((const ScMergeFlagAttr&)pPattern->GetItem(ATTR_MERGE_FLAG)).GetValue(); if (nFlags & SC_MF_AUTO) @@ -646,13 +646,13 @@ USHORT ScColumn::GetOptimalColWidth( OutputDevice* pDev, double nPPTX, double nP if (nCount == 0) return nOldWidth; - USHORT nWidth = (USHORT) (nOldWidth * nPPTX); - BOOL bFound = FALSE; + USHORT nWidth = (USHORT) (nOldWidth * nPPTX); + BOOL bFound = FALSE; SCSIZE nIndex; ScMarkedDataIter aDataIter(this, pMarkData, TRUE); if ( bSimpleTextImport ) - { // alles eins bis auf NumberFormate + { // alles eins bis auf NumberFormate const ScPatternAttr* pPattern = GetPattern( 0 ); Font aFont; // font color doesn't matter here @@ -722,13 +722,13 @@ USHORT lcl_GetAttribHeight( const ScPatternAttr& rPattern, USHORT nFontHeightId USHORT nHeight = (USHORT) ((const SvxFontHeightItem&) rPattern.GetItem(nFontHeightId)).GetHeight(); const SvxMarginItem* pMargin = (const SvxMarginItem*) &rPattern.GetItem(ATTR_MARGIN); nHeight += nHeight / 5; - // gibt bei 10pt 240 + // gibt bei 10pt 240 if ( ((const SvxEmphasisMarkItem&)rPattern. GetItem(ATTR_FONT_EMPHASISMARK)).GetEmphasisMark() != EMPHASISMARK_NONE ) { - // add height for emphasis marks - //! font metrics should be used instead + // add height for emphasis marks + //! font metrics should be used instead nHeight += nHeight / 4; } @@ -738,8 +738,8 @@ USHORT lcl_GetAttribHeight( const ScPatternAttr& rPattern, USHORT nFontHeightId nHeight -= 240; } - // Standard-Hoehe: TextHeight + Raender - 23 - // -> 257 unter Windows + // Standard-Hoehe: TextHeight + Raender - 23 + // -> 257 unter Windows if (nHeight > STD_ROWHEIGHT_DIFF) nHeight -= STD_ROWHEIGHT_DIFF; @@ -749,9 +749,9 @@ USHORT lcl_GetAttribHeight( const ScPatternAttr& rPattern, USHORT nFontHeightId return nHeight; } -// pHeight in Twips -// nMinHeight, nMinStart zur Optimierung: ab nRow >= nMinStart ist mindestens nMinHeight -// (wird nur bei bStdAllowed ausgewertet) +// pHeight in Twips +// nMinHeight, nMinStart zur Optimierung: ab nRow >= nMinStart ist mindestens nMinHeight +// (wird nur bei bStdAllowed ausgewertet) void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT* pHeight, OutputDevice* pDev, @@ -766,18 +766,18 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT* pHeight SCROW nEditPos = 0; SCROW nNextEnd = 0; - // bei bedingter Formatierung werden immer die einzelnen Zellen angesehen + // bei bedingter Formatierung werden immer die einzelnen Zellen angesehen const ScPatternAttr* pPattern = aIter.Next(nStart,nEnd); while ( pPattern ) { - const ScMergeAttr* pMerge = (const ScMergeAttr*)&pPattern->GetItem(ATTR_MERGE); - const ScMergeFlagAttr* pFlag = (const ScMergeFlagAttr*)&pPattern->GetItem(ATTR_MERGE_FLAG); + const ScMergeAttr* pMerge = (const ScMergeAttr*)&pPattern->GetItem(ATTR_MERGE); + const ScMergeFlagAttr* pFlag = (const ScMergeFlagAttr*)&pPattern->GetItem(ATTR_MERGE_FLAG); if ( pMerge->GetRowMerge() > 1 || pFlag->IsOverlapped() ) { - // nix - vertikal bei der zusammengefassten und den ueberdeckten, - // horizontal nur bei den ueberdeckten (unsichtbaren) - - // eine nur horizontal zusammengefasste wird aber beruecksichtigt + // nix - vertikal bei der zusammengefassten und den ueberdeckten, + // horizontal nur bei den ueberdeckten (unsichtbaren) - + // eine nur horizontal zusammengefasste wird aber beruecksichtigt } else { @@ -804,20 +804,20 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT* pHeight } if (bStdOnly) - if (HasEditCells(nStart,nEnd,nEditPos)) // includes mixed script types + if (HasEditCells(nStart,nEnd,nEditPos)) // includes mixed script types { if (nEditPos == nStart) { bStdOnly = FALSE; if (nEnd > nEditPos) nNextEnd = nEnd; - nEnd = nEditPos; // einzeln ausrechnen - bStdAllowed = FALSE; // wird auf jeden Fall per Zelle berechnet + nEnd = nEditPos; // einzeln ausrechnen + bStdAllowed = FALSE; // wird auf jeden Fall per Zelle berechnet } else { nNextEnd = nEnd; - nEnd = nEditPos - 1; // Standard - Teil + nEnd = nEditPos - 1; // Standard - Teil } } @@ -835,8 +835,8 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT* pHeight else nDefHeight = nLatHeight = lcl_GetAttribHeight( *pPattern, ATTR_FONT_HEIGHT ); - // if everything below is already larger, the loop doesn't have to - // be run again + // if everything below is already larger, the loop doesn't have to + // be run again SCROW nStdEnd = nEnd; if ( nDefHeight <= nMinHeight && nStdEnd >= nMinStart ) nStdEnd = (nMinStart>0) ? nMinStart-1 : 0; @@ -847,8 +847,8 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT* pHeight if ( bStdOnly ) { - // if cells are not handled individually below, - // check for cells with different script type + // if cells are not handled individually below, + // check for cells with different script type SCSIZE nIndex; Search(nStart,nIndex); @@ -884,7 +884,7 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT* pHeight } } - if (!bStdOnly) // belegte Zellen suchen + if (!bStdOnly) // belegte Zellen suchen { ScNeededSizeOptions aOptions; @@ -892,7 +892,7 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT* pHeight Search(nStart,nIndex); while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEnd) : FALSE ) { - // Zellhoehe nur berechnen, wenn sie spaeter auch gebraucht wird (#37928#) + // Zellhoehe nur berechnen, wenn sie spaeter auch gebraucht wird (#37928#) if ( bShrink || !(pDocument->GetRowFlags(nRow, nTab) & CR_MANUALSIZE) ) { @@ -983,27 +983,27 @@ void ScColumn::RemoveAutoSpellObj() { ScEditCell* pOldCell = (ScEditCell*) pItems[i].pCell; const EditTextObject* pData = pOldCell->GetData(); - // keine Abfrage auf HasOnlineSpellErrors, damit es auch - // nach dem Laden funktioniert + // keine Abfrage auf HasOnlineSpellErrors, damit es auch + // nach dem Laden funktioniert - // Fuer den Test auf harte Formatierung (ScEditAttrTester) sind die Defaults - // in der EditEngine unwichtig. Wenn der Tester spaeter einmal gleiche - // Attribute in Default und harter Formatierung erkennen und weglassen sollte, - // muessten an der EditEngine zu jeder Zelle die richtigen Defaults gesetzt - // werden! + // Fuer den Test auf harte Formatierung (ScEditAttrTester) sind die Defaults + // in der EditEngine unwichtig. Wenn der Tester spaeter einmal gleiche + // Attribute in Default und harter Formatierung erkennen und weglassen sollte, + // muessten an der EditEngine zu jeder Zelle die richtigen Defaults gesetzt + // werden! - // auf Attribute testen + // auf Attribute testen if ( !pEngine ) pEngine = new ScTabEditEngine(pDocument); pEngine->SetText( *pData ); ScEditAttrTester aTester( pEngine ); - if ( aTester.NeedsObject() ) // nur Spell-Errors entfernen + if ( aTester.NeedsObject() ) // nur Spell-Errors entfernen { - EditTextObject* pNewData = pEngine->CreateTextObject(); // ohne BIGOBJ + EditTextObject* pNewData = pEngine->CreateTextObject(); // ohne BIGOBJ pOldCell->SetData( pNewData, pEngine->GetEditTextObjectPool() ); delete pNewData; } - else // String erzeugen + else // String erzeugen { String aText = ScEditUtil::GetSpaceDelimitedString( *pEngine ); ScBaseCell* pNewCell = new ScStringCell( aText ); @@ -1029,18 +1029,18 @@ void ScColumn::RemoveEditAttribs( SCROW nStartRow, SCROW nEndRow ) ScEditCell* pOldCell = (ScEditCell*) pItems[i].pCell; const EditTextObject* pData = pOldCell->GetData(); - // Fuer den Test auf harte Formatierung (ScEditAttrTester) sind die Defaults - // in der EditEngine unwichtig. Wenn der Tester spaeter einmal gleiche - // Attribute in Default und harter Formatierung erkennen und weglassen sollte, - // muessten an der EditEngine zu jeder Zelle die richtigen Defaults gesetzt - // werden! + // Fuer den Test auf harte Formatierung (ScEditAttrTester) sind die Defaults + // in der EditEngine unwichtig. Wenn der Tester spaeter einmal gleiche + // Attribute in Default und harter Formatierung erkennen und weglassen sollte, + // muessten an der EditEngine zu jeder Zelle die richtigen Defaults gesetzt + // werden! - // auf Attribute testen + // auf Attribute testen if ( !pEngine ) { //pEngine = new ScTabEditEngine(pDocument); pEngine = new ScFieldEditEngine( pDocument->GetEditPool() ); - // EE_CNTRL_ONLINESPELLING falls schon Fehler drin sind + // EE_CNTRL_ONLINESPELLING falls schon Fehler drin sind pEngine->SetControlWord( pEngine->GetControlWord() | EE_CNTRL_ONLINESPELLING ); pEngine->SetForbiddenCharsTable( pDocument->GetForbiddenCharacters() ); pEngine->SetAsianCompressionMode( pDocument->GetAsianCompression() ); @@ -1054,18 +1054,18 @@ void ScColumn::RemoveEditAttribs( SCROW nStartRow, SCROW nEndRow ) const SfxItemSet& rOld = pEngine->GetParaAttribs( nPar ); if ( rOld.Count() ) { - SfxItemSet aNew( *rOld.GetPool(), rOld.GetRanges() ); // leer + SfxItemSet aNew( *rOld.GetPool(), rOld.GetRanges() ); // leer pEngine->SetParaAttribs( nPar, aNew ); } } - // URL-Felder in Text wandeln (andere gibt's nicht, darum pType=0) + // URL-Felder in Text wandeln (andere gibt's nicht, darum pType=0) pEngine->RemoveFields( TRUE ); BOOL bSpellErrors = pEngine->HasOnlineSpellErrors(); - BOOL bNeedObject = bSpellErrors || nParCount>1; // Errors/Absaetze behalten - // ScEditAttrTester nicht mehr noetig, Felder sind raus + BOOL bNeedObject = bSpellErrors || nParCount>1; // Errors/Absaetze behalten + // ScEditAttrTester nicht mehr noetig, Felder sind raus - if ( bNeedObject ) // bleibt Edit-Zelle + if ( bNeedObject ) // bleibt Edit-Zelle { ULONG nCtrl = pEngine->GetControlWord(); ULONG nWantBig = bSpellErrors ? EE_CNTRL_ALLOWBIGOBJS : 0; @@ -1075,7 +1075,7 @@ void ScColumn::RemoveEditAttribs( SCROW nStartRow, SCROW nEndRow ) pOldCell->SetData( pNewData, pEngine->GetEditTextObjectPool() ); delete pNewData; } - else // String erzeugen + else // String erzeugen { String aText = ScEditUtil::GetSpaceDelimitedString( *pEngine ); ScBaseCell* pNewCell = new ScStringCell( aText ); @@ -1134,9 +1134,9 @@ BOOL ScColumnIterator::Next( SCROW& rRow, ScBaseCell*& rpCell ) return FALSE; } -SCSIZE ScColumnIterator::GetIndex() const // Index zur letzen abgefragten Zelle +SCSIZE ScColumnIterator::GetIndex() const // Index zur letzen abgefragten Zelle { - return nPos - 1; // bei Next ist Pos hochgezaehlt worden + return nPos - 1; // bei Next ist Pos hochgezaehlt worden } // ----------------------------------------------------------------------------------------- @@ -1166,17 +1166,17 @@ BOOL ScMarkedDataIter::Next( SCSIZE& rIndex ) { if (!pMarkIter || !pMarkIter->Next( nTop, nBottom )) { - if (bAll) // ganze Spalte + if (bAll) // ganze Spalte { - nTop = 0; - nBottom = MAXROW; + nTop = 0; + nBottom = MAXROW; } else return FALSE; } pColumn->Search( nTop, nPos ); bNext = FALSE; - bAll = FALSE; // nur beim ersten Versuch + bAll = FALSE; // nur beim ersten Versuch } if ( nPos >= pColumn->nCount ) @@ -1238,7 +1238,7 @@ BOOL ScColumn::IsEmptyVisData(BOOL bNotes) const SCSIZE ScColumn::VisibleCount( SCROW nStartRow, SCROW nEndRow ) const { - // Notizen werden nicht mitgezaehlt + // Notizen werden nicht mitgezaehlt SCSIZE nVisCount = 0; SCSIZE nIndex; @@ -1329,10 +1329,10 @@ BOOL ScColumn::IsEmptyBlock(SCROW nStartRow, SCROW nEndRow, bool bIgnoreNotes) c while ( nIndex < nCount && pItems[nIndex].nRow <= nEndRow ) { if ( !pItems[nIndex].pCell->IsBlank( bIgnoreNotes ) ) // found a cell - return FALSE; // not empty + return FALSE; // not empty ++nIndex; } - return TRUE; // no cell found + return TRUE; // no cell found } SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const @@ -1408,11 +1408,11 @@ BOOL ScColumn::GetPrevDataPos(SCROW& rRow) const return bFound; } -BOOL ScColumn::GetNextDataPos(SCROW& rRow) const // greater than rRow +BOOL ScColumn::GetNextDataPos(SCROW& rRow) const // greater than rRow { SCSIZE nIndex; if (Search( rRow, nIndex )) - ++nIndex; // next cell + ++nIndex; // next cell BOOL bMore = ( nIndex < nCount ); if ( bMore ) @@ -1500,11 +1500,11 @@ void ScColumn::FindDataAreaPos(SCROW& rRow, long nMovY) const BOOL ScColumn::HasDataAt(SCROW nRow) const { -/* SCSIZE nIndex; +/* SCSIZE nIndex; return Search( nRow, nIndex ); */ - // immer nur sichtbare interessant ? - //! dann HasVisibleDataAt raus + // immer nur sichtbare interessant ? + //! dann HasVisibleDataAt raus SCSIZE nIndex; if (Search(nRow, nIndex)) @@ -1650,11 +1650,11 @@ void ScColumn::EndListening( SvtListener& rLst, SCROW nRow ) pCell->DeleteBroadcaster(); } } -// else -// DBG_ERROR("ScColumn::EndListening - kein Broadcaster"); +// else +// DBG_ERROR("ScColumn::EndListening - kein Broadcaster"); } -// else -// DBG_ERROR("ScColumn::EndListening - keine Zelle"); +// else +// DBG_ERROR("ScColumn::EndListening - keine Zelle"); } void ScColumn::CompileDBFormula() @@ -1714,12 +1714,12 @@ void lcl_UpdateSubTotal( ScFunctionData& rData, ScBaseCell* pCell ) break; case CELLTYPE_FORMULA: { - if ( rData.eFunc != SUBTOTAL_FUNC_CNT2 ) // da interessiert's nicht + if ( rData.eFunc != SUBTOTAL_FUNC_CNT2 ) // da interessiert's nicht { ScFormulaCell* pFC = (ScFormulaCell*)pCell; if ( pFC->GetErrCode() ) { - if ( rData.eFunc != SUBTOTAL_FUNC_CNT ) // fuer Anzahl einfach weglassen + if ( rData.eFunc != SUBTOTAL_FUNC_CNT ) // fuer Anzahl einfach weglassen rData.bError = TRUE; } else if (pFC->IsValue()) @@ -1754,11 +1754,11 @@ void lcl_UpdateSubTotal( ScFunctionData& rData, ScBaseCell* pCell ) rData.bError = TRUE; } break; - case SUBTOTAL_FUNC_CNT: // nur Werte + case SUBTOTAL_FUNC_CNT: // nur Werte if (bVal) ++rData.nCount; break; - case SUBTOTAL_FUNC_CNT2: // alle + case SUBTOTAL_FUNC_CNT2: // alle if (bCell) ++rData.nCount; break; @@ -1780,7 +1780,7 @@ void lcl_UpdateSubTotal( ScFunctionData& rData, ScBaseCell* pCell ) } } -// Mehrfachselektion: +// Mehrfachselektion: void ScColumn::UpdateSelectionFunction( const ScMarkData& rMark, ScFunctionData& rData, ScFlatBoolRowSegments& rHiddenRows, @@ -1798,7 +1798,7 @@ void ScColumn::UpdateSelectionFunction( const ScMarkData& rMark, } } -// bei bNoMarked die Mehrfachselektion weglassen +// bei bNoMarked die Mehrfachselektion weglassen void ScColumn::UpdateAreaFunction( ScFunctionData& rData, ScFlatBoolRowSegments& rHiddenRows, SCROW nStartRow, SCROW nEndRow ) @@ -1819,7 +1819,7 @@ ULONG ScColumn::GetWeightedCount() const { ULONG nTotal = 0; - // Notizen werden nicht gezaehlt + // Notizen werden nicht gezaehlt for (SCSIZE i=0; i<nCount; i++) { diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 65e896c7f2c4..e93fd9f3718c 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1,7 +1,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 @@ -46,10 +46,10 @@ #include "formula/errorcodes.hxx" #include "formula/token.hxx" #include "brdcst.hxx" -#include "docoptio.hxx" // GetStdPrecision fuer GetMaxNumberStringLen +#include "docoptio.hxx" // GetStdPrecision fuer GetMaxNumberStringLen #include "subtotal.hxx" #include "markdata.hxx" -#include "detfunc.hxx" // fuer Notizen bei DeleteRange +#include "detfunc.hxx" // fuer Notizen bei DeleteRange #include "postit.hxx" #include "stringutil.hxx" @@ -60,11 +60,11 @@ using ::rtl::OUString; using ::rtl::OUStringBuffer; // Err527 Workaround -extern const ScFormulaCell* pLastFormulaTreeTop; // in cellform.cxx +extern const ScFormulaCell* pLastFormulaTreeTop; // in cellform.cxx using namespace formula; // STATIC DATA ----------------------------------------------------------- -BOOL ScColumn::bDoubleAlloc = FALSE; // fuer Import: Groesse beim Allozieren verdoppeln +BOOL ScColumn::bDoubleAlloc = FALSE; // fuer Import: Groesse beim Allozieren verdoppeln void ScColumn::Insert( SCROW nRow, ScBaseCell* pNewCell ) @@ -80,7 +80,7 @@ void ScColumn::Insert( SCROW nRow, ScBaseCell* pNewCell ) } if ( !bIsAppended ) { - SCSIZE nIndex; + SCSIZE nIndex; if (Search(nRow, nIndex)) { ScBaseCell* pOldCell = pItems[nIndex].pCell; @@ -203,13 +203,13 @@ void ScColumn::Append( SCROW nRow, ScBaseCell* pCell ) void ScColumn::Delete( SCROW nRow ) { - SCSIZE nIndex; + SCSIZE nIndex; if (Search(nRow, nIndex)) { ScBaseCell* pCell = pItems[nIndex].pCell; ScNoteCell* pNoteCell = new ScNoteCell; - pItems[nIndex].pCell = pNoteCell; // Dummy fuer Interpret + pItems[nIndex].pCell = pNoteCell; // Dummy fuer Interpret pDocument->Broadcast( ScHint( SC_HINT_DYING, ScAddress( nCol, nRow, nTab ), pCell ) ); if ( SvtBroadcaster* pBC = pCell->ReleaseBroadcaster() ) @@ -223,7 +223,7 @@ void ScColumn::Delete( SCROW nRow ) memmove( &pItems[nIndex], &pItems[nIndex + 1], (nCount - nIndex) * sizeof(ColEntry) ); pItems[nCount].nRow = 0; pItems[nCount].pCell = NULL; - // Soll man hier den Speicher freigeben (delta)? Wird dann langsamer! + // Soll man hier den Speicher freigeben (delta)? Wird dann langsamer! } pCell->EndListeningTo( pDocument ); pCell->Delete(); @@ -235,7 +235,7 @@ void ScColumn::DeleteAtIndex( SCSIZE nIndex ) { ScBaseCell* pCell = pItems[nIndex].pCell; ScNoteCell* pNoteCell = new ScNoteCell; - pItems[nIndex].pCell = pNoteCell; // Dummy fuer Interpret + pItems[nIndex].pCell = pNoteCell; // Dummy fuer Interpret pDocument->Broadcast( ScHint( SC_HINT_DYING, ScAddress( nCol, pItems[nIndex].nRow, nTab ), pCell ) ); delete pNoteCell; @@ -275,7 +275,7 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) return ; BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden BOOL bFound=FALSE; SCROW nEndRow = nStartRow + nSize - 1; @@ -297,9 +297,9 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) if (pBC) { // gibt jetzt invalid reference, kein Aufruecken der direkten Referenzen -// MoveListeners( *pBC, nRow+nSize ); +// MoveListeners( *pBC, nRow+nSize ); pCell->DeleteBroadcaster(); - // in DeleteRange werden leere Broadcaster geloescht + // in DeleteRange werden leere Broadcaster geloescht } } if (bFound) @@ -549,10 +549,10 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, USHORT nDelFla void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, USHORT nDelFlag) { - // FreeAll darf hier nicht gerufen werden wegen Broadcastern + // FreeAll darf hier nicht gerufen werden wegen Broadcastern - // Attribute erst am Ende, damit vorher noch zwischen Zahlen und Datum - // unterschieden werden kann (#47901#) + // Attribute erst am Ende, damit vorher noch zwischen Zahlen und Datum + // unterschieden werden kann (#47901#) USHORT nContMask = IDF_CONTENTS; // IDF_NOCAPTIONS needs to be passed too, if IDF_NOTE is set @@ -590,7 +590,7 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, USHORT nDelFlag) RemoveEditAttribs( nStartRow, nEndRow ); } - // Attribute erst hier + // Attribute erst hier if ((nDelFlag & IDF_ATTRIB) == IDF_ATTRIB) pAttrArray->DeleteArea( nStartRow, nEndRow ); else if ((nDelFlag & IDF_ATTRIB) != 0) pAttrArray->DeleteHardAttr( nStartRow, nEndRow ); } @@ -603,8 +603,8 @@ ScFormulaCell* ScColumn::CreateRefCell( ScDocument* pDestDoc, const ScAddress& r if (!nContFlags) return NULL; - // Testen, ob Zelle kopiert werden soll - // auch bei IDF_CONTENTS komplett, wegen Notes / Broadcastern + // Testen, ob Zelle kopiert werden soll + // auch bei IDF_CONTENTS komplett, wegen Notes / Broadcastern BOOL bMatch = FALSE; ScBaseCell* pCell = pItems[nIndex].pCell; @@ -630,8 +630,8 @@ ScFormulaCell* ScColumn::CreateRefCell( ScDocument* pDestDoc, const ScAddress& r } break; case CELLTYPE_STRING: - case CELLTYPE_EDIT: bMatch = ((nFlags & IDF_STRING) != 0); break; - case CELLTYPE_FORMULA: bMatch = ((nFlags & IDF_FORMULA) != 0); break; + case CELLTYPE_EDIT: bMatch = ((nFlags & IDF_STRING) != 0); break; + case CELLTYPE_FORMULA: bMatch = ((nFlags & IDF_FORMULA) != 0); break; default: { // added to avoid warnings @@ -641,16 +641,16 @@ ScFormulaCell* ScColumn::CreateRefCell( ScDocument* pDestDoc, const ScAddress& r return NULL; - // Referenz einsetzen + // Referenz einsetzen ScSingleRefData aRef; aRef.nCol = nCol; aRef.nRow = pItems[nIndex].nRow; aRef.nTab = nTab; - aRef.InitFlags(); // -> alles absolut + aRef.InitFlags(); // -> alles absolut aRef.SetFlag3D(TRUE); - //! 3D(FALSE) und TabRel(TRUE), wenn die endgueltige Position auf der selben Tabelle ist? - //! (bei TransposeClip ist die Zielposition noch nicht bekannt) + //! 3D(FALSE) und TabRel(TRUE), wenn die endgueltige Position auf der selben Tabelle ist? + //! (bei TransposeClip ist die Zielposition noch nicht bekannt) aRef.CalcRelFromAbs( rDestPos ); @@ -661,8 +661,8 @@ ScFormulaCell* ScColumn::CreateRefCell( ScDocument* pDestDoc, const ScAddress& r } -// rColumn = Quelle -// nRow1, nRow2 = Zielposition +// rColumn = Quelle +// nRow1, nRow2 = Zielposition void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy, USHORT nInsFlag, BOOL bAsLink, BOOL bSkipAttrForEmpty, @@ -672,8 +672,8 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy, { if ( bSkipAttrForEmpty ) { - // copy only attributes for non-empty cells - // (notes are not counted as non-empty here, to match the content behavior) + // copy only attributes for non-empty cells + // (notes are not counted as non-empty here, to match the content behavior) SCSIZE nStartIndex; rColumn.Search( nRow1-nDy, nStartIndex ); @@ -685,7 +685,7 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy, SCROW nStartRow = rColumn.pItems[nStartIndex].nRow; SCROW nEndRow = nStartRow; - // find consecutive non-empty cells + // find consecutive non-empty cells while ( nEndRow < nRow2-nDy && nEndIndex+1 < rColumn.nCount && @@ -709,25 +709,25 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy, if ( bAsLink && nInsFlag == IDF_ALL ) { - // bei "alles" werden auch leere Zellen referenziert - //! IDF_ALL muss immer mehr Flags enthalten, als bei "Inhalte Einfuegen" - //! einzeln ausgewaehlt werden koennen! + // bei "alles" werden auch leere Zellen referenziert + //! IDF_ALL muss immer mehr Flags enthalten, als bei "Inhalte Einfuegen" + //! einzeln ausgewaehlt werden koennen! Resize( nCount + static_cast<SCSIZE>(nRow2-nRow1+1) ); - ScAddress aDestPos( nCol, 0, nTab ); // Row wird angepasst + ScAddress aDestPos( nCol, 0, nTab ); // Row wird angepasst - // Referenz erzeugen (Quell-Position) + // Referenz erzeugen (Quell-Position) ScSingleRefData aRef; aRef.nCol = rColumn.nCol; - // nRow wird angepasst + // nRow wird angepasst aRef.nTab = rColumn.nTab; - aRef.InitFlags(); // -> alles absolut + aRef.InitFlags(); // -> alles absolut aRef.SetFlag3D(TRUE); for (SCROW nDestRow = nRow1; nDestRow <= nRow2; nDestRow++) { - aRef.nRow = nDestRow - nDy; // Quell-Zeile + aRef.nRow = nDestRow - nDy; // Quell-Zeile aDestPos.SetRow( nDestRow ); aRef.CalcRelFromAbs( aDestPos ); @@ -763,8 +763,8 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy, bAtEnd = TRUE; else if ( nDestRow >= (SCsROW) nRow1 ) { - // rows at the beginning may be skipped if filtered rows are left out, - // nDestRow may be negative then + // rows at the beginning may be skipped if filtered rows are left out, + // nDestRow may be negative then ScAddress aDestPos( nCol, (SCROW)nDestRow, nTab ); @@ -939,7 +939,7 @@ void ScColumn::MixMarked( const ScMarkData& rMark, USHORT nFunction, } -// Ergebnis in rVal1 +// Ergebnis in rVal1 BOOL lcl_DoFunction( double& rVal1, double nVal2, USHORT nFunction ) { @@ -950,7 +950,7 @@ BOOL lcl_DoFunction( double& rVal1, double nVal2, USHORT nFunction ) bOk = SubTotal::SafePlus( rVal1, nVal2 ); break; case PASTE_SUB: - nVal2 = -nVal2; //! geht das immer ohne Fehler? + nVal2 = -nVal2; //! geht das immer ohne Fehler? bOk = SubTotal::SafePlus( rVal1, nVal2 ); break; case PASTE_MUL: @@ -992,9 +992,9 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, SCSIZE nIndex; Search( nRow1, nIndex ); -// SCSIZE nSrcIndex = 0; +// SCSIZE nSrcIndex = 0; SCSIZE nSrcIndex; - rSrcCol.Search( nRow1, nSrcIndex ); //! Testen, ob Daten ganz vorne + rSrcCol.Search( nRow1, nSrcIndex ); //! Testen, ob Daten ganz vorne SCROW nNextThis = MAXROW+1; if ( nIndex < nCount ) @@ -1026,14 +1026,14 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, BOOL bSrcEmpty = ( eSrcType == CELLTYPE_NONE || eSrcType == CELLTYPE_NOTE ); BOOL bDestEmpty = ( eDestType == CELLTYPE_NONE || eDestType == CELLTYPE_NOTE ); - if ( bSkipEmpty && bDestEmpty ) // Originalzelle wiederherstellen + if ( bSkipEmpty && bDestEmpty ) // Originalzelle wiederherstellen { - if ( pSrc ) // war da eine Zelle? + if ( pSrc ) // war da eine Zelle? { pNew = pSrc->CloneWithoutNote( *pDocument ); } } - else if ( nFunction ) // wirklich Rechenfunktion angegeben + else if ( nFunction ) // wirklich Rechenfunktion angegeben { double nVal1; double nVal2; @@ -1046,7 +1046,7 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, else nVal2 = 0.0; - // leere Zellen werden als Werte behandelt + // leere Zellen werden als Werte behandelt BOOL bSrcVal = ( bSrcEmpty || eSrcType == CELLTYPE_VALUE ); BOOL bDestVal = ( bDestEmpty || eDestType == CELLTYPE_VALUE ); @@ -1056,15 +1056,15 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, BOOL bDestText = ( eDestType == CELLTYPE_STRING || eDestType == CELLTYPE_EDIT ); - // sonst bleibt nur Formel... + // sonst bleibt nur Formel... if ( bSrcEmpty && bDestEmpty ) { - // beide leer -> nix + // beide leer -> nix } else if ( bSrcVal && bDestVal ) { - // neuen Wert eintragen, oder Fehler bei Ueberlauf + // neuen Wert eintragen, oder Fehler bei Ueberlauf BOOL bOk = lcl_DoFunction( nVal1, nVal2, nFunction ); @@ -1075,15 +1075,15 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, ScFormulaCell* pFC = new ScFormulaCell( pDocument, ScAddress( nCol, nRow, nTab ) ); pFC->SetErrCode( errNoValue ); - //! oder NOVALUE, dann auch in consoli, - //! sonst in Interpreter::GetCellValue die Abfrage auf errNoValue raus - //! (dann geht Stringzelle+Wertzelle nicht mehr) + //! oder NOVALUE, dann auch in consoli, + //! sonst in Interpreter::GetCellValue die Abfrage auf errNoValue raus + //! (dann geht Stringzelle+Wertzelle nicht mehr) pNew = pFC; } } else if ( bSrcText || bDestText ) { - // mit Texten wird nicht gerechnet - immer "alte" Zelle, also pSrc + // mit Texten wird nicht gerechnet - immer "alte" Zelle, also pSrc if (pSrc) pNew = pSrc->CloneWithoutNote( *pDocument ); @@ -1092,28 +1092,28 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, } else { - // Kombination aus Wert und mindestens einer Formel -> Formel erzeugen + // Kombination aus Wert und mindestens einer Formel -> Formel erzeugen ScTokenArray aArr; - // erste Zelle + // erste Zelle if ( eSrcType == CELLTYPE_FORMULA ) lcl_AddCode( aArr, (ScFormulaCell*)pSrc ); else aArr.AddDouble( nVal1 ); - // Operator + // Operator OpCode eOp = ocAdd; switch ( nFunction ) { - case PASTE_ADD: eOp = ocAdd; break; - case PASTE_SUB: eOp = ocSub; break; - case PASTE_MUL: eOp = ocMul; break; - case PASTE_DIV: eOp = ocDiv; break; + case PASTE_ADD: eOp = ocAdd; break; + case PASTE_SUB: eOp = ocSub; break; + case PASTE_MUL: eOp = ocMul; break; + case PASTE_DIV: eOp = ocDiv; break; } - aArr.AddOpCode(eOp); // Funktion + aArr.AddOpCode(eOp); // Funktion - // zweite Zelle + // zweite Zelle if ( eDestType == CELLTYPE_FORMULA ) lcl_AddCode( aArr, (ScFormulaCell*)pDest ); else @@ -1124,21 +1124,21 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, } - if ( pNew || bDelete ) // neues Ergebnis ? + if ( pNew || bDelete ) // neues Ergebnis ? { - if (pDest && !pNew) // alte Zelle da ? + if (pDest && !pNew) // alte Zelle da ? { if ( pDest->GetBroadcaster() ) - pNew = new ScNoteCell; // Broadcaster uebernehmen + pNew = new ScNoteCell; // Broadcaster uebernehmen else - Delete(nRow); // -> loeschen + Delete(nRow); // -> loeschen } if (pNew) - Insert(nRow, pNew); // neue einfuegen + Insert(nRow, pNew); // neue einfuegen - Search( nRow, nIndex ); // alles kann sich verschoben haben + Search( nRow, nIndex ); // alles kann sich verschoben haben if (pNew) - nNextThis = nRow; // nIndex zeigt jetzt genau auf nRow + nNextThis = nRow; // nIndex zeigt jetzt genau auf nRow else nNextThis = ( nIndex < nCount ) ? pItems[nIndex].nRow : MAXROW+1; } @@ -1176,7 +1176,7 @@ void ScColumn::StartAllListeners() SCROW nRow = pItems[i].nRow; ((ScFormulaCell*)pCell)->StartListeningTo( pDocument ); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener eingefuegt? + Search( nRow, i ); // Listener eingefuegt? } } } @@ -1197,7 +1197,7 @@ void ScColumn::StartNeededListeners() SCROW nRow = pItems[i].nRow; pFCell->StartListeningTo( pDocument ); if ( nRow != pItems[i].nRow ) - Search( nRow, i ); // Listener eingefuegt? + Search( nRow, i ); // Listener eingefuegt? } } } @@ -1239,14 +1239,14 @@ void ScColumn::StartListeningInArea( SCROW nRow1, SCROW nRow2 ) if ( pCell->GetCellType() == CELLTYPE_FORMULA ) ((ScFormulaCell*)pCell)->StartListeningTo( pDocument ); if ( nRow != pItems[nIndex].nRow ) - Search( nRow, nIndex ); // durch Listening eingefuegt + Search( nRow, nIndex ); // durch Listening eingefuegt nIndex++; } } } -// TRUE = Zahlformat gesetzt +// TRUE = Zahlformat gesetzt BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, formula::FormulaGrammar::AddressConvention eConv, SvNumberFormatter* pLangFormatter, bool bDetectNumberFormat ) @@ -1277,24 +1277,24 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, && pFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT ) cFirstChar = rString.GetChar(0); else - cFirstChar = 0; // Text + cFirstChar = 0; // Text } else - { // waehrend ConvertFrom Import gibt es keine gesetzten Formate + { // waehrend ConvertFrom Import gibt es keine gesetzten Formate cFirstChar = rString.GetChar(0); } if ( cFirstChar == '=' ) { - if ( rString.Len() == 1 ) // = Text + if ( rString.Len() == 1 ) // = Text pNewCell = new ScStringCell( rString ); - else // =Formel + else // =Formel pNewCell = new ScFormulaCell( pDocument, ScAddress( nCol, nRow, nTabP ), rString, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_DEFAULT, eConv), MM_NONE ); } - else if ( cFirstChar == '\'') // 'Text + else if ( cFirstChar == '\'') // 'Text pNewCell = new ScStringCell( rString.Copy(1) ); else { @@ -1319,7 +1319,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, if ( rString == aStr ) bIsText = TRUE; break; - case CELLTYPE_NOTE : // durch =Formel referenziert + case CELLTYPE_NOTE : // durch =Formel referenziert break; default: if ( i == nCount - 1 ) @@ -1399,7 +1399,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, const LocaleDataWrapper* pLocale = pLocaleSource->GetLocaleData(); if (!pLocale) break; - + LocaleDataItem aLocaleItem = pLocale->getLocaleItem(); const OUString& rDecSep = aLocaleItem.decimalSeparator; const OUString& rGroupSep = aLocaleItem.thousandSeparator; @@ -1423,7 +1423,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, } if ( bIsLoading && (!nCount || nRow > pItems[nCount-1].nRow) ) - { // Search einsparen und ohne Umweg ueber Insert, Listener aufbauen + { // Search einsparen und ohne Umweg ueber Insert, Listener aufbauen // und Broadcast kommt eh erst nach dem Laden if ( pNewCell ) Append( nRow, pNewCell ); @@ -1445,7 +1445,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, if (pBC) { pNewCell->TakeBroadcaster(pBC); - pLastFormulaTreeTop = 0; // Err527 Workaround + pLastFormulaTreeTop = 0; // Err527 Workaround } if ( pOldCell->GetCellType() == CELLTYPE_FORMULA ) @@ -1456,7 +1456,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, Search(nRow, i); } pOldCell->Delete(); - pItems[i].pCell = pNewCell; // ersetzen + pItems[i].pCell = pNewCell; // ersetzen if ( pNewCell->GetCellType() == CELLTYPE_FORMULA ) { pNewCell->StartListeningTo( pDocument ); @@ -1468,17 +1468,17 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, } else { - DeleteAtIndex(i); // loeschen und Broadcast + DeleteAtIndex(i); // loeschen und Broadcast } } else if (pNewCell) { - Insert(nRow, pNewCell); // neu eintragen und Broadcast + Insert(nRow, pNewCell); // neu eintragen und Broadcast } } - // hier keine Formate mehr fuer Formeln setzen! - // (werden bei der Ausgabe abgefragt) + // hier keine Formate mehr fuer Formeln setzen! + // (werden bei der Ausgabe abgefragt) } return bNumFmtSet; @@ -1497,9 +1497,9 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : FALSE ) { - ScBaseCell* pCell = pItems[nIndex].pCell; - TypedStrData* pData; - ULONG nFormat = GetNumberFormat( nRow ); + ScBaseCell* pCell = pItems[nIndex].pCell; + TypedStrData* pData; + ULONG nFormat = GetNumberFormat( nRow ); ScCellFormat::GetInputString( pCell, nFormat, aString, *pFormatter ); @@ -1527,7 +1527,7 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec { short nType = pFormatter->GetType(nFormat); if ((nType & NUMBERFORMAT_DATE) && !(nType & NUMBERFORMAT_TIME)) - { + { // special case for date values. Disregard the time // element if the number format is of date type. nValue = ::rtl::math::approxFloor(nValue); @@ -1549,7 +1549,7 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec #endif if ( !rStrings.Insert( pData ) ) - delete pData; // doppelt + delete pData; // doppelt ++nIndex; } @@ -1558,13 +1558,13 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec } // -// GetDataEntries - Strings aus zusammenhaengendem Bereich um nRow +// GetDataEntries - Strings aus zusammenhaengendem Bereich um nRow // -// DATENT_MAX - max. Anzahl Eintrage in Liste fuer Auto-Eingabe -// DATENT_SEARCH - max. Anzahl Zellen, die durchsucht werden - neu: nur Strings zaehlen -#define DATENT_MAX 200 -#define DATENT_SEARCH 2000 +// DATENT_MAX - max. Anzahl Eintrage in Liste fuer Auto-Eingabe +// DATENT_SEARCH - max. Anzahl Zellen, die durchsucht werden - neu: nur Strings zaehlen +#define DATENT_MAX 200 +#define DATENT_SEARCH 2000 BOOL ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rStrings, BOOL bLimit) @@ -1575,23 +1575,23 @@ BOOL ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rStrings, B String aString; USHORT nCells = 0; - // Die Beschraenkung auf angrenzende Zellen (ohne Luecken) ist nicht mehr gewollt - // (Featurekommission zur 5.1), stattdessen abwechselnd nach oben und unten suchen, - // damit naheliegende Zellen wenigstens zuerst gefunden werden. - //! Abstaende der Zeilennummern vergleichen? (Performance??) + // Die Beschraenkung auf angrenzende Zellen (ohne Luecken) ist nicht mehr gewollt + // (Featurekommission zur 5.1), stattdessen abwechselnd nach oben und unten suchen, + // damit naheliegende Zellen wenigstens zuerst gefunden werden. + //! Abstaende der Zeilennummern vergleichen? (Performance??) - SCSIZE nUpIndex = nThisIndex; // zeigt hinter die Zelle - SCSIZE nDownIndex = nThisIndex; // zeigt auf die Zelle + SCSIZE nUpIndex = nThisIndex; // zeigt hinter die Zelle + SCSIZE nDownIndex = nThisIndex; // zeigt auf die Zelle if (bThisUsed) - ++nDownIndex; // Startzelle ueberspringen + ++nDownIndex; // Startzelle ueberspringen while ( nUpIndex || nDownIndex < nCount ) { - if ( nUpIndex ) // nach oben + if ( nUpIndex ) // nach oben { ScBaseCell* pCell = pItems[nUpIndex-1].pCell; CellType eType = pCell->GetCellType(); - if (eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT) // nur Strings interessieren + if (eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT) // nur Strings interessieren { if (eType == CELLTYPE_STRING) ((ScStringCell*)pCell)->GetString(aString); @@ -1600,23 +1600,23 @@ BOOL ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rStrings, B TypedStrData* pData = new TypedStrData(aString); if ( !rStrings.Insert( pData ) ) - delete pData; // doppelt + delete pData; // doppelt else if ( bLimit && rStrings.GetCount() >= DATENT_MAX ) - break; // Maximum erreicht + break; // Maximum erreicht bFound = TRUE; if ( bLimit ) if (++nCells >= DATENT_SEARCH) - break; // genug gesucht + break; // genug gesucht } --nUpIndex; } - if ( nDownIndex < nCount ) // nach unten + if ( nDownIndex < nCount ) // nach unten { ScBaseCell* pCell = pItems[nDownIndex].pCell; CellType eType = pCell->GetCellType(); - if (eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT) // nur Strings interessieren + if (eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT) // nur Strings interessieren { if (eType == CELLTYPE_STRING) ((ScStringCell*)pCell)->GetString(aString); @@ -1625,14 +1625,14 @@ BOOL ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rStrings, B TypedStrData* pData = new TypedStrData(aString); if ( !rStrings.Insert( pData ) ) - delete pData; // doppelt + delete pData; // doppelt else if ( bLimit && rStrings.GetCount() >= DATENT_MAX ) - break; // Maximum erreicht + break; // Maximum erreicht bFound = TRUE; if ( bLimit ) if (++nCells >= DATENT_SEARCH) - break; // genug gesucht + break; // genug gesucht } ++nDownIndex; } @@ -1711,7 +1711,7 @@ void ScColumn::SetValue( SCROW nRow, const double& rVal) void ScColumn::GetString( SCROW nRow, String& rString ) const { - SCSIZE nIndex; + SCSIZE nIndex; Color* pColor; if (Search(nRow, nIndex)) { @@ -1731,7 +1731,7 @@ void ScColumn::GetString( SCROW nRow, String& rString ) const void ScColumn::GetInputString( SCROW nRow, String& rString ) const { - SCSIZE nIndex; + SCSIZE nIndex; if (Search(nRow, nIndex)) { ScBaseCell* pCell = pItems[nIndex].pCell; @@ -1750,7 +1750,7 @@ void ScColumn::GetInputString( SCROW nRow, String& rString ) const double ScColumn::GetValue( SCROW nRow ) const { - SCSIZE nIndex; + SCSIZE nIndex; if (Search(nRow, nIndex)) { ScBaseCell* pCell = pItems[nIndex].pCell; @@ -1778,7 +1778,7 @@ double ScColumn::GetValue( SCROW nRow ) const void ScColumn::GetFormula( SCROW nRow, String& rFormula, BOOL ) const { - SCSIZE nIndex; + SCSIZE nIndex; if (Search(nRow, nIndex)) { ScBaseCell* pCell = pItems[nIndex].pCell; @@ -1794,7 +1794,7 @@ void ScColumn::GetFormula( SCROW nRow, String& rFormula, BOOL ) const CellType ScColumn::GetCellType( SCROW nRow ) const { - SCSIZE nIndex; + SCSIZE nIndex; if (Search(nRow, nIndex)) return pItems[nIndex].pCell->GetCellType(); return CELLTYPE_NONE; @@ -1803,7 +1803,7 @@ CellType ScColumn::GetCellType( SCROW nRow ) const USHORT ScColumn::GetErrCode( SCROW nRow ) const { - SCSIZE nIndex; + SCSIZE nIndex; if (Search(nRow, nIndex)) { ScBaseCell* pCell = pItems[nIndex].pCell; @@ -1816,7 +1816,7 @@ USHORT ScColumn::GetErrCode( SCROW nRow ) const BOOL ScColumn::HasStringData( SCROW nRow ) const { - SCSIZE nIndex; + SCSIZE nIndex; if (Search(nRow, nIndex)) return (pItems[nIndex].pCell)->HasStringData(); return FALSE; @@ -1825,7 +1825,7 @@ BOOL ScColumn::HasStringData( SCROW nRow ) const BOOL ScColumn::HasValueData( SCROW nRow ) const { - SCSIZE nIndex; + SCSIZE nIndex; if (Search(nRow, nIndex)) return (pItems[nIndex].pCell)->HasValueData(); return FALSE; @@ -1833,7 +1833,7 @@ BOOL ScColumn::HasValueData( SCROW nRow ) const BOOL ScColumn::HasStringCells( SCROW nStartRow, SCROW nEndRow ) const { - // TRUE, wenn String- oder Editzellen im Bereich + // TRUE, wenn String- oder Editzellen im Bereich if ( pItems ) { @@ -1938,7 +1938,7 @@ sal_Int32 ScColumn::GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCh } -xub_StrLen ScColumn::GetMaxNumberStringLen( +xub_StrLen ScColumn::GetMaxNumberStringLen( sal_uInt16& nPrecision, SCROW nRowStart, SCROW nRowEnd ) const { xub_StrLen nStringLen = 0; diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx index 95da04fef0e0..00c4adf54dea 100644 --- a/sc/source/core/data/compressedarray.cxx +++ b/sc/source/core/data/compressedarray.cxx @@ -1,7 +1,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 @@ -362,7 +362,7 @@ A ScCompressedArray<A,D>::GetLastUnequalAccess( A nStart, const D& rCompare ) } -// === ScSummableCompressedArray ============================================= +// === ScSummableCompressedArray ============================================= template< typename A, typename D > unsigned long ScSummableCompressedArray<A,D>::SumValues( A nStart, A nEnd ) const diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index b08838198477..56774ab29339 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1,7 +1,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 @@ -144,14 +144,14 @@ ScConditionEntry::ScConditionEntry( const ScConditionEntry& r ) : bRelRef2(r.bRelRef2), bFirstRun(TRUE) { - // ScTokenArray copy ctor erzeugt flache Kopie + // ScTokenArray copy ctor erzeugt flache Kopie if (r.pFormula1) pFormula1 = new ScTokenArray( *r.pFormula1 ); if (r.pFormula2) pFormula2 = new ScTokenArray( *r.pFormula2 ); - // Formelzellen werden erst bei IsValid angelegt + // Formelzellen werden erst bei IsValid angelegt } ScConditionEntry::ScConditionEntry( ScDocument* pDocument, const ScConditionEntry& r ) : @@ -185,8 +185,8 @@ ScConditionEntry::ScConditionEntry( ScDocument* pDocument, const ScConditionEntr if (r.pFormula2) pFormula2 = r.pFormula2->Clone(); - // Formelzellen werden erst bei IsValid angelegt - //! im Clipboard nicht - dann vorher interpretieren !!! + // Formelzellen werden erst bei IsValid angelegt + //! im Clipboard nicht - dann vorher interpretieren !!! } ScConditionEntry::ScConditionEntry( ScConditionMode eOper, @@ -194,7 +194,7 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper, const String& rExprNmsp1, const String& rExprNmsp2, FormulaGrammar::Grammar eGrammar1, FormulaGrammar::Grammar eGrammar2 ) : eOp(eOper), - nOptions(0), // spaeter... + nOptions(0), // spaeter... nVal1(0.0), nVal2(0.0), aStrNmsp1(rExprNmsp1), @@ -215,14 +215,14 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper, { Compile( rExpr1, rExpr2, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2, FALSE ); - // Formelzellen werden erst bei IsValid angelegt + // Formelzellen werden erst bei IsValid angelegt } ScConditionEntry::ScConditionEntry( ScConditionMode eOper, const ScTokenArray* pArr1, const ScTokenArray* pArr2, ScDocument* pDocument, const ScAddress& rPos ) : eOp(eOper), - nOptions(0), // spaeter... + nOptions(0), // spaeter... nVal1(0.0), nVal2(0.0), eTempGrammar1(FormulaGrammar::GRAM_DEFAULT), @@ -251,13 +251,13 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper, if ( pToken->GetType() == svDouble ) { nVal1 = pToken->GetDouble(); - DELETEZ(pFormula1); // nicht als Formel merken + DELETEZ(pFormula1); // nicht als Formel merken } else if ( pToken->GetType() == svString ) { bIsStr1 = TRUE; aStrVal1 = pToken->GetString(); - DELETEZ(pFormula1); // nicht als Formel merken + DELETEZ(pFormula1); // nicht als Formel merken } } } @@ -275,20 +275,20 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper, if ( pToken->GetType() == svDouble ) { nVal2 = pToken->GetDouble(); - DELETEZ(pFormula2); // nicht als Formel merken + DELETEZ(pFormula2); // nicht als Formel merken } else if ( pToken->GetType() == svString ) { bIsStr2 = TRUE; aStrVal2 = pToken->GetString(); - DELETEZ(pFormula2); // nicht als Formel merken + DELETEZ(pFormula2); // nicht als Formel merken } } } bRelRef2 = lcl_HasRelRef( pDoc, pFormula2 ); } - // formula cells are created at IsValid + // formula cells are created at IsValid } ScConditionEntry::~ScConditionEntry() @@ -313,8 +313,8 @@ void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2, aComp.SetGrammar( eGrammar1 ); if ( pDoc->IsImportingXML() && !bTextToReal ) { - // temporary formula string as string tokens - //! merge with lcl_ScDocFunc_CreateTokenArrayXML + // temporary formula string as string tokens + //! merge with lcl_ScDocFunc_CreateTokenArrayXML pFormula1 = new ScTokenArray; pFormula1->AddString( rExpr1 ); // bRelRef1 is set when the formula is compiled again (CompileXML) @@ -331,13 +331,13 @@ void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2, if ( pToken->GetType() == svDouble ) { nVal1 = pToken->GetDouble(); - DELETEZ(pFormula1); // nicht als Formel merken + DELETEZ(pFormula1); // nicht als Formel merken } else if ( pToken->GetType() == svString ) { bIsStr1 = TRUE; aStrVal1 = pToken->GetString(); - DELETEZ(pFormula1); // nicht als Formel merken + DELETEZ(pFormula1); // nicht als Formel merken } } } @@ -350,8 +350,8 @@ void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2, aComp.SetGrammar( eGrammar2 ); if ( pDoc->IsImportingXML() && !bTextToReal ) { - // temporary formula string as string tokens - //! merge with lcl_ScDocFunc_CreateTokenArrayXML + // temporary formula string as string tokens + //! merge with lcl_ScDocFunc_CreateTokenArrayXML pFormula2 = new ScTokenArray; pFormula2->AddString( rExpr2 ); // bRelRef2 is set when the formula is compiled again (CompileXML) @@ -368,13 +368,13 @@ void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2, if ( pToken->GetType() == svDouble ) { nVal2 = pToken->GetDouble(); - DELETEZ(pFormula2); // nicht als Formel merken + DELETEZ(pFormula2); // nicht als Formel merken } else if ( pToken->GetType() == svString ) { bIsStr2 = TRUE; aStrVal2 = pToken->GetString(); - DELETEZ(pFormula2); // nicht als Formel merken + DELETEZ(pFormula2); // nicht als Formel merken } } } @@ -384,9 +384,9 @@ void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2, } } -void ScConditionEntry::MakeCells( const ScAddress& rPos ) // Formelzellen anlegen +void ScConditionEntry::MakeCells( const ScAddress& rPos ) // Formelzellen anlegen { - if ( !pDoc->IsClipOrUndo() ) // nie im Clipboard rechnen! + if ( !pDoc->IsClipOrUndo() ) // nie im Clipboard rechnen! { if ( pFormula1 && !pFCell1 && !bRelRef1 ) { @@ -404,8 +404,8 @@ 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) + // Das Bit SC_COND_NOBLANKS wird gesetzt, wenn Blanks nicht ignoriert werden + // (nur bei Gueltigkeit) if (bSet) nOptions &= ~SC_COND_NOBLANKS; @@ -415,7 +415,7 @@ void ScConditionEntry::SetIgnoreBlank(BOOL bSet) void ScConditionEntry::CompileAll() { - // Formelzellen loeschen, dann wird beim naechsten IsValid neu kompiliert + // Formelzellen loeschen, dann wird beim naechsten IsValid neu kompiliert DELETEZ(pFCell1); DELETEZ(pFCell2); @@ -436,7 +436,7 @@ void ScConditionEntry::CompileXML() aSrcString.Erase(); } - // Convert the text tokens that were created during XML import into real tokens. + // Convert the text tokens that were created during XML import into real tokens. Compile( GetExpression(aSrcPos, 0, 0, eTempGrammar1), GetExpression(aSrcPos, 1, 0, eTempGrammar2), @@ -526,7 +526,7 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, } if (bChanged1) - DELETEZ(pFCell1); // is created again in IsValid + DELETEZ(pFCell1); // is created again in IsValid } if (pFormula2) { @@ -543,7 +543,7 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, } if (bChanged2) - DELETEZ(pFCell2); // is created again in IsValid + DELETEZ(pFCell2); // is created again in IsValid } } @@ -565,11 +565,11 @@ void ScConditionEntry::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) } } -//! als Vergleichsoperator ans TokenArray ??? +//! als Vergleichsoperator ans TokenArray ??? BOOL lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 ) { - // verglichen wird nur das nicht-UPN Array + // verglichen wird nur das nicht-UPN Array if ( pArr1 && pArr2 ) { @@ -583,12 +583,12 @@ BOOL lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 ) { if ( ppToken1[i] != ppToken2[i] && !(*ppToken1[i] == *ppToken2[i]) ) - return FALSE; // Unterschied + return FALSE; // Unterschied } - return TRUE; // alle Eintraege gleich + return TRUE; // alle Eintraege gleich } else - return !pArr1 && !pArr2; // beide 0 -> gleich + return !pArr1 && !pArr2; // beide 0 -> gleich } int ScConditionEntry::operator== ( const ScConditionEntry& r ) const @@ -603,7 +603,7 @@ int ScConditionEntry::operator== ( const ScConditionEntry& r ) const if ( ( pFormula1 || pFormula2 ) && ( aSrcPos != r.aSrcPos || aSrcString != r.aSrcString ) ) bEq = FALSE; - // wenn keine Formeln, Werte vergleichen + // wenn keine Formeln, Werte vergleichen if ( !pFormula1 && ( nVal1 != r.nVal1 || aStrVal1 != r.aStrVal1 || bIsStr1 != r.bIsStr1 ) ) bEq = FALSE; if ( !pFormula2 && ( nVal2 != r.nVal2 || aStrVal2 != r.aStrVal2 || bIsStr2 != r.bIsStr2 ) ) @@ -615,28 +615,28 @@ int ScConditionEntry::operator== ( const ScConditionEntry& r ) const void ScConditionEntry::Interpret( const ScAddress& rPos ) { - // Formelzellen anlegen - // dabei koennen neue Broadcaster (Note-Zellen) ins Dokument eingefuegt werden !!!! + // Formelzellen anlegen + // dabei koennen neue Broadcaster (Note-Zellen) ins Dokument eingefuegt werden !!!! if ( ( pFormula1 && !pFCell1 ) || ( pFormula2 && !pFCell2 ) ) MakeCells( rPos ); - // Formeln auswerten + // Formeln auswerten - BOOL bDirty = FALSE; //! 1 und 2 getrennt ??? + BOOL bDirty = FALSE; //! 1 und 2 getrennt ??? ScFormulaCell* pTemp1 = NULL; ScFormulaCell* pEff1 = pFCell1; if ( bRelRef1 ) { - pTemp1 = new ScFormulaCell( pDoc, rPos, pFormula1 ); // ohne Listening + pTemp1 = new ScFormulaCell( pDoc, rPos, pFormula1 ); // ohne Listening pEff1 = pTemp1; } if ( pEff1 ) { - if (!pEff1->IsRunning()) // keine 522 erzeugen + if (!pEff1->IsRunning()) // keine 522 erzeugen { - //! Changed statt Dirty abfragen !!! + //! Changed statt Dirty abfragen !!! if (pEff1->GetDirty() && !bRelRef1) bDirty = TRUE; if (pEff1->IsValue()) @@ -659,12 +659,12 @@ void ScConditionEntry::Interpret( const ScAddress& rPos ) ScFormulaCell* pEff2 = pFCell2; //@ 1!=2 if ( bRelRef2 ) { - pTemp2 = new ScFormulaCell( pDoc, rPos, pFormula2 ); // ohne Listening + pTemp2 = new ScFormulaCell( pDoc, rPos, pFormula2 ); // ohne Listening pEff2 = pTemp2; } if ( pEff2 ) { - if (!pEff2->IsRunning()) // keine 522 erzeugen + if (!pEff2->IsRunning()) // keine 522 erzeugen { if (pEff2->GetDirty() && !bRelRef2) bDirty = TRUE; @@ -684,13 +684,13 @@ void ScConditionEntry::Interpret( const ScAddress& rPos ) } delete pTemp2; - // wenn IsRunning, bleiben die letzten Werte erhalten + // wenn IsRunning, bleiben die letzten Werte erhalten if (bDirty && !bFirstRun) { - // bei bedingten Formaten neu painten + // bei bedingten Formaten neu painten - DataChanged( NULL ); // alles + DataChanged( NULL ); // alles } bFirstRun = FALSE; @@ -698,7 +698,7 @@ void ScConditionEntry::Interpret( const ScAddress& rPos ) BOOL ScConditionEntry::IsValid( double nArg ) const { - // Interpret muss schon gerufen sein + // Interpret muss schon gerufen sein if ( bIsStr1 ) { @@ -711,23 +711,23 @@ BOOL ScConditionEntry::IsValid( double nArg ) const if ( bIsStr2 ) return FALSE; - double nComp1 = nVal1; // Kopie, damit vertauscht werden kann + double nComp1 = nVal1; // Kopie, damit vertauscht werden kann double nComp2 = nVal2; if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN ) if ( nComp1 > nComp2 ) { - // richtige Reihenfolge fuer Wertebereich + // richtige Reihenfolge fuer Wertebereich double nTemp = nComp1; nComp1 = nComp2; nComp2 = nTemp; } - // Alle Grenzfaelle muessen per ::rtl::math::approxEqual getestet werden! + // Alle Grenzfaelle muessen per ::rtl::math::approxEqual getestet werden! BOOL bValid = FALSE; switch (eOp) { case SC_COND_NONE: - break; // immer FALSE; + break; // immer FALSE; case SC_COND_EQUAL: bValid = ::rtl::math::approxEqual( nArg, nComp1 ); break; @@ -766,12 +766,12 @@ BOOL ScConditionEntry::IsValid( double nArg ) const BOOL ScConditionEntry::IsValidStr( const String& rArg ) const { - // Interpret muss schon gerufen sein + // Interpret muss schon gerufen sein - if ( eOp == SC_COND_DIRECT ) // Formel ist unabhaengig vom Inhalt + if ( eOp == SC_COND_DIRECT ) // Formel ist unabhaengig vom Inhalt return !::rtl::math::approxEqual( nVal1, 0.0 ); - // Wenn Bedingung Zahl enthaelt, immer FALSE, ausser bei "ungleich" + // Wenn Bedingung Zahl enthaelt, immer FALSE, ausser bei "ungleich" if ( !bIsStr1 ) return ( eOp == SC_COND_NOTEQUAL ); @@ -779,14 +779,14 @@ BOOL ScConditionEntry::IsValidStr( const String& rArg ) const if ( !bIsStr2 ) return FALSE; - String aUpVal1( aStrVal1 ); //! als Member? (dann auch in Interpret setzen) + String aUpVal1( aStrVal1 ); //! als Member? (dann auch in Interpret setzen) String aUpVal2( aStrVal2 ); if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN ) if ( ScGlobal::GetCollator()->compareString( aUpVal1, aUpVal2 ) == COMPARE_GREATER ) { - // richtige Reihenfolge fuer Wertebereich + // richtige Reihenfolge fuer Wertebereich String aTemp( aUpVal1 ); aUpVal1 = aUpVal2; aUpVal2 = aTemp; } @@ -821,14 +821,14 @@ BOOL ScConditionEntry::IsValidStr( const String& rArg ) const break; case SC_COND_BETWEEN: case SC_COND_NOTBETWEEN: - // Test auf NOTBETWEEN: + // Test auf NOTBETWEEN: bValid = ( nCompare == COMPARE_LESS || ScGlobal::GetCollator()->compareString( rArg, aUpVal2 ) == COMPARE_GREATER ); if ( eOp == SC_COND_BETWEEN ) bValid = !bValid; break; - // SC_COND_DIRECT schon oben abgefragt + // SC_COND_DIRECT schon oben abgefragt default: DBG_ERROR("unbekannte Operation bei ScConditionEntry"); bValid = FALSE; @@ -841,7 +841,7 @@ BOOL ScConditionEntry::IsValidStr( const String& rArg ) const BOOL ScConditionEntry::IsCellValid( ScBaseCell* pCell, const ScAddress& rPos ) const { - ((ScConditionEntry*)this)->Interpret(rPos); // Formeln auswerten + ((ScConditionEntry*)this)->Interpret(rPos); // Formeln auswerten double nArg = 0.0; String aArgStr; @@ -875,14 +875,14 @@ BOOL ScConditionEntry::IsCellValid( ScBaseCell* pCell, const ScAddress& rPos ) c break; default: - pCell = NULL; // Note-Zellen wie leere + pCell = NULL; // Note-Zellen wie leere break; } } if (!pCell) if (bIsStr1) - bVal = FALSE; // leere Zellen je nach Bedingung + bVal = FALSE; // leere Zellen je nach Bedingung if (bVal) return IsValid( nArg ); @@ -995,7 +995,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 + // absolut muss getroffen sein, relativ bestimmt Bereich BOOL bHit = TRUE; SCsCOL nCol1; @@ -1051,11 +1051,11 @@ void ScConditionEntry::SourceChanged( const ScAddress& rChanged ) if ( bHit ) { - //! begrenzen + //! begrenzen ScRange aPaint( nCol1,nRow1,nTab1, nCol2,nRow2,nTab2 ); - // kein Paint, wenn es nur die Zelle selber ist + // kein Paint, wenn es nur die Zelle selber ist if ( aPaint.aStart != rChanged || aPaint.aEnd != rChanged ) DataChanged( &aPaint ); } @@ -1176,7 +1176,7 @@ int ScCondFormatEntry::operator== ( const ScCondFormatEntry& r ) const return ScConditionEntry::operator==( r ) && aStyleName == r.aStyleName; - // Range wird nicht verglichen + // Range wird nicht verglichen } ScCondFormatEntry::~ScCondFormatEntry() @@ -1247,7 +1247,7 @@ BOOL ScConditionalFormat::EqualEntries( const ScConditionalFormat& r ) const if ( nEntryCount != r.nEntryCount ) return FALSE; - //! auf gleiche Eintraege in anderer Reihenfolge testen ??? + //! auf gleiche Eintraege in anderer Reihenfolge testen ??? for (USHORT i=0; i<nEntryCount; i++) if ( ! (*ppEntries[i] == *r.ppEntries[i]) ) @@ -1308,8 +1308,8 @@ void lcl_Extend( ScRange& rRange, ScDocument* pDoc, BOOL bLines ) if (bLines) { - if (nStartCol > 0) --nStartCol; - if (nStartRow > 0) --nStartRow; + if (nStartCol > 0) --nStartCol; + if (nStartRow > 0) --nStartRow; if (nEndCol < MAXCOL) ++nEndCol; if (nEndRow < MAXROW) ++nEndRow; } @@ -1350,7 +1350,7 @@ BOOL lcl_CutRange( ScRange& rRange, const ScRange& rOther ) return TRUE; } - return FALSE; // ausserhalb + return FALSE; // ausserhalb } void ScConditionalFormat::DoRepaint( const ScRange* pModified ) @@ -1359,13 +1359,13 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified ) SfxObjectShell* pSh = pDoc->GetDocumentShell(); if (pSh) { - // Rahmen/Schatten enthalten? - // (alle Bedingungen testen) + // Rahmen/Schatten enthalten? + // (alle Bedingungen testen) BOOL bExtend = FALSE; BOOL bRotate = FALSE; BOOL bAttrTested = FALSE; - if (!pAreas) // RangeList ggf. holen + if (!pAreas) // RangeList ggf. holen { pAreas = new ScRangeList; pDoc->FindConditionalFormat( nKey, *pAreas ); @@ -1413,11 +1413,11 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified ) bAttrTested = TRUE; } - lcl_Extend( aRange, pDoc, bExtend ); // zusammengefasste und bExtend + lcl_Extend( aRange, pDoc, bExtend ); // zusammengefasste und bExtend if ( bRotate ) { aRange.aStart.SetCol(0); - aRange.aEnd.SetCol(MAXCOL); // gedreht: ganze Zeilen + aRange.aEnd.SetCol(MAXCOL); // gedreht: ganze Zeilen } // gedreht -> ganze Zeilen @@ -1462,7 +1462,7 @@ void ScConditionalFormat::UpdateReference( UpdateRefMode eUpdateRefMode, for (USHORT i=0; i<nEntryCount; i++) ppEntries[i]->UpdateReference(eUpdateRefMode, rRange, nDx, nDy, nDz); - delete pAreas; // aus dem AttrArray kommt beim Einfuegen/Loeschen kein Aufruf + delete pAreas; // aus dem AttrArray kommt beim Einfuegen/Loeschen kein Aufruf pAreas = NULL; } @@ -1478,7 +1478,7 @@ void ScConditionalFormat::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) for (USHORT i=0; i<nEntryCount; i++) ppEntries[i]->UpdateMoveTab( nOldPos, nNewPos ); - delete pAreas; // aus dem AttrArray kommt beim Einfuegen/Loeschen kein Aufruf + delete pAreas; // aus dem AttrArray kommt beim Einfuegen/Loeschen kein Aufruf pAreas = NULL; } @@ -1501,27 +1501,27 @@ bool ScConditionalFormat::MarkUsedExternalReferences() const ScConditionalFormatList::ScConditionalFormatList(const ScConditionalFormatList& rList) : ScConditionalFormats_Impl() { - // fuer Ref-Undo - echte Kopie mit neuen Tokens! + // fuer Ref-Undo - echte Kopie mit neuen Tokens! USHORT nCount = rList.Count(); for (USHORT i=0; i<nCount; i++) InsertNew( rList[i]->Clone() ); - //! sortierte Eintraege aus rList schneller einfuegen ??? + //! sortierte Eintraege aus rList schneller einfuegen ??? } ScConditionalFormatList::ScConditionalFormatList(ScDocument* pNewDoc, const ScConditionalFormatList& rList) { - // fuer neues Dokument - echte Kopie mit neuen Tokens! + // fuer neues Dokument - echte Kopie mit neuen Tokens! USHORT nCount = rList.Count(); for (USHORT i=0; i<nCount; i++) InsertNew( rList[i]->Clone(pNewDoc) ); - //! sortierte Eintraege aus rList schneller einfuegen ??? + //! sortierte Eintraege aus rList schneller einfuegen ??? } BOOL ScConditionalFormatList::operator==( const ScConditionalFormatList& r ) const @@ -1530,8 +1530,8 @@ BOOL ScConditionalFormatList::operator==( const ScConditionalFormatList& r ) con USHORT nCount = Count(); BOOL bEqual = ( nCount == r.Count() ); - for (USHORT i=0; i<nCount && bEqual; i++) // Eintraege sind sortiert - if ( !(*this)[i]->EqualEntries(*r[i]) ) // Eintraege unterschiedlich ? + for (USHORT i=0; i<nCount && bEqual; i++) // Eintraege sind sortiert + if ( !(*this)[i]->EqualEntries(*r[i]) ) // Eintraege unterschiedlich ? bEqual = FALSE; return bEqual; @@ -1539,7 +1539,7 @@ BOOL ScConditionalFormatList::operator==( const ScConditionalFormatList& r ) con ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey ) { - //! binaer suchen + //! binaer suchen USHORT nCount = Count(); for (USHORT i=0; i<nCount; i++) diff --git a/sc/source/core/data/dbdocutl.cxx b/sc/source/core/data/dbdocutl.cxx index 39675704fb70..233bc4e73d70 100644 --- a/sc/source/core/data/dbdocutl.cxx +++ b/sc/source/core/data/dbdocutl.cxx @@ -1,7 +1,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 @@ -60,7 +60,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB BOOL bError = FALSE; ULONG nFormatIndex = 0; - //! wasNull calls only if null value was found? + //! wasNull calls only if null value was found? try { @@ -68,7 +68,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB { case sdbc::DataType::BIT: case sdbc::DataType::BOOLEAN: - //! use language from doc (here, date/time and currency)? + //! use language from doc (here, date/time and currency)? nFormatIndex = pDoc->GetFormatTable()->GetStandardFormat( NUMBERFORMAT_LOGICAL, ScGlobal::eLnge ); nVal = (xRow->getBoolean(nRowPos) ? 1 : 0); @@ -85,7 +85,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB case sdbc::DataType::DOUBLE: case sdbc::DataType::NUMERIC: case sdbc::DataType::DECIMAL: - //! do the conversion here? + //! do the conversion here? nVal = xRow->getDouble(nRowPos); bEmptyFlag = ( nVal == 0.0 ) && xRow->wasNull(); bValue = TRUE; @@ -150,7 +150,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB case sdbc::DataType::VARBINARY: case sdbc::DataType::LONGVARBINARY: default: - bError = TRUE; // unknown type + bError = TRUE; // unknown type } } catch ( uno::Exception& ) diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index aa5b011da93b..1da04e90b99d 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -1,7 +1,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 @@ -88,7 +88,7 @@ ScDocumentIterator::~ScDocumentIterator() BOOL ScDocumentIterator::GetThisCol() { - ScTable* pTab; + ScTable* pTab; while ( (pTab = pDoc->pTab[nTab]) == NULL ) { if ( nTab == nEndTab ) @@ -99,8 +99,8 @@ BOOL ScDocumentIterator::GetThisCol() } ++nTab; } - ScColumn* pCol = &pTab->aCol[nCol]; - ScAttrArray* pAtt = pCol->pAttrArray; + ScColumn* pCol = &pTab->aCol[nCol]; + ScAttrArray* pAtt = pCol->pAttrArray; BOOL bFound = FALSE; do @@ -126,8 +126,8 @@ BOOL ScDocumentIterator::GetThisCol() if (nColRow == nRow) { - bFound = TRUE; - pCell = pCol->pItems[nColPos].pCell; + bFound = TRUE; + pCell = pCol->pItems[nColPos].pCell; pPattern = pAtt->pData[nAttrPos].pPattern; } else if ( pAtt->pData[nAttrPos].pPattern != pDefPattern ) @@ -225,7 +225,7 @@ void lcl_IterGetNumberFormat( ULONG& nFormat, const ScAttrArray*& rpArr, if ( rpArr != pNewArr || nAttrEndRow < nRow ) { SCSIZE nPos; - pNewArr->Search( nRow, nPos ); // nPos 0 gueltig wenn nicht gefunden + pNewArr->Search( nRow, nPos ); // nPos 0 gueltig wenn nicht gefunden const ScPatternAttr* pPattern = pNewArr->pData[nPos].pPattern; nFormat = pPattern->GetNumberFormat( pDoc->GetFormatTable() ); rpArr = pNewArr; @@ -306,9 +306,9 @@ ScValueIterator::ScValueIterator( ScDocument* pDocument, const ScRange& rRange, nRow = nStartRow; nTab = nStartTab; - nColRow = 0; // wird bei GetFirst initialisiert + nColRow = 0; // wird bei GetFirst initialisiert - nNumFormat = 0; // werden bei GetNumberFormat initialisiert + nNumFormat = 0; // werden bei GetNumberFormat initialisiert pAttrArray = 0; nAttrEndRow = 0; } @@ -332,7 +332,7 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) { // rValue = 0.0; //! do not change caller's value! rErr = 0; - return FALSE; // Ende und Aus + return FALSE; // Ende und Aus } } pCol = &(pDoc->pTab[nTab])->aCol[nCol]; @@ -365,8 +365,8 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) rValue = pDoc->RoundValueAsShown( rValue, nNumFormat ); } // - // wenn in der selben Spalte gleich noch eine Value-Cell folgt, die - // auch noch im Block liegt, den Wert jetzt schon holen + // wenn in der selben Spalte gleich noch eine Value-Cell folgt, die + // auch noch im Block liegt, den Wert jetzt schon holen // if ( nColRow < pCol->nCount && pCol->pItems[nColRow].nRow <= nEndRow && @@ -384,7 +384,7 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) } } - return TRUE; // gefunden + return TRUE; // gefunden } // break; case CELLTYPE_FORMULA: @@ -397,7 +397,7 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) rValue = ((ScFormulaCell*)pCell)->GetValue(); nRow--; bNumValid = FALSE; - return TRUE; // gefunden + return TRUE; // gefunden } else if ( bTextAsZero ) { @@ -432,7 +432,7 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) } } else - nRow = nEndRow + 1; // naechste Spalte + nRow = nEndRow + 1; // naechste Spalte } } @@ -475,18 +475,18 @@ BOOL ScValueIterator::GetFirst(double& rValue, USHORT& rErr) nRow = nStartRow; nTab = nStartTab; -// nColRow = 0; +// nColRow = 0; ScColumn* pCol = &(pDoc->pTab[nTab])->aCol[nCol]; pCol->Search( nRow, nColRow ); - nNumFormat = 0; // werden bei GetNumberFormat initialisiert + nNumFormat = 0; // werden bei GetNumberFormat initialisiert pAttrArray = 0; nAttrEndRow = 0; return GetThis(rValue, rErr); } -/* ist inline: +/* ist inline: BOOL ScValueIterator::GetNext(double& rValue, USHORT& rErr) { ++nRow; @@ -539,7 +539,7 @@ SCSIZE ScDBQueryDataIterator::SearchColEntryIndex(ScDocument& rDoc, SCTAB nTab, // ---------------------------------------------------------------------------- ScDBQueryDataIterator::DataAccessInternal::DataAccessInternal(const ScDBQueryDataIterator* pParent, ScDBQueryParamInternal* pParam, ScDocument* pDoc) : - DataAccess(pParent), + DataAccess(pParent), mpParam(pParam), mpDoc(pDoc) { @@ -547,7 +547,7 @@ ScDBQueryDataIterator::DataAccessInternal::DataAccessInternal(const ScDBQueryDat nRow = mpParam->nRow1; nTab = mpParam->nTab; - nColRow = 0; // wird bei GetFirst initialisiert + nColRow = 0; // wird bei GetFirst initialisiert SCSIZE i; SCSIZE nCount = mpParam->GetEntryCount(); for (i=0; (i<nCount) && (mpParam->GetEntry(i).bDoQuery); i++) @@ -557,7 +557,7 @@ ScDBQueryDataIterator::DataAccessInternal::DataAccessInternal(const ScDBQueryDat rEntry.bQueryByString = !(mpDoc->GetFormatTable()->IsNumberFormat(*rEntry.pStr, nIndex, rEntry.nVal)); } - nNumFormat = 0; // werden bei GetNumberFormat initialisiert + nNumFormat = 0; // werden bei GetNumberFormat initialisiert pAttrArray = 0; nAttrEndRow = 0; } @@ -604,7 +604,7 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue) rValue.mbIsNumber = true; if ( bCalcAsShown ) { - const ScAttrArray* pNewAttrArray = + const ScAttrArray* pNewAttrArray = ScDBQueryDataIterator::GetAttrArrayByCol(*mpDoc, nTab, nCol); lcl_IterGetNumberFormat( nNumFormat, pAttrArray, nAttrEndRow, pNewAttrArray, nRow, mpDoc ); @@ -613,7 +613,7 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue) nNumFmtType = NUMBERFORMAT_NUMBER; nNumFmtIndex = 0; rValue.mnError = 0; - return TRUE; // gefunden + return TRUE; // gefunden } // break; case CELLTYPE_FORMULA: @@ -626,7 +626,7 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue) nNumFmtIndex, ScAddress( nCol, nRow, nTab ), pCell ); rValue.mnError = ((ScFormulaCell*)pCell)->GetErrCode(); - return TRUE; // gefunden + return TRUE; // gefunden } else nRow++; @@ -774,7 +774,7 @@ bool ScDBQueryDataIterator::DataAccessMatrix::isValidQuery(SCROW nRow, const ScM vector<bool> aResults; aResults.reserve(nEntryCount); - const CollatorWrapper& rCollator = + const CollatorWrapper& rCollator = mpParam->bCaseSens ? *ScGlobal::GetCaseCollator() : *ScGlobal::GetCollator(); for (SCSIZE i = 0; i < nEntryCount; ++i) @@ -895,7 +895,7 @@ bool ScDBQueryDataIterator::DataAccessMatrix::isValidQuery(SCROW nRow, const ScM else if (rEntry.eConnect == SC_AND) { // For AND op, tuck the result into the last result value. - size_t n = aResults.size(); + size_t n = aResults.size(); aResults[n-1] = aResults[n-1] && bValid; } else @@ -978,21 +978,21 @@ ScCellIterator::ScCellIterator( ScDocument* pDocument, if (!ValidTab(nEndTab)) nEndTab = MAXTAB; while (nEndTab>0 && !pDoc->pTab[nEndTab]) - --nEndTab; // nur benutzte Tabellen + --nEndTab; // nur benutzte Tabellen if (nStartTab>nEndTab) nStartTab = nEndTab; nCol = nStartCol; nRow = nStartRow; nTab = nStartTab; - nColRow = 0; // wird bei GetFirst initialisiert + nColRow = 0; // wird bei GetFirst initialisiert if (!pDoc->pTab[nTab]) { DBG_ERROR("Tabelle nicht gefunden"); nStartCol = nCol = MAXCOL+1; nStartRow = nRow = MAXROW+1; - nStartTab = nTab = MAXTAB+1; // -> Abbruch bei GetFirst + nStartTab = nTab = MAXTAB+1; // -> Abbruch bei GetFirst } } @@ -1020,21 +1020,21 @@ ScCellIterator::ScCellIterator if (!ValidTab(nEndTab)) nEndTab = MAXTAB; while (nEndTab>0 && !pDoc->pTab[nEndTab]) - --nEndTab; // nur benutzte Tabellen + --nEndTab; // nur benutzte Tabellen if (nStartTab>nEndTab) nStartTab = nEndTab; nCol = nStartCol; nRow = nStartRow; nTab = nStartTab; - nColRow = 0; // wird bei GetFirst initialisiert + nColRow = 0; // wird bei GetFirst initialisiert if (!pDoc->pTab[nTab]) { DBG_ERROR("Tabelle nicht gefunden"); nStartCol = nCol = MAXCOL+1; nStartRow = nRow = MAXROW+1; - nStartTab = nTab = MAXTAB+1; // -> Abbruch bei GetFirst + nStartTab = nTab = MAXTAB+1; // -> Abbruch bei GetFirst } } @@ -1054,7 +1054,7 @@ ScBaseCell* ScCellIterator::GetThis() nCol = nStartCol; nTab++; if ( nTab > nEndTab ) - return NULL; // Ende und Aus + return NULL; // Ende und Aus } pCol = &(pDoc->pTab[nTab])->aCol[nCol]; } while ( pCol->nCount == 0 ); @@ -1064,7 +1064,7 @@ ScBaseCell* ScCellIterator::GetThis() while ( (nColRow < pCol->nCount) && (pCol->pItems[nColRow].nRow < nRow) ) nColRow++; - if ( nColRow < pCol->nCount && pCol->pItems[nColRow].nRow <= nEndRow ) + if ( nColRow < pCol->nCount && pCol->pItems[nColRow].nRow <= nEndRow ) { nRow = pCol->pItems[nColRow].nRow; if ( !bSubTotal || !pDoc->pTab[nTab]->RowFiltered( nRow ) ) @@ -1073,9 +1073,9 @@ ScBaseCell* ScCellIterator::GetThis() if ( bSubTotal && pCell->GetCellType() == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->IsSubTotal() ) - nRow++; // Sub-Total-Zeilen nicht + nRow++; // Sub-Total-Zeilen nicht else - return pCell; // gefunden + return pCell; // gefunden } else nRow++; @@ -1092,7 +1092,7 @@ ScBaseCell* ScCellIterator::GetFirst() nCol = nStartCol; nRow = nStartRow; nTab = nStartTab; -// nColRow = 0; +// nColRow = 0; ScColumn* pCol = &(pDoc->pTab[nTab])->aCol[nCol]; pCol->Search( nRow, nColRow ); return GetThis(); @@ -1118,9 +1118,9 @@ ScQueryCellIterator::ScQueryCellIterator(ScDocument* pDocument, SCTAB nTable, { nCol = aParam.nCol1; nRow = aParam.nRow1; - nColRow = 0; // wird bei GetFirst initialisiert + nColRow = 0; // wird bei GetFirst initialisiert SCSIZE i; - if (bMod) // sonst schon eingetragen + if (bMod) // sonst schon eingetragen { for (i=0; (i<MAXQUERY) && (aParam.GetEntry(i).bDoQuery); i++) { @@ -1131,7 +1131,7 @@ ScQueryCellIterator::ScQueryCellIterator(ScDocument* pDocument, SCTAB nTable, nIndex, rEntry.nVal)); } } - nNumFormat = 0; // werden bei GetNumberFormat initialisiert + nNumFormat = 0; // werden bei GetNumberFormat initialisiert pAttrArray = 0; nAttrEndRow = 0; } @@ -1157,7 +1157,7 @@ ScBaseCell* ScQueryCellIterator::GetThis() do { if ( ++nCol > aParam.nCol2 ) - return NULL; // Ende und Aus + return NULL; // Ende und Aus if ( bAdvanceQuery ) { AdvanceQueryParamEntryField(); @@ -1239,7 +1239,7 @@ ScBaseCell* ScQueryCellIterator::GetFirst() nRow = aParam.nRow1; if (aParam.bHasHeader) nRow++; -// nColRow = 0; +// nColRow = 0; ScColumn* pCol = &(pDoc->pTab[nTab])->aCol[nCol]; pCol->Search( nRow, nColRow ); return GetThis(); @@ -1271,7 +1271,7 @@ void ScQueryCellIterator::AdvanceQueryParamEntryField() } } else - break; // for + break; // for } } @@ -1696,7 +1696,7 @@ ScHorizontalCellIterator::ScHorizontalCellIterator(ScDocument* pDocument, SCTAB } else { - pNextRows[i-nStartCol] = MAXROWCOUNT; // nichts gefunden + pNextRows[i-nStartCol] = MAXROWCOUNT; // nichts gefunden pNextIndices[i-nStartCol] = MAXROWCOUNT; } } @@ -1729,7 +1729,7 @@ ScBaseCell* ScHorizontalCellIterator::GetNext( SCCOL& rCol, SCROW& rRow ) } else { - pNextRows[nCol-nStartCol] = MAXROWCOUNT; // nichts gefunden + pNextRows[nCol-nStartCol] = MAXROWCOUNT; // nichts gefunden pNextIndices[nCol-nStartCol] = MAXROWCOUNT; } @@ -1799,9 +1799,9 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB nCol = nStartCol; bRowEmpty = FALSE; - pIndices = new SCSIZE[nEndCol-nStartCol+1]; - pNextEnd = new SCROW[nEndCol-nStartCol+1]; - ppPatterns = new const ScPatternAttr*[nEndCol-nStartCol+1]; + pIndices = new SCSIZE[nEndCol-nStartCol+1]; + pNextEnd = new SCROW[nEndCol-nStartCol+1]; + ppPatterns = new const ScPatternAttr*[nEndCol-nStartCol+1]; SCROW nSkipTo = MAXROW; BOOL bEmpty = TRUE; @@ -1820,10 +1820,10 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB { pPattern = NULL; if ( nThisEnd < nSkipTo ) - nSkipTo = nThisEnd; // nSkipTo kann gleich hier gesetzt werden + nSkipTo = nThisEnd; // nSkipTo kann gleich hier gesetzt werden } else - bEmpty = FALSE; // Attribute gefunden + bEmpty = FALSE; // Attribute gefunden pIndices[nPos] = nIndex; pNextEnd[nPos] = nThisEnd; @@ -1831,7 +1831,7 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB } if (bEmpty) - nRow = nSkipTo; // bis zum naechsten Bereichsende ueberspringen + nRow = nSkipTo; // bis zum naechsten Bereichsende ueberspringen bRowEmpty = bEmpty; } @@ -1861,16 +1861,16 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo while ( nCol < nEndCol && ppPatterns[nCol+1-nStartCol] == pPat ) ++nCol; rCol2 = nCol; - ++nCol; // hochzaehlen fuer naechsten Aufruf - return pPat; // gefunden + ++nCol; // hochzaehlen fuer naechsten Aufruf + return pPat; // gefunden } } // naechste Zeile ++nRow; - if ( nRow > nEndRow ) // schon am Ende? - return NULL; // nichts gefunden + if ( nRow > nEndRow ) // schon am Ende? + return NULL; // nichts gefunden BOOL bEmpty = TRUE; SCCOL i; @@ -1890,7 +1890,7 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo if ( IsDefaultItem( pPattern ) ) pPattern = NULL; else - bEmpty = FALSE; // Attribute gefunden + bEmpty = FALSE; // Attribute gefunden pNextEnd[nPos] = nThisEnd; ppPatterns[nPos] = pPattern; @@ -1905,20 +1905,20 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo } } else if ( ppPatterns[nPos] ) - bEmpty = FALSE; // Bereich noch nicht zuende + bEmpty = FALSE; // Bereich noch nicht zuende } if (bEmpty) { SCCOL nCount = nEndCol-nStartCol+1; - SCROW nSkipTo = pNextEnd[0]; // naechstes Bereichsende suchen + SCROW nSkipTo = pNextEnd[0]; // naechstes Bereichsende suchen for (i=1; i<nCount; i++) if ( pNextEnd[i] < nSkipTo ) nSkipTo = pNextEnd[i]; - nRow = nSkipTo; // leere Zeilen ueberspringen + nRow = nSkipTo; // leere Zeilen ueberspringen } bRowEmpty = bEmpty; - nCol = nStartCol; // wieder links anfangen + nCol = nStartCol; // wieder links anfangen } // return NULL; @@ -1948,7 +1948,7 @@ ScUsedAreaIterator::~ScUsedAreaIterator() BOOL ScUsedAreaIterator::GetNext() { - // Iteratoren weiterzaehlen + // Iteratoren weiterzaehlen if ( pCell && IsGreater( nNextCol, nNextRow, nCellCol, nCellRow ) ) pCell = aCellIter.GetNext( nCellCol, nCellRow ); @@ -1962,39 +1962,39 @@ BOOL ScUsedAreaIterator::GetNext() if ( pPattern && nAttrRow == nNextRow && nAttrCol1 < nNextCol ) nAttrCol1 = nNextCol; - // naechsten Abschnitt heraussuchen + // naechsten Abschnitt heraussuchen BOOL bFound = TRUE; BOOL bUseCell = FALSE; if ( pCell && pPattern ) { - if ( IsGreater( nCellCol, nCellRow, nAttrCol1, nAttrRow ) ) // vorne nur Attribute ? + if ( IsGreater( nCellCol, nCellRow, nAttrCol1, nAttrRow ) ) // vorne nur Attribute ? { pFoundCell = NULL; pFoundPattern = pPattern; nFoundRow = nAttrRow; nFoundStartCol = nAttrCol1; - if ( nCellRow == nAttrRow && nCellCol <= nAttrCol2 ) // auch Zelle im Bereich ? - nFoundEndCol = nCellCol - 1; // nur bis vor der Zelle + if ( nCellRow == nAttrRow && nCellCol <= nAttrCol2 ) // auch Zelle im Bereich ? + nFoundEndCol = nCellCol - 1; // nur bis vor der Zelle else - nFoundEndCol = nAttrCol2; // alles + nFoundEndCol = nAttrCol2; // alles } else { bUseCell = TRUE; - if ( nAttrRow == nCellRow && nAttrCol1 == nCellCol ) // Attribute auf der Zelle ? + if ( nAttrRow == nCellRow && nAttrCol1 == nCellCol ) // Attribute auf der Zelle ? pFoundPattern = pPattern; else pFoundPattern = NULL; } } - else if ( pCell ) // nur Zelle -> direkt uebernehmen + else if ( pCell ) // nur Zelle -> direkt uebernehmen { pFoundPattern = NULL; - bUseCell = TRUE; // Position von Zelle + bUseCell = TRUE; // Position von Zelle } - else if ( pPattern ) // nur Attribute -> direkt uebernehmen + else if ( pPattern ) // nur Attribute -> direkt uebernehmen { pFoundCell = NULL; pFoundPattern = pPattern; @@ -2002,10 +2002,10 @@ BOOL ScUsedAreaIterator::GetNext() nFoundStartCol = nAttrCol1; nFoundEndCol = nAttrCol2; } - else // gar nichts + else // gar nichts bFound = FALSE; - if ( bUseCell ) // Position von Zelle + if ( bUseCell ) // Position von Zelle { pFoundCell = pCell; nFoundRow = nCellRow; @@ -2062,7 +2062,7 @@ const ScPatternAttr* ScDocAttrIterator::GetNext( SCCOL& rCol, SCROW& rRow1, SCRO else pColIter = NULL; } - return NULL; // is nix mehr + return NULL; // is nix mehr } //------------------------------------------------------------------------------- @@ -2132,14 +2132,14 @@ const ScPatternAttr* ScAttrRectIterator::GetNext( SCCOL& rCol1, SCCOL& rCol2, else pColIter = NULL; } - return NULL; // is nix mehr + return NULL; // is nix mehr } // ============================================================================ SCROW ScRowBreakIterator::NOT_FOUND = -1; -ScRowBreakIterator::ScRowBreakIterator(set<SCROW>& rBreaks) : +ScRowBreakIterator::ScRowBreakIterator(set<SCROW>& rBreaks) : mrBreaks(rBreaks), maItr(rBreaks.begin()), maEnd(rBreaks.end()) { diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 8b2f48d8a2cc..b9078a5304ee 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -1,7 +1,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 @@ -73,11 +73,11 @@ #include "attrib.hxx" #include "patattr.hxx" #include "globstr.hrc" -#include "sc.hrc" // Slot-IDs +#include "sc.hrc" // Slot-IDs -#define SC_MAX_POOLREF (SFX_ITEMS_OLD_MAXREF - 39) -#define SC_SAFE_POOLREF (SC_MAX_POOLREF + 20) +#define SC_MAX_POOLREF (SFX_ITEMS_OLD_MAXREF - 39) +#define SC_SAFE_POOLREF (SC_MAX_POOLREF + 20) // STATIC DATA ----------------------------------------------------------- @@ -97,93 +97,93 @@ USHORT* ScDocumentPool::pVersionMap11 = 0; static SfxItemInfo __READONLY_DATA aItemInfos[] = { - { SID_ATTR_CHAR_FONT, SFX_ITEM_POOLABLE }, // ATTR_FONT - { SID_ATTR_CHAR_FONTHEIGHT, SFX_ITEM_POOLABLE }, // ATTR_FONT_HEIGHT - { SID_ATTR_CHAR_WEIGHT, SFX_ITEM_POOLABLE }, // ATTR_FONT_WEIGHT - { SID_ATTR_CHAR_POSTURE, SFX_ITEM_POOLABLE }, // ATTR_FONT_POSTURE - { SID_ATTR_CHAR_UNDERLINE, SFX_ITEM_POOLABLE }, // ATTR_FONT_UNDERLINE - { SID_ATTR_CHAR_OVERLINE, SFX_ITEM_POOLABLE }, // ATTR_FONT_OVERLINE - { SID_ATTR_CHAR_STRIKEOUT, SFX_ITEM_POOLABLE }, // ATTR_FONT_CROSSEDOUT - { SID_ATTR_CHAR_CONTOUR, SFX_ITEM_POOLABLE }, // ATTR_FONT_CONTOUR - { SID_ATTR_CHAR_SHADOWED, SFX_ITEM_POOLABLE }, // ATTR_FONT_SHADOWED - { SID_ATTR_CHAR_COLOR, SFX_ITEM_POOLABLE }, // ATTR_FONT_COLOR - { SID_ATTR_CHAR_LANGUAGE, SFX_ITEM_POOLABLE }, // ATTR_FONT_LANGUAGE - { SID_ATTR_CHAR_CJK_FONT, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT from 614 - { SID_ATTR_CHAR_CJK_FONTHEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_HEIGHT from 614 - { SID_ATTR_CHAR_CJK_WEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_WEIGHT from 614 - { SID_ATTR_CHAR_CJK_POSTURE, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_POSTURE from 614 - { SID_ATTR_CHAR_CJK_LANGUAGE, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_LANGUAGE from 614 - { SID_ATTR_CHAR_CTL_FONT, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT from 614 - { SID_ATTR_CHAR_CTL_FONTHEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_HEIGHT from 614 - { SID_ATTR_CHAR_CTL_WEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_WEIGHT from 614 - { SID_ATTR_CHAR_CTL_POSTURE, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_POSTURE from 614 - { SID_ATTR_CHAR_CTL_LANGUAGE, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_LANGUAGE from 614 - { SID_ATTR_CHAR_EMPHASISMARK, SFX_ITEM_POOLABLE }, // ATTR_FONT_EMPHASISMARK from 614 - { 0, SFX_ITEM_POOLABLE }, // ATTR_USERDEF from 614 / 641c - { SID_ATTR_CHAR_WORDLINEMODE, SFX_ITEM_POOLABLE }, // ATTR_FONT_WORDLINE from 632b - { SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE }, // ATTR_FONT_RELIEF from 632b - { SID_ATTR_ALIGN_HYPHENATION, SFX_ITEM_POOLABLE }, // ATTR_HYPHENATE from 632b - { 0, SFX_ITEM_POOLABLE }, // ATTR_SCRIPTSPACE from 614d - { 0, SFX_ITEM_POOLABLE }, // ATTR_HANGPUNCTUATION from 614d - { 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_INDENT, SFX_ITEM_POOLABLE }, // ATTR_INDENT ab 350 - { SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE }, // ATTR_VER_JUSTIFY + { SID_ATTR_CHAR_FONT, SFX_ITEM_POOLABLE }, // ATTR_FONT + { SID_ATTR_CHAR_FONTHEIGHT, SFX_ITEM_POOLABLE }, // ATTR_FONT_HEIGHT + { SID_ATTR_CHAR_WEIGHT, SFX_ITEM_POOLABLE }, // ATTR_FONT_WEIGHT + { SID_ATTR_CHAR_POSTURE, SFX_ITEM_POOLABLE }, // ATTR_FONT_POSTURE + { SID_ATTR_CHAR_UNDERLINE, SFX_ITEM_POOLABLE }, // ATTR_FONT_UNDERLINE + { SID_ATTR_CHAR_OVERLINE, SFX_ITEM_POOLABLE }, // ATTR_FONT_OVERLINE + { SID_ATTR_CHAR_STRIKEOUT, SFX_ITEM_POOLABLE }, // ATTR_FONT_CROSSEDOUT + { SID_ATTR_CHAR_CONTOUR, SFX_ITEM_POOLABLE }, // ATTR_FONT_CONTOUR + { SID_ATTR_CHAR_SHADOWED, SFX_ITEM_POOLABLE }, // ATTR_FONT_SHADOWED + { SID_ATTR_CHAR_COLOR, SFX_ITEM_POOLABLE }, // ATTR_FONT_COLOR + { SID_ATTR_CHAR_LANGUAGE, SFX_ITEM_POOLABLE }, // ATTR_FONT_LANGUAGE + { SID_ATTR_CHAR_CJK_FONT, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT from 614 + { SID_ATTR_CHAR_CJK_FONTHEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_HEIGHT from 614 + { SID_ATTR_CHAR_CJK_WEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_WEIGHT from 614 + { SID_ATTR_CHAR_CJK_POSTURE, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_POSTURE from 614 + { SID_ATTR_CHAR_CJK_LANGUAGE, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_LANGUAGE from 614 + { SID_ATTR_CHAR_CTL_FONT, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT from 614 + { SID_ATTR_CHAR_CTL_FONTHEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_HEIGHT from 614 + { SID_ATTR_CHAR_CTL_WEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_WEIGHT from 614 + { SID_ATTR_CHAR_CTL_POSTURE, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_POSTURE from 614 + { SID_ATTR_CHAR_CTL_LANGUAGE, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_LANGUAGE from 614 + { SID_ATTR_CHAR_EMPHASISMARK, SFX_ITEM_POOLABLE }, // ATTR_FONT_EMPHASISMARK from 614 + { 0, SFX_ITEM_POOLABLE }, // ATTR_USERDEF from 614 / 641c + { SID_ATTR_CHAR_WORDLINEMODE, SFX_ITEM_POOLABLE }, // ATTR_FONT_WORDLINE from 632b + { SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE }, // ATTR_FONT_RELIEF from 632b + { SID_ATTR_ALIGN_HYPHENATION, SFX_ITEM_POOLABLE }, // ATTR_HYPHENATE from 632b + { 0, SFX_ITEM_POOLABLE }, // ATTR_SCRIPTSPACE from 614d + { 0, SFX_ITEM_POOLABLE }, // ATTR_HANGPUNCTUATION from 614d + { 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_INDENT, SFX_ITEM_POOLABLE }, // ATTR_INDENT ab 350 + { SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE }, // ATTR_VER_JUSTIFY { 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 ab 367 + { SID_ATTR_ALIGN_LOCKPOS, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_MODE ab 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 + { SID_ATTR_FRAMEDIRECTION, SFX_ITEM_POOLABLE }, // ATTR_WRITINGDIR from 643 + { SID_ATTR_ALIGN_LINEBREAK, SFX_ITEM_POOLABLE }, // ATTR_LINEBREAK { SID_ATTR_ALIGN_SHRINKTOFIT, SFX_ITEM_POOLABLE }, // ATTR_SHRINKTOFIT from 680/dr14 { SID_ATTR_BORDER_DIAG_TLBR, SFX_ITEM_POOLABLE }, // ATTR_BORDER_TLBR from 680/dr14 { SID_ATTR_BORDER_DIAG_BLTR, SFX_ITEM_POOLABLE }, // ATTR_BORDER_BLTR from 680/dr14 - { SID_ATTR_ALIGN_MARGIN, SFX_ITEM_POOLABLE }, // ATTR_MARGIN - { 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 - { 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 - { SID_ATTR_BORDER_INNER, SFX_ITEM_POOLABLE }, // ATTR_BORDER_INNER - { SID_ATTR_BORDER_SHADOW, SFX_ITEM_POOLABLE }, // ATTR_SHADOW - { 0, SFX_ITEM_POOLABLE }, // ATTR_VALIDDATA - { 0, SFX_ITEM_POOLABLE }, // ATTR_CONDITIONAL - { 0, SFX_ITEM_POOLABLE }, // ATTR_PATTERN - { 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 - { 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 - { SID_ATTR_PAGE_EXT1, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HORCENTER - { SID_ATTR_PAGE_EXT2, SFX_ITEM_POOLABLE }, // ATTR_PAGE_VERCENTER - { SID_ATTR_PAGE_ON, SFX_ITEM_POOLABLE }, // ATTR_PAGE_ON - { SID_ATTR_PAGE_DYNAMIC, SFX_ITEM_POOLABLE }, // ATTR_PAGE_DYNAMIC - { SID_ATTR_PAGE_SHARED, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SHARED - { SID_SCATTR_PAGE_NOTES, SFX_ITEM_POOLABLE }, // ATTR_PAGE_NOTES - { SID_SCATTR_PAGE_GRID, SFX_ITEM_POOLABLE }, // ATTR_PAGE_GRID - { SID_SCATTR_PAGE_HEADERS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERS - { SID_SCATTR_PAGE_CHARTS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_CHARTS - { SID_SCATTR_PAGE_OBJECTS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_OBJECTS - { SID_SCATTR_PAGE_DRAWINGS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_DRAWINGS - { SID_SCATTR_PAGE_TOPDOWN, SFX_ITEM_POOLABLE }, // ATTR_PAGE_TOPDOWN - { SID_SCATTR_PAGE_SCALE, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SCALE - { SID_SCATTR_PAGE_SCALETOPAGES, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SCALETOPAGES - { SID_SCATTR_PAGE_FIRSTPAGENO, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FIRSTPAGENO - { SID_SCATTR_PAGE_PRINTAREA, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PRINTAREA - { SID_SCATTR_PAGE_REPEATROW, SFX_ITEM_POOLABLE }, // ATTR_PAGE_REPEATROW - { SID_SCATTR_PAGE_REPEATCOL, SFX_ITEM_POOLABLE }, // ATTR_PAGE_REPEATCOL - { SID_SCATTR_PAGE_PRINTTABLES, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PRINTTABLES - { SID_SCATTR_PAGE_HEADERLEFT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERLEFT - { SID_SCATTR_PAGE_FOOTERLEFT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FOOTERLEFT - { SID_SCATTR_PAGE_HEADERRIGHT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERRIGHT - { SID_SCATTR_PAGE_FOOTERRIGHT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FOOTERRIGHT - { SID_ATTR_PAGE_HEADERSET, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERSET - { SID_ATTR_PAGE_FOOTERSET, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FOOTERSET - { SID_SCATTR_PAGE_FORMULAS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FORMULAS + { SID_ATTR_ALIGN_MARGIN, SFX_ITEM_POOLABLE }, // ATTR_MARGIN + { 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 + { 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 + { SID_ATTR_BORDER_INNER, SFX_ITEM_POOLABLE }, // ATTR_BORDER_INNER + { SID_ATTR_BORDER_SHADOW, SFX_ITEM_POOLABLE }, // ATTR_SHADOW + { 0, SFX_ITEM_POOLABLE }, // ATTR_VALIDDATA + { 0, SFX_ITEM_POOLABLE }, // ATTR_CONDITIONAL + { 0, SFX_ITEM_POOLABLE }, // ATTR_PATTERN + { 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 + { 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 + { SID_ATTR_PAGE_EXT1, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HORCENTER + { SID_ATTR_PAGE_EXT2, SFX_ITEM_POOLABLE }, // ATTR_PAGE_VERCENTER + { SID_ATTR_PAGE_ON, SFX_ITEM_POOLABLE }, // ATTR_PAGE_ON + { SID_ATTR_PAGE_DYNAMIC, SFX_ITEM_POOLABLE }, // ATTR_PAGE_DYNAMIC + { SID_ATTR_PAGE_SHARED, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SHARED + { SID_SCATTR_PAGE_NOTES, SFX_ITEM_POOLABLE }, // ATTR_PAGE_NOTES + { SID_SCATTR_PAGE_GRID, SFX_ITEM_POOLABLE }, // ATTR_PAGE_GRID + { SID_SCATTR_PAGE_HEADERS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERS + { SID_SCATTR_PAGE_CHARTS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_CHARTS + { SID_SCATTR_PAGE_OBJECTS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_OBJECTS + { SID_SCATTR_PAGE_DRAWINGS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_DRAWINGS + { SID_SCATTR_PAGE_TOPDOWN, SFX_ITEM_POOLABLE }, // ATTR_PAGE_TOPDOWN + { SID_SCATTR_PAGE_SCALE, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SCALE + { SID_SCATTR_PAGE_SCALETOPAGES, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SCALETOPAGES + { SID_SCATTR_PAGE_FIRSTPAGENO, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FIRSTPAGENO + { SID_SCATTR_PAGE_PRINTAREA, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PRINTAREA + { SID_SCATTR_PAGE_REPEATROW, SFX_ITEM_POOLABLE }, // ATTR_PAGE_REPEATROW + { SID_SCATTR_PAGE_REPEATCOL, SFX_ITEM_POOLABLE }, // ATTR_PAGE_REPEATCOL + { SID_SCATTR_PAGE_PRINTTABLES, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PRINTTABLES + { SID_SCATTR_PAGE_HEADERLEFT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERLEFT + { SID_SCATTR_PAGE_FOOTERLEFT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FOOTERLEFT + { SID_SCATTR_PAGE_HEADERRIGHT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERRIGHT + { SID_SCATTR_PAGE_FOOTERRIGHT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FOOTERRIGHT + { SID_ATTR_PAGE_HEADERSET, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERSET + { SID_ATTR_PAGE_FOOTERSET, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FOOTERSET + { SID_SCATTR_PAGE_FORMULAS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FORMULAS { SID_SCATTR_PAGE_NULLVALS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_NULLVALS { SID_SCATTR_PAGE_SCALETO, SFX_ITEM_POOLABLE } // ATTR_PAGE_SCALETO }; @@ -192,12 +192,12 @@ static SfxItemInfo __READONLY_DATA aItemInfos[] = ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) - : SfxItemPool ( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScDocumentPool")), + : SfxItemPool ( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScDocumentPool")), ATTR_STARTINDEX, ATTR_ENDINDEX, aItemInfos, NULL, bLoadRefCounts ), - pSecondary ( pSecPool ) + pSecondary ( pSecPool ) { - // latin font from GetDefaultFonts is not used, DEFAULTFONT_LATIN_SPREADSHEET instead + // latin font from GetDefaultFonts is not used, DEFAULTFONT_LATIN_SPREADSHEET instead Font aStdFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, LANGUAGE_ENGLISH_US, DEFAULTFONT_FLAGS_ONLYONE ); SvxFontItem* pStdFont = new SvxFontItem( aStdFont.GetFamily(), @@ -210,14 +210,14 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) SvxFontItem aDummy( ATTR_FONT ); GetDefaultFonts( aDummy, *pCjkFont, *pCtlFont ); - SvxBoxInfoItem* pGlobalBorderInnerAttr = new SvxBoxInfoItem( ATTR_BORDER_INNER ); - SfxItemSet* pSet = new SfxItemSet( *this, ATTR_PATTERN_START, ATTR_PATTERN_END ); - SfxItemSet aSetItemItemSet( *this, + SvxBoxInfoItem* pGlobalBorderInnerAttr = new SvxBoxInfoItem( ATTR_BORDER_INNER ); + SfxItemSet* pSet = new SfxItemSet( *this, ATTR_PATTERN_START, ATTR_PATTERN_END ); + SfxItemSet aSetItemItemSet( *this, ATTR_BACKGROUND, ATTR_BACKGROUND, - ATTR_BORDER, ATTR_SHADOW, - ATTR_LRSPACE, ATTR_ULSPACE, + ATTR_BORDER, ATTR_SHADOW, + ATTR_LRSPACE, ATTR_ULSPACE, ATTR_PAGE_SIZE, ATTR_PAGE_SIZE, - ATTR_PAGE_ON, ATTR_PAGE_SHARED, + ATTR_PAGE_ON, ATTR_PAGE_SHARED, 0 ); pGlobalBorderInnerAttr->SetLine(NULL, BOXINFO_LINE_HORI); @@ -228,7 +228,7 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) ppPoolDefaults = new SfxPoolItem*[ATTR_ENDINDEX-ATTR_STARTINDEX+1]; - ppPoolDefaults[ ATTR_FONT - ATTR_STARTINDEX ] = pStdFont; + ppPoolDefaults[ ATTR_FONT - ATTR_STARTINDEX ] = pStdFont; ppPoolDefaults[ ATTR_FONT_HEIGHT - ATTR_STARTINDEX ] = new SvxFontHeightItem( 200, 100, ATTR_FONT_HEIGHT ); // 10 pt; ppPoolDefaults[ ATTR_FONT_WEIGHT - ATTR_STARTINDEX ] = new SvxWeightItem( WEIGHT_NORMAL, ATTR_FONT_WEIGHT ); ppPoolDefaults[ ATTR_FONT_POSTURE - ATTR_STARTINDEX ] = new SvxPostureItem( ITALIC_NONE, ATTR_FONT_POSTURE ); @@ -238,100 +238,100 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) ppPoolDefaults[ ATTR_FONT_CONTOUR - ATTR_STARTINDEX ] = new SvxContourItem( sal_False, ATTR_FONT_CONTOUR ); ppPoolDefaults[ ATTR_FONT_SHADOWED - ATTR_STARTINDEX ] = new SvxShadowedItem( sal_False, ATTR_FONT_SHADOWED ); ppPoolDefaults[ ATTR_FONT_COLOR - ATTR_STARTINDEX ] = new SvxColorItem( Color(COL_AUTO), ATTR_FONT_COLOR ); - ppPoolDefaults[ ATTR_FONT_LANGUAGE - ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW), ATTR_FONT_LANGUAGE ); - ppPoolDefaults[ ATTR_CJK_FONT - ATTR_STARTINDEX ] = pCjkFont; + ppPoolDefaults[ ATTR_FONT_LANGUAGE - ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW), ATTR_FONT_LANGUAGE ); + ppPoolDefaults[ ATTR_CJK_FONT - ATTR_STARTINDEX ] = pCjkFont; ppPoolDefaults[ ATTR_CJK_FONT_HEIGHT - ATTR_STARTINDEX ] = new SvxFontHeightItem( 200, 100, ATTR_CJK_FONT_HEIGHT ); ppPoolDefaults[ ATTR_CJK_FONT_WEIGHT - ATTR_STARTINDEX ] = new SvxWeightItem( WEIGHT_NORMAL, ATTR_CJK_FONT_WEIGHT ); ppPoolDefaults[ ATTR_CJK_FONT_POSTURE- ATTR_STARTINDEX ] = new SvxPostureItem( ITALIC_NONE, ATTR_CJK_FONT_POSTURE ); - ppPoolDefaults[ ATTR_CJK_FONT_LANGUAGE-ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW), + ppPoolDefaults[ ATTR_CJK_FONT_LANGUAGE-ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW), ATTR_CJK_FONT_LANGUAGE ); - ppPoolDefaults[ ATTR_CTL_FONT - ATTR_STARTINDEX ] = pCtlFont; + ppPoolDefaults[ ATTR_CTL_FONT - ATTR_STARTINDEX ] = pCtlFont; ppPoolDefaults[ ATTR_CTL_FONT_HEIGHT - ATTR_STARTINDEX ] = new SvxFontHeightItem( 200, 100, ATTR_CTL_FONT_HEIGHT ); ppPoolDefaults[ ATTR_CTL_FONT_WEIGHT - ATTR_STARTINDEX ] = new SvxWeightItem( WEIGHT_NORMAL, ATTR_CTL_FONT_WEIGHT ); ppPoolDefaults[ ATTR_CTL_FONT_POSTURE- ATTR_STARTINDEX ] = new SvxPostureItem( ITALIC_NONE, ATTR_CTL_FONT_POSTURE ); - ppPoolDefaults[ ATTR_CTL_FONT_LANGUAGE-ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW), + ppPoolDefaults[ ATTR_CTL_FONT_LANGUAGE-ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW), ATTR_CTL_FONT_LANGUAGE ); ppPoolDefaults[ ATTR_FONT_EMPHASISMARK-ATTR_STARTINDEX ] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, ATTR_FONT_EMPHASISMARK ); - ppPoolDefaults[ ATTR_USERDEF - ATTR_STARTINDEX ] = new SvXMLAttrContainerItem( ATTR_USERDEF ); + ppPoolDefaults[ ATTR_USERDEF - ATTR_STARTINDEX ] = new SvXMLAttrContainerItem( ATTR_USERDEF ); ppPoolDefaults[ ATTR_FONT_WORDLINE - ATTR_STARTINDEX ] = new SvxWordLineModeItem(sal_False, ATTR_FONT_WORDLINE ); ppPoolDefaults[ ATTR_FONT_RELIEF - ATTR_STARTINDEX ] = new SvxCharReliefItem( RELIEF_NONE, ATTR_FONT_RELIEF ); - ppPoolDefaults[ ATTR_HYPHENATE - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HYPHENATE ); + ppPoolDefaults[ ATTR_HYPHENATE - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HYPHENATE ); ppPoolDefaults[ ATTR_SCRIPTSPACE - ATTR_STARTINDEX ] = new SvxScriptSpaceItem( sal_False, ATTR_SCRIPTSPACE); ppPoolDefaults[ ATTR_HANGPUNCTUATION - ATTR_STARTINDEX ] = new SvxHangingPunctuationItem( sal_False, ATTR_HANGPUNCTUATION); ppPoolDefaults[ ATTR_FORBIDDEN_RULES - ATTR_STARTINDEX ] = new SvxForbiddenRuleItem( sal_False, ATTR_FORBIDDEN_RULES); ppPoolDefaults[ ATTR_HOR_JUSTIFY - ATTR_STARTINDEX ] = new SvxHorJustifyItem( SVX_HOR_JUSTIFY_STANDARD, ATTR_HOR_JUSTIFY); - ppPoolDefaults[ ATTR_INDENT - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_INDENT, 0 ); + ppPoolDefaults[ ATTR_INDENT - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_INDENT, 0 ); ppPoolDefaults[ ATTR_VER_JUSTIFY - ATTR_STARTINDEX ] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY); ppPoolDefaults[ ATTR_STACKED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_STACKED, FALSE ); - ppPoolDefaults[ ATTR_ROTATE_VALUE - ATTR_STARTINDEX ] = new SfxInt32Item( ATTR_ROTATE_VALUE, 0 ); - ppPoolDefaults[ ATTR_ROTATE_MODE - ATTR_STARTINDEX ] = new SvxRotateModeItem( SVX_ROTATE_MODE_BOTTOM, ATTR_ROTATE_MODE ); - ppPoolDefaults[ ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_VERTICAL_ASIAN ); - // The default for the ATTR_WRITINGDIR cell attribute must by FRMDIR_ENVIRONMENT, - // so that value is returned when asking for a default cell's attributes. - // The value from the page style is set as DefaultHorizontalTextDirection for the EditEngine. - ppPoolDefaults[ ATTR_WRITINGDIR - ATTR_STARTINDEX ] = new SvxFrameDirectionItem( FRMDIR_ENVIRONMENT, ATTR_WRITINGDIR ); - ppPoolDefaults[ ATTR_LINEBREAK - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_LINEBREAK ); + ppPoolDefaults[ ATTR_ROTATE_VALUE - ATTR_STARTINDEX ] = new SfxInt32Item( ATTR_ROTATE_VALUE, 0 ); + ppPoolDefaults[ ATTR_ROTATE_MODE - ATTR_STARTINDEX ] = new SvxRotateModeItem( SVX_ROTATE_MODE_BOTTOM, ATTR_ROTATE_MODE ); + ppPoolDefaults[ ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_VERTICAL_ASIAN ); + // The default for the ATTR_WRITINGDIR cell attribute must by FRMDIR_ENVIRONMENT, + // so that value is returned when asking for a default cell's attributes. + // The value from the page style is set as DefaultHorizontalTextDirection for the EditEngine. + ppPoolDefaults[ ATTR_WRITINGDIR - ATTR_STARTINDEX ] = new SvxFrameDirectionItem( FRMDIR_ENVIRONMENT, ATTR_WRITINGDIR ); + ppPoolDefaults[ ATTR_LINEBREAK - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_LINEBREAK ); ppPoolDefaults[ ATTR_SHRINKTOFIT - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_SHRINKTOFIT ); ppPoolDefaults[ ATTR_BORDER_TLBR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_TLBR ); ppPoolDefaults[ ATTR_BORDER_BLTR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_BLTR ); ppPoolDefaults[ ATTR_MARGIN - ATTR_STARTINDEX ] = new SvxMarginItem( ATTR_MARGIN ); - ppPoolDefaults[ ATTR_MERGE - ATTR_STARTINDEX ] = new ScMergeAttr; - ppPoolDefaults[ ATTR_MERGE_FLAG - ATTR_STARTINDEX ] = new ScMergeFlagAttr; - ppPoolDefaults[ ATTR_VALUE_FORMAT - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALUE_FORMAT, 0 ); - ppPoolDefaults[ ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX ] = new SvxLanguageItem( ScGlobal::eLnge, ATTR_LANGUAGE_FORMAT ); - ppPoolDefaults[ ATTR_BACKGROUND - ATTR_STARTINDEX ] = new SvxBrushItem( Color(COL_TRANSPARENT), ATTR_BACKGROUND ); - ppPoolDefaults[ ATTR_PROTECTION - ATTR_STARTINDEX ] = new ScProtectionAttr; - ppPoolDefaults[ ATTR_BORDER - ATTR_STARTINDEX ] = new SvxBoxItem( ATTR_BORDER ); - ppPoolDefaults[ ATTR_BORDER_INNER - ATTR_STARTINDEX ] = pGlobalBorderInnerAttr; - ppPoolDefaults[ ATTR_SHADOW - ATTR_STARTINDEX ] = new SvxShadowItem( ATTR_SHADOW ); - ppPoolDefaults[ ATTR_VALIDDATA - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALIDDATA, 0 ); - ppPoolDefaults[ ATTR_CONDITIONAL - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_CONDITIONAL, 0 ); - - // 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 + ppPoolDefaults[ ATTR_MERGE - ATTR_STARTINDEX ] = new ScMergeAttr; + ppPoolDefaults[ ATTR_MERGE_FLAG - ATTR_STARTINDEX ] = new ScMergeFlagAttr; + ppPoolDefaults[ ATTR_VALUE_FORMAT - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALUE_FORMAT, 0 ); + ppPoolDefaults[ ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX ] = new SvxLanguageItem( ScGlobal::eLnge, ATTR_LANGUAGE_FORMAT ); + ppPoolDefaults[ ATTR_BACKGROUND - ATTR_STARTINDEX ] = new SvxBrushItem( Color(COL_TRANSPARENT), ATTR_BACKGROUND ); + ppPoolDefaults[ ATTR_PROTECTION - ATTR_STARTINDEX ] = new ScProtectionAttr; + ppPoolDefaults[ ATTR_BORDER - ATTR_STARTINDEX ] = new SvxBoxItem( ATTR_BORDER ); + ppPoolDefaults[ ATTR_BORDER_INNER - ATTR_STARTINDEX ] = pGlobalBorderInnerAttr; + ppPoolDefaults[ ATTR_SHADOW - ATTR_STARTINDEX ] = new SvxShadowItem( ATTR_SHADOW ); + ppPoolDefaults[ ATTR_VALIDDATA - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALIDDATA, 0 ); + ppPoolDefaults[ ATTR_CONDITIONAL - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_CONDITIONAL, 0 ); + + // 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 if ( ScGlobal::GetEmptyBrushItem() ) - ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ] = new ScPatternAttr( pSet, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); + ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ] = new ScPatternAttr( pSet, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); else - ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ] = new ScPatternAttr( pSet, - String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(STRING_STANDARD)) ); //! without name? - - ppPoolDefaults[ ATTR_LRSPACE - ATTR_STARTINDEX ] = new SvxLRSpaceItem( ATTR_LRSPACE ); - ppPoolDefaults[ ATTR_ULSPACE - ATTR_STARTINDEX ] = new SvxULSpaceItem( ATTR_ULSPACE ); - ppPoolDefaults[ ATTR_PAGE - ATTR_STARTINDEX ] = new SvxPageItem( ATTR_PAGE ); - ppPoolDefaults[ ATTR_PAGE_PAPERTRAY - ATTR_STARTINDEX ] = new SfxAllEnumItem( ATTR_PAGE_PAPERTRAY ); - ppPoolDefaults[ ATTR_PAGE_PAPERBIN - ATTR_STARTINDEX ] = new SvxPaperBinItem( ATTR_PAGE_PAPERBIN ); - ppPoolDefaults[ ATTR_PAGE_SIZE - ATTR_STARTINDEX ] = new SvxSizeItem( ATTR_PAGE_SIZE ); - ppPoolDefaults[ ATTR_PAGE_MAXSIZE - ATTR_STARTINDEX ] = new SvxSizeItem( ATTR_PAGE_MAXSIZE ); - ppPoolDefaults[ ATTR_PAGE_HORCENTER - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HORCENTER ); - ppPoolDefaults[ ATTR_PAGE_VERCENTER - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_VERCENTER ); - ppPoolDefaults[ ATTR_PAGE_ON - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_ON, TRUE ); - ppPoolDefaults[ ATTR_PAGE_DYNAMIC - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_DYNAMIC, TRUE ); - ppPoolDefaults[ ATTR_PAGE_SHARED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_SHARED, TRUE ); - ppPoolDefaults[ ATTR_PAGE_NOTES - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NOTES, FALSE ); - ppPoolDefaults[ ATTR_PAGE_GRID - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_GRID, FALSE ); - ppPoolDefaults[ ATTR_PAGE_HEADERS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HEADERS, FALSE ); - ppPoolDefaults[ ATTR_PAGE_CHARTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_CHARTS ); - ppPoolDefaults[ ATTR_PAGE_OBJECTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_OBJECTS ); - ppPoolDefaults[ ATTR_PAGE_DRAWINGS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_DRAWINGS ); - ppPoolDefaults[ ATTR_PAGE_TOPDOWN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_TOPDOWN, TRUE ); - ppPoolDefaults[ ATTR_PAGE_SCALE - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_SCALE, 100 ); - ppPoolDefaults[ ATTR_PAGE_SCALETOPAGES-ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_SCALETOPAGES, 1 ); - ppPoolDefaults[ ATTR_PAGE_FIRSTPAGENO- ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_FIRSTPAGENO, 1 ); - ppPoolDefaults[ ATTR_PAGE_PRINTAREA - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_PRINTAREA ); - ppPoolDefaults[ ATTR_PAGE_REPEATROW - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_REPEATROW ); - ppPoolDefaults[ ATTR_PAGE_REPEATCOL - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_REPEATCOL ); - ppPoolDefaults[ ATTR_PAGE_PRINTTABLES- ATTR_STARTINDEX ] = new ScTableListItem( ATTR_PAGE_PRINTTABLES ); - ppPoolDefaults[ ATTR_PAGE_HEADERLEFT - ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_HEADERLEFT ); - ppPoolDefaults[ ATTR_PAGE_FOOTERLEFT - ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_FOOTERLEFT ); - ppPoolDefaults[ ATTR_PAGE_HEADERRIGHT- ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_HEADERRIGHT ); - ppPoolDefaults[ ATTR_PAGE_FOOTERRIGHT- ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_FOOTERRIGHT ); - ppPoolDefaults[ ATTR_PAGE_HEADERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_HEADERSET, aSetItemItemSet ); - ppPoolDefaults[ ATTR_PAGE_FOOTERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_FOOTERSET, aSetItemItemSet ); - ppPoolDefaults[ ATTR_PAGE_FORMULAS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_FORMULAS, FALSE ); - ppPoolDefaults[ ATTR_PAGE_NULLVALS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NULLVALS, TRUE ); + ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ] = new ScPatternAttr( pSet, + String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(STRING_STANDARD)) ); //! without name? + + ppPoolDefaults[ ATTR_LRSPACE - ATTR_STARTINDEX ] = new SvxLRSpaceItem( ATTR_LRSPACE ); + ppPoolDefaults[ ATTR_ULSPACE - ATTR_STARTINDEX ] = new SvxULSpaceItem( ATTR_ULSPACE ); + ppPoolDefaults[ ATTR_PAGE - ATTR_STARTINDEX ] = new SvxPageItem( ATTR_PAGE ); + ppPoolDefaults[ ATTR_PAGE_PAPERTRAY - ATTR_STARTINDEX ] = new SfxAllEnumItem( ATTR_PAGE_PAPERTRAY ); + ppPoolDefaults[ ATTR_PAGE_PAPERBIN - ATTR_STARTINDEX ] = new SvxPaperBinItem( ATTR_PAGE_PAPERBIN ); + ppPoolDefaults[ ATTR_PAGE_SIZE - ATTR_STARTINDEX ] = new SvxSizeItem( ATTR_PAGE_SIZE ); + ppPoolDefaults[ ATTR_PAGE_MAXSIZE - ATTR_STARTINDEX ] = new SvxSizeItem( ATTR_PAGE_MAXSIZE ); + ppPoolDefaults[ ATTR_PAGE_HORCENTER - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HORCENTER ); + ppPoolDefaults[ ATTR_PAGE_VERCENTER - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_VERCENTER ); + ppPoolDefaults[ ATTR_PAGE_ON - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_ON, TRUE ); + ppPoolDefaults[ ATTR_PAGE_DYNAMIC - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_DYNAMIC, TRUE ); + ppPoolDefaults[ ATTR_PAGE_SHARED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_SHARED, TRUE ); + ppPoolDefaults[ ATTR_PAGE_NOTES - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NOTES, FALSE ); + ppPoolDefaults[ ATTR_PAGE_GRID - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_GRID, FALSE ); + ppPoolDefaults[ ATTR_PAGE_HEADERS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HEADERS, FALSE ); + ppPoolDefaults[ ATTR_PAGE_CHARTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_CHARTS ); + ppPoolDefaults[ ATTR_PAGE_OBJECTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_OBJECTS ); + ppPoolDefaults[ ATTR_PAGE_DRAWINGS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_DRAWINGS ); + ppPoolDefaults[ ATTR_PAGE_TOPDOWN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_TOPDOWN, TRUE ); + ppPoolDefaults[ ATTR_PAGE_SCALE - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_SCALE, 100 ); + ppPoolDefaults[ ATTR_PAGE_SCALETOPAGES-ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_SCALETOPAGES, 1 ); + ppPoolDefaults[ ATTR_PAGE_FIRSTPAGENO- ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_FIRSTPAGENO, 1 ); + ppPoolDefaults[ ATTR_PAGE_PRINTAREA - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_PRINTAREA ); + ppPoolDefaults[ ATTR_PAGE_REPEATROW - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_REPEATROW ); + ppPoolDefaults[ ATTR_PAGE_REPEATCOL - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_REPEATCOL ); + ppPoolDefaults[ ATTR_PAGE_PRINTTABLES- ATTR_STARTINDEX ] = new ScTableListItem( ATTR_PAGE_PRINTTABLES ); + ppPoolDefaults[ ATTR_PAGE_HEADERLEFT - ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_HEADERLEFT ); + ppPoolDefaults[ ATTR_PAGE_FOOTERLEFT - ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_FOOTERLEFT ); + ppPoolDefaults[ ATTR_PAGE_HEADERRIGHT- ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_HEADERRIGHT ); + ppPoolDefaults[ ATTR_PAGE_FOOTERRIGHT- ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_FOOTERRIGHT ); + ppPoolDefaults[ ATTR_PAGE_HEADERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_HEADERSET, aSetItemItemSet ); + ppPoolDefaults[ ATTR_PAGE_FOOTERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_FOOTERSET, aSetItemItemSet ); + ppPoolDefaults[ ATTR_PAGE_FORMULAS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_FORMULAS, FALSE ); + ppPoolDefaults[ ATTR_PAGE_NULLVALS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NULLVALS, TRUE ); ppPoolDefaults[ ATTR_PAGE_SCALETO - ATTR_STARTINDEX ] = new ScPageScaleToItem( 1, 1 ); -// ppPoolDefaults[ ATTR_ITEM_DOUBLE - ATTR_STARTINDEX ] = new ScDoubleItem( ATTR_ITEM_DOUBLE, 0 ); +// ppPoolDefaults[ ATTR_ITEM_DOUBLE - ATTR_STARTINDEX ] = new ScDoubleItem( ATTR_ITEM_DOUBLE, 0 ); SetDefaults( ppPoolDefaults ); @@ -401,12 +401,12 @@ void ScDocumentPool::InitVersionMaps() // alte WhichId's mappen // nicht mit ATTR_* zaehlen, falls die sich nochmal aendern - // erste Map: ATTR_LANGUAGE_FORMAT ab sv329 eingefuegt + // erste Map: ATTR_LANGUAGE_FORMAT ab sv329 eingefuegt - const USHORT nMap1Start = 100; // alter ATTR_STARTINDEX - const USHORT nMap1End = 157; // alter ATTR_ENDINDEX + const USHORT nMap1Start = 100; // alter ATTR_STARTINDEX + const USHORT nMap1End = 157; // alter ATTR_ENDINDEX const USHORT nMap1Count = nMap1End - nMap1Start + 1; - const USHORT nMap1New = 18; // ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX + const USHORT nMap1New = 18; // ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX pVersionMap1 = new USHORT [ nMap1Count ]; USHORT i, j; for ( i=0, j=nMap1Start; i < nMap1New; i++, j++ ) @@ -415,12 +415,12 @@ void ScDocumentPool::InitVersionMaps() for ( i=nMap1New, j=nMap1Start+nMap1New+1; i < nMap1Count; i++, j++ ) pVersionMap1[i] = j; - // zweite Map: ATTR_VALIDDATA und ATTR_CONDITIONAL ab 341 eingefuegt + // zweite Map: ATTR_VALIDDATA und ATTR_CONDITIONAL ab 341 eingefuegt - const USHORT nMap2Start = 100; // ATTR_STARTINDEX - const USHORT nMap2End = 158; // ATTR_ENDINDEX + const USHORT nMap2Start = 100; // ATTR_STARTINDEX + const USHORT nMap2End = 158; // ATTR_ENDINDEX const USHORT nMap2Count = nMap2End - nMap2Start + 1; - const USHORT nMap2New = 24; // ATTR_VALIDDATA - ATTR_STARTINDEX + const USHORT nMap2New = 24; // ATTR_VALIDDATA - ATTR_STARTINDEX pVersionMap2 = new USHORT [ nMap2Count ]; for ( i=0, j=nMap2Start; i < nMap2New; i++, j++ ) pVersionMap2[i] = j; @@ -428,12 +428,12 @@ void ScDocumentPool::InitVersionMaps() for ( i=nMap2New, j=nMap2Start+nMap2New+2; i < nMap2Count; i++, j++ ) pVersionMap2[i] = j; - // dritte Map: ATTR_INDENT ab 350 eingefuegt + // dritte Map: ATTR_INDENT ab 350 eingefuegt - const USHORT nMap3Start = 100; // ATTR_STARTINDEX - const USHORT nMap3End = 160; // ATTR_ENDINDEX + const USHORT nMap3Start = 100; // ATTR_STARTINDEX + const USHORT nMap3End = 160; // ATTR_ENDINDEX const USHORT nMap3Count = nMap3End - nMap3Start + 1; - const USHORT nMap3New = 11; // ATTR_INDENT - ATTR_STARTINDEX + const USHORT nMap3New = 11; // ATTR_INDENT - ATTR_STARTINDEX pVersionMap3 = new USHORT [ nMap3Count ]; for ( i=0, j=nMap3Start; i < nMap3New; i++, j++ ) pVersionMap3[i] = j; @@ -441,12 +441,12 @@ void ScDocumentPool::InitVersionMaps() 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 + // vierte Map: ATTR_ROTATE_VALUE und ATTR_ROTATE_MODE ab 367 eingefuegt - const USHORT nMap4Start = 100; // ATTR_STARTINDEX - const USHORT nMap4End = 161; // ATTR_ENDINDEX + const USHORT nMap4Start = 100; // ATTR_STARTINDEX + const USHORT nMap4End = 161; // ATTR_ENDINDEX const USHORT nMap4Count = nMap4End - nMap4Start + 1; - const USHORT nMap4New = 14; // ATTR_ROTATE_VALUE - ATTR_STARTINDEX + const USHORT nMap4New = 14; // ATTR_ROTATE_VALUE - ATTR_STARTINDEX pVersionMap4 = new USHORT [ nMap4Count ]; for ( i=0, j=nMap4Start; i < nMap4New; i++, j++ ) pVersionMap4[i] = j; @@ -454,12 +454,12 @@ void ScDocumentPool::InitVersionMaps() 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 USHORT nMap5Start = 100; // ATTR_STARTINDEX - const USHORT nMap5End = 163; // ATTR_ENDINDEX + const USHORT nMap5Start = 100; // ATTR_STARTINDEX + const USHORT nMap5End = 163; // ATTR_ENDINDEX const USHORT nMap5Count = nMap5End - nMap5Start + 1; - const USHORT nMap5New = 10; // ATTR_CJK_FONT - ATTR_STARTINDEX + const USHORT nMap5New = 10; // ATTR_CJK_FONT - ATTR_STARTINDEX pVersionMap5 = new USHORT [ nMap5Count ]; for ( i=0, j=nMap5Start; i < nMap5New; i++, j++ ) pVersionMap5[i] = j; @@ -469,10 +469,10 @@ void ScDocumentPool::InitVersionMaps() // sixth map: ATTR_SCRIPTSPACE, ATTR_HANGPUNCTUATION, ATTR_FORBIDDEN_RULES added in 614d - const USHORT nMap6Start = 100; // ATTR_STARTINDEX - const USHORT nMap6End = 175; // ATTR_ENDINDEX + const USHORT nMap6Start = 100; // ATTR_STARTINDEX + const USHORT nMap6End = 175; // ATTR_ENDINDEX const USHORT nMap6Count = nMap6End - nMap6Start + 1; - const USHORT nMap6New = 22; // ATTR_SCRIPTSPACE - ATTR_STARTINDEX + const USHORT nMap6New = 22; // ATTR_SCRIPTSPACE - ATTR_STARTINDEX pVersionMap6 = new USHORT [ nMap6Count ]; for ( i=0, j=nMap6Start; i < nMap6New; i++, j++ ) pVersionMap6[i] = j; @@ -480,12 +480,12 @@ 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 USHORT nMap7Start = 100; // ATTR_STARTINDEX - const USHORT nMap7End = 178; // ATTR_ENDINDEX + const USHORT nMap7Start = 100; // ATTR_STARTINDEX + const USHORT nMap7End = 178; // ATTR_ENDINDEX const USHORT nMap7Count = nMap7End - nMap7Start + 1; - const USHORT nMap7New = 22; // ATTR_FONT_WORDLINE - ATTR_STARTINDEX + const USHORT nMap7New = 22; // ATTR_FONT_WORDLINE - ATTR_STARTINDEX pVersionMap7 = new USHORT [ nMap7Count ]; for ( i=0, j=nMap7Start; i < nMap7New; i++, j++ ) pVersionMap7[i] = j; @@ -493,12 +493,12 @@ 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 USHORT nMap8Start = 100; // ATTR_STARTINDEX - const USHORT nMap8End = 181; // ATTR_ENDINDEX + const USHORT nMap8Start = 100; // ATTR_STARTINDEX + const USHORT nMap8End = 181; // ATTR_ENDINDEX const USHORT nMap8Count = nMap8End - nMap8Start + 1; - const USHORT nMap8New = 34; // ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX + const USHORT nMap8New = 34; // ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX pVersionMap8 = new USHORT [ nMap8Count ]; for ( i=0, j=nMap8Start; i < nMap8New; i++, j++ ) pVersionMap8[i] = j; @@ -506,12 +506,12 @@ 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 USHORT nMap9Start = 100; // ATTR_STARTINDEX - const USHORT nMap9End = 182; // ATTR_ENDINDEX + const USHORT nMap9Start = 100; // ATTR_STARTINDEX + const USHORT nMap9End = 182; // ATTR_ENDINDEX const USHORT nMap9Count = nMap9End - nMap9Start + 1; - const USHORT nMap9New = 35; // ATTR_WRITINGDIR - ATTR_STARTINDEX + const USHORT nMap9New = 35; // ATTR_WRITINGDIR - ATTR_STARTINDEX pVersionMap9 = new USHORT [ nMap9Count ]; for ( i=0, j=nMap9Start; i < nMap9New; i++, j++ ) pVersionMap9[i] = j; @@ -583,25 +583,25 @@ void ScDocumentPool::DeleteVersionMaps() // ---------------------------------------------------------------------------------------- // -// Fuer die Pattern-Attribute (SetItems) kann der USHORT 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). +// Fuer die Pattern-Attribute (SetItems) kann der USHORT 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). // const SfxPoolItem& __EXPORT ScDocumentPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) { - if ( rItem.Which() != ATTR_PATTERN ) // nur Pattern ist special + if ( rItem.Which() != ATTR_PATTERN ) // nur Pattern ist special return SfxItemPool::Put( rItem, nWhich ); - // das Default-Pattern dieses Pools nicht kopieren + // das Default-Pattern dieses Pools nicht kopieren if (&rItem == ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ]) return rItem; - // ansonsten muss Put immer passieren, weil es ein anderer Pool sein kann + // ansonsten muss Put immer passieren, weil es ein anderer Pool sein kann const SfxPoolItem& rNew = SfxItemPool::Put( rItem, nWhich ); CheckRef( rNew ); return rNew; @@ -609,7 +609,7 @@ const SfxPoolItem& __EXPORT ScDocumentPool::Put( const SfxPoolItem& rItem, USHOR void __EXPORT ScDocumentPool::Remove( const SfxPoolItem& rItem ) { - if ( rItem.Which() == ATTR_PATTERN ) // nur Pattern ist special + if ( rItem.Which() == ATTR_PATTERN ) // nur Pattern ist special { ULONG nRef = rItem.GetRefCount(); if ( nRef >= (ULONG) SC_MAX_POOLREF && nRef <= (ULONG) SFX_ITEMS_OLD_MAXREF ) @@ -619,13 +619,13 @@ void __EXPORT ScDocumentPool::Remove( const SfxPoolItem& rItem ) DBG_ERROR("Wer fummelt da an meinen Ref-Counts herum"); SetRefCount( (SfxPoolItem&)rItem, (ULONG) SC_SAFE_POOLREF ); } - return; // nicht herunterzaehlen + return; // nicht herunterzaehlen } } SfxItemPool::Remove( rItem ); } -void ScDocumentPool::CheckRef( const SfxPoolItem& rItem ) // static +void ScDocumentPool::CheckRef( const SfxPoolItem& rItem ) // static { ULONG nRef = rItem.GetRefCount(); if ( nRef >= (ULONG) SC_MAX_POOLREF && nRef <= (ULONG) SFX_ITEMS_OLD_MAXREF ) @@ -678,11 +678,11 @@ SfxItemPool* __EXPORT ScDocumentPool::Clone() const SfxItemPresentation lcl_HFPresentation ( - const SfxPoolItem& rItem, + const SfxPoolItem& rItem, SfxItemPresentation ePresentation, - SfxMapUnit eCoreMetric, - SfxMapUnit ePresentationMetric, - String& rText, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresentationMetric, + String& rText, const IntlWrapper* pIntl ) { @@ -695,10 +695,10 @@ SfxItemPresentation lcl_HFPresentation return SFX_ITEM_PRESENTATION_NONE; } - SfxItemIter aIter( rSet ); + SfxItemIter aIter( rSet ); pItem = aIter.FirstItem(); - String aText; - String aDel = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( " + " )); + String aText; + String aDel = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( " + " )); while( pItem ) { @@ -780,15 +780,15 @@ SfxItemPresentation lcl_HFPresentation } SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( - const SfxPoolItem& rItem, + const SfxPoolItem& rItem, SfxItemPresentation ePresentation, - SfxMapUnit ePresentationMetric, - String& rText, + SfxMapUnit ePresentationMetric, + String& rText, const IntlWrapper* pIntl ) const { - USHORT nW = rItem.Which(); - String aStrYes ( ScGlobal::GetRscString(STR_YES) ); - String aStrNo ( ScGlobal::GetRscString(STR_NO) ); + USHORT nW = rItem.Which(); + String aStrYes ( ScGlobal::GetRscString(STR_YES) ); + String aStrNo ( ScGlobal::GetRscString(STR_NO) ); String aStrSep = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(": ")); switch( nW ) @@ -799,7 +799,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case SFX_ITEM_PRESENTATION_COMPLETE: rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_PRINTDIR); rText += aStrSep; -// break; // DURCHFALLEN!!! +// break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? ScGlobal::GetRscString(STR_SCATTR_PAGE_TOPDOWN) : @@ -818,7 +818,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case SFX_ITEM_PRESENTATION_COMPLETE: rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_HEADERS); rText += aStrSep; -// break; // DURCHFALLEN!!! +// break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ; break; @@ -835,7 +835,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case SFX_ITEM_PRESENTATION_COMPLETE: rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_NULLVALS); rText += aStrSep; -// break; // DURCHFALLEN!!! +// break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ; break; @@ -852,7 +852,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case SFX_ITEM_PRESENTATION_COMPLETE: rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_FORMULAS); rText += aStrSep; -// break; // DURCHFALLEN!!! +// break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ; break; @@ -869,7 +869,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case SFX_ITEM_PRESENTATION_COMPLETE: rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_NOTES); rText += aStrSep; -// break; // DURCHFALLEN!!! +// break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ; break; @@ -886,7 +886,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case SFX_ITEM_PRESENTATION_COMPLETE: rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_GRID); rText += aStrSep; -// break; // DURCHFALLEN!!! +// break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ; break; @@ -899,7 +899,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case ATTR_PAGE_SCALETOPAGES: { - USHORT nPagNo = ((const SfxUInt16Item&)rItem).GetValue(); + USHORT nPagNo = ((const SfxUInt16Item&)rItem).GetValue(); if( nPagNo ) { @@ -909,7 +909,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( { rText.Assign( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALETOPAGES ) ).Append( aStrSep ); } -// break; // DURCHFALLEN!!! +// break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: { String aPages( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_PAGES ) ); @@ -932,7 +932,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case ATTR_PAGE_FIRSTPAGENO: { - USHORT nPagNo = ((const SfxUInt16Item&)rItem).GetValue(); + USHORT nPagNo = ((const SfxUInt16Item&)rItem).GetValue(); if( nPagNo ) { @@ -941,7 +941,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case SFX_ITEM_PRESENTATION_COMPLETE: rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_FIRSTPAGENO); rText += aStrSep; -// break; // DURCHFALLEN!!! +// break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += String::CreateFromInt32( nPagNo ); break; @@ -960,7 +960,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case ATTR_PAGE_SCALE: { - USHORT nPercent = ((const SfxUInt16Item&)rItem).GetValue(); + USHORT nPercent = ((const SfxUInt16Item&)rItem).GetValue(); if( nPercent ) { @@ -969,7 +969,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case SFX_ITEM_PRESENTATION_COMPLETE: rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_SCALE); rText += aStrSep; -// break; // DURCHFALLEN!!! +// break; // DURCHFALLEN!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += String::CreateFromInt32( nPercent ); rText += '%'; @@ -989,9 +989,9 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case ATTR_PAGE_HEADERSET: { - String aBuffer; + String aBuffer; - if( lcl_HFPresentation( rItem, ePresentation, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) != SFX_ITEM_PRESENTATION_NONE ) + if( lcl_HFPresentation( rItem, ePresentation, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) != SFX_ITEM_PRESENTATION_NONE ) { rText = ScGlobal::GetRscString(STR_HEADER); rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ( " )); @@ -1003,9 +1003,9 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( case ATTR_PAGE_FOOTERSET: { - String aBuffer; + String aBuffer; - if( lcl_HFPresentation( rItem, ePresentation, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) != SFX_ITEM_PRESENTATION_NONE ) + if( lcl_HFPresentation( rItem, ePresentation, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) != SFX_ITEM_PRESENTATION_NONE ) { rText = ScGlobal::GetRscString(STR_FOOTER); rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ( " )); @@ -1045,7 +1045,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation( SfxMapUnit __EXPORT ScDocumentPool::GetMetric( USHORT nWhich ) const { - // eigene Attribute: Twips, alles andere 1/100 mm + // eigene Attribute: Twips, alles andere 1/100 mm if ( nWhich >= ATTR_STARTINDEX && nWhich <= ATTR_ENDINDEX ) return SFX_MAPUNIT_TWIP; diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index d2c99c75a95e..1c1cf3983083 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -1,7 +1,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 @@ -77,7 +77,7 @@ #include "validat.hxx" #include "progress.hxx" #include "detdata.hxx" -#include "sc.hrc" // FID_DATACHANGED +#include "sc.hrc" // FID_DATACHANGED #include "ddelink.hxx" #include "chgtrack.hxx" #include "chgviset.hxx" @@ -123,7 +123,7 @@ private: // STATIC DATA ----------------------------------------------------------- -ScDocument::ScDocument( ScDocumentMode eMode, +ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : xServiceManager( ::comphelper::getProcessServiceFactory() ), mpUndoManager( NULL ), @@ -187,7 +187,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, bIsUndo( eMode == SCDOCMODE_UNDO ), bIsVisible( FALSE ), bIsEmbedded( FALSE ), -// bNoSetDirty( TRUE ), +// bNoSetDirty( TRUE ), bNoSetDirty( FALSE ), bInsertingFromOtherDoc( FALSE ), bLoadingMedium( false ), @@ -239,8 +239,8 @@ ScDocument::ScDocument( ScDocumentMode eMode, } else { - pTab[0] = NULL; - pBASM = NULL; + pTab[0] = NULL; + pBASM = NULL; pChartListenerCollection = NULL; pRefreshTimerControl = NULL; } @@ -263,13 +263,13 @@ ScDocument::ScDocument( ScDocumentMode eMode, aTrackTimer.SetTimeout( 100 ); } -sfx2::LinkManager* ScDocument::GetLinkManager() const -{ +sfx2::LinkManager* ScDocument::GetLinkManager() const +{ if ( bAutoCalc && !pLinkManager && pShell) { pLinkManager = new sfx2::LinkManager( pShell ); } - return pLinkManager; + return pLinkManager; } @@ -293,8 +293,8 @@ void ScDocument::SetStorageGrammar( formula::FormulaGrammar::Grammar eGram ) void ScDocument::SetDocVisible( BOOL bSet ) { - // called from view ctor - only for a visible document, - // each new sheet's RTL flag is initialized from the locale + // called from view ctor - only for a visible document, + // each new sheet's RTL flag is initialized from the locale bIsVisible = bSet; } @@ -333,17 +333,17 @@ void ScDocument::SetChangeTrack( ScChangeTrack* pTrack ) IMPL_LINK( ScDocument, TrackTimeHdl, Timer*, EMPTYARG ) { - if ( ScDdeLink::IsInUpdate() ) // nicht verschachteln + if ( ScDdeLink::IsInUpdate() ) // nicht verschachteln { - aTrackTimer.Start(); // spaeter nochmal versuchen + aTrackTimer.Start(); // spaeter nochmal versuchen } - else if (pShell) // ausfuehren + else if (pShell) // ausfuehren { TrackFormulas(); pShell->Broadcast( SfxSimpleHint( FID_DATACHANGED ) ); ResetChanged( ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB) ); - // modified... + // modified... if (!pShell->IsModified()) { @@ -362,7 +362,7 @@ IMPL_LINK( ScDocument, TrackTimeHdl, Timer*, EMPTYARG ) void ScDocument::StartTrackTimer() { - if (!aTrackTimer.IsActive()) // nicht ewig aufschieben + if (!aTrackTimer.IsActive()) // nicht ewig aufschieben aTrackTimer.Start(); } @@ -374,7 +374,7 @@ ScDocument::~ScDocument() // first of all disable all refresh timers by deleting the control if ( pRefreshTimerControl ) - { // To be sure there isn't anything running do it with a protector, + { // To be sure there isn't anything running do it with a protector, // this ensures also that nothing needs the control anymore. ScRefreshTimerProtector aProt( GetRefreshTimerControlAddress() ); delete pRefreshTimerControl, pRefreshTimerControl = NULL; @@ -403,12 +403,12 @@ ScDocument::~ScDocument() DELETEZ( pLookupCacheMapImpl); // before pBASM because of listeners // BroadcastAreas vor allen Zellen zerstoeren um unnoetige // Einzel-EndListenings der Formelzellen zu vermeiden - delete pBASM; // BroadcastAreaSlotMachine + delete pBASM; // BroadcastAreaSlotMachine pBASM = NULL; if (pUnoBroadcaster) { - delete pUnoBroadcaster; // broadcasted nochmal SFX_HINT_DYING + delete pUnoBroadcaster; // broadcasted nochmal SFX_HINT_DYING pUnoBroadcaster = NULL; } @@ -439,12 +439,12 @@ ScDocument::~ScDocument() delete pConsolidateDlgData; delete pLinkManager; delete pClipData; - delete pDetOpList; // loescht auch die Eintraege + delete pDetOpList; // loescht auch die Eintraege delete pChangeTrack; delete pEditEngine; delete pNoteEngine; SfxItemPool::Free(pNoteItemPool); - delete pChangeViewSettings; // und weg damit + delete pChangeViewSettings; // und weg damit delete pVirtualDevice_100th_mm; delete pDPCollection; @@ -483,8 +483,8 @@ void ScDocument::InitClipPtrs( ScDocument* pSourceDoc ) xPoolHelper = pSourceDoc->xPoolHelper; - // bedingte Formate / Gueltigkeiten - //! Vorlagen kopieren? + // bedingte Formate / Gueltigkeiten + //! Vorlagen kopieren? const ScConditionalFormatList* pSourceCond = pSourceDoc->pCondFormList; if ( pSourceCond ) pCondFormList = new ScConditionalFormatList(this, *pSourceCond); @@ -616,7 +616,7 @@ void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, { if ( bForceTab && !pTab[nTab] ) { - BOOL bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags + BOOL bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags pTab[nTab] = new ScTable(this, nTab, String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")), @@ -635,12 +635,12 @@ void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, //UNUSED2009-05 if ( bForceTab && !pTab[nTab] ) //UNUSED2009-05 { //UNUSED2009-05 BOOL bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 pTab[nTab] = new ScTable(this, nTab, //UNUSED2009-05 String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")), //UNUSED2009-05 bExtras, bExtras); //UNUSED2009-05 } -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 if (pTab[nTab]) //UNUSED2009-05 pTab[nTab]->PutCell( rPos, nFormatIndex, pCell ); //UNUSED2009-05 } @@ -748,15 +748,15 @@ BOOL ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos ) if (nTabCount > 1) { BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden SetNoListening( TRUE ); ScProgress* pProgress = new ScProgress( GetDocumentShell(), ScGlobal::GetRscString(STR_UNDO_MOVE_TAB), GetCodeCount() ); if (nNewPos == SC_TAB_APPEND) nNewPos = nTabCount-1; - // Referenz-Updaterei - //! mit UpdateReference zusammenfassen! + // Referenz-Updaterei + //! mit UpdateReference zusammenfassen! SCsTAB nDz = ((SCsTAB)nNewPos) - (SCsTAB)nOldPos; ScRange aSourceRange( 0,0,nOldPos, MAXCOL,MAXROW,nOldPos ); @@ -790,7 +790,7 @@ BOOL ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos ) for (i = 0; i <= MAXTAB; i++) if (pTab[i]) pTab[i]->UpdateMoveTab( nOldPos, nNewPos, i, *pProgress ); - delete pProgress; // freimachen fuer evtl. andere + delete pProgress; // freimachen fuer evtl. andere for (i = 0; i <= MAXTAB; i++) if (pTab[i]) pTab[i]->UpdateCompile(); @@ -819,8 +819,8 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM String aName; GetName(nOldPos, aName); - // vorneweg testen, ob der Prefix als gueltig erkannt wird - // wenn nicht, nur doppelte vermeiden + // vorneweg testen, ob der Prefix als gueltig erkannt wird + // wenn nicht, nur doppelte vermeiden BOOL bPrefix = ValidTabName( aName ); DBG_ASSERT(bPrefix, "ungueltiger Tabellenname"); SCTAB nDummy; @@ -834,7 +834,7 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM bValid = ( !GetTable( aName, nDummy ) && (nMaxTableNumber <= MAXTAB) ); BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden if (bValid) { if (nNewPos == nMaxTableNumber) @@ -882,7 +882,7 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM if (pTab[i] && i != nOldPos && i != nNewPos) pTab[i]->StartAllListeners(); - // update conditional formats after table is inserted + // update conditional formats after table is inserted if ( pCondFormList ) pCondFormList->UpdateReference( URM_INSDEL, aRange, 0,0,1 ); if ( pValidationList ) @@ -896,16 +896,16 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM } if (bValid) { - SetNoListening( TRUE ); // noch nicht bei CopyToTable/Insert + SetNoListening( TRUE ); // noch nicht bei CopyToTable/Insert pTab[nOldPos]->CopyToTable(0, 0, MAXCOL, MAXROW, IDF_ALL, (pOnlyMarked != NULL), pTab[nNewPos], pOnlyMarked ); pTab[nNewPos]->SetTabBgColor(pTab[nOldPos]->GetTabBgColor()); SCsTAB nDz; -/* if (nNewPos < nOldPos) +/* if (nNewPos < nOldPos) nDz = ((short)nNewPos) - (short)nOldPos + 1; else -*/ nDz = ((short)nNewPos) - (short)nOldPos; +*/ nDz = ((short)nNewPos) - (short)nOldPos; pTab[nNewPos]->UpdateReference(URM_COPY, 0, 0, nNewPos , MAXCOL, MAXROW, nNewPos, 0, 0, nDz, NULL); @@ -913,7 +913,7 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM pTab[nOldPos]->UpdateInsertTab(nNewPos); pTab[nOldPos]->UpdateCompile(); - pTab[nNewPos]->UpdateCompile( TRUE ); // #67996# maybe already compiled in Clone, but used names need recompilation + pTab[nNewPos]->UpdateCompile( TRUE ); // #67996# maybe already compiled in Clone, but used names need recompilation SetNoListening( FALSE ); pTab[nOldPos]->StartAllListeners(); pTab[nNewPos]->StartAllListeners(); @@ -937,18 +937,18 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos, BOOL bInsertNew, BOOL bResultsOnly ) { - ULONG nRetVal = 1; // 0 => Fehler 1 = ok + ULONG nRetVal = 1; // 0 => Fehler 1 = ok // 2 => RefBox, 3 => NameBox // 4 => beides BOOL bValid = TRUE; - if (bInsertNew) // neu einfuegen + if (bInsertNew) // neu einfuegen { String aName; pSrcDoc->GetName(nSrcPos, aName); CreateValidTabName(aName); bValid = InsertTab(nDestPos, aName); } - else // bestehende Tabelle ersetzen + else // bestehende Tabelle ersetzen { if (VALIDTAB(nDestPos) && pTab[nDestPos]) { @@ -962,12 +962,12 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, { BOOL bOldAutoCalcSrc = FALSE; BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden SetNoListening( TRUE ); if ( bResultsOnly ) { bOldAutoCalcSrc = pSrcDoc->GetAutoCalc(); - pSrcDoc->SetAutoCalc( TRUE ); // falls was berechnet werden muss + pSrcDoc->SetAutoCalc( TRUE ); // falls was berechnet werden muss } { @@ -997,7 +997,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, std::set<USHORT> aUsedNames; pSrcDoc->pTab[nSrcPos]->FindRangeNamesInUse( 0, 0, MAXCOL, MAXROW, aUsedNames ); - for (USHORT i = 0; i < nSrcRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch !!! + for (USHORT i = 0; i < nSrcRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch !!! { ScRangeData* pSrcData = (*pSrcDoc->pRangeName)[i]; USHORT nOldIndex = pSrcData->GetIndex(); @@ -1025,7 +1025,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, ScRangeData* pData = new ScRangeData( *pSrcData ); pData->SetDocument(this); if ( pRangeName->FindIndex( pData->GetIndex() ) ) - pData->SetIndex(0); // need new index, done in Insert + pData->SetIndex(0); // need new index, done in Insert if (!pRangeName->Insert(pData)) { DBG_ERROR("can't insert name"); // shouldn't happen @@ -1046,14 +1046,14 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, else { pSrcRangeNames[i] = NULL; - //aSrcRangeMap.SetPair( i, 0, 0 ); // not needed, defaulted + //aSrcRangeMap.SetPair( i, 0, 0 ); // not needed, defaulted } } if ( bRangeNameReplace ) { // first update all inserted named formulas if they contain other // range names and used indices changed - for (USHORT i = 0; i < nSrcRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch + for (USHORT i = 0; i < nSrcRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch { if ( pSrcRangeNames[i] ) pSrcRangeNames[i]->ReplaceRangeNamesInUse( aSrcRangeMap ); @@ -1094,7 +1094,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, pSrcDoc->SetAutoCalc( bOldAutoCalcSrc ); SetAutoCalc( bOldAutoCalc ); - // Drawing kopieren + // Drawing kopieren if (bInsertNew) TransferDrawPage( pSrcDoc, nSrcPos, nDestPos ); @@ -1117,7 +1117,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, aLibName = pSrcShell->GetBasicManager()->GetName(); pStarBASIC = pSrcShell->GetBasicManager()->GetLib( aLibName ); } - + String sCodeName; String sSource; uno::Reference< script::XLibraryContainer > xLibContainer = pSrcShell->GetBasicContainer(); @@ -1135,7 +1135,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, rtl::OUString sRTLSource; xLib->getByName( sSrcCodeName ) >>= sRTLSource; sSource = sRTLSource; - } + } VBA_InsertModule( *this, nDestPos, sCodeName, sSource ); } } @@ -1143,7 +1143,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, return nRetVal; } -// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- void ScDocument::SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError) { @@ -1161,7 +1161,7 @@ void ScDocument::EraseNonUsedSharedNames(USHORT nLevel) { String aName; pRangeData->GetName(aName); - aName.Erase(0, 6); // !!! vgl. Table4, FillFormula !! + aName.Erase(0, 6); // !!! vgl. Table4, FillFormula !! USHORT nInd = (USHORT) aName.ToInt32(); if (nInd <= nLevel) { @@ -1180,7 +1180,7 @@ void ScDocument::EraseNonUsedSharedNames(USHORT nLevel) } } -// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- void ScDocument::SetConsolidateDlgData( const ScConsolidateParam* pData ) { @@ -1202,7 +1202,7 @@ void ScDocument::SetChangeViewSettings(const ScChangeViewSettings& rNew) *pChangeViewSettings=rNew; } -// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- ScFieldEditEngine* ScDocument::CreateFieldEditEngine() { @@ -1240,7 +1240,7 @@ void ScDocument::DisposeFieldEditEngine(ScFieldEditEngine*& rpEditEngine) rpEditEngine = NULL; } -// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // static ScRecursionHelper* ScDocument::CreateRecursionHelperInstance() @@ -1248,7 +1248,7 @@ ScRecursionHelper* ScDocument::CreateRecursionHelperInstance() return new ScRecursionHelper; } -// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- ScLookupCache & ScDocument::GetLookupCache( const ScRange & rRange ) { diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 8fea4b8af2b9..ef4917126f5c 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -1,7 +1,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 @@ -66,10 +66,10 @@ #include "dociter.hxx" #include "detdata.hxx" #include "detfunc.hxx" -#include "scmod.hxx" // SC_MOD -#include "inputopt.hxx" // GetExpandRefs +#include "scmod.hxx" // SC_MOD +#include "inputopt.hxx" // GetExpandRefs #include "chartlis.hxx" -#include "sc.hrc" // SID_LINK +#include "sc.hrc" // SID_LINK #include "hints.hxx" #include "dpobject.hxx" #include "unoguard.hxx" @@ -134,8 +134,8 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, BOOL bRemove { if ( bRemoveAutoFilter ) { - // remove auto filter attribute if new db data don't contain auto filter flag - // start position is also compared, so bRemoveAutoFilter must not be set from ref-undo! + // remove auto filter attribute if new db data don't contain auto filter flag + // start position is also compared, so bRemoveAutoFilter must not be set from ref-undo! if ( pDBCollection ) { @@ -270,7 +270,7 @@ BOOL ScDocument::IsScenario( SCTAB nTab ) const { return ValidTab(nTab) && pTab[nTab] &&pTab[nTab]->IsScenario(); //if (ValidTab(nTab) && pTab[nTab]) - // return pTab[nTab]->IsScenario(); + // return pTab[nTab]->IsScenario(); //return FALSE; } @@ -328,7 +328,7 @@ BOOL ScDocument::IsLinked( SCTAB nTab ) const return ValidTab(nTab) && pTab[nTab] && pTab[nTab]->IsLinked(); // euqivalent to //if (ValidTab(nTab) && pTab[nTab]) - // return pTab[nTab]->IsLinked(); + // return pTab[nTab]->IsLinked(); //return FALSE; } @@ -420,15 +420,15 @@ BOOL ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab, return FALSE; } rTab = 0; - String aFilterName; // wird vom Loader gefuellt - String aOptions; // Filter-Optionen + String aFilterName; // wird vom Loader gefuellt + String aOptions; // Filter-Optionen sal_uInt32 nLinkCnt = pExtDocOptions ? pExtDocOptions->GetDocSettings().mnLinkCnt : 0; ScDocumentLoader aLoader( aFileName, aFilterName, aOptions, nLinkCnt + 1 ); if ( aLoader.IsError() ) return FALSE; ScDocument* pSrcDoc = aLoader.GetDocument(); - // Tabelle kopieren + // Tabelle kopieren SCTAB nSrcTab; if ( pSrcDoc->GetTable( aTabName, nSrcTab ) ) { @@ -448,7 +448,7 @@ BOOL ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab, BOOL bWasThere = HasLink( aFileName, aFilterName, aOptions ); SetLink( rTab, SC_LINK_VALUE, aFileName, aFilterName, aOptions, aTabName, nRefreshDelay ); - if ( !bWasThere ) // Link pro Quelldokument nur einmal eintragen + if ( !bWasThere ) // Link pro Quelldokument nur einmal eintragen { ScTableLink* pLink = new ScTableLink( pShell, aFileName, aFilterName, aOptions, nRefreshDelay ); pLink->SetInCreate( TRUE ); @@ -588,8 +588,8 @@ BOOL ScDocument::SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline { return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->SetOutlineTable(pNewOutline); //if (VALIDTAB(nTab)) - // if (pTab[nTab]) - // return pTab[nTab]->SetOutlineTable(pNewOutline); + // if (pTab[nTab]) + // return pTab[nTab]->SetOutlineTable(pNewOutline); //return FALSE; } @@ -605,7 +605,7 @@ BOOL ScDocument::TestRemoveSubTotals( SCTAB nTab, const ScSubTotalParam& rParam { return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->TestRemoveSubTotals( rParam ); //if (VALIDTAB(nTab) && pTab[nTab] ) - // return pTab[nTab]->TestRemoveSubTotals( rParam ); + // return pTab[nTab]->TestRemoveSubTotals( rParam ); //return FALSE; } @@ -620,8 +620,8 @@ BOOL ScDocument::DoSubTotals( SCTAB nTab, ScSubTotalParam& rParam ) { return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->DoSubTotals( rParam ); //if (VALIDTAB(nTab)) - // if (pTab[nTab]) - // return pTab[nTab]->DoSubTotals( rParam ); + // if (pTab[nTab]) + // return pTab[nTab]->DoSubTotals( rParam ); //return FALSE; } @@ -637,11 +637,11 @@ BOOL ScDocument::HasSubTotalCells( const ScRange& rRange ) pCell = aIter.GetNext(); } - return FALSE; // none found + return FALSE; // none found } -// kopiert aus diesem Dokument die Zellen von Positionen, an denen in pPosDoc -// auch Zellen stehen, nach pDestDoc +// kopiert aus diesem Dokument die Zellen von Positionen, an denen in pPosDoc +// auch Zellen stehen, nach pDestDoc void ScDocument::CopyUpdated( ScDocument* pPosDoc, ScDocument* pDestDoc ) { @@ -655,18 +655,18 @@ void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, BOOL bNewScenario { if (ValidTab(nSrcTab) && ValidTab(nDestTab) && pTab[nSrcTab] && pTab[nDestTab]) { - // Flags fuer aktive Szenarios richtig setzen - // und aktuelle Werte in bisher aktive Szenarios zurueckschreiben + // Flags fuer aktive Szenarios richtig setzen + // und aktuelle Werte in bisher aktive Szenarios zurueckschreiben ScRangeList aRanges = *pTab[nSrcTab]->GetScenarioRanges(); const ULONG nRangeCount = aRanges.Count(); - // nDestTab ist die Zieltabelle + // nDestTab ist die Zieltabelle for ( SCTAB nTab = nDestTab+1; nTab<=MAXTAB && pTab[nTab] && pTab[nTab]->IsScenario(); nTab++ ) { - if ( pTab[nTab]->IsActiveScenario() ) // auch wenn's dasselbe Szenario ist + if ( pTab[nTab]->IsActiveScenario() ) // auch wenn's dasselbe Szenario ist { BOOL bTouched = FALSE; for ( ULONG nR=0; nR<nRangeCount && !bTouched; nR++) @@ -684,11 +684,11 @@ void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, BOOL bNewScenario } } - pTab[nSrcTab]->SetActiveScenario(TRUE); // da kommt's her... - if (!bNewScenario) // Daten aus dem ausgewaehlten Szenario kopieren + pTab[nSrcTab]->SetActiveScenario(TRUE); // da kommt's her... + if (!bNewScenario) // Daten aus dem ausgewaehlten Szenario kopieren { BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden pTab[nSrcTab]->CopyScenarioTo( pTab[nDestTab] ); SetDirty(); SetAutoCalc( bOldAutoCalc ); @@ -712,7 +712,7 @@ BOOL ScDocument::HasScenarioRange( SCTAB nTab, const ScRange& rRange ) const { return ValidTab(nTab) && pTab[nTab] && pTab[nTab]->HasScenarioRange( rRange ); //if (ValidTab(nTab) && pTab[nTab]) - // return pTab[nTab]->HasScenarioRange( rRange ); + // return pTab[nTab]->HasScenarioRange( rRange ); //return FALSE; } @@ -729,7 +729,7 @@ BOOL ScDocument::IsActiveScenario( SCTAB nTab ) const { return ValidTab(nTab) && pTab[nTab] && pTab[nTab]->IsActiveScenario( ); //if (ValidTab(nTab) && pTab[nTab]) - // return pTab[nTab]->IsActiveScenario(); + // return pTab[nTab]->IsActiveScenario(); //return FALSE; } @@ -765,29 +765,29 @@ void ScDocument::RemoveUnoObject( SfxListener& rObject ) if ( bInUnoBroadcast ) { - // #107294# Broadcasts from ScDocument::BroadcastUno are the only way that - // uno object methods are called without holding a reference. + // #107294# Broadcasts from ScDocument::BroadcastUno are the only way that + // uno object methods are called without holding a reference. // - // If RemoveUnoObject is called from an object dtor in the finalizer thread - // while the main thread is calling BroadcastUno, the dtor thread must wait - // (or the object's Notify might try to access a deleted object). - // The SolarMutex can't be locked here because if a component is called from - // a VCL event, the main thread has the SolarMutex locked all the time. + // If RemoveUnoObject is called from an object dtor in the finalizer thread + // while the main thread is calling BroadcastUno, the dtor thread must wait + // (or the object's Notify might try to access a deleted object). + // The SolarMutex can't be locked here because if a component is called from + // a VCL event, the main thread has the SolarMutex locked all the time. // - // This check is done after calling EndListening, so a later BroadcastUno call - // won't touch this object. + // This check is done after calling EndListening, so a later BroadcastUno call + // won't touch this object. vos::IMutex& rSolarMutex = Application::GetSolarMutex(); if ( rSolarMutex.tryToAcquire() ) { - // BroadcastUno is always called with the SolarMutex locked, so if it - // can be acquired, this is within the same thread (should not happen) + // BroadcastUno is always called with the SolarMutex locked, so if it + // can be acquired, this is within the same thread (should not happen) DBG_ERRORFILE( "RemoveUnoObject called from BroadcastUno" ); rSolarMutex.release(); } else { - // let the thread that called BroadcastUno continue + // let the thread that called BroadcastUno continue while ( bInUnoBroadcast ) { vos::OThread::yield(); @@ -968,9 +968,9 @@ void ScDocument::UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDo aSource.aEnd.SetTab( nClipTab ); aDest.SetTab( nDestTab ); - // wie UpdateReference + // wie UpdateReference - pRangeName->UpdateTranspose( aSource, aDest ); // vor den Zellen! + pRangeName->UpdateTranspose( aSource, aDest ); // vor den Zellen! for (SCTAB i=0; i<=MAXTAB; i++) if (pTab[i]) pTab[i]->UpdateTranspose( aSource, aDest, pUndoDoc ); @@ -981,9 +981,9 @@ void ScDocument::UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDo void ScDocument::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY ) { - //! pDBCollection - //! pPivotCollection - //! UpdateChartRef + //! pDBCollection + //! pPivotCollection + //! UpdateChartRef pRangeName->UpdateGrow( rArea, nGrowX, nGrowY ); @@ -1131,7 +1131,7 @@ BOOL ScDocument::SearchAndReplace(const SvxSearchItem& rSearchItem, ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) { - //! getrennte Markierungen pro Tabelle verwalten !!!!!!!!!!!!! + //! getrennte Markierungen pro Tabelle verwalten !!!!!!!!!!!!! rMark.MarkToMulti(); @@ -1157,7 +1157,7 @@ BOOL ScDocument::SearchAndReplace(const SvxSearchItem& rSearchItem, } } - // Markierung wird innen schon komplett gesetzt + // Markierung wird innen schon komplett gesetzt } else { @@ -1210,7 +1210,7 @@ BOOL ScDocument::SearchAndReplace(const SvxSearchItem& rSearchItem, return bFound; } -// Outline anpassen +// Outline anpassen BOOL ScDocument::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, BOOL bShow ) { @@ -1280,8 +1280,8 @@ BOOL ScDocument::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n BOOL ScDocument::HasAutoFilter( SCCOL nCurCol, SCROW nCurRow, SCTAB nCurTab ) { - ScDBData* pDBData = GetDBAtCursor( nCurCol, nCurRow, nCurTab ); - BOOL bHasAutoFilter = ( pDBData != NULL ); + ScDBData* pDBData = GetDBAtCursor( nCurCol, nCurRow, nCurTab ); + BOOL bHasAutoFilter = ( pDBData != NULL ); if ( pDBData ) { @@ -1317,8 +1317,8 @@ BOOL ScDocument::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, { return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->HasColHeader( nStartCol, nStartRow, nEndCol, nEndRow ); //if (VALIDTAB(nTab)) - // if (pTab[nTab]) - // return pTab[nTab]->HasColHeader( nStartCol, nStartRow, nEndCol, nEndRow ); + // if (pTab[nTab]) + // return pTab[nTab]->HasColHeader( nStartCol, nStartRow, nEndCol, nEndRow ); //return FALSE; } @@ -1328,14 +1328,14 @@ BOOL ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, { return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->HasRowHeader( nStartCol, nStartRow, nEndCol, nEndRow ); //if (VALIDTAB(nTab)) - // if (pTab[nTab]) - // return pTab[nTab]->HasRowHeader( nStartCol, nStartRow, nEndCol, nEndRow ); + // if (pTab[nTab]) + // return pTab[nTab]->HasRowHeader( nStartCol, nStartRow, nEndCol, nEndRow ); //return FALSE; } // -// GetFilterEntries - Eintraege fuer AutoFilter-Listbox +// GetFilterEntries - Eintraege fuer AutoFilter-Listbox // BOOL ScDocument::GetFilterEntries( @@ -1343,7 +1343,7 @@ BOOL ScDocument::GetFilterEntries( { if ( ValidTab(nTab) && pTab[nTab] && pDBCollection ) { - ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, FALSE); //!?? + ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, FALSE); //!?? if (pDBData) { SCTAB nAreaTab; @@ -1391,7 +1391,7 @@ BOOL ScDocument::GetFilterEntries( } // -// GetFilterEntriesArea - Eintraege fuer Filter-Dialog +// GetFilterEntriesArea - Eintraege fuer Filter-Dialog // BOOL ScDocument::GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, @@ -1407,7 +1407,7 @@ BOOL ScDocument::GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRo } // -// GetDataEntries - Eintraege fuer Auswahlliste-Listbox (keine Zahlen / Formeln) +// GetDataEntries - Eintraege fuer Auswahlliste-Listbox (keine Zahlen / Formeln) // BOOL ScDocument::GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, @@ -1429,26 +1429,26 @@ BOOL ScDocument::GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, return ValidTab(nTab) && pTab[nTab] && pTab[nTab]->GetDataEntries( nCol, nRow, rStrings, bLimit ); //if (ValidTab(nTab) && pTab[nTab]) - // return pTab[nTab]->GetDataEntries( nCol, nRow, rStrings, bLimit ); + // return pTab[nTab]->GetDataEntries( nCol, nRow, rStrings, bLimit ); //return FALSE; } // -// GetFormulaEntries - Eintraege fuer Formel-AutoEingabe +// GetFormulaEntries - Eintraege fuer Formel-AutoEingabe // -// Funktionen werden als 1 schon vom InputHandler eingefuegt -#define SC_STRTYPE_NAMES 2 -#define SC_STRTYPE_DBNAMES 3 -#define SC_STRTYPE_HEADERS 4 +// Funktionen werden als 1 schon vom InputHandler eingefuegt +#define SC_STRTYPE_NAMES 2 +#define SC_STRTYPE_DBNAMES 3 +#define SC_STRTYPE_HEADERS 4 BOOL ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings ) { USHORT i; // - // Bereichsnamen + // Bereichsnamen // if ( pRangeName ) @@ -1467,7 +1467,7 @@ BOOL ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings ) } // - // Datenbank-Bereiche + // Datenbank-Bereiche // if ( pDBCollection ) @@ -1486,7 +1486,7 @@ BOOL ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings ) } // - // Inhalte von Beschriftungsbereichen + // Inhalte von Beschriftungsbereichen // ScRangePairList* pLists[2]; @@ -1525,7 +1525,7 @@ void ScDocument::GetEmbedded( ScRange& rRange ) const rRange = aEmbedRange; } -Rectangle ScDocument::GetEmbeddedRect() const // 1/100 mm +Rectangle ScDocument::GetEmbeddedRect() const // 1/100 mm { Rectangle aRect; ScTable* pTable = pTab[aEmbedRange.aStart.Tab()]; @@ -1567,7 +1567,7 @@ void ScDocument::ResetEmbedded() } -/** Similar to ScViewData::AddPixelsWhile(), but add height twips and only +/** Similar to ScViewData::AddPixelsWhile(), but add height twips and only while result is less than nStopTwips. @return TRUE if advanced at least one row. */ @@ -1625,7 +1625,7 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect ) Rectangle aPosRect = rMMRect; if ( IsNegativePage( nTab ) ) - ScDrawLayer::MirrorRectRTL( aPosRect ); // always with positive (LTR) values + ScDrawLayer::MirrorRectRTL( aPosRect ); // always with positive (LTR) values long nSize; long nTwips; @@ -1684,13 +1684,13 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect ) return ScRange( nX1,nY1,nTab, nX2,nY2,nTab ); } -void ScDocument::SetEmbedded( const Rectangle& rRect ) // aus VisArea (1/100 mm) +void ScDocument::SetEmbedded( const Rectangle& rRect ) // aus VisArea (1/100 mm) { bIsEmbedded = TRUE; aEmbedRange = GetRange( nVisibleTab, rRect ); } -// VisArea auf Zellgrenzen anpassen +// VisArea auf Zellgrenzen anpassen void lcl_SnapHor( ScTable* pTable, long& rVal, SCCOL& rStartCol ) { @@ -1724,7 +1724,7 @@ void lcl_SnapVer( ScTable* pTable, long& rVal, SCROW& rStartRow ) SCROW nLastRow; if (pTable->RowHidden(i, NULL, &nLastRow)) { - i = nLastRow; + i = nLastRow; continue; } @@ -1737,7 +1737,7 @@ void lcl_SnapVer( ScTable* pTable, long& rVal, SCROW& rStartRow ) } else { - bFound = true; + bFound = true; break; } } @@ -1763,12 +1763,12 @@ void ScDocument::SnapVisArea( Rectangle& rRect ) const SCCOL nCol = 0; lcl_SnapHor( pTable, rRect.Left(), nCol ); - ++nCol; // mindestens eine Spalte + ++nCol; // mindestens eine Spalte lcl_SnapHor( pTable, rRect.Right(), nCol ); SCROW nRow = 0; lcl_SnapVer( pTable, rRect.Top(), nRow ); - ++nRow; // mindestens eine Zeile + ++nRow; // mindestens eine Zeile lcl_SnapVer( pTable, rRect.Bottom(), nRow ); if ( bNegativePage ) @@ -1878,7 +1878,7 @@ void ScDocument::SetLanguage( LanguageType eLatin, LanguageType eCjk, LanguageTy pPool->SetPoolDefaultItem( SvxLanguageItem( eCtlLanguage, ATTR_CTL_FONT_LANGUAGE ) ); } - UpdateDrawLanguages(); // set edit engine defaults in drawing layer pool + UpdateDrawLanguages(); // set edit engine defaults in drawing layer pool } void ScDocument::SetDrawDefaults() @@ -1910,10 +1910,10 @@ Rectangle ScDocument::GetMMRect( SCCOL nStartCol, SCROW nStartRow, aRect.Right() += GetColWidth(i,nTab); aRect.Bottom() += GetRowHeight( nStartRow, nEndRow, nTab); - aRect.Left() = (long)(aRect.Left() * HMM_PER_TWIPS); - aRect.Right() = (long)(aRect.Right() * HMM_PER_TWIPS); - aRect.Top() = (long)(aRect.Top() * HMM_PER_TWIPS); - aRect.Bottom() = (long)(aRect.Bottom() * HMM_PER_TWIPS); + aRect.Left() = (long)(aRect.Left() * HMM_PER_TWIPS); + aRect.Right() = (long)(aRect.Right() * HMM_PER_TWIPS); + aRect.Top() = (long)(aRect.Top() * HMM_PER_TWIPS); + aRect.Bottom() = (long)(aRect.Bottom() * HMM_PER_TWIPS); if ( IsNegativePage( nTab ) ) ScDrawLayer::MirrorRectRTL( aRect ); @@ -2012,7 +2012,7 @@ void ScDocument::DecSizeRecalcLevel( SCTAB nTab, bool bUpdateNoteCaptionPos ) // Wang Xu Ming -- 2009-8-17 // DataPilot Migration - Cache&&Performance -ScDPTableDataCache* ScDocument::GetDPObjectCache( long nID ) +ScDPTableDataCache* ScDocument::GetDPObjectCache( long nID ) { for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); iter++ ) { // @@ -2022,7 +2022,7 @@ ScDPTableDataCache* ScDocument::GetDPObjectCache( long nID ) return NULL; } -ScDPTableDataCache* ScDocument::GetUsedDPObjectCache ( ScRange rRange ) +ScDPTableDataCache* ScDocument::GetUsedDPObjectCache ( ScRange rRange ) { ScDPTableDataCache* pCache = NULL; USHORT nCount = GetDPCollection()->GetCount(); @@ -2042,7 +2042,7 @@ ScDPTableDataCache* ScDocument::GetUsedDPObjectCache ( ScRange rRange ) } long ScDocument::AddDPObjectCache( ScDPTableDataCache* pData ) -{ +{ if ( pData->GetId() < 0 ) { //create a id for it pData->SetId( GetNewDPObjectCacheId() ); @@ -2077,10 +2077,10 @@ long ScDocument::GetNewDPObjectCacheId() void ScDocument::RemoveDPObjectCache( long nID ) { for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); iter++ ) - { + { if ( nID == (*iter)->GetId() ) { - ScDPTableDataCache* pCache = *iter; + ScDPTableDataCache* pCache = *iter; m_listDPObjectsCaches.erase( iter ); delete pCache; break; @@ -2090,9 +2090,9 @@ void ScDocument::RemoveDPObjectCache( long nID ) } void ScDocument::RemoveUnusedDPObjectCaches() -{ +{ for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); iter++ ) - { + { long nID = (*iter)->GetId(); USHORT nCount = GetDPCollection()->GetCount(); USHORT i ; @@ -2103,7 +2103,7 @@ void ScDocument::RemoveUnusedDPObjectCaches() } if ( i == nCount ) { - ScDPTableDataCache* pCache = *iter; + ScDPTableDataCache* pCache = *iter; m_listDPObjectsCaches.erase( iter ); delete pCache; continue; @@ -2114,10 +2114,10 @@ void ScDocument::RemoveUnusedDPObjectCaches() void ScDocument::GetUsedDPObjectCache( std::list<ScDPTableDataCache*>& usedlist ) { for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); iter++ ) - { + { long nID = (*iter)->GetId(); USHORT nCount = GetDPCollection()->GetCount(); - USHORT i=0; + USHORT i=0; for ( i=0; i<nCount; i++) if ( nID == (*pDPCollection)[i]->GetCacheId() ) break; diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 148cc367534c..cbd55fd5fe14 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -1,7 +1,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 @@ -112,7 +112,7 @@ BOOL ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, pCell->Interpret(); USHORT nErrCode = pCell->GetErrCode(); nX = pCell->GetValueAlways(); - if (nErrCode == 0) // kein fehler beim Rechnen + if (nErrCode == 0) // kein fehler beim Rechnen bRet = TRUE; delete pCell; } @@ -135,7 +135,7 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, SCROW k; i = 0; BOOL bStop = FALSE; - while (i <= MAXTAB && !bStop) // erste markierte Tabelle finden + while (i <= MAXTAB && !bStop) // erste markierte Tabelle finden { if (pTab[i] && rMark.GetTableSelect(i)) bStop = TRUE; @@ -196,7 +196,7 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, { for (k = nRow1; k <= nRow2; k++) { - if (j != nCol1 || k != nRow1) // nicht in der ersten Zelle + if (j != nCol1 || k != nRow1) // nicht in der ersten Zelle { // Array muss geklont werden, damit jede // Zelle ein eigenes Array erhaelt! @@ -222,7 +222,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera SCROW k; i = 0; BOOL bStop = FALSE; - while (i <= MAXTAB && !bStop) // erste markierte Tabelle finden + while (i <= MAXTAB && !bStop) // erste markierte Tabelle finden { if (pTab[i] && rMark.GetTableSelect(i)) bStop = TRUE; @@ -243,11 +243,11 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera aForString += ScCompiler::GetNativeSymbol( ocOpen); const String& sSep = ScCompiler::GetNativeSymbol( ocSep); - if (rParam.nMode == 0) // nur Spalte + if (rParam.nMode == 0) // nur Spalte { aRef.Set( rParam.aRefFormulaCell.GetAddress(), TRUE, FALSE, FALSE ); aForString += aRef.GetRefString(this, nTab1); - aForString += sSep; + aForString += sSep; aForString += rParam.aRefColCell.GetRefString(this, nTab1); aForString += sSep; aRef.Set( nCol1, nRow1, nTab1, FALSE, TRUE, TRUE ); @@ -256,7 +256,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera nCol2 = Min( nCol2, (SCCOL)(rParam.aRefFormulaEnd.Col() - rParam.aRefFormulaCell.Col() + nCol1 + 1)); } - else if (rParam.nMode == 1) // nur zeilenweise + else if (rParam.nMode == 1) // nur zeilenweise { aRef.Set( rParam.aRefFormulaCell.GetAddress(), FALSE, TRUE, FALSE ); aForString += aRef.GetRefString(this, nTab1); @@ -269,7 +269,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera nRow2 = Min( nRow2, (SCROW)(rParam.aRefFormulaEnd.Row() - rParam.aRefFormulaCell.Row() + nRow1 + 1)); } - else // beides + else // beides { aForString += rParam.aRefFormulaCell.GetRefString(this, nTab1); aForString += sSep; @@ -312,20 +312,20 @@ bool ScDocument::MarkUsedExternalReferences( ScTokenArray & rArr ) switch (t->GetType()) { case svExternalSingleRef: - bAllMarked = pRefMgr->setCacheTableReferenced( + bAllMarked = pRefMgr->setCacheTableReferenced( t->GetIndex(), t->GetString(), 1); break; case svExternalDoubleRef: { const ScComplexRefData& rRef = t->GetDoubleRef(); size_t nSheets = rRef.Ref2.nTab - rRef.Ref1.nTab + 1; - bAllMarked = pRefMgr->setCacheTableReferenced( + bAllMarked = pRefMgr->setCacheTableReferenced( t->GetIndex(), t->GetString(), nSheets); } break; case svExternalName: - /* TODO: external names aren't supported yet, but would - * have to be marked as well, if so. Mechanism would be + /* TODO: external names aren't supported yet, but would + * have to be marked as well, if so. Mechanism would be * different. */ DBG_ERRORFILE("ScDocument::MarkUsedExternalReferences: implement the svExternalName case!"); break; @@ -385,7 +385,7 @@ void ScDocument::CompileDBFormula( BOOL bCreateFormulaString ) void ScDocument::CompileNameFormula( BOOL bCreateFormulaString ) { if ( pCondFormList ) - pCondFormList->CompileAll(); // nach ScNameDlg noetig + pCondFormList->CompileAll(); // nach ScNameDlg noetig for (SCTAB i=0; i<=MAXTAB; i++) { @@ -461,7 +461,7 @@ BOOL ScDocument::GetSelectionFunction( ScSubTotalFunc eFunc, pTab[nTab]->UpdateSelectionFunction( aData, nStartCol, nStartRow, nEndCol, nEndRow, rMark ); - //! rMark an UpdateSelectionFunction uebergeben !!!!! + //! rMark an UpdateSelectionFunction uebergeben !!!!! if (!aData.bError) switch (eFunc) @@ -510,10 +510,10 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat ) nPrecision = (short)GetFormatTable()->GetFormatPrecision( nFormat ); switch ( nType ) { - case NUMBERFORMAT_PERCENT: // 0,41% == 0,0041 + case NUMBERFORMAT_PERCENT: // 0,41% == 0,0041 nPrecision += 2; break; - case NUMBERFORMAT_SCIENTIFIC: // 1,23e-3 == 0,00123 + case NUMBERFORMAT_SCIENTIFIC: // 1,23e-3 == 0,00123 { if ( fVal > 0.0 ) nPrecision = sal::static_int_cast<short>( nPrecision - (short)floor( log10( fVal ) ) ); @@ -527,7 +527,7 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat ) nPrecision = (short)GetDocOptions().GetStdPrecision(); double fRound = ::rtl::math::round( fVal, nPrecision ); if ( ::rtl::math::approxEqual( fVal, fRound ) ) - return fVal; // durch Rundung hoechstens Fehler + return fVal; // durch Rundung hoechstens Fehler else return fRound; } @@ -536,13 +536,13 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat ) } // -// bedingte Formate und Gueltigkeitsbereiche +// bedingte Formate und Gueltigkeitsbereiche // ULONG ScDocument::AddCondFormat( const ScConditionalFormat& rNew ) { if (rNew.IsEmpty()) - return 0; // leer ist immer 0 + return 0; // leer ist immer 0 if (!pCondFormList) pCondFormList = new ScConditionalFormatList; @@ -571,7 +571,7 @@ ULONG ScDocument::AddCondFormat( const ScConditionalFormat& rNew ) ULONG ScDocument::AddValidationEntry( const ScValidationData& rNew ) { if (rNew.IsEmpty()) - return 0; // leer ist immer 0 + return 0; // leer ist immer 0 if (!pValidationList) pValidationList = new ScValidationDataList; @@ -667,7 +667,7 @@ const ScConditionalFormat* ScDocument::GetCondFormat( return NULL; } -const ScValidationData* ScDocument::GetValidationEntry( ULONG nIndex ) const +const ScValidationData* ScDocument::GetValidationEntry( ULONG nIndex ) const { if ( pValidationList ) return pValidationList->GetData( nIndex ); @@ -689,7 +689,7 @@ void ScDocument::FindConditionalFormat( ULONG nKey, ScRangeList& rRanges, SCTAB void ScDocument::ConditionalChanged( ULONG nKey ) { - if ( nKey && pCondFormList && !bIsClip && !bIsUndo ) // nKey==0 -> noop + if ( nKey && pCondFormList && !bIsClip && !bIsUndo ) // nKey==0 -> noop { ScConditionalFormat* pForm = pCondFormList->GetFormat( nKey ); if (pForm) @@ -725,27 +725,27 @@ void ScDocument::AddDetectiveOperation( const ScDetOpData& rData ) void ScDocument::ClearDetectiveOperations() { - delete pDetOpList; // loescht auch die Eintraege + delete pDetOpList; // loescht auch die Eintraege pDetOpList = NULL; } void ScDocument::SetDetOpList(ScDetOpList* pNew) { - delete pDetOpList; // loescht auch die Eintraege + delete pDetOpList; // loescht auch die Eintraege pDetOpList = pNew; } //------------------------------------------------------------------------ // -// Vergleich von Dokumenten +// Vergleich von Dokumenten // //------------------------------------------------------------------------ -// Pfriemel-Faktoren -#define SC_DOCCOMP_MAXDIFF 256 -#define SC_DOCCOMP_MINGOOD 128 -#define SC_DOCCOMP_COLUMNS 10 -#define SC_DOCCOMP_ROWS 100 +// Pfriemel-Faktoren +#define SC_DOCCOMP_MAXDIFF 256 +#define SC_DOCCOMP_MINGOOD 128 +#define SC_DOCCOMP_COLUMNS 10 +#define SC_DOCCOMP_ROWS 100 USHORT ScDocument::RowDifferences( SCROW nThisRow, SCTAB nThisTab, @@ -762,7 +762,7 @@ USHORT ScDocument::RowDifferences( SCROW nThisRow, SCTAB nThisTab, else nOtherCol = nThisCol; - if (ValidCol(nOtherCol)) // nur Spalten vergleichen, die in beiden Dateien sind + if (ValidCol(nOtherCol)) // nur Spalten vergleichen, die in beiden Dateien sind { const ScBaseCell* pThisCell = GetCell( ScAddress( nThisCol, nThisRow, nThisTab ) ); const ScBaseCell* pOtherCell = rOtherDoc.GetCell( ScAddress( nOtherCol, nOtherRow, nOtherTab ) ); @@ -771,7 +771,7 @@ USHORT ScDocument::RowDifferences( SCROW nThisRow, SCTAB nThisTab, if ( pThisCell && pOtherCell ) nDif += 3; else - nDif += 4; // Inhalt <-> leer zaehlt mehr + nDif += 4; // Inhalt <-> leer zaehlt mehr } if ( ( pThisCell && pThisCell->GetCellType()!=CELLTYPE_NOTE ) || @@ -781,7 +781,7 @@ USHORT ScDocument::RowDifferences( SCROW nThisRow, SCTAB nThisTab, } if (nUsed > 0) - return static_cast<USHORT>((nDif*64)/nUsed); // max.256 (SC_DOCCOMP_MAXDIFF) + return static_cast<USHORT>((nDif*64)/nUsed); // max.256 (SC_DOCCOMP_MAXDIFF) DBG_ASSERT(!nDif,"Diff ohne Used"); return 0; @@ -791,7 +791,7 @@ USHORT ScDocument::ColDifferences( SCCOL nThisCol, SCTAB nThisTab, ScDocument& rOtherDoc, SCCOL nOtherCol, SCTAB nOtherTab, SCROW nMaxRow, SCCOLROW* pOtherRows ) { - //! optimieren mit Iterator oder so + //! optimieren mit Iterator oder so ULONG nDif = 0; ULONG nUsed = 0; @@ -803,7 +803,7 @@ USHORT ScDocument::ColDifferences( SCCOL nThisCol, SCTAB nThisTab, else nOtherRow = nThisRow; - if (ValidRow(nOtherRow)) // nur Zeilen vergleichen, die in beiden Dateien sind + if (ValidRow(nOtherRow)) // nur Zeilen vergleichen, die in beiden Dateien sind { const ScBaseCell* pThisCell = GetCell( ScAddress( nThisCol, nThisRow, nThisTab ) ); const ScBaseCell* pOtherCell = rOtherDoc.GetCell( ScAddress( nOtherCol, nOtherRow, nOtherTab ) ); @@ -812,7 +812,7 @@ USHORT ScDocument::ColDifferences( SCCOL nThisCol, SCTAB nThisTab, if ( pThisCell && pOtherCell ) nDif += 3; else - nDif += 4; // Inhalt <-> leer zaehlt mehr + nDif += 4; // Inhalt <-> leer zaehlt mehr } if ( ( pThisCell && pThisCell->GetCellType()!=CELLTYPE_NOTE ) || @@ -822,7 +822,7 @@ USHORT ScDocument::ColDifferences( SCCOL nThisCol, SCTAB nThisTab, } if (nUsed > 0) - return static_cast<USHORT>((nDif*64)/nUsed); // max.256 + return static_cast<USHORT>((nDif*64)/nUsed); // max.256 DBG_ASSERT(!nDif,"Diff ohne Used"); return 0; @@ -832,28 +832,28 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW BOOL bColumns, ScDocument& rOtherDoc, SCTAB nThisTab, SCTAB nOtherTab, SCCOLROW nEndCol, SCCOLROW* pTranslate, ScProgress* pProgress, ULONG nProAdd ) { - // bColumns=TRUE: Zeilen sind Spalten und umgekehrt + // bColumns=TRUE: Zeilen sind Spalten und umgekehrt - SCCOLROW nMaxCont; // wieviel weiter - SCCOLROW nMinGood; // was ist ein Treffer (incl.) + SCCOLROW nMaxCont; // wieviel weiter + SCCOLROW nMinGood; // was ist ein Treffer (incl.) if ( bColumns ) { - nMaxCont = SC_DOCCOMP_COLUMNS; // 10 Spalten + nMaxCont = SC_DOCCOMP_COLUMNS; // 10 Spalten nMinGood = SC_DOCCOMP_MINGOOD; - //! Extra Durchgang mit nMinGood = 0 ???? + //! Extra Durchgang mit nMinGood = 0 ???? } else { - nMaxCont = SC_DOCCOMP_ROWS; // 100 Zeilen + nMaxCont = SC_DOCCOMP_ROWS; // 100 Zeilen nMinGood = SC_DOCCOMP_MINGOOD; } - BOOL bUseTotal = bColumns && !pTranslate; // nur beim ersten Durchgang + BOOL bUseTotal = bColumns && !pTranslate; // nur beim ersten Durchgang SCCOLROW nOtherRow = 0; USHORT nComp; SCCOLROW nThisRow; - BOOL bTotal = FALSE; // ueber verschiedene nThisRow beibehalten + BOOL bTotal = FALSE; // ueber verschiedene nThisRow beibehalten SCCOLROW nUnknown = 0; for (nThisRow = 0; nThisRow <= nThisEndRow; nThisRow++) { @@ -861,7 +861,7 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW BOOL bFound = FALSE; USHORT nBest = SC_DOCCOMP_MAXDIFF; SCCOLROW nMax = Min( nOtherEndRow, static_cast<SCCOLROW>(( nTempOther + nMaxCont + nUnknown )) ); - for (SCCOLROW i=nTempOther; i<=nMax && nBest>0; i++) // bei 0 abbrechen + for (SCCOLROW i=nTempOther; i<=nMax && nBest>0; i++) // bei 0 abbrechen { if (bColumns) nComp = ColDifferences( static_cast<SCCOL>(nThisRow), nThisTab, rOtherDoc, static_cast<SCCOL>(i), nOtherTab, nEndCol, pTranslate ); @@ -876,7 +876,7 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW if ( nComp < SC_DOCCOMP_MAXDIFF || bFound ) bTotal = FALSE; else if ( i == nTempOther && bUseTotal ) - bTotal = TRUE; // nur ganz oben + bTotal = TRUE; // nur ganz oben } if ( bFound ) { @@ -894,7 +894,7 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW pProgress->SetStateOnPercent(nProAdd+static_cast<ULONG>(nThisRow)); } - // Bloecke ohne Uebereinstimmung ausfuellen + // Bloecke ohne Uebereinstimmung ausfuellen SCROW nFillStart = 0; SCROW nFillPos = 0; @@ -906,7 +906,7 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW { if ( bInFill ) { - if ( nThisOther > nFillStart ) // ist was zu verteilen da? + if ( nThisOther > nFillStart ) // ist was zu verteilen da? { SCROW nDiff1 = nThisOther - nFillStart; SCROW nDiff2 = nThisRow - nFillPos; @@ -935,13 +935,13 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) SCTAB* pOtherTabs = new SCTAB[nThisCount]; SCTAB nThisTab; - // Tabellen mit gleichen Namen vergleichen + // Tabellen mit gleichen Namen vergleichen String aThisName; String aOtherName; for (nThisTab=0; nThisTab<nThisCount; nThisTab++) { SCTAB nOtherTab = SCTAB_MAX; - if (!IsScenario(nThisTab)) // Szenarien weglassen + if (!IsScenario(nThisTab)) // Szenarien weglassen { GetName( nThisTab, aThisName ); for (SCTAB nTemp=0; nTemp<nOtherCount && nOtherTab>MAXTAB; nTemp++) @@ -954,7 +954,7 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) } pOtherTabs[nThisTab] = nOtherTab; } - // auffuellen, damit einzeln umbenannte Tabellen nicht wegfallen + // auffuellen, damit einzeln umbenannte Tabellen nicht wegfallen SCTAB nFillStart = 0; SCTAB nFillPos = 0; BOOL bInFill = FALSE; @@ -965,7 +965,7 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) { if ( bInFill ) { - if ( nThisOther > nFillStart ) // ist was zu verteilen da? + if ( nThisOther > nFillStart ) // ist was zu verteilen da? { SCTAB nDiff1 = nThisOther - nFillStart; SCTAB nDiff2 = nThisTab - nFillPos; @@ -985,7 +985,7 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) } // - // Tabellen in der gefundenen Reihenfolge vergleichen + // Tabellen in der gefundenen Reihenfolge vergleichen // for (nThisTab=0; nThisTab<nThisCount; nThisTab++) @@ -1003,9 +1003,9 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) SCROW nEndRow = Max(nThisEndRow, nOtherEndRow); SCCOL nThisCol; SCROW nThisRow; - ULONG n1,n2; // fuer AppendDeleteRange + ULONG n1,n2; // fuer AppendDeleteRange - //! ein Progress ueber alle Tabellen ??? + //! ein Progress ueber alle Tabellen ??? String aTabName; GetName( nThisTab, aTabName ); String aTemplate = ScGlobal::GetRscString(STR_PROGRESS_COMPARING); @@ -1013,20 +1013,20 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) aProText += aTabName; aProText += aTemplate.GetToken( 1, '#' ); ScProgress aProgress( GetDocumentShell(), - aProText, 3*nThisEndRow ); // 2x FindOrder, 1x hier - long nProgressStart = 2*nThisEndRow; // start fuer hier + aProText, 3*nThisEndRow ); // 2x FindOrder, 1x hier + long nProgressStart = 2*nThisEndRow; // start fuer hier SCCOLROW* pTempRows = new SCCOLROW[nThisEndRow+1]; SCCOLROW* pOtherRows = new SCCOLROW[nThisEndRow+1]; SCCOLROW* pOtherCols = new SCCOLROW[nThisEndCol+1]; - // eingefuegte/geloeschte Spalten/Zeilen finden: - // Zwei Versuche: - // 1) Original Zeilen vergleichen (pTempRows) - // 2) Original Spalten vergleichen (pOtherCols) - // mit dieser Spaltenreihenfolge Zeilen vergleichen (pOtherRows) + // eingefuegte/geloeschte Spalten/Zeilen finden: + // Zwei Versuche: + // 1) Original Zeilen vergleichen (pTempRows) + // 2) Original Spalten vergleichen (pOtherCols) + // mit dieser Spaltenreihenfolge Zeilen vergleichen (pOtherRows) - //! Spalten vergleichen zweimal mit unterschiedlichem nMinGood ??? + //! Spalten vergleichen zweimal mit unterschiedlichem nMinGood ??? // 1 FindOrder( pTempRows, nThisEndRow, nOtherEndRow, FALSE, @@ -1038,46 +1038,46 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) rOtherDoc, nThisTab, nOtherTab, nThisEndCol, pOtherCols, &aProgress, nThisEndRow ); - ULONG nMatch1 = 0; // pTempRows, keine Spalten + ULONG nMatch1 = 0; // pTempRows, keine Spalten for (nThisRow = 0; nThisRow<=nThisEndRow; nThisRow++) if (ValidRow(pTempRows[nThisRow])) nMatch1 += SC_DOCCOMP_MAXDIFF - RowDifferences( nThisRow, nThisTab, rOtherDoc, pTempRows[nThisRow], nOtherTab, nEndCol, NULL ); - ULONG nMatch2 = 0; // pOtherRows, pOtherCols + ULONG nMatch2 = 0; // pOtherRows, pOtherCols for (nThisRow = 0; nThisRow<=nThisEndRow; nThisRow++) if (ValidRow(pOtherRows[nThisRow])) nMatch2 += SC_DOCCOMP_MAXDIFF - RowDifferences( nThisRow, nThisTab, rOtherDoc, pOtherRows[nThisRow], nOtherTab, nThisEndCol, pOtherCols ); - if ( nMatch1 >= nMatch2 ) // ohne Spalten ? + if ( nMatch1 >= nMatch2 ) // ohne Spalten ? { - // Spalten zuruecksetzen + // Spalten zuruecksetzen for (nThisCol = 0; nThisCol<=nThisEndCol; nThisCol++) pOtherCols[nThisCol] = nThisCol; - // Zeilenarrays vertauschen (geloescht werden sowieso beide) + // Zeilenarrays vertauschen (geloescht werden sowieso beide) SCCOLROW* pSwap = pTempRows; pTempRows = pOtherRows; pOtherRows = pSwap; } else { - // bleibt bei pOtherCols, pOtherRows + // bleibt bei pOtherCols, pOtherRows } - // Change-Actions erzeugen - // 1) Spalten von rechts - // 2) Zeilen von unten - // 3) einzelne Zellen in normaler Reihenfolge + // Change-Actions erzeugen + // 1) Spalten von rechts + // 2) Zeilen von unten + // 3) einzelne Zellen in normaler Reihenfolge - // Actions fuer eingefuegte/geloeschte Spalten + // Actions fuer eingefuegte/geloeschte Spalten SCCOL nLastOtherCol = static_cast<SCCOL>(nOtherEndCol + 1); - // nThisEndCol ... 0 + // nThisEndCol ... 0 for ( nThisCol = nThisEndCol+1; nThisCol > 0; ) { --nThisCol; @@ -1089,9 +1089,9 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) nLastOtherCol-1, MAXROW, nOtherTab ); pChangeTrack->AppendDeleteRange( aDelRange, &rOtherDoc, n1, n2 ); } - if ( nOtherCol > MAXCOL ) // eingefuegt + if ( nOtherCol > MAXCOL ) // eingefuegt { - // zusammenfassen + // zusammenfassen if ( nThisCol == nThisEndCol || ValidCol(static_cast<SCCOL>(pOtherCols[nThisCol+1])) ) { SCCOL nFirstNew = static_cast<SCCOL>(nThisCol); @@ -1106,17 +1106,17 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) else nLastOtherCol = nOtherCol; } - if ( nLastOtherCol > 0 ) // ganz oben geloescht + if ( nLastOtherCol > 0 ) // ganz oben geloescht { ScRange aDelRange( 0, 0, nOtherTab, nLastOtherCol-1, MAXROW, nOtherTab ); pChangeTrack->AppendDeleteRange( aDelRange, &rOtherDoc, n1, n2 ); } - // Actions fuer eingefuegte/geloeschte Zeilen + // Actions fuer eingefuegte/geloeschte Zeilen SCROW nLastOtherRow = nOtherEndRow + 1; - // nThisEndRow ... 0 + // nThisEndRow ... 0 for ( nThisRow = nThisEndRow+1; nThisRow > 0; ) { --nThisRow; @@ -1128,9 +1128,9 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) MAXCOL, nLastOtherRow-1, nOtherTab ); pChangeTrack->AppendDeleteRange( aDelRange, &rOtherDoc, n1, n2 ); } - if ( nOtherRow > MAXROW ) // eingefuegt + if ( nOtherRow > MAXROW ) // eingefuegt { - // zusammenfassen + // zusammenfassen if ( nThisRow == nThisEndRow || ValidRow(pOtherRows[nThisRow+1]) ) { SCROW nFirstNew = nThisRow; @@ -1145,14 +1145,14 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) else nLastOtherRow = nOtherRow; } - if ( nLastOtherRow > 0 ) // ganz oben geloescht + if ( nLastOtherRow > 0 ) // ganz oben geloescht { ScRange aDelRange( 0, 0, nOtherTab, MAXCOL, nLastOtherRow-1, nOtherTab ); pChangeTrack->AppendDeleteRange( aDelRange, &rOtherDoc, n1, n2 ); } - // Zeilen durchgehen um einzelne Zellen zu finden + // Zeilen durchgehen um einzelne Zellen zu finden for (nThisRow = 0; nThisRow <= nThisEndRow; nThisRow++) { @@ -1186,8 +1186,8 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) } } - //! Inhalt von eingefuegten / geloeschten Tabellen ??? - //! Aktionen fuer eingefuegte / geloeschte Tabellen ??? + //! Inhalt von eingefuegten / geloeschten Tabellen ??? + //! Aktionen fuer eingefuegte / geloeschte Tabellen ??? delete[] pOtherTabs; } diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index d86d174ab414..f53d2a14b688 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -1,7 +1,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 @@ -48,10 +48,10 @@ #include <svx/svdoole2.hxx> #include <svx/svdpage.hxx> -//REMOVE #ifndef SO2_DECL_SVINPLACEOBJECT_DEFINED -//REMOVE #define SO2_DECL_SVINPLACEOBJECT_DEFINED -//REMOVE SO2_DECL_REF(SvInPlaceObject) -//REMOVE #endif +//REMOVE #ifndef SO2_DECL_SVINPLACEOBJECT_DEFINED +//REMOVE #define SO2_DECL_SVINPLACEOBJECT_DEFINED +//REMOVE SO2_DECL_REF(SvInPlaceObject) +//REMOVE #endif #include "document.hxx" #include "drwlayer.hxx" @@ -136,7 +136,7 @@ void ScDocument::UpdateAllCharts() USHORT nDataCount = pChartCollection->GetCount(); if ( !nDataCount ) - return ; // nothing to do + return ; // nothing to do USHORT nPos; @@ -237,7 +237,7 @@ BOOL ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName ) if (pName) pName->Erase(); - return FALSE; // nix gefunden + return FALSE; // nix gefunden } void ScDocument::UpdateChartArea( const String& rChartName, @@ -441,7 +441,7 @@ void ScDocument::UpdateChartArea( const String& rChartName, // ((SdrOle2Obj*)pObject)->GetNewReplacement(); // pObject->ActionChanged(); - return; // nicht weitersuchen + return; // nicht weitersuchen } } pObject = aIter.Next(); @@ -560,7 +560,7 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode, { #if 0 if ( nDz != 0 ) - { // #81844# sheet to be deleted or inserted or moved + { // #81844# sheet to be deleted or inserted or moved // => no valid sheet names for references right now pChartListener->ChangeListening( aNewRLR, bDataChanged ); pChartListener->ScheduleSeriesRanges(); @@ -568,8 +568,8 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode, else #endif { -// SetChartRangeList( pChartListener->GetString(), aNewRLR ); -// pChartListener->ChangeListening( aNewRLR, bDataChanged ); +// SetChartRangeList( pChartListener->GetString(), aNewRLR ); +// pChartListener->ChangeListening( aNewRLR, bDataChanged ); // Force the chart to be loaded now, so it registers itself for UNO events. // UNO broadcasts are done after UpdateChartRef, so the chart will get this @@ -648,9 +648,9 @@ uno::Reference< embed::XEmbeddedObject > if (!pDrawLayer) return uno::Reference< embed::XEmbeddedObject >(); - // die Seiten hier vom Draw-Layer nehmen, - // weil sie evtl. nicht mit den Tabellen uebereinstimmen - // (z.B. Redo von Tabelle loeschen, Draw-Redo passiert vor DeleteTab). + // die Seiten hier vom Draw-Layer nehmen, + // weil sie evtl. nicht mit den Tabellen uebereinstimmen + // (z.B. Redo von Tabelle loeschen, Draw-Redo passiert vor DeleteTab). sal_uInt16 nCount = pDrawLayer->GetPageCount(); for (sal_uInt16 nTab=0; nTab<nCount; nTab++) @@ -763,10 +763,10 @@ void ScDocument::UpdateChartListenerCollection() if (!bIsChart) { - // put into list of other ole objects, so the object doesn't have to - // be swapped in the next time UpdateChartListenerCollection is called - //! remove names when objects are no longer there? - // (object names aren't used again before reloading the document) + // put into list of other ole objects, so the object doesn't have to + // be swapped in the next time UpdateChartListenerCollection is called + //! remove names when objects are no longer there? + // (object names aren't used again before reloading the document) if (!pOtherObjects) pOtherObjects = new ScStrCollection; diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx index 8706c49320d1..a64201857b63 100644 --- a/sc/source/core/data/documen6.cxx +++ b/sc/source/core/data/documen6.cxx @@ -1,7 +1,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 @@ -46,11 +46,11 @@ using namespace com::sun::star; -#define SC_BREAKITER_SERVICE "com.sun.star.i18n.BreakIterator" +#define SC_BREAKITER_SERVICE "com.sun.star.i18n.BreakIterator" // -// this file is compiled with exceptions enabled -// put functions here that need exceptions! +// this file is compiled with exceptions enabled +// put functions here that need exceptions! // // ----------------------------------------------------------------------- @@ -84,7 +84,7 @@ BOOL ScDocument::HasStringWeakCharacters( const String& rString ) { sal_Int16 nType = xBreakIter->getScriptType( aText, nPos ); if ( nType == i18n::ScriptType::WEAK ) - return TRUE; // found + return TRUE; // found nPos = xBreakIter->endOfScript( aText, nPos, nType ); } @@ -92,7 +92,7 @@ BOOL ScDocument::HasStringWeakCharacters( const String& rString ) } } - return FALSE; // none found + return FALSE; // none found } BYTE ScDocument::GetStringScriptType( const String& rString ) @@ -135,11 +135,11 @@ BYTE ScDocument::GetStringScriptType( const String& rString ) BYTE ScDocument::GetCellScriptType( ScBaseCell* pCell, ULONG nNumberFormat ) { if ( !pCell ) - return 0; // empty + return 0; // empty BYTE nStored = pCell->GetScriptType(); - if ( nStored != SC_SCRIPTTYPE_UNKNOWN ) // stored value valid? - return nStored; // use stored value + if ( nStored != SC_SCRIPTTYPE_UNKNOWN ) // stored value valid? + return nStored; // use stored value String aStr; Color* pColor; @@ -147,7 +147,7 @@ BYTE ScDocument::GetCellScriptType( ScBaseCell* pCell, ULONG nNumberFormat ) BYTE nRet = GetStringScriptType( aStr ); - pCell->SetScriptType( nRet ); // store for later calls + pCell->SetScriptType( nRet ); // store for later calls return nRet; } @@ -160,14 +160,14 @@ BYTE ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* { pCell = GetCell( ScAddress( nCol, nRow, nTab ) ); if ( !pCell ) - return 0; // empty + return 0; // empty } // if script type is set, don't have to get number formats BYTE nStored = pCell->GetScriptType(); - if ( nStored != SC_SCRIPTTYPE_UNKNOWN ) // stored value valid? - return nStored; // use stored value + if ( nStored != SC_SCRIPTTYPE_UNKNOWN ) // stored value valid? + return nStored; // use stored value // include number formats from conditional formatting diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index d77dc1041d9c..96484dc2f129 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -1,7 +1,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 @@ -43,14 +43,14 @@ #include "brdcst.hxx" #include "bcaslot.hxx" #include "cell.hxx" -#include "formula/errorcodes.hxx" // errCircularReference +#include "formula/errorcodes.hxx" // errCircularReference #include "scerrors.hxx" #include "docoptio.hxx" #include "refupdat.hxx" #include "table.hxx" #include "progress.hxx" -#include "scmod.hxx" // SC_MOD -#include "inputopt.hxx" // GetExpandRefs +#include "scmod.hxx" // SC_MOD +#include "inputopt.hxx" // GetExpandRefs #include "conditio.hxx" #include "sheetevents.hxx" #include <tools/shl.hxx> @@ -58,7 +58,7 @@ #include "globstr.hrc" -extern const ScFormulaCell* pLastFormulaTreeTop; // cellform.cxx Err527 WorkAround +extern const ScFormulaCell* pLastFormulaTreeTop; // cellform.cxx Err527 WorkAround // STATIC DATA ----------------------------------------------------------- @@ -92,7 +92,7 @@ void ScDocument::Broadcast( ULONG nHint, const ScAddress& rAddr, ) { if ( !pBASM ) - return ; // Clipboard or Undo + return ; // Clipboard or Undo ScHint aHint( nHint, rAddr, pCell ); Broadcast( aHint ); } @@ -101,7 +101,7 @@ void ScDocument::Broadcast( ULONG nHint, const ScAddress& rAddr, void ScDocument::Broadcast( const ScHint& rHint ) { if ( !pBASM ) - return ; // Clipboard or Undo + return ; // Clipboard or Undo if ( !nHardRecalcState ) { ScBulkBroadcast aBulkBroadcast( pBASM); // scoped bulk broadcast @@ -120,7 +120,7 @@ void ScDocument::Broadcast( const ScHint& rHint ) TrackFormulas( rHint.GetId() ); } - // Repaint fuer bedingte Formate mit relativen Referenzen: + // Repaint fuer bedingte Formate mit relativen Referenzen: if ( pCondFormList && rHint.GetAddress() != BCA_BRDCST_ALWAYS ) pCondFormList->SourceChanged( rHint.GetAddress() ); @@ -136,7 +136,7 @@ void ScDocument::Broadcast( const ScHint& rHint ) void ScDocument::AreaBroadcast( const ScHint& rHint ) { if ( !pBASM ) - return ; // Clipboard or Undo + return ; // Clipboard or Undo if ( !nHardRecalcState ) { ScBulkBroadcast aBulkBroadcast( pBASM); // scoped bulk broadcast @@ -144,7 +144,7 @@ void ScDocument::AreaBroadcast( const ScHint& rHint ) TrackFormulas( rHint.GetId() ); } - // Repaint fuer bedingte Formate mit relativen Referenzen: + // Repaint fuer bedingte Formate mit relativen Referenzen: if ( pCondFormList && rHint.GetAddress() != BCA_BRDCST_ALWAYS ) pCondFormList->SourceChanged( rHint.GetAddress() ); } @@ -226,7 +226,7 @@ void ScDocument::PutInFormulaTree( ScFormulaCell* pCell ) if ( pEOFormulaTree ) pEOFormulaTree->SetNext( pCell ); else - pFormulaTree = pCell; // kein Ende, kein Anfang.. + pFormulaTree = pCell; // kein Ende, kein Anfang.. pCell->SetPrevious( pEOFormulaTree ); pCell->SetNext( 0 ); pEOFormulaTree = pCell; @@ -243,13 +243,13 @@ void ScDocument::RemoveFromFormulaTree( ScFormulaCell* pCell ) { ScFormulaCell* pNext = pCell->GetNext(); if ( pPrev ) - pPrev->SetNext( pNext ); // gibt Vorlaeufer + pPrev->SetNext( pNext ); // gibt Vorlaeufer else - pFormulaTree = pNext; // ist erste Zelle + pFormulaTree = pNext; // ist erste Zelle if ( pNext ) - pNext->SetPrevious( pPrev ); // gibt Nachfolger + pNext->SetPrevious( pPrev ); // gibt Nachfolger else - pEOFormulaTree = pPrev; // ist letzte Zelle + pEOFormulaTree = pPrev; // ist letzte Zelle pCell->SetPrevious( 0 ); pCell->SetNext( 0 ); USHORT nRPN = pCell->GetCode()->GetCodeLen(); @@ -298,7 +298,7 @@ void ScDocument::CalcFormulaTree( BOOL bOnlyForced, BOOL bNoProgress ) while ( pCell ) { if ( pCell->GetDirty() ) - pCell = pCell->GetNext(); // alles klar + pCell = pCell->GetNext(); // alles klar else { if ( pCell->GetCode()->IsRecalcModeAlways() ) @@ -311,7 +311,7 @@ void ScDocument::CalcFormulaTree( BOOL bOnlyForced, BOOL bNoProgress ) pCell = pNext; } else - { // andere simpel berechnen + { // andere simpel berechnen pCell->SetDirtyVar(); pCell = pCell->GetNext(); } @@ -404,7 +404,7 @@ void ScDocument::AppendToFormulaTrack( ScFormulaCell* pCell ) if ( pEOFormulaTrack ) pEOFormulaTrack->SetNextTrack( pCell ); else - pFormulaTrack = pCell; // kein Ende, kein Anfang.. + pFormulaTrack = pCell; // kein Ende, kein Anfang.. pCell->SetPreviousTrack( pEOFormulaTrack ); pCell->SetNextTrack( 0 ); pEOFormulaTrack = pCell; @@ -421,13 +421,13 @@ void ScDocument::RemoveFromFormulaTrack( ScFormulaCell* pCell ) { ScFormulaCell* pNext = pCell->GetNextTrack(); if ( pPrev ) - pPrev->SetNextTrack( pNext ); // gibt Vorlaeufer + pPrev->SetNextTrack( pNext ); // gibt Vorlaeufer else - pFormulaTrack = pNext; // ist erste Zelle + pFormulaTrack = pNext; // ist erste Zelle if ( pNext ) - pNext->SetPreviousTrack( pPrev ); // gibt Nachfolger + pNext->SetPreviousTrack( pPrev ); // gibt Nachfolger else - pEOFormulaTrack = pPrev; // ist letzte Zelle + pEOFormulaTrack = pPrev; // ist letzte Zelle pCell->SetPreviousTrack( 0 ); pCell->SetNextTrack( 0 ); --nFormulaTrackCount; @@ -465,7 +465,7 @@ void ScDocument::TrackFormulas( ULONG nHintId ) if ( ( pBC = pTrack->GetBroadcaster() ) != NULL ) pBC->Broadcast( aHint ); pBASM->AreaBroadcast( aHint ); - // Repaint fuer bedingte Formate mit relativen Referenzen: + // Repaint fuer bedingte Formate mit relativen Referenzen: if ( pCondFormList ) pCondFormList->SourceChanged( pTrack->aPos ); // for "calculate" event, keep track of which sheets are affected by tracked formulas diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index e3c9d251fab7..bc2bf8c348e5 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -1,7 +1,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 @@ -85,7 +85,7 @@ #include "chartlis.hxx" #include "chartlock.hxx" #include "refupdat.hxx" -#include "validat.hxx" // fuer HasMacroCalls +#include "validat.hxx" // fuer HasMacroCalls #include "markdata.hxx" #include "scmod.hxx" #include "printopt.hxx" @@ -95,11 +95,11 @@ #include "charthelper.hxx" #include "dpobject.hxx" -#define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue() +#define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue() -// states for online spelling in the visible range (0 is set initially) -#define VSPL_START 0 -#define VSPL_DONE 1 +// states for online spelling in the visible range (0 is set initially) +#define VSPL_START 0 +#define VSPL_DONE 1 // STATIC DATA ----------------------------------------------------------- @@ -159,9 +159,9 @@ void ScDocument::SetPrinter( SfxPrinter* pNewPrinter ) { if ( pNewPrinter == pPrinter ) { - // #i6706# SetPrinter is called with the same printer again if - // the JobSetup has changed. In that case just call UpdateDrawPrinter - // (SetRefDevice for drawing layer) because of changed text sizes. + // #i6706# SetPrinter is called with the same printer again if + // the JobSetup has changed. In that case just call UpdateDrawPrinter + // (SetRefDevice for drawing layer) because of changed text sizes. UpdateDrawPrinter(); } else @@ -205,8 +205,8 @@ VirtualDevice* ScDocument::GetVirtualDevice_100th_mm() { if (!pVirtualDevice_100th_mm) { -// pVirtualDevice_100th_mm = new VirtualDevice; -// pVirtualDevice_100th_mm->SetMapMode( MAP_100TH_MM ); +// pVirtualDevice_100th_mm = new VirtualDevice; +// pVirtualDevice_100th_mm->SetMapMode( MAP_100TH_MM ); pVirtualDevice_100th_mm = new VirtualDevice( 1 ); pVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::REFDEV_MODE_MSO1); @@ -239,10 +239,10 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet, { case SFX_STYLE_FAMILY_PAGE: { - const USHORT nOldScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE); + const USHORT nOldScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE); const USHORT nOldScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES); rSet.Put( rChanges ); - const USHORT nNewScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE); + const USHORT nNewScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE); const USHORT nNewScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES); if ( (nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages) ) @@ -284,9 +284,9 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet, } // Bedeutung der Items in rChanges: - // Item gesetzt - Aenderung uebernehmen - // Dontcare - Default setzen - // Default - keine Aenderung + // Item gesetzt - Aenderung uebernehmen + // Dontcare - Default setzen + // Default - keine Aenderung // ("keine Aenderung" geht nicht mit PutExtended, darum Schleife) for (USHORT nWhich = ATTR_PATTERN_START; nWhich <= ATTR_PATTERN_END; nWhich++) { @@ -334,7 +334,7 @@ void ScDocument::InvalidateTextWidth( const String& rStyleName ) void ScDocument::InvalidateTextWidth( SCTAB nTab ) { - ScAddress aAdrFrom( 0, 0, nTab ); + ScAddress aAdrFrom( 0, 0, nTab ); ScAddress aAdrTo ( MAXCOL, MAXROW, nTab ); InvalidateTextWidth( &aAdrFrom, &aAdrTo, FALSE ); } @@ -343,7 +343,7 @@ void ScDocument::InvalidateTextWidth( SCTAB nTab ) BOOL ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab ) { - BOOL bInUse = FALSE; + BOOL bInUse = FALSE; const SCTAB nCount = GetTableCount(); SCTAB i; @@ -438,10 +438,10 @@ void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress //------------------------------------------------------------------------ -#define CALCMAX 1000 // Berechnungen -#define ABORT_EVENTS (INPUT_ANY & ~INPUT_TIMER & ~INPUT_OTHER) +#define CALCMAX 1000 // Berechnungen +#define ABORT_EVENTS (INPUT_ANY & ~INPUT_TIMER & ~INPUT_OTHER) -BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder versuchen +BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder versuchen { // #i75610# if a printer hasn't been set or created yet, don't create one for this if ( bIdleDisabled || IsInLinkUpdate() || GetPrinter(FALSE) == NULL ) @@ -451,22 +451,22 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers // ULONG nMs = 0; // USHORT nIter = 0; - const ULONG nStart = Time::GetSystemTicks(); - double nPPTX = 0.0; - double nPPTY = 0.0; - OutputDevice* pDev = NULL; - MapMode aOldMap; - ScStyleSheet* pStyle = NULL; - ScColumnIterator* pColIter = NULL; - ScTable* pTable = NULL; - ScColumn* pColumn = NULL; - ScBaseCell* pCell = NULL; - SCTAB nTab = aCurTextWidthCalcPos.Tab(); - SCROW nRow = aCurTextWidthCalcPos.Row(); - SCsCOL nCol = aCurTextWidthCalcPos.Col(); - USHORT nRestart = 0; - USHORT nZoom = 0; - BOOL bNeedMore= FALSE; + const ULONG nStart = Time::GetSystemTicks(); + double nPPTX = 0.0; + double nPPTY = 0.0; + OutputDevice* pDev = NULL; + MapMode aOldMap; + ScStyleSheet* pStyle = NULL; + ScColumnIterator* pColIter = NULL; + ScTable* pTable = NULL; + ScColumn* pColumn = NULL; + ScBaseCell* pCell = NULL; + SCTAB nTab = aCurTextWidthCalcPos.Tab(); + SCROW nRow = aCurTextWidthCalcPos.Row(); + SCsCOL nCol = aCurTextWidthCalcPos.Col(); + USHORT nRestart = 0; + USHORT nZoom = 0; + BOOL bNeedMore= FALSE; if ( !ValidRow(nRow) ) nRow = 0, nCol--; @@ -475,11 +475,11 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers if ( !ValidTab(nTab) || !pTab[nTab] ) nTab = 0; -// DBG_ERROR( String("Start = ") + String(nTab) + String(',') + String(nCol) + String(',') + String(nRow) ); +// DBG_ERROR( String("Start = ") + String(nTab) + String(',') + String(nCol) + String(',') + String(nRow) ); - // SearchMask/Family muss gemerkt werden, - // damit z.B. der Organizer nicht durcheinanderkommt, wenn zwischendurch eine - // Query-Box aufgemacht wird !!! + // SearchMask/Family muss gemerkt werden, + // damit z.B. der Organizer nicht durcheinanderkommt, wenn zwischendurch eine + // Query-Box aufgemacht wird !!! ScStyleSheetPool* pStylePool = xPoolHelper->GetStylePool(); USHORT nOldMask = pStylePool->GetSearchMask(); @@ -497,7 +497,7 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers { USHORT nCount = 0; - nZoom = GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALE); + nZoom = GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALE); Fraction aZoomFract( nZoom, 100 ); pColumn = &pTable->aCol[nCol]; pColIter = new ScColumnIterator( pColumn, nRow, MAXROW ); @@ -506,13 +506,13 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers { if ( pColIter->Next( nRow, pCell ) ) { - if ( TEXTWIDTH_DIRTY == pCell->GetTextWidth() ) + if ( TEXTWIDTH_DIRTY == pCell->GetTextWidth() ) { if ( !pDev ) { pDev = GetPrinter(); aOldMap = pDev->GetMapMode(); - pDev->SetMapMode( MAP_PIXEL ); // wichtig fuer GetNeededSize + pDev->SetMapMode( MAP_PIXEL ); // wichtig fuer GetNeededSize Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MAP_TWIP ); nPPTX = aPix1000.X() / 1000.0; @@ -525,15 +525,15 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers bProgress = TRUE; } -// DBG_ERROR( String("t,c,r = ") + String(nTab) + String(',') + String(nCol) + String(',') + String(nRow) ); -// DBG_ERROR( String("nOldWidth = ") + String(pCell->GetTextWidth()) ); +// DBG_ERROR( String("t,c,r = ") + String(nTab) + String(',') + String(nCol) + String(',') + String(nRow) ); +// DBG_ERROR( String("nOldWidth = ") + String(pCell->GetTextWidth()) ); USHORT nNewWidth = (USHORT)GetNeededSize( nCol, nRow, nTab, pDev, nPPTX, nPPTY, aZoomFract,aZoomFract, TRUE, - TRUE ); // bTotalSize + TRUE ); // bTotalSize -// DBG_ERROR( String("nNewWidth = ") + String(nNewWidth) ); +// DBG_ERROR( String("nNewWidth = ") + String(nNewWidth) ); pCell->SetTextWidth( nNewWidth ); @@ -618,7 +618,7 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers delete pColIter; -// DBG_ERROR( String(nCount) + String(" End = ") + String(nTab) + String(',') + String(nCol) + String(',') + String(nRow) ); +// DBG_ERROR( String(nCount) + String(" End = ") + String(nTab) + String(',') + String(nCol) + String(',') + String(nRow) ); if (pDev) pDev->SetMapMode(aOldMap); @@ -640,7 +640,7 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers class ScSpellStatus { public: - BOOL bModified; + BOOL bModified; ScSpellStatus() : bModified(FALSE) {}; @@ -656,38 +656,38 @@ IMPL_LINK( ScSpellStatus, EventHdl, EditStatus *, pStatus ) return 0; } -// SPELL_MAXCELLS muss mindestens 256 sein, solange am Iterator keine -// Start-Spalte gesetzt werden kann +// SPELL_MAXCELLS muss mindestens 256 sein, solange am Iterator keine +// Start-Spalte gesetzt werden kann -//! SPELL_MAXTEST fuer Timer und Idle unterschiedlich ??? +//! SPELL_MAXTEST fuer Timer und Idle unterschiedlich ??? -// SPELL_MAXTEST now divided between visible and rest of document +// SPELL_MAXTEST now divided between visible and rest of document -#define SPELL_MAXTEST_VIS 1 -#define SPELL_MAXTEST_ALL 3 -#define SPELL_MAXCELLS 256 +#define SPELL_MAXTEST_VIS 1 +#define SPELL_MAXTEST_ALL 3 +#define SPELL_MAXCELLS 256 BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpellPos, USHORT nMaxTest ) { - ScEditEngineDefaulter* pEngine = NULL; //! am Dokument speichern + ScEditEngineDefaulter* pEngine = NULL; //! am Dokument speichern SfxItemSet* pDefaults = NULL; ScSpellStatus aStatus; - USHORT nCellCount = 0; // Zellen insgesamt - USHORT nTestCount = 0; // Aufrufe Spelling - BOOL bChanged = FALSE; // Aenderungen? + USHORT nCellCount = 0; // Zellen insgesamt + USHORT nTestCount = 0; // Aufrufe Spelling + BOOL bChanged = FALSE; // Aenderungen? - SCCOL nCol = rSpellRange.aStart.Col(); // iterator always starts on the left edge + SCCOL nCol = rSpellRange.aStart.Col(); // iterator always starts on the left edge SCROW nRow = rSpellPos.Row(); SCTAB nTab = rSpellPos.Tab(); - if ( !pTab[nTab] ) // sheet deleted? + if ( !pTab[nTab] ) // sheet deleted? { nTab = rSpellRange.aStart.Tab(); nRow = rSpellRange.aStart.Row(); if ( !pTab[nTab] ) { - // may happen for visible range + // may happen for visible range return FALSE; } } @@ -695,7 +695,7 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe rSpellRange.aStart.Col(), nRow, rSpellRange.aEnd.Col(), rSpellRange.aEnd.Row() ); ScBaseCell* pCell = aIter.GetNext( nCol, nRow ); - // skip everything left of rSpellPos: + // skip everything left of rSpellPos: while ( pCell && nRow == rSpellPos.Row() && nCol < rSpellPos.Col() ) pCell = aIter.GetNext( nCol, nRow ); @@ -710,13 +710,13 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe { if (!pEngine) { - // #71154# ScTabEditEngine is needed - // because MapMode must be set for some old documents + // #71154# ScTabEditEngine is needed + // because MapMode must be set for some old documents pEngine = new ScTabEditEngine( this ); pEngine->SetControlWord( pEngine->GetControlWord() | ( EE_CNTRL_ONLINESPELLING | EE_CNTRL_ALLOWBIGOBJS ) ); pEngine->SetStatusEventHdl( LINK( &aStatus, ScSpellStatus, EventHdl ) ); - // Delimiters hier wie in inputhdl.cxx !!! + // Delimiters hier wie in inputhdl.cxx !!! pEngine->SetWordDelimiters( ScEditUtil::ModifyDelimiters( pEngine->GetWordDelimiters() ) ); pDefaults = new SfxItemSet( pEngine->GetEmptyItemSet() ); @@ -728,7 +728,7 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab ); pPattern->FillEditItemSet( pDefaults ); - pEngine->SetDefaults( pDefaults, FALSE ); //! noetig ? + pEngine->SetDefaults( pDefaults, FALSE ); //! noetig ? USHORT nCellLang = ((const SvxLanguageItem&) pPattern->GetItem(ATTR_FONT_LANGUAGE)).GetValue(); @@ -747,9 +747,9 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe aStatus.bModified = FALSE; pEngine->CompleteOnlineSpelling(); - if ( aStatus.bModified ) // Fehler dazu oder weggekommen? + if ( aStatus.bModified ) // Fehler dazu oder weggekommen? { - BOOL bNeedEdit = TRUE; // Test auf einfachen Text + BOOL bNeedEdit = TRUE; // Test auf einfachen Text if ( !pEngine->HasOnlineSpellErrors() ) { ScEditAttrTester aTester( pEngine ); @@ -767,14 +767,14 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe this, pEngine->GetEditTextObjectPool() ) ); delete pNewData; } - else // einfacher String + else // einfacher String PutCell( nCol, nRow, nTab, new ScStringCell( pEngine->GetText() ) ); - // Paint + // Paint if (pShell) { - // #47751# Seitenvorschau ist davon nicht betroffen - // (sollte jedenfalls nicht) + // #47751# Seitenvorschau ist davon nicht betroffen + // (sollte jedenfalls nicht) ScPaintHint aHint( ScRange( nCol, nRow, nTab ), PAINT_GRID ); aHint.SetPrintFlag( FALSE ); pShell->Broadcast( aHint ); @@ -783,17 +783,17 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe bChanged = TRUE; } - if ( ++nTestCount >= nMaxTest ) // checked enough text? + if ( ++nTestCount >= nMaxTest ) // checked enough text? break; } - if ( ++nCellCount >= SPELL_MAXCELLS ) // seen enough cells? + if ( ++nCellCount >= SPELL_MAXCELLS ) // seen enough cells? break; } if ( pCell ) { - ++nCol; // continue after last cell + ++nCol; // continue after last cell if ( nCol > rSpellRange.aEnd.Col() ) { nCol = rSpellRange.aStart.Col(); @@ -803,7 +803,7 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe } } - if (!pCell) // end of range reached -> next sheet + if (!pCell) // end of range reached -> next sheet { ++nTab; if ( nTab > rSpellRange.aEnd.Tab() || !pTab[nTab] ) @@ -811,12 +811,12 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe nCol = rSpellRange.aStart.Col(); nRow = rSpellRange.aStart.Row(); - nVisSpellState = VSPL_DONE; //! only if this is for the visible range + nVisSpellState = VSPL_DONE; //! only if this is for the visible range } rSpellPos.Set( nCol, nRow, nTab ); delete pDefaults; - delete pEngine; // bevor aStatus out of scope geht + delete pEngine; // bevor aStatus out of scope geht return bChanged; } @@ -832,23 +832,23 @@ BOOL ScDocument::ContinueOnlineSpelling() BOOL bOldInserting = IsInsertingFromOtherDoc(); SetInsertingFromOtherDoc( TRUE ); - //! use one EditEngine for both calls + //! use one EditEngine for both calls - // #41504# first check visible range + // #41504# first check visible range BOOL bResult = OnlineSpellInRange( aVisSpellRange, aVisSpellPos, SPELL_MAXTEST_VIS ); - // during first pass through visible range, always continue + // during first pass through visible range, always continue if ( nVisSpellState == VSPL_START ) bResult = TRUE; if (bResult) { - // if errors found, continue there + // if errors found, continue there OnlineSpellInRange( aVisSpellRange, aVisSpellPos, SPELL_MAXTEST_ALL ); } else { - // if nothing found there, continue with rest of document + // if nothing found there, continue with rest of document ScRange aTotalRange( 0,0,0, MAXCOL,MAXROW,MAXTAB ); bResult = OnlineSpellInRange( aTotalRange, aOnlineSpellPos, SPELL_MAXTEST_ALL ); } @@ -863,7 +863,7 @@ void ScDocument::SetOnlineSpellPos( const ScAddress& rPos ) { aOnlineSpellPos = rPos; - // skip visible area for aOnlineSpellPos + // skip visible area for aOnlineSpellPos if ( aVisSpellRange.In( aOnlineSpellPos ) ) aOnlineSpellPos = aVisSpellRange.aEnd; } @@ -873,7 +873,7 @@ BOOL ScDocument::SetVisibleSpellRange( const ScRange& rNewRange ) BOOL bChange = ( aVisSpellRange != rNewRange ); if (bChange) { - // continue spelling through visible range when scrolling down + // continue spelling through visible range when scrolling down BOOL bContDown = ( nVisSpellState == VSPL_START && rNewRange.In( aVisSpellPos ) && rNewRange.aStart.Row() > aVisSpellRange.aStart.Row() && rNewRange.aStart.Col() == aVisSpellRange.aStart.Col() && @@ -887,7 +887,7 @@ BOOL ScDocument::SetVisibleSpellRange( const ScRange& rNewRange ) nVisSpellState = VSPL_START; } - // skip visible area for aOnlineSpellPos + // skip visible area for aOnlineSpellPos if ( aVisSpellRange.In( aOnlineSpellPos ) ) aOnlineSpellPos = aVisSpellRange.aEnd; } @@ -896,7 +896,7 @@ BOOL ScDocument::SetVisibleSpellRange( const ScRange& rNewRange ) void ScDocument::RemoveAutoSpellObj() { - // alle Spelling-Informationen entfernen + // alle Spelling-Informationen entfernen for (SCTAB nTab=0; nTab<=MAXTAB && pTab[nTab]; nTab++) pTab[nTab]->RemoveAutoSpellObj(); @@ -904,7 +904,7 @@ void ScDocument::RemoveAutoSpellObj() //------------------------------------------------------------------------ -BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuchen +BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuchen { BOOL bAnyLeft = FALSE; @@ -933,13 +933,13 @@ BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuche void ScDocument::SaveDdeLinks(SvStream& rStream) const { - // bei 4.0-Export alle mit Modus != DEFAULT weglassen + // bei 4.0-Export alle mit Modus != DEFAULT weglassen BOOL bExport40 = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_40 ); const ::sfx2::SvBaseLinks& rLinks = GetLinkManager()->GetLinks(); USHORT nCount = rLinks.Count(); - // erstmal zaehlen... + // erstmal zaehlen... USHORT nDdeCount = 0; USHORT i; @@ -951,12 +951,12 @@ void ScDocument::SaveDdeLinks(SvStream& rStream) const ++nDdeCount; } - // Header + // Header ScMultipleWriteHeader aHdr( rStream ); rStream << nDdeCount; - // Links speichern + // Links speichern for (i=0; i<nCount; i++) { @@ -987,7 +987,7 @@ void ScDocument::LoadDdeLinks(SvStream& rStream) BOOL ScDocument::HasDdeLinks() const { - if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager + if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); USHORT nCount = rLinks.Count(); @@ -1001,7 +1001,7 @@ BOOL ScDocument::HasDdeLinks() const void ScDocument::SetInLinkUpdate(BOOL bSet) { - // called from TableLink and AreaLink + // called from TableLink and AreaLink DBG_ASSERT( bInLinkUpdate != bSet, "SetInLinkUpdate twice" ); bInLinkUpdate = bSet; @@ -1094,9 +1094,9 @@ void ScDocument::UpdateDdeLinks() BOOL ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const String& rItem ) { - // fuer refresh() per StarOne Api - // ResetValue() fuer einzelnen Link nicht noetig - //! wenn's mal alles asynchron wird, aber auch hier + // fuer refresh() per StarOne Api + // ResetValue() fuer einzelnen Link nicht noetig + //! wenn's mal alles asynchron wird, aber auch hier BOOL bFound = FALSE; if (GetLinkManager()) @@ -1132,14 +1132,14 @@ void ScDocument::DisconnectDdeLinks() { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScDdeLink)) - pBase->Disconnect(); // bleibt im LinkManager eingetragen + pBase->Disconnect(); // bleibt im LinkManager eingetragen } } } void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const { - if (bIsClip) // aus Stream erzeugen + if (bIsClip) // aus Stream erzeugen { if (pClipData) { @@ -1315,7 +1315,7 @@ bool ScDocument::SetDdeLinkResultMatrix( USHORT nDdePos, ScMatrix* pResults ) BOOL ScDocument::HasAreaLinks() const { - if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager + if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); USHORT nCount = rLinks.Count(); @@ -1442,12 +1442,12 @@ void ScDocument::KeyInput( const KeyEvent& ) apTemporaryChartLock->StartOrContinueLocking(); } -// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- BOOL ScDocument::CheckMacroWarn() { - // The check for macro configuration, macro warning and disabling is now handled - // in SfxObjectShell::AdjustMacroMode, called by SfxObjectShell::CallBasic. + // The check for macro configuration, macro warning and disabling is now handled + // in SfxObjectShell::AdjustMacroMode, called by SfxObjectShell::CallBasic. return TRUE; } @@ -1456,17 +1456,17 @@ BOOL ScDocument::CheckMacroWarn() SfxBindings* ScDocument::GetViewBindings() { - // used to invalidate slots after changes to this document + // used to invalidate slots after changes to this document if ( !pShell ) - return NULL; // no ObjShell -> no view + return NULL; // no ObjShell -> no view - // first check current view + // first check current view SfxViewFrame* pViewFrame = SfxViewFrame::Current(); - if ( pViewFrame && pViewFrame->GetObjectShell() != pShell ) // wrong document? + if ( pViewFrame && pViewFrame->GetObjectShell() != pShell ) // wrong document? pViewFrame = NULL; - // otherwise use first view for this doc + // otherwise use first view for this doc if ( !pViewFrame ) pViewFrame = SfxViewFrame::GetFirst( pShell ); @@ -1482,7 +1482,7 @@ void lcl_TransliterateEditEngine( ScEditEngineDefaulter& rEngine, utl::TransliterationWrapper& rTranslitarationWrapper, BOOL bConsiderLanguage, ScDocument* pDoc ) { - //! should use TransliterateText method of EditEngine instead, when available! + //! should use TransliterateText method of EditEngine instead, when available! sal_uInt16 nLanguage = LANGUAGE_SYSTEM; @@ -1502,7 +1502,7 @@ void lcl_TransliterateEditEngine( ScEditEngineDefaulter& rEngine, String aOldStr = rEngine.GetText( aSel ); SfxItemSet aAttr = rEngine.GetAttribs( aSel ); - if ( aAttr.GetItemState( EE_FEATURE_FIELD ) != SFX_ITEM_ON ) // fields are not touched + if ( aAttr.GetItemState( EE_FEATURE_FIELD ) != SFX_ITEM_ON ) // fields are not touched { if ( bConsiderLanguage ) { @@ -1537,7 +1537,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp BOOL bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); sal_uInt16 nLanguage = LANGUAGE_SYSTEM; - ScEditEngineDefaulter* pEngine = NULL; // not using pEditEngine member because of defaults + ScEditEngineDefaulter* pEngine = NULL; // not using pEditEngine member because of defaults SCTAB nCount = GetTableCount(); for (SCTAB nTab = 0; nTab < nCount; nTab++) @@ -1563,7 +1563,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp if ( bConsiderLanguage ) { - BYTE nScript = GetStringScriptType( aOldStr ); //! cell script type? + BYTE nScript = GetStringScriptType( aOldStr ); //! cell script type? USHORT nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? ATTR_CJK_FONT_LANGUAGE : ( ( nScript == SCRIPTTYPE_COMPLEX ) ? ATTR_CTL_FONT_LANGUAGE : ATTR_FONT_LANGUAGE ); diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index abef7d53c2af..92b5fb7d0bc8 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -1,7 +1,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 @@ -61,7 +61,7 @@ #include "rechead.hxx" #include "poolhelp.hxx" #include "docpool.hxx" -#include "detfunc.hxx" // for UpdateAllComments +#include "detfunc.hxx" // for UpdateAllComments #include "editutil.hxx" #include "postit.hxx" #include "charthelper.hxx" @@ -128,8 +128,8 @@ void ScDocument::TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDes } } - // #71726# make sure the data references of charts are adapted - // (this must be after InsertObject!) + // #71726# make sure the data references of charts are adapted + // (this must be after InsertObject!) ScChartHelper::AdjustRangesOfChartsOnDestinationPage( pSrcDoc, this, nSrcPos, nDestPos ); } @@ -138,30 +138,30 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell ) if (pDocShell && !pShell) pShell = pDocShell; -// DBG_ASSERT(pShell,"InitDrawLayer ohne Shell"); +// DBG_ASSERT(pShell,"InitDrawLayer ohne Shell"); if (!pDrawLayer) { String aName; - if ( pShell && !pShell->IsLoading() ) // #88438# don't call GetTitle while loading + if ( pShell && !pShell->IsLoading() ) // #88438# don't call GetTitle while loading aName = pShell->GetTitle(); pDrawLayer = new ScDrawLayer( this, aName ); if (GetLinkManager()) pDrawLayer->SetLinkManager( pLinkManager ); - // Drawing pages are accessed by table number, so they must also be present - // for preceding table numbers, even if the tables aren't allocated - // (important for clipboard documents). + // Drawing pages are accessed by table number, so they must also be present + // for preceding table numbers, even if the tables aren't allocated + // (important for clipboard documents). SCTAB nDrawPages = 0; SCTAB nTab; for (nTab=0; nTab<=MAXTAB; nTab++) if (pTab[nTab]) - nDrawPages = nTab + 1; // needed number of pages + nDrawPages = nTab + 1; // needed number of pages for (nTab=0; nTab<nDrawPages; nTab++) { - pDrawLayer->ScAddPage( nTab ); // always add page, with or without the table + pDrawLayer->ScAddPage( nTab ); // always add page, with or without the table if (pTab[nTab]) { String aTabName; @@ -170,7 +170,7 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell ) pTab[nTab]->SetDrawPageSize(false,false); // #54782# set the right size immediately #if 0 - ULONG nx = (ULONG) ((double) (MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS ); + ULONG nx = (ULONG) ((double) (MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS ); ULONG ny = (ULONG) ((double) (MAXROW+1) * ScGlobal::nStdRowHeight * HMM_PER_TWIPS ); pDrawLayer->SetPageSize( nTab, Size( nx, ny ) ); #endif @@ -220,8 +220,8 @@ void ScDocument::UpdateDrawPrinter() // use the printer even if IsValid is false // Application::GetDefaultDevice causes trouble with changing MapModes -// OutputDevice* pRefDev = GetPrinter(); -// pRefDev->SetMapMode( MAP_100TH_MM ); +// OutputDevice* pRefDev = GetPrinter(); +// pRefDev->SetMapMode( MAP_100TH_MM ); pDrawLayer->SetRefDevice(GetRefDevice()); } } @@ -292,7 +292,7 @@ void ScDocument::DeleteObjectsInSelection( const ScMarkData& rMark ) BOOL ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkData* pTabMark ) { - // pTabMark is used only for selected tables. If pTabMark is 0, all tables of rRange are used. + // pTabMark is used only for selected tables. If pTabMark is 0, all tables of rRange are used. if (!pDrawLayer) return FALSE; @@ -414,10 +414,10 @@ void ScDocument::StartAnimations( SCTAB nTab, Window* pWin ) BOOL ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect ) { - // Gibt es Objekte auf dem Hintergrund-Layer, die (teilweise) von rMMRect - // betroffen sind? - // (fuer Drawing-Optimierung, vor dem Hintergrund braucht dann nicht geloescht - // zu werden) + // Gibt es Objekte auf dem Hintergrund-Layer, die (teilweise) von rMMRect + // betroffen sind? + // (fuer Drawing-Optimierung, vor dem Hintergrund braucht dann nicht geloescht + // zu werden) if (!pDrawLayer) return FALSE; @@ -442,9 +442,9 @@ BOOL ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect ) BOOL ScDocument::HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect ) { - // Gibt es ueberhaupt Objekte, die (teilweise) von rMMRect - // betroffen sind? - // (um leere Seiten beim Drucken zu erkennen) + // Gibt es ueberhaupt Objekte, die (teilweise) von rMMRect + // betroffen sind? + // (um leere Seiten beim Drucken zu erkennen) if (!pDrawLayer) return FALSE; @@ -475,7 +475,7 @@ void ScDocument::EnsureGraphicNames() SdrObject* ScDocument::GetObjectAtPoint( SCTAB nTab, const Point& rPos ) { - // fuer Drag&Drop auf Zeichenobjekt + // fuer Drag&Drop auf Zeichenobjekt SdrObject* pFound = NULL; if (pDrawLayer && pTab[nTab]) @@ -490,8 +490,8 @@ SdrObject* ScDocument::GetObjectAtPoint( SCTAB nTab, const Point& rPos ) { if ( pObject->GetCurrentBoundRect().IsInside(rPos) ) { - // Intern interessiert gar nicht - // Objekt vom Back-Layer nur, wenn kein Objekt von anderem Layer getroffen + // Intern interessiert gar nicht + // Objekt vom Back-Layer nur, wenn kein Objekt von anderem Layer getroffen SdrLayerID nLayer = pObject->GetLayer(); if ( (nLayer != SC_LAYER_INTERN) && (nLayer != SC_LAYER_HIDDEN) ) @@ -503,7 +503,7 @@ SdrObject* ScDocument::GetObjectAtPoint( SCTAB nTab, const Point& rPos ) } } } - // weitersuchen -> letztes (oberstes) getroffenes Objekt nehmen + // weitersuchen -> letztes (oberstes) getroffenes Objekt nehmen pObject = aIter.Next(); } @@ -519,13 +519,13 @@ BOOL ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, if (!IsBlockEmpty( nTab, nStartCol, nStartRow, nEndCol, nEndRow )) return FALSE; - ScDocument* pThis = (ScDocument*)this; //! GetMMRect / HasAnyDraw etc. const !!! + ScDocument* pThis = (ScDocument*)this; //! GetMMRect / HasAnyDraw etc. const !!! Rectangle aMMRect; if ( pLastRange && pLastMM && nTab == pLastRange->aStart.Tab() && nStartRow == pLastRange->aStart.Row() && nEndRow == pLastRange->aEnd.Row() ) { - // keep vertical part of aMMRect, only update horizontal position + // keep vertical part of aMMRect, only update horizontal position aMMRect = *pLastMM; long nLeft = 0; @@ -553,17 +553,17 @@ BOOL ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, if ( nStartCol > 0 && !bLeftIsEmpty ) { - // aehnlich wie in ScPrintFunc::AdjustPrintArea - //! ExtendPrintArea erst ab Start-Spalte des Druckbereichs + // aehnlich wie in ScPrintFunc::AdjustPrintArea + //! ExtendPrintArea erst ab Start-Spalte des Druckbereichs SCCOL nExtendCol = nStartCol - 1; SCROW nTmpRow = nEndRow; pThis->ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab, - FALSE, TRUE ); // kein Refresh, incl. Attrs + FALSE, TRUE ); // kein Refresh, incl. Attrs OutputDevice* pDev = pThis->GetPrinter(); - pDev->SetMapMode( MAP_PIXEL ); // wichtig fuer GetNeededSize + pDev->SetMapMode( MAP_PIXEL ); // wichtig fuer GetNeededSize pThis->ExtendPrintArea( pDev, nTab, 0, nStartRow, nExtendCol, nEndRow ); if ( nExtendCol >= nStartCol ) return FALSE; @@ -637,9 +637,9 @@ void ScDocument::InvalidateControls( Window* pWin, SCTAB nTab, const Rectangle& Rectangle aObjRect = pObject->GetLogicRect(); if ( aObjRect.IsOver( rMMRect ) ) { - // Uno-Controls zeichnen sich immer komplett, ohne Ruecksicht - // auf ClippingRegions. Darum muss das ganze Objekt neu gepainted - // werden, damit die Selektion auf der Tabelle nicht uebermalt wird. + // Uno-Controls zeichnen sich immer komplett, ohne Ruecksicht + // auf ClippingRegions. Darum muss das ganze Objekt neu gepainted + // werden, damit die Selektion auf der Tabelle nicht uebermalt wird. //pWin->Invalidate( aObjRect.GetIntersection( rMMRect ) ); pWin->Invalidate( aObjRect ); @@ -654,8 +654,8 @@ void ScDocument::InvalidateControls( Window* pWin, SCTAB nTab, const Rectangle& BOOL ScDocument::HasDetectiveObjects(SCTAB nTab) const { - // looks for detective objects, annotations don't count - // (used to adjust scale so detective objects hit their cells better) + // looks for detective objects, annotations don't count + // (used to adjust scale so detective objects hit their cells better) BOOL bFound = FALSE; @@ -683,11 +683,11 @@ BOOL ScDocument::HasDetectiveObjects(SCTAB nTab) const void ScDocument::UpdateFontCharSet() { - // In alten Versionen (bis incl. 4.0 ohne SP) wurden beim Austausch zwischen - // Systemen die CharSets in den Font-Attributen nicht angepasst. - // Das muss fuer Dokumente bis incl SP2 nun nachgeholt werden: - // Alles, was nicht SYMBOL ist, wird auf den System-CharSet umgesetzt. - // Bei neuen Dokumenten (Version SC_FONTCHARSET) sollte der CharSet stimmen. + // In alten Versionen (bis incl. 4.0 ohne SP) wurden beim Austausch zwischen + // Systemen die CharSets in den Font-Attributen nicht angepasst. + // Das muss fuer Dokumente bis incl SP2 nun nachgeholt werden: + // Alles, was nicht SYMBOL ist, wird auf den System-CharSet umgesetzt. + // Bei neuen Dokumenten (Version SC_FONTCHARSET) sollte der CharSet stimmen. BOOL bUpdateOld = ( nSrcVer < SC_FONTCHARSET ); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 1efe32446eef..b7ecc946225c 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1,7 +1,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 @@ -83,7 +83,7 @@ #include "detdata.hxx" #include "cell.hxx" #include "dpobject.hxx" -#include "detfunc.hxx" // for UpdateAllComments +#include "detfunc.hxx" // for UpdateAllComments #include "scmod.hxx" #include "dociter.hxx" #include "progress.hxx" @@ -104,9 +104,9 @@ using ::std::set; struct ScDefaultAttr { - const ScPatternAttr* pAttr; - SCROW nFirst; - SCSIZE nCount; + const ScPatternAttr* pAttr; + SCROW nFirst; + SCSIZE nCount; ScDefaultAttr(const ScPatternAttr* pPatAttr) : pAttr(pPatAttr), nFirst(0), nCount(0) {} }; @@ -118,7 +118,7 @@ struct ScLessDefaultAttr } }; -typedef std::set<ScDefaultAttr, ScLessDefaultAttr> ScDefaultAttrSet; +typedef std::set<ScDefaultAttr, ScLessDefaultAttr> ScDefaultAttrSet; void ScDocument::MakeTable( SCTAB nTab,bool _bNeedsNameCheck ) { @@ -127,7 +127,7 @@ void ScDocument::MakeTable( SCTAB nTab,bool _bNeedsNameCheck ) String aString = ScGlobal::GetRscString(STR_TABLE_DEF); //"Tabelle" aString += String::CreateFromInt32(nTab+1); if ( _bNeedsNameCheck ) - CreateValidTabName( aString ); // keine doppelten + CreateValidTabName( aString ); // keine doppelten pTab[nTab] = new ScTable(this, nTab, aString); pTab[nTab]->SetLoadingMedium(bLoadingMedium); @@ -158,7 +158,7 @@ BOOL ScDocument::GetName( SCTAB nTab, String& rName ) const return FALSE; } -BOOL ScDocument::SetCodeName( SCTAB nTab, String& rName ) +BOOL ScDocument::SetCodeName( SCTAB nTab, String& rName ) { if (VALIDTAB(nTab)) { @@ -265,15 +265,15 @@ void ScDocument::CreateValidTabName(String& rName) const // neu erzeugen const String aStrTable( ScResId(SCSTR_TABLE) ); - BOOL bOk = FALSE; + BOOL bOk = FALSE; - // vorneweg testen, ob der Prefix als gueltig erkannt wird - // wenn nicht, nur doppelte vermeiden + // vorneweg testen, ob der Prefix als gueltig erkannt wird + // wenn nicht, nur doppelte vermeiden BOOL bPrefix = ValidTabName( aStrTable ); DBG_ASSERT(bPrefix, "ungueltiger Tabellenname"); SCTAB nDummy; - SCTAB nLoops = 0; // "zur Sicherheit" + SCTAB nLoops = 0; // "zur Sicherheit" for ( SCTAB i = nMaxTableNumber+1; !bOk && nLoops <= MAXTAB; i++ ) { rName = aStrTable; @@ -314,9 +314,9 @@ void ScDocument::CreateValidTabName(String& rName) const BOOL ScDocument::InsertTab( SCTAB nPos, const String& rName, BOOL bExternalDocument ) { - SCTAB nTabCount = GetTableCount(); - BOOL bValid = ValidTab(nTabCount); - if ( !bExternalDocument ) // sonst rName == "'Doc'!Tab", vorher pruefen + SCTAB nTabCount = GetTableCount(); + BOOL bValid = ValidTab(nTabCount); + if ( !bExternalDocument ) // sonst rName == "'Doc'!Tab", vorher pruefen bValid = (bValid && ValidNewTabName(rName)); if (bValid) { @@ -372,7 +372,7 @@ BOOL ScDocument::InsertTab( SCTAB nPos, const String& rName, if (pTab[i]) pTab[i]->StartAllListeners(); - // update conditional formats after table is inserted + // update conditional formats after table is inserted if ( pCondFormList ) pCondFormList->UpdateReference( URM_INSDEL, aRange, 0,0,1 ); if ( pValidationList ) @@ -403,7 +403,7 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) if (nTabCount > 1) { BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden ScRange aRange( 0, 0, nTab, MAXCOL, MAXROW, nTab ); DelBroadcastAreasInRange( aRange ); @@ -481,13 +481,13 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) BOOL ScDocument::RenameTab( SCTAB nTab, const String& rName, BOOL /* bUpdateRef */, BOOL bExternalDocument ) { - BOOL bValid = FALSE; - SCTAB i; + BOOL bValid = FALSE; + SCTAB i; if VALIDTAB(nTab) if (pTab[nTab]) { if ( bExternalDocument ) - bValid = TRUE; // zusammengesetzter Name + bValid = TRUE; // zusammengesetzter Name else bValid = ValidTabName(rName); for (i=0; (i<=MAXTAB) && bValid; i++) @@ -586,10 +586,10 @@ void ScDocument::SetLayoutRTL( SCTAB nTab, BOOL bRTL ) return; } - pTab[nTab]->SetLayoutRTL( bRTL ); // only sets the flag + pTab[nTab]->SetLayoutRTL( bRTL ); // only sets the flag pTab[nTab]->SetDrawPageSize(); - // mirror existing objects: + // mirror existing objects: if (pDrawLayer) { @@ -601,8 +601,8 @@ void ScDocument::SetLayoutRTL( SCTAB nTab, BOOL bRTL ) SdrObject* pObject = aIter.Next(); while (pObject) { - // objects with ScDrawObjData are re-positioned in SetPageSize, - // don't mirror again + // objects with ScDrawObjData are re-positioned in SetPageSize, + // don't mirror again ScDrawObjData* pData = ScDrawLayer::GetObjData( pObject ); if ( !pData ) pDrawLayer->MirrorRTL( pObject ); @@ -628,8 +628,8 @@ BOOL ScDocument::IsLayoutRTL( SCTAB nTab ) const BOOL ScDocument::IsNegativePage( SCTAB nTab ) const { - // Negative page area is always used for RTL layout. - // The separate method is used to find all RTL handling of drawing objects. + // Negative page area is always used for RTL layout. + // The separate method is used to find all RTL handling of drawing objects. return IsLayoutRTL( nTab ); } @@ -637,7 +637,7 @@ BOOL ScDocument::IsNegativePage( SCTAB nTab ) const /* ---------------------------------------------------------------------------- benutzten Bereich suchen: - GetCellArea - nur Daten + GetCellArea - nur Daten GetTableArea - Daten / Attribute GetPrintArea - beruecksichtigt auch Zeichenobjekte, streicht Attribute bis ganz rechts / unten @@ -706,7 +706,7 @@ bool ScDocument::ShrinkToUsedDataArea( SCTAB nTab, SCCOL& rStartCol, return pTab[nTab]->ShrinkToUsedDataArea( rStartCol, rStartRow, rEndCol, rEndRow, bColumnsOnly); } -// zusammenhaengender Bereich +// zusammenhaengender Bereich void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld, bool bOnlyDown ) const @@ -837,7 +837,7 @@ BOOL ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, BOOL bTest = TRUE; BOOL bRet = FALSE; BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for ( i = nStartTab; i <= nEndTab && bTest; i++) if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i))) bTest &= pTab[i]->TestInsertRow( nStartCol, nEndCol, nSize ); @@ -871,8 +871,8 @@ BOOL ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i))) pTab[i]->InsertRow( nStartCol, nEndCol, nStartRow, nSize ); - // #82991# UpdateRef for drawing layer must be after inserting, - // when the new row heights are known. + // #82991# UpdateRef for drawing layer must be after inserting, + // when the new row heights are known. for (i=nStartTab; i<=nEndTab; i++) if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i))) pTab[i]->UpdateDrawRef( URM_INSDEL, @@ -880,7 +880,7 @@ BOOL ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, 0, static_cast<SCsROW>(nSize), 0 ); if ( pChangeTrack && pChangeTrack->IsInDeleteUndo() ) - { // durch Restaurierung von Referenzen auf geloeschte Bereiche ist + { // durch Restaurierung von Referenzen auf geloeschte Bereiche ist // ein neues Listening faellig, bisherige Listener wurden in // FormulaCell UpdateReference abgehaengt StartAllListeners(); @@ -931,7 +931,7 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab, } BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden // handle chunks of consecutive selected sheets together SCTAB nTabRangeStart = nStartTab; @@ -1040,7 +1040,7 @@ BOOL ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab, BOOL bTest = TRUE; BOOL bRet = FALSE; BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for ( i = nStartTab; i <= nEndTab && bTest; i++) if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i))) bTest &= pTab[i]->TestInsertCol( nStartRow, nEndRow, nSize ); @@ -1072,7 +1072,7 @@ BOOL ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab, pTab[i]->InsertCol( nStartCol, nStartRow, nEndRow, nSize ); if ( pChangeTrack && pChangeTrack->IsInDeleteUndo() ) - { // durch Restaurierung von Referenzen auf geloeschte Bereiche ist + { // durch Restaurierung von Referenzen auf geloeschte Bereiche ist // ein neues Listening faellig, bisherige Listener wurden in // FormulaCell UpdateReference abgehaengt StartAllListeners(); @@ -1121,7 +1121,7 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA } BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden // handle chunks of consecutive selected sheets together SCTAB nTabRangeStart = nStartTab; @@ -1190,8 +1190,8 @@ void ScDocument::DeleteCol( const ScRange& rRange, ScDocument* pRefUndoDoc, BOOL } -// fuer Area-Links: Zellen einuegen/loeschen, wenn sich der Bereich veraendert -// (ohne Paint) +// fuer Area-Links: Zellen einuegen/loeschen, wenn sich der Bereich veraendert +// (ohne Paint) void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew, @@ -1210,32 +1210,32 @@ void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew, SCROW nNewEndY = rNew.aEnd.Row(); SCTAB nTab = rOld.aStart.Tab(); - // wenn es mehr Zeilen werden, werden Spalten auf der alten Hoehe eingefuegt/geloescht + // wenn es mehr Zeilen werden, werden Spalten auf der alten Hoehe eingefuegt/geloescht BOOL bGrowY = ( nNewEndY > nOldEndY ); SCROW nColEndY = bGrowY ? nOldEndY : nNewEndY; SCCOL nRowEndX = bGrowY ? nNewEndX : nOldEndX; - // Spalten + // Spalten - if ( nNewEndX > nOldEndX ) // Spalten einfuegen + if ( nNewEndX > nOldEndX ) // Spalten einfuegen { rColRange = ScRange( nOldEndX+1, nStartY, nTab, nNewEndX, nColEndY, nTab ); rInsCol = TRUE; } - else if ( nNewEndX < nOldEndX ) // Spalten loeschen + else if ( nNewEndX < nOldEndX ) // Spalten loeschen { rColRange = ScRange( nNewEndX+1, nStartY, nTab, nOldEndX, nColEndY, nTab ); rDelCol = TRUE; } - // Zeilen + // Zeilen - if ( nNewEndY > nOldEndY ) // Zeilen einfuegen + if ( nNewEndY > nOldEndY ) // Zeilen einfuegen { rRowRange = ScRange( nStartX, nOldEndY+1, nTab, nRowEndX, nNewEndY, nTab ); rInsRow = TRUE; } - else if ( nNewEndY < nOldEndY ) // Zeilen loeschen + else if ( nNewEndY < nOldEndY ) // Zeilen loeschen { rRowRange = ScRange( nStartX, nNewEndY+1, nTab, nRowEndX, nOldEndY, nTab ); rDelRow = TRUE; @@ -1276,9 +1276,9 @@ BOOL ScDocument::CanFitBlock( const ScRange& rOld, const ScRange& rNew ) ScRange aColRange,aRowRange; lcl_GetInsDelRanges( rOld, rNew, aColRange,bInsCol,bDelCol, aRowRange,bInsRow,bDelRow ); - if ( bInsCol && !CanInsertCol( aColRange ) ) // Zellen am Rand ? + if ( bInsCol && !CanInsertCol( aColRange ) ) // Zellen am Rand ? bOk = FALSE; - if ( bInsRow && !CanInsertRow( aRowRange ) ) // Zellen am Rand ? + if ( bInsRow && !CanInsertRow( aRowRange ) ) // Zellen am Rand ? bOk = FALSE; if ( bInsCol || bDelCol ) @@ -1308,16 +1308,16 @@ void ScDocument::FitBlock( const ScRange& rOld, const ScRange& rNew, BOOL bClear lcl_GetInsDelRanges( rOld, rNew, aColRange,bInsCol,bDelCol, aRowRange,bInsRow,bDelRow ); if ( bInsCol ) - InsertCol( aColRange ); // Spalten zuerst einfuegen + InsertCol( aColRange ); // Spalten zuerst einfuegen if ( bInsRow ) InsertRow( aRowRange ); if ( bDelRow ) - DeleteRow( aRowRange ); // Zeilen zuerst loeschen + DeleteRow( aRowRange ); // Zeilen zuerst loeschen if ( bDelCol ) DeleteCol( aColRange ); - // Referenzen um eingefuegte Zeilen erweitern + // Referenzen um eingefuegte Zeilen erweitern if ( bInsCol || bInsRow ) { @@ -1338,7 +1338,7 @@ void ScDocument::DeleteArea(SCCOL nCol1, SCROW nRow1, PutInOrder( nCol1, nCol2 ); PutInOrder( nRow1, nRow2 ); BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for (SCTAB i = 0; i <= MAXTAB; i++) if (pTab[i]) if ( rMark.GetTableSelect(i) || bIsUndo ) @@ -1356,7 +1356,7 @@ void ScDocument::DeleteAreaTab(SCCOL nCol1, SCROW nRow1, if ( VALIDTAB(nTab) && pTab[nTab] ) { BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden pTab[nTab]->DeleteArea(nCol1, nRow1, nCol2, nRow2, nDelFlag); SetAutoCalc( bOldAutoCalc ); } @@ -1473,7 +1473,7 @@ void ScDocument::CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, if (VALIDTAB(nTab1) && VALIDTAB(nTab2)) { BOOL bOldAutoCalc = pDestDoc->GetAutoCalc(); - pDestDoc->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDestDoc->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for (SCTAB i = nTab1; i <= nTab2; i++) { if (pTab[i] && pDestDoc->pTab[i]) @@ -1497,7 +1497,7 @@ void ScDocument::UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, if (VALIDTAB(nTab1) && VALIDTAB(nTab2)) { BOOL bOldAutoCalc = pDestDoc->GetAutoCalc(); - pDestDoc->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDestDoc->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden if (nTab1 > 0) CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, FALSE, pDestDoc, pMarks ); @@ -1525,7 +1525,7 @@ void ScDocument::CopyToDocument(const ScRange& rRange, if( !pDestDoc->aDocName.Len() ) pDestDoc->aDocName = aDocName; BOOL bOldAutoCalc = pDestDoc->GetAutoCalc(); - pDestDoc->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDestDoc->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for (SCTAB i = aNewRange.aStart.Tab(); i <= aNewRange.aEnd.Tab(); i++) if (pTab[i] && pDestDoc->pTab[i]) pTab[i]->CopyToTable(aNewRange.aStart.Col(), aNewRange.aStart.Row(), @@ -1546,7 +1546,7 @@ void ScDocument::UndoToDocument(const ScRange& rRange, SCTAB nTab2 = aNewRange.aEnd.Tab(); BOOL bOldAutoCalc = pDestDoc->GetAutoCalc(); - pDestDoc->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDestDoc->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden if (nTab1 > 0) CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, FALSE, pDestDoc, pMarks ); @@ -1597,7 +1597,7 @@ void ScDocument::CopyToClip(const ScClipParam& rClipParam, if (pDrawLayer && bIncludeObjects) { - // also copy drawing objects + // also copy drawing objects Rectangle aObjRect = GetMMRect( aClipRange.aStart.Col(), aClipRange.aStart.Row(), aClipRange.aEnd.Col(), aClipRange.aEnd.Row(), i); pDrawLayer->CopyToClip(pClipDoc, i, aObjRect); @@ -1641,15 +1641,15 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL DBG_ASSERT( bIsClip && pTransClip && pTransClip->bIsClip, "TransposeClip mit falschem Dokument" ); - // initialisieren - // -> pTransClip muss vor dem Original-Dokument geloescht werden! + // initialisieren + // -> pTransClip muss vor dem Original-Dokument geloescht werden! - pTransClip->ResetClip(this, (ScMarkData*)NULL); // alle + pTransClip->ResetClip(this, (ScMarkData*)NULL); // alle - // Bereiche uebernehmen + // Bereiche uebernehmen pTransClip->pRangeName->FreeAll(); - for (USHORT i = 0; i < pRangeName->GetCount(); i++) //! DB-Bereiche Pivot-Bereiche auch !!! + for (USHORT i = 0; i < pRangeName->GetCount(); i++) //! DB-Bereiche Pivot-Bereiche auch !!! { USHORT nIndex = ((ScRangeData*)((*pRangeName)[i]))->GetIndex(); ScRangeData* pData = new ScRangeData(*((*pRangeName)[i])); @@ -1659,7 +1659,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL pData->SetIndex(nIndex); } - // Daten + // Daten ScRange aClipRange = GetClipParam().getWholeRange(); if ( ValidRow(aClipRange.aEnd.Row()-aClipRange.aStart.Row()) ) @@ -1674,11 +1674,11 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL if ( pDrawLayer && ( nFlags & IDF_OBJECTS ) ) { - // Drawing objects are copied to the new area without transposing. - // CopyFromClip is used to adjust the objects to the transposed block's - // cell range area. - // (pDrawLayer in the original clipboard document is set only if there - // are drawing objects to copy) + // Drawing objects are copied to the new area without transposing. + // CopyFromClip is used to adjust the objects to the transposed block's + // cell range area. + // (pDrawLayer in the original clipboard document is set only if there + // are drawing objects to copy) pTransClip->InitDrawLayer(); Rectangle aSourceRect = GetMMRect( aClipRange.aStart.Col(), aClipRange.aStart.Row(), @@ -1698,7 +1698,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL DBG_ERROR("TransposeClip: zu gross"); } - // Dies passiert erst beim Einfuegen... + // Dies passiert erst beim Einfuegen... GetClipParam().mbCutMode = false; } @@ -1936,16 +1936,16 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, if ( pCBFCP->pClipDoc->pDrawLayer && ( pCBFCP->nInsFlag & IDF_OBJECTS ) ) { - // also copy drawing objects + // also copy drawing objects // drawing layer must be created before calling CopyFromClip // (ScDocShell::MakeDrawLayer also does InitItems etc.) DBG_ASSERT( pDrawLayer, "CopyBlockFromClip: No drawing layer" ); if ( pDrawLayer ) { - // For GetMMRect, the row heights in the target document must already be valid - // (copied in an extra step before pasting, or updated after pasting cells, but - // before pasting objects). + // For GetMMRect, the row heights in the target document must already be valid + // (copied in an extra step before pasting, or updated after pasting cells, but + // before pasting objects). Rectangle aSourceRect = pCBFCP->pClipDoc->GetMMRect( nCol1-nDx, nRow1-nDy, nCol2-nDx, nRow2-nDy, nClipTab ); @@ -2006,10 +2006,10 @@ void ScDocument::CopyNonFilteredFromClip( SCCOL nCol1, SCROW nRow1, const ScCopyBlockFromClipParams* pCBFCP, SCROW & rClipStartRow ) { - // call CopyBlockFromClip for ranges of consecutive non-filtered rows - // nCol1/nRow1 etc. is in target doc + // call CopyBlockFromClip for ranges of consecutive non-filtered rows + // nCol1/nRow1 etc. is in target doc - // filtered state is taken from first used table in clipboard (as in GetClipArea) + // filtered state is taken from first used table in clipboard (as in GetClipArea) SCTAB nFlagTab = 0; ScTable** ppClipTab = pCBFCP->pClipDoc->pTab; while ( nFlagTab < MAXTAB && !ppClipTab[nFlagTab] ) @@ -2065,7 +2065,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar if (pClipDoc->bIsClip && pClipDoc->GetTableCount()) { BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple recalculations + SetAutoCalc( FALSE ); // avoid multiple recalculations NumFmtMergeHandler aNumFmtMergeHdl(this, pClipDoc); @@ -2115,8 +2115,8 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar nDelFlag |= IDF_NOTE; else if ( nInsFlag & IDF_CONTENTS ) nDelFlag |= IDF_CONTENTS; - // With bSkipAttrForEmpty, don't remove attributes, copy - // on top of existing attributes instead. + // With bSkipAttrForEmpty, don't remove attributes, copy + // on top of existing attributes instead. if ( ( nInsFlag & IDF_ATTRIB ) && !bSkipAttrForEmpty ) nDelFlag |= IDF_ATTRIB; @@ -2124,14 +2124,14 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar aCBFCP.pRefUndoDoc = pRefUndoDoc; aCBFCP.pClipDoc = pClipDoc; aCBFCP.nInsFlag = nInsFlag; - aCBFCP.bAsLink = bAsLink; + aCBFCP.bAsLink = bAsLink; aCBFCP.bSkipAttrForEmpty = bSkipAttrForEmpty; - aCBFCP.nTabStart = MAXTAB; // wird in der Schleife angepasst - aCBFCP.nTabEnd = 0; // wird in der Schleife angepasst + aCBFCP.nTabStart = MAXTAB; // wird in der Schleife angepasst + aCBFCP.nTabEnd = 0; // wird in der Schleife angepasst - // Inc/DecRecalcLevel einmal aussen, damit nicht fuer jeden Block - // die Draw-Seitengroesse neu berechnet werden muss - //! nur wenn ganze Zeilen/Spalten kopiert werden? + // Inc/DecRecalcLevel einmal aussen, damit nicht fuer jeden Block + // die Draw-Seitengroesse neu berechnet werden muss + //! nur wenn ganze Zeilen/Spalten kopiert werden? for (SCTAB j = 0; j <= MAXTAB; j++) if (pTab[j] && rMark.GetTableSelect(j)) @@ -2149,7 +2149,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar pDestRanges = &aLocalRangeList; } - bInsertingFromOtherDoc = TRUE; // kein Broadcast/Listener aufbauen bei Insert + bInsertingFromOtherDoc = TRUE; // kein Broadcast/Listener aufbauen bei Insert // bei mindestens 64 Zeilen wird in ScColumn::CopyFromClip voralloziert BOOL bDoDouble = ( nYw < 64 && nAllRow2 - nAllRow1 > 64); @@ -2434,8 +2434,8 @@ void ScDocument::GetClipArea(SCCOL& nClipX, SCROW& nClipY, BOOL bIncludeFiltered nClipY = nEndRow - nStartRow; else { - // count non-filtered rows - // count on first used table in clipboard + // count non-filtered rows + // count on first used table in clipboard SCTAB nCountTab = 0; while ( nCountTab < MAXTAB && !pTab[nCountTab] ) ++nCountTab; @@ -2445,7 +2445,7 @@ void ScDocument::GetClipArea(SCCOL& nClipX, SCROW& nClipY, BOOL bIncludeFiltered if ( nResult > 0 ) nClipY = nResult - 1; else - nClipY = 0; // always return at least 1 row + nClipY = 0; // always return at least 1 row } } @@ -2470,7 +2470,7 @@ void ScDocument::GetClipStart(SCCOL& nClipX, SCROW& nClipY) BOOL ScDocument::HasClipFilteredRows() { - // count on first used table in clipboard + // count on first used table in clipboard SCTAB nCountTab = 0; while ( nCountTab < MAXTAB && !pTab[nCountTab] ) ++nCountTab; @@ -2508,7 +2508,7 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark, { USHORT nDelFlags = nFlags; if (nDelFlags & IDF_CONTENTS) - nDelFlags |= IDF_CONTENTS; // immer alle Inhalte oder keine loeschen! + nDelFlags |= IDF_CONTENTS; // immer alle Inhalte oder keine loeschen! SCTAB nSrcTab = rSrcArea.aStart.Tab(); @@ -2522,7 +2522,7 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark, BOOL bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS ); BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden SCTAB nCount = GetTableCount(); for (SCTAB i=0; i<nCount; i++) @@ -2566,7 +2566,7 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark, { USHORT nDelFlags = nFlags; if (nDelFlags & IDF_CONTENTS) - nDelFlags |= IDF_CONTENTS; // immer alle Inhalte oder keine loeschen! + nDelFlags |= IDF_CONTENTS; // immer alle Inhalte oder keine loeschen! if (ValidTab(nSrcTab) && pTab[nSrcTab]) { @@ -2574,7 +2574,7 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark, BOOL bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS ); BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden ScRange aArea; rMark.GetMultiMarkArea( aArea ); @@ -2625,7 +2625,7 @@ void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell, { if ( bForceTab && !pTab[nTab] ) { - BOOL bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags + BOOL bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags pTab[nTab] = new ScTable(this, nTab, String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")), @@ -2644,7 +2644,7 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceT SCTAB nTab = rPos.Tab(); if ( bForceTab && !pTab[nTab] ) { - BOOL bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags + BOOL bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags pTab[nTab] = new ScTable(this, nTab, String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")), @@ -2657,7 +2657,7 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceT } -BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, +BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, SvNumberFormatter* pFormatter, bool bDetectNumberFormat ) { if ( ValidTab(nTab) && pTab[nTab] ) @@ -2827,7 +2827,7 @@ BOOL ScDocument::HasValueData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const BOOL ScDocument::HasStringCells( const ScRange& rRange ) const { - // TRUE, wenn String- oder Editzellen im Bereich + // TRUE, wenn String- oder Editzellen im Bereich SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); @@ -2914,16 +2914,16 @@ void ScDocument::InitializeAllNoteCaptions( bool bForced ) void ScDocument::SetDirty() { BOOL bOldAutoCalc = GetAutoCalc(); - bAutoCalc = FALSE; // keine Mehrfachberechnung + bAutoCalc = FALSE; // keine Mehrfachberechnung { // scope for bulk broadcast ScBulkBroadcast aBulkBroadcast( GetBASM()); for (SCTAB i=0; i<=MAXTAB; i++) if (pTab[i]) pTab[i]->SetDirty(); } - // Charts werden zwar auch ohne AutoCalc im Tracking auf Dirty gesetzt, - // wenn alle Formeln dirty sind, werden die Charts aber nicht mehr erwischt - // (#45205#) - darum alle Charts nochmal explizit + // Charts werden zwar auch ohne AutoCalc im Tracking auf Dirty gesetzt, + // wenn alle Formeln dirty sind, werden die Charts aber nicht mehr erwischt + // (#45205#) - darum alle Charts nochmal explizit if (pChartListenerCollection) pChartListenerCollection->SetDirty(); @@ -2934,7 +2934,7 @@ void ScDocument::SetDirty() void ScDocument::SetDirty( const ScRange& rRange ) { BOOL bOldAutoCalc = GetAutoCalc(); - bAutoCalc = FALSE; // keine Mehrfachberechnung + bAutoCalc = FALSE; // keine Mehrfachberechnung { // scope for bulk broadcast ScBulkBroadcast aBulkBroadcast( GetBASM()); SCTAB nTab2 = rRange.aEnd.Tab(); @@ -2948,7 +2948,7 @@ void ScDocument::SetDirty( const ScRange& rRange ) void ScDocument::SetTableOpDirty( const ScRange& rRange ) { BOOL bOldAutoCalc = GetAutoCalc(); - bAutoCalc = FALSE; // no multiple recalculation + bAutoCalc = FALSE; // no multiple recalculation SCTAB nTab2 = rRange.aEnd.Tab(); for (SCTAB i=rRange.aStart.Tab(); i<=nTab2; i++) if (pTab[i]) pTab[i]->SetTableOpDirty( rRange ); @@ -3050,8 +3050,8 @@ void ScDocument::CalcAfterLoad() { SCTAB i; - if (bIsClip) // Excel-Dateien werden aus dem Clipboard in ein Clip-Doc geladen - return; // dann wird erst beim Einfuegen in das richtige Doc berechnet + if (bIsClip) // Excel-Dateien werden aus dem Clipboard in ein Clip-Doc geladen + return; // dann wird erst beim Einfuegen in das richtige Doc berechnet bCalcingAfterLoad = TRUE; for ( i = 0; i <= MAXTAB; i++) @@ -3060,7 +3060,7 @@ void ScDocument::CalcAfterLoad() if (pTab[i]) pTab[i]->SetDirtyAfterLoad(); bCalcingAfterLoad = FALSE; - SetDetectiveDirty(FALSE); // noch keine wirklichen Aenderungen + SetDetectiveDirty(FALSE); // noch keine wirklichen Aenderungen // #i112436# If formula cells are already dirty, they don't broadcast further changes. // So the source ranges of charts must be interpreted even if they are not visible, @@ -3096,7 +3096,7 @@ void ScDocument::ResetChanged( const ScRange& rRange ) } // -// Spaltenbreiten / Zeilenhoehen -------------------------------------- +// Spaltenbreiten / Zeilenhoehen -------------------------------------- // @@ -3288,7 +3288,7 @@ BOOL ScDocument::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, U const Fraction& rZoomX, const Fraction& rZoomY, BOOL bShrink ) { -//! MarkToMulti(); +//! MarkToMulti(); if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->SetOptimalHeight( nStartRow, nEndRow, nExtra, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bShrink ); @@ -3321,7 +3321,7 @@ void ScDocument::UpdateAllRowHeights( OutputDevice* pDev, double nPPTX, double n // -// Spalten-/Zeilen-Flags ---------------------------------------------- +// Spalten-/Zeilen-Flags ---------------------------------------------- // void ScDocument::ShowCol(SCCOL nCol, SCTAB nTab, BOOL bShow) @@ -3507,7 +3507,7 @@ bool ScDocument::RowHidden(SCROW nRow, SCTAB nTab, SCROW& rLastRow) { if (!ValidTab(nTab) || !pTab[nTab]) { - rLastRow = nRow; + rLastRow = nRow; return false; } @@ -3527,7 +3527,7 @@ bool ScDocument::ColHidden(SCCOL nCol, SCTAB nTab, SCCOL& rLastCol) { if (!ValidTab(nTab) || !pTab[nTab]) { - rLastCol = nCol; + rLastCol = nCol; return false; } @@ -3707,7 +3707,7 @@ SCCOL ScDocument::GetNextDifferentChangedCol( SCTAB nTab, SCCOL nStart) const SCROW ScDocument::GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart, bool bCareManualSize) const { const ScBitMaskCompressedArray< SCROW, BYTE> * pRowFlagsArray; - if ( ValidTab(nTab) && pTab[nTab] && ((pRowFlagsArray = pTab[nTab]->GetRowFlagsArray()) != NULL) && + if ( ValidTab(nTab) && pTab[nTab] && ((pRowFlagsArray = pTab[nTab]->GetRowFlagsArray()) != NULL) && pTab[nTab]->mpRowHeights && pTab[nTab]->mpHiddenRows ) { size_t nIndex; // ignored @@ -3813,7 +3813,7 @@ void ScDocument::ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, S } // -// Attribute ---------------------------------------------------------- +// Attribute ---------------------------------------------------------- // const SfxPoolItem* ScDocument::GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, USHORT nWhich ) const @@ -3953,7 +3953,7 @@ void ScDocument::ApplySelectionLineStyle( const ScMarkData& rMark, } -const ScStyleSheet* ScDocument::GetStyle( SCCOL nCol, SCROW nRow, SCTAB nTab ) const +const ScStyleSheet* ScDocument::GetStyle( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { if ( VALIDTAB(nTab) && pTab[nTab] ) return pTab[nTab]->GetStyle(nCol, nRow); @@ -3962,10 +3962,10 @@ const ScStyleSheet* ScDocument::GetStyle( SCCOL nCol, SCROW nRow, SCTAB nTab ) c } -const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) const +const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) const { - BOOL bEqual = TRUE; - BOOL bFound; + BOOL bEqual = TRUE; + BOOL bFound; const ScStyleSheet* pStyle = NULL; const ScStyleSheet* pNewStyle; @@ -3978,7 +3978,7 @@ const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) con if (bFound) { if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) - bEqual = FALSE; // unterschiedliche + bEqual = FALSE; // unterschiedliche pStyle = pNewStyle; } } @@ -3995,7 +3995,7 @@ const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) con if (bFound) { if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) - bEqual = FALSE; // unterschiedliche + bEqual = FALSE; // unterschiedliche pStyle = pNewStyle; } } @@ -4017,7 +4017,7 @@ void ScDocument::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, BOOL b if ( pStyleSheet && pStyleSheet->GetName() == ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ) { - // update attributes for all note objects + // update attributes for all note objects ScDetectiveFunc::UpdateAllComments( *this ); } } @@ -4111,13 +4111,13 @@ ScPatternAttr* ScDocument::CreateSelectionPattern( const ScMarkData& rMark, BOOL { ScMergePatternState aState; - if ( rMark.IsMultiMarked() ) // multi selection + if ( rMark.IsMultiMarked() ) // multi selection { for (SCTAB i=0; i<=MAXTAB; i++) if (pTab[i] && rMark.GetTableSelect(i)) pTab[i]->MergeSelectionPattern( aState, rMark, bDeep ); } - if ( rMark.IsMarked() ) // simle selection + if ( rMark.IsMarked() ) // simle selection { ScRange aRange; rMark.GetMarkArea(aRange); @@ -4132,7 +4132,7 @@ ScPatternAttr* ScDocument::CreateSelectionPattern( const ScMarkData& rMark, BOOL if (aState.pItemSet) return new ScPatternAttr( aState.pItemSet ); else - return new ScPatternAttr( GetPool() ); // empty + return new ScPatternAttr( GetPool() ); // empty } @@ -4145,8 +4145,8 @@ const ScPatternAttr* ScDocument::GetSelectionPattern( const ScMarkData& rMark, B void ScDocument::GetSelectionFrame( const ScMarkData& rMark, - SvxBoxItem& rLineOuter, - SvxBoxInfoItem& rLineInner ) + SvxBoxItem& rLineOuter, + SvxBoxInfoItem& rLineInner ) { rLineOuter.SetLine(NULL, BOX_LINE_TOP); rLineOuter.SetLine(NULL, BOX_LINE_BOTTOM); @@ -4175,7 +4175,7 @@ void ScDocument::GetSelectionFrame( const ScMarkData& rMark, aRange.aEnd.Col(), aRange.aEnd.Row() ); } - // Don't care Status auswerten + // Don't care Status auswerten rLineInner.SetValid( VALID_LEFT, ( aFlags.nLeft != SC_LINE_DONTCARE ) ); rLineInner.SetValid( VALID_RIGHT, ( aFlags.nRight != SC_LINE_DONTCARE ) ); @@ -4290,7 +4290,7 @@ void ScDocument::GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab, const SvxBorderLine** ppLeft, const SvxBorderLine** ppTop, const SvxBorderLine** ppRight, const SvxBorderLine** ppBottom ) const { - //! Seitengrenzen fuer Druck beruecksichtigen !!!!! + //! Seitengrenzen fuer Druck beruecksichtigen !!!!! const SvxBoxItem* pThisAttr = (const SvxBoxItem*) GetEffItem( nCol, nRow, nTab, ATTR_BORDER ); DBG_ASSERT(pThisAttr,"wo ist das Attribut?"); @@ -4464,7 +4464,7 @@ BOOL ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRo BOOL ScDocument::GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix ) { - // if rCell is part of a matrix formula, return its complete range + // if rCell is part of a matrix formula, return its complete range BOOL bRet = FALSE; ScBaseCell* pCell = GetCell( rCellPos ); @@ -4523,7 +4523,7 @@ BOOL ScDocument::ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow, IsVerOverlapped()) --rStartRow; - //! weiterreichen ? + //! weiterreichen ? ScAttrArray* pAttrArray = pTab[nTab]->aCol[nOldCol].pAttrArray; SCSIZE nIndex; @@ -4642,8 +4642,8 @@ BOOL ScDocument::ExtendMerge( ScRange& rRange, BOOL bRefresh, BOOL bAttrs ) BOOL ScDocument::ExtendTotalMerge( ScRange& rRange ) { - // Bereich genau dann auf zusammengefasste Zellen erweitern, wenn - // dadurch keine neuen nicht-ueberdeckten Zellen getroffen werden + // Bereich genau dann auf zusammengefasste Zellen erweitern, wenn + // dadurch keine neuen nicht-ueberdeckten Zellen getroffen werden BOOL bRet = FALSE; ScRange aExt = rRange; @@ -4715,11 +4715,11 @@ BOOL ScDocument::RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow, SCCOL nDBEndCol; SCROW nDBEndRow; - // Autofilter loeschen + // Autofilter loeschen BOOL bChange = RemoveFlagsTab( nStartCol,nStartRow, nEndCol,nEndRow, nTab, SC_MF_AUTO ); - // Autofilter setzen + // Autofilter setzen for (i=0; i<nCount; i++) { @@ -4929,7 +4929,7 @@ void ScDocument::GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, } // -// Datei-Operationen +// Datei-Operationen // @@ -5088,8 +5088,8 @@ BOOL ScDocument::HasManualBreaks( SCTAB nTab ) const void ScDocument::GetDocStat( ScDocStat& rDocStat ) { rDocStat.nTableCount = GetTableCount(); - rDocStat.aDocName = aDocName; - rDocStat.nCellCount = GetCellCount(); + rDocStat.aDocName = aDocName; + rDocStat.nCellCount = GetCellCount(); } @@ -5212,8 +5212,8 @@ void ScDocument::RestorePrintRanges( const ScPrintRangeSaver& rSaver ) BOOL ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const { // Die Seitennummern-Zaehlung faengt bei einer Tabelle neu an, wenn eine - // andere Vorlage als bei der vorherigen gesetzt ist (nur Namen vergleichen) - // und eine Seitennummer angegeben ist (nicht 0) + // andere Vorlage als bei der vorherigen gesetzt ist (nur Namen vergleichen) + // und eine Seitennummer angegeben ist (nicht 0) if ( nTab < MAXTAB && pTab[nTab] && pTab[nTab+1] ) { @@ -5226,12 +5226,12 @@ BOOL ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const const SfxItemSet& rSet = pStyle->GetItemSet(); USHORT nFirst = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_FIRSTPAGENO)).GetValue(); if ( nFirst != 0 ) - return TRUE; // Seitennummer in neuer Vorlage angegeben + return TRUE; // Seitennummer in neuer Vorlage angegeben } } } - return FALSE; // sonst nicht + return FALSE; // sonst nicht } SfxUndoManager* ScDocument::GetUndoManager() diff --git a/sc/source/core/data/dpcachetable.cxx b/sc/source/core/data/dpcachetable.cxx index d97900e6b904..89caa2660836 100644 --- a/sc/source/core/data/dpcachetable.cxx +++ b/sc/source/core/data/dpcachetable.cxx @@ -1,7 +1,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 @@ -88,7 +88,7 @@ bool ScDPCacheTable::FilterItem::match( const ScDPItemData& rCellData ) const } // ---------------------------------------------------------------------------- -ScDPCacheTable::SingleFilter::SingleFilter(String aString, double fValue, bool bHasValue) +ScDPCacheTable::SingleFilter::SingleFilter(String aString, double fValue, bool bHasValue) { maItem.maString = aString; maItem.mfValue = fValue; @@ -117,7 +117,7 @@ bool ScDPCacheTable::SingleFilter::hasValue() const // ---------------------------------------------------------------------------- -ScDPCacheTable::GroupFilter::GroupFilter() +ScDPCacheTable::GroupFilter::GroupFilter() { } @@ -157,8 +157,8 @@ ScDPCacheTable::Criterion::Criterion() : // ---------------------------------------------------------------------------- -ScDPCacheTable::ScDPCacheTable( ScDocument* pDoc,long nId ) : - mpCache( NULL ), +ScDPCacheTable::ScDPCacheTable( ScDocument* pDoc,long nId ) : + mpCache( NULL ), mpNoneCache( NULL ) { if ( nId >= 0 ) @@ -189,7 +189,7 @@ void ScDPCacheTable::fillTable( const ScQueryParam& rQuery, BOOL* pSpecial, if ( mpCache == NULL ) InitNoneCache( NULL ); //check cache - const SCROW nRowCount = getRowSize(); + const SCROW nRowCount = getRowSize(); const SCCOL nColCount = (SCCOL) getColSize(); if ( nRowCount <= 0 || nColCount <= 0) return; @@ -201,7 +201,7 @@ void ScDPCacheTable::fillTable( const ScQueryParam& rQuery, BOOL* pSpecial, // Initialize field entries container. maFieldEntries.clear(); maFieldEntries.reserve(nColCount); - + // Data rows for (SCCOL nCol = 0; nCol < nColCount; ++nCol) { @@ -214,11 +214,11 @@ void ScDPCacheTable::fillTable( const ScQueryParam& rQuery, BOOL* pSpecial, { SCROW nIndex = GetCache()->GetItemDataId( nCol, nRow, bRepeatIfEmpty ); SCROW nOrder = GetCache()->GetOrder( nCol, nIndex ); - + if ( nCol == 0 ) maRowsVisible.push_back(false); - if ( lcl_HasQueryEntry(rQuery) && + if ( lcl_HasQueryEntry(rQuery) && !GetCache()->ValidQuery( nRow , rQuery, pSpecial ) ) continue; if ( bIgnoreEmptyRows && GetCache()->IsRowEmpty( nRow ) ) @@ -244,7 +244,7 @@ void ScDPCacheTable::fillTable() if ( mpCache == NULL ) InitNoneCache( NULL ); //check cache - const SCROW nRowCount = getRowSize(); + const SCROW nRowCount = getRowSize(); const SCCOL nColCount = (SCCOL) getColSize(); if ( nRowCount <= 0 || nColCount <= 0) return; @@ -256,7 +256,7 @@ void ScDPCacheTable::fillTable() // Initialize field entries container. maFieldEntries.clear(); maFieldEntries.reserve(nColCount); - + // Data rows for (SCCOL nCol = 0; nCol < nColCount; ++nCol) { @@ -269,7 +269,7 @@ void ScDPCacheTable::fillTable() { SCROW nIndex = GetCache()->GetItemDataId( nCol, nRow, false ); SCROW nOrder = GetCache()->GetOrder( nCol, nIndex ); - + if ( nCol == 0 ) maRowsVisible.push_back(true); @@ -310,7 +310,7 @@ void ScDPCacheTable::filterByPageDimension(const vector<Criterion>& rCriteria, c } const ScDPItemData* ScDPCacheTable::getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const -{ +{ SCROW nId= GetCache()->GetItemDataId(nCol, nRow, bRepeatIfEmpty); return GetCache()->GetItemDataById( nCol, nId ); } @@ -318,7 +318,7 @@ const ScDPItemData* ScDPCacheTable::getCell(SCCOL nCol, SCROW nRow, bool bRepeat void ScDPCacheTable::getValue( ScDPValueData& rVal, SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const { const ScDPItemData* pData = getCell( nCol, nRow, bRepeatIfEmpty ); - + if (pData) { rVal.fValue = pData->IsValue() ? pData->GetValue() : 0.0; @@ -348,7 +348,7 @@ const ::std::vector<SCROW>& ScDPCacheTable::getFieldEntries( sal_Int32 nColumn return maFieldEntries[nColumn]; } -void ScDPCacheTable::filterTable(const vector<Criterion>& rCriteria, Sequence< Sequence<Any> >& rTabData, +void ScDPCacheTable::filterTable(const vector<Criterion>& rCriteria, Sequence< Sequence<Any> >& rTabData, const hash_set<sal_Int32>& rRepeatIfEmptyDims) { sal_Int32 nRowSize = getRowSize(); diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx index 21669eb7a435..56655a2f0ace 100644 --- a/sc/source/core/data/dpdimsave.cxx +++ b/sc/source/core/data/dpdimsave.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/core/data/dpglobal.cxx b/sc/source/core/data/dpglobal.cxx index 6b84d37d8d0f..9c5539eb7956 100755 --- a/sc/source/core/data/dpglobal.cxx +++ b/sc/source/core/data/dpglobal.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright IBM Corporation 2009. * Copyright 2009 by Sun Microsystems, Inc. * @@ -84,7 +84,7 @@ namespace ScDPGlobal { continue; } - return false; + return false; } } } @@ -93,7 +93,7 @@ namespace ScDPGlobal return true; } //end - + } // -------------------------------------------------------------------- // ScDPItemDataPool @@ -126,16 +126,16 @@ sal_Int32 ScDPItemDataPool::getDataId( const ScDPItemData& aData ) DataHash::const_iterator itr = maItemIds.find( aData), itrEnd = maItemIds.end(); if ( itr == itrEnd ) - // not exist + // not exist return -1; - + else //exist return itr->second; } sal_Int32 ScDPItemDataPool::insertData( const ScDPItemData& aData ) -{ +{ sal_Int32 nResult = getDataId( aData ); if( nResult < 0 ) diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index edb3b787b9b2..586dd002448c 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -1,7 +1,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 @@ -79,8 +79,8 @@ const sal_Int32 SC_DP_DATE_FIRST = -1; const sal_Int32 SC_DP_DATE_LAST = 10000; // ============================================================================ -namespace -{ +namespace +{ BOOL lcl_Search( SCCOL nSourceDim, ScDPTableDataCache* pCache , const std::vector< SCROW >& vIdx, SCROW nNew , SCROW& rIndex) { rIndex = vIdx.size(); @@ -92,7 +92,7 @@ namespace while (nLo <= nHi) { nIndex = (nLo + nHi) / 2; - + const ScDPItemData* pData = pCache->GetItemDataById( nSourceDim, vIdx[nIndex] ); const ScDPItemData* pDataInsert = pCache->GetItemDataById( nSourceDim, nNew ); @@ -115,9 +115,9 @@ namespace void lcl_Insert( SCCOL nSourceDim, ScDPTableDataCache* pCache , std::vector< SCROW >& vIdx, SCROW nNew ) { - SCROW nIndex = 0; - if ( !lcl_Search( nSourceDim, pCache, vIdx, nNew ,nIndex ) ) - vIdx.insert( vIdx.begin()+nIndex, nNew ); + SCROW nIndex = 0; + if ( !lcl_Search( nSourceDim, pCache, vIdx, nNew ,nIndex ) ) + vIdx.insert( vIdx.begin()+nIndex, nNew ); } template<bool bUpdateData> @@ -279,7 +279,7 @@ namespace class ScDPGroupDateFilter : public ScDPCacheTable::FilterBase { public: - ScDPGroupDateFilter(double fMatchValue, sal_Int32 nDatePart, + ScDPGroupDateFilter(double fMatchValue, sal_Int32 nDatePart, const Date* pNullDate, const ScDPNumGroupInfo* pNumInfo); // Wang Xu Ming -- 2009-8-17 @@ -298,7 +298,7 @@ private: // ---------------------------------------------------------------------------- -ScDPGroupDateFilter::ScDPGroupDateFilter(double fMatchValue, sal_Int32 nDatePart, +ScDPGroupDateFilter::ScDPGroupDateFilter(double fMatchValue, sal_Int32 nDatePart, const Date* pNullDate, const ScDPNumGroupInfo* pNumInfo) : mpNullDate(pNullDate), mpNumInfo(pNumInfo), @@ -316,7 +316,7 @@ bool ScDPGroupDateFilter::match( const ScDPItemData & rCellData ) const if ( !rCellData.IsValue() ) return false; -// ScDPCacheCell rCell( rCellData.fValue ); +// ScDPCacheCell rCell( rCellData.fValue ); if (!mpNumInfo) return false; @@ -329,7 +329,7 @@ bool ScDPGroupDateFilter::match( const ScDPItemData & rCellData ) const if ( rCellData.GetValue() > mpNumInfo->End && !approxEqual(rCellData.GetValue(), mpNumInfo->End) ) return static_cast<sal_Int32>(mfMatchValue) == SC_DP_DATE_LAST; - if (mnDatePart == DataPilotFieldGroupBy::HOURS || mnDatePart == DataPilotFieldGroupBy::MINUTES || + if (mnDatePart == DataPilotFieldGroupBy::HOURS || mnDatePart == DataPilotFieldGroupBy::MINUTES || mnDatePart == DataPilotFieldGroupBy::SECONDS) { // handle time @@ -593,7 +593,7 @@ BOOL lcl_DateContained( sal_Int32 nGroupPart, const ScDPItemData& rGroupData, bContained = ( nGroupValue == nCompare ); } break; - + // other parts: everything is contained } @@ -673,16 +673,16 @@ void ScDPDateGroupHelper::FillColumnEntries( SCCOL nSourceDim, ScDPTableDataCach for ( sal_Int32 nValue = nStart; nValue <= nEnd; nValue++ ) { - String aName = lcl_GetDateGroupName( nDatePart, nValue, pFormatter ); + String aName = lcl_GetDateGroupName( nDatePart, nValue, pFormatter ); lcl_InsertValue<false>( nSourceDim, pCache, rEntries, aName, nValue, nDatePart ); } // add first/last entry (min/max) - String aFirstName = lcl_GetSpecialDateName( aNumInfo.Start, true, pFormatter ); + String aFirstName = lcl_GetSpecialDateName( aNumInfo.Start, true, pFormatter ); lcl_InsertValue<true>( nSourceDim, pCache, rEntries, aFirstName, SC_DP_DATE_FIRST, nDatePart ); - String aLastName = lcl_GetSpecialDateName( aNumInfo.End, false, pFormatter ); - lcl_InsertValue<true>( nSourceDim, pCache, rEntries, aLastName, SC_DP_DATE_LAST, nDatePart ); + String aLastName = lcl_GetSpecialDateName( aNumInfo.End, false, pFormatter ); + lcl_InsertValue<true>( nSourceDim, pCache, rEntries, aLastName, SC_DP_DATE_LAST, nDatePart ); } // ----------------------------------------------------------------------- @@ -751,13 +751,13 @@ ScDPGroupDimension::ScDPGroupDimension( const ScDPGroupDimension& rOther ) : nGroupDim( rOther.nGroupDim ), aGroupName( rOther.aGroupName ), pDateHelper( NULL ), - aItems( rOther.aItems ) + aItems( rOther.aItems ) { if ( rOther.pDateHelper ) pDateHelper = new ScDPDateGroupHelper( *rOther.pDateHelper ); } -ScDPGroupDimension& ScDPGroupDimension::operator=( const ScDPGroupDimension& rOther ) +ScDPGroupDimension& ScDPGroupDimension::operator=( const ScDPGroupDimension& rOther ) { nSourceDim = rOther.nSourceDim; nGroupDim = rOther.nGroupDim; @@ -794,8 +794,8 @@ const std::vector< SCROW >& ScDPGroupDimension::GetColumnEntries( const ScDPCac { if ( maMemberEntries.empty() ) { - if ( pDateHelper ) - { + if ( pDateHelper ) + { pDateHelper->FillColumnEntries( (SCCOL)GetSourceDim(), rCacheTable.GetCache(), maMemberEntries, rOriginal ); } else @@ -852,7 +852,7 @@ const ScDPGroupItem* ScDPGroupDimension::GetGroupByIndex( size_t nIndex ) const void ScDPGroupDimension::DisposeData() { - maMemberEntries.clear(); + maMemberEntries.clear(); } // ----------------------------------------------------------------------- @@ -861,7 +861,7 @@ ScDPNumGroupDimension::ScDPNumGroupDimension() : pDateHelper( NULL ), bHasNonInteger( false ), cDecSeparator( 0 ) -{ +{ } ScDPNumGroupDimension::ScDPNumGroupDimension( const ScDPNumGroupInfo& rInfo ) : @@ -871,7 +871,7 @@ ScDPNumGroupDimension::ScDPNumGroupDimension( const ScDPNumGroupInfo& rInfo ) : cDecSeparator( 0 ) { } - + ScDPNumGroupDimension::ScDPNumGroupDimension( const ScDPNumGroupDimension& rOther ) : aGroupInfo( rOther.aGroupInfo ), pDateHelper( NULL ), @@ -946,7 +946,7 @@ const std::vector< SCROW >& ScDPNumGroupDimension::GetNumEntries( SCCOL nSourceD for (size_t nOriginalPos=0; nOriginalPos<nOriginalCount; nOriginalPos++) { const ScDPItemData* pItemData = pCache->GetItemDataById( nSourceDim , rOriginal[nOriginalPos] ); - + if ( pItemData && pItemData ->HasStringData() ) { lcl_Insert( nSourceDim, pCache, maMemberEntries, rOriginal[nOriginalPos] ); @@ -1003,7 +1003,7 @@ const std::vector< SCROW >& ScDPNumGroupDimension::GetNumEntries( SCCOL nSourceD { String aName = lcl_GetNumGroupName( fLoop, aGroupInfo, bHasNonInteger, cDecSeparator, pFormatter ); // create a numerical entry to ensure proper sorting - // (in FillMemberResults this needs special handling) + // (in FillMemberResults this needs special handling) lcl_InsertValue<true>( nSourceDim, pCache, maMemberEntries, aName, fLoop ); ++nLoopCount; fLoop = aGroupInfo.Start + nLoopCount * aGroupInfo.Step; @@ -1016,7 +1016,7 @@ const std::vector< SCROW >& ScDPNumGroupDimension::GetNumEntries( SCCOL nSourceD lcl_InsertValue<true>( nSourceDim, pCache, maMemberEntries, aFirstName, aGroupInfo.Start - aGroupInfo.Step ); String aLastName = lcl_GetSpecialNumGroupName( aGroupInfo.End, false, cDecSeparator, aGroupInfo.DateValues, pFormatter ); - lcl_InsertValue<true>( nSourceDim, pCache, maMemberEntries, aLastName, aGroupInfo.End + aGroupInfo.Step ); + lcl_InsertValue<true>( nSourceDim, pCache, maMemberEntries, aLastName, aGroupInfo.End + aGroupInfo.Step ); } } return maMemberEntries; @@ -1091,7 +1091,7 @@ long ScDPGroupTableData::GetMembersCount( long nDim ) const std::vector< SCROW >& members = GetColumnEntries( nDim ); return members.size(); } -const std::vector< SCROW >& ScDPGroupTableData::GetColumnEntries( long nColumn ) +const std::vector< SCROW >& ScDPGroupTableData::GetColumnEntries( long nColumn ) { if ( nColumn >= nSourceCount ) { @@ -1118,11 +1118,11 @@ const std::vector< SCROW >& ScDPGroupTableData::GetColumnEntries( long nColumn } const ScDPItemData* ScDPGroupTableData::GetMemberById( long nDim, long nId ) -{ +{ if ( nDim >= nSourceCount ) { if ( getIsDataLayoutDimension( nDim) ) - nDim = nSourceCount; + nDim = nSourceCount; else { const ScDPGroupDimension& rGroupDim = aGroups[nDim - nSourceCount]; @@ -1244,7 +1244,7 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPCacheTable::Criterion>& ScDPCacheTable::Criterion aCri; aCri.mnFieldIndex = itr->mnFieldIndex; aCri.mpFilter.reset(new ScDPGroupDateFilter( - pFilter->getMatchValue(), pDateHelper->GetDatePart(), + pFilter->getMatchValue(), pDateHelper->GetDatePart(), pDoc->GetFormatTable()->GetNullDate(), &pDateHelper->GetNumInfo())); aNewCriteria.push_back(aCri); @@ -1269,7 +1269,7 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPCacheTable::Criterion>& ScDPCacheTable::Criterion aCri; aCri.mnFieldIndex = nSrcDim; // use the source dimension, not the group dimension. aCri.mpFilter.reset(new ScDPGroupDateFilter( - pFilter->getMatchValue(), pDateHelper->GetDatePart(), + pFilter->getMatchValue(), pDateHelper->GetDatePart(), pDoc->GetFormatTable()->GetNullDate(), &pDateHelper->GetNumInfo())); aNewCriteria.push_back(aCri); @@ -1292,13 +1292,13 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPCacheTable::Criterion>& // End Comments if (!pGrpItem || !pGrpItem->GetName().IsCaseInsEqual(aName)) continue; - + ScDPCacheTable::Criterion aCri; aCri.mnFieldIndex = nSrcDim; aCri.mpFilter.reset(new ScDPCacheTable::GroupFilter()); - ScDPCacheTable::GroupFilter* pGrpFilter = + ScDPCacheTable::GroupFilter* pGrpFilter = static_cast<ScDPCacheTable::GroupFilter*>(aCri.mpFilter.get()); - + pGrpItem->FillGroupFilter(*pGrpFilter); aNewCriteria.push_back(aCri); } @@ -1372,7 +1372,7 @@ void ScDPGroupTableData::FillGroupValues( /*ScDPItemData* pItemData*/ SCROW* pIt pDateHelper = rGroupDim.GetDateHelper(); if ( !pDateHelper ) // date is handled below { - const ScDPGroupItem* pGroupItem = rGroupDim.GetGroupForData( *GetMemberById( nSourceDim, pItemDataIndex[nDim] )); + const ScDPGroupItem* pGroupItem = rGroupDim.GetGroupForData( *GetMemberById( nSourceDim, pItemDataIndex[nDim] )); if ( pGroupItem ) pItemDataIndex[nDim] = pCache->GetAdditionalItemID( pGroupItem->GetName() ); } @@ -1400,7 +1400,7 @@ void ScDPGroupTableData::FillGroupValues( /*ScDPItemData* pItemData*/ SCROW* pIt } if ( pDateHelper ) - { + { const ScDPItemData* pData = GetCacheTable().GetCache()->GetItemDataById( (SCCOL)nSourceDim, pItemDataIndex[nDim]); if ( pData ->IsValue() ) { @@ -1409,7 +1409,7 @@ void ScDPGroupTableData::FillGroupValues( /*ScDPItemData* pItemData*/ SCROW* pIt &pDateHelper->GetNumInfo() ); // Wang Xu Ming -- 2009-9-7 // DataPilot Migration - Cache&&Performance - //String aName = lcl_GetDateGroupName( pDateHelper, nPartValue, pDoc->GetFormatTable() ); + //String aName = lcl_GetDateGroupName( pDateHelper, nPartValue, pDoc->GetFormatTable() ); ScDPItemData aItemData( pDateHelper->GetDatePart(), String(), nPartValue, ScDPItemData::MK_DATA|ScDPItemData::MK_VAL|ScDPItemData::MK_DATEPART ); pItemDataIndex[nDim] = GetCacheTable().GetCache()->GetAdditionalItemID( aItemData ); // End Comments @@ -1581,7 +1581,7 @@ long ScDPGroupTableData::GetSourceDim( long nDim ) } long ScDPGroupTableData::Compare( long nDim, long nDataId1, long nDataId2) { - if ( getIsDataLayoutDimension(nDim) ) + if ( getIsDataLayoutDimension(nDim) ) return 0; return ScDPItemData::Compare( *GetMemberById(nDim, nDataId1),*GetMemberById(nDim, nDataId2) ); } diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index e994339f4a9a..5e6bae7bc5a3 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -1,7 +1,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 @@ -42,8 +42,8 @@ #include "dpgroup.hxx" #include "document.hxx" #include "rechead.hxx" -#include "pivot.hxx" // PIVOT_DATA_FIELD -#include "dapiuno.hxx" // ScDataPilotConversion +#include "pivot.hxx" // PIVOT_DATA_FIELD +#include "dapiuno.hxx" // ScDataPilotConversion #include "miscuno.hxx" #include "scerrors.hxx" #include "refupdat.hxx" @@ -75,7 +75,7 @@ #include <comphelper/processfactory.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> -#include <svl/zforlist.hxx> // IsNumberFormat +#include <svl/zforlist.hxx> // IsNumberFormat #include <vector> #include <stdio.h> @@ -97,35 +97,35 @@ using ::rtl::OUString; // ----------------------------------------------------------------------- -#define SCDPSOURCE_SERVICE "com.sun.star.sheet.DataPilotSource" +#define SCDPSOURCE_SERVICE "com.sun.star.sheet.DataPilotSource" // ----------------------------------------------------------------------- // incompatible versions of data pilot files -#define SC_DP_VERSION_CURRENT 6 +#define SC_DP_VERSION_CURRENT 6 // type of source data -#define SC_DP_SOURCE_SHEET 0 -#define SC_DP_SOURCE_DATABASE 1 -#define SC_DP_SOURCE_SERVICE 2 +#define SC_DP_SOURCE_SHEET 0 +#define SC_DP_SOURCE_DATABASE 1 +#define SC_DP_SOURCE_SERVICE 2 // ----------------------------------------------------------------------- -//! move to a header file -#define DP_PROP_COLUMNGRAND "ColumnGrand" -#define DP_PROP_FUNCTION "Function" -#define DP_PROP_IGNOREEMPTY "IgnoreEmptyRows" -#define DP_PROP_ISDATALAYOUT "IsDataLayoutDimension" -//#define DP_PROP_ISVISIBLE "IsVisible" -#define DP_PROP_ORIENTATION "Orientation" -#define DP_PROP_ORIGINAL "Original" -#define DP_PROP_POSITION "Position" -#define DP_PROP_REPEATIFEMPTY "RepeatIfEmpty" -#define DP_PROP_ROWGRAND "RowGrand" -#define DP_PROP_SHOWDETAILS "ShowDetails" -#define DP_PROP_SHOWEMPTY "ShowEmpty" -#define DP_PROP_SUBTOTALS "SubTotals" -#define DP_PROP_USEDHIERARCHY "UsedHierarchy" +//! move to a header file +#define DP_PROP_COLUMNGRAND "ColumnGrand" +#define DP_PROP_FUNCTION "Function" +#define DP_PROP_IGNOREEMPTY "IgnoreEmptyRows" +#define DP_PROP_ISDATALAYOUT "IsDataLayoutDimension" +//#define DP_PROP_ISVISIBLE "IsVisible" +#define DP_PROP_ORIENTATION "Orientation" +#define DP_PROP_ORIGINAL "Original" +#define DP_PROP_POSITION "Position" +#define DP_PROP_REPEATIFEMPTY "RepeatIfEmpty" +#define DP_PROP_ROWGRAND "RowGrand" +#define DP_PROP_SHOWDETAILS "ShowDetails" +#define DP_PROP_SHOWEMPTY "ShowEmpty" +#define DP_PROP_SUBTOTALS "SubTotals" +#define DP_PROP_USEDHIERARCHY "UsedHierarchy" // ----------------------------------------------------------------------- @@ -147,7 +147,7 @@ USHORT lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplie { bFound = ScUnoHelpFunctions::GetBoolProperty( xDimProp, rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) ); - //! error checking -- is "IsDataLayoutDimension" property required?? + //! error checking -- is "IsDataLayoutDimension" property required?? if (bFound) nRet = ScUnoHelpFunctions::GetEnumProperty( xDimProp, rtl::OUString::createFromAscii(DP_PROP_ORIENTATION), @@ -189,7 +189,7 @@ ScDPObject::ScDPObject(const ScDPObject& r) : pSheetDesc( NULL ), pImpDesc( NULL ), pServDesc( NULL ), - mpTableData(static_cast<ScDPTableData*>(NULL)), + mpTableData(static_cast<ScDPTableData*>(NULL)), pOutput( NULL ), bSettingsChanged( FALSE ), bAlive( FALSE ), @@ -252,7 +252,7 @@ void ScDPObject::SetSaveData(const ScDPSaveData& rData) // End Comments } - InvalidateData(); // re-init source from SaveData + InvalidateData(); // re-init source from SaveData } void ScDPObject::SetAutoFormatIndex(const sal_uInt16 nIndex) @@ -262,7 +262,7 @@ void ScDPObject::SetAutoFormatIndex(const sal_uInt16 nIndex) sal_uInt16 ScDPObject::GetAutoFormatIndex() const { - return mnAutoFormatIndex; + return mnAutoFormatIndex; } void ScDPObject::SetHeaderLayout (bool bUseGrid) @@ -286,7 +286,7 @@ void ScDPObject::SetOutRange(const ScRange& rRange) void ScDPObject::SetSheetDesc(const ScSheetSourceDesc& rDesc) { if ( pSheetDesc && rDesc == *pSheetDesc ) - return; // nothing to do + return; // nothing to do DELETEZ( pImpDesc ); DELETEZ( pServDesc ); @@ -294,7 +294,7 @@ void ScDPObject::SetSheetDesc(const ScSheetSourceDesc& rDesc) delete pImpDesc; pSheetDesc = new ScSheetSourceDesc(rDesc); - // make valid QueryParam + // make valid QueryParam pSheetDesc->aQueryParam.nCol1 = pSheetDesc->aSourceRange.aStart.Col(); pSheetDesc->aQueryParam.nRow1 = pSheetDesc->aSourceRange.aStart.Row(); @@ -302,13 +302,13 @@ void ScDPObject::SetSheetDesc(const ScSheetSourceDesc& rDesc) pSheetDesc->aQueryParam.nRow2 = pSheetDesc->aSourceRange.aEnd.Row();; pSheetDesc->aQueryParam.bHasHeader = TRUE; - InvalidateSource(); // new source must be created + InvalidateSource(); // new source must be created } void ScDPObject::SetImportDesc(const ScImportSourceDesc& rDesc) { if ( pImpDesc && rDesc == *pImpDesc ) - return; // nothing to do + return; // nothing to do DELETEZ( pSheetDesc ); DELETEZ( pServDesc ); @@ -316,13 +316,13 @@ void ScDPObject::SetImportDesc(const ScImportSourceDesc& rDesc) delete pImpDesc; pImpDesc = new ScImportSourceDesc(rDesc); - InvalidateSource(); // new source must be created + InvalidateSource(); // new source must be created } void ScDPObject::SetServiceData(const ScDPServiceDesc& rDesc) { if ( pServDesc && rDesc == *pServDesc ) - return; // nothing to do + return; // nothing to do DELETEZ( pSheetDesc ); DELETEZ( pImpDesc ); @@ -330,7 +330,7 @@ void ScDPObject::SetServiceData(const ScDPServiceDesc& rDesc) delete pServDesc; pServDesc = new ScDPServiceDesc(rDesc); - InvalidateSource(); // new source must be created + InvalidateSource(); // new source must be created } void ScDPObject::WriteSourceDataTo( ScDPObject& rDest ) const @@ -342,7 +342,7 @@ void ScDPObject::WriteSourceDataTo( ScDPObject& rDest ) const else if ( pServDesc ) rDest.SetServiceData( *pServDesc ); - // name/tag are not source data, but needed along with source data + // name/tag are not source data, but needed along with source data rDest.aTableName = aTableName; rDest.aTableTag = aTableTag; @@ -375,7 +375,7 @@ bool ScDPObject::IsDataDescriptionCell(const ScAddress& rPos) long nDataDimCount = pSaveData->GetDataDimensionCount(); if (nDataDimCount != 1) - // There has to be exactly one data dimension for the description to + // There has to be exactly one data dimension for the description to // appear at top-left corner. return false; @@ -418,9 +418,9 @@ void ScDPObject::CreateOutput() aStart.SetRow(nNewRow); pOutput->SetPosition( aStart ); - //! modify aOutRange? + //! modify aOutRange? - bAllowMove = FALSE; // use only once + bAllowMove = FALSE; // use only once } } } @@ -477,18 +477,18 @@ void ScDPObject::CreateObjects() if (!xSource.is()) { - //! cache DPSource and/or Output? + //! cache DPSource and/or Output? DBG_ASSERT( bAlive, "CreateObjects on non-inserted DPObject" ); - DELETEZ( pOutput ); // not valid when xSource is changed + DELETEZ( pOutput ); // not valid when xSource is changed if ( pServDesc ) { xSource = CreateSource( *pServDesc ); } - if ( !xSource.is() ) // database or sheet data, or error in CreateSource + if ( !xSource.is() ) // database or sheet data, or error in CreateSource { DBG_ASSERT( !pServDesc, "DPSource could not be created" ); ScDPTableData* pData = GetTableData(); @@ -507,7 +507,7 @@ void ScDPObject::CreateObjects() } else if (bSettingsChanged) { - DELETEZ( pOutput ); // not valid when xSource is changed + DELETEZ( pOutput ); // not valid when xSource is changed uno::Reference<util::XRefreshable> xRef( xSource, uno::UNO_QUERY ); if (xRef.is()) @@ -553,21 +553,21 @@ void ScDPObject::InvalidateSource() ScRange ScDPObject::GetNewOutputRange( BOOL& rOverflow ) { - CreateOutput(); // create xSource and pOutput if not already done + CreateOutput(); // create xSource and pOutput if not already done - rOverflow = pOutput->HasError(); // range overflow or exception from source + rOverflow = pOutput->HasError(); // range overflow or exception from source if ( rOverflow ) return ScRange( aOutRange.aStart ); else { - // don't store the result in aOutRange, because nothing has been output yet + // don't store the result in aOutRange, because nothing has been output yet return pOutput->GetOutputRange(); } } void ScDPObject::Output( const ScAddress& rPos ) { - // clear old output area + // clear old output area pDoc->DeleteAreaTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(), aOutRange.aEnd.Col(), aOutRange.aEnd.Row(), aOutRange.aStart.Tab(), IDF_ALL ); @@ -575,13 +575,13 @@ void ScDPObject::Output( const ScAddress& rPos ) aOutRange.aEnd.Col(), aOutRange.aEnd.Row(), aOutRange.aStart.Tab(), SC_MF_AUTO ); - CreateOutput(); // create xSource and pOutput if not already done + CreateOutput(); // create xSource and pOutput if not already done pOutput->SetPosition( rPos ); pOutput->Output(); - // aOutRange is always the range that was last output to the document + // aOutRange is always the range that was last output to the document aOutRange = pOutput->GetOutputRange(); const ScAddress& s = aOutRange.aStart; const ScAddress& e = aOutRange.aEnd; @@ -623,7 +623,7 @@ void ScDPObject::RefreshAfterLoad() pDoc->IsBlockEmpty( nTab, nFirstCol, nFirstRow + nInitial, nFirstCol, nFirstRow + nInitial ) && aOutRange.aEnd.Col() > nFirstCol ) { - BOOL bFilterButton = IsSheetData(); // when available, filter button setting must be checked here + BOOL bFilterButton = IsSheetData(); // when available, filter button setting must be checked here SCROW nSkip = bFilterButton ? 1 : 0; for (SCROW nPos=nSkip; nPos<nInitial; nPos++) @@ -632,7 +632,7 @@ void ScDPObject::RefreshAfterLoad() nHeaderRows = nInitial; } else - nHeaderRows = 0; // nothing found, no drop-down lists + nHeaderRows = 0; // nothing found, no drop-down lists } void ScDPObject::BuildAllDimensionMembers() @@ -743,14 +743,14 @@ void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode, aNewDesc.aQueryParam = pSheetDesc->aQueryParam; aNewDesc.aQueryParam.nCol1 = sal::static_int_cast<SCCOL>( aNewDesc.aQueryParam.nCol1 + nDiffX ); aNewDesc.aQueryParam.nCol2 = sal::static_int_cast<SCCOL>( aNewDesc.aQueryParam.nCol2 + nDiffX ); - aNewDesc.aQueryParam.nRow1 += nDiffY; //! used? - aNewDesc.aQueryParam.nRow2 += nDiffY; //! used? + aNewDesc.aQueryParam.nRow1 += nDiffY; //! used? + aNewDesc.aQueryParam.nRow2 += nDiffY; //! used? SCSIZE nEC = aNewDesc.aQueryParam.GetEntryCount(); for (SCSIZE i=0; i<nEC; i++) if (aNewDesc.aQueryParam.GetEntry(i).bDoQuery) aNewDesc.aQueryParam.GetEntry(i).nField += nDiffX; - SetSheetDesc( aNewDesc ); // allocates new pSheetDesc + SetSheetDesc( aNewDesc ); // allocates new pSheetDesc } } } @@ -865,7 +865,7 @@ String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout ) { BOOL bData = ScUnoHelpFunctions::GetBoolProperty( xDimProp, rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) ); - //! error checking -- is "IsDataLayoutDimension" property required?? + //! error checking -- is "IsDataLayoutDimension" property required?? rtl::OUString aName; try @@ -938,9 +938,9 @@ long ScDPObject::GetDimCount() void ScDPObject::FillPageList( TypedScStrCollection& rStrings, long nField ) { - //! merge members access with ToggleDetails? + //! merge members access with ToggleDetails? - //! convert field index to dimension index? + //! convert field index to dimension index? DBG_ASSERT( xSource.is(), "no source" ); if ( !xSource.is() ) return; @@ -1023,8 +1023,8 @@ void ScDPObject::FillPageList( TypedScStrCollection& rStrings, long nField ) } } - // add "-all-" entry to the top (unsorted) - TypedStrData* pAllData = new TypedStrData( String( ScResId( SCSTR_ALL ) ) ); //! separate string? (also output) + // add "-all-" entry to the top (unsorted) + TypedStrData* pAllData = new TypedStrData( String( ScResId( SCSTR_ALL ) ) ); //! separate string? (also output) if ( !rStrings.AtInsert( 0, pAllData ) ) delete pAllData; } @@ -1033,7 +1033,7 @@ void ScDPObject::GetHeaderPositionData(const ScAddress& rPos, DataPilotTableHead { using namespace ::com::sun::star::sheet::DataPilotTablePositionType; - CreateOutput(); // create xSource and pOutput if not already done + CreateOutput(); // create xSource and pOutput if not already done // Reset member values to invalid state. rData.Dimension = rData.Hierarchy = rData.Level = -1; @@ -1057,14 +1057,14 @@ BOOL ScDPObject::GetPivotData( ScDPGetPivotDataField& rTarget, BOOL ScDPObject::IsFilterButton( const ScAddress& rPos ) { - CreateOutput(); // create xSource and pOutput if not already done + CreateOutput(); // create xSource and pOutput if not already done return pOutput->IsFilterButton( rPos ); } long ScDPObject::GetHeaderDim( const ScAddress& rPos, USHORT& rOrient ) { - CreateOutput(); // create xSource and pOutput if not already done + CreateOutput(); // create xSource and pOutput if not already done return pOutput->GetHeaderDim( rPos, rOrient ); } @@ -1072,7 +1072,7 @@ long ScDPObject::GetHeaderDim( const ScAddress& rPos, USHORT& rOrient ) BOOL ScDPObject::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMouseTop, long nDragDim, Rectangle& rPosRect, USHORT& rOrient, long& rDimPos ) { - CreateOutput(); // create xSource and pOutput if not already done + CreateOutput(); // create xSource and pOutput if not already done return pOutput->GetHeaderDrag( rPos, bMouseLeft, bMouseTop, nDragDim, rPosRect, rOrient, rDimPos ); } @@ -1118,7 +1118,7 @@ bool lcl_Dequote( const String& rSource, xub_StrLen nStartPos, xub_StrLen& rEndP } else aBuffer.append( cNext ); - + ++nPos; } // no closing quote before the end of the string -> error (bRet still false) @@ -1295,7 +1295,7 @@ bool lcl_IsAtStart( const String& rList, const String& rSearch, sal_Int32& rMatc if ( cNext == ' ' || ( bAllowBracket && cNext == '[' ) ) bValid = true; } - + if ( bValid ) { rMatched = nMatchList; @@ -1523,9 +1523,9 @@ BOOL ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPObject* pDestObj) { - CreateObjects(); // create xSource if not already done + CreateObjects(); // create xSource if not already done - // find dimension name + // find dimension name uno::Reference<container::XNamed> xDim; uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions(); @@ -1546,12 +1546,12 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) ); if (bDataLayout) { - // the elements of the data layout dimension can't be found by their names - // -> don't change anything + // the elements of the data layout dimension can't be found by their names + // -> don't change anything return; } - // query old state + // query old state long nHierCount = 0; uno::Reference<container::XIndexAccess> xHiers; @@ -1610,21 +1610,21 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb DBG_ASSERT( bFound, "member not found" ); - //! use Hierarchy and Level in SaveData !!!! + //! use Hierarchy and Level in SaveData !!!! - // modify pDestObj if set, this object otherwise + // modify pDestObj if set, this object otherwise ScDPSaveData* pModifyData = pDestObj ? ( pDestObj->pSaveData ) : pSaveData; DBG_ASSERT( pModifyData, "no data?" ); if ( pModifyData ) { const String aName = rElemDesc.MemberName; pModifyData->GetDimensionByName(aDimName)-> - GetMemberByName(aName)->SetShowDetails( !bShowDetails ); // toggle + GetMemberByName(aName)->SetShowDetails( !bShowDetails ); // toggle if ( pDestObj ) - pDestObj->InvalidateData(); // re-init source from SaveData + pDestObj->InvalidateData(); // re-init source from SaveData else - InvalidateData(); // re-init source from SaveData + InvalidateData(); // re-init source from SaveData } } @@ -1639,10 +1639,10 @@ long lcl_FindName( const rtl::OUString& rString, const uno::Reference<container: if ( pArr[nPos] == rString ) return nPos; } - return -1; // not found + return -1; // not found } -USHORT lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimProp ) // PIVOT_FUNC mask +USHORT lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimProp ) // PIVOT_FUNC mask { uno::Reference<sheet::XHierarchiesSupplier> xDimSupp( xDimProp, uno::UNO_QUERY ); if ( xDimProp.is() && xDimSupp.is() ) @@ -1715,8 +1715,8 @@ SCSIZE lcl_FillOldFields( PivotField* pFields, SCSIZE nCount = (nOrient == sheet::DataPilotFieldOrientation_PAGE) ? PIVOT_MAXPAGEFIELD : PIVOT_MAXFIELD; - //! merge multiple occurences (data field with different functions) - //! force data field in one dimension + //! merge multiple occurences (data field with different functions) + //! force data field in one dimension std::vector< long > aPos( nCount, 0 ); @@ -1741,13 +1741,13 @@ SCSIZE lcl_FillOldFields( PivotField* pFields, sheet::GeneralFunction_NONE ); if ( eFunc == sheet::GeneralFunction_AUTO ) { - //! test for numeric data + //! test for numeric data eFunc = sheet::GeneralFunction_SUM; } nMask = ScDataPilotConversion::FunctionBit(eFunc); } else - nMask = lcl_FirstSubTotal( xDimProp ); // from first hierarchy + nMask = lcl_FirstSubTotal( xDimProp ); // from first hierarchy BOOL bDataLayout = ScUnoHelpFunctions::GetBoolProperty( xDimProp, rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) ); @@ -1773,18 +1773,18 @@ SCSIZE lcl_FillOldFields( PivotField* pFields, BOOL bDupUsed = FALSE; if ( nDupSource >= 0 ) { - // add function bit to previous entry + // add function bit to previous entry SCsCOL nCompCol; if ( bDataLayout ) nCompCol = PIVOT_DATA_FIELD; else - nCompCol = static_cast<SCsCOL>(nDupSource)+nColAdd; //! seek source column from name + nCompCol = static_cast<SCsCOL>(nDupSource)+nColAdd; //! seek source column from name for (SCSIZE nOld=0; nOld<nOutCount && !bDupUsed; nOld++) if ( pFields[nOld].nCol == nCompCol ) { - // add to previous column only if new bits aren't already set there + // add to previous column only if new bits aren't already set there if ( ( pFields[nOld].nFuncMask & nMask ) == 0 ) { pFields[nOld].nFuncMask |= nMask; @@ -1794,17 +1794,17 @@ SCSIZE lcl_FillOldFields( PivotField* pFields, } } - if ( !bDupUsed ) // also for duplicated dim if original has different orientation + if ( !bDupUsed ) // also for duplicated dim if original has different orientation { if ( bDataLayout ) { pFields[nOutCount].nCol = PIVOT_DATA_FIELD; bDataFound = TRUE; } - else if ( nDupSource >= 0 ) // if source was not found (different orientation) - pFields[nOutCount].nCol = static_cast<SCsCOL>(nDupSource)+nColAdd; //! seek from name + else if ( nDupSource >= 0 ) // if source was not found (different orientation) + pFields[nOutCount].nCol = static_cast<SCsCOL>(nDupSource)+nColAdd; //! seek from name else - pFields[nOutCount].nCol = static_cast<SCsCOL>(nDim)+nColAdd; //! seek source column from name + pFields[nOutCount].nCol = static_cast<SCsCOL>(nDim)+nColAdd; //! seek source column from name pFields[nOutCount].nFuncMask = nMask; pFields[nOutCount].nFuncCount = lcl_CountBits( nMask ); @@ -1826,7 +1826,7 @@ SCSIZE lcl_FillOldFields( PivotField* pFields, } } - // sort by getPosition() value + // sort by getPosition() value for (SCSIZE i=0; i+1<nOutCount; i++) { @@ -1841,7 +1841,7 @@ SCSIZE lcl_FillOldFields( PivotField* pFields, if ( bAddData && !bDataFound ) { if ( nOutCount >= nCount ) // space for data field? - --nOutCount; //! error? + --nOutCount; //! error? pFields[nOutCount].nCol = PIVOT_DATA_FIELD; pFields[nOutCount].nFuncMask = 0; pFields[nOutCount].nFuncCount = 0; @@ -1853,7 +1853,7 @@ SCSIZE lcl_FillOldFields( PivotField* pFields, BOOL ScDPObject::FillOldParam(ScPivotParam& rParam, BOOL bForFile) const { - ((ScDPObject*)this)->CreateObjects(); // xSource is needed for field numbers + ((ScDPObject*)this)->CreateObjects(); // xSource is needed for field numbers rParam.nCol = aOutRange.aStart.Col(); rParam.nRow = aOutRange.aStart.Row(); @@ -1974,7 +1974,7 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) BOOL bDuplicated = FALSE; BOOL bData = ScUnoHelpFunctions::GetBoolProperty( xDimProp, rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) ); - //! error checking -- is "IsDataLayoutDimension" property required?? + //! error checking -- is "IsDataLayoutDimension" property required?? try { @@ -2092,7 +2092,7 @@ BOOL ScDPObject::GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, uno::Reference< } //------------------------------------------------------------------------ -// convert old pivot tables into new datapilot tables +// convert old pivot tables into new datapilot tables String lcl_GetDimName( const uno::Reference<sheet::XDimensionsSupplier>& xSource, long nDim ) { @@ -2132,7 +2132,7 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData, PivotField* pRefRowFields, SCSIZE nRefRowCount, PivotField* pRefPageFields, SCSIZE nRefPageCount ) { - // pDoc or xSource must be set + // pDoc or xSource must be set DBG_ASSERT( pDoc || xSource.is(), "missing string source" ); String aDocStr; @@ -2151,7 +2151,7 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData, if ( pDoc ) pDoc->GetString( nCol, nRow, nTab, aDocStr ); else - aDocStr = lcl_GetDimName( xSource, nCol ); // cols must start at 0 + aDocStr = lcl_GetDimName( xSource, nCol ); // cols must start at 0 if ( aDocStr.Len() ) pDim = rSaveData.GetDimensionByName(aDocStr); @@ -2161,13 +2161,13 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData, if ( pDim ) { - if ( nOrient == sheet::DataPilotFieldOrientation_DATA ) // set summary function + if ( nOrient == sheet::DataPilotFieldOrientation_DATA ) // set summary function { - // generate an individual entry for each function + // generate an individual entry for each function BOOL bFirst = TRUE; // if a dimension is used for column/row/page and data, - // use duplicated dimensions for all data occurrences + // use duplicated dimensions for all data occurrences if (pRefColFields) for (SCSIZE nRefCol=0; nRefCol<nRefColCount; nRefCol++) if (pRefColFields[nRefCol].nCol == nCol) @@ -2181,8 +2181,8 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData, if (pRefPageFields[nRefPage].nCol == nCol) bFirst = FALSE; - // if set via api, a data column may occur several times - // (if the function hasn't been changed yet) -> also look for duplicate data column + // if set via api, a data column may occur several times + // (if the function hasn't been changed yet) -> also look for duplicate data column for (SCSIZE nPrevData=0; nPrevData<i; nPrevData++) if (pFields[nPrevData].nCol == nCol) bFirst = FALSE; @@ -2207,7 +2207,7 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData, nMask *= 2; } } - else // set SubTotals + else // set SubTotals { pDim->SetOrientation( nOrient ); @@ -2222,8 +2222,8 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData, } pDim->SetSubTotals( nFuncCount, nFuncArray ); - // ShowEmpty was implicit in old tables, - // must be set for data layout dimension (not accessible in dialog) + // ShowEmpty was implicit in old tables, + // must be set for data layout dimension (not accessible in dialog) if ( bOldDefaults || nCol == PIVOT_DATA_FIELD ) pDim->SetShowEmpty( TRUE ); } @@ -2233,7 +2233,7 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData, // ----------------------------------------------------------------------- -// static +// static BOOL ScDPObject::HasRegisteredSources() { BOOL bFound = FALSE; @@ -2251,13 +2251,13 @@ BOOL ScDPObject::HasRegisteredSources() return bFound; } -// static +// static uno::Sequence<rtl::OUString> ScDPObject::GetRegisteredSources() { long nCount = 0; uno::Sequence<rtl::OUString> aSeq(0); - // use implementation names... + // use implementation names... uno::Reference<lang::XMultiServiceFactory> xManager = comphelper::getProcessServiceFactory(); uno::Reference<container::XContentEnumerationAccess> xEnAc( xManager, uno::UNO_QUERY ); @@ -2270,7 +2270,7 @@ uno::Sequence<rtl::OUString> ScDPObject::GetRegisteredSources() while ( xEnum->hasMoreElements() ) { uno::Any aAddInAny = xEnum->nextElement(); -// if ( aAddInAny.getReflection()->getTypeClass() == TypeClass_INTERFACE ) +// if ( aAddInAny.getReflection()->getTypeClass() == TypeClass_INTERFACE ) { uno::Reference<uno::XInterface> xIntFac; aAddInAny >>= xIntFac; @@ -2297,7 +2297,7 @@ uno::Sequence<rtl::OUString> ScDPObject::GetRegisteredSources() // use getContext from addincol.cxx uno::Reference<uno::XComponentContext> getContext(uno::Reference<lang::XMultiServiceFactory> xMSF); -// static +// static uno::Reference<sheet::XDimensionsSupplier> ScDPObject::CreateSource( const ScDPServiceDesc& rDesc ) { rtl::OUString aImplName = rDesc.aServiceName; @@ -2314,7 +2314,7 @@ uno::Reference<sheet::XDimensionsSupplier> ScDPObject::CreateSource( const ScDPS while ( xEnum->hasMoreElements() && !xRet.is() ) { uno::Any aAddInAny = xEnum->nextElement(); -// if ( aAddInAny.getReflection()->getTypeClass() == TypeClass_INTERFACE ) +// if ( aAddInAny.getReflection()->getTypeClass() == TypeClass_INTERFACE ) { uno::Reference<uno::XInterface> xIntFac; aAddInAny >>= xIntFac; @@ -2344,7 +2344,7 @@ uno::Reference<sheet::XDimensionsSupplier> ScDPObject::CreateSource( const ScDPS uno::Reference<lang::XInitialization> xInit( xInterface, uno::UNO_QUERY ); if (xInit.is()) { - // initialize + // initialize uno::Sequence<uno::Any> aSeq(4); uno::Any* pArray = aSeq.getArray(); pArray[0] <<= rtl::OUString( rDesc.aParSource ); @@ -2419,14 +2419,14 @@ BOOL ScDPCollection::RefsEqual( const ScDPCollection& r ) const if ( ! ((const ScDPObject*)At(i))->RefsEqual( *((const ScDPObject*)r.At(i)) ) ) return FALSE; - return TRUE; // all equal + return TRUE; // all equal } void ScDPCollection::WriteRefsTo( ScDPCollection& r ) const { if ( nCount == r.nCount ) { - //! assert equal names? + //! assert equal names? for (USHORT i=0; i<nCount; i++) ((const ScDPObject*)At(i))->WriteRefsTo( *((ScDPObject*)r.At(i)) ); } @@ -2479,9 +2479,9 @@ ScDPObject* ScDPCollection::GetByName(const String& rName) const String ScDPCollection::CreateNewName( USHORT nMin ) const { String aBase = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("DataPilot")); - //! from Resource? + //! from Resource? - for (USHORT nAdd=0; nAdd<=nCount; nAdd++) // nCount+1 tries + for (USHORT nAdd=0; nAdd<=nCount; nAdd++) // nCount+1 tries { String aNewName = aBase; aNewName += String::CreateFromInt32( nMin + nAdd ); @@ -2490,9 +2490,9 @@ String ScDPCollection::CreateNewName( USHORT nMin ) const if (((const ScDPObject*)pItems[i])->GetName() == aNewName) bFound = TRUE; if (!bFound) - return aNewName; // found unused Name + return aNewName; // found unused Name } - return String(); // should not happen + return String(); // should not happen } @@ -2500,10 +2500,10 @@ String ScDPCollection::CreateNewName( USHORT nMin ) const // Wang Xu Ming -- 2009-8-17 // DataPilot Migration - Cache&&Performance long ScDPObject::GetCacheId() const -{ +{ if ( GetSaveData() ) return GetSaveData()->GetCacheId(); - else + else return mnCacheId; } ULONG ScDPObject::RefreshCache() @@ -2515,8 +2515,8 @@ ULONG ScDPObject::RefreshCache() } CreateObjects(); - ULONG nErrId = 0; - if ( pSheetDesc) + ULONG nErrId = 0; + if ( pSheetDesc) nErrId = pSheetDesc->CheckValidate( pDoc ); if ( nErrId == 0 ) { @@ -2536,7 +2536,7 @@ ULONG ScDPObject::RefreshCache() //cache failed DBG_ASSERT( pCache , " pCache == NULL" ); return STR_ERR_DATAPILOTSOURCE; - } + } nNewId = pCache->GetId(); @@ -2551,7 +2551,7 @@ ULONG ScDPObject::RefreshCache() (*pDPCollection)[i]->SetRefresh(); } - } + } DBG_ASSERT( GetCacheId() >= 0, " GetCacheId() >= 0 " ); } return nErrId; diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index bdd6fd555b89..16f1be0ca5cc 100755 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -1,7 +1,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 @@ -47,7 +47,7 @@ #include "docpool.hxx" #include "markdata.hxx" #include "attrib.hxx" -#include "formula/errorcodes.hxx" // errNoValue +#include "formula/errorcodes.hxx" // errNoValue #include "miscuno.hxx" #include "globstr.hrc" #include "stlpool.hxx" @@ -79,39 +79,39 @@ using ::rtl::OUString; // ----------------------------------------------------------------------- -//! move to a header file +//! move to a header file //! use names from unonames.hxx? #define DP_PROP_FUNCTION "Function" -#define DP_PROP_ORIENTATION "Orientation" -#define DP_PROP_POSITION "Position" -#define DP_PROP_USEDHIERARCHY "UsedHierarchy" -#define DP_PROP_ISDATALAYOUT "IsDataLayoutDimension" -#define DP_PROP_NUMBERFORMAT "NumberFormat" -#define DP_PROP_FILTER "Filter" +#define DP_PROP_ORIENTATION "Orientation" +#define DP_PROP_POSITION "Position" +#define DP_PROP_USEDHIERARCHY "UsedHierarchy" +#define DP_PROP_ISDATALAYOUT "IsDataLayoutDimension" +#define DP_PROP_NUMBERFORMAT "NumberFormat" +#define DP_PROP_FILTER "Filter" #define DP_PROP_COLUMNGRAND "ColumnGrand" #define DP_PROP_ROWGRAND "RowGrand" #define DP_PROP_SUBTOTALS "SubTotals" // ----------------------------------------------------------------------- -//! dynamic!!! -#define SC_DPOUT_MAXLEVELS 256 +//! dynamic!!! +#define SC_DPOUT_MAXLEVELS 256 struct ScDPOutLevelData { - long nDim; - long nHier; - long nLevel; - long nDimPos; - uno::Sequence<sheet::MemberResult> aResult; + long nDim; + long nHier; + long nLevel; + long nDimPos; + uno::Sequence<sheet::MemberResult> aResult; String maName; /// Name is the internal field name. String aCaption; /// Caption is the name visible in the output table. bool mbHasHiddenMember; ScDPOutLevelData() - { - nDim = nHier = nLevel = nDimPos = -1; + { + nDim = nHier = nLevel = nDimPos = -1; mbHasHiddenMember = false; } @@ -120,10 +120,10 @@ struct ScDPOutLevelData ( nDimPos==r.nDimPos && nHier==r.nHier && nLevel<r.nLevel ); } void Swap(ScDPOutLevelData& r) -//! { ScDPOutLevelData aTemp = r; r = *this; *this = aTemp; } +//! { ScDPOutLevelData aTemp = r; r = *this; *this = aTemp; } { ScDPOutLevelData aTemp; aTemp = r; r = *this; *this = aTemp; } - //! bug (73840) in uno::Sequence - copy and then assign doesn't work! + //! bug (73840) in uno::Sequence - copy and then assign doesn't work! }; // ----------------------------------------------------------------------- @@ -143,7 +143,7 @@ void lcl_SetStyleById( ScDocument* pDoc, SCTAB nTab, ScStyleSheet* pStyle = (ScStyleSheet*) pStlPool->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); if (!pStyle) { - // create new style (was in ScPivot::SetStyle) + // create new style (was in ScPivot::SetStyle) pStyle = (ScStyleSheet*) &pStlPool->Make( aStyleName, SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_USERDEF ); @@ -184,18 +184,18 @@ void lcl_FillNumberFormats( UINT32*& rFormats, long& rCount, const uno::Reference<container::XIndexAccess>& xDims ) { if ( rFormats ) - return; // already set + return; // already set - // xLevRes is from the data layout dimension - //! use result sequence from ScDPOutLevelData! + // xLevRes is from the data layout dimension + //! use result sequence from ScDPOutLevelData! uno::Sequence<sheet::MemberResult> aResult = xLevRes->getResults(); long nSize = aResult.getLength(); if (nSize) { - // get names/formats for all data dimensions - //! merge this with the loop to collect ScDPOutLevelData? + // get names/formats for all data dimensions + //! merge this with the loop to collect ScDPOutLevelData? String aDataNames[SC_DPOUT_MAXLEVELS]; UINT32 nDataFormats[SC_DPOUT_MAXLEVELS]; @@ -229,7 +229,7 @@ void lcl_FillNumberFormats( UINT32*& rFormats, long& rCount, } } - if ( bAnySet ) // forget everything if all formats are 0 (or no data dimensions) + if ( bAnySet ) // forget everything if all formats are 0 (or no data dimensions) { const sheet::MemberResult* pArray = aResult.getConstArray(); @@ -237,7 +237,7 @@ void lcl_FillNumberFormats( UINT32*& rFormats, long& rCount, UINT32* pNumFmt = new UINT32[nSize]; if (nDataCount == 1) { - // only one data dimension -> use its numberformat everywhere + // only one data dimension -> use its numberformat everywhere long nFormat = nDataFormats[0]; for (long nPos=0; nPos<nSize; nPos++) pNumFmt[nPos] = nFormat; @@ -246,14 +246,14 @@ void lcl_FillNumberFormats( UINT32*& rFormats, long& rCount, { for (long nPos=0; nPos<nSize; nPos++) { - // if CONTINUE bit is set, keep previous name - //! keep number format instead! + // if CONTINUE bit is set, keep previous name + //! keep number format instead! if ( !(pArray[nPos].Flags & sheet::MemberResultFlags::CONTINUE) ) aName = String( pArray[nPos].Name ); UINT32 nFormat = 0; for (long i=0; i<nDataCount; i++) - if (aName == aDataNames[i]) //! search more efficiently? + if (aName == aDataNames[i]) //! search more efficiently? { nFormat = nDataFormats[i]; break; @@ -308,7 +308,7 @@ void lcl_SortFields( ScDPOutLevelData* pFields, long nFieldCount ) BOOL lcl_MemberEmpty( const uno::Sequence<sheet::MemberResult>& rSeq ) { - // used to skip levels that have no members + // used to skip levels that have no members long nLen = rSeq.getLength(); const sheet::MemberResult* pArray = rSeq.getConstArray(); @@ -316,7 +316,7 @@ BOOL lcl_MemberEmpty( const uno::Sequence<sheet::MemberResult>& rSeq ) if (pArray[i].Flags & sheet::MemberResultFlags::HASMEMBER) return FALSE; - return TRUE; // no member data -> empty + return TRUE; // no member data -> empty } uno::Sequence<sheet::MemberResult> lcl_GetSelectedPageAsResult( const uno::Reference<beans::XPropertySet>& xDimProp ) @@ -339,7 +339,7 @@ uno::Sequence<sheet::MemberResult> lcl_GetSelectedPageAsResult( const uno::Refer if ( rField.Field == 0 && rField.Operator == sheet::FilterOperator_EQUAL && !rField.IsNumeric ) { rtl::OUString aSelectedPage( rField.StringValue ); - //! different name/caption string? + //! different name/caption string? sheet::MemberResult aResult( aSelectedPage, aSelectedPage, 0 ); aRet = uno::Sequence<sheet::MemberResult>( &aResult, 1 ); } @@ -375,9 +375,9 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS nTabStartCol = nMemberStartCol = nDataStartCol = nTabEndCol = 0; nTabStartRow = nMemberStartRow = nDataStartRow = nTabEndRow = 0; - pColFields = new ScDPOutLevelData[SC_DPOUT_MAXLEVELS]; - pRowFields = new ScDPOutLevelData[SC_DPOUT_MAXLEVELS]; - pPageFields = new ScDPOutLevelData[SC_DPOUT_MAXLEVELS]; + pColFields = new ScDPOutLevelData[SC_DPOUT_MAXLEVELS]; + pRowFields = new ScDPOutLevelData[SC_DPOUT_MAXLEVELS]; + pPageFields = new ScDPOutLevelData[SC_DPOUT_MAXLEVELS]; nColFieldCount = 0; nRowFieldCount = 0; nPageFieldCount = 0; @@ -385,7 +385,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS uno::Reference<sheet::XDataPilotResults> xResult( xSource, uno::UNO_QUERY ); if ( xSource.is() && xResult.is() ) { - // get dimension results: + // get dimension results: uno::Reference<container::XIndexAccess> xDims = new ScNameToIndexAccess( xSource->getDimensions() ); @@ -472,7 +472,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS pRowFields[nRowFieldCount].aCaption= aCaption; pRowFields[nRowFieldCount].mbHasHiddenMember = bHasHiddenMember; if (!lcl_MemberEmpty(pRowFields[nRowFieldCount].aResult)) - { + { ++nRowFieldCount; bRowFieldHasMember = true; } @@ -524,7 +524,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS lcl_SortFields( pRowFields, nRowFieldCount ); lcl_SortFields( pPageFields, nPageFieldCount ); - // get data results: + // get data results: try { @@ -582,7 +582,7 @@ void ScDPOutput::DataCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const sheet::Data { pDoc->SetValue( nCol, nRow, nTab, rData.Value ); - // use number formats from source + // use number formats from source DBG_ASSERT( bSizesValid, "DataCell: !bSizesValid" ); UINT32 nFormat = 0; @@ -614,7 +614,7 @@ void ScDPOutput::DataCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const sheet::Data //pDoc->SetString( nCol, nRow, nTab, EMPTY_STRING ); } - // SubTotal formatting is controlled by headers + // SubTotal formatting is controlled by headers } void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab, @@ -639,14 +639,14 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab, if ( nFlags & sheet::MemberResultFlags::SUBTOTAL ) { -// SvxWeightItem aItem( WEIGHT_BOLD ); // weight is in the style +// SvxWeightItem aItem( WEIGHT_BOLD ); // weight is in the style // Wang Xu Ming -- 2009-8-17 // DataPilot Migration - Cache&&Performance - OutputImpl outputimp( pDoc, nTab, + OutputImpl outputimp( pDoc, nTab, nTabStartCol, nTabStartRow, nMemberStartCol, nMemberStartRow, - nDataStartCol, nDataStartRow, nTabEndCol, nTabEndRow ); + nDataStartCol, nDataStartRow, nTabEndCol, nTabEndRow ); // End Comments - //! limit frames to horizontal or vertical? + //! limit frames to horizontal or vertical? if (bColHeader) { // Wang Xu Ming -- 2009-8-17 @@ -675,14 +675,14 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab, } } -void ScDPOutput::FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rCaption, +void ScDPOutput::FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rCaption, bool bInTable, bool bPopup, bool bHasHiddenMember ) { pDoc->SetString( nCol, nRow, nTab, rCaption ); if (bInTable) lcl_SetFrame( pDoc,nTab, nCol,nRow, nCol,nRow, 20 ); - // Button + // Button sal_uInt16 nMergeFlag = SC_MF_BUTTON; if (bPopup) nMergeFlag |= SC_MF_BUTTON_POPUP; @@ -703,8 +703,8 @@ void ScDPOutput::CalcSizes() { if (!bSizesValid) { - // get column size of data from first row - //! allow different sizes (and clear following areas) ??? + // get column size of data from first row + //! allow different sizes (and clear following areas) ??? nRowCount = aData.getLength(); const uno::Sequence<sheet::DataResult>* pRowAry = aData.getConstArray(); @@ -715,14 +715,14 @@ void ScDPOutput::CalcSizes() // Insert an extra header row only when there is no column field. nHeaderSize = 2; - // calculate output positions and sizes + // calculate output positions and sizes - long nPageSize = 0; //! use page fields! + long nPageSize = 0; //! use page fields! if ( bDoFilter || nPageFieldCount ) { - nPageSize += nPageFieldCount + 1; // plus one empty row + nPageSize += nPageFieldCount + 1; // plus one empty row if ( bDoFilter ) - ++nPageSize; // filter button above the page fields + ++nPageSize; // filter button above the page fields } if ( aStartPos.Col() + nRowFieldCount + nColCount - 1 > MAXCOL || @@ -732,7 +732,7 @@ void ScDPOutput::CalcSizes() } nTabStartCol = aStartPos.Col(); - nTabStartRow = aStartPos.Row() + (SCROW)nPageSize; // below page fields + nTabStartRow = aStartPos.Row() + (SCROW)nPageSize; // below page fields nMemberStartCol = nTabStartCol; nMemberStartRow = nTabStartRow + (SCROW) nHeaderSize; nDataStartCol = nMemberStartCol + (SCCOL)nRowFieldCount; @@ -740,14 +740,14 @@ void ScDPOutput::CalcSizes() if ( nColCount > 0 ) nTabEndCol = nDataStartCol + (SCCOL)nColCount - 1; else - nTabEndCol = nDataStartCol; // single column will remain empty + nTabEndCol = nDataStartCol; // single column will remain empty // if page fields are involved, include the page selection cells if ( nPageFieldCount > 0 && nTabEndCol < nTabStartCol + 1 ) nTabEndCol = nTabStartCol + 1; if ( nRowCount > 0 ) nTabEndRow = nDataStartRow + (SCROW)nRowCount - 1; else - nTabEndRow = nDataStartRow; // single row will remain empty + nTabEndRow = nDataStartRow; // single row will remain empty bSizesValid = TRUE; } } @@ -782,7 +782,7 @@ sal_Int32 ScDPOutput::GetPositionType(const ScAddress& rPos) if (bInColHeader) { if (nRow == nTabStartRow) - // first row in the column header area is always used for column + // first row in the column header area is always used for column // field buttons. return DataPilotTablePositionType::OTHER; @@ -801,35 +801,35 @@ void ScDPOutput::Output() SCTAB nTab = aStartPos.Tab(); const uno::Sequence<sheet::DataResult>* pRowAry = aData.getConstArray(); - // calculate output positions and sizes + // calculate output positions and sizes CalcSizes(); - if ( bSizeOverflow || bResultsError ) // does output area exceed sheet limits? - return; // nothing + if ( bSizeOverflow || bResultsError ) // does output area exceed sheet limits? + return; // nothing - // clear whole (new) output area - //! when modifying table, clear old area - //! include IDF_OBJECTS ??? + // clear whole (new) output area + //! when modifying table, clear old area + //! include IDF_OBJECTS ??? pDoc->DeleteAreaTab( aStartPos.Col(), aStartPos.Row(), nTabEndCol, nTabEndRow, nTab, IDF_ALL ); if ( bDoFilter ) lcl_DoFilterButton( pDoc, aStartPos.Col(), aStartPos.Row(), nTab ); - // output data results: - + // output data results: + for (long nRow=0; nRow<nRowCount; nRow++) { - SCROW nRowPos = nDataStartRow + (SCROW)nRow; //! check for overflow + SCROW nRowPos = nDataStartRow + (SCROW)nRow; //! check for overflow const sheet::DataResult* pColAry = pRowAry[nRow].getConstArray(); long nThisColCount = pRowAry[nRow].getLength(); - DBG_ASSERT( nThisColCount == nColCount, "count mismatch" ); //! ??? + DBG_ASSERT( nThisColCount == nColCount, "count mismatch" ); //! ??? for (long nCol=0; nCol<nThisColCount; nCol++) { - SCCOL nColPos = nDataStartCol + (SCCOL)nCol; //! check for overflow + SCCOL nColPos = nDataStartCol + (SCCOL)nCol; //! check for overflow DataCell( nColPos, nRowPos, nTab, pColAry[nCol] ); } } - // output page fields: + // output page fields: for (nField=0; nField<nPageFieldCount; nField++) { @@ -843,26 +843,26 @@ void ScDPOutput::Output() if ( pPageFields[nField].aResult.getLength() == 1 ) aPageValue = pPageFields[nField].aResult[0].Caption; else - aPageValue = String( ScResId( SCSTR_ALL ) ); //! separate string? + aPageValue = String( ScResId( SCSTR_ALL ) ); //! separate string? pDoc->SetString( nFldCol, nHdrRow, nTab, aPageValue ); lcl_SetFrame( pDoc,nTab, nFldCol,nHdrRow, nFldCol,nHdrRow, 20 ); pDoc->ApplyAttr( nFldCol, nHdrRow, nTab, ScMergeFlagAttr(SC_MF_AUTO) ); - //! which style? + //! which style? } - // data description - // (may get overwritten by first row field) + // data description + // (may get overwritten by first row field) String aDesc = aDataDescription; if ( !aDesc.Len() ) { - //! use default string ("result") ? + //! use default string ("result") ? } pDoc->SetString( nTabStartCol, nTabStartRow, nTab, aDesc ); - // set STR_PIVOT_STYLE_INNER for whole data area (subtotals are overwritten) + // set STR_PIVOT_STYLE_INNER for whole data area (subtotals are overwritten) if ( nDataStartRow > nTabStartRow ) lcl_SetStyleById( pDoc, nTab, nTabStartCol, nTabStartRow, nTabEndCol, nDataStartRow-1, @@ -870,26 +870,26 @@ void ScDPOutput::Output() lcl_SetStyleById( pDoc, nTab, nDataStartCol, nDataStartRow, nTabEndCol, nTabEndRow, STR_PIVOT_STYLE_INNER ); - // output column headers: + // output column headers: // Wang Xu Ming -- 2009-8-17 // DataPilot Migration - Cache&&Performance - OutputImpl outputimp( pDoc, nTab, + OutputImpl outputimp( pDoc, nTab, nTabStartCol, nTabStartRow, nMemberStartCol, nMemberStartRow, - nDataStartCol, nDataStartRow, nTabEndCol, nTabEndRow ); + nDataStartCol, nDataStartRow, nTabEndCol, nTabEndRow ); // End Comments for (nField=0; nField<nColFieldCount; nField++) { - SCCOL nHdrCol = nDataStartCol + (SCCOL)nField; //! check for overflow + SCCOL nHdrCol = nDataStartCol + (SCCOL)nField; //! check for overflow FieldCell( nHdrCol, nTabStartRow, nTab, pColFields[nField].aCaption, true, true, pColFields[nField].mbHasHiddenMember ); - SCROW nRowPos = nMemberStartRow + (SCROW)nField; //! check for overflow + SCROW nRowPos = nMemberStartRow + (SCROW)nField; //! check for overflow const uno::Sequence<sheet::MemberResult> rSequence = pColFields[nField].aResult; const sheet::MemberResult* pArray = rSequence.getConstArray(); long nThisColCount = rSequence.getLength(); - DBG_ASSERT( nThisColCount == nColCount, "count mismatch" ); //! ??? + DBG_ASSERT( nThisColCount == nColCount, "count mismatch" ); //! ??? for (long nCol=0; nCol<nThisColCount; nCol++) { - SCCOL nColPos = nDataStartCol + (SCCOL)nCol; //! check for overflow + SCCOL nColPos = nDataStartCol + (SCCOL)nCol; //! check for overflow HeaderCell( nColPos, nRowPos, nTab, pArray[nCol], TRUE, nField ); // Wang Xu Ming -- 2009-8-17 // DataPilot Migration - Cache&&Performance @@ -906,7 +906,7 @@ void ScDPOutput::Output() // lcl_SetFrame( pDoc,nTab, nColPos,nRowPos, nEndColPos,nTabEndRow, SC_DP_FRAME_INNER_BOLD ); if ( nField == nColFieldCount - 2 ) { - outputimp.AddCol( nColPos ); + outputimp.AddCol( nColPos ); if ( nColPos + 1 == nEndColPos ) outputimp.OutputBlockFrame( nColPos,nRowPos, nEndColPos,nRowPos+1, TRUE ); } @@ -922,30 +922,30 @@ void ScDPOutput::Output() outputimp.AddCol( nColPos ); } if ( nField== 0 && nColFieldCount == 1 ) - outputimp.OutputBlockFrame( nDataStartCol,nTabStartRow, nTabEndCol,nRowPos-1 ); + outputimp.OutputBlockFrame( nDataStartCol,nTabStartRow, nTabEndCol,nRowPos-1 ); // End Comments } - // output row headers: + // output row headers: std::vector<BOOL> vbSetBorder; vbSetBorder.resize( nTabEndRow - nDataStartRow + 1, FALSE ); for (nField=0; nField<nRowFieldCount; nField++) { bool bDataLayout = mbHasDataLayout && (nField == nRowFieldCount-1); - SCCOL nHdrCol = nTabStartCol + (SCCOL)nField; //! check for overflow + SCCOL nHdrCol = nTabStartCol + (SCCOL)nField; //! check for overflow SCROW nHdrRow = nDataStartRow - 1; - FieldCell( nHdrCol, nHdrRow, nTab, pRowFields[nField].aCaption, true, !bDataLayout, + FieldCell( nHdrCol, nHdrRow, nTab, pRowFields[nField].aCaption, true, !bDataLayout, pRowFields[nField].mbHasHiddenMember ); - SCCOL nColPos = nMemberStartCol + (SCCOL)nField; //! check for overflow + SCCOL nColPos = nMemberStartCol + (SCCOL)nField; //! check for overflow const uno::Sequence<sheet::MemberResult> rSequence = pRowFields[nField].aResult; const sheet::MemberResult* pArray = rSequence.getConstArray(); long nThisRowCount = rSequence.getLength(); - DBG_ASSERT( nThisRowCount == nRowCount, "count mismatch" ); //! ??? + DBG_ASSERT( nThisRowCount == nRowCount, "count mismatch" ); //! ??? for (long nRow=0; nRow<nThisRowCount; nRow++) { - SCROW nRowPos = nDataStartRow + (SCROW)nRow; //! check for overflow + SCROW nRowPos = nDataStartRow + (SCROW)nRow; //! check for overflow HeaderCell( nColPos, nRowPos, nTab, pArray[nRow], FALSE, nField ); if ( ( pArray[nRow].Flags & sheet::MemberResultFlags::HASMEMBER ) && !( pArray[nRow].Flags & sheet::MemberResultFlags::SUBTOTAL ) ) @@ -955,7 +955,7 @@ void ScDPOutput::Output() long nEnd = nRow; while ( nEnd+1 < nThisRowCount && ( pArray[nEnd+1].Flags & sheet::MemberResultFlags::CONTINUE ) ) ++nEnd; - SCROW nEndRowPos = nDataStartRow + (SCROW)nEnd; //! check for overflow + SCROW nEndRowPos = nDataStartRow + (SCROW)nEnd; //! check for overflow // Wang Xu Ming -- 2009-8-17 // DataPilot Migration - Cache&&Performance // lcl_SetFrame( pDoc,nTab, nColPos,nRowPos, nColPos,nEndRowPos, SC_DP_FRAME_INNER_BOLD ); @@ -1161,9 +1161,9 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa SCROW nRow = rPos.Row(); SCTAB nTab = rPos.Tab(); if ( nTab != aStartPos.Tab() ) - return; // wrong sheet + return; // wrong sheet - // calculate output positions and sizes + // calculate output positions and sizes CalcSizes(); @@ -1175,12 +1175,12 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa vector<DataPilotFieldFilter> aFilters; GetDataResultPositionData(aFilters, rPos); sal_Int32 nSize = aFilters.size(); - + DataPilotTableResultData aResData; aResData.FieldFilters.realloc(nSize); for (sal_Int32 i = 0; i < nSize; ++i) aResData.FieldFilters[i] = aFilters[i]; - + aResData.DataFieldIndex = 0; Reference<beans::XPropertySet> xPropSet(xSource, UNO_QUERY); if (xPropSet.is()) @@ -1192,10 +1192,10 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa } // Copy appropriate DataResult object from the cached sheet::DataResult table. - if (aData.getLength() > nRow - nDataStartRow && + if (aData.getLength() > nRow - nDataStartRow && aData[nRow-nDataStartRow].getLength() > nCol-nDataStartCol) aResData.Result = aData[nRow-nDataStartRow][nCol-nDataStartCol]; - + rPosData.PositionData = makeAny(aResData); return; } @@ -1240,7 +1240,7 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa const sheet::MemberResult* pArray = rSequence.getConstArray(); long nItem = nRow - nDataStartRow; - // get origin of "continue" fields + // get origin of "continue" fields while ( nItem > 0 && (pArray[nItem].Flags & sheet::MemberResultFlags::CONTINUE) ) --nItem; @@ -1316,7 +1316,7 @@ bool ScDPOutput::GetDataResultPositionData(vector<sheet::DataPilotFieldFilter>& DBG_ASSERT(nDataStartCol + rSequence.getLength() - 1 == nTabEndCol, "ScDPOutput::GetDataFieldCellData: error in geometric assumption"); long nItem = nCol - nDataStartCol; - // get origin of "continue" fields + // get origin of "continue" fields while ( nItem > 0 && (pArray[nItem].Flags & sheet::MemberResultFlags::CONTINUE) ) --nItem; @@ -1340,7 +1340,7 @@ bool ScDPOutput::GetDataResultPositionData(vector<sheet::DataPilotFieldFilter>& DBG_ASSERT(nDataStartRow + rSequence.getLength() - 1 == nTabEndRow, "ScDPOutput::GetDataFieldCellData: error in geometric assumption"); long nItem = nRow - nDataStartRow; - // get origin of "continue" fields + // get origin of "continue" fields while ( nItem > 0 && (pArray[nItem].Flags & sheet::MemberResultFlags::CONTINUE) ) --nItem; @@ -1820,9 +1820,9 @@ BOOL ScDPOutput::IsFilterButton( const ScAddress& rPos ) SCROW nRow = rPos.Row(); SCTAB nTab = rPos.Tab(); if ( nTab != aStartPos.Tab() || !bDoFilter ) - return FALSE; // wrong sheet or no button at all + return FALSE; // wrong sheet or no button at all - // filter button is at top left + // filter button is at top left return ( nCol == aStartPos.Col() && nRow == aStartPos.Row() ); } @@ -1832,13 +1832,13 @@ long ScDPOutput::GetHeaderDim( const ScAddress& rPos, USHORT& rOrient ) SCROW nRow = rPos.Row(); SCTAB nTab = rPos.Tab(); if ( nTab != aStartPos.Tab() ) - return -1; // wrong sheet + return -1; // wrong sheet - // calculate output positions and sizes + // calculate output positions and sizes CalcSizes(); - // test for column header + // test for column header if ( nRow == nTabStartRow && nCol >= nDataStartCol && nCol < nDataStartCol + nColFieldCount ) { @@ -1847,7 +1847,7 @@ long ScDPOutput::GetHeaderDim( const ScAddress& rPos, USHORT& rOrient ) return pColFields[nField].nDim; } - // test for row header + // test for row header if ( nRow+1 == nDataStartRow && nCol >= nTabStartCol && nCol < nTabStartCol + nRowFieldCount ) { @@ -1856,7 +1856,7 @@ long ScDPOutput::GetHeaderDim( const ScAddress& rPos, USHORT& rOrient ) return pRowFields[nField].nDim; } - // test for page field + // test for page field SCROW nPageStartRow = aStartPos.Row() + ( bDoFilter ? 1 : 0 ); if ( nCol == aStartPos.Col() && nRow >= nPageStartRow && nRow < nPageStartRow + nPageFieldCount ) @@ -1866,29 +1866,29 @@ long ScDPOutput::GetHeaderDim( const ScAddress& rPos, USHORT& rOrient ) return pPageFields[nField].nDim; } - //! single data field (?) + //! single data field (?) rOrient = sheet::DataPilotFieldOrientation_HIDDEN; - return -1; // invalid + return -1; // invalid } BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMouseTop, long nDragDim, Rectangle& rPosRect, USHORT& rOrient, long& rDimPos ) { - // Rectangle instead of ScRange for rPosRect to allow for negative values + // Rectangle instead of ScRange for rPosRect to allow for negative values SCCOL nCol = rPos.Col(); SCROW nRow = rPos.Row(); SCTAB nTab = rPos.Tab(); if ( nTab != aStartPos.Tab() ) - return FALSE; // wrong sheet + return FALSE; // wrong sheet - // calculate output positions and sizes + // calculate output positions and sizes CalcSizes(); - // test for column header + // test for column header if ( nCol >= nDataStartCol && nCol <= nTabEndCol && nRow + 1 >= nMemberStartRow && nRow < nMemberStartRow + nColFieldCount ) @@ -1899,12 +1899,12 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo nField = 0; bMouseTop = TRUE; } - //! find start of dimension + //! find start of dimension rPosRect = Rectangle( nDataStartCol, nMemberStartRow + nField, nTabEndCol, nMemberStartRow + nField -1 ); - BOOL bFound = FALSE; // is this within the same orientation? + BOOL bFound = FALSE; // is this within the same orientation? BOOL bBeforeDrag = FALSE; BOOL bAfterDrag = FALSE; for (long nPos=0; nPos<nColFieldCount && !bFound; nPos++) @@ -1939,13 +1939,13 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo } rOrient = sheet::DataPilotFieldOrientation_COLUMN; - rDimPos = nField; //!... + rDimPos = nField; //!... return TRUE; } - // test for row header + // test for row header - // special case if no row fields + // special case if no row fields BOOL bSpecial = ( nRow+1 >= nDataStartRow && nRow <= nTabEndRow && nRowFieldCount == 0 && nCol == nTabStartCol && bMouseLeft ); @@ -1953,12 +1953,12 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo nCol + 1 >= nTabStartCol && nCol < nTabStartCol + nRowFieldCount ) ) { long nField = nCol - nTabStartCol; - //! find start of dimension + //! find start of dimension rPosRect = Rectangle( nTabStartCol + nField, nDataStartRow - 1, nTabStartCol + nField - 1, nTabEndRow ); - BOOL bFound = FALSE; // is this within the same orientation? + BOOL bFound = FALSE; // is this within the same orientation? BOOL bBeforeDrag = FALSE; BOOL bAfterDrag = FALSE; for (long nPos=0; nPos<nRowFieldCount && !bFound; nPos++) @@ -1993,11 +1993,11 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo } rOrient = sheet::DataPilotFieldOrientation_ROW; - rDimPos = nField; //!... + rDimPos = nField; //!... return TRUE; } - // test for page fields + // test for page fields SCROW nPageStartRow = aStartPos.Row() + ( bDoFilter ? 1 : 0 ); if ( nCol >= aStartPos.Col() && nCol <= nTabEndCol && @@ -2009,12 +2009,12 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo nField = 0; bMouseTop = TRUE; } - //! find start of dimension + //! find start of dimension rPosRect = Rectangle( aStartPos.Col(), nPageStartRow + nField, nTabEndCol, nPageStartRow + nField - 1 ); - BOOL bFound = FALSE; // is this within the same orientation? + BOOL bFound = FALSE; // is this within the same orientation? BOOL bBeforeDrag = FALSE; BOOL bAfterDrag = FALSE; for (long nPos=0; nPos<nPageFieldCount && !bFound; nPos++) @@ -2049,7 +2049,7 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo } rOrient = sheet::DataPilotFieldOrientation_PAGE; - rDimPos = nField; //!... + rDimPos = nField; //!... return TRUE; } diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx index fd9bee0ed572..7a6e46a9532d 100644 --- a/sc/source/core/data/dpoutputgeometry.cxx +++ b/sc/source/core/data/dpoutputgeometry.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index dd493bb0df6c..84b5bdb9a542 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -1,7 +1,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 @@ -80,16 +80,16 @@ using ::std::auto_ptr; // ----------------------------------------------------------------------- -#define SC_DPSAVEMODE_NO 0 -#define SC_DPSAVEMODE_YES 1 -#define SC_DPSAVEMODE_DONTKNOW 2 +#define SC_DPSAVEMODE_NO 0 +#define SC_DPSAVEMODE_YES 1 +#define SC_DPSAVEMODE_DONTKNOW 2 // ----------------------------------------------------------------------- void lcl_SetBoolProperty( const uno::Reference<beans::XPropertySet>& xProp, const rtl::OUString& rName, sal_Bool bValue ) { - //! move to ScUnoHelpFunctions? + //! move to ScUnoHelpFunctions? xProp->setPropertyValue( rName, uno::Any( &bValue, getBooleanCppuType() ) ); } @@ -120,8 +120,8 @@ ScDPSaveMember::~ScDPSaveMember() BOOL ScDPSaveMember::operator== ( const ScDPSaveMember& r ) const { - if ( aName != r.aName || - nVisibleMode != r.nVisibleMode || + if ( aName != r.aName || + nVisibleMode != r.nVisibleMode || nShowDetailsMode != r.nShowDetailsMode ) return FALSE; @@ -286,18 +286,18 @@ ScDPSaveDimension::~ScDPSaveDimension() BOOL ScDPSaveDimension::operator== ( const ScDPSaveDimension& r ) const { - if ( aName != r.aName || - bIsDataLayout != r.bIsDataLayout || - bDupFlag != r.bDupFlag || - nOrientation != r.nOrientation || - nFunction != r.nFunction || + if ( aName != r.aName || + bIsDataLayout != r.bIsDataLayout || + bDupFlag != r.bDupFlag || + nOrientation != r.nOrientation || + nFunction != r.nFunction || nUsedHierarchy != r.nUsedHierarchy || nShowEmptyMode != r.nShowEmptyMode || bSubTotalDefault != r.bSubTotalDefault || nSubTotalCount != r.nSubTotalCount ) return FALSE; - if ( nSubTotalCount && ( !pSubTotalFuncs || !r.pSubTotalFuncs ) ) // should not happen + if ( nSubTotalCount && ( !pSubTotalFuncs || !r.pSubTotalFuncs ) ) // should not happen return FALSE; long i; @@ -606,8 +606,8 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, SC_UNO_FIELD_SUBTOTALNAME, *pSubTotalName); } - // Level loop outside of maMemberList loop - // because SubTotals have to be set independently of known members + // Level loop outside of maMemberList loop + // because SubTotals have to be set independently of known members long nCount = maMemberHash.size(); @@ -803,11 +803,11 @@ ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r ) BOOL ScDPSaveData::operator== ( const ScDPSaveData& r ) const { if ( nColumnGrandMode != r.nColumnGrandMode || - nRowGrandMode != r.nRowGrandMode || + nRowGrandMode != r.nRowGrandMode || nIgnoreEmptyMode != r.nIgnoreEmptyMode || nRepeatEmptyMode != r.nRepeatEmptyMode || bFilterButton != r.bFilterButton || - mnCacheId != r.mnCacheId ||/// Wang Xu Ming -- 2009-6-18 DataPilot Migration + mnCacheId != r.mnCacheId ||/// Wang Xu Ming -- 2009-6-18 DataPilot Migration bDrillDown != r.bDrillDown || mbDimensionMembersBuilt != r.mbDimensionMembersBuilt) return FALSE; @@ -881,7 +881,7 @@ ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const String& rName) if ( pDim->GetName() == rName && !pDim->IsDataLayout() ) return pDim; } - return NULL; // don't create new + return NULL; // don't create new } ScDPSaveDimension* ScDPSaveData::GetNewDimensionByName(const String& rName) @@ -923,8 +923,8 @@ ScDPSaveDimension* ScDPSaveData::GetExistingDataLayoutDimension() const ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const String& rName) { - // always insert new - //! check if dimension is there? + // always insert new + //! check if dimension is there? ScDPSaveDimension* pOld = GetDimensionByName( rName ); ScDPSaveDimension* pNew = new ScDPSaveDimension( *pOld ); @@ -1001,12 +1001,12 @@ long ScDPSaveData::GetDataDimensionCount() const void ScDPSaveData::SetPosition( ScDPSaveDimension* pDim, long nNew ) { - // position (nNew) is counted within dimensions of the same orientation + // position (nNew) is counted within dimensions of the same orientation USHORT nOrient = pDim->GetOrientation(); aDimList.Remove( pDim ); - ULONG nCount = aDimList.Count(); // after remove + ULONG nCount = aDimList.Count(); // after remove ULONG nInsPos = 0; while ( nNew > 0 && nInsPos < nCount ) @@ -1074,14 +1074,14 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie if (!xSource.is()) return; - // source options must be first! + // source options must be first! uno::Reference<beans::XPropertySet> xSourceProp( xSource, uno::UNO_QUERY ); DBG_ASSERT( xSourceProp.is(), "no properties at source" ); if ( xSourceProp.is() ) { - // source options are not available for external sources - //! use XPropertySetInfo to test for availability? + // source options are not available for external sources + //! use XPropertySetInfo to test for availability? try { @@ -1105,9 +1105,9 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie // exceptions in the other calls are errors try { - // reset all orientations - //! "forgetSettings" or similar at source ????? - //! reset all duplicated dimensions, or reuse them below !!! + // reset all orientations + //! "forgetSettings" or similar at source ????? + //! reset all duplicated dimensions, or reuse them below !!! DBG_TRACE( "ScDPSaveData::WriteToSource" ); lcl_ResetOrient( xSource ); @@ -1119,10 +1119,10 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie rtl::OUString aName = pDim->GetName(); DBG_TRACESTR(pDim->GetName()); - + BOOL bData = pDim->IsDataLayout(); - //! getByName for ScDPSource, including DataLayoutDimension !!!!!!!! + //! getByName for ScDPSource, including DataLayoutDimension !!!!!!!! uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions(); uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName ); @@ -1138,7 +1138,7 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie { bFound = ScUnoHelpFunctions::GetBoolProperty( xDimProp, rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) ); - //! error checking -- is "IsDataLayoutDimension" property required?? + //! error checking -- is "IsDataLayoutDimension" property required?? } } else @@ -1155,8 +1155,8 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie String aNewName = pDim->GetName(); // different name for each duplication of a (real) dimension... - for (long j=0; j<=i; j++) //! Test !!!!!! - aNewName += '*'; //! modify name at creation of SaveDimension + for (long j=0; j<=i; j++) //! Test !!!!!! + aNewName += '*'; //! modify name at creation of SaveDimension uno::Reference<util::XCloneable> xCloneable( xIntDim, uno::UNO_QUERY ); DBG_ASSERT( xCloneable.is(), "cannot clone dimension" ); @@ -1203,7 +1203,7 @@ BOOL ScDPSaveData::IsEmpty() const if ( pDim->GetOrientation() != sheet::DataPilotFieldOrientation_HIDDEN && !pDim->IsDataLayout() ) return FALSE; } - return TRUE; // no entries that are not hidden + return TRUE; // no entries that are not hidden } ScDPDimensionSaveData* ScDPSaveData::GetDimensionData() @@ -1346,13 +1346,13 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference< return; SCCOL nSrcDim = pCache->GetDimensionIndex( GetName() ); - + if ( nSrcDim == -1 ) return; if ( pSelectedPage ) {//check pSelected page DBG_TRACESTR( (*pSelectedPage) ); - if ( pCache->GetIdByItemData( nSrcDim, *pSelectedPage ) == -1 ) + if ( pCache->GetIdByItemData( nSrcDim, *pSelectedPage ) == -1 ) { delete pSelectedPage; pSelectedPage = NULL; @@ -1361,8 +1361,8 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference< }; if ( pReferenceValue && pReferenceValue->ReferenceItemType == DataPilotFieldReferenceItemType::NAMED ) - {//check pReferenceValue -#ifdef DEBUG + {//check pReferenceValue +#ifdef DEBUG switch( pReferenceValue->ReferenceType) { case sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE: //both @@ -1398,7 +1398,7 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference< { //running total has not reference item const String& sReferenceItemName = pReferenceValue->ReferenceItemName; DBG_TRACESTR( sReferenceItemName ); - if ( pCache->GetIdByItemData( nRefDim, sReferenceItemName ) == -1 ) + if ( pCache->GetIdByItemData( nRefDim, sReferenceItemName ) == -1 ) bValid = false; } if ( !bValid ) @@ -1421,7 +1421,7 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference< const String& sFieldDimName = pSortInfo->Field; std::list<String>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName ); if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 ) - { + { pSortInfo->Mode = DataPilotFieldSortMode::MANUAL; pSortInfo->Field = GetName(); } @@ -1434,7 +1434,7 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference< const String& sFieldDimName = pAutoShowInfo->DataField; std::list<String>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName ); if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 ) - { + { delete pAutoShowInfo; pAutoShowInfo = NULL; } @@ -1446,10 +1446,10 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference< for (MemberList::iterator i=maMemberList.begin(); i != maMemberList.end() ; ) { rtl::OUString aMemberName = (*i)->GetName(); - if ( pCache->GetIdByItemData( nSrcDim, aMemberName ) == -1 ) + if ( pCache->GetIdByItemData( nSrcDim, aMemberName ) == -1 ) i = maMemberList.erase( i ); else - i++; + i++; } } } @@ -1460,15 +1460,15 @@ bool operator == (const ::com::sun::star::sheet::DataPilotFieldSortInfo &l, cons } bool operator == (const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo &l, const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo &r ) { - return l.IsEnabled == r.IsEnabled && - l.ShowItemsMode == r.ShowItemsMode && + return l.IsEnabled == r.IsEnabled && + l.ShowItemsMode == r.ShowItemsMode && l.ItemCount == r.ItemCount && l.DataField == r.DataField; } bool operator == (const ::com::sun::star::sheet::DataPilotFieldReference &l, const ::com::sun::star::sheet::DataPilotFieldReference &r ) { - return l.ReferenceType == r.ReferenceType && - l.ReferenceField == r.ReferenceField && + return l.ReferenceType == r.ReferenceType && + l.ReferenceField == r.ReferenceField && l.ReferenceItemType == r.ReferenceItemType && l.ReferenceItemName == r.ReferenceItemName; } diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx index b966d9d458ea..0d4a1af94a91 100644 --- a/sc/source/core/data/dpsdbtab.cxx +++ b/sc/source/core/data/dpsdbtab.cxx @@ -1,7 +1,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 @@ -68,13 +68,13 @@ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::UNO_QUERY; -#define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet" -#define SC_SERVICE_INTHANDLER "com.sun.star.task.InteractionHandler" +#define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet" +#define SC_SERVICE_INTHANDLER "com.sun.star.task.InteractionHandler" -//! move to a header file? -#define SC_DBPROP_DATASOURCENAME "DataSourceName" -#define SC_DBPROP_COMMAND "Command" -#define SC_DBPROP_COMMANDTYPE "CommandType" +//! move to a header file? +#define SC_DBPROP_DATASOURCENAME "DataSourceName" +#define SC_DBPROP_COMMAND "Command" +#define SC_DBPROP_COMMANDTYPE "CommandType" // ----------------------------------------------------------------------- // Wang Xu Ming -- 2009-9-15 // DataPilot Migration - Cache&&Performance @@ -83,7 +83,7 @@ using ::com::sun::star::uno::UNO_QUERY; ScDPTableDataCache* pCache = NULL; ScDPCollection* pDPCollection= pDoc->GetDPCollection(); USHORT nCount = pDPCollection->GetCount(); - + for ( short i=nCount-1; i>=0 ; i--) { if ( const ScImportSourceDesc* pUsedDesc = (*pDPCollection)[i]->GetImportSourceDesc() ) @@ -105,7 +105,7 @@ ScDPTableDataCache* ScImportSourceDesc::CreateCache( ScDocument* pDoc , long nID return NULL; sal_Int32 nSdbType = -1; - + switch ( nType ) { case sheet::DataImportMode_SQL: nSdbType = sdb::CommandType::COMMAND; break; @@ -123,7 +123,7 @@ ScDPTableDataCache* ScImportSourceDesc::CreateCache( ScDocument* pDoc , long nID if ( pCache == NULL ) pCache = new ScDPTableDataCache( pDoc ); - + uno::Reference<sdbc::XRowSet> xRowSet ; try { @@ -195,7 +195,7 @@ ScDPTableDataCache* ScImportSourceDesc::GetCache( ScDocument* pDoc, long nID ) c if ( NULL == pCache && pDoc ) pCache = GetExistDPObjectCache( pDoc); if ( NULL == pCache ) - pCache = CreateCache( pDoc , nID ); + pCache = CreateCache( pDoc , nID ); return pCache; } @@ -204,7 +204,7 @@ long ScImportSourceDesc:: GetCacheId( ScDocument* pDoc, long nID ) const ScDPTableDataCache* pCache = GetCache( pDoc, nID); if ( NULL == pCache ) return -1; - else + else return pCache->GetId(); } @@ -225,7 +225,7 @@ ScDatabaseDPData::~ScDatabaseDPData() void ScDatabaseDPData::DisposeData() { - //! use OpenDatabase here? + //! use OpenDatabase here? aCacheTable.clear(); } @@ -241,7 +241,7 @@ String ScDatabaseDPData::getDimensionName(long nColumn) { if (getIsDataLayoutDimension(nColumn)) { - //! different internal and display names? + //! different internal and display names? //return "Data"; return ScGlobal::GetRscString(STR_PIVOT_DATA); } @@ -257,14 +257,14 @@ BOOL ScDatabaseDPData::getIsDataLayoutDimension(long nColumn) BOOL ScDatabaseDPData::IsDateDimension(long /* nDim */) { - //! later... + //! later... return FALSE; } void ScDatabaseDPData::SetEmptyFlags( BOOL /* bIgnoreEmptyRows */, BOOL /* bRepeatIfEmpty */ ) { - // not used for database data - //! disable flags + // not used for database data + //! disable flags } void ScDatabaseDPData::CreateCacheTable() diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index a1fa9d2d60a6..6bdf5170cd01 100755 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -1,7 +1,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 @@ -115,7 +115,7 @@ String ScSheetDPData::getDimensionName(long nColumn) CreateCacheTable(); if (getIsDataLayoutDimension(nColumn)) { - //! different internal and display names? + //! different internal and display names? //return "Data"; return ScGlobal::GetRscString(STR_PIVOT_DATA); } @@ -164,16 +164,16 @@ ULONG ScSheetDPData::GetNumberFormat(long nDim) else { return GetCacheTable().GetCache()->GetNumberFormat( nDim ); - } + } } -UINT32 ScDPTableData::GetNumberFormatByIdx( NfIndexTableOffset eIdx ) +UINT32 ScDPTableData::GetNumberFormatByIdx( NfIndexTableOffset eIdx ) { if( !mpDoc ) return 0; if ( SvNumberFormatter* pFormatter = mpDoc->GetFormatTable() ) return pFormatter->GetFormatIndex( eIdx, LANGUAGE_SYSTEM ); - + return 0; } @@ -201,7 +201,7 @@ void ScSheetDPData::CreateCacheTable() // already cached. return; - aCacheTable.fillTable( aQuery, pSpecial, + aCacheTable.fillTable( aQuery, pSpecial, bIgnoreEmptyRows, bRepeatIfEmpty ); } @@ -273,7 +273,7 @@ ScDPTableDataCache* ScSheetSourceDesc::GetCache( ScDocument* pDoc, long nID ) co if ( NULL == pCache && pDoc ) pCache = GetExistDPObjectCache( pDoc ); if ( NULL == pCache ) - pCache = CreateCache( pDoc ); + pCache = CreateCache( pDoc ); return pCache; } @@ -282,7 +282,7 @@ long ScSheetSourceDesc:: GetCacheId( ScDocument* pDoc, long nID ) const ScDPTableDataCache* pCache = GetCache( pDoc, nID); if ( NULL == pCache ) return -1; - else + else return pCache->GetId(); } @@ -295,11 +295,11 @@ ULONG ScSheetSourceDesc::CheckValidate( ScDocument* pDoc ) const { if ( pDoc->IsBlockEmpty( aSrcRange.aStart.Tab(), i, aSrcRange.aStart.Row(),i, aSrcRange.aStart.Row())) - return STR_PIVOT_FIRSTROWEMPTYERR; + return STR_PIVOT_FIRSTROWEMPTYERR; } if( pDoc->IsBlockEmpty( aSrcRange.aStart.Tab(), aSrcRange.aStart.Col(), aSrcRange.aStart.Row()+1, aSrcRange.aEnd.Col(), aSrcRange.aEnd.Row() ) ) { - return STR_PIVOT_ONLYONEROWERR; + return STR_PIVOT_ONLYONEROWERR; } return 0; } diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx index cb68732a237f..7ae5fb453a3e 100755 --- a/sc/source/core/data/dptabdat.cxx +++ b/sc/source/core/data/dptabdat.cxx @@ -1,7 +1,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 @@ -65,9 +65,9 @@ ScDPTableData::ScDPTableData(ScDocument* pDoc, long nCacheId ) : mnCacheId( nCacheId ), mpDoc ( pDoc ) { - nLastDateVal = nLastHier = nLastLevel = nLastRet = -1; // invalid + nLastDateVal = nLastHier = nLastLevel = nLastRet = -1; // invalid - //! reset before new calculation (in case the base date is changed) + //! reset before new calculation (in case the base date is changed) } ScDPTableData::~ScDPTableData() @@ -79,7 +79,7 @@ long ScDPTableData::GetDatePart( long nDateVal, long nHierarchy, long nLevel ) if ( nDateVal == nLastDateVal && nHierarchy == nLastHier && nLevel == nLastLevel ) return nLastRet; - Date aDate( 30,12,1899 ); //! get from source data (and cache here) + Date aDate( 30,12,1899 ); //! get from source data (and cache here) aDate += nDateVal; long nRet = 0; @@ -88,10 +88,10 @@ long ScDPTableData::GetDatePart( long nDateVal, long nHierarchy, long nLevel ) case SC_DAPI_HIERARCHY_QUARTER: switch (nLevel) { - case 0: nRet = aDate.GetYear(); break; - case 1: nRet = (aDate.GetMonth()-1) / 3 + 1; break; - case 2: nRet = aDate.GetMonth(); break; - case 3: nRet = aDate.GetDay(); break; + case 0: nRet = aDate.GetYear(); break; + case 1: nRet = (aDate.GetMonth()-1) / 3 + 1; break; + case 2: nRet = aDate.GetMonth(); break; + case 3: nRet = aDate.GetDay(); break; default: DBG_ERROR("GetDatePart: wrong level"); } @@ -99,10 +99,10 @@ long ScDPTableData::GetDatePart( long nDateVal, long nHierarchy, long nLevel ) case SC_DAPI_HIERARCHY_WEEK: switch (nLevel) { - //! use settings for different definitions - case 0: nRet = aDate.GetYear(); break; //!... - case 1: nRet = aDate.GetWeekOfYear(); break; - case 2: nRet = (long)aDate.GetDayOfWeek(); break; + //! use settings for different definitions + case 0: nRet = aDate.GetYear(); break; //!... + case 1: nRet = aDate.GetWeekOfYear(); break; + case 2: nRet = (long)aDate.GetDayOfWeek(); break; default: DBG_ERROR("GetDatePart: wrong level"); } @@ -112,9 +112,9 @@ long ScDPTableData::GetDatePart( long nDateVal, long nHierarchy, long nLevel ) } nLastDateVal = nDateVal; - nLastHier = nHierarchy; - nLastLevel = nLevel; - nLastRet = nRet; + nLastHier = nHierarchy; + nLastLevel = nLevel; + nLastRet = nRet; return nRet; } @@ -126,7 +126,7 @@ bool ScDPTableData::IsRepeatIfEmpty() ULONG ScDPTableData::GetNumberFormat(long) { - return 0; // default format + return 0; // default format } BOOL ScDPTableData::IsBaseForGroup(long) const @@ -157,7 +157,7 @@ BOOL ScDPTableData::HasCommonElement( const ScDPItemData&, long, DBG_ERROR("HasCommonElement shouldn't be called for non-group data"); return FALSE; } -void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPCacheTable& rCacheTable, +void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPCacheTable& rCacheTable, const CalcInfo& rInfo, CalcRowData& rData) { // column dimensions @@ -188,7 +188,7 @@ void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPCacheTab void ScDPTableData::ProcessRowData(CalcInfo& rInfo, CalcRowData& rData, bool bAutoShow) { // Wang Xu Ming -- 2009-6-16 - // DataPilot Migration + // DataPilot Migration if (!bAutoShow) { LateInitParams aColParams( rInfo.aColDims, rInfo.aColLevels, FALSE ); @@ -217,7 +217,7 @@ void ScDPTableData::ProcessRowData(CalcInfo& rInfo, CalcRowData& rData, bool bAu // End Comments } - rInfo.pRowRoot->ProcessData(rData.aRowData, rInfo.pColRoot->GetChildDimension(), + rInfo.pRowRoot->ProcessData(rData.aRowData, rInfo.pColRoot->GetChildDimension(), rData.aColData, rData.aValues); } } @@ -238,7 +238,7 @@ void ScDPTableData::CalcResultsFromCacheTable(const ScDPCacheTable& rCacheTable, // Wang Xu Ming -- 2009-6-10 // DataPilot Migration -void ScDPTableData::GetItemData(const ScDPCacheTable& rCacheTable, sal_Int32 nRow, +void ScDPTableData::GetItemData(const ScDPCacheTable& rCacheTable, sal_Int32 nRow, const vector<long>& rDims, vector< SCROW/*ScDPItemData*/>& rItemData) // End Comments { @@ -283,7 +283,7 @@ const ScDPItemData* ScDPTableData::GetMemberByIndex( long nDim, long nIndex ) { if ( nIndex >= GetMembersCount( nDim ) ) return NULL; - + const ::std::vector<SCROW>& nMembers = GetCacheTable().getFieldEntries( nDim ); return GetCacheTable().GetCache()->GetItemDataById( (SCCOL) nDim, (SCROW)nMembers[nIndex] ); @@ -291,16 +291,16 @@ const ScDPItemData* ScDPTableData::GetMemberByIndex( long nDim, long nIndex ) const ScDPItemData* ScDPTableData::GetMemberById( long nDim, long nId) { - + return GetCacheTable().GetCache()->GetItemDataById( (SCCOL) nDim, (SCROW)nId); } -SCROW ScDPTableData::GetIdOfItemData( long nDim, const ScDPItemData& rData ) +SCROW ScDPTableData::GetIdOfItemData( long nDim, const ScDPItemData& rData ) { return GetCacheTable().GetCache()->GetIdByItemData((SCCOL) nDim, rData ); } -const std::vector< SCROW >& ScDPTableData::GetColumnEntries( long nColumn ) +const std::vector< SCROW >& ScDPTableData::GetColumnEntries( long nColumn ) { return GetCacheTable().getFieldEntries( nColumn ); } @@ -313,16 +313,16 @@ long ScDPTableData::GetSourceDim( long nDim ) long ScDPTableData::Compare( long nDim, long nDataId1, long nDataId2) { - if ( getIsDataLayoutDimension(nDim) ) + if ( getIsDataLayoutDimension(nDim) ) return 0; - long n1 = GetCacheTable().GetCache()->GetOrder( nDim, nDataId1); - long n2 = GetCacheTable().GetCache()->GetOrder( nDim, nDataId2); - if ( n1 > n2 ) - return 1; - else if ( n1 == n2 ) - return 0; - else + long n1 = GetCacheTable().GetCache()->GetOrder( nDim, nDataId1); + long n2 = GetCacheTable().GetCache()->GetOrder( nDim, nDataId2); + if ( n1 > n2 ) + return 1; + else if ( n1 == n2 ) + return 0; + else return -1; } // End Comments diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx index 8f25b70e41b6..f350e86496a0 100755 --- a/sc/source/core/data/dptablecache.cxx +++ b/sc/source/core/data/dptablecache.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright IBM Corporation 2009. * Copyright 2009 by Sun Microsystems, Inc. * @@ -57,7 +57,7 @@ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::UNO_QUERY_THROW; // ----------------------------------------------------------------------- -namespace +namespace { BOOL lcl_isDate( ULONG nNumType ) { @@ -91,7 +91,7 @@ namespace rIndex = nLo; return bFound; } - + ScDPItemData* lcl_GetItemValue(const Reference<sdbc::XRow>& xRow, sal_Int32 nType, long nCol, const Date& rNullDate ) { @@ -106,7 +106,7 @@ namespace case sdbc::DataType::BOOLEAN: { nNumType = NUMBERFORMAT_LOGICAL; - fValue = xRow->getBoolean(nCol) ? 1 : 0; + fValue = xRow->getBoolean(nCol) ? 1 : 0; return new ScDPItemData( rStr, fValue,TRUE,nNumType); } //break; @@ -186,7 +186,7 @@ namespace ScDPItemData::ScDPItemData( const String& rS, double fV/* = 0.0*/, BOOL bHV/* = FALSE*/, const ULONG nNumFormatP /*= 0*/ , BOOL bData/* = TRUE*/) : nNumFormat( nNumFormatP ), aString(rS), fValue(fV), mbFlag( (MK_VAL*!!bHV) | (MK_DATA*!!bData) | (MK_ERR*!!FALSE) | (MK_DATE*!!lcl_isDate( nNumFormat ) ) ) -{ +{ } ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nDocTab ): @@ -194,9 +194,9 @@ ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nD { String aDocStr; pDoc->GetString( nCol, nRow, nDocTab, aDocStr ); - + SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); - + ScAddress aPos( nCol, nRow, nDocTab ); ScBaseCell* pCell = pDoc->GetCell( aPos ); @@ -223,7 +223,7 @@ ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nD BOOL ScDPItemData::IsCaseInsEqual( const ScDPItemData& r ) const { //TODO: indified Date? //! pass Transliteration? - //! inline? + //! inline? return IsValue() ? ( r.IsValue() && rtl::math::approxEqual( fValue, r.fValue ) ) : ( !r.IsValue() && ScGlobal::GetpTransliteration()->isEqual( aString, r.aString ) ); @@ -251,7 +251,7 @@ BOOL ScDPItemData::operator==( const ScDPItemData& r ) const // Identify date if ( IsDate() != r.IsDate() ) return FALSE; - else + else if ( r.IsValue() ) return rtl::math::approxEqual( fValue, r.fValue ); else @@ -299,7 +299,7 @@ sal_Int32 ScDPItemData::Compare( const ScDPItemData& rA, // //Wang Xu Ming SODC_17561 #ifdef DEBUG -void ScDPItemData::dump() const +void ScDPItemData::dump() const { DBG_TRACE1( "Numberformat= %o", nNumFormat ); DBG_TRACESTR(aString ); @@ -319,64 +319,64 @@ TypedStrData* ScDPItemData::CreateTypeString( ) sal_uInt8 ScDPItemData::GetType() const { - + if ( IsHasErr() ) return SC_VALTYPE_ERROR; else if ( !IsHasData() ) return SC_VALTYPE_EMPTY; else if ( IsValue()) return SC_VALTYPE_VALUE; - else + else return SC_VALTYPE_STRING; } -BOOL ScDPItemData::IsHasData() const +BOOL ScDPItemData::IsHasData() const { return !!(mbFlag&MK_DATA); } -BOOL ScDPItemData::IsHasErr() const -{ - return !!(mbFlag&MK_ERR); +BOOL ScDPItemData::IsHasErr() const +{ + return !!(mbFlag&MK_ERR); } -BOOL ScDPItemData::IsValue() const -{ +BOOL ScDPItemData::IsValue() const +{ return !!(mbFlag&MK_VAL); } -String ScDPItemData::GetString() const -{ +String ScDPItemData::GetString() const +{ return aString; } -double ScDPItemData::GetValue() const -{ +double ScDPItemData::GetValue() const +{ return fValue; } -ULONG ScDPItemData::GetNumFormat() const -{ +ULONG ScDPItemData::GetNumFormat() const +{ return nNumFormat; } -BOOL ScDPItemData::HasStringData() const +BOOL ScDPItemData::HasStringData() const -{ +{ return IsHasData()&&!IsHasErr()&&!IsValue(); } BOOL ScDPItemData::IsDate() const -{ - return !!(mbFlag&MK_DATE); +{ + return !!(mbFlag&MK_DATE); } BOOL ScDPItemData::HasDatePart() const { - return !!(mbFlag&MK_DATEPART); + return !!(mbFlag&MK_DATEPART); } -void ScDPItemData::SetDate( BOOL b ) +void ScDPItemData::SetDate( BOOL b ) { - b ? ( mbFlag |= MK_DATE ) : ( mbFlag &= ~MK_DATE ); + b ? ( mbFlag |= MK_DATE ) : ( mbFlag &= ~MK_DATE ); } // ----------------------------------------------------------------------- @@ -388,7 +388,7 @@ BOOL ScDPTableDataCache::operator== ( const ScDPTableDataCache& r ) const if ( GetColumnCount() == r.GetColumnCount() ) { for ( SCCOL i = 0 ; i < GetColumnCount(); i++ ) - { //check dim names + { //check dim names if ( GetDimensionName( i ) != r.GetDimensionName( i ) ) return FALSE; //check rows count @@ -402,12 +402,12 @@ BOOL ScDPTableDataCache::operator== ( const ScDPTableDataCache& r ) const { if ( *( GetDimMemberValues( i )[j] ) == *( r.GetDimMemberValues( i )[j] ) ) continue; - else + else return FALSE; } } - else - return FALSE; + else + return FALSE; //check source table index for ( SCROW k=0 ; k < GetRowCount(); k ++ ) { @@ -415,7 +415,7 @@ BOOL ScDPTableDataCache::operator== ( const ScDPTableDataCache& r ) const continue; else return FALSE; - } + } } } return TRUE; @@ -444,7 +444,7 @@ ScDPTableDataCache::~ScDPTableDataCache() for ( ULONG row = 0 ; row < mpTableDataValues[nCol].size(); row++ ) delete mpTableDataValues[nCol][row]; } - for ( nCol =0; nCol < mrLabelNames.size(); nCol++ ) + for ( nCol =0; nCol < mrLabelNames.size(); nCol++ ) delete mrLabelNames[nCol]; // End Comments @@ -462,15 +462,15 @@ ScDPTableDataCache::~ScDPTableDataCache() // ----------------------------------------------------------------------- void ScDPTableDataCache::AddRow( ScDPItemData* pRow, USHORT nCount ) -{ +{ DBG_ASSERT( pRow , " empty pointer" ); if ( !mrLabelNames.size() ) { mnColumnCount= nCount; mpTableDataValues = new std::vector<ScDPItemData*>[ mnColumnCount ]; - mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; - mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; - mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; + mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; for ( USHORT i = 0; i < nCount ; i ++ ) AddLabel( new ScDPItemData( pRow[i] ) ); @@ -492,10 +492,10 @@ bool ScDPTableDataCache::IsValid() const namespace { -/** - * While the macro interpret level is incremented, the formula cells are - * (semi-)guaranteed to be interpreted. - */ +/** + * While the macro interpret level is incremented, the formula cells are + * (semi-)guaranteed to be interpreted. + */ class MacroInterpretIncrementer { public: @@ -517,20 +517,20 @@ private: // ----------------------------------------------------------------------- bool ScDPTableDataCache::InitFromDoc( ScDocument* pDoc, const ScRange& rRange ) { - // Make sure the formula cells within the data range are interpreted + // Make sure the formula cells within the data range are interpreted // during this call, for this method may be called from the interpretation // of GETPIVOTDATA, which disables nested formula interpretation without // increasing the macro level. MacroInterpretIncrementer aMacroInc(pDoc); // - SCROW nStartRow = rRange.aStart.Row(); // start of data + SCROW nStartRow = rRange.aStart.Row(); // start of data SCROW nEndRow = rRange.aEnd.Row(); USHORT nStartCol = rRange.aStart.Col(); USHORT nEndCol = rRange.aEnd.Col(); USHORT nDocTab = rRange.aStart.Tab(); - - //init + + //init long nOldColumCount = mnColumnCount; mnColumnCount = nEndCol - nStartCol + 1; if ( IsValid() ) @@ -547,11 +547,11 @@ bool ScDPTableDataCache::InitFromDoc( ScDocument* pDoc, const ScRange& rRange ) delete [] mpIndexOrder; mrLabelNames.clear(); } - + mpTableDataValues = new std::vector<ScDPItemData*>[ mnColumnCount ]; - mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; - mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; - mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; + mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; //check valid for ( SCROW nRow = nStartRow; nRow <= nEndRow; nRow ++ ) { @@ -598,9 +598,9 @@ bool ScDPTableDataCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowS // Get column titles and types. mrLabelNames.reserve(mnColumnCount); mpTableDataValues = new std::vector<ScDPItemData*>[ mnColumnCount ]; - mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; - mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; - mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpSourceData = new std::vector<SCROW>[ mnColumnCount ]; + mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ]; + mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ]; std::vector<sal_Int32> aColTypes(mnColumnCount); @@ -615,7 +615,7 @@ bool ScDPTableDataCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowS Reference<sdbc::XRow> xRow(xRowSet, UNO_QUERY_THROW); xRowSet->first(); do - { + { for (sal_Int32 nCol = 0; nCol < mnColumnCount; ++nCol) { ScDPItemData * pNew = lcl_GetItemValue( xRow, aColTypes[nCol], nCol+1, rNullDate ); @@ -646,12 +646,12 @@ ULONG ScDPTableDataCache::GetDimNumType( SCCOL nDim) const } // ----------------------------------------------------------------------- -bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOOL *pSpecial) +bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOOL *pSpecial) { //Copied and modified from ScTable::ValidQuery if (!rParam.GetEntry(0).bDoQuery) return TRUE; - BOOL bMatchWholeCell = mpDoc->GetDocOptions().IsMatchWholeCell(); - + BOOL bMatchWholeCell = mpDoc->GetDocOptions().IsMatchWholeCell(); + //--------------------------------------------------------------- const SCSIZE nFixedBools = 32; @@ -661,8 +661,8 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO BOOL* pPasst = ( nEntryCount <= nFixedBools ? &aBool[0] : new BOOL[nEntryCount] ); BOOL* pTest = ( nEntryCount <= nFixedBools ? &aTest[0] : new BOOL[nEntryCount] ); - long nPos = -1; - SCSIZE i = 0; + long nPos = -1; + SCSIZE i = 0; CollatorWrapper* pCollator = (rParam.bCaseSens ? ScGlobal::GetCaseCollator() : ScGlobal::GetCollator() ); ::utl::TransliterationWrapper* pTransliteration = (rParam.bCaseSens ? @@ -672,8 +672,8 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO { ScQueryEntry& rEntry = rParam.GetEntry(i); // we can only handle one single direct query - SCROW nId = GetItemDataId( (SCCOL)rEntry.nField, nRow, FALSE ); - const ScDPItemData* pCellData = GetItemDataById( (SCCOL)rEntry.nField, nId); + SCROW nId = GetItemDataId( (SCCOL)rEntry.nField, nRow, FALSE ); + const ScDPItemData* pCellData = GetItemDataById( (SCCOL)rEntry.nField, nId); BOOL bOk = FALSE; BOOL bTestEqual = FALSE; @@ -686,9 +686,9 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO bOk = pCellData->IsHasData(); } else if ( !rEntry.bQueryByString && pCellData->IsValue() ) - { // by Value + { // by Value double nCellVal = pCellData->GetValue(); - + switch (rEntry.eOp) { case SC_EQUAL : @@ -718,8 +718,8 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO || (rEntry.bQueryByString && pCellData->HasStringData() ) ) - { // by String - String aCellStr = pCellData->GetString(); + { // by String + String aCellStr = pCellData->GetString(); BOOL bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL) || (rEntry.eOp == SC_NOT_EQUAL))); @@ -859,7 +859,7 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO // ----------------------------------------------------------------------- bool ScDPTableDataCache::IsRowEmpty( SCROW nRow ) const { - return mbEmptyRow[ nRow ]; + return mbEmptyRow[ nRow ]; } @@ -873,10 +873,10 @@ BOOL ScDPTableDataCache::AddData(long nDim, ScDPItemData* pitemData) { DBG_ASSERT( IsValid(), " IsValid() == false " ); DBG_ASSERT( nDim < mnColumnCount && nDim >=0 , "dimension out of bound" ); - SCROW nIndex = 0; - - BOOL bInserted = FALSE; + SCROW nIndex = 0; + BOOL bInserted = FALSE; + pitemData->SetDate( lcl_isDate( GetNumType( pitemData->nNumFormat ) ) ); if ( !lcl_Search( mpTableDataValues[nDim], mpGlobalOrder[nDim], *pitemData, nIndex ) ) @@ -898,7 +898,7 @@ BOOL ScDPTableDataCache::AddData(long nDim, ScDPItemData* pitemData) if ( pitemData->IsHasData() ) mbEmptyRow[ nCurRow ] = FALSE; - if ( !bInserted ) + if ( !bInserted ) delete pitemData; return TRUE; @@ -910,7 +910,7 @@ String ScDPTableDataCache::GetDimensionName( USHORT nColumn ) const DBG_ASSERT( /* nColumn>=0 && */ nColumn < mrLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName"); DBG_ASSERT( mrLabelNames.size() == static_cast <USHORT> (mnColumnCount+1), "ScDPTableDataCache::GetDimensionName"); if ( static_cast<size_t>(nColumn+1) < mrLabelNames.size() ) - { + { return mrLabelNames[nColumn+1]->aString; } else @@ -918,11 +918,11 @@ String ScDPTableDataCache::GetDimensionName( USHORT nColumn ) const } void ScDPTableDataCache::AddLabel(ScDPItemData *pData) -{ +{ DBG_ASSERT( IsValid(), " IsValid() == false " ); if ( mrLabelNames.size() == 0 ) - mrLabelNames.push_back( new ScDPItemData( ScGlobal::GetRscString(STR_PIVOT_DATA) ) ); + mrLabelNames.push_back( new ScDPItemData( ScGlobal::GetRscString(STR_PIVOT_DATA) ) ); //reset name if needed @@ -946,7 +946,7 @@ void ScDPTableDataCache::AddLabel(ScDPItemData *pData) while ( !bFound ); pData->aString = strNewName; - mrLabelNames.push_back( pData ); + mrLabelNames.push_back( pData ); } SCROW ScDPTableDataCache::GetItemDataId(USHORT nDim, SCROW nRow, BOOL bRepeatIfEmpty) const @@ -955,7 +955,7 @@ SCROW ScDPTableDataCache::GetItemDataId(USHORT nDim, SCROW nRow, BOOL bRepeatIfE DBG_ASSERT( /* nDim >= 0 && */ nDim < mnColumnCount, "ScDPTableDataCache::GetItemDataId " ); if ( bRepeatIfEmpty ) - { + { while ( nRow >0 && !mpTableDataValues[nDim][ mpSourceData[nDim][nRow] ]->IsHasData() ) --nRow; } @@ -993,7 +993,7 @@ SCROW ScDPTableDataCache::GetSortedItemDataId(SCCOL nDim, SCROW nOrder) const DBG_ASSERT ( IsValid(), "IsValid"); DBG_ASSERT( nDim>=0 && nDim < mnColumnCount, "nDim < mnColumnCount"); DBG_ASSERT( nOrder >= 0 && (size_t) nOrder < mpGlobalOrder[nDim].size(), "nOrder < mpGlobalOrder[nDim].size()" ); - + return mpGlobalOrder[nDim][nOrder]; } @@ -1016,7 +1016,7 @@ ULONG ScDPTableDataCache::GetNumberFormat( long nDim ) const return mpTableDataValues[nDim][0]->nNumFormat; } -BOOL ScDPTableDataCache::IsDateDimension( long nDim ) const +BOOL ScDPTableDataCache::IsDateDimension( long nDim ) const { if ( nDim >= mnColumnCount ) return false; @@ -1050,7 +1050,7 @@ SCCOL ScDPTableDataCache::GetDimensionIndex(String sName) const } SCROW ScDPTableDataCache::GetIdByItemData(long nDim, String sItemData ) const -{ +{ if ( nDim < mnColumnCount && nDim >=0 ) { for ( size_t n = 0; n< mpTableDataValues[nDim].size(); n++ ) @@ -1059,13 +1059,13 @@ SCROW ScDPTableDataCache::GetIdByItemData(long nDim, String sItemData ) const return n; } } - + ScDPItemData rData ( sItemData ); return GetRowCount() +maAdditionalDatas.getDataId(rData); } SCROW ScDPTableDataCache::GetIdByItemData( long nDim, const ScDPItemData& rData ) const -{ +{ if ( nDim < mnColumnCount && nDim >=0 ) { for ( size_t n = 0; n< mpTableDataValues[nDim].size(); n++ ) @@ -1087,7 +1087,7 @@ SCROW ScDPTableDataCache::GetAdditionalItemID( const ScDPItemData& rData ) { return GetRowCount() + maAdditionalDatas.insertData( rData ); } - + SCROW ScDPTableDataCache::GetOrder(long nDim, SCROW nIndex) const { @@ -1111,15 +1111,15 @@ SCROW ScDPTableDataCache::GetOrder(long nDim, SCROW nIndex) const ScDocument* ScDPTableDataCache::GetDoc() const { - return mpDoc; + return mpDoc; }; -long ScDPTableDataCache::GetColumnCount() const +long ScDPTableDataCache::GetColumnCount() const { - return mnColumnCount; + return mnColumnCount; } -long ScDPTableDataCache::GetId() const +long ScDPTableDataCache::GetId() const { - return mnID; + return mnID; } - + diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index c79f7c1b17a6..aef7a8c7c15f 100755 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -1,7 +1,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 @@ -41,12 +41,12 @@ #include "global.hxx" #include "subtotal.hxx" #include "globstr.hrc" -#include "datauno.hxx" // ScDataUnoConversion +#include "datauno.hxx" // ScDataUnoConversion #include "document.hxx" // for DumpState only! #include <math.h> -#include <float.h> //! Test !!! +#include <float.h> //! Test !!! #include <algorithm> #include <hash_map> @@ -72,20 +72,20 @@ SV_IMPL_PTRARR( ScDPDataMembers, ScDPDataMemberPtr ); // ----------------------------------------------------------------------- -static USHORT nFuncStrIds[12] = // passend zum enum ScSubTotalFunc -{ - 0, // SUBTOTAL_FUNC_NONE - STR_FUN_TEXT_AVG, // SUBTOTAL_FUNC_AVE - STR_FUN_TEXT_COUNT, // SUBTOTAL_FUNC_CNT - STR_FUN_TEXT_COUNT, // SUBTOTAL_FUNC_CNT2 - STR_FUN_TEXT_MAX, // SUBTOTAL_FUNC_MAX - STR_FUN_TEXT_MIN, // SUBTOTAL_FUNC_MIN - STR_FUN_TEXT_PRODUCT, // SUBTOTAL_FUNC_PROD - STR_FUN_TEXT_STDDEV, // SUBTOTAL_FUNC_STD - STR_FUN_TEXT_STDDEV, // SUBTOTAL_FUNC_STDP - STR_FUN_TEXT_SUM, // SUBTOTAL_FUNC_SUM - STR_FUN_TEXT_VAR, // SUBTOTAL_FUNC_VAR - STR_FUN_TEXT_VAR // SUBTOTAL_FUNC_VARP +static USHORT nFuncStrIds[12] = // passend zum enum ScSubTotalFunc +{ + 0, // SUBTOTAL_FUNC_NONE + STR_FUN_TEXT_AVG, // SUBTOTAL_FUNC_AVE + STR_FUN_TEXT_COUNT, // SUBTOTAL_FUNC_CNT + STR_FUN_TEXT_COUNT, // SUBTOTAL_FUNC_CNT2 + STR_FUN_TEXT_MAX, // SUBTOTAL_FUNC_MAX + STR_FUN_TEXT_MIN, // SUBTOTAL_FUNC_MIN + STR_FUN_TEXT_PRODUCT, // SUBTOTAL_FUNC_PROD + STR_FUN_TEXT_STDDEV, // SUBTOTAL_FUNC_STD + STR_FUN_TEXT_STDDEV, // SUBTOTAL_FUNC_STDP + STR_FUN_TEXT_SUM, // SUBTOTAL_FUNC_SUM + STR_FUN_TEXT_VAR, // SUBTOTAL_FUNC_VAR + STR_FUN_TEXT_VAR // SUBTOTAL_FUNC_VARP }; namespace { template < typename T > @@ -95,7 +95,7 @@ namespace { for ( size_t i = 0 ; i < vec.size(); i++ ) { if ( vec[i] ) - delete vec[i]; + delete vec[i]; } vec.resize( nSize, NULL ); } @@ -418,8 +418,8 @@ ScDPRelativePos::ScDPRelativePos( long nBase, long nDir ) : void ScDPAggData::Update( const ScDPValueData& rNext, ScSubTotalFunc eFunc, const ScDPSubTotalState& rSubState ) { - if (nCount<0) // error? - return; // nothing more... + if (nCount<0) // error? + return; // nothing more... if ( rNext.nType == SC_VALTYPE_EMPTY ) return; @@ -433,35 +433,35 @@ void ScDPAggData::Update( const ScDPValueData& rNext, ScSubTotalFunc eFunc, cons if ( eFunc == SUBTOTAL_FUNC_NONE ) return; - if ( eFunc != SUBTOTAL_FUNC_CNT2 ) // CNT2 counts everything, incl. strings and errors + if ( eFunc != SUBTOTAL_FUNC_CNT2 ) // CNT2 counts everything, incl. strings and errors { if ( rNext.nType == SC_VALTYPE_ERROR ) { - nCount = -1; // -1 for error (not for CNT2) + nCount = -1; // -1 for error (not for CNT2) return; } if ( rNext.nType == SC_VALTYPE_STRING ) - return; // ignore + return; // ignore } - ++nCount; // for all functions + ++nCount; // for all functions switch (eFunc) { case SUBTOTAL_FUNC_SUM: case SUBTOTAL_FUNC_AVE: if ( !SubTotal::SafePlus( fVal, rNext.fValue ) ) - nCount = -1; // -1 for error + nCount = -1; // -1 for error break; case SUBTOTAL_FUNC_PROD: - if ( nCount == 1 ) // copy first value (fVal is initialized to 0) + if ( nCount == 1 ) // copy first value (fVal is initialized to 0) fVal = rNext.fValue; else if ( !SubTotal::SafeMult( fVal, rNext.fValue ) ) - nCount = -1; // -1 for error + nCount = -1; // -1 for error break; case SUBTOTAL_FUNC_CNT: case SUBTOTAL_FUNC_CNT2: - // nothing more than incrementing nCount + // nothing more than incrementing nCount break; case SUBTOTAL_FUNC_MAX: if ( nCount == 1 || rNext.fValue > fVal ) @@ -478,11 +478,11 @@ void ScDPAggData::Update( const ScDPValueData& rNext, ScSubTotalFunc eFunc, cons { // fAux is used to sum up squares if ( !SubTotal::SafePlus( fVal, rNext.fValue ) ) - nCount = -1; // -1 for error + nCount = -1; // -1 for error double fAdd = rNext.fValue; if ( !SubTotal::SafeMult( fAdd, rNext.fValue ) || !SubTotal::SafePlus( fAux, fAdd ) ) - nCount = -1; // -1 for error + nCount = -1; // -1 for error } break; default: @@ -492,8 +492,8 @@ void ScDPAggData::Update( const ScDPValueData& rNext, ScSubTotalFunc eFunc, cons void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSubState ) { - // calculate the original result - // (without reference value, used as the basis for reference value calculation) + // calculate the original result + // (without reference value, used as the basis for reference value calculation) // called several times at the cross-section of several subtotals - don't calculate twice then if ( IsCalculated() ) @@ -508,7 +508,7 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub return; } - // check the error conditions for the selected function + // check the error conditions for the selected function BOOL bError = FALSE; switch (eFunc) @@ -517,7 +517,7 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub case SUBTOTAL_FUNC_PROD: case SUBTOTAL_FUNC_CNT: case SUBTOTAL_FUNC_CNT2: - bError = ( nCount < 0 ); // only real errors + bError = ( nCount < 0 ); // only real errors break; case SUBTOTAL_FUNC_AVE: @@ -525,19 +525,19 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub case SUBTOTAL_FUNC_MIN: case SUBTOTAL_FUNC_STDP: case SUBTOTAL_FUNC_VARP: - bError = ( nCount <= 0 ); // no data is an error + bError = ( nCount <= 0 ); // no data is an error break; case SUBTOTAL_FUNC_STD: case SUBTOTAL_FUNC_VAR: - bError = ( nCount < 2 ); // need at least 2 values + bError = ( nCount < 2 ); // need at least 2 values break; default: DBG_ERROR("invalid function"); } - // calculate the selected function + // calculate the selected function double fResult = 0.0; if ( !bError ) @@ -548,7 +548,7 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub case SUBTOTAL_FUNC_MIN: case SUBTOTAL_FUNC_SUM: case SUBTOTAL_FUNC_PROD: - // different error conditions are handled above + // different error conditions are handled above fResult = fVal; break; @@ -562,7 +562,7 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub fResult = fVal / (double) nCount; break; - //! use safe mul for fVal * fVal + //! use safe mul for fVal * fVal case SUBTOTAL_FUNC_STD: if ( nCount >= 2 ) @@ -585,13 +585,13 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub } } - BOOL bEmpty = ( nCount == 0 ); // no data + BOOL bEmpty = ( nCount == 0 ); // no data - // store the result - // Empty is checked first, so empty results are shown empty even for "average" etc. - // If these results should be treated as errors in reference value calculations, - // a separate state value (EMPTY_ERROR) is needed. - // Now, for compatibility, empty "average" results are counted as 0. + // store the result + // Empty is checked first, so empty results are shown empty even for "average" etc. + // If these results should be treated as errors in reference value calculations, + // a separate state value (EMPTY_ERROR) is needed. + // Now, for compatibility, empty "average" results are counted as 0. if ( bEmpty ) nCount = SC_DPAGG_RESULT_EMPTY; @@ -601,11 +601,11 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub nCount = SC_DPAGG_RESULT_VALID; if ( bEmpty || bError ) - fResult = 0.0; // default, in case the state is later modified + fResult = 0.0; // default, in case the state is later modified // fprintf(stdout, "ScDPAggData::Calculate: result = %g\n", fResult);fflush(stdout); - fVal = fResult; // used directly from now on - fAux = 0.0; // used for running total or original result of reference value + fVal = fResult; // used directly from now on + fAux = 0.0; // used for running total or original result of reference value } BOOL ScDPAggData::IsCalculated() const @@ -740,7 +740,7 @@ static ScSubTotalFunc lcl_GetForceFunc( const ScDPLevel* pLevel, long nFuncNo ) ScSubTotalFunc eRet = SUBTOTAL_FUNC_NONE; if ( pLevel ) { - //! direct access via ScDPLevel + //! direct access via ScDPLevel uno::Sequence<sheet::GeneralFunction> aSeq = pLevel->getSubTotals(); long nSequence = aSeq.getLength(); @@ -765,7 +765,7 @@ static ScSubTotalFunc lcl_GetForceFunc( const ScDPLevel* pLevel, long nFuncNo ) // ----------------------------------------------------------------------- -ScDPResultData::ScDPResultData( ScDPSource* pSrc ) : //! Ref +ScDPResultData::ScDPResultData( ScDPSource* pSrc ) : //! Ref pSource( pSrc ), nMeasCount( 0 ), pMeasFuncs( NULL ), @@ -815,11 +815,11 @@ void ScDPResultData::SetMeasureData( long nCount, const ScSubTotalFunc* pFunctio } else { - // use one dummy measure + // use one dummy measure nMeasCount = 1; pMeasFuncs = new ScSubTotalFunc[1]; pMeasFuncs[0] = SUBTOTAL_FUNC_NONE; - pMeasRefs = new sheet::DataPilotFieldReference[1]; // default ctor is ok + pMeasRefs = new sheet::DataPilotFieldReference[1]; // default ctor is ok pMeasRefOrient = new USHORT[1]; pMeasRefOrient[0] = sheet::DataPilotFieldOrientation_HIDDEN; pMeasNames = new String[1]; @@ -870,13 +870,13 @@ USHORT ScDPResultData::GetMeasureRefOrient(long nMeasure) const String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const { - // with bForce==TRUE, return function instead of "result" for single measure - // with eForceFunc != SUBTOTAL_FUNC_NONE, always use eForceFunc + // with bForce==TRUE, return function instead of "result" for single measure + // with eForceFunc != SUBTOTAL_FUNC_NONE, always use eForceFunc rbTotalResult = false; if ( nMeasure < 0 || ( nMeasCount == 1 && !bForce && eForceFunc == SUBTOTAL_FUNC_NONE ) ) { - // for user-specified subtotal function with all measures, - // display only function name + // for user-specified subtotal function with all measures, + // display only function name if ( eForceFunc != SUBTOTAL_FUNC_NONE ) return ScGlobal::GetRscString(nFuncStrIds[eForceFunc]); @@ -899,10 +899,10 @@ String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFu USHORT nId = nFuncStrIds[eFunc]; if (nId) { - aRet += ScGlobal::GetRscString(nId); // function name + aRet += ScGlobal::GetRscString(nId); // function name aRet.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " - " )); } - aRet += pMeasNames[nMeasure]; // field name + aRet += pMeasNames[nMeasure]; // field name return aRet; } @@ -940,7 +940,7 @@ BOOL ScDPResultData::IsInGroup( const ScDPItemData& rGroupData, long nGroupIndex const ScDPItemData* pData = pSource->GetItemDataById( nGroupIndex , nBaseDataId); if ( pData ) return pSource->GetData()->IsInGroup( rGroupData, nGroupIndex, *pData , nBaseIndex ); - else + else return FALSE; } BOOL ScDPResultData::IsInGroup( SCROW nGroupDataId, long nGroupIndex, @@ -949,7 +949,7 @@ BOOL ScDPResultData::IsInGroup( SCROW nGroupDataId, long nGroupIndex, const ScDPItemData* pGroupData = pSource->GetItemDataById( nGroupIndex , nGroupDataId); if ( pGroupData ) return pSource->GetData()->IsInGroup( *pGroupData, nGroupIndex, rBaseData , nBaseIndex ); - else + else return FALSE; } @@ -968,17 +968,17 @@ const ScDPSource* ScDPResultData::GetSource() const return pSource; } -ResultMembers* ScDPResultData::GetDimResultMembers( long nDim , ScDPDimension* pDim, ScDPLevel* pLevel) const +ResultMembers* ScDPResultData::GetDimResultMembers( long nDim , ScDPDimension* pDim, ScDPLevel* pLevel) const { - if ( mpDimMembers[ nDim ] == NULL ) + if ( mpDimMembers[ nDim ] == NULL ) { - //long nDimSource = pDim->GetDimension(); - + //long nDimSource = pDim->GetDimension(); + ResultMembers* pResultMembers = new ResultMembers(); // global order is used to initialize aMembers, so it doesn't have to be looked at later const ScMemberSortOrder& rGlobalOrder = pLevel->GetGlobalOrder(); - + ScDPMembers* pMembers = pLevel->GetMembersObject(); long nMembCount = pMembers->getCount(); for ( long i=0; i<nMembCount; i++ ) @@ -1017,7 +1017,7 @@ ScDPResultMember::ScDPResultMember( const ScDPResultData* pData, const ScDPPare // pParentLevel/pMemberDesc is 0 for root members } -ScDPResultMember::ScDPResultMember( const ScDPResultData* pData, +ScDPResultMember::ScDPResultMember( const ScDPResultData* pData, BOOL bForceSub ) : pResultData( pData ), pChildDimension( NULL ), @@ -1042,7 +1042,7 @@ String ScDPResultMember::GetName() const if (pMemberDesc) return pMemberDesc->GetNameStr(); else - return ScGlobal::GetRscString(STR_PIVOT_TOTAL); // root member + return ScGlobal::GetRscString(STR_PIVOT_TOTAL); // root member } void ScDPResultMember::FillItemData( ScDPItemData& rData ) const @@ -1056,7 +1056,7 @@ void ScDPResultMember::FillItemData( ScDPItemData& rData ) const BOOL ScDPResultMember::IsNamedItem( SCROW nIndex ) const { - //! store ScDPMember pointer instead of ScDPMember ??? + //! store ScDPMember pointer instead of ScDPMember ??? const ScDPMember* pMemberDesc = GetDPMember(); if (pMemberDesc) return ((ScDPMember*)pMemberDesc)->IsNamedItem( nIndex ); @@ -1082,11 +1082,11 @@ bool ScDPResultMember::IsValidEntry( const vector< SCROW >& aMembers ) const return true; } -void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, +void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, size_t nPos, ScDPInitState& rInitState , BOOL bInitChild /*= TRUE */) { - // with LateInit, initialize only those members that have data + // with LateInit, initialize only those members that have data if ( pResultData->IsLateInit() ) return; @@ -1095,7 +1095,7 @@ void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vect if (nPos >= ppDim.size()) return; - // skip child dimension if details are not shown + // skip child dimension if details are not shown if ( GetDPMember() && !GetDPMember()->getShowDetails() ) { // Wang Xu Ming -- 2009-6-16 @@ -1110,17 +1110,17 @@ void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vect pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState , FALSE ); return; } - else + else { //find next dim nPos ++; nMemberStep ++; } } // End Comments - bHasHiddenDetails = TRUE; // only if there is a next dimension + bHasHiddenDetails = TRUE; // only if there is a next dimension return; } - + if ( bInitChild ) { pChildDimension = new ScDPResultDimension( pResultData ); @@ -1128,11 +1128,11 @@ void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vect } } -void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev*/, +void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev*/, const vector< SCROW >& pItemData, size_t nPos, ScDPInitState& rInitState ) { - // without LateInit, everything has already been initialized + // without LateInit, everything has already been initialized if ( !pResultData->IsLateInit() ) return; @@ -1142,7 +1142,7 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD // No next dimension. Bail out. return; - // skip child dimension if details are not shown + // skip child dimension if details are not shown if ( GetDPMember() && !GetDPMember()->getShowDetails() ) { // Wang Xu Ming -- 2009-6-16 @@ -1164,7 +1164,7 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD rParams.SetInitChild( bWasInitChild ); return; } - else + else { //find next dim nPos ++; nMemberStep ++; @@ -1175,7 +1175,7 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD return; } - // LateInitFrom is called several times... + // LateInitFrom is called several times... if ( rParams.GetInitChild() ) { if ( !pChildDimension ) @@ -1210,7 +1210,7 @@ long ScDPResultMember::GetSize(long nMeasure) const { if ( !IsVisible() ) return 0; - const ScDPLevel* pParentLevel = GetParentLevel(); + const ScDPLevel* pParentLevel = GetParentLevel(); long nExtraSpace = 0; if ( pParentLevel && pParentLevel->IsAddEmpty() ) ++nExtraSpace; @@ -1245,18 +1245,18 @@ long ScDPResultMember::GetSize(long nMeasure) const BOOL ScDPResultMember::IsVisible() const { - // not initialized -> shouldn't be there at all - // (allocated only to preserve ordering) - const ScDPLevel* pParentLevel = GetParentLevel(); + // not initialized -> shouldn't be there at all + // (allocated only to preserve ordering) + const ScDPLevel* pParentLevel = GetParentLevel(); return ( bHasElements || ( pParentLevel && pParentLevel->getShowEmpty() ) ) && IsValid() && bInitialized; } BOOL ScDPResultMember::IsValid() const { - // non-Valid members are left out of calculation + // non-Valid members are left out of calculation - // was member set no invisible at the DataPilotSource? - const ScDPMember* pMemberDesc =GetDPMember(); + // was member set no invisible at the DataPilotSource? + const ScDPMember* pMemberDesc =GetDPMember(); if ( pMemberDesc && !pMemberDesc->getIsVisible() ) return FALSE; @@ -1279,13 +1279,13 @@ long ScDPResultMember::GetSubTotalCount( long* pUserSubStart ) const if ( pUserSubStart ) *pUserSubStart = 0; // default - const ScDPLevel* pParentLevel = GetParentLevel(); + const ScDPLevel* pParentLevel = GetParentLevel(); - if ( bForceSubTotal ) // set if needed for root members - return 1; // grand total is always "automatic" + if ( bForceSubTotal ) // set if needed for root members + return 1; // grand total is always "automatic" else if ( pParentLevel ) { - //! direct access via ScDPLevel + //! direct access via ScDPLevel uno::Sequence<sheet::GeneralFunction> aSeq = pParentLevel->getSubTotals(); long nSequence = aSeq.getLength(); @@ -1327,8 +1327,8 @@ void ScDPResultMember::ProcessData( const vector< SCROW >& aChildMembers, const // show only own values if there's no child dimension (innermost). if ( !nUserSubCount || !pChildDimension ) nUserSubCount = 1; - - const ScDPLevel* pParentLevel = GetParentLevel(); + + const ScDPLevel* pParentLevel = GetParentLevel(); for (long nUserPos=0; nUserPos<nUserSubCount; nUserPos++) // including hidden "automatic" { @@ -1343,10 +1343,10 @@ void ScDPResultMember::ProcessData( const vector< SCROW >& aChildMembers, const } } -/** +/** * Parse subtotal string and replace all occurrences of '?' with the caption * string. Do ensure that escaped characters are not translated. - */ + */ static String lcl_parseSubtotalName(const String& rSubStr, const String& rCaption) { String aNewStr; @@ -1375,8 +1375,8 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS const String* pMemberName, const String* pMemberCaption ) { - // IsVisible() test is in ScDPResultDimension::FillMemberResults - // (not on data layout dimension) + // IsVisible() test is in ScDPResultDimension::FillMemberResults + // (not on data layout dimension) long nSize = GetSize(nMeasure); sheet::MemberResult* pArray = pSequences->getArray(); @@ -1384,7 +1384,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS BOOL bIsNumeric = FALSE; String aName; - if ( pMemberName ) // if pMemberName != NULL, use instead of real member name + if ( pMemberName ) // if pMemberName != NULL, use instead of real member name aName = *pMemberName; else { @@ -1393,7 +1393,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS aName = aItemData.GetString(); bIsNumeric = aItemData.IsValue(); } - const ScDPDimension* pParentDim = GetParentDim(); + const ScDPDimension* pParentDim = GetParentDim(); if ( bIsNumeric && pParentDim && pResultData->IsNumOrDateGroup( pParentDim->GetDimension() ) ) { // Numeric group dimensions use numeric entries for proper sorting, @@ -1413,7 +1413,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS } } - if ( pMemberCaption ) // use pMemberCaption if != NULL + if ( pMemberCaption ) // use pMemberCaption if != NULL aCaption = *pMemberCaption; if (!aCaption.Len()) aCaption = ScGlobal::GetRscString(STR_EMPTYDATA); @@ -1423,18 +1423,18 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS else pArray[rPos].Flags &= ~sheet::MemberResultFlags::NUMERIC; - if ( nSize && !bRoot ) // root is overwritten by first dimension + if ( nSize && !bRoot ) // root is overwritten by first dimension { pArray[rPos].Name = rtl::OUString(aName); pArray[rPos].Caption = rtl::OUString(aCaption); - pArray[rPos].Flags |= sheet::MemberResultFlags::HASMEMBER; + pArray[rPos].Flags |= sheet::MemberResultFlags::HASMEMBER; - // set "continue" flag (removed for subtotals later) + // set "continue" flag (removed for subtotals later) for (long i=1; i<nSize; i++) pArray[rPos+i].Flags |= sheet::MemberResultFlags::CONTINUE; } - - const ScDPLevel* pParentLevel = GetParentLevel(); + + const ScDPLevel* pParentLevel = GetParentLevel(); long nExtraSpace = 0; if ( pParentLevel && pParentLevel->IsAddEmpty() ) ++nExtraSpace; @@ -1453,11 +1453,11 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS if ( bTitleLine ) // in tabular layout the title is on a separate row ++rPos; // -> fill child dimension one row below - if (bRoot) // same sequence for root member + if (bRoot) // same sequence for root member pChildDimension->FillMemberResults( pSequences, rPos, nMeasure ); else //pChildDimension->FillMemberResults( pSequences + 1, rPos, nMeasure ); - pChildDimension->FillMemberResults( pSequences + nMemberStep/*1*/, rPos, nMeasure ); + pChildDimension->FillMemberResults( pSequences + nMemberStep/*1*/, rPos, nMeasure ); if ( bTitleLine ) // title row is included in GetSize, so the following --rPos; // positions are calculated with the normal values @@ -1519,8 +1519,8 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS if ( nMeasure == SC_DPMEASURE_ALL ) { - // data layout dimension is (direct/indirect) child of this. - // data layout dimension must have name for all entries. + // data layout dimension is (direct/indirect) child of this. + // data layout dimension must have name for all entries. uno::Sequence<sheet::MemberResult>* pLayoutSeq = pSequences; if (!bRoot) @@ -1551,9 +1551,9 @@ void ScDPResultMember::FillDataResults( const ScDPResultMember* pRefMember, uno::Sequence< uno::Sequence<sheet::DataResult> >& rSequence, long& rRow, long nMeasure ) const { - // IsVisible() test is in ScDPResultDimension::FillDataResults - // (not on data layout dimension) - const ScDPLevel* pParentLevel = GetParentLevel(); + // IsVisible() test is in ScDPResultDimension::FillDataResults + // (not on data layout dimension) + const ScDPLevel* pParentLevel = GetParentLevel(); long nStartRow = rRow; long nExtraSpace = 0; @@ -1608,7 +1608,7 @@ void ScDPResultMember::FillDataResults( const ScDPResultMember* pRefMember, if ( pDataRoot ) { - ScDPSubTotalState aSubState; // initial state + ScDPSubTotalState aSubState; // initial state for (long nUserPos=nUserSubStart; nUserPos<nUserSubCount; nUserPos++) { @@ -1891,7 +1891,7 @@ long lcl_GetSubTotalPos( const ScDPSubTotalState& rSubState ) void ScDPDataMember::UpdateValues( const vector<ScDPValueData>& aValues, const ScDPSubTotalState& rSubState ) { - //! find out how many and which subtotals are used + //! find out how many and which subtotals are used ScDPAggData* pAgg = &aAggregate; @@ -1918,13 +1918,13 @@ void ScDPDataMember::ProcessData( const vector< SCROW >& aChildMembers, const ve { if ( pResultData->IsLateInit() && !pChildDimension && pResultMember && pResultMember->GetChildDimension() ) { - // if this DataMember doesn't have a child dimension because the ResultMember's - // child dimension wasn't there yet during this DataMembers's creation, - // create the child dimension now + // if this DataMember doesn't have a child dimension because the ResultMember's + // child dimension wasn't there yet during this DataMembers's creation, + // create the child dimension now InitFrom( pResultMember->GetChildDimension() ); } - ScDPSubTotalState aLocalSubState(rSubState); // keep row state, modify column + ScDPSubTotalState aLocalSubState(rSubState); // keep row state, modify column long nUserSubCount = pResultMember ? pResultMember->GetSubTotalCount() : 0; @@ -1946,7 +1946,7 @@ void ScDPDataMember::ProcessData( const vector< SCROW >& aChildMembers, const ve } if (pChildDimension) - pChildDimension->ProcessData( aChildMembers, aValues, rSubState ); // with unmodified subtotal state + pChildDimension->ProcessData( aChildMembers, aValues, rSubState ); // with unmodified subtotal state } BOOL ScDPDataMember::HasData( long nMeasure, const ScDPSubTotalState& rSubState ) const @@ -1955,11 +1955,11 @@ BOOL ScDPDataMember::HasData( long nMeasure, const ScDPSubTotalState& rSubState rSubState.eColForce != rSubState.eRowForce ) return FALSE; - // #74542# HasData can be different between measures! + // #74542# HasData can be different between measures! const ScDPAggData* pAgg = GetConstAggData( nMeasure, rSubState ); if (!pAgg) - return FALSE; //! error? + return FALSE; //! error? return pAgg->HasData(); } @@ -1977,7 +1977,7 @@ double ScDPDataMember::GetAggregate( long nMeasure, const ScDPSubTotalState& rSu { const ScDPAggData* pAgg = GetConstAggData( nMeasure, rSubState ); if (!pAgg) - return DBL_MAX; //! error? + return DBL_MAX; //! error? return pAgg->GetResult(); } @@ -2029,7 +2029,7 @@ void ScDPDataMember::FillDataRow( const ScDPResultMember* pRefMember, { DBG_ASSERT( pRefMember == pResultMember || !pResultMember, "bla" ); - if ( pRefMember->IsVisible() ) //! here or in ScDPDataDimension::FillDataRow ??? + if ( pRefMember->IsVisible() ) //! here or in ScDPDataDimension::FillDataRow ??? { long nStartCol = rCol; @@ -2048,8 +2048,8 @@ void ScDPDataMember::FillDataRow( const ScDPResultMember* pRefMember, BOOL bSubTotalInTitle = pRefMember->IsSubTotalInTitle( nMeasure ); - // leave space for children even if the DataMember hasn't been initialized - // (pDataChild is null then, this happens when no values for it are in this row) + // leave space for children even if the DataMember hasn't been initialized + // (pDataChild is null then, this happens when no values for it are in this row) BOOL bHasChild = ( pRefChild != NULL ); if ( bHasChild ) @@ -2077,7 +2077,7 @@ void ScDPDataMember::FillDataRow( const ScDPResultMember* pRefMember, nUserSubStart = 0; } - ScDPSubTotalState aLocalSubState(rSubState); // keep row state, modify column + ScDPSubTotalState aLocalSubState(rSubState); // keep row state, modify column long nMemberMeasure = nMeasure; long nSubSize = pResultData->GetCountForMeasure(nMeasure); @@ -2480,7 +2480,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, if ( bRefDimInCol ) { aRefItemPos.nBasePos = pColVisible[nColPos]; // without sort order applied - pSelectMember = ScDPResultDimension::GetColReferenceMember( pRefPos, pRefName, + pSelectMember = ScDPResultDimension::GetColReferenceMember( pRefPos, pRefName, nColPos, rRunning ); } else @@ -2609,7 +2609,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, if ( nRowTotal == 0.0 || nColTotal == 0.0 ) pAggData->SetError(); else - pAggData->SetResult( + pAggData->SetResult( ( pAggData->GetResult() * nGrandTotal ) / ( nRowTotal * nColTotal ) ); } @@ -2780,7 +2780,7 @@ ScDPResultMember *ScDPResultDimension::FindMember( SCROW iData ) const return NULL; } -void ScDPResultDimension::InitFrom( const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, +void ScDPResultDimension::InitFrom( const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, size_t nPos, ScDPInitState& rInitState, BOOL bInitChild /*= TRUE */ ) { if (nPos >= ppDim.size() || nPos >= ppLev.size()) @@ -2799,7 +2799,7 @@ void ScDPResultDimension::InitFrom( const vector<ScDPDimension*>& ppDim, const v } bIsDataLayout = pThisDim->getIsDataLayoutDimension(); // member - aDimensionName = pThisDim->getName(); // member + aDimensionName = pThisDim->getName(); // member // Check the autoshow setting. If it's enabled, store the settings. const sheet::DataPilotFieldAutoShowInfo& rAutoInfo = pThisLevel->GetAutoShow(); @@ -2856,7 +2856,7 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S return; #ifdef DBG_UTIL DBG_ASSERT( nPos <= pItemData.size(), ByteString::CreateFromInt32( pItemData.size()).GetBuffer() ); -#endif +#endif ScDPDimension* pThisDim = rParams.GetDim( nPos ); ScDPLevel* pThisLevel = rParams.GetLevel( nPos ); SCROW rThisData = pItemData[nPos]; @@ -2870,7 +2870,7 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S if ( !bInitialized ) { // init some values - // create all members at the first call (preserve order) + // create all members at the first call (preserve order) bIsDataLayout = pThisDim->getIsDataLayoutDimension(); aDimensionName = pThisDim->getName(); @@ -2905,14 +2905,14 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S #endif pMembers->SetHasHideDetailsMembers( FALSE ); } - + bool bNewAllMembers =(!rParams.IsRow()) || nPos == 0 || bLateInitAllMembers ; - + if (bNewAllMembers ) - { + { // global order is used to initialize aMembers, so it doesn't have to be looked at later if ( !bInitialized ) - { //init all members + { //init all members const ScMemberSortOrder& rGlobalOrder = pThisLevel->GetGlobalOrder(); ScDPGroupCompare aCompare( pResultData, rInitState, nDimSource ); @@ -2931,21 +2931,21 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S } bInitialized = TRUE; // don't call again, even if no members were included } - // initialize only specific member (or all if "show empty" flag is set) + // initialize only specific member (or all if "show empty" flag is set) if ( bLateInitAllMembers ) { long nCount = maMemberArray.size(); for (long i=0; i<nCount; i++) { ScDPResultMember* pResultMember = maMemberArray[i]; - - // check show empty + + // check show empty BOOL bAllChildren = FALSE; if( bShowEmpty ) { if ( pResultMember->IsNamedItem( rThisData ) ) bAllChildren = FALSE; - else + else bAllChildren = TRUE; } rParams.SetInitAllChildren( bAllChildren ); @@ -2961,14 +2961,14 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S { //DBG_TRACE( "ScDPResultDimension::LateInitFrom"); // DBG_TRACESTR( pResultMember->GetDPMember()->GetNameStr()); - + rInitState.AddMember( nDimSource, pResultMember->GetDataId() ); pResultMember->LateInitFrom( rParams, pItemData, nPos+1, rInitState ); rInitState.RemoveMember(); } } } - else + else InitWithMembers( rParams, pItemData, nPos, rInitState ); } @@ -2980,12 +2980,12 @@ long ScDPResultDimension::GetSize(long nMeasure) const { DBG_ASSERT(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, "DataLayout dimension twice?"); - // repeat first member... - nTotal = nMemberCount * maMemberArray[0]->GetSize(0); // all measures have equal size + // repeat first member... + nTotal = nMemberCount * maMemberArray[0]->GetSize(0); // all measures have equal size } else { - // add all members + // add all members for (long nMem=0; nMem<nMemberCount; nMem++) nTotal += maMemberArray[nMem]->GetSize(nMeasure); } @@ -3010,7 +3010,7 @@ bool ScDPResultDimension::IsValidEntry( const vector< SCROW >& aMembers ) const } void ScDPResultDimension::ProcessData( const vector< SCROW >& aMembers, - const ScDPResultDimension* pDataDim, + const ScDPResultDimension* pDataDim, const vector< SCROW >& aDataMembers, const vector<ScDPValueData>& aValues ) const { @@ -3044,7 +3044,7 @@ void ScDPResultDimension::FillMemberResults( uno::Sequence<sheet::MemberResult>* long nSorted = aMemberOrder.empty() ? i : aMemberOrder[i]; ScDPResultMember* pMember = maMemberArray[nSorted]; - // in data layout dimension, use first member with different measures/names + // in data layout dimension, use first member with different measures/names if ( bIsDataLayout ) { bool bTotalResult = false; @@ -3547,8 +3547,8 @@ void ScDPDataDimension::InitFrom( const ScDPResultDimension* pDim ) if ( !pResultData->IsLateInit() ) { - // with LateInit, pResMem hasn't necessarily been initialized yet, - // so InitFrom for the new result member is called from its ProcessData method + // with LateInit, pResMem hasn't necessarily been initialized yet, + // so InitFrom for the new result member is called from its ProcessData method const ScDPResultDimension* pChildDim = pResMem->GetChildDimension(); if ( pChildDim ) @@ -3611,7 +3611,7 @@ void ScDPDataDimension::FillDataRow( const ScDPResultDimension* pRefDim, } const ScDPResultMember* pRefMember = pRefDim->GetMember(nMemberPos); - if ( pRefMember->IsVisible() ) //! here or in ScDPDataMember::FillDataRow ??? + if ( pRefMember->IsVisible() ) //! here or in ScDPDataMember::FillDataRow ??? { const ScDPDataMember* pDataMember = aMembers[(USHORT)nMemberPos]; pDataMember->FillDataRow( pRefMember, rSequence, nMemberCol, nMemberMeasure, bIsSubTotalRow, rSubState ); @@ -3898,10 +3898,10 @@ void ScDPResultVisibilityData::fillFieldFilters(vector<ScDPCacheTable::Criterion continue; long nDimIndex = itrField->second; - aCri.mnFieldIndex = static_cast<sal_Int32>(nDimIndex); + aCri.mnFieldIndex = static_cast<sal_Int32>(nDimIndex); aCri.mpFilter.reset(new ScDPCacheTable::GroupFilter(/*mrSharedString*/)); - - ScDPCacheTable::GroupFilter* pGrpFilter = + + ScDPCacheTable::GroupFilter* pGrpFilter = static_cast<ScDPCacheTable::GroupFilter*>(aCri.mpFilter.get()); const VisibleMemberType& rMem = itr->second; @@ -3929,7 +3929,7 @@ size_t ScDPResultVisibilityData::MemberHash::operator() (const ScDPItemData& r) } // Wang Xu Ming -- 2009-6-10 // DataPilot Migration -SCROW ScDPResultMember::GetDataId( ) const +SCROW ScDPResultMember::GetDataId( ) const { const ScDPMember* pMemberDesc = GetDPMember(); if (pMemberDesc) @@ -3940,9 +3940,9 @@ SCROW ScDPResultMember::GetDataId( ) const ScDPResultMember* ScDPResultDimension::AddMember(const ScDPParentDimData &aData ) { ScDPResultMember* pMember = new ScDPResultMember( pResultData, aData, FALSE ); - SCROW nDataIndex = pMember->GetDataId(); + SCROW nDataIndex = pMember->GetDataId(); maMemberArray.push_back( pMember ); - + if ( maMemberHash.end() == maMemberHash.find( nDataIndex ) ) maMemberHash.insert( std::pair< SCROW, ScDPResultMember *>( nDataIndex, pMember ) ); return pMember; @@ -3953,7 +3953,7 @@ ResultMembers* ScDPResultDimension::GetResultMember( ScDPDimension* pThisDim, Sc ResultMembers* pResultMembers = new ResultMembers(); // global order is used to initialize aMembers, so it doesn't have to be looked at later const ScMemberSortOrder& rGlobalOrder = pThisLevel->GetGlobalOrder(); - + ScDPMembers* pMembers = pThisLevel->GetMembersObject(); long nMembCount = pMembers->getCount(); for ( long i=0; i<nMembCount; i++ ) @@ -3977,7 +3977,7 @@ ScDPResultMember* ScDPResultDimension::InsertMember(ScDPParentDimData *pMemberDa ScDPResultMember* pNew = new ScDPResultMember( pResultData, *pMemberData, FALSE ); maMemberArray.insert( maMemberArray.begin()+nInsert, pNew ); - SCROW nDataIndex = pMemberData->mpMemberDesc->GetItemDataId(); + SCROW nDataIndex = pMemberData->mpMemberDesc->GetItemDataId(); if ( maMemberHash.end() == maMemberHash.find( nDataIndex ) ) maMemberHash.insert( std::pair< SCROW, ScDPResultMember *>( nDataIndex, pNew ) ); return pNew; @@ -3985,8 +3985,8 @@ ScDPResultMember* ScDPResultDimension::InsertMember(ScDPParentDimData *pMemberDa return maMemberArray[ nInsert ]; } -void ScDPResultDimension:: InitWithMembers( LateInitParams& rParams, - const ::std::vector< SCROW >& pItemData, +void ScDPResultDimension:: InitWithMembers( LateInitParams& rParams, + const ::std::vector< SCROW >& pItemData, size_t nPos, ScDPInitState& rInitState ) { @@ -4000,14 +4000,14 @@ void ScDPResultDimension:: InitWithMembers( LateInitParams& rParams, { long nDimSource = pThisDim->GetDimension(); //! check GetSourceDim? - // create all members at the first call (preserve order) + // create all members at the first call (preserve order) ResultMembers* pMembers = pResultData->GetDimResultMembers(nDimSource, pThisDim, pThisLevel); ScDPGroupCompare aCompare( pResultData, rInitState, nDimSource ); - // initialize only specific member (or all if "show empty" flag is set) + // initialize only specific member (or all if "show empty" flag is set) ScDPResultMember* pResultMember = NULL; - if ( bInitialized ) + if ( bInitialized ) pResultMember = FindMember( nDataID ); - else + else bInitialized = TRUE; if ( pResultMember == NULL ) @@ -4082,7 +4082,7 @@ void ScDPResultDimension::CheckShowEmpty( BOOL bShow ) for (long i=0; i<nCount; i++) { pMember = maMemberArray.at(i); - pMember->CheckShowEmpty( bShow ); + pMember->CheckShowEmpty( bShow ); } } @@ -4104,6 +4104,6 @@ void ScDPResultMember::CheckShowEmpty( BOOL bShow ) ScDPResultDimension* pChildDim = GetChildDimension(); if (pChildDim ) pChildDim->CheckShowEmpty( TRUE ); - } + } } }// End Comments diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index da40e6e230c4..ed334e5a1b3f 100755 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -1,7 +1,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 @@ -55,7 +55,7 @@ #include "dptabdat.hxx" #include "global.hxx" #include "collect.hxx" -#include "datauno.hxx" // ScDataUnoConversion +#include "datauno.hxx" // ScDataUnoConversion #include "unoguard.hxx" #include "miscuno.hxx" #include "unonames.hxx" @@ -86,7 +86,7 @@ using ::rtl::OUString; // ----------------------------------------------------------------------- -#define SC_MINCOUNT_LIMIT 1000000 +#define SC_MINCOUNT_LIMIT 1000000 // ----------------------------------------------------------------------- @@ -103,11 +103,11 @@ SC_SIMPLE_SERVICE_INFO( ScDPMember, "ScDPMember", "com.sun.star.sheet. // ----------------------------------------------------------------------- // property maps for PropertySetInfo -// DataDescription / NumberFormat are internal +// DataDescription / NumberFormat are internal // ----------------------------------------------------------------------- -//! move to a header? +//! move to a header? BOOL lcl_GetBoolFromAny( const uno::Any& aAny ) { if ( aAny.getValueTypeClass() == uno::TypeClass_BOOLEAN ) @@ -129,7 +129,7 @@ ScDPSource::ScDPSource( ScDPTableData* pD ) : nRowDimCount( 0 ), nDataDimCount( 0 ), nPageDimCount( 0 ), - bColumnGrand( TRUE ), // default is true + bColumnGrand( TRUE ), // default is true bRowGrand( TRUE ), bIgnoreEmptyRows( FALSE ), bRepeatIfEmpty( FALSE ), @@ -148,9 +148,9 @@ ScDPSource::ScDPSource( ScDPTableData* pD ) : ScDPSource::~ScDPSource() { if (pDimensions) - pDimensions->release(); // ref-counted + pDimensions->release(); // ref-counted - //! free lists + //! free lists delete[] pColResults; delete[] pRowResults; @@ -234,12 +234,12 @@ BOOL lcl_TestSubTotal( BOOL& rAllowed, long nColumn, long* pArray, long nCount, for (long i=0; i<nCount; i++) if (pArray[i] == nColumn) { - // no subtotals for data layout dim, no matter where + // no subtotals for data layout dim, no matter where if ( pSource->IsDataLayoutDimension(nColumn) ) rAllowed = FALSE; else { - // no subtotals if no other dim but data layout follows + // no subtotals if no other dim but data layout follows long nNextIndex = i+1; if ( nNextIndex < nCount && pSource->IsDataLayoutDimension(pArray[nNextIndex]) ) ++nNextIndex; @@ -247,14 +247,14 @@ BOOL lcl_TestSubTotal( BOOL& rAllowed, long nColumn, long* pArray, long nCount, rAllowed = FALSE; } - return TRUE; // found + return TRUE; // found } return FALSE; } BOOL ScDPSource::SubTotalAllowed(long nColumn) { - //! cache this at ScDPResultData + //! cache this at ScDPResultData BOOL bAllowed = TRUE; if ( lcl_TestSubTotal( bAllowed, nColumn, nColDims, nColDimCount, this ) ) return bAllowed; @@ -277,7 +277,7 @@ void lcl_RemoveDim( long nRemove, long* pDims, long& rCount ) void ScDPSource::SetOrientation(long nColumn, USHORT nNew) { - //! change to no-op if new orientation is equal to old? + //! change to no-op if new orientation is equal to old? // remove from old list lcl_RemoveDim( nColumn, nColDims, nColDimCount ); @@ -305,7 +305,7 @@ void ScDPSource::SetOrientation(long nColumn, USHORT nNew) case sheet::DataPilotFieldOrientation_HIDDEN: break; // End Comments - default: + default: DBG_ERROR( "ScDPSource::SetOrientation: unexpected orientation" ); break; } @@ -326,7 +326,7 @@ BOOL ScDPSource::IsDateDimension(long nDim) return pData->IsDateDimension(nDim); } -UINT32 ScDPSource::GetNumberFormat(long nDim) +UINT32 ScDPSource::GetNumberFormat(long nDim) { return pData->GetNumberFormat( nDim ); } @@ -336,7 +336,7 @@ ScDPDimensions* ScDPSource::GetDimensionsObject() if (!pDimensions) { pDimensions = new ScDPDimensions(this); - pDimensions->acquire(); // ref-counted + pDimensions->acquire(); // ref-counted } return pDimensions; } @@ -355,7 +355,7 @@ ScDPDimension* ScDPSource::AddDuplicated(long /* nSource */, const String& rNewN { DBG_ASSERT( pDimensions, "AddDuplicated without dimensions?" ); - // re-use + // re-use long nOldDimCount = pDimensions->getCount(); for (long i=0; i<nOldDimCount; i++) @@ -363,20 +363,20 @@ ScDPDimension* ScDPSource::AddDuplicated(long /* nSource */, const String& rNewN ScDPDimension* pDim = pDimensions->getByIndex(i); if (pDim && String(pDim->getName()) == rNewName) { - //! test if pDim is a duplicate of source + //! test if pDim is a duplicate of source return pDim; } } SetDupCount( nDupCount + 1 ); - pDimensions->CountChanged(); // uses nDupCount + pDimensions->CountChanged(); // uses nDupCount return pDimensions->getByIndex( pDimensions->getCount() - 1 ); } long ScDPSource::GetSourceDim(long nDim) { - // original source dimension or data layout dimension? + // original source dimension or data layout dimension? if ( nDim <= pData->GetColumnCount() ) return nDim; @@ -398,26 +398,26 @@ long ScDPSource::GetSourceDim(long nDim) uno::Sequence< uno::Sequence<sheet::DataResult> > SAL_CALL ScDPSource::getResults() throw(uno::RuntimeException) { - CreateRes_Impl(); // create pColResRoot and pRowResRoot + CreateRes_Impl(); // create pColResRoot and pRowResRoot - if ( bResultOverflow ) // set in CreateRes_Impl + if ( bResultOverflow ) // set in CreateRes_Impl { - // no results available + // no results available throw uno::RuntimeException(); } long nColCount = pColResRoot->GetSize(pResData->GetColStartMeasure()); long nRowCount = pRowResRoot->GetSize(pResData->GetRowStartMeasure()); - // allocate full sequence - //! leave out empty rows??? + // allocate full sequence + //! leave out empty rows??? uno::Sequence< uno::Sequence<sheet::DataResult> > aSeq( nRowCount ); uno::Sequence<sheet::DataResult>* pRowAry = aSeq.getArray(); for (long nRow = 0; nRow < nRowCount; nRow++) { uno::Sequence<sheet::DataResult> aColSeq( nColCount ); - // use default values of DataResult + // use default values of DataResult pRowAry[nRow] = aColSeq; } @@ -435,13 +435,13 @@ void SAL_CALL ScDPSource::refresh() throw(uno::RuntimeException) void SAL_CALL ScDPSource::addRefreshListener( const uno::Reference<util::XRefreshListener >& ) throw(uno::RuntimeException) { - DBG_ERROR("not implemented"); //! exception? + DBG_ERROR("not implemented"); //! exception? } void SAL_CALL ScDPSource::removeRefreshListener( const uno::Reference<util::XRefreshListener >& ) throw(uno::RuntimeException) { - DBG_ERROR("not implemented"); //! exception? + DBG_ERROR("not implemented"); //! exception? } Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<sheet::DataPilotFieldFilter>& aFilters) @@ -500,7 +500,7 @@ Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<s String ScDPSource::getDataDescription() { - CreateRes_Impl(); // create pResData + CreateRes_Impl(); // create pResData String aRet; if ( pResData->GetMeasureCount() == 1 ) @@ -509,7 +509,7 @@ String ScDPSource::getDataDescription() aRet = pResData->GetMeasureString( 0, TRUE, SUBTOTAL_FUNC_NONE, bTotalResult ); } - // empty for more than one measure + // empty for more than one measure return aRet; } @@ -556,7 +556,7 @@ void ScDPSource::setRepeatIfEmpty(BOOL bSet) pData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty ); } -void ScDPSource::validate() //! ??? +void ScDPSource::validate() //! ??? { CreateRes_Impl(); } @@ -565,7 +565,7 @@ void ScDPSource::disposeData() { if ( pResData ) { - // reset all data... + // reset all data... DELETEZ(pColResRoot); DELETEZ(pRowResRoot); @@ -580,22 +580,22 @@ void ScDPSource::disposeData() if ( pDimensions ) { - pDimensions->release(); // ref-counted - pDimensions = NULL; // settings have to be applied (from SaveData) again! + pDimensions->release(); // ref-counted + pDimensions = NULL; // settings have to be applied (from SaveData) again! } SetDupCount( 0 ); - //! Test ???? + //! Test ???? nColDimCount = nRowDimCount = nDataDimCount = nPageDimCount = 0; - pData->DisposeData(); // cached entries etc. + pData->DisposeData(); // cached entries etc. bResultOverflow = FALSE; } long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLevel, long nLevels ) { - // Calculate the product of the member count for those consecutive levels that - // have the "show all" flag, one following level, and the data layout dimension. + // Calculate the product of the member count for those consecutive levels that + // have the "show all" flag, one following level, and the data layout dimension. long nTotal = 1; long nDataCount = 1; @@ -614,7 +614,7 @@ long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPL BOOL bDo = FALSE; if ( ppDim[nPos]->getIsDataLayoutDimension() ) { - // data layout dim doesn't interfere with "show all" flags + // data layout dim doesn't interfere with "show all" flags nDataCount = ppLevel[nPos]->GetMembersObject()->getCount(); if ( nDataCount == 0 ) nDataCount = 1; @@ -624,7 +624,7 @@ long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPL bDo = TRUE; if ( !ppLevel[nPos]->getShowEmpty() ) { - // this level is counted, following ones are not + // this level is counted, following ones are not bWasShowAll = FALSE; } } @@ -633,21 +633,21 @@ long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPL long nThisCount = ppLevel[nPos]->GetMembersObject()->getMinMembers(); if ( nThisCount == 0 ) { - nTotal = 1; // empty level -> start counting from here - //! start with visible elements in this level? + nTotal = 1; // empty level -> start counting from here + //! start with visible elements in this level? } else { if ( nTotal >= LONG_MAX / nThisCount ) - return LONG_MAX; // overflow + return LONG_MAX; // overflow nTotal *= nThisCount; } } } - // always include data layout dim, even after restarting + // always include data layout dim, even after restarting if ( nTotal >= LONG_MAX / nDataCount ) - return LONG_MAX; // overflow + return LONG_MAX; // overflow nTotal *= nDataCount; return nTotal; @@ -678,10 +678,10 @@ void ScDPSource::FillCalcInfo(bool bIsRow, ScDPTableData::CalcInfo& rInfo, bool ScDPLevels* pLevels = pDim->GetHierarchiesObject()->getByIndex(nHierarchy)->GetLevelsObject(); long nCount = pLevels->getCount(); - //! Test + //! Test if ( pDim->getIsDataLayoutDimension() && nDataDimCount < 2 ) nCount = 0; - //! Test + //! Test for (long j = 0; j < nCount; ++j) { @@ -689,7 +689,7 @@ void ScDPSource::FillCalcInfo(bool bIsRow, ScDPTableData::CalcInfo& rInfo, bool pLevel->EvaluateSortOrder(); // no layout flags for column fields, only for row fields - pLevel->SetEnableLayout( bIsRow ); + pLevel->SetEnableLayout( bIsRow ); if ( pLevel->GetAutoShow().IsEnabled ) rHasAutoShow = TRUE; @@ -756,7 +756,7 @@ void ScDPSource::FilterCacheTableByPageDimensions() ScDPCacheTable::Criterion aFilter; aFilter.mnFieldIndex = static_cast<sal_Int32>(nField); aFilter.mpFilter.reset(new ScDPCacheTable::GroupFilter(/*rSharedString*/)); - ScDPCacheTable::GroupFilter* pGrpFilter = + ScDPCacheTable::GroupFilter* pGrpFilter = static_cast<ScDPCacheTable::GroupFilter*>(aFilter.mpFilter.get()); for (long j = 0; j < nMemCount; ++j) { @@ -798,7 +798,7 @@ void ScDPSource::CreateRes_Impl() if ( nDataDimCount > 1 && ( nDataOrient != sheet::DataPilotFieldOrientation_COLUMN && nDataOrient != sheet::DataPilotFieldOrientation_ROW ) ) { - // if more than one data dimension, data layout orientation must be set + // if more than one data dimension, data layout orientation must be set SetOrientation( pData->GetColumnCount(), sheet::DataPilotFieldOrientation_ROW ); nDataOrient = sheet::DataPilotFieldOrientation_ROW; } @@ -819,8 +819,8 @@ void ScDPSource::CreateRes_Impl() ScDPTableData::CalcInfo aInfo; - // LateInit (initialize only those rows/children that are used) can be used unless - // any data dimension needs reference values from column/row dimensions + // LateInit (initialize only those rows/children that are used) can be used unless + // any data dimension needs reference values from column/row dimensions BOOL bLateInit = TRUE; // Go through all data dimensions (i.e. fields) and build their meta data @@ -835,7 +835,7 @@ void ScDPSource::CreateRes_Impl() sheet::GeneralFunction eUser = (sheet::GeneralFunction)pDim->getFunction(); if (eUser == sheet::GeneralFunction_AUTO) { - //! test for numeric data + //! test for numeric data eUser = sheet::GeneralFunction_SUM; } @@ -844,7 +844,7 @@ void ScDPSource::CreateRes_Impl() // Get reference field/item information. pDataRefValues[i] = pDim->GetReferenceValue(); - nDataRefOrient[i] = sheet::DataPilotFieldOrientation_HIDDEN; // default if not used + nDataRefOrient[i] = sheet::DataPilotFieldOrientation_HIDDEN; // default if not used sal_Int32 eRefType = pDataRefValues[i].ReferenceType; if ( eRefType == sheet::DataPilotFieldReferenceType::ITEM_DIFFERENCE || eRefType == sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE || @@ -856,24 +856,24 @@ void ScDPSource::CreateRes_Impl() if ( nColumn >= 0 ) { nDataRefOrient[i] = GetOrientation( nColumn ); - // need fully initialized results to find reference values - // (both in column or row dimensions), so updated values or - // differences to 0 can be displayed even for empty results. + // need fully initialized results to find reference values + // (both in column or row dimensions), so updated values or + // differences to 0 can be displayed even for empty results. bLateInit = FALSE; } } - pDataNames[i] = String( pDim->getName() ); //! label? + pDataNames[i] = String( pDim->getName() ); //! label? - // asterisk is added to duplicated dimension names by ScDPSaveData::WriteToSource - //! modify user visible strings as in ScDPResultData::GetMeasureString instead! + // asterisk is added to duplicated dimension names by ScDPSaveData::WriteToSource + //! modify user visible strings as in ScDPResultData::GetMeasureString instead! pDataNames[i].EraseTrailingChars('*'); - //! if the name is overridden by user, a flag must be set - //! so the user defined name replaces the function string and field name. + //! if the name is overridden by user, a flag must be set + //! so the user defined name replaces the function string and field name. - //! the complete name (function and field) must be stored at the dimension + //! the complete name (function and field) must be stored at the dimension long nSource = ((ScDPDimension*)pDim)->GetSourceDim(); if (nSource >= 0) @@ -940,16 +940,16 @@ void ScDPSource::CreateRes_Impl() pLevels->getByIndex(j)->GetMembersObject(); // initialize for groups } - // pre-check: calculate minimum number of result columns / rows from - // levels that have the "show all" flag set + // pre-check: calculate minimum number of result columns / rows from + // levels that have the "show all" flag set long nMinColMembers = lcl_CountMinMembers( aInfo.aColDims, aInfo.aColLevels, nColLevelCount ); long nMinRowMembers = lcl_CountMinMembers( aInfo.aRowDims, aInfo.aRowLevels, nRowLevelCount ); if ( nMinColMembers > MAXCOLCOUNT/*SC_MINCOUNT_LIMIT*/ || nMinRowMembers > SC_MINCOUNT_LIMIT ) { - // resulting table is too big -> abort before calculating - // (this relies on late init, so no members are allocated in InitFrom above) + // resulting table is too big -> abort before calculating + // (this relies on late init, so no members are allocated in InitFrom above) bResultOverflow = TRUE; } @@ -1013,9 +1013,9 @@ void ScDPSource::CreateRes_Impl() //UNUSED2009-05 void ScDPSource::DumpState( ScDocument* pDoc, const ScAddress& rPos ) //UNUSED2009-05 { //UNUSED2009-05 CreateRes_Impl(); -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 ScAddress aDocPos( rPos ); -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 if (pColResRoot->GetChildDimension()) //UNUSED2009-05 pColResRoot->GetChildDimension()->DumpState( NULL, pDoc, aDocPos ); //UNUSED2009-05 pRowResRoot->DumpState( pColResRoot, pDoc, aDocPos ); @@ -1082,10 +1082,10 @@ void ScDPSource::FillMemberResults() { CreateRes_Impl(); - if ( bResultOverflow ) // set in CreateRes_Impl + if ( bResultOverflow ) // set in CreateRes_Impl { - // no results available -> abort (leave empty) - // exception is thrown in ScDPSource::getResults + // no results available -> abort (leave empty) + // exception is thrown in ScDPSource::getResults return; } @@ -1155,11 +1155,11 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPSource::getPropertySetInfo( static SfxItemPropertyMapEntry aDPSourceMap_Impl[] = { - {MAP_CHAR_LEN(SC_UNO_COLGRAND), 0, &getBooleanCppuType(), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_DATADESC), 0, &getCppuType((rtl::OUString*)0), beans::PropertyAttribute::READONLY, 0 }, - {MAP_CHAR_LEN(SC_UNO_IGNOREEM), 0, &getBooleanCppuType(), 0, 0 }, // for sheet data only - {MAP_CHAR_LEN(SC_UNO_REPEATIF), 0, &getBooleanCppuType(), 0, 0 }, // for sheet data only - {MAP_CHAR_LEN(SC_UNO_ROWGRAND), 0, &getBooleanCppuType(), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_COLGRAND), 0, &getBooleanCppuType(), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_DATADESC), 0, &getCppuType((rtl::OUString*)0), beans::PropertyAttribute::READONLY, 0 }, + {MAP_CHAR_LEN(SC_UNO_IGNOREEM), 0, &getBooleanCppuType(), 0, 0 }, // for sheet data only + {MAP_CHAR_LEN(SC_UNO_REPEATIF), 0, &getBooleanCppuType(), 0, 0 }, // for sheet data only + {MAP_CHAR_LEN(SC_UNO_ROWGRAND), 0, &getBooleanCppuType(), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_ROWFIELDCOUNT), 0, &getCppuType(static_cast<sal_Int32*>(0)), READONLY, 0 }, {MAP_CHAR_LEN(SC_UNO_COLUMNFIELDCOUNT), 0, &getCppuType(static_cast<sal_Int32*>(0)), READONLY, 0 }, {MAP_CHAR_LEN(SC_UNO_DATAFIELDCOUNT), 0, &getCppuType(static_cast<sal_Int32*>(0)), READONLY, 0 }, @@ -1194,7 +1194,7 @@ void SAL_CALL ScDPSource::setPropertyValue( const rtl::OUString& aPropertyName, else { DBG_ERROR("unknown property"); - //! THROW( UnknownPropertyException() ); + //! THROW( UnknownPropertyException() ); } } @@ -1212,7 +1212,7 @@ uno::Any SAL_CALL ScDPSource::getPropertyValue( const rtl::OUString& aPropertyNa lcl_SetBoolInAny( aRet, getIgnoreEmptyRows() ); else if ( aNameStr.EqualsAscii( SC_UNO_REPEATIF ) ) lcl_SetBoolInAny( aRet, getRepeatIfEmpty() ); - else if ( aNameStr.EqualsAscii( SC_UNO_DATADESC ) ) // read-only + else if ( aNameStr.EqualsAscii( SC_UNO_DATADESC ) ) // read-only aRet <<= rtl::OUString( getDataDescription() ); else if ( aNameStr.EqualsAscii( SC_UNO_ROWFIELDCOUNT ) ) // read-only aRet <<= static_cast<sal_Int32>(nRowDimCount); @@ -1228,7 +1228,7 @@ uno::Any SAL_CALL ScDPSource::getPropertyValue( const rtl::OUString& aPropertyNa else { DBG_ERROR("unknown property"); - //! THROW( UnknownPropertyException() ); + //! THROW( UnknownPropertyException() ); } return aRet; } @@ -1241,7 +1241,7 @@ ScDPDimensions::ScDPDimensions( ScDPSource* pSrc ) : pSource( pSrc ), ppDims( NULL ) { - //! hold pSource + //! hold pSource // include data layout dimension and duplicated dimensions nDimCount = pSource->GetData()->GetColumnCount() + 1 + pSource->GetDupCount(); @@ -1249,13 +1249,13 @@ ScDPDimensions::ScDPDimensions( ScDPSource* pSrc ) : ScDPDimensions::~ScDPDimensions() { - //! release pSource + //! release pSource if (ppDims) { for (long i=0; i<nDimCount; i++) if ( ppDims[i] ) - ppDims[i]->release(); // ref-counted + ppDims[i]->release(); // ref-counted delete[] ppDims; } } @@ -1270,13 +1270,13 @@ void ScDPDimensions::CountChanged() long nCopy = Min( nNewCount, nDimCount ); ScDPDimension** ppNew = new ScDPDimension*[nNewCount]; - for (i=0; i<nCopy; i++) // copy existing dims + for (i=0; i<nCopy; i++) // copy existing dims ppNew[i] = ppDims[i]; - for (i=nCopy; i<nNewCount; i++) // clear additional pointers + for (i=nCopy; i<nNewCount; i++) // clear additional pointers ppNew[i] = NULL; - for (i=nCopy; i<nDimCount; i++) // delete old dims if count is decreased + for (i=nCopy; i<nDimCount; i++) // delete old dims if count is decreased if ( ppDims[i] ) - ppDims[i]->release(); // ref-counted + ppDims[i]->release(); // ref-counted delete[] ppDims; ppDims = ppNew; @@ -1337,7 +1337,7 @@ sal_Bool SAL_CALL ScDPDimensions::hasElements() throw(uno::RuntimeException) long ScDPDimensions::getCount() const { - // in tabular data, every column of source data is a dimension + // in tabular data, every column of source data is a dimension return nDimCount; } @@ -1355,13 +1355,13 @@ ScDPDimension* ScDPDimensions::getByIndex(long nIndex) const if ( !ppDims[nIndex] ) { ppDims[nIndex] = new ScDPDimension( pSource, nIndex ); - ppDims[nIndex]->acquire(); // ref-counted + ppDims[nIndex]->acquire(); // ref-counted } return ppDims[nIndex]; } - return NULL; //! exception? + return NULL; //! exception? } // ----------------------------------------------------------------------- @@ -1371,7 +1371,7 @@ ScDPDimension::ScDPDimension( ScDPSource* pSrc, long nD ) : nDim( nD ), pHierarchies( NULL ), nUsedHier( 0 ), - nFunction( SUBTOTAL_FUNC_SUM ), // sum is default + nFunction( SUBTOTAL_FUNC_SUM ), // sum is default mpLayoutName(NULL), mpSubtotalName(NULL), nSourceDim( -1 ), @@ -1379,15 +1379,15 @@ ScDPDimension::ScDPDimension( ScDPSource* pSrc, long nD ) : pSelectedData( NULL ), mbHasHiddenMember(false) { - //! hold pSource + //! hold pSource } ScDPDimension::~ScDPDimension() { - //! release pSource + //! release pSource if ( pHierarchies ) - pHierarchies->release(); // ref-counted + pHierarchies->release(); // ref-counted delete pSelectedData; } @@ -1397,7 +1397,7 @@ ScDPHierarchies* ScDPDimension::GetHierarchiesObject() if (!pHierarchies) { pHierarchies = new ScDPHierarchies( pSource, nDim ); - pHierarchies->acquire(); // ref-counted + pHierarchies->acquire(); // ref-counted } return pHierarchies; } @@ -1428,7 +1428,7 @@ uno::Reference<container::XNameAccess> SAL_CALL ScDPDimension::getHierarchies() void SAL_CALL ScDPDimension::setName( const ::rtl::OUString& rNewName ) throw(uno::RuntimeException) { - // used after cloning + // used after cloning aName = String( rNewName ); } @@ -1449,7 +1449,7 @@ long ScDPDimension::getPosition() const void ScDPDimension::setPosition(long /* nNew */) { - //! ... + //! ... } BOOL ScDPDimension::getIsDataLayoutDimension() const @@ -1482,13 +1482,13 @@ ScDPDimension* ScDPDimension::CreateCloneObject() { DBG_ASSERT( nSourceDim < 0, "recursive duplicate - not implemented" ); - //! set new name here, or temporary name ??? + //! set new name here, or temporary name ??? String aNewName = aName; ScDPDimension* pNew = pSource->AddDuplicated( nDim, aNewName ); - pNew->aName = aNewName; //! here or in source? - pNew->nSourceDim = nDim; //! recursive? + pNew->aName = aNewName; //! here or in source? + pNew->nSourceDim = nDim; //! recursive? return pNew; } @@ -1514,7 +1514,7 @@ const ScDPItemData& ScDPDimension::GetSelectedData() { // find the named member to initialize pSelectedData from it, with name and value - long nLevel = 0; // same as in ScDPObject::FillPageList + long nLevel = 0; // same as in ScDPObject::FillPageList long nHierarchy = getUsedHierarchy(); if ( nHierarchy >= GetHierarchiesObject()->getCount() ) @@ -1539,7 +1539,7 @@ const ScDPItemData& ScDPDimension::GetSelectedData() } if ( !pSelectedData ) - pSelectedData = new ScDPItemData( aSelectedPage, 0.0, FALSE ); // default - name only + pSelectedData = new ScDPItemData( aSelectedPage, 0.0, FALSE ); // default - name only } return *pSelectedData; @@ -1549,7 +1549,7 @@ const ScDPItemData& ScDPDimension::GetSelectedData() //UNUSED2009-05 { //UNUSED2009-05 if ( bHasSelectedPage ) //UNUSED2009-05 return rData.IsCaseInsEqual( GetSelectedData() ); -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 return TRUE; // no selection -> all data //UNUSED2009-05 } @@ -1575,15 +1575,15 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPDimension::getPropertySetIn static SfxItemPropertyMapEntry aDPDimensionMap_Impl[] = { - {MAP_CHAR_LEN(SC_UNO_FILTER), 0, &getCppuType((uno::Sequence<sheet::TableFilterField>*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_FUNCTION), 0, &getCppuType((sheet::GeneralFunction*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_ISDATALA), 0, &getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0 }, - {MAP_CHAR_LEN(SC_UNO_NUMBERFO), 0, &getCppuType((sal_Int32*)0), beans::PropertyAttribute::READONLY, 0 }, - {MAP_CHAR_LEN(SC_UNO_ORIENTAT), 0, &getCppuType((sheet::DataPilotFieldOrientation*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_ORIGINAL), 0, &getCppuType((uno::Reference<container::XNamed>*)0), beans::PropertyAttribute::READONLY, 0 }, - {MAP_CHAR_LEN(SC_UNO_POSITION), 0, &getCppuType((sal_Int32*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_REFVALUE), 0, &getCppuType((sheet::DataPilotFieldReference*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_USEDHIER), 0, &getCppuType((sal_Int32*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_FILTER), 0, &getCppuType((uno::Sequence<sheet::TableFilterField>*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_FUNCTION), 0, &getCppuType((sheet::GeneralFunction*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_ISDATALA), 0, &getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0 }, + {MAP_CHAR_LEN(SC_UNO_NUMBERFO), 0, &getCppuType((sal_Int32*)0), beans::PropertyAttribute::READONLY, 0 }, + {MAP_CHAR_LEN(SC_UNO_ORIENTAT), 0, &getCppuType((sheet::DataPilotFieldOrientation*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_ORIGINAL), 0, &getCppuType((uno::Reference<container::XNamed>*)0), beans::PropertyAttribute::READONLY, 0 }, + {MAP_CHAR_LEN(SC_UNO_POSITION), 0, &getCppuType((sal_Int32*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_REFVALUE), 0, &getCppuType((sheet::DataPilotFieldReference*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_USEDHIER), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_LAYOUTNAME), 0, &getCppuType(static_cast<rtl::OUString*>(0)), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_FIELD_SUBTOTALNAME), 0, &getCppuType(static_cast<rtl::OUString*>(0)), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_HAS_HIDDEN_MEMBER), 0, &getBooleanCppuType(), 0, 0 }, @@ -1655,7 +1655,7 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam DBG_ERROR("Filter property is not a single string"); throw lang::IllegalArgumentException(); } - DELETEZ( pSelectedData ); // invalid after changing aSelectedPage + DELETEZ( pSelectedData ); // invalid after changing aSelectedPage } else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) { @@ -1674,7 +1674,7 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam else { DBG_ERROR("unknown property"); - //! THROW( UnknownPropertyException() ); + //! THROW( UnknownPropertyException() ); } } @@ -1700,7 +1700,7 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert } else if ( aNameStr.EqualsAscii( SC_UNO_REFVALUE ) ) aRet <<= aReferenceValue; - else if ( aNameStr.EqualsAscii( SC_UNO_ISDATALA ) ) // read-only properties + else if ( aNameStr.EqualsAscii( SC_UNO_ISDATALA ) ) // read-only properties lcl_SetBoolInAny( aRet, getIsDataLayoutDimension() ); else if ( aNameStr.EqualsAscii( SC_UNO_NUMBERFO ) ) { @@ -1756,7 +1756,7 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert else { DBG_ERROR("unknown property"); - //! THROW( UnknownPropertyException() ); + //! THROW( UnknownPropertyException() ); } return aRet; } @@ -1770,10 +1770,10 @@ ScDPHierarchies::ScDPHierarchies( ScDPSource* pSrc, long nD ) : nDim( nD ), ppHiers( NULL ) { - //! hold pSource + //! hold pSource #if 0 - // date columns have 3 hierarchies (flat/quarter/week), other columns only one + // date columns have 3 hierarchies (flat/quarter/week), other columns only one long nSrcDim = pSource->GetSourceDim( nDim ); if ( pSource->IsDateDimension( nSrcDim ) ) nHierCount = SC_DAPI_DATE_HIERARCHIES; @@ -1787,13 +1787,13 @@ ScDPHierarchies::ScDPHierarchies( ScDPSource* pSrc, long nD ) : ScDPHierarchies::~ScDPHierarchies() { - //! release pSource + //! release pSource if (ppHiers) { for (long i=0; i<nHierCount; i++) if ( ppHiers[i] ) - ppHiers[i]->release(); // ref-counted + ppHiers[i]->release(); // ref-counted delete[] ppHiers; } } @@ -1856,8 +1856,8 @@ long ScDPHierarchies::getCount() const ScDPHierarchy* ScDPHierarchies::getByIndex(long nIndex) const { - // pass hierarchy index to new object in case the implementation - // will be extended to more than one hierarchy + // pass hierarchy index to new object in case the implementation + // will be extended to more than one hierarchy if ( nIndex >= 0 && nIndex < nHierCount ) { @@ -1870,13 +1870,13 @@ ScDPHierarchy* ScDPHierarchies::getByIndex(long nIndex) const if ( !ppHiers[nIndex] ) { ppHiers[nIndex] = new ScDPHierarchy( pSource, nDim, nIndex ); - ppHiers[nIndex]->acquire(); // ref-counted + ppHiers[nIndex]->acquire(); // ref-counted } return ppHiers[nIndex]; } - return NULL; //! exception? + return NULL; //! exception? } // ----------------------------------------------------------------------- @@ -1887,15 +1887,15 @@ ScDPHierarchy::ScDPHierarchy( ScDPSource* pSrc, long nD, long nH ) : nHier( nH ), pLevels( NULL ) { - //! hold pSource + //! hold pSource } ScDPHierarchy::~ScDPHierarchy() { - //! release pSource + //! release pSource if (pLevels) - pLevels->release(); // ref-counted + pLevels->release(); // ref-counted } ScDPLevels* ScDPHierarchy::GetLevelsObject() @@ -1903,7 +1903,7 @@ ScDPLevels* ScDPHierarchy::GetLevelsObject() if (!pLevels) { pLevels = new ScDPLevels( pSource, nDim, nHier ); - pLevels->acquire(); // ref-counted + pLevels->acquire(); // ref-counted } return pLevels; } @@ -1916,18 +1916,18 @@ uno::Reference<container::XNameAccess> SAL_CALL ScDPHierarchy::getLevels() ::rtl::OUString SAL_CALL ScDPHierarchy::getName() throw(uno::RuntimeException) { - String aRet; //! globstr-ID !!!! + String aRet; //! globstr-ID !!!! switch (nHier) { case SC_DAPI_HIERARCHY_FLAT: aRet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("flat")); - break; //! name ??????? + break; //! name ??????? case SC_DAPI_HIERARCHY_QUARTER: aRet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Quarter")); - break; //! name ??????? + break; //! name ??????? case SC_DAPI_HIERARCHY_WEEK: aRet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Week")); - break; //! name ??????? + break; //! name ??????? default: DBG_ERROR( "ScDPHierarchy::getName: unexpected hierarchy" ); break; @@ -1937,7 +1937,7 @@ uno::Reference<container::XNameAccess> SAL_CALL ScDPHierarchy::getLevels() void SAL_CALL ScDPHierarchy::setName( const ::rtl::OUString& /* rNewName */ ) throw(uno::RuntimeException) { - DBG_ERROR("not implemented"); //! exception? + DBG_ERROR("not implemented"); //! exception? } // ----------------------------------------------------------------------- @@ -1948,18 +1948,18 @@ ScDPLevels::ScDPLevels( ScDPSource* pSrc, long nD, long nH ) : nHier( nH ), ppLevs( NULL ) { - //! hold pSource + //! hold pSource - // text columns have only one level + // text columns have only one level long nSrcDim = pSource->GetSourceDim( nDim ); if ( pSource->IsDateDimension( nSrcDim ) ) { switch ( nHier ) { - case SC_DAPI_HIERARCHY_FLAT: nLevCount = SC_DAPI_FLAT_LEVELS; break; - case SC_DAPI_HIERARCHY_QUARTER: nLevCount = SC_DAPI_QUARTER_LEVELS; break; - case SC_DAPI_HIERARCHY_WEEK: nLevCount = SC_DAPI_WEEK_LEVELS; break; + case SC_DAPI_HIERARCHY_FLAT: nLevCount = SC_DAPI_FLAT_LEVELS; break; + case SC_DAPI_HIERARCHY_QUARTER: nLevCount = SC_DAPI_QUARTER_LEVELS; break; + case SC_DAPI_HIERARCHY_WEEK: nLevCount = SC_DAPI_WEEK_LEVELS; break; default: DBG_ERROR("wrong hierarchy"); nLevCount = 0; @@ -1971,13 +1971,13 @@ ScDPLevels::ScDPLevels( ScDPSource* pSrc, long nD, long nH ) : ScDPLevels::~ScDPLevels() { - //! release pSource + //! release pSource if (ppLevs) { for (long i=0; i<nLevCount; i++) if ( ppLevs[i] ) - ppLevs[i]->release(); // ref-counted + ppLevs[i]->release(); // ref-counted delete[] ppLevs; } } @@ -2051,13 +2051,13 @@ ScDPLevel* ScDPLevels::getByIndex(long nIndex) const if ( !ppLevs[nIndex] ) { ppLevs[nIndex] = new ScDPLevel( pSource, nDim, nHier, nIndex ); - ppLevs[nIndex]->acquire(); // ref-counted + ppLevs[nIndex]->acquire(); // ref-counted } return ppLevs[nIndex]; } - return NULL; //! exception? + return NULL; //! exception? } // ----------------------------------------------------------------------- @@ -2105,16 +2105,16 @@ ScDPLevel::ScDPLevel( ScDPSource* pSrc, long nD, long nH, long nL ) : nAutoMeasure( 0 ), bEnableLayout( FALSE ) { - //! hold pSource - // aSubTotals is empty + //! hold pSource + // aSubTotals is empty } ScDPLevel::~ScDPLevel() { - //! release pSource + //! release pSource if ( pMembers ) - pMembers->release(); // ref-counted + pMembers->release(); // ref-counted } void ScDPLevel::EvaluateSortOrder() @@ -2187,7 +2187,7 @@ ScDPMembers* ScDPLevel::GetMembersObject() if (!pMembers) { pMembers = new ScDPMembers( pSource, nDim, nHier, nLev ); - pMembers->acquire(); // ref-counted + pMembers->acquire(); // ref-counted } return pMembers; } @@ -2203,7 +2203,7 @@ uno::Sequence<sheet::MemberResult> SAL_CALL ScDPLevel::getResults() throw(uno::R if (pRes) return *pRes; - return uno::Sequence<sheet::MemberResult>(0); //! Error? + return uno::Sequence<sheet::MemberResult>(0); //! Error? } ::rtl::OUString SAL_CALL ScDPLevel::getName() throw(uno::RuntimeException) @@ -2211,7 +2211,7 @@ uno::Sequence<sheet::MemberResult> SAL_CALL ScDPLevel::getResults() throw(uno::R long nSrcDim = pSource->GetSourceDim( nDim ); if ( pSource->IsDateDimension( nSrcDim ) ) { - String aRet; //! globstr-ID !!!! + String aRet; //! globstr-ID !!!! if ( nHier == SC_DAPI_HIERARCHY_QUARTER ) { @@ -2265,12 +2265,12 @@ uno::Sequence<sheet::MemberResult> SAL_CALL ScDPLevel::getResults() throw(uno::R void SAL_CALL ScDPLevel::setName( const ::rtl::OUString& /* rNewName */ ) throw(uno::RuntimeException) { - DBG_ERROR("not implemented"); //! exception? + DBG_ERROR("not implemented"); //! exception? } uno::Sequence<sheet::GeneralFunction> ScDPLevel::getSubTotals() const { - //! separate functions for settings and evaluation? + //! separate functions for settings and evaluation? long nSrcDim = pSource->GetSourceDim( nDim ); if ( !pSource->SubTotalAllowed( nSrcDim ) ) @@ -2282,7 +2282,7 @@ uno::Sequence<sheet::GeneralFunction> ScDPLevel::getSubTotals() const void ScDPLevel::setSubTotals(const uno::Sequence<sheet::GeneralFunction>& rNew) { aSubTotals = rNew; - //! set "manual change" flag? + //! set "manual change" flag? } BOOL ScDPLevel::getShowEmpty() const @@ -2305,11 +2305,11 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPLevel::getPropertySetInfo() static SfxItemPropertyMapEntry aDPLevelMap_Impl[] = { //! change type of AutoShow/Layout/Sorting to API struct when available - {MAP_CHAR_LEN(SC_UNO_AUTOSHOW), 0, &getCppuType((sheet::DataPilotFieldAutoShowInfo*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_LAYOUT), 0, &getCppuType((sheet::DataPilotFieldLayoutInfo*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_SHOWEMPT), 0, &getBooleanCppuType(), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_SORTING), 0, &getCppuType((sheet::DataPilotFieldSortInfo*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_SUBTOTAL), 0, &getCppuType((uno::Sequence<sheet::GeneralFunction>*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_AUTOSHOW), 0, &getCppuType((sheet::DataPilotFieldAutoShowInfo*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_LAYOUT), 0, &getCppuType((sheet::DataPilotFieldLayoutInfo*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_SHOWEMPT), 0, &getBooleanCppuType(), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_SORTING), 0, &getCppuType((sheet::DataPilotFieldSortInfo*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_SUBTOTAL), 0, &getCppuType((uno::Sequence<sheet::GeneralFunction>*)0), 0, 0 }, {0,0,0,0,0,0} }; static uno::Reference<beans::XPropertySetInfo> aRef = @@ -2340,7 +2340,7 @@ void SAL_CALL ScDPLevel::setPropertyValue( const rtl::OUString& aPropertyName, c else { DBG_ERROR("unknown property"); - //! THROW( UnknownPropertyException() ); + //! THROW( UnknownPropertyException() ); } } @@ -2354,7 +2354,7 @@ uno::Any SAL_CALL ScDPLevel::getPropertyValue( const rtl::OUString& aPropertyNam lcl_SetBoolInAny( aRet, getShowEmpty() ); else if ( aNameStr.EqualsAscii( SC_UNO_SUBTOTAL ) ) { - uno::Sequence<sheet::GeneralFunction> aSeq = getSubTotals(); //! avoid extra copy? + uno::Sequence<sheet::GeneralFunction> aSeq = getSubTotals(); //! avoid extra copy? aRet <<= aSeq; } else if ( aNameStr.EqualsAscii( SC_UNO_SORTING ) ) @@ -2380,7 +2380,7 @@ uno::Any SAL_CALL ScDPLevel::getPropertyValue( const rtl::OUString& aPropertyNam else { DBG_ERROR("unknown property"); - //! THROW( UnknownPropertyException() ); + //! THROW( UnknownPropertyException() ); } return aRet; } @@ -2396,7 +2396,7 @@ ScDPMembers::ScDPMembers( ScDPSource* pSrc, long nD, long nH, long nL ) : nLev( nL ), ppMbrs( NULL ) { - //! hold pSource + //! hold pSource long nSrcDim = pSource->GetSourceDim( nDim ); if ( pSource->IsDataLayoutDimension(nSrcDim) ) @@ -2438,12 +2438,12 @@ ScDPMembers::ScDPMembers( ScDPSource* pSrc, long nD, long nH, long nL ) : nMbrCount = nLastYear + 1 - nFirstYear; } else - nMbrCount = 0; // no values + nMbrCount = 0; // no values } break; - case SC_DAPI_LEVEL_QUARTER: nMbrCount = 4; break; - case SC_DAPI_LEVEL_MONTH: nMbrCount = 12; break; - case SC_DAPI_LEVEL_DAY: nMbrCount = 31; break; + case SC_DAPI_LEVEL_QUARTER: nMbrCount = 4; break; + case SC_DAPI_LEVEL_MONTH: nMbrCount = 12; break; + case SC_DAPI_LEVEL_DAY: nMbrCount = 31; break; default: DBG_ERROR( "ScDPMembers::ScDPMembers: unexpected level" ); break; @@ -2453,9 +2453,9 @@ ScDPMembers::ScDPMembers( ScDPSource* pSrc, long nD, long nH, long nL ) : { switch (nLev) { - case SC_DAPI_LEVEL_YEAR: nMbrCount = 1; break; //! get years from source - case SC_DAPI_LEVEL_WEEK: nMbrCount = 53; break; - case SC_DAPI_LEVEL_WEEKDAY: nMbrCount = 7; break; + case SC_DAPI_LEVEL_YEAR: nMbrCount = 1; break; //! get years from source + case SC_DAPI_LEVEL_WEEK: nMbrCount = 53; break; + case SC_DAPI_LEVEL_WEEKDAY: nMbrCount = 7; break; default: DBG_ERROR( "ScDPMembers::ScDPMembers: unexpected level" ); break; @@ -2468,13 +2468,13 @@ ScDPMembers::ScDPMembers( ScDPSource* pSrc, long nD, long nH, long nL ) : ScDPMembers::~ScDPMembers() { - //! release pSource + //! release pSource if (ppMbrs) { for (long i=0; i<nMbrCount; i++) if ( ppMbrs[i] ) - ppMbrs[i]->release(); // ref-counted + ppMbrs[i]->release(); // ref-counted delete[] ppMbrs; } } @@ -2567,22 +2567,22 @@ long ScDPMembers::getMinMembers() const { for (long i=0; i<nMbrCount; i++) { - // count only visible with details (default is true for both) + // count only visible with details (default is true for both) const ScDPMember* pMbr = ppMbrs[i]; if ( !pMbr || ( pMbr->getIsVisible() && pMbr->getShowDetails() ) ) ++nVisCount; } } else - nVisCount = nMbrCount; // default for all + nVisCount = nMbrCount; // default for all return nVisCount; } ScDPMember* ScDPMembers::getByIndex(long nIndex) const { - // result of GetColumnEntries must not change between ScDPMembers ctor - // and all calls to getByIndex + // result of GetColumnEntries must not change between ScDPMembers ctor + // and all calls to getByIndex if ( nIndex >= 0 && nIndex < nMbrCount ) { @@ -2606,10 +2606,10 @@ ScDPMember* ScDPMembers::getByIndex(long nIndex) const long nVal = 0; String aName; - if ( nLev == SC_DAPI_LEVEL_YEAR ) // YEAR is in both hierarchies + if ( nLev == SC_DAPI_LEVEL_YEAR ) // YEAR is in both hierarchies { - //! cache year range here! - + //! cache year range here! + // Wang Xu Ming - DataPilot migration double fFirstVal = pSource->GetData()->GetMemberByIndex( nSrcDim, 0 )->GetValue(); long nFirstYear = pSource->GetData()->GetDatePart( @@ -2621,24 +2621,24 @@ ScDPMember* ScDPMembers::getByIndex(long nIndex) const } else if ( nHier == SC_DAPI_HIERARCHY_WEEK && nLev == SC_DAPI_LEVEL_WEEKDAY ) { - nVal = nIndex; // DayOfWeek is 0-based + nVal = nIndex; // DayOfWeek is 0-based aName = ScGlobal::GetCalendar()->getDisplayName( ::com::sun::star::i18n::CalendarDisplayIndex::DAY, sal::static_int_cast<sal_Int16>(nVal), 0 ); } else if ( nHier == SC_DAPI_HIERARCHY_QUARTER && nLev == SC_DAPI_LEVEL_MONTH ) { - nVal = nIndex; // Month is 0-based + nVal = nIndex; // Month is 0-based aName = ScGlobal::GetCalendar()->getDisplayName( ::com::sun::star::i18n::CalendarDisplayIndex::MONTH, sal::static_int_cast<sal_Int16>(nVal), 0 ); } else - nVal = nIndex + 1; // Quarter, Day, Week are 1-based + nVal = nIndex + 1; // Quarter, Day, Week are 1-based if ( !aName.Len() ) aName = String::CreateFromInt32(nVal); - + ScDPItemData rData( aName, nVal, TRUE, 0 ) ; pNew = new ScDPMember( pSource, nDim, nHier, nLev, pSource->GetCache()->GetAdditionalItemID(rData)); } @@ -2647,7 +2647,7 @@ ScDPMember* ScDPMembers::getByIndex(long nIndex) const const std::vector< SCROW >& memberIndexs = pSource->GetData()->GetColumnEntries( nSrcDim ); pNew = new ScDPMember( pSource, nDim, nHier, nLev, memberIndexs[nIndex] ); } - pNew->acquire(); // ref-counted + pNew->acquire(); // ref-counted ppMbrs[nIndex] = pNew; } @@ -2656,7 +2656,7 @@ ScDPMember* ScDPMembers::getByIndex(long nIndex) const return ppMbrs[nIndex]; } - return NULL; //! exception? + return NULL; //! exception? } // ----------------------------------------------------------------------- @@ -2673,12 +2673,12 @@ ScDPMember::ScDPMember( ScDPSource* pSrc, long nD, long nH, long nL, bVisible( TRUE ), bShowDet( TRUE ) { - //! hold pSource + //! hold pSource } ScDPMember::~ScDPMember() { - //! release pSource + //! release pSource } BOOL ScDPMember::IsNamedItem( const ScDPItemData& r ) const @@ -2690,7 +2690,7 @@ BOOL ScDPMember::IsNamedItem( const ScDPItemData& r ) const (long)::rtl::math::approxFloor( r.GetValue() ), nHier, nLev ); - // fValue is converted from integer, so simple comparison works + // fValue is converted from integer, so simple comparison works return nComp == GetItemData().GetValue(); } @@ -2701,7 +2701,7 @@ BOOL ScDPMember::IsNamedItem( SCROW nIndex ) const { long nSrcDim = pSource->GetSourceDim( nDim ); if ( nHier != SC_DAPI_HIERARCHY_FLAT && pSource->IsDateDimension( nSrcDim ) ) - { + { const ScDPItemData* pData = pSource->GetCache()->GetItemDataById( (SCCOL) nSrcDim, nIndex ); if ( pData->IsValue() ) { @@ -2743,7 +2743,7 @@ sal_Int32 ScDPMember::Compare( const ScDPMember& rOther ) const void ScDPMember::FillItemData( ScDPItemData& rData ) const { - //! handle date hierarchy... + //! handle date hierarchy... rData = GetItemData() ; } @@ -2765,7 +2765,7 @@ String ScDPMember::GetNameStr() const void SAL_CALL ScDPMember::setName( const ::rtl::OUString& /* rNewName */ ) throw(uno::RuntimeException) { - DBG_ERROR("not implemented"); //! exception? + DBG_ERROR("not implemented"); //! exception? } BOOL ScDPMember::getIsVisible() const @@ -2776,7 +2776,7 @@ BOOL ScDPMember::getIsVisible() const void ScDPMember::setIsVisible(BOOL bSet) { bVisible = bSet; - //! set "manual change" flag + //! set "manual change" flag } BOOL ScDPMember::getShowDetails() const @@ -2787,7 +2787,7 @@ BOOL ScDPMember::getShowDetails() const void ScDPMember::setShowDetails(BOOL bSet) { bShowDet = bSet; - //! set "manual change" flag + //! set "manual change" flag } sal_Int32 ScDPMember::getPosition() const @@ -2809,9 +2809,9 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPMember::getPropertySetInfo( static SfxItemPropertyMapEntry aDPMemberMap_Impl[] = { - {MAP_CHAR_LEN(SC_UNO_ISVISIBL), 0, &getBooleanCppuType(), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_ISVISIBL), 0, &getBooleanCppuType(), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_POSITION), 0, &getCppuType((sal_Int32*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_SHOWDETA), 0, &getBooleanCppuType(), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_SHOWDETA), 0, &getBooleanCppuType(), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_LAYOUTNAME), 0, &getCppuType(static_cast<rtl::OUString*>(0)), 0, 0 }, {0,0,0,0,0,0} }; @@ -2845,7 +2845,7 @@ void SAL_CALL ScDPMember::setPropertyValue( const rtl::OUString& aPropertyName, else { DBG_ERROR("unknown property"); - //! THROW( UnknownPropertyException() ); + //! THROW( UnknownPropertyException() ); } } @@ -2866,7 +2866,7 @@ uno::Any SAL_CALL ScDPMember::getPropertyValue( const rtl::OUString& aPropertyNa else { DBG_ERROR("unknown property"); - //! THROW( UnknownPropertyException() ); + //! THROW( UnknownPropertyException() ); } return aRet; } @@ -2887,7 +2887,7 @@ const ScDPItemData& ScDPMember::GetItemData() const const ScDPItemData* ScDPSource::GetItemDataById(long nDim, long nId) { - long nSrcDim = GetSourceDim( nDim ); + long nSrcDim = GetSourceDim( nDim ); const ScDPItemData* pItemData = GetData()->GetMemberById( nSrcDim, nId ); if ( !pItemData ) { //todo: @@ -2901,7 +2901,7 @@ const ScDPItemData* ScDPSource::GetItemDataById(long nDim, long nId) SCROW ScDPSource::GetMemberId( long nDim, const ScDPItemData& rData ) { long nSrcDim = GetSourceDim( nDim ); - return GetCache()->GetIdByItemData( nSrcDim, rData ); + return GetCache()->GetIdByItemData( nSrcDim, rData ); } const ScDPItemData* ScDPMembers::GetSrcItemDataByIndex( SCROW nIndex) @@ -2909,7 +2909,7 @@ const ScDPItemData* ScDPMembers::GetSrcItemDataByIndex( SCROW nIndex) const std::vector< SCROW >& memberIds = pSource->GetData()->GetColumnEntries( nDim ); if ( nIndex >= (long )(memberIds.size()) || nIndex < 0 ) return NULL; - SCROW nId = memberIds[ nIndex ]; + SCROW nId = memberIds[ nIndex ]; return pSource->GetItemDataById( nDim, nId ); } diff --git a/sc/source/core/data/drawpage.cxx b/sc/source/core/data/drawpage.cxx index 715b99f362a1..1b635098b12b 100644 --- a/sc/source/core/data/drawpage.cxx +++ b/sc/source/core/data/drawpage.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 4df709768279..271882427539 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -1,7 +1,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 @@ -82,15 +82,15 @@ #include "attrib.hxx" #include "charthelper.hxx" -#define DET_ARROW_OFFSET 1000 +#define DET_ARROW_OFFSET 1000 -// Abstand zur naechsten Zelle beim Loeschen (bShrink), damit der Anker -// immer an der richtigen Zelle angezeigt wird -//#define SHRINK_DIST 3 -// und noch etwas mehr, damit das Objekt auch sichtbar in der Zelle liegt -#define SHRINK_DIST 25 +// Abstand zur naechsten Zelle beim Loeschen (bShrink), damit der Anker +// immer an der richtigen Zelle angezeigt wird +//#define SHRINK_DIST 3 +// und noch etwas mehr, damit das Objekt auch sichtbar in der Zelle liegt +#define SHRINK_DIST 25 -#define SHRINK_DIST_TWIPS 15 +#define SHRINK_DIST_TWIPS 15 using namespace ::com::sun::star; @@ -104,9 +104,9 @@ static E3dObjFactory* pF3d = NULL; static USHORT nInst = 0; SfxObjectShell* ScDrawLayer::pGlobalDrawPersist = NULL; -//REMOVE SvPersist* ScDrawLayer::pGlobalDrawPersist = NULL; +//REMOVE SvPersist* ScDrawLayer::pGlobalDrawPersist = NULL; -BOOL bDrawIsInUndo = FALSE; //! Member +BOOL bDrawIsInUndo = FALSE; //! Member // ----------------------------------------------------------------------- @@ -168,7 +168,7 @@ __EXPORT ScTabSizeChangedHint::~ScTabSizeChangedHint() // ----------------------------------------------------------------------- -#define MAXMM 10000000 +#define MAXMM 10000000 inline void TwipsToMM( long& nVal ) { @@ -177,7 +177,7 @@ inline void TwipsToMM( long& nVal ) inline void ReverseTwipsToMM( long& nVal ) { - // reverse the effect of TwipsToMM - round up here (add 1) + // reverse the effect of TwipsToMM - round up here (add 1) nVal = ((long) ( nVal / HMM_PER_TWIPS )) + 1; } @@ -207,11 +207,11 @@ void lcl_ReverseTwipsToMM( Rectangle& rRect ) ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) : FmFormModel( SvtPathOptions().GetPalettePath(), - NULL, // SfxItemPool* Pool + NULL, // SfxItemPool* Pool pGlobalDrawPersist ? pGlobalDrawPersist : ( pDocument ? pDocument->GetDocumentShell() : NULL ), - TRUE ), // bUseExtColorTable (is set below) + TRUE ), // bUseExtColorTable (is set below) aName( rName ), pDoc( pDocument ), pUndoGroup( NULL ), @@ -219,7 +219,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) : bAdjustEnabled( TRUE ), bHyphenatorSet( FALSE ) { - pGlobalDrawPersist = NULL; // nur einmal benutzen + pGlobalDrawPersist = NULL; // nur einmal benutzen SfxObjectShell* pObjSh = pDocument ? pDocument->GetDocumentShell() : NULL; if ( pObjSh ) @@ -235,7 +235,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) : SetColorTable( XColorTable::GetStdColorTable() ); SetSwapGraphics(TRUE); -// SetSwapAsynchron(TRUE); // an der View +// SetSwapAsynchron(TRUE); // an der View SetScaleUnit(MAP_100TH_MM); SfxItemPool& rPool = GetItemPool(); @@ -257,7 +257,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) : rPool.GetSecondaryPool()->SetPoolDefaultItem( SvxScriptSpaceItem( FALSE, EE_PARA_ASIANCJKSPACING ) ); } - rPool.FreezeIdRanges(); // the pool is also used directly + rPool.FreezeIdRanges(); // the pool is also used directly SdrLayerAdmin& rAdmin = GetLayerAdmin(); rAdmin.NewLayer(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("vorne")), SC_LAYER_FRONT); @@ -267,7 +267,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) : rAdmin.NewLayer(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("hidden")), SC_LAYER_HIDDEN); // "Controls" is new - must also be created when loading - // Link fuer URL-Fields setzen + // Link fuer URL-Fields setzen ScModule* pScMod = SC_MOD(); Outliner& rOutliner = GetDrawOutliner(); rOutliner.SetCalcFieldValueHdl( LINK( pScMod, ScModule, CalcFieldValueHdl ) ); @@ -283,7 +283,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) : if ( pHitOutlinerPool ) pHitOutlinerPool->SetPoolDefaultItem(SvxFontHeightItem( 423, 100, EE_CHAR_FONTHEIGHT )); // 12Pt - // URL-Buttons haben keinen Handler mehr, machen alles selber + // URL-Buttons haben keinen Handler mehr, machen alles selber if( !nInst++ ) { @@ -324,7 +324,7 @@ void ScDrawLayer::UseHyphenator() SdrPage* __EXPORT ScDrawLayer::AllocPage(FASTBOOL bMasterPage) { - // don't create basic until it is needed + // don't create basic until it is needed StarBASIC* pBasic = NULL; ScDrawPage* pPage = new ScDrawPage( *this, pBasic, sal::static_int_cast<BOOL>(bMasterPage) ); return pPage; @@ -344,14 +344,14 @@ BOOL ScDrawLayer::HasObjects() const void ScDrawLayer::UpdateBasic() { - // don't create basic until it is needed - //! remove this method? + // don't create basic until it is needed + //! remove this method? } SdrModel* __EXPORT ScDrawLayer::AllocModel() const { - // #103849# Allocated model (for clipboard etc) must not have a pointer - // to the original model's document, pass NULL as document: + // #103849# Allocated model (for clipboard etc) must not have a pointer + // to the original model's document, pass NULL as document: return new ScDrawLayer( NULL, aName ); } @@ -393,11 +393,11 @@ void ScDrawLayer::ScRemovePage( SCTAB nTab ) if (bRecording) { SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab)); - AddCalcUndo(new SdrUndoDelPage(*pPage)); // Undo-Action wird Owner der Page - RemovePage( static_cast<sal_uInt16>(nTab) ); // nur austragen, nicht loeschen + AddCalcUndo(new SdrUndoDelPage(*pPage)); // Undo-Action wird Owner der Page + RemovePage( static_cast<sal_uInt16>(nTab) ); // nur austragen, nicht loeschen } else - DeletePage( static_cast<sal_uInt16>(nTab) ); // einfach weg damit + DeletePage( static_cast<sal_uInt16>(nTab) ); // einfach weg damit } void ScDrawLayer::ScRenamePage( SCTAB nTab, const String& rNewName ) @@ -414,7 +414,7 @@ void ScDrawLayer::ScMovePage( USHORT nOldPos, USHORT nNewPos ) void ScDrawLayer::ScCopyPage( USHORT nOldPos, USHORT nNewPos, BOOL bAlloc ) { - //! remove argument bAlloc (always FALSE) + //! remove argument bAlloc (always FALSE) if (bDrawIsInUndo) return; @@ -506,12 +506,12 @@ void ScDrawLayer::SetPageSize( USHORT nPageNo, const Size& rSize, bool bUpdateNo if ( rSize != pPage->GetSize() ) { pPage->SetSize( rSize ); - Broadcast( ScTabSizeChangedHint( static_cast<SCTAB>(nPageNo) ) ); // SetWorkArea() an den Views + Broadcast( ScTabSizeChangedHint( static_cast<SCTAB>(nPageNo) ) ); // SetWorkArea() an den Views } // Detektivlinien umsetzen (an neue Hoehen/Breiten anpassen) - // auch wenn Groesse gleich geblieben ist - // (einzelne Zeilen/Spalten koennen geaendert sein) + // auch wenn Groesse gleich geblieben ist + // (einzelne Zeilen/Spalten koennen geaendert sein) BOOL bNegativePage = pDoc && pDoc->IsNegativePage( static_cast<SCTAB>(nPageNo) ); @@ -569,15 +569,15 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b TwipsToMM( aPos.X() ); TwipsToMM( aPos.Y() ); - // Berechnung und Werte wie in detfunc.cxx + // Berechnung und Werte wie in detfunc.cxx Size aSize( (long)(pDoc->GetColWidth( nCol1, nTab1 ) * HMM_PER_TWIPS), (long)(pDoc->GetRowHeight( nRow1, nTab1 ) * HMM_PER_TWIPS) ); Rectangle aRect( aPos, aSize ); - aRect.Left() -= 250; - aRect.Right() += 250; - aRect.Top() -= 70; - aRect.Bottom() += 70; + aRect.Left() -= 250; + aRect.Right() += 250; + aRect.Top() -= 70; + aRect.Bottom() += 70; if ( bNegativePage ) MirrorRectRTL( aRect ); @@ -590,7 +590,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b } else if( bArrow ) { - //! nicht mehrere Undos fuer ein Objekt erzeugen (hinteres kann dann weggelassen werden) + //! nicht mehrere Undos fuer ein Objekt erzeugen (hinteres kann dann weggelassen werden) SCCOL nLastCol; SCROW nLastRow; @@ -605,7 +605,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b TwipsToMM( aPos.Y() ); Point aStartPos = aPos; if ( bNegativePage ) - aStartPos.X() = -aStartPos.X(); // don't modify aPos - used below + aStartPos.X() = -aStartPos.X(); // don't modify aPos - used below if ( pObj->GetPoint( 0 ) != aStartPos ) { if (bRecording) @@ -639,7 +639,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b TwipsToMM( aPos.Y() ); Point aEndPos = aPos; if ( bNegativePage ) - aEndPos.X() = -aEndPos.X(); // don't modify aPos - used below + aEndPos.X() = -aEndPos.X(); // don't modify aPos - used below if ( pObj->GetPoint( 1 ) != aEndPos ) { if (bRecording) @@ -665,7 +665,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b } } } - else // Referenz-Rahmen + else // Referenz-Rahmen { DBG_ASSERT( bValid1, "ScDrawLayer::RecalcPos - invalid start position" ); Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) ); @@ -746,7 +746,7 @@ BOOL ScDrawLayer::GetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) co if ( bNegativePage ) { - nStartX = -nStartX; // positions are negative, swap start/end so the same comparisons work + nStartX = -nStartX; // positions are negative, swap start/end so the same comparisons work nEndX = -nEndX; ::std::swap( nStartX, nEndX ); } @@ -788,7 +788,7 @@ BOOL ScDrawLayer::GetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) co if ( bNegativePage ) { - nStartX = -nStartX; // reverse transformation, so the same cell address calculation works + nStartX = -nStartX; // reverse transformation, so the same cell address calculation works nEndX = -nEndX; ::std::swap( nStartX, nEndX ); } @@ -810,7 +810,7 @@ BOOL ScDrawLayer::GetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) co rRange.aStart.SetCol( i>0 ? (i-1) : 0 ); nWidth = 0; - for (i=0; i<=MAXCOL && nWidth<=nEndX; i++) //! bei Start anfangen + for (i=0; i<=MAXCOL && nWidth<=nEndX; i++) //! bei Start anfangen nWidth += pDoc->GetColWidth(i,nTab); rRange.aEnd.SetCol( i>0 ? (i-1) : 0 ); } @@ -873,12 +873,12 @@ SdrUndoGroup* ScDrawLayer::GetCalcUndo() return pRet; } -// MoveAreaTwips: all measures are kept in twips +// MoveAreaTwips: all measures are kept in twips void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, const Point& rMove, const Point& rTopLeft ) { if (!rMove.X() && !rMove.Y()) - return; // nix + return; // nix SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab)); DBG_ASSERT(pPage,"Page nicht gefunden"); @@ -890,9 +890,9 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, // fuer Shrinking! Rectangle aNew( rArea ); BOOL bShrink = FALSE; - if ( rMove.X() < 0 || rMove.Y() < 0 ) // verkleinern + if ( rMove.X() < 0 || rMove.Y() < 0 ) // verkleinern { - if ( rTopLeft != rArea.TopLeft() ) // sind gleich beim Verschieben von Zellen + if ( rTopLeft != rArea.TopLeft() ) // sind gleich beim Verschieben von Zellen { bShrink = TRUE; aNew.Left() = rTopLeft.X(); @@ -905,14 +905,14 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, { if( GetAnchor( pObject ) == SCA_CELL ) { - if ( GetObjData( pObject ) ) // Detektiv-Pfeil ? + if ( GetObjData( pObject ) ) // Detektiv-Pfeil ? { // hier nichts } - else if ( pObject->ISA( SdrEdgeObj ) ) // Verbinder? + else if ( pObject->ISA( SdrEdgeObj ) ) // Verbinder? { - // hier auch nichts - //! nicht verbundene Enden wie bei Linien (s.u.) behandeln? + // hier auch nichts + //! nicht verbundene Enden wie bei Linien (s.u.) behandeln? } else if ( pObject->IsPolyObj() && pObject->GetPointCount()==2 ) { @@ -927,7 +927,7 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, } else if (bShrink && aNew.IsInside(aPoint)) { - // Punkt ist in betroffener Zelle - Test auf geloeschten Bereich + // Punkt ist in betroffener Zelle - Test auf geloeschten Bereich if ( rMove.X() && aPoint.X() >= rArea.Left() + rMove.X() ) { aPoint.X() = rArea.Left() + rMove.X() - SHRINK_DIST_TWIPS; @@ -955,7 +955,7 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, // aOldMMPos: not converted, millimeters Point aOldMMPos = bNegativePage ? aObjRect.TopRight() : aObjRect.TopLeft(); lcl_ReverseTwipsToMM( aObjRect ); - Point aTopLeft = bNegativePage ? aObjRect.TopRight() : aObjRect.TopLeft(); // logical left + Point aTopLeft = bNegativePage ? aObjRect.TopRight() : aObjRect.TopLeft(); // logical left Size aMoveSize; BOOL bDoMove = FALSE; if (rArea.IsInside(aTopLeft)) @@ -965,7 +965,7 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, } else if (bShrink && aNew.IsInside(aTopLeft)) { - // Position ist in betroffener Zelle - Test auf geloeschten Bereich + // Position ist in betroffener Zelle - Test auf geloeschten Bereich if ( rMove.X() && aTopLeft.X() >= rArea.Left() + rMove.X() ) { aMoveSize.Width() = rArea.Left() + rMove.X() - SHRINK_DIST - aTopLeft.X(); @@ -992,10 +992,10 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, if ( aTopLeft.Y() + aMoveSize.Height() < 0 ) aMoveSize.Height() = -aTopLeft.Y(); - // get corresponding move size in millimeters: + // get corresponding move size in millimeters: Point aNewPos( aTopLeft.X() + aMoveSize.Width(), aTopLeft.Y() + aMoveSize.Height() ); lcl_TwipsToMM( aNewPos ); - aMoveSize = Size( aNewPos.X() - aOldMMPos.X(), aNewPos.Y() - aOldMMPos.Y() ); // millimeters + aMoveSize = Size( aNewPos.X() - aOldMMPos.X(), aNewPos.Y() - aOldMMPos.Y() ); // millimeters AddCalcUndo( new SdrUndoMoveObj( *pObject, aMoveSize ) ); pObject->Move( aMoveSize ); @@ -1003,12 +1003,12 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, else if ( rArea.IsInside( bNegativePage ? aObjRect.BottomLeft() : aObjRect.BottomRight() ) && !pObject->IsResizeProtect() ) { - // geschuetzte Groessen werden nicht veraendert - // (Positionen schon, weil sie ja an der Zelle "verankert" sind) + // geschuetzte Groessen werden nicht veraendert + // (Positionen schon, weil sie ja an der Zelle "verankert" sind) AddCalcUndo( new SdrUndoGeoObj( *pObject ) ); long nOldSizeX = aObjRect.Right() - aObjRect.Left() + 1; long nOldSizeY = aObjRect.Bottom() - aObjRect.Top() + 1; - long nLogMoveX = rMove.X() * ( bNegativePage ? -1 : 1 ); // logical direction + long nLogMoveX = rMove.X() * ( bNegativePage ? -1 : 1 ); // logical direction pObject->Resize( aOldMMPos, Fraction( nOldSizeX+nLogMoveX, nOldSizeX ), Fraction( nOldSizeY+rMove.Y(), nOldSizeY ) ); } @@ -1032,7 +1032,7 @@ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCR Rectangle aRect = pDoc->GetMMRect( nCol1, nRow1, nCol2, nRow2, nTab ); lcl_ReverseTwipsToMM( aRect ); - //! use twips directly? + //! use twips directly? Point aMove; @@ -1050,22 +1050,22 @@ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCR if ( bNegativePage ) aMove.X() = -aMove.X(); - Point aTopLeft = aRect.TopLeft(); // Anfang beim Verkleinern + Point aTopLeft = aRect.TopLeft(); // Anfang beim Verkleinern if (bInsDel) { - if ( aMove.X() != 0 && nDx < 0 ) // nDx counts cells, sign is independent of RTL + if ( aMove.X() != 0 && nDx < 0 ) // nDx counts cells, sign is independent of RTL aTopLeft.X() += aMove.X(); if ( aMove.Y() < 0 ) aTopLeft.Y() += aMove.Y(); } - // drawing objects are now directly included in cut&paste - // -> only update references when inserting/deleting (or changing widths or heights) + // drawing objects are now directly included in cut&paste + // -> only update references when inserting/deleting (or changing widths or heights) if ( bInsDel ) MoveAreaTwips( nTab, aRect, aMove, aTopLeft ); // - // Detektiv-Pfeile: Zellpositionen anpassen + // Detektiv-Pfeile: Zellpositionen anpassen // MoveCells( nTab, nCol1,nRow1, nCol2,nRow2, nDx,nDy, bUpdateNoteCaptionPos ); @@ -1092,7 +1092,7 @@ void ScDrawLayer::WidthChanged( SCTAB nTab, SCCOL nCol, long nDifTwips ) aRect.Top() = 0; aRect.Bottom() = MAXMM; - //! aTopLeft ist falsch, wenn mehrere Spalten auf einmal ausgeblendet werden + //! aTopLeft ist falsch, wenn mehrere Spalten auf einmal ausgeblendet werden BOOL bNegativePage = pDoc->IsNegativePage( nTab ); if ( bNegativePage ) @@ -1125,7 +1125,7 @@ void ScDrawLayer::HeightChanged( SCTAB nTab, SCROW nRow, long nDifTwips ) aRect.Left() = 0; aRect.Right() = MAXMM; - //! aTopLeft ist falsch, wenn mehrere Zeilen auf einmal ausgeblendet werden + //! aTopLeft ist falsch, wenn mehrere Zeilen auf einmal ausgeblendet werden BOOL bNegativePage = pDoc->IsNegativePage( nTab ); if ( bNegativePage ) @@ -1177,7 +1177,7 @@ BOOL ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow ) SdrObject* pObject = aIter.Next(); while ( pObject && !bFound ) { - aObjRect = pObject->GetSnapRect(); //! GetLogicRect ? + aObjRect = pObject->GetSnapRect(); //! GetLogicRect ? if (aTestRect.IsInside(aObjRect.TopLeft()) || aTestRect.IsInside(aObjRect.BottomLeft())) bFound = TRUE; @@ -1197,8 +1197,8 @@ void ScDrawLayer::DeleteObjects( SCTAB nTab ) pPage->RecalcObjOrdNums(); - long nDelCount = 0; - ULONG nObjCount = pPage->GetObjCount(); + long nDelCount = 0; + ULONG nObjCount = pPage->GetObjCount(); if (nObjCount) { SdrObject** ppObj = new SdrObject*[nObjCount]; @@ -1207,7 +1207,7 @@ void ScDrawLayer::DeleteObjects( SCTAB nTab ) SdrObject* pObject = aIter.Next(); while (pObject) { - // alle loeschen + // alle loeschen ppObj[nDelCount++] = pObject; pObject = aIter.Next(); } @@ -1239,8 +1239,8 @@ void ScDrawLayer::DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, pPage->RecalcObjOrdNums(); - long nDelCount = 0; - ULONG nObjCount = pPage->GetObjCount(); + long nDelCount = 0; + ULONG nObjCount = pPage->GetObjCount(); if (nObjCount) { Rectangle aDelRect = pDoc->GetMMRect( nCol1, nRow1, nCol2, nRow2, nTab ); @@ -1295,11 +1295,11 @@ void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark ) if (pPage) { pPage->RecalcObjOrdNums(); - long nDelCount = 0; - ULONG nObjCount = pPage->GetObjCount(); + long nDelCount = 0; + ULONG nObjCount = pPage->GetObjCount(); if (nObjCount) { - // Rechteck um die ganze Selektion + // Rechteck um die ganze Selektion Rectangle aMarkBound = pDoc->GetMMRect( aMarkRange.aStart.Col(), aMarkRange.aStart.Row(), aMarkRange.aEnd.Col(), aMarkRange.aEnd.Row(), nTab ); @@ -1326,7 +1326,7 @@ void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark ) pObject = aIter.Next(); } - // Objekte loeschen (rueckwaerts) + // Objekte loeschen (rueckwaerts) long i; if (bRecording) @@ -1348,7 +1348,7 @@ void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark ) void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle& rRange ) { - // copy everything in the specified range into the same page (sheet) in the clipboard doc + // copy everything in the specified range into the same page (sheet) in the clipboard doc SdrPage* pSrcPage = GetPage(static_cast<sal_uInt16>(nTab)); if (pSrcPage) @@ -1366,12 +1366,12 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle& { if ( !pDestModel ) { - pDestModel = pClipDoc->GetDrawLayer(); // does the document already have a drawing layer? + pDestModel = pClipDoc->GetDrawLayer(); // does the document already have a drawing layer? if ( !pDestModel ) { - // allocate drawing layer in clipboard document only if there are objects to copy + // allocate drawing layer in clipboard document only if there are objects to copy - pClipDoc->InitDrawLayer(); //! create contiguous pages + pClipDoc->InitDrawLayer(); //! create contiguous pages pDestModel = pClipDoc->GetDrawLayer(); } if (pDestModel) @@ -1392,8 +1392,8 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle& pNewObject->NbcMove(Size(0,0)); pDestPage->InsertObject( pNewObject ); - // no undo needed in clipboard document - // charts are not updated + // no undo needed in clipboard document + // charts are not updated } } @@ -1404,7 +1404,7 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle& BOOL lcl_IsAllInRange( const ::std::vector< ScRangeList >& rRangesVector, const ScRange& rClipRange ) { - // check if every range of rRangesVector is completely in rClipRange + // check if every range of rRangesVector is completely in rClipRange ::std::vector< ScRangeList >::const_iterator aIt = rRangesVector.begin(); for( ;aIt!=rRangesVector.end(); ++aIt ) @@ -1416,12 +1416,12 @@ BOOL lcl_IsAllInRange( const ::std::vector< ScRangeList >& rRangesVector, const ScRange aRange = *rRanges.GetObject(i); if ( !rClipRange.In( aRange ) ) { - return FALSE; // at least one range is not valid + return FALSE; // at least one range is not valid } } } - return TRUE; // everything is fine + return TRUE; // everything is fine } BOOL lcl_MoveRanges( ::std::vector< ScRangeList >& rRangesVector, const ScRange& rSourceRange, const ScAddress& rDestPos ) @@ -1460,7 +1460,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const if (!pClipModel) return; - if (bDrawIsInUndo) //! can this happen? + if (bDrawIsInUndo) //! can this happen? { DBG_ERROR("CopyFromClip, bDrawIsInUndo"); return; @@ -1539,7 +1539,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const aVerFract = Fraction( nDestHeight, nSourceHeight ); bResize = TRUE; } - Point aRefPos = rDestRange.TopLeft(); // for resizing (after moving) + Point aRefPos = rDestRange.TopLeft(); // for resizing (after moving) while (pOldObject) { @@ -1554,7 +1554,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const pNewObject->SetPage(pDestPage); if ( bMirrorObj ) - MirrorRTL( pNewObject ); // first mirror, then move + MirrorRTL( pNewObject ); // first mirror, then move pNewObject->NbcMove( aMove ); if ( bResize ) @@ -1564,7 +1564,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const if (bRecording) AddCalcUndo( new SdrUndoInsertObj( *pNewObject ) ); - //#i110034# handle chart data references (after InsertObject) + //#i110034# handle chart data references (after InsertObject) if ( pNewObject->GetObjIdentifier() == OBJ_OLE2 ) { @@ -1637,7 +1637,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const uno::Reference< chart::XChartDocument > xNewChartDoc( xNewChart, uno::UNO_QUERY ); if( xOldChartDoc.is() && xNewChartDoc.is() ) xNewChartDoc->attachData( xOldChartDoc->getData() ); - + // (see ScDocument::UpdateChartListenerCollection, PastingDrawFromOtherDoc) } } @@ -1657,8 +1657,8 @@ void ScDrawLayer::MirrorRTL( SdrObject* pObj ) { UINT16 nIdent = pObj->GetObjIdentifier(); - // don't mirror OLE or graphics, otherwise ask the object - // if it can be mirrored + // don't mirror OLE or graphics, otherwise ask the object + // if it can be mirrored BOOL bCanMirror = ( nIdent != OBJ_GRAF && nIdent != OBJ_OLE2 ); if (bCanMirror) { @@ -1677,9 +1677,9 @@ void ScDrawLayer::MirrorRTL( SdrObject* pObj ) } else { - // Move instead of mirroring: - // New start position is negative of old end position - // -> move by sum of start and end position + // Move instead of mirroring: + // New start position is negative of old end position + // -> move by sum of start and end position Rectangle aObjRect = pObj->GetLogicRect(); Size aMoveSize( -(aObjRect.Left() + aObjRect.Right()), 0 ); if (bRecording) @@ -1691,7 +1691,7 @@ void ScDrawLayer::MirrorRTL( SdrObject* pObj ) // static void ScDrawLayer::MirrorRectRTL( Rectangle& rRect ) { - // mirror and swap left/right + // mirror and swap left/right long nTemp = rRect.Left(); rRect.Left() = -rRect.Right(); rRect.Right() = -nTemp; @@ -1744,10 +1744,10 @@ String ScDrawLayer::GetVisibleName( SdrObject* pObj ) String aName = pObj->GetName(); if ( pObj->GetObjIdentifier() == OBJ_OLE2 ) { - // #95575# For OLE, the user defined name (GetName) is used - // if it's not empty (accepting possibly duplicate names), - // otherwise the persist name is used so every object appears - // in the Navigator at all. + // #95575# For OLE, the user defined name (GetName) is used + // if it's not empty (accepting possibly duplicate names), + // otherwise the persist name is used so every object appears + // in the Navigator at all. if ( !aName.Len() ) aName = static_cast<SdrOle2Obj*>(pObj)->GetPersistName(); @@ -1757,8 +1757,8 @@ String ScDrawLayer::GetVisibleName( SdrObject* pObj ) inline sal_Bool IsNamedObject( SdrObject* pObj, const String& rName ) { - // TRUE if rName is the object's Name or PersistName - // (used to find a named object) + // TRUE if rName is the object's Name or PersistName + // (used to find a named object) return ( pObj->GetName() == rName || ( pObj->GetObjIdentifier() == OBJ_OLE2 && @@ -1818,7 +1818,7 @@ String ScDrawLayer::GetNewGraphicName( long* pnCounter ) const void ScDrawLayer::EnsureGraphicNames() { - // make sure all graphic objects have names (after Excel import etc.) + // make sure all graphic objects have names (after Excel import etc.) sal_uInt16 nTabCount = GetPageCount(); for (sal_uInt16 nTab=0; nTab<nTabCount; nTab++) @@ -1865,7 +1865,7 @@ ScAnchorType ScDrawLayer::GetAnchor( const SdrObject* pObj ) return ( aAnchor.Y() != 0 ) ? SCA_PAGE : SCA_CELL; } -ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, BOOL bCreate ) // static +ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, BOOL bCreate ) // static { USHORT nCount = pObj ? pObj->GetUserDataCount() : 0; for( USHORT i = 0; i < nCount; i++ ) @@ -1909,7 +1909,7 @@ ScDrawObjData* ScDrawLayer::GetNoteCaptionData( SdrObject* pObj, SCTAB nTab ) return (pData && pData->mbNote) ? pData : 0; } -ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj ) // static +ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj ) // static { USHORT nCount = pObj->GetUserDataCount(); for( USHORT i = 0; i < nCount; i++ ) @@ -1923,28 +1923,28 @@ ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj ) // static } // static: -IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj, +IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj, const Point& rWinPoint, const Window& rCmpWnd ) { - const MapMode aMap100( MAP_100TH_MM ); - MapMode aWndMode = rCmpWnd.GetMapMode(); - Point aRelPoint( rCmpWnd.LogicToLogic( rWinPoint, &aWndMode, &aMap100 ) ); - Rectangle aLogRect = rCmpWnd.LogicToLogic( pObj->GetLogicRect(), &aWndMode, &aMap100 ); - ScIMapInfo* pIMapInfo = GetIMapInfo( pObj ); - IMapObject* pIMapObj = NULL; + const MapMode aMap100( MAP_100TH_MM ); + MapMode aWndMode = rCmpWnd.GetMapMode(); + Point aRelPoint( rCmpWnd.LogicToLogic( rWinPoint, &aWndMode, &aMap100 ) ); + Rectangle aLogRect = rCmpWnd.LogicToLogic( pObj->GetLogicRect(), &aWndMode, &aMap100 ); + ScIMapInfo* pIMapInfo = GetIMapInfo( pObj ); + IMapObject* pIMapObj = NULL; if ( pIMapInfo ) { - Size aGraphSize; - ImageMap& rImageMap = (ImageMap&) pIMapInfo->GetImageMap(); - Graphic aGraphic; - BOOL bObjSupported = FALSE; + Size aGraphSize; + ImageMap& rImageMap = (ImageMap&) pIMapInfo->GetImageMap(); + Graphic aGraphic; + BOOL bObjSupported = FALSE; if ( pObj->ISA( SdrGrafObj ) ) // einfaches Grafik-Objekt { - const SdrGrafObj* pGrafObj = (const SdrGrafObj*) pObj; - const GeoStat& rGeo = pGrafObj->GetGeoStat(); - const Graphic& rGraphic = pGrafObj->GetGraphic(); + const SdrGrafObj* pGrafObj = (const SdrGrafObj*) pObj; + const GeoStat& rGeo = pGrafObj->GetGeoStat(); + const Graphic& rGraphic = pGrafObj->GetGraphic(); // Drehung rueckgaengig if ( rGeo.nDrehWink ) @@ -2007,7 +2007,7 @@ ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, BOOL bCreate ) return 0; } -void ScDrawLayer::SetGlobalDrawPersist(SfxObjectShell* pPersist) // static +void ScDrawLayer::SetGlobalDrawPersist(SfxObjectShell* pPersist) // static { DBG_ASSERT(!pGlobalDrawPersist,"SetGlobalDrawPersist mehrfach"); pGlobalDrawPersist = pPersist; @@ -2029,7 +2029,7 @@ SvStream* __EXPORT ScDrawLayer::GetDocumentStream(SdrDocumentStreamInfo& rStream uno::Reference< embed::XStorage > xStorage = pDoc->GetDocumentShell() ? pDoc->GetDocumentShell()->GetStorage() : NULL; - SvStream* pRet = NULL; + SvStream* pRet = NULL; if( xStorage.is() ) { @@ -2068,17 +2068,17 @@ SvStream* __EXPORT ScDrawLayer::GetDocumentStream(SdrDocumentStreamInfo& rStream } } // the following code seems to be related to binary format -//REMOVE else -//REMOVE { -//REMOVE pRet = pStor->OpenStream( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(STRING_SCSTREAM)), -//REMOVE STREAM_READ | STREAM_WRITE | STREAM_TRUNC ); +//REMOVE else +//REMOVE { +//REMOVE pRet = pStor->OpenStream( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(STRING_SCSTREAM)), +//REMOVE STREAM_READ | STREAM_WRITE | STREAM_TRUNC ); //REMOVE -//REMOVE if( pRet ) -//REMOVE { -//REMOVE pRet->SetVersion( pStor->GetVersion() ); -//REMOVE pRet->SetKey( pStor->GetKey() ); -//REMOVE } -//REMOVE } +//REMOVE if( pRet ) +//REMOVE { +//REMOVE pRet->SetVersion( pStor->GetVersion() ); +//REMOVE pRet->SetKey( pStor->GetKey() ); +//REMOVE } +//REMOVE } rStreamInfo.mbDeleteAfterUse = ( pRet != NULL ); } @@ -2086,14 +2086,14 @@ SvStream* __EXPORT ScDrawLayer::GetDocumentStream(SdrDocumentStreamInfo& rStream return pRet; } -//REMOVE void ScDrawLayer::ReleasePictureStorage() -//REMOVE { -//REMOVE xPictureStorage.Clear(); -//REMOVE } +//REMOVE void ScDrawLayer::ReleasePictureStorage() +//REMOVE { +//REMOVE xPictureStorage.Clear(); +//REMOVE } SdrLayerID __EXPORT ScDrawLayer::GetControlExportLayerId( const SdrObject & ) const { - // Layer fuer Export von Form-Controls in Versionen vor 5.0 - immer SC_LAYER_FRONT + // Layer fuer Export von Form-Controls in Versionen vor 5.0 - immer SC_LAYER_FRONT return SC_LAYER_FRONT; } diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 99da4979a1b6..280b777738d8 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -1,7 +1,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 @@ -35,7 +35,7 @@ #include "scitems.hxx" #include <editeng/boxitem.hxx> #include <editeng/bolnitem.hxx> -#include <editeng/editdata.hxx> // can be removed if table has a bLayoutRTL flag +#include <editeng/editdata.hxx> // can be removed if table has a bLayoutRTL flag #include <editeng/shaditem.hxx> #include "fillinfo.hxx" @@ -83,7 +83,7 @@ inline const SvxBorderLine* GetNullOrLine( const SvxBoxItem* pBox, FillInfoLineP return NULL; } -// aehnlich wie in output.cxx +// aehnlich wie in output.cxx void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY, ScDocument* pDoc, RowInfo* pRowInfo, @@ -99,7 +99,7 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY, SCCOL nLastCol; SCROW nLastRow; - while (bHOver) // nY konstant + while (bHOver) // nY konstant { --rStartX; if (rStartX >= (SCsCOL) nX1 && !pDoc->ColHidden(rStartX, nTab, nLastCol)) @@ -121,7 +121,7 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY, --rStartY; if (nArrY>0) - --nArrY; // lokale Kopie ! + --nArrY; // lokale Kopie ! if (rStartX >= (SCsCOL) nX1 && rStartY >= (SCsROW) nY1 && !pDoc->ColHidden(rStartX, nTab, nLastCol) && @@ -207,7 +207,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX nBlockStartY = aTmpRange.aStart.Row(); nBlockEndX = aTmpRange.aEnd.Col(); nBlockEndY = aTmpRange.aEnd.Row(); - ExtendHidden( nBlockStartX, nBlockStartY, nBlockEndX, nBlockEndY, nTab ); //? noetig ? + ExtendHidden( nBlockStartX, nBlockStartY, nBlockEndX, nBlockEndY, nTab ); //? noetig ? if (pMarkData->IsMarkNegative()) bSkipMarks = TRUE; else @@ -215,7 +215,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX } } - // zuerst nur die Eintraege fuer die ganze Spalte + // zuerst nur die Eintraege fuer die ganze Spalte nArrY=0; SCROW nYExtra = nY2+1; @@ -226,7 +226,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX if (nSignedY >= 0) nY = (SCROW) nSignedY; else - nY = MAXROW+1; // ungueltig + nY = MAXROW+1; // ungueltig if (nY > nDocHeightEndRow) { @@ -239,38 +239,38 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX if ( nArrY==0 || nDocHeight || nY > MAXROW ) { RowInfo* pThisRowInfo = &pRowInfo[nArrY]; - pThisRowInfo->pCellInfo = NULL; // wird unten belegt + pThisRowInfo->pCellInfo = NULL; // wird unten belegt USHORT nHeight = (USHORT) ( nDocHeight * nScaleY ); if (!nHeight) nHeight = 1; - pThisRowInfo->nRowNo = nY; //! Fall < 0 ? - pThisRowInfo->nHeight = nHeight; - pThisRowInfo->bEmptyBack = TRUE; - pThisRowInfo->bEmptyText = TRUE; - pThisRowInfo->bChanged = TRUE; - pThisRowInfo->bAutoFilter = FALSE; - pThisRowInfo->bPushButton = FALSE; - pThisRowInfo->nRotMaxCol = SC_ROTMAX_NONE; + pThisRowInfo->nRowNo = nY; //! Fall < 0 ? + pThisRowInfo->nHeight = nHeight; + pThisRowInfo->bEmptyBack = TRUE; + pThisRowInfo->bEmptyText = TRUE; + pThisRowInfo->bChanged = TRUE; + pThisRowInfo->bAutoFilter = FALSE; + pThisRowInfo->bPushButton = FALSE; + pThisRowInfo->nRotMaxCol = SC_ROTMAX_NONE; ++nArrY; if (nArrY >= ROWINFO_MAX) { DBG_ERROR("Zu grosser Bereich bei FillInfo" ); - nYExtra = nSignedY; // Ende - nY2 = nYExtra - 1; // Bereich anpassen + nYExtra = nSignedY; // Ende + nY2 = nYExtra - 1; // Bereich anpassen } } else - if (nSignedY==(SCsROW) nYExtra) // zusaetzliche Zeile verdeckt ? + if (nSignedY==(SCsROW) nYExtra) // zusaetzliche Zeile verdeckt ? ++nYExtra; } - nArrCount = nArrY; // incl. Dummys + nArrCount = nArrY; // incl. Dummys - // rotierter Text... + // rotierter Text... - // Attribut im Dokument ueberhaupt verwendet? + // Attribut im Dokument ueberhaupt verwendet? BOOL bAnyItem = FALSE; USHORT nRotCount = pPool->GetItemCount( ATTR_ROTATE_VALUE ); for (USHORT nItem=0; nItem<nRotCount; nItem++) @@ -284,33 +284,33 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX if ( bAnyItem && HasAttrib( 0,nY1,nTab, MAXCOL,nY2+1,nTab, HASATTR_ROTATE | HASATTR_CONDITIONAL ) ) { - //! Conditionals auch bei HASATTR_ROTATE abfragen ???? + //! Conditionals auch bei HASATTR_ROTATE abfragen ???? DBG_ASSERT( nArrCount>2, "nArrCount zu klein" ); -// FindMaxRotCol( nTab, &pRowInfo[1], nArrCount-2, nX1, nX2 ); +// FindMaxRotCol( nTab, &pRowInfo[1], nArrCount-2, nX1, nX2 ); FindMaxRotCol( nTab, &pRowInfo[1], nArrCount-1, nX1, nX2 ); - // FindMaxRotCol setzt nRotMaxCol + // FindMaxRotCol setzt nRotMaxCol for (nArrY=0; nArrY<nArrCount; nArrY++) if (pRowInfo[nArrY].nRotMaxCol != SC_ROTMAX_NONE && pRowInfo[nArrY].nRotMaxCol > nRotMax) nRotMax = pRowInfo[nArrY].nRotMaxCol; } - // Zell-Infos erst nach dem Test auf gedrehte allozieren - // bis nRotMax wegen nRotateDir Flag + // Zell-Infos erst nach dem Test auf gedrehte allozieren + // bis nRotMax wegen nRotateDir Flag for (nArrY=0; nArrY<nArrCount; nArrY++) { RowInfo* pThisRowInfo = &pRowInfo[nArrY]; nY = pThisRowInfo->nRowNo; - pThisRowInfo->pCellInfo = new CellInfo[ nRotMax+1+2 ]; // vom Aufrufer zu loeschen ! + pThisRowInfo->pCellInfo = new CellInfo[ nRotMax+1+2 ]; // vom Aufrufer zu loeschen ! - for (nArrX=0; nArrX<=nRotMax+2; nArrX++) // Zell-Infos vorbelegen + for (nArrX=0; nArrX<=nRotMax+2; nArrX++) // Zell-Infos vorbelegen { if (nArrX>0) nX = nArrX-1; else - nX = MAXCOL+1; // ungueltig + nX = MAXCOL+1; // ungueltig CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrX]; pInfo->bEmptyCellText = TRUE; @@ -322,21 +322,21 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX pInfo->bMarked = FALSE; pInfo->nWidth = 0; - pInfo->nClipMark = SC_CLIPMARK_NONE; - pInfo->bMerged = FALSE; + pInfo->nClipMark = SC_CLIPMARK_NONE; + pInfo->bMerged = FALSE; pInfo->bHOverlapped = FALSE; pInfo->bVOverlapped = FALSE; - pInfo->bAutoFilter = FALSE; - pInfo->bPushButton = FALSE; + pInfo->bAutoFilter = FALSE; + pInfo->bPushButton = FALSE; pInfo->bPopupButton = false; pInfo->bFilterActive = false; - pInfo->nRotateDir = SC_ROTDIR_NONE; + pInfo->nRotateDir = SC_ROTDIR_NONE; - pInfo->bPrinted = FALSE; // view-intern - pInfo->bHideGrid = FALSE; // view-intern - pInfo->bEditEngine = FALSE; // view-intern + pInfo->bPrinted = FALSE; // view-intern + pInfo->bHideGrid = FALSE; // view-intern + pInfo->bEditEngine = FALSE; // view-intern - pInfo->pBackground = NULL; //! weglassen? + pInfo->pBackground = NULL; //! weglassen? pInfo->pPatternAttr = NULL; pInfo->pConditionSet= NULL; @@ -344,13 +344,13 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX pInfo->mpTLBRLine = NULL; pInfo->mpBLTRLine = NULL; - pInfo->pShadowAttr = pDefShadow; + pInfo->pShadowAttr = pDefShadow; pInfo->pHShadowOrigin = NULL; pInfo->pVShadowOrigin = NULL; } } - for (nArrX=nX2+3; nArrX<=nRotMax+2; nArrX++) // restliche Breiten eintragen + for (nArrX=nX2+3; nArrX<=nRotMax+2; nArrX++) // restliche Breiten eintragen { nX = nArrX-1; if ( ValidCol(nX) ) @@ -366,9 +366,9 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX } } - for (nArrX=0; nArrX<=nX2+2; nArrX++) // links & rechts + 1 + for (nArrX=0; nArrX<=nX2+2; nArrX++) // links & rechts + 1 { - nX = (nArrX>0) ? nArrX-1 : MAXCOL+1; // negativ -> ungueltig + nX = (nArrX>0) ? nArrX-1 : MAXCOL+1; // negativ -> ungueltig if ( ValidCol(nX) ) { @@ -382,9 +382,9 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX if (!nThisWidth) nThisWidth = 1; - pRowInfo[0].pCellInfo[nArrX].nWidth = nThisWidth; //! dies sollte reichen + pRowInfo[0].pCellInfo[nArrX].nWidth = nThisWidth; //! dies sollte reichen - ScColumn* pThisCol = &pTab[nTab]->aCol[nX]; // Spalten-Daten + ScColumn* pThisCol = &pTab[nTab]->aCol[nX]; // Spalten-Daten nArrY = 1; SCSIZE nUIndex; @@ -415,25 +415,25 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX ++nUIndex; } - if (nX+1 >= nX1) // Attribute/Blockmarken ab nX1-1 + if (nX+1 >= nX1) // Attribute/Blockmarken ab nX1-1 { - ScAttrArray* pThisAttrArr = pThisCol->pAttrArray; // Attribute + ScAttrArray* pThisAttrArr = pThisCol->pAttrArray; // Attribute nArrY = 0; const ScPatternAttr* pPattern; - SCROW nCurRow=nY1; // einzelne Zeile + SCROW nCurRow=nY1; // einzelne Zeile if (nCurRow>0) - --nCurRow; // oben 1 mehr + --nCurRow; // oben 1 mehr else nArrY = 1; - nThisRow=nCurRow; // Ende des Bereichs + nThisRow=nCurRow; // Ende des Bereichs SCSIZE nIndex; (void) pThisAttrArr->Search( nCurRow, nIndex ); do { - nThisRow=pThisAttrArr->pData[nIndex].nRow; // Ende des Bereichs + nThisRow=pThisAttrArr->pData[nIndex].nRow; // Ende des Bereichs pPattern=pThisAttrArr->pData[nIndex].pPattern; const SvxBrushItem* pBackground = (const SvxBrushItem*) @@ -460,11 +460,11 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX BOOL bVOverlapped = ((nOverlap & SC_MF_VER) != 0); BOOL bAutoFilter = ((nOverlap & SC_MF_AUTO) != 0); BOOL bPushButton = ((nOverlap & SC_MF_BUTTON) != 0); - BOOL bScenario = ((nOverlap & SC_MF_SCENARIO) != 0); + BOOL bScenario = ((nOverlap & SC_MF_SCENARIO) != 0); bool bPopupButton = ((nOverlap & SC_MF_BUTTON_POPUP) != 0); bool bFilterActive = ((nOverlap & SC_MF_HIDDEN_MEMBER) != 0); if (bMerged||bHOverlapped||bVOverlapped) - bAnyMerged = TRUE; // intern + bAnyMerged = TRUE; // intern BOOL bHidden, bHideFormula; if (bTabProtect) @@ -490,7 +490,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX if ( nArrY==0 || !bRowHidden ) { RowInfo* pThisRowInfo = &pRowInfo[nArrY]; - if (pBackground != pDefBackground) // Spalten-HG == Standard ? + if (pBackground != pDefBackground) // Spalten-HG == Standard ? pThisRowInfo->bEmptyBack = FALSE; if (bAutoFilter) pThisRowInfo->bAutoFilter = TRUE; @@ -498,26 +498,26 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX pThisRowInfo->bPushButton = TRUE; CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrX]; - pInfo->pBackground = pBackground; - pInfo->pPatternAttr = pPattern; - pInfo->bMerged = bMerged; - pInfo->bHOverlapped = bHOverlapped; - pInfo->bVOverlapped = bVOverlapped; - pInfo->bAutoFilter = bAutoFilter; - pInfo->bPushButton = bPushButton; + pInfo->pBackground = pBackground; + pInfo->pPatternAttr = pPattern; + pInfo->bMerged = bMerged; + pInfo->bHOverlapped = bHOverlapped; + pInfo->bVOverlapped = bVOverlapped; + pInfo->bAutoFilter = bAutoFilter; + pInfo->bPushButton = bPushButton; pInfo->bPopupButton = bPopupButton; pInfo->bFilterActive = bFilterActive; - pInfo->pLinesAttr = pLinesAttr; + pInfo->pLinesAttr = pLinesAttr; pInfo->mpTLBRLine = pTLBRLine; pInfo->mpBLTRLine = pBLTRLine; - pInfo->pShadowAttr = pShadowAttr; - // nWidth wird nicht mehr einzeln gesetzt + pInfo->pShadowAttr = pShadowAttr; + // nWidth wird nicht mehr einzeln gesetzt BOOL bEmbed = FALSE; //bIsEmbedded && - nTab >= aEmbedRange.aStart.Tab() && + nTab >= aEmbedRange.aStart.Tab() && nTab <= aEmbedRange.aEnd.Tab() && - nX >= aEmbedRange.aStart.Col() && - nX <= aEmbedRange.aEnd.Col() && + nX >= aEmbedRange.aStart.Col() && + nX <= aEmbedRange.aEnd.Col() && nCurRow >= aEmbedRange.aStart.Row() && nCurRow <= aEmbedRange.aEnd.Row(); @@ -547,7 +547,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX pStlPool->Find( aStyle, SFX_STYLE_FAMILY_PARA ); if ( pStyleSheet ) { - //! Style-Sets cachen !!! + //! Style-Sets cachen !!! pInfo->pConditionSet = &pStyleSheet->GetItemSet(); bAnyCondition = TRUE; } @@ -573,12 +573,12 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX if (pMarkData && pMarkData->IsMultiMarked()) { - // Blockmarken + // Blockmarken const ScMarkArray* pThisMarkArr = pMarkData->GetArray()+nX; BOOL bThisMarked; nArrY = 1; - nCurRow = nY1; // einzelne Zeile - nThisRow = nY1; // Ende des Bereichs + nCurRow = nY1; // einzelne Zeile + nThisRow = nY1; // Ende des Bereichs if ( pThisMarkArr->Search( nY1, nIndex ) ) { @@ -616,14 +616,14 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX } } } - else // vordere Spalten + else // vordere Spalten { for (nArrY=1; nArrY+1<nArrCount; nArrY++) { RowInfo* pThisRowInfo = &pRowInfo[nArrY]; CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrX]; - pInfo->nWidth = nThisWidth; //! oder nur 0 abfragen ?? + pInfo->nWidth = nThisWidth; //! oder nur 0 abfragen ?? } } } @@ -634,13 +634,13 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX } //------------------------------------------------------------------------- - // bedingte Formatierung auswerten + // bedingte Formatierung auswerten if (bAnyCondition) { for (nArrY=0; nArrY<nArrCount; nArrY++) { - for (nArrX=nX1; nArrX<=nX2+2; nArrX++) // links und rechts einer mehr + for (nArrX=nX1; nArrX<=nX2+2; nArrX++) // links und rechts einer mehr { CellInfo* pInfo = &pRowInfo[nArrY].pCellInfo[nArrX]; const SfxItemSet* pCondSet = pInfo->pConditionSet; @@ -648,14 +648,14 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { const SfxPoolItem* pItem; - // Hintergrund + // Hintergrund if ( pCondSet->GetItemState( ATTR_BACKGROUND, TRUE, &pItem ) == SFX_ITEM_SET ) { pInfo->pBackground = (const SvxBrushItem*) pItem; pRowInfo[nArrY].bEmptyBack = FALSE; } - // Umrandung + // Umrandung if ( pCondSet->GetItemState( ATTR_BORDER, TRUE, &pItem ) == SFX_ITEM_SET ) pInfo->pLinesAttr = (const SvxBoxItem*) pItem; @@ -664,7 +664,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX if ( pCondSet->GetItemState( ATTR_BORDER_BLTR, TRUE, &pItem ) == SFX_ITEM_SET ) pInfo->mpBLTRLine = static_cast< const SvxLineItem* >( pItem ); - // Schatten + // Schatten if ( pCondSet->GetItemState( ATTR_SHADOW, TRUE, &pItem ) == SFX_ITEM_SET ) { pInfo->pShadowAttr = (const SvxShadowItem*) pItem; @@ -675,11 +675,11 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX } } - // bedingte Formatierung Ende + // bedingte Formatierung Ende //------------------------------------------------------------------------- // - // Daten von zusammengefassten Zellen anpassen + // Daten von zusammengefassten Zellen anpassen // if (bAnyMerged) @@ -689,7 +689,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX RowInfo* pThisRowInfo = &pRowInfo[nArrY]; nSignedY = nArrY ? pThisRowInfo->nRowNo : ((SCsROW)nY1)-1; - for (nArrX=nX1; nArrX<=nX2+2; nArrX++) // links und rechts einer mehr + for (nArrX=nX1; nArrX<=nX2+2; nArrX++) // links und rechts einer mehr { SCsCOL nSignedX = ((SCsCOL) nArrX) - 1; CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrX]; @@ -745,14 +745,14 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX } } - if (bAnyShadow) // Schatten verteilen + if (bAnyShadow) // Schatten verteilen { for (nArrY=0; nArrY<nArrCount; nArrY++) { BOOL bTop = ( nArrY == 0 ); BOOL bBottom = ( nArrY+1 == nArrCount ); - for (nArrX=nX1; nArrX<=nX2+2; nArrX++) // links und rechts einer mehr + for (nArrX=nX1; nArrX<=nX2+2; nArrX++) // links und rechts einer mehr { BOOL bLeft = ( nArrX == nX1 ); BOOL bRight = ( nArrX == nX2+2 ); @@ -762,7 +762,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX SvxShadowLocation eLoc = pThisAttr ? pThisAttr->GetLocation() : SVX_SHADOW_NONE; if (eLoc != SVX_SHADOW_NONE) { - // oder Test auf != eLoc + // oder Test auf != eLoc SCsCOL nDxPos = 1; SCsCOL nDxNeg = -1; @@ -785,10 +785,10 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { switch (eLoc) { - case SVX_SHADOW_BOTTOMRIGHT: eLoc = SVX_SHADOW_BOTTOMLEFT; break; - case SVX_SHADOW_BOTTOMLEFT: eLoc = SVX_SHADOW_BOTTOMRIGHT; break; - case SVX_SHADOW_TOPRIGHT: eLoc = SVX_SHADOW_TOPLEFT; break; - case SVX_SHADOW_TOPLEFT: eLoc = SVX_SHADOW_TOPRIGHT; break; + case SVX_SHADOW_BOTTOMRIGHT: eLoc = SVX_SHADOW_BOTTOMLEFT; break; + case SVX_SHADOW_BOTTOMLEFT: eLoc = SVX_SHADOW_BOTTOMRIGHT; break; + case SVX_SHADOW_TOPRIGHT: eLoc = SVX_SHADOW_TOPLEFT; break; + case SVX_SHADOW_TOPLEFT: eLoc = SVX_SHADOW_TOPRIGHT; break; default: { // added to avoid warnings diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 48879bcdec93..e1e1bbb22a94 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -1,7 +1,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 @@ -90,20 +90,20 @@ // ----------------------------------------------------------------------- -#define CLIPST_AVAILABLE 0 -#define CLIPST_CAPTURED 1 -#define CLIPST_DELETE 2 -#define CLIPST_DRAW 3 +#define CLIPST_AVAILABLE 0 +#define CLIPST_CAPTURED 1 +#define CLIPST_DELETE 2 +#define CLIPST_DRAW 3 -ScDocShellRef* ScGlobal::pDrawClipDocShellRef = NULL; -SvxSearchItem* ScGlobal::pSearchItem = NULL; -ScAutoFormat* ScGlobal::pAutoFormat = NULL; +ScDocShellRef* ScGlobal::pDrawClipDocShellRef = NULL; +SvxSearchItem* ScGlobal::pSearchItem = NULL; +ScAutoFormat* ScGlobal::pAutoFormat = NULL; FuncCollection* ScGlobal::pFuncCollection = NULL; ScUnoAddInCollection* ScGlobal::pAddInCollection = NULL; -ScUserList* ScGlobal::pUserList = NULL; -String** ScGlobal::ppRscString = NULL; +ScUserList* ScGlobal::pUserList = NULL; +String** ScGlobal::ppRscString = NULL; LanguageType ScGlobal::eLnge = LANGUAGE_SYSTEM; -::com::sun::star::lang::Locale* ScGlobal::pLocale = NULL; +::com::sun::star::lang::Locale* ScGlobal::pLocale = NULL; SvtSysLocale* ScGlobal::pSysLocale = NULL; const CharClass* ScGlobal::pCharClass = NULL; const LocaleDataWrapper* ScGlobal::pLocaleData = NULL; @@ -114,59 +114,59 @@ CollatorWrapper* ScGlobal::pCaseCollator = NULL; ::utl::TransliterationWrapper* ScGlobal::pCaseTransliteration = NULL; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XOrdinalSuffix> ScGlobal::xOrdinalSuffix = NULL; IntlWrapper* ScGlobal::pScIntlWrapper = NULL; -sal_Unicode ScGlobal::cListDelimiter = ','; -String* ScGlobal::pEmptyString = NULL; -String* ScGlobal::pStrClipDocName = NULL; +sal_Unicode ScGlobal::cListDelimiter = ','; +String* ScGlobal::pEmptyString = NULL; +String* ScGlobal::pStrClipDocName = NULL; -SvxBrushItem* ScGlobal::pEmptyBrushItem = NULL; -SvxBrushItem* ScGlobal::pButtonBrushItem = NULL; -SvxBrushItem* ScGlobal::pEmbeddedBrushItem = NULL; -SvxBrushItem* ScGlobal::pProtectedBrushItem = NULL; +SvxBrushItem* ScGlobal::pEmptyBrushItem = NULL; +SvxBrushItem* ScGlobal::pButtonBrushItem = NULL; +SvxBrushItem* ScGlobal::pEmbeddedBrushItem = NULL; +SvxBrushItem* ScGlobal::pProtectedBrushItem = NULL; ImageList* ScGlobal::pOutlineBitmaps = NULL; ImageList* ScGlobal::pOutlineBitmapsHC = NULL; ScFunctionList* ScGlobal::pStarCalcFunctionList = NULL; -ScFunctionMgr* ScGlobal::pStarCalcFunctionMgr = NULL; +ScFunctionMgr* ScGlobal::pStarCalcFunctionMgr = NULL; ScUnitConverter* ScGlobal::pUnitConverter = NULL; SvNumberFormatter* ScGlobal::pEnglishFormatter = NULL; -double ScGlobal::nScreenPPTX = 96.0; -double ScGlobal::nScreenPPTY = 96.0; +double ScGlobal::nScreenPPTX = 96.0; +double ScGlobal::nScreenPPTY = 96.0; -USHORT ScGlobal::nDefFontHeight = 240; -USHORT ScGlobal::nStdRowHeight = 257; +USHORT ScGlobal::nDefFontHeight = 240; +USHORT ScGlobal::nStdRowHeight = 257; -long ScGlobal::nLastRowHeightExtra = 0; -long ScGlobal::nLastColWidthExtra = STD_EXTRA_WIDTH; +long ScGlobal::nLastRowHeightExtra = 0; +long ScGlobal::nLastColWidthExtra = STD_EXTRA_WIDTH; -static USHORT nPPTZoom = 0; // ScreenZoom used to determine nScreenPPTX/Y +static USHORT nPPTZoom = 0; // ScreenZoom used to determine nScreenPPTX/Y class SfxViewShell; -SfxViewShell* pScActiveViewShell = NULL; //! als Member !!!!! -USHORT nScClickMouseModifier = 0; //! dito -USHORT nScFillModeMouseModifier = 0; //! dito +SfxViewShell* pScActiveViewShell = NULL; //! als Member !!!!! +USHORT nScClickMouseModifier = 0; //! dito +USHORT nScFillModeMouseModifier = 0; //! dito // Hack: ScGlobal::GetUserList() muss InitAppOptions in der UI aufrufen, -// damit UserList aus Cfg geladen wird +// damit UserList aus Cfg geladen wird void global_InitAppOptions(); //======================================================================== // -// statische Funktionen +// statische Funktionen // //======================================================================== BOOL ScGlobal::HasAttrChanged( const SfxItemSet& rNewAttrs, const SfxItemSet& rOldAttrs, - const USHORT nWhich ) + const USHORT nWhich ) { - BOOL bInvalidate = FALSE; - const SfxItemState eNewState = rNewAttrs.GetItemState( nWhich ); - const SfxItemState eOldState = rOldAttrs.GetItemState( nWhich ); + BOOL bInvalidate = FALSE; + const SfxItemState eNewState = rNewAttrs.GetItemState( nWhich ); + const SfxItemState eOldState = rOldAttrs.GetItemState( nWhich ); //---------------------------------------------------------- @@ -281,7 +281,7 @@ void ScGlobal::SetSearchItem( const SvxSearchItem& rNew ) { // Hier waere ein Zuweisungsoperator ganz nett: delete pSearchItem; - pSearchItem = (SvxSearchItem*)rNew.Clone(); + pSearchItem = (SvxSearchItem*)rNew.Clone(); pSearchItem->SetWhich( SID_SEARCH_ITEM ); } @@ -406,7 +406,7 @@ String ScGlobal::GetErrorString(USHORT nErrNumber) case errDivisionByZero : nErrNumber = STR_DIV_ZERO; break; case errIllegalFPOperation : nErrNumber = STR_NUM_ERROR; break; - default : sResStr = GetRscString(STR_ERROR_STR); + default : sResStr = GetRscString(STR_ERROR_STR); sResStr += String::CreateFromInt32( nErrNumber ); nErrNumber = 0; break; @@ -534,17 +534,17 @@ void ScGlobal::Init() { pEmptyString = new String; - // Die Default-Sprache fuer Zahlenformate (ScGlobal::eLnge) - // muss immer LANGUAGE_SYSTEM sein - //! Dann kann auch die Variable raus + // Die Default-Sprache fuer Zahlenformate (ScGlobal::eLnge) + // muss immer LANGUAGE_SYSTEM sein + //! Dann kann auch die Variable raus eLnge = LANGUAGE_SYSTEM; - //! Wenn Sortierung etc. von der Sprache der installierten Offfice-Version + //! Wenn Sortierung etc. von der Sprache der installierten Offfice-Version //! abhaengen sollen, hier "Application::GetSettings().GetUILanguage()" pSysLocale = new SvtSysLocale; pCharClass = pSysLocale->GetCharClassPtr(); pLocaleData = pSysLocale->GetLocaleDataPtr(); - + ppRscString = new String *[ STR_COUNT ]; for( USHORT nC = 0 ; nC < STR_COUNT ; nC++ ) ppRscString[ nC ] = NULL; @@ -559,14 +559,14 @@ void ScGlobal::Init() // arguments are to be merged in, which in turn need strings of function // names from the compiler. ScParameterClassification::Init(); - srand( (unsigned) time( NULL ) ); // Random Seed Init fuer Interpreter + srand( (unsigned) time( NULL ) ); // Random Seed Init fuer Interpreter InitAddIns(); pStrClipDocName = new String( ScResId( SCSTR_NONAME ) ); *pStrClipDocName += '1'; - // ScDocumentPool::InitVersionMaps() ist schon vorher gerufen worden + // ScDocumentPool::InitVersionMaps() ist schon vorher gerufen worden } void ScGlobal::UpdatePPT( OutputDevice* pDev ) @@ -574,10 +574,10 @@ void ScGlobal::UpdatePPT( OutputDevice* pDev ) USHORT nCurrentZoom = Application::GetSettings().GetStyleSettings().GetScreenZoom(); if ( nCurrentZoom != nPPTZoom ) { - // Screen PPT values must be updated when ScreenZoom has changed. - // If called from Window::DataChanged, the window is passed as pDev, - // to make sure LogicToPixel uses a device which already uses the new zoom. - // For the initial settings, NULL is passed and GetDefaultDevice used. + // Screen PPT values must be updated when ScreenZoom has changed. + // If called from Window::DataChanged, the window is passed as pDev, + // to make sure LogicToPixel uses a device which already uses the new zoom. + // For the initial settings, NULL is passed and GetDefaultDevice used. if ( !pDev ) pDev = Application::GetDefaultDevice(); @@ -614,12 +614,12 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool) return; } -// String aTestString('X'); +// String aTestString('X'); OutputDevice* pDefaultDev = Application::GetDefaultDevice(); VirtualDevice aVirtWindow( *pDefaultDev ); aVirtWindow.SetMapMode(MAP_PIXEL); Font aDefFont; - pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, &aVirtWindow); // font color doesn't matter here + pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, &aVirtWindow); // font color doesn't matter here aVirtWindow.SetFont(aDefFont); nDefFontHeight = (USHORT) aVirtWindow.PixelToLogic(Size(0, aVirtWindow.GetTextHeight()), MAP_TWIP).Height(); @@ -647,11 +647,11 @@ void ScGlobal::Clear() delete[] ppRscString; ppRscString = NULL; - DELETEZ(pStarCalcFunctionList); // vor ResMgr zerstoeren! + DELETEZ(pStarCalcFunctionList); // vor ResMgr zerstoeren! DELETEZ(pStarCalcFunctionMgr); ScParameterClassification::Exit(); ScCompiler::DeInit(); - ScInterpreter::GlobalExit(); // statischen Stack loeschen + ScInterpreter::GlobalExit(); // statischen Stack loeschen DELETEZ(pEmptyBrushItem); DELETEZ(pButtonBrushItem); @@ -659,8 +659,8 @@ void ScGlobal::Clear() DELETEZ(pProtectedBrushItem); DELETEZ(pOutlineBitmaps); DELETEZ(pOutlineBitmapsHC); -// DELETEZ(pAnchorBitmap); -// DELETEZ(pGrayAnchorBitmap); +// DELETEZ(pAnchorBitmap); +// DELETEZ(pGrayAnchorBitmap); DELETEZ(pEnglishFormatter); DELETEZ(pCaseTransliteration); DELETEZ(pTransliteration); @@ -697,16 +697,16 @@ CharSet ScGlobal::GetCharsetValue( const String& rCharSet ) return (CharSet) nVal; } // old CharSet values for compatibility - else if (rCharSet.EqualsIgnoreCaseAscii("ANSI") ) return RTL_TEXTENCODING_MS_1252; - else if (rCharSet.EqualsIgnoreCaseAscii("MAC") ) return RTL_TEXTENCODING_APPLE_ROMAN; - else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC") ) return RTL_TEXTENCODING_IBM_850; + else if (rCharSet.EqualsIgnoreCaseAscii("ANSI") ) return RTL_TEXTENCODING_MS_1252; + else if (rCharSet.EqualsIgnoreCaseAscii("MAC") ) return RTL_TEXTENCODING_APPLE_ROMAN; + else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC") ) return RTL_TEXTENCODING_IBM_850; else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC_437")) return RTL_TEXTENCODING_IBM_437; else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC_850")) return RTL_TEXTENCODING_IBM_850; else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC_860")) return RTL_TEXTENCODING_IBM_860; else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC_861")) return RTL_TEXTENCODING_IBM_861; else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC_863")) return RTL_TEXTENCODING_IBM_863; else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC_865")) return RTL_TEXTENCODING_IBM_865; -// else if (rCharSet.EqualsIgnoreCaseAscii("SYSTEM") ) return gsl_getSystemTextEncoding(); +// else if (rCharSet.EqualsIgnoreCaseAscii("SYSTEM") ) return gsl_getSystemTextEncoding(); else return gsl_getSystemTextEncoding(); } @@ -719,16 +719,16 @@ String ScGlobal::GetCharsetString( CharSet eVal ) switch ( eVal ) { // old CharSet strings for compatibility - case RTL_TEXTENCODING_MS_1252: pChar = "ANSI"; break; - case RTL_TEXTENCODING_APPLE_ROMAN: pChar = "MAC"; break; + case RTL_TEXTENCODING_MS_1252: pChar = "ANSI"; break; + case RTL_TEXTENCODING_APPLE_ROMAN: pChar = "MAC"; break; // IBMPC == IBMPC_850 - case RTL_TEXTENCODING_IBM_437: pChar = "IBMPC_437"; break; - case RTL_TEXTENCODING_IBM_850: pChar = "IBMPC_850"; break; - case RTL_TEXTENCODING_IBM_860: pChar = "IBMPC_860"; break; - case RTL_TEXTENCODING_IBM_861: pChar = "IBMPC_861"; break; - case RTL_TEXTENCODING_IBM_863: pChar = "IBMPC_863"; break; - case RTL_TEXTENCODING_IBM_865: pChar = "IBMPC_865"; break; - case RTL_TEXTENCODING_DONTKNOW: pChar = "SYSTEM"; break; + case RTL_TEXTENCODING_IBM_437: pChar = "IBMPC_437"; break; + case RTL_TEXTENCODING_IBM_850: pChar = "IBMPC_850"; break; + case RTL_TEXTENCODING_IBM_860: pChar = "IBMPC_860"; break; + case RTL_TEXTENCODING_IBM_861: pChar = "IBMPC_861"; break; + case RTL_TEXTENCODING_IBM_863: pChar = "IBMPC_863"; break; + case RTL_TEXTENCODING_IBM_865: pChar = "IBMPC_865"; break; + case RTL_TEXTENCODING_DONTKNOW: pChar = "SYSTEM"; break; // new string of TextEncoding value default: return String::CreateFromInt32( eVal ); @@ -746,7 +746,7 @@ bool ScGlobal::HasStarCalcFunctionList() ScFunctionList* ScGlobal::GetStarCalcFunctionList() { if ( !pStarCalcFunctionList ) - pStarCalcFunctionList = new ScFunctionList; + pStarCalcFunctionList = new ScFunctionList; return pStarCalcFunctionList; } @@ -892,12 +892,12 @@ const sal_Unicode* ScGlobal::FindUnquoted( const sal_Unicode* pString, sal_Unico BOOL ScGlobal::EETextObjEqual( const EditTextObject* pObj1, const EditTextObject* pObj2 ) { - if ( pObj1 == pObj2 ) // both empty or the same object + if ( pObj1 == pObj2 ) // both empty or the same object return TRUE; if ( pObj1 && pObj2 ) { - // first test for equal text content + // first test for equal text content USHORT nParCount = pObj1->GetParagraphCount(); if ( nParCount != pObj2->GetParagraphCount() ) return FALSE; @@ -905,8 +905,8 @@ BOOL ScGlobal::EETextObjEqual( const EditTextObject* pObj1, if ( pObj1->GetText(nPar) != pObj2->GetText(nPar) ) return FALSE; - SvMemoryStream aStream1; - SvMemoryStream aStream2; + SvMemoryStream aStream1; + SvMemoryStream aStream2; pObj1->Store( aStream1 ); pObj2->Store( aStream2 ); ULONG nSize = aStream1.Tell(); @@ -920,13 +920,13 @@ BOOL ScGlobal::EETextObjEqual( const EditTextObject* pObj1, void ScGlobal::OpenURL( const String& rURL, const String& rTarget ) { - // OpenURL wird immer ueber irgendwelche Umwege durch Mausklicks im GridWindow - // aufgerufen, darum stimmen pScActiveViewShell und nScClickMouseModifier. + // OpenURL wird immer ueber irgendwelche Umwege durch Mausklicks im GridWindow + // aufgerufen, darum stimmen pScActiveViewShell und nScClickMouseModifier. SfxStringItem aUrl( SID_FILE_NAME, rURL ); SfxStringItem aTarget( SID_TARGETNAME, rTarget ); - if ( nScClickMouseModifier & KEY_MOD1 ) // control-click -> into new window + if ( nScClickMouseModifier & KEY_MOD1 ) // control-click -> into new window aTarget.SetValue( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("_blank")) ); @@ -946,7 +946,7 @@ void ScGlobal::OpenURL( const String& rURL, const String& rTarget ) SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, FALSE ); SfxBoolItem aBrowsing( SID_BROWSE, TRUE ); - // kein SID_SILENT mehr wegen Bug #42525# (war angeblich sowieso falsch) + // kein SID_SILENT mehr wegen Bug #42525# (war angeblich sowieso falsch) SfxViewFrame* pViewFrm = SfxViewFrame::Current(); if (pViewFrm) @@ -967,17 +967,17 @@ BOOL ScGlobal::IsSystemRTL() BYTE ScGlobal::GetDefaultScriptType() { - // Used when text contains only WEAK characters. - // Script type of office language is used then (same as GetEditDefaultLanguage, - // to get consistent behavior of text in simple cells and EditEngine, - // also same as GetAppLanguage() in Writer) + // Used when text contains only WEAK characters. + // Script type of office language is used then (same as GetEditDefaultLanguage, + // to get consistent behavior of text in simple cells and EditEngine, + // also same as GetAppLanguage() in Writer) return (BYTE) SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguage() ); } LanguageType ScGlobal::GetEditDefaultLanguage() { - // used for EditEngine::SetDefaultLanguage + // used for EditEngine::SetDefaultLanguage return Application::GetSettings().GetLanguage(); } @@ -1104,7 +1104,7 @@ void ScGlobal::AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter ) //=================================================================== //=================================================================== -// class ScFuncRes +// class ScFuncRes // fuer temporaere Objekte zum Holen der Resourcen class ScFuncRes : public Resource @@ -1123,7 +1123,7 @@ ScFuncRes::ScFuncRes( ResId &aRes, ScFuncDesc* pDesc, bool & rbSuppressed ) { rbSuppressed = (bool)GetNum(); pDesc->nCategory = GetNum(); - pDesc->nHelpId = GetNum() + 32768; //! Hack, see scfuncs.src + pDesc->nHelpId = GetNum() + 32768; //! Hack, see scfuncs.src pDesc->nArgCount = GetNum(); USHORT nArgs = pDesc->nArgCount; if (nArgs >= VAR_ARGS) @@ -1201,22 +1201,22 @@ USHORT ScFuncRes::GetNum() class ScResourcePublisher : public Resource { private: - void FreeResource() { Resource::FreeResource(); } + void FreeResource() { Resource::FreeResource(); } public: ScResourcePublisher( const ScResId& rId ) : Resource( rId ) {} ~ScResourcePublisher() { FreeResource(); } - BOOL IsAvailableRes( const ResId& rId ) const + BOOL IsAvailableRes( const ResId& rId ) const { return Resource::IsAvailableRes( rId ); } - + }; ScFunctionList::ScFunctionList() : - nMaxFuncNameLen ( 0 ) + nMaxFuncNameLen ( 0 ) { - ScFuncDesc* pDesc = NULL; - xub_StrLen nStrLen = 0; - FuncCollection* pFuncColl; + ScFuncDesc* pDesc = NULL; + xub_StrLen nStrLen = 0; + FuncCollection* pFuncColl; USHORT i,j; USHORT nDescBlock[] = { @@ -1262,7 +1262,7 @@ ScFunctionList::ScFunctionList() : } } - USHORT nNextId = SC_OPCODE_LAST_OPCODE_ID + 1; // FuncID for AddIn functions + USHORT nNextId = SC_OPCODE_LAST_OPCODE_ID + 1; // FuncID for AddIn functions // Auswertung AddIn-Liste String aDefArgNameValue(RTL_CONSTASCII_STRINGPARAM("value")); @@ -1285,7 +1285,7 @@ ScFunctionList::ScFunctionList() : FuncData *pAddInFuncData = (FuncData*)pFuncColl->At(i); USHORT nArgs = pAddInFuncData->GetParamCount() - 1; pAddInFuncData->GetParamDesc( aArgName, aArgDesc, 0 ); - pDesc->nFIndex = nNextId++; // ??? OpCode vergeben + pDesc->nFIndex = nNextId++; // ??? OpCode vergeben pDesc->nCategory = ID_FUNCTION_GRP_ADDINS; pDesc->pFuncName = new String(pAddInFuncData->GetInternalName()); pDesc->pFuncName->ToUpperAscii(); @@ -1359,7 +1359,7 @@ ScFunctionList::ScFunctionList() : } } } -// pDesc->nHelpId = 0; +// pDesc->nHelpId = 0; aFunctionList.Insert(pDesc, LIST_APPEND); nStrLen = (*(pDesc->pFuncName)).Len(); @@ -1367,7 +1367,7 @@ ScFunctionList::ScFunctionList() : nMaxFuncNameLen = nStrLen; } - // StarOne AddIns + // StarOne AddIns ScUnoAddInCollection* pUnoAddIns = ScGlobal::GetAddInCollection(); long nUnoCount = pUnoAddIns->GetFuncCount(); @@ -1564,7 +1564,7 @@ String ScFuncDesc::GetSignature() const aFormula.appendAscii( "(" ); ::std::vector< ::rtl::OUString >::const_iterator aIter = _aArguments.begin(); ::std::vector< ::rtl::OUString >::const_iterator aEnd = _aArguments.end(); - + if ( nArgCount > 0 && aIter != aEnd ) { BOOL bLastArg = ( aIter->getLength() == 0 ); @@ -1619,12 +1619,12 @@ USHORT ScFuncDesc::GetSuppressedArgCount() const return sRet; } // ----------------------------------------------------------------------------- -const formula::IFunctionCategory* ScFuncDesc::getCategory() const +const formula::IFunctionCategory* ScFuncDesc::getCategory() const { return ScGlobal::GetStarCalcFunctionMgr()->getCategory(nCategory); } // ----------------------------------------------------------------------------- -::rtl::OUString ScFuncDesc::getDescription() const +::rtl::OUString ScFuncDesc::getDescription() const { ::rtl::OUString sRet; if ( pFuncDesc ) @@ -1633,13 +1633,13 @@ const formula::IFunctionCategory* ScFuncDesc::getCategory() const } // ----------------------------------------------------------------------------- // GetSuppressedArgCount -xub_StrLen ScFuncDesc::getSuppressedArgumentCount() const +xub_StrLen ScFuncDesc::getSuppressedArgumentCount() const { return GetSuppressedArgCount(); } // ----------------------------------------------------------------------------- -// -void ScFuncDesc::fillVisibleArgumentMapping(::std::vector<USHORT>& _rArguments) const +// +void ScFuncDesc::fillVisibleArgumentMapping(::std::vector<USHORT>& _rArguments) const { if (!bHasSuppressedArgs || !pDefArgFlags) { @@ -1684,34 +1684,34 @@ void ScFuncDesc::initArgumentInfo() const } } // ----------------------------------------------------------------------------- -::rtl::OUString ScFuncDesc::getSignature() const +::rtl::OUString ScFuncDesc::getSignature() const { return GetSignature(); } // ----------------------------------------------------------------------------- -long ScFuncDesc::getHelpId() const +long ScFuncDesc::getHelpId() const { return nHelpId; } // ----------------------------------------------------------------------------- // parameter -sal_uInt32 ScFuncDesc::getParameterCount() const +sal_uInt32 ScFuncDesc::getParameterCount() const { return nArgCount; } // ----------------------------------------------------------------------------- -::rtl::OUString ScFuncDesc::getParameterName(sal_uInt32 _nPos) const +::rtl::OUString ScFuncDesc::getParameterName(sal_uInt32 _nPos) const { return *(ppDefArgNames[_nPos]); } // ----------------------------------------------------------------------------- -::rtl::OUString ScFuncDesc::getParameterDescription(sal_uInt32 _nPos) const +::rtl::OUString ScFuncDesc::getParameterDescription(sal_uInt32 _nPos) const { return *(ppDefArgDescs[_nPos]); } // ----------------------------------------------------------------------------- -bool ScFuncDesc::isParameterOptional(sal_uInt32 _nPos) const +bool ScFuncDesc::isParameterOptional(sal_uInt32 _nPos) const { return pDefArgFlags[_nPos].bOptional; } @@ -1720,19 +1720,19 @@ bool ScFuncDesc::isParameterOptional(sal_uInt32 _nPos) const // class ScFunctionMgr: ScFunctionMgr::ScFunctionMgr() - : pFuncList ( ScGlobal::GetStarCalcFunctionList() ), - pCurCatList ( NULL ) + : pFuncList ( ScGlobal::GetStarCalcFunctionList() ), + pCurCatList ( NULL ) { DBG_ASSERT( pFuncList, "Funktionsliste nicht gefunden." ); - ULONG nCount = pFuncList->GetCount(); - const ScFuncDesc* pDesc; - List* pRootList; - ULONG n; + ULONG nCount = pFuncList->GetCount(); + const ScFuncDesc* pDesc; + List* pRootList; + ULONG n; - for ( USHORT i=0; i<MAX_FUNCCAT; i++ ) // Kategorie-Listen erstellen + for ( USHORT i=0; i<MAX_FUNCCAT; i++ ) // Kategorie-Listen erstellen aCatLists[i] = new List; - pRootList = aCatLists[0]; // Gesamtliste ("Alle") erstellen + pRootList = aCatLists[0]; // Gesamtliste ("Alle") erstellen CollatorWrapper* pCaseCollator = ScGlobal::GetCaseCollator(); for ( n=0; n<nCount; n++ ) { @@ -1742,14 +1742,14 @@ ScFunctionMgr::ScFunctionMgr() { // ist zwar case-sensitiv, aber Umlaute muessen richtig einsortiert werden - const ScFuncDesc* pTmpDesc = (const ScFuncDesc*)pRootList->GetObject(nTmpCnt); + const ScFuncDesc* pTmpDesc = (const ScFuncDesc*)pRootList->GetObject(nTmpCnt); if ( pCaseCollator->compareString(*pDesc->pFuncName, *pTmpDesc->pFuncName ) == COMPARE_LESS ) break; } - pRootList->Insert((void*)pDesc, nTmpCnt); // Einsortieren + pRootList->Insert((void*)pDesc, nTmpCnt); // Einsortieren } - for ( n=0; n<nCount; n++ ) // in Gruppenlisten kopieren + for ( n=0; n<nCount; n++ ) // in Gruppenlisten kopieren { pDesc = (const ScFuncDesc*)pRootList->GetObject(n); DBG_ASSERT((pDesc->nCategory) < MAX_FUNCCAT, "Unbekannte Kategorie"); @@ -1771,7 +1771,7 @@ ScFunctionMgr::~ScFunctionMgr() const ScFuncDesc* ScFunctionMgr::Get( const String& rFName ) const { - const ScFuncDesc* pDesc = NULL; + const ScFuncDesc* pDesc = NULL; if (rFName.Len() <= pFuncList->GetMaxFuncNameLen()) for (pDesc = First(0); pDesc; pDesc = Next()) if (rFName.EqualsIgnoreCaseAscii(*(pDesc->pFuncName))) @@ -1783,7 +1783,7 @@ const ScFuncDesc* ScFunctionMgr::Get( const String& rFName ) const const ScFuncDesc* ScFunctionMgr::Get( USHORT nFIndex ) const { - const ScFuncDesc* pDesc; + const ScFuncDesc* pDesc; for (pDesc = First(0); pDesc; pDesc = Next()) if (pDesc->nFIndex == nFIndex) break; @@ -1792,7 +1792,7 @@ const ScFuncDesc* ScFunctionMgr::Get( USHORT nFIndex ) const //------------------------------------------------------------------------ -const ScFuncDesc* ScFunctionMgr::First( USHORT nCategory ) const +const ScFuncDesc* ScFunctionMgr::First( USHORT nCategory ) const { DBG_ASSERT( nCategory < MAX_FUNCCAT, "Unbekannte Kategorie" ); @@ -1842,7 +1842,7 @@ void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const formula:: const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions(); USHORT nLRUFuncCount = Min( rAppOpt.GetLRUFuncListCount(), (USHORT)LRU_MAX ); - USHORT* pLRUListIds = rAppOpt.GetLRUFuncList(); + USHORT* pLRUListIds = rAppOpt.GetLRUFuncList(); if ( pLRUListIds ) { @@ -1899,7 +1899,7 @@ const formula::IFunctionManager* ScFunctionCategory::getFunctionManager() const // ----------------------------------------------------------------------------- const formula::IFunctionDescription* ScFunctionCategory::getFunction(sal_uInt32 _nPos) const { - const ScFuncDesc* pDesc = NULL; + const ScFuncDesc* pDesc = NULL; sal_uInt32 i = 0; for (pDesc = (const ScFuncDesc*)m_pCategory->First(); i < _nPos && pDesc; pDesc = (const ScFuncDesc*)m_pCategory->Next(),++i) ; @@ -1945,7 +1945,7 @@ CalendarWrapper* ScGlobal::GetCalendar() } return pCalendar; } -CollatorWrapper* ScGlobal::GetCollator() +CollatorWrapper* ScGlobal::GetCollator() { if ( !pCollator ) { @@ -1954,7 +1954,7 @@ CollatorWrapper* ScGlobal::GetCollator() } // if ( !pCollator ) return pCollator; } -CollatorWrapper* ScGlobal::GetCaseCollator() +CollatorWrapper* ScGlobal::GetCaseCollator() { if ( !pCaseCollator ) { @@ -1981,7 +1981,7 @@ IntlWrapper* ScGlobal::GetScIntlWrapper() } return pScIntlWrapper; } -::com::sun::star::lang::Locale* ScGlobal::GetLocale() +::com::sun::star::lang::Locale* ScGlobal::GetLocale() { if ( !pLocale ) { diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx index 3234340ae9dd..55fa221afb0b 100644 --- a/sc/source/core/data/global2.cxx +++ b/sc/source/core/data/global2.cxx @@ -1,7 +1,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 @@ -80,16 +80,16 @@ ScImportParam::ScImportParam() : } ScImportParam::ScImportParam( const ScImportParam& r ) : - nCol1 (r.nCol1), - nRow1 (r.nRow1), - nCol2 (r.nCol2), - nRow2 (r.nRow2), - bImport (r.bImport), - aDBName (r.aDBName), - aStatement (r.aStatement), - bNative (r.bNative), - bSql (r.bSql), - nType (r.nType) + nCol1 (r.nCol1), + nRow1 (r.nRow1), + nCol2 (r.nCol2), + nRow2 (r.nRow2), + bImport (r.bImport), + aDBName (r.aDBName), + aStatement (r.aStatement), + bNative (r.bNative), + bSql (r.bSql), + nType (r.nType) { } @@ -111,34 +111,34 @@ ScImportParam::~ScImportParam() ScImportParam& ScImportParam::operator=( const ScImportParam& r ) { - nCol1 = r.nCol1; - nRow1 = r.nRow1; - nCol2 = r.nCol2; - nRow2 = r.nRow2; - bImport = r.bImport; - aDBName = r.aDBName; - aStatement = r.aStatement; - bNative = r.bNative; - bSql = r.bSql; - nType = r.nType; + nCol1 = r.nCol1; + nRow1 = r.nRow1; + nCol2 = r.nCol2; + nRow2 = r.nRow2; + bImport = r.bImport; + aDBName = r.aDBName; + aStatement = r.aStatement; + bNative = r.bNative; + bSql = r.bSql; + nType = r.nType; return *this; } BOOL ScImportParam::operator==( const ScImportParam& rOther ) const { - return( nCol1 == rOther.nCol1 && - nRow1 == rOther.nRow1 && - nCol2 == rOther.nCol2 && - nRow2 == rOther.nRow2 && - bImport == rOther.bImport && - aDBName == rOther.aDBName && - aStatement == rOther.aStatement && - bNative == rOther.bNative && - bSql == rOther.bSql && - nType == rOther.nType ); + return( nCol1 == rOther.nCol1 && + nRow1 == rOther.nRow1 && + nCol2 == rOther.nCol2 && + nRow2 == rOther.nRow2 && + bImport == rOther.bImport && + aDBName == rOther.aDBName && + aStatement == rOther.aStatement && + bNative == rOther.bNative && + bSql == rOther.bSql && + nType == rOther.nType ); - //! nQuerySh und pConnection sind gleich ? + //! nQuerySh und pConnection sind gleich ? } @@ -185,54 +185,54 @@ ScQueryEntry::~ScQueryEntry() ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r ) { - bDoQuery = r.bDoQuery; - bQueryByString = r.bQueryByString; + bDoQuery = r.bDoQuery; + bQueryByString = r.bQueryByString; bQueryByDate = r.bQueryByDate; - eOp = r.eOp; - eConnect = r.eConnect; - nField = r.nField; - nVal = r.nVal; - *pStr = *r.pStr; + eOp = r.eOp; + eConnect = r.eConnect; + nField = r.nField; + nVal = r.nVal; + *pStr = *r.pStr; if ( pSearchParam ) { delete pSearchParam; delete pSearchText; } - pSearchParam = NULL; - pSearchText = NULL; + pSearchParam = NULL; + pSearchText = NULL; return *this; } void ScQueryEntry::Clear() { - bDoQuery = FALSE; - bQueryByString = FALSE; + bDoQuery = FALSE; + bQueryByString = FALSE; bQueryByDate = false; - eOp = SC_EQUAL; - eConnect = SC_AND; - nField = 0; - nVal = 0.0; + eOp = SC_EQUAL; + eConnect = SC_AND; + nField = 0; + nVal = 0.0; pStr->Erase(); if ( pSearchParam ) { delete pSearchParam; delete pSearchText; } - pSearchParam = NULL; - pSearchText = NULL; + pSearchParam = NULL; + pSearchText = NULL; } BOOL ScQueryEntry::operator==( const ScQueryEntry& r ) const { - return bDoQuery == r.bDoQuery - && bQueryByString == r.bQueryByString + return bDoQuery == r.bDoQuery + && bQueryByString == r.bQueryByString && bQueryByDate == r.bQueryByDate - && eOp == r.eOp - && eConnect == r.eConnect - && nField == r.nField - && nVal == r.nVal - && *pStr == *r.pStr; + && eOp == r.eOp + && eConnect == r.eConnect + && nField == r.nField + && nVal == r.nVal + && *pStr == *r.pStr; //! pSearchParam und pSearchText nicht vergleichen } @@ -272,14 +272,14 @@ ScSubTotalParam::ScSubTotalParam( const ScSubTotalParam& r ) : { for (USHORT i=0; i<MAXSUBTOTAL; i++) { - bGroupActive[i] = r.bGroupActive[i]; - nField[i] = r.nField[i]; + bGroupActive[i] = r.bGroupActive[i]; + nField[i] = r.nField[i]; if ( (r.nSubTotals[i] > 0) && r.pSubTotals[i] && r.pFunctions[i] ) { nSubTotals[i] = r.nSubTotals[i]; - pSubTotals[i] = new SCCOL [r.nSubTotals[i]]; - pFunctions[i] = new ScSubTotalFunc [r.nSubTotals[i]]; + pSubTotals[i] = new SCCOL [r.nSubTotals[i]]; + pFunctions[i] = new ScSubTotalFunc [r.nSubTotals[i]]; for (SCCOL j=0; j<r.nSubTotals[i]; j++) { @@ -308,8 +308,8 @@ void ScSubTotalParam::Clear() for (USHORT i=0; i<MAXSUBTOTAL; i++) { - bGroupActive[i] = FALSE; - nField[i] = 0; + bGroupActive[i] = FALSE; + nField[i] = 0; if ( (nSubTotals[i] > 0) && pSubTotals[i] && pFunctions[i] ) { @@ -325,33 +325,33 @@ void ScSubTotalParam::Clear() ScSubTotalParam& ScSubTotalParam::operator=( const ScSubTotalParam& r ) { - nCol1 = r.nCol1; - nRow1 = r.nRow1; - nCol2 = r.nCol2; - nRow2 = r.nRow2; - bRemoveOnly = r.bRemoveOnly; - bReplace = r.bReplace; - bPagebreak = r.bPagebreak; - bCaseSens = r.bCaseSens; - bDoSort = r.bDoSort; - bAscending = r.bAscending; - bUserDef = r.bUserDef; - nUserIndex = r.nUserIndex; - bIncludePattern = r.bIncludePattern; + nCol1 = r.nCol1; + nRow1 = r.nRow1; + nCol2 = r.nCol2; + nRow2 = r.nRow2; + bRemoveOnly = r.bRemoveOnly; + bReplace = r.bReplace; + bPagebreak = r.bPagebreak; + bCaseSens = r.bCaseSens; + bDoSort = r.bDoSort; + bAscending = r.bAscending; + bUserDef = r.bUserDef; + nUserIndex = r.nUserIndex; + bIncludePattern = r.bIncludePattern; for (USHORT i=0; i<MAXSUBTOTAL; i++) { - bGroupActive[i] = r.bGroupActive[i]; - nField[i] = r.nField[i]; - nSubTotals[i] = r.nSubTotals[i]; + bGroupActive[i] = r.bGroupActive[i]; + nField[i] = r.nField[i]; + nSubTotals[i] = r.nSubTotals[i]; if ( pSubTotals[i] ) delete [] pSubTotals[i]; if ( pFunctions[i] ) delete [] pFunctions[i]; if ( r.nSubTotals[i] > 0 ) { - pSubTotals[i] = new SCCOL [r.nSubTotals[i]]; - pFunctions[i] = new ScSubTotalFunc [r.nSubTotals[i]]; + pSubTotals[i] = new SCCOL [r.nSubTotals[i]]; + pFunctions[i] = new ScSubTotalFunc [r.nSubTotals[i]]; for (SCCOL j=0; j<r.nSubTotals[i]; j++) { @@ -374,18 +374,18 @@ ScSubTotalParam& ScSubTotalParam::operator=( const ScSubTotalParam& r ) BOOL ScSubTotalParam::operator==( const ScSubTotalParam& rOther ) const { - BOOL bEqual = (nCol1 == rOther.nCol1) - && (nRow1 == rOther.nRow1) - && (nCol2 == rOther.nCol2) - && (nRow2 == rOther.nRow2) - && (bRemoveOnly == rOther.bRemoveOnly) - && (bReplace == rOther.bReplace) - && (bPagebreak == rOther.bPagebreak) - && (bDoSort == rOther.bDoSort) - && (bCaseSens == rOther.bCaseSens) - && (bAscending == rOther.bAscending) - && (bUserDef == rOther.bUserDef) - && (nUserIndex == rOther.nUserIndex) + BOOL bEqual = (nCol1 == rOther.nCol1) + && (nRow1 == rOther.nRow1) + && (nCol2 == rOther.nCol2) + && (nRow2 == rOther.nRow2) + && (bRemoveOnly == rOther.bRemoveOnly) + && (bReplace == rOther.bReplace) + && (bPagebreak == rOther.bPagebreak) + && (bDoSort == rOther.bDoSort) + && (bCaseSens == rOther.bCaseSens) + && (bAscending == rOther.bAscending) + && (bUserDef == rOther.bUserDef) + && (nUserIndex == rOther.nUserIndex) && (bIncludePattern== rOther.bIncludePattern); if ( bEqual ) @@ -393,9 +393,9 @@ BOOL ScSubTotalParam::operator==( const ScSubTotalParam& rOther ) const bEqual = TRUE; for ( USHORT i=0; i<MAXSUBTOTAL && bEqual; i++ ) { - bEqual = (bGroupActive[i] == rOther.bGroupActive[i]) - && (nField[i] == rOther.nField[i]) - && (nSubTotals[i] == rOther.nSubTotals[i]); + bEqual = (bGroupActive[i] == rOther.bGroupActive[i]) + && (nField[i] == rOther.nField[i]) + && (nSubTotals[i] == rOther.nSubTotals[i]); if ( bEqual && (nSubTotals[i] > 0) ) { @@ -416,10 +416,10 @@ BOOL ScSubTotalParam::operator==( const ScSubTotalParam& rOther ) const //------------------------------------------------------------------------ -void ScSubTotalParam::SetSubTotals( USHORT nGroup, - const SCCOL* ptrSubTotals, - const ScSubTotalFunc* ptrFunctions, - USHORT nCount ) +void ScSubTotalParam::SetSubTotals( USHORT nGroup, + const SCCOL* ptrSubTotals, + const ScSubTotalFunc* ptrFunctions, + USHORT nCount ) { DBG_ASSERT( (nGroup <= MAXSUBTOTAL), "ScSubTotalParam::SetSubTotals(): nGroup > MAXSUBTOTAL!" ); @@ -439,8 +439,8 @@ void ScSubTotalParam::SetSubTotals( USHORT nGroup, delete [] pSubTotals[nGroup]; delete [] pFunctions[nGroup]; - pSubTotals[nGroup] = new SCCOL [nCount]; - pFunctions[nGroup] = new ScSubTotalFunc [nCount]; + pSubTotals[nGroup] = new SCCOL [nCount]; + pFunctions[nGroup] = new ScSubTotalFunc [nCount]; nSubTotals[nGroup] = static_cast<SCCOL>(nCount); for ( USHORT i=0; i<nCount; i++ ) @@ -507,21 +507,21 @@ void __EXPORT ScConsolidateParam::Clear() nCol = 0; nRow = 0; nTab = 0; - bByCol = bByRow = bReferenceData = FALSE; - eFunction = SUBTOTAL_FUNC_SUM; + bByCol = bByRow = bReferenceData = FALSE; + eFunction = SUBTOTAL_FUNC_SUM; } //------------------------------------------------------------------------ ScConsolidateParam& __EXPORT ScConsolidateParam::operator=( const ScConsolidateParam& r ) { - nCol = r.nCol; - nRow = r.nRow; - nTab = r.nTab; - bByCol = r.bByCol; - bByRow = r.bByRow; - bReferenceData = r.bReferenceData; - eFunction = r.eFunction; + nCol = r.nCol; + nRow = r.nRow; + nTab = r.nTab; + bByCol = r.bByCol; + bByRow = r.bByRow; + bReferenceData = r.bReferenceData; + eFunction = r.eFunction; SetAreas( r.ppDataAreas, r.nDataAreaCount ); return *this; @@ -531,14 +531,14 @@ ScConsolidateParam& __EXPORT ScConsolidateParam::operator=( const ScConsolidateP BOOL __EXPORT ScConsolidateParam::operator==( const ScConsolidateParam& r ) const { - BOOL bEqual = (nCol == r.nCol) - && (nRow == r.nRow) - && (nTab == r.nTab) - && (bByCol == r.bByCol) - && (bByRow == r.bByRow) - && (bReferenceData == r.bReferenceData) - && (nDataAreaCount == r.nDataAreaCount) - && (eFunction == r.eFunction); + BOOL bEqual = (nCol == r.nCol) + && (nRow == r.nRow) + && (nTab == r.nTab) + && (bByCol == r.bByCol) + && (bByRow == r.bByRow) + && (bReferenceData == r.bReferenceData) + && (nDataAreaCount == r.nDataAreaCount) + && (eFunction == r.eFunction); if ( nDataAreaCount == 0 ) bEqual = bEqual && (ppDataAreas == NULL) && (r.ppDataAreas == NULL); @@ -590,7 +590,7 @@ bool PivotField::operator==( const PivotField& r ) const // struct ScPivotParam: ScPivotParam::ScPivotParam() - : nCol(0), nRow(0), nTab(0), + : nCol(0), nRow(0), nTab(0), nPageCount(0), nColCount(0), nRowCount(0), nDataCount(0), bIgnoreEmptyRows(FALSE), bDetectCategories(FALSE), bMakeTotalCol(TRUE), bMakeTotalRow(TRUE) @@ -600,7 +600,7 @@ ScPivotParam::ScPivotParam() //------------------------------------------------------------------------ ScPivotParam::ScPivotParam( const ScPivotParam& r ) - : nCol( r.nCol ), nRow( r.nRow ), nTab( r.nTab ), + : nCol( r.nCol ), nRow( r.nRow ), nTab( r.nTab ), nPageCount(0), nColCount(0), nRowCount(0), nDataCount(0), bIgnoreEmptyRows(r.bIgnoreEmptyRows), bDetectCategories(r.bDetectCategories), @@ -661,25 +661,25 @@ void ScPivotParam::SetLabelData(const vector<ScDPLabelDataRef>& r) void __EXPORT ScPivotParam::SetPivotArrays ( const PivotField* pPageArr, const PivotField* pColArr, - const PivotField* pRowArr, - const PivotField* pDataArr, + const PivotField* pRowArr, + const PivotField* pDataArr, SCSIZE nPageCnt, - SCSIZE nColCnt, - SCSIZE nRowCnt, - SCSIZE nDataCnt ) + SCSIZE nColCnt, + SCSIZE nRowCnt, + SCSIZE nDataCnt ) { ClearPivotArrays(); if ( pPageArr && pColArr && pRowArr && pDataArr ) { nPageCount = (nPageCnt>PIVOT_MAXPAGEFIELD) ? PIVOT_MAXPAGEFIELD : nPageCnt; - nColCount = (nColCnt>PIVOT_MAXFIELD) ? PIVOT_MAXFIELD : nColCnt; - nRowCount = (nRowCnt>PIVOT_MAXFIELD) ? PIVOT_MAXFIELD : nRowCnt; - nDataCount = (nDataCnt>PIVOT_MAXFIELD) ? PIVOT_MAXFIELD : nDataCnt; + nColCount = (nColCnt>PIVOT_MAXFIELD) ? PIVOT_MAXFIELD : nColCnt; + nRowCount = (nRowCnt>PIVOT_MAXFIELD) ? PIVOT_MAXFIELD : nRowCnt; + nDataCount = (nDataCnt>PIVOT_MAXFIELD) ? PIVOT_MAXFIELD : nDataCnt; memcpy( aPageArr, pPageArr, nPageCount * sizeof(PivotField) ); - memcpy( aColArr, pColArr, nColCount * sizeof(PivotField) ); - memcpy( aRowArr, pRowArr, nRowCount * sizeof(PivotField) ); + memcpy( aColArr, pColArr, nColCount * sizeof(PivotField) ); + memcpy( aRowArr, pRowArr, nRowCount * sizeof(PivotField) ); memcpy( aDataArr, pDataArr, nDataCount * sizeof(PivotField) ); } } @@ -688,13 +688,13 @@ void __EXPORT ScPivotParam::SetPivotArrays ( const PivotField* pPageArr, ScPivotParam& __EXPORT ScPivotParam::operator=( const ScPivotParam& r ) { - nCol = r.nCol; - nRow = r.nRow; - nTab = r.nTab; + nCol = r.nCol; + nRow = r.nRow; + nTab = r.nTab; bIgnoreEmptyRows = r.bIgnoreEmptyRows; bDetectCategories = r.bDetectCategories; - bMakeTotalCol = r.bMakeTotalCol; - bMakeTotalRow = r.bMakeTotalRow; + bMakeTotalCol = r.bMakeTotalCol; + bMakeTotalRow = r.bMakeTotalRow; SetPivotArrays ( r.aPageArr, r.aColArr, r.aRowArr, r.aDataArr, r.nPageCount, r.nColCount, r.nRowCount, r.nDataCount ); @@ -706,18 +706,18 @@ ScPivotParam& __EXPORT ScPivotParam::operator=( const ScPivotParam& r ) BOOL __EXPORT ScPivotParam::operator==( const ScPivotParam& r ) const { - BOOL bEqual = (nCol == r.nCol) - && (nRow == r.nRow) - && (nTab == r.nTab) + BOOL bEqual = (nCol == r.nCol) + && (nRow == r.nRow) + && (nTab == r.nTab) && (bIgnoreEmptyRows == r.bIgnoreEmptyRows) && (bDetectCategories == r.bDetectCategories) && (bMakeTotalCol == r.bMakeTotalCol) && (bMakeTotalRow == r.bMakeTotalRow) && (maLabelArray.size() == r.maLabelArray.size()) && (nPageCount == r.nPageCount) - && (nColCount == r.nColCount) - && (nRowCount == r.nRowCount) - && (nDataCount == r.nDataCount); + && (nColCount == r.nColCount) + && (nRowCount == r.nRowCount) + && (nDataCount == r.nDataCount); if ( bEqual ) { @@ -743,16 +743,16 @@ BOOL __EXPORT ScPivotParam::operator==( const ScPivotParam& r ) const // struct ScSolveParam ScSolveParam::ScSolveParam() - : pStrTargetVal( NULL ) + : pStrTargetVal( NULL ) { } //------------------------------------------------------------------------ ScSolveParam::ScSolveParam( const ScSolveParam& r ) - : aRefFormulaCell ( r.aRefFormulaCell ), + : aRefFormulaCell ( r.aRefFormulaCell ), aRefVariableCell( r.aRefVariableCell ), - pStrTargetVal ( r.pStrTargetVal + pStrTargetVal ( r.pStrTargetVal ? new String(*r.pStrTargetVal) : NULL ) { @@ -762,10 +762,10 @@ ScSolveParam::ScSolveParam( const ScSolveParam& r ) ScSolveParam::ScSolveParam( const ScAddress& rFormulaCell, const ScAddress& rVariableCell, - const String& rTargetValStr ) - : aRefFormulaCell ( rFormulaCell ), + const String& rTargetValStr ) + : aRefFormulaCell ( rFormulaCell ), aRefVariableCell( rVariableCell ), - pStrTargetVal ( new String(rTargetValStr) ) + pStrTargetVal ( new String(rTargetValStr) ) { } @@ -794,8 +794,8 @@ ScSolveParam& __EXPORT ScSolveParam::operator=( const ScSolveParam& r ) BOOL ScSolveParam::operator==( const ScSolveParam& r ) const { - BOOL bEqual = (aRefFormulaCell == r.aRefFormulaCell) - && (aRefVariableCell == r.aRefVariableCell); + BOOL bEqual = (aRefFormulaCell == r.aRefFormulaCell) + && (aRefVariableCell == r.aRefVariableCell); if ( bEqual ) { @@ -815,11 +815,11 @@ BOOL ScSolveParam::operator==( const ScSolveParam& r ) const // struct ScTabOpParam ScTabOpParam::ScTabOpParam( const ScTabOpParam& r ) - : aRefFormulaCell ( r.aRefFormulaCell ), - aRefFormulaEnd ( r.aRefFormulaEnd ), - aRefRowCell ( r.aRefRowCell ), - aRefColCell ( r.aRefColCell ), - nMode ( r.nMode ) + : aRefFormulaCell ( r.aRefFormulaCell ), + aRefFormulaEnd ( r.aRefFormulaEnd ), + aRefRowCell ( r.aRefRowCell ), + aRefColCell ( r.aRefColCell ), + nMode ( r.nMode ) { } @@ -829,12 +829,12 @@ ScTabOpParam::ScTabOpParam( const ScRefAddress& rFormulaCell, const ScRefAddress& rFormulaEnd, const ScRefAddress& rRowCell, const ScRefAddress& rColCell, - BYTE nMd) - : aRefFormulaCell ( rFormulaCell ), - aRefFormulaEnd ( rFormulaEnd ), - aRefRowCell ( rRowCell ), - aRefColCell ( rColCell ), - nMode ( nMd ) + BYTE nMd) + : aRefFormulaCell ( rFormulaCell ), + aRefFormulaEnd ( rFormulaEnd ), + aRefRowCell ( rRowCell ), + aRefColCell ( rColCell ), + nMode ( nMd ) { } @@ -844,9 +844,9 @@ ScTabOpParam& ScTabOpParam::operator=( const ScTabOpParam& r ) { aRefFormulaCell = r.aRefFormulaCell; aRefFormulaEnd = r.aRefFormulaEnd; - aRefRowCell = r.aRefRowCell; - aRefColCell = r.aRefColCell; - nMode = r.nMode; + aRefRowCell = r.aRefRowCell; + aRefColCell = r.aRefColCell; + nMode = r.nMode; return *this; } @@ -854,11 +854,11 @@ ScTabOpParam& ScTabOpParam::operator=( const ScTabOpParam& r ) BOOL __EXPORT ScTabOpParam::operator==( const ScTabOpParam& r ) const { - return ( (aRefFormulaCell == r.aRefFormulaCell) - && (aRefFormulaEnd == r.aRefFormulaEnd) - && (aRefRowCell == r.aRefRowCell) - && (aRefColCell == r.aRefColCell) - && (nMode == r.nMode) ); + return ( (aRefFormulaCell == r.aRefFormulaCell) + && (aRefFormulaEnd == r.aRefFormulaEnd) + && (aRefRowCell == r.aRefRowCell) + && (aRefColCell == r.aRefColCell) + && (nMode == r.nMode) ); } String ScGlobal::GetAbsDocName( const String& rFileName, @@ -866,14 +866,14 @@ String ScGlobal::GetAbsDocName( const String& rFileName, { String aAbsName; if ( !pShell->HasName() ) - { // maybe relative to document path working directory + { // maybe relative to document path working directory INetURLObject aObj; SvtPathOptions aPathOpt; aObj.SetSmartURL( aPathOpt.GetWorkPath() ); - aObj.setFinalSlash(); // it IS a path + aObj.setFinalSlash(); // it IS a path bool bWasAbs = true; aAbsName = aObj.smartRel2Abs( rFileName, bWasAbs ).GetMainURL(INetURLObject::NO_DECODE); - // returned string must be encoded because it's used directly to create SfxMedium + // returned string must be encoded because it's used directly to create SfxMedium } else { @@ -884,7 +884,7 @@ String ScGlobal::GetAbsDocName( const String& rFileName, aAbsName = pMedium->GetURLObject().smartRel2Abs( rFileName, bWasAbs ).GetMainURL(INetURLObject::NO_DECODE); } else - { // This can't happen, but ... + { // This can't happen, but ... // just to be sure to have the same encoding INetURLObject aObj; aObj.SetSmartURL( aAbsName ); @@ -903,13 +903,13 @@ String ScGlobal::GetDocTabName( const String& rFileName, xub_StrLen nPos = 1; while( (nPos = aDocTab.Search( '\'', nPos )) != STRING_NOTFOUND ) - { // escape Quotes + { // escape Quotes aDocTab.Insert( '\\', nPos ); nPos += 2; } aDocTab += '\''; aDocTab += SC_COMPILER_FILE_TAB_SEP; - aDocTab += rTabName; // "'Doc'#Tab" + aDocTab += rTabName; // "'Doc'#Tab" return aDocTab; } diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx index 2accdadeb781..f1a1c8e6736c 100644 --- a/sc/source/core/data/globalx.cxx +++ b/sc/source/core/data/globalx.cxx @@ -1,7 +1,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 @@ -70,8 +70,8 @@ void ScGlobal::InitAddIns() String aPath( aMultiPath.GetToken( 0, ';', nIndex ) ); if ( aPath.Len() > 0 ) { - // use LocalFileHelper to convert the path to a URL that always points - // to the file on the server + // use LocalFileHelper to convert the path to a URL that always points + // to the file on the server String aUrl; if ( utl::LocalFileHelper::ConvertPhysicalNameToURL( aPath, aUrl ) ) aPath = aUrl; diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx index aeca394437cd..dba34fc05990 100644 --- a/sc/source/core/data/markarr.cxx +++ b/sc/source/core/data/markarr.cxx @@ -1,7 +1,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 @@ -76,12 +76,12 @@ void ScMarkArray::Reset( BOOL bMarked ) BOOL ScMarkArray::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); + 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 ) @@ -248,7 +248,7 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, BOOL bMarked ) } } } -// InfoBox(0, String(nCount) + String(" Eintraege") ).Execute(); +// InfoBox(0, String(nCount) + String(" Eintraege") ).Execute(); } //UNUSED2009-05 void ScMarkArray::DeleteArea(SCROW nStartRow, SCROW nEndRow) @@ -372,7 +372,7 @@ SCROW ScMarkArray::GetMarkEnd( SCROW nRow, BOOL bUp ) const } // -// -------------- Iterator ---------------------------------------------- +// -------------- Iterator ---------------------------------------------- // ScMarkArrayIter::ScMarkArrayIter( const ScMarkArray* pNewArray ) : diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index 4401ac19d199..63d226af97a3 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -1,7 +1,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 @@ -56,10 +56,10 @@ ScMarkData::ScMarkData(const ScMarkData& rData) : aMultiRange( rData.aMultiRange ), pMultiSel( NULL ) { - bMarked = rData.bMarked; + bMarked = rData.bMarked; bMultiMarked = rData.bMultiMarked; - bMarking = rData.bMarking; - bMarkIsNeg = rData.bMarkIsNeg; + bMarking = rData.bMarking; + bMarkIsNeg = rData.bMarkIsNeg; for (SCTAB i=0; i<=MAXTAB; i++) bTabMarked[i] = rData.bTabMarked[i]; @@ -72,7 +72,7 @@ ScMarkData::ScMarkData(const ScMarkData& rData) : } } -ScMarkData& ScMarkData::operator=(const ScMarkData& rData) +ScMarkData& ScMarkData::operator=(const ScMarkData& rData) { if ( &rData == this ) return *this; @@ -80,12 +80,12 @@ ScMarkData& ScMarkData::operator=(const ScMarkData& rData) delete[] pMultiSel; pMultiSel = NULL; - aMarkRange = rData.aMarkRange; + aMarkRange = rData.aMarkRange; aMultiRange = rData.aMultiRange; - bMarked = rData.bMarked; + bMarked = rData.bMarked; bMultiMarked = rData.bMultiMarked; - bMarking = rData.bMarking; - bMarkIsNeg = rData.bMarkIsNeg; + bMarking = rData.bMarking; + bMarkIsNeg = rData.bMarkIsNeg; for (SCTAB i=0; i<=MAXTAB; i++) bTabMarked[i] = rData.bTabMarked[i]; @@ -131,7 +131,7 @@ void ScMarkData::SetMarkArea( const ScRange& rRange ) void ScMarkData::GetMarkArea( ScRange& rRange ) const { - rRange = aMarkRange; //! inline ? + rRange = aMarkRange; //! inline ? } void ScMarkData::GetMultiMarkArea( ScRange& rRange ) const @@ -164,7 +164,7 @@ void ScMarkData::SetMultiMarkArea( const ScRange& rRange, BOOL bMark ) for (nCol=nStartCol; nCol<=nEndCol; nCol++) pMultiSel[nCol].SetMarkArea( nStartRow, nEndRow, bMark ); - if ( bMultiMarked ) // aMultiRange updaten + if ( bMultiMarked ) // aMultiRange updaten { if ( nStartCol < aMultiRange.aStart.Col() ) aMultiRange.aStart.SetCol( nStartCol ); @@ -177,7 +177,7 @@ void ScMarkData::SetMultiMarkArea( const ScRange& rRange, BOOL bMark ) } else { - aMultiRange = rRange; // neu + aMultiRange = rRange; // neu bMultiMarked = TRUE; } } @@ -223,7 +223,7 @@ void ScMarkData::MarkToMulti() SetMultiMarkArea( aMarkRange, !bMarkIsNeg ); bMarked = FALSE; - // check if all multi mark ranges have been removed + // check if all multi mark ranges have been removed if ( bMarkIsNeg && !HasAnyMultiMarks() ) ResetMark(); } @@ -235,7 +235,7 @@ void ScMarkData::MarkToSimple() return; if ( bMultiMarked && bMarked ) - MarkToMulti(); // may result in bMarked and bMultiMarked reset + MarkToMulti(); // may result in bMarked and bMultiMarked reset if ( bMultiMarked ) { @@ -252,7 +252,7 @@ void ScMarkData::MarkToSimple() while ( nStartCol < nEndCol && !pMultiSel[nEndCol].HasMarks() ) --nEndCol; - // Zeilen werden nur aus MarkArray genommen + // Zeilen werden nur aus MarkArray genommen SCROW nStartRow, nEndRow; if ( pMultiSel[nStartCol].HasOneMark( nStartRow, nEndRow ) ) { @@ -288,7 +288,7 @@ BOOL ScMarkData::IsCellMarked( SCCOL nCol, SCROW nRow, BOOL bNoSimple ) const if (bMultiMarked) { - //! hier auf negative Markierung testen ? + //! hier auf negative Markierung testen ? DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); return pMultiSel[nCol].GetMark( nRow ); @@ -299,12 +299,12 @@ BOOL ScMarkData::IsCellMarked( SCCOL nCol, SCROW nRow, BOOL bNoSimple ) const BOOL ScMarkData::IsColumnMarked( SCCOL nCol ) const { - // bMarkIsNeg inzwischen auch fuer Spaltenkoepfe - //! GetMarkColumnRanges fuer komplett markierte Spalten + // bMarkIsNeg inzwischen auch fuer Spaltenkoepfe + //! GetMarkColumnRanges fuer komplett markierte Spalten if ( bMarked && !bMarkIsNeg && aMarkRange.aStart.Col() <= nCol && aMarkRange.aEnd.Col() >= nCol && - aMarkRange.aStart.Row() == 0 && aMarkRange.aEnd.Row() == MAXROW ) + aMarkRange.aStart.Row() == 0 && aMarkRange.aEnd.Row() == MAXROW ) return TRUE; if ( bMultiMarked && pMultiSel[nCol].IsAllMarked(0,MAXROW) ) @@ -315,11 +315,11 @@ BOOL ScMarkData::IsColumnMarked( SCCOL nCol ) const BOOL ScMarkData::IsRowMarked( SCROW nRow ) const { - // bMarkIsNeg inzwischen auch fuer Zeilenkoepfe - //! GetMarkRowRanges fuer komplett markierte Zeilen + // bMarkIsNeg inzwischen auch fuer Zeilenkoepfe + //! GetMarkRowRanges fuer komplett markierte Zeilen if ( bMarked && !bMarkIsNeg && - aMarkRange.aStart.Col() == 0 && aMarkRange.aEnd.Col() == MAXCOL && + aMarkRange.aStart.Col() == 0 && aMarkRange.aEnd.Col() == MAXCOL && aMarkRange.aStart.Row() <= nRow && aMarkRange.aEnd.Row() >= nRow ) return TRUE; @@ -340,7 +340,7 @@ void ScMarkData::MarkFromRangeList( const ScRangeList& rList, BOOL bReset ) if (bReset) { for (SCTAB i=0; i<=MAXTAB; i++) - bTabMarked[i] = FALSE; // Tabellen sind nicht in ResetMark + bTabMarked[i] = FALSE; // Tabellen sind nicht in ResetMark ResetMark(); } @@ -370,7 +370,7 @@ void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, BOOL bClear ) const if (bClear) pList->RemoveAll(); - //! bei mehreren selektierten Tabellen mehrere Ranges eintragen !!! + //! bei mehreren selektierten Tabellen mehrere Ranges eintragen !!! if ( bMultiMarked ) { @@ -405,7 +405,7 @@ void ScMarkData::ExtendRangeListTables( ScRangeList* pList ) const return; ScRangeList aOldList(*pList); - pList->RemoveAll(); //! oder die vorhandenen unten weglassen + pList->RemoveAll(); //! oder die vorhandenen unten weglassen for (SCTAB nTab=0; nTab<=MAXTAB; nTab++) if (bTabMarked[nTab]) @@ -585,7 +585,7 @@ BOOL ScMarkData::HasAnyMultiMarks() const if ( pMultiSel[nCol].HasMarks() ) return TRUE; - return FALSE; // nix + return FALSE; // nix } void ScMarkData::InsertTab( SCTAB nTab ) diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx index af444c4b2123..9c52b02fdaae 100644 --- a/sc/source/core/data/olinetab.cxx +++ b/sc/source/core/data/olinetab.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/core/data/pagepar.cxx b/sc/source/core/data/pagepar.cxx index 318f5c19501b..94a9d01b45d8 100644 --- a/sc/source/core/data/pagepar.cxx +++ b/sc/source/core/data/pagepar.cxx @@ -1,7 +1,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 @@ -60,8 +60,8 @@ void ScPageTableParam::Reset() bCellContent = TRUE; bNotes=bGrid=bHeaders=bDrawings= bLeftRight=bScaleAll=bScaleTo=bScalePageNum= - bFormulas=bNullVals=bSkipEmpty = FALSE; - bTopDown=bScaleNone=bCharts=bObjects = TRUE; + bFormulas=bNullVals=bSkipEmpty = FALSE; + bTopDown=bScaleNone=bCharts=bObjects = TRUE; nScaleAll = 100; nScalePageNum = nScaleWidth = nScaleHeight = 0; nFirstPageNo = 1; @@ -104,19 +104,19 @@ void ScPageAreaParam::Reset() BOOL ScPageAreaParam::operator==( const ScPageAreaParam& r ) const { BOOL bEqual = - bPrintArea == r.bPrintArea - && bRepeatRow == r.bRepeatRow - && bRepeatCol == r.bRepeatCol; + bPrintArea == r.bPrintArea + && bRepeatRow == r.bRepeatRow + && bRepeatCol == r.bRepeatCol; if ( bEqual ) if ( bPrintArea ) - bEqual = bEqual && ( aPrintArea == r.aPrintArea ); + bEqual = bEqual && ( aPrintArea == r.aPrintArea ); if ( bEqual ) if ( bRepeatRow ) - bEqual = bEqual && ( aRepeatRow == r.aRepeatRow ); + bEqual = bEqual && ( aRepeatRow == r.aRepeatRow ); if ( bEqual ) if ( bRepeatCol ) - bEqual = bEqual && ( aRepeatCol == r.aRepeatCol ); + bEqual = bEqual && ( aRepeatCol == r.aRepeatCol ); return bEqual; } diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index b66aea63dd05..7b6309366cbc 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -1,7 +1,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 @@ -80,38 +80,38 @@ ScDocument* ScPatternAttr::pDoc = NULL; // ----------------------------------------------------------------------- -//! move to some header file -inline long TwipsToHMM(long nTwips) { return (nTwips * 127 + 36) / 72; } -inline long HMMToTwips(long nHMM) { return (nHMM * 72 + 63) / 127; } +//! move to some header file +inline long TwipsToHMM(long nTwips) { return (nTwips * 127 + 36) / 72; } +inline long HMMToTwips(long nHMM) { return (nHMM * 72 + 63) / 127; } // ----------------------------------------------------------------------- ScPatternAttr::ScPatternAttr( SfxItemSet* pItemSet, const String& rStyleName ) - : SfxSetItem ( ATTR_PATTERN, pItemSet ), - pName ( new String( rStyleName ) ), - pStyle ( NULL ) + : SfxSetItem ( ATTR_PATTERN, pItemSet ), + pName ( new String( rStyleName ) ), + pStyle ( NULL ) { } ScPatternAttr::ScPatternAttr( SfxItemSet* pItemSet, ScStyleSheet* pStyleSheet ) - : SfxSetItem ( ATTR_PATTERN, pItemSet ), - pName ( NULL ), - pStyle ( pStyleSheet ) + : SfxSetItem ( ATTR_PATTERN, pItemSet ), + pName ( NULL ), + pStyle ( pStyleSheet ) { if ( pStyleSheet ) GetItemSet().SetParent( &pStyleSheet->GetItemSet() ); } ScPatternAttr::ScPatternAttr( SfxItemPool* pItemPool ) - : SfxSetItem ( ATTR_PATTERN, new SfxItemSet( *pItemPool, ATTR_PATTERN_START, ATTR_PATTERN_END ) ), - pName ( NULL ), - pStyle ( NULL ) + : SfxSetItem ( ATTR_PATTERN, new SfxItemSet( *pItemPool, ATTR_PATTERN_START, ATTR_PATTERN_END ) ), + pName ( NULL ), + pStyle ( NULL ) { } ScPatternAttr::ScPatternAttr( const ScPatternAttr& rPatternAttr ) - : SfxSetItem ( rPatternAttr ), - pStyle ( rPatternAttr.pStyle ) + : SfxSetItem ( rPatternAttr ), + pStyle ( rPatternAttr.pStyle ) { if (rPatternAttr.pName) pName = new String(*rPatternAttr.pName); @@ -165,8 +165,8 @@ int __EXPORT ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const SfxPoolItem* __EXPORT ScPatternAttr::Create( SvStream& rStream, USHORT /* nVersion */ ) const { String* pStr; - BOOL bHasStyle; - short eFamDummy; + BOOL bHasStyle; + short eFamDummy; rStream >> bHasStyle; @@ -196,7 +196,7 @@ SvStream& __EXPORT ScPatternAttr::Store(SvStream& rStream, USHORT /* nItemVersio if ( pStyle ) rStream.WriteByteString( pStyle->GetName(), rStream.GetStreamCharSet() ); - else if ( pName ) // wenn Style geloescht ist/war + else if ( pName ) // wenn Style geloescht ist/war rStream.WriteByteString( *pName, rStream.GetStreamCharSet() ); else rStream.WriteByteString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), @@ -240,7 +240,7 @@ void ScPatternAttr::GetFont( const SfxItemSet* pCondSet, BYTE nScript, const Color* pBackConfigColor, const Color* pTextConfigColor ) { - // Items auslesen + // Items auslesen const SvxFontItem* pFontAttr; UINT32 nFontHeight; @@ -376,9 +376,9 @@ void ScPatternAttr::GetFont( } DBG_ASSERT(pFontAttr,"nanu?"); - // auswerten + // auswerten - // FontItem: + // FontItem: if (rFont.GetName() != pFontAttr->GetFamilyName()) rFont.SetName( pFontAttr->GetFamilyName() ); @@ -391,7 +391,7 @@ void ScPatternAttr::GetFont( rFont.SetLanguage(eLang); - // Groesse + // Groesse if ( pOutDev != NULL ) { @@ -418,7 +418,7 @@ void ScPatternAttr::GetFont( rFont.SetSize( Size( 0, (long) nFontHeight ) ); } - // determine effective font color + // determine effective font color if ( ( aColor.GetColor() == COL_AUTO && eAutoMode != SC_AUTOCOL_RAW ) || eAutoMode == SC_AUTOCOL_IGNOREFONT || eAutoMode == SC_AUTOCOL_IGNOREALL ) @@ -427,7 +427,7 @@ void ScPatternAttr::GetFont( aColor.SetColor( COL_BLACK ); else { - // get background color from conditional or own set + // get background color from conditional or own set Color aBackColor; if ( pCondSet ) { @@ -439,7 +439,7 @@ void ScPatternAttr::GetFont( else aBackColor = ((const SvxBrushItem&)rItemSet.Get( ATTR_BACKGROUND )).GetColor(); - // if background color attribute is transparent, use window color for brightness comparisons + // if background color attribute is transparent, use window color for brightness comparisons if ( aBackColor == COL_TRANSPARENT || eAutoMode == SC_AUTOCOL_IGNOREBACK || eAutoMode == SC_AUTOCOL_IGNOREALL ) { @@ -454,7 +454,7 @@ void ScPatternAttr::GetFont( aBackColor.SetColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor ); } - // get system text color for comparison + // get system text color for comparison Color aSysTextColor; if ( eAutoMode == SC_AUTOCOL_PRINT ) aSysTextColor.SetColor( COL_BLACK ); @@ -466,26 +466,26 @@ void ScPatternAttr::GetFont( else aSysTextColor.SetColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor ); - // select the resulting color + // select the resulting color if ( aBackColor.IsDark() && aSysTextColor.IsDark() ) { - // use white instead of dark on dark + // use white instead of dark on dark aColor.SetColor( COL_WHITE ); } else if ( aBackColor.IsBright() && aSysTextColor.IsBright() ) { - // use black instead of bright on bright + // use black instead of bright on bright aColor.SetColor( COL_BLACK ); } else { - // use aSysTextColor (black for SC_AUTOCOL_PRINT, from style settings otherwise) + // use aSysTextColor (black for SC_AUTOCOL_PRINT, from style settings otherwise) aColor = aSysTextColor; } } } - // set font effects + // set font effects rFont.SetWeight( eWeight ); rFont.SetItalic( eItalic ); rFont.SetUnderline( eUnder ); @@ -512,29 +512,29 @@ void ScPatternAttr::GetFont( void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& rSrcSet, const SfxItemSet* pCondSet ) { - // Items auslesen - - SvxColorItem aColorItem(EE_CHAR_COLOR); // use item as-is - SvxFontItem aFontItem(EE_CHAR_FONTINFO); // use item as-is - SvxFontItem aCjkFontItem(EE_CHAR_FONTINFO_CJK); - SvxFontItem aCtlFontItem(EE_CHAR_FONTINFO_CTL); - long nTHeight, nCjkTHeight, nCtlTHeight; // Twips - FontWeight eWeight, eCjkWeight, eCtlWeight; + // Items auslesen + + SvxColorItem aColorItem(EE_CHAR_COLOR); // use item as-is + SvxFontItem aFontItem(EE_CHAR_FONTINFO); // use item as-is + SvxFontItem aCjkFontItem(EE_CHAR_FONTINFO_CJK); + SvxFontItem aCtlFontItem(EE_CHAR_FONTINFO_CTL); + long nTHeight, nCjkTHeight, nCtlTHeight; // Twips + FontWeight eWeight, eCjkWeight, eCtlWeight; SvxUnderlineItem aUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE); SvxOverlineItem aOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE); - BOOL bWordLine; - FontStrikeout eStrike; - FontItalic eItalic, eCjkItalic, eCtlItalic; - BOOL bOutline; - BOOL bShadow; - BOOL bForbidden; + BOOL bWordLine; + FontStrikeout eStrike; + FontItalic eItalic, eCjkItalic, eCtlItalic; + BOOL bOutline; + BOOL bShadow; + BOOL bForbidden; FontEmphasisMark eEmphasis; - FontRelief eRelief; - LanguageType eLang, eCjkLang, eCtlLang; - BOOL bHyphenate; + FontRelief eRelief; + LanguageType eLang, eCjkLang, eCtlLang; + BOOL bHyphenate; SvxFrameDirection eDirection; - //! additional parameter to control if language is needed? + //! additional parameter to control if language is needed? if ( pCondSet ) { @@ -637,7 +637,7 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r pItem = &rSrcSet.Get( ATTR_WRITINGDIR ); eDirection = (SvxFrameDirection)((const SvxFrameDirectionItem*)pItem)->GetValue(); } - else // alles direkt aus Pattern + else // alles direkt aus Pattern { aColorItem = (const SvxColorItem&) rSrcSet.Get( ATTR_FONT_COLOR ); aFontItem = (const SvxFontItem&) rSrcSet.Get( ATTR_FONT ); @@ -695,15 +695,15 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r long nCjkHeight = TwipsToHMM(nCjkTHeight); long nCtlHeight = TwipsToHMM(nCtlTHeight); - // put items into EditEngine ItemSet + // put items into EditEngine ItemSet if ( aColorItem.GetValue().GetColor() == COL_AUTO ) { - // #108979# When cell attributes are converted to EditEngine paragraph attributes, - // don't create a hard item for automatic color, because that would be converted - // to black when the item's Store method is used in CreateTransferable/WriteBin. - // COL_AUTO is the EditEngine's pool default, so ClearItem will result in automatic - // color, too, without having to store the item. + // #108979# When cell attributes are converted to EditEngine paragraph attributes, + // don't create a hard item for automatic color, because that would be converted + // to black when the item's Store method is used in CreateTransferable/WriteBin. + // COL_AUTO is the EditEngine's pool default, so ClearItem will result in automatic + // color, too, without having to store the item. rEditSet.ClearItem( EE_CHAR_COLOR ); } else @@ -869,8 +869,8 @@ void ScPatternAttr::GetFromEditItemSet( const SfxItemSet* pEditSet ) void ScPatternAttr::FillEditParaItems( SfxItemSet* pEditSet ) const { - // in GetFromEditItemSet schon dabei, in FillEditItemSet aber nicht - // Hor. Ausrichtung Standard wird immer als "links" umgesetzt + // in GetFromEditItemSet schon dabei, in FillEditItemSet aber nicht + // Hor. Ausrichtung Standard wird immer als "links" umgesetzt const SfxItemSet& rMySet = GetItemSet(); @@ -880,10 +880,10 @@ void ScPatternAttr::FillEditParaItems( SfxItemSet* pEditSet ) const SvxAdjust eSvxAdjust; switch (eHorJust) { - case SVX_HOR_JUSTIFY_RIGHT: eSvxAdjust = SVX_ADJUST_RIGHT; break; + case SVX_HOR_JUSTIFY_RIGHT: eSvxAdjust = SVX_ADJUST_RIGHT; break; case SVX_HOR_JUSTIFY_CENTER: eSvxAdjust = SVX_ADJUST_CENTER; break; - case SVX_HOR_JUSTIFY_BLOCK: eSvxAdjust = SVX_ADJUST_BLOCK; break; - default: eSvxAdjust = SVX_ADJUST_LEFT; break; + case SVX_HOR_JUSTIFY_BLOCK: eSvxAdjust = SVX_ADJUST_BLOCK; break; + default: eSvxAdjust = SVX_ADJUST_LEFT; break; } pEditSet->Put( SvxAdjustItem( eSvxAdjust, EE_PARA_JUST ) ); } @@ -898,19 +898,19 @@ void ScPatternAttr::DeleteUnchanged( const ScPatternAttr* pOldAttrs ) for ( USHORT nSubWhich=ATTR_PATTERN_START; nSubWhich<=ATTR_PATTERN_END; nSubWhich++ ) { - // only items that are set are interesting + // only items that are set are interesting if ( rThisSet.GetItemState( nSubWhich, FALSE, &pThisItem ) == SFX_ITEM_SET ) { SfxItemState eOldState = rOldSet.GetItemState( nSubWhich, TRUE, &pOldItem ); if ( eOldState == SFX_ITEM_SET ) { - // item is set in OldAttrs (or its parent) -> compare pointers + // item is set in OldAttrs (or its parent) -> compare pointers if ( pThisItem == pOldItem ) rThisSet.ClearItem( nSubWhich ); } else if ( eOldState != SFX_ITEM_DONTCARE ) { - // not set in OldAttrs -> compare item value to default item + // not set in OldAttrs -> compare item value to default item if ( *pThisItem == rThisSet.GetPool()->GetDefaultItem( nSubWhich ) ) rThisSet.ClearItem( nSubWhich ); } @@ -936,9 +936,9 @@ void ScPatternAttr::ClearItems( const USHORT* pWhich ) SfxStyleSheetBase* lcl_CopyStyleToPool ( - SfxStyleSheetBase* pSrcStyle, - SfxStyleSheetBasePool* pSrcPool, - SfxStyleSheetBasePool* pDestPool, + SfxStyleSheetBase* pSrcStyle, + SfxStyleSheetBasePool* pSrcPool, + SfxStyleSheetBasePool* pDestPool, const SvNumberFormatterIndexTable* pFormatExchangeList ) { @@ -950,9 +950,9 @@ SfxStyleSheetBase* lcl_CopyStyleToPool //-------------------------------------------------------- - const String aStrSrcStyle = pSrcStyle->GetName(); - const SfxStyleFamily eFamily = pSrcStyle->GetFamily(); - SfxStyleSheetBase* pDestStyle = pDestPool->Find( aStrSrcStyle, eFamily ); + const String aStrSrcStyle = pSrcStyle->GetName(); + const SfxStyleFamily eFamily = pSrcStyle->GetFamily(); + SfxStyleSheetBase* pDestStyle = pDestPool->Find( aStrSrcStyle, eFamily ); if ( !pDestStyle ) { @@ -1026,7 +1026,7 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD if ( nAttrId == ATTR_CONDITIONAL ) { - // Bedingte Formate ins neue Dokument kopieren + // Bedingte Formate ins neue Dokument kopieren ULONG nNewIndex = 0; ScConditionalFormatList* pSrcList = pSrcDoc->GetCondFormList(); @@ -1038,8 +1038,8 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD { nNewIndex = pDestDoc->AddCondFormat( *pOldData ); - // zugehoerige Styles auch mitkopieren - //! nur wenn Format bei Add neu angelegt + // zugehoerige Styles auch mitkopieren + //! nur wenn Format bei Add neu angelegt ScStyleSheetPool* pSrcSPool = pSrcDoc->GetStyleSheetPool(); ScStyleSheetPool* pDestSPool = pDestDoc->GetStyleSheetPool(); @@ -1058,7 +1058,7 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD } else if ( nAttrId == ATTR_VALIDDATA ) { - // Gueltigkeit ins neue Dokument kopieren + // Gueltigkeit ins neue Dokument kopieren ULONG nNewIndex = 0; ScValidationDataList* pSrcList = pSrcDoc->GetValidationList(); @@ -1073,7 +1073,7 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD } else if ( nAttrId == ATTR_VALUE_FORMAT && pDestDoc->GetFormatExchangeList() ) { - // Zahlformate nach Exchange-Liste + // Zahlformate nach Exchange-Liste ULONG nOldFormat = ((const SfxUInt32Item*)pSrcItem)->GetValue(); sal_uInt32* pNewFormat = static_cast<sal_uInt32*>(pDestDoc->GetFormatExchangeList()->Get(nOldFormat)); @@ -1154,7 +1154,7 @@ BOOL ScPatternAttr::IsVisibleEqual( const ScPatternAttr& rOther ) const OneEqual( rThisSet, rOtherSet, ATTR_BORDER_BLTR ) && OneEqual( rThisSet, rOtherSet, ATTR_SHADOW ); - //! auch hier nur wirklich sichtbare Werte testen !!! + //! auch hier nur wirklich sichtbare Werte testen !!! } const String* ScPatternAttr::GetStyleName() const @@ -1167,7 +1167,7 @@ void ScPatternAttr::SetStyleSheet( ScStyleSheet* pNewStyle ) { if (pNewStyle) { - SfxItemSet& rPatternSet = GetItemSet(); + SfxItemSet& rPatternSet = GetItemSet(); const SfxItemSet& rStyleSet = pNewStyle->GetItemSet(); for (USHORT i=ATTR_PATTERN_START; i<=ATTR_PATTERN_END; i++) @@ -1193,9 +1193,9 @@ void ScPatternAttr::UpdateStyleSheet() { pStyle = (ScStyleSheet*)pDoc->GetStyleSheetPool()->Find(*pName, SFX_STYLE_FAMILY_PARA); - // wenn Style nicht gefunden, Standard nehmen, - // damit keine leere Anzeige im Toolbox-Controller - //! es wird vorausgesetzt, dass "Standard" immer der erste Eintrag ist! + // wenn Style nicht gefunden, Standard nehmen, + // damit keine leere Anzeige im Toolbox-Controller + //! es wird vorausgesetzt, dass "Standard" immer der erste Eintrag ist! if (!pStyle) { SfxStyleSheetIterator* pIter = pDoc->GetStyleSheetPool()->CreateIterator( @@ -1257,13 +1257,13 @@ ULONG ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter ) const LanguageType eLang = ((SvxLanguageItem*)&GetItemSet().Get( ATTR_LANGUAGE_FORMAT ))->GetLanguage(); if ( nFormat < SV_COUNTRY_LANGUAGE_OFFSET && eLang == LANGUAGE_SYSTEM ) - ; // es bleibt wie es ist + ; // es bleibt wie es ist else if ( pFormatter ) nFormat = pFormatter->GetFormatForLanguageIfBuiltIn( nFormat, eLang ); return nFormat; } -// dasselbe, wenn bedingte Formatierung im Spiel ist: +// dasselbe, wenn bedingte Formatierung im Spiel ist: ULONG ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter, const SfxItemSet* pCondSet ) const @@ -1296,7 +1296,7 @@ const SfxPoolItem& ScPatternAttr::GetItem( USHORT nSubWhich, const SfxItemSet* p return GetItem( nSubWhich, GetItemSet(), pCondSet ); } -// GetRotateVal testet vorher ATTR_ORIENTATION +// GetRotateVal testet vorher ATTR_ORIENTATION long ScPatternAttr::GetRotateVal( const SfxItemSet* pCondSet ) const { @@ -1328,7 +1328,7 @@ BYTE ScPatternAttr::GetRotateDir( const SfxItemSet* pCondSet ) const nRet = SC_ROTDIR_CENTER; else if ( eRotMode == SVX_ROTATE_MODE_TOP || eRotMode == SVX_ROTATE_MODE_BOTTOM ) { - long nRot180 = nAttrRotate % 18000; // 1/100 Grad + long nRot180 = nAttrRotate % 18000; // 1/100 Grad if ( nRot180 == 9000 ) nRet = SC_ROTDIR_CENTER; else if ( ( eRotMode == SVX_ROTATE_MODE_TOP && nRot180 < 9000 ) || diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx index 5a6174bc0129..66bfd3b86c11 100644 --- a/sc/source/core/data/pivot2.cxx +++ b/sc/source/core/data/pivot2.cxx @@ -1,7 +1,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 @@ -52,7 +52,7 @@ #include "userlist.hxx" #include "pivot.hxx" #include "rechead.hxx" -#include "formula/errorcodes.hxx" // fuer errNoValue +#include "formula/errorcodes.hxx" // fuer errNoValue #include "refupdat.hxx" #include "stlpool.hxx" #include "stlsheet.hxx" diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx index 010cc502798b..fda341f7d12c 100644 --- a/sc/source/core/data/poolhelp.cxx +++ b/sc/source/core/data/poolhelp.cxx @@ -1,7 +1,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 @@ -42,7 +42,7 @@ // ----------------------------------------------------------------------- -ScPoolHelper::ScPoolHelper( ScDocument* pSourceDoc ) +ScPoolHelper::ScPoolHelper( ScDocument* pSourceDoc ) :pFormTable(NULL) ,pEditPool(NULL) ,pEnginePool(NULL) @@ -63,18 +63,18 @@ ScPoolHelper::~ScPoolHelper() mxStylePool.clear(); SfxItemPool::Free(pDocPool); } -SfxItemPool* ScPoolHelper::GetEditPool() const +SfxItemPool* ScPoolHelper::GetEditPool() const { if ( !pEditPool ) { pEditPool = EditEngine::CreatePool(); pEditPool->SetDefaultMetric( SFX_MAPUNIT_100TH_MM ); pEditPool->FreezeIdRanges(); - pEditPool->SetFileFormatVersion( SOFFICE_FILEFORMAT_50 ); // used in ScGlobal::EETextObjEqual + pEditPool->SetFileFormatVersion( SOFFICE_FILEFORMAT_50 ); // used in ScGlobal::EETextObjEqual } return pEditPool; } -SfxItemPool* ScPoolHelper::GetEnginePool() const +SfxItemPool* ScPoolHelper::GetEnginePool() const { if ( !pEnginePool ) { @@ -84,7 +84,7 @@ SfxItemPool* ScPoolHelper::GetEnginePool() const } // ifg ( pEnginePool ) return pEnginePool; } -SvNumberFormatter* ScPoolHelper::GetFormTable() const +SvNumberFormatter* ScPoolHelper::GetFormTable() const { if ( !pFormTable ) { @@ -117,7 +117,7 @@ void ScPoolHelper::SetFormTableOpt(const ScDocOptions& rOpt) void ScPoolHelper::SourceDocumentGone() { - // reset all pointers to the source document + // reset all pointers to the source document mxStylePool->SetDocument( NULL ); if ( pFormTable ) pFormTable->SetColorLink( Link() ); diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index a4bc9a473768..79f9e0714c41 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/core/data/scdpoutputimpl.cxx b/sc/source/core/data/scdpoutputimpl.cxx index 6a667806e097..b780768b9d32 100644 --- a/sc/source/core/data/scdpoutputimpl.cxx +++ b/sc/source/core/data/scdpoutputimpl.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright IBM Corporation 2009. * Copyright 2009 by Sun Microsystems, Inc. * @@ -49,16 +49,16 @@ void OutputImpl::OutputDataArea() AddRow( mnDataStartRow ); AddCol( mnDataStartCol ); - mnCols.push_back( mnTabEndCol+1); //set last row bottom + mnCols.push_back( mnTabEndCol+1); //set last row bottom mnRows.push_back( mnTabEndRow+1); //set last col bottom - + BOOL bAllRows = ( ( mnTabEndRow - mnDataStartRow + 2 ) == (SCROW) mnRows.size() ); - + std::sort( mnCols.begin(), mnCols.end(), lcl_compareColfuc ); std::sort( mnRows.begin(), mnRows.end(), lcl_compareRowfuc ); - + for( SCCOL nCol = 0; nCol < (SCCOL)mnCols.size()-1; nCol ++ ) - { + { if ( !bAllRows ) { if ( nCol < (SCCOL)mnCols.size()-2) @@ -66,7 +66,7 @@ void OutputImpl::OutputDataArea() for ( SCROW i = nCol%2; i < (SCROW)mnRows.size()-2; i +=2 ) OutputBlockFrame( mnCols[nCol], mnRows[i], mnCols[nCol+1]-1, mnRows[i+1]-1 ); if ( mnRows.size()>=2 ) - OutputBlockFrame( mnCols[nCol], mnRows[mnRows.size()-2], mnCols[nCol+1]-1, mnRows[mnRows.size()-1]-1 ); + OutputBlockFrame( mnCols[nCol], mnRows[mnRows.size()-2], mnCols[nCol+1]-1, mnRows[mnRows.size()-1]-1 ); } else { @@ -74,7 +74,7 @@ void OutputImpl::OutputDataArea() OutputBlockFrame( mnCols[nCol], mnRows[i], mnCols[nCol+1]-1, mnRows[i+1]-1 ); } } - else + else OutputBlockFrame( mnCols[nCol], mnRows.front(), mnCols[nCol+1]-1, mnRows.back()-1, bAllRows ); } //out put rows area outer framer @@ -88,14 +88,14 @@ void OutputImpl::OutputDataArea() OutputBlockFrame( mnDataStartCol, mnTabStartRow, mnTabEndCol, mnDataStartRow-1 ); } -OutputImpl::OutputImpl( ScDocument* pDoc, USHORT nTab, - SCCOL nTabStartCol, - SCROW nTabStartRow, - SCCOL nMemberStartCol, - SCROW nMemberStartRow, - SCCOL nDataStartCol, - SCROW nDataStartRow, - SCCOL nTabEndCol, +OutputImpl::OutputImpl( ScDocument* pDoc, USHORT nTab, + SCCOL nTabStartCol, + SCROW nTabStartRow, + SCCOL nMemberStartCol, + SCROW nMemberStartRow, + SCCOL nDataStartCol, + SCROW nDataStartRow, + SCCOL nTabEndCol, SCROW nTabEndRow ): mpDoc( pDoc ), mnTab( nTab ), @@ -104,13 +104,13 @@ OutputImpl::OutputImpl( ScDocument* pDoc, USHORT nTab, mnMemberStartCol( nMemberStartCol), mnMemberStartRow( nMemberStartRow), mnDataStartCol ( nDataStartCol ), - mnDataStartRow ( nDataStartRow ), + mnDataStartRow ( nDataStartRow ), mnTabEndCol( nTabEndCol ), mnTabEndRow( nTabEndRow ) { mbNeedLineCols.resize( nTabEndCol-nDataStartCol+1, false ); mbNeedLineRows.resize( nTabEndRow-nDataStartRow+1, false ); - + } BOOL OutputImpl::AddRow( SCROW nRow ) @@ -127,7 +127,7 @@ BOOL OutputImpl::AddRow( SCROW nRow ) BOOL OutputImpl::AddCol( SCCOL nCol ) { - + if ( !mbNeedLineCols[ nCol - mnDataStartCol ] ) { mbNeedLineCols[ nCol - mnDataStartCol ] = true; @@ -135,7 +135,7 @@ BOOL OutputImpl::AddCol( SCCOL nCol ) return TRUE; } else - return FALSE; + return FALSE; } void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, BOOL bHori ) @@ -146,7 +146,7 @@ void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEnd aLine.SetOutWidth( SC_DP_FRAME_INNER_BOLD ); aOutLine.SetColor( SC_DP_FRAME_COLOR ); aOutLine.SetOutWidth( SC_DP_FRAME_OUTER_BOLD ); - + SvxBoxItem aBox( ATTR_BORDER ); if ( nStartCol == mnTabStartCol ) @@ -158,18 +158,18 @@ void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEnd aBox.SetLine(&aOutLine, BOX_LINE_TOP); else aBox.SetLine(&aLine, BOX_LINE_TOP); - + if ( nEndCol == mnTabEndCol ) //bottom row aBox.SetLine(&aOutLine, BOX_LINE_RIGHT); - else + else aBox.SetLine(&aLine, BOX_LINE_RIGHT); - if ( nEndRow == mnTabEndRow ) //bottom + if ( nEndRow == mnTabEndRow ) //bottom aBox.SetLine(&aOutLine, BOX_LINE_BOTTOM); else aBox.SetLine(&aLine, BOX_LINE_BOTTOM); - + SvxBoxInfoItem aBoxInfo( ATTR_BORDER_INNER ); aBoxInfo.SetValid(VALID_VERT,FALSE ); if ( bHori ) diff --git a/sc/source/core/data/scdpoutputimpl.hxx b/sc/source/core/data/scdpoutputimpl.hxx index 9148fe91ba02..34f61ed9943a 100755 --- a/sc/source/core/data/scdpoutputimpl.hxx +++ b/sc/source/core/data/scdpoutputimpl.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright IBM Corporation 2009. * Copyright 2009 by Sun Microsystems, Inc. * @@ -33,47 +33,47 @@ #include "document.hxx" -#define SC_DP_FRAME_INNER_BOLD 20 -#define SC_DP_FRAME_OUTER_BOLD 40 +#define SC_DP_FRAME_INNER_BOLD 20 +#define SC_DP_FRAME_OUTER_BOLD 40 -#define SC_DP_FRAME_COLOR Color(0,0,0) //( 0x20, 0x40, 0x68 ) +#define SC_DP_FRAME_COLOR Color(0,0,0) //( 0x20, 0x40, 0x68 ) class OutputImpl { - ScDocument* mpDoc; - USHORT mnTab; + ScDocument* mpDoc; + USHORT mnTab; ::std::vector< bool > mbNeedLineCols; ::std::vector< SCCOL > mnCols; - + ::std::vector< bool > mbNeedLineRows; ::std::vector< SCROW > mnRows; - SCCOL mnTabStartCol; - SCROW mnTabStartRow; - SCCOL mnMemberStartCol; - SCROW mnMemberStartRow; - - SCCOL mnDataStartCol; - SCROW mnDataStartRow; - SCCOL mnTabEndCol; - SCROW mnTabEndRow; + SCCOL mnTabStartCol; + SCROW mnTabStartRow; + SCCOL mnMemberStartCol; + SCROW mnMemberStartRow; + + SCCOL mnDataStartCol; + SCROW mnDataStartRow; + SCCOL mnTabEndCol; + SCROW mnTabEndRow; public: - OutputImpl( ScDocument* pDoc, USHORT nTab, - SCCOL nTabStartCol, - SCROW nTabStartRow, - SCCOL nMemberStartCol, - SCROW nMemberStartRow, - SCCOL nDataStartCol, - SCROW nDataStartRow, - SCCOL nTabEndCol, + OutputImpl( ScDocument* pDoc, USHORT nTab, + SCCOL nTabStartCol, + SCROW nTabStartRow, + SCCOL nMemberStartCol, + SCROW nMemberStartRow, + SCCOL nDataStartCol, + SCROW nDataStartRow, + SCCOL nTabEndCol, SCROW nTabEndRow ); BOOL AddRow( SCROW nRow ); BOOL AddCol( SCCOL nCol ); - + void OutputDataArea(); void OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, BOOL bHori = FALSE ); - + }; -#endif +#endif diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx index 86b53582d1d4..d45c3a85662f 100644 --- a/sc/source/core/data/segmenttree.cxx +++ b/sc/source/core/data/segmenttree.cxx @@ -1,7 +1,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 @@ -136,7 +136,7 @@ typename ScFlatSegmentsImpl<_ValueType, _ExtValueType>::ValueType ScFlatSegments } template<typename _ValueType, typename _ExtValueType> -typename ScFlatSegmentsImpl<_ValueType, _ExtValueType>::ExtValueType +typename ScFlatSegmentsImpl<_ValueType, _ExtValueType>::ExtValueType ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getSumValue(SCCOLROW nPos1, SCCOLROW nPos2) { RangeData aData; @@ -208,7 +208,7 @@ SCCOLROW ScFlatSegmentsImpl<_ValueType, _ExtValueType>::findLastNotOf(ValueType { SCCOLROW nPos = numeric_limits<SCCOLROW>::max(); // position not found. typename fst_type::const_reverse_iterator itr = maSegments.rbegin(), itrEnd = maSegments.rend(); - // Note that when searching in reverse direction, we need to skip the first + // Note that when searching in reverse direction, we need to skip the first // node, since the right-most leaf node does not store a valid value. for (++itr; itr != itrEnd; ++itr) { @@ -300,7 +300,7 @@ bool ScFlatBoolRowSegments::ForwardIterator::getValue(SCROW nPos, bool& rVal) ScFlatBoolRowSegments::RangeData aData; if (!mrSegs.getRangeData(mnCurPos, aData)) return false; - + mbCurValue = aData.mbValue; mnLastPos = aData.mnRow2; } @@ -498,7 +498,7 @@ bool ScFlatUInt16RowSegments::ForwardIterator::getValue(SCROW nPos, sal_uInt16& ScFlatUInt16RowSegments::RangeData aData; if (!mrSegs.getRangeData(mnCurPos, aData)) return false; - + mnCurValue = aData.mnValue; mnLastPos = aData.mnRow2; } diff --git a/sc/source/core/data/sheetevents.cxx b/sc/source/core/data/sheetevents.cxx index e1875b5db15b..610a6ed8620c 100644 --- a/sc/source/core/data/sheetevents.cxx +++ b/sc/source/core/data/sheetevents.cxx @@ -131,7 +131,7 @@ const ScSheetEvents& ScSheetEvents::operator=(const ScSheetEvents& rOther) if (rOther.mpScriptNames[nEvent]) mpScriptNames[nEvent] = new rtl::OUString(*rOther.mpScriptNames[nEvent]); else - mpScriptNames[nEvent] = NULL; + mpScriptNames[nEvent] = NULL; } return *this; } diff --git a/sc/source/core/data/sortparam.cxx b/sc/source/core/data/sortparam.cxx index 9e8d355e74fa..dd3a9cdf4d11 100644 --- a/sc/source/core/data/sortparam.cxx +++ b/sc/source/core/data/sortparam.cxx @@ -1,7 +1,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 @@ -56,8 +56,8 @@ ScSortParam::ScSortParam( const ScSortParam& r ) : { for (USHORT i=0; i<MAXSORT; i++) { - bDoSort[i] = r.bDoSort[i]; - nField[i] = r.nField[i]; + bDoSort[i] = r.bDoSort[i]; + nField[i] = r.nField[i]; bAscending[i] = r.bAscending[i]; } } @@ -72,14 +72,14 @@ void ScSortParam::Clear() nDestTab = 0; nUserIndex = 0; bHasHeader=bCaseSens=bUserDef = FALSE; - bByRow=bIncludePattern=bInplace = TRUE; + bByRow=bIncludePattern=bInplace = TRUE; aCollatorLocale = ::com::sun::star::lang::Locale(); aCollatorAlgorithm.Erase(); for (USHORT i=0; i<MAXSORT; i++) { - bDoSort[i] = FALSE; - nField[i] = 0; + bDoSort[i] = FALSE; + nField[i] = 0; bAscending[i] = TRUE; } } @@ -88,27 +88,27 @@ void ScSortParam::Clear() ScSortParam& ScSortParam::operator=( const ScSortParam& r ) { - nCol1 = r.nCol1; - nRow1 = r.nRow1; - nCol2 = r.nCol2; - nRow2 = r.nRow2; - bHasHeader = r.bHasHeader; - bCaseSens = r.bCaseSens; - bByRow = r.bByRow; - bUserDef = r.bUserDef; - nUserIndex = r.nUserIndex; - bIncludePattern = r.bIncludePattern; - bInplace = r.bInplace; - nDestTab = r.nDestTab; - nDestCol = r.nDestCol; - nDestRow = r.nDestRow; - aCollatorLocale = r.aCollatorLocale; - aCollatorAlgorithm = r.aCollatorAlgorithm; + nCol1 = r.nCol1; + nRow1 = r.nRow1; + nCol2 = r.nCol2; + nRow2 = r.nRow2; + bHasHeader = r.bHasHeader; + bCaseSens = r.bCaseSens; + bByRow = r.bByRow; + bUserDef = r.bUserDef; + nUserIndex = r.nUserIndex; + bIncludePattern = r.bIncludePattern; + bInplace = r.bInplace; + nDestTab = r.nDestTab; + nDestCol = r.nDestCol; + nDestRow = r.nDestRow; + aCollatorLocale = r.aCollatorLocale; + aCollatorAlgorithm = r.aCollatorAlgorithm; for (USHORT i=0; i<MAXSORT; i++) { - bDoSort[i] = r.bDoSort[i]; - nField[i] = r.nField[i]; + bDoSort[i] = r.bDoSort[i]; + nField[i] = r.nField[i]; bAscending[i] = r.bAscending[i]; } @@ -121,37 +121,37 @@ BOOL ScSortParam::operator==( const ScSortParam& rOther ) const { BOOL bEqual = FALSE; // Anzahl der Sorts gleich? - USHORT nLast = 0; + USHORT nLast = 0; USHORT nOtherLast = 0; while ( bDoSort[nLast++] && nLast < MAXSORT ) ; while ( rOther.bDoSort[nOtherLast++] && nOtherLast < MAXSORT ) ; nLast--; nOtherLast--; - if ( (nLast == nOtherLast) - && (nCol1 == rOther.nCol1) - && (nRow1 == rOther.nRow1) - && (nCol2 == rOther.nCol2) - && (nRow2 == rOther.nRow2) - && (bHasHeader == rOther.bHasHeader) - && (bByRow == rOther.bByRow) - && (bCaseSens == rOther.bCaseSens) - && (bUserDef == rOther.bUserDef) - && (nUserIndex == rOther.nUserIndex) + if ( (nLast == nOtherLast) + && (nCol1 == rOther.nCol1) + && (nRow1 == rOther.nRow1) + && (nCol2 == rOther.nCol2) + && (nRow2 == rOther.nRow2) + && (bHasHeader == rOther.bHasHeader) + && (bByRow == rOther.bByRow) + && (bCaseSens == rOther.bCaseSens) + && (bUserDef == rOther.bUserDef) + && (nUserIndex == rOther.nUserIndex) && (bIncludePattern == rOther.bIncludePattern) - && (bInplace == rOther.bInplace) - && (nDestTab == rOther.nDestTab) - && (nDestCol == rOther.nDestCol) - && (nDestRow == rOther.nDestRow) - && (aCollatorLocale.Language == rOther.aCollatorLocale.Language) - && (aCollatorLocale.Country == rOther.aCollatorLocale.Country) - && (aCollatorLocale.Variant == rOther.aCollatorLocale.Variant) - && (aCollatorAlgorithm == rOther.aCollatorAlgorithm) + && (bInplace == rOther.bInplace) + && (nDestTab == rOther.nDestTab) + && (nDestCol == rOther.nDestCol) + && (nDestRow == rOther.nDestRow) + && (aCollatorLocale.Language == rOther.aCollatorLocale.Language) + && (aCollatorLocale.Country == rOther.aCollatorLocale.Country) + && (aCollatorLocale.Variant == rOther.aCollatorLocale.Variant) + && (aCollatorAlgorithm == rOther.aCollatorAlgorithm) ) { bEqual = TRUE; for ( USHORT i=0; i<=nLast && bEqual; i++ ) { - bEqual = (nField[i] == rOther.nField[i]) && (bAscending[i] == rOther.bAscending[i]); + bEqual = (nField[i] == rOther.nField[i]) && (bAscending[i] == rOther.bAscending[i]); } } return bEqual; @@ -170,21 +170,21 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld ) USHORT nNewCount = 0; USHORT i; - // zuerst die Gruppen aus den Teilergebnissen + // zuerst die Gruppen aus den Teilergebnissen if (rSub.bDoSort) for (i=0; i<MAXSUBTOTAL; i++) if (rSub.bGroupActive[i]) { if (nNewCount < MAXSORT) { - bDoSort[nNewCount] = TRUE; - nField[nNewCount] = rSub.nField[i]; + bDoSort[nNewCount] = TRUE; + nField[nNewCount] = rSub.nField[i]; bAscending[nNewCount] = rSub.bAscending; ++nNewCount; } } - // dann dahinter die alten Einstellungen + // dann dahinter die alten Einstellungen for (i=0; i<MAXSORT; i++) if (rOld.bDoSort[i]) { @@ -193,22 +193,22 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld ) for (USHORT j=0; j<nNewCount; j++) if ( nField[j] == nThisField ) bDouble = TRUE; - if (!bDouble) // ein Feld nicht zweimal eintragen + if (!bDouble) // ein Feld nicht zweimal eintragen { if (nNewCount < MAXSORT) { - bDoSort[nNewCount] = TRUE; - nField[nNewCount] = nThisField; + bDoSort[nNewCount] = TRUE; + nField[nNewCount] = nThisField; bAscending[nNewCount] = rOld.bAscending[i]; ++nNewCount; } } } - for (i=nNewCount; i<MAXSORT; i++) // Rest loeschen + for (i=nNewCount; i<MAXSORT; i++) // Rest loeschen { - bDoSort[i] = FALSE; - nField[i] = 0; + bDoSort[i] = FALSE; + nField[i] = 0; bAscending[i] = TRUE; } } @@ -228,8 +228,8 @@ ScSortParam::ScSortParam( const ScQueryParam& rParam, SCCOL nCol ) : bAscending[0] = TRUE; for (USHORT i=1; i<MAXSORT; i++) { - bDoSort[i] = FALSE; - nField[i] = 0; + bDoSort[i] = FALSE; + nField[i] = 0; bAscending[i] = TRUE; } } diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index d722856dc80a..863ff1c399f7 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -1,7 +1,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 @@ -69,7 +69,7 @@ //======================================================================== ScStyleSheetPool::ScStyleSheetPool( SfxItemPool& rPoolP, - ScDocument* pDocument ) + ScDocument* pDocument ) : SfxStyleSheetPool( rPoolP ), pActualStyleSheet( NULL ), pDoc( pDocument ), @@ -102,11 +102,11 @@ void ScStyleSheetPool::SetDocument( ScDocument* pDocument ) SfxStyleSheetBase& ScStyleSheetPool::Make( const String& rName, SfxStyleFamily eFam, USHORT mask, USHORT nPos ) { - // When updating styles from a template, Office 5.1 sometimes created - // files with multiple default styles. - // Create new styles in that case: + // When updating styles from a template, Office 5.1 sometimes created + // files with multiple default styles. + // Create new styles in that case: - //! only when loading? + //! only when loading? if ( rName.EqualsAscii(STRING_STANDARD) && Find( rName, eFam ) != NULL ) { @@ -127,8 +127,8 @@ SfxStyleSheetBase& ScStyleSheetPool::Make( const String& rName, //------------------------------------------------------------------------ SfxStyleSheetBase* __EXPORT ScStyleSheetPool::Create( - const String& rName, - SfxStyleFamily eFamily, + const String& rName, + SfxStyleFamily eFamily, USHORT nMaskP ) { ScStyleSheet* pSheet = new ScStyleSheet( rName, *this, eFamily, nMaskP ); @@ -165,7 +165,7 @@ void __EXPORT ScStyleSheetPool::Remove( SfxStyleSheetBase* pStyle ) void ScStyleSheetPool::CopyStyleFrom( ScStyleSheetPool* pSrcPool, const String& rName, SfxStyleFamily eFamily ) { - // this ist Dest-Pool + // this ist Dest-Pool SfxStyleSheetBase* pStyleSheet = pSrcPool->Find( rName, eFamily ); if (pStyleSheet) @@ -180,7 +180,7 @@ void ScStyleSheetPool::CopyStyleFrom( ScStyleSheetPool* pSrcPool, const SfxPoolItem* pItem; if ( eFamily == SFX_STYLE_FAMILY_PAGE ) { - // Set-Items + // Set-Items if ( rSourceSet.GetItemState( ATTR_PAGE_HEADERSET, FALSE, &pItem ) == SFX_ITEM_SET ) { @@ -215,23 +215,23 @@ void ScStyleSheetPool::CopyStyleFrom( ScStyleSheetPool* pSrcPool, //------------------------------------------------------------------------ // -// Standard-Vorlagen +// Standard-Vorlagen // //------------------------------------------------------------------------ -#define SCSTR(id) ScGlobal::GetRscString(id) +#define SCSTR(id) ScGlobal::GetRscString(id) void ScStyleSheetPool::CopyStdStylesFrom( ScStyleSheetPool* pSrcPool ) { - // Default-Styles kopieren - - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_RESULT), SFX_STYLE_FAMILY_PARA ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_RESULT1), SFX_STYLE_FAMILY_PARA ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_HEADLINE), SFX_STYLE_FAMILY_PARA ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_HEADLINE1), SFX_STYLE_FAMILY_PARA ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PAGE ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_REPORT), SFX_STYLE_FAMILY_PAGE ); + // Default-Styles kopieren + + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_RESULT), SFX_STYLE_FAMILY_PARA ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_RESULT1), SFX_STYLE_FAMILY_PARA ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_HEADLINE), SFX_STYLE_FAMILY_PARA ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_HEADLINE1), SFX_STYLE_FAMILY_PARA ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PAGE ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_REPORT), SFX_STYLE_FAMILY_PAGE ); } //------------------------------------------------------------------------ @@ -253,27 +253,27 @@ void lcl_CheckFont( SfxItemSet& rSet, LanguageType eLang, USHORT nFontType, USHO void ScStyleSheetPool::CreateStandardStyles() { - // neue Eintraege auch bei CopyStdStylesFrom eintragen - - Color aColBlack ( COL_BLACK ); - Color aColGrey ( COL_LIGHTGRAY ); - String aStr; - xub_StrLen nStrLen; - String aHelpFile;//XXX JN welcher Text??? - //ULONG nNumFmt = 0L; - SfxItemSet* pSet = NULL; - SfxItemSet* pHFSet = NULL; - SvxSetItem* pHFSetItem = NULL; - ScEditEngineDefaulter* pEdEngine = new ScEditEngineDefaulter( EditEngine::CreatePool(), TRUE ); + // neue Eintraege auch bei CopyStdStylesFrom eintragen + + Color aColBlack ( COL_BLACK ); + Color aColGrey ( COL_LIGHTGRAY ); + String aStr; + xub_StrLen nStrLen; + String aHelpFile;//XXX JN welcher Text??? + //ULONG nNumFmt = 0L; + SfxItemSet* pSet = NULL; + SfxItemSet* pHFSet = NULL; + SvxSetItem* pHFSetItem = NULL; + ScEditEngineDefaulter* pEdEngine = new ScEditEngineDefaulter( EditEngine::CreatePool(), TRUE ); pEdEngine->SetUpdateMode( FALSE ); - EditTextObject* pEmptyTxtObj = pEdEngine->CreateTextObject(); - EditTextObject* pTxtObj = NULL; - ScPageHFItem* pHeaderItem = new ScPageHFItem( ATTR_PAGE_HEADERRIGHT ); - ScPageHFItem* pFooterItem = new ScPageHFItem( ATTR_PAGE_FOOTERRIGHT ); - ScStyleSheet* pSheet = NULL; - SvxBorderLine aBorderLine ( &aColBlack, DEF_LINE_WIDTH_2 ); - SvxBoxItem aBoxItem ( ATTR_BORDER ); - SvxBoxInfoItem aBoxInfoItem ( ATTR_BORDER_INNER ); + EditTextObject* pEmptyTxtObj = pEdEngine->CreateTextObject(); + EditTextObject* pTxtObj = NULL; + ScPageHFItem* pHeaderItem = new ScPageHFItem( ATTR_PAGE_HEADERRIGHT ); + ScPageHFItem* pFooterItem = new ScPageHFItem( ATTR_PAGE_FOOTERRIGHT ); + ScStyleSheet* pSheet = NULL; + SvxBorderLine aBorderLine ( &aColBlack, DEF_LINE_WIDTH_2 ); + SvxBoxItem aBoxItem ( ATTR_BORDER ); + SvxBoxInfoItem aBoxInfoItem ( ATTR_BORDER_INNER ); String aStrStandard = ScGlobal::GetRscString(STR_STYLENAME_STANDARD); @@ -287,18 +287,18 @@ void ScStyleSheetPool::CreateStandardStyles() pSheet = (ScStyleSheet*) &Make( aStrStandard, SFX_STYLE_FAMILY_PARA, SCSTYLEBIT_STANDARD ); pSheet->SetHelpId( aHelpFile, HID_SC_SHEET_CELL_STD ); - // if default fonts for the document's languages are different from the pool default, - // put them into the default style - // (not as pool defaults, because pool defaults can't be changed by the user) - // the document languages must be set before creating the default styles! + // if default fonts for the document's languages are different from the pool default, + // put them into the default style + // (not as pool defaults, because pool defaults can't be changed by the user) + // the document languages must be set before creating the default styles! pSet = &pSheet->GetItemSet(); LanguageType eLatin, eCjk, eCtl; pDoc->GetLanguage( eLatin, eCjk, eCtl ); - // #108374# / #107782#: If the UI language is Korean, the default Latin font has to - // be queried for Korean, too (the Latin language from the document can't be Korean). - // This is the same logic as in SwDocShell::InitNew. + // #108374# / #107782#: If the UI language is Korean, the default Latin font has to + // be queried for Korean, too (the Latin language from the document can't be Korean). + // This is the same logic as in SwDocShell::InitNew. LanguageType eUiLanguage = Application::GetSettings().GetUILanguage(); switch( eUiLanguage ) { @@ -345,7 +345,7 @@ void ScStyleSheetPool::CreateStandardStyles() // will now be done in GetItemSet(); // pSet = &pSheet->GetItemSet(); // nNumFmt = pDoc->GetFormatTable()->GetStandardFormat( NUMBERFORMAT_CURRENCY, - // ScGlobal::eLnge ); + // ScGlobal::eLnge ); // pSet->Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNumFmt ) ); //---------------- @@ -512,7 +512,7 @@ void ScStyleSheetPool::CreateStandardStyles() //UNUSED2008-05 void ScStyleSheetPool::UpdateStdNames() //UNUSED2008-05 { //UNUSED2008-05 // Standard-Styles den richtigen Namen in der Programm-Sprache geben -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 String aHelpFile; //UNUSED2008-05 sal_uInt32 nCount = aStyles.size(); //UNUSED2008-05 for (sal_uInt32 n=0; n<nCount; n++) @@ -523,7 +523,7 @@ void ScStyleSheetPool::CreateStandardStyles() //UNUSED2008-05 String aOldName = pStyle->GetName(); //UNUSED2008-05 ULONG nHelpId = pStyle->GetHelpId( aHelpFile ); //UNUSED2008-05 SfxStyleFamily eFam = pStyle->GetFamily(); -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 BOOL bHelpKnown = TRUE; //UNUSED2008-05 String aNewName; //UNUSED2008-05 USHORT nNameId = 0; @@ -544,13 +544,13 @@ void ScStyleSheetPool::CreateStandardStyles() //UNUSED2008-05 { //UNUSED2008-05 if ( nNameId ) //UNUSED2008-05 aNewName = SCSTR( nNameId ); -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 if ( aNewName.Len() && aNewName != aOldName && !Find( aNewName, eFam ) ) //UNUSED2008-05 { //UNUSED2008-05 DBG_TRACE( "Renaming style..." ); -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 pStyle->SetName( aNewName ); // setzt auch Parents um -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 // Styles in Patterns sind schon auf Pointer umgesetzt //UNUSED2008-05 if (eFam == SFX_STYLE_FAMILY_PAGE) //UNUSED2008-05 { @@ -565,12 +565,12 @@ void ScStyleSheetPool::CreateStandardStyles() //UNUSED2008-05 else //UNUSED2008-05 { //UNUSED2008-05 // wrong or no HelpId -> set new HelpId -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 // no assertion for wrong HelpIds because this happens //UNUSED2008-05 // with old files (#67218#) or with old files that were //UNUSED2008-05 // saved again with a new version in a different language //UNUSED2008-05 // (so SrcVersion doesn't help) -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 USHORT nNewId = 0; //UNUSED2008-05 if ( eFam == SFX_STYLE_FAMILY_PARA ) //UNUSED2008-05 { @@ -592,7 +592,7 @@ void ScStyleSheetPool::CreateStandardStyles() //UNUSED2008-05 else if ( aOldName == SCSTR( STR_STYLENAME_REPORT ) ) //UNUSED2008-05 nNewId = HID_SC_SHEET_PAGE_REP; //UNUSED2008-05 } -//UNUSED2008-05 +//UNUSED2008-05 //UNUSED2008-05 if ( nNewId ) // new ID found from name -> set ID //UNUSED2008-05 { //UNUSED2008-05 pStyle->SetHelpId( aHelpFile, nNewId ); diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index a3319eafd3fd..a747307faac2 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -1,7 +1,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 @@ -51,7 +51,7 @@ #include "attrib.hxx" -#include <vcl/svapp.hxx> // GetSettings() +#include <vcl/svapp.hxx> // GetSettings() #include "globstr.hrc" #include "sc.hrc" @@ -59,14 +59,14 @@ TYPEINIT1(ScStyleSheet, SfxStyleSheet); -#define TWO_CM 1134 -#define HFDIST_CM 142 +#define TWO_CM 1134 +#define HFDIST_CM 142 //======================================================================== -ScStyleSheet::ScStyleSheet( const String& rName, +ScStyleSheet::ScStyleSheet( const String& rName, ScStyleSheetPool& rPoolP, - SfxStyleFamily eFamily, + SfxStyleFamily eFamily, USHORT nMaskP ) : SfxStyleSheet ( rName, rPoolP, eFamily, nMaskP ) @@ -77,7 +77,7 @@ ScStyleSheet::ScStyleSheet( const String& rName, //------------------------------------------------------------------------ ScStyleSheet::ScStyleSheet( const ScStyleSheet& rStyle ) - : SfxStyleSheet ( rStyle ) + : SfxStyleSheet ( rStyle ) , eUsage( UNKNOWN ) { } @@ -103,8 +103,8 @@ BOOL __EXPORT ScStyleSheet::HasParentSupport () const switch ( GetFamily() ) { - case SFX_STYLE_FAMILY_PARA: bHasParentSupport = TRUE; break; - case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = FALSE; break; + case SFX_STYLE_FAMILY_PARA: bHasParentSupport = TRUE; break; + case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = FALSE; break; default: { // added to avoid warnings @@ -165,40 +165,40 @@ SfxItemSet& __EXPORT ScStyleSheet::GetItemSet() ATTR_USERDEF, ATTR_USERDEF, 0 ); - // Wenn gerade geladen wird, wird auch der Set hinterher aus der Datei - // gefuellt, es brauchen also keine Defaults gesetzt zu werden. - // GetPrinter wuerde dann auch einen neuen Printer anlegen, weil der - // gespeicherte Printer noch nicht geladen ist! + // Wenn gerade geladen wird, wird auch der Set hinterher aus der Datei + // gefuellt, es brauchen also keine Defaults gesetzt zu werden. + // GetPrinter wuerde dann auch einen neuen Printer anlegen, weil der + // gespeicherte Printer noch nicht geladen ist! ScDocument* pDoc = ((ScStyleSheetPool&)GetPool()).GetDocument(); if ( pDoc ) { // Setzen von sinnvollen Default-Werten: - SvxPageItem aPageItem( ATTR_PAGE ); - SvxSizeItem aPaperSizeItem( ATTR_PAGE_SIZE, SvxPaperInfo::GetDefaultPaperSize() ); + SvxPageItem aPageItem( ATTR_PAGE ); + SvxSizeItem aPaperSizeItem( ATTR_PAGE_SIZE, SvxPaperInfo::GetDefaultPaperSize() ); - SvxSetItem aHFSetItem( + SvxSetItem aHFSetItem( (const SvxSetItem&) rItemPool.GetDefaultItem(ATTR_PAGE_HEADERSET) ); - SfxItemSet& rHFSet = aHFSetItem.GetItemSet(); - SvxSizeItem aHFSizeItem( // 0,5 cm + Abstand + SfxItemSet& rHFSet = aHFSetItem.GetItemSet(); + SvxSizeItem aHFSizeItem( // 0,5 cm + Abstand ATTR_PAGE_SIZE, Size( 0, (long)( 500 / HMM_PER_TWIPS ) + HFDIST_CM ) ); - SvxULSpaceItem aHFDistItem ( HFDIST_CM,// nUp + SvxULSpaceItem aHFDistItem ( HFDIST_CM,// nUp HFDIST_CM,// nLow ATTR_ULSPACE ); - SvxLRSpaceItem aLRSpaceItem( TWO_CM, // nLeft - TWO_CM, // nRight - TWO_CM, // nTLeft - 0, // nFirstLineOffset + SvxLRSpaceItem aLRSpaceItem( TWO_CM, // nLeft + TWO_CM, // nRight + TWO_CM, // nTLeft + 0, // nFirstLineOffset ATTR_LRSPACE ); - SvxULSpaceItem aULSpaceItem( TWO_CM, // nUp - TWO_CM, // nLow + SvxULSpaceItem aULSpaceItem( TWO_CM, // nUp + TWO_CM, // nLow ATTR_ULSPACE ); - SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER ); + SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER ); aBoxInfoItem.SetTable( FALSE ); aBoxInfoItem.SetDist( TRUE ); @@ -217,10 +217,10 @@ SfxItemSet& __EXPORT ScStyleSheet::GetItemSet() pSet->Put( aBoxInfoItem ); // PoolDefault wg. Formatvorlagen // nicht ueberschreiben! - // Writing direction: not as pool default because the default for cells - // must remain FRMDIR_ENVIRONMENT, and each page style's setting is - // supposed to be saved in the file format. - // The page default depends on the system language. + // Writing direction: not as pool default because the default for cells + // must remain FRMDIR_ENVIRONMENT, and each page style's setting is + // supposed to be saved in the file format. + // The page default depends on the system language. SvxFrameDirection eDirection = ScGlobal::IsSystemRTL() ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP; pSet->Put( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ), ATTR_WRITINGDIR ); @@ -292,8 +292,8 @@ void __EXPORT ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint ) //------------------------------------------------------------------------ -// #66123# schmutzige Tricks, um die Standard-Vorlage immer als "Standard" zu speichern, -// obwohl der fuer den Benutzer sichtbare Name uebersetzt ist: +// #66123# schmutzige Tricks, um die Standard-Vorlage immer als "Standard" zu speichern, +// obwohl der fuer den Benutzer sichtbare Name uebersetzt ist: const String& ScStyleSheet::GetName() const { @@ -325,13 +325,13 @@ const String& ScStyleSheet::GetFollow() const return rBase; } -// Verhindern, dass ein Style "Standard" angelegt wird, wenn das nicht der -// Standard-Name ist, weil sonst beim Speichern zwei Styles denselben Namen haetten -// (Beim Laden wird der Style direkt per Make mit dem Namen erzeugt, so dass diese -// Abfrage dann nicht gilt) -//! Wenn irgendwann aus dem Laden SetName aufgerufen wird, muss fuer das Laden ein -//! Flag gesetzt und abgefragt werden. -//! Die ganze Abfrage muss raus, wenn fuer eine neue Datei-Version die Namens-Umsetzung wegfaellt. +// Verhindern, dass ein Style "Standard" angelegt wird, wenn das nicht der +// Standard-Name ist, weil sonst beim Speichern zwei Styles denselben Namen haetten +// (Beim Laden wird der Style direkt per Make mit dem Namen erzeugt, so dass diese +// Abfrage dann nicht gilt) +//! Wenn irgendwann aus dem Laden SetName aufgerufen wird, muss fuer das Laden ein +//! Flag gesetzt und abgefragt werden. +//! Die ganze Abfrage muss raus, wenn fuer eine neue Datei-Version die Namens-Umsetzung wegfaellt. BOOL ScStyleSheet::SetName( const String& rNew ) { diff --git a/sc/source/core/data/tabbgcolor.cxx b/sc/source/core/data/tabbgcolor.cxx index a3d9eec16d99..5697227b7b1f 100644 --- a/sc/source/core/data/tabbgcolor.cxx +++ b/sc/source/core/data/tabbgcolor.cxx @@ -38,25 +38,25 @@ #include "tabbgcolor.hxx" bool ScUndoTabColorInfo::IsDefaultOldTabBgColor() const -{ - return maOldTabBgColor == Color(COL_AUTO); +{ + return maOldTabBgColor == Color(COL_AUTO); } -bool ScUndoTabColorInfo::IsDefaultNewTabBgColor() const -{ - return maOldTabBgColor == Color(COL_AUTO); +bool ScUndoTabColorInfo::IsDefaultNewTabBgColor() const +{ + return maOldTabBgColor == Color(COL_AUTO); } ScUndoTabColorInfo::ScUndoTabColorInfo(SCTAB nTab) : - mnTabId(nTab), - maOldTabBgColor(COL_AUTO), + mnTabId(nTab), + maOldTabBgColor(COL_AUTO), maNewTabBgColor(COL_AUTO) { } ScUndoTabColorInfo::ScUndoTabColorInfo(const ScUndoTabColorInfo& r) : - mnTabId(r.mnTabId), - maOldTabBgColor(r.maOldTabBgColor), + mnTabId(r.mnTabId), + maOldTabBgColor(r.maOldTabBgColor), maNewTabBgColor(r.maNewTabBgColor) { } diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index baaabd3a8c8f..b6788ebae6d3 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1,7 +1,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 @@ -46,7 +46,7 @@ #include "refupdat.hxx" #include "markdata.hxx" #include "progress.hxx" -#include "hints.hxx" // fuer Paint-Broadcast +#include "hints.hxx" // fuer Paint-Broadcast #include "prnsave.hxx" #include "tabprotection.hxx" #include "sheetevents.hxx" @@ -120,8 +120,8 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName, if ( pDocument->IsDocVisible() ) { - // when a sheet is added to a visible document, - // initialize its RTL flag from the system locale + // when a sheet is added to a visible document, + // initialize its RTL flag from the system locale bLayoutRTL = ScGlobal::IsSystemRTL(); } @@ -131,7 +131,7 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName, if ( pDrawLayer->ScAddPage( nTab ) ) // FALSE (not inserted) during Undo { pDrawLayer->ScRenamePage( nTab, aName ); - ULONG nx = (ULONG) ((double) (MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS ); + ULONG nx = (ULONG) ((double) (MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS ); ULONG ny = (ULONG) ((double) (MAXROW+1) * ScGlobal::nStdRowHeight * HMM_PER_TWIPS ); pDrawLayer->SetPageSize( static_cast<sal_uInt16>(nTab), Size( nx, ny ), false ); } @@ -145,9 +145,9 @@ ScTable::~ScTable() { if (!pDocument->IsInDtorClear()) { - // nicht im dtor die Pages in der falschen Reihenfolge loeschen - // (nTab stimmt dann als Page-Number nicht!) - // In ScDocument::Clear wird hinterher per Clear am Draw Layer alles geloescht. + // nicht im dtor die Pages in der falschen Reihenfolge loeschen + // (nTab stimmt dann als Page-Number nicht!) + // In ScDocument::Clear wird hinterher per Clear am Draw Layer alles geloescht. ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer(); if (pDrawLayer) @@ -242,11 +242,11 @@ void ScTable::SetLink( BYTE nMode, const String& rTab, ULONG nRefreshDelay ) { nLinkMode = nMode; - aLinkDoc = rDoc; // Datei - aLinkFlt = rFlt; // Filter - aLinkOpt = rOpt; // Filter-Optionen - aLinkTab = rTab; // Tabellenname in Quelldatei - nLinkRefreshDelay = nRefreshDelay; // refresh delay in seconds, 0==off + aLinkDoc = rDoc; // Datei + aLinkFlt = rFlt; // Filter + aLinkOpt = rOpt; // Filter-Optionen + aLinkTab = rTab; // Tabellenname in Quelldatei + nLinkRefreshDelay = nRefreshDelay; // refresh delay in seconds, 0==off if (IsStreamValid()) SetStreamValid(FALSE); @@ -269,7 +269,7 @@ long ScTable::GetNeededSize( SCCOL nCol, SCROW nRow, BOOL bWidth, BOOL bTotalSize ) { ScNeededSizeOptions aOptions; - aOptions.bSkipMerged = FALSE; // zusammengefasste mitzaehlen + aOptions.bSkipMerged = FALSE; // zusammengefasste mitzaehlen aOptions.bTotalSize = bTotalSize; return aCol[nCol].GetNeededSize @@ -302,14 +302,14 @@ BOOL ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT nExtra, USHORT* pHeight = new USHORT[nCount]; // Twips ! memset( pHeight, 0, sizeof(USHORT) * nCount ); - // zuerst einmal ueber den ganzen Bereich - // (mit der letzten Spalte in der Hoffnung, dass die am ehesten noch auf - // Standard formatiert ist) + // zuerst einmal ueber den ganzen Bereich + // (mit der letzten Spalte in der Hoffnung, dass die am ehesten noch auf + // Standard formatiert ist) aCol[MAXCOL].GetOptimalHeight( nStartRow, nEndRow, pHeight, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bForce, 0, 0 ); - // daraus Standardhoehe suchen, die im unteren Bereich gilt + // daraus Standardhoehe suchen, die im unteren Bereich gilt USHORT nMinHeight = pHeight[nCount-1]; SCSIZE nPos = nCount-1; @@ -318,7 +318,7 @@ BOOL ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT nExtra, SCROW nMinStart = nStartRow + nPos; ULONG nWeightedCount = 0; - for (SCCOL nCol=0; nCol<MAXCOL; nCol++) // MAXCOL schon oben + for (SCCOL nCol=0; nCol<MAXCOL; nCol++) // MAXCOL schon oben { aCol[nCol].GetOptimalHeight( nStartRow, nEndRow, pHeight, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bForce, @@ -327,7 +327,7 @@ BOOL ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT nExtra, if (pProgress) { ULONG nWeight = aCol[nCol].GetWeightedCount(); - if (nWeight) // nochmal denselben Status muss auch nicht sein + if (nWeight) // nochmal denselben Status muss auch nicht sein { nWeightedCount += nWeight; pProgress->SetState( nWeightedCount + nProgressStart ); @@ -402,7 +402,7 @@ BOOL ScTable::GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const SCCOL nMaxX = 0; SCROW nMaxY = 0; for (SCCOL i=0; i<=MAXCOL; i++) - if (!aCol[i].IsEmptyVisData(TRUE)) // TRUE = Notizen zaehlen auch + if (!aCol[i].IsEmptyVisData(TRUE)) // TRUE = Notizen zaehlen auch { bFound = TRUE; nMaxX = i; @@ -418,7 +418,7 @@ BOOL ScTable::GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const BOOL ScTable::GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const { - BOOL bRet = TRUE; //! merken? + BOOL bRet = TRUE; //! merken? if (!bTableAreaValid) { bRet = GetPrintArea( ((ScTable*)this)->nTableAreaX, @@ -430,7 +430,7 @@ BOOL ScTable::GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const return bRet; } -/* vorher: +/* vorher: BOOL bFound = FALSE; SCCOL nMaxX = 0; @@ -459,7 +459,7 @@ BOOL ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, BOOL bNotes ) const SCROW nMaxY = 0; SCCOL i; - for (i=0; i<=MAXCOL; i++) // Daten testen + for (i=0; i<=MAXCOL; i++) // Daten testen if (!aCol[i].IsEmptyVisData(bNotes)) { bFound = TRUE; @@ -472,7 +472,7 @@ BOOL ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, BOOL bNotes ) const SCCOL nMaxDataX = nMaxX; - for (i=0; i<=MAXCOL; i++) // Attribute testen + for (i=0; i<=MAXCOL; i++) // Attribute testen { SCROW nLastRow; if (aCol[i].GetLastVisibleAttr( nLastRow )) @@ -484,7 +484,7 @@ BOOL ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, BOOL bNotes ) const } } - if (nMaxX == MAXCOL) // Attribute rechts weglassen + if (nMaxX == MAXCOL) // Attribute rechts weglassen { --nMaxX; while ( nMaxX>0 && aCol[nMaxX].IsVisibleAttrEqual(aCol[nMaxX+1]) ) @@ -530,7 +530,7 @@ BOOL ScTable::GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow, SCCOL nMaxX = 0; SCCOL i; - for (i=0; i<=MAXCOL; i++) // Attribute testen + for (i=0; i<=MAXCOL; i++) // Attribute testen { if (aCol[i].HasVisibleAttrIn( nStartRow, nEndRow )) { @@ -539,16 +539,16 @@ BOOL ScTable::GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow, } } - if (nMaxX == MAXCOL) // Attribute rechts weglassen + if (nMaxX == MAXCOL) // Attribute rechts weglassen { --nMaxX; while ( nMaxX>0 && aCol[nMaxX].IsVisibleAttrEqual(aCol[nMaxX+1], nStartRow, nEndRow) ) --nMaxX; } - for (i=0; i<=MAXCOL; i++) // Daten testen + for (i=0; i<=MAXCOL; i++) // Daten testen { - if (!aCol[i].IsEmptyBlock( nStartRow, nEndRow )) //! bNotes ?????? + if (!aCol[i].IsEmptyBlock( nStartRow, nEndRow )) //! bNotes ?????? { bFound = TRUE; if (i>nMaxX) @@ -567,7 +567,7 @@ BOOL ScTable::GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol, SCROW nMaxY = 0; SCCOL i; - for (i=nStartCol; i<=nEndCol; i++) // Attribute testen + for (i=nStartCol; i<=nEndCol; i++) // Attribute testen { SCROW nLastRow; if (aCol[i].GetLastVisibleAttr( nLastRow )) @@ -578,7 +578,7 @@ BOOL ScTable::GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol, } } - for (i=nStartCol; i<=nEndCol; i++) // Daten testen + for (i=nStartCol; i<=nEndCol; i++) // Daten testen if (!aCol[i].IsEmptyVisData(bNotes)) { bFound = TRUE; @@ -598,7 +598,7 @@ BOOL ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const SCROW nMinY = MAXROW; SCCOL i; - for (i=0; i<=MAXCOL; i++) // Attribute testen + for (i=0; i<=MAXCOL; i++) // Attribute testen { SCROW nFirstRow; if (aCol[i].GetFirstVisibleAttr( nFirstRow )) @@ -611,9 +611,9 @@ BOOL ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const } } - if (nMinX == 0) // Attribute links weglassen + if (nMinX == 0) // Attribute links weglassen { - if ( aCol[0].IsVisibleAttrEqual(aCol[1]) ) // keine einzelnen + if ( aCol[0].IsVisibleAttrEqual(aCol[1]) ) // keine einzelnen { ++nMinX; while ( nMinX<MAXCOL && aCol[nMinX].IsVisibleAttrEqual(aCol[nMinX-1]) ) @@ -622,7 +622,7 @@ BOOL ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const } BOOL bDatFound = FALSE; - for (i=0; i<=MAXCOL; i++) // Daten testen + for (i=0; i<=MAXCOL; i++) // Daten testen if (!aCol[i].IsEmptyVisData(TRUE)) { if (!bDatFound && i<nMinX) @@ -924,11 +924,11 @@ BOOL ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark, GetAttr(nCol,nRow,ATTR_PROTECTION))->GetProtection()) return FALSE; - if (bMarked || bUnprotected) //! auch sonst ??? + if (bMarked || bUnprotected) //! auch sonst ??? { - // #53697# ausgeblendete muessen uebersprungen werden, weil der Cursor sonst - // auf der naechsten Zelle landet, auch wenn die geschuetzt/nicht markiert ist. - //! per Extra-Parameter steuern, nur fuer Cursor-Bewegung ??? + // #53697# ausgeblendete muessen uebersprungen werden, weil der Cursor sonst + // auf der naechsten Zelle landet, auch wenn die geschuetzt/nicht markiert ist. + //! per Extra-Parameter steuern, nur fuer Cursor-Bewegung ??? if (RowHidden(nRow)) return FALSE; @@ -943,7 +943,7 @@ BOOL ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark, void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, BOOL bMarked, BOOL bUnprotected, const ScMarkData& rMark ) { - if (bUnprotected && !IsProtected()) // Tabelle ueberhaupt geschuetzt? + if (bUnprotected && !IsProtected()) // Tabelle ueberhaupt geschuetzt? bUnprotected = FALSE; USHORT nWrap = 0; @@ -960,10 +960,10 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, { BOOL bUp = ( nMovY < 0 ); nRow = rMark.GetNextMarked( nCol, nRow, bUp ); - while ( VALIDROW(nRow) && + while ( VALIDROW(nRow) && (RowHidden(nRow) || pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_OVERLAPPED)) ) { - // #53697# ausgeblendete ueberspringen (s.o.) + // #53697# ausgeblendete ueberspringen (s.o.) nRow += nMovY; nRow = rMark.GetNextMarked( nCol, nRow, bUp ); } @@ -972,7 +972,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, { nCol = sal::static_int_cast<SCsCOL>( nCol + static_cast<SCsCOL>(nMovY) ); while ( VALIDCOL(nCol) && ColHidden(nCol) ) - nCol = sal::static_int_cast<SCsCOL>( nCol + static_cast<SCsCOL>(nMovY) ); // #53697# skip hidden rows (see above) + nCol = sal::static_int_cast<SCsCOL>( nCol + static_cast<SCsCOL>(nMovY) ); // #53697# skip hidden rows (see above) if (nCol < 0) { nCol = MAXCOL; @@ -990,10 +990,10 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, else if (nRow > MAXROW) nRow = 0; nRow = rMark.GetNextMarked( nCol, nRow, bUp ); - while ( VALIDROW(nRow) && + while ( VALIDROW(nRow) && (RowHidden(nRow) || pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_OVERLAPPED)) ) { - // #53697# ausgeblendete ueberspringen (s.o.) + // #53697# ausgeblendete ueberspringen (s.o.) nRow += nMovY; nRow = rMark.GetNextMarked( nCol, nRow, bUp ); } @@ -1023,7 +1023,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, SCsROW* pNextRows = new SCsROW[MAXCOL+1]; SCCOL i; - if ( nMovX > 0 ) // vorwaerts + if ( nMovX > 0 ) // vorwaerts { for (i=0; i<=MAXCOL; i++) pNextRows[i] = (i<nCol) ? (nRow+1) : nRow; @@ -1038,7 +1038,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, SCsROW nMinRow = MAXROW+1; for (i=0; i<=MAXCOL; i++) - if (pNextRows[i] < nMinRow) // bei gleichen den linken + if (pNextRows[i] < nMinRow) // bei gleichen den linken { nMinRow = pNextRows[i]; nCol = i; @@ -1047,16 +1047,16 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, if ( nRow > MAXROW ) { - if (++nWrap >= 2) break; // ungueltigen Wert behalten + if (++nWrap >= 2) break; // ungueltigen Wert behalten nCol = 0; nRow = 0; for (i=0; i<=MAXCOL; i++) - pNextRows[i] = 0; // alles ganz von vorne + pNextRows[i] = 0; // alles ganz von vorne } } while ( !ValidNextPos(nCol, nRow, rMark, bMarked, bUnprotected) ); } - else // rueckwaerts + else // rueckwaerts { for (i=0; i<=MAXCOL; i++) pNextRows[i] = (i>nCol) ? (nRow-1) : nRow; @@ -1071,7 +1071,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, SCsROW nMaxRow = -1; for (i=0; i<=MAXCOL; i++) - if (pNextRows[i] >= nMaxRow) // bei gleichen den rechten + if (pNextRows[i] >= nMaxRow) // bei gleichen den rechten { nMaxRow = pNextRows[i]; nCol = i; @@ -1080,11 +1080,11 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, if ( nRow < 0 ) { - if (++nWrap >= 2) break; // ungueltigen Wert behalten + if (++nWrap >= 2) break; // ungueltigen Wert behalten nCol = MAXCOL; nRow = MAXROW; for (i=0; i<=MAXCOL; i++) - pNextRows[i] = MAXROW; // alles ganz von vorne + pNextRows[i] = MAXROW; // alles ganz von vorne } } while ( !ValidNextPos(nCol, nRow, rMark, bMarked, bUnprotected) ); @@ -1094,9 +1094,9 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, } } - // ungueltige Werte kommen z.b. bei Tab heraus, - // wenn nicht markiert und nicht geschuetzt ist (linker / rechter Rand), - // dann Werte unveraendert lassen + // ungueltige Werte kommen z.b. bei Tab heraus, + // wenn nicht markiert und nicht geschuetzt ist (linker / rechter Rand), + // dann Werte unveraendert lassen if (VALIDCOLROW(nCol,nRow)) { @@ -1112,7 +1112,7 @@ BOOL ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMa if ( !pMarkArray ) return FALSE; - ++rRow; // naechste Zelle ist gesucht + ++rRow; // naechste Zelle ist gesucht while ( rCol <= MAXCOL ) { @@ -1131,33 +1131,33 @@ BOOL ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMa if ( pCell && pCell->GetCellType() != CELLTYPE_NOTE ) { rRow = nCellRow; - return TRUE; // Zelle gefunden + return TRUE; // Zelle gefunden } } - rRow = nEnd + 1; // naechsten markierten Bereich suchen + rRow = nEnd + 1; // naechsten markierten Bereich suchen } else - rRow = MAXROW + 1; // Ende der Spalte + rRow = MAXROW + 1; // Ende der Spalte } rRow = 0; - ++rCol; // naechste Spalte testen + ++rCol; // naechste Spalte testen } - return FALSE; // alle Spalten durch + return FALSE; // alle Spalten durch } void ScTable::UpdateDrawRef( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, bool bUpdateNoteCaptionPos ) { - if ( nTab >= nTab1 && nTab <= nTab2 && nDz == 0 ) // only within the table + if ( nTab >= nTab1 && nTab <= nTab2 && nDz == 0 ) // only within the table { InitializeNoteCaptions(); ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer(); if ( eUpdateRefMode != URM_COPY && pDrawLayer ) { if ( eUpdateRefMode == URM_MOVE ) - { // source range + { // source range nCol1 = sal::static_int_cast<SCCOL>( nCol1 - nDx ); nRow1 = sal::static_int_cast<SCROW>( nRow1 - nDy ); nCol2 = sal::static_int_cast<SCCOL>( nCol2 - nDx ); @@ -1192,7 +1192,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW if ( bIncludeDraw ) UpdateDrawRef( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, bUpdateNoteCaptionPos ); - if ( nTab >= nTab1 && nTab <= nTab2 && nDz == 0 ) // print ranges: only within the table + if ( nTab >= nTab1 && nTab <= nTab2 && nDz == 0 ) // print ranges: only within the table { SCTAB nSTab = nTab; SCTAB nETab = nTab; @@ -1235,7 +1235,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW { *pRepeatColRange = ScRange( nSCol, nSRow, 0, nECol, nERow, 0 ); bRecalcPages = TRUE; - nRepeatStartX = nSCol; // fuer UpdatePageBreaks + nRepeatStartX = nSCol; // fuer UpdatePageBreaks nRepeatEndX = nECol; } } @@ -1255,12 +1255,12 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW { *pRepeatRowRange = ScRange( nSCol, nSRow, 0, nECol, nERow, 0 ); bRecalcPages = TRUE; - nRepeatStartY = nSRow; // fuer UpdatePageBreaks + nRepeatStartY = nSRow; // fuer UpdatePageBreaks nRepeatEndY = nERow; } } - // updating print ranges is not necessary with multiple print ranges + // updating print ranges is not necessary with multiple print ranges if ( bRecalcPages && GetPrintRangeCount() <= 1 ) { UpdatePageBreaks(NULL); @@ -1525,14 +1525,14 @@ void ScTable::DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd ) } #define SET_PRINTRANGE( p1, p2 ) \ - if ( (p2) ) \ - { \ - if ( (p1) ) \ - *(p1) = *(p2); \ - else \ - (p1) = new ScRange( *(p2) ); \ - } \ - else \ + if ( (p2) ) \ + { \ + if ( (p1) ) \ + *(p1) = *(p2); \ + else \ + (p1) = new ScRange( *(p2) ); \ + } \ + else \ DELETEZ( (p1) ) void ScTable::SetRepeatColRange( const ScRange* pNew ) @@ -1612,7 +1612,7 @@ ScTable::VisibleDataCellIterator::VisibleDataCellIterator(ScFlatBoolRowSegments& mrRowSegs(rRowSegs), mrColumn(rColumn), mpCell(NULL), - mnCurRow(ROW_NOT_FOUND), + mnCurRow(ROW_NOT_FOUND), mnUBound(ROW_NOT_FOUND) { } @@ -1624,20 +1624,20 @@ ScTable::VisibleDataCellIterator::~VisibleDataCellIterator() ScBaseCell* ScTable::VisibleDataCellIterator::reset(SCROW nRow) { if (nRow > MAXROW) - { + { mnCurRow = ROW_NOT_FOUND; return NULL; } ScFlatBoolRowSegments::RangeData aData; if (!mrRowSegs.getRangeData(nRow, aData)) - { + { mnCurRow = ROW_NOT_FOUND; return NULL; } if (!aData.mbValue) - { + { // specified row is visible. Take it. mnCurRow = nRow; mnUBound = aData.mnRow2; @@ -1649,7 +1649,7 @@ ScBaseCell* ScTable::VisibleDataCellIterator::reset(SCROW nRow) mnCurRow = aData.mnRow2 + 1; mnUBound = mnCurRow; // get range data on the next iteration. if (mnCurRow > MAXROW) - { + { // Make sure the row doesn't exceed our current limit. mnCurRow = ROW_NOT_FOUND; return NULL; @@ -1699,7 +1699,7 @@ ScBaseCell* ScTable::VisibleDataCellIterator::next() return mpCell; } mnCurRow = ROW_NOT_FOUND; - return NULL; + return NULL; } SCROW ScTable::VisibleDataCellIterator::getRow() const diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index d54e16b8cbd7..aeb2a19b05e6 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1,7 +1,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 @@ -47,7 +47,7 @@ #include "olinetab.hxx" #include "rechead.hxx" #include "stlpool.hxx" -#include "attarray.hxx" // Iterator +#include "attarray.hxx" // Iterator #include "markdata.hxx" #include "progress.hxx" #include "dociter.hxx" @@ -88,7 +88,7 @@ BOOL ScTable::SetOutlineTable( const ScOutlineTable* pNewOutline ) else pOutlineTable = NULL; - return ( nNewSizeX != nOldSizeX || nNewSizeY != nOldSizeY ); // Groesse geaendert ? + return ( nNewSizeX != nOldSizeX || nNewSizeY != nOldSizeY ); // Groesse geaendert ? } @@ -292,7 +292,7 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE aCol[MAXCOL - nSize - i].MoveTo(nStartRow, nEndRow, aCol[MAXCOL - i]); } - if (nStartCol>0) // copy old attributes + if (nStartCol>0) // copy old attributes { USHORT nWhichArray[2]; nWhichArray[0] = ATTR_MERGE; @@ -379,7 +379,7 @@ void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USH if (nRow2 > MAXROW) nRow2 = MAXROW; if (ValidColRow(nCol1, nRow1) && ValidColRow(nCol2, nRow2)) { -// IncRecalcLevel(); +// IncRecalcLevel(); { // scope for bulk broadcast ScBulkBroadcast aBulkBroadcast( pDocument->GetBASM()); @@ -398,7 +398,7 @@ void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USH ApplyPatternArea( nCol1, nRow1, nCol2, nRow2, aPattern ); } -// DecRecalcLevel(); +// DecRecalcLevel(); } } @@ -426,20 +426,20 @@ void ScTable::DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark ) } -// pTable = Clipboard +// pTable = Clipboard void ScTable::CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable, BOOL bKeepScenarioFlags, BOOL bCloneNoteCaptions) { if (ValidColRow(nCol1, nRow1) && ValidColRow(nCol2, nRow2)) { - // Inhalte kopieren + // Inhalte kopieren SCCOL i; for ( i = nCol1; i <= nCol2; i++) aCol[i].CopyToClip(nRow1, nRow2, pTable->aCol[i], bKeepScenarioFlags, bCloneNoteCaptions); - // copy widths/heights, and only "hidden", "filtered" and "manual" flags - // also for all preceding columns/rows, to have valid positions for drawing objects + // copy widths/heights, and only "hidden", "filtered" and "manual" flags + // also for all preceding columns/rows, to have valid positions for drawing objects if (pColWidth && pTable->pColWidth) for (i=0; i<=nCol2; i++) @@ -457,7 +457,7 @@ void ScTable::CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, pTable->CopyRowHidden(*this, 0, nRow2); pTable->CopyRowFiltered(*this, 0, nRow2); - // ggf. Formeln durch Werte ersetzen + // ggf. Formeln durch Werte ersetzen if ( IsProtected() ) for (i = nCol1; i <= nCol2; i++) @@ -465,13 +465,13 @@ void ScTable::CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } } -void ScTable::CopyToClip(const ScRangeList& rRanges, ScTable* pTable, +void ScTable::CopyToClip(const ScRangeList& rRanges, ScTable* pTable, bool bKeepScenarioFlags, bool bCloneNoteCaptions) { ScRangeList aRanges(rRanges); for (ScRangePtr p = aRanges.First(); p; p = aRanges.Next()) { - CopyToClip(p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), + CopyToClip(p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), pTable, bKeepScenarioFlags, bCloneNoteCaptions); } } @@ -534,7 +534,7 @@ void ScTable::MixData( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } -// Markierung von diesem Dokument +// Markierung von diesem Dokument void ScTable::MixMarked( const ScMarkData& rMark, USHORT nFunction, BOOL bSkipEmpty, ScTable* pSrcTab ) { @@ -557,18 +557,18 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if ( bAsLink && nFlags == IDF_ALL ) { - // #68989# with IDF_ALL, also create links (formulas) for empty cells + // #68989# with IDF_ALL, also create links (formulas) for empty cells for ( nRow=nRow1; nRow<=nRow2; nRow++ ) { - // create simple formula, as in ScColumn::CreateRefCell + // create simple formula, as in ScColumn::CreateRefCell ScAddress aDestPos( static_cast<SCCOL>(nRow-nRow1), static_cast<SCROW>(nCol-nCol1), pTransClip->nTab ); ScSingleRefData aRef; aRef.nCol = nCol; aRef.nRow = nRow; aRef.nTab = nTab; - aRef.InitFlags(); // -> all absolute + aRef.InitFlags(); // -> all absolute aRef.SetFlag3D(TRUE); aRef.CalcRelFromAbs( aDestPos ); ScTokenArray aArr; @@ -585,19 +585,19 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { ScAddress aDestPos( static_cast<SCCOL>(nRow-nRow1), static_cast<SCROW>(nCol-nCol1), pTransClip->nTab ); ScBaseCell* pNew; - if ( bAsLink ) // Referenz erzeugen ? + if ( bAsLink ) // Referenz erzeugen ? { pNew = aCol[nCol].CreateRefCell( pDestDoc, aDestPos, aIter.GetIndex(), nFlags ); } - else // kopieren + else // kopieren { ScAddress aOwnPos( nCol, nRow, nTab ); if (pCell->GetCellType() == CELLTYPE_FORMULA) { pNew = pCell->CloneWithNote( aOwnPos, *pDestDoc, aDestPos, SC_CLONECELL_STARTLISTENING ); - // Referenzen drehen - // bei Cut werden Referenzen spaeter per UpdateTranspose angepasst + // Referenzen drehen + // bei Cut werden Referenzen spaeter per UpdateTranspose angepasst if (!bWasCut) ((ScFormulaCell*)pNew)->TransposeReference(); @@ -611,7 +611,7 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } } - // Attribute + // Attribute SCROW nAttrRow1; SCROW nAttrRow2; @@ -729,9 +729,9 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, aCol[i].CopyToColumn(nRow1, nRow2, nFlags, bMarked, pDestTab->aCol[i], pMarkData, bAsLink); - if (bColRowFlags) // Spaltenbreiten/Zeilenhoehen/Flags + if (bColRowFlags) // Spaltenbreiten/Zeilenhoehen/Flags { - // Charts muessen beim Ein-/Ausblenden angepasst werden + // Charts muessen beim Ein-/Ausblenden angepasst werden ScChartListenerCollection* pCharts = pDestTab->pDocument->GetChartListenerCollection(); bool bFlagChange = false; @@ -753,8 +753,8 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, pDestTab->pColWidth[i] = pColWidth[i]; pDestTab->pColFlags[i] = pColFlags[i]; pDestTab->SetColHidden(i, i, bThisHidden); - //! Aenderungen zusammenfassen? - if (bHiddenChange && pCharts) + //! Aenderungen zusammenfassen? + if (bHiddenChange && pCharts) pCharts->SetRangeDirty(ScRange( i, 0, nTab, i, MAXROW, nTab )); if (bChange) @@ -779,13 +779,13 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCROW nThisLastRow, nDestLastRow; bool bThisHidden = RowHidden(i, NULL, &nThisLastRow); bool bDestHidden = pDestTab->RowHidden(i, NULL, &nDestLastRow); - + // If the segment sizes differ, we take the shorter segment of the two. SCROW nLastRow = ::std::min(nThisLastRow, nDestLastRow); if (nLastRow >= nRow2) // the last row shouldn't exceed the upper bound the caller specified. nLastRow = nRow2; - + pDestTab->SetRowHidden(i, nLastRow, bThisHidden); bool bThisHiddenChange = (bThisHidden != bDestHidden); @@ -794,14 +794,14 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, // Hidden flags differ. pCharts->SetRangeDirty(ScRange(0, i, nTab, MAXCOL, nLastRow, nTab)); } - + if (bThisHiddenChange) bFlagChange = true; - + // Jump to the last row of the identical flag segment. i = nLastRow; } - + // Filtered flags. for (SCROW i = nRow1; i <= nRow2; ++i) { @@ -821,7 +821,7 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (bFlagChange) pDestTab->InvalidatePageBreaks(); - pDestTab->SetOutlineTable( pOutlineTable ); // auch nur wenn bColRowFlags + pDestTab->SetOutlineTable( pOutlineTable ); // auch nur wenn bColRowFlags } } } @@ -903,7 +903,7 @@ void ScTable::MarkScenarioIn( ScMarkData& rDestMark, USHORT nNeededBits ) const { DBG_ASSERT( bScenario, "bScenario == FALSE" ); - if ( ( nScenarioFlags & nNeededBits ) != nNeededBits ) // alle Bits gesetzt? + if ( ( nScenarioFlags & nNeededBits ) != nNeededBits ) // alle Bits gesetzt? return; for (SCCOL i=0; i<=MAXCOL; i++) @@ -914,16 +914,16 @@ BOOL ScTable::HasScenarioRange( const ScRange& rRange ) const { DBG_ASSERT( bScenario, "bScenario == FALSE" ); -// ScMarkData aMark; -// MarkScenarioIn( aMark, 0 ); //! Bits als Parameter von HasScenarioRange? -// return aMark.IsAllMarked( rRange ); +// ScMarkData aMark; +// MarkScenarioIn( aMark, 0 ); //! Bits als Parameter von HasScenarioRange? +// return aMark.IsAllMarked( rRange ); ScRange aTabRange = rRange; aTabRange.aStart.SetTab( nTab ); aTabRange.aEnd.SetTab( nTab ); const ScRangeList* pList = GetScenarioRanges(); -// return ( pList && pList->Find( aTabRange ) ); +// return ( pList && pList->Find( aTabRange ) ); if (pList) { @@ -953,7 +953,7 @@ const ScRangeList* ScTable::GetScenarioRanges() const { ((ScTable*)this)->pScenarioRanges = new ScRangeList; ScMarkData aMark; - MarkScenarioIn( aMark, 0 ); // immer + MarkScenarioIn( aMark, 0 ); // immer aMark.FillRangeListWithMarks( pScenarioRanges, FALSE ); } return pScenarioRanges; @@ -1014,11 +1014,11 @@ void ScTable::PutCell( const ScAddress& rPos, ScBaseCell* pCell ) //UNUSED2009-05 } -BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString, +BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString, SvNumberFormatter* pFormatter, bool bDetectNumberFormat ) { if (ValidColRow(nCol,nRow)) - return aCol[nCol].SetString( + return aCol[nCol].SetString( nRow, nTabP, rString, pDocument->GetAddressConvention(), pFormatter, bDetectNumberFormat ); else return FALSE; @@ -1213,7 +1213,7 @@ void ScTable::SetDirtyVar() void ScTable::SetDirty() { BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].SetDirty(); pDocument->SetAutoCalc( bOldAutoCalc ); @@ -1223,7 +1223,7 @@ void ScTable::SetDirty() void ScTable::SetDirty( const ScRange& rRange ) { BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden SCCOL nCol2 = rRange.aEnd.Col(); for (SCCOL i=rRange.aStart.Col(); i<=nCol2; i++) aCol[i].SetDirty( rRange ); @@ -1234,7 +1234,7 @@ void ScTable::SetDirty( const ScRange& rRange ) void ScTable::SetTableOpDirty( const ScRange& rRange ) { BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // no multiple recalculation + pDocument->SetAutoCalc( FALSE ); // no multiple recalculation SCCOL nCol2 = rRange.aEnd.Col(); for (SCCOL i=rRange.aStart.Col(); i<=nCol2; i++) aCol[i].SetTableOpDirty( rRange ); @@ -1245,7 +1245,7 @@ void ScTable::SetTableOpDirty( const ScRange& rRange ) void ScTable::SetDirtyAfterLoad() { BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].SetDirtyAfterLoad(); pDocument->SetAutoCalc( bOldAutoCalc ); @@ -1255,7 +1255,7 @@ void ScTable::SetDirtyAfterLoad() void ScTable::SetRelNameDirty() { BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].SetRelNameDirty(); pDocument->SetAutoCalc( bOldAutoCalc ); @@ -1310,7 +1310,7 @@ void ScTable::ResetChanged( const ScRange& rRange ) aCol[nCol].ResetChanged(nStartRow, nEndRow); } -// Attribute +// Attribute const SfxPoolItem* ScTable::GetAttr( SCCOL nCol, SCROW nRow, USHORT nWhich ) const { @@ -1368,12 +1368,12 @@ bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USH //UNUSED2009-05 SCROW nRow2 = rRange.aEnd.Row(); //UNUSED2009-05 PutInOrder( nCol1, nCol2 ); //UNUSED2009-05 PutInOrder( nRow1, nRow2 ); -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 BOOL bFound = FALSE; //UNUSED2009-05 for (SCCOL i=nCol1; i<=nCol2; i++) //UNUSED2009-05 if (aCol[i].HasLines( nRow1, nRow2, rSizes, (i==nCol1), (i==nCol2) )) //UNUSED2009-05 bFound = TRUE; -//UNUSED2009-05 +//UNUSED2009-05 //UNUSED2009-05 return bFound; //UNUSED2009-05 } @@ -1422,16 +1422,16 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO SCCOL nCol, SCROW nAttrRow1, SCROW nAttrRow2, SCSIZE nArrY, const ScPatternAttr* pPattern, const SfxItemSet* pCondSet ) { - // Rueckgabe = neues nArrY + // Rueckgabe = neues nArrY BYTE nRotDir = pPattern->GetRotateDir( pCondSet ); if ( nRotDir != SC_ROTDIR_NONE ) { BOOL bHit = TRUE; - if ( nCol+1 < nX1 ) // column to the left + if ( nCol+1 < nX1 ) // column to the left bHit = ( nRotDir != SC_ROTDIR_LEFT ); - else if ( nCol > nX2+1 ) // column to the right - bHit = ( nRotDir != SC_ROTDIR_RIGHT ); // SC_ROTDIR_STANDARD may now also be extended to the left + else if ( nCol > nX2+1 ) // column to the right + bHit = ( nRotDir != SC_ROTDIR_RIGHT ); // SC_ROTDIR_STANDARD may now also be extended to the left if ( bHit ) { @@ -1440,14 +1440,14 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO { long nRotVal = ((const SfxInt32Item&) pPattern-> GetItem( ATTR_ROTATE_VALUE, pCondSet )).GetValue(); - double nRealOrient = nRotVal * F_PI18000; // 1/100 Grad + double nRealOrient = nRotVal * F_PI18000; // 1/100 Grad double nCos = cos( nRealOrient ); double nSin = sin( nRealOrient ); - //! begrenzen !!! - //! zusaetzlich Faktor fuer unterschiedliche PPT X/Y !!! + //! begrenzen !!! + //! zusaetzlich Faktor fuer unterschiedliche PPT X/Y !!! - // bei SC_ROTDIR_LEFT kommt immer ein negativer Wert heraus, - // wenn der Modus beruecksichtigt wird + // bei SC_ROTDIR_LEFT kommt immer ein negativer Wert heraus, + // wenn der Modus beruecksichtigt wird nFactor = -fabs( nCos / nSin ); } @@ -1495,7 +1495,7 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC return; } - // nRotMaxCol ist auf SC_ROTMAX_NONE initialisiert, nRowNo ist schon gesetzt + // nRotMaxCol ist auf SC_ROTMAX_NONE initialisiert, nRowNo ist schon gesetzt SCROW nY1 = pRowInfo[0].nRowNo; SCROW nY2 = pRowInfo[nArrCount-1].nRowNo; @@ -1515,8 +1515,8 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC if ( pPattern->GetItemSet().GetItemState( ATTR_CONDITIONAL, TRUE, &pCondItem ) == SFX_ITEM_SET ) { - // alle Formate durchgehen, damit die Zellen nicht einzeln - // angeschaut werden muessen + // alle Formate durchgehen, damit die Zellen nicht einzeln + // angeschaut werden muessen ULONG nIndex = ((const SfxUInt32Item*)pCondItem)->GetValue(); ScConditionalFormatList* pList = pDocument->GetCondFormList(); @@ -1539,7 +1539,7 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC FillMaxRot( pRowInfo, nArrCount, nX1, nX2, nCol, nAttrRow1, nAttrRow2, nArrY, pPattern, &pStyleSheet->GetItemSet() ); - // nArrY nicht veraendern + // nArrY nicht veraendern } } } @@ -1563,28 +1563,28 @@ BOOL ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCR USHORT nEdges; if ( nCol1 == nCol2 ) - { // linke und rechte Spalte + { // linke und rechte Spalte const USHORT n = 4 | 16; nEdges = aCol[nCol1].GetBlockMatrixEdges( nRow1, nRow2, n ); // nicht (4 und 16) oder 1 oder 32 if ( nEdges && (((nEdges & n) != n) || (nEdges & 33)) ) - return TRUE; // linke oder rechte Kante fehlt oder offen + return TRUE; // linke oder rechte Kante fehlt oder offen } else - { // linke Spalte + { // linke Spalte nEdges = aCol[nCol1].GetBlockMatrixEdges( nRow1, nRow2, 4 ); // nicht 4 oder 1 oder 32 if ( nEdges && (((nEdges & 4) != 4) || (nEdges & 33)) ) - return TRUE; // linke Kante fehlt oder offen + return TRUE; // linke Kante fehlt oder offen // rechte Spalte nEdges = aCol[nCol2].GetBlockMatrixEdges( nRow1, nRow2, 16 ); // nicht 16 oder 1 oder 32 if ( nEdges && (((nEdges & 16) != 16) || (nEdges & 33)) ) - return TRUE; // rechte Kante fehlt oder offen + return TRUE; // rechte Kante fehlt oder offen } if ( nRow1 == nRow2 ) - { // obere und untere Zeile + { // obere und untere Zeile BOOL bOpen = FALSE; const USHORT n = 2 | 8; for ( SCCOL i=nCol1; i<=nCol2; i++) @@ -1593,17 +1593,17 @@ BOOL ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCR if ( nEdges ) { if ( (nEdges & n) != n ) - return TRUE; // obere oder untere Kante fehlt + return TRUE; // obere oder untere Kante fehlt if ( nEdges & 4 ) - bOpen = TRUE; // linke Kante oeffnet, weitersehen + bOpen = TRUE; // linke Kante oeffnet, weitersehen else if ( !bOpen ) - return TRUE; // es gibt was, was nicht geoeffnet wurde + return TRUE; // es gibt was, was nicht geoeffnet wurde if ( nEdges & 16 ) - bOpen = FALSE; // rechte Kante schliesst + bOpen = FALSE; // rechte Kante schliesst } } if ( bOpen ) - return TRUE; // es geht noch weiter + return TRUE; // es geht noch weiter } else { @@ -1623,15 +1623,15 @@ BOOL ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCR if ( (nEdges & n) != n ) return TRUE; if ( nEdges & 4 ) - bOpen = TRUE; // linke Kante oeffnet, weitersehen + bOpen = TRUE; // linke Kante oeffnet, weitersehen else if ( !bOpen ) - return TRUE; // es gibt was, was nicht geoeffnet wurde + return TRUE; // es gibt was, was nicht geoeffnet wurde if ( nEdges & 16 ) - bOpen = FALSE; // rechte Kante schliesst + bOpen = FALSE; // rechte Kante schliesst } } if ( bOpen ) - return TRUE; // es geht noch weiter + return TRUE; // es geht noch weiter } } return FALSE; @@ -1944,8 +1944,8 @@ const ScStyleSheet* ScTable::GetSelectionStyle( const ScMarkData& rMark, BOOL& r { rFound = FALSE; - BOOL bEqual = TRUE; - BOOL bColFound; + BOOL bEqual = TRUE; + BOOL bColFound; const ScStyleSheet* pStyle = NULL; const ScStyleSheet* pNewStyle; @@ -1958,7 +1958,7 @@ const ScStyleSheet* ScTable::GetSelectionStyle( const ScMarkData& rMark, BOOL& r { rFound = TRUE; if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) - bEqual = FALSE; // unterschiedliche + bEqual = FALSE; // unterschiedliche pStyle = pNewStyle; } } @@ -1967,13 +1967,13 @@ const ScStyleSheet* ScTable::GetSelectionStyle( const ScMarkData& rMark, BOOL& r } -const ScStyleSheet* ScTable::GetAreaStyle( BOOL& rFound, SCCOL nCol1, SCROW nRow1, +const ScStyleSheet* ScTable::GetAreaStyle( BOOL& rFound, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const { rFound = FALSE; - BOOL bEqual = TRUE; - BOOL bColFound; + BOOL bEqual = TRUE; + BOOL bColFound; const ScStyleSheet* pStyle = NULL; const ScStyleSheet* pNewStyle; @@ -1985,7 +1985,7 @@ const ScStyleSheet* ScTable::GetAreaStyle( BOOL& rFound, SCCOL nCol1, SCROW nRow { rFound = TRUE; if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) - bEqual = FALSE; // unterschiedliche + bEqual = FALSE; // unterschiedliche pStyle = pNewStyle; } } @@ -2095,7 +2095,7 @@ void ScTable::ClearSelectionItems( const USHORT* pWhich, const ScMarkData& rMark } -// Spaltenbreiten / Zeilenhoehen +// Spaltenbreiten / Zeilenhoehen void ScTable::SetColWidth( SCCOL nCol, USHORT nNewWidth ) { @@ -2103,7 +2103,7 @@ void ScTable::SetColWidth( SCCOL nCol, USHORT nNewWidth ) { if (!nNewWidth) { -// DBG_ERROR("Spaltenbreite 0 in SetColWidth"); +// DBG_ERROR("Spaltenbreite 0 in SetColWidth"); nNewWidth = STD_COL_WIDTH; } @@ -2159,12 +2159,12 @@ void ScTable::SetRowHeight( SCROW nRow, USHORT nNewHeight ) namespace { -/** - * Check if the new pixel size is different from the old size between - * specified ranges. +/** + * Check if the new pixel size is different from the old size between + * specified ranges. */ bool lcl_pixelSizeChanged( - ScFlatUInt16RowSegments& rRowHeights, SCROW nStartRow, SCROW nEndRow, + ScFlatUInt16RowSegments& rRowHeights, SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight, double nPPTY) { long nNewPix = static_cast<long>(nNewHeight * nPPTY); @@ -2177,7 +2177,7 @@ bool lcl_pixelSizeChanged( break; if (nHeight != nNewHeight) - { + { bool bChanged = (nNewPix != static_cast<long>(nHeight * nPPTY)); if (bChanged) return true; @@ -2323,7 +2323,7 @@ USHORT ScTable::GetColWidth( SCCOL nCol ) const } -USHORT ScTable::GetOriginalWidth( SCCOL nCol ) const // immer die eingestellte +USHORT ScTable::GetOriginalWidth( SCCOL nCol ) const // immer die eingestellte { DBG_ASSERT(VALIDCOL(nCol),"Falsche Spaltennummer"); @@ -2336,7 +2336,7 @@ USHORT ScTable::GetOriginalWidth( SCCOL nCol ) const // immer die eingest USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) { - // get the width that is used in the largest continuous column range (up to nEndCol) + // get the width that is used in the largest continuous column range (up to nEndCol) if ( !ValidCol(nEndCol) ) { @@ -2349,7 +2349,7 @@ USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) SCCOL nRangeStart = 0; while ( nRangeStart <= nEndCol ) { - // skip hidden columns + // skip hidden columns while ( nRangeStart <= nEndCol && ColHidden(nRangeStart) ) ++nRangeStart; if ( nRangeStart <= nEndCol ) @@ -2362,7 +2362,7 @@ USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) ++nThisCount; ++nRangeEnd; - // skip hidden columns + // skip hidden columns while ( nRangeEnd <= nEndCol && ColHidden(nRangeEnd) ) ++nRangeEnd; } @@ -2373,7 +2373,7 @@ USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) nMaxWidth = nThisWidth; } - nRangeStart = nRangeEnd; // next range + nRangeStart = nRangeEnd; // next range } } @@ -2402,9 +2402,9 @@ USHORT ScTable::GetRowHeight( SCROW nRow, SCROW* pStartRow, SCROW* pEndRow, bool return 0; } - // If bHiddenAsZero, pStartRow and pEndRow were initialized to - // boundaries of a non-hidden segment. Assume that the previous and - // next segment are hidden then and limit the current height + // If bHiddenAsZero, pStartRow and pEndRow were initialized to + // boundaries of a non-hidden segment. Assume that the previous and + // next segment are hidden then and limit the current height // segment. if (pStartRow) *pStartRow = (bHiddenAsZero ? std::max( *pStartRow, aData.mnRow1) : aData.mnRow1); @@ -2477,7 +2477,7 @@ ULONG ScTable::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale } -USHORT ScTable::GetOriginalHeight( SCROW nRow ) const // non-0 even if hidden +USHORT ScTable::GetOriginalHeight( SCROW nRow ) const // non-0 even if hidden { DBG_ASSERT(VALIDROW(nRow),"wrong row number"); @@ -2488,7 +2488,7 @@ USHORT ScTable::GetOriginalHeight( SCROW nRow ) const // non-0 even if hid } -// Spalten-/Zeilen-Flags +// Spalten-/Zeilen-Flags SCROW ScTable::GetHiddenRowCount( SCROW nRow ) @@ -2504,7 +2504,7 @@ SCROW ScTable::GetHiddenRowCount( SCROW nRow ) } -//! ShowRows / DBShowRows zusammenfassen +//! ShowRows / DBShowRows zusammenfassen void ScTable::ShowCol(SCCOL nCol, bool bShow) { @@ -2599,7 +2599,7 @@ void ScTable::DBShowRow(SCROW nRow, bool bShow) } } - // Filter-Flag immer setzen, auch wenn Hidden unveraendert + // Filter-Flag immer setzen, auch wenn Hidden unveraendert SetRowHidden(nRow, nRow, !bShow); SetRowFiltered(nRow, nRow, !bShow); DecRecalcLevel(); @@ -2662,9 +2662,9 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow) nStartRow = nEndRow + 1; } - // #i12341# For Show/Hide rows, the outlines are updated separately from the outside. - // For filtering, the changes aren't visible to the caller, so UpdateOutlineRow has - // to be done here. + // #i12341# For Show/Hide rows, the outlines are updated separately from the outside. + // For filtering, the changes aren't visible to the caller, so UpdateOutlineRow has + // to be done here. if (pOutlineTable) UpdateOutlineRow( nRow1, nRow2, bShow ); @@ -2772,7 +2772,7 @@ SCROW ScTable::GetLastFlaggedRow() const { SCROW nLastFound = 0; if (pRowFlags) - { + { SCROW nRow = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast<BYTE>(CR_ALL) ); if (ValidRow(nRow)) nLastFound = nRow; @@ -2910,7 +2910,7 @@ void ScTable::StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ) } -// Auto-Outline +// Auto-Outline template< typename T > short DiffSign( T a, T b ) @@ -2923,7 +2923,7 @@ short DiffSign( T a, T b ) void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) { BOOL bSizeChanged = FALSE; - BOOL bMissed = FALSE; + BOOL bMissed = FALSE; SCCOL nCol; SCROW nRow; @@ -2932,7 +2932,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC ScOutlineArray* pArray; ScBaseCell* pCell; ScRange aRef; -/* ScPatternAttr aBoldPattern( pDocument->GetPool() ); //! spezielle Format-Vorlage +/* ScPatternAttr aBoldPattern( pDocument->GetPool() ); //! spezielle Format-Vorlage aBoldPattern.GetItemSet().Put( SvxWeightItem( WEIGHT_BOLD ) ); */ @@ -2940,8 +2940,8 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC // Zeilen - SCROW nCount = nEndRow-nStartRow+1; - BOOL* pUsed = new BOOL[nCount]; + SCROW nCount = nEndRow-nStartRow+1; + BOOL* pUsed = new BOOL[nCount]; for (i=0; i<nCount; i++) pUsed[i] = FALSE; for (nCol=nStartCol; nCol<=nEndCol; nCol++) @@ -2967,7 +2967,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC { if (pArray->Insert( aRef.aStart.Row(), aRef.aEnd.Row(), bSizeChanged )) { -// ApplyPatternArea( nStartCol, nRow, nEndCol, nRow, aBoldPattern ); +// ApplyPatternArea( nStartCol, nRow, nEndCol, nRow, aBoldPattern ); bFound = TRUE; } else @@ -2998,7 +2998,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC { if (pArray->Insert( aRef.aStart.Col(), aRef.aEnd.Col(), bSizeChanged )) { -// ApplyPatternArea( nCol, nStartRow, nCol, nEndRow, aBoldPattern ); +// ApplyPatternArea( nCol, nStartRow, nCol, nEndRow, aBoldPattern ); bFound = TRUE; } else @@ -3009,12 +3009,12 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC } } - // CopyData - fuer Query in anderen Bereich + // CopyData - fuer Query in anderen Bereich void ScTable::CopyData( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCCOL nDestCol, SCROW nDestRow, SCTAB nDestTab ) { - //! wenn fuer mehrere Zeilen benutzt, nach Spalten optimieren! + //! wenn fuer mehrere Zeilen benutzt, nach Spalten optimieren! ScAddress aSrc( nStartCol, nStartRow, nTab ); ScAddress aDest( nDestCol, nDestRow, nDestTab ); @@ -3080,7 +3080,7 @@ BOOL ScTable::RefVisible(ScFormulaCell* pCell) } } - return TRUE; // irgendwie anders + return TRUE; // irgendwie anders } @@ -3105,7 +3105,7 @@ void ScTable::SetDrawPageSize(bool bResetStreamValid, bool bUpdateNoteCaptionPos x = (long) ((double) x * HMM_PER_TWIPS); y = (long) ((double) y * HMM_PER_TWIPS); - if ( IsLayoutRTL() ) // IsNegativePage + if ( IsLayoutRTL() ) // IsNegativePage x = -x; pDrawLayer->SetPageSize( static_cast<sal_uInt16>(nTab), Size( x, y ), bUpdateNoteCaptionPos ); diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index bd6a2c92c442..d3f025ba6084 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -1,7 +1,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 @@ -64,12 +64,12 @@ // STATIC DATA ----------------------------------------------------------- -const USHORT nMaxSorts = 3; // maximale Anzahl Sortierkriterien in aSortParam +const USHORT nMaxSorts = 3; // maximale Anzahl Sortierkriterien in aSortParam struct ScSortInfo { - ScBaseCell* pCell; - SCCOLROW nOrg; + ScBaseCell* pCell; + SCCOLROW nOrg; DECL_FIXEDMEMPOOL_NEWDEL( ScSortInfo ); }; const USHORT nMemPoolSortInfo = (0x8000 - 64) / sizeof(ScSortInfo); @@ -81,10 +81,10 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScSortInfo, nMemPoolSortInfo, nMemPoolSortInfo ) class ScSortInfoArray { private: - ScSortInfo** pppInfo[nMaxSorts]; - SCSIZE nCount; - SCCOLROW nStart; - USHORT nUsedSorts; + ScSortInfo** pppInfo[nMaxSorts]; + SCSIZE nCount; + SCCOLROW nStart; + USHORT nUsedSorts; public: ScSortInfoArray( USHORT nSorts, SCCOLROW nInd1, SCCOLROW nInd2 ) : @@ -109,9 +109,9 @@ public: delete [] ppInfo; } } - ScSortInfo* Get( USHORT nSort, SCCOLROW nInd ) + ScSortInfo* Get( USHORT nSort, SCCOLROW nInd ) { return (pppInfo[nSort])[ nInd - nStart ]; } - void Swap( SCCOLROW nInd1, SCCOLROW nInd2 ) + void Swap( SCCOLROW nInd1, SCCOLROW nInd2 ) { SCSIZE n1 = static_cast<SCSIZE>(nInd1 - nStart); SCSIZE n2 = static_cast<SCSIZE>(nInd2 - nStart); @@ -123,10 +123,10 @@ public: ppInfo[n2] = pTmp; } } - USHORT GetUsedSorts() { return nUsedSorts; } - ScSortInfo** GetFirstArray() { return pppInfo[0]; } - SCCOLROW GetStart() { return nStart; } - SCSIZE GetCount() { return nCount; } + USHORT GetUsedSorts() { return nUsedSorts; } + ScSortInfo** GetFirstArray() { return pppInfo[0]; } + SCCOLROW GetStart() { return nStart; } + SCSIZE GetCount() { return nCount; } }; ScSortInfoArray* ScTable::CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2 ) @@ -170,7 +170,7 @@ ScSortInfoArray* ScTable::CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2 ) BOOL ScTable::IsSortCollatorGlobal() const { - return pSortCollator == ScGlobal::GetCollator() || + return pSortCollator == ScGlobal::GetCollator() || pSortCollator == ScGlobal::GetCaseCollator(); } @@ -185,7 +185,7 @@ void ScTable::InitSortCollator( const ScSortParam& rPar ) rPar.aCollatorLocale, (rPar.bCaseSens ? 0 : SC_COLLATOR_IGNORES) ); } else - { // SYSTEM + { // SYSTEM DestroySortCollator(); pSortCollator = (rPar.bCaseSens ? ScGlobal::GetCaseCollator() : ScGlobal::GetCollator()); @@ -268,7 +268,7 @@ short ScTable::CompareCell( USHORT nSort, if ( eType2 == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell2)->IsValue() ) bStr2 = FALSE; - if ( bStr1 && bStr2 ) // nur Strings untereinander als String vergleichen! + if ( bStr1 && bStr2 ) // nur Strings untereinander als String vergleichen! { String aStr1; String aStr2; @@ -300,11 +300,11 @@ short ScTable::CompareCell( USHORT nSort, if (!bUserDef) nRes = (short) pSortCollator->compareString( aStr1, aStr2 ); } - else if ( bStr1 ) // String <-> Zahl - nRes = 1; // Zahl vorne - else if ( bStr2 ) // Zahl <-> String - nRes = -1; // Zahl vorne - else // Zahlen untereinander + else if ( bStr1 ) // String <-> Zahl + nRes = 1; // Zahl vorne + else if ( bStr2 ) // Zahl <-> String + nRes = -1; // Zahl vorne + else // Zahlen untereinander { double nVal1; double nVal2; @@ -336,7 +336,7 @@ short ScTable::CompareCell( USHORT nSort, if ( pCell2 ) nRes = 1; else - nRes = 0; // beide leer + nRes = 0; // beide leer } return nRes; } @@ -561,15 +561,15 @@ void ScTable::Sort(const ScSortParam& rSortParam, BOOL bKeepQuery) } -// Testen, ob beim Loeschen von Zwischenergebnissen andere Daten mit geloescht werden -// (fuer Hinweis-Box) +// Testen, ob beim Loeschen von Zwischenergebnissen andere Daten mit geloescht werden +// (fuer Hinweis-Box) BOOL ScTable::TestRemoveSubTotals( const ScSubTotalParam& rParam ) { SCCOL nStartCol = rParam.nCol1; - SCROW nStartRow = rParam.nRow1 + 1; // Header + SCROW nStartRow = rParam.nRow1 + 1; // Header SCCOL nEndCol = rParam.nCol2; - SCROW nEndRow = rParam.nRow2; + SCROW nEndRow = rParam.nRow2; SCCOL nCol; SCROW nRow; @@ -594,15 +594,15 @@ BOOL ScTable::TestRemoveSubTotals( const ScSubTotalParam& rParam ) return bWillDelete; } -// alte Ergebnisse loeschen -// rParam.nRow2 wird veraendert ! +// alte Ergebnisse loeschen +// rParam.nRow2 wird veraendert ! void ScTable::RemoveSubTotals( ScSubTotalParam& rParam ) { SCCOL nStartCol = rParam.nCol1; - SCROW nStartRow = rParam.nRow1 + 1; // Header + SCROW nStartRow = rParam.nRow1 + 1; // Header SCCOL nEndCol = rParam.nCol2; - SCROW nEndRow = rParam.nRow2; // wird veraendert + SCROW nEndRow = rParam.nRow2; // wird veraendert SCCOL nCol; SCROW nRow; @@ -624,10 +624,10 @@ void ScTable::RemoveSubTotals( ScSubTotalParam& rParam ) } } - rParam.nRow2 = nEndRow; // neues Ende + rParam.nRow2 = nEndRow; // neues Ende } -// harte Zahlenformate loeschen (fuer Ergebnisformeln) +// harte Zahlenformate loeschen (fuer Ergebnisformeln) void lcl_RemoveNumberFormat( ScTable* pTab, SCCOL nCol, SCROW nRow ) { @@ -654,24 +654,24 @@ typedef struct lcl_ScTable_DoSubTotals_RowEntry SCROW nFuncEnd; } RowEntry; -// neue Zwischenergebnisse -// rParam.nRow2 wird veraendert ! +// neue Zwischenergebnisse +// rParam.nRow2 wird veraendert ! BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) { SCCOL nStartCol = rParam.nCol1; - SCROW nStartRow = rParam.nRow1 + 1; // Header + SCROW nStartRow = rParam.nRow1 + 1; // Header SCCOL nEndCol = rParam.nCol2; - SCROW nEndRow = rParam.nRow2; // wird veraendert + SCROW nEndRow = rParam.nRow2; // wird veraendert USHORT i; - // Leerzeilen am Ende weglassen, - // damit alle Ueberlaeufe (MAXROW) bei InsertRow gefunden werden (#35180#) - // Wenn sortiert wurde, sind alle Leerzeilen am Ende. + // Leerzeilen am Ende weglassen, + // damit alle Ueberlaeufe (MAXROW) bei InsertRow gefunden werden (#35180#) + // Wenn sortiert wurde, sind alle Leerzeilen am Ende. SCSIZE nEmpty = GetEmptyLinesInBlock( nStartCol, nStartRow, nEndCol, nEndRow, DIR_BOTTOM ); nEndRow -= nEmpty; - USHORT nLevelCount = 0; // Anzahl Gruppierungen + USHORT nLevelCount = 0; // Anzahl Gruppierungen BOOL bDoThis = TRUE; for (i=0; i<MAXSUBTOTAL && bDoThis; i++) if (rParam.bGroupActive[i]) @@ -679,23 +679,23 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) else bDoThis = FALSE; - if (nLevelCount==0) // nichts tun + if (nLevelCount==0) // nichts tun return TRUE; - SCCOL* nGroupCol = rParam.nField; // Spalten nach denen + SCCOL* nGroupCol = rParam.nField; // Spalten nach denen // gruppiert wird - // #44444# Durch (leer) als eigene Kategorie muss immer auf - // Teilergebniszeilen aus den anderen Spalten getestet werden - // (frueher nur, wenn eine Spalte mehrfach vorkam) + // #44444# Durch (leer) als eigene Kategorie muss immer auf + // Teilergebniszeilen aus den anderen Spalten getestet werden + // (frueher nur, wenn eine Spalte mehrfach vorkam) BOOL bTestPrevSub = ( nLevelCount > 1 ); - String aSubString; - String aOutString; + String aSubString; + String aOutString; BOOL bIgnoreCase = !rParam.bCaseSens; - String *pCompString[MAXSUBTOTAL]; // Pointer wegen Compiler-Problemen + String *pCompString[MAXSUBTOTAL]; // Pointer wegen Compiler-Problemen for (i=0; i<MAXSUBTOTAL; i++) pCompString[i] = new String; @@ -704,7 +704,7 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) ScStyleSheet* pStyle = (ScStyleSheet*) pDocument->GetStyleSheetPool()->Find( ScGlobal::GetRscString(STR_STYLENAME_RESULT), SFX_STYLE_FAMILY_PARA ); - BOOL bSpaceLeft = TRUE; // Erfolg beim Einfuegen? + BOOL bSpaceLeft = TRUE; // Erfolg beim Einfuegen? // #90279# For performance reasons collect formula entries so their // references don't have to be tested for updates each time a new row is @@ -712,7 +712,7 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) RowEntry aRowEntry; ::std::vector< RowEntry > aRowVector; - for (USHORT nLevel=0; nLevel<=nLevelCount && bSpaceLeft; nLevel++) // incl. Gesamtergebnis + for (USHORT nLevel=0; nLevel<=nLevelCount && bSpaceLeft; nLevel++) // incl. Gesamtergebnis { BOOL bTotal = ( nLevel == nLevelCount ); aRowEntry.nGroupNo = bTotal ? 0 : (nLevelCount-nLevel-1); @@ -722,7 +722,7 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) // result functions ScSubTotalFunc* eResFunc = rParam.pFunctions[aRowEntry.nGroupNo]; - if (nResCount > 0) // sonst nur sortieren + if (nResCount > 0) // sonst nur sortieren { for (i=0; i<=aRowEntry.nGroupNo; i++) { @@ -731,9 +731,9 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) *pCompString[i] = ScGlobal::pCharClass->upper( aSubString ); else *pCompString[i] = aSubString; - } // aSubString bleibt auf dem letzten stehen + } // aSubString bleibt auf dem letzten stehen - BOOL bBlockVis = FALSE; // Gruppe eingeblendet? + BOOL bBlockVis = FALSE; // Gruppe eingeblendet? aRowEntry.nSubStartRow = nStartRow; for (SCROW nRow=nStartRow; nRow<=nEndRow+1 && bSpaceLeft; nRow++) { @@ -751,8 +751,8 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) GetString( nGroupCol[i], nRow, aString ); if (bIgnoreCase) ScGlobal::pCharClass->toUpper( aString ); - // #41427# wenn sortiert, ist "leer" eine eigene Gruppe - // sonst sind leere Zellen unten erlaubt + // #41427# wenn sortiert, ist "leer" eine eigene Gruppe + // sonst sind leere Zellen unten erlaubt bChanged = ( ( aString.Len() || rParam.bDoSort ) && aString != *pCompString[i] ); } @@ -804,10 +804,10 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) // collect formula positions aRowVector.push_back( aRowEntry ); - if (bTotal) // "Gesamtergebnis" + if (bTotal) // "Gesamtergebnis" aOutString = ScGlobal::GetRscString( STR_TABLE_GESAMTERGEBNIS ); else - { // " Ergebnis" + { // " Ergebnis" aOutString = aSubString; if (!aOutString.Len()) aOutString = ScGlobal::GetRscString( STR_EMPTYDATA ); @@ -816,17 +816,17 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) if ( nResCount == 1 ) switch ( eResFunc[0] ) { - case SUBTOTAL_FUNC_AVE: nStrId = STR_FUN_TEXT_AVG; break; + case SUBTOTAL_FUNC_AVE: nStrId = STR_FUN_TEXT_AVG; break; case SUBTOTAL_FUNC_CNT: - case SUBTOTAL_FUNC_CNT2: nStrId = STR_FUN_TEXT_COUNT; break; - case SUBTOTAL_FUNC_MAX: nStrId = STR_FUN_TEXT_MAX; break; - case SUBTOTAL_FUNC_MIN: nStrId = STR_FUN_TEXT_MIN; break; - case SUBTOTAL_FUNC_PROD: nStrId = STR_FUN_TEXT_PRODUCT; break; + case SUBTOTAL_FUNC_CNT2: nStrId = STR_FUN_TEXT_COUNT; break; + case SUBTOTAL_FUNC_MAX: nStrId = STR_FUN_TEXT_MAX; break; + case SUBTOTAL_FUNC_MIN: nStrId = STR_FUN_TEXT_MIN; break; + case SUBTOTAL_FUNC_PROD: nStrId = STR_FUN_TEXT_PRODUCT; break; case SUBTOTAL_FUNC_STD: - case SUBTOTAL_FUNC_STDP: nStrId = STR_FUN_TEXT_STDDEV; break; - case SUBTOTAL_FUNC_SUM: nStrId = STR_FUN_TEXT_SUM; break; + case SUBTOTAL_FUNC_STDP: nStrId = STR_FUN_TEXT_STDDEV; break; + case SUBTOTAL_FUNC_SUM: nStrId = STR_FUN_TEXT_SUM; break; case SUBTOTAL_FUNC_VAR: - case SUBTOTAL_FUNC_VARP: nStrId = STR_FUN_TEXT_VAR; break; + case SUBTOTAL_FUNC_VARP: nStrId = STR_FUN_TEXT_VAR; break; default: { // added to avoid warnings @@ -855,7 +855,7 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) } else { -// DBG_ERROR( "nSubTotals==0 bei DoSubTotals" ); +// DBG_ERROR( "nSubTotals==0 bei DoSubTotals" ); } } @@ -893,16 +893,16 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) { ApplyStyle( nResCols[nResult], iEntry->nDestRow, *pStyle ); - // Zahlformat loeschen + // Zahlformat loeschen lcl_RemoveNumberFormat( this, nResCols[nResult], iEntry->nDestRow ); } } } - //! je nach Einstellung Zwischensummen-Zeilen nach oben verschieben ? + //! je nach Einstellung Zwischensummen-Zeilen nach oben verschieben ? - //! Outlines direkt erzeugen? + //! Outlines direkt erzeugen? if (bSpaceLeft) DoAutoOutline( nStartCol, nStartRow, nEndCol, nEndRow ); @@ -910,7 +910,7 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) for (i=0; i<MAXSUBTOTAL; i++) delete pCompString[i]; - rParam.nRow2 = nEndRow; // neues Ende + rParam.nRow2 = nEndRow; // neues Ende return bSpaceLeft; } @@ -931,9 +931,9 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, BOOL* pPasst = ( nEntryCount <= nFixedBools ? &aBool[0] : new BOOL[nEntryCount] ); BOOL* pTest = ( nEntryCount <= nFixedBools ? &aTest[0] : new BOOL[nEntryCount] ); - long nPos = -1; - SCSIZE i = 0; - BOOL bMatchWholeCell = pDocument->GetDocOptions().IsMatchWholeCell(); + long nPos = -1; + SCSIZE i = 0; + BOOL bMatchWholeCell = pDocument->GetDocOptions().IsMatchWholeCell(); CollatorWrapper* pCollator = (rParam.bCaseSens ? ScGlobal::GetCaseCollator() : ScGlobal::GetCollator()); ::utl::TransliterationWrapper* pTransliteration = (rParam.bCaseSens ? @@ -958,7 +958,7 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, } else if ( !rEntry.bQueryByString && (pCell ? pCell->HasValueData() : HasValueData( static_cast<SCCOL>(rEntry.nField), nRow))) - { // by Value + { // by Value double nCellVal; if ( pCell ) { @@ -978,11 +978,11 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, else nCellVal = GetValue( static_cast<SCCOL>(rEntry.nField), nRow ); - /* NOTE: lcl_PrepareQuery() prepares a filter query such that if a - * date+time format was queried rEntry.bQueryByDate is not set. In - * case other queries wanted to use this mechanism they should do - * the same, in other words only if rEntry.nVal is an integer value - * rEntry.bQueryByDate should be true and the time fraction be + /* NOTE: lcl_PrepareQuery() prepares a filter query such that if a + * date+time format was queried rEntry.bQueryByDate is not set. In + * case other queries wanted to use this mechanism they should do + * the same, in other words only if rEntry.nVal is an integer value + * rEntry.bQueryByDate should be true and the time fraction be * stripped here. */ if (rEntry.bQueryByDate) { @@ -991,15 +991,15 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, if (pEntry) { short nNumFmtType = pEntry->GetType(); - /* NOTE: Omitting the check for absence of - * NUMBERFORMAT_TIME would include also date+time formatted - * values of the same day. That may be desired in some - * cases, querying all time values of a day, but confusing - * in other cases. A user can always setup a standard + /* NOTE: Omitting the check for absence of + * NUMBERFORMAT_TIME would include also date+time formatted + * values of the same day. That may be desired in some + * cases, querying all time values of a day, but confusing + * in other cases. A user can always setup a standard * filter query for x >= date AND x < date+1 */ if ((nNumFmtType & NUMBERFORMAT_DATE) && !(nNumFmtType & NUMBERFORMAT_TIME)) { - // The format is of date type. Strip off the time + // The format is of date type. Strip off the time // element. nCellVal = ::rtl::math::approxFloor(nCellVal); } @@ -1037,15 +1037,15 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, } } else if ( (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL) || - (rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN || + (rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN || rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_BEGIN_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH) || (rEntry.bQueryByString && (pCell ? pCell->HasStringData() : HasStringData( static_cast<SCCOL>(rEntry.nField), nRow)))) - { // by String - String aCellStr; + { // by String + String aCellStr; if( rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN || rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_BEGIN_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH ) @@ -1062,7 +1062,7 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, GetInputString( static_cast<SCCOL>(rEntry.nField), nRow, aCellStr ); BOOL bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL) - || (rEntry.eOp == SC_NOT_EQUAL) || (rEntry.eOp == SC_CONTAINS) + || (rEntry.eOp == SC_NOT_EQUAL) || (rEntry.eOp == SC_CONTAINS) || (rEntry.eOp == SC_DOES_NOT_CONTAIN) || (rEntry.eOp == SC_BEGINS_WITH) || (rEntry.eOp == SC_ENDS_WITH) || (rEntry.eOp == SC_DOES_NOT_BEGIN_WITH) || (rEntry.eOp == SC_DOES_NOT_END_WITH))); @@ -1073,7 +1073,7 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, { xub_StrLen nStart = 0; xub_StrLen nEnd = aCellStr.Len(); - + // from 614 on, nEnd is behind the found text BOOL bMatch = FALSE; if ( rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH ) @@ -1082,7 +1082,7 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, nStart = aCellStr.Len(); bMatch = (BOOL) rEntry.GetSearchTextPtr( rParam.bCaseSens ) ->SearchBkwrd( aCellStr, &nStart, &nEnd ); - } + } else { bMatch = (BOOL) rEntry.GetSearchTextPtr( rParam.bCaseSens ) @@ -1152,7 +1152,7 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, String aQuer( pTransliteration->transliterate( *rEntry.pStr, ScGlobal::eLnge, 0, rEntry.pStr->Len(), NULL ) ); - xub_StrLen nIndex = (rEntry.eOp == SC_ENDS_WITH + xub_StrLen nIndex = (rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH)? (aCell.Len()-aQuer.Len()):0; xub_StrLen nStrPos = aCell.Search( aQuer, nIndex ); switch (rEntry.eOp) @@ -1289,7 +1289,7 @@ void ScTable::TopTenQuery( ScQueryParam& rParam ) case SC_BOTPERC: { ScSortParam aLocalSortParam( rParam, static_cast<SCCOL>(rEntry.nField) ); - aSortParam = aLocalSortParam; // used in CreateSortInfoArray, Compare + aSortParam = aLocalSortParam; // used in CreateSortInfoArray, Compare if ( !bSortCollatorInitialized ) { bSortCollatorInitialized = TRUE; @@ -1311,9 +1311,9 @@ void ScTable::TopTenQuery( ScQueryParam& rParam ) if ( nValidCount > 0 ) { if ( rEntry.bQueryByString ) - { // dat wird nix + { // dat wird nix rEntry.bQueryByString = FALSE; - rEntry.nVal = 10; // 10 bzw. 10% + rEntry.nVal = 10; // 10 bzw. 10% } SCSIZE nVal = (rEntry.nVal >= 1 ? static_cast<SCSIZE>(rEntry.nVal) : 1); SCSIZE nOffset = 0; @@ -1324,7 +1324,7 @@ void ScTable::TopTenQuery( ScQueryParam& rParam ) rEntry.eOp = SC_GREATER_EQUAL; if ( nVal > nValidCount ) nVal = nValidCount; - nOffset = nValidCount - nVal; // 1 <= nVal <= nValidCount + nOffset = nValidCount - nVal; // 1 <= nVal <= nValidCount } break; case SC_BOTVAL: @@ -1332,7 +1332,7 @@ void ScTable::TopTenQuery( ScQueryParam& rParam ) rEntry.eOp = SC_LESS_EQUAL; if ( nVal > nValidCount ) nVal = nValidCount; - nOffset = nVal - 1; // 1 <= nVal <= nValidCount + nOffset = nVal - 1; // 1 <= nVal <= nValidCount } break; case SC_TOPPERC: @@ -1465,16 +1465,16 @@ static void lcl_PrepareQuery( ScDocument* pDoc, ScTable* pTab, ScQueryParam& rPa SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) { ScQueryParam aParam( rParamOrg ); - ScStrCollection aScStrCollection; - StrData* pStrData = NULL; + ScStrCollection aScStrCollection; + StrData* pStrData = NULL; - BOOL bStarted = FALSE; - BOOL bOldResult = TRUE; - SCROW nOldStart = 0; - SCROW nOldEnd = 0; + BOOL bStarted = FALSE; + BOOL bOldResult = TRUE; + SCROW nOldStart = 0; + SCROW nOldEnd = 0; - SCSIZE nCount = 0; - SCROW nOutRow = 0; + SCSIZE nCount = 0; + SCROW nOutRow = 0; SCROW nHeader = aParam.bHasHeader ? 1 : 0; SCSIZE nEntryCount = aParam.GetEntryCount(); @@ -1491,9 +1491,9 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) for (SCROW j=aParam.nRow1 + nHeader; j<=aParam.nRow2; j++) { - BOOL bResult; // Filterergebnis + BOOL bResult; // Filterergebnis BOOL bValid = ValidQuery(j, aParam, pSpecial); - if (!bValid && bKeepSub) // Subtotals stehenlassen + if (!bValid && bKeepSub) // Subtotals stehenlassen { for (SCCOL nCol=aParam.nCol1; nCol<=aParam.nCol2 && !bValid; nCol++) { @@ -1572,14 +1572,14 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) BOOL ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam) { - BOOL bValid = TRUE; + BOOL bValid = TRUE; SCCOL* pFields = new SCCOL[nCol2-nCol1+1]; - String aCellStr; - SCCOL nCol = nCol1; + String aCellStr; + SCCOL nCol = nCol1; DBG_ASSERT( rQueryParam.nTab != SCTAB_MAX, "rQueryParam.nTab no value, not bad but no good" ); - SCTAB nDBTab = (rQueryParam.nTab == SCTAB_MAX ? nTab : rQueryParam.nTab); - SCROW nDBRow1 = rQueryParam.nRow1; - SCCOL nDBCol2 = rQueryParam.nCol2; + SCTAB nDBTab = (rQueryParam.nTab == SCTAB_MAX ? nTab : rQueryParam.nTab); + SCROW nDBRow1 = rQueryParam.nRow1; + SCCOL nDBCol2 = rQueryParam.nCol2; // Erste Zeile muessen Spaltenkoepfe sein while (bValid && (nCol <= nCol2)) { @@ -1669,9 +1669,9 @@ BOOL ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 SCSIZE nIndex = 0; SCROW nRow = nRow1; DBG_ASSERT( rQueryParam.nTab != SCTAB_MAX, "rQueryParam.nTab no value, not bad but no good" ); - SCTAB nDBTab = (rQueryParam.nTab == SCTAB_MAX ? nTab : rQueryParam.nTab); - SCROW nDBRow1 = rQueryParam.nRow1; - SCCOL nDBCol2 = rQueryParam.nCol2; + SCTAB nDBTab = (rQueryParam.nTab == SCTAB_MAX ? nTab : rQueryParam.nTab); + SCROW nDBRow1 = rQueryParam.nRow1; + SCCOL nDBCol2 = rQueryParam.nCol2; SCSIZE nNewEntries = static_cast<SCSIZE>(nRow2-nRow1+1); rQueryParam.Resize( nNewEntries ); @@ -1775,13 +1775,13 @@ BOOL ScTable::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow nCount = rQueryParam.GetEntryCount(); if (bValid) { - // bQueryByString muss gesetzt sein + // bQueryByString muss gesetzt sein for (i=0; i < nCount; i++) rQueryParam.GetEntry(i).bQueryByString = TRUE; } else { - // nix + // nix for (i=0; i < nCount; i++) rQueryParam.GetEntry(i).Clear(); } @@ -1874,7 +1874,7 @@ ULONG ScTable::GetWeightedCount() const ULONG nCellCount = 0; for ( SCCOL nCol=0; nCol<=MAXCOL; nCol++ ) - if ( aCol[nCol].GetCellCount() ) // GetCellCount ist inline + if ( aCol[nCol].GetCellCount() ) // GetCellCount ist inline nCellCount += aCol[nCol].GetWeightedCount(); return nCellCount; @@ -1885,7 +1885,7 @@ ULONG ScTable::GetCodeCount() const ULONG nCodeCount = 0; for ( SCCOL nCol=0; nCol<=MAXCOL; nCol++ ) - if ( aCol[nCol].GetCellCount() ) // GetCellCount ist inline + if ( aCol[nCol].GetCellCount() ) // GetCellCount ist inline nCodeCount += aCol[nCol].GetCodeCount(); return nCodeCount; @@ -1900,7 +1900,7 @@ sal_Int32 ScTable::GetMaxStringLen( SCCOL nCol, SCROW nRowStart, return 0; } -xub_StrLen ScTable::GetMaxNumberStringLen( +xub_StrLen ScTable::GetMaxNumberStringLen( sal_uInt16& nPrecision, SCCOL nCol, SCROW nRowStart, SCROW nRowEnd ) const { if ( ValidCol(nCol) ) @@ -1913,8 +1913,8 @@ void ScTable::UpdateSelectionFunction( ScFunctionData& rData, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark ) { - // Cursor neben einer Markierung nicht beruecksichtigen: - //! nur noch MarkData uebergeben, Cursorposition ggf. hineinselektieren!!! + // Cursor neben einer Markierung nicht beruecksichtigen: + //! nur noch MarkData uebergeben, Cursorposition ggf. hineinselektieren!!! BOOL bSingle = ( rMark.IsMarked() || !rMark.IsMultiMarked() ); // Mehrfachselektion: @@ -1927,7 +1927,7 @@ void ScTable::UpdateSelectionFunction( ScFunctionData& rData, bSingle && ( nCol >= nStartCol && nCol <= nEndCol ), nStartRow, nEndRow ); - // Einfachselektion (oder Cursor) nur wenn nicht negativ (und s.o.): + // Einfachselektion (oder Cursor) nur wenn nicht negativ (und s.o.): if ( bSingle && !rMark.IsMarkNegative() ) for (nCol=nStartCol; nCol<=nEndCol && !rData.bError; nCol++) diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 434144d06e00..cbb4f01817ce 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1,7 +1,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 @@ -85,7 +85,7 @@ #define _D_MAX_LONG_ (double) 0x7fffffff -extern USHORT nScFillModeMouseModifier; // global.cxx +extern USHORT nScFillModeMouseModifier; // global.cxx // ----------------------------------------------------------------------- @@ -111,9 +111,9 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, USHORT* pMinDigits // prefer the one at the beginning only if it's followed by a space. // Otherwise, use the number at the end, to enable things like IP addresses. if ( nNum > nNeg && ( cNext == 0 || cNext == ' ' || !CharClass::isAsciiNumeric(cLast) ) ) - { // number at the beginning + { // number at the beginning nVal = aValue.Copy( 0, nNum ).ToInt32(); - // #60893# any number with a leading zero sets the minimum number of digits + // #60893# any number with a leading zero sets the minimum number of digits if ( p[nNeg] == '0' && pMinDigits && ( nNum - nNeg > *pMinDigits ) ) *pMinDigits = nNum - nNeg; aValue.Erase( 0, nNum ); @@ -131,9 +131,9 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, USHORT* pMinDigits nNeg = 1; } if ( nNum < nEnd - nNeg ) - { // number at the end + { // number at the end nVal = aValue.Copy( nNum + 1 ).ToInt32(); - // #60893# any number with a leading zero sets the minimum number of digits + // #60893# any number with a leading zero sets the minimum number of digits if ( p[nNum+1+nNeg] == '0' && pMinDigits && ( nEnd - nNum - nNeg > *pMinDigits ) ) *pMinDigits = nEnd - nNum - nNeg; aValue.Erase( nNum + 1 ); @@ -147,7 +147,7 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, USHORT* pMinDigits String lcl_ValueString( sal_Int32 nValue, USHORT nMinDigits ) { if ( nMinDigits <= 1 ) - return String::CreateFromInt32( nValue ); // simple case... + return String::CreateFromInt32( nValue ); // simple case... else { String aStr = String::CreateFromInt32( Abs( nValue ) ); @@ -157,7 +157,7 @@ String lcl_ValueString( sal_Int32 nValue, USHORT nMinDigits ) aZero.Fill( nMinDigits - aStr.Len(), '0' ); aStr.Insert( aZero, 0 ); } - // nMinDigits doesn't include the '-' sign -> add after inserting zeros + // nMinDigits doesn't include the '-' sign -> add after inserting zeros if ( nValue < 0 ) aStr.Insert( '-', 0 ); return aStr; @@ -199,7 +199,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, rListData = NULL; rCmd = FILL_SIMPLE; if ( nScFillModeMouseModifier & KEY_MOD1 ) - return ; // Ctrl-Taste: Copy + return ; // Ctrl-Taste: Copy SCCOL nAddX; SCROW nAddY; @@ -285,7 +285,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); } else - bVal = FALSE; // #50965# kein Datum passt auch nicht + bVal = FALSE; // #50965# kein Datum passt auch nicht } if (bVal) { @@ -300,7 +300,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } } } - else // einzelnes Datum -> Tage hochzaehlen + else // einzelnes Datum -> Tage hochzaehlen { rCmd = FILL_DATE; rDateCmd = FILL_DAY; @@ -359,8 +359,8 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } else if ( nCount > 1 ) { - // pass rMinDigits to all DecompValueString calls - // -> longest number defines rMinDigits + // pass rMinDigits to all DecompValueString calls + // -> longest number defines rMinDigits sal_Int32 nVal1; short nFlag1 = lcl_DecompValueString( aStr, nVal1, &rMinDigits ); @@ -408,7 +408,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } else { - // call DecompValueString to set rMinDigits + // call DecompValueString to set rMinDigits sal_Int32 nDummy; lcl_DecompValueString( aStr, nDummy, &rMinDigits ); } @@ -418,11 +418,11 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, void ScTable::FillFormula(ULONG& /* nFormulaCounter */, BOOL /* bFirst */, ScFormulaCell* pSrcCell, SCCOL nDestCol, SCROW nDestRow, BOOL bLast ) { -/* USHORT nTokArrLen = pSrcCell->GetTokenArrayLen(); - if ( nTokArrLen > 15 ) // mehr als =A1 oder =67 +/* USHORT nTokArrLen = pSrcCell->GetTokenArrayLen(); + if ( nTokArrLen > 15 ) // mehr als =A1 oder =67 { ScRangeName* pRangeName = pDocument->GetRangeName(); - String aName("___SC_"); // Wird dieser String veraendert, + String aName("___SC_"); // Wird dieser String veraendert, // auch in document2 EraseNonUsed... // mitaendern!! aName += pRangeName->GetSharedMaxIndex() + 1; @@ -455,8 +455,8 @@ void ScTable::FillFormula(ULONG& /* nFormulaCounter */, BOOL /* bFirst */, ScFor aCol[nDestCol].Insert(nDestRow, pDestCell); } else -*/ { - pDocument->SetNoListening( TRUE ); // noch falsche Referenzen +*/ { + pDocument->SetNoListening( TRUE ); // noch falsche Referenzen ScAddress aAddr( nDestCol, nDestRow, nTab ); ScFormulaCell* pDestCell = new ScFormulaCell( *pSrcCell, *pDocument, aAddr ); aCol[nDestCol].Insert(nDestRow, pDestCell); @@ -509,7 +509,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, return; // - // Richtung auswerten + // Richtung auswerten // BOOL bVertical = (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_TOP); @@ -517,7 +517,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ULONG nCol = 0; ULONG nRow = 0; - ULONG& rInner = bVertical ? nRow : nCol; // Schleifenvariablen + ULONG& rInner = bVertical ? nRow : nCol; // Schleifenvariablen ULONG& rOuter = bVertical ? nCol : nRow; ULONG nOStart; ULONG nOEnd; @@ -575,15 +575,15 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ULONG nProgress = rProgress.GetState(); // - // ausfuehren + // ausfuehren // ULONG nActFormCnt = 0; for (rOuter = nOStart; rOuter <= nOEnd; rOuter++) { - ULONG nMaxFormCnt = 0; // fuer Formeln + ULONG nMaxFormCnt = 0; // fuer Formeln - // Attributierung uebertragen + // Attributierung uebertragen const ScPatternAttr* pSrcPattern = NULL; const ScStyleSheet* pStyleSheet = NULL; @@ -597,13 +597,13 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { if ( pNewPattern ) delete pNewPattern; - if (bVertical) // rInner&:=nRow, rOuter&:=nCol + if (bVertical) // rInner&:=nRow, rOuter&:=nCol pSrcPattern = aCol[nCol].GetPattern(static_cast<SCROW>(nAtSrc)); else // rInner&:=nCol, rOuter&:=nRow pSrcPattern = aCol[nAtSrc].GetPattern(static_cast<SCROW>(nRow)); bGetPattern = FALSE; pStyleSheet = pSrcPattern->GetStyleSheet(); - // Merge/Mergeflag nicht uebernehmen, + // Merge/Mergeflag nicht uebernehmen, const SfxItemSet& rSet = pSrcPattern->GetItemSet(); if ( rSet.GetItemState(ATTR_MERGE, FALSE) == SFX_ITEM_SET || rSet.GetItemState(ATTR_MERGE_FLAG, FALSE) == SFX_ITEM_SET ) @@ -619,10 +619,10 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if ( bVertical && nISrcStart == nISrcEnd ) { - // Attribute komplett am Stueck setzen + // Attribute komplett am Stueck setzen if (pNewPattern || pSrcPattern != pDocument->GetDefPattern()) { - // Default steht schon da (DeleteArea) + // Default steht schon da (DeleteArea) SCROW nY1 = static_cast<SCROW>(Min( nIStart, nIEnd )); SCROW nY2 = static_cast<SCROW>(Max( nIStart, nIEnd )); if ( pStyleSheet ) @@ -632,17 +632,17 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, else aCol[nCol].ApplyPatternArea( nY1, nY2, *pSrcPattern ); } - break; // Schleife abbrechen + break; // Schleife abbrechen } if ( pSrcPattern != aCol[nCol].GetPattern( static_cast<SCROW>(nRow) ) ) { - // Vorlage auch uebernehmen - //! am AttrArray mit ApplyPattern zusammenfassen ?? + // Vorlage auch uebernehmen + //! am AttrArray mit ApplyPattern zusammenfassen ?? if ( pStyleSheet ) aCol[nCol].ApplyStyle( static_cast<SCROW>(nRow), *pStyleSheet ); - // ApplyPattern statt SetPattern um alte MergeFlags stehenzulassen + // ApplyPattern statt SetPattern um alte MergeFlags stehenzulassen if ( pNewPattern ) aCol[nCol].ApplyPattern( static_cast<SCROW>(nRow), *pNewPattern ); else @@ -652,7 +652,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (nAtSrc==nISrcEnd) { if ( nAtSrc != nISrcStart ) - { // mehr als eine Source-Zelle + { // mehr als eine Source-Zelle nAtSrc = nISrcStart; bGetPattern = TRUE; } @@ -674,7 +674,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if ( pNewPattern ) delete pNewPattern; - // Analyse + // Analyse FillCmd eFillCmd; FillDateCmd eDateCmd; @@ -699,7 +699,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nListCount = pListData->GetSubCount(); if ( !bPositive ) { - // nListIndex auf FillAnalyse zeigt auf den letzten Eintrag -> anpassen + // nListIndex auf FillAnalyse zeigt auf den letzten Eintrag -> anpassen ULONG nSub = nISrcStart - nISrcEnd; for (ULONG i=0; i<nSub; i++) { @@ -729,7 +729,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, nProgress += nIMax - nIMin + 1; rProgress.SetStateOnPercent( nProgress ); } - else if (eFillCmd == FILL_SIMPLE) // Auffuellen mit Muster + else if (eFillCmd == FILL_SIMPLE) // Auffuellen mit Muster { ULONG nSource = nISrcStart; double nDelta; @@ -756,9 +756,9 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { if ( bGetCell ) { - if (bVertical) // rInner&:=nRow, rOuter&:=nCol + if (bVertical) // rInner&:=nRow, rOuter&:=nCol pSrcCell = aCol[nCol].GetCell( static_cast<SCROW>(nSource) ); - else // rInner&:=nCol, rOuter&:=nRow + else // rInner&:=nCol, rOuter&:=nRow pSrcCell = aCol[nSource].GetCell( static_cast<SCROW>(nRow) ); bGetCell = FALSE; if ( pSrcCell ) @@ -777,7 +777,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ((ScEditCell*)pSrcCell)->GetString( aValue ); if ( !(nScFillModeMouseModifier & KEY_MOD1) ) { - nCellDigits = 0; // look at each source cell individually + nCellDigits = 0; // look at each source cell individually nHeadNoneTail = lcl_DecompValueString( aValue, nStringValue, &nCellDigits ); @@ -857,7 +857,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (nSource==nISrcEnd) { if ( nSource != nISrcStart ) - { // mehr als eine Source-Zelle + { // mehr als eine Source-Zelle nSource = nISrcStart; bGetCell = TRUE; } @@ -882,8 +882,8 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bGetCell = TRUE; } - // Progress in der inneren Schleife nur bei teuren Zellen, - // und auch dann nicht fuer jede einzelne + // Progress in der inneren Schleife nur bei teuren Zellen, + // und auch dann nicht fuer jede einzelne ++nProgress; if ( eCellType == CELLTYPE_FORMULA || eCellType == CELLTYPE_EDIT ) @@ -928,29 +928,29 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n long nIndex = 0; ULONG nSrcCount = 0; FillDir eFillDir = FILL_TO_BOTTOM; - if ( nEndX == nCol2 && nEndY == nRow2 ) // leer + if ( nEndX == nCol2 && nEndY == nRow2 ) // leer bOk = FALSE; - else if ( nEndX == nCol2 ) // nach oben/unten + else if ( nEndX == nCol2 ) // nach oben/unten { - nEndX = nCol2 = nCol1; // nur erste Spalte ansehen + nEndX = nCol2 = nCol1; // nur erste Spalte ansehen nSrcCount = nRow2 - nRow1 + 1; - nIndex = ((long)nEndY) - nRow1; // kann negativ werden + nIndex = ((long)nEndY) - nRow1; // kann negativ werden if ( nEndY >= nRow1 ) eFillDir = FILL_TO_BOTTOM; else eFillDir = FILL_TO_TOP; } - else if ( nEndY == nRow2 ) // nach links/rechts + else if ( nEndY == nRow2 ) // nach links/rechts { - nEndY = nRow2 = nRow1; // nur erste Zeile ansehen + nEndY = nRow2 = nRow1; // nur erste Zeile ansehen nSrcCount = nCol2 - nCol1 + 1; - nIndex = ((long)nEndX) - nCol1; // kann negativ werden + nIndex = ((long)nEndX) - nCol1; // kann negativ werden if ( nEndX >= nCol1 ) eFillDir = FILL_TO_RIGHT; else eFillDir = FILL_TO_LEFT; } - else // Richtung nicht eindeutig + else // Richtung nicht eindeutig bOk = FALSE; if ( bOk ) @@ -964,19 +964,19 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n FillAnalyse(nCol1,nRow1, nCol2,nRow2, eFillCmd,eDateCmd, nInc,nMinDigits, pListData,nListIndex); - if ( pListData ) // benutzerdefinierte Liste + if ( pListData ) // benutzerdefinierte Liste { USHORT nListCount = pListData->GetSubCount(); if ( nListCount ) { - ULONG nSub = nSrcCount - 1; // nListIndex ist vom letzten Source-Eintrag + ULONG nSub = nSrcCount - 1; // nListIndex ist vom letzten Source-Eintrag while ( nIndex < sal::static_int_cast<long>(nSub) ) nIndex += nListCount; ULONG nPos = ( nListIndex + nIndex - nSub ) % nListCount; aValue = pListData->GetSubStr(sal::static_int_cast<USHORT>(nPos)); } } - else if ( eFillCmd == FILL_SIMPLE ) // Auffuellen mit Muster + else if ( eFillCmd == FILL_SIMPLE ) // Auffuellen mit Muster { long nPosIndex = nIndex; while ( nPosIndex < 0 ) @@ -989,14 +989,14 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n else nSrcX = sal::static_int_cast<SCCOL>( nSrcX + static_cast<SCCOL>(nPos) ); - ScBaseCell* pCell = GetCell( nSrcX, nSrcY ); + ScBaseCell* pCell = GetCell( nSrcX, nSrcY ); if ( pCell ) { sal_Int32 nDelta; if (nIndex >= 0) nDelta = nIndex / nSrcCount; else - nDelta = ( nIndex - nSrcCount + 1 ) / nSrcCount; // -1 -> -1 + nDelta = ( nIndex - nSrcCount + 1 ) / nSrcCount; // -1 -> -1 CellType eType = pCell->GetCellType(); switch ( eType ) @@ -1011,7 +1011,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n if ( !(nScFillModeMouseModifier & KEY_MOD1) ) { sal_Int32 nVal; - USHORT nCellDigits = 0; // look at each source cell individually + USHORT nCellDigits = 0; // look at each source cell individually short nFlag = lcl_DecompValueString( aValue, nVal, &nCellDigits ); if ( nFlag < 0 ) { @@ -1027,7 +1027,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n break; case CELLTYPE_VALUE: { - // dabei kann's keinen Ueberlauf geben... + // dabei kann's keinen Ueberlauf geben... double nVal = ((ScValueCell*)pCell)->GetValue(); if ( !(nScFillModeMouseModifier & KEY_MOD1) ) nVal += (double) nDelta; @@ -1038,7 +1038,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n GetOutputString( nVal, nNumFmt, aValue, &pColor ); } break; - // Formeln nicht + // Formeln nicht default: { // added to avoid warnings @@ -1046,13 +1046,13 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n } } } - else if ( eFillCmd == FILL_LINEAR || eFillCmd == FILL_DATE ) // Werte + else if ( eFillCmd == FILL_LINEAR || eFillCmd == FILL_DATE ) // Werte { BOOL bValueOk; double nStart; sal_Int32 nVal = 0; short nHeadNoneTail = 0; - ScBaseCell* pCell = GetCell( nCol1, nRow1 ); + ScBaseCell* pCell = GetCell( nCol1, nRow1 ); if ( pCell ) { CellType eType = pCell->GetCellType(); @@ -1090,7 +1090,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n bValueOk = ( SubTotal::SafeMult( nAdd, (double) nIndex ) && SubTotal::SafePlus( nStart, nAdd ) ); } - else // Datum + else // Datum { bValueOk = TRUE; USHORT nDayOfMonth = 0; @@ -1119,7 +1119,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n } else { - //! Zahlformat je nach Index holen? + //! Zahlformat je nach Index holen? Color* pColor; ULONG nNumFmt = GetNumberFormat( nCol1, nRow1 ); pDocument->GetFormatTable()-> @@ -1148,7 +1148,7 @@ void ScTable::IncDate(double& rVal, USHORT& nDayOfMonth, double nStep, FillDateC const USHORT nMinYear = 1583; const USHORT nMaxYear = 9956; - long nInc = (long) nStep; // nach oben/unten begrenzen ? + long nInc = (long) nStep; // nach oben/unten begrenzen ? Date aNullDate = *pDocument->GetFormatTable()->GetNullDate(); Date aDate = aNullDate; aDate += (long)rVal; @@ -1177,7 +1177,7 @@ void ScTable::IncDate(double& rVal, USHORT& nDayOfMonth, double nStep, FillDateC case FILL_MONTH: { if ( nDayOfMonth == 0 ) - nDayOfMonth = aDate.GetDay(); // init + nDayOfMonth = aDate.GetDay(); // init long nMonth = aDate.GetMonth(); long nYear = aDate.GetYear(); @@ -1196,7 +1196,7 @@ void ScTable::IncDate(double& rVal, USHORT& nDayOfMonth, double nStep, FillDateC { if (nMonth < 1) { - long nYAdd = 1 - nMonth / 12; // positiv + long nYAdd = 1 - nMonth / 12; // positiv nMonth += nYAdd * 12; nYear -= nYAdd; } @@ -1242,7 +1242,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, BOOL bAttribs, ScProgress& rProgress ) { // - // Richtung auswerten + // Richtung auswerten // BOOL bVertical = (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_TOP); @@ -1250,7 +1250,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ULONG nCol = 0; ULONG nRow = 0; - ULONG& rInner = bVertical ? nRow : nCol; // Schleifenvariablen + ULONG& rInner = bVertical ? nRow : nCol; // Schleifenvariablen ULONG& rOuter = bVertical ? nCol : nRow; ULONG nOStart; ULONG nOEnd; @@ -1311,7 +1311,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ULONG nProgress = rProgress.GetState(); // - // ausfuehren + // ausfuehren // ULONG nActFormCnt = 0; @@ -1339,7 +1339,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { CellType eCellType = pSrcCell->GetCellType(); - if (eFillCmd == FILL_SIMPLE) // kopieren + if (eFillCmd == FILL_SIMPLE) // kopieren { if (eCellType == CELLTYPE_FORMULA) { @@ -1386,8 +1386,8 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { case FILL_LINEAR: { - // #86365# use multiplication instead of repeated addition - // to avoid accumulating rounding errors + // #86365# use multiplication instead of repeated addition + // to avoid accumulating rounding errors nVal = nStartVal; double nAdd = nStepValue; if ( !SubTotal::SafeMult( nAdd, (double) ++nIndex ) || @@ -1413,7 +1413,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (nStepValue >= 0) { - if (nVal > nMaxValue) // Zielwert erreicht? + if (nVal > nMaxValue) // Zielwert erreicht? { nVal = nMaxValue; bOverflow = TRUE; @@ -1480,8 +1480,8 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { case FILL_LINEAR: { - // #86365# use multiplication instead of repeated addition - // to avoid accumulating rounding errors + // #86365# use multiplication instead of repeated addition + // to avoid accumulating rounding errors nVal = nStartVal; double nAdd = nStepValue; if ( !SubTotal::SafeMult( nAdd, (double) ++nIndex ) || @@ -1501,7 +1501,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (nStepValue >= 0) { - if (nVal > nMaxValue) // Zielwert erreicht? + if (nVal > nMaxValue) // Zielwert erreicht? { nVal = nMaxValue; bOverflow = TRUE; @@ -1577,9 +1577,9 @@ void ScTable::Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, FillSeries(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, eFillCmd, eFillDateCmd, nStepValue, nMaxValue, 0, TRUE, aProgress); - if (bSharedNameInserted) // Wurde Shared-Name eingefuegt? + if (bSharedNameInserted) // Wurde Shared-Name eingefuegt? pDocument->GetRangeName()->SetSharedMaxIndex( - pDocument->GetRangeName()->GetSharedMaxIndex()+1); // dann hochzaehlen + pDocument->GetRangeName()->GetSharedMaxIndex()+1); // dann hochzaehlen } @@ -1592,7 +1592,7 @@ void ScTable::AutoFormatArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC ScAutoFormatData* pData = (*pAutoFormat)[nFormatNo]; if (pData) { -// ScPatternAttr aPattern(pDocument->GetPool()); +// ScPatternAttr aPattern(pDocument->GetPool()); // pData->FillToItemSet(nIndex, aPattern.GetItemSet(), *pDocument); ApplyPatternArea(nStartCol, nStartRow, nEndCol, nEndRow, rAttr); } @@ -1744,7 +1744,7 @@ void ScTable::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW void ScTable::GetAutoFormatAttr(SCCOL nCol, SCROW nRow, USHORT nIndex, ScAutoFormatData& rData) { UINT32 nFormatIndex = GetNumberFormat( nCol, nRow ); - ScNumFormatAbbrev aNumFormat( nFormatIndex, *pDocument->GetFormatTable() ); + ScNumFormatAbbrev aNumFormat( nFormatIndex, *pDocument->GetFormatTable() ); rData.GetFromItemSet( nIndex, GetPattern( nCol, nRow )->GetItemSet(), aNumFormat ); } @@ -1909,7 +1909,7 @@ void ScTable::UpdateInsertTabAbs(SCTAB nTable) BOOL ScTable::GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, BOOL bInSel, const ScMarkData& rMark) const { - if (rRow == MAXROW+2) // Tabellenende + if (rRow == MAXROW+2) // Tabellenende { rRow = 0; rCol = 0; diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index 7c13756aab38..64e0577a28c0 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -62,7 +62,7 @@ using ::std::set; // STATIC DATA ----------------------------------------------------------- -#define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue() +#define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue() void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) @@ -70,14 +70,14 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) if ( pDocument->IsImportingXML() ) return; - // pUserArea != NULL -> print area is specified. We need to force-update + // pUserArea != NULL -> print area is specified. We need to force-update // the page breaks. if (!pUserArea) { if (!bPageSizeValid) return; - + if (mbPageBreaksValid) return; } @@ -109,7 +109,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) USHORT nAreaCount = GetPrintRangeCount(); if ( nAreaCount > 1 ) { - // bei mehreren Bereichen nichts anzeigen: + // bei mehreren Bereichen nichts anzeigen: for (nX=0; nX<MAXCOL; nX++) RemoveColBreak(nX, true, false); @@ -128,7 +128,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) nEndCol = pArea->aEnd.Col(); nEndRow = pArea->aEnd.Row(); } - } // sonst alles + } // sonst alles } // get bSkipColBreaks/bSkipRowBreaks flags: @@ -157,7 +157,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) long nPageSizeX = aPageSizeTwips.Width(); long nPageSizeY = aPageSizeTwips.Height(); - // Anfang: Breaks loeschen + // Anfang: Breaks loeschen for (nX=0; nX<nStartCol; nX++) RemoveColBreak(nX, true, false); @@ -168,7 +168,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) if (nStartRow > 0) SetRowBreak(nStartRow, true, false); // AREABREAK - // Mittelteil: Breaks verteilen + // Mittelteil: Breaks verteilen BOOL bRepeatCol = ( nRepeatStartX != SCCOL_REPEAT_NONE ); BOOL bColFound = FALSE; @@ -220,7 +220,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) long nThisY = 0; if (!bThisRowHidden) { - sal_uInt16 nTmp; + sal_uInt16 nTmp; aIterHeights.getValue(nY, nTmp); nThisY = static_cast<long>(nTmp); } @@ -276,7 +276,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) SCROW nLastCommon = ::std::min(nLastHidden, nLastHeight); if (nNextManualBreak >= 0) nLastCommon = ::std::min(nLastCommon, nNextManualBreak-1); - + if (nLastCommon > nY) { long nMaxMultiple = static_cast<long>(nLastCommon - nY); @@ -294,7 +294,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) nSizeY += nThisY; } - // Ende: Breaks loeschen + // Ende: Breaks loeschen if (nEndCol < MAXCOL) { @@ -349,7 +349,7 @@ void ScTable::GetAllRowBreaks(set<SCROW>& rBreaks, bool bPage, bool bManual) con if (bManual) { - using namespace std; + using namespace std; copy(maRowManualBreaks.begin(), maRowManualBreaks.end(), inserter(rBreaks, rBreaks.begin())); } } @@ -425,7 +425,7 @@ void ScTable::RemoveRowBreak(SCROW nRow, bool bPage, bool bManual) maRowPageBreaks.erase(nRow); if (bManual) - { + { maRowManualBreaks.erase(nRow); InvalidatePageBreaks(); } @@ -440,7 +440,7 @@ void ScTable::RemoveColBreak(SCCOL nCol, bool bPage, bool bManual) maColPageBreaks.erase(nCol); if (bManual) - { + { maColManualBreaks.erase(nCol); InvalidatePageBreaks(); } @@ -455,7 +455,7 @@ void ScTable::SetRowBreak(SCROW nRow, bool bPage, bool bManual) maRowPageBreaks.insert(nRow); if (bManual) - { + { maRowManualBreaks.insert(nRow); InvalidatePageBreaks(); } @@ -470,7 +470,7 @@ void ScTable::SetColBreak(SCCOL nCol, bool bPage, bool bManual) maColPageBreaks.insert(nCol); if (bManual) - { + { maColManualBreaks.insert(nCol); InvalidatePageBreaks(); } @@ -532,7 +532,7 @@ bool ScTable::RowHidden(SCROW nRow, SCROW* pFirstRow, SCROW* pLastRow) const bool ScTable::RowHidden(SCROW nRow, SCROW& rLastRow) const { - rLastRow = nRow; + rLastRow = nRow; if (!ValidRow(nRow)) return true; @@ -562,7 +562,7 @@ bool ScTable::HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const bool ScTable::ColHidden(SCCOL nCol, SCCOL& rLastCol) const { - rLastCol = nCol; + rLastCol = nCol; if (!ValidCol(nCol)) return true; @@ -1051,7 +1051,7 @@ Size ScTable::GetPageSize() const if ( bPageSizeValid ) return aPageSizeTwips; else - return Size(); // leer + return Size(); // leer } void ScTable::SetRepeatArea( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow ) @@ -1076,9 +1076,9 @@ void ScTable::SetPageStyle( const String& rName ) { if ( aPageStyle != rName ) { - String aStrNew = rName; - SfxStyleSheetBasePool* pStylePool = pDocument->GetStyleSheetPool(); - SfxStyleSheetBase* pNewStyle = pStylePool->Find( aStrNew, SFX_STYLE_FAMILY_PAGE ); + String aStrNew = rName; + SfxStyleSheetBasePool* pStylePool = pDocument->GetStyleSheetPool(); + SfxStyleSheetBase* pNewStyle = pStylePool->Find( aStrNew, SFX_STYLE_FAMILY_PAGE ); if ( !pNewStyle ) { @@ -1092,18 +1092,18 @@ void ScTable::SetPageStyle( const String& rName ) if ( pOldStyle && pNewStyle ) { - SfxItemSet& rOldSet = pOldStyle->GetItemSet(); - SfxItemSet& rNewSet = pNewStyle->GetItemSet(); - const USHORT nOldScale = GET_SCALEVALUE(rOldSet,ATTR_PAGE_SCALE); + SfxItemSet& rOldSet = pOldStyle->GetItemSet(); + SfxItemSet& rNewSet = pNewStyle->GetItemSet(); + const USHORT nOldScale = GET_SCALEVALUE(rOldSet,ATTR_PAGE_SCALE); const USHORT nOldScaleToPages = GET_SCALEVALUE(rOldSet,ATTR_PAGE_SCALETOPAGES); - const USHORT nNewScale = GET_SCALEVALUE(rNewSet,ATTR_PAGE_SCALE); + const USHORT nNewScale = GET_SCALEVALUE(rNewSet,ATTR_PAGE_SCALE); const USHORT nNewScaleToPages = GET_SCALEVALUE(rNewSet,ATTR_PAGE_SCALETOPAGES); if ( (nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages) ) InvalidateTextWidth(NULL, NULL, FALSE, FALSE); } - if ( pNewStyle ) // auch ohne den alten (fuer UpdateStdNames) + if ( pNewStyle ) // auch ohne den alten (fuer UpdateStdNames) aPageStyle = aStrNew; if (IsStreamValid()) @@ -1130,7 +1130,7 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p if ( bNumFormatChanged ) pCell->SetScriptType( SC_SCRIPTTYPE_UNKNOWN ); if ( bBroadcast ) - { // nur bei CalcAsShown + { // nur bei CalcAsShown switch ( pCell->GetCellType() ) { case CELLTYPE_VALUE : @@ -1159,8 +1159,8 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p for ( SCCOL nCol=nColStart; nCol<=nColEnd; nCol++ ) { ScColumnIterator aIter( &aCol[nCol], nRowStart, nRowEnd ); - ScBaseCell* pCell = NULL; - SCROW nRow = nRowStart; + ScBaseCell* pCell = NULL; + SCROW nRow = nRowStart; while ( aIter.Next( nRow, pCell ) ) { @@ -1168,7 +1168,7 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p if ( bNumFormatChanged ) pCell->SetScriptType( SC_SCRIPTTYPE_UNKNOWN ); if ( bBroadcast ) - { // nur bei CalcAsShown + { // nur bei CalcAsShown switch ( pCell->GetCellType() ) { case CELLTYPE_VALUE : diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 500ac1bb3614..381cd9c00254 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -1,7 +1,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 @@ -51,7 +51,7 @@ BOOL lcl_GetTextWithBreaks( const ScEditCell& rCell, ScDocument* pDoc, String& rVal ) { - // TRUE = more than 1 paragraph + // TRUE = more than 1 paragraph const EditTextObject* pData = NULL; rCell.GetData( pData ); @@ -64,11 +64,11 @@ BOOL lcl_GetTextWithBreaks( const ScEditCell& rCell, ScDocument* pDoc, String& r BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRow, const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) { - BOOL bFound = FALSE; - BOOL bDoSearch = TRUE; - BOOL bDoBack = rSearchItem.GetBackward(); + BOOL bFound = FALSE; + BOOL bDoSearch = TRUE; + BOOL bDoBack = rSearchItem.GetBackward(); - String aString; + String aString; ScBaseCell* pCell; if (rSearchItem.GetSelection()) bDoSearch = rMark.IsCellMarked(nCol, nRow); @@ -159,8 +159,8 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo BOOL bRepeat = !rSearchItem.GetWordOnly(); do { - // wenn der gefundene Text leer ist, nicht weitersuchen, - // sonst wuerde man nie mehr aufhoeren (#35410#) + // wenn der gefundene Text leer ist, nicht weitersuchen, + // sonst wuerde man nie mehr aufhoeren (#35410#) if ( nEnd < nStart || nEnd == STRING_MAXLEN ) bRepeat = FALSE; @@ -178,7 +178,7 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo aString.Insert(rSearchItem.GetReplaceString(), nStart); } - // Indizes anpassen + // Indizes anpassen if (bDoBack) { nEnd = nStart; @@ -190,7 +190,7 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo nEnd = aString.Len(); } - // weitersuchen ? + // weitersuchen ? if (bRepeat) { if ( rSearchItem.GetCommand() != SVX_SEARCHCMD_REPLACE_ALL || nStart >= nEnd ) @@ -219,9 +219,9 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo pNote->SetText( ScAddress( nCol, nRow, nTab ), aString ); } else if ( cMatrixFlag != MM_NONE ) - { // #60558# Matrix nicht zerreissen + { // #60558# Matrix nicht zerreissen if ( aString.Len() > 2 ) - { // {} raus, erst hier damit auch "{=" durch "{=..." ersetzt werden kann + { // {} raus, erst hier damit auch "{=" durch "{=..." ersetzt werden kann if ( aString.GetChar( aString.Len()-1 ) == '}' ) aString.Erase( aString.Len()-1, 1 ); if ( aString.GetChar(0) == '{' ) @@ -382,7 +382,7 @@ BOOL ScTable::SearchAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark, SCCOL nCol = 0; SCROW nRow = -1; - ScMarkData aNewMark( rMark ); // Tabellen-Markierungen kopieren + ScMarkData aNewMark( rMark ); // Tabellen-Markierungen kopieren aNewMark.ResetMark(); do { @@ -392,8 +392,8 @@ BOOL ScTable::SearchAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark, } while (bFound); - rMark = aNewMark; // Markierung kopieren - //! pro Tabelle + rMark = aNewMark; // Markierung kopieren + //! pro Tabelle return (aNewMark.IsMultiMarked()); } @@ -430,15 +430,15 @@ BOOL ScTable::Replace(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow BOOL ScTable::ReplaceAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) { - BOOL bOldDouble = ScColumn::bDoubleAlloc; // sollte immer FALSE sein? + BOOL bOldDouble = ScColumn::bDoubleAlloc; // sollte immer FALSE sein? DBG_ASSERT(!bOldDouble,"bDoubleAlloc ???"); - ScColumn::bDoubleAlloc = TRUE; // fuer Undo-Doc + ScColumn::bDoubleAlloc = TRUE; // fuer Undo-Doc BOOL bFound = TRUE; SCCOL nCol = 0; SCROW nRow = -1; - ScMarkData aNewMark( rMark ); // Tabellen-Markierungen kopieren + ScMarkData aNewMark( rMark ); // Tabellen-Markierungen kopieren aNewMark.ResetMark(); do { @@ -450,8 +450,8 @@ BOOL ScTable::ReplaceAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark, ScColumn::bDoubleAlloc = bOldDouble; - rMark = aNewMark; // Markierung kopieren - //! pro Tabelle + rMark = aNewMark; // Markierung kopieren + //! pro Tabelle return (aNewMark.IsMultiMarked()); } @@ -472,7 +472,7 @@ BOOL ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& BOOL bBack = rSearchItem.GetBackward(); short nAdd = bBack ? -1 : 1; - if (bRows) // zeilenweise + if (bRows) // zeilenweise { nRow += nAdd; do @@ -491,18 +491,18 @@ BOOL ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& } while (!bFound && ValidCol(nCol)); } - else // spaltenweise + else // spaltenweise { SCsROW nNextRows[MAXCOLCOUNT]; SCsCOL i; for (i=0; i<=MAXCOL; i++) { SCsROW nSRow = nRow; - if (bBack) { if (i>=nCol) --nSRow; } - else { if (i<=nCol) ++nSRow; } + if (bBack) { if (i>=nCol) --nSRow; } + else { if (i<=nCol) ++nSRow; } nNextRows[i] = aCol[i].SearchStyle( nSRow, pSearchStyle, bBack, bSelect, rMark ); } - if (bBack) // rueckwaerts + if (bBack) // rueckwaerts { nRow = -1; for (i=MAXCOL; i>=0; i--) @@ -513,7 +513,7 @@ BOOL ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& bFound = TRUE; } } - else // vorwaerts + else // vorwaerts { nRow = MAXROW+1; for (i=0; i<=MAXCOL; i++) @@ -534,7 +534,7 @@ BOOL ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& return bFound; } -//! einzelnes Pattern fuer Undo zurueckgeben +//! einzelnes Pattern fuer Undo zurueckgeben BOOL ScTable::ReplaceStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, ScMarkData& rMark, BOOL bIsUndo) @@ -569,7 +569,7 @@ BOOL ScTable::SearchAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark BOOL bSelect = rSearchItem.GetSelection(); BOOL bBack = rSearchItem.GetBackward(); - ScMarkData aNewMark( rMark ); // Tabellen-Markierungen kopieren + ScMarkData aNewMark( rMark ); // Tabellen-Markierungen kopieren aNewMark.ResetMark(); for (SCCOL i=0; i<=MAXCOL; i++) { @@ -593,8 +593,8 @@ BOOL ScTable::SearchAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark } } - rMark = aNewMark; // Markierung kopieren - //! pro Tabelle + rMark = aNewMark; // Markierung kopieren + //! pro Tabelle return (aNewMark.IsMultiMarked()); } @@ -653,13 +653,13 @@ BOOL ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem, } else { - // SearchParam no longer needed - SearchOptions contains all settings + // SearchParam no longer needed - SearchOptions contains all settings com::sun::star::util::SearchOptions aSearchOptions = rSearchItem.GetSearchOptions(); aSearchOptions.Locale = *ScGlobal::GetLocale(); - // #107259# reflect UseAsianOptions flag in SearchOptions - // (use only ignore case and width if asian options are disabled). - // This is also done in SvxSearchDialog CommandHdl, but not in API object. + // #107259# reflect UseAsianOptions flag in SearchOptions + // (use only ignore case and width if asian options are disabled). + // This is also done in SvxSearchDialog CommandHdl, but not in API object. if ( !rSearchItem.IsUseAsianOptions() ) aSearchOptions.transliterateFlags &= ( com::sun::star::i18n::TransliterationModules_IGNORE_CASE | diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx index 2709dd54d1fb..a80cafa8c115 100644 --- a/sc/source/core/data/tabprotection.cxx +++ b/sc/source/core/data/tabprotection.cxx @@ -1,7 +1,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 @@ -229,10 +229,10 @@ void ScTableProtectionImpl::setPasswordHash(const uno::Sequence<sal_Int8>& aPass bool ScTableProtectionImpl::verifyPassword(const String& aPassText) const { -#if DEBUG_TAB_PROTECTION +#if DEBUG_TAB_PROTECTION fprintf(stdout, "ScTableProtectionImpl::verifyPassword: input = '%s'\n", OUStringToOString(rtl::OUString(aPassText), RTL_TEXTENCODING_UTF8).getStr()); -#endif +#endif if (mbEmptyPass) return aPassText.Len() == 0; @@ -243,12 +243,12 @@ bool ScTableProtectionImpl::verifyPassword(const String& aPassText) const Sequence<sal_Int8> aHash = hashPassword(aPassText, meHash); -#if DEBUG_TAB_PROTECTION +#if DEBUG_TAB_PROTECTION fprintf(stdout, "ScTableProtectionImpl::verifyPassword: hash = "); for (sal_Int32 i = 0; i < aHash.getLength(); ++i) printf("%2.2X ", static_cast<sal_uInt8>(aHash[i])); printf("\n"); -#endif +#endif return aHash == maPassHash; } diff --git a/sc/source/core/data/userdat.cxx b/sc/source/core/data/userdat.cxx index 466e83b15fad..b70d54fb54bd 100644 --- a/sc/source/core/data/userdat.cxx +++ b/sc/source/core/data/userdat.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 2239b1d0f773..020ad95e4a30 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -1,7 +1,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 @@ -67,7 +67,7 @@ SV_IMPL_OP_PTRARR_SORT( ScValidationEntries_Impl, ScValidationDataPtr ); //------------------------------------------------------------------------ // -// Eintrag fuer Gueltigkeit (es gibt nur eine Bedingung) +// Eintrag fuer Gueltigkeit (es gibt nur eine Bedingung) // ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOper, @@ -109,7 +109,7 @@ ScValidationData::ScValidationData( const ScValidationData& r ) : aErrorTitle( r.aErrorTitle ), aErrorMessage( r.aErrorMessage ) { - // Formeln per RefCount kopiert + // Formeln per RefCount kopiert } ScValidationData::ScValidationData( ScDocument* pDocument, const ScValidationData& r ) : @@ -125,7 +125,7 @@ ScValidationData::ScValidationData( ScDocument* pDocument, const ScValidationDat aErrorTitle( r.aErrorTitle ), aErrorMessage( r.aErrorMessage ) { - // Formeln wirklich kopiert + // Formeln wirklich kopiert } ScValidationData::~ScValidationData() @@ -141,18 +141,18 @@ BOOL ScValidationData::IsEmpty() const BOOL ScValidationData::EqualEntries( const ScValidationData& r ) const { - // gleiche Parameter eingestellt (ohne Key) + // gleiche Parameter eingestellt (ohne Key) return ScConditionEntry::operator==(r) && - eDataMode == r.eDataMode && - bShowInput == r.bShowInput && - bShowError == r.bShowError && - eErrorStyle == r.eErrorStyle && + eDataMode == r.eDataMode && + bShowInput == r.bShowInput && + bShowError == r.bShowError && + eErrorStyle == r.eErrorStyle && mnListType == r.mnListType && - aInputTitle == r.aInputTitle && - aInputMessage == r.aInputMessage && - aErrorTitle == r.aErrorTitle && - aErrorMessage == r.aErrorMessage; + aInputTitle == r.aInputTitle && + aInputMessage == r.aInputMessage && + aErrorTitle == r.aErrorTitle && + aErrorMessage == r.aErrorMessage; } void ScValidationData::ResetInput() @@ -198,16 +198,16 @@ BOOL ScValidationData::DoScript( const ScAddress& rPos, const String& rInput, if ( !pDocSh || !pDocument->CheckMacroWarn() ) return FALSE; - BOOL bScriptReturnedFalse = FALSE; // Standard: kein Abbruch + BOOL bScriptReturnedFalse = FALSE; // Standard: kein Abbruch // Set up parameters ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aParams(2); - // 1) eingegebener / berechneter Wert + // 1) eingegebener / berechneter Wert String aValStr = rInput; double nValue; BOOL bIsValue = FALSE; - if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen + if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen { bIsValue = pCell->IsValue(); if ( bIsValue ) @@ -220,13 +220,13 @@ BOOL ScValidationData::DoScript( const ScAddress& rPos, const String& rInput, else aParams[0] = ::com::sun::star::uno::makeAny( ::rtl::OUString( aValStr ) ); - // 2) Position der Zelle + // 2) Position der Zelle String aPosStr; rPos.Format( aPosStr, SCA_VALID | SCA_TAB_3D, pDocument, pDocument->GetAddressConvention() ); aParams[1] = ::com::sun::star::uno::makeAny( ::rtl::OUString( aPosStr ) ); - // use link-update flag to prevent closing the document - // while the macro is running + // use link-update flag to prevent closing the document + // while the macro is running BOOL bWasInLinkUpdate = pDocument->IsInLinkUpdate(); if ( !bWasInLinkUpdate ) pDocument->SetInLinkUpdate( TRUE ); @@ -261,7 +261,7 @@ BOOL ScValidationData::DoScript( const ScAddress& rPos, const String& rInput, if ( eRet == ERRCODE_BASIC_METHOD_NOT_FOUND && !pCell ) // Makro nicht gefunden (nur bei Eingabe) { - //! andere Fehlermeldung, wenn gefunden, aber nicht bAllowed ?? + //! andere Fehlermeldung, wenn gefunden, aber nicht bAllowed ?? ErrorBox aBox( pParent, WinBits(WB_OK), ScGlobal::GetRscString( STR_VALID_MACRONOTFOUND ) ); @@ -287,15 +287,15 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, return FALSE; BOOL bDone = FALSE; - BOOL bRet = FALSE; // Standard: kein Abbruch + BOOL bRet = FALSE; // Standard: kein Abbruch SfxApplication* pSfxApp = SFX_APP(); - pSfxApp->EnterBasicCall(); // Dok-Basic anlegen etc. + pSfxApp->EnterBasicCall(); // Dok-Basic anlegen etc. - // Wenn das Dok waehrend eines Basic-Calls geladen wurde, - // ist das Sbx-Objekt evtl. nicht angelegt (?) -// pDocSh->GetSbxObject(); + // Wenn das Dok waehrend eines Basic-Calls geladen wurde, + // ist das Sbx-Objekt evtl. nicht angelegt (?) +// pDocSh->GetSbxObject(); - // keine Sicherheitsabfrage mehr vorneweg (nur CheckMacroWarn), das passiert im CallBasic + // keine Sicherheitsabfrage mehr vorneweg (nur CheckMacroWarn), das passiert im CallBasic #if 0 // Makro-Name liegt in folgender Form vor: @@ -307,8 +307,8 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, String aDocName = aErrorTitle.GetToken(3, '.'); #endif - // Funktion ueber den einfachen Namen suchen, - // dann aBasicStr, aMacroStr fuer SfxObjectShell::CallBasic zusammenbauen + // Funktion ueber den einfachen Namen suchen, + // dann aBasicStr, aMacroStr fuer SfxObjectShell::CallBasic zusammenbauen StarBASIC* pRoot = pDocSh->GetBasic(); SbxVariable* pVar = pRoot->Find( aErrorTitle, SbxCLASS_METHOD ); @@ -324,24 +324,24 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, aMacroStr += pMethod->GetName(); String aBasicStr; - // #95867# the distinction between document- and app-basic has to be done - // by checking the parent (as in ScInterpreter::ScMacro), not by looping - // over all open documents, because this may be called from within loading, - // when SfxObjectShell::GetFirst/GetNext won't find the document. + // #95867# the distinction between document- and app-basic has to be done + // by checking the parent (as in ScInterpreter::ScMacro), not by looping + // over all open documents, because this may be called from within loading, + // when SfxObjectShell::GetFirst/GetNext won't find the document. if ( pObject->GetParent() ) - aBasicStr = pObject->GetParent()->GetName(); // Dokumentenbasic + aBasicStr = pObject->GetParent()->GetName(); // Dokumentenbasic else - aBasicStr = SFX_APP()->GetName(); // Applikationsbasic + aBasicStr = SFX_APP()->GetName(); // Applikationsbasic - // Parameter fuer Makro + // Parameter fuer Makro SbxArrayRef refPar = new SbxArray; - // 1) eingegebener / berechneter Wert + // 1) eingegebener / berechneter Wert String aValStr = rInput; double nValue = 0.0; BOOL bIsValue = FALSE; - if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen + if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen { bIsValue = pCell->IsValue(); if ( bIsValue ) @@ -354,13 +354,13 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, else refPar->Get(1)->PutString( aValStr ); - // 2) Position der Zelle + // 2) Position der Zelle String aPosStr; rPos.Format( aPosStr, SCA_VALID | SCA_TAB_3D, pDocument, pDocument->GetAddressConvention() ); refPar->Get(2)->PutString( aPosStr ); - // use link-update flag to prevent closing the document - // while the macro is running + // use link-update flag to prevent closing the document + // while the macro is running BOOL bWasInLinkUpdate = pDocument->IsInLinkUpdate(); if ( !bWasInLinkUpdate ) pDocument->SetInLinkUpdate( TRUE ); @@ -375,16 +375,16 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, if ( !bWasInLinkUpdate ) pDocument->SetInLinkUpdate( FALSE ); - // Eingabe abbrechen, wenn Basic-Makro FALSE zurueckgibt + // Eingabe abbrechen, wenn Basic-Makro FALSE zurueckgibt if ( eRet == ERRCODE_NONE && refRes->GetType() == SbxBOOL && refRes->GetBool() == FALSE ) bRet = TRUE; bDone = TRUE; } pSfxApp->LeaveBasicCall(); - if ( !bDone && !pCell ) // Makro nicht gefunden (nur bei Eingabe) + if ( !bDone && !pCell ) // Makro nicht gefunden (nur bei Eingabe) { - //! andere Fehlermeldung, wenn gefunden, aber nicht bAllowed ?? + //! andere Fehlermeldung, wenn gefunden, aber nicht bAllowed ?? ErrorBox aBox( pParent, WinBits(WB_OK), ScGlobal::GetRscString( STR_VALID_MACRONOTFOUND ) ); @@ -408,17 +408,17 @@ BOOL ScValidationData::DoError( Window* pParent, const String& rInput, if ( eErrorStyle == SC_VALERR_MACRO ) return DoMacro( rPos, rInput, NULL, pParent ); - // Fehlermeldung ausgeben + // Fehlermeldung ausgeben String aTitle = aErrorTitle; if (!aTitle.Len()) - aTitle = ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ); // application title + aTitle = ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ); // application title String aMessage = aErrorMessage; if (!aMessage.Len()) aMessage = ScGlobal::GetRscString( STR_VALID_DEFERROR ); - //! ErrorBox / WarningBox / InfoBox ? - //! (bei InfoBox immer nur OK-Button) + //! ErrorBox / WarningBox / InfoBox ? + //! (bei InfoBox immer nur OK-Button) WinBits nStyle = 0; switch (eErrorStyle) @@ -449,17 +449,17 @@ BOOL ScValidationData::IsDataValid( const String& rTest, const ScPatternAttr& rP const ScAddress& rPos ) const { if ( eDataMode == SC_VALID_ANY ) - return TRUE; // alles erlaubt + return TRUE; // alles erlaubt if ( rTest.GetChar(0) == '=' ) - return FALSE; // Formeln sind sonst immer ungueltig + return FALSE; // Formeln sind sonst immer ungueltig if ( !rTest.Len() ) - return IsIgnoreBlank(); // leer: wie eingestellt + return IsIgnoreBlank(); // leer: wie eingestellt SvNumberFormatter* pFormatter = GetDocument()->GetFormatTable(); - // Test, was es denn ist - wie in ScColumn::SetString + // Test, was es denn ist - wie in ScColumn::SetString sal_uInt32 nFormat = rPattern.GetNumberFormat( pFormatter ); @@ -509,8 +509,8 @@ BOOL ScValidationData::IsDataValid( ScBaseCell* pCell, const ScAddress& rPos ) c pFCell->GetString( aString ); } break; - default: // Notizen, Broadcaster - return IsIgnoreBlank(); // wie eingestellt + default: // Notizen, Broadcaster + return IsIgnoreBlank(); // wie eingestellt } BOOL bOk = TRUE; @@ -520,23 +520,23 @@ BOOL ScValidationData::IsDataValid( ScBaseCell* pCell, const ScAddress& rPos ) c case SC_VALID_WHOLE: case SC_VALID_DECIMAL: - case SC_VALID_DATE: // Date/Time ist nur Formatierung + case SC_VALID_DATE: // Date/Time ist nur Formatierung case SC_VALID_TIME: bOk = bIsVal; if ( bOk && eDataMode == SC_VALID_WHOLE ) - bOk = ::rtl::math::approxEqual( nVal, floor(nVal+0.5) ); // ganze Zahlen + bOk = ::rtl::math::approxEqual( nVal, floor(nVal+0.5) ); // ganze Zahlen if ( bOk ) bOk = IsCellValid( pCell, rPos ); break; case SC_VALID_CUSTOM: - // fuer Custom muss eOp == SC_COND_DIRECT sein - //! der Wert muss im Dokument stehen !!!!!!!!!!!!!!!!!!!! + // fuer Custom muss eOp == SC_COND_DIRECT sein + //! der Wert muss im Dokument stehen !!!!!!!!!!!!!!!!!!!! bOk = IsCellValid( pCell, rPos ); break; case SC_VALID_TEXTLEN: - bOk = !bIsVal; // nur Text + bOk = !bIsVal; // nur Text if ( bOk ) { double nLenVal = (double) aString.Len(); @@ -771,7 +771,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings, //For external reference and a formula that results in an area or array, date formats are still lost. if ( bRef ) { - pDocument->GetInputString((SCCOL)(nCol+aRange.aStart.Col()), + pDocument->GetInputString((SCCOL)(nCol+aRange.aStart.Col()), (SCROW)(nRow+aRange.aStart.Row()), aRange.aStart.Tab() , aValStr); } else @@ -914,32 +914,32 @@ bool ScValidationData::IsListValid( ScBaseCell* pCell, const ScAddress& rPos ) c ScValidationDataList::ScValidationDataList(const ScValidationDataList& rList) : ScValidationEntries_Impl() { - // fuer Ref-Undo - echte Kopie mit neuen Tokens! + // fuer Ref-Undo - echte Kopie mit neuen Tokens! USHORT nCount = rList.Count(); for (USHORT i=0; i<nCount; i++) InsertNew( rList[i]->Clone() ); - //! sortierte Eintraege aus rList schneller einfuegen ??? + //! sortierte Eintraege aus rList schneller einfuegen ??? } ScValidationDataList::ScValidationDataList(ScDocument* pNewDoc, const ScValidationDataList& rList) { - // fuer neues Dokument - echte Kopie mit neuen Tokens! + // fuer neues Dokument - echte Kopie mit neuen Tokens! USHORT nCount = rList.Count(); for (USHORT i=0; i<nCount; i++) InsertNew( rList[i]->Clone(pNewDoc) ); - //! sortierte Eintraege aus rList schneller einfuegen ??? + //! sortierte Eintraege aus rList schneller einfuegen ??? } ScValidationData* ScValidationDataList::GetData( sal_uInt32 nKey ) { - //! binaer suchen + //! binaer suchen USHORT nCount = Count(); for (USHORT i=0; i<nCount; i++) @@ -987,8 +987,8 @@ BOOL ScValidationDataList::operator==( const ScValidationDataList& r ) const USHORT nCount = Count(); BOOL bEqual = ( nCount == r.Count() ); - for (USHORT i=0; i<nCount && bEqual; i++) // Eintraege sind sortiert - if ( !(*this)[i]->EqualEntries(*r[i]) ) // Eintraege unterschiedlich ? + for (USHORT i=0; i<nCount && bEqual; i++) // Eintraege sind sortiert + if ( !(*this)[i]->EqualEntries(*r[i]) ) // Eintraege unterschiedlich ? bEqual = FALSE; return bEqual; |