diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-15 09:20:51 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-15 09:54:14 +0000 |
commit | 739d98d541c5353a136b7b738ef41a4540e08cde (patch) | |
tree | baa5ee5732cf21d77e218a3ff6560139632a6676 /svx | |
parent | 227e7bf0dba4d3fa992b3ee96f182ffb94591854 (diff) |
replace SdrMeasureTextHPos with css::drawing::MeasureTextHorzPos
cause they are cast to each other freely and the css one isn't going to change
value by accident, like has happened to its sibling SdrMeasureTextVPos
recently.
Change-Id: Idb0558553a7bc8337603b7b01df4a597363fcb6d
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdomeas.cxx | 40 |
3 files changed, 25 insertions, 25 deletions
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx index 02410ad4f4cf..d5eb000dac43 100644 --- a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx @@ -67,22 +67,22 @@ namespace sdr switch(static_cast<const SdrMeasureTextHPosItem&>(rItemSet.Get(SDRATTR_MEASURETEXTHPOS)).GetValue()) { - case SdrMeasureTextHPos::LeftOutside : + case css::drawing::MeasureTextHorzPos::MeasureTextHorzPos_LEFTOUTSIDE: { aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE; break; } - case SdrMeasureTextHPos::Inside : + case css::drawing::MeasureTextHorzPos::MeasureTextHorzPos_INSIDE: { aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED; break; } - case SdrMeasureTextHPos::RightOutside : + case css::drawing::MeasureTextHorzPos::MeasureTextHorzPos_RIGHTOUTSIDE: { aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE; break; } - default : // SdrMeasureTextHPos::Auto + default: // css::drawing::MeasureTextHorzPos::MeasureTextHorzPos_AUTO { break; } diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 78de5013536b..52a42257bfa1 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -1803,7 +1803,7 @@ bool SdrMeasureTextHPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMember ePos = (drawing::MeasureTextHorzPos)nEnum; } - SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextHPos)ePos ) ); + SetValue(sal::static_int_cast<sal_uInt16>(ePos)); return true; } diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index c98ab4426d0a..0a38f0c7c045 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -262,7 +262,7 @@ struct ImpMeasureRec : public SdrDragStatUserData Point aPt1; Point aPt2; SdrMeasureKind eKind; - SdrMeasureTextHPos eWantTextHPos; + css::drawing::MeasureTextHorzPos eWantTextHPos; SdrMeasureTextVPos eWantTextVPos; long nLineDist; long nHelplineOverhang; @@ -306,7 +306,7 @@ struct ImpMeasurePoly double nHlpSin; double nHlpCos; sal_uInt16 nMainlineAnz; - SdrMeasureTextHPos eUsedTextHPos; + css::drawing::MeasureTextHorzPos eUsedTextHPos; SdrMeasureTextVPos eUsedTextVPos; long nLineWdt2; // half the line width long nArrow1Len; // length of 1st arrowhead; for Center, use only half @@ -423,7 +423,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& } } rPol.bBreakedLine=bBrkLine; - if (rPol.eUsedTextHPos==SdrMeasureTextHPos::Auto) { // if text is too wide, push it outside + if (rPol.eUsedTextHPos==css::drawing::MeasureTextHorzPos_AUTO) { // if text is too wide, push it outside bool bOutside = false; long nNeedSiz=!rRec.bTextRota90 ? rPol.aTextSize.Width() : rPol.aTextSize.Height(); if (nNeedSiz>rPol.nLineLen) bOutside = true; // text doesn't fit in between @@ -433,9 +433,9 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& long nSmallNeed=nArrow1Len+nArrow2Len+(nArrow1Wdt+nArrow2Wdt)/2/4; if (nNeedSiz+nSmallNeed>rPol.nLineLen) bPfeileAussen = true; // text fits in between, if arrowheads are on the outside } - rPol.eUsedTextHPos=bOutside ? SdrMeasureTextHPos::LeftOutside : SdrMeasureTextHPos::Inside; + rPol.eUsedTextHPos=bOutside ? css::drawing::MeasureTextHorzPos_LEFTOUTSIDE : css::drawing::MeasureTextHorzPos_INSIDE; } - if (rPol.eUsedTextHPos!=SdrMeasureTextHPos::Inside) bPfeileAussen = true; + if (rPol.eUsedTextHPos != css::drawing::MeasureTextHorzPos_INSIDE) bPfeileAussen = true; rPol.nArrow1Wdt=nArrow1Wdt; rPol.nArrow2Wdt=nArrow2Wdt; rPol.nShortLineLen=nShortLen; @@ -524,8 +524,8 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& long nLen2=nShortLen; long nTextWdt=rRec.bTextRota90 ? rPol.aTextSize.Height() : rPol.aTextSize.Width(); if (!bBrkLine) { - if (rPol.eUsedTextHPos==SdrMeasureTextHPos::LeftOutside) nLen1=nArrow1Len+nTextWdt; - if (rPol.eUsedTextHPos==SdrMeasureTextHPos::RightOutside) nLen2=nArrow2Len+nTextWdt; + if (rPol.eUsedTextHPos==css::drawing::MeasureTextHorzPos_LEFTOUTSIDE) nLen1=nArrow1Len+nTextWdt; + if (rPol.eUsedTextHPos==css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE) nLen2=nArrow2Len+nTextWdt; } rPol.aMainline1.aP1=aMainlinePt1; rPol.aMainline1.aP2=aMainlinePt1; rPol.aMainline1.aP2.X()-=nLen1; RotatePoint(rPol.aMainline1.aP2,aMainlinePt1,nLineSin,nLineCos); @@ -534,7 +534,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol.aMainline3.aP1=aMainlinePt1; rPol.aMainline3.aP2=aMainlinePt2; rPol.nMainlineAnz=3; - if (bBrkLine && rPol.eUsedTextHPos==SdrMeasureTextHPos::Inside) rPol.nMainlineAnz=2; + if (bBrkLine && rPol.eUsedTextHPos==css::drawing::MeasureTextHorzPos_INSIDE) rPol.nMainlineAnz=2; } } @@ -666,12 +666,12 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const bool bRota90=aRec.bTextRota90; bool bUpsideDown=aRec.bTextUpsideDown!=aMPol.bAutoUpsideDown; bool bBelowRefEdge=aRec.bBelowRefEdge; - SdrMeasureTextHPos eMH=aMPol.eUsedTextHPos; + css::drawing::MeasureTextHorzPos eMH=aMPol.eUsedTextHPos; SdrMeasureTextVPos eMV=aMPol.eUsedTextVPos; if (!bRota90) { switch (eMH) { - case SdrMeasureTextHPos::LeftOutside: aTextPos.X()=aPt1b.X()-aTextSize2.Width()-nArr1Len-nLWdt; break; - case SdrMeasureTextHPos::RightOutside: aTextPos.X()=aPt1b.X()+nLen+nArr2Len+nLWdt; break; + case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: aTextPos.X()=aPt1b.X()-aTextSize2.Width()-nArr1Len-nLWdt; break; + case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: aTextPos.X()=aPt1b.X()+nLen+nArr2Len+nLWdt; break; default: aTextPos.X()=aPt1b.X(); aTextSize2.Width()=nLen; } switch (eMV) { @@ -692,8 +692,8 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const } } else { // also if bTextRota90==TRUE switch (eMH) { - case SdrMeasureTextHPos::LeftOutside: aTextPos.X()=aPt1b.X()-aTextSize2.Height()-nArr1Len; break; - case SdrMeasureTextHPos::RightOutside: aTextPos.X()=aPt1b.X()+nLen+nArr2Len; break; + case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: aTextPos.X()=aPt1b.X()-aTextSize2.Height()-nArr1Len; break; + case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: aTextPos.X()=aPt1b.X()+nLen+nArr2Len; break; default: aTextPos.X()=aPt1b.X(); aTextSize2.Height()=nLen; } switch (eMV) { @@ -1323,23 +1323,23 @@ sal_uInt16 SdrMeasureObj::GetOutlinerViewAnchorMode() const SdrTextHorzAdjust eTH=GetTextHorizontalAdjust(); SdrTextVertAdjust eTV=GetTextVerticalAdjust(); - SdrMeasureTextHPos eMH=aMPol.eUsedTextHPos; + css::drawing::MeasureTextHorzPos eMH=aMPol.eUsedTextHPos; SdrMeasureTextVPos eMV=aMPol.eUsedTextVPos; bool bTextRota90=aRec.bTextRota90; bool bBelowRefEdge=aRec.bBelowRefEdge; // TODO: bTextUpsideDown should be interpreted here! if (!bTextRota90) { - if (eMH==SdrMeasureTextHPos::LeftOutside) eTH=SDRTEXTHORZADJUST_RIGHT; - if (eMH==SdrMeasureTextHPos::RightOutside) eTH=SDRTEXTHORZADJUST_LEFT; - // at eMH==SdrMeasureTextHPos::Inside we can anchor horizontally + if (eMH==css::drawing::MeasureTextHorzPos_LEFTOUTSIDE) eTH=SDRTEXTHORZADJUST_RIGHT; + if (eMH==css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE) eTH=SDRTEXTHORZADJUST_LEFT; + // at eMH==css::drawing::MeasureTextHorzPos_INSIDE we can anchor horizontally if (eMV==SdrMeasureTextVPos::Above) eTV=SDRTEXTVERTADJUST_BOTTOM; if (eMV==SdrMeasureTextVPos::Below) eTV=SDRTEXTVERTADJUST_TOP; if (eMV==SdrMeasureTextVPos::VerticalCentered) eTV=SDRTEXTVERTADJUST_CENTER; } else { - if (eMH==SdrMeasureTextHPos::LeftOutside) eTV=SDRTEXTVERTADJUST_BOTTOM; - if (eMH==SdrMeasureTextHPos::RightOutside) eTV=SDRTEXTVERTADJUST_TOP; - // at eMH==SdrMeasureTextHPos::Inside we can anchor vertically + if (eMH==css::drawing::MeasureTextHorzPos_LEFTOUTSIDE) eTV=SDRTEXTVERTADJUST_BOTTOM; + if (eMH==css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE) eTV=SDRTEXTVERTADJUST_TOP; + // at eMH==css::drawing::MeasureTextHorzPos_INSIDE we can anchor vertically if (!bBelowRefEdge) { if (eMV==SdrMeasureTextVPos::Above) eTH=SDRTEXTHORZADJUST_LEFT; if (eMV==SdrMeasureTextVPos::Below) eTH=SDRTEXTHORZADJUST_RIGHT; |