diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-10-23 17:41:47 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-10-23 18:34:39 +0200 |
commit | 31af61ea091cc895b893c849f2130aa35792b7db (patch) | |
tree | 6c7b63c5b538034bd5d356c5a8667b7e95d59b9c /cui | |
parent | Fraction: Revert "-Werror,-Wliteral-conversion (implicit conversion from doub... (diff) | |
download | core-31af61ea091cc895b893c849f2130aa35792b7db.tar.gz core-31af61ea091cc895b893c849f2130aa35792b7db.zip |
Fraction: Revert "fdo#81356: convert Fraction to boost::rational<long> - wip"
This reverts commit 47a2d7642d249d70b5da0c330a73f3a0032e4bba.
Conflicts:
cui/source/tabpages/transfrm.cxx
svx/source/svdraw/svdedtv1.cxx
svx/source/svdraw/svdibrow.cxx
sw/source/filter/ww1/w1filter.cxx
tools/source/generic/rational.cxx
Change-Id: I4849916f5f277a4afef0e279b0135c76b36b9d15
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/grfpage.cxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 30 |
2 files changed, 17 insertions, 17 deletions
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 0c7e7bcb7763..c1318d55381e 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -812,8 +812,8 @@ void SvxCropExample::SetFrameSize( const Size& rSz ) if(!aFrameSize.Height()) aFrameSize.Height() = 1; Size aWinSize( GetOutputSizePixel() ); - boost::rational<long> aXScale( aWinSize.Width() * 4, aFrameSize.Width() * 5 ); - boost::rational<long> aYScale( aWinSize.Height() * 4, aFrameSize.Height() * 5 ); + Fraction aXScale( aWinSize.Width() * 4, aFrameSize.Width() * 5 ); + Fraction aYScale( aWinSize.Height() * 4, aFrameSize.Height() * 5 ); if( aYScale < aXScale ) aXScale = aYScale; diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 5afb6c185e28..54fd77472801 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -90,9 +90,9 @@ static void lcl_ConvertRect(basegfx::B2DRange& rRange, const sal_uInt16 nDigits, rRange = basegfx::B2DRange(aTopLeft, aBottomRight); } -static void lcl_ScaleRect(basegfx::B2DRange& rRange, const boost::rational<long> aUIScale) +static void lcl_ScaleRect(basegfx::B2DRange& rRange, const Fraction aUIScale) { - const double fFactor(1.0 / boost::rational_cast<double>(aUIScale)); + const double fFactor(1.0 / double(aUIScale)); rRange = basegfx::B2DRange(rRange.getMinimum() * fFactor, rRange.getMaximum() * fFactor); } @@ -254,7 +254,7 @@ void SvxAngleTabPage::Construct() } // take scale into account - const boost::rational<long> aUIScale = pView->GetModel()->GetUIScale(); + const Fraction aUIScale(pView->GetModel()->GetUIScale()); lcl_ScaleRect(maRange, aUIScale); // take UI units into account @@ -274,7 +274,7 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet) if(m_pCtlAngle->IsValueModified() || m_pMtrPosX->IsValueModified() || m_pMtrPosY->IsValueModified()) { - const double fUIScale(boost::rational_cast<double>(this->pView->GetModel()->GetUIScale())); + const double fUIScale(double(pView->GetModel()->GetUIScale())); const double fTmpX((GetCoreValue(*m_pMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale); const double fTmpY((GetCoreValue(*m_pMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale); @@ -292,7 +292,7 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet) void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs) { - const double fUIScale(boost::rational_cast<double>(this->pView->GetModel()->GetUIScale())); + const double fUIScale(double(pView->GetModel()->GetUIScale())); const SfxPoolItem* pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ROT_X ); if(pItem) @@ -475,9 +475,9 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs) if( m_pMtrRadius->IsValueChangedFromSaved() ) { - boost::rational<long> aUIScale = pView->GetModel()->GetUIScale(); + Fraction aUIScale = pView->GetModel()->GetUIScale(); long nTmp = GetCoreValue( *m_pMtrRadius, ePoolUnit ); - nTmp = boost::rational_cast<long>(nTmp * aUIScale); + nTmp = Fraction( nTmp ) * aUIScale; rAttrs->Put( makeSdrEckenradiusItem( nTmp ) ); bModified = true; @@ -527,8 +527,8 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) if( pItem ) { - const double fUIScale(boost::rational_cast<double>(this->pView->GetModel()->GetUIScale())); - const double fTmp((double)static_cast<const SdrMetricItem*>(pItem)->GetValue() / fUIScale); + const double fUIScale(double(pView->GetModel()->GetUIScale())); + const double fTmp((double)((const SdrMetricItem*)pItem)->GetValue() / fUIScale); SetMetricValue(*m_pMtrRadius, basegfx::fround(fTmp), ePoolUnit); } else @@ -758,7 +758,7 @@ void SvxPositionSizeTabPage::Construct() } // take scale into account - const boost::rational<long> aUIScale = mpView->GetModel()->GetUIScale(); + const Fraction aUIScale(mpView->GetModel()->GetUIScale()); lcl_ScaleRect( maWorkRange, aUIScale ); lcl_ScaleRect( maRange, aUIScale ); @@ -790,7 +790,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) { if ( m_pMtrPosX->IsValueModified() || m_pMtrPosY->IsValueModified() ) { - const double fUIScale(boost::rational_cast<double>(this->mpView->GetModel()->GetUIScale())); + const double fUIScale(double(mpView->GetModel()->GetUIScale())); double fX((GetCoreValue( *m_pMtrPosX, mePoolUnit ) + maAnchor.getX()) * fUIScale); double fY((GetCoreValue( *m_pMtrPosY, mePoolUnit ) + maAnchor.getY()) * fUIScale); @@ -828,19 +828,19 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) if ( m_pMtrWidth->IsValueModified() || m_pMtrHeight->IsValueModified() ) { - boost::rational<long> aUIScale = mpView->GetModel()->GetUIScale(); + Fraction aUIScale = mpView->GetModel()->GetUIScale(); // get Width double nWidth = static_cast<double>(m_pMtrWidth->GetValue( meDlgUnit )); nWidth = MetricField::ConvertDoubleValue( nWidth, m_pMtrWidth->GetBaseValue(), m_pMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM ); - long lWidth = long(nWidth * boost::rational_cast<double>(aUIScale)); + long lWidth = long(nWidth * (double)aUIScale); lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit ); lWidth = static_cast<long>(m_pMtrWidth->Denormalize( lWidth )); // get Height double nHeight = static_cast<double>(m_pMtrHeight->GetValue( meDlgUnit )); nHeight = MetricField::ConvertDoubleValue( nHeight, m_pMtrHeight->GetBaseValue(), m_pMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM ); - long lHeight = long(nHeight * boost::rational_cast<double>(aUIScale)); + long lHeight = long(nHeight * (double)aUIScale); lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit ); lHeight = static_cast<long>(m_pMtrHeight->Denormalize( lHeight )); @@ -899,7 +899,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) void SvxPositionSizeTabPage::Reset( const SfxItemSet* ) { const SfxPoolItem* pItem; - const double fUIScale(boost::rational_cast<double>(this->mpView->GetModel()->GetUIScale())); + const double fUIScale(double(mpView->GetModel()->GetUIScale())); if ( !mbPageDisabled ) { |