diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-05-21 01:33:49 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-05-24 21:19:42 +0000 |
commit | 44326f8dfabd81bf8b5a5c741f29ae8c57b4a88e (patch) | |
tree | aaf761356c9ed58574982b06df7985f11b16baa8 /winaccessibility | |
parent | 9364a49a87684e54b7b04a6a110a2325bff5d96b (diff) |
remove unused struct member
TYPE_BSTR_MAP.type was never used, this makes struct obsolete.
replace magic numbers with constants
Change-Id: Ifbe236c102f78cc570401254dda2fba9bb2c2a95
Reviewed-on: https://gerrit.libreoffice.org/25228
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'winaccessibility')
-rw-r--r-- | winaccessibility/source/UAccCOM/AccRelation.cxx | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/winaccessibility/source/UAccCOM/AccRelation.cxx b/winaccessibility/source/UAccCOM/AccRelation.cxx index 7d7ab00f2f0e..6ca355b17007 100644 --- a/winaccessibility/source/UAccCOM/AccRelation.cxx +++ b/winaccessibility/source/UAccCOM/AccRelation.cxx @@ -31,6 +31,7 @@ #include <vcl/svapp.hxx> +#include <com/sun/star/accessibility/AccessibleRelationType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> #include "MAccessible.h" @@ -194,27 +195,23 @@ STDMETHODIMP CAccRelation::put_XSubInterface(hyper pXSubInterface) */ BSTR CAccRelation::getRelationTypeBSTR(int type) { - static struct TYPE_BSTR_MAP - { - LPCTSTR string; - int type; - } - map[] = + static LPCTSTR map[] = { - {_T("INVALID") , 0}, - {IA2_RELATION_FLOWS_FROM , 1}, - {IA2_RELATION_FLOWS_TO , 2}, - {IA2_RELATION_CONTROLLED_BY , 3}, - {IA2_RELATION_CONTROLLER_FOR, 4}, - {IA2_RELATION_LABEL_FOR , 5}, - {IA2_RELATION_LABELED_BY , 6}, - {IA2_RELATION_MEMBER_OF , 7}, - {IA2_RELATION_SUBWINDOW_OF , 8}, - {IA2_RELATION_NODE_CHILD_OF , 9}, - {IA2_RELATION_DESCRIBED_BY , 10}, + _T("INVALID"), // AccessibleRelationType::INVALID + IA2_RELATION_FLOWS_FROM, // AccessibleRelationType::CONTENT_FLOWS_FROM + IA2_RELATION_FLOWS_TO, // AccessibleRelationType::CONTENT_FLOWS_TO + IA2_RELATION_CONTROLLED_BY, // AccessibleRelationType::CONTROLLED_BY + IA2_RELATION_CONTROLLER_FOR, // AccessibleRelationType::CONTROLLER_FOR + IA2_RELATION_LABEL_FOR, // AccessibleRelationType::LABEL_FOR + IA2_RELATION_LABELED_BY, // AccessibleRelationType::LABELED_BY + IA2_RELATION_MEMBER_OF, // AccessibleRelationType::MEMBER_OF + IA2_RELATION_SUBWINDOW_OF, // AccessibleRelationType::SUB_WINDOW_OF + IA2_RELATION_NODE_CHILD_OF, // AccessibleRelationType::NODE_CHILD_OF + IA2_RELATION_DESCRIBED_BY // AccessibleRelationType::DESCRIBED_BY }; - return ::SysAllocString((type >= 0 && type <= 10) ? map[type].string : _T("")); + return ::SysAllocString( (type >= AccessibleRelationType::INVALID && type <= AccessibleRelationType::DESCRIBED_BY) + ? map[type] : _T("")); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |