sd/qa/unit/export-tests-ooxml1.cxx       |    6 ++---
 sd/qa/unit/export-tests-ooxml2.cxx       |    4 +--
 sd/qa/unit/import-tests.cxx              |   35 +++++++++++++++++++++++++++++++
 sd/qa/unit/misc-tests.cxx                |    6 ++---
 sd/source/filter/eppt/pptx-epptooxml.cxx |    2 -
 sd/source/filter/eppt/pptx-text.cxx      |    2 -
 sd/source/ui/func/fuoaprms.cxx           |    8 +++----
 sd/source/ui/unoidl/unoobj.cxx           |    2 -
 sd/source/ui/view/drviews9.cxx           |   10 ++++----
 9 files changed, 55 insertions(+), 20 deletions(-)

New commits:
commit 82025e7f7af562549a900b9f1d76ed73fe4f2a58
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Fri Mar 31 12:21:44 2017 +0200

    use actual UNO enums in sd
    
    Change-Id: Ife2590d2d8d7622ea6fa2f03d6a333c856326d34
    Reviewed-on: https://gerrit.libreoffice.org/35963
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 2fc233bf836a..e7a29c25f6c4 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -507,12 +507,12 @@ void SdOOXMLExportTest1::testTableCellFillProperties()
     drawing::FillStyle aFillStyle( drawing::FillStyle_NONE );
     xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
     xCell->getPropertyValue("FillStyle") >>= aFillStyle;
-    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_BITMAP, aFillStyle);
+    CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_BITMAP, (int)aFillStyle);
 
     // Test Gradient fill type for cell
     xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
     xCell->getPropertyValue("FillStyle") >>= aFillStyle;
-    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, aFillStyle);
+    CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_GRADIENT, (int)aFillStyle);
 
     xDocShRef->DoClose();
 }
@@ -543,7 +543,7 @@ void SdOOXMLExportTest1::testLineStyle()
 
     const XLineStyleItem& rStyleItem = dynamic_cast<const XLineStyleItem&>(
                 pShape->GetMergedItem(XATTR_LINESTYLE));
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong style",drawing::LineStyle_SOLID, 
rStyleItem.GetValue());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong style", (int)drawing::LineStyle_SOLID, 
(int)rStyleItem.GetValue());
 
     xDocShRef->DoClose();
 }
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index fa83615f268e..0e6bd2542814 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -768,12 +768,12 @@ void SdOOXMLExportTest2::testTdf105739()
         // Test fill type
         drawing::FillStyle aFillStyle(drawing::FillStyle_NONE);
         aXBackgroundPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
-        CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, aFillStyle);
+        CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_GRADIENT, 
(int)aFillStyle);
 
         // Test gradient properties
         com::sun::star::awt::Gradient aFillGradient;
         aXBackgroundPropSet->getPropertyValue("FillGradient") >>= 
aFillGradient;
-        CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_LINEAR, aFillGradient.Style);
+        CPPUNIT_ASSERT_EQUAL((int)awt::GradientStyle_LINEAR, 
(int)aFillGradient.Style);
         CPPUNIT_ASSERT_EQUAL(util::Color(0xff0000), aFillGradient.StartColor);
         CPPUNIT_ASSERT_EQUAL(util::Color(0x00b050), aFillGradient.EndColor);
     }
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index c4dfd192dd09..f45ae187d0db 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -623,6 +623,41 @@ std::ostream& operator<<(std::ostream& rStrm, const 
uno::Reference<T>& xRef)
 
 } } } }
 
