summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-04-20 12:06:07 +0200
committerJustin Luth <justin_luth@sil.org>2021-06-25 06:00:18 +0200
commitcd09753cb04a0649dfa9d3cb73ad7514af2d03bd (patch)
tree3097c342270536b187b83a6b1f9cf56faa69c876 /sw
parent709a40e86734a4cbf67b65222e79db76aae56981 (diff)
NFC: cleanup unnecessary variables, reduce scope.
This function look a LOT different way back at original import, and some of the refactoring since then left things a bit messy. The impetus for changing this was to see how m_nListLevel was being used, and having it assigned to a temporary const variable for no reason was annoying. Change-Id: Ia25397dbe4bce2fd7bdfbb1b3053bd271c08212a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114404 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx17
1 files changed, 5 insertions, 12 deletions
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 71864ead9beb..80bfebd68a61 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1766,17 +1766,11 @@ void SwWW8ImplReader::RegisterNumFormatOnStyle(sal_uInt16 nStyle)
rStyleInf.maWordLR.reset(ItemGet<SvxLRSpaceItem>(*rStyleInf.m_pFormat, RES_LR_SPACE).Clone());
// Phase 2: refresh StyleDef after reading all Lists
- SwNumRule* pNmRule = nullptr;
- const sal_uInt16 nLFO = rStyleInf.m_nLFOIndex;
- const sal_uInt8 nLevel = rStyleInf.m_nListLevel;
- if (
- (USHRT_MAX > nLFO) &&
- (WW8ListManager::nMaxLevel > nLevel)
- )
+ if (rStyleInf.m_nLFOIndex < USHRT_MAX && rStyleInf.m_nListLevel < WW8ListManager::nMaxLevel)
{
std::vector<sal_uInt8> aParaSprms;
- pNmRule = m_xLstManager->GetNumRuleForActivation(nLFO, nLevel,
- aParaSprms);
+ SwNumRule* pNmRule = m_xLstManager->GetNumRuleForActivation(
+ rStyleInf.m_nLFOIndex, rStyleInf.m_nListLevel, aParaSprms);
if (pNmRule != nullptr)
{
@@ -1791,11 +1785,10 @@ void SwWW8ImplReader::RegisterNumFormatOnStyle(sal_uInt16 nStyle)
SwNumRuleItem(pNmRule->GetName()));
rStyleInf.m_bHasStyNumRule = true;
}
+
+ SetStyleIndent(rStyleInf, pNmRule->Get(rStyleInf.m_nListLevel));
}
}
-
- if (pNmRule)
- SetStyleIndent(rStyleInf, pNmRule->Get(nLevel));
}
void SwWW8ImplReader::RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO,