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

Eike Rathke erack at redhat.com
Tue Mar 7 09:52:23 UTC 2017


 sc/source/ui/docshell/docsh5.cxx |    3 +++
 sc/source/ui/view/viewdata.cxx   |    6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 73dec49802ef8fc42c5719efaa42a33cde68e569
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Mar 7 10:46:12 2017 +0100

    a size is a size
    
    Change-Id: I98b54ac353bc0c078f31b447aec2eff7e80b4308

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index e875f10..93c9a4a 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1554,9 +1554,9 @@ void ScViewData::CreateSelectedTabData()
 
 void ScViewData::EnsureTabDataSize(size_t nSize)
 {
-    if (nSize >= maTabData.size())
+    if (nSize > maTabData.size())
     {
-        size_t n = nSize - maTabData.size() + 1;
+        size_t n = nSize - maTabData.size();
         maTabData.insert(maTabData.end(), n, nullptr);
     }
 }
@@ -2843,7 +2843,7 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence <beans::PropertyValue>
     sal_Int16 nTemp16(0);
     bool bPageMode(false);
 
-    EnsureTabDataSize(GetDocument()->GetTableCount()-1);
+    EnsureTabDataSize(GetDocument()->GetTableCount());
 
     for (sal_Int32 i = 0; i < nCount; i++)
     {
commit 4c8059a3e140171399ac85ceb882d23bb458599d
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Mar 6 22:26:32 2017 +0100

    Resolves: tdf#102777 broadcast SC_TAB_INSERTED when inserting scenario
    
    So ScViewData::maTabData gets an entry added which deleting the scenario
    can remove again.
    
    Change-Id: I166baeff5408ef67faef41364515a13b8d4610bb

diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 66d7cc5..b39dcf9 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -829,6 +829,9 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const OUString& rName, const OUStrin
             PostPaintExtras();                                          // Tabellenreiter
             aModificator.SetDocumentModified();
 
+            // A scenario tab is like a hidden sheet, broadcasting also
+            // notifies ScTabViewShell to add an ScViewData::maTabData entry.
+            Broadcast( ScTablesHint( SC_TAB_INSERTED, nNewTab ));
             SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
 
             return nNewTab;


More information about the Libreoffice-commits mailing list