Update git submodules
[LibreOffice.git] / xmloff / source / forms / handler / form_handler_factory.cxx
blob2a943aa82355fc3e411735472d4b1f7aac233fb6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <forms/form_handler_factory.hxx>
21 #include "vcl_date_handler.hxx"
22 #include "vcl_time_handler.hxx"
23 #include <osl/diagnose.h>
25 namespace xmloff
28 //= FormHandlerFactory
29 PPropertyHandler FormHandlerFactory::getFormPropertyHandler( const PropertyId i_propertyId )
31 PPropertyHandler pHandler;
33 switch ( i_propertyId )
35 case PID_DATE_MIN:
36 case PID_DATE_MAX:
37 case PID_DEFAULT_DATE:
38 case PID_DATE:
40 static PPropertyHandler s_pVCLDateHandler = new VCLDateHandler();
41 pHandler = s_pVCLDateHandler;
43 break;
45 case PID_TIME_MIN:
46 case PID_TIME_MAX:
47 case PID_DEFAULT_TIME:
48 case PID_TIME:
50 static PPropertyHandler s_pVCLTimeHandler = new VCLTimeHandler();
51 pHandler = s_pVCLTimeHandler;
53 break;
55 default:
56 OSL_ENSURE( false, "FormHandlerFactory::getFormPropertyHandler: unknown property ID!" );
57 break;
60 return pHandler;
63 } // namespace xmloff
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */