diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-11-28 10:40:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-11-28 14:29:05 +0000 |
commit | b992da28c595f40a75ddf3237edec10d73e56d91 (patch) | |
tree | 131194afd9279878735d98799f15b8da20f65676 | |
parent | 1fe671546218135841d2cb1c99a993b95fd7e12c (diff) |
tdf#104106 Enable save whenever edit mode active
but in case of a r/o medium do "save as" instead.
Change-Id: If99602481deb053c2f834b1c7f5d24eb725df9c1
Reviewed-on: https://gerrit.libreoffice.org/31308
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
(cherry picked from commit afe7f739106124542712ec50dbe2917a8dd14db3)
Reviewed-on: https://gerrit.libreoffice.org/31315
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 4f5b420ee178..6547aff74b5d 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -634,7 +634,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) *rReq.GetArgs(), aDispatchArgs ); - const SfxSlot* pSlot = GetModule()->GetSlotPool()->GetSlot( nId ); + bool bForceSaveAs = nId == SID_SAVEDOC && IsReadOnlyMedium(); + const SfxSlot* pSlot = GetModule()->GetSlotPool()->GetSlot( bForceSaveAs ? SID_SAVEASDOC : nId ); if ( !pSlot ) throw uno::Exception(); @@ -968,7 +969,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) } case SID_SAVEDOC: { - if ( !IsReadOnlyMedium() ) + if ( !IsReadOnly() ) rSet.Put(SfxStringItem( nWhich, SfxResId(STR_SAVEDOC).toString())); else diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 55f256cf2121..e4784b00adbf 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -611,7 +611,7 @@ bool SfxObjectShell::PrepareClose { SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); const SfxPoolItem* ppArgs[] = { &aWarnItem, nullptr }; - pPoolItem = pFrame->GetBindings().ExecuteSynchron( IsReadOnlyMedium() ? SID_SAVEASDOC : SID_SAVEDOC, ppArgs ); + pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs ); } if ( !pPoolItem || dynamic_cast< const SfxVoidItem *>( pPoolItem ) != nullptr || ( dynamic_cast< const SfxBoolItem *>( pPoolItem ) != nullptr && !static_cast<const SfxBoolItem*>( pPoolItem )->GetValue() ) ) |