+namespace com { namespace sun { namespace star { namespace drawing {
+
+std::ostream& operator<<(std::ostream& rStrm, LineStyle n)
+{
+    rStrm << (int) n;
+    return rStrm;
+}
+std::ostream& operator<<(std::ostream& rStrm, FillStyle n)
+{
+    rStrm << (int) n;
+    return rStrm;
+}
+
+} } } }
+
+namespace com { namespace sun { namespace star { namespace presentation {
+
+std::ostream& operator<<(std::ostream& rStrm, ClickAction n)
+{
+    rStrm << (int) n;
+    return rStrm;
+}
+
+} } } }
+
+namespace com { namespace sun { namespace star { namespace style {
+
+std::ostream& operator<<(std::ostream& rStrm, ParagraphAdjust n)
+{
+    rStrm << (int) n;
+    return rStrm;
+}
+
+} } } }
+
 void SdImportTest::testTdf97808()
 {
     sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/tdf97808.fodp"), FODP);
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 87c6beb66ca0..014869cb0790 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -228,7 +228,7 @@ void SdMiscTest::testTdf99396TextEdit()
         uno::Reference<table::XTable> xTable = pTableObject->getTable();
         uno::Reference<beans::XPropertySet> xCell(xTable->getCellByPosition(0, 
0), uno::UNO_QUERY);
         drawing::TextVerticalAdjust eAdjust = 
xCell->getPropertyValue("TextVerticalAdjust").get<drawing::TextVerticalAdjust>();
-        CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, eAdjust);
+        CPPUNIT_ASSERT_EQUAL((int)drawing::TextVerticalAdjust_BOTTOM, 
(int)eAdjust);
     }
     {
         const EditTextObject& rEdit = 
pTableObject->getText(0)->GetOutlinerParaObject()->GetTextObject();
@@ -246,7 +246,7 @@ void SdMiscTest::testTdf99396TextEdit()
         uno::Reference<beans::XPropertySet> xCell(xTable->getCellByPosition(0, 
0), uno::UNO_QUERY);
         drawing::TextVerticalAdjust eAdjust = 
xCell->getPropertyValue("TextVerticalAdjust").get<drawing::TextVerticalAdjust>();
         // This failed: Undo() did not change it from 
drawing::TextVerticalAdjust_BOTTOM.
-        CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, eAdjust);
+        CPPUNIT_ASSERT_EQUAL((int)drawing::TextVerticalAdjust_TOP, 
(int)eAdjust);
     }
     {
         const EditTextObject& rEdit = 
pTableObject->getText(0)->GetOutlinerParaObject()->GetTextObject();
@@ -298,7 +298,7 @@ void SdMiscTest::testFillGradient()
     drawing::FillStyle eFillStyle;
     awt::Gradient aGradient2;
     CPPUNIT_ASSERT(xPropSet2->getPropertyValue("FillStyle") >>= eFillStyle);
-    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT,eFillStyle);
+    CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_GRADIENT, (int)eFillStyle);
     CPPUNIT_ASSERT(xPropSet2->getPropertyValue("FillGradient") >>= aGradient2);
     CPPUNIT_ASSERT_EQUAL(sal_Int32(RGB_COLORDATA(255, 0, 
0)),aGradient2.StartColor);
     CPPUNIT_ASSERT_EQUAL(sal_Int32(RGB_COLORDATA(0, 255, 
0)),aGradient2.EndColor);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index a4762d404daa..a2a9e5216fd9 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1078,7 +1078,7 @@ void PowerPointExport::WriteAnimationCondition( const 
FSHelperPtr& pFS, Any& rAn
     } else if( aEvent.Offset >>= eTiming ) {
         if( eTiming == Timing_INDEFINITE )
             pDelay = "indefinite";
-        SAL_INFO("sd.eppt", "event offset timing: " << eTiming);
+        SAL_INFO("sd.eppt", "event offset timing: " << (int)eTiming);
     }
     }
 
diff --git a/sd/source/filter/eppt/pptx-text.cxx 
b/sd/source/filter/eppt/pptx-text.cxx
index 5ce1714f8d7d..51c9ab3944fd 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -1122,7 +1122,7 @@ void ParagraphObj::ImplGetParagraphValues( 
PPTExBulletProvider* pBuProv, bool bG
 
     if ( ImplGetPropertyValue( "ParaTabStops", bGetPropStateValue ) )
         maTabStop = 
*o3tl::doAccess<css::uno::Sequence<css::style::TabStop>>(mAny);
-    sal_Int16 eTextAdjust( css::style::ParagraphAdjust_LEFT );
+    sal_Int16 eTextAdjust( (sal_Int16)css::style::ParagraphAdjust_LEFT );
     if ( GetPropertyValue( aAny, mXPropSet, "ParaAdjust", bGetPropStateValue ) 
)
         aAny >>= eTextAdjust;
     switch ( (css::style::ParagraphAdjust)eTextAdjust )
diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx
index 06486761bb2d..a58efa46b682 100644
--- a/sd/source/ui/func/fuoaprms.cxx
+++ b/sd/source/ui/func/fuoaprms.cxx
@@ -354,14 +354,14 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& 
rReq )
         else if (nEffectSet == ATTR_MIXED)
             aSet.InvalidateItem( ATTR_ANIMATION_EFFECT );
         else
-            aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, 
presentation::AnimationEffect_NONE));
+            aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, 
(sal_uInt16)presentation::AnimationEffect_NONE));
 
         if (nTextEffectSet == ATTR_SET)
             aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, 
(sal_uInt16)eTextEffect));
         else if (nTextEffectSet == ATTR_MIXED)
             aSet.InvalidateItem( ATTR_ANIMATION_TEXTEFFECT );
         else
-            aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, 
presentation::AnimationEffect_NONE));
+            aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, 
(sal_uInt16)presentation::AnimationEffect_NONE));
 
         if (nSpeedSet == ATTR_SET)
             aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_SPEED, (sal_uInt16)eSpeed));
@@ -413,7 +413,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& 
rReq )
         else if (nClickActionSet == ATTR_MIXED)
             aSet.InvalidateItem(ATTR_ACTION);
         else
-            aSet.Put(SfxAllEnumItem(ATTR_ACTION, 
presentation::ClickAction_NONE));
+            aSet.Put(SfxAllEnumItem(ATTR_ACTION, 
(sal_uInt16)presentation::ClickAction_NONE));
 
         if (nBookmarkSet == ATTR_SET)
             aSet.Put(SfxStringItem(ATTR_ACTION_FILENAME, aBookmark));
@@ -425,7 +425,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& 
rReq )
         else if (nSecondEffectSet == ATTR_MIXED)
             aSet.InvalidateItem( ATTR_ACTION_EFFECT );
         else
