include/svl/itemset.hxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 67169626f18c0d0d83834cb7fe50f203f8c6b5ea
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon Jun 9 06:53:27 2025 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Mon Jun 9 10:04:53 2025 +0200

    Simplify a bit, reusing existing more generic methods
    
    Change-Id: I052ae1fbcce3f2795faabd15d23b7f50dfa6e6f7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186273
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx
index 8b158e410318..7aaf0913c913 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -193,8 +193,7 @@ public:
 
     template <class T> SfxItemState GetItemState(TypedWhichId<T> nWhich, bool 
bSrchInParent = true, const T **ppItem = nullptr ) const
     {
-        // use local helper, start value for looped-through SfxItemState value 
is SfxItemState::UNKNOWN
-        return GetItemState_ForWhichID(SfxItemState::UNKNOWN, 
sal_uInt16(nWhich), bSrchInParent, reinterpret_cast<SfxPoolItem 
const**>(ppItem));
+        return GetItemState(sal_uInt16(nWhich), bSrchInParent, 
reinterpret_cast<SfxPoolItem const**>(ppItem));
     }
 
     /// Templatized version of GetItemState() to directly return the correct 
type.
@@ -202,9 +201,9 @@ public:
     const T *                   GetItemIfSet(   TypedWhichId<T> nWhich,
                                                 bool bSrchInParent = true ) 
const
     {
-        const SfxPoolItem * pItem = nullptr;
-        if (SfxItemState::SET == 
GetItemState_ForWhichID(SfxItemState::UNKNOWN, sal_uInt16(nWhich), 
bSrchInParent, &pItem))
-            return static_cast<const T*>(pItem);
+        const T * pItem = nullptr;
+        if (SfxItemState::SET == GetItemState(nWhich, bSrchInParent, &pItem))
+            return pItem;
         return nullptr;
     }
 

Reply via email to