Tag: cws_src680_dba24e User: oj Date: 2007-12-19 12:27:46+0000 Modified: dba/dbaccess/source/core/dataaccess/documentdefinition.cxx dba/dbaccess/source/ui/app/AppController.cxx dba/dbaccess/source/ui/app/AppControllerDnD.cxx dba/dbaccess/source/ui/inc/linkeddocuments.hxx dba/dbaccess/source/ui/misc/linkeddocuments.cxx dba/dbaccess/source/ui/querydesign/querycontroller.cxx
Log: #i84339# some code cleanups for the wizards File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: documentdefinition.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.50&r2=1.50.4.1 Delta lines: +4 -4 ------------------- --- documentdefinition.cxx 2007-11-21 15:39:30+0000 1.50 +++ documentdefinition.cxx 2007-12-19 12:27:42+0000 1.50.4.1 @@ -4,9 +4,9 @@ * * $RCSfile: documentdefinition.cxx,v $ * - * $Revision: 1.50 $ + * $Revision: 1.50.4.1 $ * - * last change: $Author: ihi $ $Date: 2007/11/21 15:39:30 $ + * last change: $Author: oj $ $Date: 2007/12/19 12:27:42 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1386,7 +1386,7 @@ sDocumentService = GetDocumentServiceFromMediaType( xStorage, m_pImpl->m_aProps.sPersistentName, m_aContext.getLegacyServiceFactory(), aClassID ); // check if we are not a form and // the com.sun.star.report.pentaho.SOReportJobFactory is not present. - if (m_bForm == 0 /* MAGIC! */ && !sDocumentService.equalsAscii("com.sun.star.text.TextDocument")) + if ( !m_bForm && !sDocumentService.equalsAscii("com.sun.star.text.TextDocument")) { // we seems to be a new report, check if report extension is present. Reference< XContentEnumerationAccess > xEnumAccess( m_aContext.getLegacyServiceFactory(), UNO_QUERY ); Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.50.4.1&r2=1.50.4.2 Delta lines: +15 -5 -------------------- --- AppController.cxx 2007-12-04 10:01:39+0000 1.50.4.1 +++ AppController.cxx 2007-12-19 12:27:42+0000 1.50.4.2 @@ -4,9 +4,9 @@ * * $RCSfile: AppController.cxx,v $ * - * $Revision: 1.50.4.1 $ + * $Revision: 1.50.4.2 $ * - * last change: $Author: oj $ $Date: 2007/12/04 10:01:39 $ + * last change: $Author: oj $ $Date: 2007/12/19 12:27:42 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -421,6 +421,14 @@ if ( m_xDataSource.is() ) { m_xDataSource->removePropertyChangeListener(::rtl::OUString(), this); + m_xDataSource->removePropertyChangeListener(PROPERTY_INFO, this); + m_xDataSource->removePropertyChangeListener(PROPERTY_URL, this); + m_xDataSource->removePropertyChangeListener(PROPERTY_ISPASSWORDREQUIRED, this); + m_xDataSource->removePropertyChangeListener(PROPERTY_LAYOUTINFORMATION, this); + m_xDataSource->removePropertyChangeListener(PROPERTY_SUPPRESSVERSIONCL, this); + m_xDataSource->removePropertyChangeListener(PROPERTY_TABLEFILTER, this); + m_xDataSource->removePropertyChangeListener(PROPERTY_TABLETYPEFILTER, this); + m_xDataSource->removePropertyChangeListener(PROPERTY_USER, this); // otherwise we may delete our datasource twice Reference<XPropertySet> xProp = m_xDataSource; m_xDataSource = NULL; @@ -458,7 +466,7 @@ } m_pView = NULL; - OApplicationController_CBASE::disposing(); + OApplicationController_CBASE::disposing(); // here the m_refCount must be equal 5 } //-------------------------------------------------------------------- @@ -1871,10 +1879,12 @@ ::std::auto_ptr<OLinkedDocumentsAccess> aHelper = getDocumentsAccess(_eType); if ( aHelper->isConnected() ) { + Reference< XComponent > xComponent,xDefinition; if ( E_QUERY == _eType ) - aHelper->newQueryWithPilot( ); + xComponent = aHelper->newQueryWithPilot( ); else - aHelper->newTableWithPilot( ); + xComponent = aHelper->newTableWithPilot( ); + addDocumentListener(xComponent,xDefinition); } } break; File [changed]: AppControllerDnD.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerDnD.cxx?r1=1.23&r2=1.23.4.1 Delta lines: +4 -4 ------------------- --- AppControllerDnD.cxx 2007-11-21 15:50:06+0000 1.23 +++ AppControllerDnD.cxx 2007-12-19 12:27:42+0000 1.23.4.1 @@ -4,9 +4,9 @@ * * $RCSfile: AppControllerDnD.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.23.4.1 $ * - * last change: $Author: ihi $ $Date: 2007/11/21 15:50:06 $ + * last change: $Author: oj $ $Date: 2007/12/19 12:27:42 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -649,7 +649,7 @@ OSL_ENSURE(xNameAccess.is(),"Data source doesn't return a name access -> GPF"); return ::std::auto_ptr<OLinkedDocumentsAccess>( - new OLinkedDocumentsAccess( getView(), getORB(), xNameAccess, xConnection, getDatabaseName() ) ); + new OLinkedDocumentsAccess( getView(), m_xCurrentFrame,getORB(), xNameAccess, xConnection, getDatabaseName() ) ); } // ----------------------------------------------------------------------------- TransferableHelper* OApplicationController::copyObject() Directory: /dba/dbaccess/source/ui/inc/ ======================================= File [changed]: linkeddocuments.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/linkeddocuments.hxx?r1=1.15&r2=1.15.6.1 Delta lines: +9 -5 ------------------- --- linkeddocuments.hxx 2007-11-20 19:23:35+0000 1.15 +++ linkeddocuments.hxx 2007-12-19 12:27:42+0000 1.15.6.1 @@ -4,9 +4,9 @@ * * $RCSfile: linkeddocuments.hxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.15.6.1 $ * - * last change: $Author: ihi $ $Date: 2007/11/20 19:23:35 $ + * last change: $Author: oj $ $Date: 2007/12/19 12:27:42 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -51,6 +51,7 @@ #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ #include <com/sun/star/sdbc/XConnection.hpp> #endif +#include <com/sun/star/frame/XFrame.hpp> #ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_ #include <com/sun/star/frame/XComponentLoader.hpp> #endif @@ -82,6 +83,8 @@ m_xDocumentContainer; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > + m_xParentFrame; Window* m_pDialogParent; String m_sCurrentlyEditing; ::rtl::OUString @@ -90,6 +93,7 @@ public: OLinkedDocumentsAccess( Window* _pDialogParent + ,const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxParentFrame ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB ,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection @@ -132,12 +136,12 @@ ,const sal_Int32 _nCommandType = -1 ,const ::rtl::OUString& _rObjectName = ::rtl::OUString() ); - void newQueryWithPilot( + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> newQueryWithPilot( const sal_Int32 _nCommandType = -1 ,const ::rtl::OUString& _rObjectName = ::rtl::OUString() ); - void newTableWithPilot(); + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> newTableWithPilot(); enum RESULT { Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: linkeddocuments.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/linkeddocuments.cxx?r1=1.25&r2=1.25.4.1 Delta lines: +19 -13 --------------------- --- linkeddocuments.cxx 2007-11-20 19:23:54+0000 1.25 +++ linkeddocuments.cxx 2007-12-19 12:27:42+0000 1.25.4.1 @@ -4,9 +4,9 @@ * * $RCSfile: linkeddocuments.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.25.4.1 $ * - * last change: $Author: ihi $ $Date: 2007/11/20 19:23:54 $ + * last change: $Author: oj $ $Date: 2007/12/19 12:27:42 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -200,6 +200,7 @@ DBG_NAME(OLinkedDocumentsAccess) //------------------------------------------------------------------ OLinkedDocumentsAccess::OLinkedDocumentsAccess(Window* _pDialogParent + , const Reference< XFrame >& _rxParentFrame , const Reference< XMultiServiceFactory >& _rxORB , const Reference< XNameAccess >& _rxContainer , const Reference< XConnection>& _xConnection @@ -208,6 +209,7 @@ :m_xORB(_rxORB) ,m_xDocumentContainer(_rxContainer) ,m_xConnection(_xConnection) + ,m_xParentFrame(_rxParentFrame) ,m_pDialogParent(_pDialogParent) ,m_sDataSourceName(_sDataSourceName) { @@ -284,12 +286,14 @@ aDesc[::svx::daCommand] <<= _rObjectName; if ( m_xConnection.is() ) aDesc[::svx::daConnection] <<= m_xConnection; + Sequence<Any> aSeq = aDesc.createAnySequence(); - sal_Int32 nPos = aSeq.getLength(); - aSeq.realloc(nPos+1); - PropertyValue aProp; - aProp.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentDefinition")); - aSeq[nPos] <<= aProp; + const sal_Int32 nLength = aSeq.getLength(); + aSeq.realloc(nLength + 1 ); + PropertyValue aVal; + aVal.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentFrame")); + aVal.Value <<= m_xParentFrame; + aSeq[nLength] <<= aVal; Reference< XJobExecutor > xFormWizard; { @@ -309,6 +313,8 @@ xRet.set(xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Document"))),UNO_QUERY); } } + xFormWizard->trigger(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("end"))); + ::comphelper::disposeComponent(xFormWizard); } } catch(const Exception&) @@ -329,16 +335,16 @@ return newWithPilot("com.sun.star.wizards.report.CallReportWizard",_xDefinition,_nCommandType,_rObjectName); } //------------------------------------------------------------------ - void OLinkedDocumentsAccess::newTableWithPilot() + Reference< XComponent> OLinkedDocumentsAccess::newTableWithPilot() { Reference< XComponent > xDefinition; - newWithPilot("com.sun.star.wizards.table.CallTableWizard",xDefinition); + return newWithPilot("com.sun.star.wizards.table.CallTableWizard",xDefinition); } //------------------------------------------------------------------ - void OLinkedDocumentsAccess::newQueryWithPilot(const sal_Int32 _nCommandType,const ::rtl::OUString& _rObjectName) + Reference< XComponent> OLinkedDocumentsAccess::newQueryWithPilot(const sal_Int32 _nCommandType,const ::rtl::OUString& _rObjectName) { Reference< XComponent > xDefinition; - newWithPilot("com.sun.star.wizards.query.CallQueryWizard",xDefinition,_nCommandType,_rObjectName); + return newWithPilot("com.sun.star.wizards.query.CallQueryWizard",xDefinition,_nCommandType,_rObjectName); } //------------------------------------------------------------------ Reference< XComponent > OLinkedDocumentsAccess::newDocument(sal_Int32 _nNewFormId,Reference< XComponent >& _xDefinition,const sal_Int32 _nCommandType,const ::rtl::OUString& _sObjectName) Directory: /dba/dbaccess/source/ui/querydesign/ =============================================== File [changed]: querycontroller.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/querycontroller.cxx?r1=1.112&r2=1.112.4.1 Delta lines: +4 -4 ------------------- --- querycontroller.cxx 2007-11-21 17:12:55+0000 1.112 +++ querycontroller.cxx 2007-12-19 12:27:43+0000 1.112.4.1 @@ -4,9 +4,9 @@ * * $RCSfile: querycontroller.cxx,v $ * - * $Revision: 1.112 $ + * $Revision: 1.112.4.1 $ * - * last change: $Author: ihi $ $Date: 2007/11/21 17:12:55 $ + * last change: $Author: oj $ $Date: 2007/12/19 12:27:43 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -749,7 +749,7 @@ } sal_Bool bCreateView( sal_False ); - if ( rArguments.get_ensureType( "CreateView", bCreateView ) ) + if ( rArguments.get_ensureType( "CreateView", bCreateView ) && bCreateView ) { OSL_ENSURE( false, "OQueryController::impl_initialize: CurrentQuery is regognized for compatibility only!" ); m_nCommandType = CommandType::TABLE; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
