[Libreoffice-commits] online.git: loolwsd/TileDesc.hpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Fri Nov 25 03:46:28 UTC 2016


 loolwsd/TileDesc.hpp |   27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

New commits:
commit c8c8407e001dc6b058488cae0578f68c59093225
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed Nov 23 21:28:50 2016 -0500

    loolwsd: move ver field in tile to the end
    
    tile and tilecombine have grown organically
    and gained optional fields when originally
    all fields were required.
    
    Since internally we deduplicate them, we need
    to compare the required fields and not the
    optional ones. By moving all optional ones
    after the landmark ver, we make comparison
    easier and, hopefully, less error prone.
    
    Change-Id: I309185d3e19a45c7d59bc872e8a76acd3c511c14
    Reviewed-on: https://gerrit.libreoffice.org/31182
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/TileDesc.hpp b/loolwsd/TileDesc.hpp
index 5c39e48..85bc453 100644
--- a/loolwsd/TileDesc.hpp
+++ b/loolwsd/TileDesc.hpp
@@ -120,17 +120,19 @@ public:
             << " tileposx=" << _tilePosX
             << " tileposy=" << _tilePosY
             << " tilewidth=" << _tileWidth
-            << " tileheight=" << _tileHeight
-            << " ver=" << _ver;
+            << " tileheight=" << _tileHeight;
 
-        if (_imgSize > 0)
+        if (_id >= 0)
         {
-            oss << " imgsize=" << _imgSize;
+            oss << " id=" << _id;
         }
 
-        if (_id >= 0)
+        // Anything after ver is optional.
+        oss << " ver=" << _ver;
+
+        if (_imgSize > 0)
         {
-            oss << " id=" << _id;
+            oss << " imgsize=" << _imgSize;
         }
 
         if (_broadcast)
@@ -162,8 +164,10 @@ public:
                 pairs[name] = value;
             }
         }
+
         std::string s;
-        bool broadcast = (LOOLProtocol::getTokenString(tokens, "broadcast", s) && s == "yes");
+        const bool broadcast = (LOOLProtocol::getTokenString(tokens, "broadcast", s) &&
+                                s == "yes");
 
         return TileDesc(pairs["part"], pairs["width"], pairs["height"],
                         pairs["tileposx"], pairs["tileposy"],
@@ -304,16 +308,17 @@ public:
 
         oss << " tilewidth=" << _tileWidth
             << " tileheight=" << _tileHeight;
-        if (_ver >= 0)
-        {
-            oss << " ver=" << _ver;
-        }
 
         if (_id >= 0)
         {
             oss << " id=" << _id;
         }
 
+        if (_ver >= 0)
+        {
+            oss << " ver=" << _ver;
+        }
+
         return oss.str();
     }
 


More information about the Libreoffice-commits mailing list