From 2b80771e213b166307059acddc9f7f822a6944f7 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Mon, 18 Apr 2005 10:46:44 +0000 Subject: INTEGRATION: CWS fwkfinal8 (1.5.6); FILE MERGED 2005/04/06 15:26:03 tbe 1.5.6.1: #i42647# Badly Viewed Filenames for the Macro Assignments Saving in Customize Dialog --- scripting/source/inc/util/MiscUtils.hxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'scripting/source/inc/util/MiscUtils.hxx') diff --git a/scripting/source/inc/util/MiscUtils.hxx b/scripting/source/inc/util/MiscUtils.hxx index 9ed5bfb00df3..436b9179dd54 100644 --- a/scripting/source/inc/util/MiscUtils.hxx +++ b/scripting/source/inc/util/MiscUtils.hxx @@ -2,9 +2,9 @@ * * $RCSfile: MiscUtils.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: obo $ $Date: 2005-03-18 09:47:24 $ + * last change: $Author: obo $ $Date: 2005-04-18 11:46:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,6 +64,10 @@ #include +#ifndef _URLOBJ_HXX +#include +#endif + #include #include #include @@ -273,12 +277,9 @@ static ::rtl::OUString parseLocationName( const ::rtl::OUString& location ) // strip out the last leaf of location name // e.g. file://dir1/dir2/Blah.sxw - > Blah.sxw ::rtl::OUString temp = location; - sal_Int32 lastSlashIndex = temp.lastIndexOf( ::rtl::OUString::createFromAscii( "/" ) ); - - if ( ( lastSlashIndex + 1 ) < temp.getLength() ) - { - temp = temp.copy( lastSlashIndex + 1 ); - } + INetURLObject aURLObj( temp ); + if ( !aURLObj.HasError() ) + temp = aURLObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); return temp; } -- cgit