[Libreoffice-commits] core.git: basic/source canvas/source configmgr/source editeng/source eventattacher/source extensions/source filter/source hwpfilter/source i18npool/source idlc/source pyuno/zipcore sfx2/source shell/source svl/source svx/source tools/source UnoControls/source vcl/source vcl/win xmloff/source xmlsecurity/source

Caolán McNamara caolanm at redhat.com
Wed Mar 11 02:59:06 PDT 2015


 UnoControls/source/base/basecontainercontrol.cxx                      |   65 +-
 UnoControls/source/controls/progressmonitor.cxx                       |   29 -
 basic/source/classes/image.cxx                                        |   30 -
 canvas/source/directx/dx_impltools.cxx                                |    3 
 configmgr/source/winreg.cxx                                           |  115 ++--
 editeng/source/accessibility/AccessibleContextBase.cxx                |   24 
 editeng/source/uno/unoedprx.cxx                                       |    8 
 eventattacher/source/eventattacher.cxx                                |    6 
 extensions/source/plugin/win/winmgr.cxx                               |    5 
 filter/source/graphicfilter/icgm/bitmap.cxx                           |  255 ++++------
 filter/source/graphicfilter/icgm/class1.cxx                           |    9 
 filter/source/graphicfilter/ieps/ieps.cxx                             |  239 ++++-----
 filter/source/graphicfilter/ipsd/ipsd.cxx                             |    7 
 filter/source/graphicfilter/itga/itga.cxx                             |   83 +--
 filter/source/svg/svgexport.cxx                                       |   99 +--
 hwpfilter/source/drawing.h                                            |    5 
 hwpfilter/source/hinfo.cxx                                            |    3 
 hwpfilter/source/htags.cxx                                            |    2 
 i18npool/source/collator/gencoll_rule.cxx                             |    3 
 idlc/source/parser.y                                                  |    3 
 pyuno/zipcore/python.cxx                                              |    9 
 sfx2/source/doc/graphhelp.cxx                                         |   89 +--
 shell/source/win32/zipfile/zipfile.cxx                                |    2 
 svl/source/items/slstitm.cxx                                          |   13 
 svl/source/numbers/zforlist.cxx                                       |    2 
 svl/source/passwordcontainer/passwordcontainer.cxx                    |    5 
 svl/source/svdde/ddesvr.cxx                                           |    2 
 svx/source/engine3d/extrud3d.cxx                                      |    9 
 svx/source/engine3d/lathe3d.cxx                                       |   13 
 svx/source/svdraw/svdattr.cxx                                         |    5 
 svx/source/svdraw/svdhdl.cxx                                          |   68 --
 svx/source/svdraw/svdograf.cxx                                        |   14 
 svx/source/svdraw/svdotxtr.cxx                                        |   25 
 svx/source/unodraw/unopage.cxx                                        |    6 
 tools/source/stream/stream.cxx                                        |   33 -
 vcl/source/filter/ixpm/xpmread.cxx                                    |   13 
 vcl/win/source/gdi/salbmp.cxx                                         |  108 ++--
 xmloff/source/draw/animationexport.cxx                                |    8 
 xmloff/source/draw/sdxmlexp.cxx                                       |   40 -
 xmloff/source/draw/shapeimport.cxx                                    |    7 
 xmloff/source/draw/ximp3dscene.cxx                                    |    7 
 xmloff/source/draw/ximpstyl.cxx                                       |   30 -
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |    7 
 xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx     |    4 
 44 files changed, 659 insertions(+), 853 deletions(-)

New commits:
commit 556373c41fddbac6cbee1c89e7707631270a1852
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 11 09:06:08 2015 +0000

    V668 no sense in testing the result of new against null
    
    Change-Id: I4a33bd92fc8448638a4bfe1eab7e5041a4c5cc39

