[Libreoffice-commits] core.git: xmloff/source
Michael Stahl (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 23 13:44:24 UTC 2021
xmloff/source/text/XMLTextMarkImportContext.cxx | 12 +++++++++---
xmloff/source/text/XMLTextMarkImportContext.hxx | 2 ++
2 files changed, 11 insertions(+), 3 deletions(-)
New commits:
commit fbe183bbb05220a4ccc51952445b1797bb498403
Author: Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Fri Aug 20 20:28:48 2021 +0200
Commit: Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Mon Aug 23 15:43:50 2021 +0200
xmloff: avoid annoying warnings about bookmark conditions
Change-Id: I7bb15c0ab46eee1554977b275b1dfdaff8d1b0cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120794
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index 2017d8f21a3d..44f652aaf6fa 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -23,6 +23,7 @@
#include <rtl/ustring.hxx>
#include <sal/log.hxx>
#include <osl/diagnose.h>
+#include <sax/tools/converter.hxx>
#include <xmloff/xmluconv.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlimp.hxx>
@@ -95,6 +96,7 @@ XMLTextMarkImportContext::XMLTextMarkImportContext(
: SvXMLImportContext(rImport)
, m_rHelper(rHlp)
, m_rxCrossRefHeadingBookmark(io_rxCrossRefHeadingBookmark)
+ , m_isHidden(false)
, m_bHaveAbout(false)
{
}
@@ -166,9 +168,7 @@ void XMLTextMarkImportContext::startFastElement( sal_Int32 nElement,
if ((nElement & TOKEN_MASK) == XML_BOOKMARK_START)
{
- const OUString sHidden = xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_HIDDEN));
- const OUString sCondition = xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_CONDITION));
- m_rHelper.setBookmarkAttributes(m_sBookmarkName, sHidden == "true", sCondition);
+ m_rHelper.setBookmarkAttributes(m_sBookmarkName, m_isHidden, m_sCondition);
}
}
@@ -539,6 +539,12 @@ bool XMLTextMarkImportContext::FindName(
case XML_ELEMENT(FIELD, XML_TYPE):
m_sFieldName = sValue;
break;
+ case XML_ELEMENT(LO_EXT, XML_HIDDEN):
+ ::sax::Converter::convertBool(m_isHidden, sValue);
+ break;
+ case XML_ELEMENT(LO_EXT, XML_CONDITION):
+ m_sCondition = sValue;
+ break;
default:
XMLOFF_WARN_UNKNOWN("xmloff", aIter);
}
diff --git a/xmloff/source/text/XMLTextMarkImportContext.hxx b/xmloff/source/text/XMLTextMarkImportContext.hxx
index ccf04e55deeb..407cddbadf7f 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.hxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.hxx
@@ -65,6 +65,8 @@ private:
OUString m_sBookmarkName;
OUString m_sFieldName;
+ bool m_isHidden;
+ OUString m_sCondition;
OUString m_sXmlId;
// RDFa
bool m_bHaveAbout;
More information about the Libreoffice-commits
mailing list