diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-15 09:52:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-15 09:54:14 +0000 |
commit | 933c85431d57139a60751b4132155f42d62da64b (patch) | |
tree | 36cbc48b9b40a052c45d5da796c7d8e7214980c5 /svx | |
parent | 739d98d541c5353a136b7b738ef41a4540e08cde (diff) |
replace SdrMeasureTextVPos with css::drawing::MeasureTextVertPos
cause we freely cast from SdrMeasureTextVPos to MeasureTextVertPos and
since...
commit b0a23c4c35f90ce3cf6a18a37fe141eb33cd5c57
Date: Mon Feb 13 11:06:07 2017 +0200
remove unused BreakedLine enumerator from SdrMeasureTextVPos
the numbers don't match eachother anymore
Change-Id: Ie4a22179c5f5b7d08af8c1a973b6c64cda83681d
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 3 | ||||
-rw-r--r-- | svx/source/svdraw/svdomeas.cxx | 40 |
3 files changed, 25 insertions, 26 deletions
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx index d5eb000dac43..bf9187d792bc 100644 --- a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx @@ -90,22 +90,22 @@ namespace sdr switch(static_cast<const SdrMeasureTextVPosItem&>(rItemSet.Get(SDRATTR_MEASURETEXTVPOS)).GetValue()) { - case SdrMeasureTextVPos::Above : + case css::drawing::MeasureTextVertPos_EAST: { aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE; break; } - case SdrMeasureTextVPos::VerticalCentered : + case css::drawing::MeasureTextVertPos_CENTERED: { aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED; break; } - case SdrMeasureTextVPos::Below : + case css::drawing::MeasureTextVertPos_WEST: { aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE; break; } - default : // SdrMeasureTextVPos::Auto + default : // css::drawing::MeasureTextVertPos_AUTO { break; } diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 52a42257bfa1..fcf56a6779b6 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -1850,11 +1850,10 @@ bool SdrMeasureTextVPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMember ePos = (drawing::MeasureTextVertPos)nEnum; } - SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextVPos)ePos ) ); + SetValue(sal::static_int_cast<sal_uInt16>(ePos)); return true; } - SfxPoolItem* SdrMeasureUnitItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureUnitItem(*this); } SfxPoolItem* SdrMeasureUnitItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureUnitItem(rIn); } diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 0a38f0c7c045..c29523910dd3 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -263,7 +263,7 @@ struct ImpMeasureRec : public SdrDragStatUserData Point aPt2; SdrMeasureKind eKind; css::drawing::MeasureTextHorzPos eWantTextHPos; - SdrMeasureTextVPos eWantTextVPos; + css::drawing::MeasureTextVertPos eWantTextVPos; long nLineDist; long nHelplineOverhang; long nHelplineDist; @@ -307,7 +307,7 @@ struct ImpMeasurePoly double nHlpCos; sal_uInt16 nMainlineAnz; css::drawing::MeasureTextHorzPos eUsedTextHPos; - SdrMeasureTextVPos eUsedTextVPos; + css::drawing::MeasureTextVertPos eUsedTextVPos; long nLineWdt2; // half the line width long nArrow1Len; // length of 1st arrowhead; for Center, use only half long nArrow2Len; // length of 2nd arrowhead; for Center, use only half @@ -411,10 +411,10 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol.eUsedTextHPos=rRec.eWantTextHPos; rPol.eUsedTextVPos=rRec.eWantTextVPos; - if (rPol.eUsedTextVPos==SdrMeasureTextVPos::Auto) - rPol.eUsedTextVPos=SdrMeasureTextVPos::Above; + if (rPol.eUsedTextVPos == css::drawing::MeasureTextVertPos_AUTO) + rPol.eUsedTextVPos = css::drawing::MeasureTextVertPos_EAST; bool bBrkLine=false; - if (rPol.eUsedTextVPos==SdrMeasureTextVPos::VerticalCentered) + if (rPol.eUsedTextVPos == css::drawing::MeasureTextVertPos_CENTERED) { OutlinerParaObject* pOutlinerParaObject = SdrTextObj::GetOutlinerParaObject(); if (pOutlinerParaObject!=nullptr && pOutlinerParaObject->GetTextObject().GetParagraphCount()==1) @@ -667,7 +667,7 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const bool bUpsideDown=aRec.bTextUpsideDown!=aMPol.bAutoUpsideDown; bool bBelowRefEdge=aRec.bBelowRefEdge; css::drawing::MeasureTextHorzPos eMH=aMPol.eUsedTextHPos; - SdrMeasureTextVPos eMV=aMPol.eUsedTextVPos; + css::drawing::MeasureTextVertPos eMV=aMPol.eUsedTextVPos; if (!bRota90) { switch (eMH) { case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: aTextPos.X()=aPt1b.X()-aTextSize2.Width()-nArr1Len-nLWdt; break; @@ -675,9 +675,9 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const default: aTextPos.X()=aPt1b.X(); aTextSize2.Width()=nLen; } switch (eMV) { - case SdrMeasureTextVPos::VerticalCentered: + case css::drawing::MeasureTextVertPos_CENTERED: aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()/2; break; - case SdrMeasureTextVPos::Below: { + case css::drawing::MeasureTextVertPos_WEST: { if (!bUpsideDown) aTextPos.Y()=aPt1b.Y()+nLWdt; else aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()-nLWdt; } break; @@ -697,9 +697,9 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const default: aTextPos.X()=aPt1b.X(); aTextSize2.Height()=nLen; } switch (eMV) { - case SdrMeasureTextVPos::VerticalCentered: + case css::drawing::MeasureTextVertPos_CENTERED: aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()/2; break; - case SdrMeasureTextVPos::Below: { + case css::drawing::MeasureTextVertPos_WEST: { if (!bBelowRefEdge) aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()+nLWdt; else aTextPos.Y()=aPt1b.Y()-nLWdt; } break; @@ -1323,8 +1323,8 @@ sal_uInt16 SdrMeasureObj::GetOutlinerViewAnchorMode() const SdrTextHorzAdjust eTH=GetTextHorizontalAdjust(); SdrTextVertAdjust eTV=GetTextVerticalAdjust(); - css::drawing::MeasureTextHorzPos eMH=aMPol.eUsedTextHPos; - SdrMeasureTextVPos eMV=aMPol.eUsedTextVPos; + css::drawing::MeasureTextHorzPos eMH = aMPol.eUsedTextHPos; + css::drawing::MeasureTextVertPos eMV = aMPol.eUsedTextVPos; bool bTextRota90=aRec.bTextRota90; bool bBelowRefEdge=aRec.bBelowRefEdge; @@ -1333,21 +1333,21 @@ sal_uInt16 SdrMeasureObj::GetOutlinerViewAnchorMode() const 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; + if (eMV==css::drawing::MeasureTextVertPos_EAST) eTV=SDRTEXTVERTADJUST_BOTTOM; + if (eMV==css::drawing::MeasureTextVertPos_WEST) eTV=SDRTEXTVERTADJUST_TOP; + if (eMV==css::drawing::MeasureTextVertPos_CENTERED) eTV=SDRTEXTVERTADJUST_CENTER; } else { 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; + if (eMV==css::drawing::MeasureTextVertPos_EAST) eTH=SDRTEXTHORZADJUST_LEFT; + if (eMV==css::drawing::MeasureTextVertPos_WEST) eTH=SDRTEXTHORZADJUST_RIGHT; } else { - if (eMV==SdrMeasureTextVPos::Above) eTH=SDRTEXTHORZADJUST_RIGHT; - if (eMV==SdrMeasureTextVPos::Below) eTH=SDRTEXTHORZADJUST_LEFT; + if (eMV==css::drawing::MeasureTextVertPos_EAST) eTH=SDRTEXTHORZADJUST_RIGHT; + if (eMV==css::drawing::MeasureTextVertPos_WEST) eTH=SDRTEXTHORZADJUST_LEFT; } - if (eMV==SdrMeasureTextVPos::VerticalCentered) eTH=SDRTEXTHORZADJUST_CENTER; + if (eMV==css::drawing::MeasureTextVertPos_CENTERED) eTH=SDRTEXTHORZADJUST_CENTER; } EVAnchorMode eRet=ANCHOR_BOTTOM_HCENTER; |