basic/source/runtime/methods.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit ccfeef1a48f5add83e443afd6664f40df59381b4
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Wed Nov 17 22:19:58 2021 +0100
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Thu Nov 18 10:01:11 2021 +0100

    tdf#145725: document about VBASupport+RGB (no bug here)
    
    Change-Id: I1a90509b7e5481bcf811f19889688c767c32e46b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125430
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index b98615cb66a6..7dfde6184b0d 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -4072,6 +4072,11 @@ void SbRtl_RGB(StarBASIC *, SbxArray & rPar, bool)
 
     SbiInstance* pInst = GetSbData()->pInst;
     bool bCompatibility = ( pInst && pInst->IsCompatibility() );
+    // See discussion in tdf#145725, here's the quotation from a link 
indicated in the bugtracker
+    // which explains why we need to manage RGB differently according to VB 
compatibility
+    // "In other words, the individual color components are stored in the 
opposite order one would expect.
+    //  VB stores the red color component in the low-order byte of the long 
integer's low-order word,
+    //  the green color in the high-order byte of the low-order word, and the 
blue color in the low-order byte of the high-order word"
     if( bCompatibility )
     {
         nRGB   = (nBlue << 16) | (nGreen << 8) | nRed;

Reply via email to