%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/orca/scripts/apps/soffice/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/orca/scripts/apps/soffice/__pycache__/spellcheck.cpython-312.pyc

�

g
f����dZdZdZdZdZdZddlmZddlmZdd	lm	Z	dd
l
mZddlm
Z
ddlmZGd
�de	j �Zy)z1Customized support for spellcheck in LibreOffice.z$Id$z
$Revision$z$Date$zCopyright (c) 2015 Igalia, S.L.�LGPL�)�debug)�messages)�
spellcheck)�AXObject)�AXText)�AXUtilitiesc�H��eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
�xZS)	�
SpellCheckc�6��t�|�|d��i|_y)NF)�hasChangeToEntry)�super�__init__�_windows)�self�script�	__class__s  ��F/usr/lib/python3/dist-packages/orca/scripts/apps/soffice/spellcheck.pyrzSpellCheck.__init__'s���
����%��8���
�c��|�ytj|�r|S|jtj|d��S)Nr)r	�	is_dialog�_findChildDialogr�	get_child)r�roots  rrzSpellCheck._findChildDialog+s;���<��� � ��&��K��$�$�X�%7�%7��a�%@�A�Arc��tj|�r+d|dg}tjtj|d�y|j
j
t|��}|�-d|d|g}tjtj|d�|S|j|�}|sCd|j
t|�<d|dg}tjtj|d�ytj|tj��[d|j
t|�<d|j
t|�<d|dg}tjtj|d�ytj|tj�du}d|d|g}tjtj|d�||j
t|�<|S)	NzSOFFICE:z+is not spellcheck window because it's dead.TFzis spellcheck window:z:is not spellcheck window because the dialog was not found.z;is not spellcheck dialog because a page tab list was found.z2is spellcheck dialog based on combobox descendant:)
r�is_deadr�printTokens�
LEVEL_INFOr�get�hashr�find_descendantr	�is_page_tab_list�is_combo_box)r�window�tokens�rv�dialogs     r�_isCandidateWindowzSpellCheck._isCandidateWindow4s������F�#� �&�*W�X�F����e�.�.���=��
�]�]�
�
�t�F�|�
,��
�>� �&�*A�2�F�F����e�.�.���=��I��&�&�v�.���*/�D�M�M�$�v�,�'� �&�R�T�F����e�.�.���=���#�#�F�K�,H�,H�I�U�*/�D�M�M�$�v�,�'�*/�D�M�M�$�v�,�'� �&�S�U�F����e�.�.���=��
�
%�
%�f�k�.F�.F�
G�t�
S���f�&Z�\^�_��
���%�*�*�F�D�9�&(��
�
�d�6�l�#��	rc��d�}tj||�}d|d|g}tjtj|d�|S)Nc��tj|�sytj|�xrtj|�S�NF)r�supports_editable_textr	�is_focusable�
is_multi_line��xs r�isErrorz,SpellCheck._findErrorWidget.<locals>.isErrorWs4���2�2�1�5���+�+�A�.�O�;�3L�3L�Q�3O�OrzSOFFICE: Error widget for:�is:T�rr!rrr)rrr1r&r%s     r�_findErrorWidgetzSpellCheck._findErrorWidgetVsG��	P�
�
%�
%�d�G�
4��.��e�R�@��
���%�*�*�F�D�9��	rc��d�}tj||�}d|d|g}tjtj|d�|S)Nc��tj|�sytj|�xs,tj|�xstj
|�Sr+)r�supports_selectionr	�is_list�is_list_box�
is_tree_tabler/s r�isSelectableListz9SpellCheck._findSuggestionsList.<locals>.isSelectableListbsL���.�.�q�1���&�&�q�)�0��*�*�1�-�0��,�,�Q�/�
0rzSOFFICE: Suggestions list for:r2Tr3)rrr;r&r%s     r�_findSuggestionsListzSpellCheck._findSuggestionsListasG��	0��
%�
%�d�,<�
=��2�D�%��D��
���%�*�*�F�D�9��	rc�`�|jjj|�\}}|dz|fS)N�)�_script�	utilities�getPositionAndSetSize)r�
suggestion�index�totals    r�_getSuggestionIndexAndPositionz)SpellCheck._getSuggestionIndexAndPositionns/���|�|�-�-�C�C�J�O���u��q�y�%��rc�|�tj|j�}d\}}d|cxkr|kr�n|Stj|j|�\}}}|j	dd�jdd�dk(r!tj|j||�St||dz�}d|cxkr|kr��|S|S)N)r�rzfg-colorrG� z255,0,0r>)r�get_character_count�_errorWidget�get_text_attributes_at_offsetr�replace�
get_substring�max)r�length�offset�string�attrs�start�ends       r�getMisspelledWordzSpellCheck.getMisspelledWordrs����+�+�D�,=�,=�>�������6�"�F�"��
�!'� D� D�T�EV�EV�X^� _��E�5�#��y�y��R�(�0�0��b�9�Y�F��+�+�D�,=�,=�u�c�J�J���f�q�j�)�F�	�6�"�F�"��
�
#��
rc��|j�sytj|j�}|sytj
|z}|jjj|��}|jj||��y)NF)rQ)�voiceT)
�isActiver�get_all_textrJr�MISSPELLED_WORD_CONTEXTr?�speechGeneratorrW�speakMessage)rrQ�msgrWs    r�presentContextzSpellCheck.presentContext}sq���}�}����$�$�T�%6�%6�7�����.�.��7�����,�,�2�2�#�2�>�����!�!�#�U�!�3�r)�__name__�
__module__�__qualname__rrr(r4r<rErUr^�
__classcell__)rs@rrr%s-����B� �D	�� �	�rrN)�__doc__�__id__�__version__�__date__�
__copyright__�__license__�orcarrr�orca.ax_objectr�orca.ax_textr�orca.ax_utilitiesr	r�rr�<module>rnsI��,8�	������1�
������#��)�c��&�&�cr

Zerion Mini Shell 1.0