tdf#146553 sw: Enable the AutoText dialog's Insert button in editable
sections in read-only mode. Change-Id: I0fdf3a11f96ded8fe84cf9c81da2d6a020af3197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180995 Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de> Tested-by: Jenkins
This commit is contained in:
@@ -343,8 +343,19 @@ SwGlossaryDlg::SwGlossaryDlg(const SfxViewFrame& rViewFrame,
|
||||
|
||||
ShowPreview();
|
||||
|
||||
m_bIsDocReadOnly = m_pShell->GetView().GetDocShell()->IsReadOnly() ||
|
||||
m_pShell->HasReadonlySel();
|
||||
bool bIsInEditableSect = false;
|
||||
bool bIsReadOnly = m_pShell->GetView().GetDocShell()->IsReadOnly();
|
||||
if (bIsReadOnly)
|
||||
{
|
||||
// If there is editable section in read-only mode,
|
||||
// enable the use of the AutoText dialog's insert button
|
||||
// within these sections.
|
||||
const SwSection* pSection = m_pShell->GetCurrSection();
|
||||
if (pSection && pSection->IsEditInReadonly())
|
||||
bIsInEditableSect = true;
|
||||
}
|
||||
|
||||
m_bIsDocReadOnly = (bIsReadOnly || m_pShell->HasReadonlySel()) && !bIsInEditableSect;
|
||||
if( m_bIsDocReadOnly )
|
||||
m_xInsertBtn->set_sensitive(false);
|
||||
m_xNameED->grab_focus();
|
||||
|
||||
Reference in New Issue
Block a user