Fix incorrect Outliner tree-display type returned

Reverts 6d97fdc37e. A function like this should not return a different
tree-display object than of the requested type. This may hide errors,
and leaves the Outliner in an undefined state (where the stored display
mode doesn't match the tree-display object). I rather don't hide the
fact that all display-modes should be handled here, and emit a clear
error if one isn't.
This commit is contained in:
Julian Eisel 2022-02-24 17:02:14 +01:00
parent fc8aab755a
commit 17301a3163
1 changed files with 5 additions and 3 deletions

View File

@ -7,6 +7,8 @@
#include "DNA_listBase.h"
#include "DNA_space_types.h"
#include "BLI_utildefines.h"
#include "tree_display.hh"
using namespace blender::ed::outliner;
@ -30,11 +32,11 @@ std::unique_ptr<AbstractTreeDisplay> AbstractTreeDisplay::createFromDisplayMode(
case SO_OVERRIDES_LIBRARY:
return std::make_unique<TreeDisplayOverrideLibrary>(space_outliner);
case SO_VIEW_LAYER:
/* FIXME(Julian): this should not be the default! Return nullptr and handle that as valid
* case. */
default:
return std::make_unique<TreeDisplayViewLayer>(space_outliner);
}
BLI_assert_unreachable();
return nullptr;
}
bool AbstractTreeDisplay::hasWarnings() const