[Libreoffice-commits] core.git: i18npool/source sdext/source sfx2/source slideshow/source solenv/bin soltools/cpp sot/source starmath/source svl/source svtools/source svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Nov 7 11:40:49 UTC 2018
i18npool/source/nativenumber/nativenumbersupplier.cxx | 12 +--
sdext/source/minimizer/optimizerdialog.cxx | 21 ++---
sfx2/source/appl/workwin.cxx | 17 +---
sfx2/source/control/dispatch.cxx | 7 -
sfx2/source/doc/DocumentMetadataAccess.cxx | 5 -
sfx2/source/view/lokcharthelper.cxx | 23 ++---
slideshow/source/engine/animationnodes/animationbasenode.cxx | 6 -
solenv/bin/concat-deps.c | 13 +--
soltools/cpp/_cpp.c | 7 -
sot/source/sdstor/stgdir.cxx | 5 -
sot/source/sdstor/storage.cxx | 7 -
starmath/source/view.cxx | 4 -
svl/source/fsstor/fsstorage.cxx | 18 +---
svtools/source/config/colorcfg.cxx | 7 -
svtools/source/control/valueset.cxx | 29 ++-----
svtools/source/dialogs/prnsetup.cxx | 7 -
svtools/source/uno/addrtempuno.cxx | 5 -
svx/source/form/fmshimp.cxx | 7 -
svx/source/sidebar/line/LinePropertyPanelBase.cxx | 22 ++---
svx/source/svdraw/svddrgmt.cxx | 44 ++++-------
svx/source/svdraw/svdmodel.cxx | 7 -
svx/source/svdraw/svdpoev.cxx | 23 ++---
svx/source/svdraw/svdviter.cxx | 7 -
svx/source/svdraw/svdxcgv.cxx | 14 +--
svx/source/table/svdotable.cxx | 9 --
svx/source/tbxctrls/extrusioncontrols.cxx | 15 +--
26 files changed, 126 insertions(+), 215 deletions(-)
New commits:
commit 5404f75a2fa863b97bdf8432f647053f0bff726e
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Nov 7 09:26:57 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Nov 7 12:39:11 2018 +0100
loplugin:collapseif in sdext..svx
Change-Id: I188d9e9b53e00acfbae3c7acd54de28f084c4b3f
Reviewed-on: https://gerrit.libreoffice.org/62985
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index e3a023d792df..34dcae601029 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -216,13 +216,11 @@ static OUString AsciiToNative( const OUString& inStr, sal_Int32 nCount,
if (count > 0 && number->multiplierExponent[number->exponentCount-1] == 1 &&
newStr[count-1] == numberChar[0])
count--;
- if (bNotZero && _count == count) {
- if (end != len) {
- newStr[count] = number->multiplierChar[0];
- if (useOffset)
- offset[count] = i - len;
- count++;
- }
+ if (bNotZero && _count == count && end != len) {
+ newStr[count] = number->multiplierChar[0];
+ if (useOffset)
+ offset[count] = i - len;
+ count++;
}
}
if (! bNotZero && ! (number->numberFlag & NUMBER_OMIT_ONLY_ZERO)) {
diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx
index 9185f8e4f327..f7aa8cb9564e 100644
--- a/sdext/source/minimizer/optimizerdialog.cxx
+++ b/sdext/source/minimizer/optimizerdialog.cxx
@@ -173,22 +173,19 @@ void OptimizerDialog::UpdateConfiguration()
}
aAny = getControlProperty( "CheckBox3Pg3", "State" );
- if ( aAny >>= nInt16 )
+ if ( (aAny >>= nInt16) && nInt16 )
{
- if ( nInt16 )
+ aAny = getControlProperty( "ListBox0Pg3", "SelectedItems" );
+ if ( aAny >>= aSelectedItems )
{
- aAny = getControlProperty( "ListBox0Pg3", "SelectedItems" );
- if ( aAny >>= aSelectedItems )
+ if ( aSelectedItems.getLength() )
{
- if ( aSelectedItems.getLength() )
+ sal_Int16 nSelectedItem = aSelectedItems[ 0 ];
+ aAny = getControlProperty( "ListBox0Pg3", "StringItemList" );
+ if ( aAny >>= aStringItemList )
{
- sal_Int16 nSelectedItem = aSelectedItems[ 0 ];
- aAny = getControlProperty( "ListBox0Pg3", "StringItemList" );
- if ( aAny >>= aStringItemList )
- {
- if ( aStringItemList.getLength() > nSelectedItem )
- SetConfigProperty( TK_CustomShowName, Any( aStringItemList[ nSelectedItem ] ) );
- }
+ if ( aStringItemList.getLength() > nSelectedItem )
+ SetConfigProperty( TK_CustomShowName, Any( aStringItemList[ nSelectedItem ] ) );
}
}
}
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 69e29d2e6d83..26c211d644f8 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -658,11 +658,8 @@ void SfxWorkWindow::ArrangeChildren_Impl( bool bForce )
return;
SvBorder aBorder;
- if ( nChildren )
- {
- if ( IsVisible_Impl() )
- aBorder = Arrange_Impl();
- }
+ if ( nChildren && IsVisible_Impl() )
+ aBorder = Arrange_Impl();
// If the current application document contains a IPClient, then the
// object through SetTopToolFramePixel has to be assigned the available
// space. The object will then point to its UITools and sets the app border
@@ -1288,11 +1285,8 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
if ( bCreate )
CreateChildWin_Impl( pCW, false );
- if ( !bAllChildrenVisible )
- {
- if ( pCW->pCli )
- pCW->pCli->nVisible &= ~SfxChildVisibility::ACTIVE;
- }
+ if ( !bAllChildrenVisible && pCW->pCli )
+ pCW->pCli->nVisible &= ~SfxChildVisibility::ACTIVE;
}
else if ( pChildWin )
{
@@ -1593,8 +1587,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild,
for ( n=0; n<aSortedList.size(); ++n )
{
SfxChild_Impl *pChild = aChildren[aSortedList[n]];
- if ( pChild )
- if ( pChild->pWin == pWin )
+ if ( pChild && pChild->pWin == pWin )
break;
}
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 55d38c2dc3bf..c0d8802954ec 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1206,11 +1206,8 @@ void SfxDispatcher::Update_Impl( bool bForce )
bool bIsActive = false;
SfxDispatcher *pActDispat = pWorkWin->GetBindings().GetDispatcher_Impl();
- if ( !bIsActive )
- {
- if ( this == pActDispat )
- bIsActive = true;
- }
+ if ( !bIsActive && this == pActDispat )
+ bIsActive = true;
Update_Impl_( bUIActive, !bIsIPActive, bIsIPActive, pWorkWin );
if ( (bUIActive || bIsActive) && !comphelper::LibreOfficeKit::isActive() )
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index c39e525ff5e1..8d5c1a6bc1ad 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -724,9 +724,8 @@ retry:
"exception", nullptr, rterr);
}
- if (err) {
- if (handleError(iaioe, i_xHandler)) goto retry;
- }
+ if (err && handleError(iaioe, i_xHandler))
+ goto retry;
}
/** init Impl struct */
diff --git a/sfx2/source/view/lokcharthelper.cxx b/sfx2/source/view/lokcharthelper.cxx
index 04b433c66677..dd68454b8e59 100644
--- a/sfx2/source/view/lokcharthelper.cxx
+++ b/sfx2/source/view/lokcharthelper.cxx
@@ -45,24 +45,21 @@ Size lcl_TwipsToHMM( const Size& rSize )
css::uno::Reference<css::frame::XController>& LokChartHelper::GetXController()
{
- if(!mxController.is() )
+ if(!mxController.is() && mpViewShell)
{
- if (mpViewShell)
+ SfxInPlaceClient* pIPClient = mpViewShell->GetIPClient();
+ if (pIPClient)
{
- SfxInPlaceClient* pIPClient = mpViewShell->GetIPClient();
- if (pIPClient)
+ const css::uno::Reference< ::css::embed::XEmbeddedObject >& xEmbObj = pIPClient->GetObject();
+ if( xEmbObj.is() )
{
- const css::uno::Reference< ::css::embed::XEmbeddedObject >& xEmbObj = pIPClient->GetObject();
- if( xEmbObj.is() )
+ ::css::uno::Reference< ::css::chart2::XChartDocument > xChart( xEmbObj->getComponent(), uno::UNO_QUERY );
+ if( xChart.is() )
{
- ::css::uno::Reference< ::css::chart2::XChartDocument > xChart( xEmbObj->getComponent(), uno::UNO_QUERY );
- if( xChart.is() )
+ ::css::uno::Reference< ::css::frame::XController > xChartController = xChart->getCurrentController();
+ if( xChartController.is() )
{
- ::css::uno::Reference< ::css::frame::XController > xChartController = xChart->getCurrentController();
- if( xChartController.is() )
- {
- mxController = xChartController;
- }
+ mxController = xChartController;
}
}
}
diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx
index f1f320feae89..1ff72c62e8a1 100644
--- a/slideshow/source/engine/animationnodes/animationbasenode.cxx
+++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx
@@ -305,10 +305,8 @@ void AnimationBaseNode::activate_st()
void AnimationBaseNode::deactivate_st( NodeState eDestState )
{
- if (eDestState == FROZEN) {
- if (mpActivity)
- mpActivity->end();
- }
+ if (eDestState == FROZEN && mpActivity)
+ mpActivity->end();
if (isDependentSubsettedShape()) {
// for dependent subsets, remove subset shape
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index b4f224450ce2..b01d7b69bbcd 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -848,15 +848,12 @@ static void print_fullpaths(char* line)
}
token = end;
eat_space(&token);
- if (!target_seen)
+ if (!target_seen && ':' == *token)
{
- if (':' == *token)
- {
- target_seen = 1;
- fputc(':', stdout);
- ++token;
- eat_space(&token);
- }
+ target_seen = 1;
+ fputc(':', stdout);
+ ++token;
+ eat_space(&token);
}
}
}
diff --git a/soltools/cpp/_cpp.c b/soltools/cpp/_cpp.c
index 56c309321157..0a7ce78d1749 100644
--- a/soltools/cpp/_cpp.c
+++ b/soltools/cpp/_cpp.c
@@ -108,11 +108,8 @@ void
puttokens(trp);
anymacros = 0;
cursource->line += cursource->lineinc;
- if (cursource->lineinc > 1)
- {
- if (!Pflag)
- genline();
- }
+ if (cursource->lineinc > 1 && !Pflag)
+ genline();
}
}
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 83c3f69f62fc..df077cf1d911 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -181,9 +181,8 @@ bool StgDirEntry::Store( StgDirStrm& rStrm )
if( m_pRight )
if( !static_cast<StgDirEntry*>(m_pRight)->Store( rStrm ) )
return false;
- if( m_pDown )
- if( !m_pDown->Store( rStrm ) )
- return false;
+ if( m_pDown && !m_pDown->Store( rStrm ) )
+ return false;
return true;
}
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 829dd82cb4c8..cff3520264ba 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -505,11 +505,8 @@ bool SotStorage::IsStorageFile( SvStream* pStream )
const OUString & SotStorage::GetName() const
{
- if( m_aName.isEmpty() )
- {
- if( m_pOwnStg )
- const_cast<SotStorage *>(this)->m_aName = m_pOwnStg->GetName();
- }
+ if( m_aName.isEmpty() && m_pOwnStg )
+ const_cast<SotStorage *>(this)->m_aName = m_pOwnStg->GetName();
return m_aName;
}
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index b6ddaae591b7..4b3647d42efe 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1694,8 +1694,8 @@ void SmViewShell::Execute(SfxRequest& rReq)
}
case SID_GETEDITTEXT:
- if (pWin)
- if (!pWin->GetText().isEmpty()) GetDoc()->SetText( pWin->GetText() );
+ if (pWin && !pWin->GetText().isEmpty())
+ GetDoc()->SetText( pWin->GetText() );
break;
case SID_ATTR_ZOOM:
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index 32f88f6c8596..1c4de783df95 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -362,11 +362,8 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement(
// TODO: test whether it really works for http and fwp
std::unique_ptr<SvStream> pStream = ::utl::UcbStreamHelper::CreateStream( aFileURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ),
StreamMode::STD_WRITE );
- if ( pStream )
- {
- if ( !pStream->GetError() )
- xResult.set( new ::utl::OStreamWrapper( std::move(pStream) ) );
- }
+ if ( pStream && !pStream->GetError() )
+ xResult.set( new ::utl::OStreamWrapper( std::move(pStream) ) );
}
if ( !xResult.is() )
@@ -1148,14 +1145,11 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl
// TODO: test whether it really works for http and fwp
std::unique_ptr<SvStream> pStream = ::utl::UcbStreamHelper::CreateStream( aFileURL,
StreamMode::STD_WRITE );
- if ( pStream )
+ if ( pStream && !pStream->GetError() )
{
- if ( !pStream->GetError() )
- {
- uno::Reference< io::XStream > xStream =
- uno::Reference < io::XStream >( new ::utl::OStreamWrapper( std::move(pStream) ) );
- xResult = static_cast< io::XStream* >( new OFSStreamContainer( xStream ) );
- }
+ uno::Reference< io::XStream > xStream =
+ uno::Reference < io::XStream >( new ::utl::OStreamWrapper( std::move(pStream) ) );
+ xResult = static_cast< io::XStream* >( new OFSStreamContainer( xStream ) );
}
}
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx
index a5c1a1ac25bf..10f4c0e6f63f 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -498,11 +498,8 @@ ColorConfigValue ColorConfig::GetColorValue(ColorConfigEntry eEntry, bool bSmart
if (m_pImpl)
aRet = m_pImpl->GetColorConfigValue(eEntry);
- if (bSmart)
- {
- if(aRet.nColor == COL_AUTO)
- aRet.nColor = ColorConfig::GetDefaultColor(eEntry);
- }
+ if (bSmart && aRet.nColor == COL_AUTO)
+ aRet.nColor = ColorConfig::GetDefaultColor(eEntry);
return aRet;
}
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 04d3622ed4ec..25bdbe3607d9 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -500,13 +500,10 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext)
{
mbHasVisibleItems = false;
- if (nStyle & WB_NONEFIELD)
+ if ((nStyle & WB_NONEFIELD) && mpNoneItem)
{
- if (mpNoneItem)
- {
- mpNoneItem->mbVisible = false;
- mpNoneItem->maText = GetText();
- }
+ mpNoneItem->mbVisible = false;
+ mpNoneItem->maText = GetText();
}
for (size_t i = 0; i < nItemCount; i++)
@@ -1084,14 +1081,11 @@ void ValueSet::ImplTracking( const Point& rPos, bool bRepeat )
{
if ( bRepeat || mbSelection )
{
- if ( ImplScroll( rPos ) )
+ if ( ImplScroll( rPos ) && mbSelection )
{
- if ( mbSelection )
- {
- maTimer.SetInvokeHandler( LINK( this, ValueSet, ImplTimerHdl ) );
- maTimer.SetTimeout( GetSettings().GetMouseSettings().GetScrollRepeat() );
- maTimer.Start();
- }
+ maTimer.SetInvokeHandler( LINK( this, ValueSet, ImplTimerHdl ) );
+ maTimer.SetTimeout( GetSettings().GetMouseSettings().GetScrollRepeat() );
+ maTimer.Start();
}
}
@@ -3113,13 +3107,10 @@ void SvtValueSet::Format(vcl::RenderContext const & rRenderContext)
{
mbHasVisibleItems = false;
- if (nStyle & WB_NONEFIELD)
+ if ((nStyle & WB_NONEFIELD) && mpNoneItem)
{
- if (mpNoneItem)
- {
- mpNoneItem->mbVisible = false;
- mpNoneItem->maText = GetText();
- }
+ mpNoneItem->mbVisible = false;
+ mpNoneItem->maText = GetText();
}
for (size_t i = 0; i < nItemCount; i++)
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
index 31af8385e797..b7baf49b85cb 100644
--- a/svtools/source/dialogs/prnsetup.cxx
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -332,11 +332,8 @@ short PrinterSetupDialog::run()
short nRet = GenericDialogController::run();
// update data if the dialog was terminated with OK
- if ( nRet == RET_OK )
- {
- if ( mpTempPrinter )
- mpPrinter->SetPrinterProps( mpTempPrinter );
- }
+ if ( nRet == RET_OK && mpTempPrinter )
+ mpPrinter->SetPrinterProps( mpTempPrinter );
maStatusTimer.Stop();
diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx
index e6d1bc4b056e..e2d585642b59 100644
--- a/svtools/source/uno/addrtempuno.cxx
+++ b/svtools/source/uno/addrtempuno.cxx
@@ -130,9 +130,8 @@ namespace {
{
OGenericUnoDialog::executedDialog(_nExecutionResult);
- if ( _nExecutionResult )
- if ( m_aDialog )
- static_cast< AddressBookSourceDialog* >( m_aDialog.m_xVclDialog.get() )->getFieldMapping( m_aAliases );
+ if ( _nExecutionResult && m_aDialog )
+ static_cast< AddressBookSourceDialog* >( m_aDialog.m_xVclDialog.get() )->getFieldMapping( m_aAliases );
}
void SAL_CALL OAddressBookSourceDialogUno::initialize(const Sequence< Any >& rArguments)
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index edb44f22db40..b4fe6dc14805 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -2559,11 +2559,8 @@ void FmXFormShell::UpdateForms_Lock(bool _bInvalidate)
Reference< XIndexAccess > xForms;
FmFormPage* pPage = m_pShell->GetCurPage();
- if ( pPage )
- {
- if ( m_pShell->m_bDesignMode )
- xForms.set(pPage->GetForms( false ), css::uno::UNO_QUERY);
- }
+ if ( pPage && m_pShell->m_bDesignMode )
+ xForms.set(pPage->GetForms( false ), css::uno::UNO_QUERY);
if ( m_xForms != xForms )
{
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 9b1b8152321f..33c478fc457f 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -385,14 +385,11 @@ void LinePropertyPanelBase::updateLineStart(bool bDisabled, bool bSetOrDefault,
mpLBStart->Enable();
}
- if(bSetOrDefault)
+ if(bSetOrDefault && pItem)
{
- if(pItem)
- {
- mpStartItem.reset(static_cast<XLineStartItem*>(pItem->Clone()));
- SelectEndStyle(true);
- return;
- }
+ mpStartItem.reset(static_cast<XLineStartItem*>(pItem->Clone()));
+ SelectEndStyle(true);
+ return;
}
mpStartItem.reset(nullptr);
@@ -412,14 +409,11 @@ void LinePropertyPanelBase::updateLineEnd(bool bDisabled, bool bSetOrDefault,
mpLBEnd->Enable();
}
- if(bSetOrDefault)
+ if(bSetOrDefault && pItem)
{
- if(pItem)
- {
- mpEndItem.reset(static_cast<XLineEndItem*>(pItem->Clone()));
- SelectEndStyle(false);
- return;
- }
+ mpEndItem.reset(static_cast<XLineEndItem*>(pItem->Clone()));
+ SelectEndStyle(false);
+ return;
}
mpEndItem.reset(nullptr);
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 6957043cf2f6..6d099d6efb77 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -1387,21 +1387,18 @@ bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/)
pObj->SendUserCall( SdrUserCallType::Resize, aBoundRect0 );
}
- if(bRet)
+ if(bRet && bUndo )
{
- if( bUndo )
- {
- getSdrDragView().AddUndoActions( std::move(vConnectorUndoActions) );
+ getSdrDragView().AddUndoActions( std::move(vConnectorUndoActions) );
- if ( pUndo )
- {
- getSdrDragView().AddUndo(std::move(pUndo));
- }
+ if ( pUndo )
+ {
+ getSdrDragView().AddUndo(std::move(pUndo));
+ }
- if ( pUndo2 )
- {
- getSdrDragView().AddUndo(std::move(pUndo2));
- }
+ if ( pUndo2 )
+ {
+ getSdrDragView().AddUndo(std::move(pUndo2));
}
}
@@ -3436,20 +3433,17 @@ void SdrDragDistort::MovAllPoints(basegfx::B2DPolyPolygon& rTarget)
{
SdrPageView* pPV = getSdrDragView().GetSdrPageView();
- if(pPV)
+ if(pPV && pPV->HasMarkedObjPageView())
{
- if (pPV->HasMarkedObjPageView())
- {
- basegfx::B2DPolyPolygon aDragPolygon(rTarget);
- const basegfx::B2DRange aOriginalRange(aMarkRect.Left(), aMarkRect.Top(), aMarkRect.Right(), aMarkRect.Bottom());
- const basegfx::B2DPoint aTopLeft(aDistortedRect[0].X(), aDistortedRect[0].Y());
- const basegfx::B2DPoint aTopRight(aDistortedRect[1].X(), aDistortedRect[1].Y());
- const basegfx::B2DPoint aBottomLeft(aDistortedRect[3].X(), aDistortedRect[3].Y());
- const basegfx::B2DPoint aBottomRight(aDistortedRect[2].X(), aDistortedRect[2].Y());
-
- aDragPolygon = basegfx::utils::distort(aDragPolygon, aOriginalRange, aTopLeft, aTopRight, aBottomLeft, aBottomRight);
- rTarget = aDragPolygon;
- }
+ basegfx::B2DPolyPolygon aDragPolygon(rTarget);
+ const basegfx::B2DRange aOriginalRange(aMarkRect.Left(), aMarkRect.Top(), aMarkRect.Right(), aMarkRect.Bottom());
+ const basegfx::B2DPoint aTopLeft(aDistortedRect[0].X(), aDistortedRect[0].Y());
+ const basegfx::B2DPoint aTopRight(aDistortedRect[1].X(), aDistortedRect[1].Y());
+ const basegfx::B2DPoint aBottomLeft(aDistortedRect[3].X(), aDistortedRect[3].Y());
+ const basegfx::B2DPoint aBottomRight(aDistortedRect[2].X(), aDistortedRect[2].Y());
+
+ aDragPolygon = basegfx::utils::distort(aDragPolygon, aOriginalRange, aTopLeft, aTopRight, aBottomLeft, aBottomRight);
+ rTarget = aDragPolygon;
}
}
}
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 8f457727ad3e..22b28c956173 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -534,12 +534,9 @@ void SdrModel::SetUndoComment(const OUString& rComment)
{
OSL_FAIL("svx::SdrModel::SetUndoComment(), method not supported with application undo manager!" );
}
- else if( IsUndoEnabled() )
+ else if( IsUndoEnabled() && nUndoLevel==1)
{
- if(nUndoLevel==1)
- {
- pCurrentUndoGroup->SetComment(rComment);
- }
+ pCurrentUndoGroup->SetComment(rComment);
}
}
diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx
index ec4a09e88506..cc9b8005fe2c 100644
--- a/svx/source/svdraw/svdpoev.cxx
+++ b/svx/source/svdraw/svdpoev.cxx
@@ -126,21 +126,18 @@ void SdrPolyEditView::CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmoot
}
}
- if(!bSegmFuz)
+ if(!bSegmFuz && bCanSegment)
{
- if(bCanSegment)
- {
- bool bCrv(aLocalPolygon.isNextControlPointUsed(nPntNum));
+ bool bCrv(aLocalPolygon.isNextControlPointUsed(nPntNum));
- if(b1stSegm)
- {
- b1stSegm = false;
- bCurve = bCrv;
- }
- else
- {
- bSegmFuz = (bCrv != bCurve);
- }
+ if(b1stSegm)
+ {
+ b1stSegm = false;
+ bCurve = bCrv;
+ }
+ else
+ {
+ bSegmFuz = (bCrv != bCurve);
}
}
}
diff --git a/svx/source/svdraw/svdviter.cxx b/svx/source/svdraw/svdviter.cxx
index 1d4c9b035661..dfc7f7d41531 100644
--- a/svx/source/svdraw/svdviter.cxx
+++ b/svx/source/svdraw/svdviter.cxx
@@ -136,12 +136,9 @@ SdrView* SdrViewIter::ImpFindView()
{
SdrPageView* pPV = mpCurrentView->GetSdrPageView();
- if(pPV)
+ if(pPV && ImpCheckPageView(pPV))
{
- if(ImpCheckPageView(pPV))
- {
- return mpCurrentView;
- }
+ return mpCurrentView;
}
}
else
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 3567d18856ae..0fb1e31b8d95 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -255,11 +255,8 @@ bool SdrExchangeView::Paste(
SdrPageView* pMarkPV=nullptr;
SdrPageView* pPV = GetSdrPageView();
- if(pPV)
- {
- if ( pPV->GetObjList() == pLst )
- pMarkPV=pPV;
- }
+ if(pPV && pPV->GetObjList() == pLst )
+ pMarkPV=pPV;
ImpLimitToWorkArea( aPos );
if (pLst==nullptr)
@@ -424,11 +421,8 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Po
SdrPageView* pMarkPV=nullptr;
SdrPageView* pPV = GetSdrPageView();
- if(pPV)
- {
- if (pPV->GetObjList()==&rLst)
- pMarkPV=pPV;
- }
+ if(pPV && pPV->GetObjList()==&rLst)
+ pMarkPV=pPV;
bool bMark = pMarkPV!=nullptr && !IsTextEdit() && (nOptions&SdrInsertFlags::DONTMARK)==SdrInsertFlags::NONE;
if (bMark)
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 69cd8432c044..187f52af7a69 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1062,13 +1062,10 @@ CellPos SdrTableObj::getPreviousRow( const CellPos& rPos, bool bEdgeTravel ) con
if( mpImpl.is() )
{
CellRef xCell( mpImpl->getCell( aPos ) );
- if( xCell.is() )
+ if( xCell.is() && xCell->isMerged() )
{
- if( xCell->isMerged() )
- {
- sal_Int32 nTemp = 0;
- findMergeOrigin( mpImpl->mxTable, aPos.mnCol, aPos.mnRow, nTemp, aPos.mnRow );
- }
+ sal_Int32 nTemp = 0;
+ findMergeOrigin( mpImpl->mxTable, aPos.mnCol, aPos.mnRow, nTemp, aPos.mnRow );
}
if( aPos.mnRow > 0 )
diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx
index 438aa466b89c..70b170010478 100644
--- a/svx/source/tbxctrls/extrusioncontrols.cxx
+++ b/svx/source/tbxctrls/extrusioncontrols.cxx
@@ -746,18 +746,15 @@ void ExtrusionLightingWindow::SelectHdl(void const * pControl)
if( pControl == this )
{
int nLevel = getSelectedEntryId();
- if( nLevel >= 0 )
+ if( nLevel >= 0 && nLevel != 3 )
{
- if( nLevel != 3 )
- {
- Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = OUString(g_sExtrusionLightingIntensity).copy(5);
- aArgs[0].Value <<= static_cast<sal_Int32>(nLevel);
+ Sequence< PropertyValue > aArgs( 1 );
+ aArgs[0].Name = OUString(g_sExtrusionLightingIntensity).copy(5);
+ aArgs[0].Value <<= static_cast<sal_Int32>(nLevel);
- mrController.dispatchCommand( g_sExtrusionLightingIntensity, aArgs );
+ mrController.dispatchCommand( g_sExtrusionLightingIntensity, aArgs );
- implSetIntensity( nLevel, true );
- }
+ implSetIntensity( nLevel, true );
}
}
else
More information about the Libreoffice-commits
mailing list