chart2/source/controller/drawinglayer/DrawViewWrapper.cxx |    7 +++++++
 svx/source/unodraw/UnoGraphicExporter.cxx                 |    5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 8fa1493facfe1f088fc99c762b5a8a0773fc1b9c
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Jan 26 22:14:03 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Jan 28 15:39:17 2024 +0100

    Set chart outliner background to the page bg to resolve 'auto' color
    
    Change-Id: I2498a7d49dbbd7bde017489722c3b655b6d75136
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162649
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx 
b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index 51d3e7c3e63a..56f1440e23ff 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -215,7 +215,14 @@ void DrawViewWrapper::CompleteRedraw(OutputDevice* pOut, 
const vcl::Region& rReg
     svtools::ColorConfig aColorConfig;
     Color aFillColor( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor );
     SetApplicationBackgroundColor(aFillColor);
+
+    SdrOutliner& rOutliner = GetModel().GetDrawOutliner();
+    Color aOldBackColor = rOutliner.GetBackgroundColor();
+    rOutliner.SetBackgroundColor(aFillColor);
+
     E3dView::CompleteRedraw( pOut, rReg );
+
+    rOutliner.SetBackgroundColor(aOldBackColor);
 }
 
 SdrObject* DrawViewWrapper::getSelectedObject() const
commit be2ea4ebe3f969ee9ac4c8da40cdbe6d8f011e58
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Jan 26 16:58:23 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Jan 28 15:39:09 2024 +0100

    restore original Outliner background after getting transferrable
    
    Inserting a chart into a dark mode writer will initially incorrectly
    show auto color text as dark while is is in edit mode, then once you
    leave edit mode the auto text is correctly white.
    
    But it looks like that apparently correct white color is itself a bug
    from the copy clipboard transferrable setting a good background and then
    not restoring it afterwards.
    
    Change-Id: Ib019eb494b623bdda22019d587210db2c39987f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162566
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx 
b/svx/source/unodraw/UnoGraphicExporter.cxx
index c7bd99d93a0b..4b971936b82a 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -597,7 +597,8 @@ bool GraphicExporter::GetGraphic( ExportSettings const & 
rSettings, Graphic& aGr
     SdrOutliner& rOutl=mpDoc->GetDrawOutliner();
     maOldCalcFieldValueHdl = rOutl.GetCalcFieldValueHdl();
     rOutl.SetCalcFieldValueHdl( LINK(this, GraphicExporter, CalcFieldValueHdl) 
);
-    rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor() );
+    ::Color aOldBackColor(rOutl.GetBackgroundColor());
+    rOutl.SetBackgroundColor(pPage->GetPageBackgroundColor());
 
     // #i102251#
     const EEControlBits nOldCntrl(rOutl.GetControlWord());
@@ -989,6 +990,8 @@ bool GraphicExporter::GetGraphic( ExportSettings const & 
rSettings, Graphic& aGr
     // #i102251#
     rOutl.SetControlWord(nOldCntrl);
 
+    rOutl.SetBackgroundColor(aOldBackColor);
+
     return bRet;
 
 }

Reply via email to