dbaccess/source/filter/xml/xmlExport.cxx | 8 +----- vcl/unx/generic/gdi/gdiimpl.cxx | 39 ++++++++++++------------------- 2 files changed, 18 insertions(+), 29 deletions(-)
New commits: commit 29f971d0d210036656be667f58df57a25849fcee Author: Caolán McNamara <caol...@redhat.com> Date: Mon Jan 2 21:20:07 2017 +0000 micro opt Change-Id: I2d713783f1ad533c23a3fe319e7c37b7fd0e0e0d diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 43d530d..cd1d864 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -665,13 +665,9 @@ void ODBExport::exportDataSourceSettings() ::std::vector< TypedPropertyValue >::const_iterator aEnd = m_aDataSourceSettings.end(); for ( ; aIter != aEnd; ++aIter ) { - bool bIsSequence = TypeClass_SEQUENCE == aIter->Type.getTypeClass(); + const bool bIsSequence = TypeClass_SEQUENCE == aIter->Type.getTypeClass(); - Type aSimpleType; - if ( bIsSequence ) - aSimpleType = ::comphelper::getSequenceElementType( aIter->Value.getValueType() ); - else - aSimpleType = aIter->Type; + Type aSimpleType(bIsSequence ? comphelper::getSequenceElementType(aIter->Value.getValueType()) : aIter->Type); AddAttribute( XML_NAMESPACE_DB, XML_DATA_SOURCE_SETTING_IS_LIST,bIsSequence ? XML_TRUE : XML_FALSE ); AddAttribute( XML_NAMESPACE_DB, XML_DATA_SOURCE_SETTING_NAME, aIter->Name ); commit 48954af3bc0957da9bf0d5ef9eb07c9079285932 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Jan 2 21:10:18 2017 +0000 coverity#708661 Uninitialized scalar field Change-Id: I1e87e7f6d135f9e4a0b4efbb4ce7e6e08663f675 diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index 14b32dc..e929f6b 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -63,41 +63,35 @@ #define DBG_TESTTRANS( _def_drawable ) #endif // (OSL_DEBUG_LEVEL > 1) && defined SALGDI2_TESTTRANS -#define STATIC_POINTS 64 - /* From <X11/Intrinsic.h> */ typedef unsigned long Pixel; class SalPolyLine { - XPoint Points_[STATIC_POINTS]; - XPoint *pFirst_; + std::vector<XPoint> Points_; public: SalPolyLine(sal_uLong nPoints, const SalPoint *p) - : pFirst_(nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_) + : Points_(nPoints+1) { - for( sal_uLong i = 0; i < nPoints; i++ ) + for (sal_uLong i = 0; i < nPoints; ++i) { - pFirst_[i].x = (short)p[i].mnX; - pFirst_[i].y = (short)p[i].mnY; + Points_[i].x = (short)p[i].mnX; + Points_[i].y = (short)p[i].mnY; } - pFirst_[nPoints] = pFirst_[0]; // close polyline + Points_[nPoints] = Points_[0]; // close polyline } - ~SalPolyLine() + const XPoint &operator[](sal_uLong n) const { - if( pFirst_ != Points_ ) - delete [] pFirst_; + return Points_[n]; } - XPoint &operator [] ( sal_uLong n ) const + XPoint &operator[](sal_uLong n) { - return pFirst_[n]; + return Points_[n]; } }; -#undef STATIC_POINTS - namespace { void setForeBack(XGCValues& rValues, const SalColormap& rColMap, const SalBitmap& rSalBitmap) @@ -480,11 +474,10 @@ GC X11SalGraphicsImpl::SelectPen() return mpPenGC; } -void X11SalGraphicsImpl::DrawLines( sal_uLong nPoints, - const SalPolyLine &rPoints, - GC pGC, - bool bClose - ) +void X11SalGraphicsImpl::DrawLines(sal_uLong nPoints, + const SalPolyLine &rPoints, + GC pGC, + bool bClose) { // calculate how many lines XWindow can draw in one go sal_uLong nMaxLines = (mrParent.GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq)) @@ -497,7 +490,7 @@ void X11SalGraphicsImpl::DrawLines( sal_uLong nPoints, XDrawLines( mrParent.GetXDisplay(), mrParent.GetDrawable(), pGC, - &rPoints[n], + const_cast<XPoint*>(&rPoints[n]), nMaxLines, CoordModeOrigin ); @@ -505,7 +498,7 @@ void X11SalGraphicsImpl::DrawLines( sal_uLong nPoints, XDrawLines( mrParent.GetXDisplay(), mrParent.GetDrawable(), pGC, - &rPoints[n], + const_cast<XPoint*>(&rPoints[n]), nPoints - n, CoordModeOrigin ); if( bClose )
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits