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

Generated by: LCOV version 1.10