diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-24 21:55:10 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-25 09:13:12 +0100 |
commit | f2cd9c0c789b5825b4d5bb84b352d089e231e527 (patch) | |
tree | 95f6ecfaf25231ee4de3320995263780cd655792 /vcl | |
parent | e1cbd518118a5f2889213e5725e0e0a3c133de5d (diff) |
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: If173f42302553b164267909a0a3156bb25a6d558
Reviewed-on: https://gerrit.libreoffice.org/63957
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/field.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/field2.cxx | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 59220ac21258..7e70ddb554f6 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -152,7 +152,7 @@ bool ImplNumericGetValue( const OUString& rStr, sal_Int64& rValue, } } } - if ( !bNegative && bCurrency && !aStr.isEmpty() ) + if (!bNegative && !aStr.isEmpty()) { sal_uInt16 nFormat = rLocaleDataWrappper.getCurrNegativeFormat(); if ( (nFormat == 3) || (nFormat == 6) || // $1- || 1-$ diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 3413d5533082..cfef2ecdc002 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -368,11 +368,10 @@ static void ImplPatternProcessStrictModify( Edit* pEdit, const OUString& rLiteralMask, bool bSameMask ) { - sal_uInt16 nFormatFlags = 0; OUString aText = pEdit->GetText(); // remove leading blanks - if ( bSameMask && !(nFormatFlags & PATTERN_FORMAT_EMPTYLITERALS) && !rEditMask.isEmpty() ) + if (bSameMask && !rEditMask.isEmpty()) { sal_Int32 i = 0; sal_Int32 nMaxLen = aText.getLength(); @@ -390,7 +389,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit, aText = aText.copy( i ); } - OUString aNewText = ImplPatternReformat( aText, rEditMask, rLiteralMask, nFormatFlags ); + OUString aNewText = ImplPatternReformat(aText, rEditMask, rLiteralMask, 0); if ( aNewText != aText ) { // adjust selection such that it remains at the end if it was there before @@ -399,7 +398,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit, if ( nMaxSel >= aText.getLength() ) { sal_Int32 nMaxPos = aNewText.getLength(); - ImplPatternMaxPos( aNewText, rEditMask, nFormatFlags, bSameMask, nMaxSel, nMaxPos ); + ImplPatternMaxPos(aNewText, rEditMask, 0, bSameMask, nMaxSel, nMaxPos); if ( aSel.Min() == aSel.Max() ) { aSel.Min() = nMaxPos; @@ -1757,7 +1756,7 @@ bool DateField::EventNotify( NotifyEvent& rNEvt ) Reformat(); } } - else if ( !bTextLen && IsEmptyFieldValueEnabled() ) + else { ResetLastDate(); SetEmptyFieldValueData( true ); @@ -1859,7 +1858,7 @@ bool DateBox::EventNotify( NotifyEvent& rNEvt ) bool bTextLen = !GetText().isEmpty(); if ( bTextLen || !IsEmptyFieldValueEnabled() ) Reformat(); - else if ( !bTextLen && IsEmptyFieldValueEnabled() ) + else { ResetLastDate(); SetEmptyFieldValueData( true ); |