From fb2e4da0e20fea3c085ddec899376e7f3671e1b1 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sat, 23 May 2015 10:43:41 +0100 Subject: SwView::UpdatePageNums: add LOK callback about page count change Change-Id: If9ab69c9f3ec3f9f518738792ff020ef4cfd6390 --- include/LibreOfficeKit/LibreOfficeKitEnums.h | 10 +++++++++- sw/source/uibase/uiview/view2.cxx | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 9b65e88453b9..ba4db824e00c 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -140,7 +140,15 @@ typedef enum /** * No match was found for the search input */ - LOK_CALLBACK_SEARCH_NOT_FOUND + LOK_CALLBACK_SEARCH_NOT_FOUND, + + /** + * Number of pages changed in the document. + * + * Clients should assume that data returned by an earlier + * lok::Document::getDocumentSize() call is no longer valid. + */ + LOK_CALLBACK_PAGE_COUNT_CHANGED } LibreOfficeKitCallbackType; diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index b6f947ddfb5f..a8ce619391b6 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -147,6 +147,7 @@ #include #include +#include const char sStatusDelim[] = " : "; const char sStatusComma[] = " , "; @@ -1280,6 +1281,7 @@ void SwView::Execute(SfxRequest &rReq) /// invalidate page numbering field void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr) { + GetWrtShell().libreOfficeKitCallback(LOK_CALLBACK_PAGE_COUNT_CHANGED, 0); OUString sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr )); const SfxStringItem aTmp( FN_STAT_PAGE, sTemp ); // Used to distinguish which tooltip to show -- cgit