diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-06 14:55:31 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-06 16:53:54 +0100 |
commit | 3ebfef72037f9b4e33e9ca77fae0d03706ef5d83 (patch) | |
tree | 0dcc06517ccbe9872743c9ceacbbf4f91a8ffd3b /writerfilter | |
parent | d66029491060db5f45532d0a7e3e3c52b4b11d1e (diff) |
DOCX import of para style's qFormat, rsid and friends
Load these into the new style-level InteropGrabBag.
Change-Id: I89b138c334dd3de36b97ef103d5483ca141a6585
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 27 | ||||
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.hxx | 4 |
2 files changed, 23 insertions, 8 deletions
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 28e151003a0d..b60e667af21a 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -173,16 +173,22 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask, StyleSheetE return pProps; } -beans::PropertyValue StyleSheetEntry::GetInteropGrabBag() +beans::PropertyValues StyleSheetEntry::GetInteropGrabBagSeq() { - beans::PropertyValue aRet; - aRet.Name = sStyleIdentifierI; - uno::Sequence<beans::PropertyValue> aSeq(m_aInteropGrabBag.size()); beans::PropertyValue* pSeq = aSeq.getArray(); for (std::vector<beans::PropertyValue>::iterator i = m_aInteropGrabBag.begin(); i != m_aInteropGrabBag.end(); ++i) *pSeq++ = *i; + return aSeq; +} + +beans::PropertyValue StyleSheetEntry::GetInteropGrabBag() +{ + beans::PropertyValue aRet; + aRet.Name = sStyleIdentifierI; + + beans::PropertyValues aSeq = GetInteropGrabBagSeq();; aRet.Value = uno::makeAny(aSeq); return aRet; } @@ -609,9 +615,9 @@ 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: - if(m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE) + if(m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE || m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_PARA) { - TableStyleSheetEntry* pTableEntry = static_cast<TableStyleSheetEntry *>(m_pImpl->m_pCurrentEntry.get()); + StyleSheetEntryPtr pEntry = m_pImpl->m_pCurrentEntry; beans::PropertyValue aValue; if (nSprmId == NS_ooxml::LN_CT_Style_rsid) { @@ -629,7 +635,7 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm) aValue.Name = "uiPriority"; aValue.Value = uno::makeAny(nIntValue); } - pTableEntry->AppendInteropGrabBag(aValue); + pEntry->AppendInteropGrabBag(aValue); } break; case NS_ooxml::LN_CT_Style_tblPr: //contains table properties @@ -1166,6 +1172,13 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) { xStyles->insertByName( sConvertedStyleName, uno::makeAny( xStyle) ); } + + beans::PropertyValues aGrabBag = pEntry->GetInteropGrabBagSeq(); + if (aGrabBag.hasElements()) + { + uno::Reference<beans::XPropertySet> xPropertySet(xStyle, uno::UNO_QUERY); + xPropertySet->setPropertyValue("StyleInteropGrabBag", uno::makeAny(aGrabBag)); + } } else if(pEntry->nStyleTypeCode == STYLE_TYPE_TABLE) { diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx index db9be282cbb6..25c3065f800e 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.hxx +++ b/writerfilter/source/dmapper/StyleSheetTable.hxx @@ -24,6 +24,7 @@ #include <WriterFilterDllApi.hxx> #include <dmapper/DomainMapper.hxx> #include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/beans/PropertyValues.hpp> #include <PropertyMap.hxx> #include <FontTable.hxx> #include <resourcemodel/LoggedResources.hxx> @@ -68,7 +69,8 @@ public: std::vector<beans::PropertyValue> aLsdExceptions; ///< List of lsdException attribute lists void AppendInteropGrabBag(beans::PropertyValue aValue); - beans::PropertyValue GetInteropGrabBag(); + beans::PropertyValue GetInteropGrabBag(); ///< Used for table styles, has a name. + beans::PropertyValues GetInteropGrabBagSeq(); ///< Used for existing styles, just a list of properties. StyleSheetEntry(); virtual ~StyleSheetEntry(); |