summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-04-06 10:07:43 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-04-06 10:09:55 +0200
commit1a3ab52289338c4f07fc9fee3f9022be114d2553 (patch)
tree8a13ded41a49d76a4a52fb9558b838018821ba26 /writerfilter
parentfe51974e6515f48a6e6881e5837027d08c8d66e9 (diff)
rtftok: drop m_bIsSubstream, we already have a m_pSuperstream
Originally there was m_bIsSubstream (true for footnotes, headers, etc.), then we needed a pointer to the original stream, now the boolean value is redundant, so remove it.
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx19
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx2
2 files changed, 6 insertions, 15 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e938f98be74f..c2447466b741 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -260,7 +260,6 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_aShapetextBuffer(),
m_pCurrentBuffer(0),
m_bHasFootnote(false),
- m_bIsSubstream(false),
m_pSuperstream(0),
m_nHeaderFooterPositions(),
m_nGroupStartPos(0),
@@ -312,11 +311,6 @@ Stream& RTFDocumentImpl::Mapper()
return *m_pMapperStream;
}
-void RTFDocumentImpl::setSubstream(bool bIsSubtream)
-{
- m_bIsSubstream = bIsSubtream;
-}
-
void RTFDocumentImpl::setSuperstream(RTFDocumentImpl *pSuperstream)
{
m_pSuperstream = pSuperstream;
@@ -329,7 +323,7 @@ void RTFDocumentImpl::setAuthor(rtl::OUString& rAuthor)
bool RTFDocumentImpl::isSubstream() const
{
- return m_bIsSubstream;
+ return m_pSuperstream != 0;
}
void RTFDocumentImpl::finishSubstream()
@@ -360,7 +354,6 @@ void RTFDocumentImpl::resolveSubstream(sal_uInt32 nPos, Id nId, OUString& rIgnor
sal_uInt32 nCurrent = Strm().Tell();
// Seek to header position, parse, then seek back.
RTFDocumentImpl::Pointer_t pImpl(new RTFDocumentImpl(m_xContext, m_xInputStream, m_xDstDoc, m_xFrame, m_xStatusIndicator));
- pImpl->setSubstream(true);
pImpl->setSuperstream(this);
pImpl->setIgnoreFirst(rIgnoreFirst);
if (!m_aAuthor.isEmpty())
@@ -388,7 +381,7 @@ void RTFDocumentImpl::checkFirstRun()
writerfilter::Reference<Table>::Pointer_t const pTable(new RTFReferenceTable(aSettingsTableEntries));
Mapper().table(NS_ooxml::LN_settings_settings, pTable);
// start initial paragraph
- if (!m_bIsSubstream)
+ if (!m_pSuperstream)
Mapper().startSectionGroup();
Mapper().startParagraphGroup();
m_bFirstRun = false;
@@ -499,7 +492,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false)
// The trick is that we send properties of the previous section right now, which will be exactly what dmapper expects.
Mapper().props(pProperties);
Mapper().endParagraphGroup();
- if (!m_bIsSubstream)
+ if (!m_pSuperstream)
Mapper().endSectionGroup();
if (!bFinal)
{
@@ -1149,7 +1142,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
case RTF_FOOTERL:
case RTF_FOOTERR:
case RTF_FOOTERF:
- if (!m_bIsSubstream)
+ if (!m_pSuperstream)
{
Id nId = 0;
sal_uInt32 nPos = m_nGroupStartPos - 1;
@@ -1170,7 +1163,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
}
break;
case RTF_FOOTNOTE:
- if (!m_bIsSubstream)
+ if (!m_pSuperstream)
{
Id nId = NS_rtf::LN_footnote;
@@ -1227,7 +1220,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
m_aStates.top().nDestinationState = DESTINATION_REVISIONTABLE;
break;
case RTF_ANNOTATION:
- if (!m_bIsSubstream)
+ if (!m_pSuperstream)
{
resolveSubstream(m_nGroupStartPos - 1, NS_rtf::LN_annotation);
m_aStates.top().nDestinationState = DESTINATION_SKIP;
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 1d72ece73a80..e66f22e89899 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -441,8 +441,6 @@ namespace writerfilter {
RTFBuffer_t* m_pCurrentBuffer;
bool m_bHasFootnote;
- /// If this is a substream.
- bool m_bIsSubstream;
/// Superstream of this substream.
RTFDocumentImpl *m_pSuperstream;
std::queue< std::pair<Id, sal_uInt32> > m_nHeaderFooterPositions;