Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed ups for navigating Microsoft Excel spreadsheets, especially for those containing comments / dropdowns #9257

Merged
merged 22 commits into from
Feb 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5696dd9
Initial stub for excel_getCellTextWidth in nvdaHelper
michaelDCurran Feb 6, 2019
4c18bc4
Implement all of getCellTextWidth in-process and call it from the Exc…
michaelDCurran Feb 6, 2019
08e1049
Excel: move all states calculation in-process.
michaelDCurran Feb 7, 2019
d736d85
Excel: fetch text, address, states, input title, input message, row/c…
michaelDCurran Feb 7, 2019
6d5ea05
Excel: fix up handling of merged cells.
michaelDCurran Feb 7, 2019
52e6888
Excel: no need to call cell.currentRegion in fetchAssociatedHeaderCel…
michaelDCurran Feb 7, 2019
9023155
Excel inProc: getCellInfo now uses a struct, rather than everything a…
michaelDCurran Feb 8, 2019
4c21bfa
Excel: If NvDA cannot inject in-process, such as when in Protected V…
michaelDCurran Feb 8, 2019
5c0b23c
Excel: move the fetching of comments and formulas for Elements list i…
michaelDCurran Feb 10, 2019
7b9e001
Excel: remove an unneeded method.
michaelDCurran Feb 10, 2019
f2a6b41
Merge branch 'master' into excelInproc
michaelDCurran Feb 11, 2019
9f2cd9a
Excel nvdaHelper: move constants into their own file.
michaelDCurran Feb 11, 2019
344ccd6
nvdaHelper: make use of InterfaceMarshaller in outlook.cpp.
michaelDCurran Feb 11, 2019
a3b962c
Excel: mark ExcelCellInfoQuicknavIterator as an abstract class requir…
michaelDCurran Feb 12, 2019
561765e
Excel: address review comments.
michaelDCurran Feb 12, 2019
d43f436
Address review comments.
michaelDCurran Feb 12, 2019
cf77243
Address review comments.
michaelDCurran Feb 12, 2019
35b618a
Excel nvdaHelper support: check more errors and remove a redundant fe…
michaelDCurran Feb 12, 2019
5195b10
Excel nvdaHelper:: Excel's range.item is 1-based not 0-based. Listing…
michaelDCurran Feb 13, 2019
c539f98
Excel NVDAHelper: fetching all cells from a filtered range must use I…
michaelDCurran Feb 15, 2019
aee0850
Merge branch 'master' into excelInproc
michaelDCurran Feb 17, 2019
2e8b0fb
Update what's new.
michaelDCurran Feb 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions nvdaHelper/common/COMUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include <comdef.h>
#include <common/log.h>

namespace nvCOMUtils {

class InterfaceMarshaller {
feerrenrut marked this conversation as resolved.
Show resolved Hide resolved
private:
DWORD cookie {(DWORD)(-1)};
IGlobalInterfaceTablePtr pGIT {nullptr};

public:
InterfaceMarshaller() {};

template<typename t> HRESULT marshal(t* p) {
if(cookie!=-1) {
LOG_ERROR(L"An interface is already marshalled");
return E_FAIL;
}
HRESULT res=pGIT.CreateInstance(CLSID_StdGlobalInterfaceTable);
if(res!=S_OK) {
LOG_ERROR(L"Could not create global interface table");
return res;
}
res=pGIT->RegisterInterfaceInGlobal(p,__uuidof(t),&cookie);
if(res!=S_OK) {
LOG_ERROR(L"Could not register object in global interface table");
return res;
}
return S_OK;
}

template<typename t> t* unmarshal() {
if(cookie==-1) {
LOG_ERROR(L"Nothing has been marshalled");
return nullptr;
}
t* p=nullptr;
HRESULT res=pGIT->GetInterfaceFromGlobal(cookie,__uuidof(t),reinterpret_cast<void**>(&p));
if(res!=S_OK) {
LOG_ERROR(L"Could not unmarshal object, code "<<res);
return nullptr;
}
return p;
}

~InterfaceMarshaller() {
if(cookie!=-1) {
pGIT->RevokeInterfaceFromGlobal(cookie);
}
}

};

};
2 changes: 2 additions & 0 deletions nvdaHelper/interfaces/nvdaInProcUtils/nvdaInProcUtils.acf
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ interface NvdaInProcUtils {
[fault_status,comm_status] dumpOnCrash();
[fault_status,comm_status] IA2Text_findContentDescendant();
[fault_status,comm_status] outlook_getMAPIProp();

[fault_status,comm_status] excel_getCellInfos();
}
17 changes: 17 additions & 0 deletions nvdaHelper/interfaces/nvdaInProcUtils/nvdaInProcUtils.idl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ cpp_quote("*/")
import "wtypes.idl";
import "oaidl.idl";

typedef struct {
BSTR text;
BSTR address;
BSTR inputTitle;
BSTR inputMessage;
hyper states;
long rowNumber;
long rowSpan;
long columnNumber;
long columnSpan;
long outlineLevel;
BSTR comments;
BSTR formula;
} EXCEL_CELLINFO;

/**
* Useful utlity methods that can be executed in-process from NVDA
*/
Expand Down Expand Up @@ -68,4 +83,6 @@ interface NvdaInProcUtils {
*/
error_status_t outlook_getMAPIProp(const long threadID, [in] IUnknown* mapiObject, const unsigned long mapiPropTag, [out] VARIANT* val);

error_status_t excel_getCellInfos([in] const unsigned long windowHandle,[in] IDispatch* rangeObj, [in] long cellInfoFlags, [in] long cellCount, [out,size_is(cellCount)] EXCEL_CELLINFO* cellInfos, [out] long* numCellsFetched);

}
1 change: 1 addition & 0 deletions nvdaHelper/local/nvdaHelperLocal.def
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ EXPORTS
nvdaInProcUtils_winword_getTextInRange
nvdaInProcUtils_winword_moveByLine
nvdaInProcUtils_outlook_getMAPIProp
nvdaInProcUtils_excel_getCellInfos
VBuf_createBuffer
VBuf_destroyBuffer
VBuf_findNodeByAttributes
Expand Down
Loading