diff options
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 44 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 14 |
3 files changed, 37 insertions, 27 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 24d7a325fa..0540c3dac9 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -178,7 +178,7 @@ MSWordAttrIter::~MSWordAttrIter() // Mit OutAttr() werden die Attribute an der angegebenen SwPos // ausgegeben. -class SwAttrIter : public MSWordAttrIter +class WW8SwAttrIter : public MSWordAttrIter { private: const SwTxtNode& rNd; @@ -209,10 +209,10 @@ private: void IterToCurrent(); //No copying - SwAttrIter(const SwAttrIter&); - SwAttrIter& operator=(const SwAttrIter&); + WW8SwAttrIter(const WW8SwAttrIter&); + WW8SwAttrIter& operator=(const WW8SwAttrIter&); public: - SwAttrIter( MSWordExportBase& rWr, const SwTxtNode& rNd ); + WW8SwAttrIter( MSWordExportBase& rWr, const SwTxtNode& rNd ); bool IsTxtAttr( xub_StrLen nSwPos ); bool IsRedlineAtEnd( xub_StrLen nPos ) const; @@ -248,7 +248,7 @@ public: } }; -void SwAttrIter::IterToCurrent() +void WW8SwAttrIter::IterToCurrent() { ASSERT(maCharRuns.begin() != maCharRuns.end(), "Impossible"); mnScript = maCharRunIter->mnScript; @@ -256,7 +256,7 @@ void SwAttrIter::IterToCurrent() mbCharIsRTL = maCharRunIter->mbRTL; } -SwAttrIter::SwAttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) : +WW8SwAttrIter::WW8SwAttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) : MSWordAttrIter(rWr), rNd(rTxtNd), maCharRuns(GetPseudoCharRuns(rTxtNd, 0, !rWr.HackIsWW8OrHigher())), @@ -323,7 +323,7 @@ xub_StrLen lcl_getMinPos( xub_StrLen pos1, xub_StrLen pos2 ) return min; } -xub_StrLen SwAttrIter::SearchNext( xub_StrLen nStartPos ) +xub_StrLen WW8SwAttrIter::SearchNext( xub_StrLen nStartPos ) { xub_StrLen nPos; xub_StrLen nMinPos = STRING_MAXLEN; @@ -456,7 +456,7 @@ xub_StrLen SwAttrIter::SearchNext( xub_StrLen nStartPos ) return nMinPos; } -void SwAttrIter::OutAttr( xub_StrLen nSwPos ) +void WW8SwAttrIter::OutAttr( xub_StrLen nSwPos ) { m_rExport.AttrOutput().RTLAndCJKState( IsCharRTL(), GetScript() ); @@ -582,7 +582,7 @@ void SwAttrIter::OutAttr( xub_StrLen nSwPos ) } } -void SwAttrIter::OutFlys(xub_StrLen nSwPos) +void WW8SwAttrIter::OutFlys(xub_StrLen nSwPos) { /* #i2916# @@ -604,7 +604,7 @@ void SwAttrIter::OutFlys(xub_StrLen nSwPos) } } -bool SwAttrIter::IsTxtAttr( xub_StrLen nSwPos ) +bool WW8SwAttrIter::IsTxtAttr( xub_StrLen nSwPos ) { // search for attrs with CH_TXTATR if (const SwpHints* pTxtAttrs = rNd.GetpSwpHints()) @@ -620,7 +620,7 @@ bool SwAttrIter::IsTxtAttr( xub_StrLen nSwPos ) return false; } -bool SwAttrIter::IsDropCap( int nSwPos ) +bool WW8SwAttrIter::IsDropCap( int nSwPos ) { // see if the current position falls on a DropCap int nDropChars = mrSwFmtDrop.GetChars(); @@ -639,7 +639,7 @@ bool SwAttrIter::IsDropCap( int nSwPos ) return false; } -bool SwAttrIter::RequiresImplicitBookmark() +bool WW8SwAttrIter::RequiresImplicitBookmark() { SwImplBookmarksIter bkmkIterEnd = m_rExport.maImplicitBookmarks.end(); for ( SwImplBookmarksIter aIter = m_rExport.maImplicitBookmarks.begin(); aIter != bkmkIterEnd; ++aIter ) @@ -658,7 +658,7 @@ bool SwAttrIter::RequiresImplicitBookmark() // Attribut-Anfangposition fragen kann. // Es koennen nur Attribute mit Ende abgefragt werden. // Es wird mit bDeep gesucht -const SfxPoolItem* SwAttrIter::HasTextItem( sal_uInt16 nWhich ) const +const SfxPoolItem* WW8SwAttrIter::HasTextItem( sal_uInt16 nWhich ) const { const SfxPoolItem* pRet = 0; const SwpHints* pTxtAttrs = rNd.GetpSwpHints(); @@ -691,7 +691,7 @@ void WW8Export::GetCurrentItems(WW8Bytes& rItems) const rItems.Insert((*pO)[nI], rItems.Count()); } -const SfxPoolItem& SwAttrIter::GetItem(sal_uInt16 nWhich) const +const SfxPoolItem& WW8SwAttrIter::GetItem(sal_uInt16 nWhich) const { const SfxPoolItem* pRet = HasTextItem(nWhich); return pRet ? *pRet : rNd.SwCntntNode::GetAttr(nWhich); @@ -1072,7 +1072,7 @@ String BookmarkToWriter(const String &rBookmark) INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_ASCII_US); } -void SwAttrIter::OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool) +void WW8SwAttrIter::OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool) { if ( m_rExport.HasRefToObject( REF_SETREFATTR, &rAttr.GetRefName(), 0 ) ) m_rExport.AppendBookmark( m_rExport.GetBookmarkName( REF_SETREFATTR, @@ -1172,7 +1172,7 @@ void AttributeOutputBase::TOXMark( const SwTxtNode& rNode, const SwTOXMark& rAtt FieldVanish( sTxt, eType ); } -int SwAttrIter::OutAttrWithRange(xub_StrLen nPos) +int WW8SwAttrIter::OutAttrWithRange(xub_StrLen nPos) { int nRet = 0; if ( const SwpHints* pTxtAttrs = rNd.GetpSwpHints() ) @@ -1233,7 +1233,7 @@ int SwAttrIter::OutAttrWithRange(xub_StrLen nPos) return nRet; } -bool SwAttrIter::IsRedlineAtEnd( xub_StrLen nEnd ) const +bool WW8SwAttrIter::IsRedlineAtEnd( xub_StrLen nEnd ) const { bool bRet = false; // search next Redline @@ -1255,7 +1255,7 @@ bool SwAttrIter::IsRedlineAtEnd( xub_StrLen nEnd ) const return bRet; } -const SwRedlineData* SwAttrIter::GetRedline( xub_StrLen nPos ) +const SwRedlineData* WW8SwAttrIter::GetRedline( xub_StrLen nPos ) { if( pCurRedline ) { @@ -1450,7 +1450,7 @@ Convert characters that need to be converted, the basic replacements and the ridicously complicated title case attribute mapping to hardcoded upper case because word doesn't have the feature */ -String SwAttrIter::GetSnippet(const String &rStr, xub_StrLen nAktPos, +String WW8SwAttrIter::GetSnippet(const String &rStr, xub_StrLen nAktPos, xub_StrLen nLen) const { String aSnippet(rStr, nAktPos, nLen); @@ -1646,7 +1646,7 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rS m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); } -xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos ) +xub_StrLen MSWordExportBase::GetNextPos( WW8SwAttrIter* aAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos ) { // Get the bookmarks for the normal run xub_StrLen nNextPos = aAttrIter->WhereNext(); @@ -1659,7 +1659,7 @@ xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode& return std::min( nNextPos, nNextBookmark ); } -void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen nAktPos, xub_StrLen /*nEnd*/ ) +void MSWordExportBase::UpdatePosition( WW8SwAttrIter* aAttrIter, xub_StrLen nAktPos, xub_StrLen /*nEnd*/ ) { xub_StrLen nNextPos; @@ -1797,7 +1797,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) // have to remember it in nStyle sal_uInt16 nStyle = nStyleBeforeFly; - SwAttrIter aAttrIter( *this, rNode ); + WW8SwAttrIter aAttrIter( *this, rNode ); rtl_TextEncoding eChrSet = aAttrIter.GetCharSet(); if ( bStartTOX ) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index e846737f47..8b17b1ef58 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -58,7 +58,7 @@ namespace msfilter class MSCodec_Std97; } -class SwAttrIter; +class WW8SwAttrIter; class AttributeOutputBase; class DocxAttributeOutput; class RtfAttributeOutput; @@ -751,10 +751,10 @@ protected: virtual void ExportDocument_Impl() = 0; /// Get the next position in the text node to output - virtual xub_StrLen GetNextPos( SwAttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos ); + virtual xub_StrLen GetNextPos( WW8SwAttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos ); /// Update the information for GetNextPos(). - virtual void UpdatePosition( SwAttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd ); + virtual void UpdatePosition( WW8SwAttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd ); /// Output SwTxtNode void OutputTextNode( const SwTxtNode& ); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index f0f198d0b3..9c5ecd70cc 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -439,10 +439,20 @@ 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 ) - && ( (SwFmtPageDesc*)pItem )->GetRegisteredIn() ) + bool bGotItem = + if ( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem ) && + dynamic_cast<const SwFmtPageDesc*>(pItem)->GetRegisteredIn() != NULL) { bBreakSet = true; bNewPageDesc = true; |