1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PropertyMapper.cxx,v $
10 * $Revision: 1.11.46.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
33 #include "PropertyMapper.hxx"
34 #include "ContainerHelper.hxx"
37 #include <com/sun/star/beans/XMultiPropertySet.hpp>
38 #include <com/sun/star/drawing/LineStyle.hpp>
39 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
40 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
41 #include <com/sun/star/drawing/LineJoint.hpp>
43 //.............................................................................
46 //.............................................................................
47 using namespace ::com::sun::star
;
52 void lcl_overwriteOrAppendValues(
53 tPropertyNameValueMap
&rMap
, const tPropertyNameValueMap
& rOverwriteMap
)
55 tPropertyNameValueMap::const_iterator
aIt( rOverwriteMap
.begin() );
56 tPropertyNameValueMap::const_iterator
aEnd( rOverwriteMap
.end() );
58 for( ; aIt
!= aEnd
; ++aIt
)
59 rMap
[ aIt
->first
] = aIt
->second
;
62 } // anonymous namespace
65 void PropertyMapper::setMappedProperties(
66 const uno::Reference
< beans::XPropertySet
>& xTarget
67 , const uno::Reference
< beans::XPropertySet
>& xSource
68 , const tPropertyNameMap
& rMap
69 , tPropertyNameValueMap
* pOverwriteMap
)
71 if( !xTarget
.is() || !xSource
.is() )
76 getMultiPropertyLists(aNames
, aValues
, xSource
, rMap
);
77 if(pOverwriteMap
&& (aNames
.getLength() == aValues
.getLength()))
79 tPropertyNameValueMap aNewMap
;
80 for( sal_Int32 nI
=0; nI
<aNames
.getLength(); ++nI
)
81 aNewMap
[ aNames
[nI
] ] = aValues
[nI
];
82 lcl_overwriteOrAppendValues( aNewMap
, *pOverwriteMap
);
83 aNames
= ContainerHelper::MapKeysToSequence( aNewMap
);
84 aValues
= ContainerHelper::MapValuesToSequence( aNewMap
);
87 PropertyMapper::setMultiProperties( aNames
, aValues
, xTarget
);
90 void PropertyMapper::getValueMap(
91 tPropertyNameValueMap
& rValueMap
92 , const tPropertyNameMap
& rNameMap
93 , const uno::Reference
< beans::XPropertySet
>& xSourceProp
96 tPropertyNameMap::const_iterator
aIt( rNameMap
.begin() );
97 tPropertyNameMap::const_iterator
aEnd( rNameMap
.end() );
99 for( ; aIt
!= aEnd
; ++aIt
)
101 rtl::OUString aTarget
= aIt
->first
;
102 rtl::OUString aSource
= aIt
->second
;
105 uno::Any
aAny( xSourceProp
->getPropertyValue(aSource
) );
106 if( aAny
.hasValue() )
107 rValueMap
.insert( tPropertyNameValueMap::value_type( aTarget
, aAny
) );
109 catch( uno::Exception
& e
)
111 ASSERT_EXCEPTION( e
);
116 void PropertyMapper::getMultiPropertyLists(
117 tNameSequence
& rNames
118 , tAnySequence
& rValues
119 , const uno::Reference
< beans::XPropertySet
>& xSourceProp
120 , const tPropertyNameMap
& rNameMap
123 tPropertyNameValueMap aValueMap
;
124 getValueMap( aValueMap
, rNameMap
, xSourceProp
);
125 getMultiPropertyListsFromValueMap( rNames
, rValues
, aValueMap
);
128 void PropertyMapper::getMultiPropertyListsFromValueMap(
129 tNameSequence
& rNames
130 , tAnySequence
& rValues
131 , const tPropertyNameValueMap
& rValueMap
134 sal_Int32 nPropertyCount
= rValueMap
.size();
135 rNames
.realloc(nPropertyCount
);
136 rValues
.realloc(nPropertyCount
);
139 tPropertyNameValueMap::const_iterator
aValueIt( rValueMap
.begin() );
140 tPropertyNameValueMap::const_iterator
aValueEnd( rValueMap
.end() );
142 for( ; aValueIt
!= aValueEnd
; ++aValueIt
)
144 const uno::Any
& rAny
= aValueIt
->second
;
145 if( rAny
.hasValue() )
147 //do not set empty anys because of performance (otherwise SdrAttrObj::ItemChange will take much longer)
148 rNames
[nN
] = aValueIt
->first
;
153 //reduce to real property count
158 uno::Any
* PropertyMapper::getValuePointer( tAnySequence
& rPropValues
159 , const tNameSequence
& rPropNames
160 , const rtl::OUString
& rPropName
)
162 sal_Int32 nCount
= rPropNames
.getLength();
163 for( sal_Int32 nN
= 0; nN
< nCount
; nN
++ )
165 if(rPropNames
[nN
].equals(rPropName
))
166 return &rPropValues
[nN
];
172 //set some properties from service style::CharacterProperties:
173 //-------- tabpage: Zeichen -----------
174 //Schriftart z.B. Albany UNO_NAME_EDIT_CHAR_FONTNAME == UNO_NAME_EDIT_CHAR_FONTSTYLENAME //UNO_NAME_CHAR_FONT
175 //Schriftschnitt z.B. kursiv UNO_NAME_EDIT_CHAR_POSTURE UNO_NAME_CHAR_POSTURE awt::FontSlant NONE OBLIQUE ITALIC DONTKNOW REVERSE_OBLIQUE REVERSE_ITALIC
176 //Schriftgrad (Punktgrösse z.B. 12) UNO_NAME_EDIT_CHAR_HEIGHT == UNO_NAME_CHAR_HEIGHT
177 //? UNO_NAME_EDIT_CHAR_WEIGHT == UNO_NAME_CHAR_WEIGHT
178 //Sprache UNO_NAME_EDIT_CHAR_LOCALE lang::Locale
180 //-------- tabpage: Schrifteffekt -----------
181 //Unterstreichung UNO_NAME_CHAR_UNDERLINE sal_Int16 awt::FontUnderline_NONE _SINGLE _DOUBLE _DOTTED _DONTKNOW _DASH ...
182 //Unterstreichung-farbe ??? 'CharUnderlineColor' + CharUnderlineHasColor
183 //Durchstreichung z.B. doppelt "CharStrikeout" sal_Int16 awt::FontStrikeout_NONE _SINGLE _DOUBLE ...
184 //wortweise-Durchstreichung ja/nein "CharWordMode" bool
185 //Schriftfarbe UNO_NAME_EDIT_CHAR_COLOR sal_Int32 UNO_NAME_CHAR_COLOR
186 //ReliefArt ohne/erhaben/tief "CharRelief" sal_Int16 text::FontRelief_NONE FontRelief_EMBOSSED FontRelief_ENGRAVED
187 //Kontur "CharContoured" bool
188 //Schatten UNO_NAME_CHAR_SHADOWED bool
192 const tMakePropertyNameMap
& PropertyMapper::getPropertyNameMapForCharacterProperties()
194 //shape property -- chart model object property
195 static tMakePropertyNameMap m_aShapePropertyMapForCharacterProperties
=
197 // ( C2U( "CharBackColor" ), C2U("TextBackgroundColor") )
198 // ( C2U( "CharCaseMap" ), C2U("CaseMapping") )
199 ( C2U( "CharColor" ), C2U("CharColor") )
200 ( C2U( "CharContoured" ), C2U("CharContoured") )
201 /////// ( C2U( "CharCrossedOut" ), C2U("CharCrossedOut") ) //setting this explicitly somehow conflicts with CharStrikeout
202 ( C2U( "CharEmphasis" ), C2U("CharEmphasis") )//the service style::CharacterProperties describes a property called 'CharEmphasize' wich is nowhere implemented
203 // ( C2U( "CharEscapement" ), C2U("CharEscapement") ) //#i98344# @future: add these to properties again, if the user interface offers the possibility to change them; then make sure that older wrong files are corrected on import
204 // ( C2U( "CharEscapementHeight" ), C2U("CharEscapementHeight") ) //#i98344# @future: add these to properties again, if the user interface offers the possibility to change them; then make sure that older wrong files are corrected on import
205 // ( C2U( "CharFlash" ), C2U("Flashing") )
207 ( C2U( "CharFontFamily" ), C2U("CharFontFamily") )
208 ( C2U( "CharFontFamilyAsian" ), C2U("CharFontFamilyAsian") )
209 ( C2U( "CharFontFamilyComplex" ), C2U("CharFontFamilyComplex") )
210 ( C2U( "CharFontCharSet" ), C2U("CharFontCharSet") )
211 ( C2U( "CharFontCharSetAsian" ), C2U("CharFontCharSetAsian") )
212 ( C2U( "CharFontCharSetComplex" ), C2U("CharFontCharSetComplex") )
213 ( C2U( "CharFontName" ), C2U("CharFontName") )
214 ( C2U( "CharFontNameAsian" ), C2U("CharFontNameAsian") )
215 ( C2U( "CharFontNameComplex" ), C2U("CharFontNameComplex") )
216 ( C2U( "CharFontPitch" ), C2U("CharFontPitch") )
217 ( C2U( "CharFontPitchAsian" ), C2U("CharFontPitchAsian") )
218 ( C2U( "CharFontPitchComplex" ), C2U("CharFontPitchComplex") )
219 ( C2U( "CharFontStyleName" ), C2U("CharFontStyleName") )
220 ( C2U( "CharFontStyleNameAsian" ), C2U("CharFontStyleNameAsian") )
221 ( C2U( "CharFontStyleNameComplex" ),C2U("CharFontStyleNameComplex") )
223 ( C2U( "CharHeight" ), C2U("CharHeight") )
224 ( C2U( "CharHeightAsian" ), C2U("CharHeightAsian") )
225 ( C2U( "CharHeightComplex" ), C2U("CharHeightComplex") )
226 ( C2U( "CharKerning" ), C2U("CharKerning") )
227 ( C2U( "CharLocale" ), C2U("CharLocale") )
228 ( C2U( "CharLocaleAsian" ), C2U("CharLocaleAsian") )
229 ( C2U( "CharLocaleComplex" ), C2U("CharLocaleComplex") )
230 // ( C2U( "CharNoHyphenation" ), C2U("InhibitHyphenation") )
231 ( C2U( "CharPosture" ), C2U("CharPosture") )
232 ( C2U( "CharPostureAsian" ), C2U("CharPostureAsian") )
233 ( C2U( "CharPostureComplex" ), C2U("CharPostureComplex") )
234 ( C2U( "CharRelief" ), C2U("CharRelief") )
235 // ( C2U( "CharRotation" ), C2U("Rotation") ) --> additional feature ...
236 // ( C2U( "CharScaleWidth" ), C2U("CharScaleWidth") )
237 ( C2U( "CharShadowed" ), C2U("CharShadowed") )
238 ( C2U( "CharStrikeout" ), C2U("CharStrikeout") )
239 ( C2U( "CharUnderline" ), C2U("CharUnderline") )
240 ( C2U( "CharUnderlineColor" ), C2U("CharUnderlineColor") )
241 ( C2U( "CharUnderlineHasColor" ), C2U("CharUnderlineHasColor") )
242 ( C2U( "CharWeight" ), C2U("CharWeight") )
243 ( C2U( "CharWeightAsian" ), C2U("CharWeightAsian") )
244 ( C2U( "CharWeightComplex" ), C2U("CharWeightComplex") )
245 ( C2U( "CharWordMode" ), C2U("CharWordMode") )
247 ( C2U( "WritingMode" ), C2U("WritingMode") )
249 // ( C2U( "RubyText" ), C2U("RubyText") )
250 // ( C2U( "RubyAdjust" ), C2U("RubyAdjust") )
251 // ( C2U( "RubyCharStyleName" ), C2U("RubyStyleName") )
252 // ( C2U( "RubyIsAbove" ), C2U("RubyIsAbove") )
253 ( C2U( "ParaIsCharacterDistance" ), C2U("ParaIsCharacterDistance") )
255 return m_aShapePropertyMapForCharacterProperties
;
259 const tMakePropertyNameMap
& PropertyMapper::getPropertyNameMapForParagraphProperties()
261 //shape property -- chart model object property
262 static tMakePropertyNameMap m_aShapePropertyMapForParagraphProperties
=
264 ( C2U( "ParaAdjust" ), C2U("ParaAdjust") )
265 ( C2U( "ParaBottomMargin" ), C2U("ParaBottomMargin") )
266 ( C2U( "ParaIsHyphenation" ), C2U("ParaIsHyphenation") )
267 ( C2U( "ParaLastLineAdjust" ), C2U("ParaLastLineAdjust") )
268 ( C2U( "ParaLeftMargin" ), C2U("ParaLeftMargin") )
269 ( C2U( "ParaRightMargin" ), C2U("ParaRightMargin") )
270 ( C2U( "ParaTopMargin" ), C2U("ParaTopMargin") )
272 return m_aShapePropertyMapForParagraphProperties
;
276 const tMakePropertyNameMap
& PropertyMapper::getPropertyNameMapForFillProperties()
278 //shape property -- chart model object property
279 static tMakePropertyNameMap m_aShapePropertyMapForFillProperties
=
281 ( C2U( "FillBackground" ), C2U( "FillBackground" ) )
282 ( C2U( "FillBitmapName" ), C2U( "FillBitmapName" ) )
283 ( C2U( "FillColor" ), C2U( "FillColor" ) )
284 ( C2U( "FillGradientName" ), C2U( "FillGradientName" ) )
285 ( C2U( "FillGradientStepCount" ), C2U( "FillGradientStepCount" ) )
286 ( C2U( "FillHatchName" ), C2U( "FillHatchName" ) )
287 ( C2U( "FillStyle" ), C2U( "FillStyle" ) )
288 ( C2U( "FillTransparence" ), C2U( "FillTransparence" ) )
289 ( C2U( "FillTransparenceGradientName" ), C2U("FillTransparenceGradientName") )
291 ( C2U( "FillBitmapMode" ), C2U( "FillBitmapMode" ) )
292 ( C2U( "FillBitmapSizeX" ), C2U( "FillBitmapSizeX" ) )
293 ( C2U( "FillBitmapSizeY" ), C2U( "FillBitmapSizeY" ) )
294 ( C2U( "FillBitmapLogicalSize" ), C2U( "FillBitmapLogicalSize" ) )
295 ( C2U( "FillBitmapOffsetX" ), C2U( "FillBitmapOffsetX" ) )
296 ( C2U( "FillBitmapOffsetY" ), C2U( "FillBitmapOffsetY" ) )
297 ( C2U( "FillBitmapRectanglePoint" ),C2U( "FillBitmapRectanglePoint" ) )
298 ( C2U( "FillBitmapPositionOffsetX" ),C2U( "FillBitmapPositionOffsetX" ) )
299 ( C2U( "FillBitmapPositionOffsetY" ),C2U( "FillBitmapPositionOffsetY" ) )
301 return m_aShapePropertyMapForFillProperties
;
305 const tMakePropertyNameMap
& PropertyMapper::getPropertyNameMapForLineProperties()
307 //shape property -- chart model object property
308 static tMakePropertyNameMap m_aShapePropertyMapForLineProperties
=
310 ( C2U( "LineColor" ), C2U( "LineColor" ) )
311 ( C2U( "LineDashName" ), C2U( "LineDashName" ) )
312 ( C2U( "LineJoint" ), C2U( "LineJoint" ) )
313 ( C2U( "LineStyle" ), C2U( "LineStyle" ) )
314 ( C2U( "LineTransparence" ), C2U( "LineTransparence" ) )
315 ( C2U( "LineWidth" ), C2U( "LineWidth" ) )
317 return m_aShapePropertyMapForLineProperties
;
321 const tMakePropertyNameMap
& PropertyMapper::getPropertyNameMapForFillAndLineProperties()
323 static tMakePropertyNameMap m_aShapePropertyMapForFillAndLineProperties
=
325 ( PropertyMapper::getPropertyNameMapForFillProperties() )
326 ( PropertyMapper::getPropertyNameMapForLineProperties() )
329 return m_aShapePropertyMapForFillAndLineProperties
;
333 const tMakePropertyNameMap
& PropertyMapper::getPropertyNameMapForTextShapeProperties()
335 static tMakePropertyNameMap m_aShapePropertyMapForTextShapeProperties
=
337 ( PropertyMapper::getPropertyNameMapForCharacterProperties() )
338 ( PropertyMapper::getPropertyNameMapForFillProperties() )
339 ( PropertyMapper::getPropertyNameMapForLineProperties() )
340 // ( PropertyMapper::getPropertyNameMapForParagraphProperties() )
341 // some text properties
342 // ( C2U( "TextHorizontalAdjust" ), C2U( "TextHorizontalAdjust" ) )
343 // ( C2U( "TextVerticalAdjust" ), C2U( "TextVerticalAdjust" ) )
344 // ( C2U( "TextAutoGrowHeight" ), C2U( "TextAutoGrowHeight" ) )
345 // ( C2U( "TextAutoGrowWidth" ), C2U( "TextAutoGrowWidth" ) )
346 // ( C2U( "TextLeftDistance" ), C2U( "TextLeftDistance" ) )
347 // ( C2U( "TextRightDistance" ), C2U( "TextRightDistance" ) )
348 // ( C2U( "TextUpperDistance" ), C2U( "TextUpperDistance" ) )
349 // ( C2U( "TextLowerDistance" ), C2U( "TextLowerDistance" ) )
352 return m_aShapePropertyMapForTextShapeProperties
;
356 const tMakePropertyNameMap
& PropertyMapper::getPropertyNameMapForLineSeriesProperties()
358 //shape property -- chart model object property
359 static tMakePropertyNameMap m_aShapePropertyMapForLineSeriesProperties
=
361 ( C2U( "LineColor" ), C2U("Color") )
362 ( C2U( "LineDashName" ), C2U("LineDashName") )
363 // ( C2U( "LineJoint" ), C2U("LineJoint") )
364 ( C2U( "LineStyle" ), C2U("LineStyle") )
365 ( C2U( "LineTransparence" ), C2U("Transparency") )
366 ( C2U( "LineWidth" ), C2U("LineWidth") )
369 return m_aShapePropertyMapForLineSeriesProperties
;
373 const tMakePropertyNameMap
& PropertyMapper::getPropertyNameMapForFilledSeriesProperties()
375 //shape property -- chart model object property
376 static tMakePropertyNameMap m_aShapePropertyMapForFilledSeriesProperties
=
378 ( C2U( "FillBackground"), C2U("FillBackground") )
379 ( C2U( "FillBitmapName" ), C2U("FillBitmapName") )
380 ( C2U( "FillColor" ), C2U("Color") )
381 ( C2U( "FillGradientName" ), C2U("GradientName") )
382 ( C2U( "FillGradientStepCount" ), C2U( "GradientStepCount" ) )
383 ( C2U( "FillHatchName" ), C2U("HatchName") )
384 ( C2U( "FillStyle" ), C2U("FillStyle") )
385 ( C2U( "FillTransparence" ), C2U("Transparency") )
386 ( C2U( "FillTransparenceGradientName" ), C2U("TransparencyGradientName") )
388 ( C2U( "FillBitmapMode" ), C2U( "FillBitmapMode" ) )
389 ( C2U( "FillBitmapSizeX" ), C2U( "FillBitmapSizeX" ) )
390 ( C2U( "FillBitmapSizeY" ), C2U( "FillBitmapSizeY" ) )
391 ( C2U( "FillBitmapLogicalSize" ), C2U( "FillBitmapLogicalSize" ) )
392 ( C2U( "FillBitmapOffsetX" ), C2U( "FillBitmapOffsetX" ) )
393 ( C2U( "FillBitmapOffsetY" ), C2U( "FillBitmapOffsetY" ) )
394 ( C2U( "FillBitmapRectanglePoint" ),C2U( "FillBitmapRectanglePoint" ) )
395 ( C2U( "FillBitmapPositionOffsetX" ),C2U( "FillBitmapPositionOffsetX" ) )
396 ( C2U( "FillBitmapPositionOffsetY" ),C2U( "FillBitmapPositionOffsetY" ) )
398 ( C2U( "LineColor" ), C2U("BorderColor") )
399 ( C2U( "LineDashName" ), C2U("BorderDashName") )
400 // ( C2U( "LineJoint" ), C2U("LineJoint") )
401 ( C2U( "LineStyle" ), C2U("BorderStyle") )
402 ( C2U( "LineTransparence" ), C2U("BorderTransparency") )
403 ( C2U( "LineWidth" ), C2U("BorderWidth") )
405 return m_aShapePropertyMapForFilledSeriesProperties
;
409 void PropertyMapper::setMultiProperties(
410 const tNameSequence
& rNames
411 , const tAnySequence
& rValues
412 , const ::com::sun::star::uno::Reference
<
413 ::com::sun::star::beans::XPropertySet
>& xTarget
)
415 bool bSuccess
= false;
418 uno::Reference
< beans::XMultiPropertySet
> xShapeMultiProp( xTarget
, uno::UNO_QUERY
);
419 if( xShapeMultiProp
.is() )
421 xShapeMultiProp
->setPropertyValues( rNames
, rValues
);
425 catch( uno::Exception
& e
)
427 ASSERT_EXCEPTION( e
); //if this occurs more often think of removing the XMultiPropertySet completly for better performance
433 sal_Int32 nCount
= std::max( rNames
.getLength(), rValues
.getLength() );
434 rtl::OUString aPropName
;
436 for( sal_Int32 nN
= 0; nN
< nCount
; nN
++ )
438 aPropName
= rNames
[nN
];
439 aValue
= rValues
[nN
];
443 xTarget
->setPropertyValue( aPropName
, aValue
);
445 catch( uno::Exception
& e
)
447 ASSERT_EXCEPTION( e
);
451 catch( uno::Exception
& e
)
453 ASSERT_EXCEPTION( e
);
457 void PropertyMapper::getTextLabelMultiPropertyLists(
458 const uno::Reference
< beans::XPropertySet
>& xSourceProp
459 , tNameSequence
& rPropNames
, tAnySequence
& rPropValues
461 , sal_Int32 nLimitedSpace
462 , bool bLimitedHeight
)
464 //fill character properties into the ValueMap
465 tPropertyNameValueMap aValueMap
;
466 PropertyMapper::getValueMap( aValueMap
467 , PropertyMapper::getPropertyNameMapForCharacterProperties()
470 //some more shape properties apart from character properties, position-matrix and label string
471 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("LineStyle"), uno::makeAny(drawing::LineStyle_NONE
) ) ); // drawing::LineStyle
472 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextHorizontalAdjust"), uno::makeAny(drawing::TextHorizontalAdjust_CENTER
) ) ); // drawing::TextHorizontalAdjust - needs to be overwritten
473 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextVerticalAdjust"), uno::makeAny(drawing::TextVerticalAdjust_CENTER
) ) ); //drawing::TextVerticalAdjust - needs to be overwritten
474 //aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextWritingMode"), uno::makeAny(eWritingMode) ) ); //text::WritingMode
475 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowHeight"), uno::makeAny(sal_True
) ) ); // sal_Bool
476 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowWidth"), uno::makeAny(sal_True
) ) ); // sal_Bool
478 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("Name"), uno::makeAny( rtl::OUString() ) ) ); //CID rtl::OUString - needs to be overwritten for each point
480 if( nLimitedSpace
> 0 )
483 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextMaximumFrameHeight"), uno::makeAny(nLimitedSpace
) ) ); //sal_Int32
485 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextMaximumFrameWidth"), uno::makeAny(nLimitedSpace
) ) ); //sal_Int32
486 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("ParaIsHyphenation"), uno::makeAny(sal_True
) ) );
490 //@todo ?: add paragraph properties:
491 //(uno::makeAny(eParaAdjust)) //ParaAdjust - style::ParagraphAdjust
492 //(uno::makeAny( (sal_Bool)rAxisLabelProperties.bLineBreakAllowed )) //ParaIsHyphenation - sal_Bool
493 style::ParagraphAdjust eParaAdjust( style::ParagraphAdjust_LEFT );
494 if( eHorizontalAdjust == drawing::TextHorizontalAdjust_RIGHT )
495 eParaAdjust = style::ParagraphAdjust_RIGHT;
498 PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames
, rPropValues
, aValueMap
);
501 void PropertyMapper::getPreparedTextShapePropertyLists(
502 const uno::Reference
< beans::XPropertySet
>& xSourceProp
503 , tNameSequence
& rPropNames
, tAnySequence
& rPropValues
)
505 //fill character, line and fill properties into the ValueMap
506 tPropertyNameValueMap aValueMap
;
507 PropertyMapper::getValueMap( aValueMap
508 , PropertyMapper::getPropertyNameMapForTextShapeProperties()
511 // auto-grow makes sure the shape has the correct size after setting text
512 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextHorizontalAdjust"), uno::makeAny( drawing::TextHorizontalAdjust_CENTER
)));
513 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextVerticalAdjust"), uno::makeAny( drawing::TextVerticalAdjust_CENTER
)));
514 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowHeight"), uno::makeAny( true )));
515 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowWidth"), uno::makeAny( true )));
517 // set some distance to the border, in case it is shown
518 const sal_Int32 nWidthDist
= 250;
519 const sal_Int32 nHeightDist
= 125;
520 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextLeftDistance"), uno::makeAny( nWidthDist
)));
521 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextRightDistance"), uno::makeAny( nWidthDist
)));
522 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextUpperDistance"), uno::makeAny( nHeightDist
)));
523 aValueMap
.insert( tPropertyNameValueMap::value_type( C2U("TextLowerDistance"), uno::makeAny( nHeightDist
)));
525 // use a line-joint showing the border of thick lines like two rectangles
526 // filled in between.
527 aValueMap
[C2U("LineJoint")] <<= drawing::LineJoint_MITER
;
529 PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames
, rPropValues
, aValueMap
);
532 //.............................................................................
534 //.............................................................................