[Libreoffice] [PATCH] need review: fix for #116920

Clio menenem at bk.ru
Mon Feb 14 09:12:26 PST 2011


Please, have a look at this patch. On my Linux system it seems to work 
fine. Here is the issue it could fix: 
http://qa.openoffice.org/issues/show_bug.cgi?id=116920 - "Sometimes RND 
returns 1 (one)" .

Here is how the code should look after the patch is applied:

RTLFUNC(Rnd)
{
     (void)pBasic;
     (void)bWrite;

     if ( rPar.Count() > 2 )
         StarBASIC::Error( SbERR_BAD_ARGUMENT );
     else
     {
         double nRand = (double)rand();
         nRand = ( nRand / ((double)RAND_MAX + 1.0));
         rPar.Get(0)->PutDouble( nRand );
     }
}

(Changes if they are accepted are LGPLv3/MPL)


More information about the LibreOffice mailing list