LibreOffice Module sc (master) 1
SparklineData.cxx
Go to the documentation of this file.
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
11#include <SparklineData.hxx>
12
13namespace sc
14{
15RangeOrientation calculateOrientation(sal_Int32 nOutputSize, ScRange const& rInputRange)
16{
17 sal_Int32 nRowSize = rInputRange.aEnd.Row() - rInputRange.aStart.Row();
18 sal_Int32 nColSize = rInputRange.aEnd.Col() - rInputRange.aStart.Col();
19
20 auto eInputOrientation = RangeOrientation::Unknown;
21 if (nOutputSize == nRowSize)
22 eInputOrientation = RangeOrientation::Row;
23 else if (nOutputSize == nColSize)
24 eInputOrientation = RangeOrientation::Col;
25 return eInputOrientation;
26}
27
28} // end sc
29
30/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
CAUTION! The following defines must be in the same namespace as the respective type.
RangeOrientation
RangeOrientation calculateOrientation(sal_Int32 nOutputSize, ScRange const &rInputRange)
Determine the sparkline group orientation for the input data the output size.