diff --git a/UnoControls/source/base/basecontainercontrol.cxx b/UnoControls/source/base/basecontainercontrol.cxx
index 829ae6b..7c8e5e0 100644
--- a/UnoControls/source/base/basecontainercontrol.cxx
+++ b/UnoControls/source/base/basecontainercontrol.cxx
@@ -225,49 +225,46 @@ void SAL_CALL BaseContainerControl::addControl ( const OUString& rName, const Re
     // take memory for new item
     IMPL_ControlInfo* pNewControl = new IMPL_ControlInfo;
 
-    if (pNewControl!=(IMPL_ControlInfo*)0)
-    {
-        // Ready for multithreading
-        MutexGuard aGuard (m_aMutex);
+    // Ready for multithreading
+    MutexGuard aGuard (m_aMutex);
 
-        // set control
-        pNewControl->sName      = rName;
-        pNewControl->xControl   = rControl;
+    // set control
+    pNewControl->sName      = rName;
+    pNewControl->xControl   = rControl;
 
-        // and insert in list
-        maControlInfoList.push_back( pNewControl );
+    // and insert in list
+    maControlInfoList.push_back( pNewControl );
 
-        // initialize new control
-        pNewControl->xControl->setContext       ( (OWeakObject*)this    );
-        pNewControl->xControl->addEventListener ( static_cast< XEventListener* >( static_cast< XWindowListener* >( this ) ) );
+    // initialize new control
+    pNewControl->xControl->setContext       ( (OWeakObject*)this    );
+    pNewControl->xControl->addEventListener ( static_cast< XEventListener* >( static_cast< XWindowListener* >( this ) ) );
 
-        // when container has a peer ...
-        if (getPeer().is())
-        {
-            // .. then create a peer on child
-            pNewControl->xControl->createPeer ( getPeer()->getToolkit(), getPeer() );
-            impl_activateTabControllers ();
-        }
+    // when container has a peer ...
+    if (getPeer().is())
+    {
+        // .. then create a peer on child
+        pNewControl->xControl->createPeer ( getPeer()->getToolkit(), getPeer() );
+        impl_activateTabControllers ();
+    }
 
-        // Send message to all listener
-        OInterfaceContainerHelper* pInterfaceContainer = m_aListeners.getContainer( cppu::UnoType<XContainerListener>::get());
+    // Send message to all listener
+    OInterfaceContainerHelper* pInterfaceContainer = m_aListeners.getContainer( cppu::UnoType<XContainerListener>::get());
 
-        if (pInterfaceContainer)
-        {
-            // Build event
-            ContainerEvent  aEvent;
+    if (pInterfaceContainer)
+    {
+        // Build event
+        ContainerEvent  aEvent;
 
-            aEvent.Source   = *this;
-            aEvent.Element <<= rControl;
+        aEvent.Source   = *this;
+        aEvent.Element <<= rControl;
 
-            // Get all listener
-            OInterfaceIteratorHelper    aIterator (*pInterfaceContainer);
+        // Get all listener
+        OInterfaceIteratorHelper    aIterator (*pInterfaceContainer);
 
-            // Send event
-            while ( aIterator.hasMoreElements() )
-            {
-                static_cast<XContainerListener*>(aIterator.next())->elementInserted (aEvent);
-            }
+        // Send event
+        while ( aIterator.hasMoreElements() )
+        {
+            static_cast<XContainerListener*>(aIterator.next())->elementInserted (aEvent);
         }
     }
 }
diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx
index a2f19c3..e752b00 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -217,24 +217,21 @@ void SAL_CALL ProgressMonitor::addText(
     // Else ... take memory for new item ...
     IMPL_TextlistItem*  pTextItem = new IMPL_TextlistItem;
 
-    if ( pTextItem != NULL )
-    {
-        // Set values ...
-        pTextItem->sTopic   = rTopic;
-        pTextItem->sText    = rText;
+    // Set values ...
+    pTextItem->sTopic   = rTopic;
+    pTextItem->sText    = rText;
 
-        // Ready for multithreading
-        MutexGuard aGuard ( m_aMutex );
+    // Ready for multithreading
+    MutexGuard aGuard ( m_aMutex );
 
-        // ... and insert it in right list.
-        if ( bbeforeProgress )
-        {
-            maTextlist_Top.push_back( pTextItem );
-        }
-        else
-        {
-            maTextlist_Bottom.push_back( pTextItem );
-        }
+    // ... and insert it in right list.
+    if ( bbeforeProgress )
+    {
+        maTextlist_Top.push_back( pTextItem );
+    }
+    else
+    {
+        maTextlist_Bottom.push_back( pTextItem );
     }
 
     // ... update window
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 338ed02..d99259b 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -383,16 +383,9 @@ void SbiImage::MakeStrings( short nSize )
     nStringSize = 1024;
     pStrings = new sal_Unicode[ nStringSize ];
     pStringOff = new sal_uInt32[ nSize ];
-    if( pStrings && pStringOff )
-    {
-        nStrings = nSize;
-        memset( pStringOff, 0, nSize * sizeof( sal_uInt32 ) );
-        memset( pStrings, 0, nStringSize * sizeof( sal_Unicode ) );
-    }
-    else
-    {
-        bError = true;
-    }
+    nStrings = nSize;
+    memset( pStringOff, 0, nSize * sizeof( sal_uInt32 ) );
+    memset( pStrings, 0, nStringSize * sizeof( sal_Unicode ) );
 }
 
 // Add a string to StringPool. The String buffer is dynamically
@@ -415,18 +408,11 @@ void SbiImage::AddString( const OUString& r )
         {
             sal_uInt32 nNewLen = needed + 1024;
             nNewLen &= 0xFFFFFC00;  // trim to 1K border
-            sal_Unicode* p = NULL;
-            if( (p = new sal_Unicode[ nNewLen ]) != NULL )
-            {
-                memcpy( p, pStrings, nStringSize * sizeof( sal_Unicode ) );
-                delete[] pStrings;
-                pStrings = p;
-                nStringSize = sal::static_int_cast< sal_uInt16 >(nNewLen);
-            }
-            else
-            {
-                bError = true;
-            }
+            sal_Unicode* p = new sal_Unicode[nNewLen];
+            memcpy( p, pStrings, nStringSize * sizeof( sal_Unicode ) );
+            delete[] pStrings;
+            pStrings = p;
+            nStringSize = sal::static_int_cast< sal_uInt16 >(nNewLen);
         }
         if( !bError )
         {
diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx
index 4b11228..3f38dc3 100644
--- a/canvas/source/directx/dx_impltools.cxx
+++ b/canvas/source/directx/dx_impltools.cxx
@@ -135,8 +135,7 @@ namespace dxcanvas
         Gdiplus::Graphics* createGraphicsFromHDC(HDC aHDC)
         {
             Gdiplus::Graphics* pRet = new Gdiplus::Graphics(aHDC);
-            if( pRet )
-                setupGraphics( *pRet );
+            setupGraphics( *pRet );
             return pRet;
         }
 
diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index 99886d6..7d4e9e9 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -108,82 +108,79 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, oslFileHandle aFileHan
             wchar_t* pValueName = new wchar_t[nLongestValueNameLen + 1];
             wchar_t* pValue = new wchar_t[nLongestValueLen + 1];
 
-            if(pValueName && pValue)
+            bool bFinal = false;
+            OUString aValue;
+
+            for(DWORD i = 0; i < nValues; ++i)
             {
-                bool bFinal = false;
-                OUString aValue;
+                DWORD nValueNameLen = nLongestValueNameLen + 1;
+                DWORD nValueLen = nLongestValueLen + 1;
 
-                for(DWORD i = 0; i < nValues; ++i)
-                {
-                    DWORD nValueNameLen = nLongestValueNameLen + 1;
-                    DWORD nValueLen = nLongestValueLen + 1;
+                RegEnumValueW(hCurKey, i, pValueName, &nValueNameLen, NULL, NULL, (LPBYTE)pValue, &nValueLen);
+                const wchar_t wsValue[] = L"Value";
+                const wchar_t wsFinal[] = L"Final";
 
-                    RegEnumValueW(hCurKey, i, pValueName, &nValueNameLen, NULL, NULL, (LPBYTE)pValue, &nValueLen);
-                    const wchar_t wsValue[] = L"Value";
-                    const wchar_t wsFinal[] = L"Final";
+                if(!wcscmp(pValueName, wsValue))
+                    aValue = OUString(pValue);
+                if(!wcscmp(pValueName, wsFinal) && *(DWORD*)pValue == 1)
+                    bFinal = true;
+            }
+            sal_Int32 aLastSeparator = aKeyName.lastIndexOf('\\');
+            OUString aPathAndNodes = aKeyName.copy(0, aLastSeparator);
+            OUString aProp = aKeyName.copy(aLastSeparator + 1);
+            bool bHasNode = false;
+            sal_Int32 nCloseNode = 0;
+
+            writeData(aFileHandle, "<item oor:path=\"");
+            for(sal_Int32 nIndex = 0;; ++nIndex)
+            {
+                OUString aNextPathPart = aPathAndNodes.getToken(nIndex, '\\');
 
-                    if(!wcscmp(pValueName, wsValue))
-                        aValue = OUString(pValue);
-                    if(!wcscmp(pValueName, wsFinal) && *(DWORD*)pValue == 1)
-                        bFinal = true;
-                }
-                sal_Int32 aLastSeparator = aKeyName.lastIndexOf('\\');
-                OUString aPathAndNodes = aKeyName.copy(0, aLastSeparator);
-                OUString aProp = aKeyName.copy(aLastSeparator + 1);
-                bool bHasNode = false;
-                sal_Int32 nCloseNode = 0;
-
-                writeData(aFileHandle, "<item oor:path=\"");
-                for(sal_Int32 nIndex = 0;; ++nIndex)
+                if(!aNextPathPart.isEmpty())
                 {
-                    OUString aNextPathPart = aPathAndNodes.getToken(nIndex, '\\');
-
-                    if(!aNextPathPart.isEmpty())
+                    if((aNextPathPart.lastIndexOf("/#") != -1) || bHasNode)
                     {
-                        if((aNextPathPart.lastIndexOf("/#") != -1) || bHasNode)
+                        bHasNode = true;
+                        nCloseNode++;
+                        writeData(aFileHandle, "\"><node oor:name=\"");
+                        sal_Int32 nCommandSeparator = aNextPathPart.lastIndexOf('#');
+                        if(nCommandSeparator != -1)
                         {
-                            bHasNode = true;
-                            nCloseNode++;
-                            writeData(aFileHandle, "\"><node oor:name=\"");
-                            sal_Int32 nCommandSeparator = aNextPathPart.lastIndexOf('#');
-                            if(nCommandSeparator != -1)
-                            {
-                                OUString aNodeOp = aNextPathPart.copy(nCommandSeparator + 1);
-                                writeAttributeValue(aFileHandle, aNextPathPart.copy(0, nCommandSeparator - 1));
-                                writeData(aFileHandle, "\" oor:op=\"");
-                                writeAttributeValue(aFileHandle, aNodeOp);
-                            }
-                            else
-                            {
-                                writeAttributeValue(aFileHandle, aNextPathPart);
-                            }
+                            OUString aNodeOp = aNextPathPart.copy(nCommandSeparator + 1);
+                            writeAttributeValue(aFileHandle, aNextPathPart.copy(0, nCommandSeparator - 1));
+                            writeData(aFileHandle, "\" oor:op=\"");
+                            writeAttributeValue(aFileHandle, aNodeOp);
                         }
                         else
                         {
-                            writeAttributeValue(aFileHandle, "/" + aNextPathPart);
+                            writeAttributeValue(aFileHandle, aNextPathPart);
                         }
                     }
                     else
                     {
-                        writeData(aFileHandle, "\">");
-                        break;
+                        writeAttributeValue(aFileHandle, "/" + aNextPathPart);
                     }
                 }
-
-                writeData(aFileHandle, "<prop oor:name=\"");
-                writeAttributeValue(aFileHandle, aProp);
-                writeData(aFileHandle, "\"");
-                if(bFinal)
-                    writeData(aFileHandle, " oor:finalized=\"true\"");
-                writeData(aFileHandle, "><value>");
-                writeValueContent(aFileHandle, aValue);
-                writeData(aFileHandle, "</value></prop>");
-                for(; nCloseNode > 0; nCloseNode--)
-                    writeData(aFileHandle, "</node>");
-                writeData(aFileHandle, "</item>\n");
-                delete[] pValueName;
-                delete[] pValue;
+                else
+                {
+                    writeData(aFileHandle, "\">");
+                    break;
+                }
             }
+
+            writeData(aFileHandle, "<prop oor:name=\"");
+            writeAttributeValue(aFileHandle, aProp);
+            writeData(aFileHandle, "\"");
+            if(bFinal)
+                writeData(aFileHandle, " oor:finalized=\"true\"");
+            writeData(aFileHandle, "><value>");
+            writeValueContent(aFileHandle, aValue);
+            writeData(aFileHandle, "</value></prop>");
+            for(; nCloseNode > 0; nCloseNode--)
+                writeData(aFileHandle, "</node>");
+            writeData(aFileHandle, "</item>\n");
+            delete[] pValueName;
+            delete[] pValue;
         }
         RegCloseKey(hCurKey);
     }
diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx b/editeng/source/accessibility/AccessibleContextBase.cxx
index 0fb932c..bd36489 100644
--- a/editeng/source/accessibility/AccessibleContextBase.cxx
+++ b/editeng/source/accessibility/AccessibleContextBase.cxx
@@ -69,31 +69,22 @@ AccessibleContextBase::AccessibleContextBase (
 
     // Set some states.  Don't use the SetState method because no events
     // shall be broadcastet (that is not yet initialized anyway).
-    if (pStateSet != NULL)
-    {
-        pStateSet->AddState (AccessibleStateType::ENABLED);
-        pStateSet->AddState (AccessibleStateType::SENSITIVE);
-        pStateSet->AddState (AccessibleStateType::SHOWING);
-        pStateSet->AddState (AccessibleStateType::VISIBLE);
-        pStateSet->AddState (AccessibleStateType::FOCUSABLE);
-        pStateSet->AddState (AccessibleStateType::SELECTABLE);
-    }
+    pStateSet->AddState (AccessibleStateType::ENABLED);
+    pStateSet->AddState (AccessibleStateType::SENSITIVE);
+    pStateSet->AddState (AccessibleStateType::SHOWING);
+    pStateSet->AddState (AccessibleStateType::VISIBLE);
+    pStateSet->AddState (AccessibleStateType::FOCUSABLE);
+    pStateSet->AddState (AccessibleStateType::SELECTABLE);
 
     // Create the relation set.
     ::utl::AccessibleRelationSetHelper* pRelationSet = new ::utl::AccessibleRelationSetHelper ();
     mxRelationSet = pRelationSet;
 }
 
-
-
-
 AccessibleContextBase::~AccessibleContextBase(void)
 {
 }
 
-
-
-
 bool AccessibleContextBase::SetState (sal_Int16 aState)
 {
     ::osl::ClearableMutexGuard aGuard (maMutex);
@@ -368,8 +359,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
         // We are already disposed!
         // Create a new state set that has only set the DEFUNC state.
         pStateSet = new ::utl::AccessibleStateSetHelper ();
-        if (pStateSet != NULL)
-            pStateSet->AddState (AccessibleStateType::DEFUNC);
+        pStateSet->AddState (AccessibleStateType::DEFUNC);
     }
     else
     {
diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx
index ad198b5..9de8512 100644
--- a/editeng/source/uno/unoedprx.cxx
+++ b/editeng/source/uno/unoedprx.cxx
@@ -320,12 +320,8 @@ SvxEditSource* SvxEditSourceAdapter::Clone() const
         if( pClonedAdaptee.get() )
         {
             SvxEditSourceAdapter* pClone = new SvxEditSourceAdapter();
-
-            if( pClone )
-            {
-                pClone->SetEditSource( std::move(pClonedAdaptee) );
-                return pClone;
-            }
+            pClone->SetEditSource( std::move(pClonedAdaptee) );
+            return pClone;
         }
     }
 
diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index 9d79da1..eebfcf0 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -296,13 +296,9 @@ EventAttacherImpl::~EventAttacherImpl()
 
 Reference< XInterface > SAL_CALL EventAttacherImpl_CreateInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( Exception )
 {
-    Reference< XInterface > xRet;
     XEventAttacher *pEventAttacher = (XEventAttacher*) new EventAttacherImpl( comphelper::getComponentContext(rSMgr) );
 
-    if (pEventAttacher)
-    {
-        xRet = Reference<XInterface>::query(pEventAttacher);
-    }
+    Reference< XInterface > xRet = Reference<XInterface>::query(pEventAttacher);
 
     return xRet;
 }
diff --git a/extensions/source/plugin/win/winmgr.cxx b/extensions/source/plugin/win/winmgr.cxx
index 881ec27..b84315e 100644
--- a/extensions/source/plugin/win/winmgr.cxx
+++ b/extensions/source/plugin/win/winmgr.cxx
@@ -332,7 +332,7 @@ Sequence< PluginDescription > XPluginManager_Impl::impl_getPluginDescriptions()
                 continue;
 
             char * pVersionData = new char[dwSize];
-            if (pVersionData && ::GetFileVersionInfo( arFileName, 0, dwSize, pVersionData ))
+            if (::GetFileVersionInfo( arFileName, 0, dwSize, pVersionData))
             {
                 // optional comment
                 OUString aComment;
@@ -433,8 +433,7 @@ Sequence< PluginDescription > XPluginManager_Impl::impl_getPluginDescriptions()
                     OSL_FAIL( "### cannot get MIME type or extensions!" );
 #endif
             }
-            if (pVersionData)
-                delete[] pVersionData;
+            delete[] pVersionData;
         }
 
         s_bInit = TRUE;
diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx
index b0b844f..a7fcbe5 100644
--- a/filter/source/graphicfilter/icgm/bitmap.cxx
+++ b/filter/source/graphicfilter/icgm/bitmap.cxx
@@ -44,160 +44,156 @@ void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc )
 
     if ( ImplGetDimensions( rDesc ) && rDesc.mpBuf )
     {
-        if ( ( rDesc.mpBitmap = new Bitmap( Size( rDesc.mnX, rDesc.mnY ), (sal_uInt16)rDesc.mnDstBitsPerPixel ) ) != NULL )
+        rDesc.mpBitmap = new Bitmap( Size( rDesc.mnX, rDesc.mnY ), (sal_uInt16)rDesc.mnDstBitsPerPixel );
+        if ( ( rDesc.mpAcc = rDesc.mpBitmap->AcquireWriteAccess() ) != NULL )
         {
-            if ( ( rDesc.mpAcc = rDesc.mpBitmap->AcquireWriteAccess() ) != NULL )
-            {
 
-                // the picture may either be read from left to right or right to left, from top to bottom ...
+            // the picture may either be read from left to right or right to left, from top to bottom ...
 
-                long nxCount = rDesc.mnX + 1;   // +1 because we are using prefix decreasing
-                long nyCount = rDesc.mnY + 1;
-                long    nx, ny, nxC;
+            long nxCount = rDesc.mnX + 1;   // +1 because we are using prefix decreasing
+            long nyCount = rDesc.mnY + 1;
+            long    nx, ny, nxC;
 
-                switch ( rDesc.mnDstBitsPerPixel )
+            switch ( rDesc.mnDstBitsPerPixel )
+            {
+                case 1 :
                 {
-                    case 1 :
+                    if ( rDesc.mnLocalColorPrecision == 1 )
+                        ImplSetCurrentPalette( rDesc );
+                    else
                     {
-                        if ( rDesc.mnLocalColorPrecision == 1 )
-                            ImplSetCurrentPalette( rDesc );
-                        else
-                        {
-                            rDesc.mpAcc->SetPaletteEntryCount( 2 );
-                            rDesc.mpAcc->SetPaletteColor( 0, BMCOL( mpCGM->pElement->nBackGroundColor ) );
-                            rDesc.mpAcc->SetPaletteColor( 1,
-                                ( mpCGM->pElement->nAspectSourceFlags & ASF_FILLINTERIORSTYLE )
-                                    ? BMCOL( mpCGM->pElement->pFillBundle->GetColor() )
-                                        : BMCOL( mpCGM->pElement->aFillBundle.GetColor() ) ) ;
-                        }
-                        for ( ny = 0; --nyCount ; ny++, rDesc.mpBuf += rDesc.mnScanSize )
-                        {
-                            nxC = nxCount;
-                            for ( nx = 0; --nxC; nx++ )
-                            {   // this is not fast, but a one bit/pixel format is rarely used
-                                rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>( (*( rDesc.mpBuf + (nx >> 3)) >> ((nx & 7)^7))) & 1 );
-                            }
+                        rDesc.mpAcc->SetPaletteEntryCount( 2 );
+                        rDesc.mpAcc->SetPaletteColor( 0, BMCOL( mpCGM->pElement->nBackGroundColor ) );
+                        rDesc.mpAcc->SetPaletteColor( 1,
+                            ( mpCGM->pElement->nAspectSourceFlags & ASF_FILLINTERIORSTYLE )
+                                ? BMCOL( mpCGM->pElement->pFillBundle->GetColor() )
+                                    : BMCOL( mpCGM->pElement->aFillBundle.GetColor() ) ) ;
+                    }
+                    for ( ny = 0; --nyCount ; ny++, rDesc.mpBuf += rDesc.mnScanSize )
+                    {
+                        nxC = nxCount;
+                        for ( nx = 0; --nxC; nx++ )
+                        {   // this is not fast, but a one bit/pixel format is rarely used
+                            rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>( (*( rDesc.mpBuf + (nx >> 3)) >> ((nx & 7)^7))) & 1 );
                         }
                     }
-                    break;
+                }
+                break;
 
-                    case 2 :
+                case 2 :
+                {
+                    ImplSetCurrentPalette( rDesc );
+                    for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
                     {
-                        ImplSetCurrentPalette( rDesc );
-                        for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
-                        {
-                            nxC = nxCount;
-                            for ( nx = 0; --nxC; nx++ )
-                            {   // this is not fast, but a two bits/pixel format is rarely used
-                                rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>( (*(rDesc.mpBuf + (nx >> 2)) >> (((nx & 3)^3) << 1))) & 3 );
-                            }
+                        nxC = nxCount;
+                        for ( nx = 0; --nxC; nx++ )
+                        {   // this is not fast, but a two bits/pixel format is rarely used
+                            rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>( (*(rDesc.mpBuf + (nx >> 2)) >> (((nx & 3)^3) << 1))) & 3 );
                         }
                     }
-                    break;
+                }
+                break;
 
-                    case 4 :
+                case 4 :
+                {
+                    ImplSetCurrentPalette( rDesc );
+                    for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
                     {
-                        ImplSetCurrentPalette( rDesc );
-                        for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
+                        nxC = nxCount;
+                        sal_Int8  nDat;
+                        sal_uInt8* pTemp = rDesc.mpBuf;
+                        for ( nx = 0; --nxC; nx++ )
                         {
-                            nxC = nxCount;
-                            sal_Int8  nDat;
-                            sal_uInt8* pTemp = rDesc.mpBuf;
-                            for ( nx = 0; --nxC; nx++ )
+                            nDat = *pTemp++;
+                            rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>(nDat >> 4) );
+                            if ( --nxC )
                             {
-                                nDat = *pTemp++;
-                                rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>(nDat >> 4) );
-                                if ( --nxC )
-                                {
-                                    nx ++;
-                                    rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>(nDat & 15) );
-                                }
-                                else
-                                    break;
+                                nx ++;
+                                rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>(nDat & 15) );
                             }
+                            else
+                                break;
                         }
                     }
