Skip to content

Commit 69a4ee6

Browse files
committed
Made LfStringField and LfStringArrayField GUID-less again.
I realized the actual problem was that the LfSense model was incorrectly representing the option list items as String*Fields. Now LfSense uses LfOptionListItem's and List<LfOptionListItem> to better represent LF. Note that Status went from LfStringArrayField -> LfOptionListItem, instead of a list. Seems like at one point LF was allowing multiple status values? Currently it is only allowing one, so I made that switch. I also cleaned up the ConvertMongoToLcmOptionList class some. I removed the now unneeded ability to look up LCM items from StringFields. The API now exposes LookupByItem(LfOptionListItem), which looks through the Possibilities, then the _possRepo, then the CanonicalItem's, similar to what the FromStringField was doing. The new API is cleaner and less confusing. Also added some default value for Key on LfOptionListItem. If it is requested before it's been set, it will use the GUID. Also gave it an IsEmpty method to integrate with serialization.
1 parent f8bc486 commit 69a4ee6

14 files changed

Lines changed: 151 additions & 161 deletions

src/LfMerge.Core.Tests/Actions/SynchronizeActionTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public void SynchronizeAction_LFDataChanged_GlossChanged()
164164
IEnumerable<LfLexEntry> originalMongoData = _mongoConnection.GetLfLexEntries();
165165
LfLexEntry lfEntry = originalMongoData.First(e => e.Guid == _testEntryGuid);
166166
string unchangedGloss = lfEntry.Senses[0].Gloss["en"].Value;
167-
var lfChangedGloss = LfStringField.CreateFrom(unchangedGloss + " - changed in LF", new Guid());
167+
var lfChangedGloss = LfStringField.CreateFrom(unchangedGloss + " - changed in LF");
168168
lfEntry.Senses[0].Gloss["en"] = lfChangedGloss;
169169
_mongoConnection.UpdateRecord(_lfProject, lfEntry);
170170

@@ -246,7 +246,7 @@ public void SynchronizeAction_LFDataChangedLDDataChanged_LFWins()
246246

247247
string unchangedGloss = lfEntry.Senses[0].Gloss["en"].Value;
248248
string fwChangedGloss = unchangedGloss + " - changed in FW";
249-
var lfChangedGloss = LfStringField.CreateFrom(unchangedGloss + " - changed in LF", new Guid());
249+
var lfChangedGloss = LfStringField.CreateFrom(unchangedGloss + " - changed in LF");
250250
lfEntry.Senses[0].Gloss["en"] = lfChangedGloss;
251251
lfEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
252252
_mongoConnection.UpdateRecord(_lfProject, lfEntry);
@@ -436,7 +436,7 @@ public void SynchronizeAction_LFDataChangedLDEntryDeleted_LFWins()
436436
const string lfCreatedGloss = "new English gloss - added in LF";
437437
const string fwChangedGloss = "English gloss - changed in FW";
438438
// LF adds a gloss to the entry that LD is deleting
439-
lfEntry.Senses[0].Gloss = LfMultiText.FromSingleStringMapping("en", lfCreatedGloss, new Guid());
439+
lfEntry.Senses[0].Gloss = LfMultiText.FromSingleStringMapping("en", lfCreatedGloss);
440440
lfEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
441441
_mongoConnection.UpdateRecord(_lfProject, lfEntry);
442442

@@ -480,7 +480,7 @@ public void SynchronizeAction_LFDataChangedLDOtherDataChanged_ModifiedDateUpdate
480480
var originalLfDateModified = lfEntry.DateModified;
481481
var originalLfAuthorInfoModifiedDate = lfEntry.AuthorInfo.ModifiedDate;
482482

483-
lfEntry.Note = LfMultiText.FromSingleStringMapping("en", "A note from LF", new Guid());
483+
lfEntry.Note = LfMultiText.FromSingleStringMapping("en", "A note from LF");
484484
lfEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
485485
_mongoConnection.UpdateRecord(_lfProject, lfEntry);
486486

