summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
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 );