Skip to content

Commit d351ca9

Browse files
Merge branch 'release/9.3' into copilot/fix-bb2a324b-436b-47cf-a3fb-4345d8670863
2 parents 9b9fa64 + 699d1ad commit d351ca9

41 files changed

Lines changed: 678 additions & 581 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Src/Common/Controls/XMLViews/FlatListView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private void StoreData(IEnumerable<ICmObject> objs)
103103
{
104104
var rghvo = (from obj in objs
105105
select obj.Hvo).ToArray();
106-
m_listPublisher.CacheVecProp(m_cache.LanguageProject.Hvo, rghvo);
106+
m_listPublisher.CacheVecProp(m_cache.LanguageProject.Hvo, rghvo, true);
107107
}
108108
#endregion
109109

Src/Common/Controls/XMLViews/LayoutFinder.cs

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -150,29 +150,10 @@ internal set
150150
}
151151
}
152152

153-
// /// ------------------------------------------------------------------------------------
154-
// /// <summary>
155-
// /// Given a spec that might be some sort of element, or might be something wrapping a flow object
156-
// /// around that element, return the element. Or, it might be a "frag" element wrapping all of that.
157-
// /// </summary>
158-
// /// <param name="viewSpec">The view spec.</param>
159-
// /// <returns></returns>
160-
// /// ------------------------------------------------------------------------------------
161-
// XmlNode ExtractFromFlow(XmlNode viewSpec)
162-
// {
163-
// if (viewSpec == null)
164-
// return null;
165-
// if (viewSpec.Name == "frag")
166-
// viewSpec = viewSpec.FirstChild;
167-
// if (viewSpec.Name == "para" || viewSpec.Name == "div")
168-
// {
169-
// if (viewSpec.ChildNodes.Count == 2 && viewSpec.FirstChild.Name == "properties")
170-
// return viewSpec.ChildNodes[1];
171-
// else if (viewSpec.ChildNodes.Count == 1)
172-
// return viewSpec.FirstChild;
173-
// }
174-
// return viewSpec; // None of the special flow object cases, use the node itself.
175-
// }
153+
/// <summary>
154+
/// Stores the reversal ws that should be used for filtering.
155+
/// </summary>
156+
public int ReversalWs { set; get; }
176157

177158
#region StringFinder Members
178159

@@ -278,6 +259,7 @@ public ITsString Key(IManyOnePathSortItem item, bool fForSorting)
278259
m_vc = new XmlBrowseViewBaseVc(m_cache);
279260
m_vc.SuppressPictures = true; // we won't dispose of it, so it mustn't make pictures (which we don't need)
280261
m_vc.DataAccess = m_sda;
262+
m_vc.ReversalWs = ReversalWs;
281263
}
282264
else
283265
{

Src/Common/Controls/XMLViews/MatchingObjectsBrowser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ private void UpdateResults(SearchField firstField, IEnumerable<int> results)
399399
int count = hvos.Length;
400400
int prevIndex = m_bvMatches.SelectedIndex;
401401
int prevHvo = prevIndex == -1 ? 0 : m_bvMatches.AllItems[prevIndex];
402-
m_listPublisher.CacheVecProp(m_cache.LanguageProject.LexDbOA.Hvo, hvos);
402+
m_listPublisher.CacheVecProp(m_cache.LanguageProject.LexDbOA.Hvo, hvos, true);
403403
TabStop = count > 0;
404404
// Disable the list so that it doesn't steal the focus (LT-9481)
405405
m_bvMatches.Enabled = false;

Src/Common/Controls/XMLViews/ObjectListPublisher.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015 SIL International
1+
// Copyright (c) 2015 SIL International
22
// This software is licensed under the LGPL, version 2.1 or later
33
// (http://www.gnu.org/licenses/lgpl-2.1.html)
44

@@ -76,7 +76,8 @@ public void SetOwningPropInfo(int destClass, string className, string fieldName)
7676
/// </summary>
7777
/// <param name="hvoObj">The hvo.</param>
7878
/// <param name="hvos">The hvos.</param>
79-
public void CacheVecProp(int hvoObj, int[] hvos)
79+
/// <param name="updateAndNotify">If true: Gui and properties should be updated, and notifications sent.</param>
80+
public void CacheVecProp(int hvoObj, int[] hvos, bool updateAndNotify)
8081
{
8182
if (hvos == null)
8283
throw new ArgumentNullException("Should not pass null to CacheVecProp");
@@ -86,7 +87,10 @@ public void CacheVecProp(int hvoObj, int[] hvos)
8687
cvDel = old.Length;
8788

8889
m_values[hvoObj] = hvos;
89-
SendPropChanged(hvoObj, 0, hvos.Length, cvDel);
90+
if (updateAndNotify)
91+
{
92+
SendPropChanged(hvoObj, 0, hvos.Length, cvDel);
93+
}
9094
}
9195

9296
/// <summary>

Src/Common/Controls/XMLViews/XMLViewsTests/TestObjectListPublisher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015 SIL International
1+
// Copyright (c) 2015 SIL International
22
// This software is licensed under the LGPL, version 2.1 or later
33
// (http://www.gnu.org/licenses/lgpl-2.1.html)
44

@@ -37,7 +37,7 @@ public void SetAndAccessDummyList()
3737
var values = new int[] {23, 56, 2048};
3838
Notifiee recorder = new Notifiee();
3939
publisher.AddNotification(recorder);
40-
publisher.CacheVecProp(hvoRoot, values);
40+
publisher.CacheVecProp(hvoRoot, values, true);
4141
Assert.AreEqual(values.Length, publisher.get_VecSize(hvoRoot, ObjectListFlid), "override of vec size");
4242
//Assert.AreEqual(Cache.LangProject.Texts.Count, publisher.get_VecSize(Cache.LangProject.Hvo, LangProjectTags.kflidTexts), "base vec size");
4343

Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,13 +1024,6 @@ internal override int WsForce
10241024
set { m_wsForce = value; }
10251025
}
10261026

