summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--comphelper/source/misc/mediadescriptor.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx
index 0290df58af9b..e2c8feefd95c 100644
--- a/comphelper/source/misc/mediadescriptor.cxx
+++ b/comphelper/source/misc/mediadescriptor.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: mediadescriptor.cxx,v $
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
* This file is part of OpenOffice.org.
*
@@ -392,6 +392,12 @@ const ::rtl::OUString& MediaDescriptor::PROP_DOCUMENTBASEURL()
static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL"));
return sProp;
}
+
+const ::rtl::OUString& MediaDescriptor::PROP_VIEWCONTROLLERNAME()
+{
+ static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("ViewControllerName"));
+ return sProp;
+}
/*-----------------------------------------------
10.03.2004 08:09
-----------------------------------------------*/
@@ -507,7 +513,7 @@ sal_Bool MediaDescriptor::addInputStream_Impl( sal_Bool bLockFile )
try
{
// No stream available - create a new one
- // a) data cames as PostData ...
+ // a) data comes as PostData ...
pIt = find(MediaDescriptor::PROP_POSTDATA());
if (pIt != end())
{
@@ -518,15 +524,18 @@ sal_Bool MediaDescriptor::addInputStream_Impl( sal_Bool bLockFile )
return impl_openStreamWithPostData( xPostData );
}
- // b) ... or we must get it from the given URL
- ::rtl::OUString sURL = getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), ::rtl::OUString());
- if (!sURL.getLength())
+ // b) is there a reference to a file which is just being salvaged?
+ ::rtl::OUString sFileURL = getUnpackedValueOrDefault(MediaDescriptor::PROP_SALVAGEDFILE(), ::rtl::OUString());
+ // c) finally, the last resort is the URL property
+ if ( !sFileURL.getLength() )
+ sFileURL = getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), ::rtl::OUString());
+ if (!sFileURL.getLength())
throw css::uno::Exception(
::rtl::OUString::createFromAscii("Found no URL."),
css::uno::Reference< css::uno::XInterface >());
// Parse URL! Only the main part has to be used further. E.g. a jumpmark can make trouble
- ::rtl::OUString sNormalizedURL = impl_normalizeURL(sURL);
+ ::rtl::OUString sNormalizedURL = impl_normalizeURL( sFileURL );
return impl_openStreamWithURL( sNormalizedURL, bLockFile );
}
#if OSL_DEBUG_LEVEL>0