[Libreoffice-commits] core.git: include/xmloff xmloff/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Mar 31 07:00:17 UTC 2017


 include/xmloff/xmlement.hxx                      |    2 +-
 include/xmloff/xmluconv.hxx                      |    2 +-
 xmloff/source/forms/elementexport.cxx            |    2 +-
 xmloff/source/forms/formattributes.hxx           |    4 ++--
 xmloff/source/forms/formenums.cxx                |    2 +-
 xmloff/source/forms/formenums.hxx                |    2 +-
 xmloff/source/forms/gridcolumnproptranslator.cxx |    8 ++++----
 xmloff/source/style/adjushdl.cxx                 |    2 +-
 8 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 9a165a86795c65c42a94bf6f7f48545c797f2db3
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Mar 30 16:02:15 2017 +0200

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

diff --git a/include/xmloff/xmlement.hxx b/include/xmloff/xmlement.hxx
index 5879324701bf..5a149f6335ad 100644
--- a/include/xmloff/xmlement.hxx
+++ b/include/xmloff/xmlement.hxx
@@ -37,7 +37,7 @@ private:
     sal_uInt16                      nValue;
 public:
     SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, EnumT nValue_)
-        : eToken(eToken_), nValue(nValue_) {}
+        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
     ::xmloff::token::XMLTokenEnum   GetToken() const { return eToken; }
 };
 
diff --git a/include/xmloff/xmluconv.hxx b/include/xmloff/xmluconv.hxx
index e71880be867e..8eb234289011 100644
--- a/include/xmloff/xmluconv.hxx
+++ b/include/xmloff/xmluconv.hxx
@@ -161,7 +161,7 @@ public:
                              enum ::xmloff::token::XMLTokenEnum eDefault =
                                          ::xmloff::token::XML_TOKEN_INVALID )
     {
-        return convertEnumImpl(rBuffer, nValue,
+        return convertEnumImpl(rBuffer, static_cast<sal_uInt16>(nValue),
                    reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pMap), eDefault);
     }
 
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index a2a1b10fc580..0048db73e6c1 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -663,7 +663,7 @@ namespace xmloff
                     OAttributeMetaData::getCommonControlAttributeName( CCAFlags::Orientation ),
                     PROPERTY_ORIENTATION,
                     aOrientationMap,
-                    (sal_uInt16)ScrollBarOrientation::HORIZONTAL
+                    ScrollBarOrientation::HORIZONTAL
                 );
         #if OSL_DEBUG_LEVEL > 0
                 //  reset the bit for later checking
diff --git a/xmloff/source/forms/formattributes.hxx b/xmloff/source/forms/formattributes.hxx
index a5dd78959604..04575930942b 100644
--- a/xmloff/source/forms/formattributes.hxx
+++ b/xmloff/source/forms/formattributes.hxx
@@ -378,10 +378,10 @@ namespace xmloff
         template<typename EnumT>
         void    addEnumProperty(
             const sal_Char* _pAttributeName, const OUString& _rPropertyName,
-            const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry<EnumT>* _pValueMap,
+            const EnumT _nAttributeDefault, const SvXMLEnumMapEntry<EnumT>* _pValueMap,
             const css::uno::Type* _pType = nullptr)
         {
-            addEnumPropertyImpl(_pAttributeName, _rPropertyName, _nAttributeDefault,
+            addEnumPropertyImpl(_pAttributeName, _rPropertyName, static_cast<sal_uInt16>(_nAttributeDefault),
                                 reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(_pValueMap), _pType);
         }
 
diff --git a/xmloff/source/forms/formenums.cxx b/xmloff/source/forms/formenums.cxx
index 30b13cdb82e9..b0da002e7e60 100644
--- a/xmloff/source/forms/formenums.cxx
+++ b/xmloff/source/forms/formenums.cxx
@@ -150,7 +150,7 @@ const SvXMLEnumMapEntry<sal_Int16> aListLinkageMap[] =
     { XML_SELECTION_INDEXES,    1 },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry<sal_uInt16> aOrientationMap[] =
+const SvXMLEnumMapEntry<sal_Int32> aOrientationMap[] =
 {
     { XML_HORIZONTAL,   ScrollBarOrientation::HORIZONTAL },
     { XML_VERTICAL,     ScrollBarOrientation::VERTICAL },
diff --git a/xmloff/source/forms/formenums.hxx b/xmloff/source/forms/formenums.hxx
index 7ed7dcf8acac..cc63e961f270 100644
--- a/xmloff/source/forms/formenums.hxx
+++ b/xmloff/source/forms/formenums.hxx
@@ -45,7 +45,7 @@ extern const SvXMLEnumMapEntry<sal_uInt16> aBorderTypeMap[];
 extern const SvXMLEnumMapEntry<sal_uInt16> aFontEmphasisMap[];
 extern const SvXMLEnumMapEntry<sal_uInt16> aFontReliefMap[];
 extern const SvXMLEnumMapEntry<sal_Int16>  aListLinkageMap[];
-extern const SvXMLEnumMapEntry<sal_uInt16> aOrientationMap[];
+extern const SvXMLEnumMapEntry<sal_Int32>  aOrientationMap[];
 extern const SvXMLEnumMapEntry<sal_Int16>  aVisualEffectMap[];
 extern const SvXMLEnumMapEntry<sal_Int16>  aImagePositionMap[];
 extern const SvXMLEnumMapEntry<sal_uInt16> aImageAlignMap[];
diff --git a/xmloff/source/forms/gridcolumnproptranslator.cxx b/xmloff/source/forms/gridcolumnproptranslator.cxx
index b149d4f9665c..e1241a1e600b 100644
--- a/xmloff/source/forms/gridcolumnproptranslator.cxx
+++ b/xmloff/source/forms/gridcolumnproptranslator.cxx
@@ -74,8 +74,8 @@ namespace xmloff
             { ParagraphAdjust_RIGHT,            awt::TextAlign::RIGHT    },
             { ParagraphAdjust_BLOCK,            awt::TextAlign::RIGHT    },
             { ParagraphAdjust_STRETCH,          awt::TextAlign::LEFT     },
-            { ParagraphAdjust_MAKE_FIXED_SIZE,  awt::TextAlign::LEFT     },
-            { ParagraphAdjust_MAKE_FIXED_SIZE,  -1 }
+            { ParagraphAdjust::ParagraphAdjust_MAKE_FIXED_SIZE,  awt::TextAlign::LEFT     },
+            { ParagraphAdjust::ParagraphAdjust_MAKE_FIXED_SIZE,  -1 }
         };
 
         void valueAlignToParaAdjust(Any& rValue)
@@ -100,9 +100,9 @@ namespace xmloff
             sal_Int32 nValue = 0;
             rValue >>= nValue;
             const AlignmentTranslationEntry* pTranslation = AlignmentTranslations;
-            while ( ParagraphAdjust_MAKE_FIXED_SIZE != pTranslation->nParagraphValue)
+            while ( ParagraphAdjust::ParagraphAdjust_MAKE_FIXED_SIZE != pTranslation->nParagraphValue)
             {
-                if ( nValue == pTranslation->nParagraphValue)
+                if ( (ParagraphAdjust)nValue == pTranslation->nParagraphValue)
                 {
                     rValue <<= pTranslation->nControlValue;
                     return;
diff --git a/xmloff/source/style/adjushdl.cxx b/xmloff/source/style/adjushdl.cxx
index bb2e36590612..50049509bb8e 100644
--- a/xmloff/source/style/adjushdl.cxx
+++ b/xmloff/source/style/adjushdl.cxx
@@ -111,7 +111,7 @@ bool XMLLastLineAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any
 
     rValue >>= nVal;
 
-    if( nVal != style::ParagraphAdjust_LEFT )
+    if( (style::ParagraphAdjust)nVal != style::ParagraphAdjust_LEFT )
         bRet = SvXMLUnitConverter::convertEnum( aOut, (style::ParagraphAdjust)nVal, pXML_Para_Align_Last_Enum, XML_START );
 
     rStrExpValue = aOut.makeStringAndClear();


More information about the Libreoffice-commits mailing list