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