diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 0762279bf3db..5b3a2043e63b 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -754,6 +754,14 @@
false
+
+
+
+ Press Enter to paste and clear clipboard
+
+
+ true
+
diff --git a/sc/inc/inputopt.hxx b/sc/inc/inputopt.hxx
index 4cff5d14cf48..52811ee93c5c 100644
--- a/sc/inc/inputopt.hxx
+++ b/sc/inc/inputopt.hxx
@@ -38,6 +38,7 @@ private:
bool bTextWysiwyg;
bool bReplCellsWarn;
bool bLegacyCellSelection;
+ bool bEnterPasteMode;
public:
ScInputOptions();
@@ -68,6 +69,8 @@ public:
bool GetReplaceCellsWarn() const { return bReplCellsWarn; }
void SetLegacyCellSelection(bool bSet) { bLegacyCellSelection = bSet; }
bool GetLegacyCellSelection() const { return bLegacyCellSelection; }
+ void SetEnterPasteMode(bool bSet) { bEnterPasteMode = bSet; }
+ bool GetEnterPasteMode() const { return bEnterPasteMode; }
};
// CfgItem for input options
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index b493545ec810..e80825624dea 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -113,6 +113,8 @@
// misc:
#define SID_LINKS (SC_VIEW_START + 60)
#define SID_INSERT_SMATH (SC_VIEW_START + 63)
+// Put this here since all available slots for "SC_INPUT" are taken
+#define SID_SC_INPUT_ENTER_PASTE_MODE (SC_VIEW_START + 64)
#define SID_MIRROR_VERTICAL (SC_VIEW_START + 65)
#define SID_MIRROR_HORIZONTAL (SC_VIEW_START + 66)
#define SID_CELL_FORMAT_RESET (SC_VIEW_START + 67)
diff --git a/sc/source/core/tool/inputopt.cxx b/sc/source/core/tool/inputopt.cxx
index 0ceefd1fa9f1..380c4391f307 100644
--- a/sc/source/core/tool/inputopt.cxx
+++ b/sc/source/core/tool/inputopt.cxx
@@ -69,6 +69,7 @@ void ScInputOptions::SetDefaults()
#define SCINPUTOPT_TEXTWYSIWYG 9
#define SCINPUTOPT_REPLCELLSWARN 10
#define SCINPUTOPT_LEGACY_CELL_SELECTION 11
+#define SCINPUTOPT_ENTER_PASTE_MODE 12
Sequence ScInputCfg::GetPropertyNames()
{
@@ -83,7 +84,8 @@ Sequence ScInputCfg::GetPropertyNames()
"UseTabCol", // SCINPUTOPT_USETABCOL
"UsePrinterMetrics", // SCINPUTOPT_TEXTWYSIWYG
"ReplaceCellsWarning", // SCINPUTOPT_REPLCELLSWARN
- "LegacyCellSelection"}; // SCINPUTOPT_LEGACY_CELL_SELECTION
+ "LegacyCellSelection", // SCINPUTOPT_LEGACY_CELL_SELECTION
+ "EnterPasteMode"}; // SCINPUTOPT_ENTER_PASTE_MODE
}
ScInputCfg::ScInputCfg() :
@@ -142,6 +144,9 @@ ScInputCfg::ScInputCfg() :
case SCINPUTOPT_LEGACY_CELL_SELECTION:
SetLegacyCellSelection( ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) );
break;
+ case SCINPUTOPT_ENTER_PASTE_MODE:
+ SetEnterPasteMode( ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) );
+ break;
}
}
}
@@ -193,6 +198,9 @@ void ScInputCfg::ImplCommit()
case SCINPUTOPT_LEGACY_CELL_SELECTION:
pValues[nProp] <<= GetLegacyCellSelection();
break;
+ case SCINPUTOPT_ENTER_PASTE_MODE:
+ pValues[nProp] <<= GetEnterPasteMode();
+ break;
}
}
PutProperties(aNames, aValues);
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index d39c9df9a683..f0a992e774bf 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1194,6 +1194,12 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
bSaveInputOptions = true;
}
+ if( rOptSet.HasItem( SID_SC_INPUT_ENTER_PASTE_MODE, &pItem ) )
+ {
+ m_pInputCfg->SetEnterPasteMode( static_cast(pItem)->GetValue() );
+ bSaveInputOptions = true;
+ }
+
// PrintOptions
if ( rOptSet.HasItem(SID_SCPRINTOPTIONS,&pItem) )
{
@@ -1879,6 +1885,8 @@ std::unique_ptr ScModule::CreateItemSet( sal_uInt16 nId )
SID_SCFORMULAOPTIONS, SID_SCDEFAULTSOPTIONS,
// TP_VIEW, TP_CALC:
SID_SCVIEWOPTIONS, SID_SCDOCOPTIONS,
+ // TP_INPUT:
+ SID_SC_INPUT_ENTER_PASTE_MODE, SID_SC_INPUT_ENTER_PASTE_MODE,
// TP_PRINT:
SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS,
// TP_INPUT:
@@ -1940,6 +1948,8 @@ std::unique_ptr ScModule::CreateItemSet( sal_uInt16 nId )
rInpOpt.GetReplaceCellsWarn() ) );
pRet->Put( SfxBoolItem( SID_SC_INPUT_LEGACY_CELL_SELECTION,
rInpOpt.GetLegacyCellSelection() ) );
+ pRet->Put( SfxBoolItem( SID_SC_INPUT_ENTER_PASTE_MODE,
+ rInpOpt.GetEnterPasteMode() ) );
// RID_SC_TP_PRINT
pRet->Put( ScTpPrintItem( GetPrintOptions() ) );
diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx
index bed1e1325e69..eed889eda4e5 100644
--- a/sc/source/ui/inc/tpview.hxx
+++ b/sc/source/ui/inc/tpview.hxx
@@ -94,6 +94,7 @@ class ScTpLayoutOptions : public SfxTabPage
std::unique_ptr m_xTextFmtCB;
std::unique_ptr m_xReplWarnCB;
std::unique_ptr m_xLegacyCellSelectionCB;
+ std::unique_ptr m_xEnterPasteModeCB;
DECL_LINK(MetricHdl, weld::ComboBox&, void );
DECL_LINK( AlignHdl, weld::ToggleButton&, void );
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 3e544ebaaa92..bf1db08d8cb3 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -318,6 +318,7 @@ ScTpLayoutOptions::ScTpLayoutOptions(weld::Container* pPage, weld::DialogControl
, m_xTextFmtCB(m_xBuilder->weld_check_button("textfmtcb"))
, m_xReplWarnCB(m_xBuilder->weld_check_button("replwarncb"))
, m_xLegacyCellSelectionCB(m_xBuilder->weld_check_button("legacy_cell_selection_cb"))
+ , m_xEnterPasteModeCB(m_xBuilder->weld_check_button("enter_paste_mode_cb"))
{
SetExchangeSupport();
@@ -463,6 +464,12 @@ bool ScTpLayoutOptions::FillItemSet( SfxItemSet* rCoreSet )
bRet = true;
}
+ if (m_xEnterPasteModeCB->get_state_changed_from_saved())
+ {
+ rCoreSet->Put( SfxBoolItem( SID_SC_INPUT_ENTER_PASTE_MODE, m_xEnterPasteModeCB->get_active() ) );
+ bRet = true;
+ }
+
return bRet;
}
@@ -547,6 +554,9 @@ void ScTpLayoutOptions::Reset( const SfxItemSet* rCoreSet )
if( SfxItemState::SET == rCoreSet->GetItemState( SID_SC_INPUT_LEGACY_CELL_SELECTION, false, &pItem ) )
m_xLegacyCellSelectionCB->set_active( static_cast(pItem)->GetValue() );
+ if( SfxItemState::SET == rCoreSet->GetItemState( SID_SC_INPUT_ENTER_PASTE_MODE, false, &pItem ) )
+ m_xEnterPasteModeCB->set_active( static_cast(pItem)->GetValue() );
+
m_xAlignCB->save_state();
m_xAlignLB->save_value();
m_xEditModeCB->save_state();
@@ -559,6 +569,7 @@ void ScTpLayoutOptions::Reset( const SfxItemSet* rCoreSet )
m_xReplWarnCB->save_state();
m_xLegacyCellSelectionCB->save_state();
+ m_xEnterPasteModeCB->save_state();
AlignHdl(*m_xAlignCB);
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index f15418a4e998..34d3ed07be21 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -123,6 +123,7 @@
#include
#include
#include
+#include
#include
#include
@@ -3250,7 +3251,8 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt)
mrViewData.GetViewShell()->SelectionChanged();
return ;
}
- else if( rKeyCode.GetCode() == KEY_RETURN && mrViewData.IsPasteMode() )
+ else if( rKeyCode.GetCode() == KEY_RETURN && mrViewData.IsPasteMode()
+ && SC_MOD()->GetInputOptions().GetEnterPasteMode() )
{
ScTabViewShell* pTabViewShell = mrViewData.GetViewShell();
ScClipUtil::PasteFromClipboard( &mrViewData, pTabViewShell, true );
@@ -5781,6 +5783,8 @@ void ScGridWindow::UpdateCopySourceOverlay()
return;
if (!mrViewData.ShowPasteSource())
return;
+ if (!SC_MOD()->GetInputOptions().GetEnterPasteMode())
+ return;
rtl::Reference xOverlayManager = getOverlayManager();
if (!xOverlayManager.is())
return;
diff --git a/sc/uiconfig/scalc/ui/scgeneralpage.ui b/sc/uiconfig/scalc/ui/scgeneralpage.ui
index d815895cc037..4d9a80a40c75 100644
--- a/sc/uiconfig/scalc/ui/scgeneralpage.ui
+++ b/sc/uiconfig/scalc/ui/scgeneralpage.ui
@@ -265,7 +265,7 @@
0
- 2
+ 3
2
@@ -286,7 +286,7 @@
0
- 3
+ 4
2
@@ -345,7 +345,7 @@
0
- 8
+ 9
2
@@ -366,7 +366,23 @@
0
- 7
+ 8
+ 2
+
+
+
+
+
+ 0
+ 2
2
@@ -386,7 +402,7 @@
0
- 6
+ 7
2
@@ -407,7 +423,7 @@
0
- 5
+ 6
2
@@ -422,7 +438,7 @@
0
- 4
+ 5
2