Skip to content

Commit

Permalink
Strikethrough and double-strikethrough are now reported if appropriat…
Browse files Browse the repository at this point in the history
…e in Microsoft Word.

* Speech: add support for double strikethrough (strikethrough=double). Any other True value would be just strikethrough.
* NVDAHelper winword support: add support for strikethrough and double strikethrough.

Fixes #5800.
  • Loading branch information
michaelDCurran authored and jcsteh committed Jun 24, 2016
1 parent 6658ca9 commit 5f7c38c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
7 changes: 7 additions & 0 deletions nvdaHelper/remote/winword.cpp
Expand Up @@ -84,6 +84,8 @@ using namespace std;
#define wdDISPID_FONT_BOLD 130
#define wdDISPID_FONT_ITALIC 131
#define wdDISPID_FONT_UNDERLINE 140
#define wdDISPID_FONT_STRIKETHROUGH 135
#define wdDISPID_FONT_DOUBLESTRIKETHROUGH 136
#define wdDISPID_FONT_NAME 142
#define wdDISPID_FONT_SIZE 141
#define wdDISPID_FONT_SUBSCRIPT 138
Expand Down Expand Up @@ -700,6 +702,11 @@ void generateXMLAttribsForFormatting(IDispatch* pDispatchRange, int startOffset,
} else if(_com_dispatch_raw_propget(pDispatchFont,wdDISPID_FONT_SUBSCRIPT,VT_I4,&iVal)==S_OK&&iVal) {
formatAttribsStream<<L"text-position=\"sub\" ";
}
if(_com_dispatch_raw_propget(pDispatchFont,wdDISPID_FONT_STRIKETHROUGH,VT_I4,&iVal)==S_OK&&iVal) {
formatAttribsStream<<L"strikethrough=\"1\" ";
} else if(_com_dispatch_raw_propget(pDispatchFont,wdDISPID_FONT_DOUBLESTRIKETHROUGH,VT_I4,&iVal)==S_OK&&iVal) {
formatAttribsStream<<L"strikethrough=\"double\" ";
}
}
}
}
Expand Down
13 changes: 9 additions & 4 deletions source/speech.py
Expand Up @@ -1275,12 +1275,17 @@ def getFormatFieldSpeech(attrs,attrsCache=None,formatConfig=None,unit=None,extra
strikethrough=attrs.get("strikethrough")
oldStrikethrough=attrsCache.get("strikethrough") if attrsCache is not None else None
if (strikethrough or oldStrikethrough is not None) and strikethrough!=oldStrikethrough:
# Translators: Reported when text is formatted with strikethrough.
# See http://en.wikipedia.org/wiki/Strikethrough
text=(_("strikethrough") if strikethrough
if strikethrough:
# Translators: Reported when text is formatted with double strikethrough.
# See http://en.wikipedia.org/wiki/Strikethrough
text=(_("double strikethrough") if strikethrough=="double"
# Translators: Reported when text is formatted with strikethrough.
# See http://en.wikipedia.org/wiki/Strikethrough
else _("strikethrough"))
else:
# Translators: Reported when text is formatted without strikethrough.
# See http://en.wikipedia.org/wiki/Strikethrough
else _("no strikethrough"))
text=_("no strikethrough")
textList.append(text)
underline=attrs.get("underline")
oldUnderline=attrsCache.get("underline") if attrsCache is not None else None
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Expand Up @@ -7,6 +7,7 @@

== New Features ==
- Browse mode can now be used to read PDF documents in Microsoft Edge. (#5740)
- Strikethrough and double-strikethrough are now reported if appropriate in Microsoft Word. (#5800)


== Bug Fixes ==
Expand Down

0 comments on commit 5f7c38c

Please sign in to comment.