sfx2/source/view/viewsh.cxx | 6 ++++-- svx/source/svdraw/svdpage.cxx | 10 ++++++++-- svx/source/unodraw/UnoGraphicExporter.cxx | 5 ++++- 3 files changed, 16 insertions(+), 5 deletions(-)
New commits: commit 49a5b76e9c18c9ee43cc1e1bb9de14fd50ceda77 Author: Caolán McNamara <[email protected]> AuthorDate: Tue Jan 30 21:29:31 2024 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Wed Feb 7 10:11:48 2024 +0100 use ViewShell DOCCOLOR when available for fallback, continue to warn if the terminal fallback gets used, but fill stub it to return the application DOCCOLOR Change-Id: I2bf3a1c6c6adb58811fd36c70f93932de246f10a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162782 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 3a48ad467b7fbf9cbdfff1222e08c02b0ff5d544) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162852 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 2bdc2d6327058d31bfd2ddb08f5c01ea9755bd66) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163077 Tested-by: Caolán McNamara <[email protected]> diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 93c18a16e2e2..3d4444b56b16 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -30,6 +30,7 @@ #include <vcl/toolbox.hxx> #include <vcl/weld.hxx> #include <svl/intitem.hxx> +#include <svtools/colorcfg.hxx> #include <svtools/langhelp.hxx> #include <com/sun/star/awt/XPopupMenu.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> @@ -3320,10 +3321,11 @@ vcl::Window* SfxViewShell::GetEditWindowForActiveOLEObj() const return pEditWin; } -::Color SfxViewShell::GetColorConfigColor(svtools::ColorConfigEntry) const +::Color SfxViewShell::GetColorConfigColor(svtools::ColorConfigEntry eEntry) const { SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigColor not overridden!"); - return {}; + svtools::ColorConfig aColorConfig; + return aColorConfig.GetColorValue(eEntry).nColor; } void SfxViewShell::SetLOKLanguageTag(const OUString& rBcp47LanguageTag) diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index adc8555bf13d..49a3025759b5 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -33,6 +33,7 @@ #include <comphelper/diagnose_ex.hxx> #include <comphelper/lok.hxx> +#include <sfx2/viewsh.hxx> #include <svtools/colorcfg.hxx> #include <svx/svdetc.hxx> #include <svx/svdobj.hxx> @@ -1771,8 +1772,13 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView const * pView, bool bScreenDi if(bScreenDisplay && (!pView || pView->GetApplicationDocumentColor() == COL_AUTO)) { - svtools::ColorConfig aColorConfig; - aColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor; + if (const SfxViewShell* pViewShell = SfxViewShell::Current()) + aColor = pViewShell->GetColorConfigColor(svtools::DOCCOLOR); + else + { + svtools::ColorConfig aColorConfig; + aColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor; + } } else { commit 997754eeda670585ff23fdaf0ed8830149fddca6 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Jan 26 16:58:23 2024 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Wed Feb 7 10:11:35 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 <[email protected]> (cherry picked from commit be2ea4ebe3f969ee9ac4c8da40cdbe6d8f011e58) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162851 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 53655a310737c6653ba8350d57104d0df8890976) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163076 Tested-by: Caolán McNamara <[email protected]> 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; }
