Kaydet (Commit) 5ecd8a55 authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX filter: handle char style's qFormat, rsid and friends

Change-Id: Ie0bc9aff722d87fcd246d0cf1971ad6f34f0996a
üst cad4afbd
......@@ -1311,6 +1311,9 @@ DECLARE_OOXML_TEST(testStyleInheritance, "style-inheritance.docx")
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']", "customStyle", "1");
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']/w:autoRedefine", 1);
// Additional char style properties should be also roundtripped.
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='DefaultParagraphFont']", "default", "1");
}
DECLARE_OOXML_TEST(testCalendar1, "calendar1.docx")
......
......@@ -3596,7 +3596,7 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
bool bQFormat = false, bUnhideWhenUsed = false, bSemiHidden = false, bLocked = false, bDefault = false, bCustomStyle = false;
OUString aLink, aRsid, aUiPriority;
FastAttributeList* pStyleAttributeList = m_pSerializer->createAttrList();
if (eType == STYLE_TYPE_PARA)
if (eType == STYLE_TYPE_PARA || eType == STYLE_TYPE_CHAR)
{
const SwFmt* pFmt = m_rExport.pStyles->GetSwFmt(nId);
uno::Any aAny;
......
......@@ -400,6 +400,12 @@ PropertyMapPtr StyleSheetTable::GetDefaultCharProps()
return m_pImpl->m_pDefaultCharProps;
}
// Does the given style type support InteropGrabBag?
bool lcl_wantGrabBag(StyleType eType)
{
return eType == STYLE_TYPE_TABLE || eType == STYLE_TYPE_PARA || eType == STYLE_TYPE_CHAR;
}
void StyleSheetTable::lcl_attribute(Id Name, Value & val)
{
OSL_ENSURE( m_pImpl->m_pCurrentEntry, "current entry has to be set here");
......@@ -485,7 +491,7 @@ void StyleSheetTable::lcl_attribute(Id Name, Value & val)
break;
case NS_ooxml::LN_CT_Style_default:
m_pImpl->m_pCurrentEntry->bIsDefaultStyle = (nIntValue != 0);
if(m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE || m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_PARA)
if(lcl_wantGrabBag(m_pImpl->m_pCurrentEntry->nStyleTypeCode))
{
beans::PropertyValue aValue;
aValue.Name = "default";
......@@ -494,7 +500,7 @@ void StyleSheetTable::lcl_attribute(Id Name, Value & val)
}
break;
case NS_ooxml::LN_CT_Style_customStyle:
if(m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE || m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_PARA)
if(lcl_wantGrabBag(m_pImpl->m_pCurrentEntry->nStyleTypeCode))
{
beans::PropertyValue aValue;
aValue.Name = "customStyle";
......@@ -617,7 +623,7 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
case NS_ooxml::LN_CT_Style_uiPriority:
case NS_ooxml::LN_CT_Style_link:
case NS_ooxml::LN_CT_Style_locked:
if(m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE || m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_PARA)
if(lcl_wantGrabBag(m_pImpl->m_pCurrentEntry->nStyleTypeCode))
{
StyleSheetEntryPtr pEntry = m_pImpl->m_pCurrentEntry;
beans::PropertyValue aValue;
......
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