diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-07-05 16:57:03 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-07-05 18:11:07 +0200 |
commit | 26bc5a20b39df07abce37ccf8717221ffe3d8373 (patch) | |
tree | 26008ba5e75f924faa0e4ce8b14be4493c3b4642 | |
parent | b440845b9f04fdf498caf3bcdcc52ffc8c489639 (diff) |
RTFTokenizer: remember start pos of current group
Change-Id: I953ca1d3fb5532ac8261ef0def033a4c0fcd79c6
-rw-r--r-- | writerfilter/source/rtftok/rtftokenizer.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtftokenizer.hxx | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx index 7d3c2ddece9c..fc99189ad3a2 100644 --- a/writerfilter/source/rtftok/rtftokenizer.cxx +++ b/writerfilter/source/rtftok/rtftokenizer.cxx @@ -31,7 +31,8 @@ RTFTokenizer::RTFTokenizer(RTFListener& rImport, SvStream* pInStream, uno::Refer m_xStatusIndicator(xStatusIndicator), m_nGroup(0), m_nLineNumber(0), - m_nLineStartPos(0) + m_nLineStartPos(0), + m_nGroupStart(0) { if (!RTFTokenizer::m_bControlWordsSorted) { @@ -96,6 +97,7 @@ int RTFTokenizer::resolveParse() switch (ch) { case '{': + m_nGroupStart = Strm().Tell() - 1; ret = m_rImport.pushState(); if (ret) return ret; @@ -336,6 +338,11 @@ OUString RTFTokenizer::getPosition() return aRet.makeStringAndClear(); } +sal_Size RTFTokenizer::getGroupStart() +{ + return m_nGroupStart; +} + } // namespace rtftok } // namespace writerfilter diff --git a/writerfilter/source/rtftok/rtftokenizer.hxx b/writerfilter/source/rtftok/rtftokenizer.hxx index df452fb89048..b055b8c12669 100644 --- a/writerfilter/source/rtftok/rtftokenizer.hxx +++ b/writerfilter/source/rtftok/rtftokenizer.hxx @@ -33,6 +33,7 @@ namespace writerfilter { /// To be invoked by the popState() callback to single when the importer leaves a group. void popGroup(); OUString getPosition(); + sal_Size getGroupStart(); private: SvStream& Strm(); int resolveKeyword(); @@ -48,6 +49,7 @@ namespace writerfilter { int m_nGroup; sal_Int32 m_nLineNumber; sal_Int32 m_nLineStartPos; + sal_Size m_nGroupStart; }; } // namespace rtftok } // namespace writerfilter |