View | Details | Raw Unified | Return to issue 119568
Collapse All | Expand All

(-)sw/source/core/unocore/unoidx.cxx (-4 / +23 lines)
Lines 67-74 Link Here
67
#include <chpfld.hxx>
67
#include <chpfld.hxx>
68
#include <SwStyleNameMapper.hxx>
68
#include <SwStyleNameMapper.hxx>
69
#include <unoevtlstnr.hxx>
69
#include <unoevtlstnr.hxx>
70
#include <editsh.hxx>
70
71
71
72
using namespace ::com::sun::star;
72
using namespace ::com::sun::star;
73
using ::rtl::OUString;
73
using ::rtl::OUString;
74
74
Lines 583-600 Link Here
583
/*-- 14.12.98 09:35:05---------------------------------------------------
583
/*-- 14.12.98 09:35:05---------------------------------------------------
584
584
585
  -----------------------------------------------------------------------*/
585
  -----------------------------------------------------------------------*/
586
void lcl_CalcLayout(SwDoc *pDoc)
587
{
588
    ViewShell *pViewShell = 0;
589
    SwEditShell* pEditShell = pDoc ? pDoc->GetEditShell(&pViewShell) : 0;
590
    if (pEditShell)
591
    {
592
        pEditShell->CalcLayout();
593
    }
594
    else if (pViewShell)
595
    {
596
        pViewShell->CalcLayout();
597
    }
598
599
}
600
586
void SAL_CALL SwXDocumentIndex::update() throw (uno::RuntimeException)
601
void SAL_CALL SwXDocumentIndex::update() throw (uno::RuntimeException)
587
{
602
{
588
	vos::OGuard aGuard(Application::GetSolarMutex());
603
    vos::OGuard aGuard(Application::GetSolarMutex());
589
604
590
    SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt();
605
    SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt();
591
    SwTOXBaseSection *const pTOXBase = (pFmt) ?
606
    SwTOXBaseSection *const pTOXBase = (pFmt) ?
592
        static_cast<SwTOXBaseSection*>(pFmt->GetSection()) : 0;
607
        static_cast<SwTOXBaseSection*>(pFmt->GetSection()) : 0;
593
	if(!pTOXBase)
608
    if(!pTOXBase)
594
    {
609
    {
595
		throw uno::RuntimeException();
610
        throw uno::RuntimeException();
596
    }
611
    }
597
    pTOXBase->Update();
612
    pTOXBase->Update();
613
614
    // the insertion of TOC will affect the document layout
615
    lcl_CalcLayout(m_pImpl->m_pDoc);
616
598
    // page numbers
617
    // page numbers
599
    pTOXBase->UpdatePageNum();
618
    pTOXBase->UpdatePageNum();
600
}
619
}

Return to issue 119568