diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-12 09:32:02 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-12 16:53:22 +0100 |
commit | c45753847dfc2b4645dc2f7500a18ec2c5d438df (patch) | |
tree | 8d04962d7a4367a92d220beb0c35effb9490395b /reportdesign | |
parent | 768cfcee178b284be6d96d384364e59e40ecb375 (diff) |
Revert "remove Fraction::operator tools::Long()"
This reverts commit 48b667a7e7d25f835f95df89162a7849d6972531.
Reason for revert: some discussion required
Change-Id: Ia0990d280837fb68b7ddc9f472ec78b1467b4311
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105540
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/report/EndMarker.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportWindow.cxx | 14 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ScrollHelper.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/report/SectionWindow.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/report/StartMarker.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ViewsWindow.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/report/dlgedfunc.cxx | 4 |
7 files changed, 18 insertions, 18 deletions
diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx index a02047c4e6d4..ae79c968f12c 100644 --- a/reportdesign/source/ui/report/EndMarker.cxx +++ b/reportdesign/source/ui/report/EndMarker.cxx @@ -46,7 +46,7 @@ void OEndMarker::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangl { Fraction aCornerSpace(tools::Long(CORNER_SPACE)); aCornerSpace *= rRenderContext.GetMapMode().GetScaleX(); - const tools::Long nCornerSpace = sal_Int32(aCornerSpace); + const tools::Long nCornerSpace = tools::Long(aCornerSpace); Size aSize = GetSizePixel(); aSize.AdjustWidth(nCornerSpace ); diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 0fa3c3998486..ed6f614b5859 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -137,7 +137,7 @@ sal_Int32 OReportWindow::getMaxMarkerWidth() const { Fraction aStartWidth(tools::Long(REPORT_STARTMARKER_WIDTH)); aStartWidth *= m_aViewsWindow->GetMapMode().GetScaleX(); - return static_cast<sal_Int32>(aStartWidth); + return sal_Int32(static_cast<tools::Long>(aStartWidth)); } sal_Int32 OReportWindow::GetTotalWidth() const @@ -149,9 +149,9 @@ sal_Int32 OReportWindow::GetTotalWidth() const const Fraction aZoom(m_pView->getController().getZoomValue(),100); aStartWidth *= aZoom; sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_pView->getController().getReportDefinition(),PROPERTY_PAPERSIZE).Width; - nPaperWidth = sal_Int32(nPaperWidth * aZoom); + nPaperWidth = tools::Long(nPaperWidth * aZoom); const Size aPageSize = LogicToPixel(Size(nPaperWidth,0)); - nWidth = aPageSize.Width() + sal_Int32(aStartWidth); + nWidth = aPageSize.Width() + tools::Long(aStartWidth); } return nWidth; } @@ -166,7 +166,7 @@ void OReportWindow::Resize() Fraction aStartWidth(tools::Long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100); const Point aOffset = LogicToPixel(Point(SECTION_OFFSET, 0), MapMode(MapUnit::MapAppFont)); - Point aStartPoint(static_cast<sal_Int32>(aStartWidth) + aOffset.X(),0); + Point aStartPoint(static_cast<tools::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); @@ -404,14 +404,14 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const break; case SvxZoomType::WHOLEPAGE: { - nZoom = static_cast<sal_uInt16>(static_cast<sal_Int32>(Fraction(aSize.Width()*100,impl_getRealPixelWidth()))); + nZoom = static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction(aSize.Width()*100,impl_getRealPixelWidth()))); MapMode aMap( MapUnit::Map100thMM ); const Size aHeight = m_aViewsWindow->LogicToPixel(m_aViewsWindow->PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler->GetSizePixel().Height())),aMap); - nZoom = ::std::min(nZoom,static_cast<sal_uInt16>(static_cast<sal_Int32>(Fraction(aSize.Height()*100,aHeight.Height())))); + nZoom = ::std::min(nZoom,static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction(aSize.Height()*100,aHeight.Height())))); } break; case SvxZoomType::PAGEWIDTH: - nZoom = static_cast<sal_uInt16>(static_cast<sal_Int32>(Fraction(aSize.Width()*100,impl_getRealPixelWidth()))); + nZoom = static_cast<sal_uInt16>(static_cast<tools::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 06d0cecf7328..bb9691e8eabf 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -172,8 +172,8 @@ Size OScrollWindowHelper::ResizeScrollBars() // resize scrollbars and set their ranges { Fraction aStartWidth(tools::Long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100); - const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - static_cast<sal_Int32>(aStartWidth); - lcl_setScrollBar(nNewWidth,Point( static_cast<sal_Int32>(aStartWidth) + aOffset.X(), aOutPixSz.Height() ), Size( nNewWidth, nScrSize ), *m_aHScroll); + const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - static_cast<tools::Long>(aStartWidth); + lcl_setScrollBar(nNewWidth,Point( static_cast<tools::Long>(aStartWidth) + aOffset.X(), aOutPixSz.Height() ), Size( nNewWidth, nScrSize ), *m_aHScroll); } { const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow->getRulerHeight(); diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index aa13b1de5f62..8d05c77f4c00 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -227,7 +227,7 @@ void OSectionWindow::Resize() Window::Resize(); Size aOutputSize = GetOutputSizePixel(); - tools::Long nEndWidth = sal_Int32(REPORT_ENDMARKER_WIDTH * GetMapMode().GetScaleX()); + tools::Long nEndWidth = tools::Long(REPORT_ENDMARKER_WIDTH * GetMapMode().GetScaleX()); const Point aThumbPos = m_pParent->getView()->getThumbPos(); aOutputSize.AdjustWidth( -(aThumbPos.X()) ); @@ -242,7 +242,7 @@ void OSectionWindow::Resize() { const bool bShowEndMarker = m_pParent->getView()->GetTotalWidth() <= (aThumbPos.X() + aOutputSize.Width() ); - tools::Long nStartWidth = sal_Int32(REPORT_STARTMARKER_WIDTH * GetMapMode().GetScaleX()); + tools::Long nStartWidth = tools::Long(REPORT_STARTMARKER_WIDTH * GetMapMode().GetScaleX()); // set start marker m_aStartMarker->SetPosSizePixel(Point(0,0),Size(nStartWidth,aOutputSize.Height())); diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index 40d390cdbba6..fdc6ccbc4a63 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -101,7 +101,7 @@ sal_Int32 OStartMarker::getMinHeight() const { Fraction aExtraWidth(tools::Long(2 * REPORT_EXTRA_SPACE)); aExtraWidth *= GetMapMode().GetScaleX(); - return LogicToPixel(Size(0, m_aText->GetTextHeight())).Height() + sal_Int32(aExtraWidth); + return LogicToPixel(Size(0, m_aText->GetTextHeight())).Height() + tools::Long(aExtraWidth); } void OStartMarker::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/) @@ -236,7 +236,7 @@ void OStartMarker::Resize() aImageSize.setWidth( tools::Long(aImageSize.Width() * static_cast<double>(rMapMode.GetScaleX())) ); aImageSize.setHeight( tools::Long(aImageSize.Height() * static_cast<double>(rMapMode.GetScaleY())) ); - tools::Long nExtraWidth = sal_Int32(REPORT_EXTRA_SPACE * rMapMode.GetScaleX()); + tools::Long nExtraWidth = tools::Long(REPORT_EXTRA_SPACE * rMapMode.GetScaleX()); Point aPos(aImageSize.Width() + (nExtraWidth * 2), nExtraWidth); const tools::Long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText->GetTextHeight())).Height()); diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 9f24b8c1466a..2274e85ca529 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -257,7 +257,7 @@ void OViewsWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan rRenderContext.SetTextFillColor(Application::GetSettings().GetStyleSettings().GetDialogColor()); Size aOut(GetOutputSizePixel()); - tools::Long nStartWidth = sal_Int32(REPORT_STARTMARKER_WIDTH * rRenderContext.GetMapMode().GetScaleX()); + tools::Long nStartWidth = tools::Long(REPORT_STARTMARKER_WIDTH * rRenderContext.GetMapMode().GetScaleX()); aOut.AdjustWidth( -nStartWidth ); aOut = rRenderContext.PixelToLogic(aOut); @@ -1633,7 +1633,7 @@ void OViewsWindow::zoom(const Fraction& _aZoom) Resize(); Size aOut = GetOutputSizePixel(); - aOut.setWidth( sal_Int32(aStartWidth) ); + aOut.setWidth( tools::Long(aStartWidth) ); aOut = PixelToLogic(aOut); tools::Rectangle aRect(PixelToLogic(Point(0,0)),aOut); diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 47254b382acc..4e653cb87930 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -73,7 +73,7 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) Fraction aStartWidth(tools::Long(REPORT_STARTMARKER_WIDTH)); aStartWidth *= m_pParent->GetMapMode().GetScaleX(); - aOut.AdjustWidth( -static_cast<sal_Int32>(aStartWidth) ); + aOut.AdjustWidth( -static_cast<tools::Long>(aStartWidth) ); aOut.setHeight( m_pParent->GetOutputSizePixel().Height() ); Point aPos = pScrollWindow->getThumbPos(); @@ -82,7 +82,7 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) tools::Rectangle aOutRect( aPos, aOut ); aOutRect = m_pParent->PixelToLogic( aOutRect ); tools::Rectangle aWorkArea(Point(), pScrollWindow->getTotalSize()); - aWorkArea.AdjustRight( -static_cast<sal_Int32>(aStartWidth) ); + aWorkArea.AdjustRight( -static_cast<tools::Long>(aStartWidth) ); aWorkArea = pScrollWindow->PixelToLogic( aWorkArea ); if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) ) { |