diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index 580279efbe18..7df2637b6a6a 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -51,7 +51,7 @@ private: sal_uLong m_nLineWidth; ///< width of separator line SvxBorderLineStyle m_eLineStyle; ///< Style of the separator line Color m_LineColor; ///< color of the separator line - Fraction m_Width; ///< percentage width of the separator line. + double m_Width; ///< percentage width of the separator line. css::text::HorizontalAdjust m_eAdjust; ///< line adjustment. SwTwips m_nTopDist; ///< distance between body and separator. SwTwips m_nBottomDist; ///< distance between separator and first footnote @@ -61,7 +61,7 @@ public: sal_uLong GetLineWidth() const { return m_nLineWidth; } const Color& GetLineColor() const { return m_LineColor;} SvxBorderLineStyle GetLineStyle() const { return m_eLineStyle; } - const Fraction& GetWidth() const { return m_Width; } + double GetWidth() const { return m_Width; } css::text::HorizontalAdjust GetAdj() const { return m_eAdjust; } SwTwips GetTopDist() const { return m_nTopDist; } SwTwips GetBottomDist() const { return m_nBottomDist; } @@ -70,7 +70,7 @@ public: void SetLineWidth(sal_uLong const nSet) { m_nLineWidth = nSet; } void SetLineStyle(SvxBorderLineStyle const eSet) {m_eLineStyle = eSet;} void SetLineColor(const Color& rCol) { m_LineColor = rCol;} - void SetWidth(const Fraction & rNew) { m_Width = rNew; } + void SetWidth(double rNew) { m_Width = rNew; } void SetAdj(css::text::HorizontalAdjust const eNew) { m_eAdjust = eNew; } void SetTopDist (SwTwips const nNew) { m_nTopDist = nNew; } void SetBottomDist(SwTwips const nNew) { m_nBottomDist = nNew; } diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index 9f9ce0b7e434..896b7687d1cc 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -701,7 +701,7 @@ SwPageFootnoteInfo::SwPageFootnoteInfo() : m_nMaxHeight( 0 ) , m_nLineWidth(10) , m_eLineStyle( SvxBorderLineStyle::SOLID ) - , m_Width( 25, 100 ) + , m_Width( 25.0 / 100 ) , m_nTopDist( 57 ) //1mm , m_nBottomDist( 57 ) { diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index b1f14d97c795..532c4f524164 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -9185,7 +9185,7 @@ void DocxAttributeOutput::FootnotesEndnotes( bool bFootnotes ) // Request separator only if both width and thickness are non-zero. bSeparator = rFootnoteInfo.GetLineStyle() != SvxBorderLineStyle::NONE && rFootnoteInfo.GetLineWidth() > 0 - && double(rFootnoteInfo.GetWidth()) > 0; + && rFootnoteInfo.GetWidth() > 0; nHeight = sw::FootnoteSeparatorHeight(m_rExport.m_rDoc, rFootnoteInfo); const IDocumentSettingAccess& rIDSA = m_rExport.m_rDoc.getIDocumentSettingAccess(); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index a7a3dd6c80e5..d27830ac2f90 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -468,7 +468,7 @@ void RtfExport::WriteFootnoteSettings() { const SwPageFootnoteInfo& rFootnoteInfo = m_rDoc.GetPageDesc(0).GetFootnoteInfo(); // Request a separator only in case the width is larger than zero. - bool bSeparator = double(rFootnoteInfo.GetWidth()) > 0; + bool bSeparator = rFootnoteInfo.GetWidth() > 0; Strm() .WriteChar('{') diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index f21554b3eb8a..8c9a8eb5e248 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -278,7 +278,7 @@ bool SwFootNotePage::FillItemSet(SfxItemSet *rSet) rFootnoteInfo.SetAdj(static_cast(m_xLinePosBox->get_active())); // Width - rFootnoteInfo.SetWidth(Fraction(m_xLineLengthEdit->get_value(FieldUnit::PERCENT), 100)); + rFootnoteInfo.SetWidth(double(m_xLineLengthEdit->get_value(FieldUnit::PERCENT)) / 100); const SfxPoolItem* pOldItem; if(nullptr == (pOldItem = GetOldItem( *rSet, FN_PARAM_FTN_INFO )) || diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx index 15865ff2cb57..011e44eec018 100644 --- a/sw/source/uibase/utlui/uiitems.cxx +++ b/sw/source/uibase/utlui/uiitems.cxx @@ -85,9 +85,8 @@ bool SwPageFootnoteInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const case MID_LINE_COLOR : rVal <<= m_aFootnoteInfo.GetLineColor();break; case MID_LINE_RELWIDTH : { - Fraction aTmp( 100, 1 ); - aTmp *= m_aFootnoteInfo.GetWidth(); - rVal <<= static_cast(static_cast(aTmp)); + auto nTmp = std::round(m_aFootnoteInfo.GetWidth() * 100); + rVal <<= static_cast(nTmp); } break; case MID_LINE_ADJUST : rVal <<= static_cast(m_aFootnoteInfo.GetAdj());break;//text::HorizontalAdjust @@ -156,7 +155,7 @@ bool SwPageFootnoteInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) if(nSet < 0) bRet = false; else - m_aFootnoteInfo.SetWidth(Fraction(nSet, 100)); + m_aFootnoteInfo.SetWidth(double(nSet) / 100); } break; case MID_LINE_ADJUST :