diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-04-07 11:45:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-04-07 14:13:18 +0200 |
commit | d36f7c5bd2115fcdd26ba8ff7b6a0446dea70bd4 (patch) | |
tree | 5ae4b15f3302a538ac55d714ba0529ca4c1de87a /svtools/source/brwbox | |
parent | 61d57bcebd1a246603cbcd9ad5e0a7df1a8d66cd (diff) |
Revert "long->sal_Int32 in tools/gen.hxx"
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0.
As discussed at
<https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html>
"long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with
signed integer overflow, and the original plan was to redo it to consistently
use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/>
"sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed
miserably on Windows, causing odd failures like not writing out Pictures/*.svm
streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best
approach is to just revert the original commit, at least for now.
Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix
Library_vclplug_qt5".
Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae
Reviewed-on: https://gerrit.libreoffice.org/52532
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svtools/source/brwbox')
-rw-r--r-- | svtools/source/brwbox/brwbox1.cxx | 4 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 8 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox3.cxx | 2 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.cxx | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 3f3f1d600c85..ee4326154038 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -2034,8 +2034,8 @@ tools::Rectangle BrowseBox::ImplFieldRectPixel( long nRow, sal_uInt16 nColumnId // assemble the Rectangle relative to DataWin return tools::Rectangle( Point( nColX + MIN_COLUMNWIDTH, nRowY ), - Size( (pCols[nCol]->Width() == RECT_MAX - ? RECT_MAX - (nColX + MIN_COLUMNWIDTH) : pCols[ nCol ]->Width() - 2*MIN_COLUMNWIDTH), + Size( (pCols[nCol]->Width() == LONG_MAX + ? LONG_MAX - (nColX + MIN_COLUMNWIDTH) : pCols[ nCol ]->Width() - 2*MIN_COLUMNWIDTH), GetDataRowHeight() - 1 ) ); } diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index a26159073aac..89c3babea3c7 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -941,7 +941,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec if (nY <= aOverallAreaBRPos.Y()) _rOut.DrawLine( Point( nHLineX, nY ), Point( bVLines - ? std::min<sal_Int32>(aPos.X() - 1, aOverallAreaBRPos.X()) + ? std::min(long(aPos.X() - 1), aOverallAreaBRPos.X()) : aOverallAreaBRPos.X(), nY ) ); _rOut.Pop(); @@ -1357,7 +1357,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt ) // event occurred out of data area if ( rEvt.IsRight() ) pDataWin->Command( - CommandEvent( Point( 1, RECT_MAX ), CommandEventId::ContextMenu, true ) ); + CommandEvent( Point( 1, LONG_MAX ), CommandEventId::ContextMenu, true ) ); else SetNoSelection(); } @@ -1392,7 +1392,7 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt ) pDataWin->HideTracking() ; // check allowed width and new delta - nDragX = std::max<sal_Int32>( rEvt.GetPosPixel().X(), nMinResizeX ); + nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX ); long nDeltaX = nDragX - nResizeX; sal_uInt16 nId = GetColumnId(nResizeCol); sal_uLong nOldWidth = GetColumnWidth(nId); @@ -1422,7 +1422,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt ) pDataWin->HideTracking(); // width changed? - nDragX = std::max<sal_Int32>( rEvt.GetPosPixel().X(), nMinResizeX ); + nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX ); if ( (nDragX - nResizeX) != static_cast<long>(pCols[ nResizeCol ]->Width()) ) { // resize column diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx index 12a4772af1cf..e43f634e36bd 100644 --- a/svtools/source/brwbox/brwbox3.cxx +++ b/svtools/source/brwbox/brwbox3.cxx @@ -507,7 +507,7 @@ void BrowseBox::GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumn { const Range& rRange = pColumnSel->GetRange( nRange ); // loop has to include aRange.Max() - for( sal_Int32 nCol = rRange.Min(); nCol <= rRange.Max(); ++nCol ) + for( sal_Int32 nCol = rRange.Min(); nCol <= static_cast<sal_Int32>(rRange.Max()); ++nCol ) { DBG_ASSERT( nIndex < nCount, "GetAllSelectedColumns - range overflow" ); diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx index 4598b9f8af3c..881396dfa853 100644 --- a/svtools/source/brwbox/datwin.cxx +++ b/svtools/source/brwbox/datwin.cxx @@ -153,7 +153,7 @@ void BrowserColumn::Draw( BrowseBox const & rBox, OutputDevice& rDev, const Poin else { // paint data column - long nWidth = Width() == RECT_MAX ? rBox.GetDataWindow().GetSizePixel().Width() : Width(); + long nWidth = Width() == LONG_MAX ? rBox.GetDataWindow().GetSizePixel().Width() : Width(); rBox.DoPaintField( rDev, tools::Rectangle( |