Add callback for textsplit to report line breaks. Use it to implement looking up the first line where a term appears to use with a %l spec for executing a viewer
This commit is contained in:
@@ -111,6 +111,9 @@ public:
|
||||
virtual int getFirstMatchPage(Rcl::Doc&, std::string&) {
|
||||
return -1;
|
||||
}
|
||||
virtual int getFirstMatchLine(const Rcl::Doc&, const std::string&) {
|
||||
return 1;
|
||||
}
|
||||
/** Get duplicates. */
|
||||
virtual bool docDups(const Rcl::Doc&, std::vector<Rcl::Doc>&) {
|
||||
return false;
|
||||
|
||||
@@ -126,6 +126,17 @@ int DocSequenceDb::getFirstMatchPage(Rcl::Doc &doc, string& term)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int DocSequenceDb::getFirstMatchLine(const Rcl::Doc &doc, const string& term)
|
||||
{
|
||||
std::unique_lock<std::mutex> locker(o_dblock);
|
||||
if (!setQuery())
|
||||
return false;
|
||||
if (m_q->whatDb()) {
|
||||
return m_q->getFirstMatchLine(doc, term);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
list<string> DocSequenceDb::expand(Rcl::Doc &doc)
|
||||
{
|
||||
std::unique_lock<std::mutex> locker(o_dblock);
|
||||
|
||||
@@ -43,6 +43,7 @@ public:
|
||||
|
||||
virtual bool getAbstract(Rcl::Doc &doc, std::vector<std::string>&) override;
|
||||
virtual int getFirstMatchPage(Rcl::Doc&, std::string& term) override;
|
||||
virtual int getFirstMatchLine(const Rcl::Doc&, const std::string& term) override;
|
||||
virtual bool docDups(const Rcl::Doc& doc, std::vector<Rcl::Doc>& dups)
|
||||
override;
|
||||
virtual std::string getDescription() override;
|
||||
|
||||
Reference in New Issue
Block a user