summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-07 11:45:13 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-04-07 14:13:18 +0200
commitd36f7c5bd2115fcdd26ba8ff7b6a0446dea70bd4 (patch)
tree5ae4b15f3302a538ac55d714ba0529ca4c1de87a /svtools/source
parent61d57bcebd1a246603cbcd9ad5e0a7df1a8d66cd (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')
-rw-r--r--svtools/source/brwbox/brwbox1.cxx4
-rw-r--r--svtools/source/brwbox/brwbox2.cxx8
-rw-r--r--svtools/source/brwbox/brwbox3.cxx2
-rw-r--r--svtools/source/brwbox/datwin.cxx2
-rw-r--r--svtools/source/contnr/imivctl.hxx4
-rw-r--r--svtools/source/contnr/imivctl1.cxx10
-rw-r--r--svtools/source/contnr/treelistbox.cxx2
-rw-r--r--svtools/source/control/ctrlbox.cxx2
-rw-r--r--svtools/source/control/scriptedtext.cxx6
-rw-r--r--svtools/source/control/toolbarmenu.cxx6
-rw-r--r--svtools/source/control/valueset.cxx2
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx2
-rw-r--r--svtools/source/misc/imap2.cxx8
-rw-r--r--svtools/source/svhtml/htmlout.cxx20
14 files changed, 39 insertions, 39 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(
diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx
index df71c7bcabad..12e574e345f9 100644
--- a/svtools/source/contnr/imivctl.hxx
+++ b/svtools/source/contnr/imivctl.hxx
@@ -386,10 +386,10 @@ public:
const tools::Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* );
void InvalidateBoundingRect( tools::Rectangle& rRect )
{
- rRect.SetRight(RECT_MAX);
+ rRect.SetRight(LONG_MAX);
bBoundRectsDirty = true;
}
- static bool IsBoundingRectValid( const tools::Rectangle& rRect ) { return ( rRect.Right() != RECT_MAX ); }
+ static bool IsBoundingRectValid( const tools::Rectangle& rRect ) { return ( rRect.Right() != LONG_MAX ); }
void PaintEmphasis(const tools::Rectangle& rRect1, bool bSelected,
bool bDropTarget, bool bCursored, vcl::RenderContext& rRenderContext );
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 059948681d62..48c65c97deb6 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -289,7 +289,7 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, size_t
// If the UpdateMode is true, don't set all bounding rectangles to
// 'to be checked', but only the bounding rectangle of the new entry.
// Thus, don't call InvalidateBoundingRect!
- pEntry->aRect.SetRight( RECT_MAX );
+ pEntry->aRect.SetRight( LONG_MAX );
if( bUpdateMode )
{
FindBoundingRect( pEntry );
@@ -1859,7 +1859,7 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingWidth() const
switch( nWinBits & VIEWMODE_MASK )
{
case WB_ICON:
- nWidth = std::max<sal_Int32>( nStringWidth, aImageSize.Width() );
+ nWidth = std::max( nStringWidth, aImageSize.Width() );
break;
case WB_SMALLICON:
@@ -1887,7 +1887,7 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingHeight() const
case WB_SMALLICON:
case WB_DETAILS:
- nHeight = std::max<sal_Int32>( aImageSize.Height(), nStringHeight );
+ nHeight = std::max( aImageSize.Height(), nStringHeight );
break;
}
if( nHeight > nMaxBoundHeight )
@@ -2349,7 +2349,7 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcMaxTextRect( const SvxIconChoiceCtr
if( aBoundRect.Left() > aBoundRect.Right())
aBoundRect.SetLeft( aBoundRect.Right() );
if( pEntry->GetTextMode() == SvxIconChoiceCtrlTextMode::Full )
- aBoundRect.SetBottom( RECT_MAX );
+ aBoundRect.SetBottom( LONG_MAX );
}
else
{
@@ -3267,7 +3267,7 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )
return false;
tools::Rectangle aOptTextRect( aTextRect );
- aOptTextRect.SetBottom( RECT_MAX );
+ aOptTextRect.SetBottom( LONG_MAX );
DrawTextFlags nNewFlags = nCurTextDrawFlags;
nNewFlags &= ~DrawTextFlags( DrawTextFlags::Clip | DrawTextFlags::EndEllipsis );
aOptTextRect = pView->GetTextRect( aOptTextRect, aEntryText, nNewFlags );
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index c8771a383b25..49ac834eecac 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3159,7 +3159,7 @@ Size SvTreeListBox::GetOptimalSize() const
aRet.AdjustHeight(rStyleSettings.GetBorderSize() * 2 );
}
long nMinWidth = nMinWidthInChars * approximate_char_width();
- aRet.setWidth( std::max<sal_Int32>(aRet.Width(), nMinWidth) );
+ aRet.setWidth( std::max(aRet.Width(), nMinWidth) );
return aRet;
}
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 918b6984845e..82cd893e9710 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -415,7 +415,7 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance,
//line within that
long nMinWidth = GetTextWidth("----------");
Size aSize = CalcSubEditSize();
- aSize.setWidth( std::max<sal_Int32>(nMinWidth, aSize.Width()) );
+ aSize.setWidth( std::max(nMinWidth, aSize.Width()) );
aSize.AdjustWidth( -(aTxtSize.Width()) );
aSize.AdjustWidth( -6 );
aSize.setHeight( aTxtSize.Height() );
diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx
index 9b3eb3e95749..16b90aedd764 100644
--- a/svtools/source/control/scriptedtext.cxx
+++ b/svtools/source/control/scriptedtext.cxx
@@ -138,11 +138,11 @@ void SvtScriptedTextHelper_Impl::CalculateSizes()
// calculate maximum font height
SetOutDevFont( i18n::ScriptType::LATIN );
- maTextSize.setHeight( std::max<sal_Int32>( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
+ maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
SetOutDevFont( i18n::ScriptType::ASIAN );
- maTextSize.setHeight( std::max<sal_Int32>( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
+ maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
SetOutDevFont( i18n::ScriptType::COMPLEX );
- maTextSize.setHeight( std::max<sal_Int32>( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
+ maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
mrOutDevice.Pop();
}
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index 048208233b97..dd94ed5fd8f3 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -541,7 +541,7 @@ static long ImplGetNativeCheckAndRadioSize(vcl::RenderContext const & rRenderCon
)
{
rRadioHeight = aNativeBounds.GetHeight();
- rMaxWidth = std::max<sal_Int32>(rMaxWidth, aNativeContent.GetWidth());
+ rMaxWidth = std::max (rMaxWidth, aNativeContent.GetWidth());
}
}
return std::max(rCheckHeight, rRadioHeight);
@@ -570,7 +570,7 @@ Size ToolbarMenu::implCalcSize()
if( pEntry && pEntry->mbHasImage )
{
Size aImgSz( pEntry->maImage.GetSizePixel() );
- nMinMenuItemHeight = std::max<sal_Int32>( nMinMenuItemHeight, aImgSz.Height() + 6 );
+ nMinMenuItemHeight = std::max( nMinMenuItemHeight, aImgSz.Height() + 6 );
aMaxImgSz.setWidth( std::max( aMaxImgSz.Width(), aImgSz.Width() ) );
}
}
@@ -604,7 +604,7 @@ Size ToolbarMenu::implCalcSize()
{
Size aControlSize( pEntry->mpControl->GetOutputSizePixel() );
- nMaxTextWidth = std::max<sal_Int32>( aControlSize.Width(), nMaxTextWidth );
+ nMaxTextWidth = std::max( aControlSize.Width(), nMaxTextWidth );
pEntry->maSize.setHeight( aControlSize.Height() + 1 );
}
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 85823fd25e5b..54d7e3bbbf02 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -2244,7 +2244,7 @@ Size ValueSet::GetLargestItemSize()
{
aSize.AdjustHeight(3 * NAME_LINE_HEIGHT +
maVirDev->GetTextHeight() );
- aSize.setWidth( std::max<sal_Int32>(aSize.Width(),
+ aSize.setWidth( std::max(aSize.Width(),
maVirDev->GetTextWidth(pItem->maText) + NAME_OFFSET) );
}
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index a576181f1f12..2ea05073f492 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -566,7 +566,7 @@ void AssignmentPersistentData::ImplCommit()
long nListBoxWidth = m_pImpl->pFields[0]->approximate_char_width() * 20;
for (auto const& fieldLabel : m_pImpl->aFieldLabels)
{
- nLabelWidth = std::max<sal_Int32>(nLabelWidth, FixedText::getTextDimensions(m_pImpl->pFieldLabels[0], fieldLabel, 0x7FFFFFFF).Width());
+ nLabelWidth = std::max(nLabelWidth, FixedText::getTextDimensions(m_pImpl->pFieldLabels[0], fieldLabel, 0x7FFFFFFF).Width());
}
for (sal_Int32 row=0; row<FIELD_PAIRS_VISIBLE; ++row)
{
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index d8a6f5a9e312..e1424f5d47b4 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -42,9 +42,9 @@ void IMapObject::AppendCERNCoords(OStringBuffer& rBuf, const Point& rPoint100)
const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MapUnit::Map100thMM ) ) );
rBuf.append('(');
- rBuf.append(aPixPt.X());
+ rBuf.append(static_cast<sal_Int32>(aPixPt.X()));
rBuf.append(',');
- rBuf.append(aPixPt.Y());
+ rBuf.append(static_cast<sal_Int32>(aPixPt.Y()));
rBuf.append(") ");
}
@@ -52,9 +52,9 @@ void IMapObject::AppendNCSACoords(OStringBuffer& rBuf, const Point& rPoint100)
{
const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MapUnit::Map100thMM ) ) );
- rBuf.append(aPixPt.X());
+ rBuf.append(static_cast<sal_Int32>(aPixPt.X()));
rBuf.append(',');
- rBuf.append(aPixPt.Y());
+ rBuf.append(static_cast<sal_Int32>(aPixPt.Y()));
rBuf.append(' ');
}
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 8253334243c9..8ee63d19b757 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -647,13 +647,13 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
tools::Rectangle aRect( pRectObj->GetRectangle() );
aCoords = OStringBuffer()
- .append(aRect.Left())
+ .append(static_cast<sal_Int32>(aRect.Left()))
.append(',')
- .append(aRect.Top())
+ .append(static_cast<sal_Int32>(aRect.Top()))
.append(',')
- .append(aRect.Right())
+ .append(static_cast<sal_Int32>(aRect.Right()))
.append(',')
- .append(aRect.Bottom())
+ .append(static_cast<sal_Int32>(aRect.Bottom()))
.makeStringAndClear();
}
break;
@@ -666,9 +666,9 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
long nOff = pCirc->GetRadius();
aCoords = OStringBuffer()
- .append(aCenter.X())
+ .append(static_cast<sal_Int32>(aCenter.X()))
.append(',')
- .append(aCenter.Y())
+ .append(static_cast<sal_Int32>(aCenter.Y()))
.append(',')
.append(static_cast<sal_Int32>(nOff))
.makeStringAndClear();
@@ -685,17 +685,17 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
if( nCount>0 )
{
const Point& rPoint = aPoly[0];
- aTmpBuf.append(rPoint.X())
+ aTmpBuf.append(static_cast<sal_Int32>(rPoint.X()))
.append(',')
- .append(rPoint.Y());
+ .append(static_cast<sal_Int32>(rPoint.Y()));
}
for( sal_uInt16 j=1; j<nCount; j++ )
{
const Point& rPoint = aPoly[j];
aTmpBuf.append(',')
- .append(rPoint.X())
+ .append(static_cast<sal_Int32>(rPoint.X()))
.append(',')
- .append(rPoint.Y());
+ .append(static_cast<sal_Int32>(rPoint.Y()));
}
aCoords = aTmpBuf.makeStringAndClear();
}