summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-29 16:16:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-29 21:28:33 +0200
commitef95604f607e853d2e88dcd7961468215408f8c2 (patch)
tree180d04ceae97c0e192c231a3e68431bdcd0fb0a4
parent28a278e8029ed5d589a948f68abc2ba29c616c1f (diff)
use 0 as the limit-less case
since... commit 9ebe58f0437bbb5714e629bd22e004ac895086d6 Change-Id: I001567bb7beb0a51d55c75fe36761f4c964348e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99711 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--svx/source/fmcomp/gridcell.cxx4
-rw-r--r--svx/source/inc/gridcell.hxx3
2 files changed, 3 insertions, 4 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index a920477e9f49..326188c81463 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1180,7 +1180,7 @@ void DbTextField::updateFromModel( Reference< XPropertySet > _rxModel )
_rxModel->getPropertyValue( FM_PROP_TEXT ) >>= sText;
sal_Int32 nMaxTextLen = m_pEdit->GetMaxTextLen();
- if ( EDIT_NOLIMIT != nMaxTextLen && sText.getLength() > nMaxTextLen )
+ if (nMaxTextLen != 0 && sText.getLength() > nMaxTextLen)
{
sal_Int32 nDiff = sText.getLength() - nMaxTextLen;
sText = sText.replaceAt(sText.getLength() - nDiff,nDiff, OUString());
@@ -1196,7 +1196,7 @@ bool DbTextField::commitControl()
OUString aText( m_pEdit->GetText( getModelLineEndSetting( m_rColumn.getModel() ) ) );
// we have to check if the length before we can decide if the value was modified
sal_Int32 nMaxTextLen = m_pEdit->GetMaxTextLen();
- if ( EDIT_NOLIMIT != nMaxTextLen )
+ if (nMaxTextLen != 0)
{
OUString sOldValue;
m_rColumn.getModel()->getPropertyValue( FM_PROP_TEXT ) >>= sOldValue;
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 669d1d6095a8..ee40a8520549 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -22,7 +22,6 @@
#include <memory>
#include <svx/gridctrl.hxx>
-#include <vcl/edit.hxx>
#include "sqlparserclient.hxx"
@@ -372,7 +371,7 @@ protected:
protected:
void implSetMaxTextLen( sal_Int16 _nMaxLen )
{
- implSetEffectiveMaxTextLen( _nMaxLen ? _nMaxLen : EDIT_NOLIMIT );
+ implSetEffectiveMaxTextLen(_nMaxLen);
}
virtual void implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen );
};