summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx33
-rw-r--r--ucb/source/ucp/cmis/cmis_strings.hxx23
2 files changed, 55 insertions, 1 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 5e843822bb34..f414a8bba1c8 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -47,6 +47,7 @@
#include "cmis_provider.hxx"
#include "cmis_resultset.hxx"
#include "cmis_oauth2_providers.hxx"
+#include "cmis_strings.hxx"
#define OUSTR_TO_STDSTR(s) string( OUStringToOString( s, RTL_TEXTENCODING_UTF8 ).getStr() )
#define STD_TO_OUSTR( str ) OUString( str.c_str(), str.length( ), RTL_TEXTENCODING_UTF8 )
@@ -205,7 +206,17 @@ namespace
bool bMultiValued = prop.MultiValued;
bool bOpenChoice = prop.OpenChoice;
uno::Any value = prop.Value;
- libcmis::PropertyType::Type type = libcmis::PropertyType::String;
+ libcmis::PropertyType::Type type;
+ if ( prop.Type == CMIS_TYPE_STRING )
+ type = libcmis::PropertyType::String;
+ else if ( prop.Type == CMIS_TYPE_BOOL )
+ type = libcmis::PropertyType::Bool;
+ else if ( prop.Type == CMIS_TYPE_INTEGER )
+ type = libcmis::PropertyType::Integer;
+ else if ( prop.Type == CMIS_TYPE_DECIMAL )
+ type = libcmis::PropertyType::Decimal;
+ else if ( prop.Type == CMIS_TYPE_DATETIME )
+ type = libcmis::PropertyType::DateTime;
propertyType->setId( OUSTR_TO_STDSTR( id ));
propertyType->setDisplayName( OUSTR_TO_STDSTR( name ) );
@@ -682,6 +693,26 @@ namespace cmis
pCmisProps[i].MultiValued = bMultiValued;
pCmisProps[i].OpenChoice = bOpenChoice;
pCmisProps[i].Value = lcl_cmisPropertyToUno( it->second );
+ switch ( it->second->getPropertyType( )->getType( ) )
+ {
+ default:
+ case libcmis::PropertyType::String:
+ pCmisProps[i].Type = CMIS_TYPE_STRING;
+ break;
+ case libcmis::PropertyType::Integer:
+ pCmisProps[i].Type = CMIS_TYPE_INTEGER;
+ break;
+ case libcmis::PropertyType::Decimal:
+ pCmisProps[i].Type = CMIS_TYPE_DECIMAL;
+ break;
+ case libcmis::PropertyType::Bool:
+ pCmisProps[i].Type = CMIS_TYPE_BOOL;
+ break;
+ case libcmis::PropertyType::DateTime:
+ pCmisProps[i].Type = CMIS_TYPE_DATETIME;
+ break;
+ }
+
}
xRow->appendObject( rProp.Name, uno::makeAny( aCmisProperties ) );
}
diff --git a/ucb/source/ucp/cmis/cmis_strings.hxx b/ucb/source/ucp/cmis/cmis_strings.hxx
new file mode 100644
index 000000000000..f478548c8269
--- /dev/null
+++ b/ucb/source/ucp/cmis/cmis_strings.hxx
@@ -0,0 +1,23 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ */
+
+#ifndef CMIS_STRINGS_HXX
+#define CMIS_STRINGS_HXX
+
+#define CMIS_TYPE_STRING "String"
+#define CMIS_TYPE_INTEGER "Integer"
+#define CMIS_TYPE_DECIMAL "Decimal"
+#define CMIS_TYPE_DATETIME "Datetime"
+#define CMIS_TYPE_BOOL "Bool"
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */