diff options
author | Peter Burow <pb@openoffice.org> | 2001-06-19 05:28:10 +0000 |
---|---|---|
committer | Peter Burow <pb@openoffice.org> | 2001-06-19 05:28:10 +0000 |
commit | 85f02e28c8bc265409f3439299f4966abe6adc74 (patch) | |
tree | 7e67c0fbf2df9947a0a6789b66014b8095af713c /svtools/source/contnr | |
parent | 2138a17c51d963fa7f9910d27d6032fb25714b04 (diff) |
fix: #88317# update DocumentTemplates on startup
Diffstat (limited to 'svtools/source/contnr')
-rw-r--r-- | svtools/source/contnr/templwin.cxx | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index eff5d6c49c8f..684cedfc7bbc 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -2,9 +2,9 @@ * * $RCSfile: templwin.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: pb $ $Date: 2001-06-18 11:36:42 $ + * last change: $Author: pb $ $Date: 2001-06-19 06:28:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1059,6 +1059,7 @@ struct SvtTmplDlg_Impl { SvtTemplateWindow* pWin; String aTitle; + Timer aUpdateTimer; SvtTmplDlg_Impl( Window* pParent ) : pWin( new SvtTemplateWindow( pParent ) ) {} ~SvtTmplDlg_Impl() { delete pWin; } @@ -1101,6 +1102,10 @@ SvtDocumentTemplateDialog::SvtDocumentTemplateDialog( Window* pParent ) : SelectHdl_Impl( NULL ); NewFolderHdl_Impl( NULL ); + + pImpl->aUpdateTimer.SetTimeout( 100 ); + pImpl->aUpdateTimer.SetTimeoutHdl( LINK( this, SvtDocumentTemplateDialog, UpdateHdl_Impl ) ); + pImpl->aUpdateTimer.Start(); } SvtDocumentTemplateDialog::~SvtDocumentTemplateDialog() @@ -1143,3 +1148,18 @@ IMPL_LINK ( SvtDocumentTemplateDialog , OKHdl_Impl, PushButton *, pBtn ) return 0; } +IMPL_LINK ( SvtDocumentTemplateDialog , UpdateHdl_Impl, Timer *, EMPTYARG ) +{ + UpdateDocumentTemplates_Impl(); + return 0; +} + +void SvtDocumentTemplateDialog::UpdateDocumentTemplates_Impl() +{ + ::rtl::OUString aService = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.DocumentTemplates" ) ); + Reference< XDocumentTemplates > xTemplates( + ::comphelper::getProcessServiceFactory()->createInstance( aService ), UNO_QUERY ); + if ( xTemplates.is() ) + xTemplates->update(); +} + |