diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-09-10 11:47:16 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-09-20 23:05:26 +0200 |
commit | e0b8bfe94b73c1c0a54fb7f68cc6283203a78067 (patch) | |
tree | b2f5b594e07f653f16b1b588eb18e50b356cb876 | |
parent | 4122e7fe2eb839c25f5a0d1aa475689e8b54947c (diff) |
fftester: use of deleted RTFParserState
but we only use the RTFParserState to use its m_pDocumentImpl and
the m_pDocumentImpl is never changed for the RTFParserState lifetime,
so take the m_pDocumentImpl at ctor time instead and use that
directly later
Reviewed-on: https://gerrit.libreoffice.org/28802
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 44d4d9d4e998de9b4dc939af4fa40e51e6300951)
Change-Id: I15152e3f6d9008553b4a384a5e5da21373904cc9
Reviewed-on: https://gerrit.libreoffice.org/28804
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 4ed7ca7bfd5aab9846a02d3397771c0724344993)
-rw-r--r-- | writerfilter/qa/cppunittests/rtftok/data/pass/parser-state-1.rtf | bin | 0 -> 1546 bytes | |||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/writerfilter/qa/cppunittests/rtftok/data/pass/parser-state-1.rtf b/writerfilter/qa/cppunittests/rtftok/data/pass/parser-state-1.rtf Binary files differnew file mode 100644 index 000000000000..3fe4b287640c --- /dev/null +++ b/writerfilter/qa/cppunittests/rtftok/data/pass/parser-state-1.rtf diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 2f5569d95661..a4acf31e4baf 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -6651,7 +6651,7 @@ RTFDrawingObject::RTFDrawingObject() } RTFFrame::RTFFrame(RTFParserState* pParserState) - : m_pParserState(pParserState), + : m_pDocumentImpl(pParserState->m_pDocumentImpl), nX(0), nY(0), nW(0), @@ -6669,10 +6669,10 @@ RTFFrame::RTFFrame(RTFParserState* pParserState) void RTFFrame::setSprm(Id nId, Id nValue) { - if (m_pParserState->m_pDocumentImpl->getFirstRun() && !m_pParserState->m_pDocumentImpl->isStyleSheetImport()) + if (m_pDocumentImpl->getFirstRun() && !m_pDocumentImpl->isStyleSheetImport()) { - m_pParserState->m_pDocumentImpl->checkFirstRun(); - m_pParserState->m_pDocumentImpl->setNeedPar(false); + m_pDocumentImpl->checkFirstRun(); + m_pDocumentImpl->setNeedPar(false); } switch (nId) { diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 78851d18ef2d..6744bea09383 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -182,12 +182,13 @@ public: }; class RTFParserState; +class RTFDocumentImpl; /// Stores the properties of a frame class RTFFrame { private: - RTFParserState* m_pParserState; + RTFDocumentImpl* m_pDocumentImpl; sal_Int32 nX, nY, nW, nH; sal_Int32 nHoriPadding, nVertPadding; sal_Int32 nHoriAlign, nHoriAnchor, nVertAlign, nVertAnchor; |