diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2015-12-22 13:12:23 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2015-12-23 09:38:25 +0000 |
commit | 22328a224df4619218b88205838307f70612207e (patch) | |
tree | 251c9aaf8ab1b1db5cf80af9c8644d6cacd6d897 /sfx2 | |
parent | 2351fd5d489fde281e8d1ef97af747149a29c247 (diff) |
New saving behavior
Changes in this commit:
- AlwaysAllowSave config is gone. Saving is always permitted, unless in
a read only document. Also changed the behavior in dbaccess to match
sfx2.
- The toolbar save button is always enabled, to always give access to
the dropdown. That's the case even in a read only document, except
that it changes to DROPDOWNONLY, and the save as command icon+tooltip.
In table/query designers we still disable the button in read only state.
- When the document is modified, the toolbar button gets a special icon
to indicate that.
TODO:
- Icons for the document modified state are still missing. I added some
fake links to Tango's links.txt in order to test the new behavior.
These links shouldn't stay as-is in a production version!
Change-Id: I56c169bf48b78faaf53c2989ce8624f8297ffb6e
Reviewed-on: https://gerrit.libreoffice.org/20839
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/sdi/sfx.sdi | 2 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 17 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 1 |
4 files changed, 4 insertions, 23 deletions
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 8bbf40ea7a11..1667d9d9e22b 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -4913,7 +4913,7 @@ SfxBoolItem Save SID_SAVEDOC /* flags: */ AutoUpdate = FALSE, Cachable = Cachable, - FastCall = TRUE, + FastCall = FALSE, HasCoreId = FALSE, HasDialog = FALSE, ReadOnlyDoc = FALSE, diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index adab5fb16766..161e3205064e 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -689,7 +689,6 @@ sal_Int8 ModelData_Impl::CheckStateForSave() return STATUS_SAVEAS; // check acceptable entries for media descriptor - bool bVersInfoNeedsStore = false; ::comphelper::SequenceAsHashMap aAcceptedArgs; OUString aVersionCommentString("VersionComment"); @@ -699,18 +698,15 @@ sal_Int8 ModelData_Impl::CheckStateForSave() OUString aFailOnWarningString("FailOnWarning"); if ( GetMediaDescr().find( aVersionCommentString ) != GetMediaDescr().end() ) - { - bVersInfoNeedsStore = true; aAcceptedArgs[ aVersionCommentString ] = GetMediaDescr()[ aVersionCommentString ]; - } if ( GetMediaDescr().find( aAuthorString ) != GetMediaDescr().end() ) aAcceptedArgs[ aAuthorString ] = GetMediaDescr()[ aAuthorString ]; if ( GetMediaDescr().find( aInteractionHandlerString ) != GetMediaDescr().end() ) aAcceptedArgs[ aInteractionHandlerString ] = GetMediaDescr()[ aInteractionHandlerString ]; if ( GetMediaDescr().find( aStatusIndicatorString ) != GetMediaDescr().end() ) aAcceptedArgs[ aStatusIndicatorString ] = GetMediaDescr()[ aStatusIndicatorString ]; - if ( GetMediaDescr().find( aFailOnWarningString ) != GetMediaDescr().end() ) - aAcceptedArgs[ aFailOnWarningString ] = GetMediaDescr()[ aFailOnWarningString ]; + if ( GetMediaDescr().find( aFailOnWarningString ) != GetMediaDescr().end() ) + aAcceptedArgs[ aFailOnWarningString ] = GetMediaDescr()[ aFailOnWarningString ]; // remove unacceptable entry if there is any DBG_ASSERT( GetMediaDescr().size() == aAcceptedArgs.size(), @@ -718,15 +714,6 @@ sal_Int8 ModelData_Impl::CheckStateForSave() if ( GetMediaDescr().size() != aAcceptedArgs.size() ) GetMediaDescr() = aAcceptedArgs; - // the document must be modified unless the always-save flag is set. - SvtMiscOptions aMiscOptions; - bool bAlwaysAllowSave = aMiscOptions.IsSaveAlwaysAllowed(); - if (!bAlwaysAllowSave) - { - if ( !GetModifiable()->isModified() && !bVersInfoNeedsStore ) - return STATUS_NO_ACTION; - } - // check that the old filter is acceptable OUString aOldFilterName = GetDocProps().getUnpackedValueOrDefault( aFilterNameString, diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 522976bfe1a9..d27db019168c 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -62,7 +62,6 @@ #include <unotools/useroptions.hxx> #include <unotools/saveopt.hxx> #include <svtools/asynclink.hxx> -#include <svtools/miscopt.hxx> #include <comphelper/documentconstants.hxx> #include <sfx2/app.hxx> @@ -1003,11 +1002,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) } case SID_SAVEDOC: { - SvtMiscOptions aMiscOptions; - bool bAlwaysAllowSave = aMiscOptions.IsSaveAlwaysAllowed(); - bool bAllowSave = (bAlwaysAllowSave || IsModified()); - bool bMediumRO = IsReadOnlyMedium(); - if ( !bMediumRO && GetMedium() && bAllowSave ) + if ( !IsReadOnlyMedium() ) rSet.Put(SfxStringItem( nWhich, SfxResId(STR_SAVEDOC).toString())); else diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 7dbe506431fa..79bf6cc064eb 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1305,7 +1305,6 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { SfxBindings& rBind = GetBindings(); rBind.Invalidate( SID_DOC_MODIFIED ); - rBind.Invalidate( SID_SAVEDOC ); rBind.Invalidate( SID_RELOAD ); rBind.Invalidate( SID_EDITDOC ); break; |