Tag: cws_dev300_dba30f User: fs Date: 2008-07-01 05:14:57+0000 Removed: dba/dbaccess/source/ui/app/IAppElementNotification.hxx
Modified: dba/dbaccess/source/core/dataaccess/documentdefinition.cxx dba/dbaccess/source/core/dataaccess/documentdefinition.hxx Log: RESYNC: (1.62-1.64); FILE MERGED 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.62.12.2&r2=1.62.12.3 Delta lines: +61 -18 --------------------- --- documentdefinition.cxx 2008-06-30 21:19:56+0000 1.62.12.2 +++ documentdefinition.cxx 2008-07-01 05:14:38+0000 1.62.12.3 @@ -856,7 +856,7 @@ // ----------------------------------------------------------------------------- void ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, const bool _bActivate, - const Reference< XCommandEnvironment >& _rxEnvironment, Any& _out_rComponent ) + const Reference< XCommandEnvironment >& _rxEnvironment, Any& _out_rComponent, ::osl::ClearableMutexGuard & _aGuard ) { OExecuteImpl aExecuteGuard(m_bInExecute); @@ -1017,6 +1017,9 @@ xReportEngine->setReportDefinition(xReportDefinition); xReportEngine->setActiveConnection(m_xLastKnownConnection); + if ( bOpenHidden ) + _out_rComponent <<= xReportEngine->createDocumentModel( ); + else _out_rComponent <<= xReportEngine->createDocumentAlive(NULL); return; } @@ -1027,7 +1030,9 @@ impl_onActivateEmbeddedObject(); } - fillReportData(); + // LLA: Alle fillReportData() calls prüfen, sollte es welche geben, die danach noch viel machen + // LLA: sollten wir einen _aGuard Pointer übergeben, sonst erstmal als Referenz + fillReportData(_aGuard); _out_rComponent <<= xModel; } @@ -1035,7 +1040,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 CommandId, const Reference< XCommandEnvironment >& Environment ) throw (Exception, CommandAbortedException, RuntimeException) { Any aRet; - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::ClearableMutexGuard aGuard(m_aMutex); if ( !m_bInExecute ) { sal_Bool bOpen = aCommand.Name.equalsAscii( "open" ); @@ -1050,8 +1055,29 @@ bActivateObject = false; } + // if the object is already opened, do nothing + // #i89509# / 2008-05-22 / [EMAIL PROTECTED] + if ( m_xEmbeddedObject.is() ) + { + sal_Int32 nCurrentState = m_xEmbeddedObject->getCurrentState(); + bool bIsActive = ( nCurrentState == EmbedStates::ACTIVE ); + + // exception: new-style reports always create a new document when "open" is executed + Reference< report::XReportDefinition > xReportDefinition( getComponent(), UNO_QUERY ); + bool bIsAliveNewStyleReport = ( xReportDefinition.is() && ( bOpen || bOpenForMail ) ); + + if ( bIsActive && !bIsAliveNewStyleReport ) + { + impl_onActivateEmbeddedObject(); + return makeAny( getComponent() ); + } + } + + // m_bOpenInDesign = bOpenInDesign; + // onCommandOpenSomething( aCommand.Argument, !bOpenForMail, Environment, aRet, aGuard ); + m_bOpenInDesign = bOpenInDesign || bOpenForMail; - onCommandOpenSomething( aCommand.Argument, bActivateObject, Environment, aRet ); + onCommandOpenSomething( aCommand.Argument, bActivateObject, Environment, aRet, aGuard ); } else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "copyTo" ) ) ) { @@ -1122,6 +1148,7 @@ xStorage->removeElement(m_pImpl->m_aProps.sPersistentName); dispose(); + } else if ( ( aCommand.Name.compareToAscii( "storeOwn" ) == 0 ) // compatibility || ( aCommand.Name.compareToAscii( "store" ) == 0 ) @@ -1136,8 +1163,10 @@ aRet <<= impl_close_throw(); } else + { aRet = OContentHelper::execute(aCommand,CommandId,Environment); } + } return aRet; } // ----------------------------------------------------------------------------- @@ -1355,6 +1384,15 @@ // default handling: instantiate an interaction handler and let it handle the parameter request if ( !m_bOpenInDesign ) return sal_False; + + { + osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); + if ( !m_pImpl->m_aProps.aTitle.getLength() ) + { + aGuard.clear(); + return save(sal_False); // (sal_False) : we don't want an approve dialog + } + } try { { @@ -1364,14 +1402,6 @@ Reference<XNameAccess> xName(m_xParentContainer,UNO_QUERY); DocumentSaveRequest aRequest; aRequest.Name = m_pImpl->m_aProps.aTitle; - if ( !aRequest.Name.getLength() ) - { - if ( m_bForm ) - aRequest.Name = DBACORE_RESSTRING( RID_STR_FORM ); - else - aRequest.Name = DBACORE_RESSTRING( RID_STR_REPORT ); - aRequest.Name = ::dbtools::createUniqueName(xName,aRequest.Name); - } aRequest.Content.set(m_xParentContainer,UNO_QUERY); OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aRequest)); @@ -1503,7 +1533,11 @@ // TODO: revert to the disabled code. The current version is just to be able // to integrate an intermediate version of the CWS, which should behave as // if no macros in DB docs are allowed - bool bAllowDocumentMacros = true; + bool bAllowDocumentMacros = !m_pImpl->m_pDataSource->hasMacroStorages(); + // even if the current version is not able to create documents which contain macros, + // later versions will be. Such documents contain macro/script storages in the + // document root storage, in which case we need to disable the per-form/report + // scripting. // if *any* of the objects of the database document already has macros, we continue to allow it // to have them, until the user did a migration. @@ -1539,6 +1573,12 @@ Reference< XFrame > xParentFrame; if ( m_pImpl->m_pDataSource ) xParentFrame = lcl_getDatabaseDocumentFrame( *m_pImpl->m_pDataSource ); + if ( !xParentFrame.is() ) + { // i87957 we need a parent frame + if ( !m_xDesktop.is() ) + m_xDesktop.set( m_aContext.createComponent( (::rtl::OUString)SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW ); + xParentFrame.set(m_xDesktop,uno::UNO_QUERY); + } OSL_ENSURE( xParentFrame.is(), "ODocumentDefinition::fillLoadArgs: no parent frame!" ); if ( xParentFrame.is() ) OutplaceFrameProperties.put( "ParentFrame", xParentFrame ); @@ -2034,7 +2074,7 @@ return true; } // ----------------------------------------------------------------------------- -void ODocumentDefinition::fillReportData() +void ODocumentDefinition::fillReportData(::osl::ClearableMutexGuard & _aGuard) { if ( !m_bForm && m_pImpl->m_aProps.bAsTemplate && !m_bOpenInDesign ) // open a report in alive mode, so we need to fill it { @@ -2049,9 +2089,12 @@ Reference< XJobExecutor > xExecuteable( m_aContext.createComponentWithArguments( "com.sun.star.wizards.report.CallReportWizard", aArgs ), UNO_QUERY ); if ( xExecuteable.is() ) + { + _aGuard.clear(); xExecuteable->trigger(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("fill"))); } } +} // ----------------------------------------------------------------------------- void ODocumentDefinition::updateDocumentTitle() { Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: documentdefinition.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.hxx?r1=1.30.32.1&r2=1.30.32.2 Delta lines: +6 -4 ------------------- --- documentdefinition.hxx 2008-06-30 20:54:56+0000 1.30.32.1 +++ documentdefinition.hxx 2008-07-01 05:14:41+0000 1.30.32.2 @@ -153,7 +153,7 @@ sal_Bool saveAs(); void closeObject(); sal_Bool isModified(); - void fillReportData(); + void fillReportData(::osl::ClearableMutexGuard & _aGuard); inline sal_Bool isNewReport() const { return !m_bForm && !m_pImpl->m_aProps.bAsTemplate; } /** prepares closing the document component @@ -291,7 +291,9 @@ void onCommandInsert( const ::rtl::OUString& _sURL, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& Environment ) throw( ::com::sun::star::uno::Exception ); void onCommandPreview( ::com::sun::star::uno::Any& _rImage ); void onCommandOpenSomething( const ::com::sun::star::uno::Any& _rArgument, const bool _bActivate, - const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& _rxEnvironment, ::com::sun::star::uno::Any& _out_rComponent ); + const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& _rxEnvironment, + ::com::sun::star::uno::Any& _out_rComponent, + ::osl::ClearableMutexGuard & _aClearableGuard); }; //........................................................................ Directory: /dba/dbaccess/source/ui/app/ ======================================= File [removed]: IAppElementNotification.hxx --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
