diff options
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/doc/acmplwrd.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/dbgoutsw.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doccorr.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/extinput.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/number.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/docnode/node.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/docnode/nodes.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/frmedt/fews.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 21 | ||||
-rw-r--r-- | sw/source/core/swg/SwXMLTextBlocks1.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/text/txtfly.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/xmldump.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtatr2.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/unocore/unoflatpara.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unosett.cxx | 3 |
19 files changed, 32 insertions, 53 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 |