src/LfMerge.Core.Tests/Lcm/RoundTripTests.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public void RoundTrip_LcmToMongoToLcmToMongo_ShouldKeepModifiedValuesInEntries()
181181
string vernacularWS = cache.ServiceLocator.WritingSystemManager.GetStrFromWs(cache.DefaultVernWs);
182182
string originalLexeme = originalLfEntry.Lexeme[vernacularWS].Value;
183183
string changedLexeme = "Changed lexeme for this test";
184-
var originalValue = LfStringField.CreateFrom(changedLexeme, new Guid());
184+
var originalValue = LfStringField.CreateFrom(changedLexeme);
185185
originalLfEntry.Lexeme[vernacularWS] = originalValue;
186186
originalLfEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
187187
_conn.UpdateMockLfLexEntry(originalLfEntry);
@@ -193,7 +193,7 @@ public void RoundTrip_LcmToMongoToLcmToMongo_ShouldKeepModifiedValuesInEntries()
193193
// Exercise
194194
SutMongoToLcm.Run(lfProject);
195195
string changedLexemeDuringUpdate = "This value should be overwritten by LcmToMongo";
196-
originalLfEntry.Lexeme[vernacularWS] = LfStringField.CreateFrom(changedLexemeDuringUpdate, new Guid());
196+
originalLfEntry.Lexeme[vernacularWS] = LfStringField.CreateFrom(changedLexemeDuringUpdate);
197197
originalLfEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
198198
_conn.UpdateMockLfLexEntry(originalLfEntry);
199199
SutLcmToMongo.Run(lfProject);
@@ -269,16 +269,16 @@ public void RoundTrip_LcmToMongoToLcmToMongo_ShouldKeepModifiedValuesInSenses()
269269

270270
var originalSense0Definition = originalEntry.Senses[0].Definition["en"];
271271
var originalSense1Definition = originalEntry.Senses[1].Definition["en"];
272-
var changedSense0Definition = LfStringField.CreateFrom("Changed sense0 definition for this test", new Guid());
273-
var changedSense1Definition = LfStringField.CreateFrom("Changed sense1 definition for this test", new Guid());
272+
var changedSense0Definition = LfStringField.CreateFrom("Changed sense0 definition for this test");
273+
var changedSense1Definition = LfStringField.CreateFrom("Changed sense1 definition for this test");
274274
originalEntry.Senses[0].Definition["en"] = changedSense0Definition;
275275
originalEntry.Senses[1].Definition["en"] = changedSense1Definition;
276276
originalEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
277277
_conn.UpdateMockLfLexEntry(originalEntry);
278278

279279
// Exercise
280280
SutMongoToLcm.Run(lfProject);
281-
var changedDefinitionDuringUpdate = LfStringField.CreateFrom("This value should be overwritten by LcmToMongo", new Guid());
281+
var changedDefinitionDuringUpdate = LfStringField.CreateFrom("This value should be overwritten by LcmToMongo");
282282
originalEntry.Senses[0].Definition["en"] = changedDefinitionDuringUpdate;
283283
originalEntry.Senses[1].Definition["en"] = changedDefinitionDuringUpdate;
284284
originalEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
@@ -381,16 +381,16 @@ public void RoundTrip_LcmToMongoToLcmToMongo_ShouldKeepModifiedValuesInExample()
381381

382382
var originalSense0Example0Translation = originalEntry.Senses[0].Examples[0].Translation["en"];
383383
var originalSense0Example1Translation = originalEntry.Senses[0].Examples[1].Translation["en"];
384-
var changedSense0Example0Translation = LfStringField.CreateFrom("Changed sense0 example0 sentence for this test", new Guid());
385-
var changedSense0Example1Translation = LfStringField.CreateFrom("Changed sense0 example1 sentence for this test", new Guid());
384+
var changedSense0Example0Translation = LfStringField.CreateFrom("Changed sense0 example0 sentence for this test");
385+
var changedSense0Example1Translation = LfStringField.CreateFrom("Changed sense0 example1 sentence for this test");
386386
originalEntry.Senses[0].Examples[0].Translation["en"] = changedSense0Example0Translation;
387387
originalEntry.Senses[0].Examples[1].Translation["en"] = changedSense0Example1Translation;
388388
originalEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
389389
_conn.UpdateMockLfLexEntry(originalEntry);
390390

