1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  *   Licensed to the Apache Software Foundation (ASF) under one or more
12  *   contributor license agreements. See the NOTICE file distributed
13  *   with this work for additional information regarding copyright
14  *   ownership. The ASF licenses this file to you under the Apache
15  *   License, Version 2.0 (the "License"); you may not use this file
16  *   except in compliance with the License. You may obtain a copy of
17  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <drawingml/table/tablecell.hxx>
21 #include <drawingml/table/tableproperties.hxx>
22 #include <basegfx/color/bcolor.hxx>
23 #include <oox/drawingml/shapepropertymap.hxx>
24 #include <drawingml/textbody.hxx>
25 #include <oox/drawingml/theme.hxx>
26 #include <oox/core/xmlfilterbase.hxx>
27 #include <oox/helper/propertyset.hxx>
28 #include <oox/token/properties.hxx>
29 #include <oox/token/tokens.hxx>
30 #include <tools/color.hxx>
31 #include <com/sun/star/table/BorderLineStyle.hpp>
32 #include <com/sun/star/table/BorderLine2.hpp>
33 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
34 #include <com/sun/star/text/XText.hpp>
35 #include <com/sun/star/text/WritingMode.hpp>
36 
37 using namespace ::oox::core;
38 using namespace ::com::sun::star;
39 using namespace ::com::sun::star::uno;
40 using namespace ::com::sun::star::beans;
41 using ::com::sun::star::table::BorderLine2;
42 
43 namespace oox::drawingml::table {
44 
TableCell()45 TableCell::TableCell()
46 : mpTextBody( std::make_shared<TextBody>() )
47 , mnRowSpan ( 1 )
48 , mnGridSpan( 1 )
49 , mbhMerge( false )
50 , mbvMerge( false )
51 , mnMarL( 91440 )
52 , mnMarR( 91440 )
53 , mnMarT( 45720 )
54 , mnMarB( 45720 )
55 , mnVertToken( XML_horz )
56 , mnAnchorToken( XML_t )
57 , mbAnchorCtr( false )
58 , mnHorzOverflowToken( XML_clip )
59 {
60 }
61 
applyLineAttributes(const::oox::core::XmlFilterBase & rFilterBase,Reference<XPropertySet> const & rxPropSet,oox::drawingml::LineProperties const & rLineProperties,sal_Int32 nPropId)62 static void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase,
63         Reference< XPropertySet > const & rxPropSet, oox::drawingml::LineProperties const & rLineProperties,
64         sal_Int32 nPropId )
65 {
66     BorderLine2 aBorderLine;
67     if ( rLineProperties.maLineFill.moFillType.differsFrom( XML_noFill ))
68     {
69         Color aColor = rLineProperties.maLineFill.getBestSolidColor();
70         aBorderLine.Color = sal_Int32(aColor.getColor( rFilterBase.getGraphicHelper() ));
71         aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 );
72         aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 );
73         aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 2 );
74         aBorderLine.LineDistance = 0;
75     }
76     else if ( rLineProperties.moLineWidth.get(0)!=0 )
77     {
78         aBorderLine.Color = sal_Int32( COL_AUTO );
79         aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 );
80         aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 );
81         aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 2 );
82         aBorderLine.LineDistance = 0;
83     }
84 
85     if ( rLineProperties.moPresetDash.has() )
86     {
87         switch ( rLineProperties.moPresetDash.get() )
88         {
89         case XML_dot:
90         case XML_sysDot:
91             aBorderLine.LineStyle = ::table::BorderLineStyle::DOTTED;
92             break;
93         case XML_dash:
94         case XML_lgDash:
95         case XML_sysDash:
96             aBorderLine.LineStyle = ::table::BorderLineStyle::DASHED;
97             break;
98         case XML_dashDot:
99         case XML_lgDashDot:
100         case XML_sysDashDot:
101             aBorderLine.LineStyle = ::table::BorderLineStyle::DASH_DOT;
102             break;
103         case XML_lgDashDotDot:
104         case XML_sysDashDotDot:
105             aBorderLine.LineStyle = ::table::BorderLineStyle::DASH_DOT_DOT;
106             break;
107         case XML_solid:
108             aBorderLine.LineStyle = ::table::BorderLineStyle::SOLID;
109             break;
110         default:
111             aBorderLine.LineStyle = ::table::BorderLineStyle::DASHED;
112             break;
113         }
114     }
115     else if ( !rLineProperties.maCustomDash.empty() )
116     {
117         aBorderLine.LineStyle = ::table::BorderLineStyle::DASHED;
118     }
119     else
120     {
121         aBorderLine.LineStyle = ::table::BorderLineStyle::NONE;
122     }
123 
124     PropertySet aPropSet( rxPropSet );
125     aPropSet.setProperty( nPropId, aBorderLine );
126 }
127 
applyBorder(const::oox::core::XmlFilterBase & rFilterBase,TableStylePart & rTableStylePart,sal_Int32 nLineType,oox::drawingml::LineProperties & rLineProperties)128 static void applyBorder( const ::oox::core::XmlFilterBase& rFilterBase, TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::drawingml::LineProperties& rLineProperties )
129 {
130     std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >& rPartLineBorders( rTableStylePart.getLineBorders() );
131     ::oox::drawingml::ShapeStyleRef& rLineStyleRef = rTableStylePart.getStyleRefs()[ nLineType ];
132     std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >::const_iterator aIter( rPartLineBorders.find( nLineType ) );
133     if ( ( aIter != rPartLineBorders.end() ) && aIter->second )
134         rLineProperties.assignUsed( *aIter->second );
135     else if (rLineStyleRef.mnThemedIdx != 0)
136     {
137         if (const Theme* pTheme = rFilterBase.getCurrentTheme())
138         {
139             rLineProperties.assignUsed( *pTheme->getLineStyle(rLineStyleRef.mnThemedIdx) );
140             ::Color nPhClr = rLineStyleRef.maPhClr.getColor( rFilterBase.getGraphicHelper() );
141             rLineProperties.maLineFill.maFillColor.setSrgbClr( nPhClr );
142         }
143     }
144 }
145 
applyTableStylePart(const::oox::core::XmlFilterBase & rFilterBase,oox::drawingml::FillProperties & rFillProperties,TextCharacterProperties & aTextCharProps,oox::drawingml::LineProperties & rLeftBorder,oox::drawingml::LineProperties & rRightBorder,oox::drawingml::LineProperties & rTopBorder,oox::drawingml::LineProperties & rBottomBorder,oox::drawingml::LineProperties & rTopLeftToBottomRightBorder,oox::drawingml::LineProperties & rBottomLeftToTopRightBorder,TableStylePart & rTableStylePart)146 static void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase,
147                           oox::drawingml::FillProperties& rFillProperties,
148                           TextCharacterProperties& aTextCharProps,
149                           oox::drawingml::LineProperties& rLeftBorder,
150                           oox::drawingml::LineProperties& rRightBorder,
151                           oox::drawingml::LineProperties& rTopBorder,
152                           oox::drawingml::LineProperties& rBottomBorder,
153                           oox::drawingml::LineProperties& rTopLeftToBottomRightBorder,
154                           oox::drawingml::LineProperties& rBottomLeftToTopRightBorder,
155                           TableStylePart& rTableStylePart )
156 {
157     ::oox::drawingml::FillPropertiesPtr& rPartFillPropertiesPtr( rTableStylePart.getFillProperties() );
158     if ( rPartFillPropertiesPtr )
159         rFillProperties.assignUsed( *rPartFillPropertiesPtr );
160     else
161     {
162         ::oox::drawingml::ShapeStyleRef& rFillStyleRef = rTableStylePart.getStyleRefs()[ XML_fillRef ];
163         const Theme* pTheme = rFilterBase.getCurrentTheme();
164         if (pTheme && rFillStyleRef.mnThemedIdx != 0 )
165         {
166             rFillProperties.assignUsed( *pTheme->getFillStyle( rFillStyleRef.mnThemedIdx ) );
167             ::Color nPhClr = rFillStyleRef.maPhClr.getColor( rFilterBase.getGraphicHelper() );
168             rFillProperties.maFillColor.setSrgbClr( nPhClr );
169         }
170     }
171 
172     applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
173     applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
174     applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
175     applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
176     applyBorder( rFilterBase, rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder );
177     applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder );
178 
179     aTextCharProps.maLatinFont = rTableStylePart.getLatinFont();
180     aTextCharProps.maAsianFont = rTableStylePart.getAsianFont();
181     aTextCharProps.maComplexFont = rTableStylePart.getComplexFont();
182     aTextCharProps.maSymbolFont = rTableStylePart.getSymbolFont();
183     if ( rTableStylePart.getTextColor().isUsed() )
184     {
185         aTextCharProps.maFillProperties.maFillColor = rTableStylePart.getTextColor();
186         aTextCharProps.maFillProperties.moFillType.set(XML_solidFill);
187     }
188     if( rTableStylePart.getTextBoldStyle() )
189         aTextCharProps.moBold = *rTableStylePart.getTextBoldStyle();
190     if( rTableStylePart.getTextItalicStyle() )
191         aTextCharProps.moItalic = *rTableStylePart.getTextItalicStyle();
192 }
193 
applyTableCellProperties(const Reference<css::table::XCell> & rxCell,const TableCell & rTableCell)194 static void applyTableCellProperties( const Reference < css::table::XCell >& rxCell, const TableCell& rTableCell )
195 {
196     Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW );
197     xPropSet->setPropertyValue( "TextUpperDistance", Any( static_cast< sal_Int32 >( rTableCell.getTopMargin() / 360 ) ) );
198     xPropSet->setPropertyValue( "TextRightDistance", Any( static_cast< sal_Int32 >( rTableCell.getRightMargin() / 360 ) ) );
199     xPropSet->setPropertyValue( "TextLeftDistance", Any( static_cast< sal_Int32 >( rTableCell.getLeftMargin() / 360 ) ) );
200     xPropSet->setPropertyValue( "TextLowerDistance", Any( static_cast< sal_Int32 >( rTableCell.getBottomMargin() / 360 ) ) );
201 
202     drawing::TextVerticalAdjust eVA;
203     switch( rTableCell.getAnchorToken() )
204     {
205         case XML_ctr:   eVA = drawing::TextVerticalAdjust_CENTER; break;
206         case XML_b:     eVA = drawing::TextVerticalAdjust_BOTTOM; break;
207         case XML_just:
208         case XML_dist:
209         default:
210         case XML_t:     eVA = drawing::TextVerticalAdjust_TOP; break;
211     }
212     xPropSet->setPropertyValue( "TextVerticalAdjust", Any( eVA ) );
213 }
214 
pushToXCell(const::oox::core::XmlFilterBase & rFilterBase,const::oox::drawingml::TextListStylePtr & pMasterTextListStyle,const css::uno::Reference<css::table::XCell> & rxCell,const TableProperties & rTableProperties,const TableStyle & rTableStyle,sal_Int32 nColumn,sal_Int32 nMaxColumn,sal_Int32 nRow,sal_Int32 nMaxRow)215 void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, const ::oox::drawingml::TextListStylePtr& pMasterTextListStyle,
216     const css::uno::Reference < css::table::XCell >& rxCell, const TableProperties& rTableProperties,
217     const TableStyle& rTableStyle, sal_Int32 nColumn, sal_Int32 nMaxColumn, sal_Int32 nRow, sal_Int32 nMaxRow )
218 {
219     TableStyle& rTable( const_cast< TableStyle& >( rTableStyle ) );
220     TableProperties& rProperties( const_cast< TableProperties& >( rTableProperties ) );
221 
222     Reference< text::XText > xText( rxCell, UNO_QUERY_THROW );
223     Reference< text::XTextCursor > xAt = xText->createTextCursor();
224 
225     applyTableCellProperties( rxCell, *this );
226     TextCharacterProperties aTextStyleProps;
227     xAt->gotoStart( true );
228     xAt->gotoEnd( true );
229 
230     Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW );
231     oox::drawingml::FillProperties aFillProperties;
232     oox::drawingml::LineProperties aLinePropertiesLeft;
233     oox::drawingml::LineProperties aLinePropertiesRight;
234     oox::drawingml::LineProperties aLinePropertiesTop;
235     oox::drawingml::LineProperties aLinePropertiesBottom;
236     oox::drawingml::LineProperties aLinePropertiesTopLeftToBottomRight;
237     oox::drawingml::LineProperties aLinePropertiesBottomLeftToTopRight;
238 
239     applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
240         aLinePropertiesLeft,
241         aLinePropertiesRight,
242         aLinePropertiesTop,
243         aLinePropertiesBottom,
244         aLinePropertiesTopLeftToBottomRight,
245         aLinePropertiesBottomLeftToTopRight,
246         rTable.getWholeTbl() );
247 
248     if ( rProperties.isFirstRow() && ( nRow == 0 ) )
249     {
250         applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
251             aLinePropertiesLeft,
252             aLinePropertiesRight,
253             aLinePropertiesTop,
254             aLinePropertiesBottom,
255             aLinePropertiesTopLeftToBottomRight,
256             aLinePropertiesBottomLeftToTopRight,
257             rTable.getFirstRow() );
258     }
259     if ( rProperties.isLastRow() && ( nRow == nMaxRow ) )
260     {
261         applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
262             aLinePropertiesLeft,
263             aLinePropertiesRight,
264             aLinePropertiesTop,
265             aLinePropertiesBottom,
266             aLinePropertiesTopLeftToBottomRight,
267             aLinePropertiesBottomLeftToTopRight,
268             rTable.getLastRow() );
269     }
270     if ( rProperties.isFirstCol() && ( nColumn == 0 ) )
271     {
272         applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
273             aLinePropertiesLeft,
274             aLinePropertiesRight,
275             aLinePropertiesTop,
276             aLinePropertiesBottom,
277             aLinePropertiesTopLeftToBottomRight,
278             aLinePropertiesBottomLeftToTopRight,
279             rTable.getFirstCol() );
280     }
281     if ( rProperties.isLastCol() && ( nColumn == nMaxColumn ) )
282     {
283         applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
284             aLinePropertiesLeft,
285             aLinePropertiesRight,
286             aLinePropertiesTop,
287             aLinePropertiesBottom,
288             aLinePropertiesTopLeftToBottomRight,
289             aLinePropertiesBottomLeftToTopRight,
290             rTable.getLastCol() );
291     }
292     if ( rProperties.isBandRow() )
293     {
294         if ( ( !rProperties.isFirstRow() || ( nRow != 0 ) ) &&
295             ( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) &&
296             ( !rProperties.isFirstCol() || ( nColumn != 0 ) ) &&
297             ( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) ) )
298         {
299             sal_Int32 nBand = nRow;
300             if ( rProperties.isFirstRow() )
301                 nBand++;
302             if ( nBand & 1 )
303             {
304                 applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
305                     aLinePropertiesLeft,
306                     aLinePropertiesRight,
307                     aLinePropertiesTop,
308                     aLinePropertiesBottom,
309                     aLinePropertiesTopLeftToBottomRight,
310                     aLinePropertiesBottomLeftToTopRight,
311                     rTable.getBand2H() );
312             }
313             else
314             {
315                 applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
316                     aLinePropertiesLeft,
317                     aLinePropertiesRight,
318                     aLinePropertiesTop,
319                     aLinePropertiesBottom,
320                     aLinePropertiesTopLeftToBottomRight,
321                     aLinePropertiesBottomLeftToTopRight,
322                     rTable.getBand1H() );
323             }
324         }
325     }
326     if ( ( nRow == 0 ) && ( nColumn == 0 ) )
327     {
328         applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
329             aLinePropertiesLeft,
330             aLinePropertiesRight,
331             aLinePropertiesTop,
332             aLinePropertiesBottom,
333             aLinePropertiesTopLeftToBottomRight,
334             aLinePropertiesBottomLeftToTopRight,
335             rTable.getNwCell() );
336     }
337     if ( ( nRow == nMaxRow ) && ( nColumn == 0 ) )
338     {
339         applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
340             aLinePropertiesLeft,
341             aLinePropertiesRight,
342             aLinePropertiesTop,
343             aLinePropertiesBottom,
344             aLinePropertiesTopLeftToBottomRight,
345             aLinePropertiesBottomLeftToTopRight,
346             rTable.getSwCell() );
347     }
348     if ( ( nRow == 0 ) && ( nColumn == nMaxColumn ) )
349     {
350         applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
351             aLinePropertiesLeft,
352             aLinePropertiesRight,
353             aLinePropertiesTop,
354             aLinePropertiesBottom,
355             aLinePropertiesTopLeftToBottomRight,
356             aLinePropertiesBottomLeftToTopRight,
357             rTable.getNeCell() );
358     }
359     if ( ( nRow == nMaxRow ) && ( nColumn == nMaxColumn ) )
360     {
361         applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
362             aLinePropertiesLeft,
363             aLinePropertiesRight,
364             aLinePropertiesTop,
365             aLinePropertiesBottom,
366             aLinePropertiesTopLeftToBottomRight,
367             aLinePropertiesBottomLeftToTopRight,
368             rTable.getSeCell() );
369     }
370     if ( rProperties.isBandCol() )
371     {
372         if ( ( !rProperties.isFirstRow() || ( nRow != 0 ) ) &&
373             ( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) &&
374             ( !rProperties.isFirstCol() || ( nColumn != 0 ) ) &&
375             ( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) ) )
376         {
377             sal_Int32 nBand = nColumn;
378             if ( rProperties.isFirstCol() )
379                 nBand++;
380             if ( nBand & 1 )
381             {
382                 applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
383                     aLinePropertiesLeft,
384                     aLinePropertiesRight,
385                     aLinePropertiesTop,
386                     aLinePropertiesBottom,
387                     aLinePropertiesTopLeftToBottomRight,
388                     aLinePropertiesBottomLeftToTopRight,
389                     rTable.getBand2V() );
390             }
391             else
392             {
393                 applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
394                     aLinePropertiesLeft,
395                     aLinePropertiesRight,
396                     aLinePropertiesTop,
397                     aLinePropertiesBottom,
398                     aLinePropertiesTopLeftToBottomRight,
399                     aLinePropertiesBottomLeftToTopRight,
400                     rTable.getBand1V() );
401             }
402         }
403     }
404     aLinePropertiesLeft.assignUsed( maLinePropertiesLeft );
405     aLinePropertiesRight.assignUsed( maLinePropertiesRight );
406     aLinePropertiesTop.assignUsed( maLinePropertiesTop );
407     aLinePropertiesBottom.assignUsed( maLinePropertiesBottom );
408     aLinePropertiesTopLeftToBottomRight.assignUsed( maLinePropertiesTopLeftToBottomRight );
409     aLinePropertiesBottomLeftToTopRight.assignUsed( maLinePropertiesBottomLeftToTopRight );
410     applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesLeft, PROP_LeftBorder );
411     applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesRight, PROP_RightBorder );
412     applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesTop, PROP_TopBorder );
413     applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesBottom, PROP_BottomBorder );
414     applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesTopLeftToBottomRight, PROP_DiagonalTLBR );
415     applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesBottomLeftToTopRight, PROP_DiagonalBLTR );
416 
417     if (rProperties.getBgColor().isUsed() && !maFillProperties.maFillColor.isUsed() && maFillProperties.moFillType.get() == XML_noFill)
418     {
419         maFillProperties.moFillType = XML_solidFill;
420         maFillProperties.maFillColor = rProperties.getBgColor();
421     }
422 
423     aFillProperties.assignUsed( maFillProperties );
424     ShapePropertyMap aPropMap( rFilterBase.getModelObjectHelper() );
425 
426     Color aBgColor;
427     ::Color nPhClr = API_RGB_TRANSPARENT;
428     std::shared_ptr< ::oox::drawingml::FillProperties >& rBackgroundFillPropertiesPtr( rTable.getBackgroundFillProperties() );
429     ::oox::drawingml::ShapeStyleRef& rBackgroundFillStyle( rTable.getBackgroundFillStyleRef() );
430     if (rBackgroundFillPropertiesPtr)
431         aBgColor = rBackgroundFillPropertiesPtr->getBestSolidColor();
432     else if (rBackgroundFillStyle.mnThemedIdx != 0)
433     {
434         if (const Theme* pTheme = rFilterBase.getCurrentTheme())
435         {
436             aBgColor = pTheme->getFillStyle(rBackgroundFillStyle.mnThemedIdx)->getBestSolidColor();
437             nPhClr = rBackgroundFillStyle.maPhClr.getColor(rFilterBase.getGraphicHelper());
438         }
439     }
440     if (aBgColor.isUsed())
441     {
442         const Color& rCellColor = aFillProperties.getBestSolidColor();
443         const double fTransparency = rCellColor.isUsed() ? 0.01 * rCellColor.getTransparency() : 1.0;
444         ::Color nBgColor( aBgColor.getColor(rFilterBase.getGraphicHelper(), nPhClr) );
445         ::Color nCellColor( rCellColor.getColor(rFilterBase.getGraphicHelper()) );
446         ::Color aResult( basegfx::interpolate(nBgColor.getBColor(), nCellColor.getBColor(), 1.0 - fTransparency) );
447         aFillProperties.maFillColor.clearTransformations();
448         aFillProperties.maFillColor.setSrgbClr(sal_Int32(aResult.GetRGBColor()));
449         aFillProperties.moFillType.set(XML_solidFill);
450     }
451     if (!aFillProperties.moFillType.has())
452         aFillProperties.moFillType.set(XML_noFill);
453 
454     // TODO: phClr?
455     aFillProperties.pushToPropMap( aPropMap, rFilterBase.getGraphicHelper() );
456     PropertySet( xPropSet ).setProperties( aPropMap );
457 
458     if ( getVertToken() == XML_eaVert )
459     {
460         xPropSet->setPropertyValue("TextWritingMode", Any(css::text::WritingMode_TB_RL));
461     }
462 
463     getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, pMasterTextListStyle );
464 
465     if (getVertToken() == XML_vert)
466         xPropSet->setPropertyValue("RotateAngle", Any(short(27000)));
467     else if (getVertToken() == XML_vert270)
468         xPropSet->setPropertyValue("RotateAngle", Any(short(9000)));
469 }
470 
471 }
472 
473 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
474