diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/prstylei.cxx | 24 | ||||
-rw-r--r-- | xmloff/source/style/styleexp.cxx | 13 | ||||
-rw-r--r-- | xmloff/source/style/xmlstyle.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/token/tokens.txt | 1 |
5 files changed, 43 insertions, 0 deletions
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 1e682a39fcb1..52ecd9038cbb 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3440,6 +3440,8 @@ namespace xmloff::token { TOKEN("rtl", XML_RTL ), TOKEN("symmetric", XML_SYMMETRIC ), + TOKEN("linked-style-name", XML_LINKED_STYLE_NAME ), + #if OSL_DEBUG_LEVEL > 0 { 0, nullptr, std::nullopt, XML_TOKEN_END } diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index e9ca87595f2b..5cd856b209e8 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -509,6 +509,30 @@ void XMLPropStyleContext::Finish( bool bOverwrite ) } } + // Connect linked style. + OUString aLinked(GetLinked()); + if (!aLinked.isEmpty()) + { + if (GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH) + { + aLinked = GetImport().GetStyleDisplayName(XmlStyleFamily::TEXT_TEXT, aLinked); + } + else if (GetFamily() == XmlStyleFamily::TEXT_TEXT) + { + aLinked = GetImport().GetStyleDisplayName(XmlStyleFamily::TEXT_PARAGRAPH, aLinked); + } + } + if (!aLinked.isEmpty() && xPropSetInfo->hasPropertyByName("LinkStyle")) + { + uno::Any aAny = xPropSet->getPropertyValue("LinkStyle"); + OUString aCurrentLinked; + aAny >>= aCurrentLinked; + if (aCurrentLinked != aLinked) + { + xPropSet->setPropertyValue("LinkStyle", uno::Any(aLinked)); + } + } + if ( xPropSetInfo->hasPropertyByName( "Hidden" ) ) { xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) ); diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index 2c628ffbda4d..1a3a81f10c95 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -237,6 +237,19 @@ bool XMLStyleExport::exportStyle( } } + // style:linked-style-name="..." (SW paragraph and character styles only) + if (xPropSetInfo->hasPropertyByName("LinkStyle")) + { + aAny = xPropSet->getPropertyValue("LinkStyle"); + OUString sLinkName; + aAny >>= sLinkName; + if (!sLinkName.isEmpty()) + { + GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, XML_LINKED_STYLE_NAME, + GetExport().EncodeStyleName(sLinkName)); + } + } + // style:auto-update="..." (SW only) if( xPropSetInfo->hasPropertyByName( gsIsAutoUpdate ) ) { diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index 38ec932fe132..00afedf82a39 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -88,6 +88,9 @@ void SvXMLStyleContext::SetAttribute( sal_Int32 nElement, case XML_ELEMENT(STYLE, XML_NEXT_STYLE_NAME): maFollow = rValue; break; + case XML_ELEMENT(LO_EXT, XML_LINKED_STYLE_NAME): + maLinked = rValue; + break; case XML_ELEMENT(STYLE, XML_HIDDEN): mbHidden = rValue.toBoolean(); break; diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index f52e9c492db9..395dffe62cf1 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -3185,4 +3185,5 @@ movablelimits rspace rtl symmetric +linked-style-name TOKEN_END_DUMMY |