From c8e1d42d867741be5fc4b337172a23b32626c862 Mon Sep 17 00:00:00 2001 From: "Armin Le Grand (allotropia)" Date: Tue, 9 Apr 2024 15:01:30 +0200 Subject: IASS: Missing updates in OutlinerView mode It looked like in OutlinerMode in IASS when doing changes updating the other views were missing. After debugging and finding no error I found out that the text as COL_AUTO is painted white on white - all updates happen but are invisible - argh. After some more debugging I found that in ViewShellBase::GetColorConfigColor only the DrawViewShell case was handled, so I added the OutlineViewShell now. Since that ViewShell has no SdViewOptions I hard-coded the DOCCOLOR to COL_WHITE. That method returns {} aka COL_BLACK as default which is a bad default for an office package with paper as target, so I also changed that to COL_WHITE - which is the default for unknown ViewShells now that way. Also adapted the warning to mention an 'unknown ViewShell' now. Change-Id: I580a151b4c0a9eb46d190ba84b0c6d0798dc21d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165907 Tested-by: Jenkins Reviewed-by: Armin Le Grand --- sd/source/ui/view/ViewShellBase.cxx | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 9e8e7b1aa5d4..4bea67c0eaa7 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -1071,12 +1072,31 @@ void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const } } } - else + // IASS: also need to handle OutlineViewShell + else if (nullptr != dynamic_cast(GetMainViewShell().get())) { - SAL_WARN("sd", "dynamic_cast to DrawViewShell failed"); + switch (nColorType) + { + case svtools::ColorConfigEntry::DOCCOLOR: + { + // IASS: OutlineViewShell does not have any SdViewOptions and no access + // to the (currently not shown) DrawViewShell. If that should be + // needed it may be added. For now, assume that DOCCOLOR is COL_WHITE + return COL_WHITE; + } + // Should never be called for an unimplemented color type + default: + { + O3TL_UNREACHABLE; + } + } } - return {}; + SAL_WARN("sd", "Unknown ViewShell used: Consider adding a case for this to get correct colors, COL_WHITE is used as fallback."); + // NOTE: This returned COL_BLACK. For unknown ViewShells I would assume that + // returning COL_WHITE would be safer - a better default for an office + // application dealing with Paper as target + return COL_WHITE; } //===== ViewShellBase::Implementation ========================================= -- cgit