[Libreoffice-commits] online.git: loolwsd/LOOLWSD.hpp loolwsd/README loolwsd/Util.hpp

Miklos Vajna vmiklos at collabora.co.uk
Thu Jul 28 06:39:45 UTC 2016


 loolwsd/LOOLWSD.hpp |   12 ++++++------
 loolwsd/README      |    4 +---
 loolwsd/Util.hpp    |   18 +++++++++---------
 3 files changed, 16 insertions(+), 18 deletions(-)

New commits:
commit 84ef81b7b46aae991046c76686bedb9388648d1e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jul 28 08:39:03 2016 +0200

    LOOLWSD, Util: follow coding style when prefixing data members
    
    Change-Id: Iaf788cc8e5b7df473a52fbe8496d500f0f63c117

diff --git a/loolwsd/LOOLWSD.hpp b/loolwsd/LOOLWSD.hpp
index ff282d6..46a8c18 100644
--- a/loolwsd/LOOLWSD.hpp
+++ b/loolwsd/LOOLWSD.hpp
@@ -75,18 +75,18 @@ private:
 
     class ConfigValueGetter
     {
-        Poco::Util::LayeredConfiguration& mconfig;
-        const std::string& mname;
+        Poco::Util::LayeredConfiguration& _config;
+        const std::string& _name;
 
     public:
         ConfigValueGetter(Poco::Util::LayeredConfiguration& config,
                           const std::string& name)
-            : mconfig(config)
-            , mname(name)
+            : _config(config)
+            , _name(name)
         {}
 
-        void operator()(unsigned int& value) { value = mconfig.getUInt(mname); }
-        void operator()(bool& value) { value = mconfig.getBool(mname); }
+        void operator()(unsigned int& value) { value = _config.getUInt(_name); }
+        void operator()(bool& value) { value = _config.getBool(_name); }
     };
 
     template<typename T>
diff --git a/loolwsd/README b/loolwsd/README
index ec1ae2e..2c21e7d 100644
--- a/loolwsd/README
+++ b/loolwsd/README
@@ -349,6 +349,4 @@ The style is roughly as follows, in rough order of importance:
 - Member functions use camelCaseWithInitialLowerCase. I don't like
   CamelCaseWithInitialUpperCase.
 
-- [ No kind of Hungarian prefixes. ] This rule seems to have been
-  totally ignored lately. So now the codebase is inconsistent in
-  naming conventions. Oh well.
+- [ No kind of Hungarian prefixes. ]
diff --git a/loolwsd/Util.hpp b/loolwsd/Util.hpp
index e2dd51b..1bbd377 100644
--- a/loolwsd/Util.hpp
+++ b/loolwsd/Util.hpp
@@ -188,20 +188,20 @@ namespace Util
     template<typename T>
     class RuntimeConstant
     {
-        T mValue;
-        bool mInitialized;
+        T _value;
+        bool _initialized;
 
     public:
         RuntimeConstant()
-            : mValue()
-            , mInitialized(false)
+            : _value()
+            , _initialized(false)
         {}
 
         const T& get()
         {
-            if(mInitialized)
+            if(_initialized)
             {
-                return mValue;
+                return _value;
             }
             else
             {
@@ -211,10 +211,10 @@ namespace Util
 
         void set(const T& value)
         {
-            assert(!mInitialized);
+            assert(!_initialized);
 
-            mInitialized = true;
-            mValue = value;
+            _initialized = true;
+            _value = value;
         }
     };
 } // end namespace Util


More information about the Libreoffice-commits mailing list