LCOV - code coverage report
Current view: top level - sc/source/core/data - clipcontext.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 86 0.0 %
Date: 2014-04-14 Functions: 0 43 0.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 "clipcontext.hxx"
      11             : #include "document.hxx"
      12             : #include "mtvelements.hxx"
      13             : #include <column.hxx>
      14             : #include <scitems.hxx>
      15             : 
      16             : #include <svl/intitem.hxx>
      17             : 
      18             : namespace sc {
      19             : 
      20           0 : ClipContextBase::ClipContextBase(ScDocument& rDoc) :
      21           0 :     mpSet(new ColumnBlockPositionSet(rDoc)) {}
      22             : 
      23           0 : ClipContextBase::~ClipContextBase() {}
      24             : 
      25           0 : ColumnBlockPosition* ClipContextBase::getBlockPosition(SCTAB nTab, SCCOL nCol)
      26             : {
      27           0 :     return mpSet->getBlockPosition(nTab, nCol);
      28             : }
      29             : 
      30           0 : CopyFromClipContext::CopyFromClipContext(ScDocument& rDoc,
      31             :     ScDocument* pRefUndoDoc, ScDocument* pClipDoc, sal_uInt16 nInsertFlag,
      32             :     bool bAsLink, bool bSkipAttrForEmptyCells) :
      33             :     ClipContextBase(rDoc),
      34             :     mnDestCol1(-1), mnDestCol2(-1),
      35             :     mnDestRow1(-1), mnDestRow2(-1),
      36             :     mnTabStart(-1), mnTabEnd(-1),
      37             :     mpRefUndoDoc(pRefUndoDoc), mpClipDoc(pClipDoc),
      38             :     mnInsertFlag(nInsertFlag), mnDeleteFlag(IDF_NONE),
      39             :     mpCondFormatList(NULL), mpSinglePattern(NULL), mpSingleNote(NULL),
      40             :     mbAsLink(bAsLink), mbSkipAttrForEmptyCells(bSkipAttrForEmptyCells),
      41           0 :     mbCloneNotes (mnInsertFlag & (IDF_NOTE|IDF_ADDNOTES)),
      42           0 :     mbTableProtected(false)
      43             : {
      44           0 : }
      45             : 
      46           0 : CopyFromClipContext::~CopyFromClipContext()
      47             : {
      48           0 : }
      49             : 
      50           0 : void CopyFromClipContext::setTabRange(SCTAB nStart, SCTAB nEnd)
      51             : {
      52           0 :     mnTabStart = nStart;
      53           0 :     mnTabEnd = nEnd;
      54           0 : }
      55             : 
      56           0 : SCTAB CopyFromClipContext::getTabStart() const
      57             : {
      58           0 :     return mnTabStart;
      59             : }
      60             : 
      61           0 : SCTAB CopyFromClipContext::getTabEnd() const
      62             : {
      63           0 :     return mnTabEnd;
      64             : }
      65             : 
      66           0 : void CopyFromClipContext::setDestRange( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
      67             : {
      68           0 :     mnDestCol1 = nCol1;
      69           0 :     mnDestRow1 = nRow1;
      70           0 :     mnDestCol2 = nCol2;
      71           0 :     mnDestRow2 = nRow2;
      72           0 : }
      73             : 
      74           0 : CopyFromClipContext::Range CopyFromClipContext::getDestRange() const
      75             : {
      76             :     Range aRet;
      77           0 :     aRet.mnCol1 = mnDestCol1;
      78           0 :     aRet.mnCol2 = mnDestCol2;
      79           0 :     aRet.mnRow1 = mnDestRow1;
      80           0 :     aRet.mnRow2 = mnDestRow2;
      81           0 :     return aRet;
      82             : }
      83             : 
      84           0 : ScDocument* CopyFromClipContext::getUndoDoc()
      85             : {
      86           0 :     return mpRefUndoDoc;
      87             : }
      88             : 
      89           0 : ScDocument* CopyFromClipContext::getClipDoc()
      90             : {
      91           0 :     return mpClipDoc;
      92             : }
      93             : 
      94           0 : sal_uInt16 CopyFromClipContext::getInsertFlag() const
      95             : {
      96           0 :     return mnInsertFlag;
      97             : }
      98             : 
      99           0 : void CopyFromClipContext::setDeleteFlag( sal_uInt16 nFlag )
     100             : {
     101           0 :     mnDeleteFlag = nFlag;
     102           0 : }
     103             : 
     104           0 : sal_uInt16 CopyFromClipContext::getDeleteFlag() const
     105             : {
     106           0 :     return mnDeleteFlag;
     107             : }
     108             : 
     109           0 : ScCellValue& CopyFromClipContext::getSingleCell()
     110             : {
     111           0 :     return maSingleCell;
     112             : }
     113             : 
     114           0 : void CopyFromClipContext::setCondFormatList( ScConditionalFormatList* pCondFormatList )
     115             : {
     116           0 :     mpCondFormatList = pCondFormatList;
     117           0 : }
     118             : 
     119           0 : ScConditionalFormatList* CopyFromClipContext::getCondFormatList()
     120             : {
     121           0 :     return mpCondFormatList;
     122             : }
     123             : 
     124           0 : const ScPatternAttr* CopyFromClipContext::getSingleCellPattern() const
     125             : {
     126           0 :     return mpSinglePattern;
     127             : }
     128             : 
     129           0 : void CopyFromClipContext::setSingleCellPattern( const ScPatternAttr* pAttr )
     130             : {
     131           0 :     mpSinglePattern = pAttr;
     132           0 : }
     133             : 
     134           0 : const ScPostIt* CopyFromClipContext::getSingleCellNote() const
     135             : {
     136           0 :     return mpSingleNote;
     137             : }
     138             : 
     139           0 : void CopyFromClipContext::setSingleCellNote( const ScPostIt* pNote )
     140             : {
     141           0 :     mpSingleNote = pNote;
     142           0 : }
     143             : 
     144           0 : void CopyFromClipContext::setTableProtected( bool b )
     145             : {
     146           0 :     mbTableProtected = b;
     147           0 : }
     148             : 
     149           0 : bool CopyFromClipContext::isTableProtected() const
     150             : {
     151           0 :     return mbTableProtected;
     152             : }
     153             : 
     154           0 : bool CopyFromClipContext::isAsLink() const
     155             : {
     156           0 :     return mbAsLink;
     157             : }
     158             : 
     159           0 : bool CopyFromClipContext::isSkipAttrForEmptyCells() const
     160             : {
     161           0 :     return mbSkipAttrForEmptyCells;
     162             : }
     163             : 
     164           0 : bool CopyFromClipContext::isCloneNotes() const
     165             : {
     166           0 :     return mbCloneNotes;
     167             : }
     168             : 
     169           0 : bool CopyFromClipContext::isDateCell( const ScColumn& rCol, SCROW nRow ) const
     170             : {
     171           0 :     sal_uLong nNumIndex = static_cast<const SfxUInt32Item*>(rCol.GetAttr(nRow, ATTR_VALUE_FORMAT))->GetValue();
     172           0 :     short nType = mpClipDoc->GetFormatTable()->GetType(nNumIndex);
     173           0 :     return (nType == NUMBERFORMAT_DATE) || (nType == NUMBERFORMAT_TIME) || (nType == NUMBERFORMAT_DATETIME);
     174             : }
     175             : 
     176           0 : CopyToClipContext::CopyToClipContext(
     177             :     ScDocument& rDoc, bool bKeepScenarioFlags, bool bCloneNotes) :
     178           0 :     ClipContextBase(rDoc), mbKeepScenarioFlags(bKeepScenarioFlags), mbCloneNotes(bCloneNotes) {}
     179             : 
     180           0 : CopyToClipContext::~CopyToClipContext() {}
     181             : 
     182           0 : bool CopyToClipContext::isKeepScenarioFlags() const
     183             : {
     184           0 :     return mbKeepScenarioFlags;
     185             : }
     186             : 
     187           0 : bool CopyToClipContext::isCloneNotes() const
     188             : {
     189           0 :     return mbCloneNotes;
     190             : }
     191             : 
     192           0 : CopyToDocContext::CopyToDocContext(ScDocument& rDoc) : ClipContextBase(rDoc) {}
     193           0 : CopyToDocContext::~CopyToDocContext() {}
     194             : 
     195           0 : MixDocContext::MixDocContext(ScDocument& rDoc) : ClipContextBase(rDoc) {}
     196           0 : MixDocContext::~MixDocContext() {}
     197             : 
     198           0 : }
     199             : 
     200             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10