LCOV - code coverage report
Current view: top level - sc/source/core/data - mtvelements.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 35 0.0 %
Date: 2014-04-14 Functions: 0 6 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 "mtvelements.hxx"
      11             : #include "globalnames.hxx"
      12             : #include "document.hxx"
      13             : #include "cellvalue.hxx"
      14             : 
      15             : namespace sc {
      16             : 
      17           0 : CellTextAttr::CellTextAttr() :
      18             :     mnTextWidth(TEXTWIDTH_DIRTY),
      19           0 :     mnScriptType(SC_SCRIPTTYPE_UNKNOWN) {}
      20             : 
      21           0 : CellTextAttr::CellTextAttr(const CellTextAttr& r) :
      22             :     mnTextWidth(r.mnTextWidth),
      23           0 :     mnScriptType(r.mnScriptType) {}
      24             : 
      25           0 : ColumnBlockPositionSet::ColumnBlockPositionSet(ScDocument& rDoc) : mrDoc(rDoc) {}
      26             : 
      27           0 : ColumnBlockPosition* ColumnBlockPositionSet::getBlockPosition(SCTAB nTab, SCCOL nCol)
      28             : {
      29           0 :     osl::MutexGuard aGuard(&maMtxTables);
      30             : 
      31           0 :     TablesType::iterator itTab = maTables.find(nTab);
      32           0 :     if (itTab == maTables.end())
      33             :     {
      34             :         std::pair<TablesType::iterator,bool> r =
      35           0 :             maTables.insert(TablesType::value_type(nTab, ColumnsType()));
      36           0 :         if (!r.second)
      37             :             // insertion failed.
      38           0 :             return NULL;
      39             : 
      40           0 :         itTab = r.first;
      41             :     }
      42             : 
      43           0 :     ColumnsType& rCols = itTab->second;
      44             : 
      45           0 :     ColumnsType::iterator it = rCols.find(nCol);
      46           0 :     if (it != rCols.end())
      47             :         // Block position for this column has already been fetched.
      48           0 :         return &it->second;
      49             : 
      50             :     std::pair<ColumnsType::iterator,bool> r =
      51             :         rCols.insert(
      52           0 :             ColumnsType::value_type(nCol, ColumnBlockPosition()));
      53             : 
      54           0 :     if (!r.second)
      55             :         // insertion failed.
      56           0 :         return NULL;
      57             : 
      58           0 :     it = r.first;
      59             : 
      60           0 :     if (!mrDoc.InitColumnBlockPosition(it->second, nTab, nCol))
      61           0 :         return NULL;
      62             : 
      63           0 :     return &it->second;
      64             : }
      65             : 
      66           0 : void ColumnBlockPositionSet::clear()
      67             : {
      68           0 :     osl::MutexGuard aGuard(&maMtxTables);
      69           0 :     maTables.clear();
      70           0 : }
      71             : 
      72           0 : ScRefCellValue toRefCell( const sc::CellStoreType::const_iterator& itPos, size_t nOffset )
      73             : {
      74           0 :     switch (itPos->type)
      75             :     {
      76             :         case sc::element_type_numeric:
      77             :             // Numeric cell
      78           0 :             return ScRefCellValue(sc::numeric_block::at(*itPos->data, nOffset));
      79             :         case sc::element_type_string:
      80             :             // String cell
      81           0 :             return ScRefCellValue(&sc::string_block::at(*itPos->data, nOffset));
      82             :         case sc::element_type_edittext:
      83             :             // Edit cell
      84           0 :             return ScRefCellValue(sc::edittext_block::at(*itPos->data, nOffset));
      85             :         break;
      86             :         case sc::element_type_formula:
      87             :             // Formula cell
      88           0 :             return ScRefCellValue(sc::formula_block::at(*itPos->data, nOffset));
      89             :         default:
      90             :             ;
      91             :     }
      92             : 
      93           0 :     return ScRefCellValue();
      94             : }
      95             : 
      96             : }
      97             : 
      98             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10