Return-Path: X-Original-To: apmail-openoffice-commits-archive@www.apache.org Delivered-To: apmail-openoffice-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5C981107DC for ; Thu, 2 Jan 2014 10:46:28 +0000 (UTC) Received: (qmail 80594 invoked by uid 500); 2 Jan 2014 10:46:28 -0000 Delivered-To: apmail-openoffice-commits-archive@openoffice.apache.org Received: (qmail 80483 invoked by uid 500); 2 Jan 2014 10:46:27 -0000 Mailing-List: contact commits-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list commits@openoffice.apache.org Received: (qmail 80471 invoked by uid 99); 2 Jan 2014 10:46:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jan 2014 10:46:27 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jan 2014 10:46:24 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0977B23888E2; Thu, 2 Jan 2014 10:46:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1554783 - /openoffice/trunk/main/sw/source/core/unocore/unoidx.cxx Date: Thu, 02 Jan 2014 10:46:03 -0000 To: commits@openoffice.apache.org From: steve_y@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140102104604.0977B23888E2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: steve_y Date: Thu Jan 2 10:46:03 2014 New Revision: 1554783 URL: http://svn.apache.org/r1554783 Log: Bug 119568 - [From Symphony] The page number of the TOC is not correct if open the .docx via AOO Modified: openoffice/trunk/main/sw/source/core/unocore/unoidx.cxx Modified: openoffice/trunk/main/sw/source/core/unocore/unoidx.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/unocore/unoidx.cxx?rev=1554783&r1=1554782&r2=1554783&view=diff ============================================================================== --- openoffice/trunk/main/sw/source/core/unocore/unoidx.cxx (original) +++ openoffice/trunk/main/sw/source/core/unocore/unoidx.cxx Thu Jan 2 10:46:03 2014 @@ -67,6 +67,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -583,6 +584,21 @@ throw (uno::RuntimeException) /*-- 14.12.98 09:35:05--------------------------------------------------- -----------------------------------------------------------------------*/ +void lcl_CalcLayout(SwDoc *pDoc) +{ + ViewShell *pViewShell = 0; + SwEditShell* pEditShell = pDoc ? pDoc->GetEditShell(&pViewShell) : 0; + if (pEditShell) + { + pEditShell->CalcLayout(); + } + else if (pViewShell) + { + pViewShell->CalcLayout(); + } + +} + void SAL_CALL SwXDocumentIndex::update() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -595,6 +611,10 @@ void SAL_CALL SwXDocumentIndex::update() throw uno::RuntimeException(); } pTOXBase->Update(); + + // the insertion of TOC will affect the document layout + lcl_CalcLayout(m_pImpl->m_pDoc); + // page numbers pTOXBase->UpdatePageNum(); }