From e3227975c0f42ff23d528f5ab94b4538c8af764c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 24 Sep 2021 16:01:12 +0200 Subject: 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 Tested-by: Jenkins --- sw/source/core/doc/fmtcol.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sw/source/core/doc/fmtcol.cxx') 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 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); } -- cgit