summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2001-03-09 14:00:15 +0000
committerOliver Specht <os@openoffice.org>2001-03-09 14:00:15 +0000
commit292e88dca4edb02d72b69db7f2bb7a5b04368138 (patch)
tree852887ba39907c201b556e291dd8d5657bfb320f
parent- fixed: unnecessary attext.xml stream removed (this is handled in core/swg) (diff)
downloadcore-292e88dca4edb02d72b69db7f2bb7a5b04368138.tar.gz
core-292e88dca4edb02d72b69db7f2bb7a5b04368138.zip
#84822# reload of documents: disposing and dtors corrected, reactivate beamer if available
-rw-r--r--sw/source/ui/inc/unodispatch.hxx6
-rw-r--r--sw/source/ui/inc/unotxvw.hxx6
-rw-r--r--sw/source/ui/uiview/view.cxx23
-rw-r--r--sw/source/ui/uno/unodispatch.cxx36
-rw-r--r--sw/source/ui/uno/unotxvw.cxx21
5 files changed, 67 insertions, 25 deletions
diff --git a/sw/source/ui/inc/unodispatch.hxx b/sw/source/ui/inc/unodispatch.hxx
index 91499b0e9527..e525b0d0c8d9 100644
--- a/sw/source/ui/inc/unodispatch.hxx
+++ b/sw/source/ui/inc/unodispatch.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unodispatch.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: os $ $Date: 2001-03-07 13:42:46 $
+ * last change: $Author: os $ $Date: 2001-03-09 15:00:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -127,7 +127,7 @@ class SwXDispatch : public cppu::WeakImplHelper2
::com::sun::star::view::XSelectionChangeListener
>
{
- SwView& m_rView;
+ SwView* m_pView;
StatusListenerList m_aListenerList;
sal_Bool m_bOldEnable;
sal_Bool m_bListenerAdded;
diff --git a/sw/source/ui/inc/unotxvw.hxx b/sw/source/ui/inc/unotxvw.hxx
index 20b1d88919fe..be33bcada271 100644
--- a/sw/source/ui/inc/unotxvw.hxx
+++ b/sw/source/ui/inc/unotxvw.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unotxvw.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: os $ $Date: 2001-02-02 11:51:32 $
+ * last change: $Author: os $ $Date: 2001-03-09 14:58:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -179,7 +179,7 @@ public:
void NotifySelChanged();
SwView* GetView() {return pView;}
- void Invalidate(){pView = 0;}
+ void Invalidate();
};
/* -----------------17.09.98 12:52-------------------
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index 11fa9f01b1d5..b709a12a0b72 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: view.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: os $ $Date: 2001-03-07 13:44:00 $
+ * last change: $Author: os $ $Date: 2001-03-09 14:58:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -249,7 +249,13 @@
#ifndef _UNO_LINGU_HXX
#include <svx/unolingu.hxx>
#endif
+#ifndef _DBMGR_HXX
+#include <dbmgr.hxx>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#endif
#ifndef _COM_SUN_STAR_SCANNER_SCANNERCONTEXT_HPP_
#include <com/sun/star/scanner/ScannerContext.hpp>
#endif
@@ -985,6 +991,18 @@ SwView::SwView( SfxViewFrame *pFrame, SfxViewShell* pOldSh )
pFrame->GetFrame()->GetFrameInterface()->setComponent( aTmpRef,
pViewImpl->GetUNOObject_Impl());
+ uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame()->GetFrameInterface();
+
+ uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame(
+ OUString::createFromAscii("_beamer"), frame::FrameSearchFlag::CHILDREN);
+ if(xBeamerFrame.is())
+ {
+ SwDBData aData = pWrtShell->GetDBData();
+ pWrtShell->GetNewDBMgr()->ShowInBeamer(String(aData.sDataSource), String(aData.sCommand),
+ aData.nCommandType, aEmptyStr);
+ }
+
+
if( aTimer.IsActive() )
{
if( bAttrChgNotifiedWithRegistrations )
@@ -1020,6 +1038,7 @@ SwView::~SwView()
SetWindow( 0 );
+ pViewImpl->GetUNOObject_Impl()->Invalidate();
EndListening(*GetViewFrame());
EndListening(*GetDocShell());
delete pScrollFill;
diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx
index 4de41e202086..07c8d5ce4cfb 100644
--- a/sw/source/ui/uno/unodispatch.cxx
+++ b/sw/source/ui/uno/unodispatch.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unodispatch.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: os $ $Date: 2001-03-07 13:43:18 $
+ * last change: $Author: os $ $Date: 2001-03-09 14:58:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -231,7 +231,7 @@ void SwXDispatchProviderInterceptor::disposing( const EventObject& Source )
---------------------------------------------------------------------------*/
SwXDispatch::SwXDispatch(SwView& rVw) :
- m_rView(rVw),
+ m_pView(&rVw),
m_bOldEnable(sal_False),
m_bListenerAdded(sal_False)
{
@@ -241,9 +241,9 @@ SwXDispatch::SwXDispatch(SwView& rVw) :
-----------------------------------------------------------------------*/
SwXDispatch::~SwXDispatch()
{
- if(m_bListenerAdded)
+ if(m_bListenerAdded && m_pView)
{
- Reference<XSelectionSupplier> xSupplier = m_rView.GetUNOObject();
+ Reference<XSelectionSupplier> xSupplier = m_pView->GetUNOObject();
Reference<XSelectionChangeListener> xThis = this;
xSupplier->removeSelectionChangeListener(xThis);
}
@@ -254,7 +254,9 @@ SwXDispatch::~SwXDispatch()
void SwXDispatch::dispatch(
const URL& aURL, const Sequence< PropertyValue >& aArgs ) throw(RuntimeException)
{
- SwWrtShell& rSh = m_rView.GetWrtShell();
+ if(!m_pView)
+ throw RuntimeException();
+ SwWrtShell& rSh = m_pView->GetWrtShell();
SwNewDBMgr* pNewDBMgr = rSh.GetNewDBMgr();
if(!aURL.Complete.compareToAscii(cURLInsertContent))
{
@@ -278,7 +280,9 @@ void SwXDispatch::dispatch(
void SwXDispatch::addStatusListener(
const Reference< XStatusListener >& xControl, const URL& aURL ) throw(RuntimeException)
{
- ShellModes eMode = m_rView.GetShellMode();
+ if(!m_pView)
+ throw RuntimeException();
+ ShellModes eMode = m_pView->GetShellMode();
sal_Bool bEnable = SEL_TEXT == eMode ||
SEL_LIST_TEXT == eMode ||
SEL_TABLE_TEXT == eMode ||
@@ -299,7 +303,7 @@ void SwXDispatch::addStatusListener(
if(!m_bListenerAdded)
{
- Reference<XSelectionSupplier> xSupplier = m_rView.GetUNOObject();
+ Reference<XSelectionSupplier> xSupplier = m_pView->GetUNOObject();
Reference<XSelectionChangeListener> xThis = this;
xSupplier->addSelectionChangeListener(xThis);
m_bListenerAdded = sal_True;
@@ -321,9 +325,9 @@ void SwXDispatch::removeStatusListener(
break;
}
}
- if(m_aListenerList.empty())
+ if(m_aListenerList.empty() && m_pView)
{
- Reference<XSelectionSupplier> xSupplier = m_rView.GetUNOObject();
+ Reference<XSelectionSupplier> xSupplier = m_pView->GetUNOObject();
Reference<XSelectionChangeListener> xThis = this;
xSupplier->removeSelectionChangeListener(xThis);
m_bListenerAdded = sal_False;
@@ -334,7 +338,7 @@ void SwXDispatch::removeStatusListener(
---------------------------------------------------------------------------*/
void SwXDispatch::selectionChanged( const EventObject& aEvent ) throw(RuntimeException)
{
- ShellModes eMode = m_rView.GetShellMode();
+ ShellModes eMode = m_pView->GetShellMode();
sal_Bool bEnable = SEL_TEXT == eMode ||
SEL_LIST_TEXT == eMode ||
SEL_TABLE_TEXT == eMode ||
@@ -365,5 +369,15 @@ void SwXDispatch::disposing( const EventObject& rSource ) throw(RuntimeException
Reference<XSelectionChangeListener> xThis = this;
xSupplier->removeSelectionChangeListener(xThis);
m_bListenerAdded = sal_False;
+
+ EventObject aObject;
+ aObject.Source = (cppu::OWeakObject*)this;
+ StatusListenerList::iterator aListIter = m_aListenerList.begin();
+ for(; aListIter != m_aListenerList.end(); ++aListIter)
+ {
+ StatusStruct_Impl aStatus = *aListIter;
+ aStatus.xListener->disposing(aObject);
+ }
+ m_pView = 0;
}
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 1f6b0d9caaa8..6c1f3ea5f008 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unotxvw.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: os $ $Date: 2001-03-07 13:46:48 $
+ * last change: $Author: os $ $Date: 2001-03-09 14:58:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -260,22 +260,29 @@ SwXTextView::SwXTextView(SwView* pSwView) :
-----------------------------------------------------------------------*/
SwXTextView::~SwXTextView()
{
+ Invalidate();
+}
+/* -----------------------------09.03.01 15:47--------------------------------
+
+ ---------------------------------------------------------------------------*/
+void SwXTextView::Invalidate()
+{
if(pxViewSettings)
{
beans::XPropertySet* pSettings = pxViewSettings->get();
((SwXViewSettings*)pSettings)->Invalidate();
- delete pxViewSettings;
+ DELETEZ(pxViewSettings);
}
if(pxTextViewCursor)
{
text::XTextViewCursor* pCrsr = pxTextViewCursor->get();
((SwXTextViewCursor*)pCrsr)->Invalidate();
- delete pxTextViewCursor;
+ DELETEZ(pxTextViewCursor);
}
sal_uInt16 nCount = aSelChangedListeners.Count();
+ m_refCount++; //prevent second d'tor call
if(nCount)
{
- m_refCount++; //prevent second d'tor call
Reference< uno::XInterface > xInt = (cppu::OWeakObject*)(SfxBaseController*)this;
lang::EventObject aEvent(xInt);
for ( sal_uInt16 i = nCount; i--; )
@@ -283,9 +290,11 @@ SwXTextView::~SwXTextView()
Reference< view::XSelectionChangeListener > *pObj = aSelChangedListeners[i];
(*pObj)->disposing(aEvent);
}
- m_refCount--;
}
+ m_refCount--;
+ pView = 0;
}
+
/* -----------------------------18.05.00 10:18--------------------------------
---------------------------------------------------------------------------*/