diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-06-10 21:59:45 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-06-11 14:57:41 +0200 |
commit | a75596f3f8d3660bd96a107eb13a2ea210be5b66 (patch) | |
tree | ca2bad558f45f464c3ee8e53d533c83268ecc419 /ucb/source/ucp/gio | |
parent | f676b194faf2805529556c2f1da0578b58bf37de (diff) |
Simplify Sequences initializations (ucb)
Change-Id: Idd38076a40b1177253719c01c1928da4c903151c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117017
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'ucb/source/ucp/gio')
-rw-r--r-- | ucb/source/ucp/gio/gio_content.cxx | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index 31907611e880..7278a7956361 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -1117,32 +1117,22 @@ css::uno::Sequence< css::ucb::ContentInfo > Content::queryCreatableContentsInfo( { if ( isFolder( xEnv ) ) { - css::uno::Sequence< css::ucb::ContentInfo > seq(2); // Minimum set of props we really need - css::uno::Sequence< css::beans::Property > props( 1 ); - props[0] = css::beans::Property( - "Title", - -1, - cppu::UnoType<OUString>::get(), - css::beans::PropertyAttribute::MAYBEVOID | css::beans::PropertyAttribute::BOUND ); - - // file - seq[0].Type = GIO_FILE_TYPE; - seq[0].Attributes = ( css::ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | - css::ucb::ContentInfoAttribute::KIND_DOCUMENT ); - seq[0].Properties = props; - - // folder - seq[1].Type = GIO_FOLDER_TYPE; - seq[1].Attributes = css::ucb::ContentInfoAttribute::KIND_FOLDER; - seq[1].Properties = props; - - return seq; + css::uno::Sequence< css::beans::Property > props + { + { "Title", -1, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID | css::beans::PropertyAttribute::BOUND } + }; + + return + { + { GIO_FILE_TYPE, ( css::ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | css::ucb::ContentInfoAttribute::KIND_DOCUMENT ), props }, + { GIO_FOLDER_TYPE, css::ucb::ContentInfoAttribute::KIND_FOLDER, props } + }; } else { - return css::uno::Sequence< css::ucb::ContentInfo >(); + return {}; } } |