391391
// Exercise
392392
SutMongoToLcm.Run(lfProject);
393-
var changedTranslationDuringUpdate = LfStringField.CreateFrom("This value should be overwritten by LcmToMongo", new Guid());
393+
var changedTranslationDuringUpdate = LfStringField.CreateFrom("This value should be overwritten by LcmToMongo");
394394
originalEntry.Senses[0].Examples[0].Translation["en"] = changedTranslationDuringUpdate;
395395
originalEntry.Senses[0].Examples[1].Translation["en"] = changedTranslationDuringUpdate;
396396
originalEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
@@ -473,7 +473,7 @@ public void RoundTrip_MongoToLcmToMongo_ShouldAddAndDeleteNewEntry()
473473
newEntry.Guid = Guid.NewGuid();
474474
string vernacularWS = lfProject.FieldWorksProject.Cache.LanguageProject.DefaultVernacularWritingSystem.Id;
475475
string newLexeme = "new lexeme for this test";
476-
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme, newEntry.Guid.Value);
476+
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme);
477477
newEntry.AuthorInfo = new LfAuthorInfo();
478478
newEntry.AuthorInfo.CreatedDate = new DateTime();
479479
newEntry.AuthorInfo.ModifiedDate = newEntry.AuthorInfo.CreatedDate;
@@ -553,8 +553,8 @@ public void RoundTrip_MongoToLcmToMongo_ShouldAddAndDeleteNewSense()
553553
Assert.That(lfEntry.Senses.Count, Is.EqualTo(2));
554554
LfSense newSense = new LfSense();
555555
newSense.Guid = Guid.NewGuid();
556-
newSense.Definition = LfMultiText.FromSingleStringMapping(vernacularWS, newDefinition, newSense.Guid.Value);
557-
newSense.PartOfSpeech = LfStringField.CreateFrom(newPartOfSpeech, newSense.Guid.Value);
556+
newSense.Definition = LfMultiText.FromSingleStringMapping(vernacularWS, newDefinition);
557+
newSense.PartOfSpeech = new LfOptionListItem { Value = newPartOfSpeech };
558558
lfEntry.Senses.Add(newSense);
559559
Assert.That(lfEntry.Senses.Count, Is.EqualTo(3));
560560
lfEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
@@ -643,8 +643,8 @@ public void RoundTrip_MongoToLcmToMongo_ShouldAddAndDeleteNewExample()
643643
Assert.That(lfSense.Examples.Count, Is.EqualTo(2));
644644
LfExample newExample = new LfExample();
645645
newExample.Guid = Guid.NewGuid();
646-
newExample.Sentence = LfMultiText.FromSingleStringMapping(vernacularWS, newSentence, newExample.Guid.Value);
647-
newExample.Translation = LfMultiText.FromSingleStringMapping(vernacularWS, newTranslation, newExample.Guid.Value);
646+
newExample.Sentence = LfMultiText.FromSingleStringMapping(vernacularWS, newSentence);
647+
newExample.Translation = LfMultiText.FromSingleStringMapping(vernacularWS, newTranslation);
648648
lfSense.Examples.Add(newExample);
649649
Assert.That(lfSense.Examples.Count, Is.EqualTo(3));
650650
lfEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
@@ -737,7 +737,7 @@ public void RoundTrip_MongoToLcmToMongo_ShouldAddAndDeleteNewPicture()
737737
Assert.That(lfSense.Pictures.Count, Is.EqualTo(1));
738738
LfPicture newPicture = new LfPicture();
739739
newPicture.Guid = Guid.NewGuid();
740-
newPicture.Caption = LfMultiText.FromSingleStringMapping(vernacularWS, newCaption, newPicture.Guid.Value);
740+
newPicture.Caption = LfMultiText.FromSingleStringMapping(vernacularWS, newCaption);
741741
newPicture.FileName = newFilename;
742742
lfSense.Pictures.Add(newPicture);
743743
Assert.That(lfSense.Pictures.Count, Is.EqualTo(2));

