From 972ae2cc11922fa0258a1c0c220253a5777eeee9 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 29 Dec 2023 07:52:05 +0000 Subject: [PATCH] Move call to Doc::SyncFromFacsimile to Toolkit::LoadData --- src/iomei.cpp | 4 ---- src/toolkit.cpp | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/iomei.cpp b/src/iomei.cpp index 7aa1a46e76d..66c7cf2076c 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -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(); diff --git a/src/toolkit.cpp b/src/toolkit.cpp index b7a31251bd2..4821605cf8b 100644 --- a/src/toolkit.cpp +++ b/src/toolkit.cpp @@ -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 @@ -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);