summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-10-24 12:37:04 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-10-24 13:08:42 +0200
commit8189fb2bf236abf047c00216c3b3b9d64663baf8 (patch)
tree6017e6fabdee0c1183c5f4f978499ca7c1bc23b3
parent195ca828bb0ce5ce0e545eb6deb90f0c25f06fd9 (diff)
writerfilter: implement TblStylePrHandler::getInteropGrabBag
With this, we can store tblPr (itself, not yet its child elements) inside table styles. Change-Id: I7e9008fec566e73c50c4ccfc565fd0e8a3293998
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx19
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.hxx3
-rw-r--r--writerfilter/source/dmapper/TblStylePrHandler.cxx7
-rw-r--r--writerfilter/source/dmapper/TblStylePrHandler.hxx1
4 files changed, 29 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 6a19538f5cfb..1dfac1532733 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -177,9 +177,21 @@ beans::PropertyValue TableStyleSheetEntry::GetInteropGrabBag()
{
beans::PropertyValue aRet;
aRet.Name = sStyleName;
+
+ 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;
+
+ aRet.Value = uno::makeAny(aSeq);
return aRet;
}
+void TableStyleSheetEntry::AppendInteropGrabBag(beans::PropertyValue aValue)
+{
+ m_aInteropGrabBag.push_back(aValue);
+}
+
void lcl_mergeProps( PropertyMapPtr pToFill, PropertyMapPtr pToAdd, TblStyleType nStyleId )
{
static const PropertyIds pPropsToCheck[] =
@@ -560,16 +572,21 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
PropertyMapPtr pProps = pTblStylePrHandler->getProperties( );
StyleSheetEntry * pEntry = m_pImpl->m_pCurrentEntry.get();
+ TableStyleSheetEntry * pTableEntry = dynamic_cast<TableStyleSheetEntry*>( pEntry );
if (nType == TBL_STYLE_UNKNOWN)
{
pEntry->pProperties->InsertProps(pProps);
}
else
{
- TableStyleSheetEntry * pTableEntry = dynamic_cast<TableStyleSheetEntry*>( pEntry );
if (pTableEntry != NULL)
pTableEntry->AddTblStylePr( nType, pProps );
}
+
+ if (nSprmId == NS_ooxml::LN_CT_Style_tblPr)
+ {
+ pTableEntry->AppendInteropGrabBag(pTblStylePrHandler->getInteropGrabBag("tblPr"));
+ }
}
break;
}
diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx
index c415ec343aef..cb6b9af396f3 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.hxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.hxx
@@ -124,6 +124,8 @@ private:
StyleSheetTable* m_pStyleSheet;
TblStylePrs m_aStyles;
+ std::vector<beans::PropertyValue> m_aInteropGrabBag;
+
public:
short m_nColBandSize;
@@ -141,6 +143,7 @@ public:
// @param pStack already processed StyleSheetEntries
PropertyMapPtr GetProperties( sal_Int32 nMask, StyleSheetEntryDequePtr pStack = StyleSheetEntryDequePtr());
+ void AppendInteropGrabBag(beans::PropertyValue aValue);
beans::PropertyValue GetInteropGrabBag();
TableStyleSheetEntry( StyleSheetEntry& aEntry, StyleSheetTable* pStyles );
diff --git a/writerfilter/source/dmapper/TblStylePrHandler.cxx b/writerfilter/source/dmapper/TblStylePrHandler.cxx
index dd131104222f..4ef5fa05a6ff 100644
--- a/writerfilter/source/dmapper/TblStylePrHandler.cxx
+++ b/writerfilter/source/dmapper/TblStylePrHandler.cxx
@@ -106,6 +106,13 @@ void TblStylePrHandler::resolveSprmProps(Sprm & rSprm)
pProperties->resolve(*this);
}
+beans::PropertyValue TblStylePrHandler::getInteropGrabBag(OUString aName)
+{
+ beans::PropertyValue aRet;
+ aRet.Name = aName;
+ return aRet;
+}
+
}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/TblStylePrHandler.hxx b/writerfilter/source/dmapper/TblStylePrHandler.hxx
index f44c6853be2d..b60756598d8f 100644
--- a/writerfilter/source/dmapper/TblStylePrHandler.hxx
+++ b/writerfilter/source/dmapper/TblStylePrHandler.hxx
@@ -69,6 +69,7 @@ public:
inline PropertyMapPtr getProperties() { return m_pProperties; };
inline TblStyleType getType() { return m_nType; };
+ beans::PropertyValue getInteropGrabBag(OUString aName);
private: