[Libreoffice-commits] core.git: 3 commits - cui/source include/svx svx/source

Caolán McNamara caolanm at redhat.com
Wed Feb 15 10:12:18 UTC 2017


 cui/source/tabpages/measure.cxx                       |  154 +++++++++---------
 include/svx/sxmtpitm.hxx                              |   33 ++-
 svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx |   16 -
 svx/source/svdraw/svdattr.cxx                         |    5 
 svx/source/svdraw/svdomeas.cxx                        |   78 ++++-----
 5 files changed, 147 insertions(+), 139 deletions(-)

New commits:
commit 933c85431d57139a60751b4132155f42d62da64b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 15 09:52:27 2017 +0000

    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

diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index de10555..289f992 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -339,7 +339,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
     // Position
     if ( rAttrs->GetItemState( SDRATTR_MEASURETEXTVPOS ) != SfxItemState::DONTCARE )
     {
-        SdrMeasureTextVPos eVPos = (SdrMeasureTextVPos)
+        css::drawing::MeasureTextVertPos eVPos =
                     static_cast<const SdrMeasureTextVPosItem&>( rAttrs->Get( SDRATTR_MEASURETEXTVPOS ) ).GetValue();
         {
             if ( rAttrs->GetItemState( SDRATTR_MEASURETEXTHPOS ) != SfxItemState::DONTCARE )
@@ -352,7 +352,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                 RectPoint eRP = RectPoint::MM;
                 switch( eVPos )
                 {
-                case SdrMeasureTextVPos::Above:
+                case css::drawing::MeasureTextVertPos_EAST:
                     switch( eHPos )
                     {
                     case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE:    eRP = RectPoint::LT; break;
@@ -362,7 +362,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                     default: break;
                     }
                     break;
-                case SdrMeasureTextVPos::VerticalCentered:
+                case css::drawing::MeasureTextVertPos_CENTERED:
                     switch( eHPos )
                     {
                     case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE:    eRP = RectPoint::LM; break;
@@ -372,7 +372,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                     default: break;
                     }
                     break;
-                case SdrMeasureTextVPos::Below:
+                case css::drawing::MeasureTextVertPos_WEST:
                     switch( eHPos )
                     {
                     case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE:    eRP = RectPoint::LB; break;
@@ -382,7 +382,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                     default: break;
                     }
                     break;
-                case SdrMeasureTextVPos::Auto:
+                case css::drawing::MeasureTextVertPos_AUTO:
                     switch( eHPos )
                     {
                     case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE:    eRP = RectPoint::LM; break;
@@ -403,7 +403,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                     nState = CTL_STATE::NOHORZ;
                 }
 
-                if( eVPos == SdrMeasureTextVPos::Auto )
+                if (eVPos == css::drawing::MeasureTextVertPos_AUTO)
                 {
                     m_pTsbAutoPosV->SetState( TRISTATE_TRUE );
                     nState |= CTL_STATE::NOVERT;
@@ -522,42 +522,41 @@ bool SvxMeasurePage::FillItemSet( SfxItemSet* rAttrs)
     if( bPositionModified )
     {
         // Position
-        SdrMeasureTextVPos eVPos, eOldVPos;
+        css::drawing::MeasureTextVertPos eVPos, eOldVPos;
         css::drawing::MeasureTextHorzPos eHPos, eOldHPos;
 
         RectPoint eRP = m_pCtlPosition->GetActualRP();
         switch( eRP )
         {
             default:
-            case RectPoint::LT: eVPos = SdrMeasureTextVPos::Above;
+            case RectPoint::LT: eVPos = css::drawing::MeasureTextVertPos_EAST;
                         eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
-            case RectPoint::LM: eVPos = SdrMeasureTextVPos::VerticalCentered;
+            case RectPoint::LM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
                         eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
-            case RectPoint::LB: eVPos = SdrMeasureTextVPos::Below;
+            case RectPoint::LB: eVPos = css::drawing::MeasureTextVertPos_WEST;
                         eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
-            case RectPoint::MT: eVPos = SdrMeasureTextVPos::Above;
+            case RectPoint::MT: eVPos = css::drawing::MeasureTextVertPos_EAST;
                         eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
-            case RectPoint::MM: eVPos = SdrMeasureTextVPos::VerticalCentered;
+            case RectPoint::MM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
                         eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
-            case RectPoint::MB: eVPos = SdrMeasureTextVPos::Below;
+            case RectPoint::MB: eVPos = css::drawing::MeasureTextVertPos_WEST;
                         eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
-            case RectPoint::RT: eVPos = SdrMeasureTextVPos::Above;
+            case RectPoint::RT: eVPos = css::drawing::MeasureTextVertPos_EAST;
                         eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
-            case RectPoint::RM: eVPos = SdrMeasureTextVPos::VerticalCentered;
+            case RectPoint::RM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
                         eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
-            case RectPoint::RB: eVPos = SdrMeasureTextVPos::Below;
+            case RectPoint::RB: eVPos = css::drawing::MeasureTextVertPos_WEST;
                         eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
         }
         if (m_pTsbAutoPosH->GetState() == TRISTATE_TRUE)
             eHPos = css::drawing::MeasureTextHorzPos_AUTO;
 
-        if( m_pTsbAutoPosV->GetState() == TRISTATE_TRUE )
-            eVPos = SdrMeasureTextVPos::Auto;
+        if (m_pTsbAutoPosV->GetState() == TRISTATE_TRUE)
+            eVPos = css::drawing::MeasureTextVertPos_AUTO;
 
         if ( rAttrs->GetItemState( SDRATTR_MEASURETEXTVPOS ) != SfxItemState::DONTCARE )
         {
-            eOldVPos = (SdrMeasureTextVPos)
-                        static_cast<const SdrMeasureTextVPosItem&>( rOutAttrs.Get( SDRATTR_MEASURETEXTVPOS ) ).GetValue();
+            eOldVPos = static_cast<const SdrMeasureTextVPosItem&>(rOutAttrs.Get(SDRATTR_MEASURETEXTVPOS)).GetValue();
             if( eOldVPos != eVPos )
             {
                 rAttrs->Put( SdrMeasureTextVPosItem( eVPos ) );
@@ -751,29 +750,29 @@ void SvxMeasurePage::ChangeAttrHdl_Impl( void* p )
 
         // Position
         RectPoint eRP = m_pCtlPosition->GetActualRP();
-        SdrMeasureTextVPos eVPos;
+        css::drawing::MeasureTextVertPos eVPos;
         css::drawing::MeasureTextHorzPos eHPos;
 
         switch( eRP )
         {
             default:
-            case RectPoint::LT: eVPos = SdrMeasureTextVPos::Above;
+            case RectPoint::LT: eVPos = css::drawing::MeasureTextVertPos_EAST;
                         eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
-            case RectPoint::LM: eVPos = SdrMeasureTextVPos::VerticalCentered;
+            case RectPoint::LM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
                         eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
-            case RectPoint::LB: eVPos = SdrMeasureTextVPos::Below;
+            case RectPoint::LB: eVPos = css::drawing::MeasureTextVertPos_WEST;
                         eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
-            case RectPoint::MT: eVPos = SdrMeasureTextVPos::Above;
+            case RectPoint::MT: eVPos = css::drawing::MeasureTextVertPos_EAST;
                         eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
-            case RectPoint::MM: eVPos = SdrMeasureTextVPos::VerticalCentered;
+            case RectPoint::MM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
                         eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
-            case RectPoint::MB: eVPos = SdrMeasureTextVPos::Below;
+            case RectPoint::MB: eVPos = css::drawing::MeasureTextVertPos_WEST;
                         eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
-            case RectPoint::RT: eVPos = SdrMeasureTextVPos::Above;
+            case RectPoint::RT: eVPos = css::drawing::MeasureTextVertPos_EAST;
                         eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
-            case RectPoint::RM: eVPos = SdrMeasureTextVPos::VerticalCentered;
+            case RectPoint::RM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
                         eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
-            case RectPoint::RB: eVPos = SdrMeasureTextVPos::Below;
+            case RectPoint::RB: eVPos = css::drawing::MeasureTextVertPos_WEST;
                         eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
         }
 
@@ -785,9 +784,9 @@ void SvxMeasurePage::ChangeAttrHdl_Impl( void* p )
             nState = CTL_STATE::NOHORZ;
         }
 
-        if( m_pTsbAutoPosV->GetState() == TRISTATE_TRUE )
+        if (m_pTsbAutoPosV->GetState() == TRISTATE_TRUE)
         {
-            eVPos = SdrMeasureTextVPos::Auto;
+            eVPos = css::drawing::MeasureTextVertPos_AUTO;
             nState |= CTL_STATE::NOVERT;
         }
 
diff --git a/include/svx/sxmtpitm.hxx b/include/svx/sxmtpitm.hxx
index 3caf61f..fc9abf8 100644
--- a/include/svx/sxmtpitm.hxx
+++ b/include/svx/sxmtpitm.hxx
@@ -23,19 +23,19 @@
 #include <svl/eitem.hxx>
 #include <svx/svxdllapi.h>
 #include <com/sun/star/drawing/MeasureTextHorzPos.hpp>
-
-enum class SdrMeasureTextVPos { Auto, Above, Below, VerticalCentered };
-
+#include <com/sun/star/drawing/MeasureTextVertPos.hpp>
 
 // class SdrMeasureTextHPosItem
-
 class SVX_DLLPUBLIC SdrMeasureTextHPosItem: public SfxEnumItem {
 public:
     SdrMeasureTextHPosItem(css::drawing::MeasureTextHorzPos ePos = css::drawing::MeasureTextHorzPos::MeasureTextHorzPos_AUTO)
-        : SfxEnumItem(SDRATTR_MEASURETEXTHPOS,sal::static_int_cast< sal_uInt16 >(ePos))
+        : SfxEnumItem(SDRATTR_MEASURETEXTHPOS, sal::static_int_cast<sal_uInt16>(ePos))
+    {
+    }
+    SdrMeasureTextHPosItem(SvStream& rIn)
+        : SfxEnumItem(SDRATTR_MEASURETEXTHPOS, rIn)
     {
     }
-    SdrMeasureTextHPosItem(SvStream& rIn)                               : SfxEnumItem(SDRATTR_MEASURETEXTHPOS,rIn)    {}
     virtual SfxPoolItem*   Clone(SfxItemPool* pPool=nullptr) const override;
     virtual SfxPoolItem*   Create(SvStream& rIn, sal_uInt16 nVer) const override;
     virtual sal_uInt16         GetValueCount() const override; // { return 4; }
@@ -48,17 +48,21 @@ public:
     virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper * = nullptr) const override;
 };
 
-
 // class SdrMeasureTextVPosItem
-
 class SVX_DLLPUBLIC SdrMeasureTextVPosItem: public SfxEnumItem {
 public:
-    SdrMeasureTextVPosItem(SdrMeasureTextVPos ePos=SdrMeasureTextVPos::Auto): SfxEnumItem(SDRATTR_MEASURETEXTVPOS,sal::static_int_cast< sal_uInt16 >(ePos)) {}
-    SdrMeasureTextVPosItem(SvStream& rIn)                               : SfxEnumItem(SDRATTR_MEASURETEXTVPOS,rIn)    {}
+    SdrMeasureTextVPosItem(css::drawing::MeasureTextVertPos ePos = css::drawing::MeasureTextVertPos_AUTO)
+        : SfxEnumItem(SDRATTR_MEASURETEXTVPOS, sal::static_int_cast<sal_uInt16>(ePos))
+    {
+    }
+    SdrMeasureTextVPosItem(SvStream& rIn)
+        : SfxEnumItem(SDRATTR_MEASURETEXTVPOS, rIn)
+    {
+    }
     virtual SfxPoolItem*   Clone(SfxItemPool* pPool=nullptr) const override;
     virtual SfxPoolItem*   Create(SvStream& rIn, sal_uInt16 nVer) const override;
     virtual sal_uInt16         GetValueCount() const override; // { return 5; }
-            SdrMeasureTextVPos GetValue() const { return (SdrMeasureTextVPos)SfxEnumItem::GetValue(); }
+    css::drawing::MeasureTextVertPos GetValue() const { return (css::drawing::MeasureTextVertPos)SfxEnumItem::GetValue(); }
 
     virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
     virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
index d5eb000..bf9187d 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 52a4225..fcf56a6 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 0a38f0c..c295239 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;
commit 739d98d541c5353a136b7b738ef41a4540e08cde
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 15 09:20:51 2017 +0000

    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

diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index e023463..de10555 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -347,7 +347,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                 m_pTsbAutoPosV->EnableTriState( false );
                 m_pTsbAutoPosH->EnableTriState( false );
 
-                SdrMeasureTextHPos eHPos = (SdrMeasureTextHPos)
+                css::drawing::MeasureTextHorzPos eHPos =
                             static_cast<const SdrMeasureTextHPosItem&>( rAttrs->Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue();
                 RectPoint eRP = RectPoint::MM;
                 switch( eVPos )
@@ -355,37 +355,41 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                 case SdrMeasureTextVPos::Above:
                     switch( eHPos )
                     {
-                    case SdrMeasureTextHPos::LeftOutside:    eRP = RectPoint::LT; break;
-                    case SdrMeasureTextHPos::Inside:         eRP = RectPoint::MT; break;
-                    case SdrMeasureTextHPos::RightOutside:   eRP = RectPoint::RT; break;
-                    case SdrMeasureTextHPos::Auto:          eRP = RectPoint::MT; break;
+                    case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE:    eRP = RectPoint::LT; break;
+                    case css::drawing::MeasureTextHorzPos_INSIDE:         eRP = RectPoint::MT; break;
+                    case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE:   eRP = RectPoint::RT; break;
+                    case css::drawing::MeasureTextHorzPos_AUTO:          eRP = RectPoint::MT; break;
+                    default: break;
                     }
                     break;
                 case SdrMeasureTextVPos::VerticalCentered:
                     switch( eHPos )
                     {
-                    case SdrMeasureTextHPos::LeftOutside:    eRP = RectPoint::LM; break;
-                    case SdrMeasureTextHPos::Inside:         eRP = RectPoint::MM; break;
-                    case SdrMeasureTextHPos::RightOutside:   eRP = RectPoint::RM; break;
-                    case SdrMeasureTextHPos::Auto:          eRP = RectPoint::MM; break;
+                    case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE:    eRP = RectPoint::LM; break;
+                    case css::drawing::MeasureTextHorzPos_INSIDE:         eRP = RectPoint::MM; break;
+                    case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE:   eRP = RectPoint::RM; break;
+                    case css::drawing::MeasureTextHorzPos_AUTO:          eRP = RectPoint::MM; break;
+                    default: break;
                     }
                     break;
                 case SdrMeasureTextVPos::Below:
                     switch( eHPos )
                     {
-                    case SdrMeasureTextHPos::LeftOutside:    eRP = RectPoint::LB; break;
-                    case SdrMeasureTextHPos::Inside:         eRP = RectPoint::MB; break;
-                    case SdrMeasureTextHPos::RightOutside:   eRP = RectPoint::RB; break;
-                    case SdrMeasureTextHPos::Auto:          eRP = RectPoint::MB; break;
+                    case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE:    eRP = RectPoint::LB; break;
+                    case css::drawing::MeasureTextHorzPos_INSIDE:         eRP = RectPoint::MB; break;
+                    case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE:   eRP = RectPoint::RB; break;
+                    case css::drawing::MeasureTextHorzPos_AUTO:          eRP = RectPoint::MB; break;
+                    default: break;
                     }
                     break;
                 case SdrMeasureTextVPos::Auto:
                     switch( eHPos )
                     {
-                    case SdrMeasureTextHPos::LeftOutside:    eRP = RectPoint::LM; break;
-                    case SdrMeasureTextHPos::Inside:         eRP = RectPoint::MM; break;
-                    case SdrMeasureTextHPos::RightOutside:   eRP = RectPoint::RM; break;
-                    case SdrMeasureTextHPos::Auto:          eRP = RectPoint::MM; break;
+                    case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE:    eRP = RectPoint::LM; break;
+                    case css::drawing::MeasureTextHorzPos_INSIDE:         eRP = RectPoint::MM; break;
+                    case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE:   eRP = RectPoint::RM; break;
+                    case css::drawing::MeasureTextHorzPos_AUTO:          eRP = RectPoint::MM; break;
+                    default: break;
                     }
                     break;
                  default: ;//prevent warning
@@ -393,7 +397,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
 
                 CTL_STATE nState = CTL_STATE::NONE;
 
-                if( eHPos == SdrMeasureTextHPos::Auto )
+                if (eHPos == css::drawing::MeasureTextHorzPos_AUTO)
                 {
                     m_pTsbAutoPosH->SetState( TRISTATE_TRUE );
                     nState = CTL_STATE::NOHORZ;
@@ -519,33 +523,33 @@ bool SvxMeasurePage::FillItemSet( SfxItemSet* rAttrs)
     {
         // Position
         SdrMeasureTextVPos eVPos, eOldVPos;
-        SdrMeasureTextHPos eHPos, eOldHPos;
+        css::drawing::MeasureTextHorzPos eHPos, eOldHPos;
 
         RectPoint eRP = m_pCtlPosition->GetActualRP();
         switch( eRP )
         {
             default:
             case RectPoint::LT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
             case RectPoint::LM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
             case RectPoint::LB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
             case RectPoint::MT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SdrMeasureTextHPos::Inside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
             case RectPoint::MM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SdrMeasureTextHPos::Inside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
             case RectPoint::MB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SdrMeasureTextHPos::Inside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
             case RectPoint::RT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SdrMeasureTextHPos::RightOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
             case RectPoint::RM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SdrMeasureTextHPos::RightOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
             case RectPoint::RB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SdrMeasureTextHPos::RightOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
         }
-        if( m_pTsbAutoPosH->GetState() == TRISTATE_TRUE )
-            eHPos = SdrMeasureTextHPos::Auto;
+        if (m_pTsbAutoPosH->GetState() == TRISTATE_TRUE)
+            eHPos = css::drawing::MeasureTextHorzPos_AUTO;
 
         if( m_pTsbAutoPosV->GetState() == TRISTATE_TRUE )
             eVPos = SdrMeasureTextVPos::Auto;
@@ -568,8 +572,7 @@ bool SvxMeasurePage::FillItemSet( SfxItemSet* rAttrs)
 
         if ( rAttrs->GetItemState( SDRATTR_MEASURETEXTHPOS ) != SfxItemState::DONTCARE )
         {
-            eOldHPos = (SdrMeasureTextHPos)
-                        static_cast<const SdrMeasureTextHPosItem&>( rOutAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue();
+            eOldHPos = static_cast<const SdrMeasureTextHPosItem&>( rOutAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue();
             if( eOldHPos != eHPos )
             {
                 rAttrs->Put( SdrMeasureTextHPosItem( eHPos ) );
@@ -749,36 +752,36 @@ void SvxMeasurePage::ChangeAttrHdl_Impl( void* p )
         // Position
         RectPoint eRP = m_pCtlPosition->GetActualRP();
         SdrMeasureTextVPos eVPos;
-        SdrMeasureTextHPos eHPos;
+        css::drawing::MeasureTextHorzPos eHPos;
 
         switch( eRP )
         {
             default:
             case RectPoint::LT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
             case RectPoint::LM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
             case RectPoint::LB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE; break;
             case RectPoint::MT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SdrMeasureTextHPos::Inside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
             case RectPoint::MM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SdrMeasureTextHPos::Inside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
             case RectPoint::MB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SdrMeasureTextHPos::Inside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_INSIDE; break;
             case RectPoint::RT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SdrMeasureTextHPos::RightOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
             case RectPoint::RM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SdrMeasureTextHPos::RightOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
             case RectPoint::RB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SdrMeasureTextHPos::RightOutside; break;
+                        eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE; break;
         }
 
         CTL_STATE nState = CTL_STATE::NONE;
 
-        if( m_pTsbAutoPosH->GetState() == TRISTATE_TRUE )
+        if (m_pTsbAutoPosH->GetState() == TRISTATE_TRUE)
         {
-            eHPos = SdrMeasureTextHPos::Auto;
+            eHPos = css::drawing::MeasureTextHorzPos_AUTO;
             nState = CTL_STATE::NOHORZ;
         }
 
diff --git a/include/svx/sxmtpitm.hxx b/include/svx/sxmtpitm.hxx
index f0c6ff9..3caf61f 100644
--- a/include/svx/sxmtpitm.hxx
+++ b/include/svx/sxmtpitm.hxx
@@ -22,8 +22,8 @@
 #include <svx/svddef.hxx>
 #include <svl/eitem.hxx>
 #include <svx/svxdllapi.h>
+#include <com/sun/star/drawing/MeasureTextHorzPos.hpp>
 
-enum class SdrMeasureTextHPos { Auto, LeftOutside, Inside, RightOutside };
 enum class SdrMeasureTextVPos { Auto, Above, Below, VerticalCentered };
 
 
@@ -31,12 +31,15 @@ enum class SdrMeasureTextVPos { Auto, Above, Below, VerticalCentered };
 
 class SVX_DLLPUBLIC SdrMeasureTextHPosItem: public SfxEnumItem {
 public:
-    SdrMeasureTextHPosItem(SdrMeasureTextHPos ePos=SdrMeasureTextHPos::Auto): SfxEnumItem(SDRATTR_MEASURETEXTHPOS,sal::static_int_cast< sal_uInt16 >(ePos)) {}
+    SdrMeasureTextHPosItem(css::drawing::MeasureTextHorzPos ePos = css::drawing::MeasureTextHorzPos::MeasureTextHorzPos_AUTO)
+        : SfxEnumItem(SDRATTR_MEASURETEXTHPOS,sal::static_int_cast< sal_uInt16 >(ePos))
+    {
+    }
     SdrMeasureTextHPosItem(SvStream& rIn)                               : SfxEnumItem(SDRATTR_MEASURETEXTHPOS,rIn)    {}
     virtual SfxPoolItem*   Clone(SfxItemPool* pPool=nullptr) const override;
     virtual SfxPoolItem*   Create(SvStream& rIn, sal_uInt16 nVer) const override;
     virtual sal_uInt16         GetValueCount() const override; // { return 4; }
-            SdrMeasureTextHPos GetValue() const { return (SdrMeasureTextHPos)SfxEnumItem::GetValue(); }
+    css::drawing::MeasureTextHorzPos GetValue() const { return (css::drawing::MeasureTextHorzPos)SfxEnumItem::GetValue(); }
 
     virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
     virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
index 02410ad..d5eb000 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 78de501..52a4225 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 c98ab44..0a38f0c 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;
commit 227e7bf0dba4d3fa992b3ee96f182ffb94591854
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 15 09:15:19 2017 +0000

    coverity#1400530 Mixing enum types
    
    Change-Id: Ia5d0717bc63043bb42f1c9728218fdd09c54a393

diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index ca92593..78de501 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -1850,7 +1850,7 @@ bool SdrMeasureTextVPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMember
         ePos = (drawing::MeasureTextVertPos)nEnum;
     }
 
-    SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextHPos)ePos ) );
+    SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextVPos)ePos ) );
     return true;
 }
 


More information about the Libreoffice-commits mailing list