[Libreoffice-commits] core.git: tools/source unoidl/source unotools/source vcl/source writerfilter/source xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 8 06:39:32 UTC 2018


 tools/source/stream/stream.cxx                    |    7 -
 unoidl/source/unoidl-write.cxx                    |    6 -
 unotools/source/config/bootstrap.cxx              |    7 -
 vcl/source/control/imp_listbox.cxx                |   13 +--
 vcl/source/control/scrbar.cxx                     |    7 -
 vcl/source/fontsubset/sft.cxx                     |    5 -
 vcl/source/gdi/regionband.cxx                     |    7 -
 vcl/source/gdi/virdev.cxx                         |    7 -
 vcl/source/outdev/bitmap.cxx                      |   10 --
 vcl/source/outdev/clipping.cxx                    |    5 -
 vcl/source/outdev/curvedshapes.cxx                |   28 +-----
 vcl/source/outdev/line.cxx                        |   14 ---
 vcl/source/outdev/mask.cxx                        |    5 -
 vcl/source/outdev/nativecontrols.cxx              |   20 +---
 vcl/source/outdev/outdev.cxx                      |   94 ++++++----------------
 vcl/source/outdev/rect.cxx                        |   21 +---
 vcl/source/outdev/text.cxx                        |   14 ---
 vcl/source/window/dialog.cxx                      |    9 --
 vcl/source/window/splitwin.cxx                    |   13 +--
 vcl/source/window/status.cxx                      |   13 +--
 vcl/source/window/window.cxx                      |    7 -
 vcl/source/window/winproc.cxx                     |    7 -
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   13 +--
 writerfilter/source/dmapper/StyleSheetTable.cxx   |    7 -
 writerfilter/source/dmapper/TableManager.cxx      |    7 -
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx   |   13 +--
 writerfilter/source/rtftok/rtfsdrimport.cxx       |    7 -
 xmloff/source/core/xmlimp.cxx                     |   17 +--
 xmloff/source/draw/animationexport.cxx            |    9 --
 xmloff/source/draw/ximpshap.cxx                   |   17 +--
 xmloff/source/text/XMLIndexMarkExport.cxx         |   14 ---
 xmloff/source/text/XMLTextFrameContext.cxx        |    7 -
 32 files changed, 141 insertions(+), 289 deletions(-)

New commits:
commit 7f48fa8152bd3320af7276d811b752c5a762dcce
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Nov 1 13:14:09 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Nov 8 07:37:40 2018 +0100

    loplugin:collapseif in tools..xmloff
    
    Change-Id: Iea1227a9f13a0a618d9bb6b0bbedaa5ce8d1a4f5
    Reviewed-on: https://gerrit.libreoffice.org/62732
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index a0160348dff7..8fe25c28d055 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1674,11 +1674,8 @@ void SvMemoryStream::SetBuffer( void* pNewBuf, std::size_t nCount,
 {
     SetBufferSize( 0 ); // Init buffering in the base class
     Seek( 0 );
-    if( bOwnsData )
-    {
-        if( pNewBuf != pBuf )
-            FreeMemory();
-    }
+    if( bOwnsData && pNewBuf != pBuf )
+        FreeMemory();
 
     pBuf        = static_cast<sal_uInt8 *>(pNewBuf);
     nPos        = 0;
diff --git a/unoidl/source/unoidl-write.cxx b/unoidl/source/unoidl-write.cxx
index 827e9ad0a4db..1626dbe19ea5 100644
--- a/unoidl/source/unoidl-write.cxx
+++ b/unoidl/source/unoidl-write.cxx
@@ -731,10 +731,8 @@ sal_uInt64 writeMap(
                 bool dfltCtor = ent2->getConstructors().size() == 1
                     && ent2->getConstructors()[0].defaultConstructor;
                 bool ann = !ent2->getAnnotations().empty();
-                if (!dfltCtor) {
-                    if (!ann)
-                        ann = hasNotEmptyAnnotations(ent2->getConstructors());
-                }
+                if (!dfltCtor && !ann)
+                    ann = hasNotEmptyAnnotations(ent2->getConstructors());
                 i.second.dataOffset = getOffset(file);
                 writeKind(file, ent2.get(), ann, dfltCtor);
                 writeIdxName(file, ent2->getBase());
diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx
index a084375aedda..69f530ae240c 100644
--- a/unotools/source/config/bootstrap.cxx
+++ b/unotools/source/config/bootstrap.cxx
@@ -298,11 +298,8 @@ static PathStatus checkStatusAndNormalizeURL(OUString & _sURL)
 
         eStatus = implCheckStatusOfURL(_sURL,aDirItem);
 
-        if (eStatus == Bootstrap::PATH_EXISTS)
-        {
-            if (!implNormalizeURL(_sURL,aDirItem))
-                OSL_FAIL("Unexpected failure getting actual URL for existing object");
-        }
+        if (eStatus == Bootstrap::PATH_EXISTS && !implNormalizeURL(_sURL,aDirItem))
+            OSL_FAIL("Unexpected failure getting actual URL for existing object");
     }
     return eStatus;
 }
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index bd6c0b04214c..e7f770d5ff1f 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -1493,16 +1493,13 @@ bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
             {
                 SetTopEntry( 0 );
             }
-            else if ( !bCtrl && !bMod2 )
+            else if ( !bCtrl && !bMod2 &&  mnCurrentPos )
             {
-                if ( mnCurrentPos )
-                {
-                    nSelect = mpEntryList->FindFirstSelectable( mpEntryList->GetEntryCount() ? 0 : LISTBOX_ENTRY_NOTFOUND );
-                    if( mnTop != 0 )
-                        SetTopEntry( 0 );
+                nSelect = mpEntryList->FindFirstSelectable( mpEntryList->GetEntryCount() ? 0 : LISTBOX_ENTRY_NOTFOUND );
+                if( mnTop != 0 )
+                    SetTopEntry( 0 );
 
-                    bDone = true;
-                }
+                bDone = true;
             }
             maQuickSelectionEngine.Reset();
         }
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 61d22c90e3d9..e2b000cdd2ea 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -579,11 +579,8 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD
             if (IsMouseOver())
             {
                 tools::Rectangle* pRect = ImplFindPartRect(GetPointerPosPixel());
-                if (pRect)
-                {
-                    if (pRect == &maThumbRect)
-                        nState |= ControlState::ROLLOVER;
-                }
+                if (pRect && pRect == &maThumbRect)
+                    nState |= ControlState::ROLLOVER;
             }
 
             bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, (bHorz ? ControlPart::ThumbHorz : ControlPart::ThumbVert),
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index a945ee7cc7be..11d9bedae11c 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -551,9 +551,8 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
         if( ! glyphlist.empty() )
             glyphlist.pop_back();
 
-        if (flags & USE_MY_METRICS) {
-            if (metrics) GetMetrics(ttf, index, metrics);
-        }
+        if ((flags & USE_MY_METRICS) && metrics)
+            GetMetrics(ttf, index, metrics);
 
         if (flags & ARG_1_AND_2_ARE_WORDS) {
             e = GetInt16(ptr, 0);
diff --git a/vcl/source/gdi/regionband.cxx b/vcl/source/gdi/regionband.cxx
index 28ff3fc79945..549979862e01 100644
--- a/vcl/source/gdi/regionband.cxx
+++ b/vcl/source/gdi/regionband.cxx
@@ -650,11 +650,8 @@ bool RegionBand::OptimizeBandList()
         if ( pBand->mnYBottom < pBand->mnYTop )
             OSL_ENSURE(false, "RegionBand::OptimizeBandList(): YBottomBoundary < YTopBoundary" );
 
-        if ( pBand->mpNextBand )
-        {
-            if ( pBand->mnYBottom >= pBand->mpNextBand->mnYTop )
-                OSL_ENSURE(false, "RegionBand::OptimizeBandList(): overlapping bands in region!" );
-        }
+        if ( pBand->mpNextBand && pBand->mnYBottom >= pBand->mpNextBand->mnYTop )
+            OSL_ENSURE(false, "RegionBand::OptimizeBandList(): overlapping bands in region!" );
 
         pBand = pBand->mpNextBand;
     }
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index 93b876577269..9f56bc102902 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -298,11 +298,8 @@ bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bEra
         ImplSVData*         pSVData = ImplGetSVData();
 
         // we need a graphics
-        if ( !mpGraphics )
-        {
-            if ( !AcquireGraphics() )
-                return false;
-        }
+        if ( !mpGraphics && !AcquireGraphics() )
+            return false;
 
         pNewVirDev = pSVData->mpDefInst->CreateVirtualDevice(mpGraphics, nNewWidth, nNewHeight, meFormat);
         if ( pNewVirDev )
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 462b41cda50f..e6596df1f5b8 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -136,9 +136,8 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
     if ( !IsDeviceOutputNecessary() )
         return;
 
-    if ( !mpGraphics )
-        if ( !AcquireGraphics() )
-            return;
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -372,9 +371,8 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
         if ( !IsDeviceOutputNecessary() )
             return;
 
-        if ( !mpGraphics )
-            if ( !AcquireGraphics() )
-                return;
+        if ( !mpGraphics && !AcquireGraphics() )
+            return;
 
         if ( mbInitClipRegion )
             InitClipRegion();
diff --git a/vcl/source/outdev/clipping.cxx b/vcl/source/outdev/clipping.cxx
index 8f7fcbbc98f5..1c17d53aba14 100644
--- a/vcl/source/outdev/clipping.cxx
+++ b/vcl/source/outdev/clipping.cxx
@@ -78,9 +78,8 @@ bool OutputDevice::SelectClipRegion( const vcl::Region& rRegion, SalGraphics* pG
 
     if( !pGraphics )
     {
-        if( !mpGraphics )
-            if( !AcquireGraphics() )
-                return false;
+        if( !mpGraphics && !AcquireGraphics() )
+            return false;
         pGraphics = mpGraphics;
     }
 
diff --git a/vcl/source/outdev/curvedshapes.cxx b/vcl/source/outdev/curvedshapes.cxx
index 88dde9d5adb2..8b83ea37ef58 100644
--- a/vcl/source/outdev/curvedshapes.cxx
+++ b/vcl/source/outdev/curvedshapes.cxx
@@ -42,11 +42,8 @@ void OutputDevice::DrawEllipse( const tools::Rectangle& rRect )
         return;
 
     // we need a graphics
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return;
-    }
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -90,11 +87,8 @@ void OutputDevice::DrawArc( const tools::Rectangle& rRect,
         return;
 
     // we need a graphics
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return;
-    }
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -134,11 +128,8 @@ void OutputDevice::DrawPie( const tools::Rectangle& rRect,
         return;
 
     // we need a graphics
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return;
-    }
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -185,11 +176,8 @@ void OutputDevice::DrawChord( const tools::Rectangle& rRect,
         return;
 
     // we need a graphics
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return;
-    }
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx
index 54203424257b..ef7cb30ef6ba 100644
--- a/vcl/source/outdev/line.cxx
+++ b/vcl/source/outdev/line.cxx
@@ -53,11 +53,8 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt,
     if ( !IsDeviceOutputNecessary() || !mbLineColor || ( LineStyle::NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() )
         return;
 
-    if( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return;
-    }
+    if( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -101,11 +98,8 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt )
     if ( !IsDeviceOutputNecessary() || !mbLineColor || ImplIsRecordLayout() )
         return;
 
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return;
-    }
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx
index 8677e06174a0..e8d696dd412a 100644
--- a/vcl/source/outdev/mask.cxx
+++ b/vcl/source/outdev/mask.cxx
@@ -88,9 +88,8 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize,
     if ( !IsDeviceOutputNecessary() )
         return;
 
-    if ( !mpGraphics )
-        if ( !AcquireGraphics() )
-            return;
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx
index 740d54ecc86b..3634bfe3cb01 100644
--- a/vcl/source/outdev/nativecontrols.cxx
+++ b/vcl/source/outdev/nativecontrols.cxx
@@ -162,9 +162,8 @@ bool OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPar
     if( !EnableNativeWidget( *this ) )
         return false;
 
-    if ( !mpGraphics )
-        if ( !AcquireGraphics() )
-            return false;
+    if ( !mpGraphics && !AcquireGraphics() )
+        return false;
 
     return mpGraphics->IsNativeControlSupported(nType, nPart);
 }
