summaryrefslogtreecommitdiff
path: root/vcl/source/control/field2.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-24 21:55:10 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-25 09:13:12 +0100
commitf2cd9c0c789b5825b4d5bb84b352d089e231e527 (patch)
tree95f6ecfaf25231ee4de3320995263780cd655792 /vcl/source/control/field2.cxx
parente1cbd518118a5f2889213e5725e0e0a3c133de5d (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/source/control/field2.cxx')
-rw-r--r--vcl/source/control/field2.cxx11
1 files changed, 5 insertions, 6 deletions
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 );