Skip to content
Permalink
Browse files

Report hidden formatting in MS Word (#10313)

* Report hidden formatting in MS Word

* Update source/speech/__init__.py

Co-Authored-By: Leonard de Ruijter <leonardder@users.noreply.github.com>

* Fix linting issues.
  • Loading branch information...
CyrilleB79 authored and michaelDCurran committed Oct 7, 2019
1 parent 287f4ea commit a157fbd70363acf16ac3bba8b4ad42aabbd820c0
Showing with 14 additions and 0 deletions.
  1. +1 −0 nvdaHelper/remote/WinWord/Constants.h
  2. +3 −0 nvdaHelper/remote/winword.cpp
  3. +10 −0 source/speech/__init__.py
@@ -44,6 +44,7 @@ constexpr int wdDISPID_FIELDS_ITEM_TYPE = 1;
constexpr int wdDISPID_FONT_BOLD = 130;
constexpr int wdDISPID_FONT_COLOR = 159;
constexpr int wdDISPID_FONT_DOUBLESTRIKETHROUGH = 136;
constexpr int wdDISPID_FONT_HIDDEN = 132;
constexpr int wdDISPID_FONT_ITALIC = 131;
constexpr int wdDISPID_FONT_NAME = 142;
constexpr int wdDISPID_FONT_SIZE = 141;
@@ -645,6 +645,9 @@ void generateXMLAttribsForFormatting(IDispatch* pDispatchRange, int startOffset,
} else if(_com_dispatch_raw_propget(pDispatchFont,wdDISPID_FONT_DOUBLESTRIKETHROUGH,VT_I4,&iVal)==S_OK&&iVal) {
formatAttribsStream<<L"strikethrough=\"double\" ";
}
if(_com_dispatch_raw_propget(pDispatchFont,wdDISPID_FONT_HIDDEN,VT_I4,&iVal)==S_OK&&iVal) {
formatAttribsStream<<L"hidden=\"1\" ";
}
}
}
}
@@ -1571,6 +1571,16 @@ def getFormatFieldSpeech(attrs,attrsCache=None,formatConfig=None,reason=None,uni
# Translators: Reported when text is not underlined.
else _("not underlined"))
textList.append(text)
hidden = attrs.get("hidden")
oldHidden = attrsCache.get("hidden") if attrsCache is not None else None
if (hidden or oldHidden is not None) and hidden != oldHidden:
text = (
# Translators: Reported when text is hidden.
_("hidden")if hidden
# Translators: Reported when text is not hidden.
else _("not hidden")
)
textList.append(text)
textPosition=attrs.get("text-position")
oldTextPosition=attrsCache.get("text-position") if attrsCache is not None else None
if (textPosition or oldTextPosition is not None) and textPosition!=oldTextPosition:

0 comments on commit a157fbd

Please sign in to comment.
You can’t perform that action at this time.