From d36f7c5bd2115fcdd26ba8ff7b6a0446dea70bd4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 7 Apr 2018 11:45:13 +0200 Subject: Revert "long->sal_Int32 in tools/gen.hxx" This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0. As discussed at "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. "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 Reviewed-by: Stephan Bergmann --- vcl/source/control/field2.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'vcl/source/control/field2.cxx') diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index c57449aec148..dff8cee200b5 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -466,7 +466,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, sal_Unicode cChar = rKEvt.GetCharCode(); sal_uInt16 nKeyCode = aCode.GetCode(); bool bShift = aCode.IsShift(); - sal_Int32 nCursorPos = aOldSel.Max(); + sal_Int32 nCursorPos = static_cast(aOldSel.Max()); sal_Int32 nNewPos; sal_Int32 nTempPos; @@ -523,7 +523,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, // all was selected by the focus Selection aSel( aOldSel ); aSel.Justify(); - nCursorPos = aSel.Min(); + nCursorPos = static_cast(aSel.Min()); ImplPatternMaxPos( pEdit->GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos ); aSel.Max() = nNewPos; if ( bShift ) @@ -540,16 +540,16 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, Selection aSel = aOldSel; aSel.Justify(); - nNewPos = aSel.Min(); + nNewPos = static_cast(aSel.Min()); // if selection then delete it if ( aSel.Len() ) { if ( bSameMask ) - aStr.remove( aSel.Min(), aSel.Len() ); + aStr.remove( static_cast(aSel.Min()), static_cast(aSel.Len()) ); else { - OUString aRep = rLiteralMask.copy( aSel.Min(), aSel.Len() ); + OUString aRep = rLiteralMask.copy( static_cast(aSel.Min()), static_cast(aSel.Len()) ); aStr.remove( aSel.Min(), aRep.getLength() ); aStr.insert( aSel.Min(), aRep ); } @@ -1323,7 +1323,7 @@ void DateField::ImplDateSpinArea( bool bUp ) Selection aSelection = GetField()->GetSelection(); aSelection.Justify(); OUString aText( GetText() ); - if ( aSelection.Len() == aText.getLength() ) + if ( static_cast(aSelection.Len()) == aText.getLength() ) ImplDateIncrementDay( aDate, bUp ); else { @@ -1343,7 +1343,7 @@ void DateField::ImplDateSpinArea( bool bUp ) for ( sal_Int8 i = 1; i <= 3; i++ ) { nPos = aText.indexOf( aDateSep, nPos ); - if (nPos < 0 || nPos >= aSelection.Max()) + if (nPos < 0 || nPos >= static_cast(aSelection.Max())) { nDateArea = i; break; @@ -1584,7 +1584,7 @@ void DateFormatter::ImplNewFieldValue( const Date& rDate ) OUString aText = GetField()->GetText(); // If selected until the end then keep it that way - if ( aSelection.Max() == aText.getLength() ) + if ( static_cast(aSelection.Max()) == aText.getLength() ) { if ( !aSelection.Len() ) aSelection.Min() = SELECTION_MAX; @@ -2363,7 +2363,7 @@ void TimeFormatter::ImplNewFieldValue( const tools::Time& rTime ) OUString aText = GetField()->GetText(); // If selected until the end then keep it that way - if ( aSelection.Max() == aText.getLength() ) + if ( static_cast(aSelection.Max()) == aText.getLength() ) { if ( !aSelection.Len() ) aSelection.Min() = SELECTION_MAX; -- cgit