xmloff,vbahelper: prefer passing OUString and OString by reference

Change-Id: I8b7e4284c122549c03edaa7f3963cbfb2024b3fc
This commit is contained in:
Noel Grandin
2014-03-13 15:04:48 +02:00
parent 22684273d5
commit fddde2b74a
39 changed files with 111 additions and 112 deletions

View File

@@ -511,7 +511,7 @@ ContainerUtilities::getUniqueName( const uno::Sequence< OUString >& _slist, con
}
OUString
ContainerUtilities::getUniqueName( const uno::Sequence< OUString >& _slist, const OUString _sElementName, const OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix)
ContainerUtilities::getUniqueName( const uno::Sequence< OUString >& _slist, const OUString& _sElementName, const OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix)
{
sal_Int32 a = _nStartSuffix;
OUString scompname = _sElementName;

View File

@@ -36,7 +36,7 @@ ScVbaLineFormat::ScVbaLineFormat( const uno::Reference< ov::XHelperInterface >&
}
sal_Int32
ScVbaLineFormat::convertLineStartEndNameToArrowheadStyle( OUString sLineName )
ScVbaLineFormat::convertLineStartEndNameToArrowheadStyle( const OUString& sLineName )
{
sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone;
if ( sLineName == "Small Arrow" || sLineName == "Arrow" || sLineName == "msArrowEnd" || sLineName == "Double Arrow")

View File

@@ -36,7 +36,7 @@ private:
protected:
virtual OUString getServiceImplName();
virtual css::uno::Sequence<OUString> getServiceNames();
sal_Int32 convertLineStartEndNameToArrowheadStyle( OUString sLineName );
sal_Int32 convertLineStartEndNameToArrowheadStyle( const OUString& sLineName );
OUString convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (css::uno::RuntimeException);
public:
ScVbaLineFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape );

View File

@@ -217,7 +217,7 @@ ScVbaShapes::SelectAll() throw (uno::RuntimeException, std::exception)
}
uno::Reference< drawing::XShape >
ScVbaShapes::createShape( OUString service ) throw (css::uno::RuntimeException)
ScVbaShapes::createShape( const OUString& service ) throw (css::uno::RuntimeException)
{
uno::Reference< lang::XMultiServiceFactory > xMSF( m_xModel, uno::UNO_QUERY_THROW );
uno::Reference< drawing::XShape > xShape( xMSF->createInstance( service ), uno::UNO_QUERY_THROW );
@@ -419,7 +419,7 @@ ScVbaShapes::setDefaultShapeProperties( uno::Reference< drawing::XShape > xShape
}
void
ScVbaShapes::setShape_NameProperty( uno::Reference< css::drawing::XShape > xShape, OUString sName )
ScVbaShapes::setShape_NameProperty( uno::Reference< css::drawing::XShape > xShape, const OUString& sName )
{
uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW );
try
@@ -432,12 +432,11 @@ ScVbaShapes::setShape_NameProperty( uno::Reference< css::drawing::XShape > xShap
}
OUString
ScVbaShapes::createName( OUString sName )
ScVbaShapes::createName( const OUString& sName )
{
sal_Int32 nActNumber = 1 + m_nNewShapeCount;
m_nNewShapeCount++;
sName += OUString::number( nActNumber );
return sName;
return sName + OUString::number( nActNumber );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -39,7 +39,7 @@ VbaTextFrame::setAsMSObehavior()
m_xPropertySet->setPropertyValue( "TextFitToSize", uno::makeAny( drawing::TextFitToSizeType_NONE ) );
}
sal_Int32 VbaTextFrame::getMargin( OUString sMarginType )
sal_Int32 VbaTextFrame::getMargin( const OUString& sMarginType )
{
sal_Int32 nMargin = 0;
uno::Any aMargin = m_xPropertySet->getPropertyValue( sMarginType );
@@ -47,7 +47,7 @@ sal_Int32 VbaTextFrame::getMargin( OUString sMarginType )
return nMargin;
}
void VbaTextFrame::setMargin( OUString sMarginType, float fMargin )
void VbaTextFrame::setMargin( const OUString& sMarginType, float fMargin )
{
sal_Int32 nMargin = Millimeter::getInHundredthsOfOneMillimeter( fMargin );
m_xPropertySet->setPropertyValue( sMarginType, uno::makeAny( nMargin ) );