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


On Thu, 2010-09-30 at 01:43 -0500, Norbert Thiebaud wrote:

     if(rSel.A() == rSel.B() &&
-        !rSel.A() || rSel.A() == nTextLen )
+       (!rSel.A() || rSel.A() == nTextLen ))
     {


Careful here now, 

Original is: 
if (rSel.A() == rSel.B() && !rSel.A() || rSel.A() == nTextLen)
by operator precedence this results in...
if ((rSel.A() == rSel.B() && !rSel.A()) || (rSel.A() == nTextLen))
i.e. && before ||
your patch makes it
if (rSel.A() == rSel.B() && (!rSel.A() || rSel.A() == nTextLen))
which changes the logic. Are we sure that's the intention here.


     sal_uInt16 nPos = (sal_uInt16)aControlList.GetPos(pEdit);
-    if(nPos && !pEdit->IsNextControl() ||
-        nPos < aControlList.Count() - 1 && pEdit->IsNextControl())
+    if((nPos && !pEdit->IsNextControl()) ||
+       (nPos < aControlList.Count() - 1 && pEdit->IsNextControl()))
     {

This looks good.

 {
     sal_uInt16 nPos = (sal_uInt16)aControlList.GetPos(pBtn);
-    if(nPos && !pBtn->IsNextControl() ||
-        nPos < aControlList.Count() - 1 && pBtn->IsNextControl())
+    if((nPos && !pBtn->IsNextControl()) ||
+       (nPos < aControlList.Count() - 1 && pBtn->IsNextControl()))

This looks good.

C.


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.