[libreoffice/f16] Resolves: rhbz#813280 sheets cannot be moved in Calc

Eike Rathke erack at fedoraproject.org
Wed Apr 18 12:26:43 UTC 2012


commit 8ec31a6210afac542d2b61d57de256c03492daaa
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Apr 18 14:26:20 2012 +0200

    Resolves: rhbz#813280 sheets cannot be moved in Calc

 ...bz-813280-the-current-document-is-not-alw.patch |  111 ++++++++++++++++++++
 libreoffice.spec                                   |    3 +
 2 files changed, 114 insertions(+), 0 deletions(-)
---
diff --git a/0001-resolved-rhbz-813280-the-current-document-is-not-alw.patch b/0001-resolved-rhbz-813280-the-current-document-is-not-alw.patch
new file mode 100644
index 0000000..040e1d9
--- /dev/null
+++ b/0001-resolved-rhbz-813280-the-current-document-is-not-alw.patch
@@ -0,0 +1,111 @@
+From cafe54fc6b8ae195a87c77499f63ddb4e0de2d4e Mon Sep 17 00:00:00 2001
+Message-Id: <cafe54fc6b8ae195a87c77499f63ddb4e0de2d4e.1334751575.git.erack at redhat.com>
+From: Eike Rathke <erack at redhat.com>
+Date: Tue, 17 Apr 2012 21:31:50 +0200
+Subject: [PATCH] resolved rhbz#813280 the current document is not always the
+ first in list
+
+i.e. if more than one document open and dialog invoked on any but the first
+document.
+---
+ sc/source/ui/inc/mvtabdlg.hxx      |    4 +++-
+ sc/source/ui/miscdlgs/mvtabdlg.cxx |   27 +++++++++++++++++----------
+ 2 files changed, 20 insertions(+), 11 deletions(-)
+
+diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx
+index a4b03ed..4a15a66 100644
+--- a/sc/source/ui/inc/mvtabdlg.hxx
++++ b/sc/source/ui/inc/mvtabdlg.hxx
+@@ -61,6 +61,7 @@ private:
+     void ResetRenameInput();
+     void CheckNewTabName();
+     ScDocument* GetSelectedDoc();
++    bool IsCurrentDocSelected() const;
+ 
+ private:
+     FixedLine       aFlAction;
+@@ -85,7 +86,8 @@ private:
+ 
+     const String&   mrDefaultName;
+ 
+-    sal_uInt16          nDocument;
++    sal_uInt16      mnCurrentDocPos;
++    sal_uInt16      nDocument;
+     SCTAB           nTable;
+     bool            bCopyTable:1;
+     bool            bRenameTable:1;
+diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
+index f50cdd0..e640feb 100644
+--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
++++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
+@@ -82,6 +82,7 @@ ScMoveTableDlg::ScMoveTableDlg( Window*       pParent,
+         maStrTabNameInvalid( ScResId(STR_TABNAME_WARN_INVALID) ),
+         //
+         mrDefaultName( rDefault ),
++        mnCurrentDocPos( 0 ),
+         nDocument   ( 0 ),
+         nTable      ( 0 ),
+         bCopyTable  ( false ),
+@@ -143,8 +144,13 @@ void ScMoveTableDlg::EnableRenameTable(sal_Bool bFlag)
+ void ScMoveTableDlg::ResetRenameInput()
+ {
+     if (mbEverEdited)
++    {
+         // Don't reset the name when the sheet name has ever been edited.
++        // But check the name, as this is also called for change of copy/move
++        // buttons and document listbox selection.
++        CheckNewTabName();
+         return;
++    }
+ 
+     if (!aEdTabName.IsEnabled())
+     {
+@@ -194,19 +200,15 @@ void ScMoveTableDlg::CheckNewTabName()
+         return;
+     }
+ 
+-    bool   bFound = false;
++    bool bMoveInCurrentDoc = (aBtnMove.IsChecked() && IsCurrentDocSelected());
++    bool bFound = false;
+     sal_uInt16 nLast  = aLbTable.GetEntryCount() - 1;
+-    for ( sal_uInt16 i=0; i<=nLast; ++i )
++    for ( sal_uInt16 i=0; i<=nLast && !bFound; ++i )
+     {
+         if ( rNewName == aLbTable.GetEntry( i ) )
+         {
+-            if( ( aBtnMove.IsChecked() ) &&
+-                ( aLbDoc.GetSelectEntryPos() == 0 ) &&
+-                ( aEdTabName.GetText() == mrDefaultName) )
+-
+-                // Move inside same document, thus same name is allowed.
+-                bFound = false;
+-            else
++            // Only for move within same document the same name is allowed.
++            if (!bMoveInCurrentDoc || aEdTabName.GetText() != mrDefaultName)
+                 bFound = true;
+         }
+     }
+@@ -230,6 +232,11 @@ ScDocument* ScMoveTableDlg::GetSelectedDoc()
+     return static_cast<ScDocument*>(aLbDoc.GetEntryData(nPos));
+ }
+ 
++bool ScMoveTableDlg::IsCurrentDocSelected() const
++{
++    return aLbDoc.GetSelectEntryPos() == mnCurrentDocPos;
++}
++
+ //------------------------------------------------------------------------
+ 
+ void ScMoveTableDlg::Init()
+@@ -270,7 +277,7 @@ void ScMoveTableDlg::InitDocListBox()
+ 
+             if ( pScSh == SfxObjectShell::Current() )
+             {
+-                nSelPos = i;
++                mnCurrentDocPos = nSelPos = i;
+                 aEntryName += sal_Unicode( ' ' );
+                 aEntryName += String( ScResId( STR_CURRENTDOC ) );
+             }
+-- 
+1.7.7.6
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 7c77d81..f050788 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -248,6 +248,7 @@ Patch126: 0001-Resolves-fdo-48096-torn-off-popups-trigger-keyboard-.patch
 Patch127: Introduced-SystemShellExecuteFlags-URIS_ONLY.patch
 Patch128: 0001-fdo-38088-better-CSV-import-default-separators.patch
 Patch129: 0001-rhbz-809466-change-soname-of-bundled-redland-libs.patch
+Patch130: 0001-resolved-rhbz-813280-the-current-document-is-not-alw.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -1183,6 +1184,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
 %patch127 -p1 -b .Introduced-SystemShellExecuteFlags-URIS_ONLY.patch
 %patch128 -p1 -b .fdo-38088-better-CSV-import-default-separators.patch
 %patch129 -p1 -b .rhbz-809466-change-soname-of-bundled-redland-libs.patch
+%patch130 -p1 -b .rhbz-813280-the-current-document-is-not-alw.patch
 
 # these are horribly incomplete--empty translations and copied english
 # strings with spattering of translated strings
@@ -2505,6 +2507,7 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 * Fri Apr 13 2012 David Tardon <dtardon at redhat.com> - 3.4.5.2-13-UNBUILT
 - Resolves: rhbz#809466 libreoffice-core (unintentionally) provides
   libraptor.so.1()() and librdf.so.0()()
+- Resolves: rhbz#813280 sheets cannot be moved in Calc
 
 * Thu Apr 12 2012 Stephan Bergmann <sbergman at redhat.com> - 3.4.5.2-12
 - Fix URIS_ONLY flag issue


More information about the scm-commits mailing list