Skip to content

Commit

Permalink
implemented ADD_FORMATTING text policy for HSpace and Hypbreak
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed Feb 14, 2023
1 parent 5b9ff15 commit e76d4eb
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/folia_subclasses.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2964,18 +2964,25 @@ namespace folia {
const UnicodeString TextMarkupHSpace::private_text( const TextPolicy& tp ) const {
/// get the UnicodeString value of a TextMarkupHSpace element
/*!
* \param tp the TextPolicy to use. (ignored except for debug)
* \return A single space.
* \param tp the TextPolicy to use
\return One space OR the embedded XmlText value if ADD_FORMATTING is set
*/
if ( tp.debug() ){
cerr << "TEXT MARKUP HSPACE " << " return ' '" << endl;
if ( tp.is_set( TEXT_FLAGS::ADD_FORMATTING ) ){
return AbstractElement::private_text( tp );
}
else {
return " ";
}
return " ";
}

const UnicodeString Hyphbreak::private_text( const TextPolicy& tp ) const {
/// get the UnicodeString value of a Hyphbreak element
/*!
* \param tp the TextPolicy to use
\return One space OR the embedded XmlText value if ADD_FORMATTING is set
*/
if ( tp.is_set( TEXT_FLAGS::ADD_FORMATTING ) ){
return TiCC::UnicodeFromUTF8(cls());
return AbstractElement::private_text( tp );
}
else {
return "";
Expand Down

0 comments on commit e76d4eb

Please sign in to comment.