Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-08-17 17:11:50 +0300
committerJulian Eisel <julian@blender.org>2022-08-17 17:15:03 +0300
commit71f091a631c2deae08ff289184f928538b527cb3 (patch)
tree9fe7348fbea136a4d1842de594561e6854391634 /source/blender/editors/space_outliner
parentdb054b447de3636dc4e0f973e16ed22d39e85ce3 (diff)
Cleanup: Remove unused Outliner search element storage
This is old code to keep track of an active search element, so you could step through the search results. This isn't used anymore, and not needed since searching now filters the tree to only show matches. If we ever wanted to have support for stepping through elements again, that should be done via the active element instead.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.cc123
-rw-r--r--source/blender/editors/space_outliner/space_outliner.cc2
2 files changed, 0 insertions, 125 deletions
diff --git a/source/blender/editors/space_outliner/outliner_edit.cc b/source/blender/editors/space_outliner/outliner_edit.cc
index f22db5d20fc..ffae81d6e3f 100644
--- a/source/blender/editors/space_outliner/outliner_edit.cc
+++ b/source/blender/editors/space_outliner/outliner_edit.cc
@@ -1410,129 +1410,6 @@ void OUTLINER_OT_scroll_page(wmOperatorType *ot)
/** \} */
-#if 0 /* TODO: probably obsolete now with filtering? */
-
-/* -------------------------------------------------------------------- */
-/** \name Search
- * \{ */
-
-
-/* find next element that has this name */
-static TreeElement *outliner_find_name(
- SpaceOutliner *space_outliner, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound)
-{
- TreeElement *te, *tes;
-
- for (te = lb->first; te; te = te->next) {
- int found = outliner_filter_has_name(te, name, flags);
-
- if (found) {
- /* name is right, but is element the previous one? */
- if (prev) {
- if ((te != prev) && (*prevFound)) {
- return te;
- }
- if (te == prev) {
- *prevFound = 1;
- }
- }
- else {
- return te;
- }
- }
-
- tes = outliner_find_name(space_outliner, &te->subtree, name, flags, prev, prevFound);
- if (tes) {
- return tes;
- }
- }
-
- /* nothing valid found */
- return nullptr;
-}
-
-static void outliner_find_panel(
- Scene *UNUSED(scene), ARegion *region, SpaceOutliner *space_outliner, int again, int flags)
-{
- ReportList *reports = nullptr; /* CTX_wm_reports(C); */
- TreeElement *te = nullptr;
- TreeElement *last_find;
- TreeStoreElem *tselem;
- int ytop, xdelta, prevFound = 0;
- char name[sizeof(space_outliner->search_string)];
-
- /* get last found tree-element based on stored search_tse */
- last_find = outliner_find_tse(space_outliner, &space_outliner->search_tse);
-
- /* determine which type of search to do */
- if (again && last_find) {
- /* no popup panel - previous + user wanted to search for next after previous */
- BLI_strncpy(name, space_outliner->search_string, sizeof(name));
- flags = space_outliner->search_flags;
-
- /* try to find matching element */
- te = outliner_find_name(space_outliner, &space_outliner->tree, name, flags, last_find, &prevFound);
- if (te == nullptr) {
- /* no more matches after previous, start from beginning again */
- prevFound = 1;
- te = outliner_find_name(space_outliner, &space_outliner->tree, name, flags, last_find, &prevFound);
- }
- }
- else {
- /* pop up panel - no previous, or user didn't want search after previous */
- name[0] = '\0';
- // XXX if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) {
- // te = outliner_find_name(space_outliner, &space_outliner->tree, name, flags, nullptr, &prevFound);
- // }
- // else return; XXX RETURN! XXX
- }
-
- /* do selection and reveal */
- if (te) {
- tselem = TREESTORE(te);
- if (tselem) {
- /* expand branches so that it will be visible, we need to get correct coordinates */
- if (outliner_open_back(space_outliner, te)) {
- outliner_set_coordinates(region, space_outliner);
- }
-
- /* deselect all visible, and select found element */
- outliner_flag_set(space_outliner, &space_outliner->tree, TSE_SELECTED, 0);
- tselem->flag |= TSE_SELECTED;
-
- /* Make `te->ys` center of view. */
- ytop = (int)(te->ys + BLI_rctf_size_y(&region->v2d.mask) / 2);
- if (ytop > 0) {
- ytop = 0;
- }
- region->v2d.cur.ymax = (float)ytop;
- region->v2d.cur.ymin = (float)(ytop - BLI_rctf_size_y(&region->v2d.mask));
-
- /* Make `te->xs` ==> `te->xend` center of view. */
- xdelta = (int)(te->xs - region->v2d.cur.xmin);
- region->v2d.cur.xmin += xdelta;
- region->v2d.cur.xmax += xdelta;
-
- /* store selection */
- space_outliner->search_tse = *tselem;
-
- BLI_strncpy(space_outliner->search_string, name, sizeof(space_outliner->search_string));
- space_outliner->search_flags = flags;
-
- /* redraw */
- ED_region_tag_redraw_no_rebuild(region);
- }
- }
- else {
- /* no tree-element found */
- BKE_reportf(reports, RPT_WARNING, "Not found: %s", name);
- }
-}
-
-/** \} */
-
-#endif /* if 0 */
-
/* -------------------------------------------------------------------- */
/** \name Show One Level Operator
* \{ */
diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc
index 61bc3d35dfd..15aafe9c692 100644
--- a/source/blender/editors/space_outliner/space_outliner.cc
+++ b/source/blender/editors/space_outliner/space_outliner.cc
@@ -391,8 +391,6 @@ static void outliner_id_remap(ScrArea *area, SpaceLink *slink, const struct IDRe
{
SpaceOutliner *space_outliner = (SpaceOutliner *)slink;
- BKE_id_remapper_apply(mappings, (ID **)&space_outliner->search_tse.id, ID_REMAP_APPLY_DEFAULT);
-
if (!space_outliner->treestore) {
return;
}