Skip to content

Commit

Permalink
Move call to Doc::SyncFromFacsimile to Toolkit::LoadData
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Dec 29, 2023
1 parent cc9269d commit 972ae2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/iomei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3999,10 +3999,6 @@ bool MEIInput::ReadDoc(pugi::xml_node root)
m_doc->ConvertMarkupDoc(!m_doc->GetOptions()->m_preserveAnalyticalMarkup.GetValue());
}

if (success && m_doc->IsTranscription()) {
m_doc->SyncFromFacsimileDoc();
}

if (success && !m_hasScoreDef) {
LogWarning("No scoreDef provided, trying to generate one...");
success = m_doc->GenerateDocumentScoreDef();
Expand Down
15 changes: 12 additions & 3 deletions src/toolkit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,14 @@ bool Toolkit::LoadData(const std::string &data)
breaks = BREAKS_none;
}

// Always set breaks to 'none' with Transcription or Facs rendering - rendering them differenty requires the MEI
// to be converted
if (m_doc.IsTranscription() || m_doc.IsFacs()) breaks = BREAKS_none;
// Always set breaks to 'none' with Facs rendering
if (m_doc.IsFacs()) breaks = BREAKS_none;

// Always set breaks to 'none' or 'encoded' with Transcription rendering
// rendering them differenty requires the MEI
if (m_doc.IsTranscription()) {
breaks = (m_doc.HasFacsimile()) ? BREAKS_encoded : BREAKS_none;
}

if (breaks != BREAKS_none) {
if (input->GetLayoutInformation() == LAYOUT_ENCODED
Expand Down Expand Up @@ -787,6 +792,10 @@ bool Toolkit::LoadData(const std::string &data)
}
}

if (m_doc.IsTranscription() && m_doc.HasFacsimile()) {
m_doc.SyncFromFacsimileDoc();
}

delete input;
m_view.SetDoc(&m_doc);

Expand Down

0 comments on commit 972ae2c

Please sign in to comment.