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 <PropertyMapper.hxx>
21 #include <unonames.hxx>
22 
23 #include <com/sun/star/beans/XMultiPropertySet.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
26 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
27 #include <com/sun/star/drawing/LineJoint.hpp>
28 #include <com/sun/star/style/ParagraphAdjust.hpp>
29 #include <comphelper/sequence.hxx>
30 #include <tools/diagnose_ex.h>
31 
32 namespace chart
33 {
34 using namespace ::com::sun::star;
35 
36 namespace
37 {
38 
lcl_overwriteOrAppendValues(tPropertyNameValueMap & rMap,const tPropertyNameValueMap & rOverwriteMap)39 void lcl_overwriteOrAppendValues(
40     tPropertyNameValueMap &rMap, const tPropertyNameValueMap& rOverwriteMap )
41 {
42     for (auto const& elem : rOverwriteMap)
43         rMap[ elem.first ] = elem.second;
44 }
45 
46 } // anonymous namespace
47 
setMappedProperties(const uno::Reference<beans::XPropertySet> & xTarget,const uno::Reference<beans::XPropertySet> & xSource,const tPropertyNameMap & rMap,tPropertyNameValueMap const * pOverwriteMap)48 void PropertyMapper::setMappedProperties(
49           const uno::Reference< beans::XPropertySet >& xTarget
50         , const uno::Reference< beans::XPropertySet >& xSource
51         , const tPropertyNameMap& rMap
52         , tPropertyNameValueMap const * pOverwriteMap )
53 {
54     if( !xTarget.is() || !xSource.is() )
55         return;
56 
57     tNameSequence aNames;
58     tAnySequence  aValues;
59     getMultiPropertyLists(aNames, aValues, xSource, rMap );
60     if(pOverwriteMap && (aNames.getLength() == aValues.getLength()))
61     {
62         tPropertyNameValueMap aNewMap;
63         for( sal_Int32 nI=0; nI<aNames.getLength(); ++nI )
64             aNewMap[ aNames[nI] ] = aValues[nI];
65         lcl_overwriteOrAppendValues( aNewMap, *pOverwriteMap );
66         aNames = comphelper::mapKeysToSequence( aNewMap );
67         aValues = comphelper::mapValuesToSequence( aNewMap );
68     }
69 
70     PropertyMapper::setMultiProperties( aNames, aValues, xTarget );
71 }
72 
getValueMap(tPropertyNameValueMap & rValueMap,const tPropertyNameMap & rNameMap,const uno::Reference<beans::XPropertySet> & xSourceProp)73 void PropertyMapper::getValueMap(
74                   tPropertyNameValueMap& rValueMap
75                 , const tPropertyNameMap& rNameMap
76                 , const uno::Reference< beans::XPropertySet >& xSourceProp
77                 )
78 {
79     uno::Reference< beans::XMultiPropertySet > xMultiPropSet(xSourceProp, uno::UNO_QUERY);
80     if((false) && xMultiPropSet.is())
81     {
82         uno::Sequence< OUString > aPropSourceNames(rNameMap.size());
83         uno::Sequence< OUString > aPropTargetNames(rNameMap.size());
84         sal_Int32 i = 0;
85         for (auto const& elem : rNameMap)
86         {
87             aPropTargetNames[i] = elem.first;
88             aPropSourceNames[i] = elem.second;
89             ++i;
90         }
91 
92         uno::Sequence< uno::Any > xValues = xMultiPropSet->getPropertyValues(aPropSourceNames);
93         sal_Int32 n = rNameMap.size();
94         for(i = 0;i < n; ++i)
95         {
96             if( xValues[i].hasValue() )
97                 rValueMap.emplace(  aPropTargetNames[i], xValues[i] );
98         }
99     }
100     else
101     {
102         for (auto const& elem : rNameMap)
103         {
104             OUString aTarget = elem.first;
105             OUString aSource = elem.second;
106             try
107             {
108                 uno::Any aAny( xSourceProp->getPropertyValue(aSource) );
109                 if( aAny.hasValue() )
110                     rValueMap.emplace(  aTarget, aAny );
111             }
112             catch( const uno::Exception& )
113             {
114                 TOOLS_WARN_EXCEPTION("chart2", "" );
115             }
116         }
117     }
118 }
119 
getMultiPropertyLists(tNameSequence & rNames,tAnySequence & rValues,const uno::Reference<beans::XPropertySet> & xSourceProp,const tPropertyNameMap & rNameMap)120 void PropertyMapper::getMultiPropertyLists(
121                   tNameSequence& rNames
122                 , tAnySequence&  rValues
123                 , const uno::Reference< beans::XPropertySet >& xSourceProp
124                 , const tPropertyNameMap& rNameMap
125                 )
126 {
127     tPropertyNameValueMap aValueMap;
128     getValueMap( aValueMap, rNameMap, xSourceProp );
129     getMultiPropertyListsFromValueMap( rNames, rValues, aValueMap );
130 }
131 
getMultiPropertyListsFromValueMap(tNameSequence & rNames,tAnySequence & rValues,const tPropertyNameValueMap & rValueMap)132 void PropertyMapper::getMultiPropertyListsFromValueMap(
133                   tNameSequence& rNames
134                 , tAnySequence&  rValues
135                 , const tPropertyNameValueMap& rValueMap
136                 )
137 {
138     sal_Int32 nPropertyCount = rValueMap.size();
139     rNames.realloc(nPropertyCount);
140     rValues.realloc(nPropertyCount);
141 
142     //fill sequences
143     sal_Int32 nN=0;
144     for (auto const& elem : rValueMap)
145     {
146         const uno::Any& rAny = elem.second;
147         if( rAny.hasValue() )
148         {
149             //do not set empty anys because of performance (otherwise SdrAttrObj::ItemChange will take much longer)
150             rNames[nN]  = elem.first;
151             rValues[nN] = rAny;
152             ++nN;
153         }
154     }
155     //reduce to real property count
156     rNames.realloc(nN);
157     rValues.realloc(nN);
158 }
159 
getValuePointer(tAnySequence & rPropValues,const tNameSequence & rPropNames,std::u16string_view rPropName)160 uno::Any* PropertyMapper::getValuePointer( tAnySequence& rPropValues
161                          , const tNameSequence& rPropNames
162                          , std::u16string_view rPropName )
163 {
164     sal_Int32 nCount = rPropNames.getLength();
165     for( sal_Int32 nN = 0; nN < nCount; nN++ )
166     {
167         if(rPropNames[nN] == rPropName)
168             return &rPropValues[nN];
169     }
170     return nullptr;
171 }
172 
getValuePointerForLimitedSpace(tAnySequence & rPropValues,const tNameSequence & rPropNames,bool bLimitedHeight)173 uno::Any* PropertyMapper::getValuePointerForLimitedSpace( tAnySequence& rPropValues
174                          , const tNameSequence& rPropNames
175                          , bool bLimitedHeight)
176 {
177     return PropertyMapper::getValuePointer( rPropValues, rPropNames
178         , bLimitedHeight ? OUString("TextMaximumFrameHeight") : OUString("TextMaximumFrameWidth") );
179 }
180 
getPropertyNameMapForCharacterProperties()181 const tPropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProperties()
182 {
183     //shape property -- chart model object property
184     static tPropertyNameMap s_aShapePropertyMapForCharacterProperties{
185         {"CharColor",                "CharColor"},
186         {"CharContoured",            "CharContoured"},
187         {"CharEmphasis",             "CharEmphasis"},//the service style::CharacterProperties  describes a property called 'CharEmphasize' which is nowhere implemented
188 
189         {"CharFontFamily",           "CharFontFamily"},
190         {"CharFontFamilyAsian",      "CharFontFamilyAsian"},
191         {"CharFontFamilyComplex",    "CharFontFamilyComplex"},
192         {"CharFontCharSet",          "CharFontCharSet"},
193         {"CharFontCharSetAsian",     "CharFontCharSetAsian"},
194         {"CharFontCharSetComplex",   "CharFontCharSetComplex"},
195         {"CharFontName",             "CharFontName"},
196         {"CharFontNameAsian",        "CharFontNameAsian"},
197         {"CharFontNameComplex",      "CharFontNameComplex"},
198         {"CharFontPitch",            "CharFontPitch"},
199         {"CharFontPitchAsian",       "CharFontPitchAsian"},
200         {"CharFontPitchComplex",     "CharFontPitchComplex"},
201         {"CharFontStyleName",        "CharFontStyleName"},
202         {"CharFontStyleNameAsian",   "CharFontStyleNameAsian"},
203         {"CharFontStyleNameComplex", "CharFontStyleNameComplex"},
204 
205         {"CharHeight",               "CharHeight"},
206         {"CharHeightAsian",          "CharHeightAsian"},
207         {"CharHeightComplex",        "CharHeightComplex"},
208         {"CharKerning",              "CharKerning"},
209         {"CharLocale",               "CharLocale"},
210         {"CharLocaleAsian",          "CharLocaleAsian"},
211         {"CharLocaleComplex",        "CharLocaleComplex"},
212         {"CharPosture",              "CharPosture"},
213         {"CharPostureAsian",         "CharPostureAsian"},
214         {"CharPostureComplex",       "CharPostureComplex"},
215         {"CharRelief",               "CharRelief"},
216         {"CharShadowed",             "CharShadowed"},
217         {"CharStrikeout",            "CharStrikeout"},
218         {"CharUnderline",            "CharUnderline"},
219         {"CharUnderlineColor",       "CharUnderlineColor"},
220         {"CharUnderlineHasColor",    "CharUnderlineHasColor"},
221         {"CharOverline",             "CharOverline"},
222         {"CharOverlineColor",        "CharOverlineColor"},
223         {"CharOverlineHasColor",     "CharOverlineHasColor"},
224         {"CharWeight",               "CharWeight"},
225         {"CharWeightAsian",          "CharWeightAsian"},
226         {"CharWeightComplex",        "CharWeightComplex"},
227         {"CharWordMode",             "CharWordMode"},
228 
229         {"WritingMode",              "WritingMode"},
230 
231         {"ParaIsCharacterDistance",  "ParaIsCharacterDistance"}};
232 
233     return s_aShapePropertyMapForCharacterProperties;
234 }
235 
getPropertyNameMapForParagraphProperties()236 const tPropertyNameMap& PropertyMapper::getPropertyNameMapForParagraphProperties()
237 {
238     //shape property -- chart model object property
239     static tPropertyNameMap s_aShapePropertyMapForParagraphProperties{
240         {"ParaAdjust",          "ParaAdjust"},
241         {"ParaBottomMargin",    "ParaBottomMargin"},
242         {"ParaIsHyphenation",   "ParaIsHyphenation"},
243         {"ParaLastLineAdjust",  "ParaLastLineAdjust"},
244         {"ParaLeftMargin",      "ParaLeftMargin"},
245         {"ParaRightMargin",     "ParaRightMargin"},
246         {"ParaTopMargin",       "ParaTopMargin"}};
247     return s_aShapePropertyMapForParagraphProperties;
248 }
249 
getPropertyNameMapForFillProperties()250 const tPropertyNameMap& PropertyMapper::getPropertyNameMapForFillProperties()
251 {
252     //shape property -- chart model object property
253     static tPropertyNameMap s_aShapePropertyMapForFillProperties{
254         {"FillBackground",               "FillBackground"},
255         {"FillBitmapName",               "FillBitmapName"},
256         {"FillColor",                    "FillColor"},
257         {"FillGradientName",             "FillGradientName"},
258         {"FillGradientStepCount",        "FillGradientStepCount"},
259         {"FillHatchName",                "FillHatchName"},
260         {"FillStyle",                    "FillStyle"},
261         {"FillTransparence",             "FillTransparence"},
262         {"FillTransparenceGradientName", "FillTransparenceGradientName"},
263         //bitmap properties
264         {"FillBitmapMode",               "FillBitmapMode"},
265         {"FillBitmapSizeX",              "FillBitmapSizeX"},
266         {"FillBitmapSizeY",              "FillBitmapSizeY"},
267         {"FillBitmapLogicalSize",        "FillBitmapLogicalSize"},
268         {"FillBitmapOffsetX",            "FillBitmapOffsetX"},
269         {"FillBitmapOffsetY",            "FillBitmapOffsetY"},
270         {"FillBitmapRectanglePoint",     "FillBitmapRectanglePoint"},
271         {"FillBitmapPositionOffsetX",    "FillBitmapPositionOffsetX"},
272         {"FillBitmapPositionOffsetY",    "FillBitmapPositionOffsetY"}};
273     return s_aShapePropertyMapForFillProperties;
274 }
275 
getPropertyNameMapForLineProperties()276 const tPropertyNameMap& PropertyMapper::getPropertyNameMapForLineProperties()
277 {
278     //shape property -- chart model object property
279     static tPropertyNameMap s_aShapePropertyMapForLineProperties{
280         {"LineColor",              "LineColor"},
281         {"LineDashName",           "LineDashName"},
282         {"LineJoint",              "LineJoint"},
283         {"LineStyle",              "LineStyle"},
284         {"LineTransparence",       "LineTransparence"},
285         {"LineWidth",              "LineWidth"},
286         {"LineCap",                "LineCap"}};
287     return s_aShapePropertyMapForLineProperties;
288 }
289 
290 namespace {
getPropertyNameMapForFillAndLineProperties_()291     tPropertyNameMap getPropertyNameMapForFillAndLineProperties_() {
292         auto map = PropertyMapper::getPropertyNameMapForFillProperties();
293         auto const & add
294             = PropertyMapper::getPropertyNameMapForLineProperties();
295         map.insert(add.begin(), add.end());
296         return map;
297     }
298 }
getPropertyNameMapForFillAndLineProperties()299 const tPropertyNameMap& PropertyMapper::getPropertyNameMapForFillAndLineProperties()
300 {
301     static tPropertyNameMap s_aShapePropertyMapForFillAndLineProperties
302         = getPropertyNameMapForFillAndLineProperties_();
303     return s_aShapePropertyMapForFillAndLineProperties;
304 }
305 
306 namespace {
getPropertyNameMapForTextShapeProperties_()307     tPropertyNameMap getPropertyNameMapForTextShapeProperties_() {
308         auto map = PropertyMapper::getPropertyNameMapForCharacterProperties();
309         auto const & add1
310             = PropertyMapper::getPropertyNameMapForFillProperties();
311         map.insert(add1.begin(), add1.end());
312         auto const & add2
313             = PropertyMapper::getPropertyNameMapForLineProperties();
314         map.insert(add2.begin(), add2.end());
315         return map;
316     }
317 }
getPropertyNameMapForTextShapeProperties()318 const tPropertyNameMap& PropertyMapper::getPropertyNameMapForTextShapeProperties()
319 {
320     static tPropertyNameMap s_aShapePropertyMapForTextShapeProperties
321         = getPropertyNameMapForTextShapeProperties_();
322     return s_aShapePropertyMapForTextShapeProperties;
323 }
324 
getPropertyNameMapForLineSeriesProperties()325 const tPropertyNameMap& PropertyMapper::getPropertyNameMapForLineSeriesProperties()
326 {
327     //shape property -- chart model object property
328     static tPropertyNameMap s_aShapePropertyMapForLineSeriesProperties{
329         {"LineColor",           "Color"},
330         {"LineDashName",        "LineDashName"},
331         {"LineStyle",           "LineStyle"},
332         {"LineTransparence",    "Transparency"},
333         {"LineWidth",           "LineWidth"},
334         {"LineCap",             "LineCap"}};
335     return s_aShapePropertyMapForLineSeriesProperties;
336 }
337 
338 namespace {
getPropertyNameMapForTextLabelProperties_()339     tPropertyNameMap getPropertyNameMapForTextLabelProperties_() {
340         auto map = PropertyMapper::getPropertyNameMapForCharacterProperties();
341         map.insert({
342             {"LineStyle", CHART_UNONAME_LABEL_BORDER_STYLE},
343             {"LineWidth", CHART_UNONAME_LABEL_BORDER_WIDTH},
344             {"LineColor", CHART_UNONAME_LABEL_BORDER_COLOR},
345             {"LineTransparence", CHART_UNONAME_LABEL_BORDER_TRANS},
346             {"FillStyle", CHART_UNONAME_LABEL_FILL_STYLE},
347             {"FillColor", CHART_UNONAME_LABEL_FILL_COLOR},
348             {"FillBackground", CHART_UNONAME_LABEL_FILL_BACKGROUND},
349             {"FillHatchName", CHART_UNONAME_LABEL_FILL_HATCH_NAME}
350             });
351                 // fix the spelling!
352         return map;
353     }
354 }
getPropertyNameMapForTextLabelProperties()355 const tPropertyNameMap& PropertyMapper::getPropertyNameMapForTextLabelProperties()
356 {
357     // target name (drawing layer) : source name (chart model)
358     static tPropertyNameMap aMap = getPropertyNameMapForTextLabelProperties_();
359     return aMap;
360 }
361 
getPropertyNameMapForFilledSeriesProperties()362 const tPropertyNameMap& PropertyMapper::getPropertyNameMapForFilledSeriesProperties()
363 {
364     //shape property -- chart model object property
365     static tPropertyNameMap s_aShapePropertyMapForFilledSeriesProperties{
366         {"FillBackground",               "FillBackground"},
367         {"FillBitmapName",               "FillBitmapName"},
368         {"FillColor",                    "Color"},
369         {"FillGradientName",             "GradientName"},
370         {"FillGradientStepCount",        "GradientStepCount"},
371         {"FillHatchName",                "HatchName"},
372         {"FillStyle",                    "FillStyle"},
373         {"FillTransparence",             "Transparency"},
374         {"FillTransparenceGradientName", "TransparencyGradientName"},
375         //bitmap properties
376         {"FillBitmapMode",               "FillBitmapMode"},
377         {"FillBitmapSizeX",              "FillBitmapSizeX"},
378         {"FillBitmapSizeY",              "FillBitmapSizeY"},
379         {"FillBitmapLogicalSize",        "FillBitmapLogicalSize"},
380         {"FillBitmapOffsetX",            "FillBitmapOffsetX"},
381         {"FillBitmapOffsetY",            "FillBitmapOffsetY"},
382         {"FillBitmapRectanglePoint",     "FillBitmapRectanglePoint"},
383         {"FillBitmapPositionOffsetX",    "FillBitmapPositionOffsetX"},
384         {"FillBitmapPositionOffsetY",    "FillBitmapPositionOffsetY"},
385         //line properties
386         {"LineColor",                    "BorderColor"},
387         {"LineDashName",                 "BorderDashName"},
388         {"LineStyle",                    "BorderStyle"},
389         {"LineTransparence",             "BorderTransparency"},
390         {"LineWidth",                    "BorderWidth"},
391         {"LineCap",                      "LineCap"}};
392     return s_aShapePropertyMapForFilledSeriesProperties;
393 }
394 
setMultiProperties(const tNameSequence & rNames,const tAnySequence & rValues,const css::uno::Reference<css::beans::XPropertySet> & xTarget)395 void PropertyMapper::setMultiProperties(
396                   const tNameSequence& rNames
397                 , const tAnySequence&  rValues
398                 , const css::uno::Reference<
399                   css::beans::XPropertySet >& xTarget )
400 {
401     bool bSuccess = false;
402     try
403     {
404         uno::Reference< beans::XMultiPropertySet > xShapeMultiProp( xTarget, uno::UNO_QUERY );
405         if( xShapeMultiProp.is() )
406         {
407             xShapeMultiProp->setPropertyValues( rNames, rValues );
408             bSuccess = true;
409         }
410     }
411     catch( const uno::Exception& )
412     {
413         TOOLS_WARN_EXCEPTION("chart2", "" ); //if this occurs more often think of removing the XMultiPropertySet completely for better performance
414     }
415 
416     if(bSuccess)
417         return;
418 
419     try
420     {
421         sal_Int32 nCount = std::max( rNames.getLength(), rValues.getLength() );
422         OUString aPropName;
423         uno::Any aValue;
424         for( sal_Int32 nN = 0; nN < nCount; nN++ )
425         {
426             aPropName = rNames[nN];
427             aValue = rValues[nN];
428 
429             try
430             {
431                 xTarget->setPropertyValue( aPropName, aValue );
432             }
433             catch( const uno::Exception& )
434             {
435                 TOOLS_WARN_EXCEPTION("chart2", "" );
436             }
437         }
438     }
439     catch( const uno::Exception& )
440     {
441         TOOLS_WARN_EXCEPTION("chart2", "" );
442     }
443 }
444 
getTextLabelMultiPropertyLists(const uno::Reference<beans::XPropertySet> & xSourceProp,tNameSequence & rPropNames,tAnySequence & rPropValues,bool bName,sal_Int32 nLimitedSpace,bool bLimitedHeight,bool bSupportsLabelBorder)445 void PropertyMapper::getTextLabelMultiPropertyLists(
446     const uno::Reference< beans::XPropertySet >& xSourceProp
447     , tNameSequence& rPropNames, tAnySequence& rPropValues
448     , bool bName
449     , sal_Int32 nLimitedSpace
450     , bool bLimitedHeight
451     , bool bSupportsLabelBorder)
452 {
453     //fill character properties into the ValueMap
454     tPropertyNameValueMap aValueMap;
455     tPropertyNameMap const & aNameMap = bSupportsLabelBorder ? PropertyMapper::getPropertyNameMapForTextLabelProperties() : getPropertyNameMapForCharacterProperties();
456 
457     PropertyMapper::getValueMap(aValueMap, aNameMap, xSourceProp);
458 
459     //some more shape properties apart from character properties, position-matrix and label string
460     aValueMap.emplace( "TextHorizontalAdjust", uno::Any(drawing::TextHorizontalAdjust_CENTER) ); // drawing::TextHorizontalAdjust - needs to be overwritten
461     aValueMap.emplace( "TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_CENTER) ); //drawing::TextVerticalAdjust - needs to be overwritten
462     aValueMap.emplace( "TextAutoGrowHeight", uno::Any(true) ); // sal_Bool
463     aValueMap.emplace( "TextAutoGrowWidth", uno::Any(true) ); // sal_Bool
464     aValueMap.emplace( "ParaAdjust", uno::Any(style::ParagraphAdjust_CENTER) ); // style::ParagraphAdjust_CENTER - needs to be overwritten
465     if( bName )
466         aValueMap.emplace( "Name", uno::Any( OUString() ) ); //CID OUString - needs to be overwritten for each point
467 
468     if( nLimitedSpace > 0 )
469     {
470         if(bLimitedHeight)
471             aValueMap.emplace( "TextMaximumFrameHeight", uno::Any(nLimitedSpace) ); //sal_Int32
472         else
473             aValueMap.emplace( "TextMaximumFrameWidth", uno::Any(nLimitedSpace) ); //sal_Int32
474         aValueMap.emplace( "ParaIsHyphenation", uno::Any(true) );
475     }
476 
477     PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames, rPropValues, aValueMap );
478 }
479 
getPreparedTextShapePropertyLists(const uno::Reference<beans::XPropertySet> & xSourceProp,tNameSequence & rPropNames,tAnySequence & rPropValues)480 void PropertyMapper::getPreparedTextShapePropertyLists(
481     const uno::Reference< beans::XPropertySet >& xSourceProp
482     , tNameSequence& rPropNames, tAnySequence& rPropValues )
483 {
484     //fill character, line and fill properties into the ValueMap
485     tPropertyNameValueMap aValueMap;
486     PropertyMapper::getValueMap( aValueMap
487             , PropertyMapper::getPropertyNameMapForTextShapeProperties()
488             , xSourceProp );
489 
490     // auto-grow makes sure the shape has the correct size after setting text
491     aValueMap.emplace( "TextHorizontalAdjust", uno::Any( drawing::TextHorizontalAdjust_CENTER ));
492     aValueMap.emplace( "TextVerticalAdjust", uno::Any( drawing::TextVerticalAdjust_CENTER ));
493     aValueMap.emplace( "TextAutoGrowHeight", uno::Any( true ));
494     aValueMap.emplace( "TextAutoGrowWidth", uno::Any( true ));
495 
496     // set some distance to the border, in case it is shown
497     const sal_Int32 nWidthDist  = 250;
498     const sal_Int32 nHeightDist = 125;
499     aValueMap.emplace( "TextLeftDistance",  uno::Any( nWidthDist ));
500     aValueMap.emplace( "TextRightDistance", uno::Any( nWidthDist ));
501     aValueMap.emplace( "TextUpperDistance", uno::Any( nHeightDist ));
502     aValueMap.emplace( "TextLowerDistance", uno::Any( nHeightDist ));
503 
504     // use a line-joint showing the border of thick lines like two rectangles
505     // filled in between.
506     aValueMap["LineJoint"] <<= drawing::LineJoint_ROUND;
507 
508     PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames, rPropValues, aValueMap );
509 }
510 
511 } //namespace chart
512 
513 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
514