1ca5ec200SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3ca5ec200SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4ca5ec200SAndrew Rist * or more contributor license agreements. See the NOTICE file 5ca5ec200SAndrew Rist * distributed with this work for additional information 6ca5ec200SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7ca5ec200SAndrew Rist * to you under the Apache License, Version 2.0 (the 8ca5ec200SAndrew Rist * "License"); you may not use this file except in compliance 9ca5ec200SAndrew Rist * with the License. You may obtain a copy of the License at 10ca5ec200SAndrew Rist * 11ca5ec200SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12ca5ec200SAndrew Rist * 13ca5ec200SAndrew Rist * Unless required by applicable law or agreed to in writing, 14ca5ec200SAndrew Rist * software distributed under the License is distributed on an 15ca5ec200SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16ca5ec200SAndrew Rist * KIND, either express or implied. See the License for the 17ca5ec200SAndrew Rist * specific language governing permissions and limitations 18ca5ec200SAndrew Rist * under the License. 19ca5ec200SAndrew Rist * 20ca5ec200SAndrew Rist *************************************************************/ 21ca5ec200SAndrew Rist 22ca5ec200SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #include "oox/drawingml/table/tablecell.hxx" 25cdf0e10cSrcweir #include "oox/drawingml/table/tableproperties.hxx" 26cdf0e10cSrcweir #include "oox/drawingml/shapepropertymap.hxx" 27cdf0e10cSrcweir #include "oox/drawingml/textbody.hxx" 28cdf0e10cSrcweir #include "oox/core/xmlfilterbase.hxx" 29cdf0e10cSrcweir #include "oox/helper/propertyset.hxx" 30cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp> 31cdf0e10cSrcweir #include <com/sun/star/beans/XMultiPropertySet.hpp> 32cdf0e10cSrcweir #include <com/sun/star/table/XTable.hpp> 33cdf0e10cSrcweir #include <com/sun/star/table/XMergeableCellRange.hpp> 34cdf0e10cSrcweir #include <com/sun/star/table/BorderLine.hpp> 35cdf0e10cSrcweir #include <com/sun/star/drawing/LineStyle.hpp> 36cdf0e10cSrcweir #include <com/sun/star/drawing/TextVerticalAdjust.hpp> 37cdf0e10cSrcweir #include <com/sun/star/drawing/TextHorizontalAdjust.hpp> 38cdf0e10cSrcweir #include <com/sun/star/text/XText.hpp> 39*4323f6b5SJürgen Schmidt #include <com/sun/star/text/WritingMode.hpp> 40cdf0e10cSrcweir 41cdf0e10cSrcweir using rtl::OUString; 42cdf0e10cSrcweir using namespace ::oox::core; 43cdf0e10cSrcweir using namespace ::com::sun::star; 44cdf0e10cSrcweir using namespace ::com::sun::star::uno; 45cdf0e10cSrcweir using namespace ::com::sun::star::beans; 46cdf0e10cSrcweir using ::com::sun::star::table::BorderLine; 47cdf0e10cSrcweir using ::com::sun::star::drawing::LineStyle; 48cdf0e10cSrcweir 49cdf0e10cSrcweir namespace oox { namespace drawingml { namespace table { 50cdf0e10cSrcweir 51cdf0e10cSrcweir TableCell::TableCell() 52cdf0e10cSrcweir : mnRowSpan ( 1 ) 53cdf0e10cSrcweir , mnGridSpan( 1 ) 54cdf0e10cSrcweir , mbhMerge( sal_False ) 55cdf0e10cSrcweir , mbvMerge( sal_False ) 56cdf0e10cSrcweir , mnMarL( 91440 ) 57cdf0e10cSrcweir , mnMarR( 91440 ) 58cdf0e10cSrcweir , mnMarT( 45720 ) 59cdf0e10cSrcweir , mnMarB( 45720 ) 60cdf0e10cSrcweir , mnVertToken( XML_horz ) 61cdf0e10cSrcweir , mnAnchorToken( XML_t ) 62cdf0e10cSrcweir , mbAnchorCtr( sal_False ) 63cdf0e10cSrcweir , mnHorzOverflowToken( XML_clip ) 64cdf0e10cSrcweir { 65cdf0e10cSrcweir } 66cdf0e10cSrcweir TableCell::~TableCell() 67cdf0e10cSrcweir { 68cdf0e10cSrcweir } 69cdf0e10cSrcweir 70cdf0e10cSrcweir void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase, 71cdf0e10cSrcweir Reference< XPropertySet >& rxPropSet, oox::drawingml::LineProperties& rLineProperties, 72cdf0e10cSrcweir sal_Int32 nPropId ) 73cdf0e10cSrcweir { 74cdf0e10cSrcweir BorderLine aBorderLine( 0, 0, 0, 0 ); 75cdf0e10cSrcweir if( rLineProperties.maLineFill.moFillType.differsFrom( XML_noFill ) ) 76cdf0e10cSrcweir { 77cdf0e10cSrcweir Color aColor = rLineProperties.maLineFill.getBestSolidColor(); 78cdf0e10cSrcweir aBorderLine.Color = aColor.getColor( rFilterBase.getGraphicHelper() ); 79cdf0e10cSrcweir aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 ); 80cdf0e10cSrcweir aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 ); 81cdf0e10cSrcweir aBorderLine.LineDistance = 0; 82cdf0e10cSrcweir } 83cdf0e10cSrcweir 84cdf0e10cSrcweir PropertySet aPropSet( rxPropSet ); 85cdf0e10cSrcweir aPropSet.setProperty( nPropId, aBorderLine ); 86cdf0e10cSrcweir } 87cdf0e10cSrcweir 88cdf0e10cSrcweir void applyBorder( TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::drawingml::LineProperties& rLineProperties ) 89cdf0e10cSrcweir { 90cdf0e10cSrcweir std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >& rPartLineBorders( rTableStylePart.getLineBorders() ); 91cdf0e10cSrcweir std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >::const_iterator aIter( rPartLineBorders.find( nLineType ) ); 92cdf0e10cSrcweir if ( ( aIter != rPartLineBorders.end() ) && aIter->second.get() ) 93cdf0e10cSrcweir rLineProperties.assignUsed( *aIter->second ); 94cdf0e10cSrcweir } 95cdf0e10cSrcweir 96cdf0e10cSrcweir void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, const Reference < ::com::sun::star::table::XCell >& rxCell, oox::drawingml::FillProperties& rFillProperties, 97cdf0e10cSrcweir oox::drawingml::LineProperties& rLeftBorder, 98cdf0e10cSrcweir oox::drawingml::LineProperties& rRightBorder, 99cdf0e10cSrcweir oox::drawingml::LineProperties& rTopBorder, 100cdf0e10cSrcweir oox::drawingml::LineProperties& rBottomBorder, 101cdf0e10cSrcweir oox::drawingml::LineProperties& rTopLeftToBottomRightBorder, 102cdf0e10cSrcweir oox::drawingml::LineProperties& rBottomLeftToTopRightBorder, 103cdf0e10cSrcweir TableStylePart& rTableStylePart ) 104cdf0e10cSrcweir { 105cdf0e10cSrcweir boost::shared_ptr< ::oox::drawingml::FillProperties >& rPartFillPropertiesPtr( rTableStylePart.getFillProperties() ); 106cdf0e10cSrcweir if ( rPartFillPropertiesPtr.get() ) 107cdf0e10cSrcweir rFillProperties.assignUsed( *rPartFillPropertiesPtr ); 108cdf0e10cSrcweir 109cdf0e10cSrcweir applyBorder( rTableStylePart, XML_left, rLeftBorder ); 110cdf0e10cSrcweir applyBorder( rTableStylePart, XML_right, rRightBorder ); 111cdf0e10cSrcweir applyBorder( rTableStylePart, XML_top, rTopBorder ); 112cdf0e10cSrcweir applyBorder( rTableStylePart, XML_bottom, rBottomBorder ); 113cdf0e10cSrcweir applyBorder( rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder ); 114cdf0e10cSrcweir applyBorder( rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder ); 115cdf0e10cSrcweir 116cdf0e10cSrcweir TextCharacterProperties aTextCharProps; 117cdf0e10cSrcweir aTextCharProps.maLatinFont = rTableStylePart.getLatinFont(); 118cdf0e10cSrcweir aTextCharProps.maAsianFont = rTableStylePart.getAsianFont(); 119cdf0e10cSrcweir aTextCharProps.maComplexFont = rTableStylePart.getComplexFont(); 120cdf0e10cSrcweir aTextCharProps.maSymbolFont = rTableStylePart.getSymbolFont(); 121cdf0e10cSrcweir aTextCharProps.maCharColor = rTableStylePart.getTextColor(); 122cdf0e10cSrcweir 123cdf0e10cSrcweir PropertySet aPropSet( rxCell ); 124cdf0e10cSrcweir aTextCharProps.pushToPropSet( aPropSet, rFilterBase ); 125cdf0e10cSrcweir } 126cdf0e10cSrcweir 127cdf0e10cSrcweir void applyTableCellProperties( const Reference < ::com::sun::star::table::XCell >& rxCell, const TableCell& rTableCell ) 128cdf0e10cSrcweir { 129cdf0e10cSrcweir static const rtl::OUString sTopBorder( RTL_CONSTASCII_USTRINGPARAM( "TextUpperDistance" ) ); 130cdf0e10cSrcweir static const rtl::OUString sBottomBorder( RTL_CONSTASCII_USTRINGPARAM( "TextLowerDistance" ) ); 131cdf0e10cSrcweir static const rtl::OUString sLeftBorder( RTL_CONSTASCII_USTRINGPARAM( "TextLeftDistance" ) ); 132cdf0e10cSrcweir static const rtl::OUString sRightBorder( RTL_CONSTASCII_USTRINGPARAM( "TextRightDistance" ) ); 133cdf0e10cSrcweir static const rtl::OUString sVerticalAdjust( RTL_CONSTASCII_USTRINGPARAM( "TextVerticalAdjust" ) ); 134cdf0e10cSrcweir 135cdf0e10cSrcweir Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW ); 136cdf0e10cSrcweir xPropSet->setPropertyValue( sTopBorder, Any( static_cast< sal_Int32 >( rTableCell.getTopMargin() / 360 ) ) ); 137cdf0e10cSrcweir xPropSet->setPropertyValue( sRightBorder, Any( static_cast< sal_Int32 >( rTableCell.getRightMargin() / 360 ) ) ); 138cdf0e10cSrcweir xPropSet->setPropertyValue( sLeftBorder, Any( static_cast< sal_Int32 >( rTableCell.getLeftMargin() / 360 ) ) ); 139cdf0e10cSrcweir xPropSet->setPropertyValue( sBottomBorder, Any( static_cast< sal_Int32 >( rTableCell.getBottomMargin() / 360 ) ) ); 140cdf0e10cSrcweir 141cdf0e10cSrcweir drawing::TextVerticalAdjust eVA; 142cdf0e10cSrcweir switch( rTableCell.getAnchorToken() ) 143cdf0e10cSrcweir { 144cdf0e10cSrcweir case XML_ctr: eVA = drawing::TextVerticalAdjust_CENTER; break; 145cdf0e10cSrcweir case XML_b: eVA = drawing::TextVerticalAdjust_BOTTOM; break; 146cdf0e10cSrcweir case XML_just: 147cdf0e10cSrcweir case XML_dist: 148cdf0e10cSrcweir default: 149cdf0e10cSrcweir case XML_t: eVA = drawing::TextVerticalAdjust_TOP; break; 150cdf0e10cSrcweir } 151cdf0e10cSrcweir xPropSet->setPropertyValue( sVerticalAdjust, Any( eVA ) ); 152cdf0e10cSrcweir } 153cdf0e10cSrcweir 154cdf0e10cSrcweir void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oox::drawingml::TextListStylePtr pMasterTextListStyle, 155cdf0e10cSrcweir const ::com::sun::star::uno::Reference < ::com::sun::star::table::XCell >& rxCell, const TableProperties& rTableProperties, 156cdf0e10cSrcweir const TableStyle& rTableStyle, sal_Int32 nColumn, sal_Int32 nMaxColumn, sal_Int32 nRow, sal_Int32 nMaxRow ) 157cdf0e10cSrcweir { 158cdf0e10cSrcweir TableStyle& rTable( const_cast< TableStyle& >( rTableStyle ) ); 159cdf0e10cSrcweir TableProperties& rProperties( const_cast< TableProperties& >( rTableProperties ) ); 160cdf0e10cSrcweir 161cdf0e10cSrcweir Reference< text::XText > xText( rxCell, UNO_QUERY_THROW ); 162cdf0e10cSrcweir Reference< text::XTextCursor > xAt = xText->createTextCursor(); 163cdf0e10cSrcweir 164cdf0e10cSrcweir applyTableCellProperties( rxCell, *this ); 165cdf0e10cSrcweir TextCharacterProperties aTextStyleProps; 166cdf0e10cSrcweir getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, pMasterTextListStyle ); 167cdf0e10cSrcweir 168cdf0e10cSrcweir Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW ); 169cdf0e10cSrcweir oox::drawingml::FillProperties aFillProperties; 170cdf0e10cSrcweir oox::drawingml::LineProperties aLinePropertiesLeft; 171cdf0e10cSrcweir oox::drawingml::LineProperties aLinePropertiesRight; 172cdf0e10cSrcweir oox::drawingml::LineProperties aLinePropertiesTop; 173cdf0e10cSrcweir oox::drawingml::LineProperties aLinePropertiesBottom; 174cdf0e10cSrcweir oox::drawingml::LineProperties aLinePropertiesTopLeftToBottomRight; 175cdf0e10cSrcweir oox::drawingml::LineProperties aLinePropertiesBottomLeftToTopRight; 176cdf0e10cSrcweir 177cdf0e10cSrcweir boost::shared_ptr< ::oox::drawingml::FillProperties >& rBackgroundFillPropertiesPtr( rTable.getBackgroundFillProperties() ); 178cdf0e10cSrcweir if ( rBackgroundFillPropertiesPtr.get() ) 179cdf0e10cSrcweir aFillProperties.assignUsed( *rBackgroundFillPropertiesPtr ); 180cdf0e10cSrcweir 181cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 182cdf0e10cSrcweir aLinePropertiesLeft, 183cdf0e10cSrcweir aLinePropertiesRight, 184cdf0e10cSrcweir aLinePropertiesTop, 185cdf0e10cSrcweir aLinePropertiesBottom, 186cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 187cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 188cdf0e10cSrcweir rTable.getWholeTbl() ); 189cdf0e10cSrcweir 190cdf0e10cSrcweir if ( rProperties.isFirstRow() && ( nRow == 0 ) ) 191cdf0e10cSrcweir { 192cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 193cdf0e10cSrcweir aLinePropertiesLeft, 194cdf0e10cSrcweir aLinePropertiesRight, 195cdf0e10cSrcweir aLinePropertiesTop, 196cdf0e10cSrcweir aLinePropertiesBottom, 197cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 198cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 199cdf0e10cSrcweir rTable.getFirstRow() ); 200cdf0e10cSrcweir } 201cdf0e10cSrcweir if ( rProperties.isLastRow() && ( nRow == nMaxRow ) ) 202cdf0e10cSrcweir { 203cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 204cdf0e10cSrcweir aLinePropertiesLeft, 205cdf0e10cSrcweir aLinePropertiesRight, 206cdf0e10cSrcweir aLinePropertiesTop, 207cdf0e10cSrcweir aLinePropertiesBottom, 208cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 209cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 210cdf0e10cSrcweir rTable.getLastRow() ); 211cdf0e10cSrcweir } 212cdf0e10cSrcweir if ( rProperties.isFirstCol() && ( nColumn == 0 ) ) 213cdf0e10cSrcweir { 214cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 215cdf0e10cSrcweir aLinePropertiesLeft, 216cdf0e10cSrcweir aLinePropertiesRight, 217cdf0e10cSrcweir aLinePropertiesTop, 218cdf0e10cSrcweir aLinePropertiesBottom, 219cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 220cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 221cdf0e10cSrcweir rTable.getFirstCol() ); 222cdf0e10cSrcweir } 223cdf0e10cSrcweir if ( rProperties.isLastCol() && ( nColumn == nMaxColumn ) ) 224cdf0e10cSrcweir { 225cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 226cdf0e10cSrcweir aLinePropertiesLeft, 227cdf0e10cSrcweir aLinePropertiesRight, 228cdf0e10cSrcweir aLinePropertiesTop, 229cdf0e10cSrcweir aLinePropertiesBottom, 230cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 231cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 232cdf0e10cSrcweir rTable.getLastCol() ); 233cdf0e10cSrcweir } 234cdf0e10cSrcweir if ( rProperties.isBandRow() ) 235cdf0e10cSrcweir { 236cdf0e10cSrcweir if ( ( !rProperties.isFirstRow() || ( nRow != 0 ) ) && 237cdf0e10cSrcweir ( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) ) 238cdf0e10cSrcweir { 239cdf0e10cSrcweir sal_Int32 nBand = nRow; 240cdf0e10cSrcweir if ( rProperties.isFirstRow() ) 241cdf0e10cSrcweir nBand++; 242cdf0e10cSrcweir if ( nBand & 1 ) 243cdf0e10cSrcweir { 244cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 245cdf0e10cSrcweir aLinePropertiesLeft, 246cdf0e10cSrcweir aLinePropertiesRight, 247cdf0e10cSrcweir aLinePropertiesTop, 248cdf0e10cSrcweir aLinePropertiesBottom, 249cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 250cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 251cdf0e10cSrcweir rTable.getBand2H() ); 252cdf0e10cSrcweir } 253cdf0e10cSrcweir else 254cdf0e10cSrcweir { 255cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 256cdf0e10cSrcweir aLinePropertiesLeft, 257cdf0e10cSrcweir aLinePropertiesRight, 258cdf0e10cSrcweir aLinePropertiesTop, 259cdf0e10cSrcweir aLinePropertiesBottom, 260cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 261cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 262cdf0e10cSrcweir rTable.getBand1H() ); 263cdf0e10cSrcweir } 264cdf0e10cSrcweir } 265cdf0e10cSrcweir } 266cdf0e10cSrcweir if ( ( nRow == 0 ) && ( nColumn == 0 ) ) 267cdf0e10cSrcweir { 268cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 269cdf0e10cSrcweir aLinePropertiesLeft, 270cdf0e10cSrcweir aLinePropertiesRight, 271cdf0e10cSrcweir aLinePropertiesTop, 272cdf0e10cSrcweir aLinePropertiesBottom, 273cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 274cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 275cdf0e10cSrcweir rTable.getNwCell() ); 276cdf0e10cSrcweir } 277cdf0e10cSrcweir if ( ( nRow == nMaxRow ) && ( nColumn == 0 ) ) 278cdf0e10cSrcweir { 279cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 280cdf0e10cSrcweir aLinePropertiesLeft, 281cdf0e10cSrcweir aLinePropertiesRight, 282cdf0e10cSrcweir aLinePropertiesTop, 283cdf0e10cSrcweir aLinePropertiesBottom, 284cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 285cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 286cdf0e10cSrcweir rTable.getSwCell() ); 287cdf0e10cSrcweir } 288cdf0e10cSrcweir if ( ( nRow == 0 ) && ( nColumn == nMaxColumn ) ) 289cdf0e10cSrcweir { 290cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 291cdf0e10cSrcweir aLinePropertiesLeft, 292cdf0e10cSrcweir aLinePropertiesRight, 293cdf0e10cSrcweir aLinePropertiesTop, 294cdf0e10cSrcweir aLinePropertiesBottom, 295cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 296cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 297cdf0e10cSrcweir rTable.getNeCell() ); 298cdf0e10cSrcweir } 299cdf0e10cSrcweir if ( ( nRow == nMaxColumn ) && ( nColumn == nMaxColumn ) ) 300cdf0e10cSrcweir { 301cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 302cdf0e10cSrcweir aLinePropertiesLeft, 303cdf0e10cSrcweir aLinePropertiesRight, 304cdf0e10cSrcweir aLinePropertiesTop, 305cdf0e10cSrcweir aLinePropertiesBottom, 306cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 307cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 308cdf0e10cSrcweir rTable.getSeCell() ); 309cdf0e10cSrcweir } 310cdf0e10cSrcweir if ( rProperties.isBandCol() ) 311cdf0e10cSrcweir { 312cdf0e10cSrcweir if ( ( !rProperties.isFirstCol() || ( nColumn != 0 ) ) && 313cdf0e10cSrcweir ( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) ) ) 314cdf0e10cSrcweir { 315cdf0e10cSrcweir sal_Int32 nBand = nColumn; 316cdf0e10cSrcweir if ( rProperties.isFirstCol() ) 317cdf0e10cSrcweir nBand++; 318cdf0e10cSrcweir if ( nBand & 1 ) 319cdf0e10cSrcweir { 320cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 321cdf0e10cSrcweir aLinePropertiesLeft, 322cdf0e10cSrcweir aLinePropertiesRight, 323cdf0e10cSrcweir aLinePropertiesTop, 324cdf0e10cSrcweir aLinePropertiesBottom, 325cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 326cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 327cdf0e10cSrcweir rTable.getBand2V() ); 328cdf0e10cSrcweir } 329cdf0e10cSrcweir else 330cdf0e10cSrcweir { 331cdf0e10cSrcweir applyTableStylePart( rFilterBase, rxCell, aFillProperties, 332cdf0e10cSrcweir aLinePropertiesLeft, 333cdf0e10cSrcweir aLinePropertiesRight, 334cdf0e10cSrcweir aLinePropertiesTop, 335cdf0e10cSrcweir aLinePropertiesBottom, 336cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight, 337cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight, 338cdf0e10cSrcweir rTable.getBand1V() ); 339cdf0e10cSrcweir } 340cdf0e10cSrcweir } 341cdf0e10cSrcweir } 342cdf0e10cSrcweir aLinePropertiesLeft.assignUsed( maLinePropertiesLeft ); 343cdf0e10cSrcweir aLinePropertiesRight.assignUsed( maLinePropertiesRight ); 344cdf0e10cSrcweir aLinePropertiesTop.assignUsed( maLinePropertiesTop ); 345cdf0e10cSrcweir aLinePropertiesBottom.assignUsed( maLinePropertiesBottom ); 346cdf0e10cSrcweir aLinePropertiesTopLeftToBottomRight.assignUsed( maLinePropertiesTopLeftToBottomRight ); 347cdf0e10cSrcweir aLinePropertiesBottomLeftToTopRight.assignUsed( maLinePropertiesBottomLeftToTopRight ); 348cdf0e10cSrcweir applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesLeft, PROP_LeftBorder ); 349cdf0e10cSrcweir applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesRight, PROP_RightBorder ); 350cdf0e10cSrcweir applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesTop, PROP_TopBorder ); 351cdf0e10cSrcweir applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesBottom, PROP_BottomBorder ); 352cdf0e10cSrcweir applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesTopLeftToBottomRight, PROP_DiagonalTLBR ); 353cdf0e10cSrcweir applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesBottomLeftToTopRight, PROP_DiagonalBLTR ); 354cdf0e10cSrcweir 355cdf0e10cSrcweir aFillProperties.assignUsed( maFillProperties ); 356cdf0e10cSrcweir ShapePropertyMap aPropMap( rFilterBase.getModelObjectHelper() ); 357cdf0e10cSrcweir // TODO: phClr? 358cdf0e10cSrcweir aFillProperties.pushToPropMap( aPropMap, rFilterBase.getGraphicHelper() ); 359cdf0e10cSrcweir PropertySet( xPropSet ).setProperties( aPropMap ); 360*4323f6b5SJürgen Schmidt 361*4323f6b5SJürgen Schmidt if ( getVertToken() == XML_eaVert ) 362*4323f6b5SJürgen Schmidt { 363*4323f6b5SJürgen Schmidt xPropSet->setPropertyValue(::rtl::OUString::createFromAscii( "TextWritingMode" ) , Any(com::sun::star::text::WritingMode_TB_RL) ); 364*4323f6b5SJürgen Schmidt } 365cdf0e10cSrcweir } 366cdf0e10cSrcweir 367cdf0e10cSrcweir } } } 368