[Libreoffice-commits] core.git: include/svx svx/source
Stephan Bergmann
sbergman at redhat.com
Fri Aug 22 05:46:50 PDT 2014
include/svx/sxmspitm.hxx | 22 ++++++----------------
svx/source/svdraw/svdattr.cxx | 4 ++--
svx/source/svdraw/svdobj.cxx | 8 ++++----
3 files changed, 12 insertions(+), 22 deletions(-)
New commits:
commit 9a6d1c6e16132253327e27b5f7a8cff6b8fa4bc9
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Aug 22 14:45:43 2014 +0200
Consistency around SdrYesNoItem in svx/sxmspitm.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."
Change-Id: If7a3c3834f63bd0b358da4d05e9510c3f695c5d0
diff --git a/include/svx/sxmspitm.hxx b/include/svx/sxmspitm.hxx
index 6cfd5b2..9859ebf 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 7d2e479..08da659 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 8b0ee84..c7a8b96 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()));
More information about the Libreoffice-commits
mailing list