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/source/ui/miscdlgs | |
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/source/ui/miscdlgs')
-rw-r--r-- | sc/source/ui/miscdlgs/inscodlg.cxx | 76 |
1 files changed, 75 insertions, 1 deletions
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; } |