diff options
author | Noel Power <noel.power@suse.com> | 2013-05-07 16:41:27 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-05-07 16:41:27 +0100 |
commit | 64fed0c4fde695bb7978390d2e0a303dc6d53fe7 (patch) | |
tree | c6a43b985b3b2ce0337fa5af200bf3f34305974f | |
parent | 94fdd5d302e34220a0b1beaf3610658d15c7b808 (diff) |
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
-rw-r--r-- | sc/source/filter/excel/xlstyle.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx index a6a39ed8b2a7..e2b3f1843519 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 @@ XclDefaultPalette::XclDefaultPalette( const XclRoot& rRoot ) : 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() ) |