pass SwNode instead of SwNodeIndex to InsertTable

part of the process of hiding the internals of SwPosition

Change-Id: I58e20facfb8987a31e354542a9a5e7824daa0b26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138235
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index b50b98b..41180ed 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -247,7 +247,7 @@ public:
       adjust in pContentTextColl or pHeadlineTextColl this adjust item
       overrides the item in pAttrSet. */

    static SwTableNode* InsertTable( const SwNodeIndex& rNdIdx,
    static SwTableNode* InsertTable( SwNode& rNd,
                        sal_uInt16 nBoxes, SwTextFormatColl* pContentTextColl,
                        sal_uInt16 nLines, sal_uInt16 nRepeat,
                        SwTextFormatColl* pHeadlineTextColl,
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 591cee8..9d345c9 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -393,7 +393,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts,
        SwNodes::InsertTable to propagate an adjust item if
        necessary. */
    SwTableNode *pTableNd = SwNodes::InsertTable(
        rPos.nNode,
        rPos.GetNode(),
        nCols,
        pBodyColl,
        nRows,
@@ -560,7 +560,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts,
    return &rNdTable;
}

SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
SwTableNode* SwNodes::InsertTable( SwNode& rNd,
                                   sal_uInt16 nBoxes,
                                   SwTextFormatColl* pContentTextColl,
                                   sal_uInt16 nLines,
@@ -575,8 +575,8 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
    if( !pHeadlineTextColl || !nLines )
        pHeadlineTextColl = pContentTextColl;

    SwTableNode * pTableNd = new SwTableNode( rNdIdx.GetNode() );
    SwEndNode* pEndNd = new SwEndNode( rNdIdx.GetNode(), *pTableNd );
    SwTableNode * pTableNd = new SwTableNode( rNd );
    SwEndNode* pEndNd = new SwEndNode( rNd, *pTableNd );

    if( !nLines ) // For the for loop
        ++nLines;