Kaydet (Commit) fe4cea3e authored tarafından Miklos Vajna's avatar Miklos Vajna

RTF: clean up border property handling

üst 343b52ee
...@@ -146,6 +146,7 @@ static RTFSprms& lcl_getLastAttributes(RTFSprms& rSprms, Id nId) ...@@ -146,6 +146,7 @@ static RTFSprms& lcl_getLastAttributes(RTFSprms& rSprms, Id nId)
static void lcl_putBorderProperty(std::stack<RTFParserState>& aStates, Id nId, RTFValue::Pointer_t pValue) static void lcl_putBorderProperty(std::stack<RTFParserState>& aStates, Id nId, RTFValue::Pointer_t pValue)
{ {
RTFSprms* pAttributes = 0;
if (aStates.top().nBorderState == BORDER_PARAGRAPH_BOX) if (aStates.top().nBorderState == BORDER_PARAGRAPH_BOX)
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
...@@ -156,24 +157,15 @@ static void lcl_putBorderProperty(std::stack<RTFParserState>& aStates, Id nId, R ...@@ -156,24 +157,15 @@ static void lcl_putBorderProperty(std::stack<RTFParserState>& aStates, Id nId, R
rAttributes->push_back(make_pair(nId, pValue)); rAttributes->push_back(make_pair(nId, pValue));
} }
} }
// Attributes of the last border type
else if (aStates.top().nBorderState == BORDER_PARAGRAPH) else if (aStates.top().nBorderState == BORDER_PARAGRAPH)
{ pAttributes = &lcl_getLastAttributes(aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PrBase_pBdr);
// Attributes of the last border type
RTFSprms& rAttributes = lcl_getLastAttributes(aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PrBase_pBdr);
rAttributes->push_back(make_pair(nId, pValue));
}
else if (aStates.top().nBorderState == BORDER_CELL) else if (aStates.top().nBorderState == BORDER_CELL)
{ pAttributes = &lcl_getLastAttributes(aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcBorders);
// Attributes of the last border type
RTFSprms& rAttributes = lcl_getLastAttributes(aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcBorders);
rAttributes->push_back(make_pair(nId, pValue));
}
else if (aStates.top().nBorderState == BORDER_PAGE) else if (aStates.top().nBorderState == BORDER_PAGE)
{ pAttributes = &lcl_getLastAttributes(aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgBorders);
// Attributes of the last border type if (pAttributes)
RTFSprms& rAttributes = lcl_getLastAttributes(aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgBorders); (*pAttributes)->push_back(make_pair(nId, pValue));
rAttributes->push_back(make_pair(nId, pValue));
}
} }
// NEEDSWORK: DocxAttributeOutput's impl_AppendTwoDigits does the same. // NEEDSWORK: DocxAttributeOutput's impl_AppendTwoDigits does the same.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment