summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-17 21:26:08 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-10-17 21:26:51 +0200
commit68c9515daf6648646788b70825ffa261e1fadf60 (patch)
tree6731885d74f4b231e52161ca8417192b27f17ae7
parent57ac36da7a19805cf7f63aa879e54a8f38020bce (diff)
pParagraphMarkerProperties can easily be a reference
Change-Id: Ida4309aeb69bde43f70415211490db657c7c7567
-rw-r--r--sw/source/filter/ww8/attributeoutputbase.hxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx82
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.hxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx2
-rw-r--r--sw/source/filter/ww8/ww8attributeoutput.hxx2
7 files changed, 45 insertions, 49 deletions
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 0a644c21b7d2..1dffa6340def 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -162,7 +162,7 @@ public:
virtual void StartParagraphProperties() = 0;
/// Called after we end outputting the attributes.
- virtual void EndParagraphProperties(const SfxItemSet* pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) = 0;
+ virtual void EndParagraphProperties(const SfxItemSet& rParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) = 0;
/// Empty paragraph.
virtual void EmptyParagraph() = 0;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 02aa301e3c8d..3ba8512b3845 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -903,7 +903,7 @@ void lcl_writeParagraphMarkerProperties(DocxAttributeOutput& rAttributeOutput, c
}
}
-void DocxAttributeOutput::EndParagraphProperties( const SfxItemSet* pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted)
+void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted)
{
// Call the 'Redline' function. This will add redline (change-tracking) information that regards to paragraph properties.
// This includes changes like 'Bold', 'Underline', 'Strikethrough' etc.
@@ -920,52 +920,47 @@ void DocxAttributeOutput::EndParagraphProperties( const SfxItemSet* pParagraphMa
m_pSerializer->mergeTopMarks( );
// Write 'Paragraph Mark' properties
- if ( pRedlineParagraphMarkerDeleted || pRedlineParagraphMarkerInserted || pParagraphMarkerProperties)
- {
- m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND );
- // mark() before paragraph mark properties child elements.
- InitCollectedRunProperties();
+ m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND );
+ // mark() before paragraph mark properties child elements.
+ InitCollectedRunProperties();
- if(pParagraphMarkerProperties)
- {
- // The 'm_pFontsAttrList', 'm_pEastAsianLayoutAttrList', 'm_pCharLangAttrList' are used to hold information
- // that should be collected by different properties in the core, and are all flushed together
- // to the DOCX when the function 'WriteCollectedRunProperties' gets called.
- // So we need to store the current status of these lists, so that we can revert back to them when
- // we are done exporting the redline attributes.
- ::sax_fastparser::FastAttributeList *pFontsAttrList_Original = m_pFontsAttrList;
- ::sax_fastparser::FastAttributeList *pEastAsianLayoutAttrList_Original = m_pEastAsianLayoutAttrList;
- ::sax_fastparser::FastAttributeList *pCharLangAttrList_Original = m_pCharLangAttrList;
- m_pFontsAttrList = NULL;
- m_pEastAsianLayoutAttrList = NULL;
- m_pCharLangAttrList = NULL;
-
- lcl_writeParagraphMarkerProperties(*this, *pParagraphMarkerProperties);
-
- // Write the collected run properties that are stored in 'm_pFontsAttrList', 'm_pEastAsianLayoutAttrList', 'm_pCharLangAttrList'
- WriteCollectedRunProperties();
+ // The 'm_pFontsAttrList', 'm_pEastAsianLayoutAttrList', 'm_pCharLangAttrList' are used to hold information
+ // that should be collected by different properties in the core, and are all flushed together
+ // to the DOCX when the function 'WriteCollectedRunProperties' gets called.
+ // So we need to store the current status of these lists, so that we can revert back to them when
+ // we are done exporting the redline attributes.
+ ::sax_fastparser::FastAttributeList *pFontsAttrList_Original = m_pFontsAttrList;
+ ::sax_fastparser::FastAttributeList *pEastAsianLayoutAttrList_Original = m_pEastAsianLayoutAttrList;
+ ::sax_fastparser::FastAttributeList *pCharLangAttrList_Original = m_pCharLangAttrList;
+ m_pFontsAttrList = NULL;
+ m_pEastAsianLayoutAttrList = NULL;
+ m_pCharLangAttrList = NULL;
- // Revert back the original values that were stored in 'm_pFontsAttrList', 'm_pEastAsianLayoutAttrList', 'm_pCharLangAttrList'
- m_pFontsAttrList = pFontsAttrList_Original;
- m_pEastAsianLayoutAttrList = pEastAsianLayoutAttrList_Original;
- m_pCharLangAttrList = pCharLangAttrList_Original;
- }
- if ( pRedlineParagraphMarkerDeleted )
- {
- StartRedline( pRedlineParagraphMarkerDeleted );
- EndRedline( pRedlineParagraphMarkerDeleted );
- }
- if ( pRedlineParagraphMarkerInserted )
- {
- StartRedline( pRedlineParagraphMarkerInserted );
- EndRedline( pRedlineParagraphMarkerInserted );
- }
+ lcl_writeParagraphMarkerProperties(*this, rParagraphMarkerProperties);
- // mergeTopMarks() after paragraph mark properties child elements.
- m_pSerializer->mergeTopMarks();
- m_pSerializer->endElementNS( XML_w, XML_rPr );
+ // Write the collected run properties that are stored in 'm_pFontsAttrList', 'm_pEastAsianLayoutAttrList', 'm_pCharLangAttrList'
+ WriteCollectedRunProperties();
+
+ // Revert back the original values that were stored in 'm_pFontsAttrList', 'm_pEastAsianLayoutAttrList', 'm_pCharLangAttrList'
+ m_pFontsAttrList = pFontsAttrList_Original;
+ m_pEastAsianLayoutAttrList = pEastAsianLayoutAttrList_Original;
+ m_pCharLangAttrList = pCharLangAttrList_Original;
+
+ if ( pRedlineParagraphMarkerDeleted )
+ {
+ StartRedline( pRedlineParagraphMarkerDeleted );
+ EndRedline( pRedlineParagraphMarkerDeleted );
+ }
+ if ( pRedlineParagraphMarkerInserted )
+ {
+ StartRedline( pRedlineParagraphMarkerInserted );
+ EndRedline( pRedlineParagraphMarkerInserted );
}
+ // mergeTopMarks() after paragraph mark properties child elements.
+ m_pSerializer->mergeTopMarks();
+ m_pSerializer->endElementNS( XML_w, XML_rPr );
+
if (!m_bWritingHeaderFooter && m_pCurrentFrame)
{
const SwFrmFmt& rFrmFmt = m_pCurrentFrame->GetFrmFmt();
@@ -5067,7 +5062,8 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj)
// Write paragraph properties.
StartParagraphProperties();
aAttrIter.OutParaAttr(false);
- EndParagraphProperties(0, 0, 0, 0);
+ SfxItemSet aParagraphMarkerProperties(m_rExport.pDoc->GetAttrPool());
+ EndParagraphProperties(aParagraphMarkerProperties, 0, 0, 0);
do {
const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd);
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 9fd636b512df..f373b8629a12 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -168,7 +168,7 @@ public:
virtual void StartParagraphProperties() SAL_OVERRIDE;
/// Called after we end outputting the attributes.
- virtual void EndParagraphProperties( const SfxItemSet* pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) SAL_OVERRIDE;
+ virtual void EndParagraphProperties(const SfxItemSet& rParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) SAL_OVERRIDE;
/// Start of the text run.
virtual void StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun = false ) SAL_OVERRIDE;
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 95c609e175b6..bb0e6f5a198e 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -385,7 +385,7 @@ void RtfAttributeOutput::StartParagraphProperties()
m_aSectionHeaders.append(aPar.makeStringAndClear());
}
-void RtfAttributeOutput::EndParagraphProperties(const SfxItemSet* /*pParagraphMarkerProperties*/, const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/)
+void RtfAttributeOutput::EndParagraphProperties(const SfxItemSet& /*rParagraphMarkerProperties*/, const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/)
{
m_aStyles.append(m_aStylesEnd.makeStringAndClear());
m_rExport.Strm().WriteCharPtr(m_aStyles.makeStringAndClear().getStr());
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 87b23eeeab84..a056849a4c27 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -59,7 +59,7 @@ public:
virtual void StartParagraphProperties() SAL_OVERRIDE;
/// Called after we end outputting the attributes.
- virtual void EndParagraphProperties(const SfxItemSet* pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) SAL_OVERRIDE;
+ virtual void EndParagraphProperties(const SfxItemSet& rParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) SAL_OVERRIDE;
/// Start of the text run.
virtual void StartRun(const SwRedlineData* pRedlineData, bool bSingleEmptyRun = false) SAL_OVERRIDE;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 549c79c0ca52..155c069c7444 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2733,7 +2733,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
const SwRedlineData* pRedlineParagraphMarkerDelete = AttrOutput().GetParagraphMarkerRedline( rNode, nsRedlineType_t::REDLINE_DELETE );
const SwRedlineData* pRedlineParagraphMarkerInsert = AttrOutput().GetParagraphMarkerRedline( rNode, nsRedlineType_t::REDLINE_INSERT );
const SwRedlineData* pParagraphRedlineData = aAttrIter.GetParagraphLevelRedline( );
- AttrOutput().EndParagraphProperties(&aParagraphMarkerProperties, pParagraphRedlineData, pRedlineParagraphMarkerDelete, pRedlineParagraphMarkerInsert);
+ AttrOutput().EndParagraphProperties(aParagraphMarkerProperties, pParagraphRedlineData, pRedlineParagraphMarkerDelete, pRedlineParagraphMarkerInsert);
AttrOutput().EndParagraph( pTextNodeInfoInner );
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index 5074c96694af..8e7041bafdb5 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -42,7 +42,7 @@ public:
virtual void StartParagraphProperties() SAL_OVERRIDE {}
/// Called after we end outputting the attributes.
- virtual void EndParagraphProperties( const SfxItemSet* /*pParagraphMarkerProperties*/, const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/) SAL_OVERRIDE {}
+ virtual void EndParagraphProperties(const SfxItemSet& /*rParagraphMarkerProperties*/, const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/) SAL_OVERRIDE {}
/// Empty paragraph.
virtual void EmptyParagraph() SAL_OVERRIDE;