[Libreoffice-commits] core.git: sc/source

Philipp Weissenbacher p.weissenbacher at gmail.com
Sun Aug 24 23:16:31 PDT 2014


 sc/source/core/data/documen3.cxx |  115 +++++++++++++++++++--------------------
 sc/source/core/data/global.cxx   |   95 ++++++++++++++------------------
 sc/source/core/data/olinetab.cxx |   68 +++++++++++------------
 3 files changed, 137 insertions(+), 141 deletions(-)

New commits:
commit c5d47afc152fe5440ebe733203114962f84d63ca
Author: Philipp Weissenbacher <p.weissenbacher at gmail.com>
Date:   Sun Aug 24 22:14:45 2014 +0200

    Translate German comments, fix some ws
    
    Change-Id: Ida67ce193ad032e2a1855e4380626f805514c2f2
    Reviewed-on: https://gerrit.libreoffice.org/11103
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 34badd8..7a2bc04 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -524,15 +524,15 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const OUString& aDocTab,
         return false;
     }
     rTab = 0;
-    OUString  aFilterName;        // wird vom Loader gefuellt
-    OUString  aOptions;       // Filter-Optionen
+    OUString  aFilterName; // Is filled by the Loader
+    OUString  aOptions; // Filter options
     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
+    // Copy table
     SCTAB nSrcTab;
     if ( pSrcDoc->GetTable( aTabName, nSrcTab ) )
     {
@@ -542,7 +542,7 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const OUString& aDocTab,
             return false;
         }
         rTab = GetTableCount() - 1;
-        // nicht neu einfuegen, nur Ergebnisse
+        // Don't insert anew, just the results
         TransferTab( pSrcDoc, nSrcTab, rTab, false, true );
     }
     else
@@ -552,7 +552,7 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const OUString& 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 ) // Add link only once per source document
     {
         ScTableLink* pLink = new ScTableLink( pShell, aFileName, aFilterName, aOptions, nRefreshDelay );
         pLink->SetInCreate( true );
@@ -742,9 +742,10 @@ bool ScDocument::HasSubTotalCells( const ScRange& rRange )
     return false;   // none found
 }
 
-//  kopiert aus diesem Dokument die Zellen von Positionen, an denen in pPosDoc
-//  auch Zellen stehen, nach pDestDoc
-
+/**
+ * From this document this method copies the cells of positions at which
+ * there are also cells in pPosDoc to pDestDoc
+ */
 void ScDocument::CopyUpdated( ScDocument* pPosDoc, ScDocument* pDestDoc )
 {
     SCTAB nCount = static_cast<SCTAB>(maTabs.size());
@@ -758,17 +759,16 @@ void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, bool bNewScenario
     if (ValidTab(nSrcTab) && ValidTab(nDestTab) && nSrcTab < static_cast<SCTAB>(maTabs.size())
                 && nDestTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nSrcTab] && maTabs[nDestTab])
     {
-        //  Flags fuer aktive Szenarios richtig setzen
-        //  und aktuelle Werte in bisher aktive Szenarios zurueckschreiben
-
+        // Set flags correctly for active scenarios
+        // and write current values back to recently active scenarios
         ScRangeList aRanges = *maTabs[nSrcTab]->GetScenarioRanges();
 
-        //  nDestTab ist die Zieltabelle
+        // nDestTab is the target table
         for ( SCTAB nTab = nDestTab+1;
                 nTab< static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] && maTabs[nTab]->IsScenario();
                 nTab++ )
         {
-            if ( maTabs[nTab]->IsActiveScenario() )     // auch wenn's dasselbe Szenario ist
+            if ( maTabs[nTab]->IsActiveScenario() ) // Even if it's the same scenario
             {
                 bool bTouched = false;
                 for ( size_t nR=0, nRangeCount = aRanges.size(); nR < nRangeCount && !bTouched; nR++ )
@@ -786,8 +786,8 @@ void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, bool bNewScenario
             }
         }
 
