[Libreoffice-commits] core.git: sw/source
Jan Holesovsky
kendy at collabora.com
Tue Oct 8 09:59:56 PDT 2013
sw/source/filter/ww8/attributeoutputbase.hxx | 4 +-
sw/source/filter/ww8/docxattributeoutput.cxx | 34 ++++++++++--------------
sw/source/filter/ww8/docxattributeoutput.hxx | 6 ++++
sw/source/filter/ww8/rtfattributeoutput.cxx | 19 ++++++++-----
sw/source/filter/ww8/rtfattributeoutput.hxx | 6 ++++
sw/source/filter/ww8/ww8atr.cxx | 37 +++++++++++++++------------
sw/source/filter/ww8/ww8attributeoutput.hxx | 6 ++++
7 files changed, 67 insertions(+), 45 deletions(-)
New commits:
commit 26303d1f95d2b12b9e0df68a953ab19f5378d944
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Oct 8 17:47:30 2013 +0200
DOCX export: ParaScriptSpace() should not contain handling of more items.
They are not really related, so no reason to have one method for them.
Change-Id: Id633c2a9e8d46c3a64dc9d5abe508a4da5ab2410
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 414e52b..60ab1b1 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -502,10 +502,10 @@ protected:
virtual void ParaScriptSpace( const SfxBoolItem& ) = 0;
/// Sfx item RES_PARATR_HANGINGPUNCTUATION
- void ParaHangingPunctuation( const SfxBoolItem& rHt ) { ParaScriptSpace( rHt ); };
+ virtual void ParaHangingPunctuation( const SfxBoolItem& ) = 0;
/// Sfx item RES_PARATR_FORBIDDEN_RULES
- void ParaForbiddenRules( const SfxBoolItem& rHt ) { ParaScriptSpace( rHt ); };
+ virtual void ParaForbiddenRules( const SfxBoolItem& ) = 0;
/// Sfx item RES_PARATR_VERTALIGN
virtual void ParaVerticalAlign( const SvxParaVertAlignItem& ) = 0;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1bcedd3..48af82b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5196,27 +5196,23 @@ void DocxAttributeOutput::ParaNumRule_Impl( const SwTxtNode* /*pTxtNd*/, sal_Int
void DocxAttributeOutput::ParaScriptSpace( const SfxBoolItem& rScriptSpace )
{
- sal_uInt16 nXmlElement = 0;
+ m_pSerializer->singleElementNS( XML_w, XML_autoSpaceDE,
+ FSNS( XML_w, XML_val ), rScriptSpace.GetValue( ) ? "true": "false",
+ FSEND );
+}
- switch ( rScriptSpace.Which( ) )
- {
- case RES_PARATR_SCRIPTSPACE:
- nXmlElement = XML_autoSpaceDE;
- break;
- case RES_PARATR_HANGINGPUNCTUATION:
- nXmlElement = XML_overflowPunct;
- break;
- case RES_PARATR_FORBIDDEN_RULES:
- nXmlElement = XML_kinsoku;
- break;
- }
+void DocxAttributeOutput::ParaHangingPunctuation( const SfxBoolItem& rItem )
+{
+ m_pSerializer->singleElementNS( XML_w, XML_overflowPunct,
+ FSNS( XML_w, XML_val ), rItem.GetValue( ) ? "true": "false",
+ FSEND );
+}
- if ( nXmlElement )
- {
- m_pSerializer->singleElementNS( XML_w, nXmlElement,
- FSNS( XML_w, XML_val ), rScriptSpace.GetValue( ) ? "true": "false",
- FSEND );
- }
+void DocxAttributeOutput::ParaForbiddenRules( const SfxBoolItem& rItem )
+{
+ m_pSerializer->singleElementNS( XML_w, XML_kinsoku,
+ FSNS( XML_w, XML_val ), rItem.GetValue( ) ? "true": "false",
+ FSEND );
}
void DocxAttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& rAlign )
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 16f17b7..8a17e9c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -537,6 +537,12 @@ protected:
/// Sfx item RES_PARATR_SCRIPTSPACE
virtual void ParaScriptSpace( const SfxBoolItem& );
+ /// Sfx item RES_PARATR_HANGINGPUNCTUATION
+ virtual void ParaHangingPunctuation( const SfxBoolItem& );
+
+ /// Sfx item RES_PARATR_FORBIDDEN_RULES
+ virtual void ParaForbiddenRules( const SfxBoolItem& );
+
/// Sfx item RES_PARATR_VERTALIGN
virtual void ParaVerticalAlign( const SvxParaVertAlignItem& rAlign );
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index c47abef..1e15d24 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2659,15 +2659,18 @@ void RtfAttributeOutput::ParaScriptSpace( const SfxBoolItem& rScriptSpace )
if (!rScriptSpace.GetValue( ))
return;
- switch ( rScriptSpace.Which( ) )
- {
- case RES_PARATR_SCRIPTSPACE:
- m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ASPALPHA);
- break;
- default:
- break;
- }
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ASPALPHA);
+}
+
+void RtfAttributeOutput::ParaHangingPunctuation( const SfxBoolItem& )
+{
+ SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::ParaForbiddenRules( const SfxBoolItem& )
+{
+ SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
}
void RtfAttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& rAlign )
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 0426749b..91bfd72 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -354,6 +354,12 @@ protected:
/// Sfx item RES_PARATR_SCRIPTSPACE
virtual void ParaScriptSpace( const SfxBoolItem& );
+ /// Sfx item RES_PARATR_HANGINGPUNCTUATION
+ virtual void ParaHangingPunctuation( const SfxBoolItem& );
+
+ /// Sfx item RES_PARATR_FORBIDDEN_RULES
+ virtual void ParaForbiddenRules( const SfxBoolItem& );
+
/// Sfx item RES_PARATR_VERTALIGN
virtual void ParaVerticalAlign( const SvxParaVertAlignItem& rAlign );
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 2d2c48a..f7ffc55 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2998,24 +2998,29 @@ void WW8AttributeOutput::ParaHyphenZone( const SvxHyphenZoneItem& rHyphenZone )
void WW8AttributeOutput::ParaScriptSpace( const SfxBoolItem& rScriptSpace )
{
- sal_uInt16 nId = 0;
- if ( m_rWW8Export.bWrtWW8 )
- switch ( rScriptSpace.Which() )
- {
- case RES_PARATR_SCRIPTSPACE: nId = NS_sprm::LN_PFAutoSpaceDE; break;
- case RES_PARATR_HANGINGPUNCTUATION: nId = NS_sprm::LN_PFOverflowPunct; break;
- case RES_PARATR_FORBIDDEN_RULES: nId = NS_sprm::LN_PFKinsoku; break;
- }
+ if ( !m_rWW8Export.bWrtWW8 )
+ return;
- if ( nId )
- {
- if( m_rWW8Export.bWrtWW8 )
- m_rWW8Export.InsUInt16( nId );
- else
- m_rWW8Export.pO->push_back( (sal_uInt8)nId );
+ m_rWW8Export.InsUInt16( NS_sprm::LN_PFAutoSpaceDE );
+ m_rWW8Export.pO->push_back( rScriptSpace.GetValue() ? 1 : 0 );
+}
- m_rWW8Export.pO->push_back( rScriptSpace.GetValue() ? 1 : 0 );
- }
+void WW8AttributeOutput::ParaHangingPunctuation( const SfxBoolItem& rItem )
+{
+ if ( !m_rWW8Export.bWrtWW8 )
+ return;
+
+ m_rWW8Export.InsUInt16( NS_sprm::LN_PFOverflowPunct );
+ m_rWW8Export.pO->push_back( rItem.GetValue() ? 1 : 0 );
+}
+
+void WW8AttributeOutput::ParaForbiddenRules( const SfxBoolItem& rItem )
+{
+ if ( !m_rWW8Export.bWrtWW8 )
+ return;
+
+ m_rWW8Export.InsUInt16( NS_sprm::LN_PFKinsoku );
+ m_rWW8Export.pO->push_back( rItem.GetValue() ? 1 : 0 );
}
void WW8AttributeOutput::ParaSnapToGrid( const SvxParaGridItem& rGrid )
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index e60c3e9..ac6341e 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -335,6 +335,12 @@ protected:
/// Sfx item RES_PARATR_SCRIPTSPACE
virtual void ParaScriptSpace( const SfxBoolItem& );
+ /// Sfx item RES_PARATR_HANGINGPUNCTUATION
+ virtual void ParaHangingPunctuation( const SfxBoolItem& );
+
+ /// Sfx item RES_PARATR_FORBIDDEN_RULES
+ virtual void ParaForbiddenRules( const SfxBoolItem& );
+
/// Sfx item RES_PARATR_VERTALIGN
virtual void ParaVerticalAlign( const SvxParaVertAlignItem& );
More information about the Libreoffice-commits
mailing list