summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorShubham Goyal <22shubh22@gmail.com>2019-02-26 23:02:40 +0530
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-03-08 15:51:23 +0100
commit732d630c3d2a168c725c18e4dd8df7a0a4f85566 (patch)
treeaf02abe6e0b2346c46a464b8063faa81ee11ed7d /basctl
parentcfdba2b94fd7c0a2ec0250ddc9212d367db50c8c (diff)
tdf#53524 Create UNO grid control- dialog editor
The commit is based on the patch in https://bz.apache.org/ooo/show_bug.cgi?id=120066. Change-Id: Ia4ad536331954679940104adf5d6178228c90854 Reviewed-on: https://gerrit.libreoffice.org/68814 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/inc/strings.hxx1
-rw-r--r--basctl/sdi/baside.sdi6
-rw-r--r--basctl/source/basicide/baside3.cxx4
-rw-r--r--basctl/source/basicide/basides1.cxx1
-rw-r--r--basctl/source/basicide/basidesh.cxx1
-rw-r--r--basctl/source/dlged/dlgedfac.cxx4
-rw-r--r--basctl/source/dlged/dlgedobj.cxx8
-rw-r--r--basctl/source/dlged/propbrw.cxx4
-rw-r--r--basctl/source/inc/dlgeddef.hxx16
-rw-r--r--basctl/uiconfig/basicide/toolbar/insertcontrolsbar.xml1
10 files changed, 39 insertions, 7 deletions
diff --git a/basctl/inc/strings.hxx b/basctl/inc/strings.hxx
index ec06daaef937..506886afc3e3 100644
--- a/basctl/inc/strings.hxx
+++ b/basctl/inc/strings.hxx
@@ -34,6 +34,7 @@
#define RID_STR_CLASS_PATTERNFIELD "PatternField"
#define RID_STR_CLASS_FILECONTROL "FileControl"
#define RID_STR_CLASS_TREECONTROL "TreeControl"
+#define RID_STR_CLASS_GRIDCONTROL "GridControl"
#define RID_STR_CLASS_SPINCONTROL "SpinButton"
#endif
diff --git a/basctl/sdi/baside.sdi b/basctl/sdi/baside.sdi
index 5c413f89e6c4..61ecb19cf6df 100644
--- a/basctl/sdi/baside.sdi
+++ b/basctl/sdi/baside.sdi
@@ -541,6 +541,12 @@ shell basctl_Shell
StateMethod = GetState;
]
+ SID_INSERT_GRIDCONTROL
+ [
+ ExecMethod = ExecuteDialog;
+ StateMethod = GetState;
+ ]
+
SID_EXPORT_DIALOG
[
ExecMethod = ExecuteDialog;
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index aa5e355d29e6..264bdc202116 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -356,6 +356,7 @@ void DialogWindow::GetState( SfxItemSet& rSet )
case SID_INSERT_PATTERNFIELD:
case SID_INSERT_FILECONTROL:
case SID_INSERT_SPINBUTTON:
+ case SID_INSERT_GRIDCONTROL:
case SID_INSERT_TREECONTROL:
{
if ( IsReadOnly() )
@@ -504,6 +505,9 @@ void DialogWindow::ExecuteCommand( SfxRequest& rReq )
case SID_INSERT_SPINBUTTON:
nInsertObj = OBJ_DLG_SPINBUTTON;
break;
+ case SID_INSERT_GRIDCONTROL:
+ nInsertObj = OBJ_DLG_GRIDCONTROL;
+ break;
case SID_INSERT_TREECONTROL:
nInsertObj = OBJ_DLG_TREECONTROL;
break;
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index dfcf5af28643..1ab4d275dcb3 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -897,6 +897,7 @@ void Shell::GetState(SfxItemSet &rSet)
case SID_INSERT_PATTERNFIELD:
case SID_INSERT_FILECONTROL:
case SID_INSERT_SPINBUTTON:
+ case SID_INSERT_GRIDCONTROL:
case SID_INSERT_TREECONTROL:
case SID_INSERT_FORM_RADIO:
case SID_INSERT_FORM_CHECK:
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 2c7049a5ddfa..4fd29d359337 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -892,6 +892,7 @@ void Shell::InvalidateControlSlots()
pBindings->Invalidate( SID_INSERT_PATTERNFIELD );
pBindings->Invalidate( SID_INSERT_FILECONTROL );
pBindings->Invalidate( SID_INSERT_SPINBUTTON );
+ pBindings->Invalidate( SID_INSERT_GRIDCONTROL );
pBindings->Invalidate( SID_INSERT_TREECONTROL );
pBindings->Invalidate( SID_CHOOSE_CONTROLS );
}
diff --git a/basctl/source/dlged/dlgedfac.cxx b/basctl/source/dlged/dlgedfac.cxx
index 513fdc707b1f..b69856c3cf23 100644
--- a/basctl/source/dlged/dlgedfac.cxx
+++ b/basctl/source/dlged/dlgedfac.cxx
@@ -216,6 +216,10 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
case OBJ_DLG_TREECONTROL:
pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.tree.TreeControlModel", xDialogSFact );
break;
+ case OBJ_DLG_GRIDCONTROL:
+ pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.grid.UnoControlGridModel", xDialogSFact );
+ break;
+
}
}
return pNewObj;
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index 8d2b42010fdd..81eb13a4fa6e 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -719,6 +719,10 @@ OUString DlgEdObj::GetDefaultName() const
{
sResId = RID_STR_CLASS_TREECONTROL;
}
+ else if ( supportsService( "com.sun.star.awt.grid.UnoControlGridModel" ) )
+ {
+ sResId = RID_STR_CLASS_GRIDCONTROL;
+ }
else if ( supportsService( "com.sun.star.awt.UnoControlSpinButtonModel" ) )
{
sResId = RID_STR_CLASS_SPINCONTROL;
@@ -844,6 +848,10 @@ sal_uInt16 DlgEdObj::GetObjIdentifier() const
{
return OBJ_DLG_TREECONTROL;
}
+ else if ( supportsService( "com.sun.star.awt.grid.UnoControlGridModel" ))
+ {
+ return OBJ_DLG_GRIDCONTROL;
+ }
else
{
return OBJ_DLG_CONTROL;
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index 357f05255ee0..1f4a02c82f5c 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -403,6 +403,10 @@ OUString PropBrw::GetHeadlineName( const Reference< XPropertySet >& _rxObject )
{
sResId = RID_STR_CLASS_TREECONTROL;
}
+ else if ( xServiceInfo->supportsService( "com.sun.star.awt.grid.UnoControlGridModel" ) )
+ {
+ sResId = RID_STR_CLASS_GRIDCONTROL;
+ }
else
{
sResId = RID_STR_CLASS_CONTROL;
diff --git a/basctl/source/inc/dlgeddef.hxx b/basctl/source/inc/dlgeddef.hxx
index e14bc28dd0f2..74e73a894fd0 100644
--- a/basctl/source/inc/dlgeddef.hxx
+++ b/basctl/source/inc/dlgeddef.hxx
@@ -52,14 +52,16 @@ enum
OBJ_DLG_FILECONTROL = 23,
OBJ_DLG_TREECONTROL = 24,
OBJ_DLG_SPINBUTTON = 25,
+ OBJ_DLG_GRIDCONTROL = 26,
+
+ OBJ_DLG_FORMRADIO = 27,
+ OBJ_DLG_FORMCHECK = 28,
+ OBJ_DLG_FORMLIST = 29,
+ OBJ_DLG_FORMCOMBO = 30,
+ OBJ_DLG_FORMSPIN = 31,
+ OBJ_DLG_FORMVSCROLL = 32,
+ OBJ_DLG_FORMHSCROLL = 33,
- OBJ_DLG_FORMRADIO = 26,
- OBJ_DLG_FORMCHECK = 27,
- OBJ_DLG_FORMLIST = 28,
- OBJ_DLG_FORMCOMBO = 29,
- OBJ_DLG_FORMSPIN = 30,
- OBJ_DLG_FORMVSCROLL = 31,
- OBJ_DLG_FORMHSCROLL = 32,
};
// control properties
diff --git a/basctl/uiconfig/basicide/toolbar/insertcontrolsbar.xml b/basctl/uiconfig/basicide/toolbar/insertcontrolsbar.xml
index 9d3303f8be8d..9ad39ef9da64 100644
--- a/basctl/uiconfig/basicide/toolbar/insertcontrolsbar.xml
+++ b/basctl/uiconfig/basicide/toolbar/insertcontrolsbar.xml
@@ -57,5 +57,6 @@
<toolbar:toolbaritem xlink:href=".uno:InsertFileControl"/>
<toolbar:toolbaritem xlink:href=".uno:InsertTreeControl"/>
<toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:InsertGridControl"/>
<toolbar:toolbaritem xlink:href=".uno:SpinButton"/>
</toolbar:toolbar>