summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-04-02 16:39:06 +0200
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-04-03 09:59:18 +0200
commit3e9d9b073f1b8fd934e00c8cff69fb0f9ef40781 (patch)
tree69dabaae819794676cf757e397ca169704e91702 /writerfilter/source/dmapper/DomainMapperTableHandler.cxx
parenta3efbb5d33f5c6928141fd3e7aa7c6d3bdc6a087 (diff)
oox: Preserve table style.
Table style is a property that defines a set of background and line attributes for cells. These attributes depend on theme settings (e.g. theme colors). We added a grabbag to the table object to save the table style name. We detect that name on export and write it back to the document. Finally, modified an existing unit test to check this attribute too. TODO: To get the table style working properly after a roundtrip, we must preserve it and also check that its values are not being overwritten by different cell or table properties. Change-Id: Id0e022a389561960c21ab874db33649499735024
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapperTableHandler.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index a9a4221cf408..7ed56aa38700 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -340,6 +340,8 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
PropertyMap::iterator aTableStyleIter =
m_aTableProperties->find(META_PROP_TABLE_STYLE_NAME);
+ uno::Sequence< beans::PropertyValue > aGrabBag( 1 );
+ sal_Int32 nGrabBagSize = 0;
if(aTableStyleIter != m_aTableProperties->end())
{
// Apply table style properties recursively
@@ -350,6 +352,10 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
pTableStyle = dynamic_cast<TableStyleSheetEntry*>( pStyleSheet.get( ) );
m_aTableProperties->erase( aTableStyleIter );
+ aGrabBag[0].Name = "TableStyleName";
+ aGrabBag[0].Value = uno::makeAny( sTableStyleName );
+ nGrabBagSize++;
+
if( pStyleSheet )
{
// First get the style properties, then the table ones
@@ -394,6 +400,11 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
dmapper_logger->endElement();
#endif
+ if( nGrabBagSize > 0 )
+ {
+ m_aTableProperties->Insert( PROP_TABLE_INTEROP_GRAB_BAG, uno::makeAny( aGrabBag ) );
+ }
+
m_aTableProperties->getValue( TablePropertyMap::GAP_HALF, nGapHalf );
m_aTableProperties->getValue( TablePropertyMap::LEFT_MARGIN, nLeftMargin );