LCOV - code coverage report
Current view: top level - sd/source/ui/slidesorter/model - SlsPageEnumerationProvider.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 8 12 66.7 %
Date: 2014-04-11 Functions: 4 6 66.7 %
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             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : 
      21             : #include "model/SlsPageEnumerationProvider.hxx"
      22             : #include "model/SlsPageEnumeration.hxx"
      23             : #include "model/SlsPageDescriptor.hxx"
      24             : #include <boost/function.hpp>
      25             : 
      26             : namespace sd { namespace slidesorter { namespace model {
      27             : 
      28             : 
      29             : namespace {
      30             : 
      31             : class AllPagesPredicate
      32             : {
      33             : public:
      34        2462 :     bool operator() (const SharedPageDescriptor& rpDescriptor) const
      35             :     {
      36             :         (void)rpDescriptor;
      37        2462 :         return true;
      38             :     }
      39             : };
      40             : 
      41             : 
      42             : 
      43             : 
      44             : 
      45             : class SelectedPagesPredicate
      46             : {
      47             : public:
      48         126 :     bool operator() (const SharedPageDescriptor& rpDescriptor)
      49             :     {
      50         126 :         return rpDescriptor->HasState(PageDescriptor::ST_Selected);
      51             :     }
      52             : };
      53             : 
      54             : 
      55             : 
      56             : 
      57             : class VisiblePagesPredicate
      58             : {
      59             : public:
      60           0 :     bool operator() (const SharedPageDescriptor& rpDescriptor)
      61             :     {
      62           0 :         return rpDescriptor->HasState(PageDescriptor::ST_Visible);
      63             :     }
      64             : };
      65             : 
      66             : }
      67             : 
      68             : 
      69             : 
      70             : 
      71        2450 : PageEnumeration PageEnumerationProvider::CreateAllPagesEnumeration (
      72             :     const SlideSorterModel& rModel)
      73             : {
      74        2450 :     return PageEnumeration::Create(rModel, AllPagesPredicate());
      75             : }
      76             : 
      77             : 
      78             : 
      79             : 
      80         189 : PageEnumeration PageEnumerationProvider::CreateSelectedPagesEnumeration (
      81             :     const SlideSorterModel& rModel)
      82             : {
      83             :     return PageEnumeration::Create(
      84             :         rModel,
      85         189 :         SelectedPagesPredicate());
      86             : }
      87             : 
      88             : 
      89             : 
      90             : 
      91           0 : PageEnumeration PageEnumerationProvider::CreateVisiblePagesEnumeration (
      92             :     const SlideSorterModel& rModel)
      93             : {
      94             :     return PageEnumeration::Create(
      95             :         rModel,
      96           0 :         VisiblePagesPredicate());
      97             : }
      98             : 
      99             : 
     100             : } } } // end of namespace ::sd::slidesorter::model
     101             : 
     102             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10