New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Thu Aug 8 17:05:22 UTC 2024


Hi,

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

2 new defect(s) introduced to LibreOffice found with Coverity Scan.
29 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

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


** CID 1616089:    (COPY_INSTEAD_OF_MOVE)
/sd/source/ui/func/fupage.cxx: 353 in sd::FuPage::ExecuteAsyncDialog(weld::Window *, const SfxRequest &)()
/sd/source/ui/func/fupage.cxx: 342 in sd::FuPage::ExecuteAsyncDialog(weld::Window *, const SfxRequest &)()


________________________________________________________________________________________________________
*** CID 1616089:    (COPY_INSTEAD_OF_MOVE)
/sd/source/ui/func/fupage.cxx: 353 in sd::FuPage::ExecuteAsyncDialog(weld::Window *, const SfxRequest &)()
347     
348             // create the dialog and start async execution
349             SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
350             VclPtr<SfxAbstractTabDialog> xDlg( pFact->CreateSdTabPageDialog(mpViewShell->GetFrameWeld(),
351                                                aMergedAttr.get(), mpDocSh, mbDisplayBackgroundTabPage, bIsImpressDoc) );
352             rtl::Reference<FuPage> xThis( this ); // avoid destruction within async processing
>>>     CID 1616089:    (COPY_INSTEAD_OF_MOVE)
>>>     "aNewAttr" is copied in call to copy constructor "std::shared_ptr<SfxItemSet>", when it could be moved instead.
353             xDlg->StartExecuteAsync([xDlg, xThis, pStyleSheet, aNewAttr, aMergedAttr](sal_Int32 nResult) {
354                 if (nResult == RET_OK && pStyleSheet) {
355                     SfxItemSet tempSet(*xDlg->GetOutputItemSet());
356                     xThis->ApplyItemSet(*pStyleSheet, aNewAttr, tempSet, aMergedAttr);
357                 }
358                 xDlg->disposeOnce();
/sd/source/ui/func/fupage.cxx: 342 in sd::FuPage::ExecuteAsyncDialog(weld::Window *, const SfxRequest &)()
336                 aMigrateSet.Put(XFillBitmapItem(u"background"_ustr, std::move(aGraphic)));
337                 SdrModel::MigrateItemSet( &aMigrateSet, &tempSet, *mpDoc );
338     
339                 tempSet.Put( XFillBmpStretchItem( true ));
340                 tempSet.Put( XFillBmpTileItem( false ));
341                 if( pStyleSheet ) {
>>>     CID 1616089:    (COPY_INSTEAD_OF_MOVE)
>>>     "aNewAttr" is passed-by-value as parameter to "ApplyItemSet" when it could be moved instead.
342                     ApplyItemSet(*pStyleSheet, aNewAttr, tempSet, aMergedAttr);
343                 }
344             }
345         } else {
346             bool bIsImpressDoc = mpDrawViewShell->GetDoc()->GetDocumentType() == DocumentType::Impress;
347     

** CID 1616088:    (COPY_INSTEAD_OF_MOVE)
/sd/source/ui/func/fupage.cxx: 342 in sd::FuPage::ExecuteAsyncDialog(weld::Window *, const SfxRequest &)()
/sd/source/ui/func/fupage.cxx: 353 in sd::FuPage::ExecuteAsyncDialog(weld::Window *, const SfxRequest &)()


________________________________________________________________________________________________________
*** CID 1616088:    (COPY_INSTEAD_OF_MOVE)
/sd/source/ui/func/fupage.cxx: 342 in sd::FuPage::ExecuteAsyncDialog(weld::Window *, const SfxRequest &)()
336                 aMigrateSet.Put(XFillBitmapItem(u"background"_ustr, std::move(aGraphic)));
337                 SdrModel::MigrateItemSet( &aMigrateSet, &tempSet, *mpDoc );
338     
339                 tempSet.Put( XFillBmpStretchItem( true ));
340                 tempSet.Put( XFillBmpTileItem( false ));
341                 if( pStyleSheet ) {
>>>     CID 1616088:    (COPY_INSTEAD_OF_MOVE)
>>>     "aMergedAttr" is passed-by-value as parameter to "ApplyItemSet" when it could be moved instead.
342                     ApplyItemSet(*pStyleSheet, aNewAttr, tempSet, aMergedAttr);
343                 }
344             }
345         } else {
346             bool bIsImpressDoc = mpDrawViewShell->GetDoc()->GetDocumentType() == DocumentType::Impress;
347     
/sd/source/ui/func/fupage.cxx: 353 in sd::FuPage::ExecuteAsyncDialog(weld::Window *, const SfxRequest &)()
347     
348             // create the dialog and start async execution
349             SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
350             VclPtr<SfxAbstractTabDialog> xDlg( pFact->CreateSdTabPageDialog(mpViewShell->GetFrameWeld(),
351                                                aMergedAttr.get(), mpDocSh, mbDisplayBackgroundTabPage, bIsImpressDoc) );
352             rtl::Reference<FuPage> xThis( this ); // avoid destruction within async processing
>>>     CID 1616088:    (COPY_INSTEAD_OF_MOVE)
>>>     "aMergedAttr" is copied in call to copy constructor "std::shared_ptr<SfxItemSet>", when it could be moved instead.
353             xDlg->StartExecuteAsync([xDlg, xThis, pStyleSheet, aNewAttr, aMergedAttr](sal_Int32 nResult) {
354                 if (nResult == RET_OK && pStyleSheet) {
355                     SfxItemSet tempSet(*xDlg->GetOutputItemSet());
356                     xThis->ApplyItemSet(*pStyleSheet, aNewAttr, tempSet, aMergedAttr);
357                 }
358                 xDlg->disposeOnce();


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2BKADyCpvUKOL6EWmZljiu6VvXBlQRUbS683tC8265rGNPXqJ1ffcoLZCnTuJFQbNcTEkb4XaEQkzovKhJ5DB3c-3DYY1P_A9M4dSy7guk8NP6DcfgslOyvJRzavztVIKj6nRqYjYpWom7SJFyX0y710bz0kUGtPBE8qILSUYU1lafYLJYo51fCJDhpJ8-2BXR7D9ZqbC0JvBU3F4B6r9x5suLQJTl1xAx19u4T4zXePPhn9sMMZPh2zvGn7agDjinIJhZvB23TFyjGBbmTCPH8v4hZoh4YMm6mQQ7MriUs8ca-2B5a9jxVIlrUXHS-2F05CqqZSwYO8AFBU-3D



More information about the LibreOffice mailing list