summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2000-11-10 18:04:05 +0000
committerNiklas Nebel <nn@openoffice.org>2000-11-10 18:04:05 +0000
commit786f5646c455026418665674f784b71b6ece88b8 (patch)
treeffed931ece0160161bc23a82ea64926eac5be1b0 /sc/source/ui/docshell
parentbf4bdbbe4bef899e2a99f2b9daac03a4a2b1f67f (diff)
#76477# ShowInBeamer
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx48
1 files changed, 46 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 4f57f96d0a87..88e7cec62946 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dbdocimp.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: nn $ $Date: 2000-10-26 19:08:47 $
+ * last change: $Author: nn $ $Date: 2000-11-10 19:04:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,6 +78,7 @@
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
#include "dbdocfun.hxx"
#include "docsh.hxx"
@@ -103,6 +104,49 @@ using namespace com::sun::star;
// -----------------------------------------------------------------
+// static
+void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFrame )
+{
+ if (!pFrame)
+ return;
+
+ uno::Reference<frame::XFrame> xFrame = pFrame->GetFrame()->GetFrameInterface();
+ uno::Reference<frame::XDispatchProvider> xDP(xFrame, uno::UNO_QUERY);
+ util::URL aURL;
+ aURL.Complete = rtl::OUString::createFromAscii(".component:DB/DataSourceBrowser");
+ uno::Reference<frame::XDispatch> xD = xDP->queryDispatch(aURL,
+ rtl::OUString::createFromAscii("_beamer"),
+ 0x0C);
+ if (xD.is())
+ {
+ uno::Sequence<beans::PropertyValue> aProperties;
+
+ if (rParam.bImport) // called for a range with imported data?
+ {
+ sal_Int32 nType = rParam.bSql ? sdb::CommandType::COMMAND :
+ ( (rParam.nType == ScDbQuery) ? sdb::CommandType::QUERY :
+ sdb::CommandType::TABLE );
+
+ aProperties.realloc(3);
+ beans::PropertyValue* pProperties = aProperties.getArray();
+ pProperties[0].Name = rtl::OUString::createFromAscii( SC_DBPROP_DATASOURCENAME );
+ pProperties[0].Value <<= rtl::OUString( rParam.aDBName );
+ pProperties[1].Name = rtl::OUString::createFromAscii( SC_DBPROP_COMMAND );
+ pProperties[1].Value <<= rtl::OUString( rParam.aStatement );
+ pProperties[2].Name = rtl::OUString::createFromAscii( SC_DBPROP_COMMANDTYPE );
+ pProperties[2].Value <<= nType;
+ }
+ //! else address book?
+
+ xD->dispatch(aURL, aProperties);
+ }
+ else
+ DBG_ERROR("no dispatcher for the database URL!");
+}
+
+
+// -----------------------------------------------------------------
+
BOOL ScDBDocFunc::DoImport( USHORT nTab, const ScImportParam& rParam,
const SbaSelectionList* pSelection,
BOOL bRecord, BOOL bAddrInsert )