diff options
author | Thomas Viehmann <tv@beamnet.de> | 2014-08-15 00:07:58 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2014-08-14 19:50:27 -0500 |
commit | 6af3bc396eedde71e40c3e8d714a728c8fa881aa (patch) | |
tree | 4593a0c84a353658e58b418efc2f76b779f58f14 /sc | |
parent | ec7ab6356b02d85011485048d0f4d11239d386af (diff) |
fdo#79116 make paste special easier to use
This patch adds three short cut buttons to the calc paste special
dialog: paste values only (numbers, strings, dates), paste values and
formats, and paste transposed.
Change-Id: Ie70fbaa28976b2311b1d9cf53b094a5083fb42d4
Reviewed-on: https://gerrit.libreoffice.org/10928
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/inscodlg.hxx | 19 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/inscodlg.cxx | 76 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/pastespecial.ui | 89 |
3 files changed, 169 insertions, 15 deletions
diff --git a/sc/source/ui/inc/inscodlg.hxx b/sc/source/ui/inc/inscodlg.hxx index 3fd40080c94b..1130daa2ed03 100644 --- a/sc/source/ui/inc/inscodlg.hxx +++ b/sc/source/ui/inc/inscodlg.hxx @@ -37,9 +37,9 @@ public: sal_uInt16 GetInsContentsCmdBits() const; sal_uInt16 GetFormulaCmdBits() const; - bool IsSkipEmptyCells() const {return mpBtnSkipEmptyCells->IsChecked();} - bool IsTranspose() const {return mpBtnTranspose->IsChecked();} - bool IsLink() const {return mpBtnLink->IsChecked();} + bool IsSkipEmptyCells() const; + bool IsTranspose() const; + bool IsLink() const; InsCellCmd GetMoveMode(); void SetOtherDoc( bool bSet ); @@ -71,11 +71,23 @@ private: RadioButton* mpRbMoveDown; RadioButton* mpRbMoveRight; + PushButton* mpBtnShortCutPasteValuesOnly; + PushButton* mpBtnShortCutPasteValuesFormats; + PushButton* mpBtnShortCutPasteTranspose; + bool bOtherDoc; bool bFillMode; bool bChangeTrack; bool bMoveDownDisabled; bool bMoveRightDisabled; + bool bUsedShortCut; + + sal_uInt16 nShortCutInsContentsCmdBits; + sal_uInt16 nShortCutFormulaCmdBits; + bool bShortCutSkipEmptyCells; + bool bShortCutTranspose; + bool bShortCutIsLink; + InsCellCmd nShortCutMoveMode; static bool bPreviousAllCheck; static sal_uInt16 nPreviousChecks; @@ -89,6 +101,7 @@ private: // Handler DECL_LINK( InsAllHdl, void* ); DECL_LINK( LinkBtnHdl, void* ); + DECL_LINK( ShortCutHdl, PushButton* ); }; #endif // INCLUDED_SC_SOURCE_UI_INC_INSCODLG_HXX diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx index 18426b0da703..f35252e84cce 100644 --- a/sc/source/ui/miscdlgs/inscodlg.cxx +++ b/sc/source/ui/miscdlgs/inscodlg.cxx @@ -38,7 +38,8 @@ ScInsertContentsDlg::ScInsertContentsDlg( Window* pParent, bFillMode ( false ), bChangeTrack ( false ), bMoveDownDisabled( false ), - bMoveRightDisabled( false ) + bMoveRightDisabled( false ), + bUsedShortCut ( false ) { get( mpBtnInsAll, "paste_all" ); get( mpBtnInsStrings, "text" ); @@ -59,6 +60,9 @@ ScInsertContentsDlg::ScInsertContentsDlg( Window* pParent, get( mpRbMoveNone, "no_shift" ); get( mpRbMoveDown, "move_down" ); get( mpRbMoveRight, "move_right" ); + get( mpBtnShortCutPasteValuesOnly, "paste_values_only"); + get( mpBtnShortCutPasteValuesFormats, "paste_values_formats"); + get( mpBtnShortCutPasteTranspose, "paste_transpose"); if ( pStrTitle ) SetText( *pStrTitle ); @@ -111,6 +115,9 @@ ScInsertContentsDlg::ScInsertContentsDlg( Window* pParent, mpBtnInsAll->SetClickHdl( LINK( this, ScInsertContentsDlg, InsAllHdl ) ); mpBtnLink->SetClickHdl( LINK( this, ScInsertContentsDlg, LinkBtnHdl ) ); + mpBtnShortCutPasteValuesOnly->SetClickHdl( LINK( this, ScInsertContentsDlg, ShortCutHdl ) );; + mpBtnShortCutPasteValuesFormats->SetClickHdl( LINK( this, ScInsertContentsDlg, ShortCutHdl ) );; + mpBtnShortCutPasteTranspose->SetClickHdl( LINK( this, ScInsertContentsDlg, ShortCutHdl ) ); } sal_uInt16 ScInsertContentsDlg::GetInsContentsCmdBits() const @@ -134,6 +141,9 @@ sal_uInt16 ScInsertContentsDlg::GetInsContentsCmdBits() const ScInsertContentsDlg::bPreviousAllCheck = mpBtnInsAll->IsChecked(); + if (bUsedShortCut) + return nShortCutInsContentsCmdBits; + return ( (ScInsertContentsDlg::bPreviousAllCheck) ? IDF_ALL : ScInsertContentsDlg::nPreviousChecks ); @@ -141,6 +151,8 @@ sal_uInt16 ScInsertContentsDlg::GetInsContentsCmdBits() const InsCellCmd ScInsertContentsDlg::GetMoveMode() { + if (bUsedShortCut) + return nShortCutMoveMode; if ( mpRbMoveDown->IsChecked() ) return INS_CELLSDOWN; if ( mpRbMoveRight->IsChecked() ) @@ -149,6 +161,27 @@ InsCellCmd ScInsertContentsDlg::GetMoveMode() return INS_NONE; } +bool ScInsertContentsDlg::IsSkipEmptyCells() const +{ + if (bUsedShortCut) + return bShortCutSkipEmptyCells; + return mpBtnSkipEmptyCells->IsChecked(); +} + +bool ScInsertContentsDlg::IsTranspose() const +{ + if (bUsedShortCut) + return bShortCutTranspose; + return mpBtnTranspose->IsChecked(); +} + +bool ScInsertContentsDlg::IsLink() const +{ + if (bUsedShortCut) + return bShortCutIsLink; + return mpBtnLink->IsChecked(); +} + void ScInsertContentsDlg::DisableChecks( bool bInsAllChecked ) { if ( bInsAllChecked ) @@ -267,6 +300,45 @@ void ScInsertContentsDlg::SetCellShiftDisabled( int nDisable ) } } +IMPL_LINK( ScInsertContentsDlg, ShortCutHdl, PushButton*, pBtn ) +{ + if ( pBtn == mpBtnShortCutPasteValuesOnly ) + { + bUsedShortCut = true; + nShortCutInsContentsCmdBits = IDF_STRING | IDF_VALUE | IDF_DATETIME; + nShortCutFormulaCmdBits = PASTE_NOFUNC; + bShortCutSkipEmptyCells = false; + bShortCutTranspose = false; + bShortCutIsLink = false; + nShortCutMoveMode = INS_NONE; + EndDialog(RET_OK); + } + else if ( pBtn == mpBtnShortCutPasteValuesFormats ) + { + bUsedShortCut = true; + nShortCutInsContentsCmdBits = IDF_STRING | IDF_VALUE | IDF_DATETIME | IDF_ATTRIB; + nShortCutFormulaCmdBits = PASTE_NOFUNC; + bShortCutSkipEmptyCells = false; + bShortCutTranspose = false; + bShortCutIsLink = false; + nShortCutMoveMode = INS_NONE; + EndDialog(RET_OK); + } + else if ( pBtn == mpBtnShortCutPasteTranspose ) + { + bUsedShortCut = true; + nShortCutInsContentsCmdBits = IDF_ALL; + nShortCutFormulaCmdBits = PASTE_NOFUNC; + bShortCutSkipEmptyCells = false; + bShortCutTranspose = true; + bShortCutIsLink = false; + nShortCutMoveMode = INS_NONE; + EndDialog(RET_OK); + } + return 0; +} + + IMPL_LINK_NOARG(ScInsertContentsDlg, InsAllHdl) { DisableChecks( mpBtnInsAll->IsChecked() ); @@ -314,6 +386,8 @@ sal_uInt16 ScInsertContentsDlg::GetFormulaCmdBits() const else if(mpRbDiv->IsChecked()) ScInsertContentsDlg::nPreviousFormulaChecks = PASTE_DIV; // Bits fuer Checkboxen ausblenden + if (bUsedShortCut) + return nShortCutFormulaCmdBits; return ScInsertContentsDlg::nPreviousFormulaChecks; } diff --git a/sc/uiconfig/scalc/ui/pastespecial.ui b/sc/uiconfig/scalc/ui/pastespecial.ui index c8c7eccc8684..bf6b9d02f141 100644 --- a/sc/uiconfig/scalc/ui/pastespecial.ui +++ b/sc/uiconfig/scalc/ui/pastespecial.ui @@ -1,7 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.0 on Tue Jan 28 13:14:40 2014 --> +<!-- Generated with glade 3.18.3 --> <interface> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.0"/> + <object class="GtkImage" id="img_paste_values_formats"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">sc/res/paste_values_formats.png</property> + </object> + <object class="GtkImage" id="img_paste_values_only"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">sc/res/paste_values_only.png</property> + </object> + <object class="GtkImage" id="img_paste_transpose"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">sc/res/paste_transpose.png</property> + </object> <object class="GtkDialog" id="PasteSpecial"> <property name="can_focus">False</property> <property name="border_width">6</property> @@ -68,6 +83,66 @@ </packing> </child> <child> + <object class="GtkButtonBox" id="buttonbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="paste_values_only"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_markup" translatable="yes">Values Only</property> + <property name="tooltip_text" translatable="yes">Values Only</property> + <property name="image">img_paste_values_only</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="paste_values_formats"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_markup" translatable="yes">Values & Formats</property> + <property name="tooltip_text" translatable="yes">Values & Formats</property> + <property name="image">img_paste_values_formats</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="paste_transpose"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_markup" translatable="yes">Transpose</property> + <property name="tooltip_text" translatable="yes">Transpose</property> + <property name="image">img_paste_transpose</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> <object class="GtkGrid" id="grid1"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -239,8 +314,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> @@ -371,8 +444,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> @@ -464,8 +535,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> @@ -561,15 +630,13 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> </object> |