summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-08-19 23:22:57 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-08-20 00:42:28 +0200
commit447ecc3cfbae6a3db60d5c04360c4fa1f65eb679 (patch)
tree40d6b4a1b3fb76e0c07a4046840a50295754b24b /sc
parent257fb1141f2dcb22d3ac6c8bb63af94bc3d652af (diff)
external data: add a menu entry to refresh the data
Change-Id: I1942488d518be91c3ad03f91d98834e22bfdfb16 Reviewed-on: https://gerrit.libreoffice.org/41339 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/sc.hrc3
-rw-r--r--sc/sdi/cellsh.sdi1
-rw-r--r--sc/sdi/scalc.sdi19
-rw-r--r--sc/source/ui/view/cellsh2.cxx19
-rw-r--r--sc/uiconfig/scalc/menubar/menubar.xml1
5 files changed, 41 insertions, 2 deletions
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index eda54c590d7e..aca25080d5d6 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -85,7 +85,8 @@
#define SID_SCDEFAULTSOPTIONS (SC_VIEW_START + 21)
-#define SID_DATA_PROVIDER (SC_VIEW_START + 32)
+#define SID_DATA_PROVIDER (SC_VIEW_START + 31)
+#define SID_DATA_PROVIDER_REFRESH (SC_VIEW_START + 32)
#define SID_DATA_STREAMS_PLAY (SC_VIEW_START + 33)
#define SID_DATA_STREAMS_STOP (SC_VIEW_START + 34)
#define SID_DATA_STREAMS (SC_VIEW_START + 35)
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index 8db89f78171a..90b62dae89df 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -49,6 +49,7 @@ interface CellSelection
SID_DATA_STREAMS_PLAY [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_DATA_STREAMS_STOP [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_DATA_PROVIDER [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
+ SID_DATA_PROVIDER_REFRESH [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_MANAGE_XML_SOURCE [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_SORT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_DATA_FORM [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index b828206cf121..ffb9f3c59e2b 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -4472,7 +4472,24 @@ SfxVoidItem DataProvider SID_DATA_PROVIDER
[
AutoUpdate = FALSE,
FastCall = FALSE,
- ReadOnlyDoc = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = FALSE,
+ GroupId = SfxGroupId::Data;
+]
+
+SfxVoidItem DataProviderRefresh SID_DATA_PROVIDER_REFRESH
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 4908f4179136..b03cad6f1fac 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -55,6 +55,7 @@
#include "validat.hxx"
#include "validate.hxx"
#include "scresid.hxx"
+#include "datamapper.hxx"
#include "scui_def.hxx"
#include "scabstdlg.hxx"
@@ -788,6 +789,16 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
}
break;
+ case SID_DATA_PROVIDER_REFRESH:
+ {
+ ScDocument* pDoc = GetViewData()->GetDocument();
+ auto& rDataMapper = pDoc->GetExternalDataMapper();
+ for (auto& rDataSource : rDataMapper.getDataSources())
+ {
+ rDataSource.refresh(pDoc, false);
+ }
+ }
+ break;
case SID_MANAGE_XML_SOURCE:
ExecuteXMLSourceDialog();
break;
@@ -1196,6 +1207,14 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
break;
case SID_DATA_PROVIDER:
break;
+ case SID_DATA_PROVIDER_REFRESH:
+ {
+ ScDocument* pDoc = GetViewData()->GetDocument();
+ auto& rDataMapper = pDoc->GetExternalDataMapper();
+ if (rDataMapper.getDataSources().empty())
+ rSet.DisableItem(nWhich);
+ }
+ break;
case SID_DATA_STREAMS:
case SID_DATA_STREAMS_PLAY:
case SID_DATA_STREAMS_STOP:
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index e40766848f09..fd9d62298b52 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -631,6 +631,7 @@
<menu:menuitem menu:id=".uno:DataStreams"/>
<menu:menuitem menu:id=".uno:ManageXMLSource"/>
<menu:menuitem menu:id=".uno:DataProvider"/>
+ <menu:menuitem menu:id=".uno:DataProviderRefresh"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:TableOperationDialog"/>
<menu:menuitem menu:id=".uno:TextToColumns"/>