New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Mon Apr 29 19:31:52 UTC 2024


Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.

4 new defect(s) introduced to LibreOffice found with Coverity Scan.


New defect(s) Reported-by: Coverity Scan
Showing 4 of 4 defect(s)


** CID 1596697:    (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1596697:    (FORWARD_NULL)
/sc/source/ui/miscdlgs/inscldlg.cxx: 99 in ScInsertCellDlg::ScInsertCellDlg(weld::Window *, bool)()
93                     break;
94             }
95         }
96     
97         // if some cells are selected, then disable the SpinButtons
98         m_xNumberOfCols->set_sensitive(bColCount && !pViewData->GetMarkData().IsMarked());
>>>     CID 1596697:    (FORWARD_NULL)
>>>     Passing null pointer "pViewData->GetMarkData()" to "IsMarked", which dereferences it.
99         m_xNumberOfRows->set_sensitive(bRowsCount && !pViewData->GetMarkData().IsMarked());
100     }
101     
102     ScInsertCellDlg::~ScInsertCellDlg() {}
103     
104     InsCellCmd ScInsertCellDlg::GetInsCellCmd() const
/sc/source/ui/miscdlgs/inscldlg.cxx: 98 in ScInsertCellDlg::ScInsertCellDlg(weld::Window *, bool)()
92                     bColCount = true;
93                     break;
94             }
95         }
96     
97         // if some cells are selected, then disable the SpinButtons
>>>     CID 1596697:    (FORWARD_NULL)
>>>     Passing null pointer "pViewData->GetMarkData()" to "IsMarked", which dereferences it.
98         m_xNumberOfCols->set_sensitive(bColCount && !pViewData->GetMarkData().IsMarked());
99         m_xNumberOfRows->set_sensitive(bRowsCount && !pViewData->GetMarkData().IsMarked());
100     }
101     
102     ScInsertCellDlg::~ScInsertCellDlg() {}
103     

** CID 1596696:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/slideshow/source/engine/shapes/drawshape.cxx: 1282 in slideshow::internal::DelayedGraphicLoader::DelayedGraphicLoader(std::shared_ptr<Graphic>)()


________________________________________________________________________________________________________
*** CID 1596696:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/slideshow/source/engine/shapes/drawshape.cxx: 1282 in slideshow::internal::DelayedGraphicLoader::DelayedGraphicLoader(std::shared_ptr<Graphic>)()
1276                 {
1277                     mpGraphicLoader.reset();
1278                 }
1279             }
1280     
1281             DelayedGraphicLoader::DelayedGraphicLoader(std::shared_ptr<Graphic> pGraphic)
>>>     CID 1596696:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "pGraphic" is copied in call to copy constructor "std::shared_ptr<Graphic>", when it could be moved instead.
1282                 : mpGraphic(pGraphic)
1283                 , mpVDevMask(DeviceFormat::WITHOUT_ALPHA)
1284             {
1285             }
1286     }
1287     

** CID 1596695:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/slideshow/source/engine/shapes/drawshape.cxx: 575 in slideshow::internal::DrawShape::create(const com::sun::star::uno::Reference<com::sun::star::drawing::XShape> &, const com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> &, double, std::shared_ptr<Graphic>, const slideshow::internal::SlideShowContext &)()


________________________________________________________________________________________________________
*** CID 1596695:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/slideshow/source/engine/shapes/drawshape.cxx: 575 in slideshow::internal::DrawShape::create(const com::sun::star::uno::Reference<com::sun::star::drawing::XShape> &, const com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> &, double, std::shared_ptr<Graphic>, const slideshow::internal::SlideShowContext &)()
569                 std::shared_ptr<Graphic>                    pGraphic,
570                 const SlideShowContext&                     rContext )
571             {
572                 DrawShapeSharedPtr pShape( new DrawShape(xShape,
573                                                          xContainingPage,
574                                                          nPrio,
>>>     CID 1596695:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "pGraphic" is passed-by-value as parameter to "slideshow::internal::DrawShape::DrawShape(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const &, com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage>, double, std::shared_ptr<Graphic>, slideshow::internal::SlideShowContext const &)" when it could be moved instead.
575                                                          pGraphic,
576                                                          rContext) );
577     
578                 if( pShape->hasIntrinsicAnimation() )
579                 {
580                     OSL_ASSERT( !pShape->maAnimationFrames.empty() );

** CID 1596694:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/slideshow/source/engine/shapes/shapeimporter.cxx: 323 in slideshow::internal::ShapeImporter::createShape(const com::sun::star::uno::Reference<com::sun::star::drawing::XShape> &, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> &, std::basic_string_view<char16_t, std::char_traits<char16_t>>) const()


________________________________________________________________________________________________________
*** CID 1596694:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/slideshow/source/engine/shapes/shapeimporter.cxx: 323 in slideshow::internal::ShapeImporter::createShape(const com::sun::star::uno::Reference<com::sun::star::drawing::XShape> &, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> &, std::basic_string_view<char16_t, std::char_traits<char16_t>>) const()
317                     xGraphicObject->GetPrefMapMode(),
318                     aGraphAttrs ) );
319     
320             return DrawShape::create( xCurrShape,
321                                       mxPage,
322                                       mnAscendingPrio,
>>>     CID 1596694:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "pGraphic" is passed-by-value as parameter to "create" when it could be moved instead.
323                                       pGraphic,
324                                       mrContext );
325         }
326         else
327         {
328             return DrawShape::create( xCurrShape,


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2BKADyCpvUKOL6EWmZljiu6VvXBlQRUbS683tC8265rGNPXqJ1ffcoLZCnTuJFQbNcTEkb4XaEQkzovKhJ5DB3c-3D77bR_A9M4dSy7guk8NP6DcfgslOyvJRzavztVIKj6nRqYjYpWom7SJFyX0y710bz0kUGtDgWUiSLhexOoupwx8VbiHI-2BiNCqLVfoJHpK6SLqK-2FbEzrhlsRbh8hBrZhvsgMOBmxmC4230iHgTyvFfaaQp2ydakkXuQTZ-2F2xakj94Ii6-2Fykuq7AWO1THifnjEPAC0eqq-2BFxT4y60nj-2FiG82cmizIXCQPh3FiaBUfdheyRHJJJo-3D



More information about the LibreOffice mailing list