Kaydet (Commit) 495bb32c authored tarafından Noel Grandin's avatar Noel Grandin

long->sal_uInt16 in SvxShape

Change-Id: I28a54497b1a4c236d9d3bdb0f44d3e46f3e55de7
Reviewed-on: https://gerrit.libreoffice.org/46810Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 16a3594e
......@@ -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>,
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment