update dev300-m57
[ooovba.git] / applied_patches / 0004-speed-configmgr.diff
blob1740a0636f75b0f67b5e58236b0ebdd969d16b07
1 --- configmgr/source/localbe/localfilehelper.cxx.old 2009-04-02 10:51:56.000000000 +0000
2 +++ configmgr/source/localbe/localfilehelper.cxx 2009-04-06 16:41:37.000000000 +0000
3 @@ -139,6 +139,10 @@ namespace configmgr
4 if (_sURL.getLength() == 0)
5 return false;
7 + // This method has no right to be so under-performing to
8 + // achieve so, so little of any usefulness.
9 + return true;
11 osl::DirectoryItem aDirItem;
13 osl::DirectoryItem::RC rc = osl::DirectoryItem::get(_sURL, aDirItem);
14 --- configmgr/source/localbe/localmultistratum.cxx.old 2009-04-02 10:51:56.000000000 +0000
15 +++ configmgr/source/localbe/localmultistratum.cxx 2009-04-06 16:41:37.000000000 +0000
16 @@ -83,7 +83,7 @@ uno::Sequence< rtl::OUString > SAL_CALL
17 rtl::OUString const aLayerUrl = impl_getLayerDataDirectory(getBaseUrl());
18 rtl::OUString const aComponentUrl = aLayerUrl + componentToPath(aComponent);
20 - const sal_uInt32 k_STATUS_FIELDS = FileStatusMask_Type | FileStatusMask_FileName;
21 + const sal_uInt32 k_STATUS_FIELDS = FileStatusMask_FileName;
22 osl::Directory aComponentDirectory(aComponentUrl);
23 osl::DirectoryItem aItem;
24 std::vector< rtl::OUString > aResult;
25 @@ -108,13 +108,12 @@ uno::Sequence< rtl::OUString > SAL_CALL
26 OSL_TRACE("Reading Component Directory - Error (%u) getting status of directory item.\n", unsigned(errcode));
27 break;
30 - OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_Type), "Could not get type of directory item");
31 - if (aItemDescriptor.getFileType() != osl::FileStatus::Regular)
32 - continue;
34 OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_FileName), "Could not get name of component found");
35 rtl::OUString const aFileName = aItemDescriptor.getFileName();
37 + // It is reasonable to assume a .xcu file is not a directory & =>
38 + // not stat each directory entry at considerable cost.
39 if (!aFileName.endsWithIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(kLocalDataSuffix)))
40 continue;
42 --- configmgr/source/misc/filehelper.cxx.old 2009-04-02 10:51:59.000000000 +0000
43 +++ configmgr/source/misc/filehelper.cxx 2009-04-06 16:41:37.000000000 +0000
44 @@ -102,9 +102,22 @@ namespace configmgr
45 static const TimeValue k_NullTime = {0,0};
46 sal_uInt64 aSize = 0;
47 rModifyTime = k_NullTime;
48 + rtl::OUString aURL;
50 - osl::DirectoryItem aItem;
51 - if (osl::FileBase::E_None == osl::DirectoryItem::get(_sURL, aItem))
52 + osl::DirectoryItem aItem;
54 +#ifndef STAT_LOTS_OF_UNUSED_FILES
55 + // Statting every file takes way to long - we can use the directory
56 + // time-stamp & size instead, if we need to provoke an update
57 + // a simple cat > foo; rm foo will do that.
58 + // The dir size is (hopefully) non-0 and a good enough proxy value.
60 + aURL = FileHelper::getParentDir(_sURL);
61 +#else
62 + aURL = _sURL;
63 +#endif
65 + if (osl::FileBase::E_None == osl::DirectoryItem::get(aURL, aItem))
67 osl::FileStatus aStatus(osl_FileStatus_Mask_ModifyTime|osl_FileStatus_Mask_Type|osl_FileStatus_Mask_FileSize);
68 if (osl::FileBase::E_None == aItem.getFileStatus(aStatus))