chart2/source/view/axes/VAxisBase.cxx | 4 chart2/source/view/axes/VAxisProperties.cxx | 38 ++++---- chart2/source/view/axes/VAxisProperties.hxx | 14 +- chart2/source/view/axes/VCartesianAxis.cxx | 132 ++++++++++++++-------------- chart2/source/view/axes/VPolarAngleAxis.cxx | 10 +- sc/source/ui/view/output.cxx | 21 ++-- 6 files changed, 109 insertions(+), 110 deletions(-)
New commits: commit d0a11f591a57754362bb86c4bb07869bc18e5f75 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sun Feb 6 18:30:39 2022 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sun Feb 6 13:00:14 2022 +0100 sc: fix rendering of conditional formatting icon The bWorksInPixels flag isn't needed as it means some rendering information is in pixel instead of logic, but we render in logic, not in pixels as it is falsely assumed. So don't take into account the bWorksInPixels flag and just render in pixels when LOKit is active. Change-Id: I3703d459a2d1444c397f2d9e97af9f0d3010d544 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129546 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index bd630f531ed6..2f9674a1edae 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -908,7 +908,7 @@ const BitmapEx& getIcon(sc::IconSetBitmapMap & rIconSetBitmapMap, ScIconSetType } void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldIconSetInfo, const tools::Rectangle& rRect, tools::Long nOneX, tools::Long nOneY, - sc::IconSetBitmapMap & rIconSetBitmapMap, bool bWorksInPixels) + sc::IconSetBitmapMap & rIconSetBitmapMap) { ScIconSetType eType = pOldIconSetInfo->eIconSetType; sal_Int32 nIndex = pOldIconSetInfo->nIconIndex; @@ -918,16 +918,15 @@ void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldI if (pOldIconSetInfo->mnHeight) { - if (bWorksInPixels) + if (comphelper::LibreOfficeKit::isActive()) { aHeight = rRenderContext.LogicToPixel(Size(0, pOldIconSetInfo->mnHeight), MapMode(MapUnit::MapTwip)).Height(); - if (comphelper::LibreOfficeKit::isActive()) - { - aHeight *= comphelper::LibreOfficeKit::getDPIScale(); - } + aHeight *= comphelper::LibreOfficeKit::getDPIScale(); } else + { aHeight = o3tl::convert(pOldIconSetInfo->mnHeight, o3tl::Length::twip, o3tl::Length::mm100); + } } Size aSize = rIcon.GetSizePixel(); @@ -943,7 +942,7 @@ void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldI void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const & pColor, const SvxBrushItem* pBackground, std::optional<Color>& pOldColor, const SvxBrushItem*& pOldBackground, tools::Rectangle& rRect, tools::Long nPosX, tools::Long nLayoutSign, tools::Long nOneX, tools::Long nOneY, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo, const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& pOldIconSetInfo, - sc::IconSetBitmapMap & rIconSetBitmapMap, bool bWorksInPixels) + sc::IconSetBitmapMap & rIconSetBitmapMap) { tools::Long nSignedOneX = nOneX * nLayoutSign; // need to paint if old color scale has been used and now @@ -960,7 +959,7 @@ void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const & if( pOldDataBarInfo ) drawDataBars(rRenderContext, pOldDataBarInfo, rRect, nOneX, nOneY); if( pOldIconSetInfo ) - drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap, bWorksInPixels); + drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap); rRect.SetLeft( nPosX - nSignedOneX ); } @@ -980,7 +979,7 @@ void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const & if( pOldDataBarInfo ) drawDataBars(rRenderContext, pOldDataBarInfo, rRect, nOneX, nOneY); if( pOldIconSetInfo ) - drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap, bWorksInPixels); + drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap); rRect.SetLeft( nPosX - nSignedOneX ); } @@ -1143,7 +1142,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) if (bWorksInPixels) nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X(); - drawCells(rRenderContext, pColor, pBackground, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap(), bWorksInPixels); + drawCells(rRenderContext, pColor, pBackground, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap()); // extend for all merged cells nMergedCols = 1; @@ -1167,7 +1166,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) if (bWorksInPixels) nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X(); - drawCells(rRenderContext, std::optional<Color>(), nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap(), bWorksInPixels); + drawCells(rRenderContext, std::optional<Color>(), nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap()); nArrY += nSkip; } commit 67cf91ec83a5933b07a87bdeb6ddeb6e1f781dea Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Fri Feb 4 17:46:04 2022 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sun Feb 6 12:59:59 2022 +0100 chart: prefix members of AxisLabelProperties Change-Id: Ife658e44dc039811d61b45f4712635920f5c34b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129545 Tested-by: Tomaž Vajngerl <qui...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index 3844a1074df9..b225b1f7c0c7 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -85,10 +85,10 @@ void VAxisBase::initAxisLabelProperties( const css::awt::Size& rFontReferenceSiz m_bUseTextLabels = true; } - m_aAxisLabelProperties.nNumberFormatKey = m_aAxisProperties.m_nNumberFormatKey; + m_aAxisLabelProperties.m_nNumberFormatKey = m_aAxisProperties.m_nNumberFormatKey; m_aAxisLabelProperties.init(m_aAxisProperties.m_xAxisModel); if( m_aAxisProperties.m_bComplexCategories && m_aAxisProperties.m_nAxisType == AxisType::CATEGORY ) - m_aAxisLabelProperties.eStaggering = AxisLabelStaggering::SideBySide; + m_aAxisLabelProperties.m_eStaggering = AxisLabelStaggering::SideBySide; } bool VAxisBase::isDateAxis() const diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index 295ad21a68e6..656612cc67fc 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -330,13 +330,13 @@ void AxisProperties::init( bool bCartesian ) AxisLabelProperties::AxisLabelProperties() : m_aFontReferenceSize( ChartModelHelper::getDefaultPageSize() ) , m_aMaximumSpaceForLabels( 0 , 0, m_aFontReferenceSize.Width, m_aFontReferenceSize.Height ) - , nNumberFormatKey(0) - , eStaggering( AxisLabelStaggering::SideBySide ) - , bLineBreakAllowed( false ) - , bOverlapAllowed( false ) - , bStackCharacters( false ) - , fRotationAngleDegree( 0.0 ) - , nRhythm( 1 ) + , m_nNumberFormatKey(0) + , m_eStaggering( AxisLabelStaggering::SideBySide ) + , m_bLineBreakAllowed( false ) + , m_bOverlapAllowed( false ) + , m_bStackCharacters( false ) + , m_fRotationAngleDegree( 0.0 ) + , m_nRhythm( 1 ) { } @@ -350,26 +350,26 @@ void AxisLabelProperties::init( const uno::Reference< XAxis >& xAxisModel ) try { - xProp->getPropertyValue( "TextBreak" ) >>= bLineBreakAllowed; - xProp->getPropertyValue( "TextOverlap" ) >>= bOverlapAllowed; - xProp->getPropertyValue( "StackCharacters" ) >>= bStackCharacters; - xProp->getPropertyValue( "TextRotation" ) >>= fRotationAngleDegree; + xProp->getPropertyValue( "TextBreak" ) >>= m_bLineBreakAllowed; + xProp->getPropertyValue( "TextOverlap" ) >>= m_bOverlapAllowed; + xProp->getPropertyValue( "StackCharacters" ) >>= m_bStackCharacters; + xProp->getPropertyValue( "TextRotation" ) >>= m_fRotationAngleDegree; css::chart::ChartAxisArrangeOrderType eArrangeOrder; xProp->getPropertyValue( "ArrangeOrder" ) >>= eArrangeOrder; switch(eArrangeOrder) { case css::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE: - eStaggering = AxisLabelStaggering::SideBySide; + m_eStaggering = AxisLabelStaggering::SideBySide; break; case css::chart::ChartAxisArrangeOrderType_STAGGER_EVEN: - eStaggering = AxisLabelStaggering::StaggerEven; + m_eStaggering = AxisLabelStaggering::StaggerEven; break; case css::chart::ChartAxisArrangeOrderType_STAGGER_ODD: - eStaggering = AxisLabelStaggering::StaggerOdd; + m_eStaggering = AxisLabelStaggering::StaggerOdd; break; default: - eStaggering = AxisLabelStaggering::StaggerAuto; + m_eStaggering = AxisLabelStaggering::StaggerAuto; break; } } @@ -381,14 +381,14 @@ void AxisLabelProperties::init( const uno::Reference< XAxis >& xAxisModel ) bool AxisLabelProperties::isStaggered() const { - return ( eStaggering == AxisLabelStaggering::StaggerOdd || eStaggering == AxisLabelStaggering::StaggerEven ); + return ( m_eStaggering == AxisLabelStaggering::StaggerOdd || m_eStaggering == AxisLabelStaggering::StaggerEven ); } void AxisLabelProperties::autoRotate45() { - fRotationAngleDegree = 45; - bLineBreakAllowed = false; - eStaggering = AxisLabelStaggering::SideBySide; + m_fRotationAngleDegree = 45; + m_bLineBreakAllowed = false; + m_eStaggering = AxisLabelStaggering::SideBySide; } } //namespace chart diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx index 454ea1097c86..44778cbf916e 100644 --- a/chart2/source/view/axes/VAxisProperties.hxx +++ b/chart2/source/view/axes/VAxisProperties.hxx @@ -58,17 +58,17 @@ struct AxisLabelProperties final css::awt::Size m_aFontReferenceSize;//reference size to calculate the font height css::awt::Rectangle m_aMaximumSpaceForLabels;//Labels need to be clipped in order to fit into this rectangle - sal_Int32 nNumberFormatKey; + sal_Int32 m_nNumberFormatKey; - AxisLabelStaggering eStaggering; + AxisLabelStaggering m_eStaggering; - bool bLineBreakAllowed; - bool bOverlapAllowed; + bool m_bLineBreakAllowed; + bool m_bOverlapAllowed; - bool bStackCharacters; - double fRotationAngleDegree; + bool m_bStackCharacters; + double m_fRotationAngleDegree; - sal_Int32 nRhythm; //show only each nth label with n==nRhythm + sal_Int32 m_nRhythm; //show only each nth label with n==nRhythm //methods: void init( const css::uno::Reference< css::chart2::XAxis >& xAxisModel ); diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 120513ee9831..645afcce2cb6 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -87,8 +87,8 @@ static void lcl_ResizeTextShapeToFitAvailableSpace( SvxShapeText& rShape2DText, sal_Int32 nMaxLabelsSize = bIsHorizontalAxis ? rAxisLabelProperties.m_aMaximumSpaceForLabels.Height : rAxisLabelProperties.m_aMaximumSpaceForLabels.Width; const sal_Int32 nAvgCharWidth = rShape2DText.getSize().Width / rLabel.getLength(); - const sal_Int32 nTextSize = bIsHorizontalAxis ? ShapeFactory::getSizeAfterRotation(rShape2DText, rAxisLabelProperties.fRotationAngleDegree).Height : - ShapeFactory::getSizeAfterRotation(rShape2DText, rAxisLabelProperties.fRotationAngleDegree).Width; + const sal_Int32 nTextSize = bIsHorizontalAxis ? ShapeFactory::getSizeAfterRotation(rShape2DText, rAxisLabelProperties.m_fRotationAngleDegree).Height : + ShapeFactory::getSizeAfterRotation(rShape2DText, rAxisLabelProperties.m_fRotationAngleDegree).Width; if( !nAvgCharWidth ) return; @@ -127,9 +127,9 @@ static rtl::Reference<SvxShapeText> createSingleLabel( return nullptr; // #i78696# use mathematically correct rotation now - const double fRotationAnglePi(-basegfx::deg2rad(rAxisLabelProperties.fRotationAngleDegree)); + const double fRotationAnglePi(-basegfx::deg2rad(rAxisLabelProperties.m_fRotationAngleDegree)); uno::Any aATransformation = ShapeFactory::makeTransformation( rAnchorScreenPosition2D, fRotationAnglePi ); - OUString aLabel = ShapeFactory::getStackedString( rLabel, rAxisLabelProperties.bStackCharacters ); + OUString aLabel = ShapeFactory::getStackedString( rLabel, rAxisLabelProperties.m_bStackCharacters ); rtl::Reference<SvxShapeText> xShape2DText = ShapeFactory::createText( xTarget, aLabel, rPropNames, rPropValues, aATransformation ); @@ -138,7 +138,7 @@ static rtl::Reference<SvxShapeText> createSingleLabel( lcl_ResizeTextShapeToFitAvailableSpace(*xShape2DText, rAxisLabelProperties, aLabel, rPropNames, rPropValues, bIsHorizontalAxis); LabelPositionHelper::correctPositionForRotation( xShape2DText - , rAxisProperties.maLabelAlignment.meAlignment, rAxisLabelProperties.fRotationAngleDegree, rAxisProperties.m_bComplexCategories ); + , rAxisProperties.maLabelAlignment.meAlignment, rAxisLabelProperties.m_fRotationAngleDegree, rAxisProperties.m_bComplexCategories ); return xShape2DText; } @@ -507,16 +507,16 @@ bool VCartesianAxis::isBreakOfLabelsAllowed( { if( m_aTextLabels.getLength() > 100 ) return false; - if( !rAxisLabelProperties.bLineBreakAllowed ) + if( !rAxisLabelProperties.m_bLineBreakAllowed ) return false; - if( rAxisLabelProperties.bStackCharacters ) + if( rAxisLabelProperties.m_bStackCharacters ) return false; //no break for value axis if( !m_bUseTextLabels ) return false; - if( !( rAxisLabelProperties.fRotationAngleDegree == 0.0 || - rAxisLabelProperties.fRotationAngleDegree == 90.0 || - rAxisLabelProperties.fRotationAngleDegree == 270.0 ) ) + if( !( rAxisLabelProperties.m_fRotationAngleDegree == 0.0 || + rAxisLabelProperties.m_fRotationAngleDegree == 90.0 || + rAxisLabelProperties.m_fRotationAngleDegree == 270.0 ) ) return false; //no break for complex vertical category axis if( !m_aAxisProperties.m_bSwapXAndY ) @@ -532,26 +532,26 @@ bool canAutoAdjustLabelPlacement( const AxisLabelProperties& rAxisLabelProperties, bool bIsHorizontalAxis, bool bIsVerticalAxis) { // joined prerequisite checks for auto rotate and auto stagger - if( rAxisLabelProperties.bOverlapAllowed ) + if( rAxisLabelProperties.m_bOverlapAllowed ) return false; - if( rAxisLabelProperties.bLineBreakAllowed ) // auto line break may conflict with... + if( rAxisLabelProperties.m_bLineBreakAllowed ) // auto line break may conflict with... return false; - if( rAxisLabelProperties.fRotationAngleDegree != 0.0 ) + if( rAxisLabelProperties.m_fRotationAngleDegree != 0.0 ) return false; // automatic adjusting labels only works for // horizontal axis with horizontal text // or vertical axis with vertical text if( bIsHorizontalAxis ) - return !rAxisLabelProperties.bStackCharacters; + return !rAxisLabelProperties.m_bStackCharacters; if( bIsVerticalAxis ) - return rAxisLabelProperties.bStackCharacters; + return rAxisLabelProperties.m_bStackCharacters; return false; } bool isAutoStaggeringOfLabelsAllowed( const AxisLabelProperties& rAxisLabelProperties, bool bIsHorizontalAxis, bool bIsVerticalAxis ) { - if( rAxisLabelProperties.eStaggering != AxisLabelStaggering::StaggerAuto ) + if( rAxisLabelProperties.m_eStaggering != AxisLabelStaggering::StaggerAuto ) return false; return canAutoAdjustLabelPlacement(rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis); } @@ -721,7 +721,7 @@ bool VCartesianAxis::createTextShapes( return createTextShapesSimple(xTarget, rTickIter, rAxisLabelProperties, pTickFactory); FixedNumberFormatter aFixedNumberFormatter( - m_xNumberFormatsSupplier, rAxisLabelProperties.nNumberFormatKey ); + m_xNumberFormatsSupplier, rAxisLabelProperties.m_nNumberFormatKey ); bool bIsStaggered = rAxisLabelProperties.isStaggered(); B2DVector aTextToTickDistance = pTickFactory->getDistanceAxisTickToText(m_aAxisProperties, true); @@ -742,14 +742,14 @@ bool VCartesianAxis::createTextShapes( } // recalculate the nLimitedSpaceForText in case of 90 and 270 degree if the text break is true - if ( rAxisLabelProperties.fRotationAngleDegree == 90.0 || rAxisLabelProperties.fRotationAngleDegree == 270.0 ) + if ( rAxisLabelProperties.m_fRotationAngleDegree == 90.0 || rAxisLabelProperties.m_fRotationAngleDegree == 270.0 ) { nLimitedSpaceForText = rAxisLabelProperties.m_aMaximumSpaceForLabels.Height; m_aAxisProperties.m_bLimitSpaceForLabels = false; } // recalculate the nLimitedSpaceForText in case of vertical category axis if the text break is true - if ( m_aAxisProperties.m_bSwapXAndY && bIsVerticalAxis && rAxisLabelProperties.fRotationAngleDegree == 0.0 ) + if ( m_aAxisProperties.m_bSwapXAndY && bIsVerticalAxis && rAxisLabelProperties.m_fRotationAngleDegree == 0.0 ) { nLimitedSpaceForText = pTickFactory->getXaxisStartPos().getX(); m_aAxisProperties.m_bLimitSpaceForLabels = false; @@ -790,21 +790,21 @@ bool VCartesianAxis::createTextShapes( pPREPreviousVisibleTickInfo : pPreviousVisibleTickInfo; //don't create labels which does not fit into the rhythm - if( nTick%rAxisLabelProperties.nRhythm != 0 ) + if( nTick%rAxisLabelProperties.m_nRhythm != 0 ) continue; //don't create labels for invisible ticks if( !pTickInfo->bPaintIt ) continue; - if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.bOverlapAllowed ) + if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.m_bOverlapAllowed ) { // Overlapping is not allowed. If the label overlaps with its // neighboring label, try increasing the tick interval (or rhythm // as it's called) and start over. if( lcl_doesShapeOverlapWithTickmark( *pLastVisibleNeighbourTickInfo->xTextShape - , rAxisLabelProperties.fRotationAngleDegree + , rAxisLabelProperties.m_fRotationAngleDegree , pTickInfo->aTickScreenPosition ) ) { // This tick overlaps with its neighbor. Try to stagger (if @@ -814,11 +814,11 @@ bool VCartesianAxis::createTextShapes( if( !bIsStaggered && isAutoStaggeringOfLabelsAllowed( rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis ) ) { bIsStaggered = true; - rAxisLabelProperties.eStaggering = AxisLabelStaggering::StaggerEven; + rAxisLabelProperties.m_eStaggering = AxisLabelStaggering::StaggerEven; pLastVisibleNeighbourTickInfo = pPREPreviousVisibleTickInfo; if( !pLastVisibleNeighbourTickInfo || !lcl_doesShapeOverlapWithTickmark( *pLastVisibleNeighbourTickInfo->xTextShape - , rAxisLabelProperties.fRotationAngleDegree + , rAxisLabelProperties.m_fRotationAngleDegree , pTickInfo->aTickScreenPosition ) ) bOverlapsAfterAutoStagger = false; } @@ -829,8 +829,8 @@ bool VCartesianAxis::createTextShapes( // Increment the visible tick intervals (if that's // allowed) and start over. - rAxisLabelProperties.nRhythm++; - removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.nRhythm, nTick, xTarget ); + rAxisLabelProperties.m_nRhythm++; + removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.m_nRhythm, nTick, xTarget ); return false; } } @@ -863,30 +863,30 @@ bool VCartesianAxis::createTextShapes( if(!pTickInfo->xTextShape.is()) continue; - recordMaximumTextSize( *pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree ); + recordMaximumTextSize( *pTickInfo->xTextShape, rAxisLabelProperties.m_fRotationAngleDegree ); // Label has multiple lines and the words are broken - if( nLimitedSpaceForText>0 && !rAxisLabelProperties.bOverlapAllowed - && rAxisLabelProperties.fRotationAngleDegree == 0.0 + if( nLimitedSpaceForText>0 && !rAxisLabelProperties.m_bOverlapAllowed + && rAxisLabelProperties.m_fRotationAngleDegree == 0.0 && lcl_hasWordBreak( pTickInfo->xTextShape ) ) { // Label has multiple lines and belongs to a complex category // axis. Rotate 90 degrees to try to avoid overlaps. if ( m_aAxisProperties.m_bComplexCategories ) { - rAxisLabelProperties.fRotationAngleDegree = 90; + rAxisLabelProperties.m_fRotationAngleDegree = 90; } - rAxisLabelProperties.bLineBreakAllowed = false; - m_aAxisLabelProperties.fRotationAngleDegree = rAxisLabelProperties.fRotationAngleDegree; + rAxisLabelProperties.m_bLineBreakAllowed = false; + m_aAxisLabelProperties.m_fRotationAngleDegree = rAxisLabelProperties.m_fRotationAngleDegree; removeTextShapesFromTicks(); return false; } //if NO OVERLAP -> remove overlapping shapes - if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.bOverlapAllowed ) + if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.m_bOverlapAllowed ) { // Check if the label still overlaps with its neighbor. - if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree ) ) + if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, rAxisLabelProperties.m_fRotationAngleDegree ) ) { // It overlaps. Check if staggering helps. bool bOverlapsAfterAutoStagger = true; @@ -898,11 +898,11 @@ bool VCartesianAxis::createTextShapes( || m_aAxisProperties.m_bTryStaggeringFirst ) { bIsStaggered = true; - rAxisLabelProperties.eStaggering = AxisLabelStaggering::StaggerEven; + rAxisLabelProperties.m_eStaggering = AxisLabelStaggering::StaggerEven; pLastVisibleNeighbourTickInfo = pPREPreviousVisibleTickInfo; if( !pLastVisibleNeighbourTickInfo || !lcl_doesShapeOverlapWithTickmark( *pLastVisibleNeighbourTickInfo->xTextShape - , rAxisLabelProperties.fRotationAngleDegree + , rAxisLabelProperties.m_fRotationAngleDegree , pTickInfo->aTickScreenPosition ) ) bOverlapsAfterAutoStagger = false; } @@ -919,15 +919,15 @@ bool VCartesianAxis::createTextShapes( // The nRhythm parameter is reset to 1 since the layout // used for text labels is changed. rAxisLabelProperties.autoRotate45(); - m_aAxisLabelProperties.fRotationAngleDegree = rAxisLabelProperties.fRotationAngleDegree; // Store it for future runs. + m_aAxisLabelProperties.m_fRotationAngleDegree = rAxisLabelProperties.m_fRotationAngleDegree; // Store it for future runs. removeTextShapesFromTicks(); - rAxisLabelProperties.nRhythm = 1; + rAxisLabelProperties.m_nRhythm = 1; return false; } // Try incrementing the tick interval and start over. - rAxisLabelProperties.nRhythm++; - removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.nRhythm, nTick, xTarget ); + rAxisLabelProperties.m_nRhythm++; + removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.m_nRhythm, nTick, xTarget ); return false; } } @@ -944,7 +944,7 @@ bool VCartesianAxis::createTextShapesSimple( AxisLabelProperties& rAxisLabelProperties, TickFactory2D const * pTickFactory ) { FixedNumberFormatter aFixedNumberFormatter( - m_xNumberFormatsSupplier, rAxisLabelProperties.nNumberFormatKey ); + m_xNumberFormatsSupplier, rAxisLabelProperties.m_nNumberFormatKey ); const bool bIsHorizontalAxis = pTickFactory->isHorizontalAxis(); const bool bIsVerticalAxis = pTickFactory->isVerticalAxis(); @@ -979,28 +979,28 @@ bool VCartesianAxis::createTextShapesSimple( const TickInfo* pLastVisibleNeighbourTickInfo = pPreviousVisibleTickInfo; //don't create labels which does not fit into the rhythm - if( nTick%rAxisLabelProperties.nRhythm != 0 ) + if( nTick%rAxisLabelProperties.m_nRhythm != 0 ) continue; //don't create labels for invisible ticks if( !pTickInfo->bPaintIt ) continue; - if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.bOverlapAllowed ) + if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.m_bOverlapAllowed ) { // Overlapping is not allowed. If the label overlaps with its // neighboring label, try increasing the tick interval (or rhythm // as it's called) and start over. if( lcl_doesShapeOverlapWithTickmark( *pLastVisibleNeighbourTickInfo->xTextShape - , rAxisLabelProperties.fRotationAngleDegree + , rAxisLabelProperties.m_fRotationAngleDegree , pTickInfo->aTickScreenPosition ) ) { // This tick overlaps with its neighbor. Increment the visible // tick intervals (if that's allowed) and start over. - rAxisLabelProperties.nRhythm++; - removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.nRhythm, nTick, xTarget ); + rAxisLabelProperties.m_nRhythm++; + removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.m_nRhythm, nTick, xTarget ); return false; } } @@ -1032,13 +1032,13 @@ bool VCartesianAxis::createTextShapesSimple( if(!pTickInfo->xTextShape.is()) continue; - recordMaximumTextSize( *pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree ); + recordMaximumTextSize( *pTickInfo->xTextShape, rAxisLabelProperties.m_fRotationAngleDegree ); //if NO OVERLAP -> remove overlapping shapes - if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.bOverlapAllowed ) + if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.m_bOverlapAllowed ) { // Check if the label still overlaps with its neighbor. - if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree ) ) + if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, rAxisLabelProperties.m_fRotationAngleDegree ) ) { // It overlaps. if( isAutoRotatingOfLabelsAllowed(rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis) ) @@ -1049,15 +1049,15 @@ bool VCartesianAxis::createTextShapesSimple( // The nRhythm parameter is reset to 1 since the layout // used for text labels is changed. rAxisLabelProperties.autoRotate45(); - m_aAxisLabelProperties.fRotationAngleDegree = rAxisLabelProperties.fRotationAngleDegree; // Store it for future runs. + m_aAxisLabelProperties.m_fRotationAngleDegree = rAxisLabelProperties.m_fRotationAngleDegree; // Store it for future runs. removeTextShapesFromTicks(); - rAxisLabelProperties.nRhythm = 1; + rAxisLabelProperties.m_nRhythm = 1; return false; } // Try incrementing the tick interval and start over. - rAxisLabelProperties.nRhythm++; - removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.nRhythm, nTick, xTarget ); + rAxisLabelProperties.m_nRhythm++; + removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.m_nRhythm, nTick, xTarget ); return false; } } @@ -1556,7 +1556,7 @@ sal_Int32 VCartesianAxis::estimateMaximumAutoMainIncrementCount() // tdf#48041: do not duplicate the value labels because of rounding if (m_aAxisProperties.m_nAxisType != css::chart2::AxisType::DATE) { - FixedNumberFormatter aFixedNumberFormatterTest(m_xNumberFormatsSupplier, m_aAxisLabelProperties.nNumberFormatKey); + FixedNumberFormatter aFixedNumberFormatterTest(m_xNumberFormatsSupplier, m_aAxisLabelProperties.m_nNumberFormatKey); OUString sPreviousValueLabel; sal_Int32 nSameLabel = 0; for (sal_Int32 nLabel = 0; nLabel < static_cast<sal_Int32>(m_aAllTickInfos[0].size()); ++nLabel) @@ -1610,7 +1610,7 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel std::unique_ptr<TickIter> apTickIter(createLabelTickIterator(nTextLevel)); if (apTickIter) { - double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; + double fRotationAngleDegree = m_aAxisLabelProperties.m_fRotationAngleDegree; if( nTextLevel>0 ) { lcl_shiftLabels(*apTickIter, aCumulatedLabelsDistance); @@ -1630,8 +1630,8 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel { if( !m_aAllTickInfos.empty() ) { - LabelIterator aInnerIter( m_aAllTickInfos[0], rAxisLabelProperties.eStaggering, true ); - LabelIterator aOuterIter( m_aAllTickInfos[0], rAxisLabelProperties.eStaggering, false ); + LabelIterator aInnerIter( m_aAllTickInfos[0], rAxisLabelProperties.m_eStaggering, true ); + LabelIterator aOuterIter( m_aAllTickInfos[0], rAxisLabelProperties.m_eStaggering, false ); lcl_shiftLabels( aOuterIter , lcl_getLabelsDistance( aInnerIter @@ -1677,15 +1677,15 @@ void VCartesianAxis::createLabels() AxisLabelProperties aComplexProps(m_aAxisLabelProperties); if( m_aAxisProperties.m_bComplexCategories ) { - aComplexProps.bLineBreakAllowed = true; - aComplexProps.bOverlapAllowed = aComplexProps.fRotationAngleDegree != 0.0; + aComplexProps.m_bLineBreakAllowed = true; + aComplexProps.m_bOverlapAllowed = aComplexProps.m_fRotationAngleDegree != 0.0; if( nTextLevel > 0 ) { //multilevel labels: 0 or 90 by default if( m_aAxisProperties.m_bSwapXAndY ) - aComplexProps.fRotationAngleDegree = 90.0; + aComplexProps.m_fRotationAngleDegree = 90.0; else - aComplexProps.fRotationAngleDegree = 0.0; + aComplexProps.m_fRotationAngleDegree = 0.0; } } AxisLabelProperties& rAxisLabelProperties = m_aAxisProperties.m_bComplexCategories ? aComplexProps : m_aAxisLabelProperties; @@ -1720,10 +1720,10 @@ void VCartesianAxis::createMaximumLabels() AxisLabelProperties aAxisLabelProperties( m_aAxisLabelProperties ); if( isAutoStaggeringOfLabelsAllowed( aAxisLabelProperties, pTickFactory2D->isHorizontalAxis(), pTickFactory2D->isVerticalAxis() ) ) - aAxisLabelProperties.eStaggering = AxisLabelStaggering::StaggerEven; + aAxisLabelProperties.m_eStaggering = AxisLabelStaggering::StaggerEven; - aAxisLabelProperties.bOverlapAllowed = true; - aAxisLabelProperties.bLineBreakAllowed = false; + aAxisLabelProperties.m_bOverlapAllowed = true; + aAxisLabelProperties.m_bLineBreakAllowed = false; sal_Int32 nTextLevelCount = getTextLevelCount(); for( sal_Int32 nTextLevel=0; nTextLevel<nTextLevelCount; nTextLevel++ ) { @@ -1766,7 +1766,7 @@ void VCartesianAxis::updatePositions() static_cast<sal_Int32>(aTickScreenPos2D.getX()) ,static_cast<sal_Int32>(aTickScreenPos2D.getY())); - double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; + double fRotationAngleDegree = m_aAxisLabelProperties.m_fRotationAngleDegree; if( nDepth > 0 ) { //multilevel labels: 0 or 90 by default @@ -1858,7 +1858,7 @@ void VCartesianAxis::createShapes() std::unique_ptr< TickIter > apTickIter(createLabelTickIterator( nTextLevel )); if( apTickIter ) { - double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; + double fRotationAngleDegree = m_aAxisLabelProperties.m_fRotationAngleDegree; if( nTextLevel > 0 ) { //Multi-level Labels: default to 0 or 90 diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx b/chart2/source/view/axes/VPolarAngleAxis.cxx index fad802e107a8..533ffbc92dd1 100644 --- a/chart2/source/view/axes/VPolarAngleAxis.cxx +++ b/chart2/source/view/axes/VPolarAngleAxis.cxx @@ -54,7 +54,7 @@ void VPolarAngleAxis::createTextShapes_ForAngleAxis( , double fLogicZ ) { FixedNumberFormatter aFixedNumberFormatter( - m_xNumberFormatsSupplier, rAxisLabelProperties.nNumberFormatKey ); + m_xNumberFormatsSupplier, rAxisLabelProperties.m_nNumberFormatKey ); //prepare text properties for multipropertyset-interface of shape tNameSequence aPropNames; @@ -80,7 +80,7 @@ void VPolarAngleAxis::createTextShapes_ForAngleAxis( ; pTickInfo = rTickIter.nextInfo(), nTick++ ) { //don't create labels which does not fit into the rhythm - if( nTick%rAxisLabelProperties.nRhythm != 0) + if( nTick%rAxisLabelProperties.m_nRhythm != 0) continue; //don't create labels for invisible ticks @@ -120,10 +120,10 @@ void VPolarAngleAxis::createTextShapes_ForAngleAxis( LabelPositionHelper::changeTextAdjustment( aPropValues, aPropNames, eLabelAlignment ); // #i78696# use mathematically correct rotation now - const double fRotationAnglePi(-basegfx::deg2rad(rAxisLabelProperties.fRotationAngleDegree)); + const double fRotationAnglePi(-basegfx::deg2rad(rAxisLabelProperties.m_fRotationAngleDegree)); uno::Any aATransformation = ShapeFactory::makeTransformation( aAnchorScreenPosition2D, fRotationAnglePi ); - OUString aStackedLabel = ShapeFactory::getStackedString( aLabel, rAxisLabelProperties.bStackCharacters ); + OUString aStackedLabel = ShapeFactory::getStackedString( aLabel, rAxisLabelProperties.m_bStackCharacters ); pTickInfo->xTextShape = ShapeFactory::createText( xTarget, aStackedLabel, aPropNames, aPropValues, aATransformation ); } @@ -170,7 +170,7 @@ void VPolarAngleAxis::createLabels() removeTextShapesFromTicks(); AxisLabelProperties aAxisLabelProperties( m_aAxisLabelProperties ); - aAxisLabelProperties.bOverlapAllowed = true; + aAxisLabelProperties.m_bOverlapAllowed = true; double const fLogicZ = 1.0;//as defined createTextShapes_ForAngleAxis( m_xTextTarget, aTickIter , aAxisLabelProperties