summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-16 02:45:50 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-23 06:25:31 +0100
commit8fd3c3ac9eb1c29b2afcd61a5d34d56b6c821f10 (patch)
tree0b2ce0dab2c26bc44e8b3b511800363796cfb5f5 /sc
parent668a71065fa5fe6929e6367998b04a20eb8230c5 (diff)
ManageNames: add menu and dialog for Add Name
Diffstat (limited to 'sc')
-rw-r--r--sc/Library_scui.mk1
-rw-r--r--sc/inc/sc.hrc2
-rw-r--r--sc/inc/scabstdlg.hxx9
-rw-r--r--sc/inc/sccommands.h1
-rw-r--r--sc/sdi/cellsh.sdi1
-rw-r--r--sc/sdi/editsh.sdi1
-rw-r--r--sc/sdi/scalc.sdi25
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx20
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx8
-rw-r--r--sc/source/ui/inc/namedefdlg.hrc3
-rw-r--r--sc/source/ui/inc/namedefdlg.hxx43
-rw-r--r--sc/source/ui/namedlg/namedefdlg.cxx9
-rw-r--r--sc/source/ui/src/namedefdlg.src21
-rw-r--r--sc/source/ui/view/cellsh1.cxx10
-rw-r--r--sc/source/ui/view/editsh.cxx10
-rw-r--r--sc/uiconfig/scalc/menubar/menubar.xml1
16 files changed, 163 insertions, 2 deletions
diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk
index c82732ade043..bd98b22fff13 100644
--- a/sc/Library_scui.mk
+++ b/sc/Library_scui.mk
@@ -100,6 +100,7 @@ $(eval $(call gb_Library_add_exception_objects,scui,\
sc/source/ui/miscdlgs/strindlg \
sc/source/ui/miscdlgs/tabbgcolordlg \
sc/source/ui/miscdlgs/textdlgs \
+ sc/source/ui/namedlg/namedefdlg \
sc/source/ui/optdlg/opredlin \
sc/source/ui/optdlg/tpcalc \
sc/source/ui/optdlg/tpcompatibility \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 020f7e89c3c5..2edba1e9d9f5 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -349,6 +349,7 @@
#define FID_USE_NAME (INSERT_MENU_START + 13)
#define FID_APPLY_NAME (INSERT_MENU_START + 14)
#define FID_INS_TABLE_EXT (INSERT_MENU_START + 15)
+#define FID_ADD_NAME (INSERT_MENU_START + 16)
#define SID_INSERT_CLIPART (INSERT_MENU_START + 17) //!!! should come from Svx
#define FID_INS_CELLSDOWN (INSERT_MENU_START + 18)
#define FID_INS_CELLSRIGHT (INSERT_MENU_START + 19)
@@ -1106,6 +1107,7 @@
#define RID_SCDLG_NAMES_PASTE (SC_DIALOGS_START + 72)
#define RID_SCDLG_NAMES_CREATE (SC_DIALOGS_START + 73)
#define RID_SCDLG_NAMES_APPLY (SC_DIALOGS_START + 74) //NYI
+#define RID_SCDLG_NAMES_DEFINE (SC_DIALOGS_START + 75)
#define RID_SCDLG_CHAR (SC_DIALOGS_START + 76)
#define RID_SCDLG_PARAGRAPH (SC_DIALOGS_START + 77)
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index babe95662360..74182c2e8c69 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -221,7 +221,7 @@ public:
virtual void EnableRenameTable (sal_Bool bFlag=true) = 0;
};
-class AbstractScNameCreateDlg : public VclAbstractDialog //add for ScNameCreateDlg
+class AbstractScNameCreateDlg : public VclAbstractDialog // Manage Name Dialog
{
public:
virtual sal_uInt16 GetFlags() const = 0;
@@ -233,6 +233,11 @@ public:
virtual String GetSelectedName() const = 0;
};
+class AbstractScNameAddDlg : public VclAbstractDialog // Define Name Dialog
+{
+public:
+};
+
class AbstractScPivotFilterDlg : public VclAbstractDialog //add for ScPivotFilterDlg
{
public:
@@ -419,6 +424,8 @@ public:
virtual AbstractScNamePasteDlg * CreateScNamePasteDlg ( Window * pParent, const ScRangeName* pList, //add for ScNamePasteDlg
const ScRangeName* pLocalList, int nId , bool bInsList=true ) = 0;
+ virtual AbstractScNameAddDlg* CreateScNameAddDlg ( Window* pParent, int nId) = 0;
+
virtual AbstractScPivotFilterDlg * CreateScPivotFilterDlg ( Window* pParent, //add for ScPivotFilterDlg
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId ) = 0;
diff --git a/sc/inc/sccommands.h b/sc/inc/sccommands.h
index e65dad73837b..97cbee299e8c 100644
--- a/sc/inc/sccommands.h
+++ b/sc/inc/sccommands.h
@@ -36,6 +36,7 @@
#define CMD_FID_TAB_APPEND ".uno:Add"
#define CMD_SID_CHART_ADDSOURCE ".uno:AddChartData"
#define CMD_SID_ADD_IN_MANAGER ".uno:AddInManager"
+#define CMD_FID_ADD_NAME ".uno:AddName"
#define CMD_SID_ADD_PRINTAREA ".uno:AddPrintArea"
#define CMD_SID_RANGE_ADDRESS ".uno:Address"
#define CMD_FID_ADJUST_PRINTZOOM ".uno:AdjustPrintZoom"
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index 011b813b86a4..5e4ed602d32a 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -178,6 +178,7 @@ interface CellSelection
SID_TABOP [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
SID_CONSOLIDATE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ FID_ADD_NAME [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
FID_INSERT_NAME [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
FID_USE_NAME [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
SID_CANCEL [ ExecMethod = Execute; ]
diff --git a/sc/sdi/editsh.sdi b/sc/sdi/editsh.sdi
index 1d95f2debdc3..ea38a68ed8dc 100644
--- a/sc/sdi/editsh.sdi
+++ b/sc/sdi/editsh.sdi
@@ -45,6 +45,7 @@ interface TableText
SID_CLIPBOARD_FORMAT_ITEMS [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
SID_SELECTALL [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
SID_CHARMAP [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
+ FID_ADD_NAME [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
FID_INSERT_NAME [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
SID_THES [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index fb22dd27ed0e..f2c8ad34f6bb 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -3758,6 +3758,31 @@ SfxVoidItem InsertMatrix SID_INSERT_MATRIX
]
//--------------------------------------------------------------------------
+SfxVoidItem AddName FID_ADD_NAME
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INSERT;
+]
+
+//--------------------------------------------------------------------------
SfxVoidItem InsertName FID_INSERT_NAME
()
[
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index bc0b8cbe1c58..cac850ff7080 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -53,6 +53,7 @@
#include "mvtabdlg.hxx"
#include "namecrea.hxx"
#include "namepast.hxx"
+#include "namedefdlg.hxx"
#include "pfiltdlg.hxx"
#include "pvfundlg.hxx"
#include "dpgroupdlg.hxx"
@@ -106,6 +107,7 @@ IMPL_ABSTDLG_BASE(AbstractScMetricInputDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScMoveTableDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScNameCreateDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScNamePasteDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScNameAddDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScPivotFilterDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDPFunctionDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDPSubtotalDlg_Impl);
@@ -1131,7 +1133,7 @@ AbstractScNameCreateDlg * ScAbstractDialogFactory_Impl::CreateScNameCreateDlg (
- AbstractScNamePasteDlg * ScAbstractDialogFactory_Impl::CreateScNamePasteDlg ( Window * pParent, const ScRangeName* pList,
+AbstractScNamePasteDlg * ScAbstractDialogFactory_Impl::CreateScNamePasteDlg ( Window * pParent, const ScRangeName* pList,
const ScRangeName* pLocalList, int nId , bool bInsList )
{
ScNamePasteDlg * pDlg=NULL;
@@ -1150,6 +1152,22 @@ AbstractScNameCreateDlg * ScAbstractDialogFactory_Impl::CreateScNameCreateDlg (
}
+AbstractScNameAddDlg* ScAbstractDialogFactory_Impl::CreateScNameAddDlg( Window* pParent, int nId)
+{
+ ScNameDefDlg* pDlg = NULL;
+ switch ( nId )
+ {
+ case RID_SCDLG_NAMES_DEFINE :
+ pDlg = new ScNameDefDlg( pParent );
+ break;
+ default:
+ break;
+ }
+ if ( pDlg )
+ return new AbstractScNameAddDlg_Impl( pDlg );
+ return 0;
+}
+
AbstractScPivotFilterDlg * ScAbstractDialogFactory_Impl::CreateScPivotFilterDlg ( Window* pParent,
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId )
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 62884ec77d1e..08b8ccaec472 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -51,6 +51,7 @@ class ScMetricInputDlg;
class ScMoveTableDlg;
class ScNameCreateDlg;
class ScNamePasteDlg;
+class ScNameDefDlg;
class ScPivotFilterDlg;
class ScDPFunctionDlg;
class ScDPSubtotalDlg;
@@ -285,6 +286,11 @@ class AbstractScNamePasteDlg_Impl : public AbstractScNamePasteDlg //add for ScN
virtual String GetSelectedName() const;
};
+class AbstractScNameAddDlg_Impl : public AbstractScNameAddDlg // Define Name
+{
+ DECL_ABSTDLG_BASE( AbstractScNameAddDlg_Impl, ScNameDefDlg )
+};
+
class AbstractScPivotFilterDlg_Impl : public AbstractScPivotFilterDlg //add for ScPivotFilterDlg
{
DECL_ABSTDLG_BASE( AbstractScPivotFilterDlg_Impl, ScPivotFilterDlg)
@@ -486,6 +492,8 @@ public:
virtual AbstractScNamePasteDlg * CreateScNamePasteDlg ( Window * pParent, const ScRangeName* pList, //add for ScNamePasteDlg
const ScRangeName* pLocalList, int nId , bool bInsList=true );
+ virtual AbstractScNameAddDlg* CreateScNameAddDlg ( Window* pParent, int nId);
+
virtual AbstractScPivotFilterDlg * CreateScPivotFilterDlg ( Window* pParent, //add for ScPivotFilterDlg
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId );
diff --git a/sc/source/ui/inc/namedefdlg.hrc b/sc/source/ui/inc/namedefdlg.hrc
new file mode 100644
index 000000000000..1360a70e9a3a
--- /dev/null
+++ b/sc/source/ui/inc/namedefdlg.hrc
@@ -0,0 +1,3 @@
+#include "sc.hrc"
+
+#define BTN_OK 1
diff --git a/sc/source/ui/inc/namedefdlg.hxx b/sc/source/ui/inc/namedefdlg.hxx
new file mode 100644
index 000000000000..2dd03c6d070b
--- /dev/null
+++ b/sc/source/ui/inc/namedefdlg.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "anyrefdg.hxx"
+#include "namedefdlg.hrc"
+#include <vcl/button.hxx>
+
+class ScNameDefDlg : public ModalDialog
+{
+private:
+ OKButton maBtnOk;
+public:
+ ScNameDefDlg(Window* pParent);
+
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
new file mode 100644
index 000000000000..89e1764ffba2
--- /dev/null
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -0,0 +1,9 @@
+#include "namedefdlg.hxx"
+
+
+ScNameDefDlg::ScNameDefDlg( Window* pParent ) :
+ ModalDialog( pParent, ScResId( RID_SCDLG_NAMES_DEFINE) ),
+ maBtnOk( this, ScResId( BTN_OK ) )
+{
+
+}
diff --git a/sc/source/ui/src/namedefdlg.src b/sc/source/ui/src/namedefdlg.src
new file mode 100644
index 000000000000..b6ce245cdd98
--- /dev/null
+++ b/sc/source/ui/src/namedefdlg.src
@@ -0,0 +1,21 @@
+
+#include "namedefdlg.hrc"
+
+ModalDialog RID_SCDLG_NAMES_DEFINE
+{
+ OutputSize = TRUE ;
+ HelpId = CMD_FID_ADD_NAME ;
+ Hide = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 100 , 200 ) ;
+ Text [ en-US ] = "Define Names" ;
+ Moveable = TRUE ;
+ Closeable = TRUE;
+ OkButton BTN_OK
+ {
+ Pos = MAP_APPFONT( 50, 50 );
+ Size = MAP_APPFONT( 40, 14 );
+ TabStop = TRUE;
+
+ };
+};
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 5140f3e0eccf..0790e987abed 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1837,6 +1837,16 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
break;
+ case FID_ADD_NAME:
+ {
+ ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
+
+ AbstractScNameAddDlg* pDlg = pFact->CreateScNameAddDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_NAMES_DEFINE );
+ pDlg->Execute();
+ delete pDlg;
+ }
+ break;
+
case SID_RANGE_NOTETEXT:
if (pReqArgs)
{
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 858983587f6a..8f69b3d5c302 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -451,6 +451,16 @@ void ScEditShell::Execute( SfxRequest& rReq )
}
break;
+ case FID_ADD_NAME:
+ {
+ ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
+
+ AbstractScNameAddDlg* pDlg = pFact->CreateScNameAddDlg( pViewData->GetDialogParent(), RID_SCDLG_NAMES_DEFINE );
+ pDlg->Execute();
+ delete pDlg;
+ }
+ break;
+
case SID_CHAR_DLG:
{
SfxItemSet aAttrs( pTableView->GetAttribs() );
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 06f765276367..106b5719be46 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -163,6 +163,7 @@
<menu:menuseparator/>
<menu:menu menu:id=".uno:NamesMenu">
<menu:menupopup>
+ <menu:menuitem menu:id=".uno:AddName"/>
<menu:menuitem menu:id=".uno:DefineName"/>
<menu:menuitem menu:id=".uno:InsertName"/>
<menu:menuseparator/>