summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-09-22 11:59:14 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-09-26 08:31:05 +0200
commit599e5096ba7bde1c88120376b12f3f691847f17d (patch)
tree0dff219d640ffd532da30082a69bc28943f97b68 /oox
parentef0f5acbf2bb177526ff54e7b7cd09228fd7099d (diff)
bnc#897769: OOXML import: Import border lines using reference too.
Do not ignore 'lnRef' element. Also fix typo to apply 'seCell' properties to the right cell (southeast). Change-Id: Ia45f7016f358b70e6db06a232c569335ce9d7051 (cherry picked from commit 18898e13fda25fe6dc85318dd0711355c7b2cc26)
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/table/tablecell.cxx55
1 files changed, 33 insertions, 22 deletions
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index 583d7aa73709..baf49a657470 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -84,15 +84,26 @@ void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase,
aPropSet.setProperty( nPropId, aBorderLine );
}
-void applyBorder( TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::drawingml::LineProperties& rLineProperties )
+void applyBorder( const ::oox::core::XmlFilterBase& rFilterBase, TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::drawingml::LineProperties& rLineProperties )
{
std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >& rPartLineBorders( rTableStylePart.getLineBorders() );
+ ::oox::drawingml::ShapeStyleRef& rLineStyleRef = rTableStylePart.getStyleRefs()[ nLineType ];
std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >::const_iterator aIter( rPartLineBorders.find( nLineType ) );
if ( ( aIter != rPartLineBorders.end() ) && aIter->second.get() )
rLineProperties.assignUsed( *aIter->second );
+ else if (rLineStyleRef.mnThemedIdx != 0)
+ {
+ if (const Theme* pTheme = rFilterBase.getCurrentTheme())
+ {
+ rLineProperties.assignUsed( *pTheme->getLineStyle(rLineStyleRef.mnThemedIdx) );
+ sal_Int32 nPhClr = rLineStyleRef.maPhClr.getColor( rFilterBase.getGraphicHelper() );
+ rLineProperties.maLineFill.maFillColor.setSrgbClr( nPhClr );
+ }
+ }
}
-void applyTableStylePart( oox::drawingml::FillProperties& rFillProperties,
+void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase,
+ oox::drawingml::FillProperties& rFillProperties,
TextCharacterProperties& aTextCharProps,
oox::drawingml::LineProperties& rLeftBorder,
oox::drawingml::LineProperties& rRightBorder,
@@ -106,12 +117,12 @@ void applyTableStylePart( oox::drawingml::FillProperties& rFillProperties,
if ( rPartFillPropertiesPtr.get() )
rFillProperties.assignUsed( *rPartFillPropertiesPtr );
- applyBorder( rTableStylePart, XML_left, rLeftBorder );
- applyBorder( rTableStylePart, XML_right, rRightBorder );
- applyBorder( rTableStylePart, XML_top, rTopBorder );
- applyBorder( rTableStylePart, XML_bottom, rBottomBorder );
- applyBorder( rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder );
- applyBorder( rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder );
aTextCharProps.maLatinFont = rTableStylePart.getLatinFont();
aTextCharProps.maAsianFont = rTableStylePart.getAsianFont();
@@ -171,7 +182,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
oox::drawingml::LineProperties aLinePropertiesTopLeftToBottomRight;
oox::drawingml::LineProperties aLinePropertiesBottomLeftToTopRight;
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -182,7 +193,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
if ( rProperties.isFirstRow() && ( nRow == 0 ) )
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -193,7 +204,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
}
if ( rProperties.isLastRow() && ( nRow == nMaxRow ) )
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -204,7 +215,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
}
if ( rProperties.isFirstCol() && ( nColumn == 0 ) )
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -215,7 +226,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
}
if ( rProperties.isLastCol() && ( nColumn == nMaxColumn ) )
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -236,7 +247,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
nBand++;
if ( nBand & 1 )
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -247,7 +258,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
}
else
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -260,7 +271,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
}
if ( ( nRow == 0 ) && ( nColumn == 0 ) )
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -271,7 +282,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
}
if ( ( nRow == nMaxRow ) && ( nColumn == 0 ) )
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -282,7 +293,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
}
if ( ( nRow == 0 ) && ( nColumn == nMaxColumn ) )
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -291,9 +302,9 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
aLinePropertiesBottomLeftToTopRight,
rTable.getNeCell() );
}
- if ( ( nRow == nMaxColumn ) && ( nColumn == nMaxColumn ) )
+ if ( ( nRow == nMaxRow ) && ( nColumn == nMaxColumn ) )
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -314,7 +325,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
nBand++;
if ( nBand & 1 )
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,
@@ -325,7 +336,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
}
else
{
- applyTableStylePart( aFillProperties, aTextStyleProps,
+ applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
aLinePropertiesLeft,
aLinePropertiesRight,
aLinePropertiesTop,