@@ -178,9 +177,8 @@ bool OutputDevice::HitTestNativeScrollbar(
     if( !EnableNativeWidget( *this ) )
         return false;
 
-    if ( !mpGraphics )
-        if ( !AcquireGraphics() )
-            return false;
+    if ( !mpGraphics && !AcquireGraphics() )
+        return false;
 
     Point aWinOffs( mnOutOffX, mnOutOffY );
     tools::Rectangle screenRegion( rControlRegion );
@@ -282,9 +280,8 @@ bool OutputDevice::DrawNativeControl( ControlType nType,
         return false;
 
     // make sure the current clip region is initialized correctly
-    if ( !mpGraphics )
-        if ( !AcquireGraphics() )
-            return false;
+    if ( !mpGraphics && !AcquireGraphics() )
+        return false;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -325,9 +322,8 @@ bool OutputDevice::GetNativeControlRegion(  ControlType nType,
     if( !EnableNativeWidget( *this ) )
         return false;
 
-    if ( !mpGraphics )
-        if ( !AcquireGraphics() )
-            return false;
+    if ( !mpGraphics && !AcquireGraphics() )
+        return false;
 
     // Convert the coordinates from relative to Window-absolute, so we draw
     // in the correct place in platform code
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 275f0c1845e5..a8b4c1767058 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -191,13 +191,8 @@ SalGraphics* OutputDevice::GetGraphics()
 {
     DBG_TESTSOLARMUTEX();
 
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-        {
-            SAL_WARN("vcl.gdi", "No mpGraphics set");
-        }
-    }
+    if (!mpGraphics && !AcquireGraphics())
+        SAL_WARN("vcl.gdi", "No mpGraphics set");
 
     return mpGraphics;
 }
@@ -206,13 +201,8 @@ SalGraphics const *OutputDevice::GetGraphics() const
 {
     DBG_TESTSOLARMUTEX();
 
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-        {
-            SAL_WARN("vcl.gdi", "No mpGraphics set");
-        }
-    }
+    if (!mpGraphics && !AcquireGraphics())
+        SAL_WARN("vcl.gdi", "No mpGraphics set");
 
     return mpGraphics;
 }
@@ -232,11 +222,8 @@ void OutputDevice::SetSettings( const AllSettings& rSettings )
 
 SystemGraphicsData OutputDevice::GetSystemGfxData() const
 {
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return SystemGraphicsData();
-    }
+    if (!mpGraphics && !AcquireGraphics())
+        return SystemGraphicsData();
 
     return mpGraphics->GetGraphicsData();
 }
@@ -245,52 +232,37 @@ SystemGraphicsData OutputDevice::GetSystemGfxData() const
 
 bool OutputDevice::SupportsCairo() const
 {
-    if (!mpGraphics)
-    {
-        if (!AcquireGraphics())
-            return false;
-    }
+    if (!mpGraphics && !AcquireGraphics())
+        return false;
 
     return mpGraphics->SupportsCairo();
 }
 
 cairo::SurfaceSharedPtr OutputDevice::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const
 {
-    if (!mpGraphics)
-    {
-        if (!AcquireGraphics())
-            return cairo::SurfaceSharedPtr();
-    }
+    if (!mpGraphics && !AcquireGraphics())
+        return cairo::SurfaceSharedPtr();
     return mpGraphics->CreateSurface(rSurface);
 }
 
 cairo::SurfaceSharedPtr OutputDevice::CreateSurface(int x, int y, int width, int height) const
 {
-    if (!mpGraphics)
-    {
-        if (!AcquireGraphics())
-            return cairo::SurfaceSharedPtr();
-    }
+    if (!mpGraphics && !AcquireGraphics())
+        return cairo::SurfaceSharedPtr();
     return mpGraphics->CreateSurface(*this, x, y, width, height);
 }
 
 cairo::SurfaceSharedPtr OutputDevice::CreateBitmapSurface(const BitmapSystemData& rData, const Size& rSize) const
 {
-    if (!mpGraphics)
-    {
-        if (!AcquireGraphics())
-            return cairo::SurfaceSharedPtr();
-    }
+    if (!mpGraphics && !AcquireGraphics())
+        return cairo::SurfaceSharedPtr();
     return mpGraphics->CreateBitmapSurface(*this, rData, rSize);
 }
 
 css::uno::Any OutputDevice::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const
 {
-    if (!mpGraphics)
-    {
-        if (!AcquireGraphics())
-            return css::uno::Any();
-    }
+    if (!mpGraphics && !AcquireGraphics())
+        return css::uno::Any();
     return mpGraphics->GetNativeSurfaceHandle(rSurface, rSize);
 }
 
@@ -335,11 +307,8 @@ void OutputDevice::SetRefPoint( const Point& rRefPoint )
 sal_uInt16 OutputDevice::GetBitCount() const
 {
     // we need a graphics instance
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return 0;
-    }
+    if ( !mpGraphics && !AcquireGraphics() )
+        return 0;
 
     return mpGraphics->GetBitCount();
 }
@@ -370,9 +339,8 @@ std::vector< VCLXGraphics* > *OutputDevice::CreateUnoGraphicsList()
 
 bool OutputDevice::SupportsOperation( OutDevSupportType eType ) const
 {
-    if( !mpGraphics )
-        if( !AcquireGraphics() )
-            return false;
+    if( !mpGraphics && !AcquireGraphics() )
+        return false;
     const bool bHasSupport = mpGraphics->supportsOperation( eType );
     return bHasSupport;
 }
@@ -400,9 +368,8 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
     if ( !IsDeviceOutputNecessary() )
         return;
 
-    if ( !mpGraphics )
-        if ( !AcquireGraphics() )
-            return;
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -457,9 +424,8 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
     if ( !IsDeviceOutputNecessary() )
         return;
 
-    if ( !mpGraphics )
-        if ( !AcquireGraphics() )
-            return;
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -519,9 +485,8 @@ void OutputDevice::CopyArea( const Point& rDestPt,
     if ( !IsDeviceOutputNecessary() )
         return;
 
-    if ( !mpGraphics )
-        if ( !AcquireGraphics() )
-            return;
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -597,11 +562,8 @@ void OutputDevice::drawOutDevDirect( const OutputDevice* pSrcDev, SalTwoRect& rP
                 }
                 pSrcGraphics = pSrcDev->mpGraphics;
 
-                if ( !mpGraphics )
-                {
-                    if ( !AcquireGraphics() )
-                        return;
-                }
+                if ( !mpGraphics && !AcquireGraphics() )
+                    return;
                 SAL_WARN_IF( !mpGraphics || !pSrcDev->mpGraphics, "vcl.gdi",
                             "OutputDevice::DrawOutDev(): We need more than one Graphics" );
             }
diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx
index 049612c5501e..0770b68db5b6 100644
--- a/vcl/source/outdev/rect.cxx
+++ b/vcl/source/outdev/rect.cxx
@@ -88,11 +88,8 @@ void OutputDevice::DrawRect( const tools::Rectangle& rRect,
     nVertRound = ImplLogicHeightToDevicePixel( nVertRound );
 
     // we need a graphics
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return;
-    }
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -142,11 +139,8 @@ void OutputDevice::Invert( const tools::Rectangle& rRect, InvertFlags nFlags )
     aRect.Justify();
 
     // we need a graphics
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return;
-    }
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
@@ -178,11 +172,8 @@ void OutputDevice::Invert( const tools::Polygon& rPoly, InvertFlags nFlags )
     tools::Polygon aPoly( ImplLogicToDevicePixel( rPoly ) );
 
     // we need a graphics
-    if ( !mpGraphics )
-    {
-        if ( !AcquireGraphics() )
-            return;
-    }
+    if ( !mpGraphics && !AcquireGraphics() )
+        return;
 
     if ( mbInitClipRegion )
         InitClipRegion();
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 83327e40cbb6..853ba065f7c7 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1703,21 +1703,15 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta
             rTargetDevice.Push( PushFlags::CLIPREGION );
             rTargetDevice.IntersectClipRegion( rRect );
             _rLayout.DrawText( aPos, aStr, 0, aStr.getLength(), pVector, pDisplayText );
-            if ( bDrawMnemonics )
-            {
-                if ( nMnemonicPos != -1 )
-                    rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
-            }
+            if ( bDrawMnemonics && nMnemonicPos != -1 )
+                rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
             rTargetDevice.Pop();
         }
         else
         {
             _rLayout.DrawText( aPos, aStr, 0, aStr.getLength(), pVector, pDisplayText );
-            if ( bDrawMnemonics )
-            {
-                if ( nMnemonicPos != -1 )
-                    rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
-            }
+            if ( bDrawMnemonics && nMnemonicPos != -1 )
+                rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
         }
     }
 
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 00f471ef9604..e7acc9e530cf 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1118,13 +1118,10 @@ void Dialog::EndDialog( long nResult )
 
     Hide();
 
-    if (bModal)
+    if (bModal && GetParent())
     {
-        if ( GetParent() )
-        {
-            NotifyEvent aNEvt( MouseNotifyEvent::ENDEXECUTEDIALOG, this );
-            GetParent()->CompatNotify( aNEvt );
-        }
+        NotifyEvent aNEvt( MouseNotifyEvent::ENDEXECUTEDIALOG, this );
+        GetParent()->CompatNotify( aNEvt );
     }
 
     mpDialogImpl->mnResult = nResult;
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 18da9e6e432c..18085cade791 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -893,15 +893,12 @@ void SplitWindow::ImplDrawBack(vcl::RenderContext& rRenderContext, ImplSplitSet*
     for ( auto& rItem : rItems )
     {
         pSet = rItem.mpSet.get();
-        if (pSet)
+        if (pSet && pSet->mpWallpaper)
         {
-            if (pSet->mpWallpaper)
-            {
-                Point aPoint(rItem.mnLeft, rItem.mnTop);
-                Size aSize(rItem.mnWidth, rItem.mnHeight);
-                tools::Rectangle aRect(aPoint, aSize);
-                rRenderContext.DrawWallpaper(aRect, *pSet->mpWallpaper);
-            }
+            Point aPoint(rItem.mnLeft, rItem.mnTop);
+            Size aSize(rItem.mnWidth, rItem.mnHeight);
+            tools::Rectangle aRect(aPoint, aSize);
+            rRenderContext.DrawWallpaper(aRect, *pSet->mpWallpaper);
         }
     }
 
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 660cc4222db6..b0ce426a53c6 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -319,15 +319,12 @@ tools::Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const
 {
     tools::Rectangle       aRect;
     ImplStatusItem* pItem = ( nPos < mvItemList.size() ) ? mvItemList[ nPos ].get() : nullptr;
-    if ( pItem )
+    if ( pItem && pItem->mbVisible )
     {
-        if ( pItem->mbVisible )
-        {
-            aRect.SetLeft( pItem->mnX );
-            aRect.SetRight( aRect.Left() + pItem->mnWidth + pItem->mnExtraWidth );
-            aRect.SetTop( STATUSBAR_OFFSET_Y );
-            aRect.SetBottom( mnCalcHeight - STATUSBAR_OFFSET_Y );
-        }
+        aRect.SetLeft( pItem->mnX );
+        aRect.SetRight( aRect.Left() + pItem->mnWidth + pItem->mnExtraWidth );
+        aRect.SetTop( STATUSBAR_OFFSET_Y );
+        aRect.SetBottom( mnCalcHeight - STATUSBAR_OFFSET_Y );
     }
 
     return aRect;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 4f3810dc3d02..7609d1ea11b3 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3074,11 +3074,8 @@ const Wallpaper& Window::GetDisplayBackground() const
     // FIXME: fix issue 52349, need to fix this really in
     // all NWF enabled controls
     const ToolBox* pTB = dynamic_cast<const ToolBox*>(this);
-    if( pTB )
-    {
-        if( IsNativeWidgetEnabled() )
-            return pTB->ImplGetToolBoxPrivateData()->maDisplayBackground;
-    }
+    if( pTB && IsNativeWidgetEnabled() )
+        return pTB->ImplGetToolBoxPrivateData()->maDisplayBackground;
 
     if( !IsBackground() )
     {
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 29fe7d2c19c2..cf8608615517 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -535,11 +535,8 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
                 pWinFrameData->mpMouseMoveWin = nullptr;
                 pWinFrameData->mbInMouseMove = false;
 
-                if ( pChild )
-                {
-                    if ( pChild->IsDisposed() )
-                        pChild = nullptr;
-                }
+                if ( pChild && pChild->IsDisposed() )
+                    pChild = nullptr;
                 if ( pMouseMoveWin->IsDisposed() )
                     return true;
             }
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d9edde3eaf22..a8a3d80bdade 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5405,15 +5405,12 @@ void  DomainMapper_Impl::ImportGraphic(const writerfilter::Reference< Properties
      */
     if(IsSdtEndBefore())
     {
-        if(xPropertySet.is())
+        if(xPropertySet.is() && bHasGrabBag)
         {
-            if (bHasGrabBag)
-            {
-                uno::Sequence<beans::PropertyValue> aFrameGrabBag( comphelper::InitPropertySequence({
-                    { "SdtEndBefore", uno::Any(true) }
-                }));
-                xPropertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aFrameGrabBag));
-            }
+            uno::Sequence<beans::PropertyValue> aFrameGrabBag( comphelper::InitPropertySequence({
+                { "SdtEndBefore", uno::Any(true) }
+            }));
+            xPropertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aFrameGrabBag));
         }
     }
 
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 64c47bfac84b..7a803e321bc5 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1535,11 +1535,8 @@ OUString StyleSheetTable::getOrCreateCharStyle( PropertyValueVector_t& rCharProp
         if( pStyleNames[nStyle].startsWith( cListLabel, &sSuffix ) )
         {
             sal_Int32 nSuffix = sSuffix.toInt32();
-            if( nSuffix > 0 )
-            {
-                if( nSuffix > nStyleFound )
-                    nStyleFound = nSuffix;
-            }
+            if( nSuffix > 0 && nSuffix > nStyleFound )
+                nStyleFound = nSuffix;
         }
     }
     sListLabel = cListLabel + OUString::number( ++nStyleFound );
