mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 17:20:55 +00:00
Really, I mean *really* fix bug 4857.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@24877 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9118cc1800
commit
92bcd7b0ca
@ -2548,6 +2548,21 @@ bool Paragraph::isMultiLingual(BufferParams const & bparams) const
|
||||
}
|
||||
|
||||
|
||||
docstring const Paragraph::printableString(bool label) const
|
||||
{
|
||||
odocstringstream os;
|
||||
if (label && !params().labelString().empty())
|
||||
os << params().labelString() << ' ';
|
||||
pos_type end = size();
|
||||
for (pos_type i = 0; i < end; ++i) {
|
||||
value_type const c = getChar(i);
|
||||
if (isPrintable(c))
|
||||
os.put(c);
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
|
||||
// Convert the paragraph to a string.
|
||||
// Used for building the table of contents
|
||||
docstring const Paragraph::asString(Buffer const & buffer, bool label) const
|
||||
|
@ -100,6 +100,8 @@ public:
|
||||
///
|
||||
bool isMultiLingual(BufferParams const &) const;
|
||||
|
||||
///
|
||||
docstring const printableString(bool label) const;
|
||||
///
|
||||
docstring const asString(Buffer const &, bool label) const;
|
||||
///
|
||||
|
@ -113,7 +113,7 @@ void TocBackend::updateItem(ParConstIterator const & par_it)
|
||||
*static_cast<InsetOptArg&>(inset).paragraphs().begin();
|
||||
if (!toc_item->par_it_->getLabelstring().empty())
|
||||
tocstring = toc_item->par_it_->getLabelstring() + ' ';
|
||||
tocstring += par.asString(*buffer_, false);
|
||||
tocstring += par.printableString(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -122,7 +122,7 @@ void TocBackend::updateItem(ParConstIterator const & par_it)
|
||||
if (toclevel != Layout::NOT_IN_TOC
|
||||
&& toclevel >= min_toclevel
|
||||
&& tocstring.empty())
|
||||
tocstring = toc_item->par_it_->asString(*buffer_, true);
|
||||
tocstring = toc_item->par_it_->printableString(true);
|
||||
|
||||
const_cast<TocItem &>(*toc_item).str_ = tocstring;
|
||||
}
|
||||
@ -158,7 +158,7 @@ void TocBackend::update()
|
||||
*static_cast<InsetOptArg&>(inset).paragraphs().begin();
|
||||
if (!pit->getLabelstring().empty())
|
||||
tocstring = pit->getLabelstring() + ' ';
|
||||
tocstring += par.asString(*buffer_, false);
|
||||
tocstring += par.printableString(false);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -172,7 +172,7 @@ void TocBackend::update()
|
||||
&& toclevel >= min_toclevel) {
|
||||
// insert this into the table of contents
|
||||
if (tocstring.empty())
|
||||
tocstring = pit->asString(*buffer_, true);
|
||||
tocstring = pit->printableString(true);
|
||||
toc.push_back(TocItem(pit, toclevel - min_toclevel,
|
||||
tocstring));
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ void InsetCaption::addToToc(TocList & toclist, Buffer const & buf,
|
||||
|
||||
Toc & toc = toclist[type_];
|
||||
docstring const str = convert<docstring>(counter_)
|
||||
+ ". " + pit->asString(buf, false);
|
||||
+ ". " + pit->printableString(false);
|
||||
toc.push_back(TocItem(pit, 0, str));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user