Save document file when creating new component library from component in library editor. (fixes lp:1351952)

This commit is contained in:
Wayne Stambaugh 2014-12-20 14:44:02 -05:00
parent 3f66000bf3
commit 1393bcafc0
1 changed files with 18 additions and 0 deletions

View File

@ -146,6 +146,24 @@ void LIB_EDIT_FRAME::OnExportPart( wxCommandEvent& event )
return;
}
try
{
wxFileName docFileName = fn;
docFileName.SetExt( DOC_EXT );
FILE_OUTPUTFORMATTER formatter( docFileName.GetFullPath() );
result = temp_lib.get()->SaveDocs( formatter );
}
catch( ... /* IO_ERROR ioe */ )
{
fn.MakeAbsolute();
msg = wxT( "Failed to create component library document file " ) + fn.GetFullPath();
DisplayError( this, msg );
return;
}
if( result )
m_lastLibExportPath = fn.GetPath();