From e0971ab8f6fd4d04a9bd623351eb3c23d921619d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 9 Feb 2011 19:20:34 +0000 Subject: [PATCH] * Restricted the cursor position/selection restoration to the formula mode for stored queries - it's usually more annoying than helpful for the other modes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40407 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/FindPanel.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kits/tracker/FindPanel.cpp b/src/kits/tracker/FindPanel.cpp index 5cfdcfff5d..7a6481da34 100644 --- a/src/kits/tracker/FindPanel.cpp +++ b/src/kits/tracker/FindPanel.cpp @@ -2242,11 +2242,12 @@ FindPanel::RestoreWindowState(const BNode *node) BString focusedView; if (node->ReadAttrString("_trk/focusedView", &focusedView) == B_OK) { BView *view = FindView(focusedView.String()); - if (view) { + if (view != NULL) { view->MakeFocus(); BTextControl *textControl = dynamic_cast(view); - if (textControl) { - int32 selStart = 0, selEnd = LONG_MAX; + if (textControl != NULL && Mode() == kByFormulaItem) { + int32 selStart = 0; + int32 selEnd = LONG_MAX; node->ReadAttr("_trk/focusedSelStart", B_INT32_TYPE, 0, &selStart, sizeof(selStart)); node->ReadAttr("_trk/focusedSelEnd", B_INT32_TYPE, 0,