[Libreoffice-commits] core.git: cui/source include/svx sd/source svx/source
Stephan Bergmann
sbergman at redhat.com
Mon Aug 25 08:26:20 PDT 2014
cui/source/tabpages/transfrm.cxx | 4 ++--
include/svx/sderitm.hxx | 11 +++--------
sd/source/ui/func/fuconrec.cxx | 2 +-
svx/source/sdr/contact/viewcontactofsdrrectobj.cxx | 2 +-
svx/source/svdraw/svdattr.cxx | 2 +-
svx/source/svdraw/svdedtv1.cxx | 8 ++++----
svx/source/svdraw/svdfmtf.cxx | 2 +-
svx/source/svdraw/svdotext.cxx | 4 ++--
8 files changed, 15 insertions(+), 20 deletions(-)
New commits:
commit e0c2ea6bde31bd68e1794154b72fddcd40dda7f9
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Aug 25 17:25:18 2014 +0200
Consistency around SdrMetricItem in svx/sderitm.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."
Change-Id: I4a0715b18bc3aa032779252cad2450c905a467a4
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index fdc4d4e..42b441e 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -479,7 +479,7 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs)
long nTmp = GetCoreValue( *m_pMtrRadius, ePoolUnit );
nTmp = Fraction( nTmp ) * aUIScale;
- rAttrs->Put( SdrEckenradiusItem( nTmp ) );
+ rAttrs->Put( makeSdrEckenradiusItem( nTmp ) );
bModified = true;
}
@@ -528,7 +528,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
if( pItem )
{
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);
}
else
diff --git a/include/svx/sderitm.hxx b/include/svx/sderitm.hxx
index a6a22ec..ad03621 100644
--- a/include/svx/sderitm.hxx
+++ b/include/svx/sderitm.hxx
@@ -22,14 +22,9 @@
#include <svx/sdmetitm.hxx>
#include <svx/svddef.hxx>
-/**
- * class SdrEckenradiusItem
- */
-class SdrEckenradiusItem: public SdrMetricItem {
-public:
- SdrEckenradiusItem(long nRadius=0): SdrMetricItem(SDRATTR_ECKENRADIUS,nRadius) {}
- SdrEckenradiusItem(SvStream& rIn) : SdrMetricItem(SDRATTR_ECKENRADIUS,rIn) {}
-};
+inline SdrMetricItem makeSdrEckenradiusItem(long nRadius) {
+ return SdrMetricItem(SDRATTR_ECKENRADIUS, nRadius);
+}
#endif
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index ebd76dbc..ced9706 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -431,7 +431,7 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
nSlotId == SID_DRAW_SQUARE_ROUND_NOFILL)
{
// round corner
- rAttr.Put(SdrEckenradiusItem(500));
+ rAttr.Put(makeSdrEckenradiusItem(500));
}
else if (nSlotId == SID_CONNECTOR_LINE ||
nSlotId == SID_CONNECTOR_LINE_ARROW_START ||
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index 8a02658..2ab0173 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -71,7 +71,7 @@ namespace sdr
aObjectRange.getMinX(), aObjectRange.getMinY()));
// calculate corner radius
- sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
+ sal_uInt32 nCornerRadius(((SdrMetricItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
double fCornerRadiusX;
double fCornerRadiusY;
drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index dc43119..4dd3f77 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -139,7 +139,7 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[SDRATTR_CAPTIONESCABS -SDRATTR_START]=new SdrCaptionEscAbsItem ;
mppLocalPoolDefaults[SDRATTR_CAPTIONLINELEN -SDRATTR_START]=new SdrCaptionLineLenItem ;
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_AUTOGROWHEIGHT -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true);
mppLocalPoolDefaults[SDRATTR_TEXT_FITTOSIZE -SDRATTR_START]=new SdrTextFitToSizeTypeItem;
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 81b0564..e776a7c 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -1386,11 +1386,11 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const
}
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) {
aRetSet.InvalidateItem(SDRATTR_ECKENRADIUS);
} else if (eState==SFX_ITEM_SET) {
- aRetSet.Put(SdrEckenradiusItem(nRadius));
+ aRetSet.Put(makeSdrEckenradiusItem(nRadius));
}
basegfx::B2DHomMatrix aTransformation;
@@ -1593,8 +1593,8 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
// corner radius
if (bEdgeRadiusAllowed && SFX_ITEM_SET==rAttr.GetItemState(SDRATTR_ECKENRADIUS,true,&pPoolItem)) {
- long nRadius=((SdrEckenradiusItem*)pPoolItem)->GetValue();
- aSetAttr.Put(SdrEckenradiusItem(nRadius));
+ long nRadius=((SdrMetricItem*)pPoolItem)->GetValue();
+ aSetAttr.Put(makeSdrEckenradiusItem(nRadius));
bSetAttr=true;
}
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index adb8575..2da6c1b 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -735,7 +735,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction& rAct)
long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2;
if (nRad!=0) {
SfxItemSet aSet(*mpLineAttr->GetPool(), SDRATTR_ECKENRADIUS, SDRATTR_ECKENRADIUS, 0, 0);
- aSet.Put(SdrEckenradiusItem(nRad));
+ aSet.Put(SdrMetricItem(nRad));
pRect->SetMergedItemSet(aSet);
}
InsertObj(pRect);
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 7e339f2..d74d9b0 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -540,7 +540,7 @@ void SdrTextObj::SetModel(SdrModel* pNewModel)
bool SdrTextObj::NbcSetEckenradius(long nRad)
{
- SetObjectItem(SdrEckenradiusItem(nRad));
+ SetObjectItem(makeSdrEckenradiusItem(nRad));
return true;
}
@@ -1756,7 +1756,7 @@ bool SdrTextObj::IsRealyEdited() const
long SdrTextObj::GetEckenradius() const
{
- return ((SdrEckenradiusItem&)(GetObjectItemSet().Get(SDRATTR_ECKENRADIUS))).GetValue();
+ return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_ECKENRADIUS))).GetValue();
}
long SdrTextObj::GetMinTextFrameHeight() const
More information about the Libreoffice-commits
mailing list