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

@ -230,7 +230,7 @@ class VBAHELPER_DLLPUBLIC ContainerUtilities
public:
static OUString getUniqueName( const css::uno::Sequence< OUString >& _slist, const OUString& _sElementName, const OUString& _sSuffixSeparator);
static OUString getUniqueName( const css::uno::Sequence< OUString >& _slist, const OUString _sElementName, const OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix );
static OUString getUniqueName( const css::uno::Sequence< OUString >& _slist, const OUString& _sElementName, const OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix );
static sal_Int32 FieldInList( const css::uno::Sequence< OUString >& SearchList, const OUString& SearchString );
};

View File

@ -42,18 +42,18 @@ protected:
virtual OUString getServiceImplName();
virtual css::uno::Sequence<OUString> getServiceNames();
virtual css::uno::Reference< css::container::XIndexAccess > getShapesByArrayIndices( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
css::uno::Reference< css::drawing::XShape > createShape( OUString service ) throw (css::uno::RuntimeException);
css::uno::Reference< css::drawing::XShape > createShape( const OUString& service ) throw (css::uno::RuntimeException);
css::uno::Any AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, css::uno::Any aRange ) throw (css::uno::RuntimeException);
css::uno::Any AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, css::uno::Any aRange ) throw (css::uno::RuntimeException);
css::uno::Any AddTextboxInWriter( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (css::uno::RuntimeException);
OUString createName( OUString sName );
OUString createName( const OUString& sName );
//TODO helperapi using a writer document
//css::awt::Point calculateTopLeftMargin( css::uno::Reference< ov::XHelperInterface > xDocument );
public:
ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess > xShapes, const css::uno::Reference< css::frame::XModel >& xModel );
static void setDefaultShapeProperties( css::uno::Reference< css::drawing::XShape > xShape ) throw (css::uno::RuntimeException);
static void setShape_NameProperty( css::uno::Reference< css::drawing::XShape > xShape, OUString sName );
static void setShape_NameProperty( css::uno::Reference< css::drawing::XShape > xShape, const OUString& sName );
//XEnumerationAccess
virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);

View File

@ -34,8 +34,8 @@ protected:
virtual OUString getServiceImplName();
virtual css::uno::Sequence<OUString> getServiceNames();
virtual void setAsMSObehavior();
sal_Int32 getMargin( OUString sMarginType );
void setMargin( OUString sMarginType, float fMargin );
sal_Int32 getMargin( const OUString& sMarginType );
void setMargin( const OUString& sMarginType, float fMargin );
public:
VbaTextFrame( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext , css::uno::Reference< css::drawing::XShape > xShape);
virtual ~VbaTextFrame() {}

View File

@ -81,14 +81,14 @@ class XMLOFF_DLLPUBLIC XMLSettingsExportHelper
const OUString& rName) const;
void exportIndexAccess(
const com::sun::star::uno::Reference<com::sun::star::container::XIndexAccess> aIndexed,
const OUString rName) const;
const OUString& rName) const;
void exportSymbolDescriptors(
const com::sun::star::uno::Sequence < com::sun::star::formula::SymbolDescriptor > &rProps,
const OUString rName) const;
const OUString& rName) const;
void exportForbiddenCharacters(
const com::sun::star::uno::Any &rAny,
const OUString rName) const;
const OUString& rName) const;
public:
XMLSettingsExportHelper( ::xmloff::XMLSettingsExportContext& i_rContext );

View File

@ -69,7 +69,7 @@ public:
// methods that are not contained in any interface
void AddAttribute( const OUString &sName , const OUString &sValue );
void Clear();
void RemoveAttribute( const OUString sName );
void RemoveAttribute( const OUString& sName );
void AppendAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & );
void SetValueByIndex( sal_Int16 i, const OUString& rValue );
void RemoveAttributeByIndex( sal_Int16 i );

View File

@ -580,9 +580,9 @@ public:
OUString FindActiveBookmarkName();
void pushFieldCtx( OUString name, OUString type );
void pushFieldCtx( const OUString& name, const OUString& type );
void popFieldCtx();
void addFieldParam( OUString name, OUString value );
void addFieldParam( const OUString& name, const OUString& value );
void setCurrentFieldParamsTo(::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField> &xFormField);
OUString getCurrentFieldType();
bool hasCurrentFieldCtx();

View File

@ -77,7 +77,7 @@ public:
if bAsFamily is sal_False, the family name is used as element name
*/
// TODO: Remove this ugly method as soon as possible
void AddFamily( sal_Int32 nFamily, const OUString& rStrName, SvXMLExportPropertyMapper* pMapper, OUString aStrPrefix, sal_Bool bAsFamily = sal_True );
void AddFamily( sal_Int32 nFamily, const OUString& rStrName, SvXMLExportPropertyMapper* pMapper, const OUString& aStrPrefix, sal_Bool bAsFamily = sal_True );
void AddFamily( sal_Int32 nFamily, const OUString& rStrName,
const UniReference< SvXMLExportPropertyMapper >& rMapper,
const OUString& rStrPrefix, sal_Bool bAsFamily = sal_True );

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 ) );

View File

@ -103,10 +103,10 @@ public:
::com::sun::star::beans::XPropertySet> & rConfig);
/// for helper class: set begin notice
void SetBeginNotice( OUString sText);
void SetBeginNotice( const OUString& sText);
/// for helper class: set end notice
void SetEndNotice( OUString sText);
void SetEndNotice( const OUString& sText);
};
#endif

View File

@ -93,8 +93,8 @@ protected:
void ProcessAttribute(
sal_uInt16 nPrefix,
const OUString sLocalName,
const OUString sValue);
const OUString& sLocalName,
const OUString& sValue);
};
#endif

View File

@ -100,7 +100,7 @@ protected:
void ProcessAttribute(
enum LineNumberingToken eToken,
OUString sValue);
const OUString& sValue);
virtual void CreateAndInsert(sal_Bool bOverwrite);
@ -111,8 +111,8 @@ protected:
::com::sun::star::xml::sax::XAttributeList> & xAttrList );
void ProcessAttribute(
const OUString sLocalName,
const OUString sValue);
const OUString& sLocalName,
const OUString& sValue);
};
#endif

View File

@ -51,7 +51,7 @@ namespace xmloff
/** retrieves the values of the properties controlled by an XML attributed, described by a given attribute value
*/
virtual bool
getPropertyValues( const OUString i_attributeValue, PropertyValues& o_propertyValues ) const = 0;
getPropertyValues( const OUString& i_attributeValue, PropertyValues& o_propertyValues ) const = 0;
virtual ~IPropertyHandler() { }
};

View File

@ -206,7 +206,7 @@ public:
static enum ::xmloff::token::XMLTokenEnum MapReferenceSource(sal_Int16 nType);
static enum ::xmloff::token::XMLTokenEnum MapReferenceType(sal_Int16 nType);
static enum ::xmloff::token::XMLTokenEnum MapCountFieldName(FieldIdEnum nToken);
static enum ::xmloff::token::XMLTokenEnum MapBibliographyFieldName(OUString sName);
static enum ::xmloff::token::XMLTokenEnum MapBibliographyFieldName(const OUString& sName);
static enum ::xmloff::token::XMLTokenEnum MapMeasureKind(sal_Int16 nKind);
enum ::xmloff::token::XMLTokenEnum MapPageNumberName(const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet> & xPropSet,
@ -383,7 +383,7 @@ protected:
void ProcessStringSequence(
const ::com::sun::star::uno::Sequence<OUString>& rSequence,
const OUString sSelected );
const OUString& sSelected );
void ProcessStringSequence(
const ::com::sun::star::uno::Sequence<OUString>& rSequence,

View File

@ -161,7 +161,7 @@ protected:
inline XMLTextImportHelper& GetImportHelper() { return rTextImportHelper; }
inline OUString GetServiceName() { return sServiceName; }
inline void SetServiceName(OUString sStr) { sServiceName = sStr; }
inline void SetServiceName(const OUString& sStr) { sServiceName = sStr; }
OUString GetContent();
@ -1197,7 +1197,7 @@ protected:
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet> & xPropertySet);
static const sal_Char* MapBibliographyFieldName(OUString sName);
static const sal_Char* MapBibliographyFieldName(const OUString& sName);
};
/** Import an annotation field (<text:annotation>) */

View File

