mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
We need to check, in closeFontTags(), for the case where we haven't
had any content.
This commit is contained in:
parent
29cf7af6d3
commit
8dd436b7dc
@ -233,8 +233,15 @@ namespace {
|
||||
|
||||
bool XHTMLStream::closeFontTags()
|
||||
{
|
||||
if (isTagPending(parsep_tag))
|
||||
// we haven't had any content
|
||||
return true;
|
||||
|
||||
// this may be a useless check, since we ought at least to have
|
||||
// the parsep_tag. but it can't hurt too much to be careful.
|
||||
if (tag_stack_.empty())
|
||||
return true;
|
||||
|
||||
// first, we close any open font tags we can close
|
||||
html::StartTag curtag = tag_stack_.back();
|
||||
while (html::isFontTag(curtag.tag_)) {
|
||||
@ -429,6 +436,17 @@ bool XHTMLStream::isTagOpen(string const & stag) const
|
||||
}
|
||||
|
||||
|
||||
bool XHTMLStream::isTagPending(string const & stag) const
|
||||
{
|
||||
TagStack::const_iterator sit = pending_tags_.begin();
|
||||
TagStack::const_iterator const sen = pending_tags_.end();
|
||||
for (; sit != sen; ++sit)
|
||||
if (sit->tag_ == stag)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// this is complicated, because we want to make sure that
|
||||
// everything is properly nested. the code ought to make
|
||||
// sure of that, but we won't assert (yet) if we run into
|
||||
|
@ -146,6 +146,8 @@ private:
|
||||
///
|
||||
bool isTagOpen(std::string const &) const;
|
||||
///
|
||||
bool isTagPending(std::string const &) const;
|
||||
///
|
||||
void writeError(std::string const &) const;
|
||||
///
|
||||
odocstream & os_;
|
||||
|
Loading…
Reference in New Issue
Block a user