[Libreoffice-commits] core.git: 4 commits - libreofficekit/source

Stephan Bergmann sbergman at redhat.com
Tue Jun 9 03:11:14 PDT 2015


 libreofficekit/source/gtk/lokdocview.cxx |   22 +++++++++++-----------
 libreofficekit/source/gtk/tilebuffer.cxx |    4 ++--
 libreofficekit/source/gtk/tilebuffer.hxx |    6 +-----
 3 files changed, 14 insertions(+), 18 deletions(-)

New commits:
commit e52bae937032dd5eac14da1d54b045ad9d787b1f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 9 11:58:24 2015 +0200

    -Werror,-Wignored-attributes ("attribute declaration must precede definition")
    
    Change-Id: Iee0e9ef3a623706c33f84c34c1fbbf5b173f7f5d

diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 4fb998e..ed3fc5c 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -208,6 +208,7 @@ enum
 
 static guint doc_view_signals[LAST_SIGNAL] = { 0 };
 
+SAL_DLLPUBLIC_EXPORT GType lok_doc_view_get_type();
 #ifdef __GNUC__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-function"
@@ -1196,8 +1197,6 @@ static void lok_doc_view_init (LOKDocView* pDocView)
     g_signal_connect(G_OBJECT(pDocView), "destroy", G_CALLBACK(LOKDocView_Impl::destroy), 0);
 }
 
-SAL_DLLPUBLIC_EXPORT GType lok_doc_view_get_type();
-
 SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new( LibreOfficeKit* pOffice )
 {
     LOKDocView* pDocView = LOK_DOC_VIEW(gtk_type_new(lok_doc_view_get_type()));
commit 3f0e8bdabed165e09825bc78c55afb968a6d702a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 9 11:57:56 2015 +0200

    loplugin:unreffun
    
    Change-Id: I2011b491012dfd623ece9fd24a265107ac690cba

diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 7e50b96..4fb998e 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -208,9 +208,14 @@ enum
 
 static guint doc_view_signals[LAST_SIGNAL] = { 0 };
 
-
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
 G_DEFINE_TYPE(LOKDocView, lok_doc_view, GTK_TYPE_SCROLLED_WINDOW)
-
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
 
 namespace {
 
commit 9aa9baa78852dda5c348eb0abdbef98db3e910ed
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 9 11:48:12 2015 +0200

    loplugin:literaltoboolconversion
    
    Change-Id: I85fa46de5b864369158d047fd3f7c683f10c822f

diff --git a/libreofficekit/source/gtk/tilebuffer.cxx b/libreofficekit/source/gtk/tilebuffer.cxx
index 1d6a8b6..2c0ee90 100644
--- a/libreofficekit/source/gtk/tilebuffer.cxx
+++ b/libreofficekit/source/gtk/tilebuffer.cxx
@@ -67,7 +67,7 @@ void TileBuffer::setInvalid(int x, int y)
     g_info("Setting tile invalid (%d, %d)", x, y);
     if (m_mTiles.find(index) != m_mTiles.end())
     {
-        m_mTiles[index].valid = 0;
+        m_mTiles[index].valid = false;
         m_mTiles[index].release();
         m_mTiles.erase(index);
     }
@@ -101,7 +101,7 @@ Tile& TileBuffer::getTile(int x, int y, float aZoom)
 
         //create a mapping for it
         m_mTiles[index].setPixbuf(pPixBuf);
-        m_mTiles[index].valid = 1;
+        m_mTiles[index].valid = true;
     }
 
     return m_mTiles[index];
diff --git a/libreofficekit/source/gtk/tilebuffer.hxx b/libreofficekit/source/gtk/tilebuffer.hxx
index b9bf71b..42c6d35 100644
--- a/libreofficekit/source/gtk/tilebuffer.hxx
+++ b/libreofficekit/source/gtk/tilebuffer.hxx
@@ -51,7 +51,7 @@ float twipToPixel(float fInput, float zoom);
 class Tile
 {
  public:
-    Tile() : valid(0) {}
+    Tile() : valid(false) {}
     ~Tile() { }
 
     /**
commit 3a1a5b9744eb73f82c28ecfaa39b54587ef8206b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 9 11:42:41 2015 +0200

    -Werror,-Wunused-private-field
    
    Change-Id: I76cf487c66e048b5e9d0877a1b690cd066b73528

diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 5f768e7..7e50b96 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -274,7 +274,7 @@ LOKDocView_Impl::CallbackData::CallbackData(int nType, const std::string& rPaylo
 LOKDocView_Impl::LOKDocView_Impl(LOKDocView* pDocView)
     : m_pDocView(pDocView),
       m_pDrawingArea(gtk_drawing_area_new()),
-      m_aTileBuffer(TileBuffer(0,0,0)),
+      m_aTileBuffer(TileBuffer(0,0)),
       m_fZoom(1),
       m_pOffice(0),
       m_pDocument(0),
@@ -1230,13 +1230,11 @@ SAL_DLLPUBLIC_EXPORT gboolean lok_doc_view_open_document( LOKDocView* pDocView,
         long nDocumentHeightTwips = pDocView->m_pImpl->m_nDocumentHeightTwips;
         long nDocumentWidthPixels = twipToPixel(nDocumentWidthTwips, zoom);
         long nDocumentHeightPixels = twipToPixel(nDocumentHeightTwips, zoom);
-        // Total number of rows / columns in this document.
-        guint nRows = ceil((double)nDocumentHeightPixels / nTileSizePixels);
+        // Total number of columns in this document.
         guint nColumns = ceil((double)nDocumentWidthPixels / nTileSizePixels);
 
 
         pDocView->m_pImpl->m_aTileBuffer = TileBuffer(pDocView->m_pImpl->m_pDocument,
-                                                      nRows,
                                                       nColumns);
         gtk_widget_set_size_request(pDocView->m_pImpl->m_pDrawingArea,
                                     nDocumentWidthPixels,
@@ -1257,12 +1255,10 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_zoom ( LOKDocView* pDocView, float fZ
     pDocView->m_pImpl->m_fZoom = fZoom;
     long nDocumentWidthPixels = twipToPixel(pDocView->m_pImpl->m_nDocumentWidthTwips, fZoom);
     long nDocumentHeightPixels = twipToPixel(pDocView->m_pImpl->m_nDocumentHeightTwips, fZoom);
-    // Total number of rows / columns in this document.
-    guint nRows = ceil((double)nDocumentHeightPixels / nTileSizePixels);
+    // Total number of columns in this document.
     guint nColumns = ceil((double)nDocumentWidthPixels / nTileSizePixels);
 
     pDocView->m_pImpl->m_aTileBuffer = TileBuffer(pDocView->m_pImpl->m_pDocument,
-                                                  nRows,
                                                   nColumns);
     gtk_widget_set_size_request(pDocView->m_pImpl->m_pDrawingArea,
                                 nDocumentWidthPixels,
diff --git a/libreofficekit/source/gtk/tilebuffer.hxx b/libreofficekit/source/gtk/tilebuffer.hxx
index ea8e524..b9bf71b 100644
--- a/libreofficekit/source/gtk/tilebuffer.hxx
+++ b/libreofficekit/source/gtk/tilebuffer.hxx
@@ -83,11 +83,9 @@ class TileBuffer
 {
  public:
  TileBuffer(LibreOfficeKitDocument *document,
-            int rows,
             int columns)
      : m_pLOKDocument(document)
         , m_nWidth(columns)
-        , m_nHeight(rows)
     {  }
 
     ~TileBuffer() {}
@@ -126,8 +124,6 @@ class TileBuffer
     std::map<int, Tile> m_mTiles;
     /// Width of the current tile buffer (number of columns)
     int m_nWidth;
-    /// Height of the current tile buffer (numbero of rows)
-    int m_nHeight;
 };
 
 #endif // INCLUDED_TILEBUFFER_HXX


More information about the Libreoffice-commits mailing list