sc/source/core/data/document.cxx | 5 +++++ sc/source/ui/view/tabvwshf.cxx | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-)
New commits: commit 39997d4831fc1ca900d1037b0beec1b8b91b6e83 Author: Jan Holesovsky <ke...@collabora.com> Date: Wed Jan 13 11:12:12 2016 +0100 sc: Make .uno:Insert (inserting a new sheet) always succeed. Also, when provided with '0' as the sheet number, treat it as adding at the end - which I think is the usual use case one wants to target. Change-Id: I9e1a1733c2310b8c6bb7ff239351e88bbef09ac7 diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index bb6431a..0e93b81 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -104,6 +104,8 @@ #include <boost/checked_delete.hpp> #include <boost/scoped_ptr.hpp> +#include <LibreOfficeKit/LibreOfficeKitEnums.h> + #include "mtvelements.hxx" using ::editeng::SvxBorderLine; @@ -555,6 +557,9 @@ 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 7fd1fdc..63adab3 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -178,15 +178,21 @@ 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 ) ) { - // tablenumber from basic: 1-based + OUString aName = static_cast<const SfxStringItem*>(pNameItem)->GetValue(); + pDoc->CreateValidTabName(aName); + + // tablenumber from basic is 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 ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits