desktop/qa/desktop_lib/test_desktop_lib.cxx    |    6 +++---
 desktop/source/lib/init.cxx                    |    8 ++++----
 include/LibreOfficeKit/LibreOfficeKit.h        |    4 ++--
 include/LibreOfficeKit/LibreOfficeKit.hxx      |   12 ++++++------
 include/sfx2/lokhelper.hxx                     |    2 +-
 libreofficekit/source/gtk/lokdocview.cxx       |    2 +-
 sfx2/source/view/lokhelper.cxx                 |    4 ++--
 sw/qa/extras/tiledrendering/tiledrendering.cxx |    2 +-
 8 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit dabf5c6ef2fbc9f041fbd3c5c4ddaa62ebeb493c
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Fri Sep 16 10:15:31 2016 +0200

    lok::Document: rename getViews() to getViewsCount()
    
    As this only returns the number of views, not the actual views. Since
    it's a rename, it's just an API (but not an ABI) change.
    
    Change-Id: Ib4f0ea56a90e5ae9c80ee1781aa2f29aff4259e7
    (cherry picked from commit dc00592b4e48a111efc6ff78bdbf7af998e58e22)

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index a6c256d..b5da41b 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -309,11 +309,11 @@ void DesktopLOKTest::testGetFonts()
 void DesktopLOKTest::testCreateView()
 {
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
-    CPPUNIT_ASSERT_EQUAL(1, pDocument->m_pDocumentClass->getViews(pDocument));
+    CPPUNIT_ASSERT_EQUAL(1, 
pDocument->m_pDocumentClass->getViewsCount(pDocument));
 
     int nId0 = pDocument->m_pDocumentClass->getView(pDocument);
     int nId1 = pDocument->m_pDocumentClass->createView(pDocument);
-    CPPUNIT_ASSERT_EQUAL(2, pDocument->m_pDocumentClass->getViews(pDocument));
+    CPPUNIT_ASSERT_EQUAL(2, 
pDocument->m_pDocumentClass->getViewsCount(pDocument));
 
     // Make sure the created view is the active one, then switch to the old
     // one.
@@ -322,7 +322,7 @@ void DesktopLOKTest::testCreateView()
     CPPUNIT_ASSERT_EQUAL(nId0, 
pDocument->m_pDocumentClass->getView(pDocument));
 
     pDocument->m_pDocumentClass->destroyView(pDocument, nId1);
-    CPPUNIT_ASSERT_EQUAL(1, pDocument->m_pDocumentClass->getViews(pDocument));
+    CPPUNIT_ASSERT_EQUAL(1, 
pDocument->m_pDocumentClass->getViewsCount(pDocument));
 }
 
 void DesktopLOKTest::testGetPartPageRectangles()
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a4ec903..7b61e66 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -438,7 +438,7 @@ static int doc_createView(LibreOfficeKitDocument* pThis);
 static void doc_destroyView(LibreOfficeKitDocument* pThis, int nId);
 static void doc_setView(LibreOfficeKitDocument* pThis, int nId);
 static int doc_getView(LibreOfficeKitDocument* pThis);
-static int doc_getViews(LibreOfficeKitDocument* pThis);
+static int doc_getViewsCount(LibreOfficeKitDocument* pThis);
 static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis,
                           const char *pFontName,
                           int* pFontWidth,
@@ -485,7 +485,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
<css::lang::XCompone
         m_pDocumentClass->destroyView = doc_destroyView;
         m_pDocumentClass->setView = doc_setView;
         m_pDocumentClass->getView = doc_getView;
-        m_pDocumentClass->getViews = doc_getViews;
+        m_pDocumentClass->getViewsCount = doc_getViewsCount;
 
         m_pDocumentClass->renderFont = doc_renderFont;
         m_pDocumentClass->getPartHash = doc_getPartHash;
@@ -2308,11 +2308,11 @@ static int doc_getView(LibreOfficeKitDocument* 
/*pThis*/)
     return SfxLokHelper::getView();
 }
 
-static int doc_getViews(LibreOfficeKitDocument* /*pThis*/)
+static int doc_getViewsCount(LibreOfficeKitDocument* /*pThis*/)
 {
     SolarMutexGuard aGuard;
 
-    return SfxLokHelper::getViews();
+    return SfxLokHelper::getViewsCount();
 }
 
 unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/,
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 81d65c1..a0ed819 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -219,8 +219,8 @@ struct _LibreOfficeKitDocumentClass
     void (*setView) (LibreOfficeKitDocument* pThis, int nId);
     /// @see lok::Document::getView().
     int (*getView) (LibreOfficeKitDocument* pThis);
-    /// @see lok::Document::getViews().
-    int (*getViews) (LibreOfficeKitDocument* pThis);
+    /// @see lok::Document::getViewsCount().
+    int (*getViewsCount) (LibreOfficeKitDocument* pThis);
 
     /// @see lok::Document::renderFont().
     unsigned char* (*renderFont) (LibreOfficeKitDocument* pThis,
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index aae5f38..9e185b6 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -363,7 +363,7 @@ public:
      * By default a loaded document has 1 view.
      * @return the ID of the new view.
      */
-    uintptr_t createView()
+    int createView()
     {
         return mpDoc->pClass->createView(mpDoc);
     }
@@ -372,7 +372,7 @@ public:
      * Destroy a view of an existing document.
      * @param nId a view ID, returned by createView().
      */
-    void destroyView(uintptr_t nId)
+    void destroyView(int nId)
     {
         mpDoc->pClass->destroyView(mpDoc, nId);
     }
@@ -381,7 +381,7 @@ public:
      * Set an existing view of an existing document as current.
      * @param nId a view ID, returned by createView().
      */
-    void setView(uintptr_t nId)
+    void setView(int nId)
     {
         mpDoc->pClass->setView(mpDoc, nId);
     }
@@ -390,7 +390,7 @@ public:
      * Get the current view.
      * @return a view ID, previously returned by createView().
      */
-    uintptr_t getView()
+    int getView()
     {
         return mpDoc->pClass->getView(mpDoc);
     }
@@ -398,9 +398,9 @@ public:
     /**
      * Get number of views of this document.
      */
-    inline int getViews()
+    inline int getViewsCount()
     {
-        return mpDoc->pClass->getViews(mpDoc);
+        return mpDoc->pClass->getViewsCount(mpDoc);
     }
 
     /**
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 852aa79..7460377 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -28,7 +28,7 @@ public:
     /// Get the currently active view.
     static int getView(SfxViewShell* pViewShell = nullptr);
     /// Get the number of views of the current object shell.
-    static std::size_t getViews();
+    static std::size_t getViewsCount();
 
     /// Invoke the LOK callback of all views except pThisView, with a payload 
of rKey-rPayload.
     static void notifyOtherViews(SfxViewShell* pThisView, int nType, const 
OString& rKey, const OString& rPayload);
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 6468230..d3c4974 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2516,7 +2516,7 @@ static void lok_doc_view_finalize (GObject* object)
     priv->m_pDocument->pClass->registerCallback(priv->m_pDocument, nullptr, 
nullptr);
     aGuard.unlock();
 
-    if (priv->m_pDocument && 
priv->m_pDocument->pClass->getViews(priv->m_pDocument) > 1)
+    if (priv->m_pDocument && 
priv->m_pDocument->pClass->getViewsCount(priv->m_pDocument) > 1)
     {
         priv->m_pDocument->pClass->destroyView(priv->m_pDocument, 
priv->m_nViewId);
     }
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 59cdb83..d06f92f 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -84,7 +84,7 @@ int SfxLokHelper::getView(SfxViewShell* pViewShell)
     return pViewShell->GetViewShellId();
 }
 
-std::size_t SfxLokHelper::getViews()
+std::size_t SfxLokHelper::getViewsCount()
 {
     SfxViewShellArr_Impl& rViewArr = SfxGetpApp()->GetViewShells_Impl();
     return rViewArr.size();
@@ -105,7 +105,7 @@ void SfxLokHelper::notifyOtherView(SfxViewShell* pThisView, 
SfxViewShell* pOther
 
 void SfxLokHelper::notifyOtherViews(SfxViewShell* pThisView, int nType, const 
OString& rKey, const OString& rPayload)
 {
-    if (SfxLokHelper::getViews() <= 1)
+    if (SfxLokHelper::getViewsCount() <= 1)
         return;
 
     SfxViewShell* pViewShell = SfxViewShell::GetFirst();
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index c72a961..b2c673d 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -898,7 +898,7 @@ void SwTiledRenderingTest::testViewCursorCleanup()
     // Now destroy the second view.
     SfxLokHelper::destroyView(nView2);
     Scheduler::ProcessEventsToIdle();
-    CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), 
SfxLokHelper::getViews());
+    CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), 
SfxLokHelper::getViewsCount());
     // Make sure that the graphic view selection on the first view is cleaned 
up.
     CPPUNIT_ASSERT(!aView1.m_bGraphicViewSelection);
     mxComponent->dispose();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to