[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Aug 17 13:23:44 PDT 2015


 sw/source/core/txtnode/fntcache.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 294f43d78f1662139e9308120667396f10cadde5
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Aug 10 09:14:27 2015 +0200

    tdf#87922 SwDrawTextInfo::ApplyAutoColor: handle fill attributes
    
    With this, if page background is set to e.g. black, then automatic color
    of text is again white, not black.
    
    Change-Id: I8246fa4b7834f60872b0737f03906ccc86948cc1
    (cherry picked from commit d48d0e81971266ff4625721b0f069a62ec7014e2)
    Reviewed-on: https://gerrit.libreoffice.org/17814
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 2aa8202..3d6b35bc 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -47,6 +47,7 @@
 #include <swmodule.hxx>
 #include <accessibilityoptions.hxx>
 #include <svtools/accessibilityoptions.hxx>
+#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
 #include <doc.hxx>
 #include <editeng/fhgtitem.hxx>
 #include <docsh.hxx>
@@ -2521,6 +2522,7 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont )
         {
             // check if current background has a user defined setting
             const Color* pCol = GetFont() ? GetFont()->GetBackColor() : NULL;
+            Color aColor;
             if( ! pCol || COL_TRANSPARENT == pCol->GetColor() )
             {
                 const SvxBrushItem* pItem;
@@ -2537,6 +2539,14 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont )
                 ///     is a background brush and its color is *not* "no fill"/"auto fill".
                 if( GetFrm()->GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigBackRect, false ) )
                 {
+                    if (aFillAttributes.get() && aFillAttributes->isUsed())
+                    {
+                        // First see if fill atttributes provide a color.
+                        aColor = Color(aFillAttributes->getAverageColor(aGlobalRetoucheColor.getBColor()));
+                        pCol = &aColor;
+                    }
+
+                    // If not, then fall back to the old brush item.
                     if ( !pCol )
                     {
                         pCol = &pItem->GetColor();


More information about the Libreoffice-commits mailing list