summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-11-08 09:47:50 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-11-08 09:53:13 +0100
commit5ecd8a55ee494c1150ec552a9002c6991371437c (patch)
tree6ae9142163a328d4ead79868c4087699d097b1fc
parentcad4afbd1444fe410aef014b01008b03ed4ecbf5 (diff)
DOCX filter: handle char style's qFormat, rsid and friends
Change-Id: Ie0bc9aff722d87fcd246d0cf1971ad6f34f0996a
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx3
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx12
3 files changed, 13 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d431a60d901f..c6af87de21e7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -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")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4ca41e41b4ba..eaae87870579 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -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;
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index b34273ace4ce..57c2c98a2fc3 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -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;