hi' all while looking for the formula functions and such I decided to do a few more translations and minor clean up
it's nice looking in to the code all my bests René -- -- as life grows older, I gain experience.
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 517c1d1..077109a 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -127,10 +127,10 @@ void ScDocument::MakeTable( SCTAB nTab,bool _bNeedsNameCheck ) { if ( ValidTab(nTab) && !pTab[nTab] ) { - String aString = ScGlobal::GetRscString(STR_TABLE_DEF); //"Tabelle" + String aString = ScGlobal::GetRscString(STR_TABLE_DEF); //"Table" aString += String::CreateFromInt32(nTab+1); if ( _bNeedsNameCheck ) - CreateValidTabName( aString ); // keine doppelten + CreateValidTabName( aString ); // no doubles pTab[nTab] = new ScTable(this, nTab, aString); pTab[nTab]->SetLoadingMedium(bLoadingMedium); @@ -272,18 +272,17 @@ void ScDocument::CreateValidTabName(String& rName) const { if ( !ValidTabName(rName) ) { - // neu erzeugen + // Find new one const String aStrTable( ScResId(SCSTR_TABLE) ); BOOL bOk = FALSE; - // vorneweg testen, ob der Prefix als gueltig erkannt wird - // wenn nicht, nur doppelte vermeiden + // First test if the prefix is valid, if so only avoid doubles BOOL bPrefix = ValidTabName( aStrTable ); - DBG_ASSERT(bPrefix, "ungueltiger Tabellenname"); + OSL_ENSURE(bPrefix, "Invalid Table Name"); SCTAB nDummy; - SCTAB nLoops = 0; // "zur Sicherheit" + SCTAB nLoops = 0; // "for safety messures" for ( SCTAB i = nMaxTableNumber+1; !bOk && nLoops <= MAXTAB; i++ ) { rName = aStrTable; @@ -295,13 +294,13 @@ void ScDocument::CreateValidTabName(String& rName) const ++nLoops; } - DBG_ASSERT(bOk, "kein gueltiger Tabellenname gefunden"); + OSL_ENSURE(bOk, "No Valid Table name found."); if ( !bOk ) rName = aStrTable; } else { - // uebergebenen Namen ueberpruefen + // testing the surplied Name if ( !ValidNewTabName(rName) ) { @@ -326,7 +325,7 @@ BOOL ScDocument::InsertTab( SCTAB nPos, const String& rName, { SCTAB nTabCount = GetTableCount(); BOOL bValid = ValidTab(nTabCount); - if ( !bExternalDocument ) // sonst rName == "'Doc'!Tab", vorher pruefen + if ( !bExternalDocument ) // else test rName == "'Doc'!Tab" first bValid = (bValid && ValidNewTabName(rName)); if (bValid) { @@ -413,7 +412,7 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) if (nTabCount > 1) { BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // avoid multiple calculations ScRange aRange( 0, 0, nTab, MAXCOL, MAXROW, nTab ); DelBroadcastAreasInRange( aRange ); @@ -468,8 +467,8 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) for (i = 0; i <= MAXTAB; i++) if (pTab[i]) pTab[i]->UpdateCompile(); - // Excel-Filter loescht einige Tables waehrend des Ladens, - // Listener werden erst nach dem Laden aufgesetzt + // Excel-Filter deletes some Tables while loading, Listeners will + // only be triggered after the loading is done. if ( !bInsertingFromOtherDoc ) { for (i = 0; i <= MAXTAB; i++) @@ -498,7 +497,7 @@ BOOL ScDocument::RenameTab( SCTAB nTab, const String& rName, BOOL /* bUpdateRef if (pTab[nTab]) { if ( bExternalDocument ) - bValid = TRUE; // zusammengesetzter Name + bValid = TRUE; // composed name else bValid = ValidTabName(rName); for (i=0; (i<=MAXTAB) && bValid; i++) @@ -605,7 +604,7 @@ void ScDocument::SetLayoutRTL( SCTAB nTab, BOOL bRTL ) if (pDrawLayer) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (pPage) { SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); @@ -646,12 +645,12 @@ BOOL ScDocument::IsNegativePage( SCTAB nTab ) const /* ---------------------------------------------------------------------------- - benutzten Bereich suchen: + used search area: - GetCellArea - nur Daten - GetTableArea - Daten / Attribute - GetPrintArea - beruecksichtigt auch Zeichenobjekte, - streicht Attribute bis ganz rechts / unten + GetCellArea - Only Data + GetTableArea - Data / Attributes + GetPrintArea - intended for character objects, + sweeps attributes all the way to bottom / right ---------------------------------------------------------------------------- */ @@ -717,7 +716,7 @@ bool ScDocument::ShrinkToUsedDataArea( SCTAB nTab, SCCOL& rStartCol, return pTab[nTab]->ShrinkToUsedDataArea( rStartCol, rStartRow, rEndCol, rEndRow, bColumnsOnly); } -// zusammenhaengender Bereich +// connected area void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld, bool bOnlyDown ) const @@ -848,14 +847,14 @@ BOOL ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, BOOL bTest = TRUE; BOOL bRet = FALSE; BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // avoid mulitple calculations for ( i = nStartTab; i <= nEndTab && bTest; i++) if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i))) bTest &= pTab[i]->TestInsertRow( nStartCol, nEndCol, nSize ); if (bTest) { - // UpdateBroadcastAreas muss vor UpdateReference gerufen werden, damit nicht - // Eintraege verschoben werden, die erst bei UpdateReference neu erzeugt werden + // UpdateBroadcastAreas have to be called before UpdateReference, so that entries + // aren't shifted that would be rebuild at UpdateReference // handle chunks of consecutive selected sheets together SCTAB nTabRangeStart = nStartTab; @@ -942,7 +941,7 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab, } BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // avoid multiple calculations // handle chunks of consecutive selected sheets together SCTAB nTabRangeStart = nStartTab; @@ -1051,7 +1050,7 @@ BOOL ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab, BOOL bTest = TRUE; BOOL bRet = FALSE; BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // avoid multiple calculations for ( i = nStartTab; i <= nEndTab && bTest; i++) if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i))) bTest &= pTab[i]->TestInsertCol( nStartRow, nEndRow, nSize ); @@ -1132,7 +1131,7 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA } BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // avoid multiple calculations // handle chunks of consecutive selected sheets together SCTAB nTabRangeStart = nStartTab; @@ -1209,7 +1208,7 @@ void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew, ScRange& rColRange, BOOL& rInsCol, BOOL& rDelCol, ScRange& rRowRange, BOOL& rInsRow, BOOL& rDelRow ) { - DBG_ASSERT( rOld.aStart == rNew.aStart, "FitBlock: Anfang unterschiedlich" ); + OSL_ENSURE( rOld.aStart == rNew.aStart, "FitBlock: Beginning is different" ); rInsCol = rDelCol = rInsRow = rDelRow = FALSE; @@ -1349,7 +1348,7 @@ void ScDocument::DeleteArea(SCCOL nCol1, SCROW nRow1, PutInOrder( nCol1, nCol2 ); PutInOrder( nRow1, nRow2 ); BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // avoid multiple calculations for (SCTAB i = 0; i <= MAXTAB; i++) if (pTab[i]) if ( rMark.GetTableSelect(i) || bIsUndo ) @@ -1367,7 +1366,7 @@ void ScDocument::DeleteAreaTab(SCCOL nCol1, SCROW nRow1, if ( VALIDTAB(nTab) && pTab[nTab] ) { BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + SetAutoCalc( FALSE ); // avoid multiple calculations pTab[nTab]->DeleteArea(nCol1, nRow1, nCol2, nRow2, nDelFlag); SetAutoCalc( bOldAutoCalc ); } @@ -1484,7 +1483,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 ); // avoid multiple calculations for (SCTAB i = nTab1; i <= nTab2; i++) { if (pTab[i] && pDestDoc->pTab[i]) @@ -1508,7 +1507,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 ); // avoid multiple calculations if (nTab1 > 0) CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, FALSE, pDestDoc, pMarks ); @@ -1536,7 +1535,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 ); // avoid multiple calculations 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(), @@ -1557,7 +1556,7 @@ void ScDocument::UndoToDocument(const ScRange& rRange, SCTAB nTab2 = aNewRange.aEnd.Tab(); BOOL bOldAutoCalc = pDestDoc->GetAutoCalc(); - pDestDoc->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + pDestDoc->SetAutoCalc( FALSE ); // avoid multiple calculations if (nTab1 > 0) CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, FALSE, pDestDoc, pMarks ); @@ -1578,14 +1577,14 @@ void ScDocument::CopyToClip(const ScClipParam& rClipParam, ScDocument* pClipDoc, const ScMarkData* pMarks, bool bAllTabs, bool bKeepScenarioFlags, bool bIncludeObjects, bool bCloneNoteCaptions) { - DBG_ASSERT( bAllTabs || pMarks, "CopyToClip: ScMarkData fehlt" ); + OSL_ENSURE( bAllTabs || pMarks, "CopyToClip: ScMarkData fails" ); if (bIsClip) return; if (!pClipDoc) { - DBG_ERROR("CopyToClip: no ClipDoc"); + OSL_TRACE("CopyToClip: no ClipDoc"); pClipDoc = SC_MOD()->GetClipDoc(); } @@ -1663,7 +1662,7 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1, PutInOrder( nRow1, nRow2 ); if (!pClipDoc) { - DBG_ERROR("CopyTabToClip: no ClipDoc"); + OSL_TRACE("CopyTabToClip: no ClipDoc"); pClipDoc = SC_MOD()->GetClipDoc(); } @@ -1683,8 +1682,8 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1, void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsLink ) { - DBG_ASSERT( bIsClip && pTransClip && pTransClip->bIsClip, - "TransposeClip mit falschem Dokument" ); + OSL_ENSURE( bIsClip && pTransClip && pTransClip->bIsClip, + "TransposeClip with wrong Document" ); // initialisieren // -> pTransClip muss vor dem Original-Dokument geloescht werden! @@ -1704,7 +1703,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL pData->SetIndex(nIndex); } - // Daten + // The data ScRange aClipRange = GetClipParam().getWholeRange(); if ( ValidRow(aClipRange.aEnd.Row()-aClipRange.aStart.Row()) ) @@ -1712,7 +1711,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL for (SCTAB i=0; i<=MAXTAB; i++) if (pTab[i]) { - DBG_ASSERT( pTransClip->pTab[i], "TransposeClip: Tabelle nicht da" ); + OSL_ENSURE( pTransClip->pTab[i], "TransposeClip: Table not there" ); pTab[i]->TransposeClip( aClipRange.aStart.Col(), aClipRange.aStart.Row(), aClipRange.aEnd.Col(), aClipRange.aEnd.Row(), pTransClip->pTab[i], nFlags, bAsLink ); @@ -1740,7 +1739,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL } else { - DBG_ERROR("TransposeClip: zu gross"); + OSL_TRACE("TransposeClip: To big"); } // Dies passiert erst beim Einfuegen... @@ -2010,7 +2009,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, // drawing layer must be created before calling CopyFromClip // (ScDocShell::MakeDrawLayer also does InitItems etc.) - DBG_ASSERT( pDrawLayer, "CopyBlockFromClip: No drawing layer" ); + OSL_ENSURE( pDrawLayer, "CopyBlockFromClip: No drawing layer" ); if ( pDrawLayer ) { // For GetMMRect, the row heights in the target document must already be valid @@ -2592,7 +2591,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 ); // avoid multiple calculations SCTAB nCount = GetTableCount(); for (SCTAB i=0; i<nCount; i++) @@ -2644,7 +2643,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 ); // avoid multiple calculations ScRange aArea; rMark.GetMultiMarkArea( aArea ); diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index 0bd5ec8..fab940e 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -92,12 +92,12 @@ public: }; enum ScIterFunc { - ifSUM, // Aufsummieren - ifSUMSQ, // Quadratsummen - ifPRODUCT, // Multiplizieren - ifAVERAGE, // Durchschnitt - ifCOUNT, // Anzahl Werte - ifCOUNT2, // Anzahl Werte (nichtleer) + ifSUM, // Add up + ifSUMSQ, // Sums of squares + ifPRODUCT, // Product + ifAVERAGE, // Average + ifCOUNT, // Count Values + ifCOUNT2, // Count Values (not empty) ifMIN, // Minimum ifMAX // Maximum }; diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index 1ab1fde..2fddc44 100644 --- a/sc/source/core/tool/cellform.cxx +++ b/sc/source/core/tool/cellform.cxx @@ -107,12 +107,12 @@ void ScCellFormat::GetString( ScBaseCell* pCell, ULONG nFormat, String& rString, pFCell->GetFormula( rString ); else { - // #62160# Ein via Interpreter gestartetes Makro, das hart - // auf Formelzellen zugreift, bekommt einen CellText, auch - // wenn dadurch ein weiterer Interpreter gestartet wird, - // aber nicht wenn diese Zelle gerade interpretiert wird. - // IdleCalc startet generell keine weiteren Interpreter, - // um keine Err522 (zirkulaer) zu bekommen. + // #62160# A macro started from the interpreter, which has + // access to Formular Cells, becomes a CellText, even if + // that triggers further interpretation, except if those + // cells are already being interpreted. + // IdleCalc generally doesn't trigger futher interpretation, + // as not to get Err522 (circular). if ( pFCell->GetDocument()->IsInInterpreter() && (!pFCell->GetDocument()->GetMacroInterpretLevel() || pFCell->IsRunning()) ) @@ -123,7 +123,7 @@ void ScCellFormat::GetString( ScBaseCell* pCell, ULONG nFormat, String& rString, { USHORT nErrCode = pFCell->GetErrCode(); - // erst nach dem Interpretieren (GetErrCode) das Zahlformat holen: + // get the number format only after interpretation (GetErrCode): if ( (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) nFormat = pFCell->GetStandardFormat( rFormatter, nFormat ); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index f9fc261..c5d2651 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -87,7 +87,7 @@ using namespace formula; using ::std::auto_ptr; //----------------------------------------------------------------------------- -// Funktionen +// Functions //----------------------------------------------------------------------------- @@ -1156,7 +1156,7 @@ void ScInterpreter::ScAnd() bHaveValue = TRUE; nRes &= ( GetCellValue( aAdr, pCell ) != 0.0 ); } - // else: Xcl setzt hier keinen Fehler + // else: Xcl raises no error here } } break; @@ -1254,7 +1254,7 @@ void ScInterpreter::ScOr() bHaveValue = TRUE; nRes |= ( GetCellValue( aAdr, pCell ) != 0.0 ); } - // else: Xcl setzt hier keinen Fehler + // else: Xcl raises no error here } } break; @@ -2497,7 +2497,7 @@ void ScInterpreter::ScN() void ScInterpreter::ScTrim() -{ // trimmt nicht nur sondern schnibbelt auch doppelte raus! +{ // Doesn't only trim but writes out twice! String aVal( GetString() ); aVal.EraseLeadingChars(); aVal.EraseTrailingChars(); @@ -2506,7 +2506,7 @@ void ScInterpreter::ScTrim() register const sal_Unicode* const pEnd = p + aVal.Len(); while ( p < pEnd ) { - if ( *p != ' ' || p[-1] != ' ' ) // erster kann kein ' ' sein, -1 ist also ok + if ( *p != ' ' || p[-1] != ' ' ) // ' ' can't be first, -1 is fine too aStr += *p; p++; } @@ -2607,7 +2607,7 @@ void ScInterpreter::ScT() PushString( EMPTY_STRING ); else { - // wie GetString() + // like GetString() GetCellString( aTempStr, pCell ); PushString( aTempStr ); } @@ -3388,7 +3388,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) ScValueIterator aValIter( pDok, aRange, glSubTotal, bTextAsZero ); if (aValIter.GetFirst(fVal, nErr)) { - // Schleife aus Performance-Gruenden nach innen verlegt: + // placed the loop on the inside for performance reasons: aValIter.GetCurNumFmtInfo( nFuncFmtType, nFuncFmtIndex ); switch( eFunc ) { @@ -4678,7 +4678,7 @@ void ScInterpreter::ScCountIf() else { ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE); - // Entry.nField im Iterator bei Spaltenwechsel weiterschalten + // Keep Entry.nField in iterator on column change aCellIter.SetAdvanceQueryParamEntryField( TRUE ); if ( aCellIter.GetFirst() ) {
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice