diff options
author | Ricardo Montania <ricardo@linuxafundo.com.br> | 2012-09-13 13:05:31 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-09-13 23:58:31 +0000 |
commit | 45c86d8a7b86315240fe6764f2c89e9499bf4e20 (patch) | |
tree | 30598e77145b2936ef9f71f4c489c8485bf9fd3a | |
parent | 9302520ff445d9789859f501b8bd6bc32c300e26 (diff) |
More ::rtl::OUString to OUString and RTL_CONSTASCII in avmedia
Change-Id: I925862289cf5f9f41af5532bbbaf8ec0a4e5a66b
Reviewed-on: https://gerrit.libreoffice.org/610
Reviewed-by: Olivier Hallot <olivier.hallot@alta.org.br>
Tested-by: Olivier Hallot <olivier.hallot@alta.org.br>
-rw-r--r-- | avmedia/source/framework/mediaitem.cxx | 51 | ||||
-rw-r--r-- | avmedia/source/framework/mediaplayer.cxx | 6 | ||||
-rw-r--r-- | avmedia/source/framework/mediatoolbox.cxx | 6 |
3 files changed, 29 insertions, 34 deletions
diff --git a/avmedia/source/framework/mediaitem.cxx b/avmedia/source/framework/mediaitem.cxx index 2dda7a912212..014ea2dabc7c 100644 --- a/avmedia/source/framework/mediaitem.cxx +++ b/avmedia/source/framework/mediaitem.cxx @@ -59,8 +59,8 @@ TYPEINIT1_AUTOFACTORY( MediaItem, ::SfxPoolItem ); struct MediaItem::Impl { - ::rtl::OUString m_URL; - ::rtl::OUString m_TempFileURL; + OUString m_URL; + OUString m_TempFileURL; sal_uInt32 m_nMaskSet; MediaState m_eState; double m_fTime; @@ -243,22 +243,22 @@ sal_uInt32 MediaItem::getMaskSet() const //------------------------------------------------------------------------ -void MediaItem::setURL( const ::rtl::OUString& rURL, - ::rtl::OUString const*const pTempURL) +void MediaItem::setURL( const OUString& rURL, + OUString const*const pTempURL) { m_pImpl->m_URL = rURL; m_pImpl->m_nMaskSet |= AVMEDIA_SETMASK_URL; - m_pImpl->m_TempFileURL = (pTempURL) ? *pTempURL : ::rtl::OUString(); + m_pImpl->m_TempFileURL = (pTempURL) ? *pTempURL : OUString(); } //------------------------------------------------------------------------ -const ::rtl::OUString& MediaItem::getURL() const +const OUString& MediaItem::getURL() const { return m_pImpl->m_URL; } -const ::rtl::OUString& MediaItem::getTempURL() const +const OUString& MediaItem::getTempURL() const { return m_pImpl->m_TempFileURL; } @@ -370,18 +370,17 @@ void MediaItem::setZoom( ::com::sun::star::media::ZoomLevel eZoom ) //------------------------------------------------------------------------ -static ::rtl::OUString lcl_GetFilename(::rtl::OUString const& rSourceURL) +static OUString lcl_GetFilename(OUString const& rSourceURL) { uno::Reference<uri::XUriReferenceFactory> const xUriFactory( ::comphelper::createProcessComponent( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.uri.UriReferenceFactory"))), + "com.sun.star.uri.UriReferenceFactory"), uno::UNO_QUERY_THROW); uno::Reference<uri::XUriReference> const xSourceURI( xUriFactory->parse(rSourceURL), uno::UNO_SET_THROW); - ::rtl::OUString filename; + OUString filename; { sal_Int32 const nSegments(xSourceURI->getPathSegmentCount()); if (0 < nSegments) @@ -392,21 +391,21 @@ static ::rtl::OUString lcl_GetFilename(::rtl::OUString const& rSourceURL) if (!::comphelper::OStorageHelper::IsValidZipEntryFileName( filename, false) || !filename.getLength()) { - filename = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("media")); + filename = "media"; } return filename; } static uno::Reference<io::XStream> lcl_CreateStream(uno::Reference<embed::XStorage> const& xStorage, - ::rtl::OUString const& rFilename) + OUString const& rFilename) { - ::rtl::OUString filename(rFilename); + OUString filename(rFilename); if (xStorage->hasByName(filename)) { - ::rtl::OUString basename; - ::rtl::OUString suffix; + OUString basename; + OUString suffix; sal_Int32 const nIndex(rFilename.lastIndexOf(sal_Unicode('.'))); if (0 < nIndex) { @@ -417,7 +416,7 @@ lcl_CreateStream(uno::Reference<embed::XStorage> const& xStorage, do { ++count; - filename = basename + ::rtl::OUString::valueOf(count) + suffix; + filename = basename + OUString::valueOf(count) + suffix; } while (xStorage->hasByName(filename)); } @@ -429,21 +428,18 @@ lcl_CreateStream(uno::Reference<embed::XStorage> const& xStorage, uno::Reference< beans::XPropertySet > const xStreamProps(xStream, uno::UNO_QUERY); if (xStreamProps.is()) { // this is NOT supported in FileSystemStorage - xStreamProps->setPropertyValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), - uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + xStreamProps->setPropertyValue("MediaType", uno::makeAny(OUString( //FIXME how to detect real media type? //but currently xmloff has this one hardcoded anyway... - "application/vnd.sun.star.media")))); + "application/vnd.sun.star.media"))); xStreamProps->setPropertyValue( // turn off compression - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed")), - uno::makeAny(sal_False)); + "Compressed", uno::makeAny(sal_False)); } return xStream; } bool EmbedMedia(uno::Reference<frame::XModel> const& xModel, - ::rtl::OUString const& rSourceURL, ::rtl::OUString & o_rEmbeddedURL) + OUString const& rSourceURL, OUString & o_rEmbeddedURL) { try { @@ -455,11 +451,11 @@ bool EmbedMedia(uno::Reference<frame::XModel> const& xModel, uno::Reference<embed::XStorage> const xStorage( xSBD->getDocumentStorage(), uno::UNO_QUERY_THROW); - ::rtl::OUString const media(RTL_CONSTASCII_USTRINGPARAM("Media")); + OUString const media("Media"); uno::Reference<embed::XStorage> const xSubStorage( xStorage->openStorageElement(media, embed::ElementModes::WRITE)); - ::rtl::OUString filename(lcl_GetFilename(rSourceURL)); + OUString filename(lcl_GetFilename(rSourceURL)); uno::Reference<io::XStream> const xStream( lcl_CreateStream(xSubStorage, filename), uno::UNO_SET_THROW); @@ -483,8 +479,7 @@ bool EmbedMedia(uno::Reference<frame::XModel> const& xModel, xTransaction->commit(); } - ::rtl::OUStringBuffer buf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "vnd.sun.star.Package:"))); + OUStringBuffer buf("vnd.sun.star.Package:"); buf.append(media); buf.append(sal_Unicode('/')); buf.append(filename); diff --git a/avmedia/source/framework/mediaplayer.cxx b/avmedia/source/framework/mediaplayer.cxx index c6b35df0e4f1..a6ef89a15805 100644 --- a/avmedia/source/framework/mediaplayer.cxx +++ b/avmedia/source/framework/mediaplayer.cxx @@ -132,7 +132,7 @@ void MediaFloater::ToggleFloatingMode() // ----------------------------------------------------------------------------- -void MediaFloater::setURL( const ::rtl::OUString& rURL, bool bPlayImmediately ) +void MediaFloater::setURL( const OUString& rURL, bool bPlayImmediately ) { if( mpMediaWindow ) { @@ -145,9 +145,9 @@ void MediaFloater::setURL( const ::rtl::OUString& rURL, bool bPlayImmediately ) // ----------------------------------------------------------------------------- -const ::rtl::OUString& MediaFloater::getURL() const +const OUString& MediaFloater::getURL() const { - static const ::rtl::OUString aEmptyStr; + static const OUString aEmptyStr; return( mpMediaWindow ? mpMediaWindow->getURL() : aEmptyStr ); } diff --git a/avmedia/source/framework/mediatoolbox.cxx b/avmedia/source/framework/mediatoolbox.cxx index cb795692011b..44837ac88fac 100644 --- a/avmedia/source/framework/mediatoolbox.cxx +++ b/avmedia/source/framework/mediatoolbox.cxx @@ -147,7 +147,7 @@ Window* MediaToolBoxControl::CreateItemWindow( Window *pParent ) void MediaToolBoxControl::implUpdateMediaControl() { - updateStatus( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AVMediaToolBox" ) ) ); + updateStatus( ".uno:AVMediaToolBox" ); } // ----------------------------------------------------------------------------- @@ -160,10 +160,10 @@ void MediaToolBoxControl::implExecuteMediaControl( const MediaItem& rItem ) aExecItem.merge( rItem ); aExecItem.QueryValue( aAny ); - aArgs[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AVMediaToolBox" ) ); + aArgs[ 0 ].Name = "AVMediaToolBox" ; aArgs[ 0 ].Value = aAny; - Dispatch( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AVMediaToolBox" ) ), aArgs ); + Dispatch( ".uno:AVMediaToolBox" , aArgs ); } } |