diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-12-14 14:06:28 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-12-14 16:10:42 +0100 |
commit | d9a115ae5ba869c1629973e9462d1925812354f0 (patch) | |
tree | f720b96fecaf29c10afc1945a0c40830624a4215 /svx/source | |
parent | c2726c29b233b8fa7fbd390aafe149bdf7e94b07 (diff) |
tdf#145999 -1 was the representation of unlimited cell width
when using UniString -1 -> 0xFFFF i.e. old-time EDIT_NOLIMIT
Change-Id: Ie40fa65a88a2b8961d70635ca5e4ec851567e089
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126834
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index e6a0f960395e..bfe8ff4d6dcb 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1176,13 +1176,12 @@ void DbTextField::updateFromModel( Reference< XPropertySet > _rxModel ) _rxModel->getPropertyValue( FM_PROP_TEXT ) >>= sText; sal_Int32 nMaxTextLen = m_pEdit->GetMaxTextLen(); - if (nMaxTextLen != 0 && sText.getLength() > nMaxTextLen) + if (nMaxTextLen > 0 && sText.getLength() > nMaxTextLen) { sal_Int32 nDiff = sText.getLength() - nMaxTextLen; sText = sText.replaceAt(sText.getLength() - nDiff,nDiff, u""); } - m_pEdit->SetText( sText ); m_pEdit->SetSelection( Selection( SELECTION_MAX, SELECTION_MIN ) ); } @@ -1192,7 +1191,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 (nMaxTextLen != 0) + if (nMaxTextLen > 0) { OUString sOldValue; m_rColumn.getModel()->getPropertyValue( FM_PROP_TEXT ) >>= sOldValue; |