diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-09-24 16:01:12 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-09-24 19:57:47 +0200 |
commit | e3227975c0f42ff23d528f5ab94b4538c8af764c (patch) | |
tree | ef05108a117163994f4204b0c434acef27e74e64 /sw/source/core/doc/fmtcol.cxx | |
parent | 5f19e2679c3d402fbc3de0b64d5ca3e411db711d (diff) |
sw: paragraph styles: add doc model & UNO API for a linked character style
And the same in the other direction: link a para style from a char
style.
Towards getting this info out of the grab-bag, so we can store it also
in ODF, as currently this is only kept for DOCX -> DOCX conversions, via
the style grab-bags.
Change-Id: I21691dafce0bc216d041fc8ecb16b162d293739e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122595
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/core/doc/fmtcol.cxx')
-rw-r--r-- | sw/source/core/doc/fmtcol.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index bf7a8f02f78d..e35e523b6a92 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -325,6 +325,10 @@ void SwTextFormatColl::SwClientNotify(const SwModify& rModify, const SfxHint& rH SwFormatColl::SwClientNotify(rModify, rHint); } +void SwTextFormatColl::SetLinkedCharFormat(SwCharFormat& rLink) { mpLinkedCharFormat = &rLink; } + +const SwCharFormat* SwTextFormatColl::GetLinkedCharFormat() const { return mpLinkedCharFormat; } + bool SwTextFormatColl::IsAtDocNodeSet() const { SwIterator<SwContentNode,SwFormatColl> aIter( *this ); @@ -475,6 +479,16 @@ void SwTextFormatColl::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*this).name())); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr())); + if (mpNextTextFormatColl) + { + (void)xmlTextWriterWriteAttribute( + pWriter, BAD_CAST("next"), BAD_CAST(mpNextTextFormatColl->GetName().toUtf8().getStr())); + } + if (mpLinkedCharFormat) + { + (void)xmlTextWriterWriteAttribute( + pWriter, BAD_CAST("linked"), BAD_CAST(mpLinkedCharFormat->GetName().toUtf8().getStr())); + } GetAttrSet().dumpAsXml(pWriter); (void)xmlTextWriterEndElement(pWriter); } |