summaryrefslogtreecommitdiff
path: root/xmloff/source/text
diff options
context:
space:
mode:
authorBernhard Widl <bernhard.widl@cib.de>2017-11-15 19:30:28 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-07-06 10:21:48 +0200
commit7a586a9c6bf28088c72f163d724d1cb3259e7920 (patch)
tree2678e802b147c3f3e9663ee6b6bc7e82410600d9 /xmloff/source/text
parentd3e8be155c4483642b71b00f44cb057beb68f70f (diff)
tdf#101856 create bookmarks w/ new hidden/cond attrs, save as odt
Committer's note: this is forward ported from 5.2+backports branch, with numerous conflicts. tdf#101856 add new checkbox/editfield for hidden/condition attrs Conflicts: sw/uiconfig/swriter/ui/insertbookmark.ui Author: Bernhard Widl <bernhard.widl@cib.de> (cherry picked from commit c347e00821791377731ab32acd103ea006f3cc1b) tdf#101856 Fix crash in Insert Bookmark dialog Author: Serge Krot <Serge.Krot@cib.de> Reviewed-on: https://gerrit.libreoffice.org/50616 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit bcc16920eec647f2a3753d60c4d969862f272942) Change-Id: Ib1df7a4c1477693aa2d0ec067635cdcbd393cebd Reviewed-on: https://gerrit.libreoffice.org/46820 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'xmloff/source/text')
-rw-r--r--xmloff/source/text/txtparae.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 36c161abc79c..099a7385c1cf 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2495,6 +2495,30 @@ void XMLTextParagraphExport::exportTextMark(
GetExport().AddAttributesRDFa(xTextContent);
}
+ // bookmark-start: add attributes hidden and condition
+ if (nElement == 1)
+ {
+ Reference<XPropertySet> bkmkProps(rPropSet->getPropertyValue(rProperty), UNO_QUERY);
+ Reference<XPropertySetInfo> bkmkPropInfo(bkmkProps->getPropertySetInfo(), UNO_QUERY);
+ OUString sHidden("BookmarkHidden");
+ if (bkmkPropInfo->hasPropertyByName(sHidden))
+ {
+ bool bHidden = false;
+ bkmkProps->getPropertyValue(sHidden) >>= bHidden;
+ if (bHidden)
+ {
+ GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, "hidden", "true");
+ OUString sCondition("BookmarkCondition");
+ if (bkmkPropInfo->hasPropertyByName(sCondition))
+ {
+ OUString sBookmarkCondition;
+ bkmkProps->getPropertyValue(sCondition) >>= sBookmarkCondition;
+ GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, "condition", sBookmarkCondition);
+ }
+ }
+ }
+ }
+
// export element
assert(pElements != nullptr);
assert(0 <= nElement && nElement <= 2);