1027-
/// <summary>
1028-
/// If we are uploading multiple reversals to Webonary then the writing system can be different for
1029-
/// each reversal. OverrideWs is a hack to allow cell data to be generated using the writing system
1030-
/// for the current reversal (instead of using the writing system for the displayed column). LT-21198
1031-
/// </summary>
1032-
public int OverrideWs { get; set; }
1033-
10341027
private void AddTableCell(IVwEnv vwenv, int hvo, int index, int hvoRoot, int icolActive, int cAdjCol, int icol)
10351028
{
10361029
XmlNode node = m_columns[icol - 1];
@@ -1414,18 +1407,7 @@ public void DisplayCell(IManyOnePathSortItem item, XmlNode node, int hvo, IVwEnv
14141407
{
14151408
if (node.Name == "column")
14161409
{
1417-
// Unfortunately this method is called to generate non-displayed data (data that is
1418-
// uploaded to Webonary). If we are uploading multiple reversals then the writing system
1419-
// can be different for each reversal. OverrideWs is the reversal writing system (instead
1420-
// of using the writing system for the displayed column). LT-21198
1421-
if (OverrideWs != 0)
1422-
{
1423-
WsForce = OverrideWs;
1424-
}
1425-
else
1426-
{
1427-
SetForcedWs(node);
1428-
}
1410+
SetForcedWs(node);
14291411
}
14301412
OpenOuterParts(outerParts, vwenv, hvo);
14311413
if (hvoToDisplay == hvo)

Src/Common/Controls/XMLViews/XmlSeqView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ public static ISilDataAccessManaged CachePrintDecorator(ISilDataAccessManaged ol
539539
int rootHvo, int mainFlid, int[] selectedObjects)
540540
{
541541
var printDecorator = new ObjectListPublisher(oldSda, mainFlid);
542-
printDecorator.CacheVecProp(rootHvo, selectedObjects);
542+
printDecorator.CacheVecProp(rootHvo, selectedObjects, true);
543543
return printDecorator;
544544
}
545545

Src/FdoUi/Dialogs/SummaryDialogForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private XmlView CreateSummaryView(List<int> rghvoEntries, LcmCache cache, IVwSty
272272
int kflidEntriesFound = 8999950; // some arbitrary number not conflicting with real flids.
273273
var sda = new ObjectListPublisher(cache.DomainDataByFlid as ISilDataAccessManaged, kflidEntriesFound);
274274
int hvoRoot = RootHvo;
275-
sda.CacheVecProp(hvoRoot, rghvoEntries.ToArray());
275+
sda.CacheVecProp(hvoRoot, rghvoEntries.ToArray(), true);
276276
//TODO: Make this method return a GeckoBrowser control, and generate the content here.
277277
// The name of this property must match the property used by the publishFound layout.
278278
sda.SetOwningPropInfo(LexDbTags.kflidClass, "LexDb", "EntriesFound");

Src/LexText/Interlinear/ConcordanceControlBase.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015-2017 SIL International
1+
// Copyright (c) 2015-2017 SIL International
22
// This software is licensed under the LGPL, version 2.1 or later
33
// (http://www.gnu.org/licenses/lgpl-2.1.html)
44

@@ -52,7 +52,8 @@ public virtual void Init(Mediator mediator, PropertyTable propertyTable, XmlNode
5252
m_configurationParameters = configurationParameters;
5353
m_cache = m_propertyTable.GetValue<LcmCache>("cache");
5454
string name = RecordClerk.GetCorrespondingPropertyName(XmlUtils.GetAttributeValue(configurationParameters, "clerk"));
55-
m_clerk = m_propertyTable.GetValue<OccurrencesOfSelectedUnit>(name) ?? (OccurrencesOfSelectedUnit)RecordClerkFactory.CreateClerk(m_mediator, m_propertyTable, m_configurationParameters, true);
55+
m_clerk = m_propertyTable.GetValue<OccurrencesOfSelectedUnit>(name) ?? (OccurrencesOfSelectedUnit)RecordClerkFactory.CreateClerk(
56+
m_mediator, m_propertyTable, m_configurationParameters, true, true);
5657
m_clerk.ConcordanceControl = this;
5758
}
5859

@@ -126,7 +127,7 @@ internal protected void LoadMatches(bool fLoadVirtualProperty)
126127
IsLoadingMatches = true;
127128
try
128129
{
129-
m_clerk.OwningObject = m_cache.LangProject;
130+
m_clerk.SetOwningObject(m_cache.LangProject, true);
130131
decorator.SetOccurrences(m_cache.LangProject.Hvo, occurrences);
131132
m_clerk.UpdateList(true);
132133
}

Src/LexText/Interlinear/StatisticsView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void Init(Mediator mediator, PropertyTable propertyTable, XmlNode configu
7474
string name = XmlUtils.GetAttributeValue(configurationParameters, "clerk");
7575
var clerk = RecordClerk.FindClerk(_propertyTable, name);
7676
m_clerk = (clerk == null || clerk is TemporaryRecordClerk) ?
77-
(InterlinearTextsRecordClerk)RecordClerkFactory.CreateClerk(mediator, _propertyTable, configurationParameters, true) :
77+
(InterlinearTextsRecordClerk)RecordClerkFactory.CreateClerk(mediator, _propertyTable, configurationParameters, true, true) :
7878
(InterlinearTextsRecordClerk)clerk;
7979
// There's no record bar for it to control, but it should control the staus bar (e.g., it should update if we change
8080
// the set of selected texts).

0 commit comments

Comments
 (0)