[Libreoffice-commits] core.git: chart2/source drawinglayer/source editeng/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Oct 21 14:49:12 UTC 2018
chart2/source/view/axes/VPolarGrid.cxx | 12 +++++++-----
drawinglayer/source/attribute/sdrlightingattribute3d.cxx | 6 ++++--
editeng/source/accessibility/AccessibleEditableTextPara.cxx | 3 ++-
3 files changed, 13 insertions(+), 8 deletions(-)
New commits:
commit 4219853f7344987cc8ebdf20860038222a1883dc
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Oct 20 19:18:31 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Oct 21 16:48:51 2018 +0200
clarify this code a bit
Change-Id: I44066ad4f2e2374e87771de89bdefdbccc816302
Reviewed-on: https://gerrit.libreoffice.org/62095
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/chart2/source/view/axes/VPolarGrid.cxx b/chart2/source/view/axes/VPolarGrid.cxx
index f2b1e2687a4c..232c72b8c19e 100644
--- a/chart2/source/view/axes/VPolarGrid.cxx
+++ b/chart2/source/view/axes/VPolarGrid.cxx
@@ -60,8 +60,8 @@ void VPolarGrid::setIncrements( const std::vector< ExplicitIncrementData >& rInc
void VPolarGrid::getAllTickInfos( sal_Int32 nDimensionIndex, TickInfoArraysType& rAllTickInfos ) const
{
- TickFactory aTickFactory(
- m_pPosHelper->getScales()[nDimensionIndex], m_aIncrements[nDimensionIndex] );
+ const std::vector<ExplicitScaleData>& rScales = m_pPosHelper->getScales();
+ TickFactory aTickFactory(rScales[nDimensionIndex], m_aIncrements[nDimensionIndex]);
aTickFactory.getAllTicks( rAllTickInfos );
}
@@ -111,7 +111,8 @@ void VPolarGrid::create2DAngleGrid( const Reference< drawing::XShapes >& xLogicT
Reference< drawing::XShapes > xMainTarget(
createGroupShape( xLogicTarget, m_aCID ) );
- const ExplicitScaleData& rAngleScale = m_pPosHelper->getScales()[0];
+ const std::vector<ExplicitScaleData>& rScales = m_pPosHelper->getScales();
+ const ExplicitScaleData& rAngleScale = rScales[0];
Reference< XScaling > xInverseScaling( NULL );
if( rAngleScale.Scaling.is() )
xInverseScaling = rAngleScale.Scaling->getInverseScaling();
@@ -161,8 +162,9 @@ void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogic
Reference< drawing::XShapes > xMainTarget(
createGroupShape( xLogicTarget, m_aCID ) );
- const ExplicitScaleData& rRadiusScale = m_pPosHelper->getScales()[1];
- const ExplicitScaleData& rAngleScale = m_pPosHelper->getScales()[0];
+ const std::vector<ExplicitScaleData>& rScales = m_pPosHelper->getScales();
+ const ExplicitScaleData& rRadiusScale = rScales[1];
+ const ExplicitScaleData& rAngleScale = rScales[0];
const ExplicitIncrementData& rAngleIncrement = m_aIncrements[0];
Reference< XScaling > xInverseRadiusScaling;
if( rRadiusScale.Scaling.is() )
diff --git a/drawinglayer/source/attribute/sdrlightingattribute3d.cxx b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx
index 8ead71e47b6e..07b53405bf46 100644
--- a/drawinglayer/source/attribute/sdrlightingattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx
@@ -121,8 +121,10 @@ namespace drawinglayer
// take care of global ambient light
aRetval += mpSdrLightingAttribute->getAmbientLight() * rColor;
+ const std::vector<Sdr3DLightAttribute>& rLightVector = mpSdrLightingAttribute->getLightVector();
+
// prepare light access. Is there a light?
- const sal_uInt32 nLightCount(mpSdrLightingAttribute->getLightVector().size());
+ const sal_uInt32 nLightCount(rLightVector.size());
if(nLightCount && !rNormalInEyeCoordinates.equalZero())
{
@@ -132,7 +134,7 @@ namespace drawinglayer
for(sal_uInt32 a(0); a < nLightCount; a++)
{
- const Sdr3DLightAttribute& rLight(mpSdrLightingAttribute->getLightVector()[a]);
+ const Sdr3DLightAttribute& rLight(rLightVector[a]);
const double fCosFac(rLight.getDirection().scalar(aEyeNormal));
if(basegfx::fTools::more(fCosFac, 0.0))
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 5c549f2e24f5..8023887dcfb0 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1235,7 +1235,8 @@ namespace accessibility
bool bIsDirectVal = false;
for (auto const& rRunAttrib : aRunAttribs)
{
- if ((bIsDirectVal = rRes.Name == rRunAttrib.Name))
+ bIsDirectVal = rRes.Name == rRunAttrib.Name;
+ if (bIsDirectVal)
break;
}
rRes.Handle = -1;
More information about the Libreoffice-commits
mailing list