src/LfMerge.Core.Tests/Lcm/TransferMongoToLcmActionTests.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void Action_ChangedWithSampleData_ShouldUpdatePictures()
9696
Is.EqualTo(expectedExternalFileName));
9797

9898
LfMultiText expectedNewCaption = LfMultiText.FromLcmMultiString(
99-
entry.SensesOS[0].PicturesOS[0].Caption, entry.Guid, cache.ServiceLocator.WritingSystemFactory);
99+
entry.SensesOS[0].PicturesOS[0].Caption, cache.ServiceLocator.WritingSystemFactory);
100100
int expectedNumOfNewCaptions = expectedNewCaption.Count();
101101
Assert.That(expectedNumOfNewCaptions, Is.EqualTo(2));
102102
string expectedNewVernacularCaption = expectedNewCaption["qaa-x-kal"].Value;
@@ -207,7 +207,7 @@ public void Action_WithOneNewEntry_ShouldCountOneAdded()
207207
LcmCache cache = lfProj.FieldWorksProject.Cache;
208208
string vernacularWS = cache.LanguageProject.DefaultVernacularWritingSystem.Id;
209209
string newLexeme = "new lexeme for this test";
210-
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme, newEntry.Guid.Value);
210+
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme);
211211
newEntry.AuthorInfo = new LfAuthorInfo();
212212
newEntry.AuthorInfo.CreatedDate = DateTime.UtcNow;
213213
newEntry.AuthorInfo.ModifiedDate = newEntry.AuthorInfo.CreatedDate;
@@ -237,7 +237,7 @@ public void Action_WithOneModifiedEntry_ShouldCountOneModified()
237237
LcmCache cache = lfProj.FieldWorksProject.Cache;
238238
string vernacularWS = cache.LanguageProject.DefaultVernacularWritingSystem.Id;
239239
string changedLexeme = "modified lexeme for this test";
240-
entry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme, entryGuid);
240+
entry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme);
241241
entry.AuthorInfo = new LfAuthorInfo();
242242
entry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
243243
_conn.UpdateMockLfLexEntry(entry);
@@ -289,7 +289,7 @@ public void Action_WithTwoNewEntries_ShouldCountTwoAdded()
289289
LcmCache cache = lfProj.FieldWorksProject.Cache;
290290
string vernacularWS = cache.LanguageProject.DefaultVernacularWritingSystem.Id;
291291
string newLexeme = "new lexeme for this test";
292-
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme, newEntry.Guid.Value);
292+
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme);
293293
newEntry.AuthorInfo = new LfAuthorInfo();
294294
newEntry.AuthorInfo.CreatedDate = DateTime.UtcNow;
295295
newEntry.AuthorInfo.ModifiedDate = newEntry.AuthorInfo.CreatedDate;
@@ -298,7 +298,7 @@ public void Action_WithTwoNewEntries_ShouldCountTwoAdded()
298298
LfLexEntry newEntry2 = new LfLexEntry();
299299
newEntry2.Guid = Guid.NewGuid();
300300
string newLexeme2 = "new lexeme #2 for this test";
301-
newEntry2.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme2, newEntry2.Guid.Value);
301+
newEntry2.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme2);
302302
newEntry2.AuthorInfo = new LfAuthorInfo();
303303
newEntry2.AuthorInfo.CreatedDate = DateTime.UtcNow;
304304
newEntry2.AuthorInfo.ModifiedDate = newEntry2.AuthorInfo.CreatedDate;
@@ -328,15 +328,15 @@ public void Action_WithTwoModifiedEntries_ShouldCountTwoModified()
328328
LcmCache cache = lfProj.FieldWorksProject.Cache;
329329
string vernacularWS = cache.LanguageProject.DefaultVernacularWritingSystem.Id;
330330
string changedLexeme = "modified lexeme for this test";
331-
entry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme, entryGuid);
331+
entry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme);
332332
entry.AuthorInfo = new LfAuthorInfo();
333333
entry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
334334
_conn.UpdateMockLfLexEntry(entry);
335335

