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

Michael Stahl mstahl at redhat.com
Wed Jan 13 05:57:05 PST 2016


 sc/source/core/data/document.cxx |    5 -----
 sc/source/ui/view/tabvwshf.cxx   |   18 +++++-------------
 2 files changed, 5 insertions(+), 18 deletions(-)

New commits:
commit 6dc3dbcf91c2ac63651e0494951e090953c96cb5
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 13 14:36:27 2016 +0100

    Revert "sc: Make .uno:Insert (inserting a new sheet) always succeed."
    
    This reverts commit b908497aaff0ec48340f24df33182430b32a4023.
    
    Causes segfaults in various calc unit tests.
    
    Change-Id: I6b986450fb32db094b1e1f6cbbca1b92f23e4873

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index e878815..deaddf4 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -105,8 +105,6 @@
 #include <memory>
 #include <boost/checked_delete.hpp>
 
-#include <LibreOfficeKit/LibreOfficeKitEnums.h>
-
 #include "mtvelements.hxx"
 
 using ::editeng::SvxBorderLine;
@@ -568,9 +566,6 @@ bool ScDocument::InsertTab(
         aCxt.mnTabDeletedStart = nPos;
         aCxt.mnTabDeletedEnd = nPos;
         SetAllFormulasDirty(aCxt);
-
-        if (GetDrawLayer()->isTiledRendering())
-            GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
     }
 
     return bValid;
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 2b838bf..0f31469 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -177,21 +177,15 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                     bool bOk = false;
                     const SfxPoolItem*  pTabItem;
                     const SfxPoolItem*  pNameItem;
+                    OUString            aName;
 
                     if ( pReqArgs->HasItem( FN_PARAM_1, &pTabItem ) &&
                          pReqArgs->HasItem( nSlot, &pNameItem ) )
                     {
-                        OUString aName = static_cast<const SfxStringItem*>(pNameItem)->GetValue();
-                        pDoc->CreateValidTabName(aName);
-
                         // sheet number from basic: 1-based
-                        // 0 is special, means adding at the end
-                        nTabNr = static_cast<const SfxUInt16Item*>(pTabItem)->GetValue();
-                        if (nTabNr == 0)
-                            nTabNr = nTabCount;
-                        else
-                            --nTabNr;
 
+                        aName = static_cast<const SfxStringItem*>(pNameItem)->GetValue();
+                        nTabNr = static_cast<const SfxUInt16Item*>(pTabItem)->GetValue() - 1;
                         if ( nTabNr <= nTabCount )
                             bOk = InsertTable( aName, nTabNr );
                     }
commit 93adda8562b09e14624e52a9bb3fd1e5f321789d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 13 14:36:23 2016 +0100

    Revert "sc: Further .uno:Insert (inserting a new sheet) tweak."
    
    This reverts commit b550d3b10adf3a7f8c3013c231e8251059343c5e.

diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 8ed4937..2b838bf 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -192,10 +192,8 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                         else
                             --nTabNr;
 
-                        if (nTabNr > nTabCount)
-                            nTabNr = nTabCount;
-
-                        bOk = InsertTable(aName, nTabNr);
+                        if ( nTabNr <= nTabCount )
+                            bOk = InsertTable( aName, nTabNr );
                     }
 
                     if (bOk)


More information about the Libreoffice-commits mailing list