tdf#98745 Optional save button without the dropdown
Change-Id: I66499a9108dce76e661df9b5b45b249caf9eece8
This commit is contained in:
@@ -354,12 +354,14 @@ public:
|
||||
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException ) override;
|
||||
|
||||
private:
|
||||
bool m_bSplitButton;
|
||||
bool m_bModified;
|
||||
css::uno::Reference< css::util::XModifiable > m_xModifiable;
|
||||
};
|
||||
|
||||
SaveToolbarController::SaveToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
|
||||
: ImplInheritanceHelper( rxContext, ".uno:SaveAsMenu" )
|
||||
, m_bSplitButton( true )
|
||||
, m_bModified( false )
|
||||
{
|
||||
}
|
||||
@@ -369,16 +371,21 @@ void SaveToolbarController::initialize( const css::uno::Sequence< css::uno::Any
|
||||
{
|
||||
PopupMenuToolbarController::initialize( aArguments );
|
||||
|
||||
if ( m_sModuleName.endsWith( "RelationDesign" ) )
|
||||
bool bRelationDesignModule = m_sModuleName.endsWith( "RelationDesign" );
|
||||
|
||||
ToolBox* pToolBox = nullptr;
|
||||
sal_uInt16 nId = 0;
|
||||
if ( getToolboxId( nId, &pToolBox )
|
||||
&& ( bRelationDesignModule || pToolBox->GetItemCommand( nId ) != m_aCommandURL ) )
|
||||
{
|
||||
// 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;
|
||||
m_bSplitButton = false;
|
||||
pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~ ToolBoxItemBits::DROPDOWN );
|
||||
}
|
||||
|
||||
if ( bRelationDesignModule )
|
||||
// No modified icon there, just disable the button if there's nothing to save.
|
||||
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 );
|
||||
@@ -421,7 +428,7 @@ void SaveToolbarController::updateImage()
|
||||
css::uno::Reference< css::frame::XStorable > xStorable( m_xModifiable, css::uno::UNO_QUERY );
|
||||
Image aImage;
|
||||
|
||||
if ( xStorable.is() && xStorable->isReadonly() )
|
||||
if ( m_bSplitButton && xStorable.is() && xStorable->isReadonly() )
|
||||
{
|
||||
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( ".uno:SaveAs", bLargeIcons, m_xFrame );
|
||||
}
|
||||
@@ -446,7 +453,7 @@ void SaveToolbarController::statusChanged( const css::frame::FeatureStateEvent&
|
||||
// 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() )
|
||||
if ( m_bSplitButton && xStorable.is() )
|
||||
{
|
||||
ToolBox* pToolBox = nullptr;
|
||||
sal_uInt16 nId = 0;
|
||||
|
@@ -826,6 +826,9 @@ cmd/sc_showgraphics.png cmd/sc_graphic.png
|
||||
cmd/lc_dsbrowserexplorer.png cmd/lc_showfmexplorer.png
|
||||
cmd/sc_dsbrowserexplorer.png cmd/sc_showfmexplorer.png
|
||||
|
||||
cmd/lc_savesimple.png cmd/lc_save.png
|
||||
cmd/sc_savesimple.png cmd/sc_save.png
|
||||
|
||||
# database
|
||||
# ==============================================
|
||||
database/linked_text_table.png cmd/sc_dataimport.png
|
||||
|
@@ -1,3 +1,5 @@
|
||||
cmd/lc_savesimple.png cmd/lc_save.png
|
||||
cmd/sc_savesimple.png cmd/sc_save.png
|
||||
cmd/lc_datastreamsplay.png avmedia/res/avl02049.png
|
||||
cmd/sc_datastreamsplay.png avmedia/res/av02049.png
|
||||
cmd/lc_datastreamsstop.png avmedia/res/avl02051.png
|
||||
|
@@ -1,3 +1,5 @@
|
||||
cmd/lc_savesimple.png cmd/lc_save.png
|
||||
cmd/sc_savesimple.png cmd/sc_save.png
|
||||
cmd/lc_anchormenu.png cmd/lc_toggleanchortype.png
|
||||
cmd/sc_anchormenu.png cmd/sc_toggleanchortype.png
|
||||
|
||||
|
@@ -154,6 +154,10 @@ cmd/sc_insertrowsafter.png cmd/sc_insertrows.png
|
||||
cmd/lc_insertcolumnsafter.png cmd/lc_insertcolumns.png
|
||||
cmd/sc_insertcolumnsafter.png cmd/sc_insertcolumns.png
|
||||
|
||||
# simple save button
|
||||
cmd/lc_savesimple.png cmd/lc_save.png
|
||||
cmd/sc_savesimple.png cmd/sc_save.png
|
||||
|
||||
# anchor menu
|
||||
cmd/lc_anchormenu.png cmd/lc_toggleanchortype.png
|
||||
cmd/sc_anchormenu.png cmd/sc_toggleanchortype.png
|
||||
|
@@ -1,3 +1,5 @@
|
||||
cmd/lc_savesimple.png cmd/lc_save.png
|
||||
cmd/sc_savesimple.png cmd/sc_save.png
|
||||
cmd/sc_showsinglepage.png cmd/sc_adddirect.png
|
||||
res/sx03129.png dbaccess/res/db.png
|
||||
cmd/sc_refresh.png cmd/sc_reload.png
|
||||
|
@@ -103,6 +103,7 @@
|
||||
#define SID_OPENTEMPLATE (SID_SFX_START + 594)
|
||||
#define SID_SAVEASDOC (SID_SFX_START + 502)
|
||||
#define SID_SAVEASREMOTE (SID_SFX_START + 516)
|
||||
#define SID_SAVESIMPLE (SID_SFX_START + 518)
|
||||
#define SID_SAVEACOPY (SID_SFX_START + 999)
|
||||
#define SID_SAVEACOPYITEM (SID_SFX_START + 998)
|
||||
#define SID_CLOSING (SID_SFX_START +1539)
|
||||
|
@@ -2141,6 +2141,17 @@
|
||||
<value>1</value>
|
||||
</prop>
|
||||
</node>
|
||||
<node oor:name=".uno:SaveSimple" oor:op="replace">
|
||||
<prop oor:name="Label" oor:type="xs:string">
|
||||
<value xml:lang="en-US">Save Document</value>
|
||||
</prop>
|
||||
<prop oor:name="Properties" oor:type="xs:int">
|
||||
<value>1</value>
|
||||
</prop>
|
||||
<prop oor:name="TargetURL" oor:type="xs:string">
|
||||
<value>.uno:Save</value>
|
||||
</prop>
|
||||
</node>
|
||||
<node oor:name=".uno:BezierInsert" oor:op="replace">
|
||||
<prop oor:name="Label" oor:type="xs:string">
|
||||
<value xml:lang="en-US">Insert Points</value>
|
||||
|
@@ -124,6 +124,7 @@ interface OfficeDocument : Document
|
||||
ExecMethod = ExecProps_Impl ;
|
||||
StateMethod = GetState_Impl ;
|
||||
]
|
||||
SID_SAVESIMPLE []
|
||||
SID_SAVEDOC // ole(req) api(final/play/rec)
|
||||
[
|
||||
ExecMethod = ExecFile_Impl ;
|
||||
|
@@ -3563,6 +3563,21 @@ SfxVoidItem RunBasic SID_BASICRUN
|
||||
GroupId = GID_MACRO;
|
||||
]
|
||||
|
||||
SfxVoidItem SaveSimple SID_SAVESIMPLE
|
||||
[
|
||||
AutoUpdate = FALSE,
|
||||
FastCall = FALSE,
|
||||
ReadOnlyDoc = FALSE,
|
||||
Toggle = FALSE,
|
||||
Container = TRUE,
|
||||
RecordAbsolute = FALSE,
|
||||
NoRecord;
|
||||
|
||||
AccelConfig = TRUE,
|
||||
MenuConfig = TRUE,
|
||||
ToolBoxConfig = TRUE,
|
||||
GroupId = GID_DOCUMENT;
|
||||
]
|
||||
|
||||
SfxBoolItem Save SID_SAVEDOC
|
||||
(SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem Author SID_DOCINFO_AUTHOR)
|
||||
|
Reference in New Issue
Block a user