bump product version to 5.0.4.1
[LibreOffice.git] / forms / source / component / FixedText.cxx
blobb281b509fe74b8955d9a82933f9b4c20b99588d3
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 "FixedText.hxx"
21 #include "services.hxx"
22 #include "property.hrc"
23 #include "property.hxx"
24 #include <comphelper/processfactory.hxx>
27 namespace frm
29 using namespace ::com::sun::star::uno;
30 using namespace ::com::sun::star::sdb;
31 using namespace ::com::sun::star::sdbc;
32 using namespace ::com::sun::star::sdbcx;
33 using namespace ::com::sun::star::beans;
34 using namespace ::com::sun::star::container;
35 using namespace ::com::sun::star::form;
36 using namespace ::com::sun::star::awt;
37 using namespace ::com::sun::star::io;
38 using namespace ::com::sun::star::lang;
39 using namespace ::com::sun::star::util;
42 OFixedTextModel::OFixedTextModel( const Reference<XComponentContext>& _rxFactory )
43 :OControlModel(_rxFactory, VCL_CONTROLMODEL_FIXEDTEXT)
46 m_nClassId = FormComponentType::FIXEDTEXT;
50 OFixedTextModel::OFixedTextModel( const OFixedTextModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
51 :OControlModel( _pOriginal, _rxFactory )
57 OFixedTextModel::~OFixedTextModel( )
62 IMPLEMENT_DEFAULT_CLONING( OFixedTextModel )
65 StringSequence SAL_CALL OFixedTextModel::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException, std::exception)
67 StringSequence aSupported = OControlModel::getSupportedServiceNames();
68 aSupported.realloc(aSupported.getLength() + 2);
70 OUString* pArray = aSupported.getArray();
71 pArray[aSupported.getLength()-2] = FRM_SUN_COMPONENT_FIXEDTEXT;
72 pArray[aSupported.getLength()-1] = FRM_COMPONENT_FIXEDTEXT;
73 return aSupported;
77 void OFixedTextModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const
79 OControlModel::describeAggregateProperties( _rAggregateProps );
80 RemoveProperty( _rAggregateProps, PROPERTY_TABSTOP );
84 OUString SAL_CALL OFixedTextModel::getServiceName() throw(RuntimeException, std::exception)
86 return OUString(FRM_COMPONENT_FIXEDTEXT); // old (non-sun) name for compatibility !
90 void SAL_CALL OFixedTextModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
91 throw(IOException, RuntimeException, std::exception)
93 OControlModel::write(_rxOutStream);
95 // Version
96 _rxOutStream->writeShort(0x0002);
97 writeHelpTextCompatibly(_rxOutStream);
101 void SAL_CALL OFixedTextModel::read(const Reference<XObjectInputStream>& _rxInStream) throw(IOException, RuntimeException, std::exception)
103 OControlModel::read(_rxInStream);
105 // Version
106 sal_Int16 nVersion = _rxInStream->readShort();
107 if (nVersion > 1)
108 readHelpTextCompatibly(_rxInStream);
113 extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
114 com_sun_star_form_OFixedTextModel_get_implementation(::com::sun::star::uno::XComponentContext* component,
115 ::com::sun::star::uno::Sequence<css::uno::Any> const &)
117 return cppu::acquire(new frm::OFixedTextModel(component));
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */