Fraction->double in SwPageFootnoteInfo
Change-Id: I2766a5a97538240af16c7e5fbf520e6f2f39b978 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202401 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
c30361f254
commit
bda2d1fb21
+3
-3
@@ -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; }
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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('{')
|
||||
|
||||
@@ -278,7 +278,7 @@ bool SwFootNotePage::FillItemSet(SfxItemSet *rSet)
|
||||
rFootnoteInfo.SetAdj(static_cast<css::text::HorizontalAdjust>(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 )) ||
|
||||
|
||||
@@ -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<sal_Int8>(static_cast<tools::Long>(aTmp));
|
||||
auto nTmp = std::round(m_aFootnoteInfo.GetWidth() * 100);
|
||||
rVal <<= static_cast<sal_Int8>(nTmp);
|
||||
}
|
||||
break;
|
||||
case MID_LINE_ADJUST : rVal <<= static_cast<sal_Int16>(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 :
|
||||
|
||||
Reference in New Issue
Block a user