diff --git a/writerfilter/source/dmapper/TableManager.cxx b/writerfilter/source/dmapper/TableManager.cxx
index aa173cbffa2f..5ff7f26af824 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -125,11 +125,8 @@ void TableManager::utext(const sal_uInt8* data, std::size_t len)
 void TableManager::text(const sal_uInt8* data, std::size_t len)
 {
     // optimization: cell/row end characters are the last characters in a run
-    if (len > 0)
-    {
-        if (data[len - 1] == 0x7)
-            handle0x7();
-    }
+    if (len > 0 && data[len - 1] == 0x7)
+        handle0x7();
 }
 
 void TableManager::handle0x7()
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index eb4dcbcd41a7..8f0ad98c9702 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -783,15 +783,12 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pS
 
                 beans::PropertyValue embeddingsTemp;
                 // This will add all .xlsx and .bin to grabbag list.
-                if(bFound)
+                if(bFound && mxEmbeddings.is())
                 {
-                    if(mxEmbeddings.is())
-                    {
-                        embeddingsTemp.Name = embeddingsTarget;
-                        embeddingsTemp.Value <<= mxEmbeddings;
-                        aEmbeddings.push_back(embeddingsTemp);
-                        mxEmbeddings.clear();
-                    }
+                    embeddingsTemp.Name = embeddingsTarget;
+                    embeddingsTemp.Value <<= mxEmbeddings;
+                    aEmbeddings.push_back(embeddingsTemp);
+                    mxEmbeddings.clear();
                 }
                 bFound = false;
                 bHeaderFooterFound = false;
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 2c0c1a64d515..b38330ca26c8 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -891,11 +891,8 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
         }
 
         // Handle horizontal flip.
-        if (obFlipH == true)
-        {
-            if (xPropertySet.is())
-                xPropertySet->setPropertyValue("IsMirrored", uno::makeAny(true));
-        }
+        if (obFlipH == true && xPropertySet.is())
+            xPropertySet->setPropertyValue("IsMirrored", uno::makeAny(true));
         return;
     }
 
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index a2303e170b0f..d68a9debcfc2 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -1288,20 +1288,17 @@ const Reference< container::XNameContainer > & SvXMLImport::GetMarkerHelper()
 
 const Reference< container::XNameContainer > & SvXMLImport::GetDashHelper()
 {
-    if( !mxDashHelper.is() )
+    if( !mxDashHelper.is() && mxModel.is() )
     {
-        if( mxModel.is() )
+        Reference< lang::XMultiServiceFactory > xServiceFact( mxModel, UNO_QUERY);
+        if( xServiceFact.is() )
         {
-            Reference< lang::XMultiServiceFactory > xServiceFact( mxModel, UNO_QUERY);
-            if( xServiceFact.is() )
+            try
             {
-                try
-                {
-                    mxDashHelper.set( xServiceFact->createInstance( "com.sun.star.drawing.DashTable" ), UNO_QUERY);
-                }
-                catch( lang::ServiceNotRegisteredException& )
-                {}
+                mxDashHelper.set( xServiceFact->createInstance( "com.sun.star.drawing.DashTable" ), UNO_QUERY);
             }
+            catch( lang::ServiceNotRegisteredException& )
+            {}
         }
     }
 
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 72938424411a..de66a89dcd8d 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -881,13 +881,10 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod
         }
 
         aTemp = xNode->getEndSync();
