loplugin:mergeclasses

Change-Id: I84dee96b7a1f72db46e3330ec5195367dfce894a
This commit is contained in:
Noel Grandin
2015-10-06 14:10:44 +02:00
parent 4281599a04
commit 2e658321f5
3 changed files with 9 additions and 34 deletions

View File

@@ -155,7 +155,6 @@ merge dbaui::(anonymous namespace)::ILabelProvider with dbaui::(anonymous namesp
merge dbaui::IApplicationController with dbaui::OApplicationController
merge dbaui::IEntryFilter with dbaui::(anonymous namespace)::FilterByEntryDataId
merge dbaui::OOdbcLibWrapper with dbaui::OOdbcEnumeration
merge dbaui::PropertyStorage with dbaui::SetItemPropertyStorage
merge dbaui::SbaGridListener with dbaui::SbaXDataBrowserController
merge dbmm::IMigrationProgress with dbmm::ProgressPage
merge dbmm::IProgressConsumer with dbmm::ProgressDelegator

View File

@@ -29,45 +29,27 @@ class SfxItemSet;
namespace dbaui
{
// PropertyStorage
class SAL_NO_VTABLE PropertyStorage
{
public:
virtual void getPropertyValue( css::uno::Any& _out_rValue ) const = 0;
virtual void setPropertyValue( const css::uno::Any& _rValue ) = 0;
virtual ~PropertyStorage();
};
typedef std::shared_ptr< PropertyStorage > PPropertyStorage;
typedef ::std::map< sal_Int32, PPropertyStorage > PropertyValues;
// SetItemPropertyStorage
typedef sal_uInt16 ItemId;
/** a PropertyStorage implementation which stores the value in an item set
*/
class SetItemPropertyStorage : public PropertyStorage
class SetItemPropertyStorage
{
public:
SetItemPropertyStorage( SfxItemSet& _rItemSet, const ItemId _nItemID )
SetItemPropertyStorage( SfxItemSet& _rItemSet, const sal_uInt16 _nItemID )
:m_rItemSet( _rItemSet )
,m_nItemID( _nItemID )
{
}
virtual ~SetItemPropertyStorage()
{
}
virtual void getPropertyValue( css::uno::Any& _out_rValue ) const SAL_OVERRIDE;
virtual void setPropertyValue( const css::uno::Any& _rValue ) SAL_OVERRIDE;
void getPropertyValue( css::uno::Any& _out_rValue ) const;
void setPropertyValue( const css::uno::Any& _rValue );
private:
SfxItemSet& m_rItemSet;
const ItemId m_nItemID;
SfxItemSet& m_rItemSet;
const sal_uInt16 m_nItemID;
};
typedef ::std::map< sal_Int32, std::shared_ptr< SetItemPropertyStorage > > PropertyValues;
} // namespace dbaui
#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_PROPERTYSTORAGE_HXX

View File

@@ -39,20 +39,14 @@ namespace dbaui
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::makeAny;
// PropertyStorage
PropertyStorage::~PropertyStorage()
{
}
// helper
namespace
{
#undef UNOTYPE
template < class ITEMTYPE, class UNOTYPE >
class ItemAdapter
{
public:
static bool trySet( SfxItemSet& _rSet, ItemId _nItemId, const Any& _rValue )
static bool trySet( SfxItemSet& _rSet, sal_uInt16 _nItemId, const Any& _rValue )
{
const SfxPoolItem& rItem( _rSet.Get( _nItemId ) );
const ITEMTYPE* pTypedItem = dynamic_cast< const ITEMTYPE* >( &rItem );