codemaker/source/codemaker/global.cxx | 6 +++--- codemaker/source/javamaker/javatype.cxx | 16 ++++++++-------- editeng/source/lookuptree/Trie.cxx | 18 +++++++++--------- editeng/source/outliner/outlobj.cxx | 2 +- filter/source/flash/swffilter.cxx | 2 +- filter/source/graphicfilter/eos2met/eos2met.cxx | 4 ++-- filter/source/msfilter/escherex.cxx | 2 +- filter/source/msfilter/util.cxx | 2 +- filter/source/placeware/exporter.cxx | 2 +- filter/source/svg/svgexport.cxx | 2 +- filter/source/xmlfilterdetect/filterdetect.cxx | 2 +- filter/source/xsltdialog/xmlfilterjar.cxx | 5 ++--- include/codemaker/global.hxx | 6 +++--- include/editeng/Trie.hxx | 4 ++-- include/editeng/outlobj.hxx | 2 +- include/filter/msfilter/escherex.hxx | 2 +- include/filter/msfilter/util.hxx | 2 +- include/formula/formdata.hxx | 2 +- include/oox/crypto/DocumentEncryption.hxx | 2 +- include/oox/drawingml/color.hxx | 4 ++-- include/oox/drawingml/shape.hxx | 2 +- include/oox/export/drawingml.hxx | 8 ++++---- include/oox/helper/grabbagstack.hxx | 10 +++++----- include/oox/ppt/comments.hxx | 2 +- include/oox/vml/vmlshape.hxx | 2 +- include/osl/profile.hxx | 2 +- include/toolkit/controls/eventcontainer.hxx | 4 ++-- include/unotools/compatibility.hxx | 2 +- oox/source/crypto/DocumentEncryption.cxx | 2 +- oox/source/drawingml/color.cxx | 2 +- oox/source/drawingml/shape.cxx | 2 +- oox/source/export/drawingml.cxx | 8 ++++---- oox/source/helper/grabbagstack.cxx | 10 +++++----- oox/source/helper/storagebase.cxx | 3 ++- oox/source/ppt/comments.cxx | 3 ++- sal/qa/osl/file/osl_File.cxx | 18 +++++++++--------- sal/qa/osl/module/osl_Module.cxx | 8 ++++---- unotools/source/config/compatibility.cxx | 6 +++--- 38 files changed, 91 insertions(+), 90 deletions(-)
New commits: commit c66229bfa4284758b787bf80ddd1b2e3795881df Author: Noel Grandin <[email protected]> Date: Mon Mar 17 08:58:59 2014 +0200 oox: prefer passing OUString by reference Change-Id: Iace276878e7ae668bba5bb6e36af1e5d5d72d6cb diff --git a/include/oox/crypto/DocumentEncryption.hxx b/include/oox/crypto/DocumentEncryption.hxx index 4410357..55e3d12 100644 --- a/include/oox/crypto/DocumentEncryption.hxx +++ b/include/oox/crypto/DocumentEncryption.hxx @@ -41,7 +41,7 @@ public: DocumentEncryption( com::sun::star::uno::Reference< com::sun::star::io::XStream > xDocumentStream, oox::ole::OleStorage& rOleStorage, - OUString aPassword); + const OUString& aPassword); bool encrypt(); diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx index 951e52b..e3522e5 100644 --- a/include/oox/drawingml/color.hxx +++ b/include/oox/drawingml/color.hxx @@ -61,7 +61,7 @@ public: /** Sets a scheme color from the a:schemeClr element. */ void setSchemeClr( sal_Int32 nToken ); /** Sets the scheme name from the a:schemeClr element for interoperability purposes */ - void setSchemeName( OUString sSchemeName ) { msSchemeName = sSchemeName; } + void setSchemeName( const OUString& sSchemeName ) { msSchemeName = sSchemeName; } /** Sets a system color from the a:sysClr element. */ void setSysClr( sal_Int32 nToken, sal_Int32 nLastRgb ); /** Sets a palette color index. */ @@ -102,7 +102,7 @@ public: /** Translates between color transformation tokens and their names */ static OUString getColorTransformationName( sal_Int32 nElement ); /** Translates between color transformation token names and the corresponding token */ - static sal_Int32 getColorTransformationToken( OUString sName ); + static sal_Int32 getColorTransformationToken( const OUString& sName ); private: /** Internal helper for getColor(). */ diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx index 911298f..2d0cb45 100644 --- a/include/oox/drawingml/shape.hxx +++ b/include/oox/drawingml/shape.hxx @@ -179,7 +179,7 @@ public: getDiagramDoms() { return maDiagramDoms; } void setDiagramDoms(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rDiagramDoms) { maDiagramDoms = rDiagramDoms; } com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< com::sun::star::uno::Any > >resolveRelationshipsOfTypeFromOfficeDoc( - core::XmlFilterBase& rFilter, OUString sFragment, OUString sType ); + core::XmlFilterBase& rFilter, const OUString& sFragment, const OUString& sType ); protected: ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index cf2de85..b2c8d76 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -95,10 +95,10 @@ protected: /// If set, this is the parent of the currently handled shape. com::sun::star::uno::Reference<com::sun::star::drawing::XShape> m_xParent; - bool GetProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString aName ); + bool GetProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, const OUString& aName ); bool GetPropertyAndState( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > rXPropState, - OUString aName, ::com::sun::star::beans::PropertyState& eState ); + const OUString& aName, ::com::sun::star::beans::PropertyState& eState ); const char* GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun, sal_Bool& bIsField ); @@ -123,14 +123,14 @@ public: OUString WriteImage( const Graphic &rGraphic , bool bRelPathToMedia = false); void WriteColor( sal_uInt32 nColor, sal_Int32 nAlpha = MAX_PERCENT ); - void WriteColor( OUString sColorSchemeName, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations ); + void WriteColor( const OUString& sColorSchemeName, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations ); void WriteColorTransformations( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations ); void WriteGradientStop( sal_uInt16 nStop, sal_uInt32 nColor ); void WriteLineArrow( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, sal_Bool bLineStart ); void WriteConnectorConnections( EscherConnectorListEntry& rConnectorEntry, sal_Int32 nStartID, sal_Int32 nEndID ); void WriteSolidFill( sal_uInt32 nColor, sal_Int32 nAlpha = MAX_PERCENT ); - void WriteSolidFill( OUString sSchemeName, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations ); + void WriteSolidFill( const OUString& sSchemeName, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations ); void WriteSolidFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet ); void WriteGradientFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet ); void WriteGradientFill( ::com::sun::star::awt::Gradient rGradient ); diff --git a/include/oox/helper/grabbagstack.hxx b/include/oox/helper/grabbagstack.hxx index 8a73237..619964e 100644 --- a/include/oox/helper/grabbagstack.hxx +++ b/include/oox/helper/grabbagstack.hxx @@ -34,7 +34,7 @@ private: GrabBagStackElement mCurrentElement; public: - GrabBagStack(OUString aName); + GrabBagStack(const OUString& aName); virtual ~GrabBagStack(); @@ -42,11 +42,11 @@ public: css::beans::PropertyValue getRootProperty(); - void appendElement(OUString aName, css::uno::Any aAny); - void push(OUString aKey); + void appendElement(const OUString& aName, css::uno::Any aAny); + void push(const OUString& aKey); void pop(); - void addInt32(OUString aElementName, sal_Int32 aIntValue); - void addString(OUString aElementName, OUString aStringValue); + void addInt32(const OUString& aElementName, sal_Int32 aIntValue); + void addString(const OUString& aElementName, const OUString& aStringValue); bool isStackEmpty(); }; diff --git a/include/oox/ppt/comments.hxx b/include/oox/ppt/comments.hxx index c32b8f6..a44b7da 100644 --- a/include/oox/ppt/comments.hxx +++ b/include/oox/ppt/comments.hxx @@ -57,7 +57,7 @@ class Comment OUString text; ::com::sun::star::util::DateTime aDateTime; - void setDateTime (OUString datetime); + void setDateTime (const OUString& datetime); public: void setAuthorId(const OUString& _aId) diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx index 8e0183d..5105425 100644 --- a/include/oox/vml/vmlshape.hxx +++ b/include/oox/vml/vmlshape.hxx @@ -286,7 +286,7 @@ class SimpleShape : public ShapeBase public: explicit SimpleShape( Drawing& rDrawing, const OUString& rService ); - void setService( OUString aService ) { maService = aService; } + void setService( const OUString& aService ) { maService = aService; } protected: /** Creates the corresponding XShape and inserts it into the passed container. */ diff --git a/oox/source/crypto/DocumentEncryption.cxx b/oox/source/crypto/DocumentEncryption.cxx index e0941cf..8928101 100644 --- a/oox/source/crypto/DocumentEncryption.cxx +++ b/oox/source/crypto/DocumentEncryption.cxx @@ -25,7 +25,7 @@ using namespace css::uno; using namespace std; -DocumentEncryption::DocumentEncryption(Reference< XStream > xDocumentStream, oox::ole::OleStorage& rOleStorage, OUString aPassword) : +DocumentEncryption::DocumentEncryption(Reference< XStream > xDocumentStream, oox::ole::OleStorage& rOleStorage, const OUString& aPassword) : mxDocumentStream(xDocumentStream), mrOleStorage(rOleStorage), maPassword(aPassword) diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index bebc967..5933449 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -382,7 +382,7 @@ OUString Color::getColorTransformationName( sal_Int32 nElement ) return OUString(); } -sal_Int32 Color::getColorTransformationToken( OUString sName ) +sal_Int32 Color::getColorTransformationToken( const OUString& sName ) { if( sName == "red" ) return XML_red; diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 3487b31..56342dd 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1207,7 +1207,7 @@ void Shape::putPropertiesToGrabBag( const Sequence< PropertyValue >& aProperties } } -uno::Sequence< uno::Sequence< uno::Any > > Shape::resolveRelationshipsOfTypeFromOfficeDoc(core::XmlFilterBase& rFilter, OUString sFragment, OUString sType ) +uno::Sequence< uno::Sequence< uno::Any > > Shape::resolveRelationshipsOfTypeFromOfficeDoc(core::XmlFilterBase& rFilter, const OUString& sFragment, const OUString& sType ) { uno::Sequence< uno::Sequence< uno::Any > > xRelListTemp; sal_Int32 counter = 0; diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 5f869ee..aeeff25 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -123,7 +123,7 @@ void DrawingML::ResetCounters() mnImageCounter = 1; } -bool DrawingML::GetProperty( Reference< XPropertySet > rXPropSet, OUString aName ) +bool DrawingML::GetProperty( Reference< XPropertySet > rXPropSet, const OUString& aName ) { bool bRetValue = false; @@ -136,7 +136,7 @@ bool DrawingML::GetProperty( Reference< XPropertySet > rXPropSet, OUString aName return bRetValue; } -bool DrawingML::GetPropertyAndState( Reference< XPropertySet > rXPropSet, Reference< XPropertyState > rXPropState, OUString aName, PropertyState& eState ) +bool DrawingML::GetPropertyAndState( Reference< XPropertySet > rXPropSet, Reference< XPropertyState > rXPropState, const OUString& aName, PropertyState& eState ) { bool bRetValue = false; @@ -180,7 +180,7 @@ void DrawingML::WriteColor( sal_uInt32 nColor, sal_Int32 nAlpha ) } } -void DrawingML::WriteColor( OUString sColorSchemeName, Sequence< PropertyValue > aTransformations ) +void DrawingML::WriteColor( const OUString& sColorSchemeName, Sequence< PropertyValue > aTransformations ) { // prevent writing a tag with empty val attribute if( sColorSchemeName.isEmpty() ) @@ -220,7 +220,7 @@ void DrawingML::WriteSolidFill( sal_uInt32 nColor, sal_Int32 nAlpha ) mpFS->endElementNS( XML_a, XML_solidFill ); } -void DrawingML::WriteSolidFill( OUString sSchemeName, Sequence< PropertyValue > aTransformations ) +void DrawingML::WriteSolidFill( const OUString& sSchemeName, Sequence< PropertyValue > aTransformations ) { mpFS->startElementNS( XML_a, XML_solidFill, FSEND ); WriteColor( sSchemeName, aTransformations ); diff --git a/oox/source/helper/grabbagstack.cxx b/oox/source/helper/grabbagstack.cxx index b62f5e2..a8dbb6c 100644 --- a/oox/source/helper/grabbagstack.cxx +++ b/oox/source/helper/grabbagstack.cxx @@ -17,7 +17,7 @@ namespace oox using namespace css::beans; using namespace css::uno; -GrabBagStack::GrabBagStack(OUString aName) +GrabBagStack::GrabBagStack(const OUString& aName) { mCurrentElement.maName = aName; } @@ -54,7 +54,7 @@ PropertyValue GrabBagStack::getRootProperty() return aProperty; } -void GrabBagStack::appendElement(OUString aName, Any aAny) +void GrabBagStack::appendElement(const OUString& aName, Any aAny) { PropertyValue aValue; aValue.Name = aName; @@ -62,7 +62,7 @@ void GrabBagStack::appendElement(OUString aName, Any aAny) mCurrentElement.maPropertyList.push_back(aValue); } -void GrabBagStack::push(OUString aKey) +void GrabBagStack::push(const OUString& aKey) { mStack.push(mCurrentElement); mCurrentElement.maName = aKey; @@ -83,12 +83,12 @@ void GrabBagStack::pop() appendElement(aName, makeAny(aSequence)); } -void GrabBagStack::addInt32(OUString aElementName, sal_Int32 aIntValue) +void GrabBagStack::addInt32(const OUString& aElementName, sal_Int32 aIntValue) { appendElement(aElementName, makeAny(aIntValue)); } -void GrabBagStack::addString(OUString aElementName, OUString aStringValue) +void GrabBagStack::addString(const OUString& aElementName, const OUString& aStringValue) { appendElement(aElementName, makeAny(aStringValue)); } diff --git a/oox/source/helper/storagebase.cxx b/oox/source/helper/storagebase.cxx index 0e049c6..17deba7 100644 --- a/oox/source/helper/storagebase.cxx +++ b/oox/source/helper/storagebase.cxx @@ -37,8 +37,9 @@ using namespace ::com::sun::star::uno; namespace { -void lclSplitFirstElement( OUString& orElement, OUString& orRemainder, OUString aFullName ) +void lclSplitFirstElement( OUString& orElement, OUString& orRemainder, const OUString& _aFullName ) { + OUString aFullName = _aFullName; sal_Int32 nSlashPos = aFullName.indexOf( '/' ); // strip leading slashes diff --git a/oox/source/ppt/comments.cxx b/oox/source/ppt/comments.cxx index efeabac..81d22e9 100644 --- a/oox/source/ppt/comments.cxx +++ b/oox/source/ppt/comments.cxx @@ -30,8 +30,9 @@ void CommentAuthorList::setValues(const CommentAuthorList& list) } //DateTime is saved as : 2013-01-10T15:53:26.000 -void Comment::setDateTime (OUString datetime) +void Comment::setDateTime (const OUString& _datetime) { + OUString datetime = _datetime; aDateTime.Year = datetime.getToken(0,'-').toInt32(); aDateTime.Month = datetime.getToken(1,'-').toInt32(); aDateTime.Day = datetime.getToken(2,'-').toInt32(); commit bd8ce8b959f6147a2175a8ce84fd212151ca05dc Author: Noel Grandin <[email protected]> Date: Fri Mar 14 15:14:28 2014 +0200 sal,toolkit,unotools: prefer passing OUString by reference Change-Id: Ie62a59fd9ff3d6f6a34240fd562fbc91a143bf3a diff --git a/include/osl/profile.hxx b/include/osl/profile.hxx index e2ae145..1c1e899 100644 --- a/include/osl/profile.hxx +++ b/include/osl/profile.hxx @@ -44,7 +44,7 @@ namespace osl { /** Open or create a configuration profile. @return 0 if the profile could not be created, otherwise a handle to the profile. */ - Profile(const rtl::OUString strProfileName, oslProfileOption Options = Profile_DEFAULT ) + Profile(const rtl::OUString & strProfileName, oslProfileOption Options = Profile_DEFAULT ) { profile = osl_openProfile(strProfileName.pData, Options); if( ! profile ) diff --git a/include/toolkit/controls/eventcontainer.hxx b/include/toolkit/controls/eventcontainer.hxx index ebdacda..20f6222 100644 --- a/include/toolkit/controls/eventcontainer.hxx +++ b/include/toolkit/controls/eventcontainer.hxx @@ -36,7 +36,7 @@ namespace toolkit // Hashtable to optimize struct hashName_Impl { - size_t operator()(const OUString Str) const + size_t operator()(const OUString& Str) const { return (size_t)Str.hashCode(); } @@ -44,7 +44,7 @@ struct hashName_Impl struct eqName_Impl { - bool operator()(const OUString Str1, const OUString Str2) const + bool operator()(const OUString& Str1, const OUString& Str2) const { return ( Str1 == Str2 ); } diff --git a/include/unotools/compatibility.hxx b/include/unotools/compatibility.hxx index a9afa0c..1108307 100644 --- a/include/unotools/compatibility.hxx +++ b/include/unotools/compatibility.hxx @@ -137,7 +137,7 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options void Clear(); - void SetDefault( OUString sName, bool bValue ); + void SetDefault( const OUString & sName, bool bValue ); /*-**************************************************************************************************** @short return complete specified list diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index 17607a6..63b9bcb 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -321,7 +321,7 @@ inline bool isURL( const sal_Char *pathname ) /** simple version to judge if a file name or directory name is a URL or a system path, just to see if it is start with "file:///";. */ -inline bool isURL( const ::rtl::OUString pathname ) +inline bool isURL( const ::rtl::OUString& pathname ) { return pathname.startsWith( aPreURL ); } @@ -346,7 +346,7 @@ inline void concatURL( ::rtl::OUString & pathname1, const ::rtl::OUString & path /** create a temp test file using OUString name of full qualified URL or system path. */ -inline void createTestFile( const ::rtl::OUString filename ) +inline void createTestFile( const ::rtl::OUString& filename ) { ::rtl::OUString aPathURL = filename.copy( 0 ); ::osl::FileBase::RC nError; @@ -367,7 +367,7 @@ inline void createTestFile( const ::rtl::OUString filename ) /** create a temp test file using OUString name of full qualified URL or system path in a base directory. */ -inline void createTestFile( const ::rtl::OUString basename, const ::rtl::OUString filename ) +inline void createTestFile( const ::rtl::OUString& basename, const ::rtl::OUString& filename ) { ::rtl::OUString aBaseURL = basename.copy( 0 ); @@ -377,7 +377,7 @@ inline void createTestFile( const ::rtl::OUString basename, const ::rtl::OUStrin /** detete a temp test file using OUString name. */ -inline void deleteTestFile( const ::rtl::OUString filename ) +inline void deleteTestFile( const ::rtl::OUString& filename ) { // LLA: printf("deleteTestFile\n"); ::rtl::OUString aPathURL = filename.copy( 0 ); @@ -395,7 +395,7 @@ inline void deleteTestFile( const ::rtl::OUString filename ) /** delete a temp test file using OUString name of full qualified URL or system path in a base directory. */ -inline void deleteTestFile( const ::rtl::OUString basename, const ::rtl::OUString filename ) +inline void deleteTestFile( const ::rtl::OUString& basename, const ::rtl::OUString& filename ) { ::rtl::OUString aBaseURL = basename.copy( 0 ); @@ -405,7 +405,7 @@ inline void deleteTestFile( const ::rtl::OUString basename, const ::rtl::OUStrin /** create a temp test directory using OUString name of full qualified URL or system path. */ -inline void createTestDirectory( const ::rtl::OUString dirname ) +inline void createTestDirectory( const ::rtl::OUString& dirname ) { ::rtl::OUString aPathURL = dirname.copy( 0 ); ::osl::FileBase::RC nError; @@ -420,7 +420,7 @@ inline void createTestDirectory( const ::rtl::OUString dirname ) /** create a temp test directory using OUString name of full qualified URL or system path in a base directory. */ -inline void createTestDirectory( const ::rtl::OUString basename, const ::rtl::OUString dirname ) +inline void createTestDirectory( const ::rtl::OUString& basename, const ::rtl::OUString& dirname ) { ::rtl::OUString aBaseURL = basename.copy( 0 ); @@ -430,7 +430,7 @@ inline void createTestDirectory( const ::rtl::OUString basename, const ::rtl::OU /** delete a temp test directory using OUString name of full qualified URL or system path. */ -inline void deleteTestDirectory( const ::rtl::OUString dirname ) +inline void deleteTestDirectory( const ::rtl::OUString& dirname ) { ::rtl::OUString aPathURL = dirname.copy( 0 ); ::osl::FileBase::RC nError; @@ -450,7 +450,7 @@ inline void deleteTestDirectory( const ::rtl::OUString dirname ) /** delete a temp test directory using OUString name of full qualified URL or system path in a base directory. */ -inline void deleteTestDirectory( const ::rtl::OUString basename, const ::rtl::OUString dirname ) +inline void deleteTestDirectory( const ::rtl::OUString& basename, const ::rtl::OUString& dirname ) { ::rtl::OUString aBaseURL = basename.copy( 0 ); diff --git a/sal/qa/osl/module/osl_Module.cxx b/sal/qa/osl/module/osl_Module.cxx index 84e851e..e93e29a 100644 --- a/sal/qa/osl/module/osl_Module.cxx +++ b/sal/qa/osl/module/osl_Module.cxx @@ -69,14 +69,14 @@ inline ::rtl::OUString getDllURL( void ) return dllPath; } -inline bool isURL( const ::rtl::OUString pathname ) +inline bool isURL( const ::rtl::OUString& pathname ) { return pathname.startsWith( "file:///" ); } /** create a temp test directory using OUString name of full qualified URL or system path. */ -inline void createTestDirectory( const ::rtl::OUString dirname ) +inline void createTestDirectory( const ::rtl::OUString& dirname ) { ::rtl::OUString aPathURL = dirname.copy( 0 ); ::osl::FileBase::RC nError; @@ -89,7 +89,7 @@ inline void createTestDirectory( const ::rtl::OUString dirname ) /** delete a temp test directory using OUString name of full qualified URL or system path. */ -inline void deleteTestDirectory( const ::rtl::OUString dirname ) +inline void deleteTestDirectory( const ::rtl::OUString& dirname ) { ::rtl::OUString aPathURL = dirname.copy( 0 ); ::osl::FileBase::RC nError; @@ -127,7 +127,7 @@ inline bool ifFileExist( const ::rtl::OUString & str ) /** detete a temp test file using OUString name. */ -inline void deleteTestFile( const ::rtl::OUString filename ) +inline void deleteTestFile( const ::rtl::OUString& filename ) { ::rtl::OUString aPathURL = filename.copy( 0 ); ::osl::FileBase::RC nError; diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx index c56b579..2fed816 100644 --- a/unotools/source/config/compatibility.cxx +++ b/unotools/source/config/compatibility.cxx @@ -227,7 +227,7 @@ class SvtCompatibilityOptions_Impl : public ConfigItem SvtCompatibilityOptions_Impl(); ~SvtCompatibilityOptions_Impl(); - void SetDefault( OUString sName, bool bValue ); + void SetDefault( const OUString & sName, bool bValue ); // overloaded methods of baseclass @@ -426,7 +426,7 @@ SvtCompatibilityOptions_Impl::~SvtCompatibilityOptions_Impl() } } -void SvtCompatibilityOptions_Impl::SetDefault( OUString sName, bool bValue ) +void SvtCompatibilityOptions_Impl::SetDefault( const OUString & sName, bool bValue ) { if ( COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS.equals( sName ) ) m_aDefOptions.SetUsePrtMetrics( bValue ); @@ -689,7 +689,7 @@ void SvtCompatibilityOptions::Clear() m_pDataContainer->Clear(); } -void SvtCompatibilityOptions::SetDefault( OUString sName, bool bValue ) +void SvtCompatibilityOptions::SetDefault( const OUString & sName, bool bValue ) { m_pDataContainer->SetDefault( sName, bValue ); } commit d593f45886cbe6ee9d54af1cf84b11a9004efc61 Author: Noel Grandin <[email protected]> Date: Fri Mar 14 13:23:06 2014 +0200 filter,formula: prefer passing OUString by reference Change-Id: I332f1a593853283b72ecf4dfd82b36cc091661b4 diff --git a/filter/source/flash/swffilter.cxx b/filter/source/flash/swffilter.cxx index 5654a69..927c458 100644 --- a/filter/source/flash/swffilter.cxx +++ b/filter/source/flash/swffilter.cxx @@ -177,7 +177,7 @@ FlashExportFilter::FlashExportFilter(const Reference< XComponentContext > &rxCon -OUString exportBackground(FlashExporter &aFlashExporter, Reference< XDrawPage > xDrawPage, OUString sPath, sal_uInt32 nPage, const char* suffix) +OUString exportBackground(FlashExporter &aFlashExporter, Reference< XDrawPage > xDrawPage, const OUString& sPath, sal_uInt32 nPage, const char* suffix) { OUString filename = STR("slide") + VAL(nPage+1) + STR(suffix) + STR(".swf"); OUString fullpath = sPath + STR("/") + filename; diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx index 425416e..04b7cba 100644 --- a/filter/source/graphicfilter/eos2met/eos2met.cxx +++ b/filter/source/graphicfilter/eos2met/eos2met.cxx @@ -214,7 +214,7 @@ private: void METFullArc(Point aCenter, double fMultiplier); void METPartialArcAtCurPos(Point aCenter, double fMultiplier, double fStartAngle, double fSweepAngle); - void METChrStr(Point aPt, OUString aStr); + void METChrStr(Point aPt, const OUString& aStr); void METSetArcParams(sal_Int32 nP, sal_Int32 nQ, sal_Int32 nR, sal_Int32 nS); void METSetColor(Color aColor); void METSetBackgroundColor(Color aColor); @@ -1374,7 +1374,7 @@ void METWriter::METPartialArcAtCurPos(Point aCenter, double fMultiplier, } -void METWriter::METChrStr( Point aPt, OUString aUniStr ) +void METWriter::METChrStr( Point aPt, const OUString& aUniStr ) { OString aStr(OUStringToOString(aUniStr, osl_getThreadTextEncoding())); diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 0831b66..44d2c75 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -5198,7 +5198,7 @@ void EscherEx::ReplacePersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset ) PtReplace( ESCHER_Persist_PrivateEntry | nKey, nOffset ); } -void EscherEx::SetEditAs( OUString rEditAs ) +void EscherEx::SetEditAs( const OUString& rEditAs ) { mEditAs = rEditAs; } diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index dfdff3a..36636ca 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -1323,7 +1323,7 @@ const char* GetOOXMLPresetGeometry( const char* sShapeType ) typedef boost::unordered_map< const char*, MSO_SPT, rtl::CStringHash, rtl::CStringEqual> DMLToVMLTranslationHashMap; static DMLToVMLTranslationHashMap* pDMLToVMLMap; -MSO_SPT GETVMLShapeType(OString aType) +MSO_SPT GETVMLShapeType(const OString& aType) { const char* pDML = GetOOXMLPresetGeometry(aType.getStr()); diff --git a/filter/source/placeware/exporter.cxx b/filter/source/placeware/exporter.cxx index a0bbaaa..a87821c 100644 --- a/filter/source/placeware/exporter.cxx +++ b/filter/source/placeware/exporter.cxx @@ -172,7 +172,7 @@ static void encodeFile( osl::File& rSourceFile, Reference< XOutputStream >& xOut } } -static OString convertString( OUString aInput ) +static OString convertString( const OUString& aInput ) { OString aRet( aInput.getStr(), aInput.getLength(), RTL_TEXTENCODING_ASCII_US ); aRet = aRet.replace( '\r', ' ' ); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 126c05e..7cf948a 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -125,7 +125,7 @@ public: } virtual ~TextField() {} protected: - void implGrowCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets, OUString sText, OUString sTextFieldId ) const + void implGrowCharSet( SVGFilter::UCharSetMapMap & aTextFieldCharSets, const OUString& sText, const OUString& sTextFieldId ) const { const sal_Unicode * ustr = sText.getStr(); sal_Int32 nLength = sText.getLength(); diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx index 0b24914..378d8fb 100644 --- a/filter/source/xmlfilterdetect/filterdetect.cxx +++ b/filter/source/xmlfilterdetect/filterdetect.cxx @@ -75,7 +75,7 @@ using namespace com::sun::star::beans; namespace { -OUString supportedByType( const OUString clipBoardFormat , const OUString resultString, const OUString checkType) +OUString supportedByType( const OUString& clipBoardFormat, const OUString& resultString, const OUString& checkType) { OUString sTypeName; if ( clipBoardFormat.match("doctype:") ) diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx index c6cc5e4..63f247a 100644 --- a/filter/source/xsltdialog/xmlfilterjar.cxx +++ b/filter/source/xsltdialog/xmlfilterjar.cxx @@ -102,15 +102,14 @@ static Reference< XInterface > addFolder( Reference< XInterface >& xRootFolder, return xFolder; } -static void _addFile( Reference< XInterface >& xRootFolder, Reference< XSingleServiceFactory >& xFactory, Reference< XInputStream >& xInput, OUString aName ) throw( Exception ) +static void _addFile( Reference< XInterface >& xRootFolder, Reference< XSingleServiceFactory >& xFactory, Reference< XInputStream >& xInput, const OUString& aName ) throw( Exception ) { - Reference< XActiveDataSink > xSink( xFactory->createInstance(), UNO_QUERY ); Reference< XUnoTunnel > xTunnel( xSink, UNO_QUERY ); if( xSink.is() && xTunnel.is()) { Reference< XNameContainer > xNameContainer(xRootFolder, UNO_QUERY ); - xNameContainer->insertByName(aName = encodeZipUri( aName ), makeAny(xTunnel)); + xNameContainer->insertByName(encodeZipUri( aName ), makeAny(xTunnel)); xSink->setInputStream( xInput ); } } diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index a97dd87..f87aa53 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -1644,7 +1644,7 @@ public: sal_Bool SeekToPersistOffset( sal_uInt32 nKey ); virtual sal_Bool InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue ); // nValue is being inserted into the Stream where it's appropriate (overwrite modus), without that the // current StreamPosition changes - void SetEditAs( OUString rEditAs ); + void SetEditAs( const OUString& rEditAs ); rtl::OUString GetEditAs() { return mEditAs; } SvStream& GetStream() const { return *mpOutStrm; } sal_uLong GetStreamPos() const { return mpOutStrm->Tell(); } diff --git a/include/filter/msfilter/util.hxx b/include/filter/msfilter/util.hxx index b22c6fb..ddf5a12 100644 --- a/include/filter/msfilter/util.hxx +++ b/include/filter/msfilter/util.hxx @@ -136,7 +136,7 @@ MSFILTER_DLLPUBLIC EquationResult ParseCombinedChars(const OUString& rStr); MSFILTER_DLLPUBLIC const char* GetOOXMLPresetGeometry( const char* sShapeType ); /// Similar to EnhancedCustomShapeTypeNames::Get(), but returns an MSO_SPT (binary / VML type). -MSFILTER_DLLPUBLIC MSO_SPT GETVMLShapeType(OString aType); +MSFILTER_DLLPUBLIC MSO_SPT GETVMLShapeType(const OString& aType); } diff --git a/include/formula/formdata.hxx b/include/formula/formdata.hxx index 63033f4..0827119 100644 --- a/include/formula/formdata.hxx +++ b/include/formula/formdata.hxx @@ -55,7 +55,7 @@ public: inline void SetEdFocus( sal_uInt16 nNew ) { nEdFocus = nNew; } inline void SetUndoStr( const OUString& rNew ) { aUndoStr = rNew; } inline void SetMatrixFlag(bool bNew) { bMatrix=bNew;} - inline void SetUniqueId(const OString nNew) { aUniqueId=nNew;} + inline void SetUniqueId(const OString& nNew) { aUniqueId=nNew;} inline void SetSelection(const Selection& aSel) { aSelection=aSel;} protected: void Reset(); commit c58fe8c85f159c6b456223b51981f411e312e33b Author: Noel Grandin <[email protected]> Date: Fri Mar 14 11:36:22 2014 +0200 codemaker,editeng: prefer passing OUString by reference Change-Id: If3e2dd3905cc33f1e7fc9fbfbb9f2bb49a756a34 diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx index 9ec4d6b..202f64a 100644 --- a/codemaker/source/codemaker/global.cxx +++ b/codemaker/source/codemaker/global.cxx @@ -63,10 +63,10 @@ OString getTempDir(const OString& sFileName) } OString createFileNameFromType( const OString& destination, - const OString typeName, - const OString postfix, + const OString& typeName, + const OString& postfix, bool bLowerCase, - const OString prefix ) + const OString& prefix ) { OString type(typeName.replace('.', '/')); diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx index e7d3f6d..f40b80f 100644 --- a/codemaker/source/javamaker/javatype.cxx +++ b/codemaker/source/javamaker/javatype.cxx @@ -691,7 +691,7 @@ void addTypeInfo( } void handleEnumType( - OUString name, rtl::Reference< unoidl::EnumTypeEntity > const & entity, + const OUString& name, rtl::Reference< unoidl::EnumTypeEntity > const & entity, JavaOptions const & options) { assert(entity.is()); @@ -1406,7 +1406,7 @@ void addPlainStructBaseArguments( } void handlePlainStructType( - OUString name, + const OUString& name, rtl::Reference< unoidl::PlainStructTypeEntity > const & entity, rtl::Reference< TypeManager > const & manager, JavaOptions const & options, Dependencies * dependencies) @@ -1491,7 +1491,7 @@ void handlePlainStructType( } void handlePolyStructType( - OUString name, + const OUString& name, rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > const & entity, rtl::Reference< TypeManager > const & manager, JavaOptions const & options, @@ -1626,7 +1626,7 @@ void addExceptionBaseArguments( } void handleExceptionType( - OUString name, rtl::Reference< unoidl::ExceptionTypeEntity > const & entity, + const OUString& name, rtl::Reference< unoidl::ExceptionTypeEntity > const & entity, rtl::Reference< TypeManager > const & manager, JavaOptions const & options, Dependencies * dependencies) { @@ -1797,7 +1797,7 @@ void createExceptionsAttribute( } void handleInterfaceType( - OUString name, rtl::Reference< unoidl::InterfaceTypeEntity > const & entity, + const OUString& name, rtl::Reference< unoidl::InterfaceTypeEntity > const & entity, rtl::Reference< TypeManager > const & manager, JavaOptions const & options, Dependencies * dependencies) { @@ -1956,7 +1956,7 @@ void handleTypedef( } void handleConstantGroup( - OUString name, rtl::Reference< unoidl::ConstantGroupEntity > const & entity, + const OUString& name, rtl::Reference< unoidl::ConstantGroupEntity > const & entity, rtl::Reference< TypeManager > const & manager, JavaOptions const & options, Dependencies * dependencies) { @@ -2208,7 +2208,7 @@ void addConstructor( } void handleService( - OUString name, + const OUString& name, rtl::Reference< unoidl::SingleInterfaceBasedServiceEntity > const & entity, rtl::Reference< TypeManager > const & manager, JavaOptions const & options, Dependencies * dependencies) @@ -2307,7 +2307,7 @@ void handleService( } void handleSingleton( - OUString name, + const OUString& name, rtl::Reference< unoidl::InterfaceBasedSingletonEntity > const & entity, rtl::Reference< TypeManager > const & manager, JavaOptions const & options, Dependencies * dependencies) diff --git a/editeng/source/lookuptree/Trie.cxx b/editeng/source/lookuptree/Trie.cxx index 5ed7ea3..7565513 100644 --- a/editeng/source/lookuptree/Trie.cxx +++ b/editeng/source/lookuptree/Trie.cxx @@ -31,10 +31,10 @@ struct TrieNode void markWord(); TrieNode* findChild(sal_Unicode aCharacter); - TrieNode* traversePath(OUString sPath); + TrieNode* traversePath(const OUString& sPath); void addNewChild(TrieNode* pChild); - void collectSuggestions(OUString sPath, std::vector<OUString>& rSuggestionList); - void collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPath, vector<OUString>& rSuggestionList); + void collectSuggestions(const OUString& sPath, std::vector<OUString>& rSuggestionList); + void collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector<OUString>& rSuggestionList); }; TrieNode::TrieNode(sal_Unicode aCharacter) : @@ -99,7 +99,7 @@ TrieNode* TrieNode::findChild(sal_Unicode aInputCharacter) return NULL; } -void TrieNode::collectSuggestions(OUString sPath, vector<OUString>& rSuggestionList) +void TrieNode::collectSuggestions(const OUString& sPath, vector<OUString>& rSuggestionList) { // first traverse nodes for alphabet characters for (int i=0; i<LATIN_ARRAY_SIZE; i++) @@ -119,7 +119,7 @@ void TrieNode::collectSuggestions(OUString sPath, vector<OUString>& rSuggestionL } } -void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPath, vector<OUString>& rSuggestionList) +void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector<OUString>& rSuggestionList) { OUString aStringPath = sPath + OUString(pCurrent->mCharacter); if(pCurrent->mMarker) @@ -130,7 +130,7 @@ void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPa pCurrent->collectSuggestions(aStringPath, rSuggestionList); } -TrieNode* TrieNode::traversePath(OUString sPath) +TrieNode* TrieNode::traversePath(const OUString& sPath) { TrieNode* pCurrent = this; @@ -154,7 +154,7 @@ Trie::Trie() : Trie::~Trie() {} -void Trie::insert(OUString sInputString) const +void Trie::insert(const OUString& sInputString) const { // adding an empty word is not allowed if ( sInputString.isEmpty() ) @@ -186,13 +186,13 @@ void Trie::insert(OUString sInputString) const pCurrent->markWord(); } -void Trie::findSuggestions(OUString sWordPart, vector<OUString>& rSuggesstionList) const +void Trie::findSuggestions(const OUString& sWordPart, vector<OUString>& rSuggestionList) const { TrieNode* pNode = mRoot->traversePath(sWordPart); if (pNode != NULL) { - pNode->collectSuggestions(sWordPart, rSuggesstionList); + pNode->collectSuggestions(sWordPart, rSuggestionList); } } diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx index 1eabd48..077d567 100644 --- a/editeng/source/outliner/outlobj.cxx +++ b/editeng/source/outliner/outlobj.cxx @@ -254,7 +254,7 @@ void OutlinerParaObject::ChangeStyleSheetName(SfxStyleFamily eFamily, mpImplOutlinerParaObject->mpEditTextObject->ChangeStyleSheetName(eFamily, rOldName, rNewName); } -void OutlinerParaObject::SetStyleSheets(sal_uInt16 nLevel, const OUString rNewName, +void OutlinerParaObject::SetStyleSheets(sal_uInt16 nLevel, const OUString& rNewName, const SfxStyleFamily& rNewFamily) { const sal_Int32 nCount(Count()); diff --git a/include/codemaker/global.hxx b/include/codemaker/global.hxx index e75b61d..6ee033c 100644 --- a/include/codemaker/global.hxx +++ b/include/codemaker/global.hxx @@ -105,10 +105,10 @@ private: ::rtl::OString getTempDir(const ::rtl::OString& sFileName); ::rtl::OString createFileNameFromType(const ::rtl::OString& destination, - const ::rtl::OString type, - const ::rtl::OString postfix, + const ::rtl::OString& type, + const ::rtl::OString& postfix, bool bLowerCase=false, - const ::rtl::OString prefix=""); + const ::rtl::OString& prefix=""); bool fileExists(const ::rtl::OString& fileName); bool makeValidTypeFile(const ::rtl::OString& targetFileName, diff --git a/include/editeng/Trie.hxx b/include/editeng/Trie.hxx index f5f42f0..c8963d8 100644 --- a/include/editeng/Trie.hxx +++ b/include/editeng/Trie.hxx @@ -30,8 +30,8 @@ public: Trie(); virtual ~Trie(); - void insert(OUString sInputString) const; - void findSuggestions(OUString sWordPart, std::vector<OUString>& rSuggesstionList) const; + void insert(const OUString& sInputString) const; + void findSuggestions(const OUString& sWordPart, std::vector<OUString>& rSuggestionList) const; void getAllEntries(std::vector<OUString>& entries); }; diff --git a/include/editeng/outlobj.hxx b/include/editeng/outlobj.hxx index 193241c..4464bf3 100644 --- a/include/editeng/outlobj.hxx +++ b/include/editeng/outlobj.hxx @@ -75,7 +75,7 @@ public: const OUString& rNewName, SfxStyleFamily eNewFamily); void ChangeStyleSheetName(SfxStyleFamily eFamily, const OUString& rOldName, const OUString& rNewName); - void SetStyleSheets(sal_uInt16 nLevel, const OUString rNewName, + void SetStyleSheets(sal_uInt16 nLevel, const OUString& rNewName, const SfxStyleFamily& rNewFamily); }; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