-        if( aTemp.hasValue() )
+        if( aTemp.hasValue() && (aTemp >>= nTemp) )
         {
-            if( aTemp >>= nTemp )
-            {
-                SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_Endsync );
-                mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ENDSYNC, sTmp.makeStringAndClear() );
-            }
+            SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_Endsync );
+            mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ENDSYNC, sTmp.makeStringAndClear() );
         }
 
         sal_Int16 nContainerNodeType = EffectNodeType::DEFAULT;
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index a8f9a7a1dbff..8988e52dd9f1 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -3894,19 +3894,16 @@ void SdXMLTableShapeContext::StartElement( const css::uno::Reference< css::xml::
 
         uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
 
-        if(bIsPresShape)
+        if(bIsPresShape && xProps.is())
         {
-            if(xProps.is())
+            uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
+            if( xPropsInfo.is() )
             {
-                uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
-                if( xPropsInfo.is() )
-                {
-                    if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName("IsEmptyPresentationObject"))
-                        xProps->setPropertyValue("IsEmptyPresentationObject", css::uno::Any(false) );
+                if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName("IsEmptyPresentationObject"))
+                    xProps->setPropertyValue("IsEmptyPresentationObject", css::uno::Any(false) );
 
-                    if( mbIsUserTransformed && xPropsInfo->hasPropertyByName("IsPlaceholderDependent"))
-                        xProps->setPropertyValue("IsPlaceholderDependent", css::uno::Any(false) );
-                }
+                if( mbIsUserTransformed && xPropsInfo->hasPropertyByName("IsPlaceholderDependent"))
+                    xProps->setPropertyValue("IsPlaceholderDependent", css::uno::Any(false) );
             }
         }
 
diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx
index bfeb4a845d9f..a236b7e4dfcb 100644
--- a/xmloff/source/text/XMLIndexMarkExport.cxx
+++ b/xmloff/source/text/XMLIndexMarkExport.cxx
@@ -191,12 +191,9 @@ static void lcl_ExportPropertyString( SvXMLExport& rExport,
     rAny = rPropSet->getPropertyValue( sProperty );
 
     OUString sValue;
-    if( rAny >>= sValue )
+    if( (rAny >>= sValue) && !sValue.isEmpty() )
     {
-        if( !sValue.isEmpty() )
-        {
-            rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, sValue );
-        }
+        rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, sValue );
     }
 }
 
@@ -209,12 +206,9 @@ static void lcl_ExportPropertyBool( SvXMLExport& rExport,
     rAny = rPropSet->getPropertyValue( sProperty );
 
     bool bValue;
-    if( rAny >>= bValue )
+    if( (rAny >>= bValue) && bValue )
     {
-        if( bValue )
-        {
-            rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, XML_TRUE );
-        }
+        rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, XML_TRUE );
     }
 }
 
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index a23caf149fde..134f81f9daeb 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1332,11 +1332,8 @@ bool XMLTextFrameContext::CreateIfNotThere( css::uno::Reference < css::beans::XP
 {
     SvXMLImportContext *pContext = m_xImplContext.get();
     XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl*>( pContext );
-    if( pImpl )
-    {
-        if( pImpl->CreateIfNotThere() )
-            rPropSet = pImpl->GetPropSet();
-    }
+    if( pImpl && pImpl->CreateIfNotThere() )
+        rPropSet = pImpl->GetPropSet();
 
     return rPropSet.is();
 }


More information about the Libreoffice-commits mailing list