LCOV - code coverage report
Current view: top level - sc/source/core/data - table7.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 30 44 68.2 %
Date: 2014-04-11 Functions: 7 10 70.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 <table.hxx>
      11             : #include <clipcontext.hxx>
      12             : #include <document.hxx>
      13             : #include <clipparam.hxx>
      14             : #include <bcaslot.hxx>
      15             : 
      16           2 : bool ScTable::IsMerged( SCCOL nCol, SCROW nRow ) const
      17             : {
      18           2 :     if (!ValidCol(nCol))
      19           0 :         return false;
      20             : 
      21           2 :     return aCol[nCol].IsMerged(nRow);
      22             : }
      23             : 
      24           1 : void ScTable::DeleteBeforeCopyFromClip( sc::CopyFromClipContext& rCxt, const ScTable& rClipTab )
      25             : {
      26           1 :     sc::CopyFromClipContext::Range aRange = rCxt.getDestRange();
      27           1 :     if (!ValidCol(aRange.mnCol1) || !ValidCol(aRange.mnCol2))
      28           1 :         return;
      29             : 
      30             :     // Pass some stuff to the columns via context.
      31           1 :     rCxt.setTableProtected(IsProtected());
      32           1 :     rCxt.setCondFormatList(mpCondFormatList.get());
      33             : 
      34           1 :     ScRange aClipRange = rCxt.getClipDoc()->GetClipParam().getWholeRange();
      35           1 :     SCCOL nClipCol = aClipRange.aStart.Col();
      36             :     {
      37           1 :         ScBulkBroadcast aBulkBroadcast(pDocument->GetBASM());
      38             : 
      39           2 :         for (SCCOL nCol = aRange.mnCol1; nCol <= aRange.mnCol2; ++nCol, ++nClipCol)
      40             :         {
      41           1 :             if (nClipCol > aClipRange.aEnd.Col())
      42           0 :                 nClipCol = aClipRange.aStart.Col(); // loop through columns.
      43             : 
      44           1 :             const ScColumn& rClipCol = rClipTab.aCol[nClipCol];
      45           1 :             aCol[nCol].DeleteBeforeCopyFromClip(rCxt, rClipCol);
      46           1 :         }
      47             :     }
      48             : 
      49           1 :     SetStreamValid(false);
      50             : }
      51             : 
      52           2 : void ScTable::CopyOneCellFromClip(
      53             :     sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
      54             : {
      55           4 :     for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
      56           2 :         aCol[nCol].CopyOneCellFromClip(rCxt, nRow1, nRow2);
      57           2 : }
      58             : 
      59           0 : void ScTable::SetValues( SCCOL nCol, SCROW nRow, const std::vector<double>& rVals )
      60             : {
      61           0 :     if (!ValidCol(nCol))
      62           0 :         return;
      63             : 
      64           0 :     aCol[nCol].SetValues(nRow, rVals);
      65             : }
      66             : 
      67           0 : void ScTable::TransferCellValuesTo( SCCOL nCol, SCROW nRow, size_t nLen, sc::CellValues& rDest )
      68             : {
      69           0 :     if (!ValidCol(nCol))
      70           0 :         return;
      71             : 
      72           0 :     aCol[nCol].TransferCellValuesTo(nRow, nLen, rDest);
      73             : }
      74             : 
      75           0 : void ScTable::CopyCellValuesFrom( SCCOL nCol, SCROW nRow, const sc::CellValues& rSrc )
      76             : {
      77           0 :     if (!ValidCol(nCol))
      78           0 :         return;
      79             : 
      80           0 :     aCol[nCol].CopyCellValuesFrom(nRow, rSrc);
      81             : }
      82             : 
      83          70 : void ScTable::PreprocessRangeNameUpdate(
      84             :     sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt )
      85             : {
      86       71750 :     for (SCCOL i = 0; i <= MAXCOL; ++i)
      87       71680 :         aCol[i].PreprocessRangeNameUpdate(rEndListenCxt, rCompileCxt);
      88          70 : }
      89             : 
      90          70 : void ScTable::PostprocessRangeNameUpdate( sc::CompileFormulaContext& rCompileCxt )
      91             : {
      92       71750 :     for (SCCOL i = 0; i <= MAXCOL; ++i)
      93       71680 :         aCol[i].PostprocessRangeNameUpdate(rCompileCxt);
      94         172 : }
      95             : 
      96             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10