Hi Eric,
Just a minor nitpick though. If a function returns a bool and a
variable caches this result like here
+ if(isAppleScrollBarVariantDoubleMax() == true )
+ ImplGetSVData()->maNWFData.mbIsScrollbarDoubleMax = true;
+ else
+ ImplGetSVData()->maNWFData.mbIsScrollbarDoubleMax = false;
then I prefer a direct assignment.
ouch, you are right :-)
I have modified that, and here is a new patch: http://
eric.bachard.free.fr/mac/aquavcl/patches/aquavcl03_august2007/
scrollbar/scrollbar_new3.diff
I am not sure if you really corrected this passage the way Herbert
meant. I guess he meant something like
ImplGetSVData()->maNWFData.mbIsScrollbarDoubleMax =
isAppleScrollBarVariantDoubleMax();
in one line instead of 4 lines. (Herbert, correct me if meant
something different!)
One other thing I noticed while looking at the following:
+static void getAppleScrollBarVariant(void)
+{
+ CFStringRef ScrollBarVariant;
+ ScrollBarVariant = ( (CFStringRef)CFPreferencesCopyAppValue(CFSTR
("AppleScrollBarVariant"), kCFPreferencesCurrentApplication) );
+ if ( ScrollBarVariant )
+ {
+ if ( !CFStringCompare(ScrollBarVariant, CFSTR("DoubleMax"),
kCFCompareCaseInsensitive) )
+ ImplGetSVData()->maNWFData.mbIsScrollbarDoubleMax = true;
+ else
+ ImplGetSVData()->maNWFData.mbIsScrollbarDoubleMax = false;
+ CFRelease( ScrollBarVariant );
+ }
+}
If you allocate a CFStringRef with CFSTR(str), then you have to also
release it. In the code snippet above you create two memory leaks. I
hope this function is not getting called very often :)
Kind regards,
Florian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]