summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/sxmspitm.hxx22
-rw-r--r--svx/source/svdraw/svdattr.cxx4
-rw-r--r--svx/source/svdraw/svdobj.cxx8
3 files changed, 12 insertions, 22 deletions
diff --git a/include/svx/sxmspitm.hxx b/include/svx/sxmspitm.hxx
index 6cfd5b2ca752..9859ebf48de2 100644
--- a/include/svx/sxmspitm.hxx
+++ b/include/svx/sxmspitm.hxx
@@ -22,23 +22,13 @@
#include <svx/svddef.hxx>
#include <svx/sdynitm.hxx>
+inline SdrYesNoItem makeSdrObjMoveProtectItem(bool bOn) {
+ return SdrYesNoItem(SDRATTR_OBJMOVEPROTECT, bOn);
+}
-// class SdrMoveProtectItem
-
-class SdrObjMoveProtectItem: public SdrYesNoItem {
-public:
- SdrObjMoveProtectItem(bool bOn=false): SdrYesNoItem(SDRATTR_OBJMOVEPROTECT,bOn) {}
- SdrObjMoveProtectItem(SvStream& rIn): SdrYesNoItem(SDRATTR_OBJMOVEPROTECT,rIn) {}
-};
-
-
-// class SdrSizeProtectItem
-
-class SdrObjSizeProtectItem: public SdrYesNoItem {
-public:
- SdrObjSizeProtectItem(bool bOn=false): SdrYesNoItem(SDRATTR_OBJSIZEPROTECT,bOn) {}
- SdrObjSizeProtectItem(SvStream& rIn): SdrYesNoItem(SDRATTR_OBJSIZEPROTECT,rIn) {}
-};
+inline SdrYesNoItem makeSdrObjSizeProtectItem(bool bOn) {
+ return SdrYesNoItem(SDRATTR_OBJSIZEPROTECT, bOn);
+}
#endif
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 7d2e479273ec..08da659fb542 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -201,8 +201,8 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[SDRATTR_CIRCKIND -SDRATTR_START]=new SdrCircKindItem;
mppLocalPoolDefaults[SDRATTR_CIRCSTARTANGLE-SDRATTR_START]=new SdrCircStartAngleItem;
mppLocalPoolDefaults[SDRATTR_CIRCENDANGLE -SDRATTR_START]=new SdrCircEndAngleItem;
- mppLocalPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrObjMoveProtectItem;
- mppLocalPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrObjSizeProtectItem;
+ mppLocalPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJMOVEPROTECT, false);
+ mppLocalPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJSIZEPROTECT, false);
mppLocalPoolDefaults[SDRATTR_OBJPRINTABLE -SDRATTR_START]=new SdrObjPrintableItem;
mppLocalPoolDefaults[SDRATTR_OBJVISIBLE -SDRATTR_START]=new SdrObjVisibleItem;
mppLocalPoolDefaults[SDRATTR_LAYERID -SDRATTR_START]=new SdrLayerIdItem;
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 8b0ee8484829..c7a8b9610308 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2203,11 +2203,11 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
}
if (rAttr.GetItemState(SDRATTR_OBJMOVEPROTECT,true,&pPoolItem)==SFX_ITEM_SET) {
- bool b=((const SdrObjMoveProtectItem*)pPoolItem)->GetValue();
+ bool b=((const SdrYesNoItem*)pPoolItem)->GetValue();
SetMoveProtect(b);
}
if (rAttr.GetItemState(SDRATTR_OBJSIZEPROTECT,true,&pPoolItem)==SFX_ITEM_SET) {
- bool b=((const SdrObjSizeProtectItem*)pPoolItem)->GetValue();
+ bool b=((const SdrYesNoItem*)pPoolItem)->GetValue();
SetResizeProtect(b);
}
@@ -2283,8 +2283,8 @@ void SdrObject::TakeNotPersistAttr(SfxItemSet& rAttr, bool bMerge) const
{
const Rectangle& rSnap=GetSnapRect();
const Rectangle& rLogic=GetLogicRect();
- lcl_SetItem(rAttr,bMerge,SdrObjMoveProtectItem(IsMoveProtect()));
- lcl_SetItem(rAttr,bMerge,SdrObjSizeProtectItem(IsResizeProtect()));
+ lcl_SetItem(rAttr,bMerge,makeSdrObjMoveProtectItem(IsMoveProtect()));
+ lcl_SetItem(rAttr,bMerge,makeSdrObjSizeProtectItem(IsResizeProtect()));
lcl_SetItem(rAttr,bMerge,SdrObjPrintableItem(IsPrintable()));
lcl_SetItem(rAttr,bMerge,SdrObjVisibleItem(IsVisible()));
lcl_SetItem(rAttr,bMerge,SdrRotateAngleItem(GetRotateAngle()));