summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-06-06 13:36:10 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-06-06 13:36:10 +0000
commit9f32a7e47beef039b1ae81fa8b6a4770c1def7be (patch)
treedb6d11adb2bf4522f65ddd335d031c8df92517dc
parent3d5b2d45b957badcdf398055fc6cedef65645140 (diff)
INTEGRATION: CWS dba30c (1.19.14); FILE MERGED
2008/05/13 06:53:28 fs 1.19.14.1: joining changes from CWS odbmacros3 to CWS dba30c 2008/05/07 08:16:31 fs 1.18.8.1: during #i49133#: +PROP_VIEWCONTROLLERNAME / addInputStream: respect the SalvagedFile property in the media descriptor, if present 2008/05/09 09:29:00 fs 1.18.8.2: RESYNC: (1.18-1.19); FILE MERGED
-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