Automatically section update with java

Michael Meeks michael.meeks at
Mon Mar 5 02:08:35 PST 2012

Hi Toygun,

On Mon, 2012-03-05 at 08:46 +0100, Toygun wrote:
> I have a odt document where I inserted 2 sections from other documents.
> Changing these sections requires an update in the enclosing document
> when using Libre Office or OpenOffice (popup is asking me).

	OK; if you mean the right click 'update index / table' then I would
grep for the UI string in the code, eg.

	git grep -i8 'pdate Index/Table'

	find the id:

	git grep -8  FN_UPDATE_CUR_TOX

	find what method is being called to do the update, presumably this

        case FN_UPDATE_CUR_TOX:
            const SwTOXBase* pBase = pWrtShell->GetCurTOX();
                if(TOX_INDEX == pBase->GetType())
                pWrtShell->UpdateTableOf( *pBase );

	Then grep for this UpdateTableOf method, to see if there is some UNO
implementation that goes near there. From a quick grep, it looks like:

void SAL_CALL SwXDocumentIndex::update() throw (uno::RuntimeException)
    SolarMutexGuard aGuard;

    SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt();
    SwTOXBaseSection *const pTOXBase = (pFmt) ?
        static_cast<SwTOXBaseSection*>(pFmt->GetSection()) : 0;
        throw uno::RuntimeException();
    // page numbers

	Might be what you want.	

	Then again, your question was rather vague as to what you wanted to
update - sections ? and really this list is for hacking on the core
libreoffice code, not for questions around scripting it :-)



michael.meeks at  <><, Pseudo Engineer, itinerant idiot

More information about the LibreOffice mailing list