135360
From 8d464eb04df9fe579f8ee24a476c18af8afe3fcb Mon Sep 17 00:00:00 2001
135360
From: Pranav Kant <pranavk@gnome.org>
135360
Date: Mon, 19 Oct 2015 22:36:12 +0530
135360
Subject: [PATCH 221/398] lokdocview: Use G_PARAM_STATIC_STRINGS
135360
135360
... as `name`, `nick`, and `blurb` are guaranteed to remain valid
135360
and unmodified for the lifetime of the parameters.
135360
135360
Change-Id: Ic6463b470546669d5a815842daedb170df85d161
135360
Reviewed-on: https://gerrit.libreoffice.org/19472
135360
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
135360
(cherry picked from commit d2d5a00e0e3972c0021e2e664301a32da6e54c1a)
135360
---
135360
 libreofficekit/source/gtk/lokdocview.cxx | 42 ++++++++++++++++++++------------
135360
 1 file changed, 26 insertions(+), 16 deletions(-)
135360
135360
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
135360
index 4af48bbea5a5..dc1ae5544558 100644
135360
--- a/libreofficekit/source/gtk/lokdocview.cxx
135360
+++ b/libreofficekit/source/gtk/lokdocview.cxx
135360
@@ -1638,8 +1638,9 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
135360
                               "LO Path",
135360
                               "LibreOffice Install Path",
135360
                               0,
135360
-                              static_cast<GParamFlags>(G_PARAM_READWRITE
135360
-                                                       | G_PARAM_CONSTRUCT_ONLY)));
135360
+                              static_cast<GParamFlags>(G_PARAM_READWRITE |
135360
+                                                       G_PARAM_CONSTRUCT_ONLY |
135360
+                                                       G_PARAM_STATIC_STRINGS)));
135360
 
135360
     /**
135360
      * LOKDocView:lopointer:
135360
@@ -1650,10 +1651,11 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
135360
     g_object_class_install_property (pGObjectClass,
135360
           PROP_LO_POINTER,
135360
           g_param_spec_pointer("lopointer",
135360
-                              "LO Pointer",
135360
-                              "A LibreOfficeKit* from lok_init()",
135360
-                              static_cast<GParamFlags>(G_PARAM_READWRITE
135360
-                                                       | G_PARAM_CONSTRUCT_ONLY)));
135360
+                               "LO Pointer",
135360
+                               "A LibreOfficeKit* from lok_init()",
135360
+                               static_cast<GParamFlags>(G_PARAM_READWRITE |
135360
+                                                        G_PARAM_CONSTRUCT_ONLY |
135360
+                                                        G_PARAM_STATIC_STRINGS)));
135360
 
135360
     /**
135360
      * LOKDocView:docpath:
135360
@@ -1666,7 +1668,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
135360
                               "Document Path",
135360
                               "The URI of the document to open",
135360
                               0,
135360
-                              static_cast<GParamFlags>(G_PARAM_READWRITE)));
135360
+                              static_cast<GParamFlags>(G_PARAM_READWRITE |
135360
+                                                       G_PARAM_STATIC_STRINGS)));
135360
 
135360
     /**
135360
      * LOKDocView:docpointer:
135360
@@ -1677,9 +1680,10 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
135360
     g_object_class_install_property (pGObjectClass,
135360
           PROP_DOC_POINTER,
135360
           g_param_spec_pointer("docpointer",
135360
-                              "Document Pointer",
135360
-                              "A LibreOfficeKitDocument* from documentLoad()",
135360
-                              static_cast<GParamFlags>(G_PARAM_READWRITE)));
135360
+                               "Document Pointer",
135360
+                               "A LibreOfficeKitDocument* from documentLoad()",
135360
+                               static_cast<GParamFlags>(G_PARAM_READWRITE |
135360
+                                                        G_PARAM_STATIC_STRINGS)));
135360
 
135360
     /**
135360
      * LOKDocView:editable:
135360
@@ -1692,7 +1696,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
135360
                                "Editable",
135360
                                "Whether the content is in edit mode or not",
135360
                                FALSE,
135360
-                               static_cast<GParamFlags>(G_PARAM_READWRITE)));
135360
+                               static_cast<GParamFlags>(G_PARAM_READWRITE |
135360
+                                                        G_PARAM_STATIC_STRINGS)));
135360
 
135360
     /**
135360
      * LOKDocView:load-progress:
135360
@@ -1708,7 +1713,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
135360
                               "Estimated Load Progress",
135360
                               "Shows the progress of the document load operation",
135360
                               0.0, 1.0, 0.0,
135360
-                              G_PARAM_READABLE));
135360
+                              static_cast<GParamFlags>(G_PARAM_READABLE |
135360
+                                                       G_PARAM_STATIC_STRINGS)));
135360
 
135360
     /**
135360
      * LOKDocView:zoom-level:
135360
@@ -1723,7 +1729,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
135360
                              "The current zoom level of the content",
135360
                              0, 5.0, 1.0,
135360
                              static_cast<GParamFlags>(G_PARAM_READWRITE |
135360
-                                                      G_PARAM_CONSTRUCT)));
135360
+                                                      G_PARAM_CONSTRUCT |
135360
+                                                      G_PARAM_STATIC_STRINGS)));
135360
 
135360
     /**
135360
      * LOKDocView:is-loading:
135360
@@ -1737,7 +1744,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
135360
                                "Is Loading",
135360
                                "Whether the view is loading a document",
135360
                                FALSE,
135360
-                               static_cast<GParamFlags>(G_PARAM_READABLE)));
135360
+                               static_cast<GParamFlags>(G_PARAM_READABLE |
135360
+                                                        G_PARAM_STATIC_STRINGS)));
135360
 
135360
     /**
135360
      * LOKDocView:doc-width:
135360
@@ -1750,7 +1758,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
135360
                             "Document Width",
135360
                             "Width of the document in twips",
135360
                             0, G_MAXLONG, 0,
135360
-                            static_cast<GParamFlags>(G_PARAM_READWRITE)));
135360
+                            static_cast<GParamFlags>(G_PARAM_READWRITE |
135360
+                                                     G_PARAM_STATIC_STRINGS)));
135360
 
135360
     /**
135360
      * LOKDocView:doc-height:
135360
@@ -1763,7 +1772,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
135360
                             "Document Height",
135360
                             "Height of the document in twips",
135360
                             0, G_MAXLONG, 0,
135360
-                            static_cast<GParamFlags>(G_PARAM_READWRITE)));
135360
+                            static_cast<GParamFlags>(G_PARAM_READWRITE |
135360
+                                                     G_PARAM_STATIC_STRINGS)));
135360
 
135360
     /**
135360
      * LOKDocView:can-zoom-in:
135360
-- 
135360
2.12.0
135360