kogmbh/WebODF — pull request #463 by peitschie (2014-03-11 04:19:18+00:00)
Title: Make page layout lookup code more robust when handling invalid docs

This prevents a null exception being thrown if the requested paragraph has no details about the associated page style. As a second fallback, if no style called "Standard" exists, this will fall back to the first available master-page defined in the ODT.

Note, the implementation of Formatting.getContentSize is still far from standards compliant. There are a whole bunch of factors missing in the calculations, and it still doesn't use the proper inheritance hierarchy for the page layout. Implementing these additions is a few day task however, and simply not a high enough priority for me at the moment. My key goal here was to prevent a crash from occurring with the existing broken logic.