diff options
author | Michael Stahl <mst@apache.org> | 2011-09-17 21:38:19 +0000 |
---|---|---|
committer | Michael Stahl <mst@apache.org> | 2011-09-17 21:38:19 +0000 |
commit | e3211af2c6618958cc58dd9d9a93672a96bd30aa (patch) | |
tree | 033fd6fa4eb92eb62405cb4daa6dda862fb5b7da /sw | |
parent | 2e631440ad24c0582daee5d4ba644a472daa0e3b (diff) |
sw34bf06: #i104384#: Replace MSWordExportBase::bInTable by MSWordExportBase::IsInTable()
# HG changeset patch
# User Henning Brinkmann <hbrinkm@openoffice.org>
# Date 1301385565 -7200
# Node ID 713dcef8f169f411fe62b073dab24ca3dfc02a44
# Parent 75d6ff8443f1f268780d970c67855d963c781566
Diffstat (limited to 'sw')
-rwxr-xr-x | sw/source/filter/ww8/wrtw8nds.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 30 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8gr.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 2 |
5 files changed, 35 insertions, 14 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index dea5332d181c..d4ee7ca8c9d1 100755 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1788,7 +1788,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 ) ); @@ -2026,7 +2026,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 ) @@ -2527,7 +2527,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 @@ -2678,7 +2678,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(); @@ -2717,7 +2717,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 b343901f2439..3c35e4ccf051 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1779,7 +1779,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; @@ -1815,7 +1814,6 @@ void MSWordExportBase::RestoreData() pOrigPam = rData.pOldEnd; bOutTable = rData.bOldOutTable; - bIsInTable = rData.bOldIsInTable; bOutFlyFrmAttrs = rData.bOldFlyFrmAttrs; bStartTOX = rData.bOldStartTOX; bInWriteTOX = rData.bOldInWriteTOX; @@ -2459,7 +2457,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 ); } @@ -2541,7 +2539,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 @@ -2620,6 +2618,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() @@ -2929,7 +2949,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 ec5e9eb895eb..15da1ba537cf 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -541,8 +541,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 @@ -574,6 +572,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 0fe904e8a092..e6dfd083c84e 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -465,7 +465,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 87827699a99a..10d1dba0ccaa 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1484,7 +1484,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 |