LCOV - code coverage report
Current view: top level - xmloff/source/forms/handler - form_handler_factory.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 3 20 15.0 %
Date: 2014-11-03 Functions: 2 3 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             : #include "forms/form_handler_factory.hxx"
      21             : #include "vcl_date_handler.hxx"
      22             : #include "vcl_time_handler.hxx"
      23             : 
      24             : namespace xmloff
      25             : {
      26             : 
      27             :     namespace
      28             :     {
      29         233 :         static PPropertyHandler s_pVCLDateHandler = NULL;
      30         233 :         static PPropertyHandler s_pVCLTimeHandler = NULL;
      31             :     }
      32             : 
      33             :     //= FormHandlerFactory
      34           0 :     PPropertyHandler FormHandlerFactory::getFormPropertyHandler( const PropertyId i_propertyId )
      35             :     {
      36           0 :         PPropertyHandler pHandler( NULL );
      37             : 
      38           0 :         switch ( i_propertyId )
      39             :         {
      40             :         case PID_DATE_MIN:
      41             :         case PID_DATE_MAX:
      42             :         case PID_DEFAULT_DATE:
      43             :         case PID_DATE:
      44           0 :             if ( s_pVCLDateHandler.get() == NULL )
      45             :             {
      46           0 :                 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
      47           0 :                 if ( s_pVCLDateHandler == NULL )
      48           0 :                     s_pVCLDateHandler = new VCLDateHandler();
      49             :             }
      50           0 :             pHandler = s_pVCLDateHandler;
      51           0 :             break;
      52             : 
      53             :         case PID_TIME_MIN:
      54             :         case PID_TIME_MAX:
      55             :         case PID_DEFAULT_TIME:
      56             :         case PID_TIME:
      57           0 :             if ( s_pVCLTimeHandler.get() == NULL )
      58             :             {
      59           0 :                 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
      60           0 :                 if ( s_pVCLTimeHandler == NULL )
      61           0 :                     s_pVCLTimeHandler = new VCLTimeHandler();
      62             :             }
      63           0 :             pHandler = s_pVCLTimeHandler;
      64           0 :             break;
      65             : 
      66             :         default:
      67             :             OSL_ENSURE( false, "FormHandlerFactory::getFormPropertyHandler: unknown property ID!" );
      68           0 :             break;
      69             :         }
      70             : 
      71           0 :         return pHandler;
      72             :     }
      73             : 
      74         699 : } // namespace xmloff
      75             : 
      76             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10