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

Noel Grandin noel.grandin at collabora.co.uk
Wed Dec 20 06:10:11 UTC 2017


 include/svx/DescriptionGenerator.hxx              |    6 +++---
 include/svx/unoapi.hxx                            |    4 ++--
 include/svx/unoshape.hxx                          |    6 +++---
 svx/source/accessibility/DescriptionGenerator.cxx |   11 +++++------
 svx/source/unodraw/unoprov.cxx                    |    6 +++---
 svx/source/unodraw/unoshape.cxx                   |   16 ++++++++--------
 6 files changed, 24 insertions(+), 25 deletions(-)

New commits:
commit 495bb32c23be5acec3783240eb03ccfc5aca44cd
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Dec 19 15:05:23 2017 +0200

    long->sal_uInt16 in SvxShape
    
    Change-Id: I28a54497b1a4c236d9d3bdb0f44d3e46f3e55de7
    Reviewed-on: https://gerrit.libreoffice.org/46810
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/DescriptionGenerator.hxx b/include/svx/DescriptionGenerator.hxx
index ecbe8cc51093..fd1b1e2a39ad 100644
--- a/include/svx/DescriptionGenerator.hxx
+++ b/include/svx/DescriptionGenerator.hxx
@@ -101,7 +101,7 @@ public:
     void AddProperty (const OUString& sPropertyName,
         PropertyType aType,
         const OUString& sLocalizedName=OUString(),
-        long nWhichId=-1);
+        sal_uInt16 nWhichId = 0xffff);
 
     /** Add the given property name and its associated value to the
         description string.  If the property value does not differ from the
@@ -123,7 +123,7 @@ public:
     void AddProperty (const OUString& sPropertyName,
         PropertyType aType,
         const char* pResourceId,
-        long nWhichId=-1);
+        sal_uInt16 nWhichId = 0xffff);
 
     /** Append the given string as is to the current description.
         @param sString
@@ -178,7 +178,7 @@ private:
             Name of the property.
     */
     SVX_DLLPRIVATE void AddString (const OUString& sPropertyName,
-        const OUString& sLocalizedName, long nWhichId);
+        const OUString& sLocalizedName, sal_uInt16 nWhichId);
 
     /** Add a property value formatted as fill style to the description
         string.  If the fill style is <const>HATCH</const>,
diff --git a/include/svx/unoapi.hxx b/include/svx/unoapi.hxx
index a2df06bf2341..8000220b2940 100644
--- a/include/svx/unoapi.hxx
+++ b/include/svx/unoapi.hxx
@@ -80,7 +80,7 @@ SVX_DLLPUBLIC bool SvxFieldUnitToMeasureUnit( const FieldUnit nVcl, short& eApi
  * @throws std::exception
 */
 SVX_DLLPUBLIC SAL_WARN_UNUSED_RESULT OUString
-    SvxUnogetApiNameForItem(const sal_Int16 nWhich, const OUString& rInternalName);
+    SvxUnogetApiNameForItem(const sal_uInt16 nWhich, const OUString& rInternalName);
 
 /**
  * If the given name is a predefined API name it is replaced by the predefined name
@@ -89,7 +89,7 @@ SVX_DLLPUBLIC SAL_WARN_UNUSED_RESULT OUString
  * @throws std::exception
 */
 SVX_DLLPUBLIC SAL_WARN_UNUSED_RESULT OUString
-    SvxUnogetInternalNameForItem(const sal_Int16 nWhich, const OUString& rApiName);
+    SvxUnogetInternalNameForItem(const sal_uInt16 nWhich, const OUString& rApiName);
 
 #endif // INCLUDED_SVX_UNOAPI_HXX
 
diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index ba28d311dd5d..678ee0abeffc 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -148,7 +148,7 @@ protected:
 
     css::uno::Any GetAnyForItem( SfxItemSet const & aSet, const SfxItemPropertySimpleEntry* pMap ) const;
 
-    bool SetFillAttribute( sal_Int32 nWID, const OUString& rName );
+    bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName );
 
     /** called from the XActionLockable interface methods on initial locking */
     virtual void lock();
@@ -216,8 +216,8 @@ public:
     sal_uInt32 getShapeKind() const;
 
     // styles need this
-    static bool SetFillAttribute( sal_Int32 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel );
-    static bool SetFillAttribute( sal_Int32 nWID, const OUString& rName, SfxItemSet& rSet );
+    static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel );
+    static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet );
 
     /** same as SetFillAttribute but for property names instead of which ids,
         and the property found is returned instead of set at the object
diff --git a/svx/source/accessibility/DescriptionGenerator.cxx b/svx/source/accessibility/DescriptionGenerator.cxx
index 460ac069be5c..72f95751b478 100644
--- a/svx/source/accessibility/DescriptionGenerator.cxx
+++ b/svx/source/accessibility/DescriptionGenerator.cxx
@@ -126,7 +126,7 @@ void DescriptionGenerator::AddProperty (
     const OUString& sPropertyName,
     PropertyType aType,
     const char* pLocalizedNameId,
-    long nWhichId)
+    sal_uInt16 nWhichId)
 {
     OUString sLocalizedName;
     {
@@ -138,7 +138,7 @@ void DescriptionGenerator::AddProperty (
 
 
 void DescriptionGenerator::AddProperty (const OUString& sPropertyName,
-    PropertyType aType, const OUString& sLocalizedName, long nWhichId)
+    PropertyType aType, const OUString& sLocalizedName, sal_uInt16 nWhichId)
 {
     uno::Reference<beans::XPropertyState> xState (mxShape, uno::UNO_QUERY);
     if (xState.is()
@@ -270,7 +270,7 @@ void DescriptionGenerator::AddInteger (const OUString& sPropertyName,
 
 
 void DescriptionGenerator::AddString (const OUString& sPropertyName,
-    const OUString& sLocalizedName, long nWhichId)
+    const OUString& sLocalizedName, sal_uInt16 nWhichId)
 {
     msDescription.append(sLocalizedName);
     msDescription.append('=');
@@ -283,12 +283,11 @@ void DescriptionGenerator::AddString (const OUString& sPropertyName,
             OUString sValue;
             aValue >>= sValue;
 
-            if (nWhichId >= 0)
+            if (nWhichId != 0xffff)
             {
                 SolarMutexGuard aGuard;
                 OUString sLocalizedValue =
-                    SvxUnogetInternalNameForItem(sal::static_int_cast<sal_Int16>(nWhichId),
-                                              sValue);
+                    SvxUnogetInternalNameForItem(nWhichId, sValue);
                 msDescription.append (sLocalizedValue);
             }
             else
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 06464d132a88..800281121d33 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -1498,7 +1498,7 @@ static const char* RID_SVXSTR_TRASNGR[] =
     RID_SVXSTR_TRASNGR0
 };
 
-bool SvxUnoGetResourceRanges( const short nWhich, const char**& pApiResIds, const char**& pIntResIds, int& nCount ) throw()
+bool SvxUnoGetResourceRanges( const sal_uInt16 nWhich, const char**& pApiResIds, const char**& pIntResIds, int& nCount ) throw()
 {
     switch( nWhich )
     {
@@ -1785,7 +1785,7 @@ bool SvxUnoConvertResourceStringBuiltIn(const char** pSourceResIds, const char**
 /** if the given name is a predefined name for the current language it is replaced by
     the corresponding api name.
 */
-OUString SvxUnogetApiNameForItem(const sal_Int16 nWhich, const OUString& rInternalName)
+OUString SvxUnogetApiNameForItem(const sal_uInt16 nWhich, const OUString& rInternalName)
 {
     OUString aNew = rInternalName;
 
@@ -1818,7 +1818,7 @@ OUString SvxUnogetApiNameForItem(const sal_Int16 nWhich, const OUString& rIntern
 /** if the given name is a predefined api name it is replaced by the predefined name
     for the current language.
 */
-OUString SvxUnogetInternalNameForItem(const sal_Int16 nWhich, const OUString& rApiName)
+OUString SvxUnogetInternalNameForItem(const sal_uInt16 nWhich, const OUString& rApiName)
 {
     OUString aNew = rApiName;
 
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index afd8949360b1..0ecda838a695 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1400,9 +1400,9 @@ void SAL_CALL SvxShape::removeVetoableChangeListener( const OUString& , const Re
 }
 
 
-bool SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName )
+bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName )
 {
-    SfxItemSet aSet( mpModel->GetItemPool(),    {{(sal_uInt16)nWID, (sal_uInt16)nWID}} );
+    SfxItemSet aSet( mpModel->GetItemPool(),    {{nWID, nWID}} );
 
     if( SetFillAttribute( nWID, rName, aSet, mpModel ) )
     {
@@ -1418,7 +1418,7 @@ bool SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName )
 }
 
 
-bool SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel )
+bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel )
 {
     // check if an item with the given name and which id is inside the models
     // pool or the stylesheet pool, if found it's put in the itemset
@@ -1427,7 +1427,7 @@ bool SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, SfxItemS
         // we did not find such item in one of the pools, so we check
         // the property lists that are loaded for the model for items
         // that support such.
-        OUString aStrName = SvxUnogetInternalNameForItem((sal_Int16)nWID, rName);
+        OUString aStrName = SvxUnogetInternalNameForItem(nWID, rName);
 
         switch( nWID )
         {
@@ -1530,9 +1530,9 @@ bool SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, SfxItemS
 }
 
 
-bool SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, SfxItemSet& rSet )
+bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet )
 {
-    OUString aName = SvxUnogetInternalNameForItem((sal_Int16)nWID, rName);
+    OUString aName = SvxUnogetInternalNameForItem(nWID, rName);
 
     if (aName.isEmpty())
     {
@@ -1563,11 +1563,11 @@ bool SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, SfxItemS
 
     const SfxItemPool* pPool = rSet.GetPool();
 
-    const sal_uInt32 nCount = pPool->GetItemCount2((sal_uInt16)nWID);
+    const sal_uInt32 nCount = pPool->GetItemCount2(nWID);
 
     for( sal_uInt32 nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
     {
-        const NameOrIndex* pItem = static_cast<const NameOrIndex*>(pPool->GetItem2((sal_uInt16)nWID, nSurrogate));
+        const NameOrIndex* pItem = static_cast<const NameOrIndex*>(pPool->GetItem2(nWID, nSurrogate));
         if( pItem && ( pItem->GetName() == aName ) )
         {
             rSet.Put( *pItem );


More information about the Libreoffice-commits mailing list