diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-07 13:16:30 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-07 14:21:55 +0100 |
commit | b4577903f572ebb21641b4444c630c76ef5accf4 (patch) | |
tree | c76c8322f0f8cd47b7319e2f26d8b240299d5e78 | |
parent | 14641f650e548ad3341809a22deb46f5ec93fa24 (diff) |
DOCX import: handle NS_ooxml::LN_CT_Style_autoRedefine
Change-Id: I8c2c0ca8d060e2c460d0f36aed3050ed335fb3a3
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.hxx | 1 |
3 files changed, 10 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 432aae158d0c..f96095db8c9e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1310,6 +1310,7 @@ DECLARE_OOXML_TEST(testStyleInheritance, "style-inheritance.docx") assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:locked", 1); assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']", "customStyle", "1"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']/w:autoRedefine", 1); } DECLARE_OOXML_TEST(testCalendar1, "calendar1.docx") diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index fcb04fbd9428..b34273ace4ce 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -64,6 +64,7 @@ StyleSheetEntry::StyleSheetEntry() : ,sBaseStyleIdentifier() ,sNextStyleIdentifier() ,pProperties(new StyleSheetPropertyMap) + ,bAutoRedefine(false) { } @@ -586,12 +587,14 @@ 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_autoRedefine: case NS_ooxml::LN_CT_Style_hidden: case NS_ooxml::LN_CT_Style_personal: case NS_ooxml::LN_CT_Style_personalCompose: case NS_ooxml::LN_CT_Style_personalReply: break; + case NS_ooxml::LN_CT_Style_autoRedefine: + m_pImpl->m_pCurrentEntry->bAutoRedefine = nIntValue; + break; case NS_ooxml::LN_CT_Style_tcPr: { writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); @@ -1198,11 +1201,14 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) } beans::PropertyValues aGrabBag = pEntry->GetInteropGrabBagSeq(); + uno::Reference<beans::XPropertySet> xPropertySet(xStyle, uno::UNO_QUERY); if (aGrabBag.hasElements()) { - uno::Reference<beans::XPropertySet> xPropertySet(xStyle, uno::UNO_QUERY); xPropertySet->setPropertyValue("StyleInteropGrabBag", uno::makeAny(aGrabBag)); } + + if (pEntry->bAutoRedefine) + xPropertySet->setPropertyValue("IsAutoUpdate", uno::makeAny(sal_True)); } else if(pEntry->nStyleTypeCode == STYLE_TYPE_TABLE) { diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx index 25c3065f800e..d74eadfc83f3 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.hxx +++ b/writerfilter/source/dmapper/StyleSheetTable.hxx @@ -67,6 +67,7 @@ public: OUString sConvertedStyleName; std::vector<beans::PropertyValue> aLatentStyles; ///< Attributes of latentStyles std::vector<beans::PropertyValue> aLsdExceptions; ///< List of lsdException attribute lists + bool bAutoRedefine; ///< Writer calls this auto-update. void AppendInteropGrabBag(beans::PropertyValue aValue); beans::PropertyValue GetInteropGrabBag(); ///< Used for table styles, has a name. |