diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2024-04-09 15:01:30 +0200 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-04-30 15:10:42 +0200 |
commit | c8e1d42d867741be5fc4b337172a23b32626c862 (patch) | |
tree | 7e3f0d29a39f4b552deba3c4c328710ef674f7d9 | |
parent | IASS: make live slideshow non-experimental (diff) | |
download | core-c8e1d42d867741be5fc4b337172a23b32626c862.tar.gz core-c8e1d42d867741be5fc4b337172a23b32626c862.zip |
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 <Armin.Le.Grand@me.com>
-rw-r--r-- | sd/source/ui/view/ViewShellBase.cxx | 26 |
1 files 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 <sfx2/request.hxx> #include <sfx2/printer.hxx> #include <DrawViewShell.hxx> +#include <OutlineViewShell.hxx> #include <FormShellManager.hxx> #include <ToolBarManager.hxx> #include <Window.hxx> @@ -1071,12 +1072,31 @@ void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const } } } - else + // IASS: also need to handle OutlineViewShell + else if (nullptr != dynamic_cast<OutlineViewShell*>(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 ========================================= |