diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-11-02 16:04:29 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-03 06:34:22 +0000 |
commit | fa80dae9a79a7414af8adcb91bc04dfff13bbb63 (patch) | |
tree | aa7bd54cf7f64065aa954e24406687ea9757bc13 | |
parent | 1bbf7f653b6b159afb0bf2c34dd463f58333852c (diff) |
remove unnecessary casts
Which IDs are always sal_uInt16 and likely passed from defines
Change-Id: I134358289ccd338ef1ff6ba963e25a524e790f4e
Reviewed-on: https://gerrit.libreoffice.org/30498
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/svl/itemset.hxx | 2 | ||||
-rw-r--r-- | svl/source/items/itemset.cxx | 16 |
2 files changed, 7 insertions, 11 deletions
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx index f327f92792eb..5793007eb350 100644 --- a/include/svl/itemset.hxx +++ b/include/svl/itemset.hxx @@ -66,7 +66,7 @@ public: SfxItemSet( SfxItemPool&); SfxItemSet( SfxItemPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2 ); - SfxItemSet( SfxItemPool&, int nWh1, int nWh2, int nNull, ... ); + SfxItemSet( SfxItemPool&, sal_uInt16 nWh1, sal_uInt16 nWh2, sal_uInt16 nNull, ... ); SfxItemSet( SfxItemPool&, const sal_uInt16* nWhichPairTable ); virtual ~SfxItemSet(); diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index d2388c3d40d9..e47f3bef0a5f 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -173,7 +173,7 @@ void SfxItemSet::InitRanges_Impl(va_list pArgs, sal_uInt16 nWh1, sal_uInt16 nWh2 memset(static_cast<void*>(m_pItems), 0, sizeof(SfxPoolItem*) * nSize); } -SfxItemSet::SfxItemSet(SfxItemPool& rPool, int nWh1, int nWh2, int nNull, ...) +SfxItemSet::SfxItemSet(SfxItemPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2, sal_uInt16 nNull, ...) : m_pPool( &rPool ) , m_pParent(nullptr) , m_pWhichRanges(nullptr) @@ -181,17 +181,13 @@ SfxItemSet::SfxItemSet(SfxItemPool& rPool, int nWh1, int nWh2, int nNull, ...) { assert(nWh1 <= nWh2); - if(!nNull) - InitRanges_Impl( - sal::static_int_cast< sal_uInt16 >(nWh1), - sal::static_int_cast< sal_uInt16 >(nWh2)); - else { + if (nNull == 0) // delimiter + InitRanges_Impl(nWh1, nWh2); + else + { va_list pArgs; va_start( pArgs, nNull ); - InitRanges_Impl( - pArgs, sal::static_int_cast< sal_uInt16 >(nWh1), - sal::static_int_cast< sal_uInt16 >(nWh2), - sal::static_int_cast< sal_uInt16 >(nNull)); + InitRanges_Impl(pArgs, nWh1, nWh2, nNull); va_end(pArgs); } } |