Kaydet (Commit) 11ccf6b5 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

targeted string re-work

Change-Id: I9d0b124450af7743991c5f0b80de68383b814345
üst aca92397
...@@ -299,15 +299,14 @@ void OFileAccess::transferImpl( const rtl::OUString& rSource, ...@@ -299,15 +299,14 @@ void OFileAccess::transferImpl( const rtl::OUString& rSource,
{ {
xPropSet->getPropertyValue( xPropSet->getPropertyValue(
rtl::OUString( rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ) "DefaultContext" ) )
>>= xCtx; >>= xCtx;
} }
Reference< XMacroExpander > xExpander; Reference< XMacroExpander > xExpander;
xCtx->getValueByName( xCtx->getValueByName(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( rtl::OUString( "/singletons/com.sun.star.util.theMacroExpander" ) )
"/singletons/com.sun.star.util.theMacroExpander" ) ) )
>>= xExpander; >>= xExpander;
OSL_ENSURE( xExpander.is(), OSL_ENSURE( xExpander.is(),
...@@ -319,10 +318,8 @@ void OFileAccess::transferImpl( const rtl::OUString& rSource, ...@@ -319,10 +318,8 @@ void OFileAccess::transferImpl( const rtl::OUString& rSource,
catch ( Exception const & ) catch ( Exception const & )
{ {
throw RuntimeException( throw RuntimeException(
rtl::OUString( rtl::OUString( "OFileAccess::transferrImpl - Unable to obtain "
RTL_CONSTASCII_USTRINGPARAM( "destination folder URL!" ),
"OFileAccess::transferrImpl - Unable to obtain "
"destination folder URL!" ) ),
static_cast< cppu::OWeakObject * >( this ) ); static_cast< cppu::OWeakObject * >( this ) );
} }
...@@ -331,10 +328,8 @@ void OFileAccess::transferImpl( const rtl::OUString& rSource, ...@@ -331,10 +328,8 @@ void OFileAccess::transferImpl( const rtl::OUString& rSource,
} }
throw RuntimeException( throw RuntimeException(
rtl::OUString( rtl::OUString( "OFileAccess::transferrImpl - Unable to obtain "
RTL_CONSTASCII_USTRINGPARAM( "destination folder URL!" ),
"OFileAccess::transferrImpl - Unable to obtain "
"destination folder URL!" ) ),
static_cast< cppu::OWeakObject * >( this ) ); static_cast< cppu::OWeakObject * >( this ) );
} }
...@@ -377,7 +372,7 @@ void OFileAccess::kill( const rtl::OUString& FileURL ) ...@@ -377,7 +372,7 @@ void OFileAccess::kill( const rtl::OUString& FileURL )
ucbhelper::Content aCnt( aDeleteObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment ); ucbhelper::Content aCnt( aDeleteObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment );
try try
{ {
aCnt.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "delete" )), makeAny( sal_Bool( sal_True ) ) ); aCnt.executeCommand( rtl::OUString("delete" ), makeAny( sal_Bool( sal_True ) ) );
} }
catch ( ::com::sun::star::ucb::CommandFailedException const & ) catch ( ::com::sun::star::ucb::CommandFailedException const & )
{ {
...@@ -404,7 +399,7 @@ sal_Bool OFileAccess::isReadOnly( const rtl::OUString& FileURL ) ...@@ -404,7 +399,7 @@ sal_Bool OFileAccess::isReadOnly( const rtl::OUString& FileURL )
{ {
INetURLObject aURLObj( FileURL, INET_PROT_FILE ); INetURLObject aURLObj( FileURL, INET_PROT_FILE );
ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment ); ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment );
Any aRetAny = aCnt.getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ) ); Any aRetAny = aCnt.getPropertyValue( rtl::OUString( "IsReadOnly" ) );
sal_Bool bRet = sal_False; sal_Bool bRet = sal_False;
aRetAny >>= bRet; aRetAny >>= bRet;
return bRet; return bRet;
...@@ -417,7 +412,7 @@ void OFileAccess::setReadOnly( const rtl::OUString& FileURL, sal_Bool bReadOnly ...@@ -417,7 +412,7 @@ void OFileAccess::setReadOnly( const rtl::OUString& FileURL, sal_Bool bReadOnly
ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment ); ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment );
Any aAny; Any aAny;
aAny <<= bReadOnly; aAny <<= bReadOnly;
aCnt.setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ), aAny ); aCnt.setPropertyValue( rtl::OUString( "IsReadOnly" ), aAny );
} }
void OFileAccess::createFolder( const rtl::OUString& NewFolderURL ) void OFileAccess::createFolder( const rtl::OUString& NewFolderURL )
...@@ -466,7 +461,7 @@ void OFileAccess::createFolder( const rtl::OUString& NewFolderURL ) ...@@ -466,7 +461,7 @@ void OFileAccess::createFolder( const rtl::OUString& NewFolderURL )
Sequence<rtl::OUString> aNames(1); Sequence<rtl::OUString> aNames(1);
rtl::OUString* pNames = aNames.getArray(); rtl::OUString* pNames = aNames.getArray();
pNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ); pNames[0] = rtl::OUString( "Title" );
Sequence< Any > aValues(1); Sequence< Any > aValues(1);
Any* pValues = aValues.getArray(); Any* pValues = aValues.getArray();
pValues[0] = makeAny( rtl::OUString( aTitle ) ); pValues[0] = makeAny( rtl::OUString( aTitle ) );
...@@ -497,7 +492,7 @@ sal_Int32 OFileAccess::getSize( const rtl::OUString& FileURL ) ...@@ -497,7 +492,7 @@ sal_Int32 OFileAccess::getSize( const rtl::OUString& FileURL )
sal_Int64 nTemp = 0; sal_Int64 nTemp = 0;
INetURLObject aObj( FileURL, INET_PROT_FILE ); INetURLObject aObj( FileURL, INET_PROT_FILE );
ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment ); ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment );
aCnt.getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Size" )) ) >>= nTemp; aCnt.getPropertyValue( rtl::OUString("Size" ) ) >>= nTemp;
nSize = (sal_Int32)nTemp; nSize = (sal_Int32)nTemp;
return nSize; return nSize;
} }
...@@ -521,7 +516,7 @@ DateTime OFileAccess::getDateTimeModified( const rtl::OUString& FileURL ) ...@@ -521,7 +516,7 @@ DateTime OFileAccess::getDateTimeModified( const rtl::OUString& FileURL )
Reference< XCommandEnvironment > aCmdEnv; Reference< XCommandEnvironment > aCmdEnv;
ucbhelper::Content aYoung( aFileObj.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv ); ucbhelper::Content aYoung( aFileObj.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv );
aYoung.getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DateModified" )) ) >>= aDateTime; aYoung.getPropertyValue( rtl::OUString("DateModified" ) ) >>= aDateTime;
return aDateTime; return aDateTime;
} }
...@@ -663,7 +658,7 @@ Reference< XStream > OFileAccess::openFileReadWrite( const rtl::OUString& FileUR ...@@ -663,7 +658,7 @@ Reference< XStream > OFileAccess::openFileReadWrite( const rtl::OUString& FileUR
try try
{ {
aCnt.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "open" )), aCmdArg ); aCnt.executeCommand( rtl::OUString("open" ), aCmdArg );
} }
catch ( InteractiveIOException const & e ) catch ( InteractiveIOException const & e )
{ {
...@@ -681,7 +676,7 @@ Reference< XStream > OFileAccess::openFileReadWrite( const rtl::OUString& FileUR ...@@ -681,7 +676,7 @@ Reference< XStream > OFileAccess::openFileReadWrite( const rtl::OUString& FileUR
aInsertArg.ReplaceExisting = sal_False; aInsertArg.ReplaceExisting = sal_False;
aCmdArg <<= aInsertArg; aCmdArg <<= aInsertArg;
aCnt.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "insert" )), aCmdArg ); aCnt.executeCommand( rtl::OUString("insert" ), aCmdArg );
// Retry... // Retry...
return openFileReadWrite( FileURL ); return openFileReadWrite( FileURL );
...@@ -740,7 +735,7 @@ bool OFileAccess::createNewFile( const rtl::OUString & rParentURL, ...@@ -740,7 +735,7 @@ bool OFileAccess::createNewFile( const rtl::OUString & rParentURL,
Sequence<rtl::OUString> aNames(1); Sequence<rtl::OUString> aNames(1);
rtl::OUString* pNames = aNames.getArray(); rtl::OUString* pNames = aNames.getArray();
pNames[0] = rtl::OUString( pNames[0] = rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "Title" ) ); "Title" );
Sequence< Any > aValues(1); Sequence< Any > aValues(1);
Any* pValues = aValues.getArray(); Any* pValues = aValues.getArray();
pValues[0] = makeAny( rtl::OUString( rTitle ) ); pValues[0] = makeAny( rtl::OUString( rTitle ) );
...@@ -821,7 +816,7 @@ sal_Bool OFileAccess::isHidden( const ::rtl::OUString& FileURL ) ...@@ -821,7 +816,7 @@ sal_Bool OFileAccess::isHidden( const ::rtl::OUString& FileURL )
{ {
INetURLObject aURLObj( FileURL, INET_PROT_FILE ); INetURLObject aURLObj( FileURL, INET_PROT_FILE );
ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment ); ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment );
Any aRetAny = aCnt.getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsHidden" ) ) ); Any aRetAny = aCnt.getPropertyValue( rtl::OUString( "IsHidden" ) );
sal_Bool bRet = sal_False; sal_Bool bRet = sal_False;
aRetAny >>= bRet; aRetAny >>= bRet;
return bRet; return bRet;
...@@ -834,7 +829,7 @@ void OFileAccess::setHidden( const ::rtl::OUString& FileURL, sal_Bool bHidden ) ...@@ -834,7 +829,7 @@ void OFileAccess::setHidden( const ::rtl::OUString& FileURL, sal_Bool bHidden )
ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment ); ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment );
Any aAny; Any aAny;
aAny <<= bHidden; aAny <<= bHidden;
aCnt.setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsHidden" ) ), aAny ); aCnt.setPropertyValue( rtl::OUString( "IsHidden" ), aAny );
} }
//================================================================================================== //==================================================================================================
...@@ -850,7 +845,7 @@ Reference< XInterface > SAL_CALL FileAccess_CreateInstance( const Reference< XMu ...@@ -850,7 +845,7 @@ Reference< XInterface > SAL_CALL FileAccess_CreateInstance( const Reference< XMu
Sequence< rtl::OUString > FileAccess_getSupportedServiceNames() Sequence< rtl::OUString > FileAccess_getSupportedServiceNames()
{ {
Sequence< rtl::OUString > seqNames(1); Sequence< rtl::OUString > seqNames(1);
seqNames.getArray()[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME )); seqNames.getArray()[0] = rtl::OUString(SERVICE_NAME );
return seqNames; return seqNames;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment