[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Aug 10 00:17:59 PDT 2015
sw/inc/swmodule.hxx | 5 +++++
sw/source/core/inc/drawfont.hxx | 2 +-
sw/source/core/inc/frame.hxx | 2 +-
sw/source/core/inc/swfont.hxx | 2 +-
sw/source/core/layout/paintfrm.cxx | 8 ++++++++
sw/source/core/txtnode/fntcache.cxx | 10 ++++++++++
6 files changed, 26 insertions(+), 3 deletions(-)
New commits:
commit 31937624e359803d2db8c12a805ec1a5c9d0fe30
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Aug 10 09:16:22 2015 +0200
sw: make these available outside sw core
Change-Id: Id5c4c65369c713d8fd7ba45acf55a65c0a05bb0e
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index f6bdea0..35d58c6 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -258,6 +258,11 @@ inline ::com::sun::star::uno::Reference<
SW_DLLPUBLIC SwView* GetActiveView();
SW_DLLPUBLIC SwWrtShell* GetActiveWrtShell();
+namespace sw
+{
+SW_DLLPUBLIC Color* GetActiveRetoucheColor();
+}
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx
index 7d36258..b751fc1 100644
--- a/sw/source/core/inc/drawfont.hxx
+++ b/sw/source/core/inc/drawfont.hxx
@@ -40,7 +40,7 @@ namespace vcl {
class SwUnderlineFont;
// encapsulates information for drawing text
-class SwDrawTextInfo
+class SW_DLLPUBLIC SwDrawTextInfo
{
const SwTextFrm* pFrm;
VclPtr<OutputDevice> pOut;
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 58df49f..bdfb9a6 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -213,7 +213,7 @@ namespace drawinglayer { namespace attribute {
* level: pages, headers, footers, etc. (Inside a paragraph SwLinePortion
* instances are used.)
*/
-class SwFrm: public SwClient, public SfxBroadcaster
+class SW_DLLPUBLIC SwFrm: public SwClient, public SfxBroadcaster
{
// the hidden Frm
friend class SwFlowFrm;
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index e9c96e1..70a0aca 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -123,7 +123,7 @@ public:
#define SW_CTL 2
#define SW_SCRIPTS 3
-class SwFont
+class SW_DLLPUBLIC SwFont
{
// CJK == Chinese, Japanese, Korean
// CTL == Complex text layout ( Hebrew, Arabic )
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index e4482e8..748fe0a 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -235,6 +235,14 @@ const static double aEdgeScale = 0.5;
//To optimize the expensive RetouchColor determination
Color aGlobalRetoucheColor;
+namespace sw
+{
+Color* GetActiveRetoucheColor()
+{
+ return &aGlobalRetoucheColor;
+}
+}
+
/**
* Container for static properties
*/
commit d48d0e81971266ff4625721b0f069a62ec7014e2
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
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index a106cbd..fba875c 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