summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Andrei Abahnencei <alinandrei2004@gmail.com>2024-12-12 16:03:22 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-12-19 14:52:16 +0100
commitc3839919c75f6b46de32aecbc1ab1e2855288427 (patch)
tree24d3ec46307586e994c57f1b39b0b3ab4f294ead
parent50131f31f093c32d7f4a3c85fc77637ba0513f2c (diff)
tdf#163319 Do not decrement destination position when moving a tab
to the right Signed-off-by: Alin Andrei Abahnencei <alinandrei2004@gmail.com> Change-Id: Id8da1a1b199927bb2f1b71b814737b8287ea2a34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178362 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins (cherry picked from commit e6d4af2a03f22de1493e00e497e081240bf8a5c4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178799 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/source/ui/docshell/docsh5.cxx3
-rw-r--r--test/source/sheet/xspreadsheets.cxx2
2 files changed, 1 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 52fdbfada36a..aa1269aa70b0 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -994,9 +994,6 @@ bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, bool bCopy, bool bRec
if ( m_pDocument->GetChangeTrack() )
return false;
- if ( nSrcTab<nDestTab && nDestTab!=SC_TAB_APPEND )
- nDestTab--;
-
if ( nSrcTab == nDestTab )
{
//! allow only for api calls?
diff --git a/test/source/sheet/xspreadsheets.cxx b/test/source/sheet/xspreadsheets.cxx
index e2b2640d682d..8f622ba26d80 100644
--- a/test/source/sheet/xspreadsheets.cxx
+++ b/test/source/sheet/xspreadsheets.cxx
@@ -56,7 +56,7 @@ void XSpreadsheets::testMoveByName()
// get sheet from the new position
uno::Reference< container::XIndexAccess > oIndexAccess(xSpreadsheets, UNO_QUERY_THROW);
- uno::Any aAny = oIndexAccess->getByIndex(1);
+ uno::Any aAny = oIndexAccess->getByIndex(2);
uno::Reference< container::XNamed > xNamed;
CPPUNIT_ASSERT(aAny >>= xNamed);