Kaydet (Commit) 27c9370b authored tarafından Serge Krot's avatar Serge Krot Kaydeden (comit) Thorsten Behrens

tdf#117668 Fix wrong number of sections in document

Change-Id: Ia2b8a1376f4f2b4e790598255ae69fb6ee92d23d
Reviewed-on: https://gerrit.libreoffice.org/54423Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 8fde560d
......@@ -908,11 +908,17 @@ void DocumentFieldsManager::UpdateExpFields( SwTextField* pUpdateField, bool bUp
// Make sure we don't hide all sections, which would lead to a crash. First, count how many of them do we have.
int nShownSections = 0;
for( SetGetExpFields::const_iterator it = mpUpdateFields->GetSortLst()->begin(); it != mpUpdateFields->GetSortLst()->end(); ++it )
{
SwSection* pSect = const_cast<SwSection*>((*it)->GetSection());
if ( pSect && !pSect->IsCondHidden())
nShownSections++;
SwSectionFormats& rSectFormats = m_rDoc.GetSections();
for( SwSectionFormats::size_type n = 0; n<rSectFormats.size(); ++n )
{
SwSectionFormat* pSectFormat = rSectFormats[ n ];
SwSection* pSect = pSectFormat->GetSection();
// count only visible sections
if ( pSect && !pSect->CalcHiddenFlag())
nShownSections++;
}
}
OUString aNew;
......
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