[Libreoffice-commits] core.git: include/svl svx/inc svx/source
Stephan Bergmann
sbergman at redhat.com
Fri Aug 22 06:41:12 PDT 2014
include/svl/stritem.hxx | 2 +-
svx/inc/sxonitm.hxx | 9 +++------
svx/source/svdraw/svdattr.cxx | 2 +-
svx/source/svdraw/svdobj.cxx | 4 ++--
4 files changed, 7 insertions(+), 10 deletions(-)
New commits:
commit e426e448ce2bd889f287ce13295092a75fa6150d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Aug 22 15:40:30 2014 +0200
Consistency around SfxStringItem in svx/inc/sxonitm.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."
Change-Id: I694c42a53cb9041b51ef876416f0f61963b89f86
diff --git a/include/svl/stritem.hxx b/include/svl/stritem.hxx
index 8e3f061..8d6da4f 100644
--- a/include/svl/stritem.hxx
+++ b/include/svl/stritem.hxx
@@ -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) {}
diff --git a/svx/inc/sxonitm.hxx b/svx/inc/sxonitm.hxx
index 6c3916ed..820e398 100644
--- a/svx/inc/sxonitm.hxx
+++ b/svx/inc/sxonitm.hxx
@@ -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
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 08da659..cb790e5 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -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;
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index c7a8b96..8f02887 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -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()));
More information about the Libreoffice-commits
mailing list