From 27482e865d1fc8d66d9a11fa524ceddf9d982833 Mon Sep 17 00:00:00 2001 From: Laurent Alonso Date: Mon, 7 May 2012 10:52:13 +0200 Subject: [PATCH] Add possibility of generating foot/endnotes with text labels --- writerperfect/source/filter/OdtGenerator.cxx | 26 +++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/writerperfect/source/filter/OdtGenerator.cxx b/writerperfect/source/filter/OdtGenerator.cxx index 10443b90371e..16bc97b1045f 100644 --- a/writerperfect/source/filter/OdtGenerator.cxx +++ b/writerperfect/source/filter/OdtGenerator.cxx @@ -852,8 +852,17 @@ void OdtGenerator::openFootnote(const WPXPropertyList &propList) } mpImpl->mpCurrentContentElements->push_back(pOpenFootNote); - mpImpl->mpCurrentContentElements->push_back(new TagOpenElement("text:note-citation")); - if (propList["libwpd:number"]) + TagOpenElement *pOpenFootCitation = new TagOpenElement("text:note-citation"); + if (propList["text:label"]) + { + WPXString tmpString(propList["text:label"]->getStr(),true); + pOpenFootCitation->addAttribute("text:label", tmpString); + } + mpImpl->mpCurrentContentElements->push_back(pOpenFootCitation); + + if (propList["text:label"]) + mpImpl->mpCurrentContentElements->push_back(new CharDataElement(propList["text:label"]->getStr().cstr())); + else if (propList["libwpd:number"]) mpImpl->mpCurrentContentElements->push_back(new CharDataElement(propList["libwpd:number"]->getStr().cstr())); mpImpl->mpCurrentContentElements->push_back(new TagCloseElement("text:note-citation")); @@ -885,8 +894,17 @@ void OdtGenerator::openEndnote(const WPXPropertyList &propList) } mpImpl->mpCurrentContentElements->push_back(pOpenEndNote); - mpImpl->mpCurrentContentElements->push_back(new TagOpenElement("text:note-citation")); - if (propList["libwpd:number"]) + TagOpenElement *pOpenEndCitation = new TagOpenElement("text:note-citation"); + if (propList["text:label"]) + { + WPXString tmpString(propList["text:label"]->getStr(),true); + pOpenEndCitation->addAttribute("text:label", tmpString); + } + mpImpl->mpCurrentContentElements->push_back(pOpenEndCitation); + + if (propList["text:label"]) + mpImpl->mpCurrentContentElements->push_back(new CharDataElement(propList["text:label"]->getStr().cstr())); + else if (propList["libwpd:number"]) mpImpl->mpCurrentContentElements->push_back(new CharDataElement(propList["libwpd:number"]->getStr().cstr())); mpImpl->mpCurrentContentElements->push_back(new TagCloseElement("text:note-citation"));