ScSetStringParam::mbCheckLinkFormula for HTML and RTF import

 This is a combination of 3 commits.

Introduce ScSetStringParam::mbCheckLinkFormula

(cherry picked from commit 5a93c51e3b7f455ff5d4cfc9e8b6e510fc126b75)

Handle ScSetStringParam::mbCheckLinkFormula in ScColumn::ParseString()

(cherry picked from commit 271d9ebfe0c4fc57ea6f01a9c048021e5429dd15)

 Conflicts:
	sc/source/core/data/column3.cxx

ScSetStringParam::mbCheckLinkFormula for HTML and RTF import

(cherry picked from commit 98c0bd7ffd008015623b2c5eb8630649394d76f6)

d6b0705140baacdb872560f7031efaf0c03f0e00
7cf7cf12142322cbffd5160e9a8dce55efd36be5

Change-Id: I2028fc53f9778606778cd8629611752acd3f1a1c
Reviewed-on: https://gerrit.libreoffice.org/49708
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx
index 005a997..a1ecbdd 100644
--- a/sc/inc/stringutil.hxx
+++ b/sc/inc/stringutil.hxx
@@ -92,6 +92,13 @@ struct SAL_WARN_UNUSED SC_DLLPUBLIC ScSetStringParam

    sc::StartListeningType meStartListening;

    /** When true and the string results in a compiled formula, check the
        formula tokens for presence of functions that could trigger access to
        external resources. This is to be set to true in import filter code,
        but not for user input.
     */
    bool mbCheckLinkFormula;

    ScSetStringParam();

    /**
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 397fe33..7300031 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1722,11 +1722,15 @@ bool ScColumn::ParseString(
            rCell.set(rPool.intern(rString));
        }
        else // = Formula
            rCell.set(
                new ScFormulaCell(
        {
            ScFormulaCell* pFormulaCell = new ScFormulaCell(
                    pDocument, ScAddress(nCol, nRow, nTabP), rString,
                    formula::FormulaGrammar::mergeToGrammar(formula::FormulaGrammar::GRAM_DEFAULT, eConv),
                    ScMatrixMode::NONE));
                    ScMatrixMode::NONE);
            if (aParam.mbCheckLinkFormula)
                pDocument->CheckLinkFormulaNeedingCheck( *pFormulaCell->GetCode());
            rCell.set( pFormulaCell);
        }
    }
    else if ( cFirstChar == '\'') // 'Text
    {
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index 8ac5a3a..8ba3fd0 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -30,7 +30,8 @@ ScSetStringParam::ScSetStringParam() :
    mbDetectNumberFormat(true),
    meSetTextNumFormat(Never),
    mbHandleApostrophe(true),
    meStartListening(sc::SingleCellListening)
    meStartListening(sc::SingleCellListening),
    mbCheckLinkFormula(false)
{
}

diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 0214a78..a3af0cb 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -341,6 +341,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu
                aParam.mbDetectNumberFormat = true;
                aParam.meSetTextNumFormat = ScSetStringParam::SpecialNumberOnly;
                aParam.mbHandleApostrophe = false;
                aParam.mbCheckLinkFormula = true;

                if (!aValStr.isEmpty())
                    mpDoc->SetValue( nCol, nRow, nTab, fVal );