summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2015-12-22 13:12:23 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2015-12-23 09:38:25 +0000
commit22328a224df4619218b88205838307f70612207e (patch)
tree251c9aaf8ab1b1db5cf80af9c8644d6cacd6d897 /dbaccess/source/ui
parent2351fd5d489fde281e8d1ef97af747149a29c247 (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 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/app/AppController.cxx3
-rw-r--r--dbaccess/source/ui/app/AppController.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx10
4 files changed, 5 insertions, 12 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 01a8f9435612..5d1d893e3775 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -599,7 +599,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
aReturn.bEnabled = true;
break;
case ID_BROWSER_SAVEDOC:
- aReturn.bEnabled = !isDataSourceReadOnly() && m_xDocumentModify.is() && m_xDocumentModify->isModified();
+ aReturn.bEnabled = !isDataSourceReadOnly();
break;
case ID_BROWSER_SAVEASDOC:
aReturn.bEnabled = true;
@@ -2659,7 +2659,6 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
}
m_xModel = _rxModel;
- m_xDocumentModify = xDocModify;
m_xDataSource.set( xOfficeDoc.is() ? xOfficeDoc->getDataSource() : Reference< XDataSource >(), UNO_QUERY );
// connect to new model
diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx
index cc7bcf1ac543..ad9cafae96dc 100644
--- a/dbaccess/source/ui/app/AppController.hxx
+++ b/dbaccess/source/ui/app/AppController.hxx
@@ -99,8 +99,6 @@ namespace dbaui
m_xDataSource;
css::uno::Reference< css::frame::XModel >
m_xModel;
- css::uno::Reference< css::util::XModifiable >
- m_xDocumentModify;
::cppu::OInterfaceContainerHelper
m_aContextMenuInterceptors;
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 52c76f11ab38..cc9b7d8b4c39 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -496,7 +496,7 @@ FeatureState OQueryController::GetState(sal_uInt16 _nId) const
aReturn.bEnabled = !editingCommand() && !editingView() && (!m_bGraphicalDesign || !(m_vTableFieldDesc.empty() || m_vTableData.empty()));
break;
case ID_BROWSER_SAVEDOC:
- aReturn.bEnabled = impl_isModified() && (!m_bGraphicalDesign || !(m_vTableFieldDesc.empty() || m_vTableData.empty()));
+ aReturn.bEnabled = isEditable() && (!m_bGraphicalDesign || !(m_vTableFieldDesc.empty() || m_vTableData.empty()));
break;
case SID_PRINTDOCDIRECT:
break;
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 26e48f5e5b0f..2feca27ed36e 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -190,15 +190,10 @@ FeatureState OTableController::GetState(sal_uInt16 _nId) const
break;
case ID_BROWSER_EDITDOC:
aReturn.bChecked = isEditable();
- aReturn.bEnabled = m_bNew || isEditable();// the editable flag is set through this one -> || isAddAllowed() || isDropAllowed() || isAlterAllowed();
+ aReturn.bEnabled = true;
break;
case ID_BROWSER_SAVEDOC:
- aReturn.bEnabled = impl_isModified();
- if ( aReturn.bEnabled )
- {
- aReturn.bEnabled = ::std::any_of(m_vRowList.begin(),m_vRowList.end(),
- ::boost::mem_fn(&OTableRow::isValid));
- }
+ aReturn.bEnabled = isEditable() && ::std::any_of(m_vRowList.begin(),m_vRowList.end(),::boost::mem_fn(&OTableRow::isValid));
break;
case ID_BROWSER_SAVEASDOC:
aReturn.bEnabled = isConnected() && isEditable();
@@ -244,6 +239,7 @@ void OTableController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
case ID_BROWSER_EDITDOC:
setEditable(!isEditable());
static_cast<OTableDesignView*>(getView())->setReadOnly(!isEditable());
+ InvalidateFeature(ID_BROWSER_SAVEDOC);
InvalidateFeature(ID_BROWSER_PASTE);
InvalidateFeature(SID_BROWSER_CLEAR_QUERY);
break;