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 <serval2412@yahoo.fr>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user