Tag: cws_dev300_dba31a User: oj Date: 2008-06-06 07:35:29+0000 Modified: dba/dbaccess/source/ui/app/AppController.cxx dba/dbaccess/source/ui/app/AppController.hxx dba/dbaccess/source/ui/app/AppControllerDnD.cxx
Log: #i57668# close frames which objects were deleted File Changes: 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.60&r2=1.60.20.1 Delta lines: +49 -32 --------------------- --- AppController.cxx 2008-05-05 15:51:14+0000 1.60 +++ AppController.cxx 2008-06-06 07:35:26+0000 1.60.20.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: AppController.cxx,v $ - * $Revision: 1.60 $ + * $Revision: 1.60.20.1 $ * * This file is part of OpenOffice.org. * @@ -2748,9 +2748,26 @@ } break; } // if ( aFind->second.first.first == _nKind && aFind->second.first.second == _eOpenMode ) - } // while ( aFind != m_aSpecialSubFrames.end() ) + } return bFound; } +// ----------------------------------------------------------------------------- +void OApplicationController::impl_deActivateSubFrame_throw(const ::rtl::OUString& _sName,const sal_Int32 _nKind) +{ + TFrames aCopy = m_aSpecialSubFrames; + TFrames::iterator aFind = aCopy.find(_sName); + for(;aFind != aCopy.end();++aFind) + { + if ( aFind->second.first.first == _nKind ) + { + Reference< XFrame> xFrame(aFind->second.second,UNO_QUERY); + if ( xFrame.is() ) + { + ::comphelper::disposeComponent(xFrame); + } + } // if ( aFind->second.first.first == _nKind && aFind->second.first.second == _eOpenMode ) + } +} //........................................................................ } // namespace dbaui //........................................................................ File [changed]: AppController.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.hxx?r1=1.28&r2=1.28.20.1 Delta lines: +9 -15 -------------------- --- AppController.hxx 2008-05-05 15:51:28+0000 1.28 +++ AppController.hxx 2008-06-06 07:35:26+0000 1.28.20.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: AppController.hxx,v $ - * $Revision: 1.28 $ + * $Revision: 1.28.20.1 $ * * This file is part of OpenOffice.org. * @@ -150,6 +150,13 @@ @param _nKind the kind of the component */ bool impl_activateSubFrame_throw(const ::rtl::OUString& _sName,const sal_Int32 _nKind,const ElementOpenMode _eOpenMode) const; + + /** deactivates the current table or query frame when existing + @param _sName the name of the component + @param _nKind the kind of the component + */ + void impl_deActivateSubFrame_throw(const ::rtl::OUString& _sName,const sal_Int32 _nKind); + /** returns the database name @return the database name @@ -254,19 +261,6 @@ const ::std::vector< ::rtl::OUString>& _rList, bool _bConfirm ); - /** deletes multiple elements from the given container - @param _rxNames - the object container - @param _rList - The names of the elements to delete - @param _bConfirm - determines whether the user must confirm the deletion - */ - void deleteObjects( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& _rxNames, - const ::std::vector< ::rtl::OUString>& _rList, - bool _bConfirm ); - - /** deletes tables. @param _rList The list of tables. File [changed]: AppControllerDnD.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerDnD.cxx?r1=1.28&r2=1.28.22.1 Delta lines: +11 -13 --------------------- --- AppControllerDnD.cxx 2008-05-05 15:51:41+0000 1.28 +++ AppControllerDnD.cxx 2008-06-06 07:35:26+0000 1.28.22.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: AppControllerDnD.cxx,v $ - * $Revision: 1.28 $ + * $Revision: 1.28.22.1 $ * * This file is part of OpenOffice.org. * @@ -286,6 +286,7 @@ } } } + impl_deActivateSubFrame_throw(sTableName,E_TABLE); } catch(SQLContext& e) { aErrorInfo = e; } catch(SQLWarning& e) { aErrorInfo = e; } @@ -324,14 +325,9 @@ // ----------------------------------------------------------------------------- void OApplicationController::deleteObjects( ElementType _eType, const ::std::vector< ::rtl::OUString>& _rList, bool _bConfirm ) { - deleteObjects( Reference< XNameContainer >( getElements( _eType ), UNO_QUERY ), _rList, _bConfirm ); -} - -// ----------------------------------------------------------------------------- -void OApplicationController::deleteObjects( const Reference< XNameContainer>& _rxNames, const ::std::vector< ::rtl::OUString>& _rList, bool _bConfirm ) -{ - Reference< XHierarchicalNameContainer > xHierarchyName( _rxNames, UNO_QUERY ); - if ( _rxNames.is() ) + Reference< XNameContainer > xNames( getElements( _eType ), UNO_QUERY ); + Reference< XHierarchicalNameContainer > xHierarchyName( xNames, UNO_QUERY ); + if ( xNames.is() ) { ByteString sDialogPosition; svtools::QueryDeleteResult_Impl eResult = _bConfirm ? svtools::QUERYDELETE_YES : svtools::QUERYDELETE_ALL; @@ -382,7 +378,10 @@ if ( xHierarchyName.is() ) xHierarchyName->removeByHierarchicalName( *aThisRound ); else - _rxNames->removeByName( *aThisRound ); + xNames->removeByName( *aThisRound ); + + if ( _eType == E_QUERY ) + impl_deActivateSubFrame_throw(*aThisRound,_eType); bSuccess = true; @@ -902,8 +901,7 @@ if ( nIndex != -1 ) { aList.push_back(sName.copy(sErase.getLength() + 1)); - Reference<XNameContainer> xNames(getElements(m_aAsyncDrop.nType), UNO_QUERY); - deleteObjects( xNames, aList, false ); + deleteObjects( m_aAsyncDrop.nType, aList, false ); } } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
