summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-11 21:59:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-12 07:37:13 +0100
commit48b667a7e7d25f835f95df89162a7849d6972531 (patch)
tree50d900c95e6b2ae6bac6919a350ca3a2fd71c943 /reportdesign
parent693553210828538680408832157faad9654758c8 (diff)
remove Fraction::operator tools::Long()
which was added in commit 331e2e5ed3bf4e0b2c1fab3b7bca836170317827 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Sep 14 08:49:52 2017 +0200 long->sal_Int32 in Fraction presumably to make the change impact less code. Instead, update the call sites to reflect the actual bitwidth of the data we will be receiving. Change-Id: If2a678b1cf534f39cb8cb249757462be53658309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105607 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/ui/report/EndMarker.cxx2
-rw-r--r--reportdesign/source/ui/report/ReportWindow.cxx14
-rw-r--r--reportdesign/source/ui/report/ScrollHelper.cxx4
-rw-r--r--reportdesign/source/ui/report/SectionWindow.cxx4
-rw-r--r--reportdesign/source/ui/report/StartMarker.cxx4
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx4
-rw-r--r--reportdesign/source/ui/report/dlgedfunc.cxx4
7 files changed, 18 insertions, 18 deletions
diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx
index ae79c968f12c..a02047c4e6d4 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 = tools::Long(aCornerSpace);
+ const tools::Long nCornerSpace = sal_Int32(aCornerSpace);
Size aSize = GetSizePixel();
aSize.AdjustWidth(nCornerSpace );
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
index ed6f614b5859..0fa3c3998486 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 sal_Int32(static_cast<tools::Long>(aStartWidth));
+ return static_cast<sal_Int32>(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 = tools::Long(nPaperWidth * aZoom);
+ nPaperWidth = sal_Int32(nPaperWidth * aZoom);
const Size aPageSize = LogicToPixel(Size(nPaperWidth,0));
- nWidth = aPageSize.Width() + tools::Long(aStartWidth);
+ nWidth = aPageSize.Width() + sal_Int32(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<tools::Long>(aStartWidth) + aOffset.X(),0);
+ Point aStartPoint(static_cast<sal_Int32>(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<tools::Long>(Fraction(aSize.Width()*100,impl_getRealPixelWidth())));
+ nZoom = static_cast<sal_uInt16>(static_cast<sal_Int32>(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<tools::Long>(Fraction(aSize.Height()*100,aHeight.Height()))));
+ nZoom = ::std::min(nZoom,static_cast<sal_uInt16>(static_cast<sal_Int32>(Fraction(aSize.Height()*100,aHeight.Height()))));
}
break;
case SvxZoomType::PAGEWIDTH:
- nZoom = static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction(aSize.Width()*100,impl_getRealPixelWidth())));
+ nZoom = static_cast<sal_uInt16>(static_cast<sal_Int32>(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 bb9691e8eabf..06d0cecf7328 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<tools::Long>(aStartWidth);
- lcl_setScrollBar(nNewWidth,Point( static_cast<tools::Long>(aStartWidth) + aOffset.X(), aOutPixSz.Height() ), Size( nNewWidth, nScrSize ), *m_aHScroll);
+ 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 nNewHeight = aOutPixSz.Height() - m_aReportWindow->getRulerHeight();
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index 8d05c77f4c00..aa13b1de5f62 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 = tools::Long(REPORT_ENDMARKER_WIDTH * GetMapMode().GetScaleX());
+ tools::Long nEndWidth = sal_Int32(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 = tools::Long(REPORT_STARTMARKER_WIDTH * GetMapMode().GetScaleX());
+ tools::Long nStartWidth = sal_Int32(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 fdc6ccbc4a63..40d390cdbba6 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() + tools::Long(aExtraWidth);
+ return LogicToPixel(Size(0, m_aText->GetTextHeight())).Height() + sal_Int32(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 = tools::Long(REPORT_EXTRA_SPACE * rMapMode.GetScaleX());
+ tools::Long nExtraWidth = sal_Int32(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 2274e85ca529..9f24b8c1466a 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 = tools::Long(REPORT_STARTMARKER_WIDTH * rRenderContext.GetMapMode().GetScaleX());
+ tools::Long nStartWidth = sal_Int32(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( tools::Long(aStartWidth) );
+ aOut.setWidth( sal_Int32(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 4e653cb87930..47254b382acc 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<tools::Long>(aStartWidth) );
+ aOut.AdjustWidth( -static_cast<sal_Int32>(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<tools::Long>(aStartWidth) );
+ aWorkArea.AdjustRight( -static_cast<sal_Int32>(aStartWidth) );
aWorkArea = pScrollWindow->PixelToLogic( aWorkArea );
if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) )
{