docx export: invalid sectPr added at the beginning of the doc

This reverts commit 60fa5057039d2413d56813df4d45e5cfdfbb40ac,
which was a revert of 723f772d (fix for ooo#106749) with an
alternative fix to avoid a regression (fdo#56513).

This commit contain a fix for the sectPr issue, and does not
regress on the 2 previously fixed issue.

Change-Id: Ibc551b38d25554c59b7c4ac5a447a0d60323f53f
Reviewed-on: https://gerrit.libreoffice.org/1647
Reviewed-by: Noel Power <noel.power@suse.com>
Tested-by: Noel Power <noel.power@suse.com>
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index b89a143..01d61c5 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2368,9 +2368,7 @@ void MSWordExportBase::WriteText()
        }
        else if ( pNd->IsTableNode() )
        {
            SwTable * pTable = &pNd->GetTableNode()->GetTable();
            OutputSectionBreaks( &pTable->GetTableFmt()->GetAttrSet(), *pNd );
            mpTableInfo->processSwTable( pTable );
            mpTableInfo->processSwTable( &pNd->GetTableNode()->GetTable() );
        }
        else if ( pNd->IsSectionNode() && TXT_MAINTEXT == nTxtTyp )
            OutputSectionNode( *pNd->GetSectionNode() );
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d6cbdaa..393a685 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -403,6 +403,15 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
    //section.
    bool bBreakSet = false;

    const SwPageDesc * pPageDesc = rNd.FindPageDesc(sal_False);

    if (pAktPageDesc != pPageDesc)
    {
        bBreakSet = true;
        bNewPageDesc = true;
        pAktPageDesc = pPageDesc;
    }

    if ( pSet && pSet->Count() )
    {
        if ( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem ) &&
@@ -456,7 +465,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
                    if ( pBreak &&
                         pBreak->GetBreak() == SVX_BREAK_PAGE_BEFORE )
                    {
                        bNewPageDesc = SetAktPageDescFromNode( rNd );
                        bNewPageDesc |= SetAktPageDescFromNode( rNd );
                    }
                }
                if ( !bNewPageDesc )