[Libreoffice-commits] core.git: Branch 'feature/cmis' - libcmis/libcmis-0.4.1.patch libcmis/UnpackedTarball_cmis.mk ucb/source

Cédric Bosdonnat cedric.bosdonnat.ooo at free.fr
Fri Aug 30 04:59:00 PDT 2013


 libcmis/UnpackedTarball_cmis.mk      |    2 
 libcmis/libcmis-0.4.1.patch          |   95 +++++++++++++++++++++++++++++++++++
 ucb/source/ucp/cmis/cmis_content.cxx |    2 
 3 files changed, 98 insertions(+), 1 deletion(-)

New commits:
commit a6fcdfbeaa925695a440ff7fc4be5eff16aacc78
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Fri Aug 30 14:06:09 2013 +0200

    libcmis: add a mandatory patch for GDrive feature to properly work
    
    Change-Id: I1bd183508b7f481feed641f8658c0baea6f743bd

diff --git a/libcmis/UnpackedTarball_cmis.mk b/libcmis/UnpackedTarball_cmis.mk
index 5786474..0b2a9fb 100644
--- a/libcmis/UnpackedTarball_cmis.mk
+++ b/libcmis/UnpackedTarball_cmis.mk
@@ -13,6 +13,8 @@ $(eval $(call gb_UnpackedTarball_set_tarball,cmis,$(CMIS_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,cmis,0))
 
+$(eval $(call gb_UnpackedTarball_add_patches,cmis,libcmis/libcmis-0.4.1.patch))
+
 ifeq ($(OS)$(COM),WNTMSC)
 $(eval $(call gb_UnpackedTarball_add_patches,cmis,libcmis/boost-win.patch))
 endif
diff --git a/libcmis/libcmis-0.4.1.patch b/libcmis/libcmis-0.4.1.patch
new file mode 100644
index 0000000..214475f
--- /dev/null
+++ b/libcmis/libcmis-0.4.1.patch
@@ -0,0 +1,95 @@
+diff --git src/libcmis/json-utils.cxx src/libcmis/json-utils.cxx
+index b537a09..b4e037d 100644
+--- src/libcmis/json-utils.cxx
++++ src/libcmis/json-utils.cxx
+@@ -213,48 +213,54 @@ Json::Type Json::parseType( )
+ {
+     Type type = json_string;
+     string str = toString( );
+-    boost::posix_time::ptime time = libcmis::parseDateTime( str );
+-    if ( !time.is_not_a_date_time( ) )
+-        type = json_datetime;
+-    else
++    if ( str.empty( ) )
++        return type;
++    try 
+     {
+-        Type backupType = type;
+-        type = json_bool;
+-        try
+-        {
+-            parseBool( str );
+-        }
+-        catch (...)
++        boost::posix_time::ptime time = libcmis::parseDateTime( str );
++        if ( !time.is_not_a_date_time( ) )
++            return json_datetime;
++    }
++    catch (...)
++    {
++        // Try other types
++    }
++    Type backupType = type;
++    type = json_bool;
++    try
++    {
++        parseBool( str );
++    }
++    catch (...)
++    {
++        type = backupType;
++    }
++    if ( type != json_bool )
++    {
++        if ( str.find('.') == string::npos )
+         {
+-            type = backupType;
++            backupType = type;
++            type = json_int;
++            try
++            {
++                parseInteger( str );
++            }
++            catch(...) 
++            { 
++                type = backupType;
++            }
+         }
+-        if ( type != json_bool )
++        else
+         {
+-            if ( str.find('.') == string::npos )
++            backupType = type;
++            type = json_double;
++            try
+             {
+-                backupType = type;
+-                type = json_int;
+-                try
+-                {
+-                    parseInteger( str );
+-                }
+-                catch(...) 
+-                { 
+-                    type = backupType;
+-                }
++                parseDouble( str );
+             }
+-            else
+-            {
+-                backupType = type;
+-                type = json_double;
+-                try
+-                {
+-                    parseDouble( str );
+-                }
+-                catch(...) 
+-                { 
+-                    type = backupType;
+-                }
++            catch(...) 
++            { 
++                type = backupType;
+             }
+         }
+     }
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 5b8451c..76d23b9 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -174,7 +174,7 @@ namespace
         bool bMultiValued = prop.MultiValued;
         bool bOpenChoice = prop.OpenChoice;
         uno::Any value = prop.Value;
-        libcmis::PropertyType::Type type;
+        libcmis::PropertyType::Type type = libcmis::PropertyType::String;
         if ( prop.Type == CMIS_TYPE_STRING )
             type = libcmis::PropertyType::String;
         else if ( prop.Type == CMIS_TYPE_BOOL )


More information about the Libreoffice-commits mailing list