Kaydet (Commit) 0d97d25d authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

use SwIterator for typed iteration

Change-Id: Icc1a04304e182687a306e9d08cbf7d46b0adbee6
üst 5111ad57
...@@ -1434,45 +1434,33 @@ bool SwDoc::RemoveInvisibleContent() ...@@ -1434,45 +1434,33 @@ bool SwDoc::RemoveInvisibleContent()
bool SwDoc::HasInvisibleContent() const bool SwDoc::HasInvisibleContent() const
{ {
bool bRet = false; if(SwIterator<SwFmtFld,SwFieldType>(*getIDocumentFieldsAccess().GetSysFldType( RES_HIDDENPARAFLD)).First())
return true;
SwClientIter aIter( *getIDocumentFieldsAccess().GetSysFldType( RES_HIDDENPARAFLD ) );
if( aIter.First( TYPE( SwFmtFld ) ) )
bRet = true;
// Search for any hidden paragraph (hidden text attribute) // Search for any hidden paragraph (hidden text attribute)
if( ! bRet ) for( sal_uLong n = GetNodes().Count()-1; n; --n)
{ {
for( sal_uLong n = GetNodes().Count(); !bRet && (n > 0); ) SwTxtNode* pTxtNd = GetNodes()[ n ]->GetTxtNode();
if ( pTxtNd )
{ {
SwTxtNode* pTxtNd = GetNodes()[ --n ]->GetTxtNode(); SwPaM aPam(*pTxtNd, 0, *pTxtNd, pTxtNd->GetTxt().getLength());
if ( pTxtNd ) if( pTxtNd->HasHiddenCharAttribute( true ) || ( pTxtNd->HasHiddenCharAttribute( false ) ) )
{ return true;
SwPaM aPam(*pTxtNd, 0, *pTxtNd, pTxtNd->GetTxt().getLength());
if( pTxtNd->HasHiddenCharAttribute( true ) || ( pTxtNd->HasHiddenCharAttribute( false ) ) )
{
bRet = true;
}
}
} }
} }
if( ! bRet ) const SwSectionFmts& rSectFmts = GetSections();
for( SwSectionFmts::size_type n = rSectFmts.size()-1; n; --n )
{ {
const SwSectionFmts& rSectFmts = GetSections(); SwSectionFmt* pSectFmt = rSectFmts[ n ];
// don't add sections in Undo/Redo
for( SwSectionFmts::size_type n = rSectFmts.size(); !bRet && (n > 0); ) if( !pSectFmt->IsInNodesArr())
{ continue;
SwSectionFmt* pSectFmt = rSectFmts[ --n ]; SwSection* pSect = pSectFmt->GetSection();
// don't add sections in Undo/Redo if( pSect->IsHidden() )
if( !pSectFmt->IsInNodesArr()) return true;
continue;
SwSection* pSect = pSectFmt->GetSection();
if( pSect->IsHidden() )
bRet = true;
}
} }
return bRet; return false;
} }
bool SwDoc::RestoreInvisibleContent() bool SwDoc::RestoreInvisibleContent()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment