LCOV - code coverage report
Current view: top level - xmloff/source/style - PageMasterPropHdlFactory.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 49 51 96.1 %
Date: 2014-04-11 Functions: 4 4 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             :  * 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             : #include "PageMasterPropHdlFactory.hxx"
      21             : #include <xmloff/xmltypes.hxx>
      22             : #include <xmloff/xmltoken.hxx>
      23             : #include "xmlbahdl.hxx"
      24             : #include <xmloff/NamedBoolPropertyHdl.hxx>
      25             : #include "XMLTextColumnsPropertyHandler.hxx"
      26             : #include <xmloff/XMLConstantsPropertyHandler.hxx>
      27             : #include "PageMasterPropHdl.hxx"
      28             : #include <xmloff/PageMasterStyleMap.hxx>
      29             : #include <com/sun/star/text/TextGridMode.hpp>
      30             : 
      31             : using namespace ::xmloff::token;
      32             : using namespace ::com::sun::star;
      33             : 
      34             : static SvXMLEnumMapEntry const aXML_TextGridMode_ConstantMap[] =
      35             : {
      36             :     { XML_NONE,         text::TextGridMode::NONE },
      37             :     { XML_LINE,         text::TextGridMode::LINES },
      38             :     { XML_BOTH,         text::TextGridMode::LINES_AND_CHARS },
      39             :     { XML_TOKEN_INVALID, 0 }
      40             : };
      41             : 
      42         323 : XMLPageMasterPropHdlFactory::XMLPageMasterPropHdlFactory() :
      43         323 :     XMLPropertyHandlerFactory()
      44             : {
      45         323 : }
      46             : 
      47         646 : XMLPageMasterPropHdlFactory::~XMLPageMasterPropHdlFactory()
      48             : {
      49         646 : }
      50             : 
      51       42313 : const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_Int32 nType ) const
      52             : {
      53       42313 :     nType &= MID_FLAG_MASK;
      54             : 
      55       42313 :     XMLPropertyHandler* pHdl = (XMLPropertyHandler*) XMLPropertyHandlerFactory::GetPropertyHandler( nType );
      56       42313 :     if( !pHdl )
      57             :     {
      58        5814 :         switch( nType )
      59             :         {
      60             :             case XML_PM_TYPE_PAGESTYLELAYOUT:
      61         323 :                 pHdl = new XMLPMPropHdl_PageStyleLayout();
      62         323 :             break;
      63             :             case XML_PM_TYPE_NUMFORMAT:
      64         323 :                 pHdl = new XMLPMPropHdl_NumFormat();
      65         323 :             break;
      66             :             case XML_PM_TYPE_NUMLETTERSYNC:
      67         323 :                 pHdl = new XMLPMPropHdl_NumLetterSync();
      68         323 :             break;
      69             :             case XML_PM_TYPE_PAPERTRAYNUMBER:
      70           0 :                 pHdl = new XMLPMPropHdl_PaperTrayNumber();
      71           0 :             break;
      72             :             case XML_PM_TYPE_PRINTORIENTATION:
      73             :                 pHdl = new XMLNamedBoolPropertyHdl(
      74             :                     GetXMLToken( XML_LANDSCAPE ),
      75         323 :                     GetXMLToken( XML_PORTRAIT ) );
      76         323 :             break;
      77             :             case XML_PM_TYPE_PRINTANNOTATIONS:
      78         323 :                 pHdl = new XMLPMPropHdl_Print( XML_ANNOTATIONS );
      79         323 :             break;
      80             :             case XML_PM_TYPE_PRINTCHARTS:
      81         323 :                 pHdl = new XMLPMPropHdl_Print( XML_CHARTS );
      82         323 :             break;
      83             :             case XML_PM_TYPE_PRINTDRAWING:
      84         323 :                 pHdl = new XMLPMPropHdl_Print( XML_DRAWINGS );
      85         323 :             break;
      86             :             case XML_PM_TYPE_PRINTFORMULAS:
      87         323 :                 pHdl = new XMLPMPropHdl_Print( XML_FORMULAS );
      88         323 :             break;
      89             :             case XML_PM_TYPE_PRINTGRID:
      90         323 :                 pHdl = new XMLPMPropHdl_Print( XML_GRID );
      91         323 :             break;
      92             :             case XML_PM_TYPE_PRINTHEADERS:
      93         323 :                 pHdl = new XMLPMPropHdl_Print( XML_HEADERS );
      94         323 :             break;
      95             :             case XML_PM_TYPE_PRINTOBJECTS:
      96         323 :                 pHdl = new XMLPMPropHdl_Print( XML_OBJECTS );
      97         323 :             break;
      98             :             case XML_PM_TYPE_PRINTZEROVALUES:
      99         323 :                 pHdl = new XMLPMPropHdl_Print( XML_ZERO_VALUES );
     100         323 :             break;
     101             :             case XML_PM_TYPE_PRINTPAGEORDER:
     102             :                 pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_TTB ),
     103         323 :                                                     GetXMLToken( XML_LTR ) );
     104         323 :             break;
     105             :             case XML_PM_TYPE_FIRSTPAGENUMBER:
     106         323 :                 pHdl = new XMLNumberNonePropHdl( XML_CONTINUE, 2 );
     107         323 :             break;
     108             :             case XML_PM_TYPE_CENTER_HORIZONTAL:
     109         323 :                 pHdl = new XMLPMPropHdl_CenterHorizontal();
     110         323 :             break;
     111             :             case XML_PM_TYPE_CENTER_VERTICAL:
     112         323 :                 pHdl = new XMLPMPropHdl_CenterVertical();
     113         323 :             break;
     114             :             case XML_TYPE_TEXT_COLUMNS:
     115         323 :                 pHdl = new XMLTextColumnsPropertyHandler;
     116         323 :             break;
     117             :             case XML_TYPE_LAYOUT_GRID_MODE:
     118             :                 pHdl = new XMLConstantsPropertyHandler(
     119         323 :                     aXML_TextGridMode_ConstantMap, XML_NONE );
     120         323 :             break;
     121             :         }
     122             : 
     123        5814 :         if( pHdl )
     124        5814 :             PutHdlCache( nType, pHdl );
     125             :     }
     126       42313 :     return pHdl;
     127             : }
     128             : 
     129             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10