336336
Guid kenGuid = Guid.Parse(KenEntryGuidStr);
337337
LfLexEntry kenEntry = _conn.GetLfLexEntryByGuid(kenGuid);
338338
string changedLexeme2 = "modified lexeme #2 for this test";
339-
kenEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme2, kenGuid);
339+
kenEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme2);
340340
kenEntry.AuthorInfo = new LfAuthorInfo();
341341
kenEntry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
342342
_conn.UpdateMockLfLexEntry(kenEntry);
@@ -392,7 +392,7 @@ public void Action_WithOneNewEntry_ShouldNotCountThatNewEntryOnSecondRun()
392392
LcmCache cache = lfProj.FieldWorksProject.Cache;
393393
string vernacularWS = cache.LanguageProject.DefaultVernacularWritingSystem.Id;
394394
string newLexeme = "new lexeme for this test";
395-
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme, newEntry.Guid.Value);
395+
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme);
396396
newEntry.AuthorInfo = new LfAuthorInfo();
397397
newEntry.AuthorInfo.CreatedDate = DateTime.UtcNow;
398398
newEntry.AuthorInfo.ModifiedDate = newEntry.AuthorInfo.CreatedDate;
@@ -433,7 +433,7 @@ public void Action_WithOneModifiedEntry_ShouldNotCountThatModifiedEntryOnSecondR
433433
LcmCache cache = lfProj.FieldWorksProject.Cache;
434434
string vernacularWS = cache.LanguageProject.DefaultVernacularWritingSystem.Id;
435435
string changedLexeme = "modified lexeme for this test";
436-
entry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme, entryGuid);
436+
entry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme);
437437
entry.AuthorInfo = new LfAuthorInfo();
438438
entry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
439439
_conn.UpdateMockLfLexEntry(entry);
@@ -507,7 +507,7 @@ public void Action_RunTwiceWithOneNewEntryEachTime_ShouldCountTwoAddedInTotal()
507507
LcmCache cache = lfProj.FieldWorksProject.Cache;
508508
string vernacularWS = cache.LanguageProject.DefaultVernacularWritingSystem.Id;
509509
string newLexeme = "new lexeme for this test";
510-
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme, newEntry.Guid.Value);
510+
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme);
511511
newEntry.AuthorInfo = new LfAuthorInfo();
512512
newEntry.AuthorInfo.CreatedDate = DateTime.UtcNow;
513513
newEntry.AuthorInfo.ModifiedDate = newEntry.AuthorInfo.CreatedDate;
@@ -528,7 +528,7 @@ public void Action_RunTwiceWithOneNewEntryEachTime_ShouldCountTwoAddedInTotal()
528528
newEntry = new LfLexEntry();
529529
newEntry.Guid = Guid.NewGuid();
530530
newLexeme = "second new lexeme for this test";
531-
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme, newEntry.Guid.Value);
531+
newEntry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, newLexeme);
532532
newEntry.AuthorInfo = new LfAuthorInfo();
533533
newEntry.AuthorInfo.CreatedDate = DateTime.UtcNow;
534534
newEntry.AuthorInfo.ModifiedDate = newEntry.AuthorInfo.CreatedDate;
@@ -560,7 +560,7 @@ public void Action_RunTwiceWithTheSameEntryModifiedEachTime_ShouldCountTwoModifi
560560
LcmCache cache = lfProj.FieldWorksProject.Cache;
561561
string vernacularWS = cache.LanguageProject.DefaultVernacularWritingSystem.Id;
562562
string changedLexeme = "modified lexeme for this test";
563-
entry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme, entryGuid);
563+
entry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme);
564564
entry.AuthorInfo = new LfAuthorInfo();
565565
entry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
566566
_conn.UpdateMockLfLexEntry(entry);
@@ -578,7 +578,7 @@ public void Action_RunTwiceWithTheSameEntryModifiedEachTime_ShouldCountTwoModifi
578578

