writerfilter: some param -> sprm in rtftok

The structure for these properties is to have a list like "paragraph
properties", which then has keys (e.g. NS_ooxml::LN_CT_PrBase_pBdr for
border), which may have sub-keys (e.g. NS_ooxml::LN_CT_PBdr_top), and
finally some value.

Stop calling sub-keys "parameters"; the real parameter will be some
writerfilter::Value subclass.

This is just meant to make the code more readable, no functional changes
intended.

Change-Id: Ie63b3216cafa6fcd0ad1ee8cf990cd7982ab7fb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126894
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This commit is contained in:
Miklos Vajna
2021-12-15 20:16:05 +01:00
parent 6170522364
commit c40df02caa

View File

@@ -624,22 +624,22 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
switch (nKeyword) switch (nKeyword)
{ {
case RTFKeyword::CLBRDRT: case RTFKeyword::CLBRDRT:
nParam = NS_ooxml::LN_CT_TcBorders_top; nSprm = NS_ooxml::LN_CT_TcBorders_top;
break; break;
case RTFKeyword::CLBRDRL: case RTFKeyword::CLBRDRL:
nParam = NS_ooxml::LN_CT_TcBorders_left; nSprm = NS_ooxml::LN_CT_TcBorders_left;
break; break;
case RTFKeyword::CLBRDRB: case RTFKeyword::CLBRDRB:
nParam = NS_ooxml::LN_CT_TcBorders_bottom; nSprm = NS_ooxml::LN_CT_TcBorders_bottom;
break; break;
case RTFKeyword::CLBRDRR: case RTFKeyword::CLBRDRR:
nParam = NS_ooxml::LN_CT_TcBorders_right; nSprm = NS_ooxml::LN_CT_TcBorders_right;
break; break;
default: default:
break; break;
} }
putNestedSprm(m_aStates.top().getTableCellSprms(), NS_ooxml::LN_CT_TcPrBase_tcBorders, putNestedSprm(m_aStates.top().getTableCellSprms(), NS_ooxml::LN_CT_TcPrBase_tcBorders,
nParam, pValue); nSprm, pValue);
m_aStates.top().setBorderState(RTFBorderState::CELL); m_aStates.top().setBorderState(RTFBorderState::CELL);
} }
break; break;
@@ -654,22 +654,22 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
switch (nKeyword) switch (nKeyword)
{ {
case RTFKeyword::PGBRDRT: case RTFKeyword::PGBRDRT:
nParam = NS_ooxml::LN_CT_PageBorders_top; nSprm = NS_ooxml::LN_CT_PageBorders_top;
break; break;
case RTFKeyword::PGBRDRL: case RTFKeyword::PGBRDRL:
nParam = NS_ooxml::LN_CT_PageBorders_left; nSprm = NS_ooxml::LN_CT_PageBorders_left;
break; break;
case RTFKeyword::PGBRDRB: case RTFKeyword::PGBRDRB:
nParam = NS_ooxml::LN_CT_PageBorders_bottom; nSprm = NS_ooxml::LN_CT_PageBorders_bottom;
break; break;
case RTFKeyword::PGBRDRR: case RTFKeyword::PGBRDRR:
nParam = NS_ooxml::LN_CT_PageBorders_right; nSprm = NS_ooxml::LN_CT_PageBorders_right;
break; break;
default: default:
break; break;
} }
putNestedSprm(m_aStates.top().getSectionSprms(), putNestedSprm(m_aStates.top().getSectionSprms(),
NS_ooxml::LN_EG_SectPrContents_pgBorders, nParam, pValue); NS_ooxml::LN_EG_SectPrContents_pgBorders, nSprm, pValue);
m_aStates.top().setBorderState(RTFBorderState::PAGE); m_aStates.top().setBorderState(RTFBorderState::PAGE);
} }
break; break;
@@ -684,21 +684,21 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
switch (nKeyword) switch (nKeyword)
{ {
case RTFKeyword::BRDRT: case RTFKeyword::BRDRT:
nParam = getParagraphBorder(0); nSprm = getParagraphBorder(0);
break; break;
case RTFKeyword::BRDRL: case RTFKeyword::BRDRL:
nParam = getParagraphBorder(1); nSprm = getParagraphBorder(1);
break; break;
case RTFKeyword::BRDRB: case RTFKeyword::BRDRB:
nParam = getParagraphBorder(2); nSprm = getParagraphBorder(2);
break; break;
case RTFKeyword::BRDRR: case RTFKeyword::BRDRR:
nParam = getParagraphBorder(3); nSprm = getParagraphBorder(3);
break; break;
default: default:
break; break;
} }
putNestedSprm(m_aStates.top().getParagraphSprms(), NS_ooxml::LN_CT_PrBase_pBdr, nParam, putNestedSprm(m_aStates.top().getParagraphSprms(), NS_ooxml::LN_CT_PrBase_pBdr, nSprm,
pValue); pValue);
m_aStates.top().setBorderState(RTFBorderState::PARAGRAPH); m_aStates.top().setBorderState(RTFBorderState::PARAGRAPH);
} }