Skip to content

Commit 2f2e538

Browse files
committed
Resolve @facs pointing to <surface>
1 parent 162d6df commit 2f2e538

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

include/vrv/facsimileinterface.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ class FacsimileInterface : public Interface, public AttFacsimile {
5858
Zone *GetZone() { return m_zone; }
5959
const Zone *GetZone() const { return m_zone; }
6060
///@}
61+
///
62+
63+
/** Get the surface */
64+
///@{
65+
Surface *GetSurface() { return m_surface; }
66+
const Surface *GetSurface() const { return m_surface; }
67+
///@}
6168

6269
//-----------------//
6370
// Pseudo functors //

src/facsimilefunctor.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ FunctorCode SyncFromFacsimileFunctor::VisitPb(Pb *pb)
106106
assert(m_currentPage);
107107

108108
Zone *zone = pb->GetZone();
109-
assert(zone && zone->GetParent());
110-
Surface *surface = (zone->GetParent()->Is(SURFACE)) ? vrv_cast<Surface *>(zone->GetParent()) : NULL;
111-
// Use the parent surface attributes if given
109+
Surface *surface = pb->GetSurface();
110+
if (!surface && zone && zone->GetParent())
111+
surface = (zone->GetParent()->Is(SURFACE)) ? vrv_cast<Surface *>(zone->GetParent()) : NULL;
112+
assert(zone || surface);
113+
// Use the (parent) surface attributes if given
112114
if (surface && surface->HasLrx() && surface->HasLry()) {
113115
m_currentPage->m_pageHeight = surface->GetLry() * DEFINITION_FACTOR;
114116
m_currentPage->m_pageWidth = surface->GetLrx() * DEFINITION_FACTOR;

0 commit comments

Comments
 (0)