-            aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, 
presentation::AnimationEffect_NONE));
+            aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, 
(sal_uInt16)presentation::AnimationEffect_NONE));
 
         if (nSecondSpeedSet == ATTR_SET)
             aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECTSPEED, 
(sal_uInt16)eSecondSpeed));
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index 806e60e36c02..bb89af1985b0 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -1379,7 +1379,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const 
OUString& aName, const uno
                     bOk = true;
                 }
                 break;
-            case presentation::ClickAction_MAKE_FIXED_SIZE:
+            default:
                 break;
             }
         }
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index 1bf00f00e603..0bb246b89ec5 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -217,7 +217,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
                 if (pArgs->Count () == 1)
                 {
                     const SfxUInt32Item* pFillStyle = 
rReq.GetArg<SfxUInt32Item>(ID_VAL_STYLE);
-                    if (CHECK_RANGE (drawing::FillStyle_NONE, 
(sal_Int32)pFillStyle->GetValue (), drawing::FillStyle_BITMAP))
+                    if (CHECK_RANGE (drawing::FillStyle_NONE, 
(drawing::FillStyle)pFillStyle->GetValue (), drawing::FillStyle_BITMAP))
                     {
                         pAttr->ClearItem (XATTR_FILLSTYLE);
                         XFillStyleItem aStyleItem((drawing::FillStyle) 
pFillStyle->GetValue ());
@@ -242,7 +242,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
                 if (pArgs->Count () == 1)
                 {
                     const SfxUInt32Item* pLineStyle = 
rReq.GetArg<SfxUInt32Item>(ID_VAL_STYLE);
-                    if (CHECK_RANGE (drawing::LineStyle_NONE, 
(sal_Int32)pLineStyle->GetValue (), drawing::LineStyle_DASH))
+                    if (CHECK_RANGE ((sal_Int32)drawing::LineStyle_NONE, 
(sal_Int32)pLineStyle->GetValue(), (sal_Int32)drawing::LineStyle_DASH))
                     {
                         pAttr->ClearItem (XATTR_LINESTYLE);
                         XLineStyleItem aStyleItem((drawing::LineStyle) 
pLineStyle->GetValue());
@@ -475,7 +475,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
                     const SfxUInt32Item* pDashLen = 
rReq.GetArg<SfxUInt32Item>(ID_VAL_DASHLEN);
                     const SfxUInt32Item* pDistance = 
rReq.GetArg<SfxUInt32Item>(ID_VAL_DISTANCE);
 
-                    if (CHECK_RANGE (css::drawing::DashStyle_RECT, 
(sal_Int32)pStyle->GetValue (), css::drawing::DashStyle_ROUNDRELATIVE))
+                    if (CHECK_RANGE ((sal_Int32)css::drawing::DashStyle_RECT, 
(sal_Int32)pStyle->GetValue(), 
(sal_Int32)css::drawing::DashStyle_ROUNDRELATIVE))
                     {
                         XDash aNewDash ((css::drawing::DashStyle) 
pStyle->GetValue (), (short) pDots->GetValue (), pDotLen->GetValue (),
                                         (short) pDashes->GetValue (), 
pDashLen->GetValue (), pDistance->GetValue ());
@@ -530,7 +530,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
                     const SfxUInt32Item* pStart = 
rReq.GetArg<SfxUInt32Item>(ID_VAL_STARTINTENS);
                     const SfxUInt32Item* pEnd = 
rReq.GetArg<SfxUInt32Item>(ID_VAL_ENDINTENS);
 
-                    if (CHECK_RANGE (css::awt::GradientStyle_LINEAR, 
(sal_Int32)pStyle->GetValue (), css::awt::GradientStyle_RECT) &&
+                    if (CHECK_RANGE 
((sal_Int32)css::awt::GradientStyle_LINEAR, (sal_Int32)pStyle->GetValue(), 
(sal_Int32)css::awt::GradientStyle_RECT) &&
                         CHECK_RANGE (0, (sal_Int32)pAngle->GetValue (), 360) &&
                         CHECK_RANGE (0, (sal_Int32)pBorder->GetValue (), 100) 
&&
                         CHECK_RANGE (0, (sal_Int32)pCenterX->GetValue (), 100) 
&&
@@ -613,7 +613,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
                     const SfxUInt32Item* pDistance = 
rReq.GetArg<SfxUInt32Item>(ID_VAL_DISTANCE);
                     const SfxUInt32Item* pAngle = 
rReq.GetArg<SfxUInt32Item>(ID_VAL_ANGLE);
 
-                    if (CHECK_RANGE (css::drawing::HatchStyle_SINGLE, 
(sal_Int32)pStyle->GetValue (), css::drawing::HatchStyle_TRIPLE) &&
+                    if (CHECK_RANGE 
((sal_Int32)css::drawing::HatchStyle_SINGLE, (sal_Int32)pStyle->GetValue(), 
(sal_Int32)css::drawing::HatchStyle_TRIPLE) &&
                         CHECK_RANGE (0, (sal_Int32)pAngle->GetValue (), 360))
                     {
                         pAttr->ClearItem (XATTR_FILLHATCH);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to