Consistency around SfxStringItem in svx/inc/sxonitm.hxx

...similar to what has been done for svx/sdtmfitm.hxx in
6a2ea81ca1 "Remove unused ctors" and
68969cc61a "Consistency around SdrMetricItem."

Change-Id: I694c42a53cb9041b51ef876416f0f61963b89f86
This commit is contained in:
Stephan Bergmann
2014-08-22 15:40:30 +02:00
parent 1cbd9f7fbe
commit e426e448ce
4 changed files with 7 additions and 10 deletions

View File

@@ -29,7 +29,7 @@ class SVL_DLLPUBLIC SfxStringItem: public CntUnencodedStringItem
public:
TYPEINFO_OVERRIDE();
SfxStringItem() {}
SfxStringItem(sal_uInt16 which = 0): CntUnencodedStringItem(which) {}
SfxStringItem(sal_uInt16 which, const OUString & rValue):
CntUnencodedStringItem(which, rValue) {}

View File

@@ -22,12 +22,9 @@
#include <svx/svddef.hxx>
#include <svl/stritem.hxx>
class SdrObjectNameItem: public SfxStringItem {
public:
SdrObjectNameItem() : SfxStringItem() { SetWhich(SDRATTR_OBJECTNAME); }
SdrObjectNameItem(const OUString& rStr) : SfxStringItem(SDRATTR_OBJECTNAME,rStr) {}
SdrObjectNameItem(SvStream& rIn) : SfxStringItem(SDRATTR_OBJECTNAME,rIn) {}
};
inline SfxStringItem makeSdrObjectNameItem(const OUString& rStr) {
return SfxStringItem(SDRATTR_OBJECTNAME,rStr);
}
#endif

View File

@@ -207,7 +207,7 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[SDRATTR_OBJVISIBLE -SDRATTR_START]=new SdrObjVisibleItem;
mppLocalPoolDefaults[SDRATTR_LAYERID -SDRATTR_START]=new SdrLayerIdItem;
mppLocalPoolDefaults[SDRATTR_LAYERNAME -SDRATTR_START]=new SdrLayerNameItem;
mppLocalPoolDefaults[SDRATTR_OBJECTNAME -SDRATTR_START]=new SdrObjectNameItem;
mppLocalPoolDefaults[SDRATTR_OBJECTNAME -SDRATTR_START]=new SfxStringItem(SDRATTR_OBJECTNAME);
mppLocalPoolDefaults[SDRATTR_ALLPOSITIONX -SDRATTR_START]=new SdrAllPositionXItem;
mppLocalPoolDefaults[SDRATTR_ALLPOSITIONY -SDRATTR_START]=new SdrAllPositionYItem;
mppLocalPoolDefaults[SDRATTR_ALLSIZEWIDTH -SDRATTR_START]=new SdrAllSizeWidthItem;

View File

@@ -2245,7 +2245,7 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
}
if (rAttr.GetItemState(SDRATTR_OBJECTNAME,true,&pPoolItem)==SFX_ITEM_SET) {
OUString aName=((const SdrObjectNameItem*)pPoolItem)->GetValue();
OUString aName=((const SfxStringItem*)pPoolItem)->GetValue();
SetName(aName);
}
Rectangle aNewLogic(rLogic);
@@ -2303,7 +2303,7 @@ void SdrObject::TakeNotPersistAttr(SfxItemSet& rAttr, bool bMerge) const
if (!aName.isEmpty())
{
lcl_SetItem(rAttr, bMerge, SdrObjectNameItem(aName));
lcl_SetItem(rAttr, bMerge, makeSdrObjectNameItem(aName));
}
lcl_SetItem(rAttr,bMerge,SdrLayerIdItem(GetLayer()));