-                    break;
+                }
+                break;
 
-                    case 8 :
+                case 8 :
+                {
+                    ImplSetCurrentPalette( rDesc );
+                    for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
                     {
-                        ImplSetCurrentPalette( rDesc );
-                        for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
+                        sal_uInt8* pTemp = rDesc.mpBuf;
+                        nxC = nxCount;
+                        for ( nx = 0; --nxC; nx++ )
                         {
-                            sal_uInt8* pTemp = rDesc.mpBuf;
-                            nxC = nxCount;
-                            for ( nx = 0; --nxC; nx++ )
-                            {
-                                rDesc.mpAcc->SetPixelIndex( ny, nx, *(pTemp++) );
-                            }
+                            rDesc.mpAcc->SetPixelIndex( ny, nx, *(pTemp++) );
                         }
                     }
-                    break;
+                }
+                break;
 
-                    case 24 :
+                case 24 :
+                {
                     {
+                        BitmapColor aBitmapColor;
+                        for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
                         {
-                            BitmapColor aBitmapColor;
-                            for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
+                            sal_uInt8* pTemp = rDesc.mpBuf;
+                            nxC = nxCount;
+                            for ( nx = 0; --nxC; nx++ )
                             {
-                                sal_uInt8* pTemp = rDesc.mpBuf;
-                                nxC = nxCount;
-                                for ( nx = 0; --nxC; nx++ )
-                                {
-                                    aBitmapColor.SetRed( *pTemp++ );
-                                    aBitmapColor.SetGreen( *pTemp++ );
-                                    aBitmapColor.SetBlue( *pTemp++ );
-                                    rDesc.mpAcc->SetPixel( ny, nx, aBitmapColor );
-                                }
+                                aBitmapColor.SetRed( *pTemp++ );
+                                aBitmapColor.SetGreen( *pTemp++ );
+                                aBitmapColor.SetBlue( *pTemp++ );
+                                rDesc.mpAcc->SetPixel( ny, nx, aBitmapColor );
                             }
                         }
                     }
-                    break;
                 }
-                double nX = rDesc.mnR.X - rDesc.mnQ.X;
-                double nY = rDesc.mnR.Y - rDesc.mnQ.Y;
+                break;
+            }
+            double nX = rDesc.mnR.X - rDesc.mnQ.X;
+            double nY = rDesc.mnR.Y - rDesc.mnQ.Y;
 
-                rDesc.mndy = sqrt( nX * nX + nY * nY );
+            rDesc.mndy = sqrt( nX * nX + nY * nY );
 
-                nX = rDesc.mnR.X - rDesc.mnP.X;
-                nY = rDesc.mnR.Y - rDesc.mnP.Y;
+            nX = rDesc.mnR.X - rDesc.mnP.X;
+            nY = rDesc.mnR.Y - rDesc.mnP.Y;
 
-                rDesc.mndx = sqrt( nX * nX + nY * nY );
+            rDesc.mndx = sqrt( nX * nX + nY * nY );
 
-                nX = rDesc.mnR.X - rDesc.mnP.X;
-                nY = rDesc.mnR.Y - rDesc.mnP.Y;
+            nX = rDesc.mnR.X - rDesc.mnP.X;
+            nY = rDesc.mnR.Y - rDesc.mnP.Y;
 
-                rDesc.mnOrientation = acos( nX / sqrt( nX * nX + nY * nY ) ) * 57.29577951308;
-                if ( nY > 0 )
-                    rDesc.mnOrientation = 360 - rDesc.mnOrientation;
+            rDesc.mnOrientation = acos( nX / sqrt( nX * nX + nY * nY ) ) * 57.29577951308;
+            if ( nY > 0 )
+                rDesc.mnOrientation = 360 - rDesc.mnOrientation;
 
-                nX = rDesc.mnQ.X - rDesc.mnR.X;
-                nY = rDesc.mnQ.Y - rDesc.mnR.Y;
+            nX = rDesc.mnQ.X - rDesc.mnR.X;
+            nY = rDesc.mnQ.Y - rDesc.mnR.Y;
 
-                double fAngle = 0.01745329251994 * ( 360 - rDesc.mnOrientation );
-                double fSin = sin(fAngle);
-                double fCos = cos(fAngle);
-                nX = fCos * nX + fSin * nY;
-                nY = -( fSin * nX - fCos * nY );
+            double fAngle = 0.01745329251994 * ( 360 - rDesc.mnOrientation );
+            double fSin = sin(fAngle);
+            double fCos = cos(fAngle);
+            nX = fCos * nX + fSin * nY;
+            nY = -( fSin * nX - fCos * nY );
 
-                fAngle = acos( nX / sqrt( nX * nX + nY * nY ) ) * 57.29577951308;
-                if ( nY > 0 )
-                    fAngle = 360 - fAngle;
+            fAngle = acos( nX / sqrt( nX * nX + nY * nY ) ) * 57.29577951308;
+            if ( nY > 0 )
+                fAngle = 360 - fAngle;
 
-                if ( fAngle > 180 )                 // is the picture build upwards or downwards ?
-                {
-                    rDesc.mnOrigin = rDesc.mnP;
-                }
-                else
-                {
-                    rDesc.mbVMirror = true;
-                    rDesc.mnOrigin = rDesc.mnP;
-                    rDesc.mnOrigin.X += rDesc.mnQ.X - rDesc.mnR.X;
-                    rDesc.mnOrigin.Y += rDesc.mnQ.Y - rDesc.mnR.Y;
-                }
+            if ( fAngle > 180 )                 // is the picture build upwards or downwards ?
+            {
+                rDesc.mnOrigin = rDesc.mnP;
             }
             else
-                rDesc.mbStatus = false;
+            {
+                rDesc.mbVMirror = true;
+                rDesc.mnOrigin = rDesc.mnP;
+                rDesc.mnOrigin.X += rDesc.mnQ.X - rDesc.mnR.X;
+                rDesc.mnOrigin.Y += rDesc.mnQ.Y - rDesc.mnR.Y;
+            }
         }
         else
             rDesc.mbStatus = false;
@@ -358,40 +354,29 @@ void CGMBitmap::ImplInsert( CGMBitmapDescriptor& rSource, CGMBitmapDescriptor& r
     rDest.mndy += rSource.mndy;
 };
 
-
-
 CGMBitmap* CGMBitmap::GetNext()
 {
     if ( pCGMBitmapDescriptor->mpBitmap && pCGMBitmapDescriptor->mbStatus )
     {
         CGMBitmap* pCGMTempBitmap = new CGMBitmap( *mpCGM );
-        if ( pCGMTempBitmap )
+        if ( ( (long)pCGMTempBitmap->pCGMBitmapDescriptor->mnOrientation == (long)pCGMBitmapDescriptor->mnOrientation ) &&
+            ( ( ( pCGMTempBitmap->pCGMBitmapDescriptor->mnR.X == pCGMBitmapDescriptor->mnQ.X ) &&
+                    ( pCGMTempBitmap->pCGMBitmapDescriptor->mnR.Y == pCGMBitmapDescriptor->mnQ.Y ) ) ||
+            ( ( pCGMTempBitmap->pCGMBitmapDescriptor->mnQ.X == pCGMBitmapDescriptor->mnR.X ) &&
+                    ( pCGMTempBitmap->pCGMBitmapDescriptor->mnQ.Y == pCGMBitmapDescriptor->mnR.Y ) ) ) )
         {
-            if ( ( (long)pCGMTempBitmap->pCGMBitmapDescriptor->mnOrientation == (long)pCGMBitmapDescriptor->mnOrientation ) &&
-                ( ( ( pCGMTempBitmap->pCGMBitmapDescriptor->mnR.X == pCGMBitmapDescriptor->mnQ.X ) &&
-                        ( pCGMTempBitmap->pCGMBitmapDescriptor->mnR.Y == pCGMBitmapDescriptor->mnQ.Y ) ) ||
-                ( ( pCGMTempBitmap->pCGMBitmapDescriptor->mnQ.X == pCGMBitmapDescriptor->mnR.X ) &&
-                        ( pCGMTempBitmap->pCGMBitmapDescriptor->mnQ.Y == pCGMBitmapDescriptor->mnR.Y ) ) ) )
-            {
-                ImplInsert( *(pCGMTempBitmap->pCGMBitmapDescriptor), *(pCGMBitmapDescriptor) );
-                delete pCGMTempBitmap;
-                return NULL;
-            }
-            else    // we'll replace the pointers and return the old one
-            {
-                CGMBitmapDescriptor* pTempBD = pCGMBitmapDescriptor;
-                pCGMBitmapDescriptor = pCGMTempBitmap->pCGMBitmapDescriptor;
-                pCGMTempBitmap->pCGMBitmapDescriptor = pTempBD;
-                return pCGMTempBitmap;
-            }
+            ImplInsert( *(pCGMTempBitmap->pCGMBitmapDescriptor), *(pCGMBitmapDescriptor) );
+            delete pCGMTempBitmap;
+            return NULL;
         }
-        return NULL;
+
+        CGMBitmapDescriptor* pTempBD = pCGMBitmapDescriptor;
+        pCGMBitmapDescriptor = pCGMTempBitmap->pCGMBitmapDescriptor;
+        pCGMTempBitmap->pCGMBitmapDescriptor = pTempBD;
+        return pCGMTempBitmap;
     }
     else
         return NULL;
 }
 
-
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/icgm/class1.cxx b/filter/source/graphicfilter/icgm/class1.cxx
index 1eae8c5..b43238f 100644
--- a/filter/source/graphicfilter/icgm/class1.cxx
+++ b/filter/source/graphicfilter/icgm/class1.cxx
@@ -166,12 +166,9 @@ void CGM::ImplDoClass1()
             if ( mnElementSize > 1 )
             {
                 sal_uInt8* pBuf = new sal_uInt8[ mnElementSize ];
-                if ( pBuf )
-                {
-                    memcpy( pBuf, mpSource, mnElementSize );
-                    maDefRepList.push_back( pBuf );
-                    maDefRepSizeList.push_back( mnElementSize );
-                }
+                memcpy( pBuf, mpSource, mnElementSize );
+                maDefRepList.push_back( pBuf );
+                maDefRepSizeList.push_back( mnElementSize );
             }
             mnParaSize = mnElementSize;
         }
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index 2e5f9a1..3ca015e 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -596,161 +596,160 @@ GraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
 
         rStream.Seek( nPSStreamPos );
         sal_uInt8* pBuf = new sal_uInt8[ nPSSize ];
-        if ( pBuf )
+
+        sal_uInt32  nBufStartPos = rStream.Tell();
+        sal_uInt32  nBytesRead = rStream.Read( pBuf, nPSSize );
+        if ( nBytesRead == nPSSize )
         {
-            sal_uInt32  nBufStartPos = rStream.Tell();
-            sal_uInt32  nBytesRead = rStream.Read( pBuf, nPSSize );
-            if ( nBytesRead == nPSSize )
+            int nSecurityCount = 32;
+            if ( !bHasPreview )     // if there is no tiff/wmf preview, we will parse for an preview in the eps prolog
             {
-                int nSecurityCount = 32;
-                if ( !bHasPreview )     // if there is no tiff/wmf preview, we will parse for an preview in the eps prolog
+                sal_uInt8* pDest = ImplSearchEntry( pBuf, reinterpret_cast<sal_uInt8 const *>("%%BeginPreview:"), nBytesRead - 32, 15 );
+                if ( pDest  )
                 {
-                    sal_uInt8* pDest = ImplSearchEntry( pBuf, reinterpret_cast<sal_uInt8 const *>("%%BeginPreview:"), nBytesRead - 32, 15 );
-                    if ( pDest  )
+                    pDest += 15;
+                    long nWidth = ImplGetNumber( &pDest, nSecurityCount );
+                    long nHeight = ImplGetNumber( &pDest, nSecurityCount );
+                    long nBitDepth = ImplGetNumber( &pDest, nSecurityCount );
+                    long nScanLines = ImplGetNumber( &pDest, nSecurityCount );
+                    pDest = ImplSearchEntry( pDest, reinterpret_cast<sal_uInt8 const *>("%"), 16, 1 );       // go to the first Scanline
+                    if ( nSecurityCount && pDest && nWidth && nHeight && ( ( nBitDepth == 1 ) || ( nBitDepth == 8 ) ) && nScanLines )
                     {
-                        pDest += 15;
-                        long nWidth = ImplGetNumber( &pDest, nSecurityCount );
-                        long nHeight = ImplGetNumber( &pDest, nSecurityCount );
-                        long nBitDepth = ImplGetNumber( &pDest, nSecurityCount );
-                        long nScanLines = ImplGetNumber( &pDest, nSecurityCount );
-                        pDest = ImplSearchEntry( pDest, reinterpret_cast<sal_uInt8 const *>("%"), 16, 1 );       // go to the first Scanline
-                        if ( nSecurityCount && pDest && nWidth && nHeight && ( ( nBitDepth == 1 ) || ( nBitDepth == 8 ) ) && nScanLines )
-                        {
-                            rStream.Seek( nBufStartPos + ( pDest - pBuf ) );
+                        rStream.Seek( nBufStartPos + ( pDest - pBuf ) );
 
-                            Bitmap aBitmap( Size( nWidth, nHeight ), 1 );
-                            BitmapWriteAccess* pAcc = aBitmap.AcquireWriteAccess();
-                            if ( pAcc )
+                        Bitmap aBitmap( Size( nWidth, nHeight ), 1 );
+                        BitmapWriteAccess* pAcc = aBitmap.AcquireWriteAccess();
+                        if ( pAcc )
+                        {
+                            bool bIsValid = true;
+                            sal_uInt8 nDat = 0;
+                            char nByte;
+                            for ( long y = 0; bIsValid && ( y < nHeight ); y++ )
                             {
-                                bool bIsValid = true;
-                                sal_uInt8 nDat = 0;
-                                char nByte;
-                                for ( long y = 0; bIsValid && ( y < nHeight ); y++ )
+                                int nBitsLeft = 0;
+                                for ( long x = 0; x < nWidth; x++ )
                                 {
-                                    int nBitsLeft = 0;
-                                    for ( long x = 0; x < nWidth; x++ )
+                                    if ( --nBitsLeft < 0 )
                                     {
-                                        if ( --nBitsLeft < 0 )
+                                        while ( bIsValid && ( nBitsLeft != 7 ) )
                                         {
-                                            while ( bIsValid && ( nBitsLeft != 7 ) )
+                                            rStream.ReadChar( nByte );
+                                            switch ( nByte )
                                             {
-                                                rStream.ReadChar( nByte );
-                                                switch ( nByte )
+                                                case 0x0a :
+                                                    if ( --nScanLines < 0 )
+                                                        bIsValid = false;
+                                                case 0x09 :
+                                                case 0x0d :
+                                                case 0x20 :
+                                                case 0x25 :
+                                                break;
+                                                default:
                                                 {
-                                                    case 0x0a :
-                                                        if ( --nScanLines < 0 )
-                                                            bIsValid = false;
-                                                    case 0x09 :
-                                                    case 0x0d :
-                                                    case 0x20 :
-                                                    case 0x25 :
-                                                    break;
-                                                    default:
+                                                    if ( nByte >= '0' )
                                                     {
-                                                        if ( nByte >= '0' )
+                                                        if ( nByte > '9' )
                                                         {
-                                                            if ( nByte > '9' )
-                                                            {
-                                                                nByte &=~0x20;  // case none sensitive for hexadecimal values
-                                                                nByte -= ( 'A' - 10 );
-                                                                if ( nByte > 15 )
-                                                                    bIsValid = false;
-                                                            }
-                                                            else
-                                                                nByte -= '0';
-                                                            nBitsLeft += 4;
-                                                            nDat <<= 4;
-                                                            nDat |= ( nByte ^ 0xf ); // in epsi a zero bit represents white color
+                                                            nByte &=~0x20;  // case none sensitive for hexadecimal values
+                                                            nByte -= ( 'A' - 10 );
+                                                            if ( nByte > 15 )
+                                                                bIsValid = false;
                                                         }
                                                         else
-                                                            bIsValid = false;
+                                                            nByte -= '0';
+                                                        nBitsLeft += 4;
+                                                        nDat <<= 4;
+                                                        nDat |= ( nByte ^ 0xf ); // in epsi a zero bit represents white color
                                                     }
-                                                    break;
+                                                    else
+                                                        bIsValid = false;
                                                 }
+                                                break;
                                             }
                                         }
-                                        if ( nBitDepth == 1 )
-                                            pAcc->SetPixelIndex( y, x, static_cast<sal_uInt8>(nDat >> nBitsLeft) & 1 );
-                                        else
-                                        {
-                                            pAcc->SetPixelIndex( y, x, nDat ? 1 : 0 );  // nBitDepth == 8
-                                            nBitsLeft = 0;
-                                        }
                                     }
-                                }
-                                if ( bIsValid )
-                                {
-                                    VirtualDevice   aVDev;
-                                    GDIMetaFile     aMtf;
-                                    Size            aSize;
-                                    aVDev.EnableOutput( false );
-                                    aMtf.Record( &aVDev );
-                                    aSize = aBitmap.GetPrefSize();
-                                    if( !aSize.Width() || !aSize.Height() )
-                                        aSize = Application::GetDefaultDevice()->PixelToLogic( aBitmap.GetSizePixel(), MAP_100TH_MM );
+                                    if ( nBitDepth == 1 )
+                                        pAcc->SetPixelIndex( y, x, static_cast<sal_uInt8>(nDat >> nBitsLeft) & 1 );
                                     else
-                                        aSize = OutputDevice::LogicToLogic( aSize, aBitmap.GetPrefMapMode(), MAP_100TH_MM );
-                                    aVDev.DrawBitmap( Point(), aSize, aBitmap );
-                                    aMtf.Stop();
-                                    aMtf.WindStart();
-                                    aMtf.SetPrefMapMode( MAP_100TH_MM );
-                                    aMtf.SetPrefSize( aSize );
-                                    aGraphic = aMtf;
-                                    bHasPreview = bRetValue = true;
+                                    {
+                                        pAcc->SetPixelIndex( y, x, nDat ? 1 : 0 );  // nBitDepth == 8
+                                        nBitsLeft = 0;
+                                    }
                                 }
-                                aBitmap.ReleaseAccess( pAcc );
                             }
+                            if ( bIsValid )
+                            {
+                                VirtualDevice   aVDev;
+                                GDIMetaFile     aMtf;
+                                Size            aSize;
+                                aVDev.EnableOutput( false );
+                                aMtf.Record( &aVDev );
+                                aSize = aBitmap.GetPrefSize();
+                                if( !aSize.Width() || !aSize.Height() )
+                                    aSize = Application::GetDefaultDevice()->PixelToLogic( aBitmap.GetSizePixel(), MAP_100TH_MM );
+                                else
+                                    aSize = OutputDevice::LogicToLogic( aSize, aBitmap.GetPrefMapMode(), MAP_100TH_MM );
+                                aVDev.DrawBitmap( Point(), aSize, aBitmap );
+                                aMtf.Stop();
+                                aMtf.WindStart();
+                                aMtf.SetPrefMapMode( MAP_100TH_MM );
+                                aMtf.SetPrefSize( aSize );
+                                aGraphic = aMtf;
+                                bHasPreview = bRetValue = true;
+                            }
+                            aBitmap.ReleaseAccess( pAcc );
                         }
                     }
                 }
+            }
 
-                sal_uInt8* pDest = ImplSearchEntry( pBuf, reinterpret_cast<sal_uInt8 const *>("%%BoundingBox:"), nBytesRead, 14 );
-                if ( pDest )
+            sal_uInt8* pDest = ImplSearchEntry( pBuf, reinterpret_cast<sal_uInt8 const *>("%%BoundingBox:"), nBytesRead, 14 );
+            if ( pDest )
+            {
+                nSecurityCount = 100;
+                long nNumb[4];
+                nNumb[0] = nNumb[1] = nNumb[2] = nNumb[3] = 0;
+                pDest += 14;
+                for ( int i = 0; ( i < 4 ) && nSecurityCount; i++ )
                 {
-                    nSecurityCount = 100;
-                    long nNumb[4];
-                    nNumb[0] = nNumb[1] = nNumb[2] = nNumb[3] = 0;
-                    pDest += 14;
-                    for ( int i = 0; ( i < 4 ) && nSecurityCount; i++ )
-                    {
-                        nNumb[ i ] = ImplGetNumber( &pDest, nSecurityCount );
-                    }
-                    if ( nSecurityCount)
-                    {
-                        bGraphicLinkCreated = true;
-                        GfxLink     aGfxLink( pBuf, nPSSize, GFX_LINK_TYPE_EPS_BUFFER, true ) ;
-                        GDIMetaFile aMtf;
-
-                        long nWidth =  nNumb[2] - nNumb[0] + 1;
-                        long nHeight = nNumb[3] - nNumb[1] + 1;
+                    nNumb[ i ] = ImplGetNumber( &pDest, nSecurityCount );
+                }
+                if ( nSecurityCount)
+                {
+                    bGraphicLinkCreated = true;
+                    GfxLink     aGfxLink( pBuf, nPSSize, GFX_LINK_TYPE_EPS_BUFFER, true ) ;
+                    GDIMetaFile aMtf;
 
-                        // if there is no preview -> try with gs to make one
-                        if( !bHasPreview )
-                        {
-                            bHasPreview = RenderAsEMF(pBuf, nBytesRead, aGraphic);
-                            if (!bHasPreview)
-                                bHasPreview = RenderAsBMP(pBuf, nBytesRead, aGraphic);
-                        }
+                    long nWidth =  nNumb[2] - nNumb[0] + 1;
+                    long nHeight = nNumb[3] - nNumb[1] + 1;
 
-                        // if there is no preview -> make a red box
-                        if( !bHasPreview )
-                        {
-                            MakePreview(pBuf, nBytesRead, nWidth, nHeight,
-                                aGraphic);
-                        }
+                    // if there is no preview -> try with gs to make one
+                    if( !bHasPreview )
+                    {
+                        bHasPreview = RenderAsEMF(pBuf, nBytesRead, aGraphic);
+                        if (!bHasPreview)
+                            bHasPreview = RenderAsBMP(pBuf, nBytesRead, aGraphic);
+                    }
 
-                        aMtf.AddAction( (MetaAction*)( new MetaEPSAction( Point(), Size( nWidth, nHeight ),
-                                                                          aGfxLink, aGraphic.GetGDIMetaFile() ) ) );
-                        CreateMtfReplacementAction( aMtf, rStream, nOrigPos, nPSSize, nPosWMF, nSizeWMF, nPosTIFF, nSizeTIFF );
-                        aMtf.WindStart();
-                        aMtf.SetPrefMapMode( MAP_POINT );
-                        aMtf.SetPrefSize( Size( nWidth, nHeight ) );
-                        rGraphic = aMtf;
-                        bRetValue = true;
+                    // if there is no preview -> make a red box
+                    if( !bHasPreview )
+                    {
+                        MakePreview(pBuf, nBytesRead, nWidth, nHeight,
+                            aGraphic);
                     }
+
+                    aMtf.AddAction( (MetaAction*)( new MetaEPSAction( Point(), Size( nWidth, nHeight ),
+                                                                      aGfxLink, aGraphic.GetGDIMetaFile() ) ) );
+                    CreateMtfReplacementAction( aMtf, rStream, nOrigPos, nPSSize, nPosWMF, nSizeWMF, nPosTIFF, nSizeTIFF );
+                    aMtf.WindStart();
+                    aMtf.SetPrefMapMode( MAP_POINT );
+                    aMtf.SetPrefSize( Size( nWidth, nHeight ) );
+                    rGraphic = aMtf;
+                    bRetValue = true;
                 }
             }
         }
+
         if ( !bGraphicLinkCreated )
             delete[] pBuf;
     }
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx
index 64b7233..c3c767c 100644
--- a/filter/source/graphicfilter/ipsd/ipsd.cxx
+++ b/filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -177,9 +177,6 @@ bool PSDReader::ImplReadHeader()
 
     mpFileHeader = new PSDFileHeader;
 
-    if ( !mpFileHeader )
-        return false;
-
     m_rPSD.ReadUInt32( mpFileHeader->nSignature ).ReadUInt16( mpFileHeader->nVersion ).ReadUInt32( mpFileHeader->nPad1 ).        ReadUInt16( mpFileHeader->nPad2 ).ReadUInt16( mpFileHeader->nChannels ).ReadUInt32( mpFileHeader->nRows ).            ReadUInt32( mpFileHeader->nColumns ).ReadUInt16( mpFileHeader->nDepth ).ReadUInt16( mpFileHeader->nMode );
 
     if ( ( mpFileHeader->nSignature != 0x38425053 ) || ( mpFileHeader->nVersion != 1 ) )
@@ -240,8 +237,6 @@ bool PSDReader::ImplReadHeader()
             if ( nColorLength != 768 )      // we need the color map
                 return false;
             mpPalette = new sal_uInt8[ 768 ];
-            if ( mpPalette == NULL )
-                return false;
             m_rPSD.Read( mpPalette, 768 );
         }
         break;
@@ -255,8 +250,6 @@ bool PSDReader::ImplReadHeader()
             if ( nColorLength )
                 return false;
             mpPalette = new sal_uInt8[ 768 ];
-            if ( mpPalette == NULL )
-                return false;
             for ( sal_uInt16 i = 0; i < 256; i++ )
             {
                 mpPalette[ i ] = mpPalette[ i + 256 ] = mpPalette[ i + 512 ] = (sal_uInt8)i;
diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx
index 23f9163..29dc073 100644
--- a/filter/source/graphicfilter/itga/itga.cxx
+++ b/filter/source/graphicfilter/itga/itga.cxx
@@ -175,8 +175,6 @@ bool TGAReader::ReadTGA(Graphic & rGraphic)
 bool TGAReader::ImplReadHeader()
 {
     mpFileHeader = new TGAFileHeader;
-    if ( mpFileHeader == NULL )
-        return false;
 
     m_rTGA.ReadUChar( mpFileHeader->nImageIDLength ).ReadUChar( mpFileHeader->nColorMapType ).ReadUChar( mpFileHeader->nImageType ).        ReadUInt16( mpFileHeader->nColorMapFirstEntryIndex ).ReadUInt16( mpFileHeader->nColorMapLength ).ReadUChar( mpFileHeader->nColorMapEntrySize ).            ReadUInt16( mpFileHeader->nColorMapXOrigin ).ReadUInt16( mpFileHeader->nColorMapYOrigin ).ReadUInt16( mpFileHeader->nImageWidth ).                ReadUInt16( mpFileHeader->nImageHeight ).ReadUChar( mpFileHeader->nPixelDepth ).ReadUChar( mpFileHeader->nImageDescriptor );
 
@@ -190,56 +188,53 @@ bool TGAReader::ImplReadHeader()
 
     // first we want to get the version
     mpFileFooter = new TGAFileFooter;       // read the TGA-File-Footer to determine whether
-    if ( mpFileFooter )                     // we got an old TGA format or the new one
-    {
-        sal_uLong nCurStreamPos = m_rTGA.Tell();
-        m_rTGA.Seek( STREAM_SEEK_TO_END );
-        sal_uLong nTemp = m_rTGA.Tell();
-        m_rTGA.Seek( nTemp - SizeOfTGAFileFooter );
+                                            // we got an old TGA format or the new one
+
+    sal_uLong nCurStreamPos = m_rTGA.Tell();
+    m_rTGA.Seek( STREAM_SEEK_TO_END );
+    sal_uLong nTemp = m_rTGA.Tell();
+    m_rTGA.Seek( nTemp - SizeOfTGAFileFooter );
+
+    m_rTGA.ReadUInt32( mpFileFooter->nExtensionFileOffset ).ReadUInt32( mpFileFooter->nDeveloperDirectoryOffset ).            ReadUInt32( mpFileFooter->nSignature[0] ).ReadUInt32( mpFileFooter->nSignature[1] ).ReadUInt32( mpFileFooter->nSignature[2] ).                ReadUInt32( mpFileFooter->nSignature[3] ).ReadUChar( mpFileFooter->nPadByte ).ReadUChar( mpFileFooter->nStringTerminator );
 
-        m_rTGA.ReadUInt32( mpFileFooter->nExtensionFileOffset ).ReadUInt32( mpFileFooter->nDeveloperDirectoryOffset ).            ReadUInt32( mpFileFooter->nSignature[0] ).ReadUInt32( mpFileFooter->nSignature[1] ).ReadUInt32( mpFileFooter->nSignature[2] ).                ReadUInt32( mpFileFooter->nSignature[3] ).ReadUChar( mpFileFooter->nPadByte ).ReadUChar( mpFileFooter->nStringTerminator );
 
+    if ( !m_rTGA.good())
+        return false;
+
+    // check for sal_True, VISI, ON-X, FILE in the signatures
+    if ( mpFileFooter->nSignature[ 0 ] == (('T'<<24)|('R'<<16)|('U'<<8)|'E') &&
+         mpFileFooter->nSignature[ 1 ] == (('V'<<24)|('I'<<16)|('S'<<8)|'I') &&
+         mpFileFooter->nSignature[ 2 ] == (('O'<<24)|('N'<<16)|('-'<<8)|'X') &&
+         mpFileFooter->nSignature[ 3 ] == (('F'<<24)|('I'<<16)|('L'<<8)|'E') )
+    {
+        mpExtension = new TGAExtension;
 
+        m_rTGA.Seek( mpFileFooter->nExtensionFileOffset );
+        m_rTGA.ReadUInt16( mpExtension->nExtensionSize );
         if ( !m_rTGA.good())
             return false;
-
-        // check for sal_True, VISI, ON-X, FILE in the signatures
-        if ( mpFileFooter->nSignature[ 0 ] == (('T'<<24)|('R'<<16)|('U'<<8)|'E') &&
-             mpFileFooter->nSignature[ 1 ] == (('V'<<24)|('I'<<16)|('S'<<8)|'I') &&
-             mpFileFooter->nSignature[ 2 ] == (('O'<<24)|('N'<<16)|('-'<<8)|'X') &&
-             mpFileFooter->nSignature[ 3 ] == (('F'<<24)|('I'<<16)|('L'<<8)|'E') )
+        if ( mpExtension->nExtensionSize >= SizeOfTGAExtension )
         {
-            mpExtension = new TGAExtension;
-            if ( mpExtension )
-            {
-                m_rTGA.Seek( mpFileFooter->nExtensionFileOffset );
-                m_rTGA.ReadUInt16( mpExtension->nExtensionSize );
-                if ( !m_rTGA.good())
-                    return false;
-                if ( mpExtension->nExtensionSize >= SizeOfTGAExtension )
-                {
-                    mnTGAVersion = 2;
-
-                    m_rTGA.Read( mpExtension->sAuthorName, 41 );
-                    m_rTGA.Read( mpExtension->sAuthorComment, 324 );
-                    m_rTGA.Read( mpExtension->sDateTimeStamp, 12 );
-                    m_rTGA.Read( mpExtension->sJobNameID, 12 );
-                    m_rTGA.ReadChar( mpExtension->sJobNameID[ 0 ] ).ReadChar( mpExtension->sJobNameID[ 1 ] ).ReadChar( mpExtension->sJobNameID[ 2 ] );
-                    m_rTGA.Read( mpExtension->sSoftwareID, 41 );
-                    m_rTGA.ReadUInt16( mpExtension->nSoftwareVersionNumber ).ReadUChar( mpExtension->nSoftwareVersionLetter )
-                       .ReadUInt32( mpExtension->nKeyColor ).ReadUInt16( mpExtension->nPixelAspectRatioNumerator )
-                           .ReadUInt16( mpExtension->nPixelAspectRatioDeNumerator ).ReadUInt16( mpExtension->nGammaValueNumerator )
-                               .ReadUInt16( mpExtension->nGammaValueDeNumerator ).ReadUInt32( mpExtension->nColorCorrectionOffset )
-                                   .ReadUInt32( mpExtension->nPostageStampOffset ).ReadUInt32( mpExtension->nScanLineOffset )
-                                       .ReadUChar( mpExtension->nAttributesType );
-
-                    if ( !m_rTGA.good())
-                        return false;
-                }
-            }
+            mnTGAVersion = 2;
+
+            m_rTGA.Read( mpExtension->sAuthorName, 41 );
+            m_rTGA.Read( mpExtension->sAuthorComment, 324 );
+            m_rTGA.Read( mpExtension->sDateTimeStamp, 12 );
+            m_rTGA.Read( mpExtension->sJobNameID, 12 );
+            m_rTGA.ReadChar( mpExtension->sJobNameID[ 0 ] ).ReadChar( mpExtension->sJobNameID[ 1 ] ).ReadChar( mpExtension->sJobNameID[ 2 ] );
+            m_rTGA.Read( mpExtension->sSoftwareID, 41 );
+            m_rTGA.ReadUInt16( mpExtension->nSoftwareVersionNumber ).ReadUChar( mpExtension->nSoftwareVersionLetter )
+               .ReadUInt32( mpExtension->nKeyColor ).ReadUInt16( mpExtension->nPixelAspectRatioNumerator )
+                   .ReadUInt16( mpExtension->nPixelAspectRatioDeNumerator ).ReadUInt16( mpExtension->nGammaValueNumerator )
+                       .ReadUInt16( mpExtension->nGammaValueDeNumerator ).ReadUInt32( mpExtension->nColorCorrectionOffset )
+                           .ReadUInt32( mpExtension->nPostageStampOffset ).ReadUInt32( mpExtension->nScanLineOffset )
+                               .ReadUChar( mpExtension->nAttributesType );
+
+            if ( !m_rTGA.good())
+                return false;
         }
-        m_rTGA.Seek( nCurStreamPos );
     }
+    m_rTGA.Seek( nCurStreamPos );
 
     //  using the TGA file specification this was the correct form but adobe photoshop sets nImageDescriptor
     //  equal to nPixelDepth
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index efe3e8c..d21260b 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -570,73 +570,70 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
                 // mpSVGExport = new SVGExport( xDocHandler );
                 mpSVGExport = new SVGExport( xContext, xDocHandler, maFilterData );
 
-                if( mpSVGExport != NULL )
-                {
-                    // xSVGExport is set up only to manage the life-time of the object pointed by mpSVGExport,
-                    // and in order to prevent that it is destroyed when passed to AnimationExporter.
-                    Reference< XInterface > xSVGExport = static_cast< ::com::sun::star::document::XFilter* >( mpSVGExport );
+                // xSVGExport is set up only to manage the life-time of the object pointed by mpSVGExport,
+                // and in order to prevent that it is destroyed when passed to AnimationExporter.
+                Reference< XInterface > xSVGExport = static_cast< ::com::sun::star::document::XFilter* >( mpSVGExport );
+
+                // create an id for each draw page
+                for( sal_Int32 i = 0; i < mSelectedPages.getLength(); ++i )
+                    implRegisterInterface( mSelectedPages[i] );
 
-                    // create an id for each draw page
-                    for( sal_Int32 i = 0; i < mSelectedPages.getLength(); ++i )
-                        implRegisterInterface( mSelectedPages[i] );
+                // create an id for each master page
+                for( sal_Int32 i = 0; i < mMasterPageTargets.getLength(); ++i )
+                    implRegisterInterface( mMasterPageTargets[i] );
 
-                    // create an id for each master page
-                    for( sal_Int32 i = 0; i < mMasterPageTargets.getLength(); ++i )
-                        implRegisterInterface( mMasterPageTargets[i] );
+                try
+                {
+                    mxDefaultPage = mSelectedPages[0];
 
-                    try
+                    if( mxDefaultPage.is() )
                     {
-                        mxDefaultPage = mSelectedPages[0];
+                        SvxDrawPage* pSvxDrawPage = SvxDrawPage::getImplementation( mxDefaultPage );
 
-                        if( mxDefaultPage.is() )
+                        if( pSvxDrawPage )
                         {
-                            SvxDrawPage* pSvxDrawPage = SvxDrawPage::getImplementation( mxDefaultPage );
+                            mpDefaultSdrPage = pSvxDrawPage->GetSdrPage();
+                            mpSdrModel = mpDefaultSdrPage->GetModel();
 
-                            if( pSvxDrawPage )
+                            if( mpSdrModel )
                             {
-                                mpDefaultSdrPage = pSvxDrawPage->GetSdrPage();
-                                mpSdrModel = mpDefaultSdrPage->GetModel();
-
-                                if( mpSdrModel )
-                                {
-                                    SdrOutliner& rOutl = mpSdrModel->GetDrawOutliner(NULL);
+                                SdrOutliner& rOutl = mpSdrModel->GetDrawOutliner(NULL);
 
-                                    maOldFieldHdl = rOutl.GetCalcFieldValueHdl();
-                                    maNewFieldHdl = LINK(this, SVGFilter, CalcFieldHdl);
-                                    rOutl.SetCalcFieldValueHdl(maNewFieldHdl);
-                                }
+                                maOldFieldHdl = rOutl.GetCalcFieldValueHdl();
+                                maNewFieldHdl = LINK(this, SVGFilter, CalcFieldHdl);
+                                rOutl.SetCalcFieldValueHdl(maNewFieldHdl);
                             }
-                            bRet = implExportDocument();
                         }
+                        bRet = implExportDocument();
                     }
-                    catch( ... )
-                    {
-                        delete mpSVGDoc, mpSVGDoc = NULL;
-                        OSL_FAIL( "Exception caught" );
-                    }
+                }
+                catch( ... )
+                {
+                    delete mpSVGDoc, mpSVGDoc = NULL;
+                    OSL_FAIL( "Exception caught" );
+                }
 
-                    if( mpSdrModel )
+                if( mpSdrModel )
+                {
+                    //fdo#62682 The maNewFieldHdl can end up getting copied
+                    //into various other outliners which live past this
+                    //method, so get the full list of outliners and restore
+                    //the maOldFieldHdl for all that have ended up using
+                    //maNewFieldHdl
+                    std::vector<SdrOutliner*> aOutliners(mpSdrModel->GetActiveOutliners());
+                    for (auto aIter = aOutliners.begin(); aIter != aOutliners.end(); ++aIter)
                     {
-                        //fdo#62682 The maNewFieldHdl can end up getting copied
-                        //into various other outliners which live past this
-                        //method, so get the full list of outliners and restore
-                        //the maOldFieldHdl for all that have ended up using
-                        //maNewFieldHdl
-                        std::vector<SdrOutliner*> aOutliners(mpSdrModel->GetActiveOutliners());
-                        for (auto aIter = aOutliners.begin(); aIter != aOutliners.end(); ++aIter)
-                        {
-                            SdrOutliner* pOutliner = *aIter;
-                            if (maNewFieldHdl == pOutliner->GetCalcFieldValueHdl())
-                                pOutliner->SetCalcFieldValueHdl(maOldFieldHdl);
-                        }
+                        SdrOutliner* pOutliner = *aIter;
+                        if (maNewFieldHdl == pOutliner->GetCalcFieldValueHdl())
+                            pOutliner->SetCalcFieldValueHdl(maOldFieldHdl);
                     }
-
-                    delete mpSVGWriter, mpSVGWriter = NULL;
-                    mpSVGExport = NULL; // pointed object is released by xSVGExport dtor at the end of this scope
-                    delete mpSVGFontExport, mpSVGFontExport = NULL;
-                    delete mpObjects, mpObjects = NULL;
-                    mbPresentation = false;
                 }
+
+                delete mpSVGWriter, mpSVGWriter = NULL;
+                mpSVGExport = NULL; // pointed object is released by xSVGExport dtor at the end of this scope
+                delete mpSVGFontExport, mpSVGFontExport = NULL;
+                delete mpObjects, mpObjects = NULL;
+                mbPresentation = false;
             }
         }
     }
diff --git a/hwpfilter/source/drawing.h b/hwpfilter/source/drawing.h
index 66b111a..9a9e7b4 100644
--- a/hwpfilter/source/drawing.h
+++ b/hwpfilter/source/drawing.h
@@ -363,10 +363,7 @@ static HWPDrawingObject *LoadDrawingObject(void)
     head = prev = NULL;
     do
     {
-        if ((hdo = new HWPDrawingObject) == NULL)
-        {
-            goto error;
-        }
+        hdo = new HWPDrawingObject;
         if (!LoadCommonHeader(hdo, &link_info))
         {
             goto error;
diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx
index 3a5bb21..0c2afb6 100644
--- a/hwpfilter/source/hinfo.cxx
+++ b/hwpfilter/source/hinfo.cxx
@@ -165,8 +165,7 @@ bool HWPInfo::Read(HWPFile & hwpf)
     {
         info_block = new unsigned char[info_block_len + 1];
 
-        if (0 == info_block ||
-            !HWPReadInfoBlock(info_block, info_block_len, hwpf))
+        if (!HWPReadInfoBlock(info_block, info_block_len, hwpf))
             return false;
     }
 
diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx
index 6283e77..2629479 100644
--- a/hwpfilter/source/htags.cxx
+++ b/hwpfilter/source/htags.cxx
@@ -112,7 +112,7 @@ bool OlePicture::Read(HWPFile & hwpf)
         return false;
 #ifdef WIN32
     char *data = new char[size];
-    if( data == 0 || hwpf.ReadBlock(data,size) == 0 )
+    if (hwpf.ReadBlock(data,size) == 0)
     {
           delete [] data;
           return false;
diff --git a/i18npool/source/collator/gencoll_rule.cxx b/i18npool/source/collator/gencoll_rule.cxx
index 8f71b7e..201170a 100644
--- a/i18npool/source/collator/gencoll_rule.cxx
+++ b/i18npool/source/collator/gencoll_rule.cxx
@@ -131,8 +131,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
         printf("\nRule parsering error\n");
     }
 
-    if (coll)
-        delete coll;
+    delete coll;
 
     return U_SUCCESS(status) ? 0 : 1;
 }   // End of main
diff --git a/idlc/source/parser.y b/idlc/source/parser.y
index af911c6..e041de7 100644
--- a/idlc/source/parser.y
+++ b/idlc/source/parser.y
@@ -566,8 +566,7 @@ interface_dcl :
             pInterface = new AstInterface(
                 *$1->getName(),
                 static_cast< AstInterface const * >(resolveTypedefs($1->getInherits())), pScope);
-            if ( pInterface &&
-                (pDecl = pScope->lookupByName(pInterface->getScopedName())) )
+            if ( (pDecl = pScope->lookupByName(pInterface->getScopedName())) )
             {
                 /*
                  * See if we're defining a forward declared interface.
diff --git a/pyuno/zipcore/python.cxx b/pyuno/zipcore/python.cxx
index 0e8bb6c..6944d93 100644
--- a/pyuno/zipcore/python.cxx
+++ b/pyuno/zipcore/python.cxx
@@ -144,9 +144,6 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
             MY_LENGTH(L"\""); //TODO: overflow
     }
     wchar_t * cl = new wchar_t[clSize];
-    if (cl == NULL) {
-        exit(EXIT_FAILURE);
-    }
     wchar_t * cp = encode(cl, pythonhome);
     for (int i = 1; i < argc; ++i) {
         *cp++ = L' ';
@@ -171,8 +168,7 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
         orig = (wchar_t *)L"";
     } else {
         orig = new wchar_t[n];
-        if (orig == NULL ||
-            GetEnvironmentVariableW(L"PATH", orig, n) != n - 1)
+        if (GetEnvironmentVariableW(L"PATH", orig, n) != n - 1)
         {
             exit(EXIT_FAILURE);
         }
@@ -198,8 +194,7 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
         orig = (wchar_t *)L"";
     } else {
         orig = new wchar_t[n];
-        if (orig == NULL ||
-            GetEnvironmentVariableW(L"PYTHONPATH", orig, n) != n - 1)
+        if (GetEnvironmentVariableW(L"PYTHONPATH", orig, n) != n - 1)
         {
             exit(EXIT_FAILURE);
         }
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index 2741131..084bb10 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -61,14 +61,11 @@ SvMemoryStream* GraphicHelper::getFormatStrFromGDI_Impl( const GDIMetaFile* pGDI
     if ( pGDIMeta )
     {
         SvMemoryStream* pStream = new SvMemoryStream( 65535, 65535 );
-        if ( pStream )
-        {
-            Graphic aGraph( *pGDIMeta );
-            if ( GraphicConverter::Export( *pStream, aGraph, nFormat ) == 0 )
-                pResult = pStream;
-            else
-                delete pStream;
-        }
+        Graphic aGraph( *pGDIMeta );
+        if ( GraphicConverter::Export( *pStream, aGraph, nFormat ) == 0 )
+            pResult = pStream;
+        else
+            delete pStream;
     }
 
     return pResult;
@@ -120,60 +117,56 @@ void* GraphicHelper::getWinMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta, co
     if ( pGDIMeta )
     {
         SvMemoryStream* pStream = new SvMemoryStream( 65535, 65535 );
-        if ( pStream )
+        Graphic aGraph( *pGDIMeta );
+        sal_Bool bFailed = (sal_Bool)GraphicConverter::Export( *pStream, aGraph, CVT_WMF );
+        pStream->Flush();
+        if ( !bFailed )
         {
-            Graphic aGraph( *pGDIMeta );
-            sal_Bool bFailed = (sal_Bool)GraphicConverter::Export( *pStream, aGraph, CVT_WMF );
-            pStream->Flush();
-            if ( !bFailed )
+            sal_Int32 nLength = pStream->Seek( STREAM_SEEK_TO_END );
+            if ( nLength > 22 )
             {
-                sal_Int32 nLength = pStream->Seek( STREAM_SEEK_TO_END );
-                if ( nLength > 22 )
+                HMETAFILE hMeta = SetMetaFileBitsEx( nLength - 22,
+                                ( reinterpret_cast< const unsigned char*>( pStream->GetData() ) ) + 22 );
+
+                if ( hMeta )
                 {
-                    HMETAFILE hMeta = SetMetaFileBitsEx( nLength - 22,
-                                    ( reinterpret_cast< const unsigned char*>( pStream->GetData() ) ) + 22 );
+                    HGLOBAL hMemory = GlobalAlloc( GMEM_DDESHARE | GMEM_MOVEABLE, sizeof( METAFILEPICT ) );
 
-                    if ( hMeta )
+                    if ( hMemory )
                     {
-                        HGLOBAL hMemory = GlobalAlloc( GMEM_DDESHARE | GMEM_MOVEABLE, sizeof( METAFILEPICT ) );
+                           METAFILEPICT* pMF = (METAFILEPICT*)GlobalLock( hMemory );
 
-                        if ( hMemory )
+                           pMF->hMF = hMeta;
+                           pMF->mm = MM_ANISOTROPIC;
+
+                        MapMode aMetaMode = pGDIMeta->GetPrefMapMode();
+                        MapMode aWinMode( MAP_100TH_MM );
+
+                        if ( aWinMode == pGDIMeta->GetPrefMapMode() )
                         {
-                               METAFILEPICT* pMF = (METAFILEPICT*)GlobalLock( hMemory );
-
-                               pMF->hMF = hMeta;
-                               pMF->mm = MM_ANISOTROPIC;
-
-                            MapMode aMetaMode = pGDIMeta->GetPrefMapMode();
-                            MapMode aWinMode( MAP_100TH_MM );
-
-                            if ( aWinMode == pGDIMeta->GetPrefMapMode() )
-                            {
-                                pMF->xExt = aMetaSize.Width();
-                                pMF->yExt = aMetaSize.Height();
-                            }
-                            else
-                            {
-                                Size aWinSize = OutputDevice::LogicToLogic( Size( aMetaSize.Width(), aMetaSize.Height() ),
-                                                                            pGDIMeta->GetPrefMapMode(),
-                                                                            aWinMode );
-                                pMF->xExt = aWinSize.Width();
-                                pMF->yExt = aWinSize.Height();
-                            }
-
-                            GlobalUnlock( hMemory );
-                            pResult = (void*)hMemory;
+                            pMF->xExt = aMetaSize.Width();
+                            pMF->yExt = aMetaSize.Height();
                         }
                         else
-                               DeleteMetaFile( hMeta );
+                        {
+                            Size aWinSize = OutputDevice::LogicToLogic( Size( aMetaSize.Width(), aMetaSize.Height() ),
+                                                                        pGDIMeta->GetPrefMapMode(),
+                                                                        aWinMode );
+                            pMF->xExt = aWinSize.Width();
+                            pMF->yExt = aWinSize.Height();
+                        }
+
+                        GlobalUnlock( hMemory );
+                        pResult = (void*)hMemory;
                     }
+                    else
+                           DeleteMetaFile( hMeta );
                 }
             }
-
-            delete pStream;
         }
-    }
 
+        delete pStream;
+    }
 #endif
 
 
diff --git a/shell/source/win32/zipfile/zipfile.cxx b/shell/source/win32/zipfile/zipfile.cxx
index ca43812..ac9f9a0 100644
--- a/shell/source/win32/zipfile/zipfile.cxx
+++ b/shell/source/win32/zipfile/zipfile.cxx
@@ -134,8 +134,6 @@ static std::string readString(StreamInterface *stream, unsigned long size)
     if (!stream || stream->stell() == -1)
         throw IOException(-1);
     unsigned char *tmp = new unsigned char[size];
-    if (!tmp)
-        throw IOException(-1);
     unsigned long numBytesRead = stream->sread(tmp, size);
     if (numBytesRead != size)
         throw IOException(-1);
diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx
index 1b0f35c..5221e46 100644
--- a/svl/source/items/slstitm.cxx
+++ b/svl/source/items/slstitm.cxx
@@ -60,9 +60,7 @@ SfxStringListItem::SfxStringListItem( sal_uInt16 which, const std::vector<OUStri
     if( pList /*!!! && pList->Count() */ )
     {
         pImp = new SfxImpStringList;
-
-        if (pImp)
-            pImp->aList = *pList;
+        pImp->aList = *pList;
     }
 }
 
@@ -255,12 +253,9 @@ void SfxStringListItem::SetStringList( const com::sun::star::uno::Sequence< OUSt
         pImp->nRefCount--;
     pImp = new SfxImpStringList;
 
-    if (pImp)
-    {
-        // String belongs to the list
-        for ( sal_Int32 n = 0; n < rList.getLength(); n++ )
-            pImp->aList.push_back(rList[n]);
-    }
+    // String belongs to the list
+    for ( sal_Int32 n = 0; n < rList.getLength(); n++ )
+        pImp->aList.push_back(rList[n]);
 }
 
 void SfxStringListItem::GetStringList( com::sun::star::uno::Sequence< OUString >& rList ) const
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index e182812..218fdb1 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1680,7 +1680,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const ::com::sun::star::i18n
                                                  pStringScanner,
                                                  nCheckPos,
                                                  ActLnge);
