Hi,
Please find the latest report on new defect(s) introduced to LibreOffice found
with Coverity Scan.
41 new defect(s) introduced to LibreOffice found with Coverity Scan.
4 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 20 of 41 defect(s)
** CID 1665285: Integer handling issues (NEGATIVE_RETURNS)
_____________________________________________________________________________________________
*** CID 1665285: Integer handling issues (NEGATIVE_RETURNS)
/sc/source/ui/unoobj/docuno.cxx: 1818 in
ScModelObj::FillRenderMarkData(const com::sun::star::uno::Any &, const
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> &,
ScMarkData &, ScPrintSelectionStatus &, rtl::OUString &, bool &) const()
1812 SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape(
xShape );
1813 if( pSdrObj && pDocShell )
1814 {
1815 ScDocument& rDoc = pDocShell->GetDocument();
1816 tools::Rectangle aObjRect =
pSdrObj->GetCurrentBoundRect();
1817 SCTAB nCurrentTab = ScDocShell::GetCurTab();
>>> CID 1665285: Integer handling issues (NEGATIVE_RETURNS)
>>> "nCurrentTab" is passed to a parameter that cannot be negative.
1818 ScRange aRange = rDoc.GetRange( nCurrentTab, aObjRect
);
1819 rMark.SetMarkArea( aRange );
1820
1821 if( rMark.IsMarked() && !rMark.IsMultiMarked() )
1822 {
1823 rStatus.SetMode(
ScPrintSelectionMode::RangeExclusivelyOleAndDrawObjects );
** CID 1665284: Integer handling issues (NEGATIVE_RETURNS)
_____________________________________________________________________________________________
*** CID 1665284: Integer handling issues (NEGATIVE_RETURNS)
/sc/source/ui/view/gridwin.cxx: 3392 in ScGridWindow::Command(const
CommandEvent &)()
3386 {
3387 // Loop until we get the first non-empty cell in the
row.
3388 aPos.IncCol(-1);
3389 if (aPos.Col() < 0)
3390 break;
3391
>>> CID 1665284: Integer handling issues (NEGATIVE_RETURNS)
>>> "aPos.nTab" is passed to a parameter that cannot be negative.
3392 aSpellCheckCell.assign(rDoc, aPos);
3393 }
3394
3395 if (aPos.Col() >= 0 && (aSpellCheckCell.getType() ==
CELLTYPE_STRING || aSpellCheckCell.getType() == CELLTYPE_EDIT))
3396 nColSpellError = aPos.Col();
3397
** CID 1665283: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/oox/source/drawingml/chart/stylemodel.cxx: 46 in
oox::drawingml::chart::StyleEntryModel::toStyleEntry(oox::core::XmlFilterBase
&)()
_____________________________________________________________________________________________
*** CID 1665283: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/oox/source/drawingml/chart/stylemodel.cxx: 46 in
oox::drawingml::chart::StyleEntryModel::toStyleEntry(oox::core::XmlFilterBase
&)()
40 {
41 mxBodyPr->pushTextDistances(Size(0, 0));
42 aBodyMap.reset(&mxBodyPr->maPropertyMap);
43 }
44
45 return model::StyleEntry(mxLnRef, mfLineWidthScale, mxFillRef,
mxEffectRef, mxFontRef,
>>> CID 1665283: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aBodyMap" is passed-by-value as parameter to
>>> "std::shared_ptr<oox::PropertyMap>::shared_ptr(std::shared_ptr<oox::PropertyMap>
>>> const &) /*explicit =default*/", when it could be moved instead.
46 mxShapeProp, aCharMap, aBodyMap);
47 }
48
49 } // namespace oox::drawingml::chart
50
** CID 1665282: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
_____________________________________________________________________________________________
*** CID 1665282: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/vcl/source/filter/svm/SvmReader.cxx: 975 in
SvmReader::ClipRegionHandler()()
969 VersionCompatRead aCompat(mrStream);
970 vcl::Region aRegion;
971 ReadRegion(mrStream, aRegion);
972 bool aClip(false);
973 mrStream.ReadCharAsBool(aClip);
974
>>> CID 1665282: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aRegion" is passed-by-value as parameter to
>>> "vcl::Region::Region(vcl::Region const &)", when it could be moved instead.
975 return new MetaClipRegionAction(aRegion, aClip);
976 }
977
978 rtl::Reference<MetaAction> SvmReader::ISectRectClipRegionHandler()
979 {
980 VersionCompatRead aCompat(mrStream);
** CID 1665281: Integer handling issues (NEGATIVE_RETURNS)
_____________________________________________________________________________________________
*** CID 1665281: Integer handling issues (NEGATIVE_RETURNS)
/sc/source/ui/view/tabvwshf.cxx: 917 in
ScTabViewShell::DoInsertTableFromDialog(SfxRequest &, const
VclPtr<AbstractScInsertTableDlg> &)()
911 }
912 bool bLink = pDlg->GetTablesAsLink();
913 if (!nTabs.empty())
914 {
915 if(pDlg->IsTableBefore())
916 {
>>> CID 1665281: Integer handling issues (NEGATIVE_RETURNS)
>>> "nTabNr" is passed to a parameter that cannot be negative.
917 ImportTables( pDlg->GetDocShellTables(), nTabs.size(),
nTabs.data(),
918 bLink,nTabNr );
919 }
920 else
921 {
922 SCTAB nTabAfter = nTabNr+1;
** CID 1665280: Integer handling issues (NEGATIVE_RETURNS)
_____________________________________________________________________________________________
*** CID 1665280: Integer handling issues (NEGATIVE_RETURNS)
/sc/source/ui/view/gridwin.cxx: 4605 in
ScGridWindow::DropTransferObj(ScTransferObj *, short, int, const Point &,
signed char)()
4599 bDone = true;
4600 }
4601 }
4602 else // move/copy block
4603 {
4604 OUString aChartName;
>>> CID 1665280: Integer handling issues (NEGATIVE_RETURNS)
>>> "nThisTab" is passed to a parameter that cannot be negative.
4605 if (rThisDoc.HasChartAtPoint( nThisTab, rLogicPos,
aChartName ))
4606 {
4607 OUString aRangeName(aSource.Format(rThisDoc,
ScRefFlags::RANGE_ABS_3D,
4608 rThisDoc.GetAddressConvention()));
4609 SfxStringItem aNameItem( SID_CHART_NAME, aChartName );
4610 SfxStringItem aRangeItem( SID_CHART_SOURCE, aRangeName
);
** CID 1665279: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/include/docmodel/styles/ChartStyle.hxx: 64 in
model::StyleEntry::StyleEntry(std::shared_ptr<model::StyleColor>, double,
std::shared_ptr<model::StyleColor>, std::shared_ptr<model::StyleColor>,
std::shared_ptr<model::StyleColor>, std::shared_ptr<oox::drawingml::Shape>,
std::shared_ptr<oox::PropertyMap>, std::shared_ptr<oox::PropertyMap>)()
_____________________________________________________________________________________________
*** CID 1665279: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/include/docmodel/styles/ChartStyle.hxx: 64 in
model::StyleEntry::StyleEntry(std::shared_ptr<model::StyleColor>, double,
std::shared_ptr<model::StyleColor>, std::shared_ptr<model::StyleColor>,
std::shared_ptr<model::StyleColor>, std::shared_ptr<oox::drawingml::Shape>,
std::shared_ptr<oox::PropertyMap>, std::shared_ptr<oox::PropertyMap>)()
58 std::shared_ptr<oox::PropertyMap> aBodyProps)
59 : mxLnClr(aLnClr)
60 , mfLineWidthScale(fLineScale)
61 , mxFillClr(aFillClr)
62 , mxEffectClr(aEffectClr)
63 , mxFontClr(aFontClr)
>>> CID 1665279: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aShape" is passed-by-value as parameter to
>>> "std::shared_ptr<oox::drawingml::Shape>::shared_ptr(std::shared_ptr<oox::drawingml::Shape>
>>> const &) /*explicit =default*/", when it could be moved instead.
64 , mxShapePr(aShape)
65 , mrTextCharacterPr(aCharProps)
66 , mxTextBodyPr(aBodyProps)
67 {
68 }
69 };
** CID 1665278: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
_____________________________________________________________________________________________
*** CID 1665278: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/vcl/source/rendercontext/drawmode.cxx: 273 in
vcl::drawmode::GetBitmap(const Bitmap &, DrawModeFlags)()
267 BitmapFilter::Filter(aMask, BitmapMonochromeFilter(129));
268 aMask.Invert(); // convert to alpha
269 aBmp = Bitmap(aColorBmp, aMask);
270 }
271 else
272 {
>>> CID 1665278: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aColorBmp" is copied in call to copy assignment for class "Bitmap",
>>> when it could be moved instead.
273 aBmp = aColorBmp;
274 }
275 }
276
277 if (nDrawMode & DrawModeFlags::GrayBitmap && !aBmp.IsEmpty())
278 aBmp.Convert(BmpConversion::N8BitGreys);
** CID 1665277: Integer handling issues (NEGATIVE_RETURNS)
_____________________________________________________________________________________________
*** CID 1665277: Integer handling issues (NEGATIVE_RETURNS)
/sc/source/ui/view/tabview.cxx: 2771 in
<unnamed>::ScRangeProvider::calculateDimensionBounds(long, long, bool, int &,
int &, long &, long &, int, ScViewData &)()
2765 ScPositionHelper& rPosHelper = bColumns ?
rViewData.GetLOKWidthHelper() :
2766 rViewData.GetLOKHeightHelper();
2767 const auto& rStartNearest =
rPosHelper.getNearestByPosition(nStartPos);
2768 const auto& rEndNearest =
rPosHelper.getNearestByPosition(nEndPos);
2769
2770 ScBoundsProvider aBoundsProvider(rViewData,
rViewData.CurrentTabForData(), bColumns);
>>> CID 1665277: Integer handling issues (NEGATIVE_RETURNS)
>>> "aBoundsProvider.nTab" is passed to a parameter that cannot be negative.
2771 aBoundsProvider.Compute(rStartNearest, rEndNearest, nStartPos,
nEndPos);
2772 aBoundsProvider.EnlargeBy(nEnlarge);
2773 if (bColumns)
2774 {
2775 SCCOL nStartCol = -1, nEndCol = -1;
2776 aBoundsProvider.GetStartIndexAndPosition(nStartCol,
rBoundStart);
** CID 1665276: (COPY_INSTEAD_OF_MOVE)
/vcl/source/bitmap/bitmap.cxx: 158 in
createBitmapFromColorAndAlpha(const Bitmap &, const Bitmap &)()
/vcl/source/bitmap/bitmap.cxx: 156 in
createBitmapFromColorAndAlpha(const Bitmap &, const Bitmap &)()
_____________________________________________________________________________________________
*** CID 1665276: (COPY_INSTEAD_OF_MOVE)
/vcl/source/bitmap/bitmap.cxx: 158 in
createBitmapFromColorAndAlpha(const Bitmap &, const Bitmap &)()
152 const bool bSuccess = xSalBmp->Create(aSize,
vcl::PixelFormat::N32_BPP, aPalEmpty);
153 if (!bSuccess)
154 {
155 SAL_WARN("vcl", "Bitmap::Bitmap(): could not create image");
156 return Bitmap(xSalBmp);
157 }
>>> CID 1665276: (COPY_INSTEAD_OF_MOVE)
>>> "xSalBmp" is passed-by-value as parameter to
>>> "std::shared_ptr<SalBitmap>::shared_ptr(std::shared_ptr<SalBitmap> const &)
>>> /*explicit =default*/", when it could be moved instead.
158 Bitmap aRetBmp(xSalBmp);
159 BitmapScopedReadAccess pReadColorAcc(rColorBitmap);
160 BitmapScopedReadAccess pReadAlphaAcc(rAlphaBitmap);
161 BitmapScopedWriteAccess pWriteAcc(aRetBmp);
162 auto nHeight = pReadColorAcc->Height();
163 auto nWidth = pReadColorAcc->Width();
/vcl/source/bitmap/bitmap.cxx: 156 in
createBitmapFromColorAndAlpha(const Bitmap &, const Bitmap &)()
150 static const BitmapPalette aPalEmpty;
151 std::shared_ptr<SalBitmap> xSalBmp =
ImplGetSVData()->mpDefInst->CreateSalBitmap();
152 const bool bSuccess = xSalBmp->Create(aSize,
vcl::PixelFormat::N32_BPP, aPalEmpty);
153 if (!bSuccess)
154 {
155 SAL_WARN("vcl", "Bitmap::Bitmap(): could not create image");
>>> CID 1665276: (COPY_INSTEAD_OF_MOVE)
>>> "xSalBmp" is passed-by-value as parameter to
>>> "std::shared_ptr<SalBitmap>::shared_ptr(std::shared_ptr<SalBitmap> const &)
>>> /*explicit =default*/", when it could be moved instead.
156 return Bitmap(xSalBmp);
157 }
158 Bitmap aRetBmp(xSalBmp);
159 BitmapScopedReadAccess pReadColorAcc(rColorBitmap);
160 BitmapScopedReadAccess pReadAlphaAcc(rAlphaBitmap);
161 BitmapScopedWriteAccess pWriteAcc(aRetBmp);
** CID 1665275: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
_____________________________________________________________________________________________
*** CID 1665275: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/vcl/source/filter/svm/SvmReader.cxx: 1181 in
SvmReader::EPSHandler()()
1175 aSerializer.readPoint(aPoint);
1176 Size aSize;
1177 aSerializer.readSize(aSize);
1178 GDIMetaFile aSubst;
1179 Read(aSubst);
1180
>>> CID 1665275: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aGfxLink" is passed-by-value as parameter to "GfxLink::GfxLink(GfxLink
>>> const &) /*implicit =default*/", when it could be moved instead.
1181 return new MetaEPSAction(aPoint, aSize, aGfxLink, aSubst);
1182 }
1183
1184 rtl::Reference<MetaAction> SvmReader::RefPointHandler()
1185 {
1186 VersionCompatRead aCompat(mrStream);
** CID 1665274: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/include/docmodel/styles/ChartStyle.hxx: 63 in
model::StyleEntry::StyleEntry(std::shared_ptr<model::StyleColor>, double,
std::shared_ptr<model::StyleColor>, std::shared_ptr<model::StyleColor>,
std::shared_ptr<model::StyleColor>, std::shared_ptr<oox::drawingml::Shape>,
std::shared_ptr<oox::PropertyMap>, std::shared_ptr<oox::PropertyMap>)()
_____________________________________________________________________________________________
*** CID 1665274: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/include/docmodel/styles/ChartStyle.hxx: 63 in
model::StyleEntry::StyleEntry(std::shared_ptr<model::StyleColor>, double,
std::shared_ptr<model::StyleColor>, std::shared_ptr<model::StyleColor>,
std::shared_ptr<model::StyleColor>, std::shared_ptr<oox::drawingml::Shape>,
std::shared_ptr<oox::PropertyMap>, std::shared_ptr<oox::PropertyMap>)()
57 std::shared_ptr<oox::PropertyMap> aCharProps,
58 std::shared_ptr<oox::PropertyMap> aBodyProps)
59 : mxLnClr(aLnClr)
60 , mfLineWidthScale(fLineScale)
61 , mxFillClr(aFillClr)
62 , mxEffectClr(aEffectClr)
>>> CID 1665274: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aFontClr" is passed-by-value as parameter to
>>> "std::shared_ptr<model::StyleColor>::shared_ptr(std::shared_ptr<model::StyleColor>
>>> const &) /*explicit =default*/", when it could be moved instead.
63 , mxFontClr(aFontClr)
64 , mxShapePr(aShape)
65 , mrTextCharacterPr(aCharProps)
66 , mxTextBodyPr(aBodyProps)
67 {
68 }
** CID 1665273: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/include/docmodel/styles/ChartStyle.hxx: 65 in
model::StyleEntry::StyleEntry(std::shared_ptr<model::StyleColor>, double,
std::shared_ptr<model::StyleColor>, std::shared_ptr<model::StyleColor>,
std::shared_ptr<model::StyleColor>, std::shared_ptr<oox::drawingml::Shape>,
std::shared_ptr<oox::PropertyMap>, std::shared_ptr<oox::PropertyMap>)()
_____________________________________________________________________________________________
*** CID 1665273: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/include/docmodel/styles/ChartStyle.hxx: 65 in
model::StyleEntry::StyleEntry(std::shared_ptr<model::StyleColor>, double,
std::shared_ptr<model::StyleColor>, std::shared_ptr<model::StyleColor>,
std::shared_ptr<model::StyleColor>, std::shared_ptr<oox::drawingml::Shape>,
std::shared_ptr<oox::PropertyMap>, std::shared_ptr<oox::PropertyMap>)()
59 : mxLnClr(aLnClr)
60 , mfLineWidthScale(fLineScale)
61 , mxFillClr(aFillClr)
62 , mxEffectClr(aEffectClr)
63 , mxFontClr(aFontClr)
64 , mxShapePr(aShape)
>>> CID 1665273: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aCharProps" is passed-by-value as parameter to
>>> "std::shared_ptr<oox::PropertyMap>::shared_ptr(std::shared_ptr<oox::PropertyMap>
>>> const &) /*explicit =default*/", when it could be moved instead.
65 , mrTextCharacterPr(aCharProps)
66 , mxTextBodyPr(aBodyProps)
67 {
68 }
69 };
70
** CID 1665272: Uninitialized variables (UNINIT)
_____________________________________________________________________________________________
*** CID 1665272: Uninitialized variables (UNINIT)
/docmodel/source/uno/UnoChartStyle.cxx: 31 in
model::style::getFromXChartStyle(const
com::sun::star::uno::Reference<com::sun::star::chart2::XChartStyle> &)()
25 model::StyleSet aChartStyle;
26 UnoChartStyle* pUnoChartStyle =
static_cast<UnoChartStyle*>(rxStyle.get());
27 if (pUnoChartStyle)
28 {
29 aChartStyle = pUnoChartStyle->getChartStyle();
30 }
>>> CID 1665272: Uninitialized variables (UNINIT)
>>> Using uninitialized value "aChartStyle.mnId" when calling "StyleSet".
31 return aChartStyle;
32 }
33
34 } // end model::style
35
** CID 1665271: (NEGATIVE_RETURNS)
_____________________________________________________________________________________________
*** CID 1665271: (NEGATIVE_RETURNS)
/sc/source/ui/view/viewfunc.cxx: 1625 in
ScViewFunc::SetStyleSheetToMarked(const SfxStyleSheet *)()
1619 SCROW nRow = rViewData.GetCurY();
1620 SCTAB nTab = rViewData.CurrentTabForData();
1621
1622 if ( bRecord )
1623 {
1624 ScDocumentUniquePtr pUndoDoc(new ScDocument(
SCDOCMODE_UNDO ));
>>> CID 1665271: (NEGATIVE_RETURNS)
>>> "nTab" is passed to a parameter that cannot be negative.
1625 pUndoDoc->InitUndo( rDoc, nTab, nTab );
1626 for (const auto& rTab : aFuncMark)
1627 if (rTab != nTab)
1628 pUndoDoc->AddUndoTab( rTab, rTab );
1629
1630 ScRange aCopyRange( nCol, nRow, 0, nCol, nRow, nTabCount-1
);
/sc/source/ui/view/viewfunc.cxx: 1593 in
ScViewFunc::SetStyleSheetToMarked(const SfxStyleSheet *)()
1587 const ScRange& aMarkRange = aFuncMark.GetMultiMarkArea();
1588
1589 if ( bRecord )
1590 {
1591 SCTAB nTab = rViewData.CurrentTabForData();
1592 ScDocumentUniquePtr pUndoDoc(new ScDocument(
SCDOCMODE_UNDO ));
>>> CID 1665271: (NEGATIVE_RETURNS)
>>> "nTab" is passed to a parameter that cannot be negative.
1593 pUndoDoc->InitUndo( rDoc, nTab, nTab );
1594 for (const auto& rTab : aFuncMark)
1595 if (rTab != nTab)
1596 pUndoDoc->AddUndoTab( rTab, rTab );
1597
1598 ScRange aCopyRange = aMarkRange;
** CID 1665270: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/include/docmodel/styles/ChartStyle.hxx: 59 in
model::StyleEntry::StyleEntry(std::shared_ptr<model::StyleColor>, double,
std::shared_ptr<model::StyleColor>, std::shared_ptr<model::StyleColor>,
std::shared_ptr<model::StyleColor>, std::shared_ptr<oox::drawingml::Shape>,
std::shared_ptr<oox::PropertyMap>, std::shared_ptr<oox::PropertyMap>)()
_____________________________________________________________________________________________
*** CID 1665270: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/include/docmodel/styles/ChartStyle.hxx: 59 in
model::StyleEntry::StyleEntry(std::shared_ptr<model::StyleColor>, double,
std::shared_ptr<model::StyleColor>, std::shared_ptr<model::StyleColor>,
std::shared_ptr<model::StyleColor>, std::shared_ptr<oox::drawingml::Shape>,
std::shared_ptr<oox::PropertyMap>, std::shared_ptr<oox::PropertyMap>)()
53
54 StyleEntry(std::shared_ptr<StyleColor> aLnClr, double fLineScale,
55 std::shared_ptr<StyleColor> aFillClr,
std::shared_ptr<StyleColor> aEffectClr,
56 std::shared_ptr<StyleColor> aFontClr,
std::shared_ptr<oox::drawingml::Shape> aShape,
57 std::shared_ptr<oox::PropertyMap> aCharProps,
58 std::shared_ptr<oox::PropertyMap> aBodyProps)
>>> CID 1665270: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aLnClr" is passed-by-value as parameter to
>>> "std::shared_ptr<model::StyleColor>::shared_ptr(std::shared_ptr<model::StyleColor>
>>> const &) /*explicit =default*/", when it could be moved instead.
59 : mxLnClr(aLnClr)
60 , mfLineWidthScale(fLineScale)
61 , mxFillClr(aFillClr)
62 , mxEffectClr(aEffectClr)
63 , mxFontClr(aFontClr)
64 , mxShapePr(aShape)
** CID 1665269: Integer handling issues (NEGATIVE_RETURNS)
_____________________________________________________________________________________________
*** CID 1665269: Integer handling issues (NEGATIVE_RETURNS)
/sc/source/ui/view/viewfun4.cxx: 650 in ScViewFunc::PasteFile(const
Point &, const rtl::OUString &, bool)()
644 }
645 }
646
647 if (bLink) // for bLink everything, which is
not graphics, as URL
648 {
649 tools::Rectangle aRect( rPos, Size(0,0) );
>>> CID 1665269: Integer handling issues (NEGATIVE_RETURNS)
>>> "this->GetViewData()->CurrentTabForData()" is passed to a parameter
>>> that cannot be negative.
650 ScRange aRange = GetViewData().GetDocument().
651 GetRange(
GetViewData().CurrentTabForData(), aRect );
652 SCCOL nPosX = aRange.aStart.Col();
653 SCROW nPosY = aRange.aStart.Row();
654
655 InsertBookmark( aStrURL, aStrURL, nPosX, nPosY );
** CID 1665268: Integer handling issues (NEGATIVE_RETURNS)
_____________________________________________________________________________________________
*** CID 1665268: Integer handling issues (NEGATIVE_RETURNS)
/sc/source/ui/view/viewfun2.cxx: 2748 in
ScViewFunc::InsertTableLink(const rtl::OUString &, const rtl::OUString &, const
rtl::OUString &, std::basic_string_view<char16_t, std::char_traits<char16_t>>)()
2742 if ( aTemp == rTabName )
2743 nTab = i;
2744 }
2745 }
2746
2747 if ( nTab <= MAXTAB )
>>> CID 1665268: Integer handling issues (NEGATIVE_RETURNS)
>>> "this->GetViewData()->CurrentTabForData()" is passed to a parameter
>>> that cannot be negative.
2748 ImportTables( pSrcSh, 1, &nTab, true,
2749 GetViewData().CurrentTabForData() );
2750 }
2751
2752 // Copy/link tables from another document
2753
** CID 1665267: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/include/docmodel/styles/ChartStyle.hxx: 66 in
model::StyleEntry::StyleEntry(std::shared_ptr<model::StyleColor>, double,
std::shared_ptr<model::StyleColor>, std::shared_ptr<model::StyleColor>,
std::shared_ptr<model::StyleColor>, std::shared_ptr<oox::drawingml::Shape>,
std::shared_ptr<oox::PropertyMap>, std::shared_ptr<oox::PropertyMap>)()
_____________________________________________________________________________________________
*** CID 1665267: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/include/docmodel/styles/ChartStyle.hxx: 66 in
model::StyleEntry::StyleEntry(std::shared_ptr<model::StyleColor>, double,
std::shared_ptr<model::StyleColor>, std::shared_ptr<model::StyleColor>,
std::shared_ptr<model::StyleColor>, std::shared_ptr<oox::drawingml::Shape>,
std::shared_ptr<oox::PropertyMap>, std::shared_ptr<oox::PropertyMap>)()
60 , mfLineWidthScale(fLineScale)
61 , mxFillClr(aFillClr)
62 , mxEffectClr(aEffectClr)
63 , mxFontClr(aFontClr)
64 , mxShapePr(aShape)
65 , mrTextCharacterPr(aCharProps)
>>> CID 1665267: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aBodyProps" is passed-by-value as parameter to
>>> "std::shared_ptr<oox::PropertyMap>::shared_ptr(std::shared_ptr<oox::PropertyMap>
>>> const &) /*explicit =default*/", when it could be moved instead.
66 , mxTextBodyPr(aBodyProps)
67 {
68 }
69 };
70
71 struct DOCMODEL_DLLPUBLIC StyleSet
** CID 1665266: Integer handling issues (NEGATIVE_RETURNS)
_____________________________________________________________________________________________
*** CID 1665266: Integer handling issues (NEGATIVE_RETURNS)
/sc/source/ui/dbgui/tpsort.cxx: 331 in
ScTabPageSortFields::FillFieldLists(unsigned short)()
325 nFieldArr.clear();
326 nFieldArr.push_back(0);
327
328 if ( aSortData.bByRow )
329 {
330 OUString aFieldName;
>>> CID 1665266: Integer handling issues (NEGATIVE_RETURNS)
>>> "nTab" is passed to a parameter that cannot be negative.
331 SCCOL nMaxCol = rDoc.ClampToAllocatedColumns(nTab,
aSortData.nCol2);
332 SCCOL col;
333
334 for ( col=nFirstSortCol; col<=nMaxCol &&
i<SC_MAXFIELDS(rDoc.GetSheetLimits()); col++ )
335 {
336 aFieldName = rDoc.GetString(col, nFirstSortRow, nTab);
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit,
https://scan.coverity.com/projects/libreoffice?tab=overview