[Libreoffice] Warning in basic/source/runtime/runtime.cxx

Julien Nabet serval2412 at yahoo.fr
Sun May 29 05:47:31 PDT 2011


Hello,

Since the last merging, I've got this :
Compiling: basic/source/runtime/runtime.cxx
cc1plus: warnings being treated as errors
/home/maryline/compile-libreoffice/libo/clone/libs-core/basic/source/runtime/runtime.cxx: 
In member function 'SbiForStack* 
SbiRuntime::FindForStackItemForCollection(BasicCollection*)':
/home/maryline/compile-libreoffice/libo/clone/libs-core/basic/source/runtime/runtime.cxx:1247:75: 
error: operation on 'pCollection' may be undefined
dmake:  Error code 1, while making '../../unxlngi6/slo/runtime

Is this diff patch would be ok ?

diff --git a/basic/source/runtime/runtime.cxx 
b/basic/source/runtime/runtime.cxx
index 308550a..76b7daf 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1244,7 +1244,7 @@ SbiForStack* 
SbiRuntime::FindForStackItemForCollection( class BasicCollection* p
      {
          SbxVariable* pVar = p->refEnd.Is() ? (SbxVariable*)p->refEnd : 
NULL;
          if( p->eForType == FOR_EACH_COLLECTION && pVar != NULL &&
-            (pCollection = PTR_CAST(BasicCollection,pVar)) == pCollection )
+            (pCollection = PTR_CAST(BasicCollection,pVar)) != NULL)
          {
              pRet = p;
              break;

I think pCollection must be tested against NULL but perhaps it needs 
something else.

Of course, if you're ok, I can commit and push on master.

Julien.


More information about the LibreOffice mailing list