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

Kohei Yoshida kohei.yoshida at collabora.com
Wed Jul 30 18:42:07 PDT 2014


 sc/source/core/data/document.cxx |   60 ++++++++++++++++++---------------------
 1 file changed, 29 insertions(+), 31 deletions(-)

New commits:
commit 45db9b09767dfa76bdff3e89bc9a04607e648687
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jul 29 18:24:57 2014 -0400

    Scope reduction.
    
    Change-Id: Ib77fccaf0c418e875816ed553f3540190ac0caee

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 549ab9c..3887f91 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1835,51 +1835,49 @@ void ScDocument::InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSe
 void ScDocument::InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2,
                                 bool bColInfo, bool bRowInfo )
 {
-    if (bIsUndo)
+    if (!bIsUndo)
     {
-        Clear();
+        OSL_FAIL("InitUndo");
+        return;
+    }
 
-        // Undo document shares its pooled resources with the source document.
-        SharePooledResources(pSrcDoc);
+    Clear();
 
-        if (pSrcDoc->pShell->GetMedium())
-            maFileURL = pSrcDoc->pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI);
+    // Undo document shares its pooled resources with the source document.
+    SharePooledResources(pSrcDoc);
 
-        OUString aString;
-        if ( nTab2 >= static_cast<SCTAB>(maTabs.size()))
-            maTabs.resize(nTab2 + 1, NULL);
-        for (SCTAB nTab = nTab1; nTab <= nTab2; nTab++)
-        {
-            ScTable* pTable = new ScTable(this, nTab, aString, bColInfo, bRowInfo);
-            maTabs[nTab] = pTable;
-        }
-    }
-    else
+    if (pSrcDoc->pShell->GetMedium())
+        maFileURL = pSrcDoc->pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI);
+
+    OUString aString;
+    if ( nTab2 >= static_cast<SCTAB>(maTabs.size()))
+        maTabs.resize(nTab2 + 1, NULL);
+    for (SCTAB nTab = nTab1; nTab <= nTab2; nTab++)
     {
-        OSL_FAIL("InitUndo");
+        ScTable* pTable = new ScTable(this, nTab, aString, bColInfo, bRowInfo);
+        maTabs[nTab] = pTable;
     }
 }
 
 void ScDocument::AddUndoTab( SCTAB nTab1, SCTAB nTab2, bool bColInfo, bool bRowInfo )
 {
-    if (bIsUndo)
+    if (!bIsUndo)
     {
-        OUString aString;
-        if (nTab2 >= static_cast<SCTAB>(maTabs.size()))
-        {
-            maTabs.resize(nTab2+1,NULL);
-        }
-        for (SCTAB nTab = nTab1; nTab <= nTab2; nTab++)
-            if (!maTabs[nTab])
-            {
-                maTabs[nTab] = new ScTable(this, nTab, aString, bColInfo, bRowInfo);
-            }
-
+        OSL_FAIL("AddUndoTab");
+        return;
     }
-    else
+
+    OUString aString;
+    if (nTab2 >= static_cast<SCTAB>(maTabs.size()))
     {
-        OSL_FAIL("InitUndo");
+        maTabs.resize(nTab2+1,NULL);
     }
+
+    for (SCTAB nTab = nTab1; nTab <= nTab2; nTab++)
+        if (!maTabs[nTab])
+        {
+            maTabs[nTab] = new ScTable(this, nTab, aString, bColInfo, bRowInfo);
+        }
 }
 
 void ScDocument::SetCutMode( bool bVal )


More information about the Libreoffice-commits mailing list