LCOV - code coverage report
Current view: top level - sc/source/ui/view - cellmergeoption.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 13 24 54.2 %
Date: 2014-11-03 Functions: 4 5 80.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 "cellmergeoption.hxx"
      11             : #include "address.hxx"
      12             : 
      13           0 : ScCellMergeOption::ScCellMergeOption(const ScRange& rRange) :
      14           0 :     mnStartCol(rRange.aStart.Col()),
      15           0 :     mnStartRow(rRange.aStart.Row()),
      16           0 :     mnEndCol(rRange.aEnd.Col()),
      17           0 :     mnEndRow(rRange.aEnd.Row()),
      18           0 :     mbCenter(false)
      19             : {
      20           0 :     SCTAB nTab1 = rRange.aStart.Tab();
      21           0 :     SCTAB nTab2 = rRange.aEnd.Tab();
      22           0 :     for (SCTAB i = nTab1; i <= nTab2; ++i)
      23           0 :         maTabs.insert(i);
      24           0 : }
      25             : 
      26          24 : ScCellMergeOption::ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bCenter) :
      27             :     mnStartCol(nStartCol),
      28             :     mnStartRow(nStartRow),
      29             :     mnEndCol(nEndCol),
      30             :     mnEndRow(nEndRow),
      31          24 :     mbCenter(bCenter)
      32             : {
      33          24 : }
      34             : 
      35          20 : ScCellMergeOption::ScCellMergeOption(const ScCellMergeOption& r) :
      36             :     maTabs(r.maTabs),
      37             :     mnStartCol(r.mnStartCol),
      38             :     mnStartRow(r.mnStartRow),
      39             :     mnEndCol(r.mnEndCol),
      40             :     mnEndRow(r.mnEndRow),
      41          20 :     mbCenter(r.mbCenter)
      42             : {
      43          20 : }
      44             : 
      45          24 : ScRange ScCellMergeOption::getSingleRange(SCTAB nTab) const
      46             : {
      47          24 :     return ScRange(mnStartCol, mnStartRow, nTab, mnEndCol, mnEndRow, nTab);
      48             : }
      49             : 
      50          12 : ScRange ScCellMergeOption::getFirstSingleRange() const
      51             : {
      52          12 :     SCTAB nTab = 0;
      53          12 :     if (!maTabs.empty())
      54          12 :         nTab = *maTabs.begin();
      55             : 
      56          12 :     return getSingleRange(nTab);
      57             : }
      58             : 
      59             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10