1 diff --git oovbaapi/ooo/vba/word/XDocument.idl oovbaapi/ooo/vba/word/XDocument.idl
2 index 32cf6d8..2502846 100644
3 --- oovbaapi/ooo/vba/word/XDocument.idl
4 +++ oovbaapi/ooo/vba/word/XDocument.idl
5 @@ -47,6 +47,7 @@ module ooo { module vba { module word {
6 interface XDocument : com::sun::star::uno::XInterface
8 [attribute, readonly] XRange Content;
9 + [attribute] any AttachedTemplate;
11 XRange Range( [in] any Start, [in] any End );
12 any BuiltInDocumentProperties( [in] any index );
13 diff --git oovbaapi/ooo/vba/word/XTemplate.idl oovbaapi/ooo/vba/word/XTemplate.idl
15 index 0000000..1913118
17 +++ oovbaapi/ooo/vba/word/XTemplate.idl
19 +/*************************************************************************
21 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
23 + * Copyright 2008 by Sun Microsystems, Inc.
25 + * OpenOffice.org - a multi-platform office productivity suite
30 + * This file is part of OpenOffice.org.
32 + * OpenOffice.org is free software: you can redistribute it and/or modify
33 + * it under the terms of the GNU Lesser General Public License version 3
34 + * only, as published by the Free Software Foundation.
36 + * OpenOffice.org is distributed in the hope that it will be useful,
37 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
38 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39 + * GNU Lesser General Public License version 3 for more details
40 + * (a copy is included in the LICENSE file that accompanied this code).
42 + * You should have received a copy of the GNU Lesser General Public License
43 + * version 3 along with OpenOffice.org. If not, see
44 + * <http://www.openoffice.org/license.html>
45 + * for a copy of the LGPLv3 License.
47 + ************************************************************************/
48 +#ifndef __ooo_vba_word_XTemplate_idl__
49 +#define __ooo_vba_word_XTemplate_idl__
51 +#ifndef __com_sun_star_uno_XInterface_idl__
52 +#include <com/sun/star/uno/XInterface.idl>
55 +#ifndef __ooo_vba_XHelperInterface_idl__
56 +#include <ooo/vba/XHelperInterface.idl>
59 +module ooo { module vba { module word {
63 + interface ooo::vba::XHelperInterface;
65 + [attribute, readonly] string Name;
73 diff --git oovbaapi/ooo/vba/word/makefile.mk oovbaapi/ooo/vba/word/makefile.mk
74 index 646e623..c638476 100644
75 --- oovbaapi/ooo/vba/word/makefile.mk
76 +++ oovbaapi/ooo/vba/word/makefile.mk
77 @@ -56,6 +56,7 @@ IDLFILES= XGlobals.idl\
83 # ------------------------------------------------------------------
85 diff --git sw/inc/docsh.hxx sw/inc/docsh.hxx
86 index 8cc3a72..831b785 100644
89 @@ -85,6 +85,7 @@ class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
90 comphelper::EmbeddedObjectContainer* pOLEChildList;
91 sal_Int16 nUpdateDocMode; // contains the com::sun::star::document::UpdateDocMode
92 bool bInUpdateFontList; //prevent nested calls of UpdateFontList
93 + bool bIsATemplate; //prevent nested calls of UpdateFontList
94 // Methoden fuer den Zugriff aufs Doc
95 SW_DLLPRIVATE void AddLink();
96 SW_DLLPRIVATE void RemoveLink();
97 @@ -299,6 +300,8 @@ public:
100 SfxInPlaceClient* GetIPClient( const ::svt::EmbeddedObjectRef& xObjRef );
101 + SW_DLLPRIVATE sal_Bool IsTemplate() { return bIsATemplate; }
102 + SW_DLLPRIVATE void SetIsTemplate( bool bValue ) { bIsATemplate = bValue; }
106 diff --git sw/inc/unomap.hxx sw/inc/unomap.hxx
107 index 92feb78..1e842ab 100644
108 --- sw/inc/unomap.hxx
109 +++ sw/inc/unomap.hxx
111 #define WID_DOC_LOCK_UPDATES 1016
112 #define WID_DOC_HAS_VALID_SIGNATURES 1017
113 #define WID_DOC_BUILDID 1024
114 +#define WID_DOC_ISTEMPLATEID 1025
115 // --> OD 2006-03-21 #b6375613#
116 #define WID_APPLY_WORKAROUND_FOR_B6375613 1070
118 diff --git sw/inc/unoprnms.hxx sw/inc/unoprnms.hxx
119 index 2ba5469..2aacb96 100644
120 --- sw/inc/unoprnms.hxx
121 +++ sw/inc/unoprnms.hxx
122 @@ -804,7 +804,8 @@ enum SwPropNameIds
123 /* 0734 */ UNO_NAME_CHAR_OVERLINE_COLOR,
124 /* 0735 */ UNO_NAME_CHAR_OVERLINE_HAS_COLOR,
125 /* 0736 */ UNO_NAME_OUTLINE_LEVEL, //#outline level,add<-zhaojianwei outlinelevel
126 -/* 0737 */ SW_PROPNAME_END
127 +/* 0737 */ UNO_NAME_IS_TEMPLATE,
128 +/* 0738 */ SW_PROPNAME_END
132 diff --git sw/source/core/unocore/unomap.cxx sw/source/core/unocore/unomap.cxx
133 index abc341b..14ff14e 100644
134 --- sw/source/core/unocore/unomap.cxx
135 +++ sw/source/core/unocore/unomap.cxx
136 @@ -1703,6 +1703,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP
137 { SW_PROP_NMID(UNO_NAME_RECORD_CHANGES), WID_DOC_CHANGES_RECORD, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
138 { SW_PROP_NMID(UNO_NAME_SHOW_CHANGES), WID_DOC_CHANGES_SHOW, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
139 { SW_PROP_NMID(UNO_NAME_WORD_COUNT), WID_DOC_WORD_COUNT, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::READONLY, 0},
140 + { SW_PROP_NMID(UNO_NAME_IS_TEMPLATE), WID_DOC_ISTEMPLATEID, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0},
141 { SW_PROP_NMID(UNO_NAME_WORD_SEPARATOR), WID_DOC_WORD_SEPARATOR, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
142 { SW_PROP_NMID(UNO_NAME_HIDE_FIELD_TIPS), WID_DOC_HIDE_TIPS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
143 { SW_PROP_NMID(UNO_NAME_REDLINE_DISPLAY_TYPE), WID_DOC_REDLINE_DISPLAY, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0},
144 diff --git sw/source/core/unocore/unoprnms.cxx sw/source/core/unocore/unoprnms.cxx
145 index cbb2d18..35a7192 100644
146 --- sw/source/core/unocore/unoprnms.cxx
147 +++ sw/source/core/unocore/unoprnms.cxx
148 @@ -778,7 +778,8 @@ const SwPropNameTab aPropNameTab = {
149 /* 0733 CHAR_OVERLINE */ {MAP_CHAR_LEN("CharOverline")},
150 /* 0734 CHAR_OVERLINE_COLOR */ {MAP_CHAR_LEN("CharOverlineColor")},
151 /* 0735 CHAR_OVERLINE_HAS_COLOR */ {MAP_CHAR_LEN("CharOverlineHasColor")},
152 -/* 0736 UNO_NAME_OUTLINE_LEVEL */ {MAP_CHAR_LEN("OutlineLevel")}//#outline level,add<-zhaojianwei Outlinelevel
153 +/* 0736 UNO_NAME_OUTLINE_LEVEL */ {MAP_CHAR_LEN("OutlineLevel")},//#outline level,add<-zhaojianwei Outlinelevel
154 +/* 0737 UNO_NAME_IS_TEMPLATE */ {MAP_CHAR_LEN("IsTemplate")}
157 const SwPropNameLen& SwGetPropName( USHORT nId )
158 diff --git sw/source/filter/ww8/ww8par.cxx sw/source/filter/ww8/ww8par.cxx
159 index 714c63a..e6cca0f 100644
160 --- sw/source/filter/ww8/ww8par.cxx
161 +++ sw/source/filter/ww8/ww8par.cxx
164 #include <dbgoutsw.hxx>
166 +#include <unotools/localfilehelper.hxx>
168 #define MM_250 1417 // WW-Default fuer Hor. Seitenraender: 2.5 cm
169 #define MM_200 1134 // WW-Default fuer u.Seitenrand: 2.0 cm
170 @@ -219,6 +220,80 @@ bool registerDocEvent( SfxObjectShell* pShell )
178 + sal_uInt16 cchData;
179 + rtl::OUString data;
180 + SBBItem() : cchData(0){}
182 + sal_uInt16 fExtend;
184 + sal_uInt16 cbExtra;
186 + std::vector< SBBItem > dataItems;
189 + Sttb& operator = ( const Sttb&);
193 + bool Read(SvStream *pS);
194 + void Print( FILE* fp );
195 + rtl::OUString getStringAtIndex( sal_Int32 );
198 +Sttb::Sttb() : fExtend( 0 )
208 +bool Sttb::Read( SvStream* pS )
210 + OSL_TRACE("Sttb::Read() stream pos 0x%x", pS->Tell() );
211 + nOffSet = pS->Tell();
212 + *pS >> fExtend >> cData >> cbExtra;
215 + for ( sal_Int32 index = 0; index < cData; ++index )
218 + *pS >> aItem.cchData;
219 + aItem.data = readUnicodeString( pS, aItem.cchData );
220 + dataItems.push_back( aItem );
226 +void Sttb::Print( FILE* fp )
228 + fprintf( fp, "[ 0x%x ] Sttb - dump\n", nOffSet);
229 + fprintf( fp, " fExtend 0x%x [expected 0xFFFF ]\n", fExtend );
230 + fprintf( fp, " cData no. or string data items %d (0x%x)\n", cData, cData );
234 + for ( sal_Int32 index = 0; index < cData; ++index )
235 + fprintf(fp," string dataItem[ %d(0x%x) ] has name %s\n", static_cast< int >( index ), static_cast< unsigned int >( index ), rtl::OUStringToOString( dataItems[ index ].data, RTL_TEXTENCODING_UTF8 ).getStr() );
241 +Sttb::getStringAtIndex( sal_Int32 index )
243 + rtl::OUString aRet;
244 + if ( index < dataItems.size() )
245 + aRet = dataItems[ index ].data;
249 SwMSDffManager::SwMSDffManager( SwWW8ImplReader& rRdr )
250 : SvxMSDffManager(*rRdr.pTableStream, rRdr.GetBaseURL(), rRdr.pWwFib->fcDggInfo,
251 @@ -3725,6 +3800,41 @@ void SwWW8ImplReader::ReadDocInfo()
252 DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
254 if (xDocProps.is()) {
255 + if ( pWwFib->fDot )
257 + rtl::OUString sTemplateURL;
258 + SfxMedium* pMedium = mpDocShell->GetMedium();
261 + rtl::OUString aName = pMedium->GetName();
262 + INetURLObject aURL( aName );
263 + sTemplateURL = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI);
264 + if ( sTemplateURL.getLength() > 0 )
265 + xDocProps->setTemplateURL( sTemplateURL );
268 + else // not a template
270 + long nCur = pTableStream->Tell();
272 + pTableStream->Seek( pWwFib->fcSttbfAssoc ); // point at tgc record
273 + if (!aSttb.Read( pTableStream ) )
274 + OSL_TRACE("** Read of SttbAssoc data failed!!!! ");
275 + pTableStream->Seek( nCur ); // return to previous position, is that necessary?
277 + aSttb.Print( stderr );
279 + String sPath = aSttb.getStringAtIndex( 0x1 );
281 + // attempt to convert to url ( won't work for obvious reasons on linux
283 + ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, aURL );
285 + xDocProps->setTemplateURL( aURL );
287 + xDocProps->setTemplateURL( sPath );
290 sfx2::LoadOlePropertySet(xDocProps, pStg);
293 @@ -3987,6 +3987,8 @@ ULONG SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
295 if (mbNewDoc && pStg && !pGloss) /*meaningless for a glossary, cmc*/
298 + mpDocShell->SetIsTemplate( pWwFib->fDot ); // point at tgc record
299 const SvtFilterOptions* pVBAFlags = SvtFilterOptions::Get();
300 maTracer.EnterEnvironment(sw::log::eMacros);
301 // Create and insert Excel vba Globals
302 diff --git sw/source/ui/uno/unotxdoc.cxx sw/source/ui/uno/unotxdoc.cxx
303 index fc3b8b9..356efaf 100644
304 --- sw/source/ui/uno/unotxdoc.cxx
305 +++ sw/source/ui/uno/unotxdoc.cxx
306 @@ -2147,6 +2147,9 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
310 + case WID_DOC_ISTEMPLATEID :
311 + aAny <<= pDocShell->IsTemplate();
313 case WID_DOC_CHAR_COUNT :
314 case WID_DOC_PARA_COUNT :
315 case WID_DOC_WORD_COUNT :
316 diff --git sw/source/ui/vba/makefile.mk sw/source/ui/vba/makefile.mk
317 index e789fde..42a9bbc 100644
318 --- sw/source/ui/vba/makefile.mk
319 +++ sw/source/ui/vba/makefile.mk
320 @@ -69,6 +69,7 @@ SLOFILES= \
321 $(SLO)$/vbapanes.obj \
322 $(SLO)$/vbaoptions.obj \
323 $(SLO)$/vbaselection.obj \
324 + $(SLO)$/vbatemplate.obj \
326 # --- Targets ------------------------------------------------------
328 diff --git sw/source/ui/vba/vbadocument.cxx sw/source/ui/vba/vbadocument.cxx
329 index c6b1c25..9e9fdc4 100644
330 --- sw/source/ui/vba/vbadocument.cxx
331 +++ sw/source/ui/vba/vbadocument.cxx
333 #include "vbavariables.hxx"
334 #include <com/sun/star/text/XBookmarksSupplier.hpp>
335 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
336 +#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
337 #include <com/sun/star/document/XDocumentProperties.hpp>
338 #include <vbahelper/helperdecl.hxx>
339 +#include <wordvbahelper.hxx>
340 +#include <docsh.hxx>
341 +#include "vbatemplate.hxx"
343 using namespace ::ooo::vba;
344 using namespace ::com::sun::star;
345 @@ -161,6 +165,25 @@ SwVbaDocument::getServiceImplName()
346 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaDocument") );
350 +SwVbaDocument::getAttachedTemplate() throw (uno::RuntimeException)
352 + SwDocShell* pDocShell = word::getDocShell( getModel() );
353 + uno::Reference< word::XTemplate > xTemplate;
354 + uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( getModel(), uno::UNO_QUERY_THROW );
355 + uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
356 + uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
357 + rtl::OUString sTemplateName = xDocProps->getTemplateName();
359 + xTemplate = new SwVbaTemplate( this, mxContext, getModel(), sTemplateName );
360 + return uno::makeAny( xTemplate );
364 +SwVbaDocument::setAttachedTemplate( const css::uno::Any& _attachedtemplate ) throw (uno::RuntimeException)
366 + throw uno::RuntimeException();
369 uno::Sequence< rtl::OUString >
370 SwVbaDocument::getServiceNames()
371 diff --git sw/source/ui/vba/vbadocument.hxx sw/source/ui/vba/vbadocument.hxx
372 index 0f696ce..a82503b 100644
373 --- sw/source/ui/vba/vbadocument.hxx
374 +++ sw/source/ui/vba/vbadocument.hxx
375 @@ -55,6 +55,9 @@ public:
376 virtual css::uno::Any SAL_CALL CustomDocumentProperties( const css::uno::Any& index ) throw (css::uno::RuntimeException);
377 virtual css::uno::Any SAL_CALL Bookmarks( const css::uno::Any& rIndex ) throw ( css::uno::RuntimeException );
378 virtual css::uno::Any SAL_CALL Variables( const css::uno::Any& rIndex ) throw ( css::uno::RuntimeException );
379 + virtual css::uno::Any SAL_CALL getAttachedTemplate() throw (css::uno::RuntimeException);
380 + virtual void SAL_CALL setAttachedTemplate( const css::uno::Any& _attachedtemplate ) throw (css::uno::RuntimeException);
384 virtual rtl::OUString& getServiceImplName();
385 diff --git sw/source/ui/vba/vbatemplate.cxx sw/source/ui/vba/vbatemplate.cxx
387 index 0000000..11c1a59
389 +++ sw/source/ui/vba/vbatemplate.cxx
391 +/*************************************************************************
393 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
395 + * Copyright 2008 by Sun Microsystems, Inc.
397 + * OpenOffice.org - a multi-platform office productivity suite
402 + * This file is part of OpenOffice.org.
404 + * OpenOffice.org is free software: you can redistribute it and/or modify
405 + * it under the terms of the GNU Lesser General Public License version 3
406 + * only, as published by the Free Software Foundation.
408 + * OpenOffice.org is distributed in the hope that it will be useful,
409 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
410 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
411 + * GNU Lesser General Public License version 3 for more details
412 + * (a copy is included in the LICENSE file that accompanied this code).
414 + * You should have received a copy of the GNU Lesser General Public License
415 + * version 3 along with OpenOffice.org. If not, see
416 + * <http://www.openoffice.org/license.html>
417 + * for a copy of the LGPLv3 License.
419 + ************************************************************************/
420 +#include "vbatemplate.hxx"
421 +#include <vbahelper/vbahelper.hxx>
422 +#include "wordvbahelper.hxx"
424 +using namespace ::ooo::vba;
425 +using namespace ::com::sun::star;
427 +SwVbaTemplate::SwVbaTemplate( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const rtl::OUString& rName )
428 + : SwVbaTemplate_BASE( rParent, rContext ), mxModel( rModel ), msName( rName )
433 +SwVbaTemplate::~SwVbaTemplate()
438 +SwVbaTemplate::getName() throw ( css::uno::RuntimeException )
443 +SwVbaTemplate::getServiceImplName()
445 + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTemplate") );
449 +uno::Sequence< rtl::OUString >
450 +SwVbaTemplate::getServiceNames()
452 + static uno::Sequence< rtl::OUString > aServiceNames;
453 + if ( aServiceNames.getLength() == 0 )
455 + aServiceNames.realloc( 1 );
456 + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Template" ) );
458 + return aServiceNames;
461 diff --git sw/source/ui/vba/vbatemplate.hxx sw/source/ui/vba/vbatemplate.hxx
463 index 0000000..63a2f26
465 +++ sw/source/ui/vba/vbatemplate.hxx
467 +/*************************************************************************
469 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
471 + * Copyright 2008 by Sun Microsystems, Inc.
473 + * OpenOffice.org - a multi-platform office productivity suite
478 + * This file is part of OpenOffice.org.
480 + * OpenOffice.org is free software: you can redistribute it and/or modify
481 + * it under the terms of the GNU Lesser General Public License version 3
482 + * only, as published by the Free Software Foundation.
484 + * OpenOffice.org is distributed in the hope that it will be useful,
485 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
486 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
487 + * GNU Lesser General Public License version 3 for more details
488 + * (a copy is included in the LICENSE file that accompanied this code).
490 + * You should have received a copy of the GNU Lesser General Public License
491 + * version 3 along with OpenOffice.org. If not, see
492 + * <http://www.openoffice.org/license.html>
493 + * for a copy of the LGPLv3 License.
495 + ************************************************************************/
496 +#ifndef SW_VBA_TEMPLATE_HXX
497 +#define SW_VBA_TEMPLATE_HXX
499 +#include <ooo/vba/word/XTemplate.hpp>
500 +#include <vbahelper/vbahelperinterface.hxx>
502 +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XTemplate > SwVbaTemplate_BASE;
504 +class SwVbaTemplate : public SwVbaTemplate_BASE
507 + css::uno::Reference< css::frame::XModel > mxModel;
508 + rtl::OUString msName;
510 + SwVbaTemplate( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext,
511 + const css::uno::Reference< css::frame::XModel >& rModel, const rtl::OUString& );
512 + virtual ~SwVbaTemplate();
515 + virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
516 + // XHelperInterface
517 + virtual rtl::OUString& getServiceImplName();
518 + virtual css::uno::Sequence<rtl::OUString> getServiceNames();
520 +#endif /* SW_VBA_TEMPLATE_HXX */
521 diff --git sfx2/source/doc/objcont.cxx sfx2/source/doc/objcont.cxx
522 index 3d1668b..9bb525f 100644
523 --- sfx2/source/doc/objcont.cxx
524 +++ sfx2/source/doc/objcont.cxx
525 @@ -1471,31 +1471,35 @@ sal_Bool SfxObjectShell::IsHelpDocument() const
527 void SfxObjectShell::ResetFromTemplate( const String& rTemplateName, const String& rFileName )
529 - uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties());
530 - xDocProps->setTemplateURL( ::rtl::OUString() );
531 - xDocProps->setTemplateName( ::rtl::OUString() );
532 - xDocProps->setTemplateDate( util::DateTime() );
533 - xDocProps->resetUserData( ::rtl::OUString() );
538 - if( ::utl::LocalFileHelper::IsLocalFile( rFileName ) )
541 - if( SFX_APP()->Get_Impl()->GetDocumentTemplates()->GetFull( String(), rTemplateName, aFoundName ) )
543 - INetURLObject aObj( rFileName );
544 - xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) );
545 - xDocProps->setTemplateName( rTemplateName );
548 - xDocProps->setTemplateDate( util::DateTime(
549 - now.Get100Sec(), now.GetSec(), now.GetMin(),
550 - now.GetHour(), now.GetDay(), now.GetMonth(),
553 - SetQueryLoadTemplate( sal_True );
554 + // only care about reseting this data for openoffice formats otherwise
555 + if ( IsOwnStorageFormat_Impl( *GetMedium()) )
557 + uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties());
558 + xDocProps->setTemplateURL( ::rtl::OUString() );
559 + xDocProps->setTemplateName( ::rtl::OUString() );
560 + xDocProps->setTemplateDate( util::DateTime() );
561 + xDocProps->resetUserData( ::rtl::OUString() );
566 + if( ::utl::LocalFileHelper::IsLocalFile( rFileName ) )
569 + if( SFX_APP()->Get_Impl()->GetDocumentTemplates()->GetFull( String(), rTemplateName, aFoundName ) )
571 + INetURLObject aObj( rFileName );
572 + xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) );
573 + xDocProps->setTemplateName( rTemplateName );
576 + xDocProps->setTemplateDate( util::DateTime(
577 + now.Get100Sec(), now.GetSec(), now.GetMin(),
578 + now.GetHour(), now.GetDay(), now.GetMonth(),
581 + SetQueryLoadTemplate( sal_True );