-        maTabs[nSrcTab]->SetActiveScenario(true);       // da kommt's her...
-        if (!bNewScenario)                          // Daten aus dem ausgewaehlten Szenario kopieren
+        maTabs[nSrcTab]->SetActiveScenario(true); // This is where it's from ...
+        if (!bNewScenario) // Copy data from the selected scenario
         {
             sc::AutoCalcSwitch aACSwitch(*this, false);
             maTabs[nSrcTab]->CopyScenarioTo( maTabs[nDestTab] );
@@ -860,29 +860,29 @@ void ScDocument::RemoveUnoObject( SfxListener& rObject )
 
         if ( bInUnoBroadcast )
         {
-            //  Broadcasts from ScDocument::BroadcastUno are the only way that
-            //  uno object methods are called without holding a reference.
+            // 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.
 
             comphelper::SolarMutex& 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)
                 OSL_FAIL( "RemoveUnoObject called from BroadcastUno" );
                 rSolarMutex.release();
             }
             else
             {
-                //  let the thread that called BroadcastUno continue
+                // Let the thread that called BroadcastUno continue
                 while ( bInUnoBroadcast )
                 {
                     osl::Thread::yield();
@@ -946,7 +946,7 @@ ScUnoRefList* ScDocument::EndUnoRefUndo()
 {
     ScUnoRefList* pRet = pUnoRefUndoList;
     pUnoRefUndoList = NULL;
-    return pRet;                // must be deleted by caller!
+    return pRet; // Must be deleted by caller!
 }
 
 void ScDocument::AddUnoRefChange( sal_Int64 nId, const ScRangeList& rOldRanges )
@@ -1043,7 +1043,7 @@ void ScDocument::UpdateReference(
         }
     }
 
-    // after moving, no clipboard move ref-updates are possible
+    // After moving, no clipboard move ref-updates are possible
     if (rCxt.meMode != URM_COPY && IsClipboardSource())
     {
         ScDocument* pClipDoc = SC_MOD()->GetClipDoc();
@@ -1072,9 +1072,9 @@ void ScDocument::UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDo
             aSource.aEnd.SetTab( nClipTab );
             aDest.SetTab( nDestTab );
 
-            //  wie UpdateReference
+            // Like UpdateReference
             if (pRangeName)
-                pRangeName->UpdateTranspose( aSource, aDest );      // vor den Zellen!
+                pRangeName->UpdateTranspose( aSource, aDest ); // Before the cells!
             for (SCTAB i=0; i< static_cast<SCTAB>(maTabs.size()); i++)
                 if (maTabs[i])
                     maTabs[i]->UpdateTranspose( aSource, aDest, pUndoDoc );
@@ -1237,8 +1237,7 @@ bool ScDocument::SearchAndReplace(
     const ScMarkData& rMark, ScRangeList& rMatchedRanges,
     OUString& rUndoStr, ScDocument* pUndoDoc)
 {
-    //!     getrennte Markierungen pro Tabelle verwalten !!!!!!!!!!!!!
-
+    // FIXME: Manage separated marks per table!
     bool bFound = false;
     if (rTab >= static_cast<SCTAB>(maTabs.size()))
         OSL_FAIL("table out of range");
@@ -1262,7 +1261,7 @@ bool ScDocument::SearchAndReplace(
                         rSearchItem, nCol, nRow, rMark, rMatchedRanges, rUndoStr, pUndoDoc);
                 }
 
-            //  Markierung wird innen schon komplett gesetzt
+            // Mark is set completely inside already
         }
         else
         {
@@ -1315,8 +1314,9 @@ bool ScDocument::SearchAndReplace(
     return bFound;
 }
 
-//  Outline anpassen
-
+/**
+ * Adapt Outline
+ */
 bool ScDocument::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bShow )
 {
     if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
@@ -1431,8 +1431,9 @@ bool ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol,
     return ValidTab(nTab) && maTabs[nTab] && maTabs[nTab]->HasRowHeader( nStartCol, nStartRow, nEndCol, nEndRow );
 }
 
-//  GetFilterEntries - Eintraege fuer AutoFilter-Listbox
-
+/**
+ * Entries for AutoFilter listbox
+ */
 bool ScDocument::GetFilterEntries(
     SCCOL nCol, SCROW nRow, SCTAB nTab, bool bFilter, std::vector<ScTypedStrData>& rStrings, bool& rHasDates)
 {
@@ -1455,7 +1456,7 @@ bool ScDocument::GetFilterEntries(
             ScQueryParam aParam;
             pDBData->GetQueryParam( aParam );
 
-            // return all filter entries, if a filter condition is connected with a boolean OR
+            // Return all filter entries, if a filter condition is connected with a boolean OR
             if ( bFilter )
             {
                 SCSIZE nEntryCount = aParam.GetEntryCount();
@@ -1487,8 +1488,9 @@ bool ScDocument::GetFilterEntries(
     return false;
 }
 
-//  GetFilterEntriesArea - Eintraege fuer Filter-Dialog
-
+/**
+ * Entries for Filter dialog
+ */
 bool ScDocument::GetFilterEntriesArea(
     SCCOL nCol, SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bCaseSens,
     std::vector<ScTypedStrData>& rStrings, bool& rHasDates)
@@ -1503,8 +1505,9 @@ bool ScDocument::GetFilterEntriesArea(
     return false;
 }
 
-//  GetDataEntries - Eintraege fuer Auswahlliste-Listbox (keine Zahlen / Formeln)
-
+/**
+ * Entries for selection list listbox (no numbers/formulas)
+ */
 bool ScDocument::GetDataEntries(
     SCCOL nCol, SCROW nRow, SCTAB nTab, bool bCaseSens,
     std::vector<ScTypedStrData>& rStrings, bool bLimit )
@@ -1542,13 +1545,13 @@ bool ScDocument::GetDataEntries(
     return bRet;
 }
 
-//  GetFormulaEntries - Eintraege fuer Formel-AutoEingabe
-
+/**
+ * Entries for Formula auto input
+ */
 bool ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
 {
 
-    //  Bereichsnamen
-
+    // Range name
     if ( pRangeName )
     {
         ScRangeName::const_iterator itr = pRangeName->begin(), itrEnd = pRangeName->end();
@@ -1556,8 +1559,7 @@ bool ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
             rStrings.insert(ScTypedStrData(itr->second->GetName(), 0.0, ScTypedStrData::Name));
     }
 
-    //  Datenbank-Bereiche
-
+    // Database collection
     if ( pDBCollection )
     {
         const ScDBCollection::NamedDBs& rDBs = pDBCollection->getNamedDBs();
@@ -1566,8 +1568,7 @@ bool ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
             rStrings.insert(ScTypedStrData(itr->GetName(), 0.0, ScTypedStrData::DbName));
     }
 
-    //  Inhalte von Beschriftungsbereichen
-
+    // Content of name ranges
     ScRangePairList* pLists[2];
     pLists[0] = GetColNameRanges();
     pLists[1] = GetRowNameRanges();
@@ -1601,7 +1602,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 = NULL;
@@ -1708,7 +1709,7 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect, bool bHidden
 
     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;
@@ -1766,7 +1767,7 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect, bool bHidden
     return ScRange( nX1,nY1,nTab, nX2,nY2,nTab );
 }
 
-void ScDocument::SetEmbedded( SCTAB nTab, const Rectangle& rRect )          // aus VisArea (1/100 mm)
+void ScDocument::SetEmbedded( SCTAB nTab, const Rectangle& rRect ) // From VisArea (1/100 mm)
 {
     bIsEmbedded = true;
     aEmbedRange = GetRange( nTab, rRect );
@@ -1792,7 +1793,7 @@ bool ScDocument::IsDocProtected() const
 
 bool ScDocument::IsDocEditable() const
 {
-    // import into read-only document is possible
+    // Import into read-only document is possible
     return !IsDocProtected() && ( bImportingXML || mbChangeReadOnlyEnabled || !pShell || !pShell->IsReadOnly() );
 }
 
@@ -1875,7 +1876,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
 }
 
 Rectangle ScDocument::GetMMRect( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero ) const
@@ -1955,7 +1956,7 @@ void ScDocument::DoMerge( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
     if ( nEndCol > nStartCol && nEndRow > nStartRow )
         ApplyFlagsTab( nStartCol+1, nStartRow+1, nEndCol, nEndRow, nTab, SC_MF_HOR | SC_MF_VER );
 
-    // remove all covered notes (removed captions are collected by drawing undo if active)
+    // Remove all covered notes (removed captions are collected by drawing undo if active)
     sal_uInt16 nDelFlag = IDF_NOTE | (bDeleteCaptions ? 0 : IDF_NOCAPTIONS);
     if( nStartCol < nEndCol )
         DeleteAreaTab( nStartCol + 1, nStartRow, nEndCol, nStartRow, nTab, nDelFlag );
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index a0fc55d..f5cf913 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -125,14 +125,14 @@ sal_uInt16          ScGlobal::nStdRowHeight         = 256;
 long            ScGlobal::nLastRowHeightExtra   = 0;
 long            ScGlobal::nLastColWidthExtra    = STD_EXTRA_WIDTH;
 
-static sal_uInt16 nPPTZoom = 0;     // ScreenZoom used to determine nScreenPPTX/Y
+static sal_uInt16 nPPTZoom = 0; // ScreenZoom used to determine nScreenPPTX/Y
 
 class SfxViewShell;
-SfxViewShell* pScActiveViewShell = NULL;            //! als Member !!!!!
-sal_uInt16 nScClickMouseModifier = 0;                   //! dito
-sal_uInt16 nScFillModeMouseModifier = 0;                //! dito
+SfxViewShell* pScActiveViewShell = NULL; //FIXME: Make this a member
+sal_uInt16 nScClickMouseModifier = 0;    //FIXME: This too
+sal_uInt16 nScFillModeMouseModifier = 0; //FIXME: And this
 
-//      statische Funktionen
+// Static functions
 
 bool ScGlobal::HasAttrChanged( const SfxItemSet&  rNewAttrs,
                                const SfxItemSet&  rOldAttrs,
@@ -144,16 +144,15 @@ bool ScGlobal::HasAttrChanged( const SfxItemSet&  rNewAttrs,
 
     if ( eNewState == eOldState )
     {
-        // beide Items gesetzt
-        // PoolItems, d.h. Pointer-Vergleich zulaessig
+        // Both Items set
+        // PoolItems, meaning comparing pointers is valid
         if ( SFX_ITEM_SET == eOldState )
             bInvalidate = (&rNewAttrs.Get( nWhich ) != &rOldAttrs.Get( nWhich ));
     }
     else
     {
-        // ein Default-Item dabei
-        // PoolItems, d.h. Item-Vergleich noetig
-
+        // Contains a Default Item
+        // PoolItems, meaning Item comparison necessary
         const SfxPoolItem& rOldItem = ( SFX_ITEM_SET == eOldState )
                     ? rOldAttrs.Get( nWhich )
                     : rOldAttrs.GetPool()->GetDefaultItem( nWhich );
@@ -197,9 +196,8 @@ bool ScGlobal::CheckWidthInvalidate( bool& bNumFormatChanged,
                                      const SfxItemSet& rNewAttrs,
                                      const SfxItemSet& rOldAttrs )
 {
-    // Ueberpruefen, ob Attributaenderungen in rNewAttrs gegnueber
-    // rOldAttrs die Textbreite an einer Zelle ungueltig machen
-
+    // Check whether attribute changes in rNewAttrs compared to rOldAttrs render
+    // the text width at a cell invalid
     bNumFormatChanged =
             HasAttrChanged( rNewAttrs, rOldAttrs, ATTR_VALUE_FORMAT );
     return ( bNumFormatChanged
@@ -241,7 +239,7 @@ const SvxSearchItem& ScGlobal::GetSearchItem()
 
 void ScGlobal::SetSearchItem( const SvxSearchItem& rNew )
 {
-    // Hier waere ein Zuweisungsoperator ganz nett:
+    // FIXME: An assignement operator would be nice here
     delete pSearchItem;
     pSearchItem = (SvxSearchItem*)rNew.Clone();
 
@@ -290,8 +288,7 @@ ScUnoAddInCollection* ScGlobal::GetAddInCollection()
 
 ScUserList* ScGlobal::GetUserList()
 {
-    // Hack: Cfg-Item an der App ggF. laden
-
+    // Hack: Load Cfg item at the App
     global_InitAppOptions();
 
     if (!pUserList)
@@ -499,13 +496,13 @@ void ScGlobal::Init()
 {
     pEmptyOUString = new OUString;
 
-    //  Die Default-Sprache fuer Zahlenformate (ScGlobal::eLnge)
-    //  muss immer LANGUAGE_SYSTEM sein
-    //! Dann kann auch die Variable raus
+    // The default language for number formats (ScGlobal::eLnge) must
+    // always be LANGUAGE_SYSTEM
+    // FIXME: So remove this variable?
     eLnge = LANGUAGE_SYSTEM;
 
-    //! Wenn Sortierung etc. von der Sprache der installierten Offfice-Version
-    //! abhaengen sollen, hier "Application::GetSettings().GetUILanguage()"
+    // FIXME: If the sort-order etc. should depend the installed Office version
+    //        use Application::GetSettings().GetUILanguage() here
     pSysLocale = new SvtSysLocale;
     pCharClass = pSysLocale->GetCharClassPtr();
     pLocaleData = pSysLocale->GetLocaleDataPtr();
@@ -524,7 +521,7 @@ 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 for Interpreter
     ::comphelper::rng::seed( time( NULL ) ); // seed for libc rand() replacement
 
     InitAddIns();
@@ -532,7 +529,7 @@ void ScGlobal::Init()
     pStrClipDocName = new OUString( ScResId( SCSTR_NONAME ) );
     *pStrClipDocName += "1";
 
-    //  ScDocumentPool::InitVersionMaps() ist schon vorher gerufen worden
+    //  ScDocumentPool::InitVersionMaps() has been called earlier already
 }
 
 void ScGlobal::UpdatePPT( OutputDevice* pDev )
@@ -540,10 +537,10 @@ void ScGlobal::UpdatePPT( OutputDevice* pDev )
     sal_uInt16 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();
@@ -583,7 +580,7 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool)
     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);
     sal_uInt16 nTest = static_cast<sal_uInt16>(
         aVirtWindow.PixelToLogic(Size(0, aVirtWindow.GetTextHeight()), MAP_TWIP).Height());
@@ -602,7 +599,7 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool)
 
 void ScGlobal::Clear()
 {
-    // asyncs _vor_ ExitExternalFunc zerstoeren!
+    // Destroy asyncs _before_ ExitExternalFunc!
     for( ScAddInAsyncs::iterator it = theAddInAsyncTbl.begin(); it != theAddInAsyncTbl.end(); ++it )
     {
         delete *it;
@@ -620,11 +617,11 @@ void ScGlobal::Clear()
     delete[] ppRscString;
     ppRscString = NULL;
 
-    DELETEZ(pStarCalcFunctionList);     // vor ResMgr zerstoeren!
+    DELETEZ(pStarCalcFunctionList); // Destroy before ResMgr!
     DELETEZ(pStarCalcFunctionMgr);
     ScParameterClassification::Exit();
     ScCompiler::DeInit();
-    ScInterpreter::GlobalExit();            // statischen Stack loeschen
+    ScInterpreter::GlobalExit(); // Delete static Stack
 
     DELETEZ(pEmptyBrushItem);
     DELETEZ(pButtonBrushItem);
@@ -724,7 +721,6 @@ ScFunctionMgr* ScGlobal::GetStarCalcFunctionMgr()
 void ScGlobal::ResetFunctionList()
 {
     // FunctionMgr has pointers into FunctionList, must also be updated
-
     DELETEZ( pStarCalcFunctionMgr );
     DELETEZ( pStarCalcFunctionList );
 }
@@ -845,12 +841,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
         sal_Int32 nParCount = pObj1->GetParagraphCount();
         if ( nParCount != pObj2->GetParagraphCount() )
             return false;
@@ -873,22 +869,22 @@ bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1,
 
 void ScGlobal::OpenURL( const OUString& rURL, const OUString& rTarget )
 {
-    //  OpenURL wird immer ueber irgendwelche Umwege durch Mausklicks im GridWindow
-    //  aufgerufen, darum stimmen pScActiveViewShell und nScClickMouseModifier.
-    //SvtSecurityOptions to access Libreoffice global security parameters
+    // OpenURL is always called in the GridWindow by mouse clicks in some way or another.
+    // That's why pScActiveViewShell and nScClickMouseModifier are correct.
+    // SvtSecurityOptions to access Libreoffice global security parameters
     SvtSecurityOptions aSecOpt;
     bool bCtrlClickHappened = (nScClickMouseModifier & KEY_MOD1);
     bool bCtrlClickSecOption = aSecOpt.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
     if( bCtrlClickHappened && !( bCtrlClickSecOption ) )
     {
-        //return since ctrl+click happened when the
-        //ctrl+click security option was disabled, link should not open
+        // return since ctrl+click happened when the
+        // ctrl+click security option was disabled, link should not open
         return;
     }
     else if( !( bCtrlClickHappened ) && bCtrlClickSecOption )
     {
-        //ctrl+click did not happen; only click happened maybe with some
-        //other key combo. and security option is set, so return
+        // ctrl+click did not happen; only click happened maybe with some
+        // other key combo. and security option is set, so return
         return;
     }
     SfxStringItem aUrl( SID_FILE_NAME, rURL );
@@ -910,8 +906,7 @@ void ScGlobal::OpenURL( const OUString& rURL, const OUString& rTarget )
     SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false );
     SfxBoolItem aBrowsing( SID_BROWSE, true );
 
-    //  kein SID_SILENT mehr
-
+    // No SID_SILENT anymore
     SfxViewFrame* pViewFrm = SfxViewFrame::Current();
     if (pViewFrm)
         pViewFrm->GetDispatcher()->Execute( SID_OPENDOC,
@@ -929,18 +924,16 @@ bool ScGlobal::IsSystemRTL()
 
 sal_uInt8 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 (sal_uInt8) SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() );
 }
 
 LanguageType ScGlobal::GetEditDefaultLanguage()
 {
-    //  used for EditEngine::SetDefaultLanguage
-
+    // Used for EditEngine::SetDefaultLanguage
     return Application::GetSettings().GetLanguageTag().getLanguageType();
 }
 
@@ -1043,7 +1036,7 @@ void ScGlobal::AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter )
         const SvNumberformat* pHardFormat = rFormatter.GetEntry(
             ((const SfxUInt32Item*)pHardItem)->GetValue() );
 
-        sal_uLong nParentFmt = 0;   // pool default
+        sal_uLong nParentFmt = 0; // Pool default
         const SfxItemSet* pParent = rSet.GetParent();
         if ( pParent )
             nParentFmt = ((const SfxUInt32Item&)pParent->Get( ATTR_VALUE_FORMAT )).GetValue();
diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx
index 3c24a6c..6a9e8b9 100644
--- a/sc/source/core/data/olinetab.cxx
+++ b/sc/source/core/data/olinetab.cxx
@@ -163,7 +163,7 @@ void ScOutlineArray::FindEntry(
     if (nMaxLevel > nDepth)
         nMaxLevel = nDepth;
 
-    for (size_t nLevel = 0; nLevel < nMaxLevel; ++nLevel)               //! rueckwaerts suchen ?
+    for (size_t nLevel = 0; nLevel < nMaxLevel; ++nLevel) //TODO: Search backwards?
     {
         ScOutlineCollection* pCollect = &aCollections[nLevel];
         ScOutlineCollection::iterator it = pCollect->begin(), itEnd = pCollect->end();
@@ -172,7 +172,7 @@ void ScOutlineArray::FindEntry(
             ScOutlineEntry* pEntry = it->second;
             if (pEntry->GetStart() <= nSearchPos && pEntry->GetEnd() >= nSearchPos)
             {
-                rFindLevel = nLevel + 1;            // naechster Level (zum Einfuegen)
+                rFindLevel = nLevel + 1; // Next Level (for insertion)
                 rFindIndex = std::distance(pCollect->begin(), it);
             }
         }
@@ -189,7 +189,7 @@ bool ScOutlineArray::Insert(
 
     bool bCont;
     sal_uInt16 nFindMax;
-    FindEntry( nStartCol, nStartLevel, nStartIndex );       // nLevel = neuer Level (alter+1) !!!
+    FindEntry( nStartCol, nStartLevel, nStartIndex ); // nLevel = new Level (old+1)
     FindEntry( nEndCol, nEndLevel, nEndIndex );
     nFindMax = std::max(nStartLevel,nEndLevel);
     do
@@ -230,8 +230,7 @@ bool ScOutlineArray::Insert(
 
     size_t nLevel = nStartLevel;
 
-    //  untere verschieben
-
+    // Move the ones underneath
     bool bNeedSize = false;
     if (nDepth > 0)
     {
@@ -247,7 +246,7 @@ bool ScOutlineArray::Insert(
                 {
                     if (nMoveLevel >= SC_OL_MAXDEPTH - 1)
                     {
-                        rSizeChanged = false;               // kein Platz
+                        rSizeChanged = false; // No more room
                         return false;
                     }
                     aCollections[nMoveLevel+1].insert(new ScOutlineEntry(*pEntry));
@@ -305,7 +304,7 @@ bool ScOutlineArray::FindTouchedLevel(
             if ( ( nBlockStart>=nStart && nBlockStart<=nEnd ) ||
                  ( nBlockEnd  >=nStart && nBlockEnd  <=nEnd ) )
             {
-                rFindLevel = nLevel;            // wirklicher Level
+                rFindLevel = nLevel; // Actual Level
                 bFound = true;
             }
         }
@@ -329,10 +328,10 @@ void ScOutlineArray::RemoveSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nLev
         SCCOLROW nEnd   = pEntry->GetEnd();
         if (nStart >= nStartPos && nEnd <= nEndPos)
         {
-            // Overlaps.
+            // Overlaps
             RemoveSub( nStart, nEnd, nLevel+1 );
 
-            // Re-calc iterator positions after the tree gets invalidated.
+            // Re-calc iterator positions after the tree gets invalidated
             size_t nPos = std::distance(rColl.begin(), it);
             rColl.erase(it);
             it = rColl.begin();
@@ -356,7 +355,7 @@ void ScOutlineArray::RemoveSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nLev
         {
             RemoveSub( nStart, nEnd, nLevel+1 );
 
-            // Re-calc iterator positions after the tree gets invalidated.
+            // Re-calc iterator positions after the tree gets invalidated
             size_t nPos = std::distance(rColl.begin(), it);
             rColl.erase(it);
             it = rColl.begin();
@@ -372,7 +371,7 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt
 {
     if (nStartLevel==0)
     {
-        OSL_FAIL("PromoteSub mit Level 0");
+        OSL_FAIL("PromoteSub with Level 0");
         return;
     }
 
@@ -389,7 +388,7 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt
             {
                 aCollections[nLevel-1].insert(new ScOutlineEntry(*pEntry));
 
-                // Re-calc iterator positions after the tree gets invalidated.
+                // Re-calc iterator positions after the tree gets invalidated
                 size_t nPos = std::distance(rColl.begin(), it);
                 rColl.erase(it);
                 it = rColl.begin();
@@ -412,7 +411,7 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt
             {
                 aCollections[nLevel-1].insert(new ScOutlineEntry(*pEntry));
 
-                // Re-calc iterator positions after the tree gets invalidated.
+                // Re-calc iterator positions after the tree gets invalidated
                 size_t nPos = std::distance(rColl.begin(), it);
                 rColl.erase(it);
                 it = rColl.begin();
@@ -425,7 +424,10 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt
     }
 }
 
-bool ScOutlineArray::DecDepth()                         // nDepth auf leere Levels anpassen
+/**
+ * Adapt nDepth for empty Levels
+ */
+bool ScOutlineArray::DecDepth()
 {
     bool bChanged = false;
     bool bCont;
@@ -462,7 +464,7 @@ bool ScOutlineArray::Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, bool& rSi
         SCCOLROW nEnd   = pEntry->GetEnd();
         if (nBlockStart <= nEnd && nBlockEnd >= nStart)
         {
-            // Overlaps.
+            // Overlaps
             pCollect->erase(it);
             PromoteSub( nStart, nEnd, nLevel+1 );
             itEnd = pCollect->end();
@@ -473,7 +475,7 @@ bool ScOutlineArray::Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, bool& rSi
             ++it;
     }
 
-    if (bAny)                                   // Depth anpassen
+    if (bAny) // Adapt Depth
         if (DecDepth())
             rSizeChanged = true;
 
@@ -538,7 +540,7 @@ bool ScOutlineArray::GetEntryIndex(size_t nLevel, SCCOLROW nPos, size_t& rnIndex
     if (nLevel >= nDepth)
         return false;
 
-    // found entry contains passed position
+    // Found entry contains passed position
     const ScOutlineCollection& rColl = aCollections[nLevel];
     ScOutlineCollection::const_iterator it = rColl.begin(), itEnd = rColl.end();
     for (; it != itEnd; ++it)
@@ -559,7 +561,7 @@ bool ScOutlineArray::GetEntryIndexInRange(
     if (nLevel >= nDepth)
         return false;
 
-    // found entry will be completely inside of passed range
+    // Found entry will be completely inside of passed range
     const ScOutlineCollection& rColl = aCollections[nLevel];
     ScOutlineCollection::const_iterator it = rColl.begin(), itEnd = rColl.end();
     for (; it != itEnd; ++it)
@@ -603,7 +605,7 @@ void ScOutlineArray::SetVisibleBelow(
         }
 
         if (bSkipHidden)
-            nSubLevel = nDepth;             // Abbruch
+            nSubLevel = nDepth; // Bail out
     }
 }
 
@@ -667,8 +669,8 @@ void ScOutlineArray::InsertSpace(SCCOLROW nStartPos, SCSIZE nSize)
         else
         {
             SCCOLROW nEnd = pEntry->GetEnd();
-            //  immer erweitern, wenn innerhalb der Gruppe eingefuegt
-            //  beim Einfuegen am Ende nur, wenn die Gruppe nicht ausgeblendet ist
+            // Always expand if inserted within the group
+            // When inserting at the end, only if the group is not hidden
             if ( nEnd >= nStartPos || ( nEnd+1 >= nStartPos && !pEntry->IsHidden() ) )
             {
                 SCSIZE nEntrySize = pEntry->GetSize();
@@ -682,8 +684,8 @@ void ScOutlineArray::InsertSpace(SCCOLROW nStartPos, SCSIZE nSize)
 bool ScOutlineArray::DeleteSpace(SCCOLROW nStartPos, SCSIZE nSize)
 {
     SCCOLROW nEndPos = nStartPos + nSize - 1;
-    bool bNeedSave = false;                         // Original fuer Undo benoetigt?
-    bool bChanged = false;                          // fuer Test auf Level
+    bool bNeedSave = false; // Do we need the original one for Undo?
+    bool bChanged = false; // For Level test
 
     ScSubOutlineIterator aIter( this );
     ScOutlineEntry* pEntry;
@@ -695,21 +697,21 @@ bool ScOutlineArray::DeleteSpace(SCCOLROW nStartPos, SCSIZE nSize)
 
         if ( nEntryEnd >= nStartPos )
         {
-            if ( nEntryStart > nEndPos )                                        // rechts
+            if ( nEntryStart > nEndPos ) // Right
                 pEntry->Move(-(static_cast<SCsCOLROW>(nSize)));
-            else if ( nEntryStart < nStartPos && nEntryEnd >= nEndPos )         // aussen
+            else if ( nEntryStart < nStartPos && nEntryEnd >= nEndPos ) // Outside
                 pEntry->SetSize( nEntrySize-nSize );
             else
             {
                 bNeedSave = true;
-                if ( nEntryStart >= nStartPos && nEntryEnd <= nEndPos )             // innen
+                if ( nEntryStart >= nStartPos && nEntryEnd <= nEndPos ) // Inside
                 {
                     aIter.DeleteLast();
                     bChanged = true;
                 }
-                else if ( nEntryStart >= nStartPos )                                // rechts ueber
+                else if ( nEntryStart >= nStartPos ) // Top right
                     pEntry->SetPosSize( nStartPos, static_cast<SCSIZE>(nEntryEnd-nEndPos) );
-                else                                                                // links ueber
+                else // Top left
                     pEntry->SetSize( static_cast<SCSIZE>(nStartPos-nEntryStart) );
             }
         }
@@ -736,8 +738,8 @@ bool ScOutlineArray::ManualAction(
         {
             if ( pEntry->IsHidden() == bShow )
             {
-                //  #i12341# hide if all columns/rows are hidden, show if at least one
-                //  is visible
+                // #i12341# hide if all columns/rows are hidden, show if at least one
+                // is visible
                 SCCOLROW nEnd = rTable.LastHiddenColRow(nEntryStart, bCol);
                 bool bAllHidden = (nEntryEnd <= nEnd && nEnd <
                         ::std::numeric_limits<SCCOLROW>::max());
@@ -806,7 +808,7 @@ bool ScOutlineTable::DeleteRow( SCROW nStartRow, SCSIZE nSize )
 ScSubOutlineIterator::ScSubOutlineIterator( ScOutlineArray* pOutlineArray ) :
         pArray( pOutlineArray ),
         nStart( 0 ),
-        nEnd( SCCOLROW_MAX ),                           // alle durchgehen
+        nEnd( SCCOLROW_MAX ), // Iterate over all of them
         nSubLevel( 0 ),
         nSubEntry( 0 )
 {
@@ -851,13 +853,13 @@ ScOutlineEntry* ScSubOutlineIterator::GetNext()
         }
         else
         {
-            // Go to the next sub-level.
+            // Go to the next sub-level
             nSubEntry = 0;
             ++nSubLevel;
         }
     }
     while (!bFound);
-    return pEntry;                  // nSubLevel gueltig, wenn pEntry != 0
+    return pEntry; // nSubLevel valid, if pEntry != 0
 }
 
 size_t ScSubOutlineIterator::LastEntry() const


More information about the Libreoffice-commits mailing list