Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3814

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/14/3814/1

fix for fdo#51300

Hopefully a better choice for defaults will minimise the chance of a bad colour
combination for notetext and notebackground colours when one colour ( more than
likely the notetext colour ) is gleaned from some default ( e.g. like a system
 tooltip colour ). We change the choice from system helptext ( fg & bg ) colours
and use Libreoffice default font and default note background colours instead.
The rationale here being that even in the normal scenario it seems with modern
excel documents the note background colour is a 'real' colour and not an index
( therefore the colour selection from some predefined colour doesn't happen )
But the note text colour is generally a colour index ( therefore a colour is
selected from defaults ). In say gnome3 the default tooltip colour is now white
 and a really bad contrast to the normal background colour for a note. I changed
the code here to use the colours from libreoffice given that the default colours
more or less match Excel default colours ( which will be by far the most
frequently ) used combination

Change-Id: I2ae38a44e0cbf201beb3b7d18a89f5ebdd644f8c
---
M sc/source/filter/excel/xlstyle.cxx
1 file changed, 17 insertions(+), 3 deletions(-)



diff --git a/sc/source/filter/excel/xlstyle.cxx 
b/sc/source/filter/excel/xlstyle.cxx
index a6a39ed..e2b3f18 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -27,11 +27,11 @@
 #include <vcl/font.hxx>
 #include <sal/macros.h>
 #include <rtl/tencinfo.h>
+#include <svtools/colorcfg.hxx>
 #include <toolkit/unohlp.hxx>
 #include <editeng/svxfont.hxx>
 #include "global.hxx"
 #include "xlroot.hxx"
-
 // Color data =================================================================
 
 /** Standard EGA colors, bright. */
@@ -94,8 +94,22 @@
     mnWindowText = rSett.GetWindowTextColor().GetColor();
     mnWindowBack = rSett.GetWindowColor().GetColor();
     mnFaceColor = rSett.GetFaceColor().GetColor();
-    mnNoteText = rSett.GetHelpTextColor().GetColor();
-    mnNoteBack = rSett.GetHelpColor().GetColor();
+    // Don't use the system HelpBack and HelpText colours as it causes problems
+    // with modern gnome. This is because mnNoteText and mnNoteBack are used
+    // when colour indices ( instead of real colours ) are specified.
+    // Note: That this it is not an unusual scenario that we get the Note
+    // background specified as a real colour and the text specified as a
+    // colour index. That means the text colour would be picked from
+    // the system where the note background would be picked from a real colour.
+    // Previously the the note text colour was picked from the system tooltip
+    // text colour, on modern gnome(e.g. 3) that tends to be 'white' with the
+    // default theme.
+    // Using the the Libreoffice defaults ( instead of system specific colours
+    // ) lessens the chance of the one colour being an unsuitable combination
+    // because by default the note text is black and the note background is
+    // a light yellow colour ( very similar to Excel's normal defaults )
+    mnNoteText =  svtools::ColorConfig::GetDefaultColor( svtools::FONTCOLOR 
).GetColor();
+    mnNoteBack =  svtools::ColorConfig::GetDefaultColor( 
svtools::CALCNOTESBACKGROUND ).GetColor();
 
     // default colors
     switch( rRoot.GetBiff() )

-- 
To view, visit https://gerrit.libreoffice.org/3814
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ae38a44e0cbf201beb3b7d18a89f5ebdd644f8c
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Noel Power <noel.po...@suse.com>

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to