sw34bf06: #i104384#: problem exporting section breaks in tables

Replace MSWordExportBase::bInTable by MSWordExportBase::IsInTable()

Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 9f04897..09fba3f 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -378,7 +378,7 @@ void DocxExport::OutputEndNode( const SwEndNode& rEndNode )
        if ( rNd.IsEndNode() && rNd.StartOfSectionNode()->IsSectionNode() )
            return;

        if ( !rNd.IsSectionNode() && !bIsInTable ) // No sections in table
        if ( !rNd.IsSectionNode() && IsInTable() ) // No sections in table
        {
            const SwSectionFmt* pParentFmt = rSect.GetFmt()->GetParent();
            if( !pParentFmt )
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 0026794..53eddd2 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1748,7 +1748,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )

    AttrOutput().StartParagraph( pTextNodeInfo );

    bool bFlyInTable = mpParentFrame && bIsInTable;
    bool bFlyInTable = mpParentFrame && IsInTable();

    if ( !bFlyInTable )
        nStyleBeforeFly = GetId( lcl_getFormatCollection( *this, &rNode ) );
@@ -2021,7 +2021,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )

    AttrOutput().ParagraphStyle( nStyle );

    if ( mpParentFrame && !bIsInTable )    // Fly-Attrs
    if ( mpParentFrame && IsInTable() )    // Fly-Attrs
        OutputFormat( mpParentFrame->GetFrmFmt(), false, false, true );

    if ( pTextNodeInfo.get() != NULL )
@@ -2419,7 +2419,7 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode )

    SwNodeIndex aIdx( rSectionNode, 1 );
    const SwNode& rNd = aIdx.GetNode();
    if ( !rNd.IsSectionNode() && !bIsInTable ) //No sections in table
    if ( !rNd.IsSectionNode() && !IsInTable() ) //No sections in table
    {
        // Bug 74245 - if the first Node inside the section has an own
        //              PageDesc or PageBreak attribut, then dont write
@@ -2569,7 +2569,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point
        if( nStt >= nEnd )      // kein Bereich, also kein gueltiger Node
            return;

        if ( !m_rWW8Export.bIsInTable && rFmt.IsInline() )
        if ( !m_rWW8Export.IsInTable() && rFmt.IsInline() )
        {
            //Test to see if this textbox contains only a single graphic/ole
            SwTxtNode* pParTxtNode = rAnch.GetCntntAnchor()->nNode.GetNode().GetTxtNode();
@@ -2597,7 +2597,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point

            m_rWW8Export.mpParentFrame = &rFmt;
            if (
                 m_rWW8Export.bIsInTable &&
                m_rWW8Export.IsInTable() &&
                 (FLY_AT_PAGE != rAnch.GetAnchorId()) &&
                 !m_rWW8Export.pDoc->GetNodes()[ nStt ]->IsNoTxtNode()
               )
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index fe160b9..b70cea4 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1776,7 +1776,6 @@ void MSWordExportBase::SaveData( sal_uLong nStt, sal_uLong nEnd )
    aData.eOldAnchorType = eNewAnchorType;

    aData.bOldOutTable = bOutTable;
    aData.bOldIsInTable = bIsInTable;
    aData.bOldFlyFrmAttrs = bOutFlyFrmAttrs;
    aData.bOldStartTOX = bStartTOX;
    aData.bOldInWriteTOX = bInWriteTOX;
@@ -1811,7 +1810,6 @@ void MSWordExportBase::RestoreData()
    pOrigPam = rData.pOldEnd;

    bOutTable = rData.bOldOutTable;
    bIsInTable = rData.bOldIsInTable;
    bOutFlyFrmAttrs = rData.bOldFlyFrmAttrs;
    bStartTOX = rData.bOldStartTOX;
    bInWriteTOX = rData.bOldInWriteTOX;
@@ -2432,7 +2430,7 @@ void WW8Export::SectionBreaksAndFrames( const SwTxtNode& rNode )
    OutputSectionBreaks( rNode.GetpSwAttrSet(), rNode );

    // all textframes anchored as character for the winword 7- format
    if ( !bWrtWW8 && !bIsInTable )
    if ( !bWrtWW8 && !IsInTable() )
        OutWW6FlyFrmsInCntnt( rNode );
}

@@ -2488,7 +2486,7 @@ void MSWordExportBase::WriteText()
                ;
            else if ( aIdx.GetNode().IsSectionNode() )
                ;
            else if ( !bIsInTable ) //No sections in table
            else if ( !IsInTable() ) //No sections in table
            {
                ReplaceCr( (char)0xc ); // Indikator fuer Page/Section-Break

@@ -2567,6 +2565,28 @@ void WW8Export::WriteMainText()
#endif
}

bool MSWordExportBase::IsInTable() const
{
    bool bResult = false;

    if (pCurPam != NULL)
    {
        SwNode * pNode = pCurPam->GetNode();

        if (pNode != NULL && mpTableInfo.get() != NULL)
        {
            ww8::WW8TableNodeInfo::Pointer_t pTableNodeInfo = mpTableInfo->getTableNodeInfo(pNode);

            if (pTableNodeInfo.get() != NULL && pTableNodeInfo->getDepth() > 0)
            {
                bResult = true;
            }
        }
    }

    return bResult;
}

typedef ww8::WW8Sttb< ww8::WW8Struct >  WW8SttbAssoc;

void WW8Export::WriteFkpPlcUsw()
@@ -2873,7 +2893,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )

    bStyDef = bBreakBefore = bOutKF =
        bOutFlyFrmAttrs = bOutPageDescs = bOutTable = bOutFirstPage =
        bIsInTable = bOutGrf = bInWriteEscher = bStartTOX =
        bOutGrf = bInWriteEscher = bStartTOX =
        bInWriteTOX = false;

    bFtnAtTxtEnd = bEndAtTxtEnd = true;
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 2a8b22f..312fe9f 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -539,8 +539,6 @@ public:
    sal_uInt8 bOutFirstPage : 1;     // write Attrset of FirstPageDesc
    sal_uInt8 bOutTable : 1;         // Tabelle wird ausgegeben
                                //    ( wird zB bei Flys in Tabelle zurueckgesetzt )
    sal_uInt8 bIsInTable : 1;        // wird sind innerhalb der Ausgabe einer Tabelle
                                //    ( wird erst nach der Tabelle zurueckgesetzt )
    sal_uInt8 bOutGrf : 1;           // Grafik wird ausgegeben
    sal_uInt8 bInWriteEscher : 1;    // in write textboxes
    sal_uInt8 bStartTOX : 1;         // true: a TOX is startet
@@ -572,6 +570,9 @@ public:
    /// Iterate through the nodes and call the appropriate OutputNode() on them.
    void WriteText();

    /// Return whether cuurently exported node is in table.
    bool IsInTable() const;

    /// Set the pCurPam appropriately and call WriteText().
    ///
    /// Used to export paragraphs in footnotes/endnotes/etc.
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 5c72d15..2757443 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -497,7 +497,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
    // Otherwise, an additional paragraph is exported for a graphic, which is
    // forced to be treated as inline, because it's anchored inside another frame.
    if ( !rFrame.IsInline() &&
         ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !bIsInTable )) ||
         ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !IsInTable() )) ||
           (eAn == FLY_AT_PAGE)) )
    // <--
    {
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 9448cca..901d8fb 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1472,7 +1472,7 @@ void WW8AttributeOutput::CharRotate( const SvxCharRotateItem& rRotate )
    if ( !rRotate.GetValue() )
        return;

    if ( m_rWW8Export.bWrtWW8 && !m_rWW8Export.bIsInTable )
    if ( m_rWW8Export.bWrtWW8 && !m_rWW8Export.IsInTable() )
    {
        // #i36867 In word the text in a table is rotated via the TC or NS_sprm::LN_TTextFlow
        // This means you can only rotate all or none of the text adding NS_sprm::LN_CEastAsianLayout