sc/source/core/data/validat.cxx | 3 +++ sc/source/ui/app/inputhdl.cxx | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-)
New commits: commit c869fb5ea2fa1dbbfa7c17754aeac48ed7f77cc4 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Tue Feb 6 21:42:06 2024 +0100 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Wed Feb 7 08:30:06 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> diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 09757b88d180..30980b11d2fa 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 af4e01fec9ec..ce397be3f6cd 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -3158,7 +3158,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() ); @@ -3199,6 +3199,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL if (pData->DoError(pActiveViewSh->GetFrameWeld(), aString, aCursorPos)) bForget = true; // Do not take over input + } } }