chart2/source/view/main/LabelPositionHelper.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
New commits: commit 6955e89903b5ec4328cab15f8a17663ad8ba3e9a Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Thu Jan 25 09:15:29 2024 -0500 Commit: Justin Luth <jl...@mail.com> CommitDate: Mon Jan 29 14:17:26 2024 +0100 NFC chart2: trivial avoidance of unnecessary calculations Change-Id: Ia3bfce9ba6c7b8cab55e46e4d1e8c2afe54a65b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162588 Reviewed-by: Justin Luth <jl...@mail.com> Tested-by: Justin Luth <jl...@mail.com> diff --git a/chart2/source/view/main/LabelPositionHelper.cxx b/chart2/source/view/main/LabelPositionHelper.cxx index 449c5776e4d7..471d76662ef2 100644 --- a/chart2/source/view/main/LabelPositionHelper.cxx +++ b/chart2/source/view/main/LabelPositionHelper.cxx @@ -53,28 +53,28 @@ awt::Point LabelPositionHelper::transformSceneToScreenPosition( const drawing::P void LabelPositionHelper::changeTextAdjustment( tAnySequence& rPropValues, const tNameSequence& rPropNames, LabelAlignment eAlignment) { - //HorizontalAdjustment + uno::Any* pHorizontalAdjustAny + = PropertyMapper::getValuePointer(rPropValues, rPropNames, u"TextHorizontalAdjust"); + if (pHorizontalAdjustAny) { drawing::TextHorizontalAdjust eHorizontalAdjust = drawing::TextHorizontalAdjust_CENTER; if( eAlignment==LABEL_ALIGN_RIGHT || eAlignment==LABEL_ALIGN_RIGHT_TOP || eAlignment==LABEL_ALIGN_RIGHT_BOTTOM ) eHorizontalAdjust = drawing::TextHorizontalAdjust_LEFT; else if( eAlignment==LABEL_ALIGN_LEFT || eAlignment==LABEL_ALIGN_LEFT_TOP || eAlignment==LABEL_ALIGN_LEFT_BOTTOM ) eHorizontalAdjust = drawing::TextHorizontalAdjust_RIGHT; - uno::Any* pHorizontalAdjustAny = PropertyMapper::getValuePointer(rPropValues,rPropNames,u"TextHorizontalAdjust"); - if(pHorizontalAdjustAny) - *pHorizontalAdjustAny <<= eHorizontalAdjust; + *pHorizontalAdjustAny <<= eHorizontalAdjust; } - //VerticalAdjustment + uno::Any* pVerticalAdjustAny + = PropertyMapper::getValuePointer(rPropValues, rPropNames, u"TextVerticalAdjust"); + if (pVerticalAdjustAny) { drawing::TextVerticalAdjust eVerticalAdjust = drawing::TextVerticalAdjust_CENTER; if( eAlignment==LABEL_ALIGN_TOP || eAlignment==LABEL_ALIGN_RIGHT_TOP || eAlignment==LABEL_ALIGN_LEFT_TOP ) eVerticalAdjust = drawing::TextVerticalAdjust_BOTTOM; else if( eAlignment==LABEL_ALIGN_BOTTOM || eAlignment==LABEL_ALIGN_RIGHT_BOTTOM || eAlignment==LABEL_ALIGN_LEFT_BOTTOM ) eVerticalAdjust = drawing::TextVerticalAdjust_TOP; - uno::Any* pVerticalAdjustAny = PropertyMapper::getValuePointer(rPropValues,rPropNames,u"TextVerticalAdjust"); - if(pVerticalAdjustAny) - *pVerticalAdjustAny <<= eVerticalAdjust; + *pVerticalAdjustAny <<= eVerticalAdjust; } }