@ -57,16 +57,16 @@ class XMLTextListsHelper : private boost::noncopyable
// keeping track of processed lists for import and export
// Add optional parameter <sListStyleDefaultListId> (#i92811#)
void KeepListAsProcessed( OUString sListId,
OUString sListStyleName,
OUString sContinueListId,
OUString sListStyleDefaultListId = OUString() );
void KeepListAsProcessed( const OUString& sListId,
const OUString& sListStyleName,
const OUString& sContinueListId,
const OUString& sListStyleDefaultListId = OUString() );
sal_Bool IsListProcessed( const OUString sListId ) const;
sal_Bool IsListProcessed( const OUString& sListId ) const;
OUString GetListStyleOfProcessedList(
const OUString sListId ) const;
const OUString& sListId ) const;
OUString GetContinueListIdOfProcessedList(
const OUString sListId ) const;
const OUString& sListId ) const;
const OUString& GetLastProcessedListId() const;
const OUString& GetListStyleOfLastProcessedList() const;
@ -76,16 +76,16 @@ class XMLTextListsHelper : private boost::noncopyable
OUString GetListIdForListBlock( XMLTextListBlockContext& rListBlock );
// keep track of continue list chain for export
void StoreLastContinuingList( OUString sListId,
OUString sContinuingListId );
void StoreLastContinuingList( const OUString& sListId,
const OUString& sContinuingListId );
OUString GetLastContinuingListId( OUString sListId ) const;
OUString GetLastContinuingListId( const OUString& sListId ) const;
// keep track of opened list elements of a certain list for export
void PushListOnStack( OUString sListId,
OUString sListStyleName );
void PushListOnStack( const OUString& sListId,
const OUString& sListStyleName );
void PopListFromStack();
sal_Bool EqualsToTopListStyleOnStack( const OUString sListId ) const;
sal_Bool EqualsToTopListStyleOnStack( const OUString& sListId ) const;
/** for importing numbered-paragraph
note that the ID namespace for numbered-paragraph and regular list
@ -95,13 +95,13 @@ class XMLTextListsHelper : private boost::noncopyable
::com::sun::star::container::XIndexReplace>
EnsureNumberedParagraph(
SvXMLImport & i_rImport,
const OUString i_ListId,
sal_Int16 & io_rLevel, const OUString i_StyleName);
const OUString& i_ListId,
sal_Int16 & io_rLevel, const OUString& i_StyleName);
/// get ID of the last numbered-paragraph iff it has given style-name
OUString GetNumberedParagraphListId(
const sal_uInt16 i_Level,
const OUString i_StyleName);
const OUString& i_StyleName);
/** Creates a NumRule from given style-name.
@param i_rImport the SvXMLImport
@ -117,8 +117,8 @@ class XMLTextListsHelper : private boost::noncopyable
SvXMLImport & i_rImport,
const ::com::sun::star::uno::Reference<
::com::sun::star::container::XIndexReplace>& i_xNumRule,
const OUString i_ParentStyleName,
const OUString i_StyleName,
const OUString& i_ParentStyleName,
const OUString& i_StyleName,
sal_Int16 & io_rLevel,
sal_Bool* o_pRestartNumbering = 0,
sal_Bool* io_pSetDefaults = 0);

View File

@ -173,7 +173,7 @@ Reference< drawing::XShape > SchXMLAxisContext::getTitleShape()
return xResult;
}
void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor )
void SchXMLAxisContext::CreateGrid( const OUString& sAutoStyleName, bool bIsMajor )
{
Reference< beans::XPropertySet > xDiaProp( m_rImportHelper.GetChartDocument()->getDiagram(), uno::UNO_QUERY );
Reference< chart::XAxis > xAxis( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ) );

View File

@ -65,7 +65,7 @@ private:
bool& m_rbAxisPositionAttributeImported;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTitleShape();
void CreateGrid( OUString sAutoStyleName, bool bIsMajor );
void CreateGrid( const OUString& sAutoStyleName, bool bIsMajor );
void CreateAxis();
void SetAxisTitle();
};

View File

@ -156,7 +156,7 @@ struct RegressionStyle
RegressionStyle(const com::sun::star::uno::Reference<
com::sun::star::chart2::XDataSeries >& xSeries,
OUString sStyleName) :
const OUString& sStyleName) :
m_xSeries ( xSeries ),
msStyleName ( sStyleName )
{}
@ -197,7 +197,7 @@ struct DataRowPointStyle
com::sun::star::chart2::XDataSeries >& xSeries
, sal_Int32 nPointIndex
, sal_Int32 nPointRepeat
, OUString sStyleName
, const OUString& sStyleName
, sal_Int32 nAttachedAxis = 0 ) :
meType( eType ),
m_xSeries( xSeries ),

View File

@ -60,7 +60,7 @@ using com::sun::star::xml::dom::NodeType_ELEMENT_NODE;
static Reference<XNode> lcl_createDomInstance();
static Reference<XNode> lcl_createElement( SvXMLImport& rImport,
sal_uInt16 nPrefix,
const OUString rLocalName,
const OUString& rLocalName,
Reference<XNode> xParent);
@ -195,7 +195,7 @@ static Reference<XNode> lcl_createDomInstance()
static Reference<XNode> lcl_createElement( SvXMLImport& rImport,
sal_uInt16 nPrefix,
const OUString rLocalName,
const OUString& rLocalName,
Reference<XNode> xParent)
{
DBG_ASSERT( xParent.is(), "need parent node" );

View File

@ -290,7 +290,7 @@ void XMLSettingsExportHelper::exportSequencePropertyValue(
}
void XMLSettingsExportHelper::exportSymbolDescriptors(
const uno::Sequence < formula::SymbolDescriptor > &rProps,
const OUString rName) const
const OUString& rName) const
{
uno::Reference< container::XIndexContainer > xBox = document::IndexedPropertyValues::create(m_rContext.GetComponentContext());
@ -397,7 +397,7 @@ void XMLSettingsExportHelper::exportNameAccess(
void XMLSettingsExportHelper::exportIndexAccess(
const uno::Reference<container::XIndexAccess> aIndexed,
const OUString rName) const
const OUString& rName) const
{
DBG_ASSERT(!rName.isEmpty(), "no name");
DBG_ASSERT(aIndexed->getElementType().equals(getCppuType( (uno::Sequence<beans::PropertyValue> *)0 ) ),
@ -418,7 +418,7 @@ void XMLSettingsExportHelper::exportIndexAccess(
void XMLSettingsExportHelper::exportForbiddenCharacters(
const uno::Any &rAny,
const OUString rName) const
const OUString& rName) const
{
uno::Reference<i18n::XForbiddenCharacters> xForbChars;
uno::Reference<linguistic2::XSupportedLocales> xLocales;

View File

@ -165,7 +165,7 @@ void SvXMLAttributeList::Clear()
OSL_ASSERT( ! getLength() );
}
void SvXMLAttributeList::RemoveAttribute( const OUString sName )
void SvXMLAttributeList::RemoveAttribute( const OUString& sName )
{
::std::vector<struct SvXMLTagAttribute_Impl>::iterator ii = m_pImpl->vecAttribute.begin();

View File

@ -63,7 +63,7 @@ namespace xmloff
return aBuffer.makeStringAndClear();
}
bool VCLDateHandler::getPropertyValues( const OUString i_attributeValue, PropertyValues& o_propertyValues ) const
bool VCLDateHandler::getPropertyValues( const OUString& i_attributeValue, PropertyValues& o_propertyValues ) const
{
DateTime aDateTime;
Date aDate;

View File

@ -34,7 +34,7 @@ namespace xmloff
// IPropertyHandler
virtual OUString getAttributeValue( const PropertyValues& i_propertyValues ) const;
virtual OUString getAttributeValue( const ::com::sun::star::uno::Any& i_propertyValue ) const;
virtual bool getPropertyValues( const OUString i_attributeValue, PropertyValues& o_propertyValues ) const;
virtual bool getPropertyValues( const OUString& i_attributeValue, PropertyValues& o_propertyValues ) const;
};
} // namespace xmloff

View File

@ -64,7 +64,7 @@ namespace xmloff
return aBuffer.makeStringAndClear();
}
bool VCLTimeHandler::getPropertyValues( const OUString i_attributeValue, PropertyValues& o_propertyValues ) const
bool VCLTimeHandler::getPropertyValues( const OUString& i_attributeValue, PropertyValues& o_propertyValues ) const
{
Duration aDuration;
Time aTime;

View File

@ -34,7 +34,7 @@ namespace xmloff
// IPropertyHandler
virtual OUString getAttributeValue( const PropertyValues& i_propertyValues ) const;
virtual OUString getAttributeValue( const ::com::sun::star::uno::Any& i_propertyValue ) const;
virtual bool getPropertyValues( const OUString i_attributeValue, PropertyValues& o_propertyValues ) const;
virtual bool getPropertyValues( const OUString& i_attributeValue, PropertyValues& o_propertyValues ) const;
};
} // namespace xmloff

View File

@ -280,7 +280,7 @@ void SvXMLAutoStylePoolP::AddFamily(
sal_Int32 nFamily,
const OUString& rStrName,
SvXMLExportPropertyMapper* pMapper,
OUString aStrPrefix,
const OUString& aStrPrefix,
sal_Bool bAsFamily )
{
UniReference <SvXMLExportPropertyMapper> xTmp = pMapper;

View File

@ -429,13 +429,13 @@ void XMLFootnoteConfigurationImportContext::ProcessSettings(
}
void XMLFootnoteConfigurationImportContext::SetBeginNotice(
OUString sText)
const OUString& sText)
{
sBeginNotice = sText;
}
void XMLFootnoteConfigurationImportContext::SetEndNotice(
OUString sText)
const OUString& sText)
{
sEndNotice = sText;
}

View File

@ -95,8 +95,8 @@ void XMLIndexBibliographyConfigurationContext::StartElement(
void XMLIndexBibliographyConfigurationContext::ProcessAttribute(
sal_uInt16 nPrefix,
OUString sLocalName,
OUString sValue)
const OUString& sLocalName,
const OUString& sValue)
{
if( XML_NAMESPACE_TEXT == nPrefix )
{

View File

@ -126,7 +126,7 @@ void XMLLineNumberingImportContext::StartElement(
void XMLLineNumberingImportContext::ProcessAttribute(
enum LineNumberingToken eToken,
OUString sValue)
const OUString& sValue)
{
bool bTmp(false);
sal_Int32 nTmp;

View File

@ -2795,7 +2795,7 @@ void XMLTextFieldExport::ProcessCommandType(
void XMLTextFieldExport::ProcessStringSequence(
const Sequence<OUString>& rSequence,
const OUString sSelected )
const OUString& sSelected )
{
// find selected element
sal_Int32 nSelected = -1;
@ -3353,7 +3353,7 @@ enum XMLTokenEnum XMLTextFieldExport::MapDocInfoFieldName(
return eElement;
}
enum XMLTokenEnum XMLTextFieldExport::MapBibliographyFieldName(OUString sName)
enum XMLTokenEnum XMLTextFieldExport::MapBibliographyFieldName(const OUString& sName)
{
enum XMLTokenEnum eName = XML_TOKEN_INVALID;

View File

@ -3449,7 +3449,7 @@ void XMLBibliographyFieldImportContext::PrepareField(
}
const sal_Char* XMLBibliographyFieldImportContext::MapBibliographyFieldName(
OUString sName)
const OUString& sName)
{
const sal_Char* pName = NULL;

View File

@ -1285,7 +1285,7 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
/* Apply special case, that found list style equals the chapter numbering, also
to the found list styles of the parent styles. (#i73973#)
*/
static bool lcl_HasListStyle( OUString sStyleName,
static bool lcl_HasListStyle( const OUString& sStyleName,
const Reference < XNameContainer >& xParaStyles,
SvXMLImport& rImport,
const OUString& sNumberingStyleName,
@ -2548,7 +2548,7 @@ OUString XMLTextImportHelper::FindActiveBookmarkName()
}
}
void XMLTextImportHelper::pushFieldCtx( OUString name, OUString type )
void XMLTextImportHelper::pushFieldCtx( const OUString& name, const OUString& type )
{
m_pImpl->m_FieldStack.push(Impl::field_stack_item_t(
Impl::field_name_type_t(name, type), Impl::field_params_t()));
@ -2560,7 +2560,7 @@ void XMLTextImportHelper::popFieldCtx()
m_pImpl->m_FieldStack.pop();
}
void XMLTextImportHelper::addFieldParam( OUString name, OUString value )
void XMLTextImportHelper::addFieldParam( const OUString& name, const OUString& value )
{
DBG_ASSERT(!m_pImpl->m_FieldStack.empty(),
"stack is empty: not good! Do a pushFieldCtx before...");

View File

@ -133,10 +133,10 @@ void XMLTextListsHelper::SetListItem( XMLTextListItemContext *i_pListItem )
}
// Handling for parameter <sListStyleDefaultListId> (#i92811#)
void XMLTextListsHelper::KeepListAsProcessed( OUString sListId,
OUString sListStyleName,
OUString sContinueListId,
OUString sListStyleDefaultListId )
void XMLTextListsHelper::KeepListAsProcessed( const OUString& sListId,
const OUString& sListStyleName,
const OUString& sContinueListId,
const OUString& sListStyleDefaultListId )
{
if ( IsListProcessed( sListId ) )
{
@ -176,7 +176,7 @@ void XMLTextListsHelper::KeepListAsProcessed( OUString sListId,
}
}
sal_Bool XMLTextListsHelper::IsListProcessed( const OUString sListId ) const
sal_Bool XMLTextListsHelper::IsListProcessed( const OUString& sListId ) const
{
if ( mpProcessedLists == 0 )
{
@ -187,7 +187,7 @@ sal_Bool XMLTextListsHelper::IsListProcessed( const OUString sListId ) const
}
OUString XMLTextListsHelper::GetListStyleOfProcessedList(
const OUString sListId ) const
const OUString& sListId ) const
{
if ( mpProcessedLists != 0 )
{
@ -202,7 +202,7 @@ OUString XMLTextListsHelper::GetListStyleOfProcessedList(
}
OUString XMLTextListsHelper::GetContinueListIdOfProcessedList(
const OUString sListId ) const
const OUString& sListId ) const
{
if ( mpProcessedLists != 0 )
{
@ -292,8 +292,8 @@ OUString XMLTextListsHelper::GetListIdForListBlock( XMLTextListBlockContext& rLi
return sListBlockListId;
}
void XMLTextListsHelper::StoreLastContinuingList( OUString sListId,
OUString sContinuingListId )
void XMLTextListsHelper::StoreLastContinuingList( const OUString& sListId,
const OUString& sContinuingListId )
{
if ( mpContinuingLists == 0 )
{
@ -304,7 +304,7 @@ void XMLTextListsHelper::StoreLastContinuingList( OUString sListId,
}
OUString XMLTextListsHelper::GetLastContinuingListId(
OUString sListId ) const
const OUString& sListId ) const
{
if ( mpContinuingLists != 0)
{
@ -319,8 +319,8 @@ OUString XMLTextListsHelper::GetLastContinuingListId(
return sListId;
}
void XMLTextListsHelper::PushListOnStack( OUString sListId,
OUString sListStyleName )
void XMLTextListsHelper::PushListOnStack( const OUString& sListId,
const OUString& sListStyleName )
{
if ( mpListStack == 0 )
{
@ -339,7 +339,7 @@ void XMLTextListsHelper::PopListFromStack()
}
}
sal_Bool XMLTextListsHelper::EqualsToTopListStyleOnStack( const OUString sListId ) const
sal_Bool XMLTextListsHelper::EqualsToTopListStyleOnStack( const OUString& sListId ) const
{
return mpListStack != 0
? sListId == mpListStack->back().second
@ -349,7 +349,7 @@ sal_Bool XMLTextListsHelper::EqualsToTopListStyleOnStack( const OUString sListId
OUString
XMLTextListsHelper::GetNumberedParagraphListId(
const sal_uInt16 i_Level,
const OUString i_StyleName)
const OUString& i_StyleName)
{
if (i_StyleName.isEmpty()) {
OSL_FAIL("invalid numbered-paragraph: no style-name");
@ -382,8 +382,8 @@ ClampLevel(uno::Reference<container::XIndexReplace> const& i_xNumRules,
uno::Reference<container::XIndexReplace>
XMLTextListsHelper::EnsureNumberedParagraph(
SvXMLImport & i_rImport,
const OUString i_ListId,
sal_Int16 & io_rLevel, const OUString i_StyleName)
const OUString& i_ListId,
sal_Int16 & io_rLevel, const OUString& i_StyleName)
{
OSL_ENSURE(!i_ListId.isEmpty(), "invalid ListId");
OSL_ENSURE(io_rLevel >= 0, "invalid Level");
@ -444,8 +444,8 @@ uno::Reference<container::XIndexReplace>
XMLTextListsHelper::MakeNumRule(
SvXMLImport & i_rImport,
const uno::Reference<container::XIndexReplace>& i_rNumRule,
const OUString i_ParentStyleName,
const OUString i_StyleName,
const OUString& i_ParentStyleName,
const OUString& i_StyleName,
sal_Int16 & io_rLevel,
sal_Bool* o_pRestartNumbering,
sal_Bool* io_pSetDefaults)

View File

@ -1037,8 +1037,8 @@ protected:
* are not expected to.
*/
virtual void ProcessAttribute(sal_uInt16 nNamespace,
OUString sLocalName,
OUString sValue,
const OUString& sLocalName,
const OUString& sValue,
Reference<beans::XPropertySet>& rPropSet);
static void GetServiceName(OUString& sServiceName,
@ -1168,8 +1168,8 @@ void XMLIndexMarkImportContext_Impl::ProcessAttributes(
void XMLIndexMarkImportContext_Impl::ProcessAttribute(
sal_uInt16 nNamespace,
OUString sLocalName,
OUString sValue,
const OUString& sLocalName,
const OUString& sValue,
Reference<beans::XPropertySet>& rPropSet)
{
// we only know ID + string-value attribute;
@ -1297,8 +1297,8 @@ protected:
/** process outline level */
virtual void ProcessAttribute(sal_uInt16 nNamespace,
OUString sLocalName,
OUString sValue,
const OUString& sLocalName,
const OUString& sValue,
Reference<beans::XPropertySet>& rPropSet);
};
@ -1315,8 +1315,8 @@ XMLTOCMarkImportContext_Impl::XMLTOCMarkImportContext_Impl(
void XMLTOCMarkImportContext_Impl::ProcessAttribute(
sal_uInt16 nNamespace,
OUString sLocalName,
OUString sValue,
const OUString& sLocalName,
const OUString& sValue,
Reference<beans::XPropertySet>& rPropSet)
{
SAL_WARN_IF(!rPropSet.is(), "xmloff.text", "need PropertySet");
@ -1362,8 +1362,8 @@ protected:
/** process index name */
virtual void ProcessAttribute(sal_uInt16 nNamespace,
OUString sLocalName,
OUString sValue,
const OUString& sLocalName,
const OUString& sValue,
Reference<beans::XPropertySet>& rPropSet);
};
@ -1380,7 +1380,7 @@ XMLUserIndexMarkImportContext_Impl::XMLUserIndexMarkImportContext_Impl(
}
void XMLUserIndexMarkImportContext_Impl::ProcessAttribute(
sal_uInt16 nNamespace, OUString sLocalName, OUString sValue,
sal_uInt16 nNamespace, const OUString& sLocalName, const OUString& sValue,
Reference<beans::XPropertySet>& rPropSet)
{
if ( XML_NAMESPACE_TEXT == nNamespace )
@ -1439,8 +1439,8 @@ protected:
/** process primary + secondary keys */
virtual void ProcessAttribute(sal_uInt16 nNamespace,
OUString sLocalName,
OUString sValue,
const OUString& sLocalName,
const OUString& sValue,
Reference<beans::XPropertySet>& rPropSet);
};
@ -1462,7 +1462,7 @@ XMLAlphaIndexMarkImportContext_Impl::XMLAlphaIndexMarkImportContext_Impl(
}
void XMLAlphaIndexMarkImportContext_Impl::ProcessAttribute(
sal_uInt16 nNamespace, OUString sLocalName, OUString sValue,
sal_uInt16 nNamespace, const OUString& sLocalName, const OUString& sValue,
Reference<beans::XPropertySet>& rPropSet)
{
if (XML_NAMESPACE_TEXT == nNamespace)

View File

@ -171,7 +171,7 @@ public:
XMLIndexMarkHint_Impl( const css::uno::Reference < css::beans::XPropertySet > & rPropSet,
const css::uno::Reference < css::text::XTextRange > & rPos,
OUString sIDString) :
const OUString& sIDString) :
XMLHint_Impl( XML_HINT_INDEX_MARK, rPos, rPos ),
xIndexMarkPropSet( rPropSet ),
sID(sIDString)