summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-11-23 14:54:47 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-11-24 09:34:12 +0100
commitd3d176cc657d5dcb5e0bc6d8912358a9b4435a93 (patch)
tree3a372619b866724a7ceb82d33768fc3498a9cc88
parentc069f50a9e05c796935a55e6b2db5f714cf9cff7 (diff)
Simplify a bit
Change-Id: I0b3e02669b326533f4579f57a41a16da53cf8ff4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177188 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
-rw-r--r--sc/source/ui/view/cellsh4.cxx54
1 files changed, 21 insertions, 33 deletions
diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx
index 754c5077e93a..5f1336a28338 100644
--- a/sc/source/ui/view/cellsh4.cxx
+++ b/sc/source/ui/view/cellsh4.cxx
@@ -365,37 +365,31 @@ void ScCellShell::ExecuteMove( SfxRequest& rReq )
break;
case SID_SELECT_COL:
+ if (const SfxPoolItem *pColItem, *pModifierItem;
+ pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pColItem)
+ && pReqArgs->HasItem(FN_PARAM_2, &pModifierItem))
{
- const SfxPoolItem* pColItem;
- const SfxPoolItem* pModifierItem;
- if ( pReqArgs && pReqArgs->HasItem( FN_PARAM_1, &pColItem ) &&
- pReqArgs->HasItem( FN_PARAM_2, &pModifierItem ) )
- {
- SCCOL nCol = static_cast<SCCOL>(static_cast<const SfxInt32Item*>(pColItem)->GetValue());
- sal_Int16 nModifier = static_cast<const SfxInt16Item*>(pModifierItem)->GetValue();
-
- pTabViewShell->MarkColumns( nCol, nModifier );
- }
- else
- pTabViewShell->MarkColumns();
+ SCCOL nCol = static_cast<SCCOL>(static_cast<const SfxInt32Item*>(pColItem)->GetValue());
+ sal_Int16 nModifier = static_cast<const SfxInt16Item*>(pModifierItem)->GetValue();
+
+ pTabViewShell->MarkColumns( nCol, nModifier );
}
+ else
+ pTabViewShell->MarkColumns();
break;
case SID_SELECT_ROW:
+ if (const SfxPoolItem *pRowItem, *pModifierItem;
+ pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pRowItem)
+ && pReqArgs->HasItem(FN_PARAM_2, &pModifierItem))
{
- const SfxPoolItem* pRowItem;
- const SfxPoolItem* pModifierItem;
- if ( pReqArgs && pReqArgs->HasItem( FN_PARAM_1, &pRowItem ) &&
- pReqArgs->HasItem( FN_PARAM_2, &pModifierItem ) )
- {
- SCROW nRow = static_cast<SCROW>(static_cast<const SfxInt32Item*>(pRowItem)->GetValue());
- sal_Int16 nModifier = static_cast<const SfxInt16Item*>(pModifierItem)->GetValue();
-
- pTabViewShell->MarkRows( nRow, nModifier );
- }
- else
- pTabViewShell->MarkRows();
+ SCROW nRow = static_cast<SCROW>(static_cast<const SfxInt32Item*>(pRowItem)->GetValue());
+ sal_Int16 nModifier = static_cast<const SfxInt16Item*>(pModifierItem)->GetValue();
+
+ pTabViewShell->MarkRows( nRow, nModifier );
}
+ else
+ pTabViewShell->MarkRows();
break;
case SID_SELECT_NONE:
@@ -419,15 +413,9 @@ void ScCellShell::ExecuteMove( SfxRequest& rReq )
break;
case SID_FOCUS_INPUTLINE:
- {
- ScInputHandler* pHdl = ScModule::get()->GetInputHdl(pTabViewShell);
- if (pHdl)
- {
- ScInputWindow* pWin = pHdl->GetInputWindow();
- if (pWin)
- pWin->SwitchToTextWin();
- }
- }
+ if (ScInputHandler* pHdl = ScModule::get()->GetInputHdl(pTabViewShell))
+ if (ScInputWindow* pWin = pHdl->GetInputWindow())
+ pWin->SwitchToTextWin();
break;
case SID_CURSORTOPOFSCREEN: