1 Index: attributeoutputbase.hxx
2 ===================================================================
3 --- sw/source/filter/docx/attributeoutputbase.hxx (revision 271125)
4 +++ sw/source/filter/docx/attributeoutputbase.hxx (working copy)
6 virtual void TextHardBlank( const SwFmtHardBlank& ) = 0;
8 /// Sfx item RES_PARATR_LINESPACING
9 - virtual void ParaLineSpacing( const SvxLineSpacingItem& ) = 0;
10 + void ParaLineSpacing( const SvxLineSpacingItem& );
12 + /// Count the values in ParaLineSpacing, and pass theme here.
13 + virtual void ParaLineSpacing_Impl( short nSpace, short nMulti ) = 0;
15 /// Sfx item RES_PARATR_ADJUST
16 virtual void ParaAdjust( const SvxAdjustItem& ) = 0;
19 ===================================================================
20 --- sw/source/filter/docx/docx-ww8atr.cxx (revision 271125)
21 +++ sw/source/filter/docx/docx-ww8atr.cxx (working copy)
26 -void WW8AttributeOutput::ParaLineSpacing( const SvxLineSpacingItem& rSpacing )
27 +void WW8AttributeOutput::ParaLineSpacing_Impl( short nSpace, short nMulti )
30 if ( m_rWW8Export.bWrtWW8 )
31 @@ -4442,6 +4442,12 @@
33 m_rWW8Export.pO->Insert( 20, m_rWW8Export.pO->Count() );
35 + m_rWW8Export.InsUInt16( nSpace );
36 + m_rWW8Export.InsUInt16( nMulti );
39 +void AttributeOutputBase::ParaLineSpacing( const SvxLineSpacingItem& rSpacing )
41 short nSpace = 240, nMulti = 0;
43 switch ( rSpacing.GetLineSpaceRule() )
44 @@ -4462,15 +4468,14 @@
46 i18n::ScriptType::LATIN;
47 const SwAttrSet *pSet = 0;
48 - if ( m_rWW8Export.pOutFmtNode && m_rWW8Export.pOutFmtNode->ISA( SwFmt ) )
49 + if ( GetExport().pOutFmtNode && GetExport().pOutFmtNode->ISA( SwFmt ) )
51 - const SwFmt *pFmt = (const SwFmt*)( m_rWW8Export.pOutFmtNode );
52 + const SwFmt *pFmt = (const SwFmt*)( GetExport().pOutFmtNode );
53 pSet = &pFmt->GetAttrSet();
55 - else if ( m_rWW8Export.pOutFmtNode && m_rWW8Export.pOutFmtNode->ISA( SwTxtNode ) )
56 + else if ( GetExport().pOutFmtNode && GetExport().pOutFmtNode->ISA( SwTxtNode ) )
58 - const SwTxtNode* pNd =
59 - (const SwTxtNode*)m_rWW8Export.pOutFmtNode;
60 + const SwTxtNode* pNd = (const SwTxtNode*)GetExport().pOutFmtNode;
61 pSet = &pNd->GetSwAttrSet();
62 if ( pBreakIt->xBreak.is() )
65 ASSERT( pSet, "No attrset for lineheight :-(" );
68 - nSpace = nSpace + (short)( AttrSetToLineHeight( *m_rWW8Export.pDoc,
69 + nSpace = nSpace + (short)( AttrSetToLineHeight( *GetExport().pDoc,
70 *pSet, *Application::GetDefaultDevice(), nScript ) );
77 - m_rWW8Export.InsUInt16( nSpace );
78 - m_rWW8Export.InsUInt16( nMulti );
79 + ParaLineSpacing_Impl( nSpace, nMulti );
82 void WW8AttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
83 Index: ww8attributeoutput.hxx
84 ===================================================================
85 --- sw/source/filter/docx/ww8attributeoutput.hxx (revision 271125)
86 +++ sw/source/filter/docx/ww8attributeoutput.hxx (working copy)
88 virtual void TextHardBlank( const SwFmtHardBlank& );
90 /// Sfx item RES_PARATR_LINESPACING
91 - virtual void ParaLineSpacing( const SvxLineSpacingItem& );
92 + virtual void ParaLineSpacing_Impl( short nSpace, short nMulti );
94 /// Sfx item RES_PARATR_ADJUST
95 virtual void ParaAdjust( const SvxAdjustItem& rHt );
96 Index: docxattributeoutput.cxx
97 ===================================================================
98 --- sw/source/filter/docx/docx-docxattributeoutput.cxx (revision 271348)
99 +++ sw/source/filter/docx/docx-docxattributeoutput.cxx (working copy)
100 @@ -2790,46 +2790,23 @@
104 -void DocxAttributeOutput::ParaLineSpacing( const SvxLineSpacingItem& rSpacing )
105 +void DocxAttributeOutput::ParaLineSpacing_Impl( short nSpace, short /*nMulti*/ )
107 - if (!m_pSpacingAttrList)
108 + if ( !m_pSpacingAttrList )
109 m_pSpacingAttrList = m_pSerializer->createAttrList();
111 - bool bLineSpaceRuleAuto = true;
113 - switch ( rSpacing.GetLineSpaceRule() )
116 - case SVX_LINE_SPACE_FIX:
117 - m_pSpacingAttrList->add(FSNS( XML_w, XML_lineRule ), OString( (sal_Char *)"exact") );
118 - bLineSpaceRuleAuto = false;
120 - case SVX_LINE_SPACE_MIN:
121 - m_pSpacingAttrList->add(FSNS( XML_w, XML_lineRule ), OString( (sal_Char *)"atLeast") );
122 - bLineSpaceRuleAuto = false;
124 - case SVX_LINE_SPACE_AUTO:
126 - m_pSpacingAttrList->add(FSNS( XML_w, XML_lineRule ), OString( (sal_Char *)"auto") );
128 + m_pSpacingAttrList->add( FSNS( XML_w, XML_lineRule ), "exact" );
129 + m_pSpacingAttrList->add( FSNS( XML_w, XML_line ), OString::valueOf( sal_Int32( -nSpace ) ) );
132 - sal_Int32 nSpace = 240;
134 - switch ( rSpacing.GetInterLineSpaceRule() )
135 + else if ( nSpace > 0 )
137 - case SVX_INTER_LINE_SPACE_PROP:
138 - nSpace = (sal_Int32)(( 240L * rSpacing.GetPropLineSpace() ) / 100L );
140 - case SVX_INTER_LINE_SPACE_FIX:
141 - nSpace = rSpacing.GetInterLineSpace() /* + rSpacing.GetLineHeight() */;
143 - case SVX_INTER_LINE_SPACE_OFF:
145 - nSpace = rSpacing.GetLineHeight();
147 + m_pSpacingAttrList->add( FSNS( XML_w, XML_lineRule ), "atLeast" );
148 + m_pSpacingAttrList->add( FSNS( XML_w, XML_line ), OString::valueOf( sal_Int32( nSpace ) ) );
151 - m_pSpacingAttrList->add( FSNS( XML_w, XML_line ), OString::valueOf( nSpace ) );
153 + m_pSpacingAttrList->add( FSNS( XML_w, XML_lineRule ), "auto" );
156 void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
157 Index: docxattributeoutput.hxx
158 ===================================================================
159 --- sw/source/filter/docx/docxattributeoutput.hxx (revision 271125)
160 +++ sw/source/filter/docx/docxattributeoutput.hxx (working copy)
162 virtual void TextHardBlank( const SwFmtHardBlank& );
164 /// Sfx item RES_PARATR_LINESPACING
165 - virtual void ParaLineSpacing( const SvxLineSpacingItem& rSpacing );
166 + virtual void ParaLineSpacing_Impl( short nSpace, short nMulti );
168 /// Sfx item RES_PARATR_ADJUST
169 virtual void ParaAdjust( const SvxAdjustItem& rAdjust );