/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
if (nSlot != SID_CURRENTCELL) // this comes with MouseButtonUp
pTabViewShell->HideListBox(); // Autofilter-DropDown-Listbox
if ( GetViewData().HasEditView( GetViewData().GetActivePart() ) )
{ switch ( nSlot )
{ // when opening a reference-dialog the subshell may not be switched // (on closing the dialog StopEditShell is called) case SID_OPENDLG_FUNCTION: // inplace leads to trouble with EditShell ... //! cannot always be switched ???? if (!pTabViewShell->GetViewFrame().GetFrame().IsInPlace())
pTabViewShell->SetDontSwitch(true); // do not switch off EditShell
[[fallthrough]];
case FID_CELL_FORMAT: case SID_ENABLE_HYPHENATION: case SID_DATA_SELECT: case SID_OPENDLG_CONSOLIDATE: case SID_OPENDLG_SOLVE: case SID_OPENDLG_OPTSOLVER:
switch ( nSlot )
{ case SID_STATUS_SELMODE: if ( pReqArgs )
{ /* 0: STD Click cancels selection * 1: ER Click extends selection * 2: ERG Click defines further selection
*/
sal_uInt16 nMode = static_cast<const SfxUInt16Item&>(pReqArgs->Get( nSlot )).GetValue();
switch ( nMode )
{ case 1: nMode = KEY_SHIFT; break; case 2: nMode = KEY_MOD1; break; // control-key case 0: default:
nMode = 0;
}
pTabViewShell->LockModifiers( nMode );
} else
{ // no arguments (also executed by double click on the status bar controller): // advance to next selection mode
case SID_STATUS_SELMODE_NORM:
pTabViewShell->LockModifiers( 0 );
rBindings.Invalidate( SID_STATUS_SELMODE ); break;
// SID_STATUS_SELMODE_ERG / SID_STATUS_SELMODE_ERW as toggles:
case SID_STATUS_SELMODE_ERG: if ( pTabViewShell->GetLockedModifiers() & KEY_MOD1 )
pTabViewShell->LockModifiers( 0 ); else
pTabViewShell->LockModifiers( KEY_MOD1 );
rBindings.Invalidate( SID_STATUS_SELMODE ); break;
case SID_STATUS_SELMODE_ERW: if ( pTabViewShell->GetLockedModifiers() & KEY_SHIFT )
pTabViewShell->LockModifiers( 0 ); else
pTabViewShell->LockModifiers( KEY_SHIFT );
rBindings.Invalidate( SID_STATUS_SELMODE ); break;
case SID_ENTER_STRING:
{ if ( pReqArgs )
{ // In the LOK case, we want to set the document modified state // right away at the start of the edit, so that the content is // saved even when the user leaves the document before hitting // Enter // NOTE: This also means we want to set the modified state // regardless of the DontCommit parameter's value. if (comphelper::LibreOfficeKit::isActive() && !GetViewData().GetDocShell().IsModified())
{
GetViewData().GetDocShell().SetModified();
rBindings.Invalidate(SID_SAVEDOC);
rBindings.Invalidate(SID_DOC_MODIFIED);
}
EditView* pTableView = pHdl->GetActiveView();
pHdl->DataChanging(); if (pTableView)
pTableView->getEditEngine().SetText(aStr);
pHdl->DataChanged();
pScMod->SetInputMode(SC_INPUT_NONE);
}
if ( !pHdl || !pHdl->IsInEnterHandler() )
{ // UpdateInputHandler is needed after the cell content // has changed, but if called from EnterHandler, UpdateInputHandler // will be called later when moving the cursor.
pTabViewShell->UpdateInputHandler();
}
rReq.Done();
// no GrabFocus here, as otherwise on a Mac the tab jumps before the // sideview, when the input was not finished // (GrabFocus is called in KillEditView)
}
} break;
// no GrabFocus here, as otherwise on a Mac the tab jumps before the // sideview, when the input was not finished // (GrabFocus is called in KillEditView)
} break;
case SID_OPENDLG_FUNCTION:
{ const SfxViewShell* pViewShell = SfxViewShell::Current(); if (comphelper::LibreOfficeKit::isActive()
&& pViewShell && pViewShell->isLOKMobilePhone())
{ // not set the dialog id in the mobile case or we would // not be able to get cell address pasted in the edit view // by just tapping on them
lcl_lokGetWholeFunctionList();
} else
{
sal_uInt16 nId = SID_OPENDLG_FUNCTION;
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); bool bVis = comphelper::LibreOfficeKit::isActive() || pWnd == nullptr;
pScMod->SetRefDialog( nId, bVis );
}
rReq.Ignore();
} break;
case SID_OPENDLG_CONSOLIDATE:
{
sal_uInt16 nId = ScConsolidateDlgWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
case FID_CELL_FORMAT:
{ if ( pReqArgs != nullptr )
{ // set cell attribute without dialog:
SfxItemSet aEmptySet(SfxItemSet::makeFixedSfxItemSet<ATTR_PATTERN_START, ATTR_PATTERN_END>(*pReqArgs->GetPool()));
// first test, if the prefix is recognised as valid, // else avoid only doubles bool bPrefix = ScDocument::ValidTabName( aBaseName );
OSL_ENSURE(bPrefix, "invalid sheet name");
while ( rDoc.IsScenario(nTab+i) )
i++;
bool bValid;
SCTAB nDummy; do
{
aName = aBaseName + OUString::number( i ); if (bPrefix)
bValid = rDoc.ValidNewTabName( aName ); else
bValid = !rDoc.GetTable( aName, nDummy );
++i;
} while ( !bValid && i <= MAXTAB + 2 );
// #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
pRequest.AppendItem( SfxUInt16Item( FID_ROW_HEIGHT, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
pRequest.Done();
}
pDlg->disposeOnce();
});
}
} break;
case FID_ROW_OPT_HEIGHT:
{ if ( pReqArgs )
{ const SfxUInt16Item& rUInt16Item = pReqArgs->Get( FID_ROW_OPT_HEIGHT );
// #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL,
o3tl::toTwips(rUInt16Item.GetValue(), o3tl::Length::mm100) );
ScGlobal::nLastRowHeightExtra = rUInt16Item.GetValue();
// #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
pRequest.AppendItem( SfxUInt16Item( FID_ROW_OPT_HEIGHT, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
pRequest.Done();
}
pDlg->disposeOnce();
});
}
} break;
// #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
pRequest.AppendItem( SfxUInt16Item( FID_COL_WIDTH, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal))) );
pRequest.Done();
}
pDlg->disposeOnce();
});
}
} break;
case FID_COL_OPT_WIDTH:
{ if ( pReqArgs )
{ const SfxUInt16Item& rUInt16Item = pReqArgs->Get( FID_COL_OPT_WIDTH );
// #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL,
o3tl::toTwips(rUInt16Item.GetValue(), o3tl::Length::mm100) );
ScGlobal::nLastColWidthExtra = rUInt16Item.GetValue();
// #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
pRequest.AppendItem( SfxUInt16Item( FID_COL_OPT_WIDTH, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
pRequest.Done();
}
pDlg->disposeOnce();
});
}
} break;
case FID_COL_OPT_DIRECT:
pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL, STD_EXTRA_WIDTH );
rReq.Done(); break;
case FID_ROW_HIDE:
pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, 0 );
rReq.Done(); break; case FID_ROW_SHOW:
pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_SHOW, 0 );
rReq.Done(); break; case FID_COL_HIDE:
pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT, 0 );
rReq.Done(); break; case FID_COL_SHOW:
pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_SHOW, 0 );
rReq.Done(); break;
case FID_INPUTLINE_STATUS:
OSL_FAIL("Execute from InputLine status"); break;
case SID_STATUS_DOCPOS: // Launch navigator.
GetViewData().GetDispatcher().Execute(
SID_NAVIGATOR, SfxCallMode::SYNCHRON|SfxCallMode::RECORD ); break;
case SID_MARKAREA: // called from Basic at the hidden view to select a range in the visible view
OSL_FAIL("old slot SID_MARKAREA"); break;
case FID_MOVE_KEEP_INSERT_MODE:
{ const SfxBoolItem* pEnabledArg = rReq.GetArg<SfxBoolItem>(FID_MOVE_KEEP_INSERT_MODE); if (!pEnabledArg) {
SAL_WARN("sfx.appl", "FID_MOVE_KEEP_INSERT_MODE: must specify if you would like this to be enabled"); break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.