Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/ucb/source/ucp/file/filprp.cxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#include "filtask.hxx"
21
#include "prov.hxx"
22
#include "filprp.hxx"
23
#include "filinl.hxx"
24
25
using namespace fileaccess;
26
using namespace com::sun::star;
27
using namespace com::sun::star::uno;
28
29
XPropertySetInfo_impl::XPropertySetInfo_impl( TaskManager* pMyShell,const OUString& aUnqPath )
30
0
    : m_pMyShell( pMyShell ),
31
0
      m_seq( 0 )
32
0
{
33
0
    m_pMyShell->m_pProvider->acquire();
34
35
0
    TaskManager::ContentMap::iterator it = m_pMyShell->m_aContent.find( aUnqPath );
36
37
0
    TaskManager::PropertySet& properties = it->second.properties;
38
39
0
    m_seq.realloc( properties.size() );
40
0
    auto p_seq = m_seq.getArray();
41
42
0
    sal_Int32 count = 0;
43
0
    for( const auto& rProp : properties )
44
0
    {
45
0
        p_seq[ count++ ] = beans::Property( rProp.getPropertyName(),
46
0
                                            rProp.getHandle(),
47
0
                                            rProp.getType(),
48
0
                                            rProp.getAttributes() );
49
0
    }
50
0
}
51
52
53
XPropertySetInfo_impl::XPropertySetInfo_impl( TaskManager* pMyShell,const Sequence< beans::Property >& seq )
54
0
    : m_pMyShell( pMyShell ),
55
0
      m_seq( seq )
56
0
{
57
0
    m_pMyShell->m_pProvider->acquire();
58
0
}
59
60
61
XPropertySetInfo_impl::~XPropertySetInfo_impl()
62
0
{
63
0
    m_pMyShell->m_pProvider->release();
64
0
}
65
66
67
beans::Property SAL_CALL
68
XPropertySetInfo_impl::getPropertyByName( const OUString& aName )
69
0
{
70
0
    auto pProp = std::find_if(std::cbegin(m_seq), std::cend(m_seq),
71
0
        [&aName](const beans::Property& rProp) { return rProp.Name == aName; });
72
0
    if (pProp != std::cend(m_seq))
73
0
        return *pProp;
74
75
0
    throw beans::UnknownPropertyException( aName );
76
0
}
77
78
79
Sequence< beans::Property > SAL_CALL
80
XPropertySetInfo_impl::getProperties()
81
0
{
82
0
  return m_seq;
83
0
}
84
85
86
sal_Bool SAL_CALL
87
XPropertySetInfo_impl::hasPropertyByName( const OUString& aName )
88
0
{
89
0
    return std::any_of(std::cbegin(m_seq), std::cend(m_seq),
90
0
        [&aName](const beans::Property& rProp) { return rProp.Name == aName; });
91
0
}
92
93
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */