/* -*- 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 .
*/
void HandleConditionalFormat(sal_uInt32 nIndex, bool bCondFormatDlg, bool bContainsCondFormat, const sal_uInt16 nSlot, ScTabViewShell* pTabViewShell)
{
condformat::dialog::ScCondFormatDialogType eType = condformat::dialog::NONE; switch (nSlot)
{ case SID_OPENDLG_CONDFRMT: case SID_OPENDLG_CURRENTCONDFRMT:
eType = condformat::dialog::CONDITION; break; case SID_OPENDLG_COLORSCALE:
eType = condformat::dialog::COLORSCALE; break; case SID_OPENDLG_DATABAR:
eType = condformat::dialog::DATABAR; break; case SID_OPENDLG_ICONSET:
eType = condformat::dialog::ICONSET; break; case SID_OPENDLG_CONDDATE:
eType = condformat::dialog::DATE; break; default:
assert(false); break;
}
if (bCondFormatDlg || !bContainsCondFormat)
{ // Put the xml string parameter to initialize the // Conditional Format Dialog. Set the initial DialogData.
std::shared_ptr<ScCondFormatDlgData> pDlgData(std::make_shared<ScCondFormatDlgData>(nullptr, nIndex, false));
pDlgData->SetDialogType(eType);
pTabViewShell->setScCondFormatDlgData(pDlgData);
// finish input if ( GetViewData().HasEditView( GetViewData().GetActivePart() ) )
{ switch ( nSlot )
{ case FID_DEFINE_NAME: case FID_ADD_NAME: case FID_USE_NAME: case FID_INSERT_NAME: case SID_SPELL_DIALOG: case SID_HANGUL_HANJA_CONVERSION: case SID_OPENDLG_CONDFRMT: case SID_OPENDLG_CURRENTCONDFRMT: case SID_OPENDLG_COLORSCALE: case SID_OPENDLG_DATABAR:
pScMod->InputEnterHandler();
pTabViewShell->UpdateInputHandler(); break;
default: break;
}
}
switch ( nSlot )
{
// insert / delete cells / rows / columns
case FID_INS_ROW: case FID_INS_ROWS_BEFORE:
pTabViewShell->InsertCells(INS_INSROWS_BEFORE);
rReq.Done(); break;
case FID_INS_COLUMN: case FID_INS_COLUMNS_BEFORE:
pTabViewShell->InsertCells(INS_INSCOLS_BEFORE);
rReq.Done(); break;
case FID_INS_ROWS_AFTER:
pTabViewShell->InsertCells(INS_INSROWS_AFTER);
rReq.Done(); break;
case FID_INS_COLUMNS_AFTER:
pTabViewShell->InsertCells(INS_INSCOLS_AFTER);
rReq.Done(); break;
case FID_INS_CELLSDOWN:
pTabViewShell->InsertCells(INS_CELLSDOWN);
rReq.Done(); break;
case FID_INS_CELLSRIGHT:
pTabViewShell->InsertCells(INS_CELLSRIGHT);
rReq.Done(); break;
case SID_DEL_ROWS:
pTabViewShell->DeleteCells( DelCellCmd::Rows );
rReq.Done(); break;
case SID_DEL_COLS:
pTabViewShell->DeleteCells( DelCellCmd::Cols );
rReq.Done(); break;
case FID_INS_CELL:
{
InsCellCmd eCmd=INS_NONE;
if ( pReqArgs )
{ const SfxPoolItem* pItem;
OUString aFlags;
ScopedVclPtr<AbstractScInsertContentsDlg> pDlg(pFact->CreateScInsertContentsDlg(pTabViewShell->GetFrameWeld(), new OUString(ScResId(STR_FILL_TAB))));
pDlg->SetFillMode(true);
if (pDlg->Execute() == RET_OK)
{
nFlags = pDlg->GetInsContentsCmdBits();
nFunction = pDlg->GetFormulaCmdBits();
bSkipEmpty = pDlg->IsSkipEmptyCells();
bAsLink = pDlg->IsLink(); // there is no MoveMode with fill tabs
}
}
case FID_FILL_SERIES:
{ if (GetViewData().SelectionForbidsCellFill()) // Slot should be already disabled, but in case it wasn't // don't even attempt to do the evaluation and popup a // dialog. break;
const SfxPoolItem* pItem; if (pReqArgs->HasItem(FN_PARAM_1, &pItem))
{ /* nScFillModeMouseModifier controls if we "Copy cells" or "Fill series" - if nScFillModeMouseModifier is set to "KEY_MOD1", use "Copy cells" - otherwise use "Fill series"
This is also the same with auto fill by dragging mouse - dragging with Ctrl key will set nScFillModeMouseModifier to KEY_MOD1, use "Copy cells" - only dragging will use "Fill series" (no Ctrl key)
*/ constbool bCopyCells = static_cast<const SfxBoolItem*>(pItem)->GetValue();
nScFillModeMouseModifier &= ~KEY_MOD1; // turn off, reset to 0
if (bCopyCells)
nScFillModeMouseModifier |= KEY_MOD1; // turn on
}
} if (bUseSelection) // call via mouse or if FN_PARAM_1 exists
{ // not in a merged cell
} else
{
OSL_FAIL( "Direction not unique for autofill" );
}
}
// reset nScFillModeMouseModifier to its original state // otherwise, auto fill by dragging will not work as expected
nScFillModeMouseModifier = nOrigScFillModeMouseModifier;
} break; case FID_FILL_SINGLE_EDIT:
ExecuteFillSingleEdit(); break; case SID_RANDOM_NUMBER_GENERATOR_DIALOG:
{
sal_uInt16 nId = ScRandomNumberGeneratorDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_SAMPLING_DIALOG:
{
sal_uInt16 nId = ScSamplingDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_DESCRIPTIVE_STATISTICS_DIALOG:
{
sal_uInt16 nId = ScDescriptiveStatisticsDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_ANALYSIS_OF_VARIANCE_DIALOG:
{
sal_uInt16 nId = ScAnalysisOfVarianceDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_CORRELATION_DIALOG:
{
sal_uInt16 nId = ScCorrelationDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_COVARIANCE_DIALOG:
{
sal_uInt16 nId = ScCovarianceDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_EXPONENTIAL_SMOOTHING_DIALOG:
{
sal_uInt16 nId = ScExponentialSmoothingDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_MOVING_AVERAGE_DIALOG:
{
sal_uInt16 nId = ScMovingAverageDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_REGRESSION_DIALOG:
{
sal_uInt16 nId = ScRegressionDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_TTEST_DIALOG:
{
sal_uInt16 nId = ScTTestDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_FTEST_DIALOG:
{
sal_uInt16 nId = ScFTestDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_ZTEST_DIALOG:
{
sal_uInt16 nId = ScZTestDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_CHI_SQUARE_TEST_DIALOG:
{
sal_uInt16 nId = ScChiSquareTestDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_FOURIER_ANALYSIS_DIALOG:
{
sal_uInt16 nId = ScFourierAnalysisDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
pScMod->SetRefDialog( nId, pWnd == nullptr );
} break; case SID_SEARCH_RESULTS_DIALOG:
{ const SfxPoolItem* pItem = nullptr; if (pReqArgs && pReqArgs->HasItem(SID_SEARCH_RESULTS_DIALOG, &pItem))
{ bool bVisible = static_cast<const SfxBoolItem*>(pItem)->GetValue();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); // The window ID should equal the slot ID, but not a biggie if it wasn't.
sal_uInt16 nId = sc::SearchResultsDlgWrapper::GetChildWindowId();
rViewFrm.SetChildWindow(nId, bVisible, false);
}
rReq.Done();
} break;
case SID_INSERT_SPARKLINE: case SID_EDIT_SPARKLINE_GROUP:
{
sal_uInt16 nId = sc::SparklineDialogWrapper::GetChildWindowId();
SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame();
SfxChildWindow* pWindow = rViewFrame.GetChildWindow(nId);
pScMod->SetRefDialog(nId, pWindow == nullptr);
rReq.Done();
} break;
switch (aCol[0])
{ case'R': bColumns=false; bOk = true;break; case'C': bColumns=true; bOk = true;break;
}
}
} else// Dialog only when removal for rows and columns is possible
{ bool bColPoss, bRowPoss;
pTabViewShell->TestRemoveOutline( bColPoss, bRowPoss ); // TODO: handle this case in LOK too if ( bColPoss && bRowPoss && !comphelper::LibreOfficeKit::isActive() )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
if ( rData.GetSimpleArea( nStartX, nStartY, nStartTab,
nEndX, nEndY, nEndTab ) != SC_MARK_SIMPLE ||
nStartTab != nEndTab )
{ // the destination is not a simple range,
--> --------------------
--> maximum size reached
--> --------------------
Messung V0.5
¤ 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.0.10Bemerkung:
(vorverarbeitet)
¤
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.