summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-12 16:39:03 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-18 07:37:31 +0000
commit789055bc2acb4c71483fd60ea258d158bd5aec10 (patch)
tree7849de841a71f667a30b2a971ad0c3d406110396 /sw/source
parent150ac9cf05ed9da6a2af5bc3f820280fd853e519 (diff)
clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/acmplwrd.cxx4
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx2
-rw-r--r--sw/source/core/doc/doccorr.cxx1
-rw-r--r--sw/source/core/doc/docedt.cxx2
-rw-r--r--sw/source/core/doc/doctxm.cxx2
-rw-r--r--sw/source/core/doc/extinput.cxx2
-rw-r--r--sw/source/core/doc/number.cxx4
-rw-r--r--sw/source/core/docnode/node.cxx3
-rw-r--r--sw/source/core/docnode/nodes.cxx3
-rw-r--r--sw/source/core/edit/edlingu.cxx4
-rw-r--r--sw/source/core/frmedt/fews.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx21
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks1.cxx5
-rw-r--r--sw/source/core/text/txtfly.cxx2
-rw-r--r--sw/source/core/text/xmldump.cxx4
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx2
-rw-r--r--sw/source/core/txtnode/txtedt.cxx13
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx6
-rw-r--r--sw/source/core/unocore/unosett.cxx3
-rw-r--r--sw/source/filter/html/css1atr.cxx2
-rw-r--r--sw/source/filter/html/htmlatr.cxx2
-rw-r--r--sw/source/filter/html/htmlforw.cxx6
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx23
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx8
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx5
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx6
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par.cxx2
-rw-r--r--sw/source/filter/xml/xmlimp.cxx2
-rw-r--r--sw/source/ui/misc/glossary.cxx5
-rw-r--r--sw/source/ui/vba/vbabookmarks.cxx9
-rw-r--r--sw/source/ui/vba/vbafield.cxx3
-rw-r--r--sw/source/ui/vba/vbatablehelper.cxx10
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx14
-rw-r--r--sw/source/uibase/envelp/labelcfg.cxx5
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx7
-rw-r--r--sw/source/uibase/fldui/xfldui.cxx3
-rw-r--r--sw/source/uibase/misc/glosdoc.cxx3
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx4
-rw-r--r--sw/source/uibase/shells/textsh1.cxx2
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.cxx2
-rw-r--r--sw/source/uibase/uiview/viewprt.cxx2
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx2
-rw-r--r--sw/source/uibase/uno/unoatxt.cxx4
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx44
-rw-r--r--sw/source/uibase/uno/unotxvw.cxx2
-rw-r--r--sw/source/uibase/utlui/content.cxx2
48 files changed, 116 insertions, 156 deletions
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 694370b6b717..8d8c7ebe9238 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -349,10 +349,8 @@ void SwAutoCompleteWord::SetMinWordLen( sal_uInt16 n )
*/
bool SwAutoCompleteWord::GetWordsMatching(const OUString& aMatch, std::vector<OUString>& aWords) const
{
- OUString aStringRoot = aMatch;
-
std::vector<OUString> suggestions;
- m_LookupTree.findSuggestions(aStringRoot, suggestions);
+ m_LookupTree.findSuggestions(aMatch, suggestions);
if (suggestions.empty())
{
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index b07da5a08ab2..23770384b36e 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -625,7 +625,7 @@ static OUString lcl_dbg_out(const SwNode & rNode)
const SwNumRuleItem & rItem =
static_cast<const SwNumRuleItem &>
(pColl->GetFormatAttr(RES_PARATR_NUMRULE));
- const OUString sNumruleName = rItem.GetValue();
+ const OUString& sNumruleName = rItem.GetValue();
if (!sNumruleName.isEmpty())
{
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 3b88d7d95440..a93cc46acb04 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -213,7 +213,6 @@ void SwDoc::CorrAbs(
{
SwPosition aStart(*rRange.Start());
SwPosition aEnd(*rRange.End());
- SwPosition aNewPos(rNewPos);
_DelBookmarks( aStart.nNode, aEnd.nNode, nullptr, &aStart.nContent, &aEnd.nContent );
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index fe173a69568a..02df0f3e5605 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -593,7 +593,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
uno::Reference< lang::XComponent > xDoc( GetDocShell()->GetBaseModel(), uno::UNO_QUERY );
// Expand the string:
const ModelToViewHelper aConversionMap(*pNd->GetTextNode());
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
// get XFlatParagraph to use...
uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *pNd->GetTextNode(), aExpandText, aConversionMap );
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 2eb305a5aa6b..ae2fda623a03 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -612,7 +612,7 @@ OUString SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
}
bool bUseChkStr = !sChkStr.isEmpty();
- const OUString aName( rType.GetTypeName() );
+ const OUString& aName( rType.GetTypeName() );
const sal_Int32 nNmLen = aName.getLength();
SwSectionFormats::size_type nNum = 0;
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 8fdf1767b93a..a681747b11b3 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -148,7 +148,7 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData )
}
SwIndex aIdx( pTNd, nSttCnt );
- const OUString rNewStr = rData.GetText();
+ const OUString& rNewStr = rData.GetText();
if( bIsOverwriteCursor && !sOverwriteText.isEmpty() )
{
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index b6bc8cfc5491..8bedd5747c2c 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -708,8 +708,8 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto
SVX_NUM_CHAR_SPECIAL != rMyNFormat.GetNumberingType() &&
SVX_NUM_BITMAP != rMyNFormat.GetNumberingType() )
{
- const OUString sPrefix = rMyNFormat.GetPrefix();
- const OUString sSuffix = rMyNFormat.GetSuffix();
+ const OUString& sPrefix = rMyNFormat.GetPrefix();
+ const OUString& sSuffix = rMyNFormat.GetSuffix();
aStr = sPrefix + aStr + sSuffix;
if ( pExtremities )
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 0dff01656efb..392143c44e96 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1592,8 +1592,7 @@ bool SwContentNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr )
sal_uInt16 nDel = 0;
if( IsModifyLocked() )
{
- std::vector<sal_uInt16> aClearWhichIds(rWhichArr);
- nDel = ClearItemsFromAttrSet( aClearWhichIds );
+ nDel = ClearItemsFromAttrSet( rWhichArr );
}
else
{
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index d28606e7d0d2..479fcfd722f4 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -197,7 +197,6 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
bSavePersData = bRestPersData = true;
OUString sNumRule;
- SwNodeIndex aInsPos( rInsPos );
for( sal_uLong n = 0; n < nSz; n++ )
{
SwNode* pNd = &rDelPos.GetNode();
@@ -241,7 +240,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
RemoveNode( rDelPos.GetIndex(), 1, false ); // move indices
SwContentNode * pCNd = pNd->GetContentNode();
- rNds.InsertNode( pNd, aInsPos );
+ rNds.InsertNode( pNd, rInsPos );
if( pCNd )
{
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 185e17e14b7c..85c4283380aa 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -980,7 +980,7 @@ bool SwEditShell::GetGrammarCorrection(
// Expand the string:
const ModelToViewHelper aConversionMap(*pNode);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
// get XFlatParagraph to use...
uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *pNode, aExpandText, aConversionMap );
@@ -1445,7 +1445,7 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh
if( bGrammarErrorFound )
{
const ModelToViewHelper aConversionMap(static_cast<SwTextNode&>(pCursor->GetNode()));
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
sal_Int32 nSentenceEnd =
aConversionMap.ConvertToViewPosition( aGrammarResult.nBehindEndOfSentencePosition );
// remove trailing space
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index d3cbf43758c1..32b4f8e0a1ce 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -884,7 +884,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
aEnvOfObj.GetHoriEnvironmentLayoutFrame( *pFrame );
const SwLayoutFrame& rVertEnvironLayFrame =
aEnvOfObj.GetVertEnvironmentLayoutFrame( *pFrame );
- SwRect aHoriEnvironRect( rHoriEnvironLayFrame.Frame() );
+ const SwRect& aHoriEnvironRect( rHoriEnvironLayFrame.Frame() );
SwRect aVertEnvironRect;
if ( _bFollowTextFlow )
{
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 36ab1611372b..4f856fb11545 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4295,10 +4295,7 @@ void SwFlyFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect,
// OD 06.08.2002 #99657# - paint border before painting background
// paint border
- {
- SwRect aTmp( rRect );
- PaintBorder( aTmp, pPage, rAttrs );
- }
+ PaintBorder( rRect, pPage, rAttrs );
rRenderContext.Pop();
}
@@ -6720,8 +6717,7 @@ void SwPageFrame::RefreshSubsidiary( const SwRect &rRect ) const
{
if ( IS_SUBS || isTableBoundariesEnabled() || IS_SUBS_SECTION || IS_SUBS_FLYS )
{
- SwRect aRect( rRect );
- if ( aRect.HasArea() )
+ if ( rRect.HasArea() )
{
//During paint using the root, the array is controlled from there.
//Otherwise we'll handle it for our self.
@@ -6734,7 +6730,7 @@ void SwPageFrame::RefreshSubsidiary( const SwRect &rRect ) const
bDelSubs = true;
}
- RefreshLaySubsidiary( this, aRect );
+ RefreshLaySubsidiary( this, rRect );
if ( bDelSubs )
{
@@ -7411,15 +7407,14 @@ void SwFrame::Retouch( const SwPageFrame * pPage, const SwRect &rRect ) const
for ( size_t i = 0; i < aRegion.size(); ++i )
{
- SwRect &rRetouche = aRegion[i];
+ const SwRect &rRetouche = aRegion[i];
GetUpper()->PaintBaBo( rRetouche, pPage );
//Hell and Heaven need to be refreshed too.
//To avoid recursion my retouch flag needs to be reset first!
ResetRetouche();
- SwRect aRetouchePart( rRetouche );
- if ( aRetouchePart.HasArea() )
+ if ( rRetouche.HasArea() )
{
const Color aPageBackgrdColor(pPage->GetDrawBackgrdColor());
const IDocumentDrawModelAccess& rIDDMA = pSh->getIDocumentDrawModelAccess();
@@ -7428,11 +7423,11 @@ void SwFrame::Retouch( const SwPageFrame * pPage, const SwRect &rRect ) const
// <--
pSh->Imp()->PaintLayer( rIDDMA.GetHellId(), nullptr,
- aRetouchePart, &aPageBackgrdColor,
+ rRetouche, &aPageBackgrdColor,
pPage->IsRightToLeft(),
&aSwRedirector );
pSh->Imp()->PaintLayer( rIDDMA.GetHeavenId(), nullptr,
- aRetouchePart, &aPageBackgrdColor,
+ rRetouche, &aPageBackgrdColor,
pPage->IsRightToLeft(),
&aSwRedirector );
}
@@ -7441,7 +7436,7 @@ void SwFrame::Retouch( const SwPageFrame * pPage, const SwRect &rRect ) const
//Because we leave all paint areas, we need to refresh the
//subsidiary lines.
- pPage->RefreshSubsidiary( aRetouchePart );
+ pPage->RefreshSubsidiary( rRetouche );
}
}
if ( SwViewShell::IsLstEndAction() )
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 278b063fd352..1d76da96cc27 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -345,8 +345,7 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const OUString& rShort, const OUString&
xBlkRoot->Commit ( );
}
*/
- OUString aFolderName( rPackageName );
- OUString aStreamName = aFolderName + ".xml";
+ OUString aStreamName = rPackageName + ".xml";
uno::Reference< uno::XComponentContext > xContext =
comphelper::getProcessComponentContext();
@@ -356,7 +355,7 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const OUString& rShort, const OUString&
try
{
- xRoot = xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::WRITE );
+ xRoot = xBlkRoot->openStorageElement( rPackageName, embed::ElementModes::WRITE );
uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement( aStreamName,
embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE );
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 91c6d8d4cba3..ff280299bc0a 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -669,7 +669,7 @@ bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
if ( bInFooterOrHeader )
{
- SwFormatVertOrient aVert( rFrameFormat.GetVertOrient() );
+ const SwFormatVertOrient& aVert( rFrameFormat.GetVertOrient() );
bool bVertPrt = aVert.GetRelationOrient() == text::RelOrientation::PRINT_AREA ||
aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA;
if( bVertPrt )
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index bfb5615f40e1..cedffc9dee73 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -161,9 +161,7 @@ class XmlPortionDumper:public SwPortionHandler
xmlTextWriterWriteFormatAttribute( writer,
BAD_CAST( "nType" ),
"%s", getTypeName( nType ) );
- OUString sText( rText );
- OString sText8 =OUStringToOString( sText,
- RTL_TEXTENCODING_UTF8 );
+ OString sText8 = OUStringToOString( rText, RTL_TEXTENCODING_UTF8 );
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rText" ),
"%s", sText8.getStr( ) );
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index 4bebebc673cb..244e8cd4b58d 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -253,7 +253,7 @@ SwCharFormat* SwTextRuby::GetCharFormat()
if( !rFormat.GetText().isEmpty() )
{
const SwDoc* pDoc = GetTextNode().GetDoc();
- const OUString rStr = rFormat.GetCharFormatName();
+ const OUString& rStr = rFormat.GetCharFormatName();
const sal_uInt16 nId = rStr.isEmpty()
? static_cast<sal_uInt16>(RES_POOLCHR_RUBYTEXT)
: rFormat.GetCharFormatId();
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index aea49647eb09..8ce9787f4495 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1264,7 +1264,6 @@ SwRect SwTextFrame::_AutoSpell( const SwContentNode* pActNode, sal_Int32 nActPos
}
// a change of data indicates that at least one word has been modified
- const bool bRedlineChg = (pNode->GetText().getStr() != aOldText.getStr());
sal_Int32 nBegin = 0;
sal_Int32 nEnd = pNode->GetText().getLength();
@@ -1371,13 +1370,7 @@ SwRect SwTextFrame::_AutoSpell( const SwContentNode* pActNode, sal_Int32 nActPos
}
else if( bAddAutoCmpl && rACW.GetMinWordLen() <= rWord.getLength() )
{
- if ( bRedlineChg )
- {
- OUString rNewWord( rWord );
- rACW.InsertWord( rNewWord, *pDoc );
- }
- else
- rACW.InsertWord( rWord, *pDoc );
+ rACW.InsertWord( rWord, *pDoc );
}
}
}
@@ -1488,7 +1481,7 @@ SwRect SwTextFrame::SmartTagScan( SwContentNode* /*pActNode*/, sal_Int32 /*nActP
{
// Expand the string:
const ModelToViewHelper aConversionMap(*pNode /*TODO - replace or expand fields for smart tags?*/);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
// Ownership ov ConversionMap is passed to SwXTextMarkup object!
uno::Reference<text::XTextMarkup> const xTextMarkup =
@@ -2015,7 +2008,7 @@ bool SwTextNode::CountWords( SwDocStat& rStat,
// ConversionMap to expand fields, remove invisible and redline deleted text for scanner
const ModelToViewHelper aConversionMap(*this, ExpandMode::ExpandFields | ExpandMode::ExpandFootnote | ExpandMode::HideInvisible | ExpandMode::HideDeletions);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
if (aExpandText.isEmpty() && !bCountNumbering)
{
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index bf288eb39a31..a40c10302bbc 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -470,7 +470,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara()
{
// Expand the string:
const ModelToViewHelper aConversionMap(*pRet);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
xRet = new SwXFlatParagraph( *pRet, aExpandText, aConversionMap );
// keep hard references...
@@ -522,7 +522,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaAfter(co
{
// Expand the string:
const ModelToViewHelper aConversionMap(*pNextTextNode);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
xRet = new SwXFlatParagraph( *pNextTextNode, aExpandText, aConversionMap );
// keep hard references...
@@ -568,7 +568,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaBefore(c
{
// Expand the string:
const ModelToViewHelper aConversionMap(*pPrevTextNode);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
xRet = new SwXFlatParagraph( *pPrevTextNode, aExpandText, aConversionMap );
// keep hard references...
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 39589aad681e..d21d7813eb93 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1373,10 +1373,9 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat
aPropertyValues.push_back(comphelper::makePropertyValue("Suffix", aUString));
//char style name
- OUString CharStyleName(rCharFormatName);
aUString.clear();
- SwStyleNameMapper::FillProgName( CharStyleName, aUString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true );
+ SwStyleNameMapper::FillProgName( rCharFormatName, aUString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true );
aPropertyValues.push_back(comphelper::makePropertyValue("CharStyleName", aUString));
//startvalue
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index ba607ed812c9..e16bb4d642c9 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -1600,7 +1600,7 @@ static Writer& OutCSS1_SwFormat( Writer& rWrt, const SwFormat& rFormat,
if( USER_FMT & nPoolFormatId )
{
// user templates
- const OUString aNm(rFormat.GetName());
+ const OUString& aNm(rFormat.GetName());
if (aNm == "DD 1" || aNm == "DT 1")
rHTMLWrt.m_nDfltBottomMargin = 0;
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index fe8597ea5979..884bd34b24af 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -1679,7 +1679,7 @@ void HTMLEndPosLst::InsertNoScript( const SfxPoolItem& rItem,
case HTML_AUTOFMT_VALUE:
{
const SwFormatAutoFormat& rAutoFormat = static_cast<const SwFormatAutoFormat&>(rItem);
- const std::shared_ptr<SfxItemSet> pSet = rAutoFormat.GetStyleHandle();
+ const std::shared_ptr<SfxItemSet>& pSet = rAutoFormat.GetStyleHandle();
if( pSet.get() )
Insert( *pSet.get(), nStart, nEnd, rFormatInfos, true, bParaAttrs );
}
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 591a0cebecfc..23ab86eb0ca6 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -641,7 +641,7 @@ const SdrObject *SwHTMLWriter::GetHTMLControl( const SwDrawFrameFormat& rFormat
return nullptr;
const SdrUnoObj& rFormObj = dynamic_cast<const SdrUnoObj&>(*pObj);
- uno::Reference< awt::XControlModel > xControlModel =
+ const uno::Reference< awt::XControlModel >& xControlModel =
rFormObj.GetUnoControlModel();
OSL_ENSURE( xControlModel.is(), "UNO-Control ohne Model" );
@@ -691,7 +691,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt,
const SdrUnoObj& rFormObj,
bool bInCntnr )
{
- uno::Reference< awt::XControlModel > xControlModel =
+ const uno::Reference< awt::XControlModel >& xControlModel =
rFormObj.GetUnoControlModel();
OSL_ENSURE( xControlModel.is(), "UNO-Control ohne Model" );
@@ -1280,7 +1280,7 @@ static void AddControl( HTMLControls& rControls,
const SdrUnoObj& rFormObj,
sal_uInt32 nNodeIdx )
{
- uno::Reference< awt::XControlModel > xControlModel =
+ const uno::Reference< awt::XControlModel >& xControlModel =
rFormObj.GetUnoControlModel();
if( !xControlModel.is() )
return;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4a4035ada22d..383d7c57671c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2355,10 +2355,9 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge
OUStringToOString( sMark, RTL_TEXTENCODING_UTF8 ).getStr( ) );
}
- OUString sTarget( rTarget );
- if ( !sTarget.isEmpty() )
+ if ( !rTarget.isEmpty() )
{
- OString soTarget = OUStringToOString( sTarget, RTL_TEXTENCODING_UTF8 );
+ OString soTarget = OUStringToOString( rTarget, RTL_TEXTENCODING_UTF8 );
m_pHyperlinkAttrList->add(FSNS( XML_w, XML_tgtFrame ), soTarget.getStr());
}
}
@@ -6060,12 +6059,11 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
FSEND );
// text
- OUString aText( rNumberingString );
- OUStringBuffer aBuffer( aText.getLength() + WW8ListManager::nMaxLevel );
+ OUStringBuffer aBuffer( rNumberingString.getLength() + WW8ListManager::nMaxLevel );
- const sal_Unicode *pPrev = aText.getStr();
- const sal_Unicode *pIt = aText.getStr();
- while ( pIt < aText.getStr() + aText.getLength() )
+ const sal_Unicode *pPrev = rNumberingString.getStr();
+ const sal_Unicode *pIt = rNumberingString.getStr();
+ while ( pIt < rNumberingString.getStr() + rNumberingString.getLength() )
{
// convert the level values to %NUMBER form
// (we don't use pNumLvlPos at all)
@@ -6084,7 +6082,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
aBuffer.append( pPrev, pIt - pPrev );
// If bullet char is empty, set lvlText as empty
- if ( aText.equals ( OUString(sal_Unicode(0)) ) && nNumberingType == SVX_NUM_CHAR_SPECIAL )
+ if ( rNumberingString.equals ( OUString(sal_Unicode(0)) ) && nNumberingType == SVX_NUM_CHAR_SPECIAL )
{
m_pSerializer->singleElementNS( XML_w, XML_lvlText, FSNS( XML_w, XML_val ), "", FSEND );
}
@@ -6271,7 +6269,7 @@ void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement )
void DocxAttributeOutput::CharFont( const SvxFontItem& rFont)
{
GetExport().GetId( rFont ); // ensure font info is written to fontTable.xml
- OUString sFontName(rFont.GetFamilyName());
+ const OUString& sFontName(rFont.GetFamilyName());
OString sFontNameUtf8 = OUStringToOString(sFontName, RTL_TEXTENCODING_UTF8);
if (!sFontNameUtf8.isEmpty())
AddToAttrList( m_pFontsAttrList, 2,
@@ -6427,7 +6425,7 @@ void DocxAttributeOutput::CharBackground( const SvxBrushItem& rBrush )
void DocxAttributeOutput::CharFontCJK( const SvxFontItem& rFont )
{
- OUString sFontName(rFont.GetFamilyName());
+ const OUString& sFontName(rFont.GetFamilyName());
OString sFontNameUtf8 = OUStringToOString(sFontName, RTL_TEXTENCODING_UTF8);
AddToAttrList( m_pFontsAttrList, FSNS( XML_w, XML_eastAsia ), sFontNameUtf8.getStr() );
}
@@ -6450,10 +6448,9 @@ void DocxAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight )
void DocxAttributeOutput::CharFontCTL( const SvxFontItem& rFont )
{
- OUString sFontName(rFont.GetFamilyName());
+ const OUString& sFontName(rFont.GetFamilyName());
OString sFontNameUtf8 = OUStringToOString(sFontName, RTL_TEXTENCODING_UTF8);
AddToAttrList( m_pFontsAttrList, FSNS( XML_w, XML_cs ), sFontNameUtf8.getStr() );
-
}
void DocxAttributeOutput::CharPostureCTL( const SvxPostureItem& rPosture)
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 00f50162f861..475e678d9083 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -770,8 +770,8 @@ void DocxSdrExport::writeVMLDrawing(const SdrObject* sdrObj, const SwFrameFormat
m_pImpl->m_pDrawingML->SetFS(m_pImpl->m_pSerializer);
// See WinwordAnchoring::SetAnchoring(), these are not part of the SdrObject, have to be passed around manually.
- SwFormatHoriOrient rHoriOri = (rFrameFormat).GetHoriOrient();
- SwFormatVertOrient rVertOri = (rFrameFormat).GetVertOrient();
+ const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient();
+ const SwFormatVertOrient& rVertOri = rFrameFormat.GetVertOrient();
m_pImpl->m_rExport.VMLExporter().AddSdrObject(*(sdrObj),
rHoriOri.GetHoriOrient(), rVertOri.GetVertOrient(),
rHoriOri.GetRelationOrient(),
@@ -879,7 +879,7 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* pSdrObject, const SwFrameFo
void DocxSdrExport::Impl::textFrameShadow(const SwFrameFormat& rFrameFormat)
{
- SvxShadowItem aShadowItem = rFrameFormat.GetShadow();
+ const SvxShadowItem& aShadowItem = rFrameFormat.GetShadow();
if (aShadowItem.GetLocation() == SVX_SHADOW_NONE)
return;
@@ -980,7 +980,7 @@ OString lcl_ConvertTransparency(const Color& rColor)
void DocxSdrExport::writeDMLEffectLst(const SwFrameFormat& rFrameFormat)
{
- SvxShadowItem aShadowItem = rFrameFormat.GetShadow();
+ const SvxShadowItem& aShadowItem = rFrameFormat.GetShadow();
// Output effects
if (aShadowItem.GetLocation() != SVX_SHADOW_NONE)
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 20b361a1fb5b..39b4a68fc5ae 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -560,9 +560,8 @@ bool RtfAttributeOutput::StartURL(const OUString& rUrl, const OUString& rTarget)
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FLDINST);
m_aStyles.append(" HYPERLINK ");
- OUString sURL(rUrl);
m_aStyles.append("\"");
- m_aStyles.append(msfilter::rtfutil::OutString(sURL, m_rExport.m_eCurrentEncoding));
+ m_aStyles.append(msfilter::rtfutil::OutString(rUrl, m_rExport.m_eCurrentEncoding));
m_aStyles.append("\" ");
if (!rTarget.isEmpty())
@@ -1691,7 +1690,7 @@ namespace
void lcl_TextFrameShadow(std::vector< std::pair<OString, OString> >& rFlyProperties, const SwFrameFormat& rFrameFormat)
{
- SvxShadowItem aShadowItem = rFrameFormat.GetShadow();
+ const SvxShadowItem& aShadowItem = rFrameFormat.GetShadow();
if (aShadowItem.GetLocation() == SVX_SHADOW_NONE)
return;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 7cb827cf89a5..1ac6ae80164c 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -3174,7 +3174,7 @@ bool SwMSConvertControls::ReadOCXStream( tools::SvRef<SotStorage>& rSrc1,
void SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrUnoObj& rFormObj)
{
- uno::Reference< awt::XControlModel > xControlModel =
+ const uno::Reference< awt::XControlModel >& xControlModel =
rFormObj.GetUnoControlModel();
//Why oh lord do we use so many different units ?
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 5717ae4bfd10..39b787907e99 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -429,7 +429,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby )
if (nWhich == RES_TXTATR_AUTOFMT)
{
const SwFormatAutoFormat& rAutoFormat = static_cast<const SwFormatAutoFormat&>(pHt->GetAttr());
- const std::shared_ptr<SfxItemSet> pSet = rAutoFormat.GetStyleHandle();
+ const std::shared_ptr<SfxItemSet>& pSet = rAutoFormat.GetStyleHandle();
SfxWhichIter aIter( *pSet );
const SfxPoolItem* pItem;
sal_uInt16 nWhichId = aIter.FirstWhich();
@@ -2108,7 +2108,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
AppendWordBookmark( sBkmkName );
}
- OUString aStr( rNode.GetText() );
+ const OUString& aStr( rNode.GetText() );
sal_Int32 nAktPos = 0;
sal_Int32 const nEnd = aStr.getLength();
@@ -2979,7 +2979,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const ww8::Frame& rFormat, const P
// because we deliver the normal content of the table cell, and no border
// ( Flag was deleted above in aSaveData() )
m_rWW8Export.m_bOutTable = true;
- const OUString aName = rFrameFormat.GetName();
+ const OUString& aName = rFrameFormat.GetName();
m_rWW8Export.StartCommentOutput(aName);
m_rWW8Export.WriteText();
m_rWW8Export.EndCommentOutput(aName);
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 96674f9cdeb5..cf98b68152b0 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -762,7 +762,7 @@ void MSWordExportBase::OutputFormat( const SwFormat& rFormat, bool bPapFormat, b
if ( m_bStyDef && DisallowInheritingOutlineNumbering(rFormat) )
{
SfxItemSet aSet( rFormat.GetAttrSet() );
- SvxLRSpaceItem aLR(
+ const SvxLRSpaceItem& aLR(
ItemGet<SvxLRSpaceItem>(aSet, RES_LR_SPACE));
aSet.Put( aLR );
OutputItemSet( aSet, bPapFormat, bChpFormat,
@@ -1727,7 +1727,7 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType,
if ( nSubType == REF_SETREFATTR ||
nSubType == REF_BOOKMARK )
{
- const OUString aRefName(rRField.GetSetRefName());
+ const OUString& aRefName(rRField.GetSetRefName());
aLinkStr = GetBookmarkName( nSubType, &aRefName, 0 );
}
else if ( nSubType == REF_FOOTNOTE ||
@@ -2756,7 +2756,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField )
break;
}
{
- const OUString aRefName(rRField.GetSetRefName());
+ const OUString& aRefName(rRField.GetSetRefName());
sStr = FieldString(eField)
+ MSWordExportBase::GetBookmarkName(nSubType, &aRefName, 0);
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index b1d72b99a9a7..d45992f04145 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5366,7 +5366,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss)
{
Graphic aGraphic = vecBulletGrf[nGrfBulletCP]->GetGrf();
SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH);
- vcl::Font aFont = numfunc::GetDefBulletFont();
+ const vcl::Font& aFont = numfunc::GetDefBulletFont();
int nHeight = aFont.GetFontHeight() * 12;
Size aPrefSize( aGraphic.GetPrefSize());
if (aPrefSize.Height() * aPrefSize.Width() != 0 )
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index f74e3f2fb441..748021074ee2 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -899,7 +899,7 @@ void SwXMLImport::endDocument()
{
Sequence< beans::PropertyValue > aXFormsSettings;
- const OUString sXFormsSettingsName( GetXMLToken( XML_XFORM_MODEL_SETTINGS ) );
+ const OUString& sXFormsSettingsName( GetXMLToken( XML_XFORM_MODEL_SETTINGS ) );
if ( m_xLateInitSettings.is() && m_xLateInitSettings->hasByName( sXFormsSettingsName ) )
{
OSL_VERIFY( m_xLateInitSettings->getByName( sXFormsSettingsName ) >>= aXFormsSettings );
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index f2aa4a11616e..5043c77d6933 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -1102,10 +1102,9 @@ void SwGlossaryDlg::ResumeShowAutoText()
{
uno::Any aGroup = m_xAutoText->getByName(sGroup);
uno::Reference< XAutoTextGroup > xGroup;
- OUString uShortName(sShortName);
- if((aGroup >>= xGroup) && xGroup->hasByName(uShortName))
+ if((aGroup >>= xGroup) && xGroup->hasByName(sShortName))
{
- uno::Any aEntry(xGroup->getByName(uShortName));
+ uno::Any aEntry(xGroup->getByName(sShortName));
uno::Reference< XAutoTextEntry > xEntry;
aEntry >>= xEntry;
uno::Reference< XTextRange > xRange(xCursor, uno::UNO_QUERY);
diff --git a/sw/source/ui/vba/vbabookmarks.cxx b/sw/source/ui/vba/vbabookmarks.cxx
index 5a295b99c285..ceb5af2f2359 100644
--- a/sw/source/ui/vba/vbabookmarks.cxx
+++ b/sw/source/ui/vba/vbabookmarks.cxx
@@ -164,13 +164,12 @@ SwVbaBookmarks::Add( const OUString& rName, const uno::Any& rRange ) throw (uno:
}
// remove the exist bookmark
- OUString aName = rName;
- if( m_xNameAccess->hasByName( aName ) )
- removeBookmarkByName( aName );
+ if( m_xNameAccess->hasByName( rName ) )
+ removeBookmarkByName( rName );
- addBookmarkByName( mxModel, aName, xTextRange );
+ addBookmarkByName( mxModel, rName, xTextRange );
- return uno::makeAny( uno::Reference< word::XBookmark >( new SwVbaBookmark( getParent(), mxContext, mxModel, aName ) ) );
+ return uno::makeAny( uno::Reference< word::XBookmark >( new SwVbaBookmark( getParent(), mxContext, mxModel, rName ) ) );
}
sal_Int32 SAL_CALL
diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx
index bbae48f0f564..8bef2126c165 100644
--- a/sw/source/ui/vba/vbafield.cxx
+++ b/sw/source/ui/vba/vbafield.cxx
@@ -468,8 +468,7 @@ uno::Reference< text::XTextField > SwVbaFields::Create_Field_DocProperty( const
if( bCustom )
{
uno::Reference< beans::XPropertySet > xProps( xTextField, uno::UNO_QUERY_THROW );
- OUString sDocPropertyName( aDocProperty );
- xProps->setPropertyValue("Name", uno::makeAny( sDocPropertyName ) );
+ xProps->setPropertyValue("Name", uno::makeAny( aDocProperty ) );
}
return xTextField;
diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx
index 8ffa710dcba8..7ba020dae59a 100644
--- a/sw/source/ui/vba/vbatablehelper.cxx
+++ b/sw/source/ui/vba/vbatablehelper.cxx
@@ -71,11 +71,10 @@ sal_Int32 SwVbaTableHelper::getTabColumnsMaxCount( ) throw (uno::RuntimeExceptio
return nRet;
}
-sal_Int32 SwVbaTableHelper::getTabRowIndex( const OUString& CellName ) throw (uno::RuntimeException)
+sal_Int32 SwVbaTableHelper::getTabRowIndex( const OUString& rCellName ) throw (uno::RuntimeException)
{
sal_Int32 nRet = 0;
- OUString sCellName(CellName);
- SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTableBox( sCellName ));
+ SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTableBox( rCellName ));
if( !pBox )
throw uno::RuntimeException();
@@ -86,11 +85,10 @@ sal_Int32 SwVbaTableHelper::getTabRowIndex( const OUString& CellName ) throw (un
return nRet;
}
-sal_Int32 SwVbaTableHelper::getTabColIndex( const OUString& CellName ) throw (uno::RuntimeException)
+sal_Int32 SwVbaTableHelper::getTabColIndex( const OUString& rCellName ) throw (uno::RuntimeException)
{
sal_Int32 nRet = 0;
- OUString sCellName(CellName);
- const SwTableBox* pBox = pTable->GetTableBox( sCellName );
+ const SwTableBox* pBox = pTable->GetTableBox( rCellName );
if( !pBox )
throw uno::RuntimeException();
const SwTableBoxes* pBoxes = &pBox->GetUpper()->GetTabBoxes();
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 92c6112919cc..8b9d6d5341fa 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -717,9 +717,8 @@ bool SwDBManager::GetTableNames(ListBox* pListBox, const OUString& rDBName)
xConnection = pParam->xConnection;
else
{
- OUString sDBName(rDBName);
- if ( !sDBName.isEmpty() )
- xConnection = RegisterConnection( sDBName );
+ if ( !rDBName.isEmpty() )
+ xConnection = RegisterConnection( rDBName );
}
if(xConnection.is())
{
@@ -768,8 +767,7 @@ void SwDBManager::GetColumnNames(ListBox* pListBox,
xConnection = pParam->xConnection;
else
{
- OUString sDBName(rDBName);
- xConnection = RegisterConnection( sDBName );
+ xConnection = RegisterConnection( rDBName );
}
GetColumnNames(pListBox, xConnection, rTableName);
}
@@ -1666,8 +1664,7 @@ sal_uLong SwDBManager::GetColumnFormat( const OUString& rDBName,
}
else
{
- OUString sDBName(rDBName);
- xConnection = RegisterConnection( sDBName );
+ xConnection = RegisterConnection( rDBName );
bDisposeConnection = true;
}
if(bUseMergeData)
@@ -1812,8 +1809,7 @@ sal_Int32 SwDBManager::GetColumnType( const OUString& rDBName,
}
else
{
- OUString sDBName(rDBName);
- xConnection = RegisterConnection( sDBName );
+ xConnection = RegisterConnection( rDBName );
}
if( !xColsSupp.is() )
{
diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx
index 21bfbf52c16e..72b22f2351dc 100644
--- a/sw/source/uibase/envelp/labelcfg.cxx
+++ b/sw/source/uibase/envelp/labelcfg.cxx
@@ -182,11 +182,10 @@ static std::unique_ptr<SwLabRec> lcl_CreateSwLabRec(const OUString& rType, const
pNewRec->aType = rType;
//all values are contained as colon-separated 1/100 mm values
//except for the continuous flag ('C'/'S') and nCols, nRows (sal_Int32)
- OUString sMeasure(rMeasure);
- sal_uInt16 nTokenCount = comphelper::string::getTokenCount(sMeasure, ';');
+ sal_uInt16 nTokenCount = comphelper::string::getTokenCount(rMeasure, ';');
for(sal_uInt16 i = 0; i < nTokenCount; i++)
{
- OUString sToken(sMeasure.getToken(i, ';' ));
+ OUString sToken(rMeasure.getToken(i, ';' ));
int nVal = sToken.toInt32();
switch(i)
{
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index f2119ac00909..38b413ad1770 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -1383,7 +1383,6 @@ void SwFieldMgr::UpdateCurField(sal_uLong nFormat,
bool bSetPar2 = true;
bool bSetPar1 = true;
- OUString sPar1( rPar1 );
OUString sPar2( rPar2 );
// Order to Format
@@ -1472,7 +1471,7 @@ void SwFieldMgr::UpdateCurField(sal_uLong nFormat,
for(sal_Int32 nToken = 0; nToken < nTokenCount; nToken++)
pArray[nToken] = sPar2.getToken(nToken, DB_DELIM);
static_cast<SwDropDownField*>(pTmpField)->SetItems(aEntries);
- static_cast<SwDropDownField*>(pTmpField)->SetName(sPar1);
+ static_cast<SwDropDownField*>(pTmpField)->SetName(rPar1);
bSetPar1 = bSetPar2 = false;
}
break;
@@ -1503,8 +1502,8 @@ void SwFieldMgr::UpdateCurField(sal_uLong nFormat,
// setup format before SetPar2 because of NumberFormatter!
pTmpField->ChangeFormat(nFormat);
- if(bSetPar1)
- pTmpField->SetPar1( sPar1 );
+ if( bSetPar1 )
+ pTmpField->SetPar1( rPar1 );
if( bSetPar2 )
pTmpField->SetPar2( sPar2 );
diff --git a/sw/source/uibase/fldui/xfldui.cxx b/sw/source/uibase/fldui/xfldui.cxx
index c7164e5e771d..ef4e713c9a14 100644
--- a/sw/source/uibase/fldui/xfldui.cxx
+++ b/sw/source/uibase/fldui/xfldui.cxx
@@ -55,9 +55,8 @@ bool SwFieldMgr::IsDBNumeric( const OUString& rDBName, const OUString& rTableQry
SwDBManager* pDBManager = pWrtShell ? pWrtShell->GetDBManager() :
::GetActiveView()->GetWrtShell().GetDBManager();
- OUString sSource(rDBName);
Reference< XConnection> xConnection =
- pDBManager->RegisterConnection(sSource);
+ pDBManager->RegisterConnection(rDBName);
if( !xConnection.is() )
return bNumeric;
diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx
index fa503d054a33..44426548e9ab 100644
--- a/sw/source/uibase/misc/glosdoc.cxx
+++ b/sw/source/uibase/misc/glosdoc.cxx
@@ -440,7 +440,6 @@ void SwGlossaries::RemoveFileFromList( const OUString& rGroup )
{
if (*it == rGroup)
{
- OUString aUName = rGroup;
{
// tell the UNO AutoTextGroup object that it's not valid anymore
for ( UnoAutoTextGroups::iterator aLoop = m_aGlossaryGroups.begin();
@@ -449,7 +448,7 @@ void SwGlossaries::RemoveFileFromList( const OUString& rGroup )
)
{
Reference< container::XNamed > xNamed( aLoop->get(), UNO_QUERY );
- if ( xNamed.is() && ( xNamed->getName() == aUName ) )
+ if ( xNamed.is() && ( xNamed->getName() == rGroup ) )
{
static_cast< SwXAutoTextGroup* >( xNamed.get() )->Invalidate();
// note that this static_cast works because we know that the array only
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index dcdce1d6a3ed..6928993639ef 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -467,7 +467,7 @@ void SwRedlineAcceptDlg::Activate()
if (pParent->pTLBParent)
{
// update only comment
- OUString sComment(rRedln.GetComment());
+ const OUString& sComment(rRedln.GetComment());
m_pTable->SetEntryText(sComment.replace('\n', ' '), pParent->pTLBParent, 3);
}
pParent->sComment = rRedln.GetComment();
@@ -757,7 +757,7 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd)
pRedlineParent = new SwRedlineDataParent;
pRedlineParent->pData = pRedlineData;
pRedlineParent->pNext = nullptr;
- OUString sComment(rRedln.GetComment());
+ const OUString& sComment(rRedln.GetComment());
pRedlineParent->sComment = sComment.replace('\n', ' ');
m_RedlineParents.insert(m_RedlineParents.begin() + i,
std::unique_ptr<SwRedlineDataParent>(pRedlineParent));
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index ffa42b4147ee..e105efb0d442 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1797,7 +1797,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
uno::Reference <frame::XController> xController = GetView().GetController();
const lang::Locale aLocale( SW_BREAKITER()->GetLocale( GetAppLanguageTag() ) );
- const OUString aApplicationName( rSmartTagMgr.GetApplicationName() );
+ const OUString& aApplicationName( rSmartTagMgr.GetApplicationName() );
const OUString aRangeText = xRange->getString();
const SvxSmartTagItem aItem( nWhich,
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx
index 81bf6a486ae2..2047c2aab5cb 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -465,7 +465,7 @@ ThemePanel::ThemePanel(vcl::Window* pParent,
{
const svx::ColorSet& rColorSet = aColorSets[i];
- OUString aName = rColorSet.getName();
+ const OUString& aName = rColorSet.getName();
BitmapEx aPreview = GenerateColorPreview(rColorSet);
mpValueSetColors->InsertItem(i, Image(aPreview), aName);
}
diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx
index 79228e460ccf..e7855d887172 100644
--- a/sw/source/uibase/uiview/viewprt.cxx
+++ b/sw/source/uibase/uiview/viewprt.cxx
@@ -278,7 +278,7 @@ VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent,
void SetAppPrintOptions( SwViewShell* pSh, bool bWeb )
{
const IDocumentDeviceAccess& rIDDA = pSh->getIDocumentDeviceAccess();
- SwPrintData aPrtData = rIDDA.getPrintData();
+ const SwPrintData& aPrtData = rIDDA.getPrintData();
if( rIDDA.getPrinter( false ) )
{
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index d7512009a491..7b94a1dad07f 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1049,7 +1049,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
sal_uInt16 nColumnType = 0;
const SwFrameFormat& rMaster = rDesc.GetMaster();
- SwFormatCol aCol(rMaster.GetCol());
+ const SwFormatCol& aCol(rMaster.GetCol());
const sal_uInt16 nCols = aCol.GetNumCols();
if ( nCols == 0 )
{
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index c4ed4e58bcf8..51511337f51a 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -348,8 +348,8 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const
throw uno::RuntimeException();
SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName) : nullptr;
- OUString sShortName(aName);
- OUString sLongName(aTitle);
+ const OUString& sShortName(aName);
+ const OUString& sLongName(aTitle);
if (pGlosGroup && !pGlosGroup->GetError())
{
uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 5a7d25211b92..31216c5434e3 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3707,62 +3707,61 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
Any aRet;
if(!pxDoc)
throw RuntimeException();
- OUString sToCompare(rName);
OUString sSuffix("|");
- if(sToCompare == sTables)
+ if(rName == sTables)
{
sSuffix += "table";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- pxDoc->getTextTables(), sToCompare, sSuffix );
+ pxDoc->getTextTables(), rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sFrames)
+ else if(rName == sFrames)
{
sSuffix += "frame";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- pxDoc->getTextFrames(), sToCompare, sSuffix );
+ pxDoc->getTextFrames(), rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sSections)
+ else if(rName == sSections)
{
sSuffix += "region";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- pxDoc->getTextSections(), sToCompare, sSuffix );
+ pxDoc->getTextSections(), rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sGraphics)
+ else if(rName == sGraphics)
{
sSuffix += "graphic";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- pxDoc->getGraphicObjects(), sToCompare, sSuffix );
+ pxDoc->getGraphicObjects(), rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sOLEs)
+ else if(rName == sOLEs)
{
sSuffix += "ole";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- pxDoc->getEmbeddedObjects(), sToCompare, sSuffix );
+ pxDoc->getEmbeddedObjects(), rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sOutlines)
+ else if(rName == sOutlines)
{
sSuffix += "outline";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- *pxDoc, sToCompare, sSuffix );
+ *pxDoc, rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sBookmarks)
+ else if(rName == sBookmarks)
{
sSuffix.clear();
Reference< XNameAccess > xBkms = new SwXLinkNameAccessWrapper(
- pxDoc->getBookmarks(), sToCompare, sSuffix );
+ pxDoc->getBookmarks(), rName, sSuffix );
Reference< XPropertySet > xRet(xBkms, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
@@ -3789,14 +3788,13 @@ Sequence< OUString > SwXLinkTargetSupplier::getElementNames()
sal_Bool SwXLinkTargetSupplier::hasByName(const OUString& rName)
throw( RuntimeException, std::exception )
{
- OUString sToCompare(rName);
- if( sToCompare == sTables ||
- sToCompare == sFrames ||
- sToCompare == sGraphics||
- sToCompare == sOLEs ||
- sToCompare == sSections ||
- sToCompare == sOutlines ||
- sToCompare == sBookmarks )
+ if( rName == sTables ||
+ rName == sFrames ||
+ rName == sGraphics||
+ rName == sOLEs ||
+ rName == sSections ||
+ rName == sOutlines ||
+ rName == sBookmarks )
return sal_True;
return sal_False;
}
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index ef20d115eca4..1fe0dcfe0ac8 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -911,7 +911,7 @@ awt::Point SwXTextViewCursor::getPosition() throw( uno::RuntimeException, std::e
if(m_pView)
{
const SwWrtShell& rSh = m_pView->GetWrtShell();
- const SwRect aCharRect(rSh.GetCharRect());
+ const SwRect& aCharRect(rSh.GetCharRect());
const SwFrameFormat& rMaster = rSh.GetPageDesc( rSh.GetCurPageDesc() ).GetMaster();
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 5ad5c931aa18..476c95e36b30 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -531,7 +531,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
for(size_t i = 0; i < nMemberCount; ++i)
{
const SwFrameFormat& rTableFormat = pWrtShell->GetTableFrameFormat(i, true);
- const OUString sTableName( rTableFormat.GetName() );
+ const OUString& sTableName( rTableFormat.GetName() );
SwContent* pCnt = new SwContent(this, sTableName,
rTableFormat.FindLayoutRect(false, &aNullPt).Top() );