update dev300-m58
[ooovba.git] / applied_patches / 0083-sfx2-check-existing-template-dirs.diff
blobb0e72f6e709231b68885948f9e784715e6de7eaa
1 --- sfx2/source/doc/doctemplates.cxx.old 2008-10-14 08:23:43.000000000 +0200
2 +++ sfx2/source/doc/doctemplates.cxx 2009-03-23 20:37:14.000000000 +0100
3 @@ -37,6 +37,7 @@
4 #include <tools/urlobj.hxx>
5 #include <rtl/ustring.hxx>
6 #include <rtl/ustrbuf.hxx>
7 +#include <osl/file.hxx>
8 #ifndef _SV_RESARY_HXX
9 #include <tools/resary.hxx>
10 #endif
11 @@ -1218,12 +1219,17 @@ void SfxDocTplService_Impl::doUpdate()
12 while ( nCountDir )
14 nCountDir--;
15 - if ( Content::create( pDirs[ nCountDir ], aQuietEnv, aDirContent ) )
16 + osl::Directory aDirectory (pDirs[ nCountDir ]);
17 + osl::FileBase::RC nError = aDirectory.open();
18 + if (nError == osl::FileBase::E_None || bWriteableDirectory)
20 - createFromContent( aGroupList, aDirContent, sal_False, bWriteableDirectory );
21 + if ( Content::create( pDirs[ nCountDir ], aQuietEnv, aDirContent ) )
22 + {
23 + createFromContent( aGroupList, aDirContent, sal_False, bWriteableDirectory );
24 + }
25 + aDirectory.close();
28 - bWriteableDirectory = sal_False;
29 + bWriteableDirectory = sal_False;
32 // now check the list