Do not hardcode specific insets, but use a variable instead.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37932 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2011-03-15 10:46:14 +00:00
parent 5866504aba
commit 8fa96ceec8
4 changed files with 12 additions and 4 deletions

View File

@ -3346,10 +3346,7 @@ int Paragraph::find(docstring const & str, bool cs, bool mw,
for (i = 0; i < strsize && pos < parsize; ++i, ++pos) {
// Ignore ligature break and hyphenation chars while searching
while (pos < parsize - 1 && isInset(pos)) {
const InsetSpecialChar *isc = dynamic_cast<const InsetSpecialChar*>(getInset(pos));
if (isc == 0
|| (isc->kind() != InsetSpecialChar::HYPHENATION
&& isc->kind() != InsetSpecialChar::LIGATURE_BREAK))
if (!getInset(pos)->skipOnSearch())
break;
pos++;
}

View File

@ -402,6 +402,9 @@ public:
/// Is the content of this inset part of the output document?
virtual bool producesOutput() const { return true; }
/// Skip this inset while searching?
virtual bool skipOnSearch() const { return false; }
/// \return Tool tip for this inset.
/// This default implementation returns an empty string.
virtual docstring toolTip(BufferView const & bv, int x, int y) const;

View File

@ -346,6 +346,12 @@ bool InsetSpecialChar::isLetter() const
}
bool InsetSpecialChar::skipOnSearch() const
{
return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK;
}
bool InsetSpecialChar::isLineSeparator() const
{
#if 0

View File

@ -81,6 +81,8 @@ public:
bool isChar() const { return true; }
/// is this equivalent to a letter?
bool isLetter() const;
/// Skip this inset while searching?
bool skipOnSearch() const;
// should we break lines after this inset?
bool isLineSeparator() const;
private: