Skip to content

Commit 1ff40c9

Browse files
authored
Merge 1aba63e into b9c4534
2 parents b9c4534 + 1aba63e commit 1ff40c9

File tree

7 files changed

+30
-16
lines changed

7 files changed

+30
-16
lines changed

nvdaHelper/archBuild_sconscript

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ env.Append(
9292
('_WIN32_WINNT','_WIN32_WINNT_WIN7')
9393
]
9494
)
95-
env.Append(CCFLAGS=['/W3','/WX'])
95+
env.Append(CCFLAGS=[
96+
'/W3',
97+
'/WX',
98+
'/std:c++17'
99+
])
96100
if 'analyze' in debug:
97101
env.Append(CCFLAGS=['/analyze'])
98102
# Disable: Inconsistent annotation for 'x': this instance has no annotations.

nvdaHelper/localWin10/oneCoreSpeech.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void __stdcall ocSpeech_speak(OcSpeech* instance, char16 *text) {
8888
}).then([instance, markersStr] (IBuffer^ buffer) {
8989
// Data has been read from the speech stream.
9090
// Pass it to the callback.
91-
byte* bytes = getBytes(buffer);
91+
BYTE* bytes = getBytes(buffer);
9292
instance->callback(bytes, buffer->Length, markersStr->c_str());
9393
}).then([instance] (task<void> previous) {
9494
// Catch any unhandled exceptions that occurred during these tasks.

nvdaHelper/remote/COMProxyRegistration.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ This license can be found at:
1616
#include <cwchar>
1717
#include <string>
1818
#include <locale>
19-
#include <codecvt>
2019
#include <vector>
2120
#define WIN32_LEAN_AND_MEAN
2221
#define CINTERFACE
@@ -140,8 +139,11 @@ COMProxyRegistration_t* registerCOMProxy(wchar_t* dllPath) {
140139
for(unsigned short idx=0;idx<fileInfo.TableSize;++idx) {
141140
IID iid=*(fileInfo.pStubVtblList[idx]->header.piid);
142141
CLSID clsidBackup={0};
143-
wstring_convert<codecvt_utf8_utf16<wchar_t>> converter;
144-
wstring name=converter.from_bytes(fileInfo.pNamesArray[idx]);
142+
int nameLength=MultiByteToWideChar(CP_UTF8,0, fileInfo.pNamesArray[idx],-1,NULL,0);
143+
wchar_t* wcharName=(wchar_t*)calloc(nameLength+1,sizeof(wchar_t));
144+
MultiByteToWideChar(CP_UTF8,0, fileInfo.pNamesArray[idx],-1,wcharName,nameLength);
145+
wstring name(wcharName,nameLength);
146+
free(wcharName);
145147
// Fetch the old CLSID for this interface if one is set, so we can replace it on deregistration.
146148
// If not set, then we'll use the standard marshaler clsid on deregistration.
147149
res=CoGetPSClsid(iid,&clsidBackup);

nvdaHelper/remote/WinWord/Fields.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ bool Fields::hasLinks(){
123123
}
124124

125125

126-
std::experimental::optional<int> Fields::getEndOfPageNumberFieldAtIndex(const int index){
126+
std::optional<int> Fields::getEndOfPageNumberFieldAtIndex(const int index){
127127
for( auto&& pageNum : m_pageNumbers ){
128128
if(inRange(index, pageNum.first, pageNum.second)){
129129
return pageNum.second;
130130
}
131131
}
132-
return std::experimental::optional<int>();
132+
return std::optional<int>();
133133
}
134134

135135
} // end namespace WinWord

nvdaHelper/remote/WinWord/Fields.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This license can be found at:
1616

1717
#define WIN32_LEAN_AND_MEAN
1818
#include <vector>
19-
#include <boost/optional.hpp>
19+
#include <optional>
2020

2121
struct IDispatch;
2222
namespace WinWord {
@@ -49,7 +49,7 @@ namespace WinWord {
4949
* @param index Find a range that this index is part of.
5050
* @returns an optional value, if a range exists the end index is returned of visible text range.
5151
*/
52-
std::experimental::optional<int> getEndOfPageNumberFieldAtIndex(const int index);
52+
std::optional<int> getEndOfPageNumberFieldAtIndex(const int index);
5353

5454
Fields(const Fields&) = delete; // Copy constructor disabled, no implementation.
5555
Fields& operator=(const Fields&) = delete; // Assignment disabled, no implementation.

nvdaHelper/remote/winword.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This license can be found at:
2121
#include <oleacc.h>
2222
#include <common/xml.h>
2323
#include <common/log.h>
24-
#include <boost/optional.hpp>
24+
#include <optional>
2525
#include "nvdaHelperRemote.h"
2626
#include "nvdaInProcUtils.h"
2727
#include "nvdaInProcUtils.h"
@@ -751,7 +751,7 @@ inline bool generateFootnoteEndnoteXML(IDispatch* pDispatchRange, wostringstream
751751
return true;
752752
}
753753

754-
std::experimental::optional<int> getSectionBreakType(IDispatchPtr pDispatchRange ) {
754+
std::optional<int> getSectionBreakType(IDispatchPtr pDispatchRange ) {
755755
// The following case should handle where we have the page break character ('0x0c') shown with '|p|'
756756
// first section|p|
757757
// second section.
@@ -817,7 +817,7 @@ std::experimental::optional<int> getSectionBreakType(IDispatchPtr pDispatchRange
817817
return type;
818818
}
819819

820-
std::experimental::optional<float>
820+
std::optional<float>
821821
getStartOfRangeDistanceFromEdgeOfDocument(IDispatchPtr pDispatchRange) {
822822
float rangePos = -1.0f;
823823
auto res = _com_dispatch_raw_method( pDispatchRange, wdDISPID_RANGE_INFORMATION,
@@ -831,7 +831,7 @@ getStartOfRangeDistanceFromEdgeOfDocument(IDispatchPtr pDispatchRange) {
831831
return rangePos;
832832
}
833833

834-
std::experimental::optional< std::pair<float, float> >
834+
std::optional< std::pair<float, float> >
835835
calculatePreAndPostColumnOffsets(IDispatchPtr pDispatchPageSetup) {
836836
float leftMargin = -1.0f;
837837
auto res = _com_dispatch_raw_propget( pDispatchPageSetup, wdDISPID_PAGESETUP_LEFTMARGIN,
@@ -1182,8 +1182,8 @@ void winword_getTextInRange_helper(HWND hwnd, winword_getTextInRange_args* args)
11821182
if(text) {
11831183
int noteCharOffset=-1;
11841184
bool isNoteChar=false;
1185-
std::experimental::optional<int> pageBreakCharIndex;
1186-
std::experimental::optional<int> columnBreakCharIndex;
1185+
std::optional<int> pageBreakCharIndex;
1186+
std::optional<int> columnBreakCharIndex;
11871187
if(!isFormField) {
11881188
//Force a new chunk before and after control+b (note characters)
11891189
for(int i=0;text[i]!=L'\0';++i) {

nvdaHelper/vbufBackends/gecko_ia2/gecko_ia2.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This license can be found at:
1616
#include <functional>
1717
#include <vector>
1818
#include <map>
19-
#include <boost/optional.hpp>
19+
#include <optional>
2020
#include <windows.h>
2121
#include <set>
2222
#include <string>
@@ -657,6 +657,13 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(
657657
// Whether the name of this node has been explicitly set (as opposed to calculated by descendant)
658658
const bool nameIsExplicit = IA2AttribsMapIt != IA2AttribsMap.end() && IA2AttribsMapIt->second == L"true";
659659
// Whether the name is the content of this node.
660+
<<<<<<< HEAD
661+
std::optional<bool> isLabelVisibleVal_;
662+
// A version of the isLabelVisible function that caches its result
663+
auto isLabelVisibleCached=[&]() {
664+
if(!isLabelVisibleVal_) {
665+
isLabelVisibleVal_=isLabelVisible(pacc);
666+
=======
660667
std::experimental::optional<LabelInfo> labelInfo_;
661668
// A version of the getIdForVisibleLabel function that caches its result
662669
auto isLabelVisibleCached = [&]() {
@@ -666,6 +673,7 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(
666673
bool isVisible = false;
667674
if (labelInfo_) {
668675
isVisible = labelInfo_->isVisible;
676+
>>>>>>> origin/master
669677
}
670678
return isVisible;
671679
};

0 commit comments

Comments
 (0)