[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/sdi sc/source

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 24 16:12:36 UTC 2020


 sc/sdi/scalc.sdi               |    2 +-
 sc/source/ui/view/tabvwshf.cxx |   11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 7e21086c2903d19ec0981d09d63d8f7c4e078242
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Tue Nov 24 13:14:50 2020 +0530
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Nov 24 17:11:51 2020 +0100

    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 at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

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


More information about the Libreoffice-commits mailing list