summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2015-12-22 13:12:23 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2016-01-12 12:46:31 -0600
commit677197b3459df2c89be32595e0cb1b8b3e144c69 (patch)
tree370561ff6bb70aa54052d1cf95081792f894de19 /sfx2
parentfeebc5953fb416c5dc8cdf8c7e924a9ff9c70f17 (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. Reviewed-on: https://gerrit.libreoffice.org/20839 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Maxim Monastirsky <momonasmon@gmail.com> (cherry picked from commit 22328a224df4619218b88205838307f70612207e) loplugin:unreffun (cherry picked from commit ea708936c4684668f9aefc3ce9ec2001dbd4bdf2) Change-Id: I56c169bf48b78faaf53c2989ce8624f8297ffb6e Tango: Update Save icons and support “savemodified” status Change-Id: I03589895437907b9048542f07128801577fe62dc (cherry picked from commit a7198d38f0294ab5db04a7f4457565ea8b2c32f1) Reviewed-on: https://gerrit.libreoffice.org/21260 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Jenkins <ci@libreoffice.org> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/sdi/sfx.sdi2
-rw-r--r--sfx2/source/doc/guisaveas.cxx32
-rw-r--r--sfx2/source/doc/objserv.cxx7
-rw-r--r--sfx2/source/view/viewfrm.cxx1
4 files changed, 4 insertions, 38 deletions
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index f151bc78fd9c..b5c9e3edb25d 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -4939,7 +4939,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..ddf888c6c841 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -257,7 +257,6 @@ class ModelData_Impl
uno::Reference< frame::XModel > m_xModel;
uno::Reference< frame::XStorable > m_xStorable;
uno::Reference< frame::XStorable2 > m_xStorable2;
- uno::Reference< util::XModifiable > m_xModifiable;
OUString m_aModuleName;
::comphelper::SequenceAsHashMap* m_pDocumentPropsHM;
@@ -279,7 +278,6 @@ public:
uno::Reference< frame::XModel > GetModel();
uno::Reference< frame::XStorable > GetStorable();
uno::Reference< frame::XStorable2 > GetStorable2();
- uno::Reference< util::XModifiable > GetModifiable();
::comphelper::SequenceAsHashMap& GetMediaDescr() { return m_aMediaDescrHM; }
@@ -419,19 +417,6 @@ uno::Reference< frame::XStorable2 > ModelData_Impl::GetStorable2()
}
-uno::Reference< util::XModifiable > ModelData_Impl::GetModifiable()
-{
- if ( !m_xModifiable.is() )
- {
- m_xModifiable.set( m_xModel, uno::UNO_QUERY );
- if ( !m_xModifiable.is() )
- throw uno::RuntimeException();
- }
-
- return m_xModifiable;
-}
-
-
const ::comphelper::SequenceAsHashMap& ModelData_Impl::GetDocProps()
{
if ( !m_pDocumentPropsHM )
@@ -689,7 +674,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 +683,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 +699,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 1534261dd592..33365ec9e747 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1320,7 +1320,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;