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 /reportdesign | |
parent | e92c0d6f9b7a6251e00dc55219a203a7e53c96e2 (diff) |
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 'reportdesign')
20 files changed, 70 insertions, 70 deletions
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx index d91e271277bc..6f2cfca0da64 100644 --- a/reportdesign/inc/RptObject.hxx +++ b/reportdesign/inc/RptObject.hxx @@ -148,7 +148,7 @@ protected: OCustomShape(const OUString& _sComponentName); virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE; - virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE; virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE; virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE; @@ -196,7 +196,7 @@ protected: virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE; - virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE; virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE; virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE; @@ -244,7 +244,7 @@ protected: virtual ~OUnoObject(); virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE; - virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE; virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE; virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE; diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 5c0d525dae60..0d76ae25bf80 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -538,7 +538,7 @@ void OCustomShape::NbcMove( const Size& rSize ) SdrObjCustomShape::NbcMove( rSize ); } -void OCustomShape::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract) +void OCustomShape::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract) { SdrObjCustomShape::NbcResize( rRef, xFract, yFract ); @@ -749,7 +749,7 @@ void OUnoObject::NbcMove( const Size& rSize ) -void OUnoObject::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract) +void OUnoObject::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract) { SdrUnoObj::NbcResize( rRef, xFract, yFract ); @@ -1050,7 +1050,7 @@ void OOle2Obj::NbcMove( const Size& rSize ) -void OOle2Obj::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract) +void OOle2Obj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract) { SdrOle2Obj::NbcResize( rRef, xFract, yFract ); diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx index 4c36ab743abe..2b219ea3ee63 100644 --- a/reportdesign/source/ui/inc/DesignView.hxx +++ b/reportdesign/source/ui/inc/DesignView.hxx @@ -257,7 +257,7 @@ namespace rptui /** zoom the ruler and view windows */ - void zoom(const boost::rational<long>& _aZoom); + void zoom(const Fraction& _aZoom); /** fills the vector with all selected control models /param _rSelection The vector will be filled and will not be cleared before. diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx index fec4e81de722..0af524b81b75 100644 --- a/reportdesign/source/ui/inc/ReportWindow.hxx +++ b/reportdesign/source/ui/inc/ReportWindow.hxx @@ -211,7 +211,7 @@ namespace rptui /** zoom the ruler and view windows */ - void zoom(const boost::rational<long>& _aZoom); + void zoom(const Fraction& _aZoom); /** fills the vector with all selected control models /param _rSelection The vector will be filled and will not be cleared before. diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx index 2caa45cabfb9..a8f214dbbeb2 100644 --- a/reportdesign/source/ui/inc/ScrollHelper.hxx +++ b/reportdesign/source/ui/inc/ScrollHelper.hxx @@ -202,7 +202,7 @@ namespace rptui /** zoom the ruler and view windows */ - void zoom(const boost::rational<long>& _aZoom); + void zoom(const Fraction& _aZoom); /** fills the vector with all selected control models /param _rSelection The vector will be filled and will not be cleared before. diff --git a/reportdesign/source/ui/inc/SectionWindow.hxx b/reportdesign/source/ui/inc/SectionWindow.hxx index e57769c3721d..ce8615862cee 100644 --- a/reportdesign/source/ui/inc/SectionWindow.hxx +++ b/reportdesign/source/ui/inc/SectionWindow.hxx @@ -120,7 +120,7 @@ namespace rptui /** zoom the ruler and view windows */ - void zoom(const boost::rational<long>& _aZoom); + void zoom(const Fraction& _aZoom); void scrollChildren(long _nThumbPosX); }; diff --git a/reportdesign/source/ui/inc/StartMarker.hxx b/reportdesign/source/ui/inc/StartMarker.hxx index 83d4d7aee857..9f85af132872 100644 --- a/reportdesign/source/ui/inc/StartMarker.hxx +++ b/reportdesign/source/ui/inc/StartMarker.hxx @@ -71,7 +71,7 @@ namespace rptui /** zoom the ruler and view windows */ - void zoom(const boost::rational<long>& _aZoom); + void zoom(const Fraction& _aZoom); }; } #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_STARTMARKER_HXX diff --git a/reportdesign/source/ui/inc/UITools.hxx b/reportdesign/source/ui/inc/UITools.hxx index facbd129a8c9..1471152e99a1 100644 --- a/reportdesign/source/ui/inc/UITools.hxx +++ b/reportdesign/source/ui/inc/UITools.hxx @@ -176,7 +176,7 @@ namespace rptui @param _aZoom the zoom scale @param _rWindow where to set the map mode */ - void setZoomFactor(const boost::rational<long>& _aZoom, ::vcl::Window& _rWindow); + void setZoomFactor(const Fraction& _aZoom, ::vcl::Window& _rWindow); } #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_UITOOLS_HXX diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx index 5fe5ab29fe98..fb8fff7cb894 100644 --- a/reportdesign/source/ui/inc/ViewsWindow.hxx +++ b/reportdesign/source/ui/inc/ViewsWindow.hxx @@ -331,7 +331,7 @@ namespace rptui /** zoom the ruler and view windows */ - void zoom(const boost::rational<long>& _aZoom); + void zoom(const Fraction& _aZoom); void scrollChildren(const Point& _aThumbPos); diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 2ca816ddede2..2a908306e23a 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -991,7 +991,7 @@ void correctOverlapping(SdrObject* _pControl,OReportSection& _aReportSection,boo rSectionView.InsertObjectAtView(_pControl,*rSectionView.GetSdrPageView(),SDRINSERT_ADDMARK); } -void setZoomFactor(const boost::rational<long>& _aZoom, vcl::Window& _rWindow) +void setZoomFactor(const Fraction& _aZoom, vcl::Window& _rWindow) { MapMode aMapMode( _rWindow.GetMapMode() ); aMapMode.SetScaleX(_aZoom); diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 853358ef6ccc..b9df2babf467 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -684,7 +684,7 @@ sal_uInt32 ODesignView::getMarkedObjectCount() const return m_aScrollWindow.getMarkedObjectCount(); } -void ODesignView::zoom(const boost::rational<long>& _aZoom) +void ODesignView::zoom(const Fraction& _aZoom) { m_aScrollWindow.zoom(_aZoom); } diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx index eacba6c64ffe..d9dc4cf7c891 100644 --- a/reportdesign/source/ui/report/EndMarker.cxx +++ b/reportdesign/source/ui/report/EndMarker.cxx @@ -45,9 +45,9 @@ OEndMarker::~OEndMarker() void OEndMarker::Paint( const Rectangle& /*rRect*/ ) { - boost::rational<long> aCornerSpace(long(CORNER_SPACE)); + Fraction aCornerSpace(long(CORNER_SPACE)); aCornerSpace *= GetMapMode().GetScaleX(); - const long nCornerSpace = boost::rational_cast<long>(aCornerSpace); + const long nCornerSpace = aCornerSpace; Size aSize = GetSizePixel(); aSize.Width() += nCornerSpace; diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index a68469bd0df1..b1b3f68e82ac 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -4171,7 +4171,7 @@ void OReportController::impl_fillState_nothrow(const OUString& _sProperty,dbaui: void OReportController::impl_zoom_nothrow() { - boost::rational<long> aZoom(m_nZoomValue,100); + Fraction aZoom(m_nZoomValue,100); setZoomFactor( aZoom,*getDesignView() ); getDesignView()->zoom(aZoom); InvalidateFeature(SID_ATTR_ZOOM,Reference< XStatusListener >(), true); diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 8a54f979f537..6b61162c42de 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -202,8 +202,8 @@ void OReportSection::fill() m_pView->SetGridFine(aGridSizeFine); // #i93595# set snap grid width to snap to all existing subdivisions - const boost::rational<long> aX(aGridSizeFine.A()); - const boost::rational<long> aY(aGridSizeFine.B()); + const Fraction aX(aGridSizeFine.A()); + const Fraction aY(aGridSizeFine.B()); m_pView->SetSnapGridWidth(aX, aY); m_pView->SetGridSnap( pDesignView->isGridSnap() ); diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 57afd5c0dcba..675f6ba6077e 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -141,11 +141,11 @@ void OReportWindow::showRuler(bool _bShow) sal_Int32 OReportWindow::getMaxMarkerWidth(bool _bWithEnd) const { - boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH)); + Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)); aStartWidth *= m_aViewsWindow.GetMapMode().GetScaleX(); if ( _bWithEnd ) - aStartWidth += boost::rational<long>(long(REPORT_ENDMARKER_WIDTH)); - return sal_Int32(boost::rational_cast<long>(aStartWidth)); + aStartWidth += Fraction(long(REPORT_ENDMARKER_WIDTH)); + return sal_Int32((long)aStartWidth); } sal_Int32 OReportWindow::GetTotalWidth() const @@ -153,14 +153,14 @@ sal_Int32 OReportWindow::GetTotalWidth() const sal_Int32 nWidth = 0; if ( !m_aViewsWindow.empty() ) { - boost::rational<long> aStartWidth(long(REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH )); - const boost::rational<long> aZoom(m_pView->getController().getZoomValue(),100); + Fraction aStartWidth(long(REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH )); + const Fraction aZoom(m_pView->getController().getZoomValue(),100); aStartWidth *= aZoom; const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_pView->getController().getReportDefinition(),PROPERTY_PAPERSIZE).Width; - boost::rational<long> aPaperWidth(nPaperWidth,1); + Fraction aPaperWidth(nPaperWidth,1); aPaperWidth *= aZoom; - const Size aPageSize = LogicToPixel(Size(boost::rational_cast<long>(aPaperWidth),0)); - nWidth = aPageSize.Width() + boost::rational_cast<long>(aStartWidth); + const Size aPageSize = LogicToPixel(Size(aPaperWidth,0)); + nWidth = aPageSize.Width() + long(aStartWidth); } return nWidth; } @@ -171,10 +171,10 @@ void OReportWindow::Resize() if ( !m_aViewsWindow.empty() ) { const Size aTotalOutputSize = GetOutputSizePixel(); - boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100); + Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100); const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 0 ), MAP_APPFONT ); - Point aStartPoint(boost::rational_cast<long>(aStartWidth) + aOffset.X(),0); + Point aStartPoint((long)aStartWidth + aOffset.X(),0); uno::Reference<report::XReportDefinition> xReportDefinition = getReportView()->getController().getReportDefinition(); const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width; sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN); @@ -372,7 +372,7 @@ sal_uInt32 OReportWindow::getMarkedObjectCount() const return m_aViewsWindow.getMarkedObjectCount(); } -void OReportWindow::zoom(const boost::rational<long>& _aZoom) +void OReportWindow::zoom(const Fraction& _aZoom) { m_aHRuler.SetZoom(_aZoom); m_aHRuler.Invalidate(); @@ -414,14 +414,14 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const break; case SVX_ZOOM_WHOLEPAGE: { - nZoom = (sal_uInt16) boost::rational_cast<long>( boost::rational<long>(aSize.Width() * 100, impl_getRealPixelWidth()) ); + nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); MapMode aMap( MAP_100TH_MM ); const Size aHeight = m_aViewsWindow.LogicToPixel(m_aViewsWindow.PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler.GetSizePixel().Height())),aMap); - nZoom = ::std::min(nZoom, (sal_uInt16) boost::rational_cast<long>( boost::rational<long>(aSize.Height() * 100, aHeight.Height()) )); + nZoom = ::std::min(nZoom,(sal_uInt16)(long)Fraction(aSize.Height()*100,aHeight.Height())); } break; case SVX_ZOOM_PAGEWIDTH: - nZoom = (sal_uInt16)boost::rational_cast<long>( boost::rational<long>(aSize.Width() * 100, this->impl_getRealPixelWidth()) ); + nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); break; default: break; diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index d8f1633d366b..453bd45a8355 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -101,8 +101,8 @@ void OScrollWindowHelper::setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight) m_aTotalPixelSize.Height() = _nHeight; // now set the ranges without start marker - boost::rational<long> aStartWidth(REPORT_STARTMARKER_WIDTH * m_pParent->getController().getZoomValue(),100); - long nWidth = long(_nWidth - boost::rational_cast<double>(aStartWidth)); + Fraction aStartWidth(REPORT_STARTMARKER_WIDTH * m_pParent->getController().getZoomValue(),100); + long nWidth = long(_nWidth - (double)aStartWidth); m_aHScroll.SetRangeMax( nWidth ); m_aVScroll.SetRangeMax( m_aTotalPixelSize.Height() ); @@ -163,9 +163,9 @@ Size OScrollWindowHelper::ResizeScrollBars() const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, SECTION_OFFSET ), MAP_APPFONT ); // resize scrollbars and set their ranges { - boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100); - const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - boost::rational_cast<long>(aStartWidth); - lcl_setScrollBar(nNewWidth,Point( boost::rational_cast<long>(aStartWidth) + aOffset.X(), aOutPixSz.Height() ),Size( nNewWidth, nScrSize ),m_aHScroll); + Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100); + const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - (long)aStartWidth; + lcl_setScrollBar(nNewWidth,Point( (long)aStartWidth + aOffset.X(), aOutPixSz.Height() ),Size( nNewWidth, nScrSize ),m_aHScroll); } { const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow.getRulerHeight(); @@ -383,7 +383,7 @@ sal_uInt32 OScrollWindowHelper::getMarkedObjectCount() const return m_aReportWindow.getMarkedObjectCount(); } -void OScrollWindowHelper::zoom(const boost::rational<long>& _aZoom) +void OScrollWindowHelper::zoom(const Fraction& _aZoom) { m_aReportWindow.zoom(_aZoom); Resize(); diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index 1d82b716cd5e..ef15b49d9b30 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -220,7 +220,7 @@ void OSectionWindow::Resize() Window::Resize(); Size aOutputSize = GetOutputSizePixel(); - boost::rational<long> aEndWidth(long(REPORT_ENDMARKER_WIDTH)); + Fraction aEndWidth(long(REPORT_ENDMARKER_WIDTH)); aEndWidth *= GetMapMode().GetScaleX(); const Point aThumbPos = m_pParent->getView()->getThumbPos(); @@ -236,33 +236,33 @@ void OSectionWindow::Resize() { const bool bShowEndMarker = m_pParent->getView()->GetTotalWidth() <= (aThumbPos.X() + aOutputSize.Width() ); - boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH)); + Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)); aStartWidth *= GetMapMode().GetScaleX(); // set start marker - m_aStartMarker.SetPosSizePixel(Point(0,0),Size(boost::rational_cast<long>(aStartWidth),aOutputSize.Height())); + m_aStartMarker.SetPosSizePixel(Point(0,0),Size(aStartWidth,aOutputSize.Height())); // set report section const uno::Reference< report::XSection> xSection = m_aReportSection.getSection(); Size aSectionSize = LogicToPixel( Size( 0,xSection->getHeight() ) ); - Point aReportPos(boost::rational_cast<long>(aStartWidth),0); - aSectionSize.Width() = aOutputSize.Width() - boost::rational_cast<long>(aStartWidth); + Point aReportPos(aStartWidth,0); + aSectionSize.Width() = aOutputSize.Width() - (long)aStartWidth; if ( bShowEndMarker ) - aSectionSize.Width() -= boost::rational_cast<long>(aEndWidth); + aSectionSize.Width() -= (long)aEndWidth; m_aReportSection.SetPosSizePixel(aReportPos,aSectionSize); // set splitter aReportPos.Y() += aSectionSize.Height(); m_aSplitter.SetPosSizePixel(aReportPos,Size(aSectionSize.Width(),m_aSplitter.GetSizePixel().Height())); - aSectionSize.Height() = (long)(1000 * boost::rational_cast<double>(this->GetMapMode().GetScaleY())); - m_aSplitter.SetDragRectPixel( Rectangle(Point(boost::rational_cast<long>(aStartWidth),0),aSectionSize)); + aSectionSize.Height() = (long)(1000 * (double)GetMapMode().GetScaleY()); + m_aSplitter.SetDragRectPixel( Rectangle(Point(aStartWidth,0),aSectionSize)); // set end marker aReportPos.X() += aSectionSize.Width(); aReportPos.Y() = 0; m_aEndMarker.Show(bShowEndMarker); - m_aEndMarker.SetPosSizePixel(aReportPos,Size(boost::rational_cast<long>(aEndWidth),aOutputSize.Height())); + m_aEndMarker.SetPosSizePixel(aReportPos,Size(aEndWidth,aOutputSize.Height())); } } @@ -299,7 +299,7 @@ IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker ) return 0L; } -void OSectionWindow::zoom(const boost::rational<long>& _aZoom) +void OSectionWindow::zoom(const Fraction& _aZoom) { setZoomFactor(_aZoom,*this); m_aStartMarker.zoom(_aZoom); diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index bc7fc19a6efd..a1a3f30944d2 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -89,9 +89,9 @@ OStartMarker::~OStartMarker() sal_Int32 OStartMarker::getMinHeight() const { - boost::rational<long> aExtraWidth(long(2*REPORT_EXTRA_SPACE)); + Fraction aExtraWidth(long(2*REPORT_EXTRA_SPACE)); aExtraWidth *= GetMapMode().GetScaleX(); - return LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() + boost::rational_cast<long>(aExtraWidth); + return LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() + (long)aExtraWidth; } void OStartMarker::Paint( const Rectangle& rRect ) @@ -99,7 +99,7 @@ void OStartMarker::Paint( const Rectangle& rRect ) (void)rRect; Size aSize = GetOutputSizePixel(); long nSize = aSize.Width(); - const long nCornerWidth = long(CORNER_SPACE * boost::rational_cast<double>(GetMapMode().GetScaleX())); + const long nCornerWidth = long(CORNER_SPACE * (double)GetMapMode().GetScaleX()); if ( isCollapsed() ) { @@ -134,7 +134,7 @@ void OStartMarker::Paint( const Rectangle& rRect ) } if ( m_bMarked ) { - const long nCornerHeight = long(CORNER_SPACE * boost::rational_cast<double>(GetMapMode().GetScaleY())); + const long nCornerHeight = long(CORNER_SPACE * (double)GetMapMode().GetScaleY()); Rectangle aRect( Point(nCornerWidth,nCornerHeight), Size(aSize.Width() - nCornerWidth - nCornerWidth,aSize.Height() - nCornerHeight - nCornerHeight)); ColorChanger aColors( this, COL_WHITE, COL_WHITE ); @@ -218,17 +218,17 @@ void OStartMarker::Resize() Size aImageSize = m_aImage.GetImage().GetSizePixel(); const MapMode& rMapMode = GetMapMode(); - aImageSize.Width() = long(aImageSize.Width() * boost::rational_cast<double>(rMapMode.GetScaleX())); - aImageSize.Height() = long(aImageSize.Height() * boost::rational_cast<double>(rMapMode.GetScaleY())); + aImageSize.Width() = long(aImageSize.Width() * (double)rMapMode.GetScaleX()); + aImageSize.Height() = long(aImageSize.Height() * (double)rMapMode.GetScaleY()); - boost::rational<long> aExtraWidth(long(REPORT_EXTRA_SPACE)); + Fraction aExtraWidth(long(REPORT_EXTRA_SPACE)); aExtraWidth *= rMapMode.GetScaleX(); - Point aPos(aImageSize.Width() + boost::rational_cast<long>((aExtraWidth + aExtraWidth)), boost::rational_cast<long>(aExtraWidth)); + Point aPos(aImageSize.Width() + (long)(aExtraWidth + aExtraWidth), aExtraWidth); const long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText.GetTextHeight())).Height()); m_aText.SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight)); - aPos.X() = boost::rational_cast<long>(aExtraWidth); + aPos.X() = aExtraWidth; aPos.Y() += static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ; m_aImage.SetPosSizePixel(aPos,aImageSize); } @@ -281,7 +281,7 @@ void OStartMarker::setCollapsed(bool _bCollapsed) changeImage(); } -void OStartMarker::zoom(const boost::rational<long>& _aZoom) +void OStartMarker::zoom(const Fraction& _aZoom) { setZoomFactor(_aZoom,*this); m_aVRuler.SetZoom(_aZoom); diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 8c0e49f4eb86..5fb908d71dee 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -206,7 +206,7 @@ void OViewsWindow::impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Poin aSectionSize.Height() = nMinHeight; } const StyleSettings& rSettings = GetSettings().GetStyleSettings(); - aSectionSize.Height() += (long)(rSettings.GetSplitSize() * boost::rational_cast<double>(_rSectionWindow.GetMapMode().GetScaleY())); + aSectionSize.Height() += (long)(rSettings.GetSplitSize() * (double)_rSectionWindow.GetMapMode().GetScaleY()); if ( _bSet ) _rSectionWindow.SetPosSizePixel(_rStartPoint,aSectionSize); @@ -263,13 +263,13 @@ void OViewsWindow::Paint( const Rectangle& rRect ) Window::Paint( rRect ); Size aOut = GetOutputSizePixel(); - boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH)); + Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)); aStartWidth *= GetMapMode().GetScaleX(); - aOut.Width() -= boost::rational_cast<long>(aStartWidth); + aOut.Width() -= (long)aStartWidth; aOut = PixelToLogic(aOut); - Rectangle aRect(PixelToLogic(Point(boost::rational_cast<long>(aStartWidth),0)),aOut); + Rectangle aRect(PixelToLogic(Point(aStartWidth,0)),aOut); Wallpaper aWall( m_aColorConfig.GetColorValue(::svtools::APPBACKGROUND).nColor ); DrawWallpaper(aRect,aWall); } @@ -1685,11 +1685,11 @@ void OViewsWindow::collapseSections(const uno::Sequence< beans::PropertyValue>& } } -void OViewsWindow::zoom(const boost::rational<long>& _aZoom) +void OViewsWindow::zoom(const Fraction& _aZoom) { const MapMode& aMapMode = GetMapMode(); - boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH)); + Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)); if ( _aZoom < aMapMode.GetScaleX() ) aStartWidth *= aMapMode.GetScaleX(); else @@ -1707,7 +1707,7 @@ void OViewsWindow::zoom(const boost::rational<long>& _aZoom) Resize(); Size aOut = GetOutputSizePixel(); - aOut.Width() = boost::rational_cast<long>(aStartWidth); + aOut.Width() = aStartWidth; aOut = PixelToLogic(aOut); Rectangle aRect(PixelToLogic(Point(0,0)),aOut); diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 33b12ae54a00..07067619fff9 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -78,10 +78,10 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) OScrollWindowHelper* pScrollWindow = pReportWindow->getScrollWindow(); Size aOut = pReportWindow->GetOutputSizePixel(); - boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH)); + Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)); aStartWidth *= m_pParent->GetMapMode().GetScaleX(); - aOut.Width() -= boost::rational_cast<long>(aStartWidth); + aOut.Width() -= (long)aStartWidth; aOut.Height() = m_pParent->GetOutputSizePixel().Height(); Point aPos = pScrollWindow->getThumbPos(); @@ -90,7 +90,7 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) Rectangle aOutRect( aPos, aOut ); aOutRect = m_pParent->PixelToLogic( aOutRect ); Rectangle aWorkArea(Point(), pScrollWindow->getTotalSize()); - aWorkArea.Right() -= boost::rational_cast<long>(aStartWidth); + aWorkArea.Right() -= (long)aStartWidth; aWorkArea = pScrollWindow->PixelToLogic( aWorkArea ); if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) ) { |