summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-20 23:57:47 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-06-21 15:07:52 +0100
commitc3f2401d49b1374431da54e799a23bc122c5def7 (patch)
tree81ea39989af360ca879c7a84e7b1643698255589 /basic
parent3d506e814719ecaa5862663bce467994ccf31a4d (diff)
reduce scope and replace some String::CreateFromAscii
Change-Id: I8c375e3bfbcd3d7046a8bdb1968934b7d7ca96f8
Diffstat (limited to 'basic')
-rw-r--r--basic/source/uno/namecont.cxx18
-rw-r--r--basic/source/uno/scriptcont.cxx6
2 files changed, 8 insertions, 16 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 2baa1853a35b..fc7b5328cfaa 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -1393,7 +1393,6 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
embed::ElementModes::READWRITE );
// throw uno::RuntimeException(); // TODO: method must either return the stream or throw an exception
- String aPropName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("MediaType") ) );
OUString aMime( RTL_CONSTASCII_USTRINGPARAM("text/xml") );
uno::Reference< beans::XPropertySet > xProps( xElementStream, uno::UNO_QUERY );
@@ -1404,11 +1403,10 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
if ( xProps.is() )
{
- xProps->setPropertyValue( aPropName, uno::makeAny( aMime ) );
+ xProps->setPropertyValue( rtl::OUString("MediaType"), uno::makeAny( aMime ) );
// #87671 Allow encryption
- aPropName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "UseCommonStoragePasswordEncryption" ) );
- xProps->setPropertyValue( aPropName, uno::makeAny( sal_True ) );
+ xProps->setPropertyValue( rtl::OUString("UseCommonStoragePasswordEncryption"), uno::makeAny( sal_True ) );
Reference< XOutputStream > xOutput = xElementStream->getOutputStream();
Reference< XNameContainer > xLib( pLib );
@@ -1541,13 +1539,11 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib,
if ( xProps.is() )
{
- String aPropName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("MediaType") ) );
OUString aMime( RTL_CONSTASCII_USTRINGPARAM("text/xml") );
- xProps->setPropertyValue( aPropName, uno::makeAny( aMime ) );
+ xProps->setPropertyValue( rtl::OUString("MediaType"), uno::makeAny( aMime ) );
// #87671 Allow encryption
- aPropName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "UseCommonStoragePasswordEncryption" ) );
- xProps->setPropertyValue( aPropName, uno::makeAny( sal_True ) );
+ xProps->setPropertyValue( rtl::OUString("UseCommonStoragePasswordEncryption"), uno::makeAny( sal_True ) );
xOut = xInfoStream->getOutputStream();
}
@@ -2014,13 +2010,11 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
if ( !xProps.is() )
throw uno::RuntimeException();
- String aPropName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("MediaType") ) );
OUString aMime( RTL_CONSTASCII_USTRINGPARAM("text/xml") );
- xProps->setPropertyValue( aPropName, uno::makeAny( aMime ) );
+ xProps->setPropertyValue( rtl::OUString("MediaType"), uno::makeAny( aMime ) );
// #87671 Allow encryption
- aPropName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("UseCommonStoragePasswordEncryption") );
- xProps->setPropertyValue( aPropName, uno::makeAny( sal_True ) );
+ xProps->setPropertyValue( rtl::OUString("UseCommonStoragePasswordEncryption"), uno::makeAny( sal_True ) );
xOut = xInfoStream->getOutputStream();
}
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 30e4328c812b..45311f567a6b 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -688,9 +688,8 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
if ( !xProps.is() )
throw uno::RuntimeException();
- String aPropName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("MediaType") ) );
OUString aMime( "text/xml" );
- xProps->setPropertyValue( aPropName, uno::makeAny( aMime ) );
+ xProps->setPropertyValue( rtl::OUString("MediaType"), uno::makeAny( aMime ) );
// Set encryption key
setStreamKey( xSourceStream, pLib->maPassword );
@@ -824,9 +823,8 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
uno::Reference< beans::XPropertySet > xProps( xSourceStream, uno::UNO_QUERY );
if ( !xProps.is() )
throw uno::RuntimeException();
- String aPropName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("MediaType") ) );
OUString aMime( "text/xml" );
- xProps->setPropertyValue( aPropName, uno::makeAny( aMime ) );
+ xProps->setPropertyValue( rtl::OUString("MediaType"), uno::makeAny( aMime ) );
Reference< XOutputStream > xOut = xSourceStream->getOutputStream();
Reference< XNameContainer > xLib( pLib );