[Libreoffice-commits] .: sc/inc sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Mon Jan 3 16:51:29 PST 2011
sc/inc/scabstdlg.hxx | 2 +-
sc/source/ui/attrdlg/scdlgfact.cxx | 2 +-
sc/source/ui/attrdlg/scdlgfact.hxx | 2 +-
sc/source/ui/inc/mvtabdlg.hxx | 8 +++++---
sc/source/ui/miscdlgs/mvtabdlg.cxx | 14 +++++++++++---
5 files changed, 19 insertions(+), 9 deletions(-)
New commits:
commit f200d4f7280127f120d550ddc2be5ab517d00bf9
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Jan 3 19:49:41 2011 -0500
Don't reset the default sheet name when the name has evern been edited.
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index cd8b197..3584805 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -212,7 +212,7 @@ class AbstractScMoveTableDlg : public VclAbstractDialog //add for ScMoveTableDl
public:
virtual USHORT GetSelectedDocument () const = 0;
virtual USHORT GetSelectedTable () const = 0;
- virtual BOOL GetCopyTable () const = 0;
+ virtual bool GetCopyTable () const = 0;
virtual bool GetRenameTable () const = 0;
virtual void GetTabNameString( String& rString ) const = 0;
virtual void SetForceCopyTable () = 0;
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index a7c953e..c7f8a46 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -498,7 +498,7 @@ USHORT AbstractScMoveTableDlg_Impl::GetSelectedTable() const
{
return pDlg->GetSelectedTable();
}
-BOOL AbstractScMoveTableDlg_Impl::GetCopyTable() const
+bool AbstractScMoveTableDlg_Impl::GetCopyTable() const
{
return pDlg->GetCopyTable();
}
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index d86eede..c079eb5 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -262,7 +262,7 @@ class AbstractScMoveTableDlg_Impl : public AbstractScMoveTableDlg //add for ScM
DECL_ABSTDLG_BASE( AbstractScMoveTableDlg_Impl, ScMoveTableDlg)
virtual USHORT GetSelectedDocument () const;
virtual USHORT GetSelectedTable () const;
- virtual BOOL GetCopyTable () const;
+ virtual bool GetCopyTable () const;
virtual bool GetRenameTable () const;
virtual void GetTabNameString( String& rString ) const;
virtual void SetForceCopyTable ();
diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx
index 367854a..1c0f09f 100644
--- a/sc/source/ui/inc/mvtabdlg.hxx
+++ b/sc/source/ui/inc/mvtabdlg.hxx
@@ -50,7 +50,7 @@ public:
USHORT GetSelectedDocument () const;
SCTAB GetSelectedTable () const;
- BOOL GetCopyTable () const;
+ bool GetCopyTable () const;
bool GetRenameTable () const;
void GetTabNameString( String& rString ) const;
void SetForceCopyTable ();
@@ -87,8 +87,10 @@ private:
USHORT nDocument;
SCTAB nTable;
- BOOL bCopyTable;
- BOOL bRenameTable;
+ bool bCopyTable:1;
+ bool bRenameTable:1;
+ bool mbEverEdited:1;
+
//--------------------------------------
void Init ();
void InitBtnRename ();
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index f9f78da..02fdc27 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -84,8 +84,9 @@ ScMoveTableDlg::ScMoveTableDlg( Window* pParent,
mrDefaultName( rDefault ),
nDocument ( 0 ),
nTable ( 0 ),
- bCopyTable ( FALSE ),
- bRenameTable( FALSE )
+ bCopyTable ( false ),
+ bRenameTable( false ),
+ mbEverEdited( false )
{
#if ENABLE_LAYOUT
#undef ScResId
@@ -107,7 +108,7 @@ USHORT ScMoveTableDlg::GetSelectedDocument () const { return nDocument; }
SCTAB ScMoveTableDlg::GetSelectedTable () const { return nTable; }
-BOOL ScMoveTableDlg::GetCopyTable () const { return bCopyTable; }
+bool ScMoveTableDlg::GetCopyTable () const { return bCopyTable; }
bool ScMoveTableDlg::GetRenameTable () const { return bRenameTable; }
@@ -141,6 +142,10 @@ void ScMoveTableDlg::EnableRenameTable(BOOL bFlag)
void ScMoveTableDlg::ResetRenameInput()
{
+ if (mbEverEdited)
+ // Don't reset the name when the sheet name has ever been edited.
+ return;
+
if (!aEdTabName.IsEnabled())
{
aEdTabName.SetText(String());
@@ -360,7 +365,10 @@ IMPL_LINK( ScMoveTableDlg, SelHdl, ListBox *, pLb )
IMPL_LINK( ScMoveTableDlg, CheckNameHdl, Edit *, pEdt )
{
if ( pEdt == &aEdTabName )
+ {
+ mbEverEdited = true;
CheckNewTabName();
+ }
return 0;
}
More information about the Libreoffice-commits
mailing list