From bfafa64765de7a6002c2e84daefc84811278a51a Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 25 Jan 2015 18:54:40 +0100 Subject: more removal of the model namespace --- src/plugins/html/DemoOutput.cpp | 36 ++++++++++++++++++------------------ src/plugins/html/DemoOutput.hpp | 10 +++++----- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/html/DemoOutput.cpp b/src/plugins/html/DemoOutput.cpp index a3d1b84..503c104 100644 --- a/src/plugins/html/DemoOutput.cpp +++ b/src/plugins/html/DemoOutput.cpp @@ -27,7 +27,7 @@ namespace ousia { namespace html { -void DemoHTMLTransformer::writeHTML(Handle doc, +void DemoHTMLTransformer::writeHTML(Handle doc, std::ostream &out, bool pretty) { Manager &mgr = doc->getManager(); @@ -66,7 +66,7 @@ void DemoHTMLTransformer::writeHTML(Handle doc, } // extract the book root node. - Rooted root = doc->getRoot(); + Rooted root = doc->getRoot(); if (root->getDescriptor()->getName() != "book") { throw OusiaException("The given documents root is no book node!"); } @@ -98,7 +98,7 @@ SectionType getSectionType(const std::string &name) } Rooted DemoHTMLTransformer::transformSection( - Handle parent, Handle section, + Handle parent, Handle section, AnnoMap &startMap, AnnoMap &endMap) { Manager &mgr = section->getManager(); @@ -115,8 +115,8 @@ Rooted DemoHTMLTransformer::transformSection( // check if we have a heading. if (section->hasField("heading") && section->getField("heading").size() > 0) { - Handle heading = - section->getField("heading")[0].cast(); + Handle heading = + section->getField("heading")[0].cast(); std::string headingclass; switch (type) { case SectionType::BOOK: @@ -149,7 +149,7 @@ Rooted DemoHTMLTransformer::transformSection( if (!n->isa(RttiTypes::StructuredEntity)) { continue; } - Handle s = n.cast(); + Handle s = n.cast(); /* * Strictly speaking this is the wrong mechanism, because we would have * to make an "isa" call here because we can not rely on our knowledge @@ -174,7 +174,7 @@ Rooted DemoHTMLTransformer::transformSection( } Rooted DemoHTMLTransformer::transformList( - Handle parent, Handle list, + Handle parent, Handle list, AnnoMap &startMap, AnnoMap &endMap) { Manager &mgr = list->getManager(); @@ -183,8 +183,8 @@ 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. @@ -203,10 +203,10 @@ Rooted DemoHTMLTransformer::transformList( return l; } -typedef std::stack> AnnoStack; +typedef std::stack> AnnoStack; static Rooted openAnnotation( - Manager &mgr, AnnoStack &opened, Handle entity, + Manager &mgr, AnnoStack &opened, Handle entity, Handle current) { // we push the newly opened entity on top of the stack. @@ -225,7 +225,7 @@ static Rooted openAnnotation( } Rooted DemoHTMLTransformer::transformParagraph( - Handle parent, Handle par, + Handle parent, Handle par, AnnoMap &startMap, AnnoMap &endMap) { Manager &mgr = par->getManager(); @@ -234,8 +234,8 @@ Rooted DemoHTMLTransformer::transformParagraph( // check if we have a heading. if (par->hasField("heading") && par->getField("heading").size() > 0) { - Handle heading = - par->getField("heading")[0].cast(); + Handle heading = + par->getField("heading")[0].cast(); // put the heading in a strong xml::Element. Rooted strong{new xml::Element{mgr, p, "strong"}}; p->addChild(strong); @@ -281,7 +281,7 @@ Rooted DemoHTMLTransformer::transformParagraph( * be re-opened. */ AnnoStack tmp; - Rooted closed = opened.top(); + Rooted closed = opened.top(); current = current->getParent(); opened.pop(); while (closed->getEnd()->getName() != n->getName()) { @@ -313,12 +313,12 @@ Rooted DemoHTMLTransformer::transformParagraph( if (!n->isa(RttiTypes::StructuredEntity)) { continue; } - Handle t = n.cast(); + Handle t = n.cast(); std::string childDescriptorName = t->getDescriptor()->getName(); if (childDescriptorName == "text") { - Handle primitive = - t->getField()[0].cast(); + Handle primitive = + t->getField()[0].cast(); if (primitive.isNull()) { throw OusiaException("Text field is not primitive!"); } diff --git a/src/plugins/html/DemoOutput.hpp b/src/plugins/html/DemoOutput.hpp index b755aac..67b7494 100644 --- a/src/plugins/html/DemoOutput.hpp +++ b/src/plugins/html/DemoOutput.hpp @@ -39,7 +39,7 @@ namespace ousia { namespace html { -typedef std::map> AnnoMap; +typedef std::map> AnnoMap; class DemoHTMLTransformer { private: @@ -50,14 +50,14 @@ private: * called recursively. */ Rooted transformSection(Handle parent, - Handle sec, + Handle sec, AnnoMap &startMap, AnnoMap &endMap); /** * This transforms a list entity, namely ul and ol to an XHTML element. * For each item, the transformParagraph function is called. */ Rooted transformList(Handle parent, - Handle list, + Handle list, AnnoMap &startMap, AnnoMap &endMap); /** * This transforms a paragraph-like entity, namely heading, item and @@ -65,7 +65,7 @@ private: * contained. For anchor handling we require the AnnoMaps. */ Rooted transformParagraph(Handle parent, - Handle par, + Handle par, AnnoMap &startMap, AnnoMap &endMap); public: @@ -89,7 +89,7 @@ public: * @param pretty is a flag that manipulates whether newlines and tabs are * used. */ - void writeHTML(Handle doc, std::ostream &out, + void writeHTML(Handle doc, std::ostream &out, bool pretty = true); }; } -- cgit v1.2.3