public static XAccessible GetAccessibleCounterpartFromHash(XShape needle, XAccessibleContext haystack) { XAccessible counterpart = null; if (haystack != null && needle != null) { string hash = "###" + needle.GetHashCode().ToString() + "###"; try { string desc = OoUtils.GetStringProperty(needle, "Description"); bool success = OoUtils.SetStringProperty(needle, "Description", hash + desc); if (success) { // find the accessible counterpart with the description // starting with the corresponding hash pattern counterpart = GetAccessibleChildDescriptionStartsWith(hash, haystack); if (counterpart == null) { Logger.Instance.Log(LogPriority.DEBUG, "OoAccessibility", "[ERORR] could not find ax XAccessible width the given Description"); } } else { // FIXME: what todo if no description could been set } // if found reset the Description success = OoUtils.SetStringProperty(needle, "Description", desc); if (!success) { Logger.Instance.Log(LogPriority.DEBUG, "OoAccessibility", "[ERROR] Could not revert Description change for XShape while searching for their counterpart"); } } catch { } } return counterpart; }