* minimize closure allocations by replacing LINQ with foreach when needed
* use lookups when possible
* reuse filtered items, pre-compute when possible
* use lighter Monitor for isolated storage locking instead of Mutex
* fix DocX references to be real project references instead of DLL references
On my search to solve the inserting problem of tables and paragraphs I change this code.
If the document.paragraphLookup is always correct or filled no problem.
But why depend on document.paragraphLookup if it can be done direct?
So this is not a bug.
For me it is not clear why we have the dictionary paragraphLookup.
Is there a real need for the dictionary paragraphLookup, or is it just a result of historical starting ideas and should it be cleaned?
The paragraph startindex and endindex are corrupted in Document.paragraphs[].
The result was a wrong insertion of paragraphs and tables. (at wrong locations)
The function GetParagraphs had the bug. the variable index in that function should be updated after creation of the paragraph not before
The function public virtual List<int> FindAll(string str, RegexOptions options) was only resulting one item in the list. instead of a list of find idexes
If there was only find one no big problem but if it finds more the return index was wrong also .
I think it is a typo error, instead of indexes[0] it should be indexes[i].
Allowing InsertColumn method take into account merged cells for multiple
row add columns where the count of cells is less than the index but is
not less table column count
On mono, the OriginalString of a Uri sometimes is prefixed with file:// leading to issues when combining paths. We strip the prefix if necesary to avoid that.
Fix to prevent deadlocks in multi-threaded applications
See https://support.microsoft.com/en-us/kb/2996566 (Issue 1) for more
details. But in summary if the document is larger than 10Mb, then deadlocks
can occur in multi-threaded applications.