summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-01-16 17:00:23 +0100
committerMichael Stahl <mstahl@redhat.com>2013-01-16 17:06:07 +0100
commit7dc663ec764d569957e0e1758b701dfb8f399647 (patch)
tree27b0075a0b2a45a3458fbeefdd398ebed30a51b1
parentbeacee6fad46aa2c8fc813bb0150e5c7a5175b26 (diff)
SfxObjectShell::UpdateFromTemplate_Impl: template URL...
... is an URI not a system path so convert it to absolute URI via rtl::Uri. Change-Id: I1ce4c732340a52916dab658f43b96da9a81b3525
-rw-r--r--sfx2/source/doc/objcont.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index e7bd7f3ac5d9..6f816aa814e1 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -42,6 +42,7 @@
#include <svtools/ehdl.hxx>
#include <tools/datetime.hxx>
#include <rtl/logfile.hxx>
+#include <rtl/uri.hxx>
#include <math.h>
#include <unotools/saveopt.hxx>
@@ -736,11 +737,14 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
// an error if the template filename points not to a valid file
SfxDocumentTemplates aTempl;
aTempl.Construct();
- if ( !aTemplURL.isEmpty() )
+ if (!aTemplURL.isEmpty())
{
- String aURL;
- if( ::utl::LocalFileHelper::ConvertSystemPathToURL( aTemplURL, GetMedium()->GetName(), aURL ) )
- aFoundName = aURL;
+ try {
+ aFoundName = ::rtl::Uri::convertRelToAbs(GetMedium()->GetName(),
+ aTemplURL);
+ } catch (::rtl::MalformedUriException const&) {
+ assert(false); // don't think that's supposed to happen?
+ }
}
if( !aFoundName.Len() && !aTemplName.isEmpty() )