core/dbaccess/source/ui/browser/sbagrid.cxx:1265]: (style) Same expression on both sides of '||'. Source code is if ((nCol == BROWSER_INVALIDID) || (nRow >= nCorrectRowCount) || nCol == 0 || nCol == BROWSER_INVALIDID ) Maybe better code if ((nCol == BROWSER_INVALIDID) || (nRow >= nCorrectRowCount) || nCol == 0 || nRow == BROWSER_INVALIDID )
Not being a coder, I have no idea, but I can refer to the experts...
@Lionel, Julien : thoughts ?
I don't know how this part works, it could also be: if ((nCol == BROWSER_INVALIDID) || (nRow >= nCorrectRowCount) || nCol == 0 )
This comes from my commit commit 2d73671e930a0099c26e268a2be417bfcdd7fc91 Author: Lionel Elie Mamane <lionel@mamane.lu> Date: Thu Oct 4 19:33:14 2018 +0200 clean up column pos vs column id everywhere GetColumnAtXPosPixel is used; see also tdf#119564 fix Change-Id: Ibab57c7305bf4dce9ea9f3df66e6214b0d1585b2 You'll notice that around line 1240-1245, I changed: nCol = GetColumnAtXPosPixel(rEvt.maPosPixel.X()); to nCol = GetColumnId(GetColumnAtXPosPixel(rEvt.maPosPixel.X())); So, the discussed line was created by search/replace of "GetColumnId(nCol)" by "nCol" :) Just remove the last (duplicate) || clause. The whole thing is safe because GetColumnId(BROWSER_INVALIDID) == BROWSER_INVALIDID (see svtools/source/brwbox/brwbox2.cxx around line 375), so for any x: x == BROWSER_INVALIDID implies GetColumnId(x) == BROWSER_INVALIDID and in particular x == BROWSER_INVALIDID || GetColumnId(x) == BROWSER_INVALIDID is equivalent to GetColumnId(x) == BROWSER_INVALIDID Here, x is the old value of nCol (before my patch), namely GetColumnAtXPosPixel(rEvt.maPosPixel.X())
https://gerrit.libreoffice.org/#/c/62206/
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=9deabca91c8fd899fd162f4a16a1061793e8a10e tdf#120773: simplify condition in sbagrid.cxx:1265 It will be available in 6.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.