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

writerfilter: make RTFParserState members private, part 9

Change-Id: Ia9f2508b3e9d5087cb4cfe0724b90b220d3a3550
Reviewed-on: https://gerrit.libreoffice.org/72562
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst 0746d6e6
......@@ -132,7 +132,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
break;
case RTF_LFOLEVEL:
m_aStates.top().eDestination = Destination::LFOLEVEL;
m_aStates.top().aTableSprms.clear();
m_aStates.top().getTableSprms().clear();
break;
case RTF_LISTOVERRIDETABLE:
m_aStates.top().eDestination = Destination::LISTOVERRIDETABLE;
......@@ -304,7 +304,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
if (bCustomMark)
{
m_aStates.top().getCharacterAttributes().clear();
m_aStates.top().aCharacterSprms.clear();
m_aStates.top().getCharacterSprms().clear();
auto pValue = new RTFValue(1);
m_aStates.top().getCharacterAttributes().set(
NS_ooxml::LN_CT_FtnEdnRef_customMarkFollows, pValue);
......
......@@ -469,7 +469,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
break;
case RTF_PLAIN:
{
m_aStates.top().aCharacterSprms = getDefaultState().aCharacterSprms;
m_aStates.top().getCharacterSprms() = getDefaultState().getCharacterSprms();
m_aStates.top().setCurrentEncoding(getEncoding(getFontIndex(m_nDefaultFontIndex)));
m_aStates.top().getCharacterAttributes() = getDefaultState().getCharacterAttributes();
m_aStates.top().setCurrentCharacterStyleIndex(-1);
......@@ -694,7 +694,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
{
RTFSprms aAttributes;
auto pValue = new RTFValue(aAttributes);
m_aStates.top().aCharacterSprms.set(NS_ooxml::LN_EG_RPrBase_bdr, pValue);
m_aStates.top().getCharacterSprms().set(NS_ooxml::LN_EG_RPrBase_bdr, pValue);
m_aStates.top().nBorderState = RTFBorderState::CHARACTER;
}
break;
......@@ -789,13 +789,13 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aStates.top().setCurrentBuffer(&m_aSuperBuffer);
auto pValue = new RTFValue("superscript");
m_aStates.top().aCharacterSprms.set(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue);
m_aStates.top().getCharacterSprms().set(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue);
}
break;
case RTF_SUB:
{
auto pValue = new RTFValue("subscript");
m_aStates.top().aCharacterSprms.set(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue);
m_aStates.top().getCharacterSprms().set(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue);
}
break;
case RTF_NOSUPERSUB:
......@@ -805,7 +805,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
replayBuffer(m_aSuperBuffer, nullptr, nullptr);
m_aStates.top().setCurrentBuffer(nullptr);
}
m_aStates.top().aCharacterSprms.erase(NS_ooxml::LN_EG_RPrBase_vertAlign);
m_aStates.top().getCharacterSprms().erase(NS_ooxml::LN_EG_RPrBase_vertAlign);
}
break;
case RTF_LINEPPAGE:
......@@ -1080,19 +1080,20 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_PNLVLBODY:
{
auto pValue = new RTFValue(2);
m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_AbstractNum_nsid, pValue);
m_aStates.top().getTableAttributes().set(NS_ooxml::LN_CT_AbstractNum_nsid, pValue);
}
break;
case RTF_PNDEC:
{
auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_decimal);
m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Lvl_numFmt, pValue);
m_aStates.top().getTableSprms().set(NS_ooxml::LN_CT_Lvl_numFmt, pValue);
}
break;
case RTF_PNLVLBLT:
{
m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_AbstractNum_nsid, new RTFValue(1));
m_aStates.top().aTableSprms.set(
m_aStates.top().getTableAttributes().set(NS_ooxml::LN_CT_AbstractNum_nsid,
new RTFValue(1));
m_aStates.top().getTableSprms().set(
NS_ooxml::LN_CT_Lvl_numFmt,
new RTFValue(NS_ooxml::LN_Value_ST_NumberFormat_bullet));
}
......@@ -1152,7 +1153,8 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_mirrorMargins, new RTFValue(1));
break;
case RTF_SAUTOUPD:
m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Style_autoRedefine, new RTFValue(1));
m_aStates.top().getTableSprms().set(NS_ooxml::LN_CT_Style_autoRedefine,
new RTFValue(1));
break;
case RTF_WIDOWCTRL:
m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_widowControl, new RTFValue(1));
......
......@@ -186,7 +186,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
m_aStates.top().getParagraphSprms());
bufferProperties(m_aTableBufferStack.back(), pPValue, nullptr);
auto pCValue = new RTFValue(m_aStates.top().getCharacterAttributes(),
m_aStates.top().aCharacterSprms);
m_aStates.top().getCharacterSprms());
bufferProperties(m_aTableBufferStack.back(), pCValue, nullptr);
}
......
......@@ -512,19 +512,22 @@ public:
RTFSprms& getParagraphAttributes() { return m_aParagraphAttributes; }
RTFSprms& getParagraphSprms() { return m_aParagraphSprms; }
RTFSprms& getCharacterAttributes() { return m_aCharacterAttributes; }
RTFSprms& getCharacterSprms() { return m_aCharacterSprms; }
RTFSprms& getTableAttributes() { return m_aTableAttributes; }
RTFSprms& getTableSprms() { return m_aTableSprms; }
RTFDocumentImpl* m_pDocumentImpl;
RTFInternalState nInternalState;
Destination eDestination;
RTFFieldStatus eFieldStatus;
RTFBorderState nBorderState;
// font table, stylesheet table
RTFSprms aTableSprms;
RTFSprms aTableAttributes;
// reset by plain
RTFSprms aCharacterSprms;
private:
// font table, stylesheet table
RTFSprms m_aTableSprms;
RTFSprms m_aTableAttributes;
// reset by plain
RTFSprms m_aCharacterSprms;
RTFSprms m_aCharacterAttributes;
// reset by pard
RTFSprms m_aParagraphSprms;
......
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