summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-05-27 21:12:53 +0200
committerJan Holesovsky <kendy@suse.cz>2011-05-27 21:12:53 +0200
commit66bf06edd047c8c1ce5df3bd49a40e31d1db5b8a (patch)
tree19d6b6590fb3120b799a87399255856cd1885229 /svl/source
parent9e5584a82633442467a53ccc08c3380070178a38 (diff)
parent61e112b8ac1d1fe822c7a2ae4fa75bab4c34e0a7 (diff)
Merge branch 'master' of git://anongit.freedesktop.org/libreoffice/libs-gui
Conflicts: vcl/source/control/makefile.mk vcl/unx/generic/printer/ppdparser.cxx
Diffstat (limited to 'svl/source')
-rw-r--r--svl/source/memtools/svarray.cxx4
-rw-r--r--svl/source/misc/lockfilecommon.cxx39
2 files changed, 12 insertions, 31 deletions
diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index 2a0bf03a733e..7d5984c6f6df 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -32,7 +32,6 @@
#define _SVARRAY_CXX
#define _SVSTDARR_ULONGS
-#define _SVSTDARR_ULONGSSORT
#define _SVSTDARR_sal_uInt16S
#define _SVSTDARR_STRINGS
#define _SVSTDARR_STRINGSDTOR
@@ -50,7 +49,6 @@
#define _SVSTDARR_BYTESTRINGSISORTDTOR
#define _SVSTDARR_XUB_STRLEN
-#define _SVSTDARR_XUB_STRLENSORT
#include <svl/svstdarr.hxx>
#include <tools/string.hxx>
@@ -67,8 +65,6 @@ sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const
SV_IMPL_VARARR( SvULongs, sal_uLong )
SV_IMPL_VARARR( SvUShorts, sal_uInt16 )
-SV_IMPL_VARARR_SORT( SvULongsSort, sal_uLong )
-
SV_IMPL_PTRARR( SvStrings, StringPtr )
SV_IMPL_PTRARR( SvStringsDtor, StringPtr )
SV_IMPL_OP_PTRARR_SORT( SvStringsSort, StringPtr )
diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx
index b39998dc57f4..c725a8a2d74a 100644
--- a/svl/source/misc/lockfilecommon.cxx
+++ b/svl/source/misc/lockfilecommon.cxx
@@ -56,6 +56,8 @@
#include <unotools/useroptions.hxx>
+#include <salhelper/linkhelper.hxx>
+
#include <svl/lockfilecommon.hxx>
using namespace ::com::sun::star;
@@ -89,36 +91,19 @@ INetURLObject LockFileCommon::ResolveLinks( const INetURLObject& aDocURL )
if ( aDocURL.HasError() )
throw lang::IllegalArgumentException();
- ::rtl::OUString aURLToCheck = aDocURL.GetMainURL( INetURLObject::NO_DECODE );
-
- sal_Bool bNeedsChecking = sal_True;
- sal_Int32 nMaxLinkCount = 128;
- sal_Int32 nCount = 0;
+ ::rtl::OUString aURLToCheck = aDocURL.GetMainURL(INetURLObject::NO_DECODE);
- while( bNeedsChecking )
+ // there is currently no UCB functionality to resolve the symbolic links;
+ // since the lock files are used only for local file systems the osl
+ // functionality is used directly
+ salhelper::LinkResolver aResolver(osl_FileStatus_Mask_FileName);
+ osl::FileBase::RC eStatus = aResolver.fetchFileStatus(aURLToCheck);
+ if (eStatus == osl::FileBase::E_None)
+ aURLToCheck = aResolver.m_aStatus.getFileURL();
+ else if (eStatus == osl::FileBase::E_MULTIHOP)
{
- bNeedsChecking = sal_False;
-
// do not allow too deep links
- if ( nCount++ >= nMaxLinkCount )
- throw io::IOException();
-
- // there is currently no UCB functionality to resolve the symbolic links;
- // since the lock files are used only for local file systems the osl functionality is used directly
-
- ::osl::FileStatus aStatus( osl_FileStatus_Mask_Type | osl_FileStatus_Mask_LinkTargetURL );
- ::osl::DirectoryItem aItem;
- if ( ::osl::FileBase::E_None == ::osl::DirectoryItem::get( aURLToCheck, aItem )
- && aItem.is() && ::osl::FileBase::E_None == aItem.getFileStatus( aStatus ) )
- {
- if ( aStatus.isValid( osl_FileStatus_Mask_Type )
- && aStatus.isValid( osl_FileStatus_Mask_LinkTargetURL )
- && aStatus.getFileType() == ::osl::FileStatus::Link )
- {
- aURLToCheck = aStatus.getLinkTargetURL();
- bNeedsChecking = sal_True;
- }
- }
+ throw io::IOException();
}
return INetURLObject( aURLToCheck );