summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-11-17 22:19:58 +0100
committerJulien Nabet <serval2412@yahoo.fr>2021-11-18 10:01:11 +0100
commitccfeef1a48f5add83e443afd6664f40df59381b4 (patch)
tree76abacc5a6ea52ea4d28e64c4aa7ca3f0f91712a /basic
parentaf9ae2d6a968656208528144e5f01b17b383126c (diff)
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 <serval2412@yahoo.fr>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/methods.cxx5
1 files changed, 5 insertions, 0 deletions
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;