Blob Blame History Raw
From 8d464eb04df9fe579f8ee24a476c18af8afe3fcb Mon Sep 17 00:00:00 2001
From: Pranav Kant <pranavk@gnome.org>
Date: Mon, 19 Oct 2015 22:36:12 +0530
Subject: [PATCH 221/398] lokdocview: Use G_PARAM_STATIC_STRINGS

... as `name`, `nick`, and `blurb` are guaranteed to remain valid
and unmodified for the lifetime of the parameters.

Change-Id: Ic6463b470546669d5a815842daedb170df85d161
Reviewed-on: https://gerrit.libreoffice.org/19472
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit d2d5a00e0e3972c0021e2e664301a32da6e54c1a)
---
 libreofficekit/source/gtk/lokdocview.cxx | 42 ++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 16 deletions(-)

diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 4af48bbea5a5..dc1ae5544558 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1638,8 +1638,9 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
                               "LO Path",
                               "LibreOffice Install Path",
                               0,
-                              static_cast<GParamFlags>(G_PARAM_READWRITE
-                                                       | G_PARAM_CONSTRUCT_ONLY)));
+                              static_cast<GParamFlags>(G_PARAM_READWRITE |
+                                                       G_PARAM_CONSTRUCT_ONLY |
+                                                       G_PARAM_STATIC_STRINGS)));
 
     /**
      * LOKDocView:lopointer:
@@ -1650,10 +1651,11 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
     g_object_class_install_property (pGObjectClass,
           PROP_LO_POINTER,
           g_param_spec_pointer("lopointer",
-                              "LO Pointer",
-                              "A LibreOfficeKit* from lok_init()",
-                              static_cast<GParamFlags>(G_PARAM_READWRITE
-                                                       | G_PARAM_CONSTRUCT_ONLY)));
+                               "LO Pointer",
+                               "A LibreOfficeKit* from lok_init()",
+                               static_cast<GParamFlags>(G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT_ONLY |
+                                                        G_PARAM_STATIC_STRINGS)));
 
     /**
      * LOKDocView:docpath:
@@ -1666,7 +1668,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
                               "Document Path",
                               "The URI of the document to open",
                               0,
-                              static_cast<GParamFlags>(G_PARAM_READWRITE)));
+                              static_cast<GParamFlags>(G_PARAM_READWRITE |
+                                                       G_PARAM_STATIC_STRINGS)));
 
     /**
      * LOKDocView:docpointer:
@@ -1677,9 +1680,10 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
     g_object_class_install_property (pGObjectClass,
           PROP_DOC_POINTER,
           g_param_spec_pointer("docpointer",
-                              "Document Pointer",
-                              "A LibreOfficeKitDocument* from documentLoad()",
-                              static_cast<GParamFlags>(G_PARAM_READWRITE)));
+                               "Document Pointer",
+                               "A LibreOfficeKitDocument* from documentLoad()",
+                               static_cast<GParamFlags>(G_PARAM_READWRITE |
+                                                        G_PARAM_STATIC_STRINGS)));
 
     /**
      * LOKDocView:editable:
@@ -1692,7 +1696,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
                                "Editable",
                                "Whether the content is in edit mode or not",
                                FALSE,
-                               static_cast<GParamFlags>(G_PARAM_READWRITE)));
+                               static_cast<GParamFlags>(G_PARAM_READWRITE |
+                                                        G_PARAM_STATIC_STRINGS)));
 
     /**
      * LOKDocView:load-progress:
@@ -1708,7 +1713,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
                               "Estimated Load Progress",
                               "Shows the progress of the document load operation",
                               0.0, 1.0, 0.0,
-                              G_PARAM_READABLE));
+                              static_cast<GParamFlags>(G_PARAM_READABLE |
+                                                       G_PARAM_STATIC_STRINGS)));
 
     /**
      * LOKDocView:zoom-level:
@@ -1723,7 +1729,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
                              "The current zoom level of the content",
                              0, 5.0, 1.0,
                              static_cast<GParamFlags>(G_PARAM_READWRITE |
-                                                      G_PARAM_CONSTRUCT)));
+                                                      G_PARAM_CONSTRUCT |
+                                                      G_PARAM_STATIC_STRINGS)));
 
     /**
      * LOKDocView:is-loading:
@@ -1737,7 +1744,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
                                "Is Loading",
                                "Whether the view is loading a document",
                                FALSE,
-                               static_cast<GParamFlags>(G_PARAM_READABLE)));
+                               static_cast<GParamFlags>(G_PARAM_READABLE |
+                                                        G_PARAM_STATIC_STRINGS)));
 
     /**
      * LOKDocView:doc-width:
@@ -1750,7 +1758,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
                             "Document Width",
                             "Width of the document in twips",
                             0, G_MAXLONG, 0,
-                            static_cast<GParamFlags>(G_PARAM_READWRITE)));
+                            static_cast<GParamFlags>(G_PARAM_READWRITE |
+                                                     G_PARAM_STATIC_STRINGS)));
 
     /**
      * LOKDocView:doc-height:
@@ -1763,7 +1772,8 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
                             "Document Height",
                             "Height of the document in twips",
                             0, G_MAXLONG, 0,
-                            static_cast<GParamFlags>(G_PARAM_READWRITE)));
+                            static_cast<GParamFlags>(G_PARAM_READWRITE |
+                                                     G_PARAM_STATIC_STRINGS)));
 
     /**
      * LOKDocView:can-zoom-in:
-- 
2.12.0