summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-02-05 11:15:42 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-02-05 11:15:42 +0100
commit00684a716b075f0b5f01a154ad2798272f81793d (patch)
tree383555e66baf7b8aafb7ac308262c2e63c032fbb /reportdesign
parent500131391fc5777193565f57610f07c7a22bf7ee (diff)
parentabb51ede006041a8e5db1bb0463484d2a98698df (diff)
autorecovery: merge
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/inc/ReportDefinition.hxx5
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx138
2 files changed, 96 insertions, 47 deletions
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
index ec9a5c4f5248..6048ab1d6625 100644
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -314,6 +314,11 @@ namespace reportdesign
virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getMapUnit( ::sal_Int64 nAspect ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ // XModifiable2
+ virtual ::sal_Bool SAL_CALL disableSetModified( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL enableSetModified( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isSetModifiedEnabled( ) throw (::com::sun::star::uno::RuntimeException);
+
// XModifiable
virtual ::sal_Bool SAL_CALL isModified( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setModified( ::sal_Bool bModified ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index b505f16ff751..a05e368fbef8 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -625,6 +625,7 @@ struct OReportDefinitionImpl
sal_Bool m_bControllersLocked;
sal_Bool m_bModified;
sal_Bool m_bEscapeProcessing;
+ sal_Bool m_bSetModifiedEnabled;
OReportDefinitionImpl(::osl::Mutex& _aMutex)
:m_aStorageChangeListeners(_aMutex)
,m_aCloseListener(_aMutex)
@@ -642,6 +643,7 @@ struct OReportDefinitionImpl
,m_bControllersLocked(sal_False)
,m_bModified(sal_False)
,m_bEscapeProcessing(sal_True)
+ ,m_bSetModifiedEnabled( sal_True )
{}
OReportDefinitionImpl(::osl::Mutex& _aMutex,const OReportDefinitionImpl& _aCopy)
@@ -804,55 +806,61 @@ void SAL_CALL OReportDefinition::dispose() throw(uno::RuntimeException)
// -----------------------------------------------------------------------------
void SAL_CALL OReportDefinition::disposing()
{
- m_pImpl->m_aControllers.clear();
+ notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnUnload")));
+
uno::Reference< frame::XModel > xHoldAlive( this );
- {
- notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnUnload")));
-
- lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) );
- m_pImpl->m_aModifyListeners.disposeAndClear( aDisposeEvent );
- m_pImpl->m_aCloseListener.disposeAndClear( aDisposeEvent );
- m_pImpl->m_aDocEventListeners.disposeAndClear( aDisposeEvent );
- m_pImpl->m_aStorageChangeListeners.disposeAndClear( aDisposeEvent );
-
- ::comphelper::disposeComponent(m_pImpl->m_xGroups);
- m_pImpl->m_xReportHeader.clear();
- m_pImpl->m_xReportFooter.clear();
- m_pImpl->m_xPageHeader.clear();
- m_pImpl->m_xPageFooter.clear();
- m_pImpl->m_xDetail.clear();
- //::comphelper::disposeComponent(m_pImpl->m_xReportHeader);
- //::comphelper::disposeComponent(m_pImpl->m_xReportFooter);
- //::comphelper::disposeComponent(m_pImpl->m_xPageHeader);
- //::comphelper::disposeComponent(m_pImpl->m_xPageFooter);
- //::comphelper::disposeComponent(m_pImpl->m_xDetail);
- ::comphelper::disposeComponent(m_pImpl->m_xFunctions);
-
- //::comphelper::disposeComponent(m_pImpl->m_xStorage);
- // don't dispose, this currently is the task of either the ref count going to
- // 0, or of the embedded object (if we're embedded, which is the only possible
- // case so far)
- // #i78366# / 2007-06-18 / frank.schoenheit@sun.com
- m_pImpl->m_xStorage.clear();
- m_pImpl->m_xViewData.clear();
- m_pImpl->m_xCurrentController.clear();
- m_pImpl->m_xNumberFormatsSupplier.clear();
- m_pImpl->m_xStyles.clear();
- m_pImpl->m_xXMLNamespaceMap.clear();
- m_pImpl->m_xGradientTable.clear();
- m_pImpl->m_xHatchTable.clear();
- m_pImpl->m_xBitmapTable.clear();
- m_pImpl->m_xTransparencyGradientTable.clear();
- m_pImpl->m_xDashTable.clear();
- m_pImpl->m_xMarkerTable.clear();
- m_pImpl->m_xUIConfigurationManager.clear();
- m_pImpl->m_pReportModel.reset();
- m_pImpl->m_pObjectContainer.reset();
- m_pImpl->m_aArgs.realloc(0);
- m_pImpl->m_xTitleHelper.clear();
- m_pImpl->m_xNumberedControllers.clear();
- }
+
+ lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) );
+ m_pImpl->m_aModifyListeners.disposeAndClear( aDisposeEvent );
+ m_pImpl->m_aCloseListener.disposeAndClear( aDisposeEvent );
+ m_pImpl->m_aDocEventListeners.disposeAndClear( aDisposeEvent );
+ m_pImpl->m_aStorageChangeListeners.disposeAndClear( aDisposeEvent );
+
+ // SYNCHRONIZED --->
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::ResettableMutexGuard aGuard(m_aMutex);
+
+ m_pImpl->m_aControllers.clear();
+
+ ::comphelper::disposeComponent(m_pImpl->m_xGroups);
+ m_pImpl->m_xReportHeader.clear();
+ m_pImpl->m_xReportFooter.clear();
+ m_pImpl->m_xPageHeader.clear();
+ m_pImpl->m_xPageFooter.clear();
+ m_pImpl->m_xDetail.clear();
+ //::comphelper::disposeComponent(m_pImpl->m_xReportHeader);
+ //::comphelper::disposeComponent(m_pImpl->m_xReportFooter);
+ //::comphelper::disposeComponent(m_pImpl->m_xPageHeader);
+ //::comphelper::disposeComponent(m_pImpl->m_xPageFooter);
+ //::comphelper::disposeComponent(m_pImpl->m_xDetail);
+ ::comphelper::disposeComponent(m_pImpl->m_xFunctions);
+
+ //::comphelper::disposeComponent(m_pImpl->m_xStorage);
+ // don't dispose, this currently is the task of either the ref count going to
+ // 0, or of the embedded object (if we're embedded, which is the only possible
+ // case so far)
+ // #i78366# / 2007-06-18 / frank.schoenheit@sun.com
+ m_pImpl->m_xStorage.clear();
+ m_pImpl->m_xViewData.clear();
+ m_pImpl->m_xCurrentController.clear();
+ m_pImpl->m_xNumberFormatsSupplier.clear();
+ m_pImpl->m_xStyles.clear();
+ m_pImpl->m_xXMLNamespaceMap.clear();
+ m_pImpl->m_xGradientTable.clear();
+ m_pImpl->m_xHatchTable.clear();
+ m_pImpl->m_xBitmapTable.clear();
+ m_pImpl->m_xTransparencyGradientTable.clear();
+ m_pImpl->m_xDashTable.clear();
+ m_pImpl->m_xMarkerTable.clear();
+ m_pImpl->m_xUIConfigurationManager.clear();
+ m_pImpl->m_pReportModel.reset();
+ m_pImpl->m_pObjectContainer.reset();
+ m_pImpl->m_aArgs.realloc(0);
+ m_pImpl->m_xTitleHelper.clear();
+ m_pImpl->m_xNumberedControllers.clear();
+ // <--- SYNCHRONIZED
}
+
// -----------------------------------------------------------------------------
::rtl::OUString OReportDefinition::getImplementationName_Static( ) throw(uno::RuntimeException)
{
@@ -1948,6 +1956,38 @@ embed::VisualRepresentation SAL_CALL OReportDefinition::getPreferredVisualRepres
}
// -----------------------------------------------------------------------------
// XModifiable
+::sal_Bool SAL_CALL OReportDefinition::disableSetModified( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
+
+ const sal_Bool bWasEnabled = m_pImpl->m_bSetModifiedEnabled;
+ m_pImpl->m_bSetModifiedEnabled = sal_False;
+ return bWasEnabled;
+}
+
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::enableSetModified( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
+
+ const sal_Bool bWasEnabled = m_pImpl->m_bSetModifiedEnabled;
+ m_pImpl->m_bSetModifiedEnabled = sal_True;
+ return bWasEnabled;
+}
+
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::isSetModifiedEnabled( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
+
+ return m_pImpl->m_bSetModifiedEnabled;
+}
+
+// -----------------------------------------------------------------------------
+// XModifiable
::sal_Bool SAL_CALL OReportDefinition::isModified( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard(m_aMutex);
@@ -1959,6 +1999,10 @@ void SAL_CALL OReportDefinition::setModified( ::sal_Bool _bModified ) throw (bea
{
::osl::ResettableMutexGuard aGuard(m_aMutex);
::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ if ( !m_pImpl->m_bSetModifiedEnabled )
+ return;
+
if ( m_pImpl->m_pReportModel->IsReadOnly() && _bModified )
throw beans::PropertyVetoException();
if ( m_pImpl->m_bModified != _bModified )