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>
This commit is contained in:
Armin Le Grand (allotropia)
2024-04-09 15:01:30 +02:00
committed by Armin Le Grand
parent 6cd0ef58cd
commit 32d3826a36

View File

@@ -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 =========================================