summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-05-01 10:03:44 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2018-06-03 12:17:42 +0200
commit436191347914b81bb4d4cc02e594f4b47b8df8f5 (patch)
tree7f479a1eea53ea589306d9cf4a4544db4d008e93 /sw
parent62667aac83bd743fa98a5eaa946cc8088335f66c (diff)
OUString: simplify and reduce temporaries
Change-Id: I86abb83cad333ff2d119d33d767f54be206e90da
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx21
1 files changed, 6 insertions, 15 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 5c7a9f474780..408e1509856c 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -2102,15 +2102,13 @@ bool SwTransferable::PasteDDE( TransferableDataHelper& rData,
const ::utl::TransliterationWrapper& rColl = ::GetAppCmpStrIgnore();
do {
- aName = aApp;
- aName += OUString::number( i );
+ aName = aApp + OUString::number( i );
for( j = INIT_FLDTYPES; j < nSize; j++ )
{
pTyp = rWrtShell.GetFieldType( j );
if( SwFieldIds::Dde == pTyp->Which() )
{
- OUString sTmp( static_cast<SwDDEFieldType*>(pTyp)->GetCmd() );
- if( rColl.isEqual( sTmp, aCmd ) &&
+ if( rColl.isEqual( static_cast<SwDDEFieldType*>(pTyp)->GetCmd(), aCmd ) &&
SfxLinkUpdateMode::ALWAYS == static_cast<SwDDEFieldType*>(pTyp)->GetType() )
{
aName = pTyp->GetName();
@@ -2147,12 +2145,10 @@ bool SwTransferable::PasteDDE( TransferableDataHelper& rData,
( 1 < comphelper::string::getTokenCount(aExpand, '\n') ||
comphelper::string::getTokenCount(aExpand, '\t') ) )
{
- OUString sTmp( aExpand );
- sal_Int32 nRows = comphelper::string::getTokenCount(sTmp, '\n');
+ sal_Int32 nRows = comphelper::string::getTokenCount(aExpand, '\n');
if( nRows )
--nRows;
- sTmp = sTmp.getToken( 0, '\n' );
- sal_Int32 nCols = comphelper::string::getTokenCount(sTmp, '\t');
+ sal_Int32 nCols = comphelper::string::getTokenCount(aExpand.getToken(0, '\n'), '\t');
// don't try to insert tables that are too large for writer
if (nRows > SAL_MAX_UINT16 || nCols > SAL_MAX_UINT16)
@@ -2787,14 +2783,9 @@ bool SwTransferable::CheckForURLOrLNKFile( TransferableDataHelper& rData,
}
else
{
- sal_Int32 nLen = rFileName.getLength();
- if( 4 < nLen && '.' == rFileName[ nLen - 4 ])
+ if( rFileName.getLength()>4 && rFileName.endsWithIgnoreAsciiCase(".url") )
{
- OUString sExt( rFileName.copy( nLen - 3 ));
- if( sExt.equalsIgnoreAsciiCase( "url" ))
- {
- OSL_ENSURE( false, "how do we read today .URL - Files?" );
- }
+ OSL_ENSURE( false, "how do we read today .URL - Files?" );
}
}
return bIsURLFile;