LCOV - code coverage report
Current view: top level - sc/source/filter/xml - cachedattraccess.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 19 19 100.0 %
Date: 2015-06-13 12:38:46 Functions: 7 7 100.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 "cachedattraccess.hxx"
      11             : #include "document.hxx"
      12             : 
      13         672 : ScXMLCachedRowAttrAccess::Cache::Cache() :
      14         672 :     mnTab(-1), mnRow1(-1), mnRow2(-1), mbValue(false) {}
      15             : 
      16    12583208 : bool ScXMLCachedRowAttrAccess::Cache::hasCache(sal_Int32 nTab, sal_Int32 nRow) const
      17             : {
      18    12583208 :     return mnTab == nTab && mnRow1 <= nRow && nRow <= mnRow2;
      19             : }
      20             : 
      21         336 : ScXMLCachedRowAttrAccess::ScXMLCachedRowAttrAccess(ScDocument* pDoc) :
      22         336 :     mpDoc(pDoc) {}
      23             : 
      24     6291604 : bool ScXMLCachedRowAttrAccess::rowHidden(sal_Int32 nTab, sal_Int32 nRow)
      25             : {
      26     6291604 :     if (!maHidden.hasCache(nTab, nRow))
      27             :     {
      28             :         SCROW nRow1, nRow2;
      29             :         maHidden.mbValue = mpDoc->RowHidden(
      30     6291604 :             static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab), &nRow1, &nRow2);
      31     6291604 :         maHidden.mnRow1 = static_cast<sal_Int32>(nRow1);
      32     6291604 :         maHidden.mnRow2 = static_cast<sal_Int32>(nRow2);
      33             :     }
      34     6291604 :     return maHidden.mbValue;
      35             : }
      36             : 
      37     6291604 : bool ScXMLCachedRowAttrAccess::rowFiltered(sal_Int32 nTab, sal_Int32 nRow)
      38             : {
      39     6291604 :     if (!maFiltered.hasCache(nTab, nRow))
      40             :     {
      41             :         SCROW nRow1, nRow2;
      42             :         maFiltered.mbValue = mpDoc->RowFiltered(
      43     6291604 :             static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab), &nRow1, &nRow2);
      44     6291604 :         maFiltered.mnRow1 = static_cast<sal_Int32>(nRow1);
      45     6291604 :         maFiltered.mnRow2 = static_cast<sal_Int32>(nRow2);
      46             :     }
      47     6291604 :     return maFiltered.mbValue;
      48         156 : }
      49             : 
      50             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11