Display empty dictionnary inside empty objects + Add line return before endobject if there is not
This commit is contained in:
parent
b540646199
commit
c7c665aa8f
|
@ -37,12 +37,30 @@ namespace uPDFParser
|
|||
res << " " << indirectOffset << "\n";
|
||||
else
|
||||
{
|
||||
bool needLineReturn = false;
|
||||
|
||||
if (!_dictionary.empty())
|
||||
res << _dictionary.str();
|
||||
else
|
||||
{
|
||||
if (!_data.size())
|
||||
res << "<<>>\n";
|
||||
else
|
||||
needLineReturn = true;
|
||||
}
|
||||
|
||||
std::vector<DataType*>::iterator it;
|
||||
for(it=_data.begin(); it!=_data.end(); it++)
|
||||
res << (*it)->str();
|
||||
{
|
||||
std::string tmp = (*it)->str();
|
||||
res << tmp;
|
||||
if (tmp[tmp.size()-1] == '\n' ||
|
||||
tmp[tmp.size()-1] == '\r')
|
||||
needLineReturn = false;
|
||||
}
|
||||
|
||||
if (needLineReturn)
|
||||
res << "\n";
|
||||
}
|
||||
|
||||
res << "endobj\n";
|
||||
|
|
Loading…
Reference in New Issue
Block a user