[Libreoffice-commits] core.git: vcl/osx vcl/source vcl/unx winaccessibility/source writerfilter/source writerperfect/qa xmlscript/source xmlsecurity/qa xmlsecurity/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Apr 3 11:05:47 UTC 2017


 vcl/osx/a11ytextattributeswrapper.mm                   |    4 ++--
 vcl/source/app/unohelp.cxx                             |    4 ++--
 vcl/source/gdi/lineinfo.cxx                            |    2 +-
 vcl/source/gdi/svmconverter.cxx                        |    4 ++--
 vcl/unx/gtk/a11y/atktextattributes.cxx                 |    6 +++---
 winaccessibility/source/UAccCOM/MAccessible.cxx        |    3 +--
 writerfilter/source/dmapper/DomainMapper.cxx           |    2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx      |    2 +-
 writerfilter/source/dmapper/GraphicImport.cxx          |    4 ++--
 writerfilter/source/dmapper/PropertyMap.cxx            |    4 ++--
 writerfilter/source/rtftok/rtfdocumentimpl.cxx         |    2 +-
 writerfilter/source/rtftok/rtfsdrimport.cxx            |    2 +-
 writerperfect/qa/unit/SpreadsheetImportTest.cxx        |   10 ++++++++++
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx        |    2 +-
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx        |    2 +-
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx          |    2 +-
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |    2 +-
 17 files changed, 33 insertions(+), 24 deletions(-)

New commits:
commit 0fe6f1a196b70f0ba4c948389b2ef9b1e77187b8
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Apr 3 10:55:16 2017 +0200

    use actual UNO enums in vcl..xmlsecurity
    
    Change-Id: Id862544f27ebcbe8363f93dc83192d0f0cddb5cc
    Reviewed-on: https://gerrit.libreoffice.org/36041
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/osx/a11ytextattributeswrapper.mm b/vcl/osx/a11ytextattributeswrapper.mm
index 090f429df30f..4a7de4824b17 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -141,7 +141,7 @@ using namespace ::com::sun::star::uno;
 
 +(int)convertItalicStyle:(PropertyValue)property {
     int italicStyle = NSUnitalicFontMask;
-    sal_Int16 value = property.Value.get< ::css_awt::FontSlant>();
+    ::css_awt::FontSlant value = property.Value.get< ::css_awt::FontSlant>();
     if ( value == ::css_awt::FontSlant_ITALIC ) {
         italicStyle = NSItalicFontMask;
     }
@@ -279,7 +279,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
     // 'NSJustifiedTextAlignment' is deprecated: first deprecated in macOS 10.12
     // 'NSLeftTextAlignment' is deprecated: first deprecated in macOS 10.12
     // 'NSRightTextAlignment' is deprecated: first deprecated in macOS 10.12
-                switch(alignment) {
+                switch((css::style::ParagraphAdjust)alignment) {
                     case css::style::ParagraphAdjust_RIGHT : textAlignment = [NSNumber numberWithInteger:NSRightTextAlignment]    ; break;
                     case css::style::ParagraphAdjust_CENTER: textAlignment = [NSNumber numberWithInteger:NSCenterTextAlignment]   ; break;
                     case css::style::ParagraphAdjust_BLOCK : textAlignment = [NSNumber numberWithInteger:NSJustifiedTextAlignment]; break;
diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx
index e47d69ba9594..413f470cac56 100644
--- a/vcl/source/app/unohelp.cxx
+++ b/vcl/source/app/unohelp.cxx
@@ -192,7 +192,7 @@ css::awt::FontSlant vcl::unohelper::ConvertFontSlant(FontItalic eItalic)
             eRet = css::awt::FontSlant_DONTKNOW;
             break;
         case FontItalic_FORCE_EQUAL_SIZE:
-            eRet = css::awt::FontSlant_MAKE_FIXED_SIZE;
+            eRet = css::awt::FontSlant::FontSlant_MAKE_FIXED_SIZE;
             break;
     }
     return eRet;
@@ -223,7 +223,7 @@ FontItalic vcl::unohelper::ConvertFontSlant(css::awt::FontSlant eSlant)
             //there is no vcl reverse normal
             eRet = ITALIC_NORMAL;
             break;
-        case css::awt::FontSlant_MAKE_FIXED_SIZE:
+        case css::awt::FontSlant::FontSlant_MAKE_FIXED_SIZE:
             eRet = FontItalic_FORCE_EQUAL_SIZE;
             break;
     }
diff --git a/vcl/source/gdi/lineinfo.cxx b/vcl/source/gdi/lineinfo.cxx
index a82d82cf2103..095254f4193e 100644
--- a/vcl/source/gdi/lineinfo.cxx
+++ b/vcl/source/gdi/lineinfo.cxx
@@ -216,7 +216,7 @@ SvStream& WriteLineInfo( SvStream& rOStm, const LineInfo& rLineInfo )
     rOStm.WriteUInt16( static_cast<sal_uInt16>(rLineInfo.mpImplLineInfo->meLineJoin) );
 
     // since version4
-    rOStm.WriteUInt16( rLineInfo.mpImplLineInfo->meLineCap );
+    rOStm.WriteUInt16( (sal_uInt16)rLineInfo.mpImplLineInfo->meLineCap );
 
     return rOStm;
 }
diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx
index 08428e876fc2..049479961bef 100644
--- a/vcl/source/gdi/svmconverter.cxx
+++ b/vcl/source/gdi/svmconverter.cxx
@@ -1586,7 +1586,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
                     {
                         rOStm.WriteInt16( GDI_LINECAP_ACTION );
                         rOStm.WriteInt32( 6 );
-                        rOStm.WriteInt16( rInfo.GetLineCap() );
+                        rOStm.WriteInt16( (sal_Int16)rInfo.GetLineCap() );
                     }
                 }
 
@@ -1742,7 +1742,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
                     {
                         rOStm.WriteInt16( GDI_LINECAP_ACTION );
                         rOStm.WriteInt32( 6 );
-                        rOStm.WriteInt16( rInfo.GetLineCap() );
+                        rOStm.WriteInt16( (sal_Int16)rInfo.GetLineCap() );
                     }
                 }
 
diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx
index 1ee48d456c17..5a1819b2319f 100644
--- a/vcl/unx/gtk/a11y/atktextattributes.cxx
+++ b/vcl/unx/gtk/a11y/atktextattributes.cxx
@@ -387,7 +387,7 @@ Adjust2Justification(const uno::Any& rAny)
 {
     const gchar * value = nullptr;
 
-    switch( rAny.get<short>() )
+    switch( (style::ParagraphAdjust)rAny.get<short>() )
     {
         case style::ParagraphAdjust_LEFT:
             value = "left";
@@ -419,7 +419,7 @@ Adjust2Justification(const uno::Any& rAny)
 static bool
 Justification2Adjust( uno::Any& rAny, const gchar * value )
 {
-    short nParagraphAdjust;
+    style::ParagraphAdjust nParagraphAdjust;
 
     if( strncmp( value, STRNCMP_PARAM( "left" ) ) == 0 )
         nParagraphAdjust = style::ParagraphAdjust_LEFT;
@@ -432,7 +432,7 @@ Justification2Adjust( uno::Any& rAny, const gchar * value )
     else
         return false;
 
-    rAny <<= nParagraphAdjust;
+    rAny <<= (short)nParagraphAdjust;
     return true;
 }
 
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 744215440788..3c34e30a766d 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2838,7 +2838,6 @@ void CMAccessible::get_OLECHARFromAny(Any& pAny, OLECHAR* pChar)
     case TypeClass_CONSTANT:
     case TypeClass_CONSTANTS:
     case TypeClass_SINGLETON:
-    case TypeClass_MAKE_FIXED_SIZE:
         break;
     default:
         break;
@@ -3017,7 +3016,7 @@ void CMAccessible::ConvertAnyToVariant(const css::uno::Any &rAnyVal, VARIANT *pv
         case TypeClass_CONSTANT:
         case TypeClass_CONSTANTS:
         case TypeClass_SINGLETON:
-        case TypeClass_MAKE_FIXED_SIZE:
+        case TypeClass::TypeClass_MAKE_FIXED_SIZE:
             // Output the type string, if there is other uno value type.
             pvData->vt = VT_BSTR;
             pvData->bstrVal = SysAllocString(rAnyVal.getValueTypeName().getStr());
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 4e3ff7676b5e..b899810c8444 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2726,7 +2726,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
         {
             rContext->Insert(PROP_RUBY_TEXT, uno::makeAny(aInfo.sRubyText));
             rContext->Insert(PROP_RUBY_STYLE, uno::makeAny(aInfo.sRubyStyle));
-            rContext->Insert(PROP_RUBY_ADJUST, uno::makeAny<sal_Int16>(ConversionHelper::convertRubyAlign(aInfo.nRubyAlign)));
+            rContext->Insert(PROP_RUBY_ADJUST, uno::makeAny((sal_Int16)ConversionHelper::convertRubyAlign(aInfo.nRubyAlign)));
             m_pImpl->SetRubySprmId(0);
         }
     }
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 9042e341afb2..03e172cc32ac 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3101,7 +3101,7 @@ void  DomainMapper_Impl::handleRubyEQField( const FieldContextPtr& pContext)
             pCharContext->InsertProps(m_pLastCharacterContext);
         pCharContext->InsertProps(pContext->getProperties());
         pCharContext->Insert(PROP_RUBY_TEXT, uno::makeAny( aInfo.sRubyText ) );
-        pCharContext->Insert(PROP_RUBY_ADJUST, uno::makeAny<sal_Int16>(ConversionHelper::convertRubyAlign(aInfo.nRubyAlign)));
+        pCharContext->Insert(PROP_RUBY_ADJUST, uno::makeAny((sal_Int16)ConversionHelper::convertRubyAlign(aInfo.nRubyAlign)));
         pCharContext->Insert(PROP_RUBY_STYLE, uno::makeAny(aInfo.sRubyStyle));
         appendTextPortion(sPart2, pCharContext);
     }
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 55c4342368d1..27bd7174d994 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -842,7 +842,7 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
                         m_pImpl->applyMargins(xShapeProps);
                         bool bOpaque = m_pImpl->bOpaque && !m_pImpl->rDomainMapper.IsInHeaderFooter();
                         xShapeProps->setPropertyValue("Opaque", uno::makeAny(bOpaque));
-                        xShapeProps->setPropertyValue("Surround", uno::makeAny<sal_Int32>(m_pImpl->nWrap));
+                        xShapeProps->setPropertyValue("Surround", uno::makeAny((sal_Int32)m_pImpl->nWrap));
                         m_pImpl->applyZOrder(xShapeProps);
                         m_pImpl->applyName(xShapeProps);
 
@@ -1264,7 +1264,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
                         uno::makeAny(bOpaque));
                 }
                 xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_SURROUND ),
-                    uno::makeAny<sal_Int32>(m_pImpl->nWrap));
+                    uno::makeAny((sal_Int32)m_pImpl->nWrap));
                 if( m_pImpl->rDomainMapper.IsInTable() && m_pImpl->bLayoutInCell && m_pImpl->nWrap != text::WrapTextMode_THROUGHT )
                     xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_FOLLOW_TEXT_FLOW ),
                         uno::makeAny(true));
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 2597f092cb62..33d5618b00a0 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1557,7 +1557,7 @@ ParagraphProperties::ParagraphProperties() :
     m_nLines(0),
     m_w(-1),
     m_h(-1),
-    m_nWrap(text::WrapTextMode_MAKE_FIXED_SIZE),
+    m_nWrap(text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE),
     m_hAnchor(-1),
     m_vAnchor(-1),
     m_x(-1),
@@ -1637,7 +1637,7 @@ void ParagraphProperties::ResetFrameProperties()
     m_nLines = 0;
     m_w = -1;
     m_h = -1;
-    m_nWrap = text::WrapTextMode_MAKE_FIXED_SIZE;
+    m_nWrap = text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE;
     m_hAnchor = -1;
     m_vAnchor = -1;
     m_x = -1;
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index bafdd3484ab0..fe35afe1d372 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3272,7 +3272,7 @@ RTFShape::RTFShape()
       nVertOrientRelation(0),
       nHoriOrientRelationToken(0),
       nVertOrientRelationToken(0),
