--- a/libmspub-0.1.6/src/lib/MSPUBCollector.cpp +++ b/libmspub-0.1.6/src/lib/MSPUBCollector.cpp @@ -1126,6 +1126,12 @@ { props.insert("librevenge:rotate", textRotation * 180 / M_PI); } + // pubconv: linked text boxes share one story; tell the viewer which story this box shows, + // and whether the box belongs to a master page (repeated on purpose on every page). + if (bool(info.m_textId)) + props.insert("libmspub:text-id", (int)get(info.m_textId)); + if (bool(info.m_pageSeqNum) && pageIsMaster(get(info.m_pageSeqNum))) + props.insert("libmspub:master-page", true); if (isTable) { --- a/libmspub-0.1.6/src/lib/MSPUBParser.cpp +++ b/libmspub-0.1.6/src/lib/MSPUBParser.cpp @@ -1572,6 +1572,10 @@ { MSPUB_DEBUG_MSG(("In getFontIndex\n")); input->seek(info.dataOffset + 4, librevenge::RVNG_SEEK_SET); + // pubconv: Publisher 98 and 2000 files list the font index directly (2-byte blocks, one per script), + // without the general container used from Publisher 2002 on. Without this every text of those files + // fell back to the first font of the document (usually Times New Roman). + boost::optional directIndex; while (stillReading(input, info.dataOffset + info.dataLength)) { MSPUBBlockInfo subInfo = parseBlock(input, true); @@ -1585,8 +1589,12 @@ return subSubInfo.data; } } - } - return 0; + else if (subInfo.type == 0x18 && !directIndex) + { + directIndex = subInfo.data; + } + } + return directIndex ? get(directIndex) : 0; } int MSPUBParser::getColorIndex(librevenge::RVNGInputStream *input, const MSPUBBlockInfo &info)