Commit 373ae0c0 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Reset status of highlighting/term data when loading doc in editor. Fixes...

Reset status of highlighting/term data when loading doc in editor. Fixes search not working after using shift+arrow

--HG--
branch : RECOLL_1_21_MAINT
parent 1d439465
......@@ -70,6 +70,12 @@ public:
: m_curanchor(1), m_lastanchor(0)
{
}
void clear() {
m_curanchor = 1;
m_lastanchor = 0;
m_groupanchors.clear();
m_groupcuranchors.clear();
}
bool haveAnchors()
{
......@@ -840,7 +846,7 @@ bool Preview::loadDocInCurrentTab(const Rcl::Doc &idoc, int docnum)
sleep(1);
}
LOGDEB(("LoadFileInCurrentTab: after file load: cancel %d status %d"
LOGDEB(("loadDocInCurrentTab: after file load: cancel %d status %d"
" text length %d\n",
CancelCheck::instance().cancelState(), status, fdoc.text.length()));
......@@ -879,6 +885,8 @@ bool Preview::loadDocInCurrentTab(const Rcl::Doc &idoc, int docnum)
list<QString> qrichlst;
PreviewTextEdit *editor = currentEditor();
editor->m_plaintorich->clear();
// For an actual html file, if we want to have the images and
// style loaded in the preview, we need to set the search
// path. Not too sure this is a good idea as I find them rather
......@@ -997,7 +1005,7 @@ bool Preview::loadDocInCurrentTab(const Rcl::Doc &idoc, int docnum)
if (progress.wasCanceled()) {
editor->append("<b>Cancelled !</b>");
LOGDEB(("LoadFileInCurrentTab: cancelled in editor load\n"));
LOGDEB(("loadDocInCurrentTab: cancelled in editor load\n"));
break;
}
}
......@@ -1079,7 +1087,7 @@ bool Preview::loadDocInCurrentTab(const Rcl::Doc &idoc, int docnum)
editor->setFocus();
emit(previewExposed(this, m_searchId, docnum));
LOGDEB(("LoadFileInCurrentTab: returning true\n"));
LOGDEB(("loadDocInCurrentTab: returning true\n"));
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment