tdf#108820 sw layout: no ftn fieldshading in repeated header

IsFootnoteAllowed() removes the footnote marker from
the repeated table headers, but it didn't remove the
view menu -> field shadings background.

NewExtraPortion() is the only function that calls
NewFootnotePortion(), and it will create a blank
FieldPortion is nullptr is returned, so return a
null FoonotePortion instead so that we can test
for is-footnote and then prevent the drawing
of the fieldshadings.

FieldShading is an on-screen item only and never printed,
so no unit test is possible.

Change-Id: I940eaf2dc3f4ad808b333d46f0964df31a9345b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99423
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Reviewed-by: Justin Luth <justin_luth@sil.org>
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index b7a58b1..a6903b9 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1335,7 +1335,7 @@ void SwTextPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
                 && ( PortionType::Number != nWhich
                      || m_pFrame->GetTextNodeForParaProps()->HasMarkedLabel())) // #i27615#
            {
                bDraw = true;
                bDraw = PortionType::Footnote != nWhich || m_pFrame->IsFootnoteAllowed();
            }
            break;
        case PortionType::Bookmark:
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 73aff1c..05f71a2 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -783,10 +783,11 @@ SwFootnotePortion *SwTextFormatter::NewFootnotePortion( SwTextFormatInfo &rInf,
    OSL_ENSURE( ! m_pFrame->IsVertical() || m_pFrame->IsSwapped(),
            "NewFootnotePortion with unswapped frame" );

    if( !m_pFrame->IsFootnoteAllowed() )
        return nullptr;

    SwTextFootnote  *pFootnote = static_cast<SwTextFootnote*>(pHint);

    if( !m_pFrame->IsFootnoteAllowed() )
        return new SwFootnotePortion("", pFootnote);

    const SwFormatFootnote& rFootnote = pFootnote->GetFootnote();
    SwDoc *const pDoc = &m_pFrame->GetDoc();