summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-05-25 19:36:30 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-06-01 20:11:49 +0200
commit44a18f6c9e111c3a1a29ae0ee262eb982516adae (patch)
tree5b9101ba5a66864abaf6bff6ef994b7cada6ca9b /sw
parente1cee80e4cb18e506d4a5fe3d2f4d6403e8f2223 (diff)
OUstring: avoid temporaries and constify
Change-Id: I553f6219a695cb6a41ccd9811d5ab8b5e7138ac5
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/swunohelper.cxx12
-rw-r--r--sw/source/core/unocore/unodraw.cxx31
2 files changed, 19 insertions, 24 deletions
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index 11eeeeb9d6a7..d7157b578f3a 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -62,7 +62,7 @@ bool UCB_DeleteFile( const OUString& rURL )
ucbhelper::Content aTempContent( rURL,
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
comphelper::getProcessComponentContext() );
- aTempContent.executeCommand(OUString("delete"),
+ aTempContent.executeCommand("delete",
::com::sun::star::uno::makeAny( sal_True ) );
bRemoved = true;
}
@@ -80,9 +80,9 @@ bool UCB_CopyFile( const OUString& rURL, const OUString& rNewURL, bool bCopyIsMo
try
{
INetURLObject aURL( rNewURL );
- OUString sName( aURL.GetName() );
+ const OUString sName( aURL.GetName() );
aURL.removeSegment();
- OUString sMainURL( aURL.GetMainURL(INetURLObject::NO_DECODE) );
+ const OUString sMainURL( aURL.GetMainURL(INetURLObject::NO_DECODE) );
ucbhelper::Content aTempContent( sMainURL,
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
@@ -95,8 +95,7 @@ bool UCB_CopyFile( const OUString& rURL, const OUString& rNewURL, bool bCopyIsMo
aInfo.SourceURL = rURL;
aInfo.MoveData = bCopyIsMove;
aAny <<= aInfo;
- aTempContent.executeCommand( OUString("transfer"),
- aAny );
+ aTempContent.executeCommand( "transfer", aAny );
}
catch( ::com::sun::star::uno::Exception& )
{
@@ -140,8 +139,7 @@ bool UCB_IsReadOnlyFileName( const OUString& rURL )
try
{
ucbhelper::Content aCnt( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
- ::com::sun::star::uno::Any aAny = aCnt.getPropertyValue(
- OUString("IsReadOnly"));
+ ::com::sun::star::uno::Any aAny = aCnt.getPropertyValue("IsReadOnly");
if(aAny.hasValue())
bIsReadOnly = *(sal_Bool*)aAny.getValue();
}
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 775f0efc6912..526382620ecf 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1539,7 +1539,7 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
{
// get property <::drawing::Shape::Transformation>
// without conversion to layout direction as below
- aRet = _getPropAtAggrObj( OUString("Transformation") );
+ aRet = _getPropAtAggrObj( "Transformation" );
}
else if ( FN_SHAPE_POSITION_LAYOUT_DIR == pEntry->nWID )
{
@@ -1550,13 +1550,13 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
{
// get property <::drawing::Shape::StartPosition>
// without conversion to layout direction as below
- aRet = _getPropAtAggrObj( OUString("StartPosition") );
+ aRet = _getPropAtAggrObj( "StartPosition" );
}
else if ( FN_SHAPE_ENDPOSITION_IN_HORI_L2R == pEntry->nWID )
{
// get property <::drawing::Shape::EndPosition>
// without conversion to layout direction as below
- aRet = _getPropAtAggrObj( OUString("EndPosition") );
+ aRet = _getPropAtAggrObj( "EndPosition" );
}
else if (pEntry->nWID == RES_FRM_SIZE &&
(pEntry->nMemberId == MID_FRMSIZE_REL_HEIGHT ||
@@ -1648,7 +1648,7 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
{
// get property <::drawing::Shape::Transformation>
// without conversion to layout direction as below
- aRet = _getPropAtAggrObj( OUString("Transformation") );
+ aRet = _getPropAtAggrObj( "Transformation" );
}
break;
case FN_SHAPE_POSITION_LAYOUT_DIR:
@@ -1661,14 +1661,14 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
{
// get property <::drawing::Shape::StartPosition>
// without conversion to layout direction as below
- aRet = _getPropAtAggrObj( OUString("StartPosition") );
+ aRet = _getPropAtAggrObj( "StartPosition" );
}
break;
case FN_SHAPE_ENDPOSITION_IN_HORI_L2R:
{
// get property <::drawing::Shape::StartPosition>
// without conversion to layout direction as below
- aRet = _getPropAtAggrObj( OUString("EndPosition") );
+ aRet = _getPropAtAggrObj( "EndPosition" );
}
break;
}
@@ -2364,12 +2364,11 @@ void SAL_CALL SwXShape::setSize( const awt::Size& aSize )
// implementation of virtual methods from drawing::XShapeDescriptor
OUString SAL_CALL SwXShape::getShapeType() throw ( uno::RuntimeException, std::exception )
{
- OUString aType;
if ( mxShape.is() )
{
- aType = mxShape->getShapeType();
+ return mxShape->getShapeType();
}
- return aType;
+ return OUString();
}
/** method to determine top group object
#i31698#
@@ -2427,8 +2426,7 @@ awt::Point SwXShape::_GetAttrPosition()
text::TextContentAnchorType eTextAnchorType =
text::TextContentAnchorType_AT_PARAGRAPH;
{
- OUString sAnchorType( "AnchorType" );
- uno::Any aAny = getPropertyValue( sAnchorType );
+ uno::Any aAny = getPropertyValue( "AnchorType" );
aAny >>= eTextAnchorType;
}
if ( eTextAnchorType == text::TextContentAnchorType_AS_CHARACTER )
@@ -2556,14 +2554,13 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
text::TextContentAnchorType eTextAnchorType =
text::TextContentAnchorType_AT_PARAGRAPH;
{
- OUString sAnchorType( "AnchorType" );
- uno::Any aAny = getPropertyValue( sAnchorType );
+ uno::Any aAny = getPropertyValue( "AnchorType" );
aAny >>= eTextAnchorType;
}
if ( eTextAnchorType != text::TextContentAnchorType_AS_CHARACTER )
{
// determine current x-position
- OUString aHoriPosPropStr("HoriOrientPosition");
+ const OUString aHoriPosPropStr("HoriOrientPosition");
uno::Any aHoriPos( getPropertyValue( aHoriPosPropStr ) );
sal_Int32 dCurrX = 0;
aHoriPos >>= dCurrX;
@@ -2572,7 +2569,7 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
{
// adjust x-position orientation to text::HoriOrientation::NONE, if needed
// Note: has to be done before setting x-position attribute
- OUString aHoriOrientPropStr("HoriOrient");
+ const OUString aHoriOrientPropStr("HoriOrient");
uno::Any aHoriOrient( getPropertyValue( aHoriOrientPropStr ) );
sal_Int16 eHoriOrient;
if (aHoriOrient >>= eHoriOrient) // may be void
@@ -2593,7 +2590,7 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
// handle y-position
{
// determine current y-position
- OUString aVertPosPropStr("VertOrientPosition");
+ const OUString aVertPosPropStr("VertOrientPosition");
uno::Any aVertPos( getPropertyValue( aVertPosPropStr ) );
sal_Int32 dCurrY = 0;
aVertPos >>= dCurrY;
@@ -2602,7 +2599,7 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
{
// adjust y-position orientation to text::VertOrientation::NONE, if needed
// Note: has to be done before setting y-position attribute
- OUString aVertOrientPropStr("VertOrient");
+ const OUString aVertOrientPropStr("VertOrient");
uno::Any aVertOrient( getPropertyValue( aVertOrientPropStr ) );
sal_Int16 eVertOrient;
if (aVertOrient >>= eVertOrient) // may be void