summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgt <gt@openoffice.org>2001-11-01 11:17:06 +0000
committergt <gt@openoffice.org>2001-11-01 11:17:06 +0000
commite3a6b672529606cc999c2f596b4661122f8cb568 (patch)
treeba526e582bbdbb6699e69dec839b28c8d73957aa
parent3f3cde555355ffb02f5be5179ee081c3b847ccb8 (diff)
#93478# restore ViewData by passing as Property for dispatch
-rw-r--r--sfx2/source/appl/helpinterceptor.cxx46
-rw-r--r--sfx2/source/appl/helpinterceptor.hxx18
2 files changed, 56 insertions, 8 deletions
diff --git a/sfx2/source/appl/helpinterceptor.cxx b/sfx2/source/appl/helpinterceptor.cxx
index c8ef75205952..c7a54bf83fd5 100644
--- a/sfx2/source/appl/helpinterceptor.cxx
+++ b/sfx2/source/appl/helpinterceptor.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: helpinterceptor.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: pb $ $Date: 2001-10-17 10:59:32 $
+ * last change: $Author: gt $ $Date: 2001-11-01 12:17:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -110,6 +110,21 @@ HelpInterceptor_Impl::~HelpInterceptor_Impl()
// -----------------------------------------------------------------------
+Reference< XController > HelpInterceptor_Impl::getController() const throw( RuntimeException )
+{
+ Reference< XController > xRet;
+ if( m_pWindow )
+ {
+ Reference< XFrame > xFrame = m_pWindow->getTextFrame();
+ if( xFrame.is() )
+ xRet = xFrame->getController();
+ }
+
+ return xRet;
+}
+
+// -----------------------------------------------------------------------
+
void HelpInterceptor_Impl::addURL( const String& rURL )
{
if ( !m_pHistory )
@@ -121,7 +136,22 @@ void HelpInterceptor_Impl::addURL( const String& rURL )
delete m_pHistory->Remove(i);
}
+ // get view position of _current_ URL
+ HelpHistoryEntry_Impl* pCurEntry = m_pHistory->GetObject( m_nCurPos );
+
+ if( pCurEntry )
+ {
+ try
+ {
+ Reference< XController > xContr( getController() );
+ if( xContr.is() )
+ pCurEntry->aViewData = xContr->getViewData();
+ }
+ catch( const Exception& ) {}
+ }
+
m_aCurrentURL = rURL;
+
m_pHistory->Insert( new HelpHistoryEntry_Impl( rURL ), LIST_APPEND );
m_nCurPos = m_pHistory->Count() - 1;
@@ -164,11 +194,15 @@ void HelpInterceptor_Impl::SetStartURL( const String& rURL )
m_aCurrentURL = rURL;
}
+// -----------------------------------------------------------------------
+
sal_Bool HelpInterceptor_Impl::HasHistoryPred() const
{
return m_pHistory && ( m_nCurPos > 0 );
}
+// -----------------------------------------------------------------------
+
sal_Bool HelpInterceptor_Impl::HasHistorySucc() const
{
return m_pHistory && ( m_nCurPos < ( m_pHistory->Count() - 1 ) );
@@ -271,7 +305,7 @@ Sequence< ::rtl::OUString > SAL_CALL HelpInterceptor_Impl::getInterceptedURLs()
{
Sequence< ::rtl::OUString > aURLList( 1 );
aURLList[0] = DEFINE_CONST_UNICODE("vnd.sun.star.help://*");
- return aURLList;;
+ return aURLList;
}
// -----------------------------------------------------------------------
@@ -309,7 +343,11 @@ void SAL_CALL HelpInterceptor_Impl::dispatch(
m_pOpenListener->AddListener( xDisp, aURL );
}
m_aCurrentURL = aURL.Complete;
- xDisp->dispatch( aURL, Sequence < PropertyValue >() );
+
+ Sequence< PropertyValue > aPropSeq( 1 );
+ aPropSeq[ 0 ].Name = ::rtl::OUString::createFromAscii( "ViewData" );
+ aPropSeq[ 0 ].Value = pEntry->aViewData;
+ xDisp->dispatch( aURL, aPropSeq );
}
}
}
diff --git a/sfx2/source/appl/helpinterceptor.hxx b/sfx2/source/appl/helpinterceptor.hxx
index 7db0cc4e2150..9096b3830a0d 100644
--- a/sfx2/source/appl/helpinterceptor.hxx
+++ b/sfx2/source/appl/helpinterceptor.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: helpinterceptor.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: pb $ $Date: 2001-10-17 10:59:32 $
+ * last change: $Author: gt $ $Date: 2001-11-01 12:17:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -64,6 +64,9 @@
#ifndef _CPPUHELPER_IMPLBASE2_HXX_
#include <cppuhelper/implbase3.hxx>
#endif
+#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTOR_HPP_
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
#endif
@@ -94,12 +97,18 @@
#ifndef _LINK_HXX
#include <tools/link.hxx>
#endif
+#ifndef _SV_TIMER_HXX
+#include <vcl/timer.hxx>
+#endif
+
struct HelpHistoryEntry_Impl
{
- String aURL;
+ String aURL;
+ ::com::sun::star::uno::Any aViewData;
HelpHistoryEntry_Impl( const String& rURL ) : aURL( rURL ) {}
+ HelpHistoryEntry_Impl( const String& rURL, const ::com::sun::star::uno::Any& rViewData ) : aURL( rURL ), aViewData( rViewData ) {}
};
DECLARE_LIST(HelpHistoryList_Impl,HelpHistoryEntry_Impl*);
@@ -131,8 +140,9 @@ friend class HelpDispatch_Impl;
ULONG m_nCurPos;
String m_aCurrentURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
+ getController() const throw( ::com::sun::star::uno::RuntimeException );
void addURL( const String& rURL );
-
public:
HelpInterceptor_Impl();
~HelpInterceptor_Impl();