579579
// Setup second run
580580
string changedLexeme2 = "second modified lexeme for this test";
581-
entry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme2, entryGuid);
581+
entry.Lexeme = LfMultiText.FromSingleStringMapping(vernacularWS, changedLexeme2);
582582
entry.AuthorInfo = new LfAuthorInfo();
583583
entry.AuthorInfo.ModifiedDate = DateTime.UtcNow;
584584
_conn.UpdateMockLfLexEntry(entry);

src/LfMerge.Core/DataConverters/ConvertLcmToMongoCustomField.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,6 @@ private BsonDocument GetCustomFieldData(int hvo, int flid, string fieldSourceTyp
326326
CellarPropertyType LcmFieldType = (CellarPropertyType)LcmMetaData.GetFieldType(flid);
327327
var dataGuids = new List<Guid>();
328328

329-
var guid = data.get_GuidProp(hvo, flid);
330-
331329
// Valid field types in Lcm are GenDate, Integer, String, OwningAtomic, ReferenceAtomic, and ReferenceCollection, so that's all we implement.
332330
switch (LcmFieldType)
333331
{
@@ -337,7 +335,7 @@ private BsonDocument GetCustomFieldData(int hvo, int flid, string fieldSourceTyp
337335
// LF wants single-string fields in the format { "ws": { "value": "contents" } }
338336
fieldValue = String.IsNullOrEmpty(genDateStr) ? null :
339337
LfMultiText.FromSingleStringMapping(
340-
MagicStrings.LanguageCodeForGenDateFields, genDateStr, guid).AsBsonDocument();
338+
MagicStrings.LanguageCodeForGenDateFields, genDateStr).AsBsonDocument();
341339
break;
342340
// When parsing, will use GenDate.TryParse(str, out genDate)
343341

@@ -348,7 +346,7 @@ private BsonDocument GetCustomFieldData(int hvo, int flid, string fieldSourceTyp
348346
else
349347
// LF wants single-string fields in the format { "ws": { "value": "contents" } }
350348
fieldValue = LfMultiText.FromSingleStringMapping(
351-
MagicStrings.LanguageCodeForIntFields, fieldValue.AsInt32.ToString(), guid).AsBsonDocument();
349+
MagicStrings.LanguageCodeForIntFields, fieldValue.AsInt32.ToString()).AsBsonDocument();
352350
break;
353351

354352
case CellarPropertyType.OwningAtomic:
@@ -365,7 +363,7 @@ private BsonDocument GetCustomFieldData(int hvo, int flid, string fieldSourceTyp
365363
case CellarPropertyType.MultiUnicode:
366364
ITsMultiString tss = data.get_MultiStringProp(hvo, flid);
367365
if (tss != null && tss.StringCount > 0)
368-
fieldValue = LfMultiText.FromMultiITsString(tss, guid, servLoc.WritingSystemManager).AsBsonDocument();
366+
fieldValue = LfMultiText.FromMultiITsString(tss, servLoc.WritingSystemManager).AsBsonDocument();
369367
break;
370368
case CellarPropertyType.OwningCollection:
371369
case CellarPropertyType.OwningSequence:
@@ -387,7 +385,7 @@ private BsonDocument GetCustomFieldData(int hvo, int flid, string fieldSourceTyp
387385
if (iTsValue == null || String.IsNullOrEmpty(iTsValue.Text))
388386
fieldValue = null;
389387
else
390-
fieldValue = LfMultiText.FromSingleITsString(iTsValue, guid, servLoc.WritingSystemManager).AsBsonDocument();
388+
fieldValue = LfMultiText.FromSingleITsString(iTsValue, servLoc.WritingSystemManager).AsBsonDocument();
391389
break;
392390
default:
393391
fieldValue = null;

0 commit comments

Comments
 (0)