diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-02-07 22:34:55 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-02-08 10:14:20 +0100 |
commit | dd1cdac272f98b0bacb5bb9ee6cb89852a50d31f (patch) | |
tree | b2760f0406e0444ad16192bf872b59aa9b691e61 /svtools | |
parent | 9123dda5c4d27268fa4f2dcb5a02cd3870965195 (diff) |
Clean up curious by-4/by-2 loop indices
...that had been like that ever since ff09f8d6ef2c613037f039dbcafcad6b76243a48,
"MWS_SRX644: migrate branch mws_srx644 -> HEAD" at least, for no apparent
reason.
Change-Id: I6f8bd44179b232b7b39e493d443a443a60522a5c
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/config/colorcfg.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index d09962e07636..86ff2ced5e5b 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -164,13 +164,12 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme) OUString sBase = "ColorSchemes/" + utl::wrapConfigurationElementName(rScheme); const int nCount = ColorConfigEntryCount; - for(sal_Int32 i = 0; i < 4 * nCount; i+= 4) + for(sal_Int32 i = 0; i < nCount; ++i) { - sal_Int32 nPos = i / 4; - OUString sBaseName = sBase + cNames[nPos].cName; + OUString sBaseName = sBase + cNames[i].cName; pNames[nIndex] += sBaseName; pNames[nIndex++] += "/Color"; - if(cNames[nPos].bCanBeVisible) + if(cNames[i].bCanBeVisible) { pNames[nIndex] += sBaseName; pNames[nIndex++] += g_sIsVisible; @@ -221,18 +220,18 @@ void ColorConfig_Impl::Load(const OUString& rScheme) const uno::Any* pColors = aColors.getConstArray(); const OUString* pColorNames = aColorNames.getConstArray(); sal_Int32 nIndex = 0; - for(int i = 0; i < 2 * ColorConfigEntryCount && aColors.getLength() > nIndex; i+= 2) + for(int i = 0; i < ColorConfigEntryCount && aColors.getLength() > nIndex; ++i) { if(pColors[nIndex].hasValue()) - pColors[nIndex] >>= m_aConfigValues[i / 2].nColor; + pColors[nIndex] >>= m_aConfigValues[i].nColor; else - m_aConfigValues[i/2].nColor = COL_AUTO; + m_aConfigValues[i].nColor = COL_AUTO; nIndex++; if(nIndex >= aColors.getLength()) break; //test for visibility property if(pColorNames[nIndex].endsWith(g_sIsVisible)) - m_aConfigValues[i / 2].bIsVisible = Any2Bool(pColors[nIndex++]); + m_aConfigValues[i].bIsVisible = Any2Bool(pColors[nIndex++]); } // fdo#71511: check if we are running in a11y autodetect { @@ -259,12 +258,12 @@ void ColorConfig_Impl::ImplCommit() beans::PropertyValue* pPropValues = aPropValues.getArray(); const OUString* pColorNames = aColorNames.getConstArray(); sal_Int32 nIndex = 0; - for(int i = 0; i < 2 * ColorConfigEntryCount && aColorNames.getLength() > nIndex; i+= 2) + for(int i = 0; i < ColorConfigEntryCount && aColorNames.getLength() > nIndex; ++i) { pPropValues[nIndex].Name = pColorNames[nIndex]; //save automatic colors as void value - if(COL_AUTO != sal::static_int_cast<ColorData>(m_aConfigValues[i/2].nColor)) - pPropValues[nIndex].Value <<= m_aConfigValues[i/2].nColor; + if(COL_AUTO != sal::static_int_cast<ColorData>(m_aConfigValues[i].nColor)) + pPropValues[nIndex].Value <<= m_aConfigValues[i].nColor; nIndex++; if(nIndex >= aColorNames.getLength()) @@ -273,7 +272,7 @@ void ColorConfig_Impl::ImplCommit() if(pColorNames[nIndex].endsWith(g_sIsVisible)) { pPropValues[nIndex].Name = pColorNames[nIndex]; - pPropValues[nIndex].Value <<= m_aConfigValues[i/2].bIsVisible; + pPropValues[nIndex].Value <<= m_aConfigValues[i].bIsVisible; nIndex++; } } |