sc/source/core/data/validat.cxx | 3 +++ sc/source/ui/app/inputhdl.cxx | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-)
New commits: commit b7a1ff456629549f66c93a5258073f1394598174 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Tue Feb 6 21:42:06 2024 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Feb 8 23:28:58 2024 +0100 tdf#159595: Data validation without error check allows to enter wrong data Change-Id: If5660f462a07ca571e05a44abcb0e378b6de613e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163064 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> (cherry picked from commit 9925937bb6b9be70befb8886ccc5665eff4ef227) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163020 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index a46b09986b3d..5a569ef94487 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -381,6 +381,9 @@ bool ScValidationData::DoError(weld::Window* pParent, const OUString& rInput, if ( eErrorStyle == SC_VALERR_MACRO ) return DoMacro(rPos, rInput, nullptr, pParent); + if (!bShowError) + return true; + // Output error message OUString aTitle = aErrorTitle; diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 809ba8520e33..a640d71cb2df 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -3159,7 +3159,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL { ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocument(); const ScValidationData* pData = rDoc.GetValidationEntry( nValidation ); - if (pData && pData->HasErrMsg()) + if (pData) { // #i67990# don't use pLastPattern in EnterHandler const ScPatternAttr* pPattern = rDoc.GetPattern( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab() ); @@ -3200,6 +3200,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL if (pData->DoError(pActiveViewSh->GetFrameWeld(), aString, aCursorPos)) bForget = true; // Do not take over input + } } }