Skip to content

Commit

Permalink
Simplifying the External implementation, does no special magic includ…
Browse files Browse the repository at this point in the history
…ing External documents anymore for now (@include is deprecated) (proycon/folia#87)
  • Loading branch information
proycon committed Nov 16, 2020
1 parent e27b849 commit af1817f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 34 deletions.
7 changes: 2 additions & 5 deletions include/libfolia/folia_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2591,17 +2591,14 @@ namespace folia {
friend void static_init();
public:
explicit External( Document *d = 0 ):
AbstractElement( PROPS, d ), _include(false) { classInit(); }
AbstractElement( PROPS, d ) { classInit(); }
External( const KWargs& a, Document *d = 0 ):
AbstractElement( PROPS, d ), _include(false) { classInit( a ); }
AbstractElement( PROPS, d ) { classInit( a ); }

FoliaElement* parseXml( const xmlNode * );
void resolve_external();
void setAttributes( KWargs& );
KWargs collectAttributes() const;
private:
static properties PROPS;
bool _include;
};

class Note: public AbstractStructureElement {
Expand Down
31 changes: 2 additions & 29 deletions src/folia_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -6039,39 +6039,12 @@ namespace folia {
*/
KWargs att = getAttributes( node );
setAttributes( att );
if ( _include ) {
/*if ( _include ) {
doc()->addExternal( this );
}
}*/
return this;
}

KWargs External::collectAttributes() const {
/// extract all Attribute-Value pairs for External
/*!
* \return a KWargs set of Attribute-value pairs
* inclusive: include
*/
KWargs atts = AbstractElement::collectAttributes();
if ( _include ) {
atts["include"] = "yes";
}
return atts;
}

void External::setAttributes( KWargs& kwargs ) {
/// set the External attributes given a set of Key-Value pairs.
/*!
* \param kwargs a KWargs set of Key-Value pairs
*
* checks and sets the special attributes for External: include
*/
string value = kwargs.extract( "include" );
if ( !value.empty() ) {
_include = TiCC::stringTo<bool>( value );
}
AbstractElement::setAttributes(kwargs);
}

void Note::setAttributes( KWargs& kwargs ) {
/// set the Node attributes given a set of Key-Value pairs.
/*!
Expand Down

0 comments on commit af1817f

Please sign in to comment.