Kaydet (Commit) 05a5d043 authored tarafından Noel Grandin's avatar Noel Grandin

rename nStartWink->nStartAngle

Change-Id: I2bc3e0eed4846fca066bfacce4165f392b398666
üst 0516d123
...@@ -33,7 +33,7 @@ namespace sdr { namespace properties { ...@@ -33,7 +33,7 @@ namespace sdr { namespace properties {
class SdrCircObjGeoData : public SdrTextObjGeoData class SdrCircObjGeoData : public SdrTextObjGeoData
{ {
public: public:
long nStartWink; long nStartAngle;
long nEndWink; long nEndWink;
}; };
...@@ -53,7 +53,7 @@ protected: ...@@ -53,7 +53,7 @@ protected:
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() SAL_OVERRIDE; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() SAL_OVERRIDE;
SdrObjKind meCircleKind; SdrObjKind meCircleKind;
long nStartWink; long nStartAngle;
long nEndWink; long nEndWink;
private: private:
SVX_DLLPRIVATE basegfx::B2DPolygon ImpCalcXPolyCirc(const SdrObjKind eKind, const Rectangle& rRect1, long nStart, long nEnd) const; SVX_DLLPRIVATE basegfx::B2DPolygon ImpCalcXPolyCirc(const SdrObjKind eKind, const Rectangle& rRect1, long nStart, long nEnd) const;
...@@ -122,7 +122,7 @@ protected: ...@@ -122,7 +122,7 @@ protected:
virtual void SaveGeoData(SdrObjGeoData& rGeo) const SAL_OVERRIDE; virtual void SaveGeoData(SdrObjGeoData& rGeo) const SAL_OVERRIDE;
virtual void RestGeoData(const SdrObjGeoData& rGeo) SAL_OVERRIDE; virtual void RestGeoData(const SdrObjGeoData& rGeo) SAL_OVERRIDE;
public: public:
long GetStartWink() const { return nStartWink; } long GetStartWink() const { return nStartAngle; }
long GetEndWink() const { return nEndWink; } long GetEndWink() const { return nEndWink; }
}; };
......
...@@ -110,7 +110,7 @@ TYPEINIT1(SdrCircObj,SdrRectObj); ...@@ -110,7 +110,7 @@ TYPEINIT1(SdrCircObj,SdrRectObj);
SdrCircObj::SdrCircObj(SdrObjKind eNewKind) SdrCircObj::SdrCircObj(SdrObjKind eNewKind)
{ {
nStartWink=0; nStartAngle=0;
nEndWink=36000; nEndWink=36000;
meCircleKind=eNewKind; meCircleKind=eNewKind;
bClosedObj=eNewKind!=OBJ_CARC; bClosedObj=eNewKind!=OBJ_CARC;
...@@ -119,7 +119,7 @@ SdrCircObj::SdrCircObj(SdrObjKind eNewKind) ...@@ -119,7 +119,7 @@ SdrCircObj::SdrCircObj(SdrObjKind eNewKind)
SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect): SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect):
SdrRectObj(rRect) SdrRectObj(rRect)
{ {
nStartWink=0; nStartAngle=0;
nEndWink=36000; nEndWink=36000;
meCircleKind=eNewKind; meCircleKind=eNewKind;
bClosedObj=eNewKind!=OBJ_CARC; bClosedObj=eNewKind!=OBJ_CARC;
...@@ -129,7 +129,7 @@ SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect, long nNewSta ...@@ -129,7 +129,7 @@ SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect, long nNewSta
SdrRectObj(rRect) SdrRectObj(rRect)
{ {
long nWinkDif=nNewEndWink-nNewStartWink; long nWinkDif=nNewEndWink-nNewStartWink;
nStartWink=NormAngle360(nNewStartWink); nStartAngle=NormAngle360(nNewStartWink);
nEndWink=NormAngle360(nNewEndWink); nEndWink=NormAngle360(nNewEndWink);
if (nWinkDif==36000) nEndWink+=nWinkDif; // full circle if (nWinkDif==36000) nEndWink+=nWinkDif; // full circle
meCircleKind=eNewKind; meCircleKind=eNewKind;
...@@ -198,7 +198,7 @@ bool SdrCircObj::PaintNeedsXPolyCirc() const ...@@ -198,7 +198,7 @@ bool SdrCircObj::PaintNeedsXPolyCirc() const
bNeed = eFill != drawing::FillStyle_NONE && eFill != drawing::FillStyle_SOLID; bNeed = eFill != drawing::FillStyle_NONE && eFill != drawing::FillStyle_SOLID;
} }
if(!bNeed && meCircleKind != OBJ_CIRC && nStartWink == nEndWink) if(!bNeed && meCircleKind != OBJ_CIRC && nStartAngle == nEndWink)
bNeed = true; // otherwise we're drawing a full circle bNeed = true; // otherwise we're drawing a full circle
return bNeed; return bNeed;
...@@ -279,7 +279,7 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrObjKind eCicrleKind, c ...@@ -279,7 +279,7 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrObjKind eCicrleKind, c
void SdrCircObj::RecalcXPoly() void SdrCircObj::RecalcXPoly()
{ {
const basegfx::B2DPolygon aPolyCirc(ImpCalcXPolyCirc(meCircleKind, aRect, nStartWink, nEndWink)); const basegfx::B2DPolygon aPolyCirc(ImpCalcXPolyCirc(meCircleKind, aRect, nStartAngle, nEndWink));
mpXPoly = new XPolygon(aPolyCirc); mpXPoly = new XPolygon(aPolyCirc);
} }
...@@ -346,7 +346,7 @@ SdrCircObj* SdrCircObj::Clone() const ...@@ -346,7 +346,7 @@ SdrCircObj* SdrCircObj::Clone() const
basegfx::B2DPolyPolygon SdrCircObj::TakeXorPoly() const basegfx::B2DPolyPolygon SdrCircObj::TakeXorPoly() const
{ {
const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, aRect, nStartWink, nEndWink)); const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, aRect, nStartAngle, nEndWink));
return basegfx::B2DPolyPolygon(aCircPolygon); return basegfx::B2DPolyPolygon(aCircPolygon);
} }
...@@ -405,7 +405,7 @@ SdrHdl* SdrCircObj::GetHdl(sal_uInt32 nHdlNum) const ...@@ -405,7 +405,7 @@ SdrHdl* SdrCircObj::GetHdl(sal_uInt32 nHdlNum) const
switch (nHdlNum) switch (nHdlNum)
{ {
case 0: case 0:
aPnt = GetWinkPnt(aRect,nStartWink); aPnt = GetWinkPnt(aRect,nStartAngle);
eLocalKind = HDL_CIRC; eLocalKind = HDL_CIRC;
nPNum = 1; nPNum = 1;
break; break;
...@@ -538,7 +538,7 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag) ...@@ -538,7 +538,7 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag)
if(1 == rDrag.GetHdl()->GetPointNum()) if(1 == rDrag.GetHdl()->GetPointNum())
{ {
nStartWink = nWink; nStartAngle = nWink;
} }
else if(2 == rDrag.GetHdl()->GetPointNum()) else if(2 == rDrag.GetHdl()->GetPointNum())
{ {
...@@ -597,7 +597,7 @@ OUString SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const ...@@ -597,7 +597,7 @@ OUString SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const
if(bWink) if(bWink)
{ {
const sal_Int32 nWink(1 == rDrag.GetHdl()->GetPointNum() ? nStartWink : nEndWink); const sal_Int32 nWink(1 == rDrag.GetHdl()->GetPointNum() ? nStartAngle : nEndWink);
OUString aStr; OUString aStr;
ImpTakeDescriptionStr(STR_DragCircAngle, aStr); ImpTakeDescriptionStr(STR_DragCircAngle, aStr);
...@@ -699,7 +699,7 @@ bool SdrCircObj::MovCreate(SdrDragStat& rStat) ...@@ -699,7 +699,7 @@ bool SdrCircObj::MovCreate(SdrDragStat& rStat)
rStat.SetActionRect(pU->aR); rStat.SetActionRect(pU->aR);
aRect=pU->aR; // for ObjName aRect=pU->aR; // for ObjName
ImpJustifyRect(aRect); ImpJustifyRect(aRect);
nStartWink=pU->nStart; nStartAngle=pU->nStart;
nEndWink=pU->nEnd; nEndWink=pU->nEnd;
SetBoundRectDirty(); SetBoundRectDirty();
bSnapRectDirty=true; bSnapRectDirty=true;
...@@ -734,7 +734,7 @@ bool SdrCircObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) ...@@ -734,7 +734,7 @@ bool SdrCircObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
if (bRet) { if (bRet) {
aRect=pU->aR; aRect=pU->aR;
ImpJustifyRect(aRect); ImpJustifyRect(aRect);
nStartWink=pU->nStart; nStartAngle=pU->nStart;
nEndWink=pU->nEnd; nEndWink=pU->nEnd;
} }
} }
...@@ -825,7 +825,7 @@ void SdrCircObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract ...@@ -825,7 +825,7 @@ void SdrCircObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
// That, however, is pretty bad (because of forced "hard" formatting). // That, however, is pretty bad (because of forced "hard" formatting).
// Alternatively, we could implement a bMirrored flag (maybe even // Alternatively, we could implement a bMirrored flag (maybe even
// a more general one, e. g. for mirrored text, ...). // a more general one, e. g. for mirrored text, ...).
long nS0=nStartWink; long nS0=nStartAngle;
long nE0=nEndWink; long nE0=nEndWink;
if (bNoShearRota) { if (bNoShearRota) {
// the RectObj already mirrors at VMirror because of a 180deg rotation // the RectObj already mirrors at VMirror because of a 180deg rotation
...@@ -853,7 +853,7 @@ void SdrCircObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract ...@@ -853,7 +853,7 @@ void SdrCircObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
} }
} }
long nWinkDif=nE0-nS0; long nWinkDif=nE0-nS0;
nStartWink=NormAngle360(nS0); nStartAngle=NormAngle360(nS0);
nEndWink =NormAngle360(nE0); nEndWink =NormAngle360(nE0);
if (nWinkDif==36000) nEndWink+=nWinkDif; // full circle if (nWinkDif==36000) nEndWink+=nWinkDif; // full circle
} }
...@@ -881,7 +881,7 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2) ...@@ -881,7 +881,7 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2)
long nMaxRad=((nWdt>nHgt ? nWdt : nHgt)+1) /2; long nMaxRad=((nWdt>nHgt ? nWdt : nHgt)+1) /2;
double a; double a;
// starting point // starting point
a=nStartWink*nPi180; a=nStartAngle*nPi180;
aTmpPt1=Point(Round(cos(a)*nMaxRad),-Round(sin(a)*nMaxRad)); aTmpPt1=Point(Round(cos(a)*nMaxRad),-Round(sin(a)*nMaxRad));
if (nWdt==0) aTmpPt1.X()=0; if (nWdt==0) aTmpPt1.X()=0;
if (nHgt==0) aTmpPt1.Y()=0; if (nHgt==0) aTmpPt1.Y()=0;
...@@ -919,10 +919,10 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2) ...@@ -919,10 +919,10 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2)
aTmpPt1-=aCenter; aTmpPt1-=aCenter;
aTmpPt2-=aCenter; aTmpPt2-=aCenter;
// because it's mirrored, the angles are swapped, too // because it's mirrored, the angles are swapped, too
nStartWink=GetAngle(aTmpPt2); nStartAngle=GetAngle(aTmpPt2);
nEndWink =GetAngle(aTmpPt1); nEndWink =GetAngle(aTmpPt1);
long nWinkDif=nEndWink-nStartWink; long nWinkDif=nEndWink-nStartAngle;
nStartWink=NormAngle360(nStartWink); nStartAngle=NormAngle360(nStartAngle);
nEndWink =NormAngle360(nEndWink); nEndWink =NormAngle360(nEndWink);
if (nWinkDif==36000) nEndWink+=nWinkDif; // full circle if (nWinkDif==36000) nEndWink+=nWinkDif; // full circle
} }
...@@ -939,7 +939,7 @@ void SdrCircObj::SaveGeoData(SdrObjGeoData& rGeo) const ...@@ -939,7 +939,7 @@ void SdrCircObj::SaveGeoData(SdrObjGeoData& rGeo) const
{ {
SdrRectObj::SaveGeoData(rGeo); SdrRectObj::SaveGeoData(rGeo);
SdrCircObjGeoData& rCGeo=static_cast<SdrCircObjGeoData&>(rGeo); SdrCircObjGeoData& rCGeo=static_cast<SdrCircObjGeoData&>(rGeo);
rCGeo.nStartWink=nStartWink; rCGeo.nStartAngle=nStartAngle;
rCGeo.nEndWink =nEndWink; rCGeo.nEndWink =nEndWink;
} }
...@@ -947,7 +947,7 @@ void SdrCircObj::RestGeoData(const SdrObjGeoData& rGeo) ...@@ -947,7 +947,7 @@ void SdrCircObj::RestGeoData(const SdrObjGeoData& rGeo)
{ {
SdrRectObj::RestGeoData(rGeo); SdrRectObj::RestGeoData(rGeo);
const SdrCircObjGeoData& rCGeo=static_cast<const SdrCircObjGeoData&>(rGeo); const SdrCircObjGeoData& rCGeo=static_cast<const SdrCircObjGeoData&>(rGeo);
nStartWink=rCGeo.nStartWink; nStartAngle=rCGeo.nStartAngle;
nEndWink =rCGeo.nEndWink; nEndWink =rCGeo.nEndWink;
SetXPolyDirty(); SetXPolyDirty();
ImpSetCircInfoToAttr(); ImpSetCircInfoToAttr();
...@@ -965,9 +965,9 @@ void SdrCircObj::TakeUnrotatedSnapRect(Rectangle& rRect) const ...@@ -965,9 +965,9 @@ void SdrCircObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
{ {
rRect=aRect; rRect=aRect;
if (meCircleKind!=OBJ_CIRC) { if (meCircleKind!=OBJ_CIRC) {
const Point aPntStart(GetWinkPnt(aRect,nStartWink)); const Point aPntStart(GetWinkPnt(aRect,nStartAngle));
const Point aPntEnd(GetWinkPnt(aRect,nEndWink)); const Point aPntEnd(GetWinkPnt(aRect,nEndWink));
long a=nStartWink; long a=nStartAngle;
long e=nEndWink; long e=nEndWink;
rRect.Left ()=aRect.Right(); rRect.Left ()=aRect.Right();
rRect.Right ()=aRect.Left(); rRect.Right ()=aRect.Left();
...@@ -1054,7 +1054,7 @@ sal_uInt32 SdrCircObj::GetSnapPointCount() const ...@@ -1054,7 +1054,7 @@ sal_uInt32 SdrCircObj::GetSnapPointCount() const
Point SdrCircObj::GetSnapPoint(sal_uInt32 i) const Point SdrCircObj::GetSnapPoint(sal_uInt32 i) const
{ {
switch (i) { switch (i) {
case 1 : return GetWinkPnt(aRect,nStartWink); case 1 : return GetWinkPnt(aRect,nStartAngle);
case 2 : return GetWinkPnt(aRect,nEndWink); case 2 : return GetWinkPnt(aRect,nEndWink);
default: return aRect.Center(); default: return aRect.Center();
} }
...@@ -1088,12 +1088,12 @@ void SdrCircObj::ImpSetAttrToCircInfo() ...@@ -1088,12 +1088,12 @@ void SdrCircObj::ImpSetAttrToCircInfo()
sal_Int32 nNewEnd = static_cast<const SdrAngleItem&>(rSet.Get(SDRATTR_CIRCENDANGLE)).GetValue(); sal_Int32 nNewEnd = static_cast<const SdrAngleItem&>(rSet.Get(SDRATTR_CIRCENDANGLE)).GetValue();
bool bKindChg = meCircleKind != eNewKind; bool bKindChg = meCircleKind != eNewKind;
bool bWinkChg = nNewStart != nStartWink || nNewEnd != nEndWink; bool bWinkChg = nNewStart != nStartAngle || nNewEnd != nEndWink;
if(bKindChg || bWinkChg) if(bKindChg || bWinkChg)
{ {
meCircleKind = eNewKind; meCircleKind = eNewKind;
nStartWink = nNewStart; nStartAngle = nNewStart;
nEndWink = nNewEnd; nEndWink = nNewEnd;
if(bKindChg || (meCircleKind != OBJ_CIRC && bWinkChg)) if(bKindChg || (meCircleKind != OBJ_CIRC && bWinkChg))
...@@ -1120,7 +1120,7 @@ void SdrCircObj::ImpSetCircInfoToAttr() ...@@ -1120,7 +1120,7 @@ void SdrCircObj::ImpSetCircInfoToAttr()
sal_Int32 nOldStartWink = static_cast<const SdrAngleItem&>(rSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue(); sal_Int32 nOldStartWink = static_cast<const SdrAngleItem&>(rSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue();
sal_Int32 nOldEndWink = static_cast<const SdrAngleItem&>(rSet.Get(SDRATTR_CIRCENDANGLE)).GetValue(); sal_Int32 nOldEndWink = static_cast<const SdrAngleItem&>(rSet.Get(SDRATTR_CIRCENDANGLE)).GetValue();
if(eNewKindA != eOldKindA || nStartWink != nOldStartWink || nEndWink != nOldEndWink) if(eNewKindA != eOldKindA || nStartAngle != nOldStartWink || nEndWink != nOldEndWink)
{ {
// since SetItem() implicitly calls ImpSetAttrToCircInfo() // since SetItem() implicitly calls ImpSetAttrToCircInfo()
// setting the item directly is necessary here. // setting the item directly is necessary here.
...@@ -1129,9 +1129,9 @@ void SdrCircObj::ImpSetCircInfoToAttr() ...@@ -1129,9 +1129,9 @@ void SdrCircObj::ImpSetCircInfoToAttr()
GetProperties().SetObjectItemDirect(SdrCircKindItem(eNewKindA)); GetProperties().SetObjectItemDirect(SdrCircKindItem(eNewKindA));
} }
if(nStartWink != nOldStartWink) if(nStartAngle != nOldStartWink)
{ {
GetProperties().SetObjectItemDirect(makeSdrCircStartAngleItem(nStartWink)); GetProperties().SetObjectItemDirect(makeSdrCircStartAngleItem(nStartAngle));
} }
if(nEndWink != nOldEndWink) if(nEndWink != nOldEndWink)
...@@ -1147,7 +1147,7 @@ void SdrCircObj::ImpSetCircInfoToAttr() ...@@ -1147,7 +1147,7 @@ void SdrCircObj::ImpSetCircInfoToAttr()
SdrObject* SdrCircObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const SdrObject* SdrCircObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
{ {
const bool bFill(OBJ_CARC == meCircleKind ? sal_False : sal_True); const bool bFill(OBJ_CARC == meCircleKind ? sal_False : sal_True);
const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, aRect, nStartWink, nEndWink)); const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, aRect, nStartAngle, nEndWink));
SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aCircPolygon), bFill, bBezier); SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aCircPolygon), bFill, bBezier);
if(bAddText) if(bAddText)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment