summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-13 21:25:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-19 13:19:45 +0200
commit8b663bc830605a0065184b299bea9cd3682d7935 (patch)
tree9dd047c9b6423ba047a6c7a1371ee9f658b7e26d /sd
parent1a5b12aa5da2c718848d3cc5d9bce7bfcdeacf54 (diff)
loplugin:sequentialassign in sd
Change-Id: I7d592b8929ca46c64a622551b039af0d6a7911db Reviewed-on: https://gerrit.libreoffice.org/70716 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/export-tests-ooxml1.cxx12
-rw-r--r--sd/source/core/drawdoc2.cxx3
-rw-r--r--sd/source/core/sdpage.cxx4
-rw-r--r--sd/source/filter/eppt/pptx-epptbase.cxx3
-rw-r--r--sd/source/ui/accessibility/AccessiblePageShape.cxx9
-rw-r--r--sd/source/ui/dlg/filedlg.cxx3
-rw-r--r--sd/source/ui/func/fuconrec.cxx3
-rw-r--r--sd/source/ui/func/unoaprms.cxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx3
-rw-r--r--sd/source/ui/tools/IconCache.cxx3
-rw-r--r--sd/source/ui/tools/SdGlobalResourceContainer.cxx6
-rw-r--r--sd/source/ui/unoidl/SdUnoDrawView.cxx4
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx3
-rw-r--r--sd/source/ui/view/Outliner.cxx4
-rw-r--r--sd/source/ui/view/drviews2.cxx3
-rw-r--r--sd/source/ui/view/sdview.cxx3
-rw-r--r--sd/source/ui/view/sdview3.cxx3
-rw-r--r--sd/source/ui/view/sdwindow.cxx3
18 files changed, 24 insertions, 52 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index bf1c6b422354..e7080ae0a6e8 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -752,32 +752,28 @@ void SdOOXMLExportTest1::testTableCellBorder()
uno::Reference< beans::XPropertySet > xCellPropSet (xCell, uno::UNO_QUERY_THROW);
xCellPropSet->getPropertyValue("LeftBorder") >>= aBorderLine;
- sal_Int32 nLeftBorder = aBorderLine.LineWidth ;
// While importing the table cell border line width, it converts EMU->Hmm then divided result by 2.
// To get original value of LineWidth need to multiple by 2.
- nLeftBorder = nLeftBorder * 2 ;
+ sal_Int32 nLeftBorder = aBorderLine.LineWidth * 2;
nLeftBorder = oox::drawingml::convertHmmToEmu( nLeftBorder );
CPPUNIT_ASSERT(nLeftBorder);
CPPUNIT_ASSERT_EQUAL(util::Color(45296), aBorderLine.Color);
xCellPropSet->getPropertyValue("RightBorder") >>= aBorderLine;
- sal_Int32 nRightBorder = aBorderLine.LineWidth ;
- nRightBorder = nRightBorder * 2 ;
+ sal_Int32 nRightBorder = aBorderLine.LineWidth * 2;
nRightBorder = oox::drawingml::convertHmmToEmu( nRightBorder );
CPPUNIT_ASSERT(nRightBorder);
CPPUNIT_ASSERT_EQUAL(util::Color(16777215), aBorderLine.Color);
xCellPropSet->getPropertyValue("TopBorder") >>= aBorderLine;
- sal_Int32 nTopBorder = aBorderLine.LineWidth ;
- nTopBorder = nTopBorder * 2 ;
+ sal_Int32 nTopBorder = aBorderLine.LineWidth * 2;
nTopBorder = oox::drawingml::convertHmmToEmu( nTopBorder );
CPPUNIT_ASSERT(nTopBorder);
CPPUNIT_ASSERT_EQUAL(util::Color(45296), aBorderLine.Color);
xCellPropSet->getPropertyValue("BottomBorder") >>= aBorderLine;
- sal_Int32 nBottomBorder = aBorderLine.LineWidth ;
- nBottomBorder = nBottomBorder * 2 ;
+ sal_Int32 nBottomBorder = aBorderLine.LineWidth * 2;
nBottomBorder = oox::drawingml::convertHmmToEmu( nBottomBorder );
CPPUNIT_ASSERT(nBottomBorder);
CPPUNIT_ASSERT_EQUAL(util::Color(45296), aBorderLine.Color);
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index bf3ecb518aff..7c73d7dc66ca 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -802,8 +802,7 @@ bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
// Insert after <nPage>
else
{
- nTargetPage = nPage;
- nTargetPage = 2 * nTargetPage + 1; // PageKind::Standard --> absolute
+ nTargetPage = 2 * nPage + 1; // PageKind::Standard --> absolute
for (const auto& rpPage : aPageList)
{
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index ad3ba3cb48ec..a5903269364f 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2745,9 +2745,7 @@ void SdPage::setHeaderFooterSettings( const sd::HeaderFooterSettings& rNewSettin
if(!pMasterPage)
return;
- SdrObject* pCandidate = nullptr;
-
- pCandidate = pMasterPage->GetPresObj( PRESOBJ_HEADER );
+ SdrObject* pCandidate = pMasterPage->GetPresObj( PRESOBJ_HEADER );
if(pCandidate)
{
diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx
index da99752ae3d5..83cabbd88a74 100644
--- a/sd/source/filter/eppt/pptx-epptbase.cxx
+++ b/sd/source/filter/eppt/pptx-epptbase.cxx
@@ -303,8 +303,7 @@ bool PPTWriterBase::GetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
Reference< XMasterPageTarget > aXMasterPageTarget( mXDrawPage, UNO_QUERY );
if ( aXMasterPageTarget.is() )
{
- Reference< XDrawPage > aXMasterDrawPage;
- aXMasterDrawPage = aXMasterPageTarget->getMasterPage();
+ Reference< XDrawPage > aXMasterDrawPage = aXMasterPageTarget->getMasterPage();
if ( aXMasterDrawPage.is() )
{
Reference< XPropertySet > aXMasterPagePropSet;
diff --git a/sd/source/ui/accessibility/AccessiblePageShape.cxx b/sd/source/ui/accessibility/AccessiblePageShape.cxx
index 785e098ad869..65df32db40bf 100644
--- a/sd/source/ui/accessibility/AccessiblePageShape.cxx
+++ b/sd/source/ui/accessibility/AccessiblePageShape.cxx
@@ -143,8 +143,7 @@ sal_Int32 SAL_CALL AccessiblePageShape::getForeground()
uno::Reference<beans::XPropertySet> aSet (mxPage, uno::UNO_QUERY);
if (aSet.is())
{
- uno::Any aColor;
- aColor = aSet->getPropertyValue ("LineColor");
+ uno::Any aColor = aSet->getPropertyValue ("LineColor");
aColor >>= nColor;
}
}
@@ -168,8 +167,7 @@ sal_Int32 SAL_CALL AccessiblePageShape::getBackground()
uno::Reference<beans::XPropertySet> xSet (mxPage, uno::UNO_QUERY);
if (xSet.is())
{
- uno::Any aBGSet;
- aBGSet = xSet->getPropertyValue ("Background");
+ uno::Any aBGSet = xSet->getPropertyValue ("Background");
Reference<beans::XPropertySet> xBGSet (aBGSet, uno::UNO_QUERY);
if ( ! xBGSet.is())
{
@@ -187,8 +185,7 @@ sal_Int32 SAL_CALL AccessiblePageShape::getBackground()
// gradients, hashes, and bitmaps.
if (xBGSet.is())
{
- uno::Any aColor;
- aColor = xBGSet->getPropertyValue ("FillColor");
+ uno::Any aColor = xBGSet->getPropertyValue ("FillColor");
aColor >>= nColor;
}
else
diff --git a/sd/source/ui/dlg/filedlg.cxx b/sd/source/ui/dlg/filedlg.cxx
index d8065dbce563..4822b3da3426 100644
--- a/sd/source/ui/dlg/filedlg.cxx
+++ b/sd/source/ui/dlg/filedlg.cxx
@@ -210,8 +210,7 @@ SdFileDialog_Imp::~SdFileDialog_Imp()
SdOpenSoundFileDialog::SdOpenSoundFileDialog(weld::Window *pParent)
: mpImpl(new SdFileDialog_Imp(pParent))
{
- OUString aDescr;
- aDescr = SdResId(STR_ALL_FILES);
+ OUString aDescr = SdResId(STR_ALL_FILES);
mpImpl->AddFilter( aDescr, "*.*");
// setup filter
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index edaf97aee68e..6bc0f3a658a8 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -653,8 +653,7 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj
::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/sd/source/ui/func/unoaprms.cxx b/sd/source/ui/func/unoaprms.cxx
index ab46b90ac8ee..1a30565e0f76 100644
--- a/sd/source/ui/func/unoaprms.cxx
+++ b/sd/source/ui/func/unoaprms.cxx
@@ -64,9 +64,7 @@ void SdAnimationPrmsUndoAction::Undo()
void SdAnimationPrmsUndoAction::Redo()
{
- SdAnimationInfo* pInfo = nullptr;
-
- pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
+ SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
pInfo->mbActive = bNewActive;
pInfo->meEffect = eNewEffect;
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 3e247825fcf0..420c99f86e80 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -876,8 +876,7 @@ void SlotManager::RenameSlide(const SfxRequest& rRequest)
if(rRequest.GetArgs())
{
- OUString aName;
- aName = rRequest.GetArgs()->GetItem<const SfxStringItem>(SID_RENAMEPAGE)->GetValue();
+ OUString aName = rRequest.GetArgs()->GetItem<const SfxStringItem>(SID_RENAMEPAGE)->GetValue();
bool bResult = RenameSlideFromDrawViewShell(pSelectedPage->GetPageNum()/2, aName );
DBG_ASSERT( bResult, "Couldn't rename slide" );
diff --git a/sd/source/ui/tools/IconCache.cxx b/sd/source/ui/tools/IconCache.cxx
index 5cd46bc18b23..514e513a1b42 100644
--- a/sd/source/ui/tools/IconCache.cxx
+++ b/sd/source/ui/tools/IconCache.cxx
@@ -51,8 +51,7 @@ IconCache* IconCache::Implementation::s_pIconCache = nullptr;
Image IconCache::Implementation::GetIcon(const OUString& rResourceId)
{
Image aResult;
- ImageContainer::iterator iImage;
- iImage = maContainer.find(rResourceId);
+ ImageContainer::iterator iImage = maContainer.find(rResourceId);
if (iImage == maContainer.end())
{
aResult = Image(StockImage::Yes, rResourceId);
diff --git a/sd/source/ui/tools/SdGlobalResourceContainer.cxx b/sd/source/ui/tools/SdGlobalResourceContainer.cxx
index dc0e86704d5f..c5b56cada8db 100644
--- a/sd/source/ui/tools/SdGlobalResourceContainer.cxx
+++ b/sd/source/ui/tools/SdGlobalResourceContainer.cxx
@@ -108,8 +108,7 @@ void SdGlobalResourceContainer::AddResource (
{
::osl::MutexGuard aGuard (mpImpl->maMutex);
- Implementation::SharedResourceList::iterator iResource;
- iResource = ::std::find (
+ Implementation::SharedResourceList::iterator iResource = ::std::find (
mpImpl->maSharedResources.begin(),
mpImpl->maSharedResources.end(),
pResource);
@@ -126,8 +125,7 @@ void SdGlobalResourceContainer::AddResource (const Reference<XInterface>& rxReso
{
::osl::MutexGuard aGuard (mpImpl->maMutex);
- Implementation::XInterfaceResourceList::iterator iResource;
- iResource = ::std::find (
+ Implementation::XInterfaceResourceList::iterator iResource = ::std::find (
mpImpl->maXInterfaceResources.begin(),
mpImpl->maXInterfaceResources.end(),
rxResource);
diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx
index 4a133cccdfd3..db9f7a465864 100644
--- a/sd/source/ui/unoidl/SdUnoDrawView.cxx
+++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx
@@ -468,9 +468,7 @@ void SdUnoDrawView::SetViewOffset(const awt::Point& rWinPos )
awt::Point SdUnoDrawView::GetViewOffset() const
{
- Point aRet;
-
- aRet = mrDrawViewShell.GetWinViewPos();
+ Point aRet = mrDrawViewShell.GetWinViewPos();
aRet -= mrDrawViewShell.GetViewOrigin();
return awt::Point( aRet.X(), aRet.Y() );
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 376074686ac6..8e669d3cec97 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -346,8 +346,7 @@ uno::Sequence<beans::PropertyValue>
try {
// create Settings/ sub storage.
- uno::Reference< embed::XStorage > xSubStorage;
- xSubStorage = xStorage->openStorageElement( "Settings" ,
+ uno::Reference< embed::XStorage > xSubStorage = xStorage->openStorageElement( "Settings" ,
embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE );
if( !xSubStorage.is() )
return aRet;
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 2f69f26a9f74..b161e0c8b335 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -198,9 +198,7 @@ SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode nMode )
try
{
const SvtLinguConfig aLinguConfig;
- Any aAny;
-
- aAny = aLinguConfig.GetProperty( UPN_IS_SPELL_AUTO );
+ Any aAny = aLinguConfig.GetProperty( UPN_IS_SPELL_AUTO );
aAny >>= bOnlineSpell;
}
catch( ... )
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index eb90f8cb3298..bd812d4f4a5a 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -791,8 +791,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if(rReq.GetArgs())
{
- OUString aName;
- aName = rReq.GetArgs()->GetItem<const SfxStringItem>(SID_RENAMEPAGE)->GetValue();
+ OUString aName = rReq.GetArgs()->GetItem<const SfxStringItem>(SID_RENAMEPAGE)->GetValue();
bool bResult = RenameSlide( maTabControl->GetPageId(nPage), aName );
DBG_ASSERT( bResult, "Couldn't rename slide" );
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index cd929d32a36a..d5d986d23e11 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -713,8 +713,7 @@ bool View::SdrBeginTextEdit(
{
if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_TABLE )
{
- Color aBackground;
- aBackground = GetTextEditBackgroundColor(*this);
+ Color aBackground = GetTextEditBackgroundColor(*this);
pOL->SetBackgroundColor( aBackground );
}
else
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index e392b69fa23f..6f09074d2631 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -244,8 +244,7 @@ bool View::InsertMetaFile( TransferableDataHelper& rDataHelper, const Point& rPo
// restrict movement to WorkArea
Point aInsertPos( rPos );
- Size aImageSize;
- aImageSize = bVector ? aMtf.GetPrefSize() : aGraphic.GetSizePixel();
+ Size aImageSize = bVector ? aMtf.GetPrefSize() : aGraphic.GetSizePixel();
ImpCheckInsertPos(aInsertPos, aImageSize, GetWorkArea());
if( bVector )
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index b37d113b40f7..01b495295546 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -674,8 +674,7 @@ double Window::GetVisibleHeight()
Point Window::GetVisibleCenter()
{
- Point aPos;
- aPos = ::tools::Rectangle(aPos, GetOutputSizePixel()).Center();
+ Point aPos = ::tools::Rectangle(Point(), GetOutputSizePixel()).Center();
// For LOK
bool bMapModeWasEnabled(IsMapModeEnabled());