diff options
Diffstat (limited to 'sfx2/source/view/viewfrm.cxx')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 9cb15a0f1444..4014167e3b0d 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -416,6 +416,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) return; } + RemoveInfoBar("readonly"); pSh->SetReadOnlyUI( false ); } @@ -1250,7 +1251,6 @@ const SvBorder& SfxViewFrame::GetBorderPixelImpl void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { - if( IsDowning_Impl()) return; @@ -1272,7 +1272,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) SfxDispatcher *pDispat = GetDispatcher(); bool bWasReadOnly = pDispat->GetReadOnly_Impl(); bool bIsReadOnly = xObjSh->IsReadOnly(); - if ( !bWasReadOnly != !bIsReadOnly ) + if ( bWasReadOnly != bIsReadOnly ) { // Then also TITLE_CHANGED UpdateTitle(); @@ -1360,6 +1360,14 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) // because each document has its own SfxBindings. //GetDispatcher()->GetBindings()->InvalidateAll(true); } + else + { + std::vector< PushButton* > aButtons; + PushButton* pBtn = new PushButton( &GetWindow(), SfxResId(BT_READONLY_EDIT)); + pBtn->SetClickHdl(LINK(this, SfxViewFrame, SwitchReadOnlyHandler)); + aButtons.push_back( pBtn ); + AppendInfoBar("readonly", SfxResId(STR_READONLY_DOCUMENT), aButtons); + } break; } @@ -1374,6 +1382,12 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) } } +IMPL_LINK_NOARG(SfxViewFrame, SwitchReadOnlyHandler) +{ + GetDispatcher()->Execute(SID_EDITDOC); + return 0; +} + void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh ) { |