Book formatter: Fix last block of text not displaying

deque
MiroslavR 10 years ago
parent c362ec0f95
commit 51cd2678ae

@ -50,8 +50,12 @@ namespace MWGui
while (1)
{
++mIndex;
if (mIndex >= mText.size())
{
flushBuffer();
return Event_EOF;
}
char ch = mText[mIndex];
if (ch == '<')
@ -102,11 +106,7 @@ namespace MWGui
}
}
if (mIndex == mText.size() - 1)
{
flushBuffer();
return Event_LastText;
}
}
}
@ -133,7 +133,7 @@ namespace MWGui
while (!tag.empty())
{
int sepPos = tag.find('=');
size_t sepPos = tag.find('=');
if (sepPos == std::string::npos)
return;
@ -188,8 +188,9 @@ namespace MWGui
BookTextParser parser(markup);
BookTextParser::Events event;
while ((event = parser.next()) != BookTextParser::Event_EOF)
for (;;)
{
event = parser.next();
if (event == BookTextParser::Event_BrTag || event == BookTextParser::Event_PTag)
continue;
@ -204,6 +205,9 @@ namespace MWGui
elem.paginate();
}
if (event == BookTextParser::Event_EOF)
break;
switch (event)
{
case BookTextParser::Event_ImgTag:

@ -32,7 +32,6 @@ namespace MWGui
{
Event_None = -2,
Event_EOF = -1,
Event_LastText = 0,
Event_BrTag,
Event_PTag,
Event_ImgTag,

Loading…
Cancel
Save