-    if ( !pFormat || !(nCheckPos == 0) )
+    if (nCheckPos != 0)
     {
         if (LocaleDataWrapper::areChecksEnabled())
         {
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 779cc64..889ed30 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -399,9 +399,8 @@ PasswordContainer::PasswordContainer( const Reference<XMultiServiceFactory>& xSe
     mComponent->addEventListener( this );
 
     m_pStorageFile = new StorageItem( this, OUString("Office.Common/Passwords") );
-    if( m_pStorageFile )
-        if( m_pStorageFile->useStorage() )
-            m_aContainer = m_pStorageFile->getInfo();
+    if( m_pStorageFile->useStorage() )
+        m_aContainer = m_pStorageFile->getInfo();
 }
 
 
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 1dd7110..952dfe9 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -113,8 +113,6 @@ HDDEDATA CALLBACK DdeInternal::SvrCallback(
                 return (HDDEDATA)NULL;
 
             HSZPAIR* pPairs = new HSZPAIR [nTopics + 1];
-            if ( !pPairs )
-                return (HDDEDATA)NULL;
 
             HSZPAIR* q = pPairs;
             for (DdeServices::iterator aI = rAll.begin(); aI != rAll.end(); ++aI)
diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx
index 594fd5c..b4cfbe2 100644
--- a/svx/source/engine3d/extrud3d.cxx
+++ b/svx/source/engine3d/extrud3d.cxx
@@ -200,12 +200,9 @@ SdrAttrObj* E3dExtrudeObj::GetBreakObj()
         basegfx::B2DPolyPolygon aPoly = TransformToScreenCoor(aBackSide);
         SdrPathObj* pPathObj = new SdrPathObj(OBJ_PLIN, aPoly);
 
-        if(pPathObj)
-        {
-            SfxItemSet aSet(GetObjectItemSet());
-            aSet.Put(XLineStyleItem(com::sun::star::drawing::LineStyle_SOLID));
-            pPathObj->SetMergedItemSet(aSet);
-        }
+        SfxItemSet aSet(GetObjectItemSet());
+        aSet.Put(XLineStyleItem(com::sun::star::drawing::LineStyle_SOLID));
+        pPathObj->SetMergedItemSet(aSet);
 
         return pPathObj;
     }
diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx
index 7869e63..9d2c60c 100644
--- a/svx/source/engine3d/lathe3d.cxx
+++ b/svx/source/engine3d/lathe3d.cxx
@@ -182,16 +182,13 @@ SdrAttrObj* E3dLatheObj::GetBreakObj()
     basegfx::B2DPolyPolygon aTransPoly(TransformToScreenCoor(aLathePoly3D));
     SdrPathObj* pPathObj = new SdrPathObj(OBJ_PLIN, aTransPoly);
 
-    if(pPathObj)
-    {
-        // Set Attribute
-        SfxItemSet aSet(GetObjectItemSet());
+    // Set Attribute
+    SfxItemSet aSet(GetObjectItemSet());
 
-        // Enable lines to guarantee that the object becomes visible
-        aSet.Put(XLineStyleItem(com::sun::star::drawing::LineStyle_SOLID));
+    // Enable lines to guarantee that the object becomes visible
+    aSet.Put(XLineStyleItem(com::sun::star::drawing::LineStyle_SOLID));
 
-        pPathObj->SetMergedItemSet(aSet);
-    }
+    pPathObj->SetMergedItemSet(aSet);
 
     return pPathObj;
 }
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 8cf6c02..f7c67d3 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -1515,10 +1515,7 @@ SvStream& SdrCustomShapeAdjustmentItem::Store( SvStream& rOut, sal_uInt16 nItemV
 SfxPoolItem* SdrCustomShapeAdjustmentItem::Clone( SfxItemPool * /*pPool*/) const
 {
     SdrCustomShapeAdjustmentItem* pItem = new SdrCustomShapeAdjustmentItem;
-
-    if (pItem)
-        pItem->aAdjustmentValueList = aAdjustmentValueList;
-
+    pItem->aAdjustmentValueList = aAdjustmentValueList;
     return pItem;
 }
 
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 08afe88..60f7e0b 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -970,14 +970,10 @@ void SdrHdlColor::CreateB2dIAObject()
                                     (sal_uInt16)(aBmpCol.GetSizePixel().Width() - 1) >> 1,
                                     (sal_uInt16)(aBmpCol.GetSizePixel().Height() - 1) >> 1
                                 );
-                            DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
 
                             // OVERLAYMANAGER
-                            if(pNewOverlayObject)
-                            {
-                                xManager->add(*pNewOverlayObject);
-                                maOverlayGroup.append(*pNewOverlayObject);
-                            }
+                            xManager->add(*pNewOverlayObject);
+                            maOverlayGroup.append(*pNewOverlayObject);
                         }
                     }
                 }
