diff --git a/dw/textblock.cc b/dw/textblock.cc index 532faa0..a87971b 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -282,7 +282,7 @@ Textblock::~Textblock () for( const Anchor &anchor: anchors ) { /* This also frees the names (see removeAnchor() and related). */ - removeAnchor(anchor.name); + removeAnchor(std::string{ anchor.name }); } delete paragraphs; @@ -721,7 +721,7 @@ void Textblock::sizeAllocateImpl (core::Allocation *allocation) Line *line = lines->getRef(findLineOfWord (anchor->wordIndex)); y = lineYOffsetCanvas (line, allocation); } - changeAnchor (anchor->name, y); + changeAnchor (std::string{ anchor->name }, y); } DBG_OBJ_LEAVE (); @@ -2584,7 +2584,7 @@ bool Textblock::addAnchor (const std::string &name, core::style::Style *style) anchors.emplace_back(); Anchor &anchor= anchors.back(); - anchor.name = copy; + anchor.name = copy.value(); anchor.wordIndex = words->size(); result = true; }