summaryrefslogtreecommitdiff
path: root/sfx2/source/view/viewfrm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/view/viewfrm.cxx')
-rwxr-xr-xsfx2/source/view/viewfrm.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index cb900628df05..4fa88c354f99 100755
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -277,6 +277,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if( !pSh || !pSh->HasName() || !(pSh->Get_Impl()->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ))
break;
+ SfxViewShell* pViewSh = GetViewShell();
+ if (pViewSh && pViewSh->isEditDocLocked())
+ break;
+
// Only change read-only UI and remove info bar when we succeed
struct ReadOnlyUIGuard
{
@@ -864,6 +868,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet )
const SfxShell *pFSh;
if ( !pSh->HasName() ||
!( pSh->Get_Impl()->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) ||
+ (GetViewShell() && GetViewShell()->isEditDocLocked()) ||
( pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED &&
( !(pVSh = pSh->GetViewShell()) ||
!(pFSh = pVSh->GetFormShell()) ||
@@ -1347,11 +1352,18 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
pInfoBar->addButton(xSignButton);
}
- VclPtrInstance<PushButton> xBtn(&GetWindow());
- xBtn->SetText(SfxResId(STR_READONLY_EDIT));
- xBtn->SetSizePixel(xBtn->GetOptimalSize());
- xBtn->SetClickHdl(LINK(this, SfxViewFrame, SwitchReadOnlyHandler));
- pInfoBar->addButton(xBtn);
+ bool showEditDocumentButton = true;
+ if (m_xObjSh->GetViewShell() && m_xObjSh->GetViewShell()->isEditDocLocked())
+ showEditDocumentButton = false;
+
+ if (showEditDocumentButton)
+ {
+ VclPtrInstance<PushButton> xBtn(&GetWindow());
+ xBtn->SetText(SfxResId(STR_READONLY_EDIT));
+ xBtn->SetSizePixel(xBtn->GetOptimalSize());
+ xBtn->SetClickHdl(LINK(this, SfxViewFrame, SwitchReadOnlyHandler));
+ pInfoBar->addButton(xBtn);
+ }
}
}