@@ -1293,17 +1289,13 @@ void SdrHdlLine::CreateB2dIAObject()
                                     aPosition1,
                                     aPosition2
                                 );
-                            DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
 
                             // OVERLAYMANAGER
-                            if(pNewOverlayObject)
-                            {
-                                // color(?)
-                                pNewOverlayObject->setBaseColor(Color(COL_LIGHTRED));
+                            // color(?)
+                            pNewOverlayObject->setBaseColor(Color(COL_LIGHTRED));
 
-                                xManager->add(*pNewOverlayObject);
-                                maOverlayGroup.append(*pNewOverlayObject);
-                            }
+                            xManager->add(*pNewOverlayObject);
+                            maOverlayGroup.append(*pNewOverlayObject);
                         }
                     }
                 }
@@ -1356,20 +1348,15 @@ void SdrHdlBezWgt::CreateB2dIAObject()
                                         aPosition1,
                                         aPosition2
                                     );
-                                DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
-
                                 // OVERLAYMANAGER
-                                if(pNewOverlayObject)
-                                {
-                                    // line part is not hittable
-                                    pNewOverlayObject->setHittable(false);
+                                // line part is not hittable
+                                pNewOverlayObject->setHittable(false);
 
-                                    // color(?)
-                                    pNewOverlayObject->setBaseColor(Color(COL_LIGHTBLUE));
+                                // color(?)
+                                pNewOverlayObject->setBaseColor(Color(COL_LIGHTBLUE));
 
-                                    xManager->add(*pNewOverlayObject);
-                                    maOverlayGroup.append(*pNewOverlayObject);
-                                }
+                                xManager->add(*pNewOverlayObject);
+                                maOverlayGroup.append(*pNewOverlayObject);
                             }
                         }
                     }
@@ -1411,16 +1398,12 @@ void E3dVolumeMarker::CreateB2dIAObject()
                             ::sdr::overlay::OverlayObject* pNewOverlayObject = new
                             ::sdr::overlay::OverlayPolyPolygonStripedAndFilled(
                                 aWireframePoly);
-                            DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
 
                             // OVERLAYMANAGER
-                            if(pNewOverlayObject)
-                            {
-                                pNewOverlayObject->setBaseColor(Color(COL_BLACK));
+                            pNewOverlayObject->setBaseColor(Color(COL_BLACK));
 
-                                xManager->add(*pNewOverlayObject);
-                                maOverlayGroup.append(*pNewOverlayObject);
-                            }
+                            xManager->add(*pNewOverlayObject);
+                            maOverlayGroup.append(*pNewOverlayObject);
                         }
                     }
                 }
@@ -1680,12 +1663,9 @@ void ImpTextframeHdl::CreateB2dIAObject()
                                 true); // allow animation; the Handle is not shown at text edit time
 
                             // OVERLAYMANAGER
-                            if(pNewOverlayObject)
-                            {
-                                pNewOverlayObject->setHittable(false);
-                                xManager->add(*pNewOverlayObject);
-                                maOverlayGroup.append(*pNewOverlayObject);
-                            }
+                            pNewOverlayObject->setHittable(false);
+                            xManager->add(*pNewOverlayObject);
+                            maOverlayGroup.append(*pNewOverlayObject);
                         }
                     }
                 }
@@ -2533,16 +2513,12 @@ void SdrCropViewHdl::CreateB2dIAObject()
             if(xManager.is())
             {
                 ::sdr::overlay::OverlayObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence);
-                DBG_ASSERT(pNew, "Got NO new IAO!");
 
