21#include <osl/diagnose.h>
32 uno::Sequence<OUString> aNode {
"Office.Common/Passwords/AuthenticateUsingSystemCredentials" };
38 const uno::Sequence< OUString > & )
54uno::Sequence< OUString >
61uno::Sequence< OUString >
67 uno::Sequence<OUString>
aPropNames {
"AuthenticateUsingSystemCredentials" };
68 uno::Sequence< uno::Any > aAnyValues(
72 aAnyValues.getLength() == 1,
73 "SysCredentialsConfigItem::getSystemCredentialsURLs: "
74 "Error reading config item!" );
76 uno::Sequence< OUString > aValues;
77 if ( ( aAnyValues[ 0 ] >>= aValues ) ||
78 ( !aAnyValues[ 0 ].hasValue() ) )
88 const uno::Sequence< OUString > & seqURLList )
91 uno::Sequence< OUString >
aPropNames{
"AuthenticateUsingSystemCredentials" };
92 uno::Sequence< uno::Any > aPropValues{
uno::Any(seqURLList) };
107 bool removeLastSegment( OUString & aURL )
109 sal_Int32 aInd =
aURL.lastIndexOf(
'/' );
113 sal_Int32 aPrevInd =
aURL.lastIndexOf(
'/', aInd );
114 if (
aURL.indexOf(
"://" ) != aPrevInd - 2 ||
115 aInd !=
aURL.getLength() - 1 )
125 bool findURL( std::set<OUString>
const & rContainer, OUString
const & aURL, OUString & aResult )
128 if( !rContainer.empty() && !
aURL.isEmpty() )
130 OUString aUrl( aURL );
137 auto aIter = rContainer.find( aUrl );
138 if( aIter != rContainer.end() )
145 OUString tmpUrl( aUrl );
146 if ( !tmpUrl.endsWith(
"/") )
149 aIter = rContainer.lower_bound( tmpUrl );
150 if( aIter != rContainer.end() && aIter->match( tmpUrl ) )
157 while( removeLastSegment( aUrl ) && !aUrl.isEmpty() );
166: m_aConfigItem( this ),
167 m_bCfgInited( false )
175 const uno::Sequence< OUString > aURLs(
184 OSL_ENSURE(
m_bCfgInited,
"SysCredentialsConfig::writeCfg : not initialized!" );
191 std::unique_lock aGuard(
m_aMutex );
205 std::unique_lock aGuard(
m_aMutex );
242 uno::Sequence< OUString > aResult(
nCount );
243 auto aResultRange = asNonConstRange(aResult);
248 aResultRange[
n ] = rItem;
252 if ( !bOnlyPersistent )
256 aResultRange[
n ] = rItem;
265 std::unique_lock aGuard(
m_aMutex );
css::uno::Sequence< OUString > m_seqURLs
virtual void Notify(const css::uno::Sequence< OUString > &seqPropertyNames) override
css::uno::Sequence< OUString > getSystemCredentialsURLs()
void setSystemCredentialsURLs(const css::uno::Sequence< OUString > &seqURLList)
virtual void ImplCommit() override
SysCredentialsConfig * m_pOwner
SysCredentialsConfigItem(SysCredentialsConfig *pOwner)
OUString find(OUString const &rURL)
std::set< OUString > m_aCfgContainer
css::uno::Sequence< OUString > list(bool bOnlyPersistent)
void writeCfg(std::unique_lock< std::mutex > &rGuard)
std::set< OUString > m_aMemContainer
void remove(OUString const &rURL)
void persistentConfigChanged()
void add(OUString const &rURL, bool bPersistent)
void initCfg(std::unique_lock< std::mutex > &rGuard)
SysCredentialsConfigItem m_aConfigItem
static bool PutProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, const css::uno::Sequence< css::uno::Any > &rValues, bool bAllLocales)
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
static css::uno::Sequence< css::uno::Any > GetProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, bool bAllLocales)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
const PropertyStruct aPropNames[]
ContentProvider * m_pOwner