From c8e327092a8419636ae447b3b82052e6aeb724a0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 15 Aug 2013 23:26:58 +0200 Subject: SfxEnumItem: cut out the middle man here too CntEnumItem, we hardly knew you existed. Change-Id: I54b489f22662f9a3305478d18438b13850444316 --- svl/Library_svl.mk | 1 - svl/source/items/cenumitm.cxx | 22 ++++++++++++++-------- svl/source/items/eitem.cxx | 27 --------------------------- 3 files changed, 14 insertions(+), 36 deletions(-) delete mode 100644 svl/source/items/eitem.cxx (limited to 'svl') diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk index fd28a7abe0e2..fbca2668d064 100644 --- a/svl/Library_svl.mk +++ b/svl/Library_svl.mk @@ -70,7 +70,6 @@ $(eval $(call gb_Library_add_exception_objects,svl,\ svl/source/items/ctypeitm \ svl/source/items/custritm \ svl/source/items/dateitem \ - svl/source/items/eitem \ svl/source/items/flagitem \ svl/source/items/globalnameitem \ svl/source/items/grabbagitem \ diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx index 42923fff766b..9e11d7102860 100644 --- a/svl/source/items/cenumitm.cxx +++ b/svl/source/items/cenumitm.cxx @@ -119,39 +119,45 @@ void SfxEnumItemInterface::SetBoolValue(sal_Bool) {} // -// class CntEnumItem +// class SfxEnumItem // -DBG_NAME(CntEnumItem) +DBG_NAME(SfxEnumItem) -CntEnumItem::CntEnumItem(sal_uInt16 which, SvStream & rStream): - SfxEnumItemInterface(which) +SfxEnumItem::SfxEnumItem(sal_uInt16 const nWhich, SvStream & rStream) + : SfxEnumItemInterface(nWhich) { m_nValue = 0; rStream >> m_nValue; } -TYPEINIT1(CntEnumItem, SfxEnumItemInterface) +TYPEINIT1(SfxEnumItem, SfxEnumItemInterface) // virtual -SvStream & CntEnumItem::Store(SvStream & rStream, sal_uInt16) const +SvStream & SfxEnumItem::Store(SvStream & rStream, sal_uInt16) const { rStream << m_nValue; return rStream; } // virtual -sal_uInt16 CntEnumItem::GetEnumValue() const +sal_uInt16 SfxEnumItem::GetEnumValue() const { return GetValue(); } // virtual -void CntEnumItem::SetEnumValue(sal_uInt16 nTheValue) +void SfxEnumItem::SetEnumValue(sal_uInt16 const nTheValue) { SetValue(nTheValue); } +void SfxEnumItem::SetValue(sal_uInt16 const nTheValue) +{ + DBG_ASSERT(GetRefCount() == 0, "SfxEnumItem::SetValue(): Pooled item"); + m_nValue = nTheValue; +} + // // class SfxBoolItem // diff --git a/svl/source/items/eitem.cxx b/svl/source/items/eitem.cxx deleted file mode 100644 index 0b37d072731e..000000000000 --- a/svl/source/items/eitem.cxx +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include -// -// class SfxEnumItem -// - -TYPEINIT1(SfxEnumItem, CntEnumItem); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3