DOCX filter: roundtrip paragraph style link
Change-Id: Ide29e98b73410d8917742f2eeb15bdcbd9de87cc
This commit is contained in:
@@ -1304,6 +1304,8 @@ DECLARE_OOXML_TEST(testStyleInheritance, "style-inheritance.docx")
|
||||
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='ListParagraph']/w:uiPriority", "val", "34");
|
||||
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:qFormat", 1);
|
||||
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:rsid", "val", "00780346");
|
||||
|
||||
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:link", "val", "Heading1Char");
|
||||
}
|
||||
|
||||
DECLARE_OOXML_TEST(testCalendar1, "calendar1.docx")
|
||||
|
@@ -3617,17 +3617,19 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
|
||||
const uno::Sequence<beans::PropertyValue>& rGrabBag = aAny.get< uno::Sequence<beans::PropertyValue> >();
|
||||
|
||||
bool bQFormat = false, bUnhideWhenUsed = false;
|
||||
OUString aRsid, aUiPriority;
|
||||
OUString aLink, aRsid, aUiPriority;
|
||||
for (sal_Int32 i = 0; i < rGrabBag.getLength(); ++i)
|
||||
{
|
||||
if (rGrabBag[i].Name == "uiPriority")
|
||||
aUiPriority = rGrabBag[i].Value.get<OUString>();
|
||||
else if (rGrabBag[i].Name == "qFormat")
|
||||
bQFormat = true;
|
||||
else if (rGrabBag[i].Name == "link")
|
||||
aLink = rGrabBag[i].Value.get<OUString>();
|
||||
else if (rGrabBag[i].Name == "rsid")
|
||||
aRsid = rGrabBag[i].Value.get<OUString>();
|
||||
else if (rGrabBag[i].Name == "unhideWhenUsed")
|
||||
bUnhideWhenUsed = true;
|
||||
else if (rGrabBag[i].Name == "unhideWhenUsed")
|
||||
bUnhideWhenUsed = true;
|
||||
else
|
||||
SAL_WARN("sw.ww8", "Unhandled style property: " << rGrabBag[i].Name);
|
||||
}
|
||||
@@ -3640,6 +3642,10 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
|
||||
m_pSerializer->singleElementNS(XML_w, XML_qFormat, FSEND);
|
||||
if (bUnhideWhenUsed)
|
||||
m_pSerializer->singleElementNS(XML_w, XML_unhideWhenUsed, FSEND);
|
||||
if (!aLink.isEmpty())
|
||||
m_pSerializer->singleElementNS(XML_w, XML_link,
|
||||
FSNS(XML_w, XML_val), OUStringToOString(aLink, RTL_TEXTENCODING_UTF8).getStr(),
|
||||
FSEND);
|
||||
if (!aRsid.isEmpty())
|
||||
m_pSerializer->singleElementNS(XML_w, XML_rsid,
|
||||
FSNS(XML_w, XML_val), OUStringToOString(aRsid, RTL_TEXTENCODING_UTF8).getStr(),
|
||||
|
@@ -588,7 +588,6 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
|
||||
m_pImpl->m_pCurrentEntry->sNextStyleIdentifier = sStringValue;
|
||||
break;
|
||||
case NS_ooxml::LN_CT_Style_aliases:
|
||||
case NS_ooxml::LN_CT_Style_link:
|
||||
case NS_ooxml::LN_CT_Style_autoRedefine:
|
||||
case NS_ooxml::LN_CT_Style_hidden:
|
||||
case NS_ooxml::LN_CT_Style_locked:
|
||||
@@ -616,11 +615,14 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
|
||||
case NS_ooxml::LN_CT_Style_semiHidden:
|
||||
case NS_ooxml::LN_CT_Style_unhideWhenUsed:
|
||||
case NS_ooxml::LN_CT_Style_uiPriority:
|
||||
case NS_ooxml::LN_CT_Style_link:
|
||||
if(m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE || m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_PARA)
|
||||
{
|
||||
StyleSheetEntryPtr pEntry = m_pImpl->m_pCurrentEntry;
|
||||
beans::PropertyValue aValue;
|
||||
if (nSprmId == NS_ooxml::LN_CT_Style_rsid)
|
||||
switch (nSprmId)
|
||||
{
|
||||
case NS_ooxml::LN_CT_Style_rsid:
|
||||
{
|
||||
// We want the rsid as a hex string, but always with the length of 8.
|
||||
OUStringBuffer aBuf = OUString::number(nIntValue, 16);
|
||||
@@ -631,17 +633,31 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
|
||||
aValue.Name = "rsid";
|
||||
aValue.Value = uno::makeAny(aStr.makeStringAndClear());
|
||||
}
|
||||
else if (nSprmId == NS_ooxml::LN_CT_Style_qFormat)
|
||||
break;
|
||||
case NS_ooxml::LN_CT_Style_qFormat:
|
||||
aValue.Name = "qFormat";
|
||||
else if (nSprmId == NS_ooxml::LN_CT_Style_semiHidden)
|
||||
break;
|
||||
case NS_ooxml::LN_CT_Style_semiHidden:
|
||||
aValue.Name = "semiHidden";
|
||||
else if (nSprmId == NS_ooxml::LN_CT_Style_unhideWhenUsed)
|
||||
break;
|
||||
case NS_ooxml::LN_CT_Style_unhideWhenUsed:
|
||||
aValue.Name = "unhideWhenUsed";
|
||||
else
|
||||
break;
|
||||
case NS_ooxml::LN_CT_Style_uiPriority:
|
||||
{
|
||||
aValue.Name = "uiPriority";
|
||||
aValue.Value = uno::makeAny(OUString::number(nIntValue));
|
||||
}
|
||||
break;
|
||||
case NS_ooxml::LN_CT_Style_link:
|
||||
{
|
||||
aValue.Name = "link";
|
||||
aValue.Value = uno::makeAny(sStringValue);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
pEntry->AppendInteropGrabBag(aValue);
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user