diff options
author | Peter Burow <pb@openoffice.org> | 2001-07-11 14:20:17 +0000 |
---|---|---|
committer | Peter Burow <pb@openoffice.org> | 2001-07-11 14:20:17 +0000 |
commit | 246733c477edf4847d427e40a05a44a7a2d2fb58 (patch) | |
tree | a212c724cd1175c6cf31bc175098b3e2967f0b73 /svtools | |
parent | 94d5406c3a125ba16575b08834027364204e208e (diff) |
fix: #88318# Organizer Button active
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/templwin.cxx | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index 7926423e2f9c..ffd435cb45a5 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -2,9 +2,9 @@ * * $RCSfile: templwin.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: pb $ $Date: 2001-07-09 13:06:24 $ + * last change: $Author: pb $ $Date: 2001-07-11 15:20:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1170,6 +1170,7 @@ SvtDocumentTemplateDialog::SvtDocumentTemplateDialog( Window* pParent ) : pImpl->aTitle = GetText(); + aManageBtn.SetClickHdl( LINK( this, SvtDocumentTemplateDialog, OrganizerHdl_Impl ) ); Link aLink = LINK( this, SvtDocumentTemplateDialog, OKHdl_Impl ); aEditBtn.SetClickHdl( aLink ); aOKBtn.SetClickHdl( aLink ); @@ -1252,6 +1253,38 @@ IMPL_LINK ( SvtDocumentTemplateDialog , OKHdl_Impl, PushButton *, pBtn ) return 0; } +IMPL_LINK ( SvtDocumentTemplateDialog , OrganizerHdl_Impl, PushButton *, pBtn ) +{ + Window* pOldDefWin = Application::GetDefDialogParent(); + Application::SetDefDialogParent( this ); + Reference < ::com::sun::star::frame::XFramesSupplier > xDesktop = + Reference < ::com::sun::star::frame::XFramesSupplier >( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop") ) ), UNO_QUERY ); + Reference < ::com::sun::star::frame::XFrame > xFrame( xDesktop->getActiveFrame() ); + if ( !xFrame.is() ) + xFrame = Reference < ::com::sun::star::frame::XFrame >( xDesktop, UNO_QUERY ); + + com::sun::star::util::URL aTargetURL; + aTargetURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("slot:5540") ); + Reference < com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer") ) ), UNO_QUERY ); + xTrans->parseStrict( aTargetURL ); + + Reference < ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, UNO_QUERY ); + Reference < ::com::sun::star::frame::XDispatch > xDisp; + xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(), 0 ); + + if ( xDisp.is() ) + { + Sequence<PropertyValue> aArgs(1); + PropertyValue* pArg = aArgs.getArray(); + pArg[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Referer") ); + pArg[0].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("private:user") ); + xDisp->dispatch( aTargetURL, aArgs ); + } + + Application::SetDefDialogParent( pOldDefWin ); + return 0; +} + IMPL_LINK ( SvtDocumentTemplateDialog , UpdateHdl_Impl, Timer *, EMPTYARG ) { pImpl->pWin->SetFocus( sal_False ); |