diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2024-04-09 15:01:30 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2024-04-09 17:37:00 +0200 |
commit | 32d3826a36099cbdb8675fe957348d80760f8cba (patch) | |
tree | 5dec98275938a1544b667e4c12323e9e6df993df /sd/source | |
parent | 6cd0ef58cddf40a0eb2d8cbb017136552f47704e (diff) |
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>
Diffstat (limited to 'sd/source')
-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 fd319fee5200..115beb928a19 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> @@ -1095,12 +1096,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 ========================================= |