Kaydet (Commit) c5ab6819 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

flatten LibPage::InsertLib

Change-Id: Ib71c160d3375cb94232894e6bdb1a37132aff3be
Reviewed-on: https://gerrit.libreoffice.org/65706
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 87742f16
......@@ -744,8 +744,9 @@ void LibPage::InsertLib()
else
xFP->setCurrentFilter( IDEResId(RID_STR_BASIC) );
if ( xFP->execute() == RET_OK )
{
if ( xFP->execute() != RET_OK )
return;
GetExtraData()->SetAddLibPath( xFP->getDisplayDirectory() );
GetExtraData()->SetAddLibFilter( xFP->getCurrentFilter() );
......@@ -783,8 +784,9 @@ void LibPage::InsertLib()
xDlgLibContImport.set( script::DocumentDialogLibraryContainer::createWithURL(xContext, aDlgURL), UNO_QUERY );
}
if ( xModLibContImport.is() || xDlgLibContImport.is() )
{
if ( !xModLibContImport.is() && !xDlgLibContImport.is() )
return;
VclPtr<LibDialog> pLibDlg;
Reference< script::XLibraryContainer > xModLibContImp( xModLibContImport, UNO_QUERY );
......@@ -818,10 +820,9 @@ void LibPage::InsertLib()
std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_NOLIBINSTORAGE)));
xErrorBox->run();
return;
}
else
{
bool bChanges = false;
OUString aExtension( aURLObj.getExtension() );
OUString aLibExtension( "xlb" );
OUString aContExtension( "xlc" );
......@@ -830,8 +831,10 @@ void LibPage::InsertLib()
if ( aExtension != aLibExtension && aExtension != aContExtension )
pLibDlg->EnableReference(false);
if ( pLibDlg->Execute() )
{
if ( !pLibDlg->Execute() )
return;
bool bChanges = false;
sal_uLong nNewPos = m_pLibBox->GetEntryCount();
bool bRemove = false;
bool bReplace = pLibDlg->IsReplace();
......@@ -1059,14 +1062,9 @@ void LibPage::InsertLib()
SvTreeListEntry* pFirstNew = m_pLibBox->GetEntry( nNewPos );
if ( pFirstNew )
m_pLibBox->SetCurEntry( pFirstNew );
}
pLibDlg.reset();
if ( bChanges )
MarkDocumentModified( m_aCurDocument );
}
}
}
}
void LibPage::Export()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment