Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sc/source/ui/operation/ChangeSparklineOperation.cxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 */
9
10
#include <operation/ChangeSparklineOperation.hxx>
11
12
#include <docsh.hxx>
13
#include <Sparkline.hxx>
14
#include <undo/UndoEditSparkline.hxx>
15
16
namespace sc
17
{
18
ChangeSparklineOperation::ChangeSparklineOperation(ScDocShell& rDocShell,
19
                                                   std::shared_ptr<Sparkline> const& rpSparkline,
20
                                                   SCTAB nTab, ScRangeList const& rDataRange)
21
0
    : Operation(OperationType::SparklineChange, false, false)
22
0
    , mrDocShell(rDocShell)
23
0
    , mpSparkline(rpSparkline)
24
0
    , mnTab(nTab)
25
0
    , maDataRange(rDataRange)
26
0
{
27
0
}
28
29
bool ChangeSparklineOperation::runImplementation()
30
0
{
31
0
    SCTAB nTab = convertTab(mnTab);
32
0
    ScRangeList aDataRange = convertRangeList(maDataRange);
33
34
0
    auto pUndo = std::make_unique<UndoEditSparkline>(mrDocShell, mpSparkline, nTab, aDataRange);
35
    // change sparkline by "redoing"
36
0
    pUndo->Redo();
37
0
    mrDocShell.GetUndoManager()->AddUndoAction(std::move(pUndo));
38
39
0
    syncSheetViews();
40
41
0
    return true;
42
0
}
43
}
44
45
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */