24#include <com/sun/star/uno/Sequence.h>
26#include <com/sun/star/beans/NamedValue.hpp>
27#include <com/sun/star/beans/PropertyValue.hpp>
29#include <osl/diagnose.h>
42 for (
auto const& elem : rUpdateItem)
43 (*this)[elem.first] = elem.second;
49 if (sActLocale.isEmpty())
57 if (pUINames !=
end())
58 lUINames << pUINames->second;
62 pUIName->second >>= sUIName;
64 if (!sUIName.isEmpty())
67 lUINames[sActLocale] <<= sUIName;
69 else if (!lUINames.
empty())
72 lUINames[sActLocale] >>= sUIName;
82 sal_Int32 c =
static_cast<sal_Int32
>(
size());
85 css::uno::Sequence< css::beans::PropertyValue > lList(c+2);
86 css::beans::PropertyValue* pList = lList.getArray();
92 const OUString& rName = pProp->first.maString;
93 const css::uno::Any& rValue = pProp->second;
95 if (!rValue.hasValue())
99 pList[
i].Name = rName ;
100 pList[
i].Value = rValue;
104 pList[
i].Value <<= bFinalized;
107 pList[
i].Value <<= bMandatory;
116 const css::uno::Any& aSet )
118 const css::uno::Type& aT1 = aSubSet.getValueType();
119 const css::uno::Type& aT2 = aSet.getValueType();
121 if (!aT1.equals(aT2))
126 if (aSubSet.hasValue() && aSet.hasValue())
128 css::uno::TypeClass aTypeClass = aT1.getTypeClass();
132 case css::uno::TypeClass_BOOLEAN :
133 case css::uno::TypeClass_BYTE :
134 case css::uno::TypeClass_SHORT :
135 case css::uno::TypeClass_UNSIGNED_SHORT :
136 case css::uno::TypeClass_LONG :
137 case css::uno::TypeClass_UNSIGNED_LONG :
138 case css::uno::TypeClass_HYPER :
139 case css::uno::TypeClass_UNSIGNED_HYPER :
140 case css::uno::TypeClass_FLOAT :
141 case css::uno::TypeClass_DOUBLE :
143 bool bIs = (aSubSet == aSet);
148 case css::uno::TypeClass_STRING :
149 return aSubSet == aSet;
153 case css::uno::TypeClass_STRUCT :
155 css::beans::PropertyValue p1;
156 css::beans::PropertyValue p2;
163 bool bIs = (p1.Name == p2.Name) &&
isSubSet(p1.Value, p2.Value);
167 css::beans::NamedValue
n1;
168 css::beans::NamedValue
n2;
182 case css::uno::TypeClass_SEQUENCE :
184 css::uno::Sequence< OUString > uno_s1;
185 css::uno::Sequence< OUString > uno_s2;
188 (aSubSet >>= uno_s1) &&
192 auto s2Begin = uno_s2.getConstArray();
193 auto s2End = uno_s2.getConstArray() + uno_s2.getLength();
195 for (
auto const& elem : uno_s1)
197 if (::std::find(s2Begin, s2End, elem) == s2End)
205 css::uno::Sequence< css::beans::PropertyValue > uno_p1;
206 css::uno::Sequence< css::beans::PropertyValue > uno_p2;
209 (aSubSet >>= uno_p1) &&
216 for (
auto const& elem : stl_p1)
219 if (it2 == stl_p2.
end())
223 if (!
isSubSet(elem.second, it2->second))
231 css::uno::Sequence< css::beans::NamedValue > uno_n1;
232 css::uno::Sequence< css::beans::NamedValue > uno_n2;
235 (aSubSet >>= uno_n1) &&
242 for (
auto const& elem : stl_n1)
245 if (it2 == stl_n2.
end())
249 if (!
isSubSet(elem.second, it2->second))
261 OSL_FAIL(
"isSubSet() ... this point should not be reached!");
268 for (
auto const& prop : lProps)
272 if (pItThis ==
end())
278 if (!
isSubSet(prop.Value, pItThis->second))
293 for (
auto const& prop : lProps)
300 if (pItThis ==
end())
308 if (
isSubSet(prop.Value, pItThis->second))
321 bMatchByExtension(false), bMatchByPattern(false), bPreselectedByDocumentService(false) {}
iterator find(const OUString &rKey)
css::uno::Sequence< css::beans::PropertyValue > getAsConstPropertyValueList() const
SequenceAsHashMapBase::const_iterator const_iterator
represent an item of a FilterCache instance.
void update(const CacheItem &rUpdateItem)
update only properties, which are given by the specified rItem.
bool haveProps(o3tl::span< const css::beans::NamedValue > lProps) const
check, if the given properties exist at this item.
css::uno::Sequence< css::beans::PropertyValue > getAsPackedPropertyValueList(bool bFinalized, bool bMandatory) const
convert this structure to a seq< PropertyValue > and ignore all empty properties!
CacheItem()
creates an empty item.
void validateUINames(const OUString &sActLocale)
because we know two UIName properties (a list with all locales and the value for the current locale o...
bool dontHaveProps(o3tl::span< const css::beans::NamedValue > lProps) const
check, if the given properties don't exist at this item.
constexpr OUStringLiteral PROPNAME_UINAME
used to identify a type item property against the configuration API and can be used at all name conta...
constexpr OUStringLiteral PROPNAME_MANDATORY
constexpr OUStringLiteral PROPNAME_UINAMES
constexpr OUStringLiteral PROPNAME_FINALIZED
implicit properties.
static bool isSubSet(const css::uno::Any &aSubSet, const css::uno::Any &aSet)