2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 15:33:13 +00:00
|
|
|
|
|
|
|
#include "FixedText.hxx"
|
2020-02-01 22:47:11 +01:00
|
|
|
#include <frm_strings.hxx>
|
2017-10-23 22:41:33 +02:00
|
|
|
#include <services.hxx>
|
2020-02-01 22:47:11 +01:00
|
|
|
|
|
|
|
#include <com/sun/star/form/FormComponentType.hpp>
|
2000-09-18 15:33:13 +00:00
|
|
|
|
2018-05-27 14:07:43 +02:00
|
|
|
#include <comphelper/property.hxx>
|
|
|
|
|
2015-02-12 14:10:24 +11:00
|
|
|
|
2000-09-18 15:33:13 +00:00
|
|
|
namespace frm
|
|
|
|
{
|
2000-11-23 07:48:15 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::sdb;
|
|
|
|
using namespace ::com::sun::star::sdbc;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
using namespace ::com::sun::star::container;
|
|
|
|
using namespace ::com::sun::star::form;
|
|
|
|
using namespace ::com::sun::star::awt;
|
|
|
|
using namespace ::com::sun::star::io;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::util;
|
2020-02-01 22:47:11 +01:00
|
|
|
using namespace comphelper;
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-06-03 08:34:09 +02:00
|
|
|
OFixedTextModel::OFixedTextModel( const Reference<XComponentContext>& _rxFactory )
|
2002-12-02 08:56:36 +00:00
|
|
|
:OControlModel(_rxFactory, VCL_CONTROLMODEL_FIXEDTEXT)
|
|
|
|
|
2000-09-18 15:33:13 +00:00
|
|
|
{
|
2002-12-02 08:56:36 +00:00
|
|
|
m_nClassId = FormComponentType::FIXEDTEXT;
|
2000-09-18 15:33:13 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-06-03 08:34:09 +02:00
|
|
|
OFixedTextModel::OFixedTextModel( const OFixedTextModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
|
2002-12-02 08:56:36 +00:00
|
|
|
:OControlModel( _pOriginal, _rxFactory )
|
2000-09-18 15:33:13 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2002-12-02 08:56:36 +00:00
|
|
|
OFixedTextModel::~OFixedTextModel( )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2021-11-07 15:40:37 +01:00
|
|
|
css::uno::Reference< css::util::XCloneable > SAL_CALL OFixedTextModel::createClone()
|
|
|
|
{
|
|
|
|
rtl::Reference<OFixedTextModel> pClone = new OFixedTextModel(this, getContext());
|
|
|
|
pClone->clonedFrom(this);
|
|
|
|
return pClone;
|
|
|
|
}
|
2002-12-02 08:56:36 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
css::uno::Sequence<OUString> SAL_CALL OFixedTextModel::getSupportedServiceNames()
|
2000-09-18 15:33:13 +00:00
|
|
|
{
|
2015-08-19 13:34:43 +02:00
|
|
|
css::uno::Sequence<OUString> aSupported = OControlModel::getSupportedServiceNames();
|
2015-03-17 12:25:11 +01:00
|
|
|
aSupported.realloc(aSupported.getLength() + 2);
|
2000-09-18 15:33:13 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString* pArray = aSupported.getArray();
|
2015-03-17 12:25:11 +01:00
|
|
|
pArray[aSupported.getLength()-2] = FRM_SUN_COMPONENT_FIXEDTEXT;
|
|
|
|
pArray[aSupported.getLength()-1] = FRM_COMPONENT_FIXEDTEXT;
|
2000-09-18 15:33:13 +00:00
|
|
|
return aSupported;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2007-03-09 12:25:06 +00:00
|
|
|
void OFixedTextModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const
|
2000-09-18 15:33:13 +00:00
|
|
|
{
|
2007-03-09 12:25:06 +00:00
|
|
|
OControlModel::describeAggregateProperties( _rAggregateProps );
|
2006-06-19 11:49:06 +00:00
|
|
|
RemoveProperty( _rAggregateProps, PROPERTY_TABSTOP );
|
2000-09-18 15:33:13 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
OUString SAL_CALL OFixedTextModel::getServiceName()
|
2000-09-18 15:33:13 +00:00
|
|
|
{
|
2019-07-30 17:54:50 +02:00
|
|
|
return FRM_COMPONENT_FIXEDTEXT; // old (non-sun) name for compatibility !
|
2000-09-18 15:33:13 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-11-23 07:48:15 +00:00
|
|
|
void SAL_CALL OFixedTextModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
|
2000-09-18 15:33:13 +00:00
|
|
|
{
|
|
|
|
OControlModel::write(_rxOutStream);
|
|
|
|
|
|
|
|
// Version
|
|
|
|
_rxOutStream->writeShort(0x0002);
|
2001-04-02 09:28:06 +00:00
|
|
|
writeHelpTextCompatibly(_rxOutStream);
|
2000-09-18 15:33:13 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
void SAL_CALL OFixedTextModel::read(const Reference<XObjectInputStream>& _rxInStream)
|
2000-09-18 15:33:13 +00:00
|
|
|
{
|
|
|
|
OControlModel::read(_rxInStream);
|
|
|
|
|
|
|
|
// Version
|
|
|
|
sal_Int16 nVersion = _rxInStream->readShort();
|
|
|
|
if (nVersion > 1)
|
2001-04-02 09:28:06 +00:00
|
|
|
readHelpTextCompatibly(_rxInStream);
|
2000-09-18 15:33:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2014-02-25 18:50:02 +01:00
|
|
|
|
2017-12-08 15:58:41 +02:00
|
|
|
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
|
2015-10-01 15:32:00 +02:00
|
|
|
com_sun_star_form_OFixedTextModel_get_implementation(css::uno::XComponentContext* component,
|
|
|
|
css::uno::Sequence<css::uno::Any> const &)
|
2015-02-12 14:10:24 +11:00
|
|
|
{
|
|
|
|
return cppu::acquire(new frm::OFixedTextModel(component));
|
|
|
|
}
|
2000-09-18 15:33:13 +00:00
|
|
|
|
2010-10-12 15:57:08 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|