summaryrefslogtreecommitdiff
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
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>
-rw-r--r--cui/source/options/optgdlg.cxx11
-rw-r--r--cui/source/options/optgdlg.hxx1
-rw-r--r--cui/uiconfig/ui/optgeneralpage.ui70
-rw-r--r--dbaccess/source/core/dataaccess/intercept.cxx54
-rw-r--r--dbaccess/source/core/dataaccess/intercept.hxx8
-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
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx159
-rw-r--r--icon-themes/tango/links.txt4
-rw-r--r--include/svtools/miscopt.hxx3
-rw-r--r--officecfg/registry/data/org/openoffice/Setup.xcu1
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs7
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx8
-rw-r--r--sc/source/ui/unoobj/docuno.cxx4
-rw-r--r--sc/uiconfig/scalc/toolbar/standardbar.xml2
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx4
-rw-r--r--sd/uiconfig/sdraw/toolbar/standardbar.xml2
-rw-r--r--sd/uiconfig/simpress/toolbar/standardbar.xml2
-rw-r--r--sfx2/sdi/sfx.sdi2
-rw-r--r--sfx2/source/doc/guisaveas.cxx17
-rw-r--r--sfx2/source/doc/objserv.cxx7
-rw-r--r--sfx2/source/view/viewfrm.cxx1
-rw-r--r--svtools/source/config/miscopt.cxx42
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx4
-rw-r--r--sw/uiconfig/sglobal/toolbar/standardbar.xml2
-rw-r--r--sw/uiconfig/sweb/toolbar/standardbar.xml2
-rw-r--r--sw/uiconfig/swform/toolbar/standardbar.xml2
-rw-r--r--sw/uiconfig/swreport/toolbar/standardbar.xml2
-rw-r--r--sw/uiconfig/swriter/toolbar/standardbar.xml2
-rw-r--r--sw/uiconfig/swxform/toolbar/standardbar.xml2
32 files changed, 188 insertions, 254 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index dfb517f93667..52fc00c996a0 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -273,7 +273,6 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
get(m_pFileDlgROImage, "lockimage");
get(m_pPrintDlgCB, "printdlg");
get(m_pDocStatusCB, "docstatus");
- get(m_pSaveAlwaysCB, "savealways");
get(m_pYearFrame, "yearframe");
get(m_pYearValueField, "year");
get(m_pToYearFT, "toyear");
@@ -309,7 +308,6 @@ void OfaMiscTabPage::dispose()
m_pFileDlgCB.clear();
m_pPrintDlgCB.clear();
m_pDocStatusCB.clear();
- m_pSaveAlwaysCB.clear();
m_pYearFrame.clear();
m_pYearValueField.clear();
m_pToYearFT.clear();
@@ -352,13 +350,6 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
bModified = true;
}
- if ( m_pSaveAlwaysCB->IsValueChangedFromSaved() )
- {
- SvtMiscOptions aMiscOpt;
- aMiscOpt.SetSaveAlwaysAllowed( m_pSaveAlwaysCB->IsChecked() );
- bModified = true;
- }
-
const SfxUInt16Item* pUInt16Item = dynamic_cast< const SfxUInt16Item* >( GetOldItem( *rSet, SID_ATTR_YEAR2000 ) );
sal_uInt16 nNum = (sal_uInt16)m_pYearValueField->GetText().toInt32();
if ( pUInt16Item && pUInt16Item->GetValue() != nNum )
@@ -389,8 +380,6 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet )
m_pFileDlgCB->SaveValue();
m_pPrintDlgCB->Check( !aMiscOpt.UseSystemPrintDialog() );
m_pPrintDlgCB->SaveValue();
- m_pSaveAlwaysCB->Check( aMiscOpt.IsSaveAlwaysAllowed() );
- m_pSaveAlwaysCB->SaveValue();
SvtPrintWarningOptions aPrintOptions;
m_pDocStatusCB->Check(aPrintOptions.IsModifyDocumentOnPrintingAllowed());
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 6bd50151566e..e3274d1b9f99 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -48,7 +48,6 @@ private:
VclPtr<CheckBox> m_pPrintDlgCB;
VclPtr<CheckBox> m_pDocStatusCB;
- VclPtr<CheckBox> m_pSaveAlwaysCB;
VclPtr<VclContainer> m_pYearFrame;
VclPtr<NumericField> m_pYearValueField;
diff --git a/cui/uiconfig/ui/optgeneralpage.ui b/cui/uiconfig/ui/optgeneralpage.ui
index c17ac99f9d83..ac98e80ba79b 100644
--- a/cui/uiconfig/ui/optgeneralpage.ui
+++ b/cui/uiconfig/ui/optgeneralpage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.19.0 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkAdjustment" id="adjustment1">
@@ -53,8 +53,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -87,8 +85,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -102,8 +98,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -124,8 +118,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -167,8 +159,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -184,44 +174,14 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkGrid" id="grid2">
+ <object class="GtkCheckButton" id="docstatus">
+ <property name="label" translatable="yes">_Printing sets "document modified" status</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkCheckButton" id="docstatus">
- <property name="label" translatable="yes">_Printing sets "document modified" status</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="savealways">
- <property name="label" translatable="yes">_Allow to save document even when the document is not modified </property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
</object>
</child>
</object>
@@ -240,8 +200,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -265,16 +223,14 @@
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">_Interpret as years between </property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">year</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -287,8 +243,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -300,8 +254,6 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -322,8 +274,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -365,8 +315,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
diff --git a/dbaccess/source/core/dataaccess/intercept.cxx b/dbaccess/source/core/dataaccess/intercept.cxx
index 09f7ab59fdcd..ef3713e143dd 100644
--- a/dbaccess/source/core/dataaccess/intercept.cxx
+++ b/dbaccess/source/core/dataaccess/intercept.cxx
@@ -22,7 +22,6 @@
#include "dbastrings.hrc"
#include <com/sun/star/embed/EmbedStates.hpp>
-#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <cppuhelper/weak.hxx>
@@ -187,10 +186,6 @@ IMPL_LINK_TYPED( OInterceptor, OnDispatch, void*, _pDispatcher, void )
Reference< XDispatch > xDispatch = m_xSlaveDispatchProvider->queryDispatch(pHelper->aURL, "_self", 0 );
if ( xDispatch.is() )
{
- Reference< css::document::XDocumentEventBroadcaster> xEvtB(m_pContentHolder->getComponent(),UNO_QUERY);
- if ( xEvtB.is() )
- xEvtB->removeDocumentEventListener(this);
-
Reference< XInterface > xKeepContentHolderAlive( *m_pContentHolder );
xDispatch->dispatch( pHelper->aURL,pHelper->aArguments);
}
@@ -240,7 +235,7 @@ void SAL_CALL OInterceptor::addStatusListener(
FeatureStateEvent aStateEvent;
aStateEvent.FeatureURL.Complete = m_aInterceptedURL[DISPATCH_SAVE];
aStateEvent.FeatureDescriptor = "Update";
- aStateEvent.IsEnabled = m_pContentHolder != nullptr && m_pContentHolder->isModified();
+ aStateEvent.IsEnabled = sal_True;
aStateEvent.Requery = sal_False;
Control->statusChanged(aStateEvent);
@@ -251,9 +246,6 @@ void SAL_CALL OInterceptor::addStatusListener(
}
m_pStatCL->addInterface(_URL.Complete,Control);
- Reference< css::document::XDocumentEventBroadcaster> xEvtB(m_pContentHolder->getComponent(),UNO_QUERY);
- if ( xEvtB.is() )
- xEvtB->addDocumentEventListener(this);
}
else
{
@@ -395,50 +387,6 @@ void SAL_CALL OInterceptor::setMasterDispatchProvider(
m_xMasterDispatchProvider = NewSupplier;
}
-void SAL_CALL OInterceptor::documentEventOccured( const css::document::DocumentEvent& Event ) throw (css::uno::RuntimeException, std::exception)
-{
- osl::ResettableMutexGuard _rGuard(m_aMutex);
- if ( m_pStatCL && Event.EventName == "OnModifyChanged" )
- {
- OInterfaceContainerHelper* pListener = m_pStatCL->getContainer(m_aInterceptedURL[DISPATCH_SAVE]);
- if ( pListener )
- {
- FeatureStateEvent aEvt;
- aEvt.FeatureURL.Complete = m_aInterceptedURL[DISPATCH_SAVE];
- aEvt.FeatureDescriptor = "Update";
- Reference<XModifiable> xModel(Event.Source,UNO_QUERY);
- aEvt.IsEnabled = xModel.is() && xModel->isModified();
- aEvt.Requery = sal_False;
-
- Sequence< Reference< XInterface > > aListenerSeq = pListener->getElements();
-
- const Reference< XInterface >* pxIntBegin = aListenerSeq.getConstArray();
- const Reference< XInterface >* pxInt = pxIntBegin + aListenerSeq.getLength();
-
- _rGuard.clear();
- while( pxInt > pxIntBegin )
- {
- try
- {
- while( pxInt > pxIntBegin )
- {
- --pxInt;
- static_cast< XStatusListener* >( pxInt->get() )->statusChanged(aEvt);
- }
- }
- catch( RuntimeException& )
- {
- }
- }
- _rGuard.reset();
- }
- }
-}
-
-void SAL_CALL OInterceptor::disposing( const css::lang::EventObject& /*Source*/ ) throw (css::uno::RuntimeException, std::exception)
-{
-}
-
} // namespace dbaccess
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/dataaccess/intercept.hxx b/dbaccess/source/core/dataaccess/intercept.hxx
index 48c8ae002c32..6d80e4f444eb 100644
--- a/dbaccess/source/core/dataaccess/intercept.hxx
+++ b/dbaccess/source/core/dataaccess/intercept.hxx
@@ -25,7 +25,6 @@
#include <cppuhelper/interfacecontainer.hxx>
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
#include <com/sun/star/frame/XInterceptorInfo.hpp>
-#include <com/sun/star/document/XDocumentEventListener.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include "documentdefinition.hxx"
#include <vcl/svapp.hxx>
@@ -36,8 +35,7 @@ namespace dbaccess
class OInterceptor : public ::cppu::WeakImplHelper< css::frame::XDispatchProviderInterceptor,
css::frame::XInterceptorInfo,
- css::frame::XDispatch,
- css::document::XDocumentEventListener>
+ css::frame::XDispatch >
{
DECL_LINK_TYPED( OnDispatch, void*, void );
protected:
@@ -122,10 +120,6 @@ public:
css::uno::RuntimeException, std::exception
) override;
- // XDocumentEventListener
- virtual void SAL_CALL documentEventOccured( const css::document::DocumentEvent& Event ) throw (css::uno::RuntimeException, std::exception) override;
- virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException, std::exception) override;
-
private:
osl::Mutex m_aMutex;
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;
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index cd5931c24144..43b68821cd15 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -21,6 +21,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/propertyvalue.hxx>
+#include <comphelper/propertysequence.hxx>
#include <framework/menuconfiguration.hxx>
#include <rtl/ref.hxx>
#include <svtools/imagemgr.hxx>
@@ -30,6 +31,7 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/urlobj.hxx>
#include <unotools/moduleoptions.hxx>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/svapp.hxx>
#include <vcl/toolbox.hxx>
@@ -38,10 +40,14 @@
#include <com/sun/star/frame/thePopupMenuControllerFactory.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/frame/XSubToolbarController.hpp>
#include <com/sun/star/frame/XUIControllerFactory.hpp>
+#include <com/sun/star/graphic/GraphicProvider.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/ucb/CommandFailedException.hpp>
#include <com/sun/star/ucb/ContentCreationException.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
using namespace framework;
@@ -302,34 +308,175 @@ ToolBoxItemBits GenericPopupToolbarController::getDropDownStyle() const
return m_bSplitButton ? ToolBoxItemBits::DROPDOWN : ToolBoxItemBits::DROPDOWNONLY;
}
-class SaveToolbarController : public PopupMenuToolbarController
+class SaveToolbarController : public cppu::ImplInheritanceHelper< PopupMenuToolbarController,
+ css::frame::XSubToolbarController,
+ css::util::XModifyListener >
{
public:
explicit SaveToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) override;
+
+ // XSubToolbarController
+ // Ugly HACK to cause ToolBarManager ask our controller for updated image, in case of icon theme change.
+ virtual sal_Bool SAL_CALL opensSubToolbar() throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual OUString SAL_CALL getSubToolbarName() throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL functionSelected( const OUString& aCommand ) throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL updateImage() throw ( css::uno::RuntimeException, std::exception ) override;
+
// XStatusListener
virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+ // XModifyListener
+ virtual void SAL_CALL modified( const css::lang::EventObject& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const css::lang::EventObject& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
+
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException ) override;
virtual sal_Bool SAL_CALL supportsService( OUString const & rServiceName ) throw ( css::uno::RuntimeException ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException ) override;
+
+private:
+ css::uno::Reference< css::util::XModifiable > m_xModifiable;
};
SaveToolbarController::SaveToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
- : PopupMenuToolbarController( rxContext, ".uno:SaveAsMenu" )
+ : ImplInheritanceHelper( rxContext, ".uno:SaveAsMenu" )
{
}
-void SaveToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
+void SaveToolbarController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
+ throw ( css::uno::Exception, css::uno::RuntimeException, std::exception )
+{
+ PopupMenuToolbarController::initialize( aArguments );
+
+ if ( m_sModuleName.endsWith( "RelationDesign" ) )
+ {
+ // Should not have the dropdown.
+ ToolBox* pToolBox = nullptr;
+ sal_uInt16 nId = 0;
+ if ( getToolboxId( nId, &pToolBox ) )
+ pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~ ToolBoxItemBits::DROPDOWN );
+ return;
+ }
+
+ css::uno::Reference< css::frame::XController > xController( m_xFrame->getController(), css::uno::UNO_QUERY );
+ if ( xController.is() )
+ m_xModifiable.set( xController->getModel(), css::uno::UNO_QUERY );
+
+ if ( !m_xModifiable.is() )
+ // Can be in table/query design.
+ m_xModifiable.set( xController, css::uno::UNO_QUERY );
+
+ if ( m_xModifiable.is() )
+ m_xModifiable->addModifyListener( this );
+}
+
+sal_Bool SaveToolbarController::opensSubToolbar()
+ throw ( css::uno::RuntimeException, std::exception )
+{
+ return sal_True;
+}
+
+OUString SaveToolbarController::getSubToolbarName()
+ throw ( css::uno::RuntimeException, std::exception )
+{
+ return OUString();
+}
+
+void SaveToolbarController::functionSelected( const OUString& /*aCommand*/ )
+ throw ( css::uno::RuntimeException, std::exception )
+{
+}
+
+void SaveToolbarController::updateImage()
throw ( css::uno::RuntimeException, std::exception )
{
ToolBox* pToolBox = nullptr;
sal_uInt16 nId = 0;
- if ( getToolboxId( nId, &pToolBox ) )
+ if ( !getToolboxId( nId, &pToolBox ) )
+ return;
+
+ bool bLargeIcons = pToolBox->GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE;
+ css::uno::Reference< css::frame::XStorable > xStorable( m_xModifiable, css::uno::UNO_QUERY );
+ Image aImage;
+
+ if ( xStorable.is() && xStorable->isReadonly() )
+ {
+ aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( ".uno:SaveAs", bLargeIcons, m_xFrame );
+ }
+ else if ( m_xModifiable.is() && m_xModifiable->isModified() )
+ {
+ const OUString aImageURL( "private:graphicrepository/res/savemodified_" + ( bLargeIcons ? OUString( "large.png" ) : OUString( "small.png" ) ) );
+ const css::uno::Reference< css::graphic::XGraphicProvider > xGraphicProvider( css::graphic::GraphicProvider::create( m_xContext ) );
+ const css::uno::Reference< css::graphic::XGraphic > xGraphic(
+ xGraphicProvider->queryGraphic( comphelper::InitPropertySequence( { { "URL", css::uno::makeAny( aImageURL ) } } ) ), css::uno::UNO_QUERY );
+ if ( xGraphic.is() )
+ aImage = Image( xGraphic );
+ }
+
+ if ( !aImage )
+ aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( m_aCommandURL, bLargeIcons, m_xFrame );
+
+ if ( !!aImage )
+ pToolBox->SetItemImage( nId, aImage );
+}
+
+void SaveToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
+ throw ( css::uno::RuntimeException, std::exception )
+{
+ css::uno::Reference< css::frame::XStorable > xStorable( m_xModifiable, css::uno::UNO_QUERY );
+
+ // If the model is able to tell us whether we're in read only mode, change the button to save as only mode
+ // based on that. Otherwise just dumbly disable the button (because there could be other reasons why the
+ // save slot is disabled, where save as isn't possible as well).
+ if ( xStorable.is() )
+ {
+ ToolBox* pToolBox = nullptr;
+ sal_uInt16 nId = 0;
+ if ( !getToolboxId( nId, &pToolBox ) )
+ return;
+
+ bool bReadOnly = xStorable->isReadonly();
+ pToolBox->SetQuickHelpText( nId,
+ vcl::CommandInfoProvider::Instance().GetTooltipForCommand( bReadOnly ? OUString( ".uno:SaveAs" ) : m_aCommandURL, m_xFrame ) );
+ pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~( bReadOnly ? ToolBoxItemBits::DROPDOWN : ToolBoxItemBits::DROPDOWNONLY ) );
+ pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ( bReadOnly ? ToolBoxItemBits::DROPDOWNONLY : ToolBoxItemBits::DROPDOWN ) );
+ updateImage();
+ }
+ else
+ PopupMenuToolbarController::statusChanged( rEvent );
+}
+
+void SaveToolbarController::modified( const css::lang::EventObject& /*rEvent*/ )
+ throw ( css::uno::RuntimeException, std::exception )
+{
+ updateImage();
+}
+
+void SaveToolbarController::disposing( const css::lang::EventObject& rEvent )
+ throw ( css::uno::RuntimeException, std::exception )
+{
+ if ( rEvent.Source == m_xModifiable )
+ m_xModifiable.clear();
+ else
+ PopupMenuToolbarController::disposing( rEvent );
+}
+
+void SaveToolbarController::dispose()
+ throw ( css::uno::RuntimeException, std::exception )
+{
+ PopupMenuToolbarController::dispose();
+ if ( m_xModifiable.is() )
{
- pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~( rEvent.IsEnabled ? ToolBoxItemBits::DROPDOWNONLY : ToolBoxItemBits::DROPDOWN ) );
- pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ( rEvent.IsEnabled ? ToolBoxItemBits::DROPDOWN : ToolBoxItemBits::DROPDOWNONLY ) );
+ m_xModifiable->removeModifyListener( this );
+ m_xModifiable.clear();
}
}
diff --git a/icon-themes/tango/links.txt b/icon-themes/tango/links.txt
index ec67d4a1c95c..da1aae395f58 100644
--- a/icon-themes/tango/links.txt
+++ b/icon-themes/tango/links.txt
@@ -537,3 +537,7 @@ cmd/lc_charbackcolor.png cmd/lc_backcolor.png
# Toggle graphics visibility in Writer
cmd/sc_showgraphics.png cmd/sc_insertgraphic.png
cmd/lc_showgraphics.png cmd/lc_insertgraphic.png
+
+# Modified state for the save button
+res/savemodified_small.png cmd/sc_saveas.png
+res/savemodified_large.png cmd/lc_saveas.png
diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx
index d8da7035e364..efc4a530c34c 100644
--- a/include/svtools/miscopt.hxx
+++ b/include/svtools/miscopt.hxx
@@ -90,9 +90,6 @@ class SVT_DLLPUBLIC SvtMiscOptions: public utl::detail::Options
void SetShowLinkWarningDialog( bool bSet );
bool IsShowLinkWarningDialogReadOnly() const;
- void SetSaveAlwaysAllowed( bool bSet );
- bool IsSaveAlwaysAllowed() const;
-
void SetExperimentalMode( bool bSet );
bool IsExperimentalMode() const;
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu
index 2a77ab18b877..94d2c79da758 100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -884,7 +884,6 @@
<it>/org.openoffice.Office.Common/I18N</it>
<it>/org.openoffice.Office.Common/InternalMSExport</it>
<it>/org.openoffice.Office.Common/Load</it>
- <it>/org.openoffice.Office.Common/Misc/AlwaysAllowSave</it>
<it>/org.openoffice.Office.Common/Misc/DisableUICustomization</it>
<it>/org.openoffice.Office.Common/Misc/ExperimentalMode</it>
<it>/org.openoffice.Office.Common/Misc/FormControlPilotsEnabled</it>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index b8d9828ec7ee..1655acb0d1d0 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5606,13 +5606,6 @@
</info>
<value>false</value>
</prop>
- <prop oor:name="AlwaysAllowSave" oor:type="xs:boolean" oor:nillable="false">
- <info>
- <desc>Determines if the user can save the document even when it's not
- modified.</desc>
- </info>
- <value>false</value>
- </prop>
<prop oor:name="ExperimentalMode" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Determines if various experimental, and potentially unstable
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 15b667931407..3f61c9baa961 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -787,11 +787,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
aReturn.aValue <<= getSplitPos();
break;
case SID_SAVEDOC:
- aReturn.bEnabled = impl_isModified() && isEditable();
- break;
case SID_SAVEASDOC:
- aReturn.bEnabled = isConnected() && isEditable();
- break;
case SID_SAVEACOPY:
aReturn.bEnabled = isConnected() && isEditable();
break;
@@ -1175,7 +1171,6 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
UndoContext aUndoContext( getUndoManager(), sUndoAction );
xFunctions->removeByIndex(nIndex);
select(uno::makeAny(xFunctions->getParent()));
- InvalidateFeature( SID_SAVEDOC );
InvalidateFeature( SID_UNDO );
}
}
@@ -2621,7 +2616,6 @@ void OReportController::executeMethodWithUndo(sal_uInt16 _nUndoStrId,const ::std
const OUString sUndoAction = ModuleRes(_nUndoStrId);
UndoContext aUndoContext( getUndoManager(), sUndoAction );
_pMemfun( getDesignView() );
- InvalidateFeature( SID_SAVEDOC );
InvalidateFeature( SID_UNDO );
}
@@ -2630,7 +2624,6 @@ void OReportController::alignControlsWithUndo(sal_uInt16 _nUndoStrId,sal_Int32 _
const OUString sUndoAction = ModuleRes(_nUndoStrId);
UndoContext aUndoContext( getUndoManager(), sUndoAction );
getDesignView()->alignMarkedObjects(_nControlModification,_bAlignAtSection);
- InvalidateFeature( SID_SAVEDOC );
InvalidateFeature( SID_UNDO );
}
@@ -2724,7 +2717,6 @@ void OReportController::shrinkSection(sal_uInt16 _nUndoStrId, uno::Reference<rep
}
}
- InvalidateFeature( SID_SAVEDOC );
InvalidateFeature( SID_UNDO );
}
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index c57f911a5771..7a7b0644ef5e 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -44,7 +44,6 @@
#include <tools/multisel.hxx>
#include <tools/resary.hxx>
#include <toolkit/awt/vclxdevice.hxx>
-#include <svtools/miscopt.hxx>
#include <ctype.h>
#include <float.h>
@@ -941,9 +940,6 @@ void ScModelObj::initializeForTiledRendering(const css::uno::Sequence<css::beans
aInputOptions.SetTextWysiwyg(true);
SC_MOD()->SetInputOptions(aInputOptions);
pDocShell->CalcOutputFactor();
- // tdf#93154: in tiled rendering LO doesn't always detect changes
- SvtMiscOptions aMiscOpt;
- aMiscOpt.SetSaveAlwaysAllowed(true);
// default tile size in pixels
nTilePixelWidth = 256;
diff --git a/sc/uiconfig/scalc/toolbar/standardbar.xml b/sc/uiconfig/scalc/toolbar/standardbar.xml
index 503126fca809..c3d5c5d3ba7e 100644
--- a/sc/uiconfig/scalc/toolbar/standardbar.xml
+++ b/sc/uiconfig/scalc/toolbar/standardbar.xml
@@ -24,7 +24,7 @@
<toolbar:toolbaritem xlink:href=".uno:OpenFromCalc"/>
<toolbar:toolbaritem xlink:href=".uno:OpenRemote" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Save"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:visible="false"/>
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index e301986eb25c..6e23890be488 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -60,7 +60,6 @@
#include <editeng/unolingu.hxx>
#include <svx/svdpagv.hxx>
#include <svtools/unoimap.hxx>
-#include <svtools/miscopt.hxx>
#include <svx/unoshape.hxx>
#include <editeng/unonrule.hxx>
#include <editeng/eeitem.hxx>
@@ -2386,9 +2385,6 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs
// by the tile being rerendered - which is wasteful and ugly).
pViewShell->GetDrawView()->SetSwapAsynchron(false);
}
- // tdf#93154: in tiled rendering LO doesn't always detect changes
- SvtMiscOptions aMiscOpt;
- aMiscOpt.SetSaveAlwaysAllowed(true);
}
void SdXImpressDocument::registerCallback(LibreOfficeKitCallback pCallback, void* pData)
diff --git a/sd/uiconfig/sdraw/toolbar/standardbar.xml b/sd/uiconfig/sdraw/toolbar/standardbar.xml
index e9a5fdcf7c64..6894887743a7 100644
--- a/sd/uiconfig/sdraw/toolbar/standardbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/standardbar.xml
@@ -24,7 +24,7 @@
<toolbar:toolbaritem xlink:href=".uno:Open"/>
<toolbar:toolbaritem xlink:href=".uno:OpenRemote" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/>
diff --git a/sd/uiconfig/simpress/toolbar/standardbar.xml b/sd/uiconfig/simpress/toolbar/standardbar.xml
index 4ab079c67be9..64a42e8a567f 100644
--- a/sd/uiconfig/simpress/toolbar/standardbar.xml
+++ b/sd/uiconfig/simpress/toolbar/standardbar.xml
@@ -24,7 +24,7 @@
<toolbar:toolbaritem xlink:href=".uno:Open"/>
<toolbar:toolbaritem xlink:href=".uno:OpenRemote" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Save"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:visible="false"/>
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;
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index 5df1acf4a7a0..fb2a3160856e 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -58,12 +58,10 @@ using namespace ::com::sun::star;
#define PROPERTYHANDLE_SHOWLINKWARNINGDIALOG 6
#define PROPERTYNAME_DISABLEUICUSTOMIZATION "DisableUICustomization"
#define PROPERTYHANDLE_DISABLEUICUSTOMIZATION 7
-#define PROPERTYNAME_ALWAYSALLOWSAVE "AlwaysAllowSave"
-#define PROPERTYHANDLE_ALWAYSALLOWSAVE 8
#define PROPERTYNAME_EXPERIMENTALMODE "ExperimentalMode"
-#define PROPERTYHANDLE_EXPERIMENTALMODE 9
+#define PROPERTYHANDLE_EXPERIMENTALMODE 8
#define PROPERTYNAME_MACRORECORDERMODE "MacroRecorderMode"
-#define PROPERTYHANDLE_MACRORECORDERMODE 10
+#define PROPERTYHANDLE_MACRORECORDERMODE 9
#define VCL_TOOLBOX_STYLE_FLAT ((sal_uInt16)0x0004) // from <vcl/toolbox.hxx>
@@ -85,7 +83,6 @@ private:
bool m_bShowLinkWarningDialog;
bool m_bIsShowLinkWarningDialogRO;
bool m_bDisableUICustomization;
- bool m_bAlwaysAllowSave;
bool m_bExperimentalMode;
bool m_bMacroRecorderMode;
bool m_bIconThemeWasSetAutomatically;
@@ -131,12 +128,6 @@ public:
inline bool DisableUICustomization() const
{ return m_bDisableUICustomization; }
- inline void SetSaveAlwaysAllowed( bool bSet )
- { m_bAlwaysAllowSave = bSet; SetModified(); }
-
- inline bool IsSaveAlwaysAllowed() const
- { return m_bAlwaysAllowSave; }
-
inline void SetExperimentalMode( bool bSet )
{ m_bExperimentalMode = bSet; SetModified(); }
@@ -241,7 +232,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
, m_bIsUseSystemPrintDialogRO( false )
, m_bShowLinkWarningDialog( true )
, m_bIsShowLinkWarningDialogRO( false )
- , m_bAlwaysAllowSave( false )
, m_bExperimentalMode( false )
, m_bMacroRecorderMode( false )
, m_bIconThemeWasSetAutomatically( false )
@@ -343,12 +333,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
OSL_FAIL("Wrong type of \"Misc\\DisableUICustomization\"!" );
break;
}
- case PROPERTYHANDLE_ALWAYSALLOWSAVE :
- {
- if( !(seqValues[nProperty] >>= m_bAlwaysAllowSave) )
- OSL_FAIL("Wrong type of \"Misc\\AlwaysAllowSave\"!" );
- break;
- }
case PROPERTYHANDLE_EXPERIMENTALMODE :
{
if( !(seqValues[nProperty] >>= m_bExperimentalMode) )
@@ -461,12 +445,6 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames )
OSL_FAIL("Wrong type of \"Misc\\DisableUICustomization\"!" );
}
break;
- case PROPERTYHANDLE_ALWAYSALLOWSAVE:
- {
- if( !(seqValues[nProperty] >>= m_bAlwaysAllowSave) )
- OSL_FAIL("Wrong type of \"Misc\\AlwaysAllowSave\"!" );
- }
- break;
}
}
}
@@ -624,11 +602,6 @@ void SvtMiscOptions_Impl::ImplCommit()
seqValues[nProperty] <<= m_bDisableUICustomization;
break;
}
- case PROPERTYHANDLE_ALWAYSALLOWSAVE :
- {
- seqValues[nProperty] <<= m_bAlwaysAllowSave;
- break;
- }
case PROPERTYHANDLE_EXPERIMENTALMODE :
{
seqValues[nProperty] <<= m_bExperimentalMode;
@@ -661,7 +634,6 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames()
OUString(PROPERTYNAME_USESYSTEMPRINTDIALOG),
OUString(PROPERTYNAME_SHOWLINKWARNINGDIALOG),
OUString(PROPERTYNAME_DISABLEUICUSTOMIZATION),
- OUString(PROPERTYNAME_ALWAYSALLOWSAVE),
OUString(PROPERTYNAME_EXPERIMENTALMODE),
OUString(PROPERTYNAME_MACRORECORDERMODE)
};
@@ -821,16 +793,6 @@ bool SvtMiscOptions::IsShowLinkWarningDialogReadOnly() const
return m_pDataContainer->IsShowLinkWarningDialogReadOnly();
}
-void SvtMiscOptions::SetSaveAlwaysAllowed( bool bSet )
-{
- m_pDataContainer->SetSaveAlwaysAllowed( bSet );
-}
-
-bool SvtMiscOptions::IsSaveAlwaysAllowed() const
-{
- return m_pDataContainer->IsSaveAlwaysAllowed();
-}
-
void SvtMiscOptions::SetExperimentalMode( bool bSet )
{
m_pDataContainer->SetExperimentalMode( bSet );
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 1aea89385902..26f9b694eecd 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -137,7 +137,6 @@
#include <PostItMgr.hxx>
#include <svtools/langtab.hxx>
-#include <svtools/miscopt.hxx>
#include <map>
#include <set>
#include <vector>
@@ -3233,9 +3232,6 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::
// directly in twips.
SwEditWin& rEditWin = pDocShell->GetView()->GetEditWin();
rEditWin.EnableMapMode(false);
- // tdf#93154: in tiled rendering LO doesn't always detect changes
- SvtMiscOptions aMiscOpt;
- aMiscOpt.SetSaveAlwaysAllowed(true);
}
void SwXTextDocument::registerCallback(LibreOfficeKitCallback pCallback, void* pData)
diff --git a/sw/uiconfig/sglobal/toolbar/standardbar.xml b/sw/uiconfig/sglobal/toolbar/standardbar.xml
index bdbd1858b79b..7af5a5047579 100644
--- a/sw/uiconfig/sglobal/toolbar/standardbar.xml
+++ b/sw/uiconfig/sglobal/toolbar/standardbar.xml
@@ -23,7 +23,7 @@
<toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/>
<toolbar:toolbaritem xlink:href=".uno:Open"/>
<toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/>
diff --git a/sw/uiconfig/sweb/toolbar/standardbar.xml b/sw/uiconfig/sweb/toolbar/standardbar.xml
index 14a0048543b6..be11b5b1ee6f 100644
--- a/sw/uiconfig/sweb/toolbar/standardbar.xml
+++ b/sw/uiconfig/sweb/toolbar/standardbar.xml
@@ -23,7 +23,7 @@
<toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/>
<toolbar:toolbaritem xlink:href=".uno:Open"/>
<toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/>
diff --git a/sw/uiconfig/swform/toolbar/standardbar.xml b/sw/uiconfig/swform/toolbar/standardbar.xml
index bdbd1858b79b..7af5a5047579 100644
--- a/sw/uiconfig/swform/toolbar/standardbar.xml
+++ b/sw/uiconfig/swform/toolbar/standardbar.xml
@@ -23,7 +23,7 @@
<toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/>
<toolbar:toolbaritem xlink:href=".uno:Open"/>
<toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/>
diff --git a/sw/uiconfig/swreport/toolbar/standardbar.xml b/sw/uiconfig/swreport/toolbar/standardbar.xml
index bdbd1858b79b..7af5a5047579 100644
--- a/sw/uiconfig/swreport/toolbar/standardbar.xml
+++ b/sw/uiconfig/swreport/toolbar/standardbar.xml
@@ -23,7 +23,7 @@
<toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/>
<toolbar:toolbaritem xlink:href=".uno:Open"/>
<toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/>
diff --git a/sw/uiconfig/swriter/toolbar/standardbar.xml b/sw/uiconfig/swriter/toolbar/standardbar.xml
index 6d36cc0f2583..b917956080b4 100644
--- a/sw/uiconfig/swriter/toolbar/standardbar.xml
+++ b/sw/uiconfig/swriter/toolbar/standardbar.xml
@@ -24,7 +24,7 @@
<toolbar:toolbaritem xlink:href=".uno:OpenFromWriter"/>
<toolbar:toolbaritem xlink:href=".uno:OpenRemote" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/>
diff --git a/sw/uiconfig/swxform/toolbar/standardbar.xml b/sw/uiconfig/swxform/toolbar/standardbar.xml
index de7a044b0eeb..8368721c821e 100644
--- a/sw/uiconfig/swxform/toolbar/standardbar.xml
+++ b/sw/uiconfig/swxform/toolbar/standardbar.xml
@@ -23,7 +23,7 @@
<toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/>
<toolbar:toolbaritem xlink:href=".uno:Open"/>
<toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/>