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

writerfilter: make RTFParserState members private, final part

Change-Id: I14e5bb0df50647801bf6c322132a76037185cada
Reviewed-on: https://gerrit.libreoffice.org/72564
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst e2aa8f8c
...@@ -170,7 +170,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) ...@@ -170,7 +170,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
} }
break; break;
case RTF_HEXCHAR: case RTF_HEXCHAR:
m_aStates.top().nInternalState = RTFInternalState::HEX; m_aStates.top().setInternalState(RTFInternalState::HEX);
break; break;
case RTF_CELL: case RTF_CELL:
case RTF_NESTCELL: case RTF_NESTCELL:
......
...@@ -1257,7 +1257,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) ...@@ -1257,7 +1257,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
break; break;
case RTF_BIN: case RTF_BIN:
{ {
m_aStates.top().nInternalState = RTFInternalState::BIN; m_aStates.top().setInternalState(RTFInternalState::BIN);
m_aStates.top().setBinaryToRead(nParam); m_aStates.top().setBinaryToRead(nParam);
} }
break; break;
......
...@@ -1168,7 +1168,7 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS ...@@ -1168,7 +1168,7 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS
RTFError RTFDocumentImpl::resolveChars(char ch) RTFError RTFDocumentImpl::resolveChars(char ch)
{ {
if (m_aStates.top().nInternalState == RTFInternalState::BIN) if (m_aStates.top().getInternalState() == RTFInternalState::BIN)
{ {
m_pBinaryData.reset(new SvMemoryStream()); m_pBinaryData.reset(new SvMemoryStream());
m_pBinaryData->WriteChar(ch); m_pBinaryData->WriteChar(ch);
...@@ -1177,7 +1177,7 @@ RTFError RTFDocumentImpl::resolveChars(char ch) ...@@ -1177,7 +1177,7 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
Strm().ReadChar(ch); Strm().ReadChar(ch);
m_pBinaryData->WriteChar(ch); m_pBinaryData->WriteChar(ch);
} }
m_aStates.top().nInternalState = RTFInternalState::NORMAL; m_aStates.top().setInternalState(RTFInternalState::NORMAL);
return RTFError::OK; return RTFError::OK;
} }
...@@ -1187,10 +1187,11 @@ RTFError RTFDocumentImpl::resolveChars(char ch) ...@@ -1187,10 +1187,11 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
bool bSkipped = false; bool bSkipped = false;
while (!Strm().eof() while (!Strm().eof()
&& (m_aStates.top().nInternalState == RTFInternalState::HEX && (m_aStates.top().getInternalState() == RTFInternalState::HEX
|| (ch != '{' && ch != '}' && ch != '\\'))) || (ch != '{' && ch != '}' && ch != '\\')))
{ {
if (m_aStates.top().nInternalState == RTFInternalState::HEX || (ch != 0x0d && ch != 0x0a)) if (m_aStates.top().getInternalState() == RTFInternalState::HEX
|| (ch != 0x0d && ch != 0x0a))
{ {
if (m_aStates.top().getCharsToSkip() == 0) if (m_aStates.top().getCharsToSkip() == 0)
{ {
...@@ -1209,7 +1210,7 @@ RTFError RTFDocumentImpl::resolveChars(char ch) ...@@ -1209,7 +1210,7 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
} }
// read a single char if we're in hex mode // read a single char if we're in hex mode
if (m_aStates.top().nInternalState == RTFInternalState::HEX) if (m_aStates.top().getInternalState() == RTFInternalState::HEX)
break; break;
if (RTL_TEXTENCODING_MS_932 == m_aStates.top().getCurrentEncoding()) if (RTL_TEXTENCODING_MS_932 == m_aStates.top().getCurrentEncoding())
...@@ -1239,10 +1240,10 @@ RTFError RTFDocumentImpl::resolveChars(char ch) ...@@ -1239,10 +1240,10 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
Strm().ReadChar(ch); Strm().ReadChar(ch);
} }
if (m_aStates.top().nInternalState != RTFInternalState::HEX && !Strm().eof()) if (m_aStates.top().getInternalState() != RTFInternalState::HEX && !Strm().eof())
Strm().SeekRel(-1); Strm().SeekRel(-1);
if (m_aStates.top().nInternalState == RTFInternalState::HEX if (m_aStates.top().getInternalState() == RTFInternalState::HEX
&& m_aStates.top().getDestination() != Destination::LEVELNUMBERS) && m_aStates.top().getDestination() != Destination::LEVELNUMBERS)
{ {
if (!bSkipped) if (!bSkipped)
...@@ -3508,11 +3509,11 @@ RTFError RTFDocumentImpl::handleEmbeddedObject() ...@@ -3508,11 +3509,11 @@ RTFError RTFDocumentImpl::handleEmbeddedObject()
bool RTFDocumentImpl::isInBackground() { return m_aStates.top().getInBackground(); } bool RTFDocumentImpl::isInBackground() { return m_aStates.top().getInBackground(); }
RTFInternalState RTFDocumentImpl::getInternalState() { return m_aStates.top().nInternalState; } RTFInternalState RTFDocumentImpl::getInternalState() { return m_aStates.top().getInternalState(); }
void RTFDocumentImpl::setInternalState(RTFInternalState nInternalState) void RTFDocumentImpl::setInternalState(RTFInternalState nInternalState)
{ {
m_aStates.top().nInternalState = nInternalState; m_aStates.top().setInternalState(nInternalState);
} }
Destination RTFDocumentImpl::getDestination() { return m_aStates.top().getDestination(); } Destination RTFDocumentImpl::getDestination() { return m_aStates.top().getDestination(); }
...@@ -3554,7 +3555,7 @@ void RTFDocumentImpl::checkUnicode(bool bUnicode, bool bHex) ...@@ -3554,7 +3555,7 @@ void RTFDocumentImpl::checkUnicode(bool bUnicode, bool bHex)
RTFParserState::RTFParserState(RTFDocumentImpl* pDocumentImpl) RTFParserState::RTFParserState(RTFDocumentImpl* pDocumentImpl)
: m_pDocumentImpl(pDocumentImpl) : m_pDocumentImpl(pDocumentImpl)
, nInternalState(RTFInternalState::NORMAL) , m_nInternalState(RTFInternalState::NORMAL)
, m_eDestination(Destination::NORMAL) , m_eDestination(Destination::NORMAL)
, m_eFieldStatus(RTFFieldStatus::NONE) , m_eFieldStatus(RTFFieldStatus::NONE)
, m_nBorderState(RTFBorderState::NONE) , m_nBorderState(RTFBorderState::NONE)
...@@ -3602,7 +3603,7 @@ RTFShape::RTFShape() = default; ...@@ -3602,7 +3603,7 @@ RTFShape::RTFShape() = default;
RTFDrawingObject::RTFDrawingObject() = default; RTFDrawingObject::RTFDrawingObject() = default;
RTFFrame::RTFFrame(RTFParserState* pParserState) RTFFrame::RTFFrame(RTFParserState* pParserState)
: m_pDocumentImpl(pParserState->m_pDocumentImpl) : m_pDocumentImpl(pParserState->getDocumentImpl())
, m_nX(0) , m_nX(0)
, m_nY(0) , m_nY(0)
, m_nW(0) , m_nW(0)
......
...@@ -521,11 +521,13 @@ public: ...@@ -521,11 +521,13 @@ public:
RTFFieldStatus getFieldStatus() const { return m_eFieldStatus; } RTFFieldStatus getFieldStatus() const { return m_eFieldStatus; }
void setDestination(Destination eDestination) { m_eDestination = eDestination; } void setDestination(Destination eDestination) { m_eDestination = eDestination; }
Destination getDestination() const { return m_eDestination; } Destination getDestination() const { return m_eDestination; }
void setInternalState(RTFInternalState nInternalState) { m_nInternalState = nInternalState; }
RTFDocumentImpl* m_pDocumentImpl; RTFInternalState getInternalState() const { return m_nInternalState; }
RTFInternalState nInternalState; RTFDocumentImpl* getDocumentImpl() { return m_pDocumentImpl; }
private: private:
RTFDocumentImpl* m_pDocumentImpl;
RTFInternalState m_nInternalState;
Destination m_eDestination; Destination m_eDestination;
RTFFieldStatus m_eFieldStatus; RTFFieldStatus m_eFieldStatus;
RTFBorderState m_nBorderState; RTFBorderState m_nBorderState;
......
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