1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_chart2.hxx"
26 
27 #include "LabelPositionHelper.hxx"
28 #include "PlottingPositionHelper.hxx"
29 #include "CommonConverters.hxx"
30 #include "PropertyMapper.hxx"
31 #include "ShapeFactory.hxx"
32 #include "macros.hxx"
33 #include "RelativeSizeHelper.hxx"
34 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
35 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
36 
37 //.............................................................................
38 namespace chart
39 {
40 //.............................................................................
41 using namespace ::com::sun::star;
42 using namespace ::com::sun::star::chart2;
43 
LabelPositionHelper(PlottingPositionHelper * pPosHelper,sal_Int32 nDimensionCount,const uno::Reference<drawing::XShapes> & xLogicTarget,ShapeFactory * pShapeFactory)44 LabelPositionHelper::LabelPositionHelper(
45                     PlottingPositionHelper* pPosHelper
46                     , sal_Int32 nDimensionCount
47                     , const uno::Reference< drawing::XShapes >& xLogicTarget
48                     , ShapeFactory* pShapeFactory )
49                     : m_pPosHelper(pPosHelper)
50                     , m_nDimensionCount(nDimensionCount)
51                     , m_xLogicTarget(xLogicTarget)
52                     , m_pShapeFactory(pShapeFactory)
53 {
54 }
55 
~LabelPositionHelper()56 LabelPositionHelper::~LabelPositionHelper()
57 {
58 }
59 
transformSceneToScreenPosition(const drawing::Position3D & rScenePosition3D) const60 awt::Point LabelPositionHelper::transformSceneToScreenPosition( const drawing::Position3D& rScenePosition3D ) const
61 {
62     return PlottingPositionHelper::transformSceneToScreenPosition(
63                   rScenePosition3D, m_xLogicTarget, m_pShapeFactory, m_nDimensionCount );
64 }
65 
changeTextAdjustment(tAnySequence & rPropValues,const tNameSequence & rPropNames,LabelAlignment eAlignment)66 void LabelPositionHelper::changeTextAdjustment( tAnySequence& rPropValues, const tNameSequence& rPropNames, LabelAlignment eAlignment)
67 {
68     //HorizontalAdjustment
69     {
70         drawing::TextHorizontalAdjust eHorizontalAdjust = drawing::TextHorizontalAdjust_CENTER;
71         if( LABEL_ALIGN_RIGHT==eAlignment || LABEL_ALIGN_RIGHT_TOP==eAlignment || LABEL_ALIGN_RIGHT_BOTTOM==eAlignment )
72             eHorizontalAdjust = drawing::TextHorizontalAdjust_LEFT;
73         else if( LABEL_ALIGN_LEFT==eAlignment || LABEL_ALIGN_LEFT_TOP==eAlignment || LABEL_ALIGN_LEFT_BOTTOM==eAlignment )
74             eHorizontalAdjust = drawing::TextHorizontalAdjust_RIGHT;
75         uno::Any* pHorizontalAdjustAny = PropertyMapper::getValuePointer(rPropValues,rPropNames,C2U("TextHorizontalAdjust"));
76         if(pHorizontalAdjustAny)
77             *pHorizontalAdjustAny = uno::makeAny(eHorizontalAdjust);
78     }
79 
80     //VerticalAdjustment
81     {
82         drawing::TextVerticalAdjust eVerticalAdjust = drawing::TextVerticalAdjust_CENTER;
83         if( LABEL_ALIGN_TOP==eAlignment || LABEL_ALIGN_RIGHT_TOP==eAlignment || LABEL_ALIGN_LEFT_TOP==eAlignment )
84             eVerticalAdjust = drawing::TextVerticalAdjust_BOTTOM;
85         else if( LABEL_ALIGN_BOTTOM==eAlignment || LABEL_ALIGN_RIGHT_BOTTOM==eAlignment || LABEL_ALIGN_LEFT_BOTTOM==eAlignment )
86             eVerticalAdjust = drawing::TextVerticalAdjust_TOP;
87         uno::Any* pVerticalAdjustAny = PropertyMapper::getValuePointer(rPropValues,rPropNames,C2U("TextVerticalAdjust"));
88         if(pVerticalAdjustAny)
89             *pVerticalAdjustAny = uno::makeAny(eVerticalAdjust);
90     }
91 }
92 
lcl_doDynamicFontResize(uno::Any * pAOldAndNewFontHeightAny,const awt::Size & rOldReferenceSize,const awt::Size & rNewReferenceSize)93 void lcl_doDynamicFontResize( uno::Any* pAOldAndNewFontHeightAny
94                           , const awt::Size& rOldReferenceSize
95                           , const awt::Size& rNewReferenceSize  )
96 {
97     double fOldFontHeight = 0, fNewFontHeight;
98     if( pAOldAndNewFontHeightAny && ( *pAOldAndNewFontHeightAny >>= fOldFontHeight ) )
99     {
100         fNewFontHeight = RelativeSizeHelper::calculate( fOldFontHeight, rOldReferenceSize, rNewReferenceSize );
101         *pAOldAndNewFontHeightAny = uno::makeAny(fNewFontHeight);
102     }
103 }
104 
doDynamicFontResize(tAnySequence & rPropValues,const tNameSequence & rPropNames,const uno::Reference<beans::XPropertySet> & xAxisModelProps,const awt::Size & rNewReferenceSize)105 void LabelPositionHelper::doDynamicFontResize( tAnySequence& rPropValues
106                     , const tNameSequence& rPropNames
107                     , const uno::Reference< beans::XPropertySet >& xAxisModelProps
108                     , const awt::Size& rNewReferenceSize
109                     )
110 {
111     //-------------------------
112     //handle dynamic font resize:
113     awt::Size aOldReferenceSize;
114     if( xAxisModelProps->getPropertyValue( C2U("ReferencePageSize")) >>= aOldReferenceSize )
115     {
116         uno::Any* pAOldAndNewFontHeightAny = PropertyMapper::getValuePointer( rPropValues, rPropNames, C2U("CharHeight") );
117         lcl_doDynamicFontResize( pAOldAndNewFontHeightAny, aOldReferenceSize, rNewReferenceSize );
118         pAOldAndNewFontHeightAny = PropertyMapper::getValuePointer( rPropValues, rPropNames, C2U("CharHeightAsian") );
119         lcl_doDynamicFontResize( pAOldAndNewFontHeightAny, aOldReferenceSize, rNewReferenceSize );
120         pAOldAndNewFontHeightAny = PropertyMapper::getValuePointer( rPropValues, rPropNames, C2U("CharHeightComplex") );
121         lcl_doDynamicFontResize( pAOldAndNewFontHeightAny, aOldReferenceSize, rNewReferenceSize );
122     }
123 }
124 
125 namespace
126 {
127 
lcl_correctRotation_Left(double & rfXCorrection,double & rfYCorrection,double fAnglePositiveDegree,const awt::Size & aSize,bool bRotateAroundCenter)128 void lcl_correctRotation_Left( double& rfXCorrection, double& rfYCorrection
129                            , double fAnglePositiveDegree, const awt::Size& aSize, bool bRotateAroundCenter )
130 {
131     //correct label positions for labels on a left side of something with a right centered alignment
132     double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
133     if( fAnglePositiveDegree==0.0 )
134     {
135     }
136     else if( fAnglePositiveDegree<= 90.0 )
137     {
138         rfXCorrection = -aSize.Height*rtl::math::sin( fAnglePi )/2.0;
139         if( bRotateAroundCenter )
140             rfYCorrection = -aSize.Width*rtl::math::sin( fAnglePi )/2.0;
141     }
142     else if( fAnglePositiveDegree<= 180.0 )
143     {
144         double beta = fAnglePi-F_PI/2.0;
145         rfXCorrection = -aSize.Width *rtl::math::sin( beta )
146             -aSize.Height *rtl::math::cos( beta )/2.0;
147         if( bRotateAroundCenter )
148             rfYCorrection = -aSize.Width *rtl::math::cos( beta )/2.0;
149         else
150             rfYCorrection = -aSize.Width *rtl::math::cos( beta );
151     }
152     else if( fAnglePositiveDegree<= 270.0 )
153     {
154         double beta = fAnglePi - F_PI;
155         rfXCorrection = -aSize.Width *rtl::math::cos( beta )
156             -aSize.Height*rtl::math::sin( beta )/2.0;
157         if( bRotateAroundCenter )
158             rfYCorrection = aSize.Width *rtl::math::sin( beta )/2.0;
159         else
160             rfYCorrection = aSize.Width *rtl::math::sin( beta );
161     }
162     else
163     {
164         double beta = 2*F_PI - fAnglePi;
165         rfXCorrection = -aSize.Height*rtl::math::sin( beta )/2.0;
166         if( bRotateAroundCenter )
167             rfYCorrection = aSize.Width*rtl::math::sin( beta )/2.0;
168     }
169 }
170 
lcl_correctRotation_Right(double & rfXCorrection,double & rfYCorrection,double fAnglePositiveDegree,const awt::Size & aSize,bool bRotateAroundCenter)171 void lcl_correctRotation_Right( double& rfXCorrection, double& rfYCorrection
172                            , double fAnglePositiveDegree, const awt::Size& aSize, bool bRotateAroundCenter )
173 {
174     //correct label positions for labels on a right side of something with a left centered alignment
175     double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
176     if( fAnglePositiveDegree== 0.0 )
177     {
178     }
179     else if( fAnglePositiveDegree<= 90.0 )
180     {
181         rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi )/2.0;
182         if( bRotateAroundCenter )
183             rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi )/2.0;
184     }
185     else if( fAnglePositiveDegree<= 180.0 )
186     {
187         double beta = F_PI - fAnglePi;
188         rfXCorrection = aSize.Width *rtl::math::cos( beta )
189             + aSize.Height*rtl::math::sin( beta )/2.0;
190         if( bRotateAroundCenter )
191             rfYCorrection = aSize.Width *rtl::math::sin( beta )/2.0;
192         else
193             rfYCorrection = aSize.Width *rtl::math::sin( beta );
194     }
195     else if( fAnglePositiveDegree<= 270.0 )
196     {
197         double beta = 3*F_PI/2.0 - fAnglePi;
198         rfXCorrection = aSize.Width *rtl::math::sin( beta )
199                     +aSize.Height*rtl::math::cos( beta )/2.0;
200         if( bRotateAroundCenter )
201             rfYCorrection = -aSize.Width *rtl::math::cos( beta )/2.0;
202         else
203             rfYCorrection = -aSize.Width *rtl::math::cos( beta );
204     }
205     else
206     {
207         rfXCorrection  = aSize.Height*rtl::math::sin( 2*F_PI - fAnglePi )/2.0;
208         if( bRotateAroundCenter )
209             rfYCorrection = -aSize.Width*rtl::math::sin( 2*F_PI - fAnglePi )/2.0;
210     }
211 }
212 
lcl_correctRotation_Top(double & rfXCorrection,double & rfYCorrection,double fAnglePositiveDegree,const awt::Size & aSize,bool bRotateAroundCenter)213 void lcl_correctRotation_Top( double& rfXCorrection, double& rfYCorrection
214                            , double fAnglePositiveDegree, const awt::Size& aSize, bool bRotateAroundCenter )
215 {
216     //correct label positions for labels on top of something with a bottom centered alignment
217     double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
218     if( fAnglePositiveDegree== 0.0 )
219     {
220     }
221     else if( fAnglePositiveDegree<= 90.0 )
222     {
223         rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi )/2.0;
224         if( !bRotateAroundCenter )
225             rfXCorrection += aSize.Width*rtl::math::cos( fAnglePi )/2.0;
226         rfYCorrection = -aSize.Width*rtl::math::sin( fAnglePi )/2.0;
227     }
228     else if( fAnglePositiveDegree<= 180.0 )
229     {
230         double beta = fAnglePi - F_PI/2.0;
231         rfXCorrection = aSize.Height*rtl::math::cos( beta )/2.0;
232         if( !bRotateAroundCenter )
233             rfXCorrection -= aSize.Width*rtl::math::sin( beta )/2.0;
234         rfYCorrection = -aSize.Width*rtl::math::cos( beta )/2.0
235             - aSize.Height*rtl::math::sin( beta );
236     }
237     else if( fAnglePositiveDegree<= 270.0 )
238     {
239         double beta = fAnglePi - F_PI;
240         rfXCorrection = -aSize.Height *rtl::math::sin( beta )/2.0;
241         if( !bRotateAroundCenter )
242             rfXCorrection += aSize.Width *rtl::math::cos( beta )/2.0;
243         rfYCorrection = -aSize.Width *rtl::math::sin( beta )/2.0
244             -aSize.Height *rtl::math::cos( beta );
245     }
246     else
247     {
248         rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi )/2.0;
249         if( !bRotateAroundCenter )
250             rfXCorrection -= aSize.Width*rtl::math::cos( fAnglePi )/2.0;
251         rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi )/2.0;
252     }
253 }
254 
lcl_correctRotation_Bottom(double & rfXCorrection,double & rfYCorrection,double fAnglePositiveDegree,const awt::Size & aSize,bool bRotateAroundCenter)255 void lcl_correctRotation_Bottom( double& rfXCorrection, double& rfYCorrection
256                            , double fAnglePositiveDegree, const awt::Size& aSize, bool bRotateAroundCenter )
257 {
258     //correct label positions for labels below something with a top centered alignment
259     double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
260     if( fAnglePositiveDegree==0.0 )
261     {
262     }
263     else if( fAnglePositiveDegree<= 90.0 )
264     {
265         rfXCorrection = -aSize.Height*rtl::math::sin( fAnglePi )/2.0;
266         if( !bRotateAroundCenter )
267             rfXCorrection -= aSize.Width *rtl::math::cos( fAnglePi )/2.0;
268         rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi )/2.0;
269     }
270     else if( fAnglePositiveDegree<= 180.0 )
271     {
272         double beta = fAnglePi-F_PI/2.0;
273         rfXCorrection = -aSize.Height*rtl::math::cos( beta )/2.0;
274         if( !bRotateAroundCenter )
275             rfXCorrection += aSize.Width *rtl::math::sin( beta )/2.0;
276         rfYCorrection = aSize.Width *rtl::math::cos( beta )/2.0
277             +aSize.Height*rtl::math::sin( beta );
278     }
279     else if( fAnglePositiveDegree<= 270.0 )
280     {
281         double beta = 3*F_PI/2.0 - fAnglePi;
282         rfXCorrection = aSize.Height*rtl::math::cos( beta )/2.0;
283         if( !bRotateAroundCenter )
284             rfXCorrection -= aSize.Width *rtl::math::sin( beta )/2.0;
285         rfYCorrection = aSize.Height*rtl::math::sin( beta )
286                         +aSize.Width*rtl::math::cos( beta )/2.0;
287     }
288     else
289     {
290         double beta = 2*F_PI - fAnglePi;
291         rfXCorrection = aSize.Height*rtl::math::sin( beta )/2.0;
292         if( !bRotateAroundCenter )
293             rfXCorrection += aSize.Width*rtl::math::cos( beta )/2.0;
294         rfYCorrection = aSize.Width*rtl::math::sin( beta )/2.0;
295     }
296 }
297 
lcl_correctRotation_Left_Top(double & rfXCorrection,double & rfYCorrection,double fAnglePositiveDegree,const awt::Size & aSize)298 void lcl_correctRotation_Left_Top( double& rfXCorrection, double& rfYCorrection
299                            , double fAnglePositiveDegree, const awt::Size& aSize )
300 {
301     //correct position for labels at the left top corner of something with a bottom right alignment
302     double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
303     if( fAnglePositiveDegree==0.0 )
304     {
305     }
306     else if( fAnglePositiveDegree<= 90.0 )
307     {
308         rfYCorrection = -aSize.Width*rtl::math::sin( fAnglePi );
309     }
310     else if( fAnglePositiveDegree<= 180.0 )
311     {
312         double beta = fAnglePi-F_PI/2.0;
313         rfXCorrection = -aSize.Width*rtl::math::sin( beta );
314         rfYCorrection = -aSize.Height*rtl::math::sin( beta )
315                         -aSize.Width*rtl::math::cos( beta );
316     }
317     else if( fAnglePositiveDegree<= 270.0 )
318     {
319         double beta = 3*F_PI/2.0 - fAnglePi;
320         rfXCorrection = -aSize.Height*rtl::math::cos( beta )
321                         -aSize.Width*rtl::math::sin( beta );
322         rfYCorrection = -aSize.Height*rtl::math::sin( beta );
323     }
324     else
325     {
326         rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi );
327     }
328 }
329 
lcl_correctRotation_Left_Bottom(double & rfXCorrection,double & rfYCorrection,double fAnglePositiveDegree,const awt::Size & aSize)330 void lcl_correctRotation_Left_Bottom( double& rfXCorrection, double& rfYCorrection
331                            , double fAnglePositiveDegree, const awt::Size& aSize )
332 {
333     //correct position for labels at the left bottom corner of something with a top right alignment
334     double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
335     if( fAnglePositiveDegree==0.0 )
336     {
337     }
338     else if( fAnglePositiveDegree<= 90.0 )
339     {
340         rfXCorrection = -aSize.Height*rtl::math::sin( fAnglePi );
341     }
342     else if( fAnglePositiveDegree<= 180.0 )
343     {
344         double beta = fAnglePi-F_PI/2.0;
345         rfXCorrection = -aSize.Width*rtl::math::sin( beta )
346                         -aSize.Height*rtl::math::cos( beta );;
347         rfYCorrection = aSize.Height*rtl::math::sin( beta );
348     }
349     else if( fAnglePositiveDegree<= 270.0 )
350     {
351         double beta = 3*F_PI/2.0 - fAnglePi;
352         rfXCorrection = -aSize.Width*rtl::math::sin( beta );
353         rfYCorrection = aSize.Width*rtl::math::cos( beta )
354                         +aSize.Height*rtl::math::sin( beta );
355     }
356     else
357     {
358         rfYCorrection = -aSize.Width*rtl::math::sin( fAnglePi );
359     }
360 }
361 
lcl_correctRotation_Right_Top(double & rfXCorrection,double & rfYCorrection,double fAnglePositiveDegree,const awt::Size & aSize)362 void lcl_correctRotation_Right_Top( double& rfXCorrection, double& rfYCorrection
363                            , double fAnglePositiveDegree, const awt::Size& aSize )
364 {
365     //correct position for labels at the right top corner of something with a bottom left alignment
366     double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
367     if( fAnglePositiveDegree==0.0 )
368     {
369     }
370     else if( fAnglePositiveDegree<= 90.0 )
371     {
372         rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi );
373     }
374     else if( fAnglePositiveDegree<= 180.0 )
375     {
376         double beta = fAnglePi-F_PI/2.0;
377         rfXCorrection = aSize.Width*rtl::math::sin( beta )
378                         +aSize.Height*rtl::math::cos( beta );
379         rfYCorrection = -aSize.Height*rtl::math::sin( beta );
380     }
381     else if( fAnglePositiveDegree<= 270.0 )
382     {
383         double beta = 3*F_PI/2.0 - fAnglePi;
384         rfXCorrection = aSize.Width*rtl::math::sin( beta );
385         rfYCorrection = -aSize.Width*rtl::math::cos( beta )
386                         -aSize.Height*rtl::math::sin( beta );
387     }
388     else
389     {
390         rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi );
391     }
392 }
393 
lcl_correctRotation_Right_Bottom(double & rfXCorrection,double & rfYCorrection,double fAnglePositiveDegree,const awt::Size & aSize)394 void lcl_correctRotation_Right_Bottom( double& rfXCorrection, double& rfYCorrection
395                            , double fAnglePositiveDegree, const awt::Size& aSize )
396 {
397     //correct position for labels at the right bottom corner of something with a top left alignment
398     double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
399     if( fAnglePositiveDegree==0.0 )
400     {
401     }
402     else if( fAnglePositiveDegree<= 90.0 )
403     {
404         rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi );
405     }
406     else if( fAnglePositiveDegree<= 180.0 )
407     {
408         double beta = fAnglePi-F_PI/2.0;
409         rfXCorrection = aSize.Width*rtl::math::sin( beta );
410         rfYCorrection = aSize.Height*rtl::math::sin( beta )
411                         +aSize.Width*rtl::math::cos( beta );
412     }
413     else if( fAnglePositiveDegree<= 270.0 )
414     {
415         double beta = 3*F_PI/2.0 - fAnglePi;
416         rfXCorrection = aSize.Height*rtl::math::cos( beta )
417                         +aSize.Width*rtl::math::sin( beta );
418         rfYCorrection = aSize.Height*rtl::math::sin( beta );
419     }
420     else
421     {
422         rfXCorrection = -aSize.Height*rtl::math::sin( fAnglePi );
423     }
424 }
425 
426 }//end anonymous namespace
427 
correctPositionForRotation(const uno::Reference<drawing::XShape> & xShape2DText,LabelAlignment eLabelAlignment,const double fRotationAngle,bool bRotateAroundCenter)428 void LabelPositionHelper::correctPositionForRotation( const uno::Reference< drawing::XShape >& xShape2DText
429                      , LabelAlignment eLabelAlignment, const double fRotationAngle, bool bRotateAroundCenter )
430 {
431     if( !xShape2DText.is() )
432         return;
433 
434     awt::Point aOldPos = xShape2DText->getPosition();
435     awt::Size  aSize   = xShape2DText->getSize();
436 
437     double fYCorrection = 0.0;
438     double fXCorrection  = 0.0;
439 
440     double fAnglePositiveDegree = fRotationAngle;
441     while(fAnglePositiveDegree<0.0)
442         fAnglePositiveDegree+=360.0;
443 
444     switch(eLabelAlignment)
445     {
446         case LABEL_ALIGN_LEFT:
447             lcl_correctRotation_Left( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize, bRotateAroundCenter );
448             break;
449         case LABEL_ALIGN_RIGHT:
450             lcl_correctRotation_Right( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize, bRotateAroundCenter );
451             break;
452         case LABEL_ALIGN_TOP:
453             lcl_correctRotation_Top( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize, bRotateAroundCenter );
454             break;
455         case LABEL_ALIGN_BOTTOM:
456             lcl_correctRotation_Bottom( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize, bRotateAroundCenter );
457             break;
458         case LABEL_ALIGN_LEFT_TOP:
459             lcl_correctRotation_Left_Top( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
460             break;
461         case LABEL_ALIGN_LEFT_BOTTOM:
462             lcl_correctRotation_Left_Bottom( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
463             break;
464         case LABEL_ALIGN_RIGHT_TOP:
465             lcl_correctRotation_Right_Top( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
466             break;
467         case LABEL_ALIGN_RIGHT_BOTTOM:
468             lcl_correctRotation_Right_Bottom( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
469             break;
470         default: //LABEL_ALIGN_CENTER
471             break;
472     }
473 
474     xShape2DText->setPosition( awt::Point(
475           static_cast<sal_Int32>(aOldPos.X + fXCorrection  )
476         , static_cast<sal_Int32>(aOldPos.Y + fYCorrection ) ) );
477 }
478 
479 //.............................................................................
480 } //namespace chart
481 //.............................................................................
482