Ticket #16814: 0001-Fix-error-searching-templates-when-opening-documents.patch

File 0001-Fix-error-searching-templates-when-opening-documents.patch, 1.1 KB (added by neil_mayhew, 6 years ago)

Fix error searching templates when opening documents

  • src/common/docview.cpp

    From 758aeac8bf1a6143f4499fd309241212c00b0561 Mon Sep 17 00:00:00 2001
    From: Neil Mayhew <neil_mayhew@sil.org>
    Date: Tue, 27 Jan 2015 14:20:31 -0700
    Subject: Fix error searching templates when opening documents
    
    If wxDocManager::CreateDocument is called with a filename and no flags,
    it fails to find the correct template, because of an incorrect check
    for an empty filename.
    ---
     src/common/docview.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/common/docview.cpp b/src/common/docview.cpp
    index 6ae949e..27d06c6 100644
    a b wxDocument *wxDocManager::CreateDocument(const wxString& pathOrig, long flags) 
    14811481    {
    14821482        // for the new file we need just the template, for an existing one we
    14831483        // need the template and the path, unless it's already specified
    1484         if ( (flags & wxDOC_NEW) || !path.empty() )
     1484        if ( (flags & wxDOC_NEW) || path.empty() )
    14851485            temp = SelectDocumentType(&templates[0], numTemplates);
    14861486        else
    14871487            temp = SelectDocumentPath(&templates[0], numTemplates, path, flags);