Tag: cws_src680_odbmacros2 User: fs Date: 2008-02-06 21:46:00+0000 Modified: dba/dbaccess/source/ui/app/AppController.cxx dba/dbaccess/source/ui/app/AppController.hxx dba/dbaccess/source/ui/app/AppControllerDnD.cxx
Log: #i49133# use our document's isModified instead of m_bCurrentlyModified - the lattter is only for controllers which do not have an own model 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.50.2.6&r2=1.50.2.7 Delta lines: +10 -12 --------------------- --- AppController.cxx 2008-02-04 13:07:44+0000 1.50.2.6 +++ AppController.cxx 2008-02-06 21:45:57+0000 1.50.2.7 @@ -4,9 +4,9 @@ * * $RCSfile: AppController.cxx,v $ * - * $Revision: 1.50.2.6 $ + * $Revision: 1.50.2.7 $ * - * last change: $Author: fs $ $Date: 2008/02/04 13:07:44 $ + * last change: $Author: fs $ $Date: 2008/02/06 21:45:57 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -548,12 +548,10 @@ if ( bSuspend && xStor.is() && !xStor->isReadonly() - && ( m_bCurrentlyModified - || ( xModi.is() + && ( xModi.is() && xModi->isModified() ) ) - ) { switch (ExecuteQuerySaveDocument(getView(),getStrippedDatabaseName())) { @@ -626,7 +624,7 @@ aReturn.bEnabled = sal_True; break; case ID_BROWSER_SAVEDOC: - aReturn.bEnabled = !isDataSourceReadOnly() && m_bCurrentlyModified; + aReturn.bEnabled = !isDataSourceReadOnly() && m_xDocumentModify.is() && m_xDocumentModify->isModified(); break; case ID_BROWSER_SAVEASDOC: aReturn.bEnabled = sal_True; @@ -1101,10 +1099,7 @@ { Reference<XStorable> xStore(m_xModel,UNO_QUERY); if ( xStore.is() ) - { xStore->store(); - m_bCurrentlyModified = sal_False; - } } break; case ID_BROWSER_SAVEASDOC: @@ -1137,7 +1132,6 @@ xStore->storeAsURL(aURL.GetMainURL( INetURLObject::NO_DECODE ),Sequence<PropertyValue>()); m_sDatabaseName = ::rtl::OUString(); updateTitle(); - m_bCurrentlyModified = sal_False; InvalidateFeature(ID_BROWSER_SAVEDOC); if ( getContainer()->getElementType() == E_NONE ) { @@ -2507,11 +2501,15 @@ m_xModel = _rxModel; if ( _rxModel.is() ) { + m_xDocumentModify.set( m_xModel, UNO_QUERY_THROW ); m_aModelConnector = ModelControllerConnector( _rxModel, this ); onConnectedModel(); } else + { + m_xDocumentModify.clear(); m_aModelConnector.clear(); + } m_xDataSource.set(xOfficeDoc.is() ? xOfficeDoc->getDataSource() : Reference<XDataSource>(),UNO_QUERY); if ( !m_xDataSource.is() ) File [changed]: AppController.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.hxx?r1=1.22.2.5&r2=1.22.2.6 Delta lines: +5 -10 -------------------- --- AppController.hxx 2008-01-28 11:35:59+0000 1.22.2.5 +++ AppController.hxx 2008-02-06 21:45:57+0000 1.22.2.6 @@ -4,9 +4,9 @@ * * $RCSfile: AppController.hxx,v $ * - * $Revision: 1.22.2.5 $ + * $Revision: 1.22.2.6 $ * - * last change: $Author: fs $ $Date: 2008/01/28 11:35:59 $ + * last change: $Author: fs $ $Date: 2008/02/06 21:45:57 $ * * 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 @@ #include <com/sun/star/beans/XPropertyChangeListener.hpp> #include <com/sun/star/container/XContainerListener.hpp> #include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp> +#include <com/sun/star/util/XModifiable.hpp> /** === end UNO includes === **/ #include <comphelper/stl_types.hxx> @@ -120,6 +121,8 @@ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xDataSource; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifiable > + m_xDocumentModify; ModelControllerConnector m_aModelConnector; TContainerVector m_aCurrentContainers; // the containers where we are listener on @@ -421,13 +424,6 @@ void impl_migrateScripts_nothrow(); protected: - // ---------------------------------------------------------------- - // initalizing members - /** forces usage of a connection which we do not own - <p>To be used from within XInitialization::initialize only.</p> - */ - void initializeConnection( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxForeignConn ); - // state of a feature. 'feature' may be the handle of a ::com::sun::star::util::URL somebody requested a dispatch interface for OR a toolbar slot. virtual FeatureState GetState(sal_uInt16 nId) const; // execute a feature @@ -443,7 +439,6 @@ // OGenericUnoController virtual void updateTitle( ); virtual void onLoadedMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& _xLayoutManager ); - virtual void impl_initialize(); virtual ~OApplicationController(); File [changed]: AppControllerDnD.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerDnD.cxx?r1=1.23.2.4&r2=1.23.2.5 Delta lines: +3 -11 -------------------- --- AppControllerDnD.cxx 2008-02-04 22:31:46+0000 1.23.2.4 +++ AppControllerDnD.cxx 2008-02-06 21:45:57+0000 1.23.2.5 @@ -4,9 +4,9 @@ * * $RCSfile: AppControllerDnD.cxx,v $ * - * $Revision: 1.23.2.4 $ + * $Revision: 1.23.2.5 $ * - * last change: $Author: fs $ $Date: 2008/02/04 22:31:46 $ + * last change: $Author: fs $ $Date: 2008/02/06 21:45:57 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -75,9 +75,6 @@ #ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_ #include <com/sun/star/container/XChild.hpp> #endif -#ifndef _COM_SUN_STAR_UTIL_XMODIFIABLE_HPP_ -#include <com/sun/star/util/XModifiable.hpp> -#endif #ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMECONTAINER_HPP_ #include <com/sun/star/container/XHierarchicalNameContainer.hpp> #endif @@ -588,12 +585,7 @@ ::std::copy(pBegin,pEnd,::std::back_inserter(_rList)); } } -// ----------------------------------------------------------------------------- -void OApplicationController::impl_initialize() -{ - Reference<XModifiable> xModi(m_xModel,UNO_QUERY); - m_bCurrentlyModified = (xModi.is() && xModi->isModified()); -} + // ----------------------------------------------------------------------------- void OApplicationController::getSelectionElementNames(::std::vector< ::rtl::OUString>& _rNames) const { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
