13#include <rtl/ustrbuf.hxx>
15#include <com/sun/star/beans/PropertyAttribute.hpp>
16#include <com/sun/star/beans/XPropertySet.hpp>
17#include <com/sun/star/beans/XPropertyContainer.hpp>
25 OUStringBuffer sRepresentation;
29 switch (rResult.meType)
35 sRepresentation.append(rResult.msName);
39 sRepresentation.append(
" ");
43 return sRepresentation.makeStringAndClear();
46OUString
getProperty(uno::Reference<beans::XPropertyContainer>
const& rxPropertyContainer,
47 OUString
const& rName)
51 uno::Reference<beans::XPropertySet> xPropertySet(rxPropertyContainer, uno::UNO_QUERY);
52 return xPropertySet->getPropertyValue(rName).get<OUString>();
54 catch (
const css::uno::Exception&)
61bool containsProperty(uno::Sequence<beans::Property>
const& rProperties, std::u16string_view rName)
63 return std::any_of(rProperties.begin(), rProperties.end(),
64 [&](
const beans::Property& rProperty) { return rProperty.Name == rName; });
69 uno::Reference<beans::XPropertySet> xPropertySet(rxPropertyContainer, uno::UNO_QUERY);
71 = xPropertySet->getPropertySetInfo()->getProperties();
73 for (
const beans::Property& rProperty :
aProperties)
75 rxPropertyContainer->removeProperty(rProperty.Name);
80 uno::Reference<beans::XPropertyContainer>
const& rxPropertyContainer, OUString
const& rsKey,
81 OUString
const& rsValue)
83 uno::Reference<beans::XPropertySet> xPropertySet(rxPropertyContainer, uno::UNO_QUERY);
87 if (
containsProperty(xPropertySet->getPropertySetInfo()->getProperties(), rsKey))
88 xPropertySet->setPropertyValue(rsKey,
uno::Any(rsValue));
90 rxPropertyContainer->addProperty(rsKey, beans::PropertyAttribute::REMOVABLE,
93 catch (
const uno::Exception& )
101 uno::Reference<beans::XPropertyContainer>
const& rxPropertyContainer,
103 std::vector<svx::ClassificationResult>
const& rResults)
119 ? OUString(
"BAF_POLICY")
120 : OUString(
"MANUAL");
PropertiesInfo aProperties
OUString makeCreationOriginKey() const
OUString makeFullTextualRepresentationKey() const
ClassificationCreationOrigin
bool containsProperty(uno::Sequence< beans::Property > const &rProperties, std::u16string_view rName)
OUString convertClassificationResultToString(std::vector< svx::ClassificationResult > const &rResults)
OUString getProperty(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, OUString const &rName)
void insertFullTextualRepresentationAsDocumentProperty(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, sfx::ClassificationKeyCreator const &rKeyCreator, std::vector< svx::ClassificationResult > const &rResults)
void insertCreationOrigin(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, sfx::ClassificationKeyCreator const &rKeyCreator, sfx::ClassificationCreationOrigin eOrigin)
bool addOrInsertDocumentProperty(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, OUString const &rsKey, OUString const &rsValue)
void removeAllProperties(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer)
@ INTELLECTUAL_PROPERTY_PART