summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-13 21:28:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-14 08:29:22 +0200
commit1123a47c9771e0f4a680316c034e9878919a85d5 (patch)
tree53a4e25bec1ea031c654a2af7e68e908722b98c9 /sw
parent42204a80aa7d4ce778596fa6ccab7d144c04e9b1 (diff)
loplugin:sequentialassign in sw
Change-Id: Iec56b41dba502e438dfdc7a99385545b3efdf8c7 Reviewed-on: https://gerrit.libreoffice.org/70720 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/htmlimport/htmlimport.cxx3
-rw-r--r--sw/qa/extras/inc/bordertest.hxx3
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx3
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport12.cxx3
-rw-r--r--sw/qa/extras/rtfexport/rtfexport5.cxx4
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx3
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx3
-rw-r--r--sw/source/core/access/acchyperlink.cxx3
-rw-r--r--sw/source/core/access/accmap.cxx4
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx5
-rw-r--r--sw/source/core/doc/docnum.cxx4
-rw-r--r--sw/source/core/fields/docufld.cxx3
-rw-r--r--sw/source/core/fields/expfld.cxx3
-rw-r--r--sw/source/core/frmedt/feshview.cxx3
-rw-r--r--sw/source/core/frmedt/tblsel.cxx6
-rw-r--r--sw/source/core/layout/anchoredobject.cxx8
-rw-r--r--sw/source/core/layout/fly.cxx3
-rw-r--r--sw/source/core/layout/objectformatterlayfrm.cxx4
-rw-r--r--sw/source/core/text/txthyph.cxx3
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx8
-rw-r--r--sw/source/core/txtnode/txtedt.cxx3
-rw-r--r--sw/source/core/undo/SwRewriter.cxx4
-rw-r--r--sw/source/core/undo/unredln.cxx3
-rw-r--r--sw/source/core/unocore/unoframe.cxx6
-rw-r--r--sw/source/core/unocore/unotbl.cxx6
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx4
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx3
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx3
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx3
-rw-r--r--sw/source/filter/ww8/ww8par.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx3
-rw-r--r--sw/source/filter/xml/xmltext.cxx4
-rw-r--r--sw/source/ui/fldui/fldvar.cxx4
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx6
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx3
-rw-r--r--sw/source/uibase/shells/langhelper.cxx3
-rw-r--r--sw/source/uibase/uiview/view2.cxx3
-rw-r--r--sw/source/uibase/uiview/viewport.cxx3
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx3
-rw-r--r--sw/source/uibase/utlui/condedit.cxx3
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx3
42 files changed, 50 insertions, 112 deletions
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx
index 52a6a7145bc4..db046ad6c556 100644
--- a/sw/qa/extras/htmlimport/htmlimport.cxx
+++ b/sw/qa/extras/htmlimport/htmlimport.cxx
@@ -84,8 +84,7 @@ DECLARE_HTMLIMPORT_TEST(testInlinedImage, "inlined_image.html")
uno::Reference<container::XNamed> const xNamed(xShape, uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(OUString("Image1"), xNamed->getName());
- uno::Reference<graphic::XGraphic> xGraphic;
- xGraphic = getProperty< uno::Reference<graphic::XGraphic> >(xShape, "Graphic");
+ uno::Reference<graphic::XGraphic> xGraphic = getProperty< uno::Reference<graphic::XGraphic> >(xShape, "Graphic");
CPPUNIT_ASSERT(xGraphic.is());
CPPUNIT_ASSERT(xGraphic->getType() != graphic::GraphicType::EMPTY);
diff --git a/sw/qa/extras/inc/bordertest.hxx b/sw/qa/extras/inc/bordertest.hxx
index 3e95af91f441..160ddbd5db67 100644
--- a/sw/qa/extras/inc/bordertest.hxx
+++ b/sw/qa/extras/inc/bordertest.hxx
@@ -165,8 +165,7 @@ public:
if(currentTable == sal_Int32(7))
tempMap = &map7;
- BorderLineMap::iterator it;
- it = tempMap->begin();
+ BorderLineMap::iterator it = tempMap->begin();
for (sal_Int32 i = 0; i < nLength; ++i)
{
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 3065d64c4935..b9e4f604a960 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -165,8 +165,7 @@ DECLARE_ODFIMPORT_TEST(testOdtBorders, "borders_ooo33.odt")
uno::Sequence<OUString> const cells = xTextTable->getCellNames();
sal_Int32 nLength = cells.getLength();
- AllBordersMap::iterator it;
- it = map.begin();
+ AllBordersMap::iterator it = map.begin();
for (sal_Int32 i = 0; i < nLength; ++i)
{
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index 797c2d1e8884..3008ab8186a1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -727,8 +727,7 @@ DECLARE_OOXMLEXPORT_TEST(testObjectCrossReference, "object_cross_reference.odt")
DECLARE_OOXMLEXPORT_TEST(testTdf79435_legacyInputFields, "tdf79435_legacyInputFields.doc")
{
//using .doc input file to verify cross-format compatibility.
- uno::Reference<text::XFormField> xFormField;
- xFormField
+ uno::Reference<text::XFormField> xFormField
= getProperty<uno::Reference<text::XFormField>>(getRun(getParagraph(5), 3), "Bookmark");
uno::Reference<container::XNameContainer> xParameters(xFormField->getParameters());
diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx
index b2b898738d1d..8e73fa5e2747 100644
--- a/sw/qa/extras/rtfexport/rtfexport5.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport5.cxx
@@ -989,8 +989,8 @@ DECLARE_RTFEXPORT_TEST(testClassificatonPasteLevels, "classification-confidentia
DECLARE_RTFEXPORT_TEST(testTdf95707, "tdf95707.rtf")
{
// Graphic was replaced with a "Read-Error" placeholder.
- uno::Reference<graphic::XGraphic> xGraphic;
- xGraphic = getProperty<uno::Reference<graphic::XGraphic>>(getShape(1), "Graphic");
+ uno::Reference<graphic::XGraphic> xGraphic
+ = getProperty<uno::Reference<graphic::XGraphic>>(getShape(1), "Graphic");
CPPUNIT_ASSERT(xGraphic.is());
CPPUNIT_ASSERT(xGraphic->getType() != graphic::GraphicType::EMPTY);
}
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 9a50ff1d5819..74fd2b147d76 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -6559,8 +6559,7 @@ void SwUiWriterTest::testHtmlCopyImages()
SwDoc* pDoc = createDoc("image.odt");
// Trigger the copy part of HTML copy&paste.
- WriterRef xWrt;
- xWrt = new SwHTMLWriter( /*rBaseURL=*/OUString() );
+ WriterRef xWrt = new SwHTMLWriter( /*rBaseURL=*/OUString() );
CPPUNIT_ASSERT(xWrt.is());
xWrt->m_bWriteClipboardDoc = true;
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 5afb7b187d80..b016bb5f3e04 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -88,8 +88,7 @@ DECLARE_WW8EXPORT_TEST(testFdo53985, "fdo53985.doc")
DECLARE_WW8EXPORT_TEST(testTdf79435_legacyInputFields, "tdf79435_legacyInputFields.docx")
{
//using .docx input file to verify cross-format compatibility.
- uno::Reference<text::XFormField> xFormField;
- xFormField = getProperty< uno::Reference<text::XFormField> >(getRun(getParagraph(5), 3), "Bookmark");
+ uno::Reference<text::XFormField> xFormField = getProperty< uno::Reference<text::XFormField> >(getRun(getParagraph(5), 3), "Bookmark");
uno::Reference<container::XNameContainer> xParameters(xFormField->getParameters());
OUString sTmp;
diff --git a/sw/source/core/access/acchyperlink.cxx b/sw/source/core/access/acchyperlink.cxx
index da8200e39844..fc3859ff02d7 100644
--- a/sw/source/core/access/acchyperlink.cxx
+++ b/sw/source/core/access/acchyperlink.cxx
@@ -200,8 +200,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::isValid( )
uno::UNO_QUERY );
if( !xDesktop.is() )
return false;
- uno::Reference< lang::XComponent > xComp;
- xComp = xDesktop->getCurrentComponent();
+ uno::Reference< lang::XComponent > xComp = xDesktop->getCurrentComponent();
if( !xComp.is() )
return false;
uno::Reference< css::document::XLinkTargetSupplier > xLTS(xComp, uno::UNO_QUERY);
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 4248784bb983..24769f8bc837 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -3026,9 +3026,7 @@ Point SwAccessibleMap::LogicToPixel( const Point& rPoint ) const
MapMode aSrc( MapUnit::Map100thMM );
MapMode aDest( MapUnit::MapTwip );
- Point aPoint = rPoint;
-
- aPoint = OutputDevice::LogicToLogic( aPoint, aSrc, aDest );
+ Point aPoint = OutputDevice::LogicToLogic( rPoint, aSrc, aDest );
vcl::Window *pWin = GetShell()->GetWin();
if( pWin )
{
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index d69e1cb0308d..7f5339a7206d 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -718,10 +718,7 @@ const char * dbg_out( SwOutlineNodes const & rNodes)
static OUString lcl_dbg_out(const SvxNumberFormat & rFormat)
{
- OUString aResult;
-
- aResult = lcl_dbg_out_NumType(rFormat.GetNumberingType());
-
+ OUString aResult = lcl_dbg_out_NumType(rFormat.GetNumberingType());
return aResult;
}
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index f248472ecce2..ad013e8c5744 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -2422,9 +2422,7 @@ sal_uInt16 SwDoc::FindNumRule( const OUString& rName ) const
SwNumRule* SwDoc::FindNumRulePtr( const OUString& rName ) const
{
- SwNumRule * pResult = nullptr;
-
- pResult = maNumRuleMap[rName];
+ SwNumRule * pResult = maNumRuleMap[rName];
if ( !pResult )
{
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index ec14fd1be535..04b4f1c9657f 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -911,8 +911,7 @@ OUString SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
aAny = xSet->getPropertyValue( rName );
uno::Reference < script::XTypeConverter > xConverter( script::Converter::create(comphelper::getProcessComponentContext()) );
- uno::Any aNew;
- aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
+ uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
aNew >>= sVal;
}
catch (uno::Exception&) {}
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 7bcfd443c027..62a31891396e 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -1190,8 +1190,7 @@ bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
break;
case FIELD_PROP_SUBTYPE:
{
- sal_Int16 nRet = 0;
- nRet = lcl_SubTypeToAPI(GetSubType() & 0xff);
+ sal_Int16 nRet = lcl_SubTypeToAPI(GetSubType() & 0xff);
rAny <<= nRet;
}
break;
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 2b35ad3ffe7e..84d5bbb8bc1f 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -946,8 +946,7 @@ void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj, sal_uInt1
::basegfx::B2DPolyPolygon aCircle( getPolygon( RID_SVXSTR_CIRCLE, rModel ) );
if( !aCircle.count() )
{
- ::basegfx::B2DPolygon aNewCircle;
- aNewCircle = ::basegfx::utils::createPolygonFromEllipse(::basegfx::B2DPoint(0.0, 0.0), 250.0, 250.0);
+ ::basegfx::B2DPolygon aNewCircle = ::basegfx::utils::createPolygonFromEllipse(::basegfx::B2DPoint(0.0, 0.0), 250.0, 250.0);
aNewCircle.setClosed(true);
aCircle.append(aNewCircle);
}
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index fd1f59a150b0..11c516b9b0b6 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -1714,8 +1714,7 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart,
// If necessary we should search backwards again
while ( rpStart->GetFormat()->GetProtect().IsContentProtected() )
{
- const SwLayoutFrame *pTmpLeaf = rpStart;
- pTmpLeaf = pTmpLeaf->GetNextLayoutLeaf();
+ const SwLayoutFrame *pTmpLeaf = rpStart->GetNextLayoutLeaf();
while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->getFrameArea()) > nEX ) // first skip line
pTmpLeaf = pTmpLeaf->GetNextLayoutLeaf();
while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->getFrameArea()) < nSX &&
@@ -1736,8 +1735,7 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart,
}
while ( rpEnd->GetFormat()->GetProtect().IsContentProtected() )
{
- const SwLayoutFrame *pTmpLeaf = rpEnd;
- pTmpLeaf = pTmpLeaf->GetPrevLayoutLeaf();
+ const SwLayoutFrame *pTmpLeaf = rpEnd->GetPrevLayoutLeaf();
while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->getFrameArea()) < nEX ) // skip the line for now
pTmpLeaf = pTmpLeaf->GetPrevLayoutLeaf();
while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->getFrameArea()) > nEX )
diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx
index 57dd72bfb904..0914fad4d1c7 100644
--- a/sw/source/core/layout/anchoredobject.cxx
+++ b/sw/source/core/layout/anchoredobject.cxx
@@ -878,9 +878,7 @@ Point SwAnchoredObject::GetRelPosToPageFrame( const bool _bFollowTextFlow,
*/
Point SwAnchoredObject::GetRelPosToChar() const
{
- Point aRelPos;
-
- aRelPos = GetObjRect().Pos();
+ Point aRelPos = GetObjRect().Pos();
aRelPos -= GetLastCharRect().Pos();
return aRelPos;
@@ -894,9 +892,7 @@ Point SwAnchoredObject::GetRelPosToChar() const
*/
Point SwAnchoredObject::GetRelPosToLine() const
{
- Point aRelPos;
-
- aRelPos = GetObjRect().Pos();
+ Point aRelPos = GetObjRect().Pos();
aRelPos.AdjustY( -(GetLastTopOfLine()) );
return aRelPos;
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index ee82f15ff86b..d364ccf655b8 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1725,8 +1725,7 @@ void SwFlyFrame::MakeContentPos( const SwBorderAttrs &rAttrs )
if( IsMinHeight() )
nMinHeight = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height();
- Point aNewContentPos;
- aNewContentPos = getFramePrintArea().Pos();
+ Point aNewContentPos = getFramePrintArea().Pos();
const SdrTextVertAdjust nAdjust = GetFormat()->GetTextVertAdjust().GetValue();
if( nAdjust != SDRTEXTVERTADJUST_TOP )
diff --git a/sw/source/core/layout/objectformatterlayfrm.cxx b/sw/source/core/layout/objectformatterlayfrm.cxx
index fa017f7b765e..cc9f332167b4 100644
--- a/sw/source/core/layout/objectformatterlayfrm.cxx
+++ b/sw/source/core/layout/objectformatterlayfrm.cxx
@@ -82,9 +82,7 @@ bool SwObjectFormatterLayFrame::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
bool SwObjectFormatterLayFrame::DoFormatObjs()
{
- bool bSuccess( true );
-
- bSuccess = FormatObjsAtFrame_();
+ bool bSuccess = FormatObjsAtFrame_();
if ( bSuccess && GetAnchorFrame().IsPageFrame() )
{
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index eb6e4d40b8ef..d2edb6a9ffa6 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -271,8 +271,7 @@ bool SwTextPortion::CreateHyphen( SwTextFormatInfo &rInf, SwTextGuess const &rGu
// first case: hyphenated word has alternative spelling
if ( xHyphWord->isAlternativeSpelling() )
{
- SvxAlternativeSpelling aAltSpell;
- aAltSpell = SvxGetAltSpelling( xHyphWord );
+ SvxAlternativeSpelling aAltSpell = SvxGetAltSpelling( xHyphWord );
OSL_ENSURE( aAltSpell.bIsAltSpelling, "no alternative spelling" );
OUString aAltText = aAltSpell.aReplacement;
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 05135a9868cf..63b8971f55a8 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1745,9 +1745,7 @@ SwTextNode::GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich,
const SwTextInputField* SwTextNode::GetOverlappingInputField( const SwTextAttr& rTextAttr ) const
{
- const SwTextInputField* pTextInputField = nullptr;
-
- pTextInputField = dynamic_cast<const SwTextInputField*>(GetTextAttrAt( rTextAttr.GetStart(), RES_TXTATR_INPUTFIELD, PARENT ));
+ const SwTextInputField* pTextInputField = dynamic_cast<const SwTextInputField*>(GetTextAttrAt( rTextAttr.GetStart(), RES_TXTATR_INPUTFIELD, PARENT ));
if ( pTextInputField == nullptr && rTextAttr.End() != nullptr )
{
@@ -1776,9 +1774,7 @@ SwTextField* SwTextNode::GetFieldTextAttrAt(
const sal_Int32 nIndex,
const bool bIncludeInputFieldAtStart ) const
{
- SwTextField* pTextField = nullptr;
-
- pTextField = dynamic_cast<SwTextField*>(GetTextAttrForCharAt( nIndex, RES_TXTATR_FIELD ));
+ SwTextField* pTextField = dynamic_cast<SwTextField*>(GetTextAttrForCharAt( nIndex, RES_TXTATR_FIELD ));
if ( pTextField == nullptr )
{
pTextField = dynamic_cast<SwTextField*>(GetTextAttrForCharAt( nIndex, RES_TXTATR_ANNOTATION ));
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 39ca6f1a85a1..54dbe392e349 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1846,8 +1846,7 @@ void SwTextNode::TransliterateText(
aChanges.push_back( aChgData );
}
- Boundary aFirstWordBndry;
- aFirstWordBndry = g_pBreakIt->GetBreakIter()->nextWord(
+ Boundary aFirstWordBndry = g_pBreakIt->GetBreakIter()->nextWord(
GetText(), nCurrentEnd,
g_pBreakIt->GetLocale( GetLang( nCurrentEnd ) ),
nWordType);
diff --git a/sw/source/core/undo/SwRewriter.cxx b/sw/source/core/undo/SwRewriter.cxx
index 22105f0a2aa8..da3df123c41f 100644
--- a/sw/source/core/undo/SwRewriter.cxx
+++ b/sw/source/core/undo/SwRewriter.cxx
@@ -30,9 +30,7 @@ void SwRewriter::AddRule(SwUndoArg eWhat, const OUString & rWith)
{
SwRewriteRule aRule(eWhat, rWith);
- vector<SwRewriteRule>::iterator aIt;
-
- aIt = find_if(
+ vector<SwRewriteRule>::iterator aIt = find_if(
mRules.begin(), mRules.end(),
[&aRule](SwRewriteRule const & a) { return a.first == aRule.first; });
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 7aa18cabc1f4..e5b48e5fa363 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -180,8 +180,7 @@ SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId )
SwRewriter SwUndoRedlineDelete::GetRewriter() const
{
SwRewriter aResult;
- OUString aStr = m_sRedlineText;
- aStr = DenoteSpecialCharacters(aStr);
+ OUString aStr = DenoteSpecialCharacters(m_sRedlineText);
aStr = ShortenString(aStr, nUndoStringLength, SwResId(STR_LDOTS));
SwRewriter aRewriter;
aRewriter.AddRule(UndoArg1, aStr);
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index c3be78ddf981..dc6db2ab7438 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1610,8 +1610,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
}
else if (aValue.has<uno::Reference<graphic::XGraphic>>())
{
- uno::Reference<graphic::XGraphic> xGraphic;
- xGraphic = aValue.get<uno::Reference<graphic::XGraphic>>();
+ uno::Reference<graphic::XGraphic> xGraphic = aValue.get<uno::Reference<graphic::XGraphic>>();
if (xGraphic.is())
{
aGraphic = Graphic(xGraphic);
@@ -1647,8 +1646,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
}
else if (aValue.has<uno::Reference<graphic::XGraphic>>())
{
- uno::Reference<graphic::XGraphic> xGraphic;
- xGraphic = aValue.get<uno::Reference<graphic::XGraphic>>();
+ uno::Reference<graphic::XGraphic> xGraphic = aValue.get<uno::Reference<graphic::XGraphic>>();
if (xGraphic.is())
{
aGraphic = Graphic(xGraphic);
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index d7abd42dea4a..26f6dab13353 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -999,8 +999,7 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV
else if(rPropertyName == "TableRedlineParams")
{
// Get the table row properties
- uno::Sequence<beans::PropertyValue> tableCellProperties;
- tableCellProperties = aValue.get< uno::Sequence< beans::PropertyValue > >();
+ uno::Sequence<beans::PropertyValue> tableCellProperties = aValue.get< uno::Sequence< beans::PropertyValue > >();
comphelper::SequenceAsHashMap aPropMap(tableCellProperties);
OUString sRedlineType;
if(!(aPropMap.getValue("RedlineType") >>= sRedlineType))
@@ -1297,8 +1296,7 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName, const uno:
if ( rPropertyName == "TableRedlineParams" )
{
// Get the table row properties
- uno::Sequence< beans::PropertyValue > tableRowProperties;
- tableRowProperties = aValue.get< uno::Sequence< beans::PropertyValue > >();
+ uno::Sequence< beans::PropertyValue > tableRowProperties = aValue.get< uno::Sequence< beans::PropertyValue > >();
comphelper::SequenceAsHashMap aPropMap( tableRowProperties );
OUString sRedlineType;
if( !(aPropMap.getValue("RedlineType") >>= sRedlineType) )
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7e621fa52948..e7c2f3510da3 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6941,9 +6941,7 @@ void DocxAttributeOutput::CharCaseMap( const SvxCaseMapItem& rCaseMap )
void DocxAttributeOutput::CharColor( const SvxColorItem& rColor )
{
const Color aColor( rColor.GetValue() );
- OString aColorString;
-
- aColorString = msfilter::util::ConvertColor( aColor );
+ OString aColorString = msfilter::util::ConvertColor( aColor );
const char* pExistingValue(nullptr);
if (m_pColorAttrList.is() && m_pColorAttrList->getAsChar(FSNS(XML_w, XML_val), pExistingValue))
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index d28c3c9b21a6..e8024024dd9a 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1346,8 +1346,7 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho
OUString sCheckForBrokenChains = rEntry.first;
//follow the chain and assign the same id, and incremental sequence numbers.
- std::map<OUString, MSWordExportBase::LinkedTextboxInfo>::iterator followChainIter;
- followChainIter
+ auto followChainIter
= m_pImpl->getExport().m_aLinkedTextboxesHelper.find(rEntry.second.sNextChain);
while (followChainIter != m_pImpl->getExport().m_aLinkedTextboxesHelper.end())
{
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 41d8dc3072d6..e89563655fd7 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -602,8 +602,7 @@ FlyProcessingState SwWW8AttrIter::OutFlys(sal_Int32 nSwPos)
//there are many discarded duplicates in documents - no duplicates allowed in the list, so try to find the real one.
//if this LinkDisplayName/ChainName already exists on a different shape...
// the earlier processed duplicates are thrown out unless this one can be proved as bad. (last processed duplicate usually is stored)
- std::map<OUString,MSWordExportBase::LinkedTextboxInfo>::iterator linkFinder;
- linkFinder = m_rExport.m_aLinkedTextboxesHelper.find(sLinkChainName);
+ auto linkFinder = m_rExport.m_aLinkedTextboxesHelper.find(sLinkChainName);
if( linkFinder != m_rExport.m_aLinkedTextboxesHelper.end() )
{
//If my NEXT/PREV targets have already been discovered, but don't match me, then assume I'm an abandoned remnant
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 889e6ce17d9d..2100a9b5b52f 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3226,8 +3226,7 @@ void AttributeOutputBase::TextFlyContent( const SwFormatFlyCnt& rFlyContent )
{
if ( auto pTextNd = dynamic_cast< const SwContentNode *>( GetExport().m_pOutFormatNode ) )
{
- Point aLayPos;
- aLayPos = pTextNd->FindLayoutRect( false, &aLayPos ).Pos();
+ Point aLayPos = pTextNd->FindLayoutRect( false, &aLayPos ).Pos();
SwPosition aPos( *pTextNd );
ww8::Frame aFrame( *rFlyContent.GetFrameFormat(), aPos );
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0cc938391fab..060fcd09c6cb 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5091,8 +5091,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
FTNNUM_DOC, FTNNUM_CHAPTER, FTNNUM_PAGE, FTNNUM_DOC
};
- SwFootnoteInfo aInfo;
- aInfo = m_rDoc.GetFootnoteInfo(); // Copy-Ctor private
+ SwFootnoteInfo aInfo = m_rDoc.GetFootnoteInfo(); // Copy-Ctor private
aInfo.ePos = FTNPOS_PAGE;
aInfo.eNum = eNumA[m_xWDop->rncFootnote];
@@ -5104,8 +5103,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
}
if (m_xSBase->AreThereEndnotes())
{
- SwEndNoteInfo aInfo;
- aInfo = m_rDoc.GetEndNoteInfo(); // Same as for Footnote
+ SwEndNoteInfo aInfo = m_rDoc.GetEndNoteInfo(); // Same as for Footnote
sal_uInt16 nfcEdnRef = m_xWDop->nfcEdnRef & 0xF;
aInfo.aFormat.SetNumberingType( eNumTA[nfcEdnRef] );
if( m_xWDop->nEdn )
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index b970f29ac677..9724fbffb0cd 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -575,9 +575,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet
if (aLVL.nLenGrpprlPapx != rSt.ReadBytes(&aGrpprlPapx, aLVL.nLenGrpprlPapx))
return false;
// "sprmPDxaLeft" pap.dxaLeft;dxa;word;
- SprmResult aSprm;
-
- aSprm = GrpprlHasSprm(0x840F,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
+ SprmResult aSprm = GrpprlHasSprm(0x840F,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
if (!aSprm.pSprm)
aSprm = GrpprlHasSprm(0x845E,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 7858a11e183d..9b0ffaf3b602 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -273,8 +273,7 @@ long SwWW8ImplReader::Read_FactoidBook(WW8PLCFManResult*)
/// at the same time, double backslashes are converted into single ones
OUString SwWW8ImplReader::ConvertFFileName(const OUString& rOrg)
{
- OUString aName = rOrg;
- aName = aName.replaceAll("\\\\", "\\");
+ OUString aName = rOrg.replaceAll("\\\\", "\\");
aName = aName.replaceAll("%20", " ");
// remove attached quotation marks
diff --git a/sw/source/filter/xml/xmltext.cxx b/sw/source/filter/xml/xmltext.cxx
index 3f2d2076beee..be51bf82ed68 100644
--- a/sw/source/filter/xml/xmltext.cxx
+++ b/sw/source/filter/xml/xmltext.cxx
@@ -51,9 +51,7 @@ SvXMLImportContextRef SwXMLBodyContentContext_Impl::CreateChildContext(
sal_uInt16 nPrefix, const OUString& rLocalName,
const Reference< xml::sax::XAttributeList > & xAttrList )
{
- SvXMLImportContext *pContext = nullptr;
-
- pContext = GetSwImport().GetTextImport()->CreateTextChildContext(
+ SvXMLImportContext *pContext = GetSwImport().GetTextImport()->CreateTextChildContext(
GetImport(), nPrefix, rLocalName, xAttrList,
XMLTextType::Body );
if( !pContext )
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index fbba8bf35e20..9d152e0d6bfa 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -394,9 +394,7 @@ void SwFieldVarPage::SubTypeHdl(const weld::TreeView* pBox)
{
bValue = bNumFormat = true;
- OUString sName;
-
- sName = m_xSelectionLB->get_selected_text();
+ OUString sName = m_xSelectionLB->get_selected_text();
m_xNameED->set_text( sName );
// User- or SetField ?
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index d5512ffd698c..1f9e5d3aea8f 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1416,11 +1416,9 @@ void SwFramePage::FillRelLB(const FrameMap* _pMap,
{
if (nLBRelations & rCharMap.nLBRelation)
{
- SvxSwFramePosString::StringId sStrId1 = rCharMap.eStrId;
-
// --> OD 2009-08-31 #mongolianlayout#
- sStrId1 =
- lcl_ChangeResIdToVerticalOrRTL( sStrId1,
+ SvxSwFramePosString::StringId sStrId1 =
+ lcl_ChangeResIdToVerticalOrRTL( rCharMap.eStrId,
m_bIsVerticalFrame,
m_bIsVerticalL2R,
m_bIsInRightToLeft);
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 3bca4e2b739d..69a9b025f694 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5948,8 +5948,7 @@ void QuickHelpData::FillStrArr( SwWrtShell const & rSh, const OUString& rWord )
else
{
// First character is not lower case i.e. assume upper or title case
- OUString sWordSentence = sWordLower;
- sWordSentence = sWordSentence.replaceAt( 0, 1, OUString(rWord[0]) );
+ OUString sWordSentence = sWordLower.replaceAt( 0, 1, OUString(rWord[0]) );
if ( rWord == sWordSentence )
aWordCase = CASE_SENTENCE;
else
diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx
index e302a01a845c..1245d83195a7 100644
--- a/sw/source/uibase/shells/langhelper.cxx
+++ b/sw/source/uibase/shells/langhelper.cxx
@@ -546,10 +546,9 @@ namespace SwLangHelper
OUString GetTextForLanguageGuessing(EditEngine const * rEditEngine, const ESelection& rDocSelection)
{
// string for guessing language
- OUString aText;
// get the full text of the paragraph that the end of selection is in
- aText = rEditEngine->GetText(rDocSelection.nEndPos);
+ OUString aText = rEditEngine->GetText(rDocSelection.nEndPos);
if (!aText.isEmpty())
{
sal_Int32 nStt = 0;
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index eebc6eee42d1..5213a01de635 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1096,8 +1096,7 @@ void SwView::Execute(SfxRequest &rReq)
SwDBManager* pDBManager = rSh.GetDBManager();
if (pDBManager)
{
- SwDBData aData;
- aData = rSh.GetDBData();
+ SwDBData aData = rSh.GetDBData();
rSh.EnterStdMode(); // force change in text shell; necessary for mixing DB fields
AttrChangedNotify( &rSh );
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index 09697b2c96ed..94edaba41a3f 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -302,8 +302,7 @@ void SwView::SetVisArea( const Point &rPt, bool bUpdateScrollbar )
// align is not possible (better idea?!?!)
// (fix: Bild.de, 200%) It does not work completely without alignment
// Let's see how far we get with half BrushSize.
- Point aPt( rPt );
- aPt = GetEditWin().LogicToPixel( aPt );
+ Point aPt = GetEditWin().LogicToPixel( rPt );
#if HAVE_FEATURE_DESKTOP
const long nTmp = GetWrtShell().IsFrameView() ? 4 : 8;
aPt.AdjustX( -(aPt.X() % nTmp) );
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 0cd8e2f0d52b..4a1c0b9da073 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -947,8 +947,7 @@ Reference< XIndexAccess >
auto pResultCursor(FindAny(xDesc, xCursor, true, nResult, xTmp));
if(!pResultCursor)
throw RuntimeException("No result cursor");
- Reference< XIndexAccess > xRet;
- xRet = SwXTextRanges::Create( nResult ? &(*pResultCursor) : nullptr );
+ Reference< XIndexAccess > xRet = SwXTextRanges::Create( nResult ? &(*pResultCursor) : nullptr );
return xRet;
}
diff --git a/sw/source/uibase/utlui/condedit.cxx b/sw/source/uibase/utlui/condedit.cxx
index 84de7d82c99a..231a43cb74f8 100644
--- a/sw/source/uibase/utlui/condedit.cxx
+++ b/sw/source/uibase/utlui/condedit.cxx
@@ -64,8 +64,7 @@ sal_Int8 ConditionEditDropTarget::ExecuteDrop( const ExecuteDropEvent& rEvt )
bool bBrackets = m_rEdit.GetBrackets();
if (bBrackets)
sDBName += "[";
- OUString sTmp;
- sTmp = aColDesc.getDataSource();
+ OUString sTmp = aColDesc.getDataSource();
sDBName += sTmp;
sDBName += ".";
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 1e721a638f9a..73c553c11709 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -595,9 +595,8 @@ void SwWrtShell::LaunchOLEObj( long nVerb )
{
svt::EmbeddedObjectRef& xRef = GetOLEObject();
OSL_ENSURE( xRef.is(), "OLE not found" );
- SfxInPlaceClient* pCli=nullptr;
- pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
+ SfxInPlaceClient* pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
if ( !pCli )
pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef );