From 5eca67b6cab7031d8203b1403ba5cddaef833e76 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Sun, 8 Feb 2015 19:37:51 +0100 Subject: restructured the FieldDescriptor mechanism. --- src/plugins/html/DemoOutput.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/plugins/html') diff --git a/src/plugins/html/DemoOutput.cpp b/src/plugins/html/DemoOutput.cpp index d61e9b7..d041c1d 100644 --- a/src/plugins/html/DemoOutput.cpp +++ b/src/plugins/html/DemoOutput.cpp @@ -27,8 +27,8 @@ namespace ousia { namespace html { -void DemoHTMLTransformer::writeHTML(Handle doc, - std::ostream &out, bool pretty) +void DemoHTMLTransformer::writeHTML(Handle doc, std::ostream &out, + bool pretty) { Manager &mgr = doc->getManager(); // Create an XML object tree for the document first. @@ -115,7 +115,7 @@ Rooted DemoHTMLTransformer::transformSection( Rooted sec{ new xml::Element{mgr, parent, "section", {{"class", secclass}}}}; // check if we have a heading. - if (section->hasField("heading") && + if (section->getDescriptor()->hasField("heading") && section->getField("heading").size() > 0) { Handle heading = section->getField("heading")[0].cast(); @@ -188,8 +188,7 @@ Rooted DemoHTMLTransformer::transformList( Rooted l{new xml::Element{mgr, parent, listclass}}; // iterate through list items. for (auto &it : list->getField()) { - Handle item = - it.cast(); + Handle item = it.cast(); std::string itDescrName = item->getDescriptor()->getName(); if (itDescrName == "item") { // create the list item. @@ -210,9 +209,9 @@ Rooted DemoHTMLTransformer::transformList( typedef std::stack> AnnoStack; -static Rooted openAnnotation( - Manager &mgr, AnnoStack &opened, Handle entity, - Handle current) +static Rooted openAnnotation(Manager &mgr, AnnoStack &opened, + Handle entity, + Handle current) { // we push the newly opened entity on top of the stack. opened.push(entity); @@ -238,7 +237,8 @@ Rooted DemoHTMLTransformer::transformParagraph( Rooted p{new xml::Element{mgr, parent, "p"}}; // check if we have a heading. - if (par->hasField("heading") && par->getField("heading").size() > 0) { + if (par->getDescriptor()->hasField("heading") && + par->getField("heading").size() > 0) { Handle heading = par->getField("heading")[0].cast(); // put the heading in a strong xml::Element. -- cgit v1.2.3