summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/doctempl.cxx
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2001-12-17 13:20:42 +0000
committerMathias Bauer <mba@openoffice.org>2001-12-17 13:20:42 +0000
commit64a9f2c278bc228373aa6c8b05ff54a4d707b9e6 (patch)
tree5191bc16cbab5338710feca7763aae727d717eb9 /sfx2/source/doc/doctempl.cxx
parentb2106b133e68009932864a9e6d1e65da296491a6 (diff)
#95752#: update SfxDocumentTemplates from component
Diffstat (limited to 'sfx2/source/doc/doctempl.cxx')
-rw-r--r--sfx2/source/doc/doctempl.cxx34
1 files changed, 22 insertions, 12 deletions
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index bcf3706186..f58906e455 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: doctempl.cxx,v $
*
- * $Revision: 1.44 $
+ * $Revision: 1.45 $
*
- * last change: $Author: fs $ $Date: 2001-12-06 13:40:38 $
+ * last change: $Author: mba $ $Date: 2001-12-17 14:20:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1699,18 +1699,28 @@ SfxDocumentTemplates::~SfxDocumentTemplates()
pImp = NULL;
}
- //---------------------------------------------------------------------
- //--- 05.12.01 17:49:58 -----------------------------------------------
- void SfxDocumentTemplates::Update( sal_Bool _bSmart )
+void SfxDocumentTemplates::Update( sal_Bool _bSmart )
+{
+ if ( !_bSmart // don't be smart
+ || ::svt::TemplateFolderCache( sal_True ).needsUpdate() // update is really necessary
+ )
{
- if ( !_bSmart // don't be smart
- || ::svt::TemplateFolderCache( sal_True ).needsUpdate() // update is really necessary
- )
- {
- if ( pImp->Construct() )
- pImp->Rescan();
- }
+ if ( pImp->Construct() )
+ pImp->Rescan();
}
+}
+
+void SfxDocumentTemplates::ReInitFromComponent()
+{
+ Reference< XDocumentTemplates > xTemplates = pImp->getDocTemplates();
+ if ( xTemplates.is() )
+ {
+ Reference < XContent > aRootContent = xTemplates->getContent();
+ Reference < XCommandEnvironment > aCmdEnv;
+ Content aTemplRoot( aRootContent, aCmdEnv );
+ pImp->CreateFromHierarchy( aTemplRoot );
+ }
+}
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------