summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx8
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx9
2 files changed, 7 insertions, 10 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 078f9dc94dd6..70ba0dd85115 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2306,14 +2306,14 @@ void RtfAttributeOutput::CharEscapement(const SvxEscapementItem& rEscapement)
const char* pUpDn;
- SwTwips nH = m_rExport.GetItem(RES_CHRATR_FONTSIZE).GetHeight();
+ double fHeight = m_rExport.GetItem(RES_CHRATR_FONTSIZE).GetHeight();
if (0 < rEscapement.GetEsc())
pUpDn = OOO_STRING_SVTOOLS_RTF_UP;
else if (0 > rEscapement.GetEsc())
{
pUpDn = OOO_STRING_SVTOOLS_RTF_DN;
- nH = -nH;
+ fHeight = -fHeight;
}
else
return;
@@ -2344,9 +2344,7 @@ void RtfAttributeOutput::CharEscapement(const SvxEscapementItem& rEscapement)
* ----------------------- = ------------
* 100% Escapement
*/
-
- m_aStyles.append(static_cast<sal_Int32>((long(nEsc) * nH) + 500) / 1000);
- // 500 to round !!
+ m_aStyles.append(static_cast<sal_Int32>(round(fHeight * nEsc / 1000)));
}
void RtfAttributeOutput::CharFont(const SvxFontItem& rFont)
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 040153b65bdd..17780b0e0efb 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1396,6 +1396,7 @@ void WW8AttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement )
else if ( DFLT_ESC_SUPER == nEsc || DFLT_ESC_AUTO_SUPER == nEsc )
b = 1;
}
+ // FIXME: these need a better formula. See rtfAttributeOutput
else if ( DFLT_ESC_AUTO_SUPER == nEsc )
nEsc = DFLT_ESC_SUPER;
else if ( DFLT_ESC_AUTO_SUB == nEsc )
@@ -1410,17 +1411,15 @@ void WW8AttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement )
if ( 0 == b || 0xFF == b )
{
- long nHeight = m_rWW8Export.GetItem( RES_CHRATR_FONTSIZE ).GetHeight();
+ double fHeight = m_rWW8Export.GetItem( RES_CHRATR_FONTSIZE ).GetHeight();
m_rWW8Export.InsUInt16( NS_sprm::sprmCHpsPos );
- m_rWW8Export.InsUInt16( static_cast<short>(( nHeight * nEsc + 500 ) / 1000 ));
+ m_rWW8Export.InsUInt16(static_cast<short>( round(fHeight * nEsc / 1000) ));
if( 100 != nProp || !b )
{
m_rWW8Export.InsUInt16( NS_sprm::sprmCHps );
-
- m_rWW8Export.InsUInt16(
- msword_cast<sal_uInt16>((nHeight * nProp + 500 ) / 1000));
+ m_rWW8Export.InsUInt16(msword_cast<sal_uInt16>( round(fHeight * nProp / 1000) ));
}
}
}