[Libreoffice-commits] core.git: 8 commits - desktop/unx i18nutil/source include/vcl sc/source shell/source vcl/inc vcl/source

Caolán McNamara caolanm at redhat.com
Wed Feb 8 10:41:40 UTC 2017


 desktop/unx/source/start.c                         |    2 
 i18nutil/source/utility/unicode.cxx                |    2 
 include/vcl/salbtype.hxx                           |  265 ++++++---------------
 sc/source/core/data/document.cxx                   |    2 
 shell/source/backends/desktopbe/desktopbackend.cxx |    2 
 vcl/inc/unx/i18n_cb.hxx                            |   33 +-
 vcl/source/control/edit.cxx                        |    2 
 vcl/source/control/field2.cxx                      |    7 
 vcl/source/fontsubset/fontsubset.cxx               |   11 
 vcl/source/gdi/bitmap.cxx                          |    4 
 vcl/source/gdi/pdfwriter_impl.cxx                  |    2 
 vcl/source/outdev/text.cxx                         |    2 
 12 files changed, 127 insertions(+), 207 deletions(-)

New commits:
commit 73cc391e9c9646e09722ce4324918646202c693b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 8 10:15:10 2017 +0000

    use c++11 data()
    
    Change-Id: Id111686979d6002d4b4206d18980c38e6260971f

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 7f04551..b3e0e38 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -8733,7 +8733,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
             // mapping is possible
         }
 
-        registerGlyphs( nGlyphs, pGlyphs, pGlyphWidths, &aUnicodes[0], pUnicodesPerGlyph, pMappedGlyphs, pMappedFontObjects, pFallbackFonts );
+        registerGlyphs( nGlyphs, pGlyphs, pGlyphWidths, aUnicodes.data(), pUnicodesPerGlyph, pMappedGlyphs, pMappedFontObjects, pFallbackFonts );
 
         for( int i = 0; i < nGlyphs; i++ )
         {
commit f12b4be44d8e490b7816206236bb628b20602716
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 8 10:11:04 2017 +0000

    coverity#707560 Uninitialized scalar variable
    
    Change-Id: Ia041c86a689f92795298ee16922ab42734820ec6

diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx
index 4eca8a4..3e496b1 100644
--- a/vcl/source/fontsubset/fontsubset.cxx
+++ b/vcl/source/fontsubset/fontsubset.cxx
@@ -128,9 +128,10 @@ bool FontSubsetInfo::CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths )
     // handle SFNT_TTF fonts
     // by forwarding the subset request to AG's sft subsetter
 #if 1 // TODO: remove conversion tp 16bit glyphids when sft-subsetter has been updated
-    sal_uInt16 aShortGlyphIds[256];
-    for( int i = 0; i < mnReqGlyphCount; ++i)
-        aShortGlyphIds[i] = (sal_uInt16)mpReqGlyphIds[i];
+    std::vector<sal_uInt16> aShortGlyphIds;
+    aShortGlyphIds.reserve(mnReqGlyphCount);
+    for (int i = 0; i < mnReqGlyphCount; ++i)
+        aShortGlyphIds.push_back((sal_uInt16)mpReqGlyphIds[i]);
     // remove const_cast when sft-subsetter is const-correct
     sal_uInt8* pEncArray = const_cast<sal_uInt8*>( mpReqEncodedIds );
 #endif
@@ -138,12 +139,12 @@ bool FontSubsetInfo::CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths )
     if( (mnReqFontTypeMask & TYPE42_FONT) != 0 )
     {
         nSFTErr = CreateT42FromTTGlyphs( mpSftTTFont, mpOutFile, mpReqFontName,
-            aShortGlyphIds, pEncArray, mnReqGlyphCount );
+            aShortGlyphIds.data(), pEncArray, mnReqGlyphCount );
     }
     else if( (mnReqFontTypeMask & TYPE3_FONT) != 0 )
     {
         nSFTErr = CreateT3FromTTGlyphs( mpSftTTFont, mpOutFile, mpReqFontName,
-            aShortGlyphIds, pEncArray, mnReqGlyphCount,
+            aShortGlyphIds.data(), pEncArray, mnReqGlyphCount,
                     0 /* 0 = horizontal, 1 = vertical */ );
     }
     else if( (mnReqFontTypeMask & SFNT_TTF) != 0 )
commit fb107f15b28cdba3e7a92d10cb44d85d6c933743
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 8 09:45:31 2017 +0000

    coverity#1242486 Out-of-bounds access
    
    Change-Id: I24d73edd90a7fbfe63dd70a1784fb2276ceb079b

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 7ae5ad4..d191b48 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -478,7 +478,7 @@ send_args( int fd, rtl_uString *pCwdPath )
 
     if ( bResult )
     {
-        char resp[ strlen( "InternalIPC::ProcessingDone" ) ];
+        char resp[SAL_N_ELEMENTS("InternalIPC::ProcessingDone")];
         ssize_t n = read( fd, resp, SAL_N_ELEMENTS( resp ) );
         bResult = n == (ssize_t) SAL_N_ELEMENTS( resp )
             && (memcmp(
commit 27a673ac52e02f921ae78d409d0becc85bb7f602
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 8 09:41:34 2017 +0000

    coverity#1371289 Missing move assignment operator
    
    Change-Id: Idc26faf904f0c89cfd66f53bb311d8ce9b41eaab

diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx
index 61ce7c0..5d8a70a 100644
--- a/i18nutil/source/utility/unicode.cxx
+++ b/i18nutil/source/utility/unicode.cxx
@@ -1198,7 +1198,7 @@ OUString ToggleUnicodeCodepoint::StringToReplace()
     //if U+ notation used, strip off all extra chars added not in U+ notation
     if( nUPlus != -1 )
     {
-        maInput = maInput.copy(nUPlus);
+        maInput.remove(0, nUPlus);
         sIn = maInput.copy(2).toString();
         nUPlus = sIn.indexOf("U+");
     }
diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx
index 42bc6a8..e6d160f 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -198,7 +198,7 @@ OUString xdg_user_dir_lookup (const char *type)
                 continue;
             if (relative)
             {
-                aUserDirBuf = OUStringBuffer(aHomeDirURL + "/");
+                aUserDirBuf = aHomeDirURL + "/";
             }
             else
             {
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index a2c740b..9fa9259 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1963,8 +1963,11 @@ static bool ImplIsValidTimePortion( bool _bSkipInvalidCharacters, const OUString
 static bool ImplCutTimePortion( OUStringBuffer& _rStr, sal_Int32 _nSepPos, bool _bSkipInvalidCharacters, short* _pPortion )
 {
     OUString sPortion(_rStr.getStr(), _nSepPos );
-    _rStr = _nSepPos < _rStr.getLength()
-        ? _rStr.copy( _nSepPos + 1 ) : OUStringBuffer();
+
+    if (_nSepPos < _rStr.getLength())
+        _rStr = _rStr.copy(_nSepPos + 1);
+    else
+        _rStr.truncate();
 
     if ( !ImplIsValidTimePortion( _bSkipInvalidCharacters, sPortion ) )
         return false;
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index fc4e302..46eb2bd 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1962,7 +1962,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice,
             sal_Int32 nEraseChars = std::max<sal_Int32>(4, aStr.getLength() - (nIndex*4)/3);
             while( nEraseChars < aStr.getLength() && _rLayout.GetTextWidth( aTmpStr.toString(), 0, aTmpStr.getLength() ) > nMaxWidth )
             {
-                aTmpStr = OUStringBuffer(aStr);
+                aTmpStr = aStr;
                 sal_Int32 i = (aTmpStr.getLength() - nEraseChars)/2;
                 aTmpStr.remove(i, nEraseChars++);
                 aTmpStr.insert(i, "...");
commit 193ec57c899c6941675a86b7a24d6af60e410938
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 8 09:27:06 2017 +0000

    coverity#1400143 Missing move assignment operator
    
    by using a vector and let the defaults kick in
    
    Change-Id: I84e6144ab4beeeb316ccb830e7be55e35d942062

diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index ca5993b..e395f0c 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -20,8 +20,6 @@
 #ifndef INCLUDED_VCL_SALBTYPE_HXX
 #define INCLUDED_VCL_SALBTYPE_HXX
 
-#include <string.h>
-#include <stdlib.h>
 #include <tools/debug.hxx>
 #include <vcl/checksum.hxx>
 #include <vcl/salgtype.hxx>
@@ -30,6 +28,7 @@
 #include <tools/solar.h>
 #include <vcl/dllapi.h>
 #include <o3tl/typed_flags_set.hxx>
+#include <vector>
 
 typedef sal_uInt8*        Scanline;
 typedef const sal_uInt8*  ConstScanline;
@@ -92,9 +91,6 @@ class VCL_DLLPUBLIC BitmapColor
 {
 private:
 
-// ATTENTION:
-//   Because the members of this class are accessed via memcpy,
-//   you MUST NOT CHANGE the order of the members or the size of this class!
     sal_uInt8               mcBlueOrIndex;
     sal_uInt8               mcGreen;
     sal_uInt8               mcRed;
@@ -153,38 +149,103 @@ class VCL_DLLPUBLIC BitmapPalette
 
 private:
 
-    BitmapColor*                mpBitmapColor;
-    sal_uInt16                  mnCount;
+    std::vector<BitmapColor> maBitmapColor;
 
 public:
 
-    SAL_DLLPRIVATE inline BitmapColor* ImplGetColorBuffer() const;
+    SAL_DLLPRIVATE const BitmapColor* ImplGetColorBuffer() const
+    {
+        return maBitmapColor.data();
+    }
+
+    SAL_DLLPRIVATE BitmapColor* ImplGetColorBuffer()
+    {
+        return maBitmapColor.data();
+    }
 
     BitmapChecksum GetChecksum() const
     {
-        return vcl_get_checksum(0, mpBitmapColor, mnCount * sizeof(BitmapColor));
+        return vcl_get_checksum(0, maBitmapColor.data(), maBitmapColor.size() * sizeof(BitmapColor));
     }
 
 public:
 
-    inline                      BitmapPalette();
-    inline                      BitmapPalette( const BitmapPalette& rBitmapPalette );
-    inline                      BitmapPalette( sal_uInt16 nCount );
-    inline                      ~BitmapPalette();
+    BitmapPalette()
+    {
+    }
+
+    BitmapPalette(sal_uInt16 nCount)
+        : maBitmapColor(nCount)
+    {
+    }
+
+    bool operator==( const BitmapPalette& rBitmapPalette ) const
+    {
+        return maBitmapColor == rBitmapPalette.maBitmapColor;
+    }
+
+    bool operator!=(const BitmapPalette& rBitmapPalette) const
+    {
+        return !( *this == rBitmapPalette );
+    }
+
+    bool operator!()
+    {
+        return maBitmapColor.empty();
+    }
+
+    sal_uInt16 GetEntryCount() const
+    {
+        return maBitmapColor.size();
+    }
+
+    void SetEntryCount(sal_uInt16 nCount)
+    {
+        maBitmapColor.resize(nCount);
+    }
+
+    const BitmapColor& operator[](sal_uInt16 nIndex) const
+    {
+        assert(nIndex < maBitmapColor.size() && "Palette index is out of range");
+        return maBitmapColor[nIndex];
+    }
+
+    BitmapColor& operator[](sal_uInt16 nIndex)
+    {
+        assert(nIndex < maBitmapColor.size() && "Palette index is out of range");
+        return maBitmapColor[nIndex];
+    }
 
-    inline BitmapPalette&       operator=( const BitmapPalette& rBitmapPalette );
-    inline bool                 operator==( const BitmapPalette& rBitmapPalette ) const;
-    inline bool                 operator!=( const BitmapPalette& rBitmapPalette ) const;
-    inline bool                 operator!();
+    sal_uInt16 GetBestIndex(const BitmapColor& rCol) const
+    {
+        sal_uInt16 nRetIndex = 0;
 
-    inline sal_uInt16           GetEntryCount() const;
-    inline void                 SetEntryCount( sal_uInt16 nCount );
+        if (!maBitmapColor.empty())
+        {
+            for (size_t j = 0; j < maBitmapColor.size(); ++j)
+            {
+                if (rCol == maBitmapColor[j])
+                {
+                    return j;
+                }
+            }
 
-    inline const BitmapColor&   operator[]( sal_uInt16 nIndex ) const;
-    inline BitmapColor&         operator[]( sal_uInt16 nIndex );
+            sal_uInt16 nLastErr = SAL_MAX_UINT16;
+            for (size_t i = 0; i < maBitmapColor.size(); ++i)
+            {
+                const sal_uInt16 nActErr = rCol.GetColorError(maBitmapColor[i]);
+                if ( nActErr < nLastErr )
+                {
+                    nLastErr = nActErr;
+                    nRetIndex = i;
+                }
+            }
+        }
+
+        return nRetIndex;
+    }
 
-    inline sal_uInt16           GetBestIndex( const BitmapColor& rCol ) const;
-    bool                        IsGreyPalette() const;
+    bool IsGreyPalette() const;
 };
 
 struct VCL_DLLPUBLIC ColorMaskElement
@@ -439,164 +500,6 @@ inline sal_uInt16 BitmapColor::GetColorError( const BitmapColor& rBitmapColor )
         abs( static_cast<int>(mcRed) - static_cast<int>(rBitmapColor.mcRed) ) );
 }
 
-inline BitmapPalette::BitmapPalette() :
-            mpBitmapColor   ( nullptr ),
-            mnCount         ( 0 )
-{
-}
-
-inline BitmapPalette::BitmapPalette( const BitmapPalette& rBitmapPalette ) :
-            mnCount( rBitmapPalette.mnCount )
-{
-    if( mnCount )
-    {
-        const size_t nSize = mnCount * sizeof( BitmapColor );
-        mpBitmapColor = reinterpret_cast<BitmapColor*>(new sal_uInt8[ nSize ]);
-        memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize );
-    }
-    else
-        mpBitmapColor = nullptr;
-}
-
-inline BitmapPalette::BitmapPalette( sal_uInt16 nCount ) :
-            mnCount( nCount )
-{
-    if( mnCount )
-    {
-        const size_t nSize = mnCount * sizeof( BitmapColor );
-        mpBitmapColor = reinterpret_cast<BitmapColor*>(new sal_uInt8[ nSize ]);
-        memset( mpBitmapColor, 0, nSize );
-    }
-    else
-        mpBitmapColor = nullptr;
-}
-
-inline BitmapPalette::~BitmapPalette()
-{
-    delete[] reinterpret_cast<sal_uInt8*>(mpBitmapColor);
-}
-
-inline BitmapPalette& BitmapPalette::operator=( const BitmapPalette& rBitmapPalette )
-{
-    delete[] reinterpret_cast<sal_uInt8*>(mpBitmapColor);
-    mnCount = rBitmapPalette.mnCount;
-
-    if( mnCount )
-    {
-        const size_t nSize = mnCount * sizeof( BitmapColor );
-        mpBitmapColor = reinterpret_cast<BitmapColor*>(new sal_uInt8[ nSize ]);
-        memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize );
-    }
-    else
-        mpBitmapColor = nullptr;
-
-    return *this;
-}
-
-inline bool BitmapPalette::operator==( const BitmapPalette& rBitmapPalette ) const
-{
-    bool bRet = false;
-
-    if( rBitmapPalette.mnCount == mnCount )
-    {
-        bRet = true;
-
-        for( sal_uInt16 i = 0; i < mnCount; i++ )
-        {
-            if( mpBitmapColor[ i ] != rBitmapPalette.mpBitmapColor[ i ] )
-            {
-                bRet = false;
-                break;
-            }
-        }
-    }
-
-    return bRet;
-}
-
-inline bool BitmapPalette::operator!=( const BitmapPalette& rBitmapPalette ) const
-{
-    return !( *this == rBitmapPalette );
-}
-
-inline bool BitmapPalette::operator!()
-{
-    return( !mnCount || !mpBitmapColor );
-}
-
-inline sal_uInt16 BitmapPalette::GetEntryCount() const
-{
-    return mnCount;
-}
-
-inline void BitmapPalette::SetEntryCount( sal_uInt16 nCount )
-{
-    if( !nCount )
-    {
-        delete[] reinterpret_cast<sal_uInt8*>(mpBitmapColor);
-        mpBitmapColor = nullptr;
-        mnCount = 0;
-    }
-    else if( nCount != mnCount )
-    {
-        const size_t nNewSize = nCount * sizeof( BitmapColor );
-        const size_t nMinSize = std::min( mnCount, nCount ) * sizeof( BitmapColor );
-        sal_uInt8*      pNewColor = new sal_uInt8[ nNewSize ];
-
-        if ( nMinSize && mpBitmapColor )
-            memcpy( pNewColor, mpBitmapColor, nMinSize );
-        delete[] reinterpret_cast<sal_uInt8*>(mpBitmapColor);
-        memset( pNewColor + nMinSize, 0, nNewSize - nMinSize );
-        mpBitmapColor = reinterpret_cast<BitmapColor*>(pNewColor);
-        mnCount = nCount;
-    }
-}
-
-inline const BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex ) const
-{
-    assert( nIndex < mnCount && "Palette index is out of range" );
-    return mpBitmapColor[ nIndex ];
-}
-
-inline BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex )
-{
-    assert( nIndex < mnCount && "Palette index is out of range" );
-    return mpBitmapColor[ nIndex ];
-}
-
-inline BitmapColor* BitmapPalette::ImplGetColorBuffer() const
-{
-    assert( mpBitmapColor && "No color buffer available" );
-    return mpBitmapColor;
-}
-
-inline sal_uInt16 BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
-{
-    sal_uInt16 nRetIndex = 0;
-
-    if( mpBitmapColor && mnCount )
-    {
-        for( sal_uInt16 j = 0; j < mnCount; ++j )
-            if( rCol == mpBitmapColor[ j ] )
-            {
-                return j;
-            }
-
-        sal_uInt16 nLastErr = SAL_MAX_UINT16;
-        for( sal_uInt16 i = 0; i < mnCount; ++i )
-        {
-            const sal_uInt16 nActErr = rCol.GetColorError( mpBitmapColor[ i ] );
-            if ( nActErr < nLastErr )
-            {
-                nLastErr = nActErr;
-                nRetIndex = i;
-            }
-        }
-    }
-
-    return nRetIndex;
-}
-
 inline sal_uInt32 ColorMask::GetRedMask() const
 {
     return maR.mnMask;
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 16aa9adf..2ace729 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -210,8 +210,8 @@ bool BitmapPalette::IsGreyPalette() const
     // TODO: is it worth to compare the entries for the general case?
     if (nEntryCount == 2)
     {
-       const BitmapColor& rCol0(mpBitmapColor[0]);
-       const BitmapColor& rCol1(mpBitmapColor[1]);
+       const BitmapColor& rCol0(maBitmapColor[0]);
+       const BitmapColor& rCol1(maBitmapColor[1]);
        bRet = rCol0.GetRed() == rCol0.GetGreen() && rCol0.GetRed() == rCol0.GetBlue() &&
               rCol1.GetRed() == rCol1.GetGreen() && rCol1.GetRed() == rCol1.GetBlue();
     }
commit d8baaf43b0a5f384c35ea4a7a8cac7ede7d0fb90
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 8 09:00:16 2017 +0000

    coverity#1400144 Uninitialized pointer field
    
    Change-Id: Ie7031679c60b70eb8a79062cdd0353c3da1550e4

diff --git a/vcl/inc/unx/i18n_cb.hxx b/vcl/inc/unx/i18n_cb.hxx
index a63905d..ceaf53e 100644
--- a/vcl/inc/unx/i18n_cb.hxx
+++ b/vcl/inc/unx/i18n_cb.hxx
@@ -46,13 +46,22 @@ Bool IsControlCode(sal_Unicode nChar);
 
 } /* extern "C" */
 
-typedef struct {
-  sal_Unicode   *pUnicodeBuffer;
-  XIMFeedback   *pCharStyle;
-  unsigned int   nCursorPos;
-  unsigned int   nLength;
-  unsigned int   nSize;
-} preedit_text_t;
+struct preedit_text_t
+{
+    sal_Unicode   *pUnicodeBuffer;
+    XIMFeedback   *pCharStyle;
+    unsigned int   nCursorPos;
+    unsigned int   nLength;
+    unsigned int   nSize;
+    preedit_text_t()
+        : pUnicodeBuffer(nullptr)
+        , pCharStyle(nullptr)
+        , nCursorPos(0)
+        , nLength(0)
+        , nSize(0)
+    {
+    }
+};
 
 class SalFrame;
 
@@ -63,14 +72,18 @@ enum class PreeditStatus {
     StartPending
 };
 
-struct preedit_data_t {
+struct preedit_data_t
+{
     SalFrame*               pFrame;
     PreeditStatus           eState;
     preedit_text_t          aText;
     SalExtTextInputEvent    aInputEv;
     std::vector< ExtTextInputAttr >   aInputFlags;
-
-    preedit_data_t() : eState(PreeditStatus::DontKnow) {}
+    preedit_data_t()
+        : pFrame(nullptr)
+        , eState(PreeditStatus::DontKnow)
+    {
+    }
 };
 
 #endif // INCLUDED_VCL_INC_UNX_I18N_CB_HXX
commit 1428e9e0ab5a54f5f68c92748cfe29fee864b73a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 8 08:55:53 2017 +0000

    coverity#1400141 Unchecked return value
    
    Change-Id: I69f99910bb5748e8e182639387fa3cdbc04b5589

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 97ffab7..5f3ae62 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2691,7 +2691,7 @@ void ScDocument::CopyNonFilteredFromClip(
         {
             // look for more non-filtered rows following
             SCROW nLastRow = nSourceRow;
-            rCxt.getClipDoc()->RowFiltered(nSourceRow, nFlagTab, nullptr, &nLastRow);
+            (void)rCxt.getClipDoc()->RowFiltered(nSourceRow, nFlagTab, nullptr, &nLastRow);
             SCROW nFollow = nLastRow - nSourceRow;
 
             if (nFollow > nSourceEnd - nSourceRow)
commit 0008b7564af7ccca432ddb0eb0afccf1c8a7ea2b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 8 08:53:39 2017 +0000

    coverity#1400142 Dereference after null check
    
    Change-Id: Ifdb77761a6d8a6dbcbb8f59c84734f767fe0dfaf

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 63e9a70..9490014 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2026,7 +2026,7 @@ void Edit::Command( const CommandEvent& rCEvt )
         {
             ImplSetSelection( Selection( 0, maText.getLength() ) );
         }
-        else if (sCommand == "specialchar")
+        else if (sCommand == "specialchar" && pImplFncGetSpecialChars)
         {
             OUString aChars = pImplFncGetSpecialChars( this, GetFont() );
             SetSelection( aSaveSel );


More information about the Libreoffice-commits mailing list