-      nWrap(text::WrapTextMode_MAKE_FIXED_SIZE),
+      nWrap(text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE),
       bInBackground(false)
 {
 }
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 18263f32106a..16a65806a6ce 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -958,7 +958,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
             xPropertySet->setPropertyValue("HoriOrientRelation", uno::makeAny(rShape.nHoriOrientRelation));
         if (rShape.nVertOrientRelation != 0)
             xPropertySet->setPropertyValue("VertOrientRelation", uno::makeAny(rShape.nVertOrientRelation));
-        if (rShape.nWrap != text::WrapTextMode_MAKE_FIXED_SIZE)
+        if (rShape.nWrap != text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE)
             xPropertySet->setPropertyValue("Surround", uno::makeAny(text::WrapTextMode(rShape.nWrap)));
         oox::ModelObjectHelper aModelObjectHelper(m_rImport.getModelFactory());
         if (aFillModel.moType.has())
diff --git a/writerperfect/qa/unit/SpreadsheetImportTest.cxx b/writerperfect/qa/unit/SpreadsheetImportTest.cxx
index 55d03151924b..8cfd73d00a36 100644
--- a/writerperfect/qa/unit/SpreadsheetImportTest.cxx
+++ b/writerperfect/qa/unit/SpreadsheetImportTest.cxx
@@ -24,6 +24,16 @@
 #include "WpftLoader.hxx"
 #include "wpftimport.hxx"
 
+namespace com { namespace sun { namespace star { namespace table {
+
+std::ostream& operator<<(std::ostream& rStrm, CellContentType n)
+{
+    rStrm << (int) n;
+    return rStrm;
+}
+
+} } } }
+
 namespace
 {
 
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index f88f86119ff1..0e3bc40c3b0b 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -834,7 +834,7 @@ void ElementDescriptor::readButtonTypeAttr( OUString const & rPropName, OUString
         Any a( _xProps->getPropertyValue( rPropName ) );
         if (auto n = o3tl::tryAccess<sal_Int16>(a))
         {
-            switch (*n)
+            switch ((awt::PushButtonType)*n)
             {
             case awt::PushButtonType_STANDARD:
                 addAttribute( rAttrName, "standard" );
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index 1e9f6e990d45..32edd32ea4cf 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -1070,7 +1070,7 @@ bool ImportContext::importButtonTypeProperty(
             _pImport->XMLNS_DIALOGS_UID, rAttrName ) );
     if (!buttonType.isEmpty())
     {
-        sal_Int16 nButtonType;
+        awt::PushButtonType nButtonType;
         if ( buttonType == "standard" )
         {
             nButtonType = awt::PushButtonType_STANDARD;
diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
index 003e859ac4fe..48e3a021199d 100644
--- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
+++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
@@ -379,7 +379,7 @@ void PDFSigningTest::testGood()
         std::vector<SignatureInformation> aInfos = verify(m_directories.getURLFromSrc(DATA_DIRECTORY) + rName, 1, /*rExpectedSubFilter=*/OString());
         CPPUNIT_ASSERT(!aInfos.empty());
         SignatureInformation& rInformation = aInfos[0];
-        CPPUNIT_ASSERT_EQUAL(xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED, rInformation.nStatus);
+        CPPUNIT_ASSERT_EQUAL((int)xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED, (int)rInformation.nStatus);
     }
 }
 
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 5aae7617b055..a485a43ab178 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -395,7 +395,7 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, AddButtonHdl, Button*, void)
                 return;
             mbSignaturesChanged = true;
 
-            sal_Int32 nStatus = xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED;
+            xml::crypto::SecurityOperationStatus nStatus = xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED;
 
             if (maSignatureManager.mxStore.is())
                 // In the PDF case the signature information is only available after parsing.


More information about the Libreoffice-commits mailing list