Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi julien2412,

On Wednesday, 2013-02-13 06:24:20 -0800, julien2412 wrote:

Cppcheck reported this:
sc/source/ui/view/tabview2.cxx
970   unreadVariable  style   Variable 'bMark' is assigned a value that is never
used.    951 void ScTabView::PaintBlock( bool bReset )
    952 {
    953     ScMarkData& rMark = aViewData.GetMarkData();
    954     SCTAB nTab = aViewData.GetTabNo();
    955     bool bMark = rMark.IsMarked();
    956     bool bMulti = rMark.IsMultiMarked();
    957     if (bMark || bMulti)
    958     {
    959         ScRange aMarkRange;
    960         HideAllCursors();
    961         if (bMulti)
    962         {
    963             bool bFlag = rMark.GetMarkingFlag();
    964             rMark.SetMarking(false);
    965             rMark.MarkToMulti();
    966             rMark.GetMultiMarkArea(aMarkRange);
    967             rMark.MarkToSimple();
    968             rMark.SetMarking(bFlag);
    969 
    970             bMark = rMark.IsMarked();

See
http://opengrok.libreoffice.org/xref/core/sc/source/ui/view/tabview2.cxx#950

Is line 970 can be removed or is something lacking?

It can be removed. However, I suggest to also remove line 955 and change
line 957

-    if (bMark || bMulti)
+    if (rMark.IsMarked() || bMulti)

So no one accidentally assumes bMark would be valid after that scope.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
New GnuPG key 0x65632D3A : 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Old GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack

Attachment: pgp_pUNgnfpL6.pgp
Description: PGP signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.