From 71c88f02a019dee180686ac9ec88d8c7c1f7f534 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 17 Mar 2014 09:13:09 +0200 Subject: sc: prefer passing OUString by reference Change-Id: I85e8823e872bf53182ce90576225e462edb1930a --- sc/inc/scabstdlg.hxx | 6 ++--- sc/qa/unit/subsequent_filters-test.cxx | 4 +-- sc/source/core/data/dptabsrc.cxx | 2 +- sc/source/filter/excel/xechart.cxx | 2 +- sc/source/filter/excel/xihelper.cxx | 2 +- sc/source/filter/inc/pagesettings.hxx | 4 +-- sc/source/filter/inc/xechart.hxx | 2 +- sc/source/filter/inc/xichart.hxx | 2 +- sc/source/filter/inc/xihelper.hxx | 2 +- sc/source/filter/oox/pagesettings.cxx | 2 +- sc/source/filter/xml/xmlcondformat.cxx | 2 +- sc/source/filter/xml/xmldrani.hxx | 6 ++--- sc/source/filter/xml/xmlfilti.cxx | 2 +- sc/source/filter/xml/xmlfilti.hxx | 2 +- sc/source/filter/xml/xmlimprt.cxx | 2 +- sc/source/filter/xml/xmlimprt.hxx | 2 +- sc/source/ui/Accessibility/AccessibleCell.cxx | 31 ++++++++++------------ .../RandomNumberGeneratorDialog.cxx | 2 +- .../TableFillingAndNavigationTools.cxx | 24 ++++++++--------- sc/source/ui/app/inputwin.cxx | 2 +- sc/source/ui/attrdlg/scdlgfact.cxx | 16 +++++------ sc/source/ui/attrdlg/scdlgfact.hxx | 16 +++++------ sc/source/ui/condformat/condformathelper.cxx | 2 +- sc/source/ui/dbgui/scuiasciiopt.cxx | 4 +-- sc/source/ui/inc/RandomNumberGeneratorDialog.hxx | 2 +- .../ui/inc/TableFillingAndNavigationTools.hxx | 24 ++++++++--------- sc/source/ui/inc/condformathelper.hxx | 2 +- sc/source/ui/inc/impex.hxx | 2 +- sc/source/ui/inc/mtrindlg.hxx | 20 +++++++------- sc/source/ui/inc/navipi.hxx | 4 +-- sc/source/ui/inc/scuiasciiopt.hxx | 2 +- sc/source/ui/miscdlgs/mtrindlg.cxx | 2 +- sc/source/ui/miscdlgs/solvrdlg.cxx | 2 +- sc/source/ui/navipi/navipi.cxx | 4 +-- sc/source/ui/vba/vbastyles.cxx | 2 +- sc/source/ui/vba/vbastyles.hxx | 2 +- sc/source/ui/vba/vbaworksheet.cxx | 8 +++--- sc/source/ui/vba/vbaworksheet.hxx | 2 +- 38 files changed, 108 insertions(+), 111 deletions(-) (limited to 'sc') diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index e4e5fd9ab75d..e28fdbf9147e 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -326,7 +326,7 @@ class ScAbstractDialogFactory public: SC_DLLPUBLIC static ScAbstractDialogFactory* Create(); - virtual AbstractScImportAsciiDlg * CreateScImportAsciiDlg( Window* pParent, OUString aDatName, + virtual AbstractScImportAsciiDlg * CreateScImportAsciiDlg( Window* pParent, const OUString& aDatName, SvStream* pInStream, ScImportAsciiCall eCall) = 0; @@ -367,7 +367,7 @@ public: FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, - OUString aStartStr, + const OUString& aStartStr, double fStep, double fMax, sal_uInt16 nPossDir) = 0; @@ -392,7 +392,7 @@ public: virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg(Window* pParent) = 0; virtual AbstractScMetricInputDlg * CreateScMetricInputDlg ( Window* pParent, - OString sDialogName, + const OString& sDialogName, long nCurrent, long nDefault, FieldUnit eFUnit = FUNIT_MM, diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 66bfb9446e43..92dfbaeeee60 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -1104,8 +1104,8 @@ struct ValDataTestParams sal_uLong nExpectedIndex; ValDataTestParams( ScValidationMode eMode, ScConditionMode eOp, - OUString aExpr1, OUString aExpr2, ScDocument* pDoc, - ScAddress aPos, OUString aETitle, OUString aEMsg, + const OUString& aExpr1, const OUString& aExpr2, ScDocument* pDoc, + ScAddress aPos, const OUString& aETitle, const OUString& aEMsg, ScValidErrorStyle eEStyle, sal_uLong nIndex ): eValMode(eMode), eCondOp(eOp), aStrVal1(aExpr1), aStrVal2(aExpr2), pDocument(pDoc), aPosition(aPos), diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 795bfc2e9460..9e5b5751e32a 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -635,7 +635,7 @@ static long lcl_CountMinMembers(const vector& ppDim, const vecto return nTotal; } -static long lcl_GetIndexFromName( const OUString rName, const uno::Sequence& rElements ) +static long lcl_GetIndexFromName( const OUString& rName, const uno::Sequence& rElements ) { long nCount = rElements.getLength(); const OUString* pArray = rElements.getConstArray(); diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index ecdc9cfcf8b0..2a8f39670ca8 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -972,7 +972,7 @@ sal_uInt16 XclExpChSourceLink::ConvertDataSequence( Reference< XDataSequence > x return ulimit_cast< sal_uInt16 >( nValueCount, EXC_CHDATAFORMAT_MAXPOINTCOUNT ); } -void XclExpChSourceLink::ConvertString( OUString aString ) +void XclExpChSourceLink::ConvertString( const OUString& aString ) { mxString = XclExpStringHelper::CreateString( GetRoot(), aString, EXC_STR_FORCEUNICODE | EXC_STR_8BITLENGTH | EXC_STR_SEPARATEFORMATS ); } diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index b23c1d0b231f..deab5bf5c8d0 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -763,7 +763,7 @@ void XclImpUrlHelper::DecodeUrl( OSL_ENSURE( aTabName.isEmpty(), "XclImpUrlHelper::DecodeUrl - sheet name ignored" ); } -bool XclImpUrlHelper::DecodeLink( OUString& rApplic, OUString& rTopic, const OUString rEncUrl ) +bool XclImpUrlHelper::DecodeLink( OUString& rApplic, OUString& rTopic, const OUString& rEncUrl ) { sal_Int32 nPos = rEncUrl.indexOf( EXC_DDE_DELIM ); if( (nPos != -1) && (0 < nPos) && (nPos + 1 < rEncUrl.getLength()) ) diff --git a/sc/source/filter/inc/pagesettings.hxx b/sc/source/filter/inc/pagesettings.hxx index c386cdd87fc9..5ce87a9d7487 100644 --- a/sc/source/filter/inc/pagesettings.hxx +++ b/sc/source/filter/inc/pagesettings.hxx @@ -162,8 +162,8 @@ private: void convertHeaderFooterData( PropertySet& rPropSet, HFHelperData& orHFData, - const OUString rOddContent, - const OUString rEvenContent, + const OUString& rOddContent, + const OUString& rEvenContent, bool bUseEvenContent, double fPageMargin, double fContentMargin ); diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx index c9c0afed16c7..45427dcf8d76 100644 --- a/sc/source/filter/inc/xechart.hxx +++ b/sc/source/filter/inc/xechart.hxx @@ -407,7 +407,7 @@ public: explicit XclExpChSourceLink( const XclExpChRoot& rRoot, sal_uInt8 nDestType ); - void ConvertString( OUString aString ); + void ConvertString( const OUString& aString ); /** Converts the passed source link, returns the number of linked values. */ sal_uInt16 ConvertDataSequence( XDataSequenceRef xDataSeq, bool bSplitToColumns, sal_uInt16 nDefCount = 0 ); /** Converts the passed sequence of formatted string objects, returns leading font index. */ diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx index fb4cc3146e8d..d43e12fc8880 100644 --- a/sc/source/filter/inc/xichart.hxx +++ b/sc/source/filter/inc/xichart.hxx @@ -736,7 +736,7 @@ public: /** Sets formatting information for the trend line. */ inline void SetDataFormat( XclImpChDataFormatRef xDataFmt ) { mxDataFmt = xDataFmt; } - inline void SetTrendlineName( OUString aTrendlineName) { maTrendLineName = aTrendlineName; } + inline void SetTrendlineName( const OUString& aTrendlineName) { maTrendLineName = aTrendlineName; } /** Creates an API object representing this trend line. */ XRegressionCurveRef CreateRegressionCurve() const; diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx index 3ec03780e461..9c8b568af677 100644 --- a/sc/source/filter/inc/xihelper.hxx +++ b/sc/source/filter/inc/xihelper.hxx @@ -277,7 +277,7 @@ public: @descr For DDE links: Decodes to application name and topic. For OLE object links: Decodes to class name and document URL. @return true = decoding was successful, returned strings are valid (not empty). */ - static bool DecodeLink( OUString& rApplic, OUString& rTopic, const OUString rEncUrl ); + static bool DecodeLink( OUString& rApplic, OUString& rTopic, const OUString& rEncUrl ); private: /** We don't want anybody to instantiate this class, since it is just a diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx index 1f06e82e77c3..81fc024c238d 100644 --- a/sc/source/filter/oox/pagesettings.cxx +++ b/sc/source/filter/oox/pagesettings.cxx @@ -1008,7 +1008,7 @@ void PageSettingsConverter::writePageSettingsProperties( void PageSettingsConverter::convertHeaderFooterData( PropertySet& rPropSet, HFHelperData& orHFData, - const OUString rOddContent, const OUString rEvenContent, bool bUseEvenContent, + const OUString& rOddContent, const OUString& rEvenContent, bool bUseEvenContent, double fPageMargin, double fContentMargin ) { bool bHasOddContent = !rOddContent.isEmpty(); diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index afeec54fee7b..548b07678a9b 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -591,7 +591,7 @@ ScXMLCondContext::ScXMLCondContext( ScXMLImport& rImport, sal_uInt16 nPrfx, namespace { -void setColorEntryType(const OUString& rType, ScColorScaleEntry* pEntry, const OUString rFormula, +void setColorEntryType(const OUString& rType, ScColorScaleEntry* pEntry, const OUString& rFormula, ScXMLImport& rImport) { if(rType == "minimum") diff --git a/sc/source/filter/xml/xmldrani.hxx b/sc/source/filter/xml/xmldrani.hxx index 7e0a6d8b2b75..5147646fc501 100644 --- a/sc/source/filter/xml/xmldrani.hxx +++ b/sc/source/filter/xml/xmldrani.hxx @@ -121,9 +121,9 @@ public: virtual void EndElement(); - void SetDatabaseName(const OUString sTempDatabaseName) { sDatabaseName = sTempDatabaseName; } - void SetConnectionResource(const OUString sTempConRes) { sConnectionResource = sTempConRes; } - void SetSourceObject(const OUString sTempSourceObject) { sSourceObject = sTempSourceObject; } + void SetDatabaseName(const OUString& sTempDatabaseName) { sDatabaseName = sTempDatabaseName; } + void SetConnectionResource(const OUString& sTempConRes) { sConnectionResource = sTempConRes; } + void SetSourceObject(const OUString& sTempSourceObject) { sSourceObject = sTempSourceObject; } void SetSourceType(const com::sun::star::sheet::DataImportMode nTempSourceType) { nSourceType = nTempSourceType; } void SetNative(const bool bTempNative) { bNative = bTempNative; } void SetSubTotalsBindFormatsToContent(const bool bTemp ) { bSubTotalsBindFormatsToContent = bTemp; } diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx index 31a0cbd069d3..2929b6802923 100644 --- a/sc/source/filter/xml/xmlfilti.cxx +++ b/sc/source/filter/xml/xmlfilti.cxx @@ -815,7 +815,7 @@ SvXMLImportContext *ScXMLDPConditionContext::CreateChildContext( sal_uInt16 nPre } void ScXMLDPConditionContext::getOperatorXML( - const OUString sTempOperator, ScQueryOp& aFilterOperator, bool& bUseRegularExpressions) const + const OUString& sTempOperator, ScQueryOp& aFilterOperator, bool& bUseRegularExpressions) const { bUseRegularExpressions = false; if (IsXMLToken(sTempOperator, XML_MATCH)) diff --git a/sc/source/filter/xml/xmlfilti.hxx b/sc/source/filter/xml/xmlfilti.hxx index c6a9536c82fb..b84be06e099d 100644 --- a/sc/source/filter/xml/xmlfilti.hxx +++ b/sc/source/filter/xml/xmlfilti.hxx @@ -342,7 +342,7 @@ public: ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); void getOperatorXML( - const OUString sTempOperator, ScQueryOp& aFilterOperator, bool& bUseRegularExpressions) const; + const OUString& sTempOperator, ScQueryOp& aFilterOperator, bool& bUseRegularExpressions) const; virtual void EndElement(); }; diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 64cfe3db1690..b145b0e5ca63 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -3036,7 +3036,7 @@ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeE UnlockSolarMutex(); } -sal_Int32 ScXMLImport::GetRangeType(const OUString sRangeType) const +sal_Int32 ScXMLImport::GetRangeType(const OUString& sRangeType) const { sal_Int32 nRangeType(0); OUStringBuffer sBuffer; diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index 3ab685731f13..827d8e9462c1 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -1209,7 +1209,7 @@ public: void SetRangeOverflowType(sal_uInt32 nType); - sal_Int32 GetRangeType(const OUString sRangeType) const; + sal_Int32 GetRangeType(const OUString& sRangeType) const; void SetNamedRanges(); void SetSheetNamedRanges(); void SetLabelRanges(); diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 540960ee05dc..38a437c7e2c9 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -485,29 +485,26 @@ void ScAccessibleCell::AddRelation(const ScRange& rRange, } } -static OUString ReplaceOneChar(OUString oldOUString, OUString replacedChar, OUString replaceStr) +static OUString ReplaceOneChar(const OUString& oldOUString, const OUString& replacedChar, const OUString& replaceStr) { - int iReplace = -1; - iReplace = oldOUString.lastIndexOf(replacedChar); - if (iReplace > -1) + int iReplace = oldOUString.lastIndexOf(replacedChar); + OUString aRet = oldOUString; + while(iReplace > -1) { - for(;iReplace>-1;) - { - oldOUString = oldOUString.replaceAt(iReplace,1, replaceStr); - iReplace=oldOUString.lastIndexOf(replacedChar,iReplace); - } + aRet = aRet.replaceAt(iReplace, 1, replaceStr); + iReplace = aRet.lastIndexOf(replacedChar, iReplace); } - return oldOUString; + return aRet; } -static OUString ReplaceFourChar(OUString oldOUString) +static OUString ReplaceFourChar(const OUString& oldOUString) { - oldOUString = ReplaceOneChar(oldOUString, "\\", "\\\\"); - oldOUString = ReplaceOneChar(oldOUString, ";", "\\;"); - oldOUString = ReplaceOneChar(oldOUString, "=", "\\="); - oldOUString = ReplaceOneChar(oldOUString, ",", "\\,"); - oldOUString = ReplaceOneChar(oldOUString, ":", "\\:"); - return oldOUString; + OUString aRet = ReplaceOneChar(oldOUString, "\\", "\\\\"); + aRet = ReplaceOneChar(aRet, ";", "\\;"); + aRet = ReplaceOneChar(aRet, "=", "\\="); + aRet = ReplaceOneChar(aRet, ",", "\\,"); + aRet = ReplaceOneChar(aRet, ":", "\\:"); + return aRet; } uno::Any SAL_CALL ScAccessibleCell::getExtendedAttributes() diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx index 250de89b2ac9..4a2fd8aacc74 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -250,7 +250,7 @@ void ScRandomNumberGeneratorDialog::SelectGeneratorAndGenerateNumbers() } template -void ScRandomNumberGeneratorDialog::GenerateNumbers(RNG randomGenerator, OUString aDistributionName) +void ScRandomNumberGeneratorDialog::GenerateNumbers(RNG randomGenerator, const OUString& aDistributionName) { OUString aUndo = SC_STRLOAD( RID_STATISTICS_DLGS, STR_UNDO_DISTRIBUTION_TEMPLATE); aUndo = aUndo.replaceAll("$(DISTRIBUTION)", aDistributionName); diff --git a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx index 3eb6e13e828f..fe0d2d5e84cc 100644 --- a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx +++ b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx @@ -23,7 +23,7 @@ FormulaTemplate::FormulaTemplate(ScDocument* aDocument, ScAddress::Details aAddr mAddressDetails(aAddressDetails) {} -void FormulaTemplate::setTemplate(OUString aTemplate) +void FormulaTemplate::setTemplate(const OUString& aTemplate) { mTemplate = aTemplate; } @@ -48,41 +48,41 @@ OUString& FormulaTemplate::getTemplate() return mTemplate; } -void FormulaTemplate::autoReplaceRange(OUString aVariable, ScRange aRange) +void FormulaTemplate::autoReplaceRange(const OUString& aVariable, ScRange aRange) { mRangeReplacementMap.insert ( std::pair(aVariable, aRange) ); } -void FormulaTemplate::autoReplaceAddress(OUString aVariable, ScAddress aAddress) +void FormulaTemplate::autoReplaceAddress(const OUString& aVariable, ScAddress aAddress) { mAddressReplacementMap.insert ( std::pair(aVariable, aAddress) ); } -void FormulaTemplate::applyRange(OUString aVariable, ScRange aRange) +void FormulaTemplate::applyRange(const OUString& aVariable, ScRange aRange) { OUString aString = aRange.Format(SCR_ABS, mDocument, mAddressDetails); mTemplate = mTemplate.replaceAll(aVariable, aString); } -void FormulaTemplate::applyRangeList(OUString aVariable, ScRangeList aRangeList) +void FormulaTemplate::applyRangeList(const OUString& aVariable, ScRangeList aRangeList) { OUString aString; aRangeList.Format(aString, SCR_ABS, mDocument); mTemplate = mTemplate.replaceAll(aVariable, aString); } -void FormulaTemplate::applyAddress(OUString aVariable, ScAddress aAddress) +void FormulaTemplate::applyAddress(const OUString& aVariable, ScAddress aAddress) { OUString aString = aAddress.Format(SCR_ABS, mDocument, mAddressDetails); mTemplate = mTemplate.replaceAll(aVariable, aString); } -void FormulaTemplate::applyString(OUString aVariable, OUString aValue) +void FormulaTemplate::applyString(const OUString& aVariable, const OUString& aValue) { mTemplate = mTemplate.replaceAll(aVariable, aValue); } -void FormulaTemplate::applyNumber(OUString aVariable, sal_Int32 aValue) +void FormulaTemplate::applyNumber(const OUString& aVariable, sal_Int32 aValue) { mTemplate = mTemplate.replaceAll(aVariable, OUString::number(aValue)); } @@ -154,13 +154,13 @@ AddressWalkerWriter::AddressWalkerWriter(ScAddress aInitialAddress, ScDocShell* meGrammar(eGrammar) {} -void AddressWalkerWriter::writeFormula(OUString aFormula) +void AddressWalkerWriter::writeFormula(const OUString& aFormula) { mpDocShell->GetDocFunc().SetFormulaCell(mCurrentAddress, new ScFormulaCell(mpDocument, mCurrentAddress, aFormula, meGrammar), true); } -void AddressWalkerWriter::writeMatrixFormula(OUString aFormula) +void AddressWalkerWriter::writeMatrixFormula(const OUString& aFormula) { ScRange aRange; aRange.aStart = mCurrentAddress; @@ -168,7 +168,7 @@ void AddressWalkerWriter::writeMatrixFormula(OUString aFormula) mpDocShell->GetDocFunc().EnterMatrix(aRange, NULL, NULL, aFormula, false, false, OUString(), meGrammar ); } -void AddressWalkerWriter::writeString(OUString aString) +void AddressWalkerWriter::writeString(const OUString& aString) { mpDocShell->GetDocFunc().SetStringCell(mCurrentAddress, aString, true); } @@ -178,7 +178,7 @@ void AddressWalkerWriter::writeString(const char* aCharArray) writeString(OUString::createFromAscii(aCharArray)); } -void AddressWalkerWriter::writeBoldString(OUString aString) +void AddressWalkerWriter::writeBoldString(const OUString& aString) { ScFieldEditEngine& rEngine = mpDocument->GetEditEngine(); rEngine.SetText(aString); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 544a7f1681c8..f448a9aa0bb6 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1872,7 +1872,7 @@ void ScTextWnd::StopEditEngine( bool bAll ) } } -static sal_Int32 findFirstNonMatchingChar(const OUString& rStr1, const OUString rStr2) +static sal_Int32 findFirstNonMatchingChar(const OUString& rStr1, const OUString& rStr2) { // Search the string for unmatching chars const sal_Unicode* pStr1 = rStr1.getStr(); diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index e6c7710c4d30..5685b928793d 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -603,7 +603,7 @@ bool AbstractScTextImportOptionsDlg_Impl::IsDateConversionSet() const } // =========================Factories for createdialog =================== -AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg ( Window* pParent, OUString aDatName, +AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg ( Window* pParent, const OUString& aDatName, SvStream* pInStream, ScImportAsciiCall eCall ) { ScImportAsciiDlg* pDlg = new ScImportAsciiDlg( pParent, aDatName,pInStream, eCall ); @@ -711,11 +711,11 @@ AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContent } AbstractScFillSeriesDlg* ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg( Window* pParent, - ScDocument& rDocument, - FillDir eFillDir, - FillCmd eFillCmd, - FillDateCmd eFillDateCmd, - OUString aStartStr, + ScDocument& rDocument, + FillDir eFillDir, + FillCmd eFillCmd, + FillDateCmd eFillDateCmd, + const OUString& aStartStr, double fStep, double fMax, sal_uInt16 nPossDir) @@ -780,7 +780,7 @@ AbstractScLinkedAreaDlg * ScAbstractDialogFactory_Impl::CreateScLinkedAreaDlg(Wi } AbstractScMetricInputDlg * ScAbstractDialogFactory_Impl::CreateScMetricInputDlg ( Window* pParent, - OString sDialogName, + const OString& sDialogName, long nCurrent, long nDefault, FieldUnit eFUnit, @@ -788,7 +788,7 @@ AbstractScMetricInputDlg * ScAbstractDialogFactory_Impl::CreateScMetricInputDlg long nMaximum , long nMinimum, long nFirst, - long nLast ) + long nLast ) { ScMetricInputDlg * pDlg = new ScMetricInputDlg(pParent, sDialogName, nCurrent ,nDefault, eFUnit, nDecimals, nMaximum , nMinimum , nFirst, nLast); diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 40f7bd13098c..2bc7cf0cdb61 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -395,7 +395,7 @@ class ScAbstractDialogFactory_Impl : public ScAbstractDialogFactory public: virtual ~ScAbstractDialogFactory_Impl() {} - virtual AbstractScImportAsciiDlg * CreateScImportAsciiDlg( Window* pParent, OUString aDatName, + virtual AbstractScImportAsciiDlg * CreateScImportAsciiDlg( Window* pParent, const OUString& aDatName, SvStream* pInStream, ScImportAsciiCall eCall); @@ -432,14 +432,14 @@ public: sal_uInt16 nCheckDefaults = 0); virtual AbstractScFillSeriesDlg * CreateScFillSeriesDlg( Window* pParent, - ScDocument& rDocument, - FillDir eFillDir, - FillCmd eFillCmd, - FillDateCmd eFillDateCmd, - OUString aStartStr, + ScDocument& rDocument, + FillDir eFillDir, + FillCmd eFillCmd, + FillDateCmd eFillDateCmd, + const OUString& aStartStr, double fStep, double fMax, - sal_uInt16 nPossDir); + sal_uInt16 nPossDir); virtual AbstractScGroupDlg * CreateAbstractScGroupDlg( Window* pParent, bool bUnGroup = false, bool bRows = true); @@ -461,7 +461,7 @@ public: virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg(Window* pParent); virtual AbstractScMetricInputDlg * CreateScMetricInputDlg ( Window* pParent, - OString sDialogName, + const OString& sDialogName, long nCurrent, long nDefault, FieldUnit eFUnit = FUNIT_MM, diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx index 3d5f0f83af58..8d44ec43f721 100644 --- a/sc/source/ui/condformat/condformathelper.cxx +++ b/sc/source/ui/condformat/condformathelper.cxx @@ -166,7 +166,7 @@ OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rFormat, c } OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex, - OUString aStr1, OUString aStr2 ) + const OUString& aStr1, const OUString& aStr2 ) { OUStringBuffer aBuffer(getTextForType(eType)); aBuffer.append(" "); diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index e62215367b48..5de5e123e37a 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -177,7 +177,7 @@ static void load_Separators( OUString &sFieldSeparators, OUString &sTextSeparato } static void save_Separators( - OUString maSeparators, OUString maTxtSep, bool bMergeDelimiters, bool bQuotedAsText, + const OUString& maSeparators, const OUString& maTxtSep, bool bMergeDelimiters, bool bQuotedAsText, bool bDetectSpecialNum, bool bFixedWidth, sal_Int32 nFromRow, sal_Int32 nCharSet, sal_Int32 nLanguage, ScImportAsciiCall eCall ) { @@ -235,7 +235,7 @@ static void save_Separators( -ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,OUString aDatName, +ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent, const OUString& aDatName, SvStream* pInStream, ScImportAsciiCall eCall ) : ModalDialog (pParent, "TextImportCsvDialog", "modules/scalc/ui/textimportcsv.ui"), diff --git a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx index 7b0ebb41fa2b..049b92303cc9 100644 --- a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx +++ b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx @@ -61,7 +61,7 @@ private: void GetRangeFromSelection(); template - void GenerateNumbers(RNG randomGenerator, OUString aDistributionName); + void GenerateNumbers(RNG randomGenerator, const OUString& aDistributionName); void SelectGeneratorAndGenerateNumbers(); diff --git a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx index 2f133c05f2bc..ca65ae3c908e 100644 --- a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx +++ b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx @@ -37,18 +37,18 @@ private: public: FormulaTemplate(ScDocument* aDocument, ScAddress::Details aAddressDetails); - void setTemplate(OUString aTemplate); + void setTemplate(const OUString& aTemplate); void setTemplate(const char* aTemplate); OUString& getTemplate(); - void autoReplaceRange(OUString aVariable, ScRange aRange); - void autoReplaceAddress(OUString aVariable, ScAddress aAddress); + void autoReplaceRange(const OUString& aVariable, ScRange aRange); + void autoReplaceAddress(const OUString& aVariable, ScAddress aAddress); - void applyRange(OUString aVariable, ScRange aRange); - void applyRangeList(OUString aVariable, ScRangeList aRangeList); - void applyAddress(OUString aVariable, ScAddress aAddress); - void applyString(OUString aVariable, OUString aValue); - void applyNumber(OUString aVariable, sal_Int32 aValue); + void applyRange(const OUString& aVariable, ScRange aRange); + void applyRangeList(const OUString& aVariable, ScRangeList aRangeList); + void applyAddress(const OUString& aVariable, ScAddress aAddress); + void applyString(const OUString& aVariable, const OUString& aValue); + void applyNumber(const OUString& aVariable, sal_Int32 aValue); }; class AddressWalker @@ -82,11 +82,11 @@ public: AddressWalkerWriter(ScAddress aInitialAddress, ScDocShell* pDocShell, ScDocument* pDocument, formula::FormulaGrammar::Grammar eGrammar ); - void writeFormula(OUString aFormula); - void writeMatrixFormula(OUString aFormula); - void writeString(OUString aString); + void writeFormula(const OUString& aFormula); + void writeMatrixFormula(const OUString& aFormula); + void writeString(const OUString& aString); void writeString(const char* aCharArray); - void writeBoldString(OUString aString); + void writeBoldString(const OUString& aString); void writeValue(double aValue); }; diff --git a/sc/source/ui/inc/condformathelper.hxx b/sc/source/ui/inc/condformathelper.hxx index 47270d061c46..f73f890b21c2 100644 --- a/sc/source/ui/inc/condformathelper.hxx +++ b/sc/source/ui/inc/condformathelper.hxx @@ -32,7 +32,7 @@ public: static SC_DLLPUBLIC OUString GetExpression(const ScConditionalFormat& rFormat, const ScAddress& rPos); static SC_DLLPUBLIC OUString GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex, - OUString aStr1 = OUString(), OUString aStr2 = OUString() ); + const OUString& aStr1 = OUString(), const OUString& aStr2 = OUString() ); }; #endif diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx index b21511d8ed2d..6682acb566ca 100644 --- a/sc/source/ui/inc/impex.hxx +++ b/sc/source/ui/inc/impex.hxx @@ -181,7 +181,7 @@ inline void ScImportExport::SetNoEndianSwap( SvStream& rStrm ) class ScImportStringStream : public SvMemoryStream { public: - ScImportStringStream( const OUString rStr ) + ScImportStringStream( const OUString& rStr ) : SvMemoryStream( (void*)rStr.getStr(), rStr.getLength() * sizeof(sal_Unicode), STREAM_READ) { diff --git a/sc/source/ui/inc/mtrindlg.hxx b/sc/source/ui/inc/mtrindlg.hxx index 448c77345069..4c845afe1dea 100644 --- a/sc/source/ui/inc/mtrindlg.hxx +++ b/sc/source/ui/inc/mtrindlg.hxx @@ -31,16 +31,16 @@ class ScMetricInputDlg : public ModalDialog { public: - ScMetricInputDlg( Window* pParent, - OString sDialogName, - long nCurrent, - long nDefault, - FieldUnit eFUnit = FUNIT_MM, - sal_uInt16 nDecimals = 2, - long nMaximum = 1000, - long nMinimum = 0, - long nFirst = 1, - long nLast = 100 ); + ScMetricInputDlg( Window* pParent, + const OString& sDialogName, + long nCurrent, + long nDefault, + FieldUnit eFUnit = FUNIT_MM, + sal_uInt16 nDecimals = 2, + long nMaximum = 1000, + long nMinimum = 0, + long nFirst = 1, + long nLast = 100 ); long GetInputValue( FieldUnit eUnit = FUNIT_TWIP ) const; diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx index 05b0a236bce0..924f536eb682 100644 --- a/sc/source/ui/inc/navipi.hxx +++ b/sc/source/ui/inc/navipi.hxx @@ -279,10 +279,10 @@ private: { return rBindings; } void SetCurrentCell( SCCOL nCol, SCROW Row ); - void SetCurrentCellStr( const OUString rName ); + void SetCurrentCellStr( const OUString& rName ); void SetCurrentTable( SCTAB nTab ); void SetCurrentTableStr( const OUString& rName ); - void SetCurrentObject( const OUString rName ); + void SetCurrentObject( const OUString& rName ); void SetCurrentDoc( const OUString& rDocName ); ScTabViewShell* GetTabViewShell() const; diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx index 139108376f8e..33095fa140fa 100644 --- a/sc/source/ui/inc/scuiasciiopt.hxx +++ b/sc/source/ui/inc/scuiasciiopt.hxx @@ -82,7 +82,7 @@ class ScImportAsciiDlg : public ModalDialog public: ScImportAsciiDlg( - Window* pParent, OUString aDatName, + Window* pParent, const OUString& aDatName, SvStream* pInStream, ScImportAsciiCall eCall ); ~ScImportAsciiDlg(); diff --git a/sc/source/ui/miscdlgs/mtrindlg.cxx b/sc/source/ui/miscdlgs/mtrindlg.cxx index 0ef64464f46d..1626febd0888 100644 --- a/sc/source/ui/miscdlgs/mtrindlg.cxx +++ b/sc/source/ui/miscdlgs/mtrindlg.cxx @@ -32,7 +32,7 @@ ScMetricInputDlg::ScMetricInputDlg( Window* pParent, - OString sDialogName, + const OString& sDialogName, long nCurrent, long nDefault, FieldUnit eFUnit, diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx index 7999bd8b2c09..718e22517696 100644 --- a/sc/source/ui/miscdlgs/solvrdlg.cxx +++ b/sc/source/ui/miscdlgs/solvrdlg.cxx @@ -36,7 +36,7 @@ namespace { - void lclErrorDialog( Window* pParent, OUString aString ) + void lclErrorDialog( Window* pParent, const OUString& aString ) { ErrorBox( pParent, WinBits( WB_OK | WB_DEF_OK), aString ).Execute(); } diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 56fc3e0d201a..58aedee2ccec 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -1015,7 +1015,7 @@ void ScNavigatorDlg::SetCurrentCell( SCCOL nColNo, SCROW nRowNo ) } } -void ScNavigatorDlg::SetCurrentCellStr( const OUString rName ) +void ScNavigatorDlg::SetCurrentCellStr( const OUString& rName ) { ppBoundItems[0]->ClearCache(); SfxStringItem aNameItem( SID_CURRENTCELL, rName ); @@ -1060,7 +1060,7 @@ void ScNavigatorDlg::SetCurrentTableStr( const OUString& rName ) -void ScNavigatorDlg::SetCurrentObject( const OUString rName ) +void ScNavigatorDlg::SetCurrentObject( const OUString& rName ) { SfxStringItem aNameItem( SID_CURRENTOBJECT, rName ); rBindings.GetDispatcher()->Execute( SID_CURRENTOBJECT, diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx index 6ee4c663a460..9d407b8e60ae 100644 --- a/sc/source/ui/vba/vbastyles.cxx +++ b/sc/source/ui/vba/vbastyles.cxx @@ -141,7 +141,7 @@ ScVbaStyles::Add( const OUString& _sName, const uno::Any& _aBasedOn ) throw (scr } void -ScVbaStyles::Delete(const OUString _sStyleName) throw ( script::BasicErrorException ) +ScVbaStyles::Delete(const OUString& _sStyleName) throw ( script::BasicErrorException ) { try { diff --git a/sc/source/ui/vba/vbastyles.hxx b/sc/source/ui/vba/vbastyles.hxx index f4d75c29d628..8229f256785c 100644 --- a/sc/source/ui/vba/vbastyles.hxx +++ b/sc/source/ui/vba/vbastyles.hxx @@ -34,7 +34,7 @@ class ScVbaStyles: public ScVbaStyles_BASE public: ScVbaStyles( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel ) throw ( css::script::BasicErrorException ); css::uno::Sequence< OUString > getStyleNames() throw ( css::uno::RuntimeException ); - void Delete(const OUString _sStyleName) throw ( css::script::BasicErrorException ); + void Delete(const OUString& _sStyleName) throw ( css::script::BasicErrorException ); // XStyles virtual css::uno::Reference< ov::excel::XStyle > SAL_CALL Add( const OUString& Name, const css::uno::Any& BasedOn ) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception); // XEnumerationAccess diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index ceb1ca767c9b..caa0930ad8d9 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -106,7 +106,7 @@ using namespace com::sun::star; using namespace ooo::vba; -static void getNewSpreadsheetName (OUString &aNewName, OUString aOldName, uno::Reference & xSpreadDoc ) +static void getNewSpreadsheetName (OUString &aNewName, const OUString& aOldName, uno::Reference & xSpreadDoc ) { if (!xSpreadDoc.is()) throw lang::IllegalArgumentException( OUString( "getNewSpreadsheetName() xSpreadDoc is null" ), uno::Reference< uno::XInterface >(), 1 ); @@ -120,7 +120,7 @@ static void getNewSpreadsheetName (OUString &aNewName, OUString aOldName, uno::R } } -static void removeAllSheets( uno::Reference & xSpreadDoc, OUString aSheetName) +static void removeAllSheets( uno::Reference & xSpreadDoc, const OUString& aSheetName) { if (!xSpreadDoc.is()) throw lang::IllegalArgumentException( OUString( "removeAllSheets() xSpreadDoc is null" ), uno::Reference< uno::XInterface >(), 1 ); @@ -150,7 +150,7 @@ static void removeAllSheets( uno::Reference & xSpre } static uno::Reference -openNewDoc(OUString aSheetName ) +openNewDoc(const OUString& aSheetName ) { uno::Reference xModel; try @@ -212,7 +212,7 @@ const uno::Sequence& ScVbaWorksheet::getUnoTunnelId() } uno::Reference< ov::excel::XWorksheet > -ScVbaWorksheet::createSheetCopyInNewDoc(OUString aCurrSheetName) +ScVbaWorksheet::createSheetCopyInNewDoc(const OUString& aCurrSheetName) { uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = getSheet()->createCursor( ); uno::Reference xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW); diff --git a/sc/source/ui/vba/vbaworksheet.hxx b/sc/source/ui/vba/vbaworksheet.hxx index 0891096c01be..87048fc77c57 100644 --- a/sc/source/ui/vba/vbaworksheet.hxx +++ b/sc/source/ui/vba/vbaworksheet.hxx @@ -77,7 +77,7 @@ public: virtual css::uno::Reference< css::sheet::XSpreadsheet > getSheet() { return mxSheet; } static const com::sun::star::uno::Sequence& getUnoTunnelId(); - css::uno::Reference< ov::excel::XWorksheet > createSheetCopyInNewDoc( OUString); + css::uno::Reference< ov::excel::XWorksheet > createSheetCopyInNewDoc( const OUString& ); css::uno::Reference< ov::excel::XWorksheet > createSheetCopy(css::uno::Reference< ov::excel::XWorksheet> xSheet, bool bAfter); // Attributes -- cgit