summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2020-11-24 13:14:50 +0530
committerJan Holesovsky <kendy@collabora.com>2020-11-24 17:11:51 +0100
commit7e21086c2903d19ec0981d09d63d8f7c4e078242 (patch)
tree3abcf387db126f5ea66433b2453a05935f26c655 /sc
parent8f44a939ad09d0365607ae8960e2abfe77e3fe72 (diff)
added new parameter in uno:Move
new parameter UseCurrentDocument forces to use the correct document for moving/copying sheet tabs around When this parameter is true first parameter DocName will be ignored Change-Id: I207966af5e11fdaaa0bdd91c07e1923399680395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106478 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/sdi/scalc.sdi2
-rw-r--r--sc/source/ui/view/tabvwshf.cxx11
2 files changed, 10 insertions, 3 deletions
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 20c9ad316ee7..366317ba3aae 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -3412,7 +3412,7 @@ SfxVoidItem Mirror SID_OBJECT_MIRROR
SfxVoidItem Move FID_TAB_MOVE
-(SfxStringItem DocName FID_TAB_MOVE,SfxUInt16Item Index FN_PARAM_1,SfxBoolItem Copy FN_PARAM_2)
+(SfxStringItem DocName FID_TAB_MOVE,SfxUInt16Item Index FN_PARAM_1,SfxBoolItem Copy FN_PARAM_2,SfxBoolItem UseCurrentDocument FN_PARAM_3)
[
AutoUpdate = FALSE,
FastCall = FALSE,
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 7fcf4f5b7bf6..deace51d6627 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -465,7 +465,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
bool bDoIt = false;
sal_uInt16 nDoc = 0;
SCTAB nTab = rViewData.GetTabNo();
- bool bCpy = false;
+ bool bCpy = false, bUseCurrentDocument = false;
OUString aDocName;
OUString aTabName;
@@ -474,8 +474,15 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
SCTAB nTableCount = pDoc->GetTableCount();
const SfxPoolItem* pItem;
- if( pReqArgs->HasItem( FID_TAB_MOVE, &pItem ) )
+ // if UseCurrentDocument(FN_PARAM_3) is true ignore the document name provided and use current document
+ if( pReqArgs->HasItem( FN_PARAM_3, &pItem ) )
+ bUseCurrentDocument = static_cast<const SfxBoolItem*>(pItem)->GetValue();
+
+ if (bUseCurrentDocument)
+ aDocName = GetViewData().GetDocShell()->GetTitle();
+ else if(pReqArgs->HasItem( FID_TAB_MOVE, &pItem ))
aDocName = static_cast<const SfxStringItem*>(pItem)->GetValue();
+
if( pReqArgs->HasItem( FN_PARAM_1, &pItem ) )
{
// table is 1-based