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

writerfilter: make RTFParserState members private, part 2

Change-Id: I9d712b227ea39bd63c34e77572f7e3d5ff83aa7e
Reviewed-on: https://gerrit.libreoffice.org/72555
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst 3370752d
......@@ -653,7 +653,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
}
// new destination => use new destination text
m_aStates.top().pDestinationText = &m_aStates.top().aDestinationText;
m_aStates.top().setCurrentDestinationText(&m_aStates.top().aDestinationText);
return RTFError::OK;
}
......
......@@ -470,7 +470,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aStates.top().aCharacterSprms = getDefaultState().aCharacterSprms;
m_aStates.top().nCurrentEncoding = getEncoding(getFontIndex(m_nDefaultFontIndex));
m_aStates.top().aCharacterAttributes = getDefaultState().aCharacterAttributes;
m_aStates.top().nCurrentCharacterStyleIndex = -1;
m_aStates.top().setCurrentCharacterStyleIndex(-1);
m_aStates.top().isRightToLeft = false;
m_aStates.top().eRunType = RTFParserState::RunType::LOCH;
}
......@@ -514,11 +514,11 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
{
m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_pStyle,
new RTFValue(aName));
m_aStates.top().nCurrentStyleIndex = 0;
m_aStates.top().setCurrentStyleIndex(0);
}
else
{
m_aStates.top().nCurrentStyleIndex = -1;
m_aStates.top().setCurrentStyleIndex(-1);
}
}
// Need to send paragraph properties again, if there will be any.
......
......@@ -431,7 +431,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
break;
case RTF_S:
{
m_aStates.top().nCurrentStyleIndex = nParam;
m_aStates.top().setCurrentStyleIndex(nParam);
if (m_aStates.top().eDestination == Destination::STYLESHEET
|| m_aStates.top().eDestination == Destination::STYLEENTRY)
......@@ -457,7 +457,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
}
break;
case RTF_CS:
m_aStates.top().nCurrentCharacterStyleIndex = nParam;
m_aStates.top().setCurrentCharacterStyleIndex(nParam);
if (m_aStates.top().eDestination == Destination::STYLESHEET
|| m_aStates.top().eDestination == Destination::STYLEENTRY)
{
......@@ -667,7 +667,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
pIntValue);
else if (m_aStates.top().eDestination == Destination::LISTOVERRIDEENTRY)
m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Num_abstractNumId, pIntValue);
m_aStates.top().nCurrentListIndex = nParam;
m_aStates.top().setCurrentListIndex(nParam);
}
break;
case RTF_LS:
......@@ -675,7 +675,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
if (m_aStates.top().eDestination == Destination::LISTOVERRIDEENTRY)
{
m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_AbstractNum_nsid, pIntValue);
m_aStates.top().nCurrentListOverrideIndex = nParam;
m_aStates.top().setCurrentListOverrideIndex(nParam);
}
else
{
......
......@@ -402,8 +402,8 @@ public:
void appendDestinationText(const OUString& rString)
{
if (pDestinationText)
pDestinationText->append(rString);
if (m_pCurrentDestinationText)
m_pCurrentDestinationText->append(rString);
}
void setPropName(const OUString& rPropName) { m_aPropName = rPropName; }
......@@ -437,6 +437,25 @@ public:
bool getInListpicture() const { return m_bInListpicture; }
void setCurrentBuffer(RTFBuffer_t* pCurrentBuffer) { m_pCurrentBuffer = pCurrentBuffer; }
RTFBuffer_t* getCurrentBuffer() const { return m_pCurrentBuffer; }
void setCurrentListOverrideIndex(int nCurrentListOverrideIndex)
{
m_nCurrentListOverrideIndex = nCurrentListOverrideIndex;
}
int getCurrentListOverrideIndex() const { return m_nCurrentListOverrideIndex; }
void setCurrentListIndex(int nCurrentListIndex) { m_nCurrentListIndex = nCurrentListIndex; }
int getCurrentListIndex() const { return m_nCurrentListIndex; }
void setCurrentCharacterStyleIndex(int nCurrentCharacterStyleIndex)
{
m_nCurrentCharacterStyleIndex = nCurrentCharacterStyleIndex;
}
int getCurrentCharacterStyleIndex() const { return m_nCurrentCharacterStyleIndex; }
void setCurrentStyleIndex(int nCurrentStyleIndex) { m_nCurrentStyleIndex = nCurrentStyleIndex; }
int getCurrentStyleIndex() const { return m_nCurrentStyleIndex; }
void setCurrentDestinationText(OUStringBuffer* pDestinationText)
{
m_pCurrentDestinationText = pDestinationText;
}
OUStringBuffer* getCurrentDestinationText() const { return m_pCurrentDestinationText; }
RTFDocumentImpl* m_pDocumentImpl;
RTFInternalState nInternalState;
......@@ -510,19 +529,20 @@ public:
/// Text from special destinations.
OUStringBuffer aDestinationText;
private:
/// point to the buffer of the current destination
OUStringBuffer* pDestinationText;
OUStringBuffer* m_pCurrentDestinationText;
/// Index of the current style.
int nCurrentStyleIndex;
int m_nCurrentStyleIndex;
/// Index of the current character style.
int nCurrentCharacterStyleIndex;
int m_nCurrentCharacterStyleIndex;
/// Current listid, points to a listtable entry.
int nCurrentListIndex = -1;
int m_nCurrentListIndex = -1;
/// Current ls, points to a listoverridetable entry.
int nCurrentListOverrideIndex = -1;
int m_nCurrentListOverrideIndex = -1;
private:
/// Points to the active buffer, if there is one.
RTFBuffer_t* m_pCurrentBuffer;
......
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