Kaydet (Commit) 412b1f8d authored tarafından Serge Krot's avatar Serge Krot Kaydeden (comit) Michael Stahl

tdf#101856 Backport parsing of bookmark properties

Change-Id: I7654aa93d4d86a5d36201832ac3609b9f4c30e03
Reviewed-on: https://gerrit.libreoffice.org/50565Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit 88b6b1a8)
Reviewed-on: https://gerrit.libreoffice.org/56958
Tested-by: Jenkins
Reviewed-by: 's avatarMichael Stahl <Michael.Stahl@cib.de>
üst 7a586a9c
......@@ -711,6 +711,11 @@ public:
void AddCrossRefHeadingMapping(OUString const& rFrom, OUString const& rTo);
void MapCrossRefHeadingFieldsHorribly();
void setBookmarkAttributes(bool hidden, OUString const& condition);
bool getBookmarkHidden();
const OUString& getBookmarkCondition();
};
#endif
......
......@@ -204,6 +204,8 @@ private:
const OUString sTextFieldStart;
const OUString sTextFieldEnd;
const OUString sTextFieldStartEnd;
const OUString m_sBookmarkHidden;
const OUString m_sBookmarkCondition;
protected:
const OUString sFrameStyleName;
......
......@@ -170,6 +170,13 @@ void XMLTextMarkImportContext::StartElement(
}
m_rHelper.pushFieldCtx( m_sBookmarkName, m_sFieldName );
}
if (IsXMLToken(GetLocalName(), XML_BOOKMARK_START))
{
OUString sHidden = xAttrList->getValueByName("loext:hidden");
OUString sCondition = xAttrList->getValueByName("loext:condition");
m_rHelper.setBookmarkAttributes(sHidden == "true", sCondition);
}
}
void XMLTextMarkImportContext::EndElement()
......@@ -346,6 +353,12 @@ void XMLTextMarkImportContext::EndElement()
GetImport().GetRDFaImportHelper().AddRDFa(
xMeta, xRDFaAttributes);
}
const Reference<XPropertySet> xPropertySet(xContent, UNO_QUERY);
if (xPropertySet.is())
{
xPropertySet->setPropertyValue("BookmarkHidden", uno::Any(m_rHelper.getBookmarkHidden()));
xPropertySet->setPropertyValue("BookmarkCondition", uno::Any(m_rHelper.getBookmarkCondition()));
}
}
if (nTmp==TypeFieldmarkEnd) {
......
......@@ -547,6 +547,9 @@ struct XMLTextImportHelper::Impl
// Used for frame deduplication, the name of the last frame imported directly before the current one
OUString msLastImportedFrameName;
bool m_bBookmarkHidden;
OUString m_sBookmarkCondition;
uno::Reference<text::XText> m_xText;
uno::Reference<text::XTextCursor> m_xCursor;
uno::Reference<text::XTextRange> m_xCursorAsRange;
......@@ -592,6 +595,7 @@ struct XMLTextImportHelper::Impl
bool const bProgress, bool const bBlockMode,
bool const bOrganizerMode)
: m_xTextListsHelper( new XMLTextListsHelper() )
, m_bBookmarkHidden( false )
// XML import: reconstrution of assignment of paragraph style to outline levels (#i69629#)
, m_xServiceFactory( rModel, UNO_QUERY )
, m_rSvXMLImport( rImport )
......@@ -2951,4 +2955,20 @@ void XMLTextImportHelper::MapCrossRefHeadingFieldsHorribly()
}
}
void XMLTextImportHelper::setBookmarkAttributes(bool hidden, OUString const& condition)
{
m_xImpl->m_bBookmarkHidden = hidden;
m_xImpl->m_sBookmarkCondition = condition;
}
bool XMLTextImportHelper::getBookmarkHidden()
{
return m_xImpl->m_bBookmarkHidden;
}
const OUString& XMLTextImportHelper::getBookmarkCondition()
{
return m_xImpl->m_sBookmarkCondition;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1248,6 +1248,8 @@ XMLTextParagraphExport::XMLTextParagraphExport(
sTextFieldStart( "TextFieldStart" ),
sTextFieldEnd( "TextFieldEnd" ),
sTextFieldStartEnd( "TextFieldStartEnd" ),
m_sBookmarkHidden("BookmarkHidden"),
m_sBookmarkCondition("BookmarkCondition"),
sFrameStyleName("FrameStyleName"),
aCharStyleNamesPropInfoCache( sCharStyleNames )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment