1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
24 using namespace fileaccess
;
25 using namespace com::sun::star
;
26 using namespace com::sun::star::uno
;
27 using namespace com::sun::star::ucb
;
31 #if OSL_DEBUG_LEVEL > 0
32 #define THROW_WHERE SAL_WHERE
34 #define THROW_WHERE ""
37 XPropertySetInfo_impl::XPropertySetInfo_impl( shell
* pMyShell
,const OUString
& aUnqPath
)
38 : m_pMyShell( pMyShell
),
39 m_xProvider( pMyShell
->m_pProvider
),
43 m_pMyShell
->m_pProvider
->acquire();
45 shell::ContentMap::iterator it
= m_pMyShell
->m_aContent
.find( aUnqPath
);
47 shell::PropertySet
& properties
= *(it
->second
.properties
);
48 shell::PropertySet::iterator it1
= properties
.begin();
50 m_seq
.realloc( properties
.size() );
52 while( it1
!= properties
.end() )
54 m_seq
[ m_count
++ ] = beans::Property( it1
->getPropertyName(),
57 it1
->getAttributes() );
63 XPropertySetInfo_impl::XPropertySetInfo_impl( shell
* pMyShell
,const Sequence
< beans::Property
>& seq
)
64 : m_pMyShell( pMyShell
),
65 m_count( seq
.getLength() ),
68 m_pMyShell
->m_pProvider
->acquire();
72 XPropertySetInfo_impl::~XPropertySetInfo_impl()
74 m_pMyShell
->m_pProvider
->release();
78 beans::Property SAL_CALL
79 XPropertySetInfo_impl::getPropertyByName(
80 const OUString
& aName
)
81 throw( beans::UnknownPropertyException
,
82 RuntimeException
, std::exception
)
84 for( sal_Int32 i
= 0; i
< m_seq
.getLength(); ++i
)
85 if( m_seq
[i
].Name
== aName
) return m_seq
[i
];
87 throw beans::UnknownPropertyException( THROW_WHERE
);
92 Sequence
< beans::Property
> SAL_CALL
93 XPropertySetInfo_impl::getProperties(
95 throw( RuntimeException
, std::exception
)
102 XPropertySetInfo_impl::hasPropertyByName(
103 const OUString
& aName
)
104 throw( RuntimeException
, std::exception
)
106 for( sal_Int32 i
= 0; i
< m_seq
.getLength(); ++i
)
107 if( m_seq
[i
].Name
== aName
) return true;
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */