From 901c6b93ef805afa9543ce3df4874c7cf71620d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Sch=C3=B6nheit?= Date: Thu, 16 Aug 2001 13:10:12 +0000 Subject: [PATCH] #88813# +newFormWithPilot --- dbaccess/source/ui/inc/linkeddocuments.hxx | 17 +++-- dbaccess/source/ui/misc/linkeddocuments.cxx | 75 +++++++++++++++++++-- 2 files changed, 83 insertions(+), 9 deletions(-) diff --git a/dbaccess/source/ui/inc/linkeddocuments.hxx b/dbaccess/source/ui/inc/linkeddocuments.hxx index ae7b940beac4..7f39f6541f06 100644 --- a/dbaccess/source/ui/inc/linkeddocuments.hxx +++ b/dbaccess/source/ui/inc/linkeddocuments.hxx @@ -2,9 +2,9 @@ * * $RCSfile: linkeddocuments.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: fs $ $Date: 2001-04-26 11:52:20 $ + * last change: $Author: fs $ $Date: 2001-08-16 14:08:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,6 +71,7 @@ #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include #endif +#include #ifndef _LINK_HXX #include #endif @@ -110,9 +111,12 @@ namespace dbaui sal_Bool addLinkUI(); sal_Bool newForm(sal_Int32 _nNewFormId); - -// ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > -// get(const ::rtl::OUString& _rLinkName) SAL_THROW((::com::sun::star::uno::Exception)); + sal_Bool newFormWithPilot( + const String& _rDataSourceName, + const sal_Int32 _nCommandType, + const String& _rObjectName, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection + ); ::rtl::OUString getLocation(const ::rtl::OUString& _rLinkName); @@ -141,6 +145,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.1 2001/04/26 11:52:20 fs + * initial checkin - access to the data source associated bookmarks + * * * Revision 1.0 24.04.01 14:53:19 fs ************************************************************************/ diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index 78212d07005f..fd5efe0f4a86 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -2,9 +2,9 @@ * * $RCSfile: linkeddocuments.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2001-08-07 14:37:48 $ + * last change: $Author: fs $ $Date: 2001-08-16 14:10:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -128,6 +128,27 @@ #ifndef _SVTOOLS_TEMPLDLG_HXX #include #endif +// ----------------- +// for calling basic +#ifndef _SFXAPP_HXX +#include +#endif +#ifndef _SBXCLASS_HXX +#include +#endif +#ifndef _SB_SBUNO_HXX +#include +#endif +#ifndef _SFX_MACROCONF_HXX +#include +#endif +#ifndef _EHDL_HXX +#include +#endif +// ----------------- +#ifndef _DBU_MISCRES_HRC_ +#include "dbumiscres.hrc" +#endif //...................................................................... namespace dbaui @@ -141,6 +162,7 @@ namespace dbaui using namespace ::com::sun::star::beans; using namespace ::com::sun::star::util; using namespace ::com::sun::star::ucb; + using namespace ::com::sun::star::sdbc; //================================================================== //= OLinkedDocumentsAccess @@ -444,6 +466,49 @@ namespace dbaui implDrop(_rLinkName); } + //------------------------------------------------------------------ + sal_Bool OLinkedDocumentsAccess::newFormWithPilot(const String& _rDataSourceName, const sal_Int32 _nCommandType, + const String& _rObjectName, const Reference< XConnection >& _rxConnection) + { + SfxApplication* pApp = SFX_APP(); + SbxArray* pParameter = new SbxArray(); + SbxVariable* pDataSourceName = new SbxVariable(); + SbxVariable* pContentType = new SbxVariable(); + SbxVariable* pContent = new SbxVariable(); + SbxValue* pReturn = new SbxValue(); + pReturn->AddRef(); + + if (0 != _rDataSourceName.Len()) + { + // add the data source name to the parameter list + SbxVariable* pArgument = new SbxVariable; + pArgument->PutString(_rDataSourceName); + pParameter->Put(pArgument, 1); + + if (_rxConnection.is()) + { + pParameter->Put(GetSbUnoObject(String::CreateFromAscii("Connection"), makeAny(_rxConnection)), 2); + + if ((-1 != _nCommandType) && _rObjectName.Len()) + { + pArgument = new SbxVariable; + pArgument->PutLong(_nCommandType); + pParameter->Put(pArgument, 3); + + pArgument = new SbxVariable; + pArgument->PutString(_rObjectName); + pParameter->Put(pArgument, 4); + } + } + } + + pApp->EnterBasicCall(); + ErrCode aResult = pApp->GetMacroConfig()->Call(NULL, String::CreateFromAscii("FormWizard.FormWizard.MainWithDefault"), pApp->GetBasicManager(), pParameter, pReturn); + pApp->LeaveBasicCall(); + + return ERRCODE_NONE != aResult; + } + //------------------------------------------------------------------ sal_Bool OLinkedDocumentsAccess::newForm(sal_Int32 _nNewFormId) { @@ -464,9 +529,8 @@ namespace dbaui break; case ID_FORM_NEW_PILOT: - OSL_ENSURE(sal_False, "OLinkedDocumentsAccess::newForm: AutoPilot not implemented yet!"); + OSL_ENSURE(sal_False, "OLinkedDocumentsAccess::newForm: pleas use newFormWithPilot!"); return sal_False; - break; case ID_FORM_NEW_TEMPLATE: { @@ -564,6 +628,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/08/07 14:37:48 fs + * #87029# use the new template dialog for selecting a template + * * Revision 1.1 2001/04/26 11:54:33 fs * initial checkin - access to the data source associated bookmarks *