summaryrefslogtreecommitdiff
path: root/comphelper/source/misc/mediadescriptor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'comphelper/source/misc/mediadescriptor.cxx')
-rw-r--r--comphelper/source/misc/mediadescriptor.cxx48
1 files changed, 11 insertions, 37 deletions
diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx
index e0b3e797264a..68a2999b738e 100644
--- a/comphelper/source/misc/mediadescriptor.cxx
+++ b/comphelper/source/misc/mediadescriptor.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,9 +69,6 @@ namespace css = ::com::sun::star;
//_______________________________________________
// definitions
-/*-----------------------------------------------
- 10.03.2004 07:35
------------------------------------------------*/
const ::rtl::OUString& MediaDescriptor::PROP_ABORTED()
{
static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Aborted"));
@@ -396,37 +394,25 @@ MediaDescriptor::MediaDescriptor()
{
}
-/*-----------------------------------------------
- 10.03.2004 08:09
------------------------------------------------*/
MediaDescriptor::MediaDescriptor(const css::uno::Any& aSource)
: SequenceAsHashMap(aSource)
{
}
-/*-----------------------------------------------
- 10.03.2004 08:09
------------------------------------------------*/
MediaDescriptor::MediaDescriptor(const css::uno::Sequence< css::beans::PropertyValue >& lSource)
: SequenceAsHashMap(lSource)
{
}
-/*-----------------------------------------------
- 10.03.2004 08:09
------------------------------------------------*/
MediaDescriptor::MediaDescriptor(const css::uno::Sequence< css::beans::NamedValue >& lSource)
: SequenceAsHashMap(lSource)
{
}
-/*-----------------------------------------------
- 18.11.2004 13:37
------------------------------------------------*/
sal_Bool MediaDescriptor::isStreamReadOnly() const
{
- static ::rtl::OUString CONTENTSCHEME_FILE = ::rtl::OUString::createFromAscii("file");
- static ::rtl::OUString CONTENTPROP_ISREADONLY = ::rtl::OUString::createFromAscii("IsReadOnly");
+ static ::rtl::OUString CONTENTSCHEME_FILE( RTL_CONSTASCII_USTRINGPARAM( "file" ));
+ static ::rtl::OUString CONTENTPROP_ISREADONLY( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ));
static sal_Bool READONLY_FALLBACK = sal_False;
sal_Bool bReadOnly = READONLY_FALLBACK;
@@ -540,9 +526,6 @@ void MediaDescriptor::clearComponentDataEntry( const ::rtl::OUString& rName )
}
}
-/*-----------------------------------------------
- 10.03.2004 09:02
------------------------------------------------*/
sal_Bool MediaDescriptor::addInputStream()
{
return impl_addInputStream( sal_True );
@@ -602,20 +585,20 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile )
::rtl::OUString sURL = getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), ::rtl::OUString());
if (!sURL.getLength())
throw css::uno::Exception(
- ::rtl::OUString::createFromAscii("Found no URL."),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "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 );
return impl_openStreamWithURL( sNormalizedURL, bLockFile );
}
-#if OSL_DEBUG_LEVEL>0
+#if OSL_DEBUG_LEVEL > 0
catch(const css::uno::Exception& ex)
{
::rtl::OUStringBuffer sMsg(256);
sMsg.appendAscii("Invalid MediaDescriptor detected:\n");
sMsg.append (ex.Message );
- OSL_ENSURE(sal_False, ::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr());
+ OSL_FAIL(::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr());
}
#else
catch(const css::uno::Exception&)
@@ -625,15 +608,12 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile )
return sal_False;
}
-/*-----------------------------------------------
- 25.03.2004 12:38
------------------------------------------------*/
sal_Bool MediaDescriptor::impl_openStreamWithPostData( const css::uno::Reference< css::io::XInputStream >& _rxPostData )
throw(::com::sun::star::uno::RuntimeException)
{
if ( !_rxPostData.is() )
throw css::lang::IllegalArgumentException(
- ::rtl::OUString::createFromAscii("Found invalid PostData."),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Found invalid PostData." )),
css::uno::Reference< css::uno::XInterface >(), 1);
// PostData can't be used in read/write mode!
@@ -651,7 +631,7 @@ sal_Bool MediaDescriptor::impl_openStreamWithPostData( const css::uno::Reference
::rtl::OUString sMediaType = getUnpackedValueOrDefault(MediaDescriptor::PROP_MEDIATYPE(), ::rtl::OUString());
if (!sMediaType.getLength())
{
- sMediaType = ::rtl::OUString::createFromAscii("application/x-www-form-urlencoded");
+ sMediaType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-www-form-urlencoded" ));
(*this)[MediaDescriptor::PROP_MEDIATYPE()] <<= sMediaType;
}
@@ -690,7 +670,7 @@ sal_Bool MediaDescriptor::impl_openStreamWithPostData( const css::uno::Reference
// success?
if ( !xResultStream.is() )
{
- OSL_ENSURE( false, "no valid reply to the HTTP-Post" );
+ OSL_FAIL( "no valid reply to the HTTP-Post" );
return sal_False;
}
@@ -699,10 +679,6 @@ sal_Bool MediaDescriptor::impl_openStreamWithPostData( const css::uno::Reference
}
/*-----------------------------------------------*/
-
-/*-----------------------------------------------
- 25.03.2004 12:29
------------------------------------------------*/
sal_Bool MediaDescriptor::impl_openStreamWithURL( const ::rtl::OUString& sURL, sal_Bool bLockFile )
throw(::com::sun::star::uno::RuntimeException)
{
@@ -838,9 +814,6 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const ::rtl::OUString& sURL, s
return xInputStream.is();
}
-/*-----------------------------------------------
- 10.09.2004 10:51
------------------------------------------------*/
::rtl::OUString MediaDescriptor::impl_normalizeURL(const ::rtl::OUString& sURL)
{
/* Remove Jumpmarks (fragments) of an URL only here.
@@ -853,7 +826,7 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const ::rtl::OUString& sURL, s
it parses the URL in another way. It's main part isnt enough
and it's complete part contains the jumpmark (fragment) parameter ...
*/
- static ::rtl::OUString SERVICENAME_URIREFERENCEFACTORY = ::rtl::OUString::createFromAscii("com.sun.star.uri.UriReferenceFactory");
+ static ::rtl::OUString SERVICENAME_URIREFERENCEFACTORY( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.uri.UriReferenceFactory" ));
try
{
@@ -878,3 +851,4 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const ::rtl::OUString& sURL, s
} // namespace comphelper
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */