diff options
Diffstat (limited to 'embeddedobj/source/msole')
-rw-r--r-- | embeddedobj/source/msole/graphconvert.cxx | 8 | ||||
-rw-r--r-- | embeddedobj/source/msole/olecomponent.cxx | 46 | ||||
-rw-r--r-- | embeddedobj/source/msole/oleembed.cxx | 38 | ||||
-rw-r--r-- | embeddedobj/source/msole/olemisc.cxx | 7 | ||||
-rw-r--r-- | embeddedobj/source/msole/olepersist.cxx | 154 | ||||
-rw-r--r-- | embeddedobj/source/msole/olevisual.cxx | 30 | ||||
-rw-r--r-- | embeddedobj/source/msole/ownview.cxx | 28 | ||||
-rw-r--r-- | embeddedobj/source/msole/xdialogcreator.cxx | 34 | ||||
-rw-r--r-- | embeddedobj/source/msole/xolefactory.cxx | 26 |
9 files changed, 162 insertions, 209 deletions
diff --git a/embeddedobj/source/msole/graphconvert.cxx b/embeddedobj/source/msole/graphconvert.cxx index 0642d66f383d..f177f19be449 100644 --- a/embeddedobj/source/msole/graphconvert.cxx +++ b/embeddedobj/source/msole/graphconvert.cxx @@ -63,11 +63,11 @@ sal_Bool ConvertBufferToFormat( void* pBuf, uno::Reference < io::XInputStream > xIn = new comphelper::SequenceInputStream( aData ); try { - uno::Reference < graphic::XGraphicProvider > xGraphicProvider( comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.graphic.GraphicProvider") ), uno::UNO_QUERY ); + uno::Reference < graphic::XGraphicProvider > xGraphicProvider( comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.graphic.GraphicProvider")) ), uno::UNO_QUERY ); if( xGraphicProvider.is() ) { uno::Sequence< beans::PropertyValue > aMediaProperties( 1 ); - aMediaProperties[0].Name = ::rtl::OUString::createFromAscii( "InputStream" ); + aMediaProperties[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "InputStream" )); aMediaProperties[0].Value <<= xIn; uno::Reference< graphic::XGraphic > xGraphic( xGraphicProvider->queryGraphic( aMediaProperties ) ); if( xGraphic.is() ) @@ -76,9 +76,9 @@ sal_Bool ConvertBufferToFormat( void* pBuf, // uno::Reference < io::XOutputStream > xOut = new utl::OOutputStreamHelper( aNewStream.GetLockBytes() ); uno::Reference < io::XStream > xOut = new utl::OStreamWrapper( aNewStream ); uno::Sequence< beans::PropertyValue > aOutMediaProperties( 2 ); - aOutMediaProperties[0].Name = ::rtl::OUString::createFromAscii( "OutputStream" ); + aOutMediaProperties[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OutputStream" )); aOutMediaProperties[0].Value <<= xOut; - aOutMediaProperties[1].Name = ::rtl::OUString::createFromAscii( "MimeType" ); + aOutMediaProperties[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MimeType" )); aOutMediaProperties[1].Value <<= aMimeType; xGraphicProvider->storeGraphic( xGraphic, aOutMediaProperties ); diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx index ac0b05fd96fa..616e3fc17d36 100644 --- a/embeddedobj/source/msole/olecomponent.cxx +++ b/embeddedobj/source/msole/olecomponent.cxx @@ -198,28 +198,28 @@ struct OleComponentNative_Impl { m_aSupportedGraphFormats.realloc( 5 ); m_aSupportedGraphFormats[0] = datatransfer::DataFlavor( - ::rtl::OUString::createFromAscii( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ), - ::rtl::OUString::createFromAscii( "Windows Enhanced Metafile" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Windows Enhanced Metafile" )), getCppuType( (const uno::Sequence< sal_Int8 >*) 0 ) ); m_aSupportedGraphFormats[1] = datatransfer::DataFlavor( - ::rtl::OUString::createFromAscii( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ), - ::rtl::OUString::createFromAscii( "Windows Metafile" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Windows Metafile" )), getCppuType( (const uno::Sequence< sal_Int8 >*) 0 ) ); m_aSupportedGraphFormats[2] = datatransfer::DataFlavor( - ::rtl::OUString::createFromAscii( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" ), - ::rtl::OUString::createFromAscii( "Bitmap" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Bitmap" )), getCppuType( (const uno::Sequence< sal_Int8 >*) 0 ) ); m_aSupportedGraphFormats[3] = datatransfer::DataFlavor( - ::rtl::OUString::createFromAscii( "image/png" ), - ::rtl::OUString::createFromAscii( "PNG" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "image/png" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PNG" )), getCppuType( (const uno::Sequence< sal_Int8 >*) 0 ) ); m_aSupportedGraphFormats[0] = datatransfer::DataFlavor( - ::rtl::OUString::createFromAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ), - ::rtl::OUString::createFromAscii( "GDIMetafile" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "GDIMetafile" )), getCppuType( (const uno::Sequence< sal_Int8 >*) 0 ) ); } @@ -239,11 +239,11 @@ struct OleComponentNative_Impl { //---------------------------------------------- DWORD GetAspectFromFlavor( const datatransfer::DataFlavor& aFlavor ) { - if ( aFlavor.MimeType.indexOf( ::rtl::OUString::createFromAscii( ";Aspect=THUMBNAIL" ) ) != -1 ) + if ( aFlavor.MimeType.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ";Aspect=THUMBNAIL" )) ) != -1 ) return DVASPECT_THUMBNAIL; - else if ( aFlavor.MimeType.indexOf( ::rtl::OUString::createFromAscii( ";Aspect=ICON" ) ) != -1 ) + else if ( aFlavor.MimeType.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ";Aspect=ICON" )) ) != -1 ) return DVASPECT_ICON; - else if ( aFlavor.MimeType.indexOf( ::rtl::OUString::createFromAscii( ";Aspect=DOCPRINT" ) ) != -1 ) + else if ( aFlavor.MimeType.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ";Aspect=DOCPRINT" )) ) != -1 ) return DVASPECT_DOCPRINT; else return DVASPECT_CONTENT; @@ -255,11 +255,11 @@ DWORD GetAspectFromFlavor( const datatransfer::DataFlavor& aFlavor ) ::rtl::OUString aResult; if ( nAsp == DVASPECT_THUMBNAIL ) - aResult = ::rtl::OUString::createFromAscii( ";Aspect=THUMBNAIL" ); + aResult = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ";Aspect=THUMBNAIL" )); else if ( nAsp == DVASPECT_ICON ) - aResult = ::rtl::OUString::createFromAscii( ";Aspect=ICON" ); + aResult = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ";Aspect=ICON" )); else if ( nAsp == DVASPECT_DOCPRINT ) - aResult = ::rtl::OUString::createFromAscii( ";Aspect=DOCPRINT" ); + aResult = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ";Aspect=DOCPRINT" )); // no suffix for DVASPECT_CONTENT @@ -301,7 +301,7 @@ sal_Bool OleComponentNative_Impl::ConvertDataForFlavor( const STGMEDIUM& aMedium if ( aMedium.tymed == TYMED_MFPICT ) // Win Metafile { - aFormat = ::rtl::OUString::createFromAscii("image/x-wmf"); + aFormat = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/x-wmf")); METAFILEPICT* pMF = ( METAFILEPICT* )GlobalLock( aMedium.hMetaFilePict ); if ( pMF ) { @@ -332,7 +332,7 @@ sal_Bool OleComponentNative_Impl::ConvertDataForFlavor( const STGMEDIUM& aMedium } else if ( aMedium.tymed == TYMED_ENHMF ) // Enh Metafile { - aFormat = ::rtl::OUString::createFromAscii("image/x-emf"); + aFormat = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/x-emf")); nBufSize = GetEnhMetaFileBits( aMedium.hEnhMetaFile, 0, NULL ); pBuf = new unsigned char[nBufSize]; if ( nBufSize && nBufSize == GetEnhMetaFileBits( aMedium.hEnhMetaFile, nBufSize, pBuf ) ) @@ -346,7 +346,7 @@ sal_Bool OleComponentNative_Impl::ConvertDataForFlavor( const STGMEDIUM& aMedium } else if ( aMedium.tymed == TYMED_GDI ) // Bitmap { - aFormat = ::rtl::OUString::createFromAscii("image/x-MS-bmp"); + aFormat = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/x-MS-bmp")); nBufSize = GetBitmapBits( aMedium.hBitmap, 0, NULL ); pBuf = new unsigned char[nBufSize]; if ( nBufSize && nBufSize == sal::static_int_cast< ULONG >( GetBitmapBits( aMedium.hBitmap, nBufSize, pBuf ) ) ) @@ -417,7 +417,7 @@ sal_Bool GetClassIDFromSequence_Impl( uno::Sequence< sal_Int8 > aSeq, CLSID& aRe { if ( *pStr == '&' ) { - aResult += ::rtl::OUString::createFromAscii( "~" ); + aResult += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "~" )); while( *( ++pStr ) == '&' ); } else @@ -1420,7 +1420,7 @@ void OleComponent::OnViewChange_Impl( sal_uInt32 dwAspect ) { uno::Reference < awt::XRequestCallback > xRequestCallback( m_xFactory->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.awt.AsyncCallback") ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.AsyncCallback") )), uno::UNO_QUERY ); xRequestCallback->addCallback( new MainThreadNotificationRequest( xLockObject, OLECOMP_ONVIEWCHANGE, dwAspect ), uno::Any() ); } @@ -1441,7 +1441,7 @@ void OleComponent::OnClose_Impl() { uno::Reference < awt::XRequestCallback > xRequestCallback( m_xFactory->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.awt.AsyncCallback") ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.AsyncCallback") )), uno::UNO_QUERY ); xRequestCallback->addCallback( new MainThreadNotificationRequest( xLockObject, OLECOMP_ONCLOSE ), uno::Any() ); } @@ -1604,7 +1604,7 @@ uno::Any SAL_CALL OleComponent::getTransferData( const datatransfer::DataFlavor& // allow to retrieve stream-representation of the object persistence bSupportedFlavor = sal_True; uno::Reference < io::XStream > xTempFileStream( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )), uno::UNO_QUERY ); if ( !xTempFileStream.is() ) diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index 2f077a44f3af..c441693f4917 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -287,7 +287,7 @@ sal_Bool OleEmbeddedObject::TryToConvertToOOo() || aFilterName.equals( ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM( "MS Word 2007 XML" ) ) ) ) ) { uno::Reference< container::XNameAccess > xFilterFactory( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.document.FilterFactory" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" ) )), uno::UNO_QUERY_THROW ); ::rtl::OUString aDocServiceName; @@ -313,21 +313,21 @@ sal_Bool OleEmbeddedObject::TryToConvertToOOo() // let the model behave as embedded one uno::Reference< frame::XModel > xModel( xDocument, uno::UNO_QUERY_THROW ); uno::Sequence< beans::PropertyValue > aSeq( 1 ); - aSeq[0].Name = ::rtl::OUString::createFromAscii( "SetEmbedded" ); + aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "SetEmbedded" )); aSeq[0].Value <<= sal_True; xModel->attachResource( ::rtl::OUString(), aSeq ); // load the model from the stream uno::Sequence< beans::PropertyValue > aArgs( 5 ); - aArgs[0].Name = ::rtl::OUString::createFromAscii( "HierarchicalDocumentName" ); + aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "HierarchicalDocumentName" )); aArgs[0].Value <<= m_aEntryName; - aArgs[1].Name = ::rtl::OUString::createFromAscii( "ReadOnly" ); + aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ReadOnly" )); aArgs[1].Value <<= sal_True; - aArgs[2].Name = ::rtl::OUString::createFromAscii( "FilterName" ); + aArgs[2].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName" )); aArgs[2].Value <<= aFilterName; - aArgs[3].Name = ::rtl::OUString::createFromAscii( "URL" ); - aArgs[3].Value <<= ::rtl::OUString::createFromAscii( "private:stream" ); - aArgs[4].Name = ::rtl::OUString::createFromAscii( "InputStream" ); + aArgs[3].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "URL" )); + aArgs[3].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "private:stream" )); + aArgs[4].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "InputStream" )); aArgs[4].Value <<= m_xObjectStream->getInputStream(); xSeekable->seek( 0 ); @@ -339,7 +339,7 @@ sal_Bool OleEmbeddedObject::TryToConvertToOOo() xDocument->close( sal_True ); uno::Reference< beans::XPropertySet > xStorProps( xTmpStorage, uno::UNO_QUERY_THROW ); ::rtl::OUString aMediaType; - xStorProps->getPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ) ) >>= aMediaType; + xStorProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MediaType" )) ) >>= aMediaType; xTmpStorage->dispose(); // look for the related embedded object factory @@ -475,7 +475,7 @@ void SAL_CALL OleEmbeddedObject::changeState( sal_Int32 nNewState ) throw lang::DisposedException(); // TODO if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object has no persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); // in case the object is already in requested state @@ -632,7 +632,7 @@ uno::Sequence< sal_Int32 > SAL_CALL OleEmbeddedObject::getReachableStates() throw lang::DisposedException(); // TODO if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object has no persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); #ifdef WNT @@ -674,7 +674,7 @@ sal_Int32 SAL_CALL OleEmbeddedObject::getCurrentState() throw lang::DisposedException(); // TODO if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object has no persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); // TODO: Shouldn't we ask object? ( I guess no ) @@ -785,7 +785,7 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID ) throw lang::DisposedException(); // TODO if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object has no persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); #ifdef WNT @@ -921,7 +921,7 @@ uno::Sequence< embed::VerbDescriptor > SAL_CALL OleEmbeddedObject::getSupportedV throw lang::DisposedException(); // TODO if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object has no persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); #ifdef WNT if ( m_pOleComponent ) @@ -966,7 +966,7 @@ void SAL_CALL OleEmbeddedObject::setClientSite( { if ( m_nObjectState != embed::EmbedStates::LOADED && m_nObjectState != embed::EmbedStates::RUNNING ) throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The client site can not be set currently!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The client site can not be set currently!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); m_xClientSite = xClient; @@ -992,7 +992,7 @@ uno::Reference< embed::XEmbeddedClient > SAL_CALL OleEmbeddedObject::getClientSi throw lang::DisposedException(); // TODO if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object has no persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); return m_xClientSite; @@ -1019,7 +1019,7 @@ void SAL_CALL OleEmbeddedObject::update() throw lang::DisposedException(); // TODO if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object has no persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); if ( m_nUpdateMode == embed::EmbedUpdateModes::EXPLICIT_UPDATE ) @@ -1053,7 +1053,7 @@ void SAL_CALL OleEmbeddedObject::setUpdateMode( sal_Int32 nMode ) throw lang::DisposedException(); // TODO if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object has no persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); OSL_ENSURE( nMode == embed::EmbedUpdateModes::ALWAYS_UPDATE @@ -1083,7 +1083,7 @@ sal_Int64 SAL_CALL OleEmbeddedObject::getStatus( sal_Int64 throw lang::DisposedException(); // TODO if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object must be in running state!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object must be in running state!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); sal_Int64 nResult = 0; diff --git a/embeddedobj/source/msole/olemisc.cxx b/embeddedobj/source/msole/olemisc.cxx index 1fb2e8977d4c..016115fd45fe 100644 --- a/embeddedobj/source/msole/olemisc.cxx +++ b/embeddedobj/source/msole/olemisc.cxx @@ -387,15 +387,10 @@ uno::Reference< util::XCloseable > SAL_CALL OleEmbeddedObject::getComponent() if ( m_nObjectState == -1 ) // || m_nObjectState == embed::EmbedStates::LOADED ) { // the object is still not running - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object is not loaded!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object is not loaded!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } - // if ( m_bWaitSaveCompleted ) - // throw embed::WrongStateException( - // ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), - // uno::Reference< uno::XInterface >( reinterpret_cast< ::cppu::OWeakObject* >(this) ) ); - if ( !m_pOleComponent ) { // TODO/LATER: Is it correct??? diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx index 68a3a057edc4..14e670acd06e 100644 --- a/embeddedobj/source/msole/olepersist.cxx +++ b/embeddedobj/source/msole/olepersist.cxx @@ -73,7 +73,7 @@ sal_Bool KillFile_Impl( const ::rtl::OUString& aURL, const uno::Reference< lang: { uno::Reference < ucb::XSimpleFileAccess > xAccess( xFactory->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" ) )), uno::UNO_QUERY ); if ( xAccess.is() ) @@ -97,15 +97,15 @@ sal_Bool KillFile_Impl( const ::rtl::OUString& aURL, const uno::Reference< lang: ::rtl::OUString aResult; uno::Reference < beans::XPropertySet > xTempFile( - xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )), uno::UNO_QUERY ); if ( !xTempFile.is() ) throw uno::RuntimeException(); // TODO try { - xTempFile->setPropertyValue( ::rtl::OUString::createFromAscii( "RemoveFile" ), uno::makeAny( sal_False ) ); - uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString::createFromAscii( "Uri" ) ); + xTempFile->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RemoveFile" )), uno::makeAny( sal_False ) ); + uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Uri" ) )); aUrl >>= aResult; } catch ( uno::Exception& ) @@ -133,7 +133,7 @@ sal_Bool KillFile_Impl( const ::rtl::OUString& aURL, const uno::Reference< lang: try { uno::Reference < ucb::XSimpleFileAccess > xTempAccess( xFactory->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" ) )), uno::UNO_QUERY ); if ( !xTempAccess.is() ) @@ -183,14 +183,14 @@ sal_Bool KillFile_Impl( const ::rtl::OUString& aURL, const uno::Reference< lang: try { uno::Reference < beans::XPropertySet > xTempFile( - xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )), uno::UNO_QUERY ); uno::Reference < io::XStream > xTempStream( xTempFile, uno::UNO_QUERY_THROW ); xParentStorage->copyStreamElementData( aEntryName, xTempStream ); - xTempFile->setPropertyValue( ::rtl::OUString::createFromAscii( "RemoveFile" ), uno::makeAny( sal_False ) ); - uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString::createFromAscii( "Uri" ) ); + xTempFile->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RemoveFile" )), uno::makeAny( sal_False ) ); + uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Uri" ) )); aUrl >>= aResult; } catch( uno::RuntimeException& ) @@ -214,7 +214,7 @@ void SetStreamMediaType_Impl( const uno::Reference< io::XStream >& xStream, cons if ( !xPropSet.is() ) throw uno::RuntimeException(); // TODO: all the storage streams must support XPropertySet - xPropSet->setPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ), uno::makeAny( aMediaType ) ); + xPropSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MediaType" )), uno::makeAny( aMediaType ) ); } #endif //------------------------------------------------------ @@ -224,7 +224,7 @@ void LetCommonStoragePassBeUsed_Impl( const uno::Reference< io::XStream >& xStre if ( !xPropSet.is() ) throw uno::RuntimeException(); // Only StorageStreams must be provided here, they must implement the interface - xPropSet->setPropertyValue( ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" ), + xPropSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" )), uno::makeAny( (sal_Bool)sal_True ) ); } #ifdef WNT @@ -289,7 +289,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::GetNewFilledTempStream_Impl( co OSL_ENSURE( xInStream.is(), "Wrong parameter is provided!\n" ); uno::Reference < io::XStream > xTempFile( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )), uno::UNO_QUERY_THROW ); uno::Reference< io::XOutputStream > xTempOutStream = xTempFile->getOutputStream(); @@ -381,7 +381,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToGetAcceptableFormat_Impl( { // this is either a bitmap or a metafile clipboard format, retrieve the pure stream uno::Reference < io::XStream > xResult( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )), uno::UNO_QUERY_THROW ); uno::Reference < io::XSeekable > xResultSeek( xResult, uno::UNO_QUERY_THROW ); uno::Reference < io::XOutputStream > xResultOut = xResult->getOutputStream(); @@ -389,48 +389,6 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToGetAcceptableFormat_Impl( if ( !xResultOut.is() || !xResultIn.is() ) throw uno::RuntimeException(); - // if it is windows metafile the size must be provided - // the solution is not used currently -// if ( bSetSizeToRepl && abs( aSizeToSet.Width ) < 0xFFFF && abs( aSizeToSet.Height ) < 0xFFFF ) -// { -// uno::Sequence< sal_Int8 > aHeader(22); -// sal_uInt8* pBuffer = (sal_uInt8*)aHeader.getArray(); -// -// // write 0x9ac6cdd7L -// pBuffer[0] = 0xd7; -// pBuffer[1] = 0xcd; -// pBuffer[2] = 0xc6; -// pBuffer[3] = 0x9a; -// -// // following data seems to have no value -// pBuffer[4] = 0; -// pBuffer[5] = 0; -// -// // must be set to 0 -// pBuffer[6] = 0; -// pBuffer[7] = 0; -// pBuffer[8] = 0; -// pBuffer[9] = 0; -// -// // width of the picture -// pBuffer[10] = abs( aSizeToSet.Width ) % 0x100; -// pBuffer[11] = ( abs( aSizeToSet.Width ) / 0x100 ) % 0x100; -// -// // height of the picture -// pBuffer[12] = abs( aSizeToSet.Height ) % 0x100; -// pBuffer[13] = ( abs( aSizeToSet.Height ) / 0x100 ) % 0x100; -// -// // write 2540 -// pBuffer[14] = 0x6c; //0xec; -// pBuffer[15] = 0x01; //0x09; -// -// // fill with 0 -// for ( sal_Int32 nInd = 16; nInd < 22; nInd++ ) -// pBuffer[nInd] = 0; -// -// xResultOut->writeBytes( aHeader ); -// } - xSeek->seek( nHeaderOffset ); // header size for these formats ::comphelper::OStorageHelper::CopyInputToOutput( xInStream, xResultOut ); xResultOut->closeOutput(); @@ -459,7 +417,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea uno::Reference< container::XNameContainer > xNameContainer( m_xFactory->createInstanceWithArguments( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.OLESimpleStorage" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLESimpleStorage" )), aArgs ), uno::UNO_QUERY ); @@ -471,7 +429,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea xCachedSeek->seek( 0 ); uno::Reference < io::XStream > xTempFile( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )), uno::UNO_QUERY_THROW ); uno::Reference< io::XSeekable > xTempSeek( xTempFile, uno::UNO_QUERY_THROW ); @@ -582,7 +540,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea throw io::IOException(); // TODO: // insert the result file as replacement image - ::rtl::OUString aCacheName = ::rtl::OUString::createFromAscii( "\002OlePres000" ); + ::rtl::OUString aCacheName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "\002OlePres000" )); if ( xNameContainer->hasByName( aCacheName ) ) xNameContainer->replaceByName( aCacheName, uno::makeAny( xTempFile ) ); else @@ -608,7 +566,7 @@ void OleEmbeddedObject::RemoveVisualCache_Impl( const uno::Reference< io::XStrea aArgs[1] <<= (sal_Bool)sal_True; // do not create copy uno::Reference< container::XNameContainer > xNameContainer( m_xFactory->createInstanceWithArguments( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.OLESimpleStorage" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLESimpleStorage" )), aArgs ), uno::UNO_QUERY ); @@ -617,7 +575,7 @@ void OleEmbeddedObject::RemoveVisualCache_Impl( const uno::Reference< io::XStrea for ( sal_uInt8 nInd = 0; nInd < 10; nInd++ ) { - ::rtl::OUString aStreamName = ::rtl::OUString::createFromAscii( "\002OlePres00" ); + ::rtl::OUString aStreamName(RTL_CONSTASCII_USTRINGPARAM( "\002OlePres00" )); aStreamName += ::rtl::OUString::valueOf( (sal_Int32)nInd ); if ( xNameContainer->hasByName( aStreamName ) ) xNameContainer->removeByName( aStreamName ); @@ -658,7 +616,7 @@ sal_Bool OleEmbeddedObject::HasVisReplInStream() // open temporary file for reading uno::Reference < ucb::XSimpleFileAccess > xTempAccess( m_xFactory->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" ) )), uno::UNO_QUERY ); if ( !xTempAccess.is() ) @@ -682,7 +640,7 @@ sal_Bool OleEmbeddedObject::HasVisReplInStream() aArgs[1] <<= (sal_Bool)sal_True; // do not create copy uno::Reference< container::XNameContainer > xNameContainer( m_xFactory->createInstanceWithArguments( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.OLESimpleStorage" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLESimpleStorage" )), aArgs ), uno::UNO_QUERY ); @@ -690,7 +648,7 @@ sal_Bool OleEmbeddedObject::HasVisReplInStream() { for ( sal_uInt8 nInd = 0; nInd < 10 && !bExists; nInd++ ) { - ::rtl::OUString aStreamName = ::rtl::OUString::createFromAscii( "\002OlePres00" ); + ::rtl::OUString aStreamName(RTL_CONSTASCII_USTRINGPARAM( "\002OlePres00" )); aStreamName += ::rtl::OUString::valueOf( (sal_Int32)nInd ); try { @@ -729,7 +687,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToRetrieveCachedVisualRepres { xNameContainer = uno::Reference< container::XNameContainer >( m_xFactory->createInstanceWithArguments( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.OLESimpleStorage" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLESimpleStorage" )), aArgs ), uno::UNO_QUERY ); } @@ -740,7 +698,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToRetrieveCachedVisualRepres { for ( sal_uInt8 nInd = 0; nInd < 10; nInd++ ) { - ::rtl::OUString aStreamName = ::rtl::OUString::createFromAscii( "\002OlePres00" ); + ::rtl::OUString aStreamName(RTL_CONSTASCII_USTRINGPARAM( "\002OlePres00" )); aStreamName += ::rtl::OUString::valueOf( (sal_Int32)nInd ); uno::Reference< io::XStream > xCachedCopyStream; try @@ -956,7 +914,7 @@ sal_Bool OleEmbeddedObject::OnShowWindow_Impl( sal_Bool bShow ) void OleEmbeddedObject::OnIconChanged_Impl() { // TODO/LATER: currently this notification seems to be impossible - // MakeEventListenerNotification_Impl( ::rtl::OUString::createFromAscii( "OnIconChanged" ) ); + // MakeEventListenerNotification_Impl( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OnIconChanged" )) ); } //------------------------------------------------------ @@ -986,7 +944,7 @@ void OleEmbeddedObject::OnViewChanged_Impl() // The view is changed while the object is in running state, save the new object m_xCachedVisualRepresentation = uno::Reference< io::XStream >(); SaveObject_Impl(); - MakeEventListenerNotification_Impl( ::rtl::OUString::createFromAscii( "OnVisAreaChanged" ) ); + MakeEventListenerNotification_Impl( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" )) ); } // =============================================================== } @@ -1129,7 +1087,7 @@ void OleEmbeddedObject::StoreObjectToStream( uno::Reference< io::XOutputStream > // open temporary file for reading uno::Reference < ucb::XSimpleFileAccess > xTempAccess( m_xFactory->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" ) )), uno::UNO_QUERY ); if ( !xTempAccess.is() ) @@ -1173,13 +1131,13 @@ void OleEmbeddedObject::StoreToLocation_Impl( if ( m_nObjectState == -1 ) { // the object is still not loaded - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "Can't store object without persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Can't store object without persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } if ( m_bWaitSaveCompleted ) throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object waits for saveCompleted() call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); OSL_ENSURE( m_xParentStorage.is() && m_xObjectStream.is(), "The object has no valid persistence!\n" ); @@ -1261,7 +1219,7 @@ void OleEmbeddedObject::StoreToLocation_Impl( if ( !xTargetStream.is() ) throw io::IOException(); //TODO: access denied - SetStreamMediaType_Impl( xTargetStream, ::rtl::OUString::createFromAscii( "application/vnd.sun.star.oleobject" ) ); + SetStreamMediaType_Impl( xTargetStream, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.star.oleobject" ) )); uno::Reference< io::XOutputStream > xOutStream = xTargetStream->getOutputStream(); if ( !xOutStream.is() ) throw io::IOException(); //TODO: access denied @@ -1408,12 +1366,12 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry( throw lang::DisposedException(); // TODO if ( !xStorage.is() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No parent storage is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); if ( !sEntName.getLength() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -1428,7 +1386,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry( // it can switch persistant representation only without initialization throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "Can't change persistant representation of activated object!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Can't change persistant representation of activated object!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } @@ -1438,7 +1396,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry( saveCompleted( ( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) ) ); else throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object waits for saveCompleted() call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } @@ -1535,7 +1493,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry( if ( !aURL.getLength() ) throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii( "Empty URL is provided in the media descriptor!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty URL is provided in the media descriptor!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 4 ); @@ -1557,7 +1515,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry( //TODO: //} else - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Wrong connection mode is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Wrong connection mode is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 3 ); } @@ -1575,7 +1533,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry( // do nothing, the object has already switched it's persistence } else - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Wrong connection mode is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Wrong connection mode is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 3 ); @@ -1675,7 +1633,7 @@ void SAL_CALL OleEmbeddedObject::saveCompleted( sal_Bool bUseNew ) if ( m_nObjectState == -1 ) { // the object is still not loaded - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "Can't store object without persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Can't store object without persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } @@ -1740,13 +1698,13 @@ void SAL_CALL OleEmbeddedObject::saveCompleted( sal_Bool bUseNew ) aGuard.clear(); if ( bUseNew ) { - MakeEventListenerNotification_Impl( ::rtl::OUString::createFromAscii( "OnSaveAsDone" ) ); + MakeEventListenerNotification_Impl( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OnSaveAsDone" ) )); // the object can be changed only on windows // the notification should be done only if the object is not in loaded state if ( m_pOleComponent && m_nUpdateMode == embed::EmbedUpdateModes::ALWAYS_UPDATE && !bStoreLoaded ) { - MakeEventListenerNotification_Impl( ::rtl::OUString::createFromAscii( "OnVisAreaChanged" ) ); + MakeEventListenerNotification_Impl( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) )); } } } @@ -1771,7 +1729,7 @@ sal_Bool SAL_CALL OleEmbeddedObject::hasEntry() if ( m_bWaitSaveCompleted ) throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object waits for saveCompleted() call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); if ( m_xObjectStream.is() ) @@ -1801,13 +1759,13 @@ sal_Bool SAL_CALL OleEmbeddedObject::hasEntry() if ( m_nObjectState == -1 ) { // the object is still not loaded - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object persistence is not initialized!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object persistence is not initialized!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } if ( m_bWaitSaveCompleted ) throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object waits for saveCompleted() call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); return m_aEntryName; @@ -1846,13 +1804,13 @@ void SAL_CALL OleEmbeddedObject::storeOwn() if ( m_nObjectState == -1 ) { // the object is still not loaded - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "Can't store object without persistence!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Can't store object without persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } if ( m_bWaitSaveCompleted ) throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object waits for saveCompleted() call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); if ( m_bReadOnly ) @@ -1872,7 +1830,7 @@ void SAL_CALL OleEmbeddedObject::storeOwn() if ( !m_xObjectStream.is() ) throw io::IOException(); //TODO: access denied - SetStreamMediaType_Impl( m_xObjectStream, ::rtl::OUString::createFromAscii( "application/vnd.sun.star.oleobject" ) ); + SetStreamMediaType_Impl( m_xObjectStream, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.star.oleobject" ) )); uno::Reference< io::XOutputStream > xOutStream = m_xObjectStream->getOutputStream(); if ( !xOutStream.is() ) throw io::IOException(); //TODO: access denied @@ -1940,12 +1898,12 @@ void SAL_CALL OleEmbeddedObject::storeOwn() aGuard.clear(); - MakeEventListenerNotification_Impl( ::rtl::OUString::createFromAscii( "OnSaveDone" ) ); + MakeEventListenerNotification_Impl( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OnSaveDone" ) )); // the object can be changed only on Windows // the notification should be done only if the object is not in loaded state if ( m_pOleComponent && m_nUpdateMode == embed::EmbedUpdateModes::ALWAYS_UPDATE && !bStoreLoaded ) - MakeEventListenerNotification_Impl( ::rtl::OUString::createFromAscii( "OnVisAreaChanged" ) ); + MakeEventListenerNotification_Impl( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) )); } //------------------------------------------------------ @@ -1969,13 +1927,13 @@ sal_Bool SAL_CALL OleEmbeddedObject::isReadonly() if ( m_nObjectState == -1 ) { // the object is still not loaded - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object persistence is not initialized!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object persistence is not initialized!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } if ( m_bWaitSaveCompleted ) throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object waits for saveCompleted() call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); return m_bReadOnly; @@ -2010,13 +1968,13 @@ void SAL_CALL OleEmbeddedObject::reload( if ( m_nObjectState == -1 ) { // the object is still not loaded - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object persistence is not initialized!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object persistence is not initialized!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } if ( m_bWaitSaveCompleted ) throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object waits for saveCompleted() call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); // TODO: @@ -2049,12 +2007,12 @@ void SAL_CALL OleEmbeddedObject::breakLink( const uno::Reference< embed::XStorag throw lang::DisposedException(); // TODO if ( !xStorage.is() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No parent storage is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); if ( !sEntName.getLength() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -2063,7 +2021,7 @@ void SAL_CALL OleEmbeddedObject::breakLink( const uno::Reference< embed::XStorag { // it must be a linked initialized object throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object is not a valid linked object!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object is not a valid linked object!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } @@ -2072,7 +2030,7 @@ void SAL_CALL OleEmbeddedObject::breakLink( const uno::Reference< embed::XStorag if ( m_bWaitSaveCompleted ) throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object waits for saveCompleted() call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); @@ -2187,12 +2145,12 @@ sal_Bool SAL_CALL OleEmbeddedObject::isLink() if ( m_bWaitSaveCompleted ) throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object waits for saveCompleted() call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); if ( !m_bIsLink ) throw embed::WrongStateException( - ::rtl::OUString::createFromAscii( "The object is not a link object!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object is not a link object!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); // TODO: probably the link URL can be retrieved from OLE diff --git a/embeddedobj/source/msole/olevisual.cxx b/embeddedobj/source/msole/olevisual.cxx index 31be74774e69..cafafec515ba 100644 --- a/embeddedobj/source/msole/olevisual.cxx +++ b/embeddedobj/source/msole/olevisual.cxx @@ -65,16 +65,16 @@ embed::VisualRepresentation OleEmbeddedObject::GetVisualRepresentationInNativeFo { // it's a bitmap aVisualRepr.Flavor = datatransfer::DataFlavor( - ::rtl::OUString::createFromAscii( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" ), - ::rtl::OUString::createFromAscii( "Bitmap" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Bitmap" )), ::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) ); } else { // it's a metafile aVisualRepr.Flavor = datatransfer::DataFlavor( - ::rtl::OUString::createFromAscii( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ), - ::rtl::OUString::createFromAscii( "Windows Metafile" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Windows Metafile" )), ::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) ); } @@ -111,11 +111,11 @@ void SAL_CALL OleEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, const awt OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "Illegal call!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Illegal call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object is not loaded!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object is not loaded!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); #ifdef WNT @@ -191,11 +191,11 @@ awt::Size SAL_CALL OleEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect ) OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "Illegal call!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Illegal call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object is not loaded!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object is not loaded!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); awt::Size aResult; @@ -339,13 +339,13 @@ embed::VisualRepresentation SAL_CALL OleEmbeddedObject::getPreferredVisualRepres OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "Illegal call!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Illegal call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); // TODO: if the object has cached representation then it should be returned // TODO: if the object has no cached representation and is in loaded state it should switch itself to the running state if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object is not loaded!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object is not loaded!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); embed::VisualRepresentation aVisualRepr; @@ -372,8 +372,8 @@ embed::VisualRepresentation SAL_CALL OleEmbeddedObject::getPreferredVisualRepres changeState( embed::EmbedStates::RUNNING ); datatransfer::DataFlavor aDataFlavor( - ::rtl::OUString::createFromAscii( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ), - ::rtl::OUString::createFromAscii( "Windows Metafile" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Windows Metafile" )), ::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) ); aVisualRepr.Data = m_pOleComponent->getTransferData( aDataFlavor ); @@ -405,7 +405,7 @@ embed::VisualRepresentation SAL_CALL OleEmbeddedObject::getPreferredVisualRepres if ( !m_xCachedVisualRepresentation.is() ) { // no representation can be retrieved - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "Illegal call!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Illegal call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); } @@ -432,11 +432,11 @@ sal_Int32 SAL_CALL OleEmbeddedObject::getMapUnit( sal_Int64 nAspect ) OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "Illegal call!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Illegal call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); if ( m_nObjectState == -1 ) - throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object is not loaded!\n" ), + throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object is not loaded!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); return embed::EmbedMapUnits::ONE_100TH_MM; diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx index 92f233dd2a29..5e158fef6e91 100644 --- a/embeddedobj/source/msole/ownview.cxx +++ b/embeddedobj/source/msole/ownview.cxx @@ -126,35 +126,35 @@ sal_Bool OwnView_Impl::CreateModelFromURL( const ::rtl::OUString& aFileURL ) try { uno::Reference < frame::XComponentLoader > xDocumentLoader( m_xFactory->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) )), uno::UNO_QUERY ); if ( xDocumentLoader.is() ) { uno::Sequence< beans::PropertyValue > aArgs( m_aFilterName.getLength() ? 5 : 4 ); - aArgs[0].Name = ::rtl::OUString::createFromAscii( "URL" ); + aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "URL" )); aArgs[0].Value <<= aFileURL; - aArgs[1].Name = ::rtl::OUString::createFromAscii( "ReadOnly" ); + aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ReadOnly" )); aArgs[1].Value <<= sal_True; - aArgs[2].Name = ::rtl::OUString::createFromAscii( "InteractionHandler" ); + aArgs[2].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" )); aArgs[2].Value <<= uno::Reference< task::XInteractionHandler >( static_cast< ::cppu::OWeakObject* >( new DummyHandler_Impl() ), uno::UNO_QUERY ); - aArgs[3].Name = ::rtl::OUString::createFromAscii( "DontEdit" ); + aArgs[3].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DontEdit" )); aArgs[3].Value <<= sal_True; if ( m_aFilterName.getLength() ) { - aArgs[4].Name = ::rtl::OUString::createFromAscii( "FilterName" ); + aArgs[4].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName" )); aArgs[4].Value <<= m_aFilterName; } uno::Reference< frame::XModel > xModel( xDocumentLoader->loadComponentFromURL( aFileURL, - ::rtl::OUString::createFromAscii( "_blank" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0, aArgs ), uno::UNO_QUERY ); @@ -214,7 +214,7 @@ sal_Bool OwnView_Impl::CreateModel( sal_Bool bUseNative ) throw uno::RuntimeException(); uno::Reference< document::XTypeDetection > xTypeDetection( - xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.document.TypeDetection" ) ), + xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" ) )), uno::UNO_QUERY_THROW ); ::rtl::OUString aTypeName; @@ -276,7 +276,7 @@ sal_Bool OwnView_Impl::ReadContentsAndGenerateTempFile( const uno::Reference< io // create m_aNativeTempURL ::rtl::OUString aNativeTempURL; uno::Reference < beans::XPropertySet > xNativeTempFile( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )), uno::UNO_QUERY_THROW ); uno::Reference < io::XStream > xNativeTempStream( xNativeTempFile, uno::UNO_QUERY_THROW ); uno::Reference < io::XOutputStream > xNativeOutTemp = xNativeTempStream->getOutputStream(); @@ -285,8 +285,8 @@ sal_Bool OwnView_Impl::ReadContentsAndGenerateTempFile( const uno::Reference< io throw uno::RuntimeException(); try { - xNativeTempFile->setPropertyValue( ::rtl::OUString::createFromAscii( "RemoveFile" ), uno::makeAny( sal_False ) ); - uno::Any aUrl = xNativeTempFile->getPropertyValue( ::rtl::OUString::createFromAscii( "Uri" ) ); + xNativeTempFile->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RemoveFile" )), uno::makeAny( sal_False ) ); + uno::Any aUrl = xNativeTempFile->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Uri" ) )); aUrl >>= aNativeTempURL; } catch ( uno::Exception& ) @@ -430,7 +430,7 @@ void OwnView_Impl::CreateNative() { uno::Reference < ucb::XSimpleFileAccess > xAccess( m_xFactory->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" ) )), uno::UNO_QUERY_THROW ); uno::Reference< io::XInputStream > xInStream = xAccess->openFileRead( m_aTempFileURL ); @@ -441,11 +441,11 @@ void OwnView_Impl::CreateNative() aArgs[0] <<= xInStream; uno::Reference< container::XNameAccess > xNameAccess( m_xFactory->createInstanceWithArguments( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.OLESimpleStorage" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLESimpleStorage" )), aArgs ), uno::UNO_QUERY_THROW ); - ::rtl::OUString aSubStreamName = ::rtl::OUString::createFromAscii( "\1Ole10Native" ); + ::rtl::OUString aSubStreamName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "\1Ole10Native" )); uno::Reference< embed::XClassifiedObject > xStor( xNameAccess, uno::UNO_QUERY_THROW ); uno::Sequence< sal_Int8 > aStorClassID = xStor->getClassID(); diff --git a/embeddedobj/source/msole/xdialogcreator.cxx b/embeddedobj/source/msole/xdialogcreator.cxx index efaad69d11c7..5305771a1d9b 100644 --- a/embeddedobj/source/msole/xdialogcreator.cxx +++ b/embeddedobj/source/msole/xdialogcreator.cxx @@ -118,15 +118,15 @@ uno::Sequence< sal_Int8 > GetRelatedInternalID_Impl( const uno::Sequence< sal_In uno::Sequence< ::rtl::OUString > SAL_CALL MSOLEDialogObjectCreator::impl_staticGetSupportedServiceNames() { uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.embed.MSOLEObjectSystemCreator"); - aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.MSOLEObjectSystemCreator"); + aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.MSOLEObjectSystemCreator")); + aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.MSOLEObjectSystemCreator")); return aRet; } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL MSOLEDialogObjectCreator::impl_staticGetImplementationName() { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.MSOLEObjectSystemCreator"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.MSOLEObjectSystemCreator")); } //------------------------------------------------------------------------- @@ -152,12 +152,12 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia #ifdef WNT if ( !xStorage.is() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No parent storage is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); if ( !sEntName.getLength() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -180,11 +180,11 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia ::osl::Module aOleDlgLib; - if( !aOleDlgLib.load( ::rtl::OUString::createFromAscii( "oledlg" ) ) ) + if( !aOleDlgLib.load( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "oledlg" ) ) )) throw uno::RuntimeException(); OleUIInsertObjectA_Type * pInsertFct = (OleUIInsertObjectA_Type *) - aOleDlgLib.getSymbol( ::rtl::OUString::createFromAscii( "OleUIInsertObjectA" ) ); + aOleDlgLib.getSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OleUIInsertObjectA" ) )); if( !pInsertFct ) throw uno::RuntimeException(); @@ -196,7 +196,7 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia { uno::Reference< embed::XEmbedObjectCreator > xEmbCreator( m_xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.EmbeddedObjectCreator" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.EmbeddedObjectCreator" ) )), uno::UNO_QUERY ); if ( !xEmbCreator.is() ) throw uno::RuntimeException(); @@ -229,7 +229,7 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia throw uno::RuntimeException(); uno::Sequence< beans::PropertyValue > aMediaDescr( 1 ); - aMediaDescr[0].Name = ::rtl::OUString::createFromAscii( "URL" ); + aMediaDescr[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "URL" )); aMediaDescr[0].Value <<= aFileURL; // TODO: use config helper for type detection @@ -239,12 +239,12 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia if ( aHelper.AddFilterNameCheckOwnFile( aMediaDescr ) ) xEmbCreator = uno::Reference< embed::XEmbedObjectCreator >( m_xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.EmbeddedObjectCreator" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.EmbeddedObjectCreator" ) )), uno::UNO_QUERY ); else xEmbCreator = uno::Reference< embed::XEmbedObjectCreator >( m_xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.OLEEmbeddedObjectFactory" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.OLEEmbeddedObjectFactory" ) )), uno::UNO_QUERY ); if ( !xEmbCreator.is() ) @@ -273,14 +273,14 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia if ( nBufSize && nBufSize == GetMetaFileBitsEx( pMF->hMF, nBufSize, pBuf+22 ) ) { datatransfer::DataFlavor aFlavor( - ::rtl::OUString::createFromAscii( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ), - ::rtl::OUString::createFromAscii( "Image WMF" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Image WMF" )), getCppuType( ( const uno::Sequence< sal_Int8 >* ) 0 ) ); aObjectInfo.Options.realloc( 2 ); - aObjectInfo.Options[0].Name = ::rtl::OUString::createFromAscii( "Icon" ); + aObjectInfo.Options[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Icon" )); aObjectInfo.Options[0].Value <<= aMetafile; - aObjectInfo.Options[1].Name = ::rtl::OUString::createFromAscii( "IconFormat" ); + aObjectInfo.Options[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "IconFormat" )); aObjectInfo.Options[1].Value <<= aFlavor; } @@ -317,12 +317,12 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceInitF #ifdef WNT if ( !xStorage.is() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No parent storage is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); if ( !sEntryName.getLength() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); diff --git a/embeddedobj/source/msole/xolefactory.cxx b/embeddedobj/source/msole/xolefactory.cxx index ee2212636ad7..0b1ea1e2542b 100644 --- a/embeddedobj/source/msole/xolefactory.cxx +++ b/embeddedobj/source/msole/xolefactory.cxx @@ -50,15 +50,15 @@ using namespace ::com::sun::star; uno::Sequence< ::rtl::OUString > SAL_CALL OleEmbeddedObjectFactory::impl_staticGetSupportedServiceNames() { uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.embed.OLEEmbeddedObjectFactory"); - aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.OLEEmbeddedObjectFactory"); + aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.OLEEmbeddedObjectFactory")); + aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.OLEEmbeddedObjectFactory")); return aRet; } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OleEmbeddedObjectFactory::impl_staticGetImplementationName() { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.OLEEmbeddedObjectFactory"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.OLEEmbeddedObjectFactory")); } //------------------------------------------------------------------------- @@ -83,12 +83,12 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitFromEntry" ); if ( !xStorage.is() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No parent storage is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); if ( !sEntName.getLength() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -155,12 +155,12 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" ); if ( !xStorage.is() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No parent storage is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); if ( !sEntName.getLength() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -197,12 +197,12 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitNew" ); if ( !xStorage.is() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No parent storage is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 3 ); if ( !sEntName.getLength() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 4 ); @@ -238,13 +238,13 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceLink" ); if ( !xStorage.is() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No parent storage is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); if ( !sEntName.getLength() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -285,12 +285,12 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta // the initialization is completelly controlled by user if ( !xStorage.is() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No parent storage is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); if ( !sEntName.getLength() ) - throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ), + throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); |