diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-04-18 10:46:44 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-04-18 10:46:44 +0000 |
commit | 2b80771e213b166307059acddc9f7f822a6944f7 (patch) | |
tree | 7dea6b36b3e6daced64d4de6f97f84a54f6d8536 /scripting/source/inc | |
parent | 189eb66202d0bb559de8c5e99f88962af03451a8 (diff) |
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
Diffstat (limited to 'scripting/source/inc')
-rw-r--r-- | scripting/source/inc/util/MiscUtils.hxx | 17 |
1 files changed, 9 insertions, 8 deletions
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 <rtl/ustring> +#ifndef _URLOBJ_HXX +#include <tools/urlobj.hxx> +#endif + #include <ucbhelper/content.hxx> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/frame/XModel.hpp> @@ -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; } |