-                if(pNew)
-                {
-                    // only informative object, no hit
-                    pNew->setHittable(false);
+                // only informative object, no hit
+                pNew->setHittable(false);
 
-                    xManager->add(*pNew);
-                    maOverlayGroup.append(*pNew);
-                }
+                xManager->add(*pNew);
+                maOverlayGroup.append(*pNew);
             }
         }
     }
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index dfc3d10..c8aec7d 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1407,22 +1407,18 @@ Reference< XInputStream > SdrGrafObj::getInputStream()
             if( nSize && pSourceData )
             {
                 sal_uInt8 * pBuffer = new sal_uInt8[ nSize ];
-                if( pBuffer )
-                {
-                    memcpy( pBuffer, pSourceData, nSize );
+                memcpy( pBuffer, pSourceData, nSize );
 
-                    SvMemoryStream* pStream = new SvMemoryStream( (void*)pBuffer, (sal_Size)nSize, StreamMode::READ );
-                    pStream->ObjectOwnsMemory( true );
-                    xStream.set( new utl::OInputStreamWrapper( pStream, true ) );
-                }
+                SvMemoryStream* pStream = new SvMemoryStream( (void*)pBuffer, (sal_Size)nSize, StreamMode::READ );
+                pStream->ObjectOwnsMemory( true );
+                xStream.set( new utl::OInputStreamWrapper( pStream, true ) );
             }
         }
 
         if (!xStream.is() && !aFileName.isEmpty())
         {
             SvFileStream* pStream = new SvFileStream( aFileName, StreamMode::READ );
-            if( pStream )
-                xStream.set( new utl::OInputStreamWrapper( pStream ) );
+            xStream.set( new utl::OInputStreamWrapper( pStream ) );
         }
     }
 
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 7ccf903..a2be884 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -459,24 +459,21 @@ SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPol
         pPathObj->SetPathPoly(basegfx::tools::expandToCurve(pPathObj->GetPathPoly()));
     }
 
-    if(pPathObj)
+    pPathObj->ImpSetAnchorPos(aAnchor);
+    pPathObj->NbcSetLayer(SdrLayerID(GetLayer()));
+
+    if(pModel)
     {
-        pPathObj->ImpSetAnchorPos(aAnchor);
-        pPathObj->NbcSetLayer(SdrLayerID(GetLayer()));
+        pPathObj->SetModel(pModel);
 
-        if(pModel)
+        if(!bNoSetAttr)
         {
-            pPathObj->SetModel(pModel);
-
-            if(!bNoSetAttr)
-            {
-                sdr::properties::ItemChangeBroadcaster aC(*pPathObj);
+            sdr::properties::ItemChangeBroadcaster aC(*pPathObj);
 
-                pPathObj->ClearMergedItem();
-                pPathObj->SetMergedItemSet(GetObjectItemSet());
-                pPathObj->GetProperties().BroadcastItemChange(aC);
-                pPathObj->NbcSetStyleSheet(GetStyleSheet(), true);
-            }
+            pPathObj->ClearMergedItem();
+            pPathObj->SetMergedItemSet(GetObjectItemSet());
+            pPathObj->GetProperties().BroadcastItemChange(aC);
+            pPathObj->NbcSetStyleSheet(GetStyleSheet(), true);
         }
     }
 
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 619b7ab..7ef8515 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -75,8 +75,7 @@ SvxDrawPage::SvxDrawPage( SdrPage* pInPage ) throw()
 
     // create (hidden) view
     mpView = new SdrView( mpModel );
-    if( mpView )
-        mpView->SetDesignMode(true);
+    mpView->SetDesignMode(true);
 }
 
 SvxDrawPage::~SvxDrawPage() throw()
@@ -896,8 +895,7 @@ void SvxDrawPage::ChangeModel( SdrModel* pNewModel )
         {
             delete mpView;
             mpView = new SdrView( mpModel );
-            if( mpView )
-                mpView->SetDesignMode(true);
+            mpView->SetDesignMode(true);
         }
     }
 }
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 9f6e15f..e8a2a5d 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1895,27 +1895,24 @@ bool SvMemoryStream::ReAllocateMemory( long nDiff )
     {
         sal_uInt8* pNewBuf   = new sal_uInt8[nNewSize];
 
-        if( pNewBuf )
+        bRetVal = true; // Success!
+        if( nNewSize < nSize )      // Are we shrinking?
         {
-            bRetVal = true; // Success!
-            if( nNewSize < nSize )      // Are we shrinking?
-            {
-                memcpy( pNewBuf, pBuf, (size_t)nNewSize );
-                if( nPos > nNewSize )
-                    nPos = 0L;
-                if( nEndOfData >= nNewSize )
-                    nEndOfData = nNewSize-1L;
-            }
-            else
-            {
-                memcpy( pNewBuf, pBuf, (size_t)nSize );
-            }
+            memcpy( pNewBuf, pBuf, (size_t)nNewSize );
+            if( nPos > nNewSize )
+                nPos = 0L;
+            if( nEndOfData >= nNewSize )
+                nEndOfData = nNewSize-1L;
+        }
+        else
+        {
+            memcpy( pNewBuf, pBuf, (size_t)nSize );
+        }
 
-            FreeMemory();
+        FreeMemory();
 
-            pBuf  = pNewBuf;
-            nSize = nNewSize;
-        }
+        pBuf  = pNewBuf;
+        nSize = nNewSize;
     }
     else
     {
diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx
index 06e1d97..fc378c2 100644
--- a/vcl/source/filter/ixpm/xpmread.cxx
+++ b/vcl/source/filter/ixpm/xpmread.cxx
@@ -99,19 +99,14 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
                 //              1    Byte   -> 0xFF if colour is transparent
                 //              3    Bytes  -> RGB value of the colour
                 mpColMap = new sal_uInt8[ mnColors * ( 4 + mnCpp ) ];
-                if ( mpColMap )
+                for ( sal_uLong i = 0; i < mnColors; i++ )
                 {
-                    for ( sal_uLong i = 0; i < mnColors; i++ )
+                    if ( !ImplGetColor( i ) )
                     {
-                        if ( !ImplGetColor( i ) )
-                        {
-                            mbStatus = false;
-                            break;
-                        }
+                        mbStatus = false;
+                        break;
                     }
                 }
-                else
-                    mbStatus = false;
 
                 if ( mbStatus )
                 {
diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx
index bc0dcee..0c890d0 100644
--- a/vcl/win/source/gdi/salbmp.cxx
+++ b/vcl/win/source/gdi/salbmp.cxx
@@ -297,34 +297,31 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap()
 
         pRetval = new Gdiplus::Bitmap(nW, nH, PixelFormat24bppRGB);
 
-        if(pRetval)
+        if ( pRetval->GetLastStatus() == Gdiplus::Ok )
         {
-            if ( pRetval->GetLastStatus() == Gdiplus::Ok )
+            sal_uInt8* pSrcRGB(pRGB->mpBits);
+            const sal_uInt32 nExtraRGB(pRGB->mnScanlineSize - (nW * 3));
+            const bool bTopDown(pRGB->mnFormat & BMP_FORMAT_TOP_DOWN);
+            const Gdiplus::Rect aAllRect(0, 0, nW, nH);
+            Gdiplus::BitmapData aGdiPlusBitmapData;
+            pRetval->LockBits(&aAllRect, Gdiplus::ImageLockModeWrite, PixelFormat24bppRGB, &aGdiPlusBitmapData);
+
+            // copy data to Gdiplus::Bitmap; format is BGR here in both cases, so memcpy is possible
+            for(sal_uInt32 y(0); y < nH; y++)
             {
-                sal_uInt8* pSrcRGB(pRGB->mpBits);
-                const sal_uInt32 nExtraRGB(pRGB->mnScanlineSize - (nW * 3));
-                const bool bTopDown(pRGB->mnFormat & BMP_FORMAT_TOP_DOWN);
-                const Gdiplus::Rect aAllRect(0, 0, nW, nH);
-                Gdiplus::BitmapData aGdiPlusBitmapData;
-                pRetval->LockBits(&aAllRect, Gdiplus::ImageLockModeWrite, PixelFormat24bppRGB, &aGdiPlusBitmapData);
-
-                // copy data to Gdiplus::Bitmap; format is BGR here in both cases, so memcpy is possible
-                for(sal_uInt32 y(0); y < nH; y++)
-                {
-                    const sal_uInt32 nYInsert(bTopDown ? y : nH - y - 1);
-                    sal_uInt8* targetPixels = (sal_uInt8*)aGdiPlusBitmapData.Scan0 + (nYInsert * aGdiPlusBitmapData.Stride);
-
-                    memcpy(targetPixels, pSrcRGB, nW * 3);
-                    pSrcRGB += nW * 3 + nExtraRGB;
-                }
+                const sal_uInt32 nYInsert(bTopDown ? y : nH - y - 1);
+                sal_uInt8* targetPixels = (sal_uInt8*)aGdiPlusBitmapData.Scan0 + (nYInsert * aGdiPlusBitmapData.Stride);
 
-                pRetval->UnlockBits(&aGdiPlusBitmapData);
-            }
-            else
-            {
-                delete pRetval;
-                pRetval = NULL;
+                memcpy(targetPixels, pSrcRGB, nW * 3);
+                pSrcRGB += nW * 3 + nExtraRGB;
             }
+
+            pRetval->UnlockBits(&aGdiPlusBitmapData);
+        }
+        else
+        {
+            delete pRetval;
+            pRetval = NULL;
         }
     }
 
@@ -424,45 +421,42 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
 
         pRetval = new Gdiplus::Bitmap(nW, nH, PixelFormat32bppARGB);
 
-        if(pRetval)
+        if ( pRetval->GetLastStatus() == Gdiplus::Ok ) // 2nd place to secure with new Gdiplus::Bitmap
         {
-            if ( pRetval->GetLastStatus() == Gdiplus::Ok ) // 2nd place to secure with new Gdiplus::Bitmap
+            sal_uInt8* pSrcRGB(pRGB->mpBits);
+            sal_uInt8* pSrcA(pA->mpBits);
+            const sal_uInt32 nExtraRGB(pRGB->mnScanlineSize - (nW * 3));
+            const sal_uInt32 nExtraA(pA->mnScanlineSize - nW);
+            const bool bTopDown(pRGB->mnFormat & BMP_FORMAT_TOP_DOWN);
+            const Gdiplus::Rect aAllRect(0, 0, nW, nH);
+            Gdiplus::BitmapData aGdiPlusBitmapData;
+            pRetval->LockBits(&aAllRect, Gdiplus::ImageLockModeWrite, PixelFormat32bppARGB, &aGdiPlusBitmapData);
+
+            // copy data to Gdiplus::Bitmap; format is BGRA; need to mix BGR from Bitmap and
+            // A from alpha, so inner loop is needed (who invented BitmapEx..?)
+            for(sal_uInt32 y(0); y < nH; y++)
             {
-                sal_uInt8* pSrcRGB(pRGB->mpBits);
-                sal_uInt8* pSrcA(pA->mpBits);
-                const sal_uInt32 nExtraRGB(pRGB->mnScanlineSize - (nW * 3));
-                const sal_uInt32 nExtraA(pA->mnScanlineSize - nW);
-                const bool bTopDown(pRGB->mnFormat & BMP_FORMAT_TOP_DOWN);
-                const Gdiplus::Rect aAllRect(0, 0, nW, nH);
-                Gdiplus::BitmapData aGdiPlusBitmapData;
-                pRetval->LockBits(&aAllRect, Gdiplus::ImageLockModeWrite, PixelFormat32bppARGB, &aGdiPlusBitmapData);
-
-                // copy data to Gdiplus::Bitmap; format is BGRA; need to mix BGR from Bitmap and
-                // A from alpha, so inner loop is needed (who invented BitmapEx..?)
-                for(sal_uInt32 y(0); y < nH; y++)
-                {
-                    const sal_uInt32 nYInsert(bTopDown ? y : nH - y - 1);
-                    sal_uInt8* targetPixels = (sal_uInt8*)aGdiPlusBitmapData.Scan0 + (nYInsert * aGdiPlusBitmapData.Stride);
+                const sal_uInt32 nYInsert(bTopDown ? y : nH - y - 1);
+                sal_uInt8* targetPixels = (sal_uInt8*)aGdiPlusBitmapData.Scan0 + (nYInsert * aGdiPlusBitmapData.Stride);
 
-                    for(sal_uInt32 x(0); x < nW; x++)
-                    {
-                        *targetPixels++ = *pSrcRGB++;
-                        *targetPixels++ = *pSrcRGB++;
-                        *targetPixels++ = *pSrcRGB++;
-                        *targetPixels++ = 0xff - *pSrcA++;
-                    }
-
-                    pSrcRGB += nExtraRGB;
-                    pSrcA += nExtraA;
+                for(sal_uInt32 x(0); x < nW; x++)
+                {
+                    *targetPixels++ = *pSrcRGB++;
+                    *targetPixels++ = *pSrcRGB++;
+                    *targetPixels++ = *pSrcRGB++;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list