diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-10-17 17:56:10 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-10-17 17:59:06 +0200 |
commit | 2ed29702ab29240e8e68c9c0f168a551d17f79f6 (patch) | |
tree | f45473db320c100b176cb60ed5f05888d4e111d7 /sw | |
parent | d1563b818d335495a5591f5fd491fee77b47c93d (diff) |
sw: bool -> enum for style type in AttributeOutputBase
For now just use what we have already: paragraph and character styles.
But it enum should contain numbering styles as well in the future.
Change-Id: Ifd2f918446537e04cb5ba2cd8df822c5a1f9099c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/attributeoutputbase.hxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8attributeoutput.hxx | 2 |
7 files changed, 19 insertions, 12 deletions
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 1ff4474f3f32..fc04861d6782 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -132,6 +132,13 @@ namespace msword { const sal_uInt8 PageBreak = 0xC; } +/// Type of a style in the style table. +enum StyleType +{ + STYLE_TYPE_PARA, + STYLE_TYPE_CHAR +}; + class AttributeOutputBase { public: @@ -260,7 +267,7 @@ public: virtual void DefaultStyle( sal_uInt16 nStyle ) = 0; /// Start of a style in the styles table. - virtual void StartStyle( const OUString& rName, bool bPapFmt, + virtual void StartStyle( const OUString& rName, StyleType eType, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId, bool bAutoUpdate ) = 0; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 5821bfc168d1..4a1cdcf2873c 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3596,11 +3596,11 @@ oox::drawingml::DrawingML& DocxAttributeOutput::GetDrawingML() return m_rDrawingML; } -void DocxAttributeOutput::StartStyle( const OUString& rName, bool bPapFmt, +void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId, bool bAutoUpdate ) { m_pSerializer->startElementNS( XML_w, XML_style, - FSNS( XML_w, XML_type ), bPapFmt? "paragraph": "character", // FIXME is this correct? + FSNS( XML_w, XML_type ), (eType == STYLE_TYPE_PARA ? "paragraph": "character"), FSNS( XML_w, XML_styleId ), m_rExport.pStyles->GetStyleId(nId).getStr(), FSEND ); diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 5a53d34edeb1..29dec70b1972 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -225,7 +225,7 @@ public: void OutputDefaultItem(const SfxPoolItem& rHt); /// Start of a style in the styles table. - virtual void StartStyle( const OUString& rName, bool bPapFmt, + virtual void StartStyle( const OUString& rName, StyleType eType, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId, bool bAutoUpdate ); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 47b66e7f6ec3..a0ce1d7ba6d1 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1061,14 +1061,14 @@ void RtfAttributeOutput::DefaultStyle( sal_uInt16 /*nStyle*/ ) /* noop, the default style is always 0 in RTF */ } -void RtfAttributeOutput::StartStyle( const OUString& rName, bool bPapFmt, +void RtfAttributeOutput::StartStyle( const OUString& rName, StyleType eType, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId, bool /* bAutoUpdate */ ) { SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", rName = '" << rName << "'"); m_aStylesheet.append('{'); - if (bPapFmt) + if (eType == STYLE_TYPE_PARA) m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_S); else m_aStylesheet.append( OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_CS); diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 708a40606837..0ec6cbff643a 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -134,7 +134,7 @@ public: virtual void DefaultStyle( sal_uInt16 nStyle ); /// Start of a style in the styles table. - virtual void StartStyle( const OUString& rName, bool bPapFmt, + virtual void StartStyle( const OUString& rName, StyleType eType, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId, bool bAutoUpdate ); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 4acb308c92c6..52ac3025442f 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -372,7 +372,7 @@ void WW8AttributeOutput::EndStyle() m_rWW8Export.pO->clear(); } -void WW8AttributeOutput::StartStyle( const OUString& rName, bool bPapFmt, sal_uInt16 nWwBase, +void WW8AttributeOutput::StartStyle( const OUString& rName, StyleType eType, sal_uInt16 nWwBase, sal_uInt16 nWwNext, sal_uInt16 nWwId, sal_uInt16 /*nId*/, bool bAutoUpdate ) { sal_uInt8 aWW8_STD[ sizeof( WW8_STD ) ]; @@ -384,11 +384,11 @@ void WW8AttributeOutput::StartStyle( const OUString& rName, bool bPapFmt, sal_uI Set_UInt16( pData, nBit16 ); nBit16 = nWwBase << 4; // istdBase - nBit16 |= bPapFmt ? 1 : 2; // sgc + nBit16 |= (eType == STYLE_TYPE_PARA ? 1 : 2); // sgc Set_UInt16( pData, nBit16 ); nBit16 = nWwNext << 4; // istdNext - nBit16 |= bPapFmt ? 2 : 1; // cupx + nBit16 |= (eType == STYLE_TYPE_PARA ? 2 : 1); // cupx Set_UInt16( pData, nBit16 ); pData += sizeof( sal_uInt16 ); // bchUpe @@ -615,7 +615,7 @@ void MSWordStyles::OutputStyle( SwFmt* pFmt, sal_uInt16 nPos ) } } - m_rExport.AttrOutput().StartStyle( aName, bFmtColl, + m_rExport.AttrOutput().StartStyle( aName, (bFmtColl ? STYLE_TYPE_PARA : STYLE_TYPE_CHAR), nBase, nWwNext, GetWWId( *pFmt ), nPos, pFmt->IsAutoUpdateFmt() ); diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index 537db8977562..d1f4c9b89a54 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -120,7 +120,7 @@ public: virtual void DefaultStyle( sal_uInt16 nStyle ); /// Start of a style in the styles table. - virtual void StartStyle( const OUString& rName, bool bPapFmt, + virtual void StartStyle( const OUString& rName, StyleType eType, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwIdi, sal_uInt16 nId, bool bAutoUpdate ); |