Consistency around SdrMetricItem in svx/sderitm.hxx

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

Change-Id: I4a0715b18bc3aa032779252cad2450c905a467a4
This commit is contained in:
Stephan Bergmann
2014-08-25 17:25:18 +02:00
parent c6477b9dd1
commit e0c2ea6bde
8 changed files with 15 additions and 20 deletions

View File

@@ -479,7 +479,7 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs)
long nTmp = GetCoreValue( *m_pMtrRadius, ePoolUnit ); long nTmp = GetCoreValue( *m_pMtrRadius, ePoolUnit );
nTmp = Fraction( nTmp ) * aUIScale; nTmp = Fraction( nTmp ) * aUIScale;
rAttrs->Put( SdrEckenradiusItem( nTmp ) ); rAttrs->Put( makeSdrEckenradiusItem( nTmp ) );
bModified = true; bModified = true;
} }
@@ -528,7 +528,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
if( pItem ) if( pItem )
{ {
const double fUIScale(double(pView->GetModel()->GetUIScale())); const double fUIScale(double(pView->GetModel()->GetUIScale()));
const double fTmp((double)((const SdrEckenradiusItem*)pItem)->GetValue() / fUIScale); const double fTmp((double)((const SdrMetricItem*)pItem)->GetValue() / fUIScale);
SetMetricValue(*m_pMtrRadius, basegfx::fround(fTmp), ePoolUnit); SetMetricValue(*m_pMtrRadius, basegfx::fround(fTmp), ePoolUnit);
} }
else else

View File

@@ -22,14 +22,9 @@
#include <svx/sdmetitm.hxx> #include <svx/sdmetitm.hxx>
#include <svx/svddef.hxx> #include <svx/svddef.hxx>
/** inline SdrMetricItem makeSdrEckenradiusItem(long nRadius) {
* class SdrEckenradiusItem return SdrMetricItem(SDRATTR_ECKENRADIUS, nRadius);
*/ }
class SdrEckenradiusItem: public SdrMetricItem {
public:
SdrEckenradiusItem(long nRadius=0): SdrMetricItem(SDRATTR_ECKENRADIUS,nRadius) {}
SdrEckenradiusItem(SvStream& rIn) : SdrMetricItem(SDRATTR_ECKENRADIUS,rIn) {}
};
#endif #endif

View File

@@ -431,7 +431,7 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
nSlotId == SID_DRAW_SQUARE_ROUND_NOFILL) nSlotId == SID_DRAW_SQUARE_ROUND_NOFILL)
{ {
// round corner // round corner
rAttr.Put(SdrEckenradiusItem(500)); rAttr.Put(makeSdrEckenradiusItem(500));
} }
else if (nSlotId == SID_CONNECTOR_LINE || else if (nSlotId == SID_CONNECTOR_LINE ||
nSlotId == SID_CONNECTOR_LINE_ARROW_START || nSlotId == SID_CONNECTOR_LINE_ARROW_START ||

View File

@@ -71,7 +71,7 @@ namespace sdr
aObjectRange.getMinX(), aObjectRange.getMinY())); aObjectRange.getMinX(), aObjectRange.getMinY()));
// calculate corner radius // calculate corner radius
sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue()); sal_uInt32 nCornerRadius(((SdrMetricItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
double fCornerRadiusX; double fCornerRadiusX;
double fCornerRadiusY; double fCornerRadiusY;
drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY); drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);

View File

@@ -139,7 +139,7 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[SDRATTR_CAPTIONESCABS -SDRATTR_START]=new SdrCaptionEscAbsItem ; mppLocalPoolDefaults[SDRATTR_CAPTIONESCABS -SDRATTR_START]=new SdrCaptionEscAbsItem ;
mppLocalPoolDefaults[SDRATTR_CAPTIONLINELEN -SDRATTR_START]=new SdrCaptionLineLenItem ; mppLocalPoolDefaults[SDRATTR_CAPTIONLINELEN -SDRATTR_START]=new SdrCaptionLineLenItem ;
mppLocalPoolDefaults[SDRATTR_CAPTIONFITLINELEN-SDRATTR_START]=new SdrCaptionFitLineLenItem; mppLocalPoolDefaults[SDRATTR_CAPTIONFITLINELEN-SDRATTR_START]=new SdrCaptionFitLineLenItem;
mppLocalPoolDefaults[SDRATTR_ECKENRADIUS -SDRATTR_START]=new SdrEckenradiusItem; mppLocalPoolDefaults[SDRATTR_ECKENRADIUS -SDRATTR_START]=new SdrMetricItem(SDRATTR_ECKENRADIUS, 0);
mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEHEIGHT -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, 0); mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEHEIGHT -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, 0);
mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWHEIGHT -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true); mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWHEIGHT -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true);
mppLocalPoolDefaults[SDRATTR_TEXT_FITTOSIZE -SDRATTR_START]=new SdrTextFitToSizeTypeItem; mppLocalPoolDefaults[SDRATTR_TEXT_FITTOSIZE -SDRATTR_START]=new SdrTextFitToSizeTypeItem;

View File

@@ -1386,11 +1386,11 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const
} }
eState=aMarkAttr.GetItemState(SDRATTR_ECKENRADIUS); eState=aMarkAttr.GetItemState(SDRATTR_ECKENRADIUS);
long nRadius=((SdrEckenradiusItem&)(aMarkAttr.Get(SDRATTR_ECKENRADIUS))).GetValue(); long nRadius=((SdrMetricItem&)(aMarkAttr.Get(SDRATTR_ECKENRADIUS))).GetValue();
if (eState==SFX_ITEM_DONTCARE) { if (eState==SFX_ITEM_DONTCARE) {
aRetSet.InvalidateItem(SDRATTR_ECKENRADIUS); aRetSet.InvalidateItem(SDRATTR_ECKENRADIUS);
} else if (eState==SFX_ITEM_SET) { } else if (eState==SFX_ITEM_SET) {
aRetSet.Put(SdrEckenradiusItem(nRadius)); aRetSet.Put(makeSdrEckenradiusItem(nRadius));
} }
basegfx::B2DHomMatrix aTransformation; basegfx::B2DHomMatrix aTransformation;
@@ -1593,8 +1593,8 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
// corner radius // corner radius
if (bEdgeRadiusAllowed && SFX_ITEM_SET==rAttr.GetItemState(SDRATTR_ECKENRADIUS,true,&pPoolItem)) { if (bEdgeRadiusAllowed && SFX_ITEM_SET==rAttr.GetItemState(SDRATTR_ECKENRADIUS,true,&pPoolItem)) {
long nRadius=((SdrEckenradiusItem*)pPoolItem)->GetValue(); long nRadius=((SdrMetricItem*)pPoolItem)->GetValue();
aSetAttr.Put(SdrEckenradiusItem(nRadius)); aSetAttr.Put(makeSdrEckenradiusItem(nRadius));
bSetAttr=true; bSetAttr=true;
} }

View File

@@ -735,7 +735,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction& rAct)
long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2; long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2;
if (nRad!=0) { if (nRad!=0) {
SfxItemSet aSet(*mpLineAttr->GetPool(), SDRATTR_ECKENRADIUS, SDRATTR_ECKENRADIUS, 0, 0); SfxItemSet aSet(*mpLineAttr->GetPool(), SDRATTR_ECKENRADIUS, SDRATTR_ECKENRADIUS, 0, 0);
aSet.Put(SdrEckenradiusItem(nRad)); aSet.Put(SdrMetricItem(nRad));
pRect->SetMergedItemSet(aSet); pRect->SetMergedItemSet(aSet);
} }
InsertObj(pRect); InsertObj(pRect);

View File

@@ -540,7 +540,7 @@ void SdrTextObj::SetModel(SdrModel* pNewModel)
bool SdrTextObj::NbcSetEckenradius(long nRad) bool SdrTextObj::NbcSetEckenradius(long nRad)
{ {
SetObjectItem(SdrEckenradiusItem(nRad)); SetObjectItem(makeSdrEckenradiusItem(nRad));
return true; return true;
} }
@@ -1756,7 +1756,7 @@ bool SdrTextObj::IsRealyEdited() const
long SdrTextObj::GetEckenradius() const long SdrTextObj::GetEckenradius() const
{ {
return ((SdrEckenradiusItem&)(GetObjectItemSet().Get(SDRATTR_ECKENRADIUS))).GetValue(); return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_ECKENRADIUS))).GetValue();
} }
long SdrTextObj::GetMinTextFrameHeight() const long SdrTextObj::GetMinTextFrameHeight() const