Use comphelper::IsContextFlagActive for flags from comphelper::NewFlagContext

Change-Id: Ib4a812dd115299d4251d863d0ee275d7acba1c5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99443
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2020-07-25 15:49:56 +03:00
parent 9d548868c6
commit 97200ca082
2 changed files with 4 additions and 10 deletions

View file

@ -22,8 +22,8 @@
#include <parser.hxx>
#include <basic/sberrors.hxx>
#include <basic/sbmod.hxx>
#include <comphelper/SetFlagContextHelper.hxx>
#include <expr.hxx>
#include <uno/current_context.hxx>
SbiExpression::SbiExpression( SbiParser* p, SbiExprType t,
SbiExprMode eMode, const KeywordSymbolInfo* pKeywordSymbolInfo )
@ -1042,10 +1042,7 @@ SbiExprListPtr SbiExprList::ParseParameters( SbiParser* pParser, bool bStandalon
// tdf#106529: only fail here in strict mode (i.e. when compiled from IDE), and
// allow legacy code with missing closing parenthesis when started e.g. from
// extensions and event handlers
bool bCheckStrict = false;
if (auto xContext = css::uno::getCurrentContext())
xContext->getValueByName("BasicStrict") >>= bCheckStrict;
if (bCheckStrict)
if (comphelper::IsContextFlagActive("BasicStrict"))
{
pParser->Error(ERRCODE_BASIC_EXPECTED, RPAREN);
pExprList->bError = true;

View file

@ -48,6 +48,7 @@
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/util/theMacroExpander.hpp>
#include <comphelper/propertysequence.hxx>
#include <comphelper/SetFlagContextHelper.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implbase.hxx>
@ -652,11 +653,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
}
case JFW_E_JAVA_DISABLED:
{
bool bDontEnableJava = false;
auto xContext(css::uno::getCurrentContext());
if (xContext.is())
xContext->getValueByName("DontEnableJava") >>= bDontEnableJava;
if (bDontEnableJava)
if (comphelper::IsContextFlagActive("DontEnableJava"))
return css::uno::Any();
//QueryBox: