2010-10-12 15:53:47 +02:00
|
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-11-17 18:03:33 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
*
|
2008-04-10 21:00:19 +00:00
|
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-11-17 18:03:33 +00:00
|
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-11-17 18:03:33 +00:00
|
|
|
|
*
|
2008-04-10 21:00:19 +00:00
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-11-17 18:03:33 +00:00
|
|
|
|
*
|
2008-04-10 21:00:19 +00:00
|
|
|
|
* This file is part of OpenOffice.org.
|
2000-11-17 18:03:33 +00:00
|
|
|
|
*
|
2008-04-10 21:00:19 +00:00
|
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-11-17 18:03:33 +00:00
|
|
|
|
*
|
2008-04-10 21:00:19 +00:00
|
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-11-17 18:03:33 +00:00
|
|
|
|
*
|
2008-04-10 21:00:19 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-11-17 18:03:33 +00:00
|
|
|
|
*
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
2006-09-17 09:33:50 +00:00
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
#include "elementexport.hxx"
|
|
|
|
|
#include "strings.hxx"
|
2010-04-16 23:04:00 +02:00
|
|
|
|
#include "xmloff/xmlnmspe.hxx"
|
2001-01-02 14:58:22 +00:00
|
|
|
|
#include "eventexport.hxx"
|
2004-05-07 14:59:18 +00:00
|
|
|
|
#include "formenums.hxx"
|
|
|
|
|
#include "formcellbinding.hxx"
|
2010-04-16 23:04:00 +02:00
|
|
|
|
#include "xmloff/xformsexport.hxx"
|
2010-09-15 13:55:34 +02:00
|
|
|
|
#include "property_meta_data.hxx"
|
2004-05-07 14:59:18 +00:00
|
|
|
|
|
|
|
|
|
#include <com/sun/star/text/XText.hpp>
|
2001-01-03 15:25:34 +00:00
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
|
#include <com/sun/star/io/XPersistObject.hpp>
|
2011-10-11 14:19:08 +02:00
|
|
|
|
#include <com/sun/star/util/Duration.hpp>
|
2000-11-17 18:03:33 +00:00
|
|
|
|
#include <com/sun/star/form/FormComponentType.hpp>
|
|
|
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
|
|
|
|
#include <com/sun/star/form/FormSubmitEncoding.hpp>
|
|
|
|
|
#include <com/sun/star/form/FormSubmitMethod.hpp>
|
|
|
|
|
#include <com/sun/star/sdb/CommandType.hpp>
|
|
|
|
|
#include <com/sun/star/form/NavigationBarMode.hpp>
|
|
|
|
|
#include <com/sun/star/form/TabulatorCycle.hpp>
|
|
|
|
|
#include <com/sun/star/form/FormButtonType.hpp>
|
2003-12-11 11:08:10 +00:00
|
|
|
|
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
|
2004-07-05 15:07:26 +00:00
|
|
|
|
#include <com/sun/star/awt/VisualEffect.hpp>
|
2000-11-17 18:03:33 +00:00
|
|
|
|
#include <com/sun/star/form/ListSourceType.hpp>
|
2004-07-05 15:07:26 +00:00
|
|
|
|
#include <com/sun/star/awt/ImagePosition.hpp>
|
2008-12-01 12:31:27 +00:00
|
|
|
|
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
|
#include <sax/tools/converter.hxx>
|
2009-10-18 15:05:21 +02:00
|
|
|
|
#include <tools/wintypes.hxx> // for check states
|
2007-06-27 14:13:42 +00:00
|
|
|
|
#include <xmloff/txtprmap.hxx>
|
2004-04-02 09:30:45 +00:00
|
|
|
|
#include <com/sun/star/form/binding/XBindableValue.hpp>
|
|
|
|
|
#include <com/sun/star/form/binding/XListEntrySink.hpp>
|
2004-08-02 13:13:42 +00:00
|
|
|
|
#include <tools/urlobj.hxx>
|
2008-12-01 12:31:27 +00:00
|
|
|
|
#include <xmloff/xmlexp.hxx>
|
|
|
|
|
#include <xmloff/nmspmap.hxx>
|
|
|
|
|
#include <xmloff/XMLEventExport.hxx>
|
|
|
|
|
#include <xmloff/xmluconv.hxx>
|
|
|
|
|
#include <xmloff/xmltoken.hxx>
|
|
|
|
|
#include <tools/time.hxx>
|
|
|
|
|
#include <tools/diagnose_ex.h>
|
|
|
|
|
#include <comphelper/extract.hxx>
|
2010-10-14 22:33:33 +01:00
|
|
|
|
#include <sal/macros.h>
|
2004-08-02 13:13:42 +00:00
|
|
|
|
|
2008-12-01 12:31:27 +00:00
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <algorithm>
|
2004-08-02 13:13:42 +00:00
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
//.........................................................................
|
|
|
|
|
namespace xmloff
|
|
|
|
|
{
|
|
|
|
|
//.........................................................................
|
|
|
|
|
|
2008-12-01 12:31:27 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
|
|
|
|
#define RESET_BIT( bitfield, bit ) \
|
|
|
|
|
bitfield = bitfield & ~bit
|
|
|
|
|
#else
|
|
|
|
|
#define RESET_BIT( bitfield, bit )
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-07-05 15:07:26 +00:00
|
|
|
|
using namespace ::xmloff::token;
|
2011-10-11 14:19:08 +02:00
|
|
|
|
using namespace ::com::sun::star;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
|
using namespace ::com::sun::star::sdb;
|
2003-12-11 11:08:10 +00:00
|
|
|
|
using namespace ::com::sun::star::awt;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
using namespace ::com::sun::star::form;
|
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
|
using namespace ::com::sun::star::container;
|
2001-01-02 14:58:22 +00:00
|
|
|
|
using namespace ::com::sun::star::script;
|
2001-01-03 15:25:34 +00:00
|
|
|
|
using namespace ::com::sun::star::io;
|
2003-10-21 07:38:16 +00:00
|
|
|
|
using namespace ::com::sun::star::table;
|
2004-05-07 14:59:18 +00:00
|
|
|
|
using namespace ::com::sun::star::text;
|
2004-04-02 09:30:45 +00:00
|
|
|
|
using namespace ::com::sun::star::form::binding;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
|
|
|
|
//=====================================================================
|
2001-01-02 14:58:22 +00:00
|
|
|
|
//= OElementExport
|
2000-11-17 18:03:33 +00:00
|
|
|
|
//=====================================================================
|
2001-01-02 14:58:22 +00:00
|
|
|
|
OElementExport::OElementExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxProps,
|
|
|
|
|
const Sequence< ScriptEventDescriptor >& _rEvents)
|
|
|
|
|
:OPropertyExport(_rContext, _rxProps)
|
|
|
|
|
,m_aEvents(_rEvents)
|
2000-11-17 18:03:33 +00:00
|
|
|
|
,m_pXMLElement(NULL)
|
2000-11-19 14:41:32 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2001-01-02 14:58:22 +00:00
|
|
|
|
OElementExport::~OElementExport()
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2001-01-02 14:58:22 +00:00
|
|
|
|
implEndElement();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OElementExport::doExport()
|
|
|
|
|
{
|
|
|
|
|
// collect some general information about the element
|
2000-11-17 18:03:33 +00:00
|
|
|
|
examine();
|
|
|
|
|
|
2001-01-02 14:58:22 +00:00
|
|
|
|
// first add the attributes necessary for the element
|
|
|
|
|
m_rContext.getGlobalContext().ClearAttrList();
|
|
|
|
|
|
|
|
|
|
// add the attributes
|
|
|
|
|
exportAttributes();
|
|
|
|
|
|
|
|
|
|
// start the XML element
|
|
|
|
|
implStartElement(getXMLElementName());
|
2000-11-19 14:41:32 +00:00
|
|
|
|
|
|
|
|
|
// the sub elements (mostly control type dependent)
|
|
|
|
|
exportSubTags();
|
2001-01-02 14:58:22 +00:00
|
|
|
|
|
|
|
|
|
implEndElement();
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2001-01-02 14:58:22 +00:00
|
|
|
|
void OElementExport::examine()
|
|
|
|
|
{
|
|
|
|
|
// nothing to do here
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OElementExport::exportAttributes()
|
|
|
|
|
{
|
|
|
|
|
// nothing to do here
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OElementExport::exportSubTags()
|
|
|
|
|
{
|
|
|
|
|
// the properties which where not exported 'til now
|
|
|
|
|
exportRemainingProperties();
|
|
|
|
|
|
|
|
|
|
// the script:events sub tags
|
|
|
|
|
exportEvents();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OElementExport::implStartElement(const sal_Char* _pName)
|
|
|
|
|
{
|
|
|
|
|
m_pXMLElement = new SvXMLElementExport(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, _pName, sal_True, sal_True);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OElementExport::implEndElement()
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
|
|
|
|
delete m_pXMLElement;
|
2001-01-02 14:58:22 +00:00
|
|
|
|
m_pXMLElement = NULL;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-03 15:25:34 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OElementExport::exportServiceNameAttribute()
|
|
|
|
|
{
|
|
|
|
|
Reference< XPersistObject > xPersistence(m_xProps, UNO_QUERY);
|
|
|
|
|
if (!xPersistence.is())
|
|
|
|
|
{
|
2011-03-19 14:09:49 +01:00
|
|
|
|
OSL_FAIL("OElementExport::exportServiceNameAttribute: no XPersistObject!");
|
2001-01-03 15:25:34 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::rtl::OUString sServiceName = xPersistence->getServiceName();
|
|
|
|
|
// we don't want to write the old service name directly: it's a name used for compatibility reasons, but
|
|
|
|
|
// as we start some kind of new file format here (with this xml export), we don't care about
|
|
|
|
|
// compatibility ...
|
|
|
|
|
// So we translate the old persistence service name into new ones, if possible
|
|
|
|
|
|
|
|
|
|
::rtl::OUString sToWriteServiceName = sServiceName;
|
|
|
|
|
#define CHECK_N_TRANSLATE( name ) \
|
2012-05-17 14:00:15 +01:00
|
|
|
|
else if (sServiceName.equalsAsciiL(SERVICE_PERSISTENT_COMPONENT_##name.ascii, SERVICE_PERSISTENT_COMPONENT_##name.length)) \
|
2001-01-03 15:25:34 +00:00
|
|
|
|
sToWriteServiceName = SERVICE_##name
|
|
|
|
|
|
|
|
|
|
if (sal_False)
|
|
|
|
|
;
|
|
|
|
|
CHECK_N_TRANSLATE( FORM );
|
|
|
|
|
CHECK_N_TRANSLATE( FORM );
|
|
|
|
|
CHECK_N_TRANSLATE( LISTBOX );
|
|
|
|
|
CHECK_N_TRANSLATE( COMBOBOX );
|
|
|
|
|
CHECK_N_TRANSLATE( RADIOBUTTON );
|
|
|
|
|
CHECK_N_TRANSLATE( GROUPBOX );
|
|
|
|
|
CHECK_N_TRANSLATE( FIXEDTEXT );
|
|
|
|
|
CHECK_N_TRANSLATE( COMMANDBUTTON );
|
|
|
|
|
CHECK_N_TRANSLATE( CHECKBOX );
|
|
|
|
|
CHECK_N_TRANSLATE( GRID );
|
|
|
|
|
CHECK_N_TRANSLATE( IMAGEBUTTON );
|
|
|
|
|
CHECK_N_TRANSLATE( FILECONTROL );
|
|
|
|
|
CHECK_N_TRANSLATE( TIMEFIELD );
|
|
|
|
|
CHECK_N_TRANSLATE( DATEFIELD );
|
|
|
|
|
CHECK_N_TRANSLATE( NUMERICFIELD );
|
|
|
|
|
CHECK_N_TRANSLATE( CURRENCYFIELD );
|
|
|
|
|
CHECK_N_TRANSLATE( PATTERNFIELD );
|
|
|
|
|
CHECK_N_TRANSLATE( HIDDENCONTROL );
|
|
|
|
|
CHECK_N_TRANSLATE( IMAGECONTROL );
|
|
|
|
|
CHECK_N_TRANSLATE( FORMATTEDFIELD );
|
2012-05-17 14:00:15 +01:00
|
|
|
|
else if (sServiceName.equalsAsciiL(SERVICE_PERSISTENT_COMPONENT_EDIT.ascii, SERVICE_PERSISTENT_COMPONENT_EDIT.length))
|
|
|
|
|
{
|
|
|
|
|
// special handling for the edit field: we have two controls using this as persistence service name
|
2001-01-03 15:25:34 +00:00
|
|
|
|
sToWriteServiceName = SERVICE_EDIT;
|
|
|
|
|
Reference< XServiceInfo > xSI(m_xProps, UNO_QUERY);
|
|
|
|
|
if (xSI.is() && xSI->supportsService(SERVICE_FORMATTEDFIELD))
|
|
|
|
|
sToWriteServiceName = SERVICE_FORMATTEDFIELD;
|
|
|
|
|
}
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2001-01-03 15:25:34 +00:00
|
|
|
|
Reference< XServiceInfo > xSI(m_xProps, UNO_QUERY);
|
|
|
|
|
OSL_ENSURE(xSI.is() && xSI->supportsService(sToWriteServiceName),
|
|
|
|
|
"OElementExport::exportServiceNameAttribute: wrong service name translation!");
|
|
|
|
|
|
|
|
|
|
#endif
|
2004-07-13 07:11:47 +00:00
|
|
|
|
sToWriteServiceName =
|
|
|
|
|
m_rContext.getGlobalContext().GetNamespaceMap().GetQNameByKey(
|
|
|
|
|
XML_NAMESPACE_OOO, sToWriteServiceName );
|
2001-01-03 15:25:34 +00:00
|
|
|
|
|
|
|
|
|
// now write this
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_SERVICE_NAME),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_SERVICE_NAME),
|
2001-01-03 15:25:34 +00:00
|
|
|
|
sToWriteServiceName);
|
|
|
|
|
}
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
2001-01-02 14:58:22 +00:00
|
|
|
|
void OElementExport::exportEvents()
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2001-01-02 14:58:22 +00:00
|
|
|
|
if (!m_aEvents.getLength())
|
|
|
|
|
// nothing to do
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Reference< XNameReplace > xWrapper = new OEventDescriptorMapper(m_aEvents);
|
|
|
|
|
m_rContext.getGlobalContext().GetEventExport().Export(xWrapper);
|
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
2001-01-02 14:58:22 +00:00
|
|
|
|
//=====================================================================
|
|
|
|
|
//= OControlExport
|
|
|
|
|
//=====================================================================
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
OControlExport::OControlExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxControl,
|
|
|
|
|
const ::rtl::OUString& _rControlId, const ::rtl::OUString& _rReferringControls,
|
|
|
|
|
const Sequence< ScriptEventDescriptor >& _rEvents)
|
|
|
|
|
:OElementExport(_rContext, _rxControl, _rEvents)
|
|
|
|
|
,m_sControlId(_rControlId)
|
|
|
|
|
,m_sReferringControls(_rReferringControls)
|
2006-06-19 17:16:39 +00:00
|
|
|
|
,m_nClassId(FormComponentType::CONTROL)
|
|
|
|
|
,m_eType( UNKNOWN )
|
2001-01-02 14:58:22 +00:00
|
|
|
|
,m_nIncludeCommon(0)
|
|
|
|
|
,m_nIncludeDatabase(0)
|
|
|
|
|
,m_nIncludeSpecial(0)
|
|
|
|
|
,m_nIncludeEvents(0)
|
2003-10-21 07:38:16 +00:00
|
|
|
|
,m_nIncludeBindings(0)
|
2001-01-03 15:25:34 +00:00
|
|
|
|
,m_pOuterElement(NULL)
|
2001-01-02 14:58:22 +00:00
|
|
|
|
{
|
|
|
|
|
OSL_ENSURE(m_xProps.is(), "OControlExport::OControlExport: invalid arguments!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2001-01-03 15:25:34 +00:00
|
|
|
|
OControlExport::~OControlExport()
|
|
|
|
|
{
|
|
|
|
|
implEndElement();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportOuterAttributes()
|
|
|
|
|
{
|
|
|
|
|
// the control id
|
|
|
|
|
if (CCA_NAME & m_nIncludeCommon)
|
|
|
|
|
{
|
|
|
|
|
exportStringPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_NAME),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_NAME),
|
2001-01-03 15:25:34 +00:00
|
|
|
|
PROPERTY_NAME
|
|
|
|
|
);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2001-01-03 15:25:34 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_NAME;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// the service name
|
|
|
|
|
if (m_nIncludeCommon & CCA_SERVICE_NAME)
|
|
|
|
|
{
|
|
|
|
|
exportServiceNameAttribute();
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2001-01-03 15:25:34 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_SERVICE_NAME;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2007-05-10 08:41:07 +00:00
|
|
|
|
}
|
2001-01-03 15:25:34 +00:00
|
|
|
|
|
2007-05-10 08:41:07 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportInnerAttributes()
|
|
|
|
|
{
|
2001-01-03 15:25:34 +00:00
|
|
|
|
// the control id
|
|
|
|
|
if (CCA_CONTROL_ID & m_nIncludeCommon)
|
|
|
|
|
{
|
2012-01-25 21:59:48 -02:00
|
|
|
|
OSL_ENSURE(!m_sControlId.isEmpty(), "OControlExport::exportInnerAttributes: have no control id for the control!");
|
2010-04-19 18:27:16 +02:00
|
|
|
|
m_rContext.getGlobalContext().AddAttributeIdLegacy(
|
|
|
|
|
XML_NAMESPACE_FORM, m_sControlId);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2001-01-03 15:25:34 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_CONTROL_ID;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-15 13:55:34 +02:00
|
|
|
|
// "new-style" properties ...
|
|
|
|
|
exportGenericHandlerAttributes();
|
|
|
|
|
|
2000-11-19 14:41:32 +00:00
|
|
|
|
// common control attributes
|
2000-11-17 18:03:33 +00:00
|
|
|
|
exportCommonControlAttributes();
|
|
|
|
|
|
2000-11-19 14:41:32 +00:00
|
|
|
|
// common database attributes
|
2000-11-17 18:03:33 +00:00
|
|
|
|
exportDatabaseAttributes();
|
|
|
|
|
|
2003-10-21 07:38:16 +00:00
|
|
|
|
// attributes related to external bindings
|
|
|
|
|
exportBindingAtributes();
|
|
|
|
|
|
2000-11-19 14:41:32 +00:00
|
|
|
|
// attributes special to the respective control type
|
2000-11-17 18:03:33 +00:00
|
|
|
|
exportSpecialAttributes();
|
|
|
|
|
|
2000-11-19 14:41:32 +00:00
|
|
|
|
// add the style references to the attributes
|
2001-02-01 08:46:47 +00:00
|
|
|
|
flagStyleProperties();
|
2001-01-03 15:25:34 +00:00
|
|
|
|
}
|
2000-11-19 14:41:32 +00:00
|
|
|
|
|
2001-01-03 15:25:34 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportAttributes()
|
|
|
|
|
{
|
|
|
|
|
exportOuterAttributes();
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2000-11-19 14:41:32 +00:00
|
|
|
|
void OControlExport::exportSubTags() throw (Exception)
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
// for the upcoming exportRemainingProperties:
|
|
|
|
|
// if a control has the LabelControl property, this is not stored with the control itself, but instead with
|
|
|
|
|
// the control which is referenced by this property. As the base class' exportRemainingProperties doesn't
|
|
|
|
|
// know anything about this, we need to prevent that it tries to export this property
|
|
|
|
|
exportedProperty(PROPERTY_CONTROLLABEL);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
2004-05-07 14:59:18 +00:00
|
|
|
|
// if it's a control supporting XText, then we need to declare all text-related properties
|
|
|
|
|
// as "already exported". This prevents them from being exported as generic "form:property"-tags.
|
|
|
|
|
// *If* we would export them this way, they would be completely superfluous, and sometimes even
|
|
|
|
|
// disastrous, since they may, at import time, override paragraph properties which already have
|
|
|
|
|
// been set before
|
2004-11-26 12:01:22 +00:00
|
|
|
|
Reference< XText > xControlText( m_xProps, UNO_QUERY );
|
|
|
|
|
if ( xControlText.is() )
|
2004-05-07 14:59:18 +00:00
|
|
|
|
{
|
2004-11-26 12:01:22 +00:00
|
|
|
|
const XMLPropertyMapEntry* pCharAttributeProperties = XMLTextPropertySetMapper::getPropertyMapForType( TEXT_PROP_MAP_TEXT );
|
|
|
|
|
while ( pCharAttributeProperties->msApiName )
|
2004-05-07 14:59:18 +00:00
|
|
|
|
{
|
2004-11-26 12:01:22 +00:00
|
|
|
|
exportedProperty( ::rtl::OUString::createFromAscii( pCharAttributeProperties->msApiName ) );
|
|
|
|
|
++pCharAttributeProperties;
|
|
|
|
|
}
|
2004-05-07 14:59:18 +00:00
|
|
|
|
|
2004-11-26 12:01:22 +00:00
|
|
|
|
const XMLPropertyMapEntry* pParaAttributeProperties = XMLTextPropertySetMapper::getPropertyMapForType( TEXT_PROP_MAP_SHAPE_PARA );
|
|
|
|
|
while ( pParaAttributeProperties->msApiName )
|
|
|
|
|
{
|
|
|
|
|
exportedProperty( ::rtl::OUString::createFromAscii( pParaAttributeProperties->msApiName ) );
|
|
|
|
|
++pParaAttributeProperties;
|
2004-05-07 14:59:18 +00:00
|
|
|
|
}
|
2004-11-26 12:01:22 +00:00
|
|
|
|
|
|
|
|
|
// the RichText property is not exported. The presence of the text:p element
|
|
|
|
|
// will be used - upon reading - as indicator for the value of the RichText property
|
|
|
|
|
exportedProperty( PROPERTY_RICH_TEXT );
|
|
|
|
|
|
|
|
|
|
// strange thing: paragraphs support both a CharStrikeout and a CharCrossedOut property
|
|
|
|
|
// The former is a short/enum value, the latter a boolean. The former has a real meaning
|
|
|
|
|
// (the strikeout type), the latter hasn't. But, when the CharCrossedOut is exported and
|
|
|
|
|
// later on imported, it overwrites anything which has previously been imported for
|
|
|
|
|
// CharStrikeout.
|
2011-03-04 00:11:22 +01:00
|
|
|
|
// #i27729#
|
2004-11-26 12:01:22 +00:00
|
|
|
|
exportedProperty( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharCrossedOut" ) ) );
|
2004-05-07 14:59:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-07-26 06:31:26 +00:00
|
|
|
|
if ( m_eType == LISTBOX )
|
|
|
|
|
{
|
|
|
|
|
// will be exported in exportListSourceAsElements:
|
|
|
|
|
if ( controlHasUserSuppliedListEntries() )
|
|
|
|
|
exportedProperty( PROPERTY_DEFAULT_SELECT_SEQ );
|
|
|
|
|
|
|
|
|
|
// will not be exported in a generic way. Either exportListSourceAsElements cares
|
|
|
|
|
// for them, or we don't need them
|
|
|
|
|
exportedProperty( PROPERTY_STRING_ITEM_LIST );
|
|
|
|
|
exportedProperty( PROPERTY_VALUE_SEQ );
|
|
|
|
|
exportedProperty( PROPERTY_SELECT_SEQ );
|
|
|
|
|
exportedProperty( PROPERTY_LISTSOURCE );
|
|
|
|
|
}
|
|
|
|
|
if ( m_eType == COMBOBOX )
|
|
|
|
|
exportedProperty( PROPERTY_STRING_ITEM_LIST );
|
|
|
|
|
|
2001-01-02 14:58:22 +00:00
|
|
|
|
// let the base class export the remaining properties and the events
|
|
|
|
|
OElementExport::exportSubTags();
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
|
|
|
|
// special sub tags for some controls
|
|
|
|
|
switch (m_eType)
|
|
|
|
|
{
|
|
|
|
|
case LISTBOX:
|
2004-06-28 16:04:36 +00:00
|
|
|
|
// don't export the list entries if the are not provided by the user, but obtained implicitly
|
|
|
|
|
// from other sources
|
2011-03-04 00:11:22 +01:00
|
|
|
|
// #i26944#
|
2004-06-28 16:04:36 +00:00
|
|
|
|
if ( controlHasUserSuppliedListEntries() )
|
|
|
|
|
exportListSourceAsElements();
|
2000-11-17 18:03:33 +00:00
|
|
|
|
break;
|
|
|
|
|
case GRID:
|
|
|
|
|
{ // a grid control requires us to store all columns as sub elements
|
2000-11-19 14:41:32 +00:00
|
|
|
|
Reference< XIndexAccess > xColumnContainer(m_xProps, UNO_QUERY);
|
|
|
|
|
OSL_ENSURE(xColumnContainer.is(), "OControlExport::exportSubTags: a grid control which is no IndexAccess?!!");
|
|
|
|
|
if (xColumnContainer.is())
|
2000-12-18 14:14:35 +00:00
|
|
|
|
m_rContext.exportCollectionElements(xColumnContainer);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case COMBOBOX:
|
|
|
|
|
{ // a combox box description has sub elements: the items
|
2002-10-25 06:53:45 +00:00
|
|
|
|
DBG_CHECK_PROPERTY( PROPERTY_STRING_ITEM_LIST, Sequence< ::rtl::OUString > );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
2004-06-28 16:04:36 +00:00
|
|
|
|
// don't export the list entries if the are not provided by the user, but obtained implicitly
|
|
|
|
|
// from other sources
|
2011-03-04 00:11:22 +01:00
|
|
|
|
// #i26944#
|
2004-06-28 16:04:36 +00:00
|
|
|
|
if ( controlHasUserSuppliedListEntries() )
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2004-06-28 16:04:36 +00:00
|
|
|
|
// get the item list
|
|
|
|
|
Sequence< ::rtl::OUString > aListItems;
|
|
|
|
|
m_xProps->getPropertyValue(PROPERTY_STRING_ITEM_LIST) >>= aListItems;
|
|
|
|
|
// loop through it and write the sub elements
|
|
|
|
|
const ::rtl::OUString* pListItems = aListItems.getConstArray();
|
|
|
|
|
for (sal_Int32 i=0; i<aListItems.getLength(); ++i, ++pListItems)
|
|
|
|
|
{
|
|
|
|
|
m_rContext.getGlobalContext().ClearAttrList();
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_LABEL),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL),
|
2004-06-28 16:04:36 +00:00
|
|
|
|
*pListItems);
|
|
|
|
|
SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "item", sal_True, sal_True);
|
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2004-05-07 14:59:18 +00:00
|
|
|
|
|
|
|
|
|
case TEXT_AREA:
|
|
|
|
|
{
|
|
|
|
|
// if we act as rich text control, we need to export some text:p elements
|
|
|
|
|
if ( xControlText.is() )
|
|
|
|
|
{
|
|
|
|
|
sal_Bool bActingAsRichText = sal_False;
|
|
|
|
|
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_RICH_TEXT ) )
|
|
|
|
|
{
|
|
|
|
|
OSL_VERIFY(m_xProps->getPropertyValue( PROPERTY_RICH_TEXT ) >>= bActingAsRichText );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( bActingAsRichText )
|
|
|
|
|
m_rContext.getGlobalContext().GetTextParagraphExport()->exportText( xControlText );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2006-06-19 17:16:39 +00:00
|
|
|
|
default:
|
|
|
|
|
// nothing do to
|
|
|
|
|
break;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-15 13:55:34 +02:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportGenericHandlerAttributes()
|
|
|
|
|
{
|
|
|
|
|
const Sequence< Property > aProperties = m_xPropertyInfo->getProperties();
|
|
|
|
|
for ( const Property* prop = aProperties.getConstArray();
|
|
|
|
|
prop != aProperties.getConstArray() + aProperties.getLength();
|
|
|
|
|
++prop
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// see if this property can already be handled with an IPropertyHandler (which, on the long
|
|
|
|
|
// term, should be the case for most, if not all, properties)
|
|
|
|
|
const PropertyDescription* propDescription = metadata::getPropertyDescription( prop->Name );
|
|
|
|
|
if ( propDescription == NULL )
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
// let the factory provide the concrete handler. Note that caching, if desired, is the task
|
|
|
|
|
// of the factory
|
|
|
|
|
PPropertyHandler handler = (*propDescription->factory)( propDescription->propertyId );
|
2012-01-15 11:48:11 +01:00
|
|
|
|
if ( !handler.get() )
|
|
|
|
|
{
|
|
|
|
|
SAL_WARN( "xmloff.forms", "OControlExport::exportGenericHandlerAttributes: invalid property handler provided by the factory!" );
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2010-09-15 13:55:34 +02:00
|
|
|
|
|
|
|
|
|
::rtl::OUString attributeValue;
|
|
|
|
|
if ( propDescription->propertyGroup == NO_GROUP )
|
|
|
|
|
{
|
|
|
|
|
// that's a property which has a direct mapping to an attribute
|
|
|
|
|
if ( !shouldExportProperty( prop->Name ) )
|
|
|
|
|
// TODO: in the future, we surely need a more sophisticated approach to this, involving the property
|
|
|
|
|
// handler, or the property description
|
|
|
|
|
{
|
|
|
|
|
exportedProperty( prop->Name );
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Any propValue = m_xProps->getPropertyValue( prop->Name );
|
|
|
|
|
attributeValue = handler->getAttributeValue( propValue );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// that's a property which is part of a group of properties, whose values, in their entity, comprise
|
|
|
|
|
// a single attribute value
|
|
|
|
|
|
|
|
|
|
// retrieve the descriptions of all other properties which add to the attribute value
|
|
|
|
|
PropertyDescriptionList descriptions;
|
|
|
|
|
metadata::getPropertyGroup( propDescription->propertyGroup, descriptions );
|
|
|
|
|
|
|
|
|
|
// retrieve the values for all those properties
|
|
|
|
|
PropertyValues aValues;
|
2010-09-16 09:27:49 +02:00
|
|
|
|
for ( PropertyDescriptionList::iterator desc = descriptions.begin();
|
|
|
|
|
desc != descriptions.end();
|
|
|
|
|
++desc
|
2010-09-15 13:55:34 +02:00
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
// TODO: XMultiPropertySet?
|
2010-09-16 09:27:49 +02:00
|
|
|
|
const Any propValue = m_xProps->getPropertyValue( (*desc)->propertyName );
|
|
|
|
|
aValues[ (*desc)->propertyId ] = propValue;
|
2010-09-15 13:55:34 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// let the handler translate into an XML attribute value
|
|
|
|
|
attributeValue = handler->getAttributeValue( aValues );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AddAttribute(
|
|
|
|
|
propDescription->attribute.namespacePrefix,
|
|
|
|
|
token::GetXMLToken( propDescription->attribute.attributeToken ),
|
|
|
|
|
attributeValue
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
exportedProperty( prop->Name );
|
|
|
|
|
}
|
|
|
|
|
catch( const Exception& )
|
|
|
|
|
{
|
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportCommonControlAttributes()
|
|
|
|
|
{
|
2006-06-19 17:16:39 +00:00
|
|
|
|
size_t i=0;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
|
|
|
|
// I decided to handle all the properties here with some static arrays describing the property-attribute
|
|
|
|
|
// relations. This leads to somewhat ugly code :), but the only alternative I can think of right now
|
|
|
|
|
// would require maps and O(log n) searches, which seems somewhat expensive as this code is used
|
|
|
|
|
// very frequently.
|
|
|
|
|
|
|
|
|
|
// the extra indents for the respective blocks are to ensure that there is no copy'n'paste error, using
|
|
|
|
|
// map identifiers from the wrong block
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
2000-11-19 14:41:32 +00:00
|
|
|
|
// some string properties
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
|
|
|
|
// the attribute ids of all properties which are expected to be of type string
|
|
|
|
|
static sal_Int32 nStringPropertyAttributeIds[] =
|
|
|
|
|
{
|
2002-08-22 06:36:10 +00:00
|
|
|
|
CCA_LABEL, CCA_TITLE
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
|
|
|
|
// the names of all properties which are expected to be of type string
|
2002-10-25 06:53:45 +00:00
|
|
|
|
static ::rtl::OUString aStringPropertyNames[] =
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2002-08-22 06:36:10 +00:00
|
|
|
|
PROPERTY_LABEL, PROPERTY_TITLE
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2012-05-29 17:23:51 +01:00
|
|
|
|
OSL_ENSURE( sizeof(aStringPropertyNames)/sizeof(aStringPropertyNames[0]) ==
|
|
|
|
|
sizeof(nStringPropertyAttributeIds)/sizeof(nStringPropertyAttributeIds[0]),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
"OControlExport::exportCommonControlAttributes: somebody tampered with the maps (1)!");
|
|
|
|
|
|
2012-05-29 17:23:51 +01:00
|
|
|
|
for (i=0; i<sizeof(nStringPropertyAttributeIds)/sizeof(nStringPropertyAttributeIds[0]); ++i)
|
2000-11-17 18:03:33 +00:00
|
|
|
|
if (nStringPropertyAttributeIds[i] & m_nIncludeCommon)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportStringPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(nStringPropertyAttributeIds[i]),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(nStringPropertyAttributeIds[i]),
|
2002-10-25 06:53:45 +00:00
|
|
|
|
aStringPropertyNames[i]
|
2000-11-17 18:03:33 +00:00
|
|
|
|
);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~nStringPropertyAttributeIds[i];
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
// some boolean properties
|
|
|
|
|
{
|
|
|
|
|
static sal_Int32 nBooleanPropertyAttributeIds[] =
|
|
|
|
|
{ // attribute flags
|
CWS-TOOLING: integrate CWS dba32c
2009-06-29 20:53:25 +0200 fs r273484 : #i103138# Rectangle conversion
2009-06-29 20:51:50 +0200 fs r273483 : #i103138# yet more refactoring, now also setting the proper zoom level at the proper point in time
2009-06-29 13:40:26 +0200 fs r273470 : added svn:ignore to ignore output paths
2009-06-29 10:08:54 +0200 fs r273455 : #i103138#
refactored the code for positioning/zooming the control
Basically, we now allow adjustControlGeometry_throw (formerly known as positionControl_throw and setControlZoom) to
take an additional ViewTransformation parameter, describing the transformation to obtain the actual
control position/size. Consequently, positionControl itself also allows for a ViewTransformation parameter.
This has become necessary since during painting, the device which we created our control for might not necessarily
have a proper MapMode set. In this case, if we would use this map mode for calculating the control's position/size,
this would lead to wrong results.
Note that this problem was introduced by the fix for #i101398#: During the fix, we postponed the control creation
to a later time (when it is really needed). At this later time, the MapMode at the device is broken, at the earlier
time where we formerly crearted the control (createPrimitive2DSequence), it is not yet broken.
Whether or not the MapMode is defined as "broken" might depend on one's point of view, however ...
I consider it broken, since:
- we need the map mode to obtain the proper zoom level, which is to be forwarded to the control
- there are scenarios where the MapMode is *not* set to MAP_PIXEL (in those scenarios, everything works
fine), and there are scenarios where it *is* set to MAP_PIXEL (in those the bug 103138 appears).
It somehow feels wrong that one cannot rely on the device's map mode this way, but on the other hand
one has no possibility to obtain the current zoom by other means.
Note that one issue (still to be submitted) is left: In the page pane of a Draw/Impress document, controls
have a wrong text size. This is because in this pane, the above-mentioned "broken" map mode is used,
which means the controls have a zoom of "1:1" set, which is wrong here.
2009-06-25 13:41:35 +0200 msc r273380 : #100000# the tabs changed die to new properties
2009-06-24 12:42:40 +0200 msc r273330 : #102082# remove issue warning
2009-06-22 10:43:14 +0200 fs r273201 : createPrimitive2DSequence: care for being disposed
2009-06-18 12:35:13 +0200 oj r273109 : #i102305# make nooptfiles for gcc
2009-06-17 12:14:37 +0200 oj r273056 : #i102305# fix for linux
2009-06-17 07:20:22 +0200 oj r273046 : #i102305# move ValueTransfer into the for loop to avoid a crash under Linux
2009-06-17 07:17:28 +0200 oj r273045 : #i102305# use varchar
2009-06-15 14:11:27 +0200 fs r272983 : added since tag
2009-06-15 12:11:39 +0200 oj r272973 : #i102305# SAL_DLLPUBLIC_EXPORT inserted
2009-06-15 11:08:53 +0200 fs r272969 : #i10000#
2009-06-15 09:25:13 +0200 fs r272963 : merging fix for P1 issue #i102701#
2009-06-11 11:31:24 +0200 fs r272858 : #i10000# copied the fix which before the rebase was done in ../dialog/macropg.src
2009-06-11 09:38:14 +0200 fs r272846 : CWS-TOOLING: rebase CWS dba32c to trunk@272827 (milestone: DEV300:m50)
2009-06-02 09:53:10 +0200 fs r272483 : #i10000#
2009-05-29 15:55:03 +0200 fs r272465 : #i100818#
2009-05-29 12:58:43 +0200 fs r272452 : don't apply comphelper::getString on possibly VOID any
2009-05-29 10:38:35 +0200 oj r272437 : #i101519# handle where condition
2009-05-29 09:53:39 +0200 fs r272434 : #i100818# call into releaseStubs /without/ locked GlobalMutex
2009-05-28 07:53:44 +0200 oj r272375 : #i101369# parse tree changed
2009-05-27 14:53:36 +0200 fs r272347 : #i10000#
2009-05-27 09:29:15 +0200 oj r272327 : #i101626# check for double before hard cast
2009-05-27 09:13:58 +0200 oj r272326 : #i101626# handle void correctly
2009-05-27 08:04:39 +0200 oj r272321 : #i102256# wrong method signature used
2009-05-27 07:55:52 +0200 oj r272320 : #i101519# look up parameter typ if used in function
2009-05-27 06:49:07 +0200 oj r272319 : #i101519# set parameter from rowset as well
2009-05-26 13:30:56 +0200 oj r272297 : #i101987# impl XBatchExecution
2009-05-26 12:44:34 +0200 oj r272293 : #i101700# check if group is not set
2009-05-26 12:16:53 +0200 oj r272290 : #i101369# resolved some reduce7reduce problems with boolean_term and search_condition
2009-05-26 12:12:42 +0200 oj r272289 : #i101369# fix for or on one line criteria
2009-05-25 16:02:25 +0200 fs r272257 : #i999704# +PROPERTY_MOUSE_WHEEL_BEHAVIOR
2009-05-25 16:01:55 +0200 fs r272256 : merging the changes from CWS dba32b herein
2009-05-25 15:49:57 +0200 fs r272254 : #i999704#
2009-05-25 15:32:57 +0200 fs r272252 : #i99704# grid columns also to respect the MouseWheelBehavior property
2009-05-25 15:23:43 +0200 fs r272251 : don't pass empty Anys to ::comphelper::getString
2009-05-25 14:48:43 +0200 fs r272248 : merged changes from CWS dba32b herein
2009-05-25 14:44:40 +0200 fs r272247 : #i99704# support new MouseWheelBehavior property
2009-05-25 14:43:18 +0200 fs r272246 : #i99704# WheelWithoutFocus (peer property) superseded by MouseWheelBehavior (model property)
2009-05-25 14:41:03 +0200 fs r272245 : #i99704# no need to set the mouse wheel behavior at the peer, this is now a model property, having the right default
2009-05-25 14:39:31 +0200 fs r272243 : removed dead import
2009-05-25 14:35:36 +0200 fs r272242 : the new EnableVisible doesn't make sense for grid columns
2009-05-25 14:34:33 +0200 fs r272241 : #i99704# +MouseWheelBehavior - allow to enable/disable the mouse wheel for the control, or make it focus-dependent
2009-05-25 14:26:11 +0200 fs r272240 : #i99704# change MouseSettings wheel flag (NoWheelActionWithoutFocus) to a three-state option, allowing to completely ignore the mouse wheel
2009-05-23 21:35:59 +0200 fs r272213 : localize 'sub component opened/closed' event
2009-05-22 21:42:47 +0200 fs r272211 : #i102003#
2009-05-22 21:42:20 +0200 fs r272210 : grammar
2009-05-22 21:36:10 +0200 fs r272209 : #i102140# load only once, not twice, and show error messages during loading (and during any form action, that is) asynchronously
2009-05-22 21:35:11 +0200 fs r272208 : #i102140# +clear
2009-05-22 14:50:30 +0200 fs r272194 : #i102139# for newly created DB docs, set the MacroExecutionMode to USE_CONFIG
2009-05-22 12:03:42 +0200 fs r272180 : #i88878#
provided by noel.power@novell.com
implement a visibility property (EnableVisible) for toolkit controls, and usage in forms and UNO dialogs
2009-05-15 15:37:31 +0200 fs r271942 : #i100671# corrected some @since tags, so autodoc has better chances of correctly reading them
2009-05-15 15:33:11 +0200 fs r271940 : don't call comphelper::getFOO for VOID values
2009-05-15 15:08:31 +0200 fs r271937 : includes
2009-05-15 13:39:22 +0200 fs r271934 : #i101398# createPrimitive2DSequence: when we already have a control, use the old code. In particular, call positionControlForPaint
2009-05-15 12:33:48 +0200 fs r271933 : make the geometry a part of the ControlPrimitive2D's identity
2009-05-15 10:15:44 +0200 fs r271928 : #i10000#
2009-05-14 20:55:38 +0200 fs r271921 : #i101398# don't reuse the name PRIMITIVE_ID_CONTROLPRIMITIVE2D, make the name of our own ControlPrimitive2D unique
2009-05-14 20:55:31 +0200 fs r271920 : #i101398# don't reuse the name PRIMITIVE_ID_CONTROLPRIMITIVE2D, make the name of our own ControlPrimitive2D unique
2009-05-14 20:23:23 +0200 fs r271919 : #i101622#
2009-05-14 16:04:38 +0200 fs r271898 : don't use comphelper::getInt32 on voids
2009-05-14 16:04:12 +0200 fs r271897 : merge fix for issue whose number just slipped my memory ... (originally fixed in CWS dba32b)
2009-05-14 15:36:55 +0200 fs r271895 : merging changes from DEV300:m48
2009-05-07 14:43:19 +0200 fs r271670 : #i101477#
2009-05-07 14:37:30 +0200 fs r271668 : #i101477#
2009-05-07 09:27:30 +0200 oj r271628 : #i101343# remove pch
2009-05-06 09:36:02 +0200 fs r271568 : getFoo: diagnostics
2009-05-04 09:23:06 +0200 oj r271438 : CWS-TOOLING: rebase CWS dba32c to trunk@271427 (milestone: DEV300:m47)
2009-04-29 23:18:13 +0200 fs r271394 : #i101398# use a dedicated 2DPrimitive for UNO Controls, which is able to provide the B2DRange *without* actually creating the control
2009-04-29 13:52:25 +0200 fs r271366 : #i101308#
2009-07-03 14:21:50 +00:00
|
|
|
|
CCA_CURRENT_SELECTED, CCA_DISABLED, CCA_DROPDOWN, CCA_PRINTABLE, CCA_READONLY, CCA_SELECTED, CCA_TAB_STOP, CCA_ENABLEVISIBLE
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2012-05-17 14:00:15 +01:00
|
|
|
|
static const ConstAsciiString pBooleanPropertyNames[] =
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{ // property names
|
2012-05-17 14:00:15 +01:00
|
|
|
|
PROPERTY_STATE, PROPERTY_ENABLED, PROPERTY_DROPDOWN, PROPERTY_PRINTABLE, PROPERTY_READONLY, PROPERTY_DEFAULT_STATE, PROPERTY_TABSTOP, PROPERTY_ENABLEVISIBLE
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2001-03-29 11:19:43 +00:00
|
|
|
|
static sal_Bool nBooleanPropertyAttrFlags[] =
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{ // attribute defaults
|
CWS-TOOLING: integrate CWS dba32c
2009-06-29 20:53:25 +0200 fs r273484 : #i103138# Rectangle conversion
2009-06-29 20:51:50 +0200 fs r273483 : #i103138# yet more refactoring, now also setting the proper zoom level at the proper point in time
2009-06-29 13:40:26 +0200 fs r273470 : added svn:ignore to ignore output paths
2009-06-29 10:08:54 +0200 fs r273455 : #i103138#
refactored the code for positioning/zooming the control
Basically, we now allow adjustControlGeometry_throw (formerly known as positionControl_throw and setControlZoom) to
take an additional ViewTransformation parameter, describing the transformation to obtain the actual
control position/size. Consequently, positionControl itself also allows for a ViewTransformation parameter.
This has become necessary since during painting, the device which we created our control for might not necessarily
have a proper MapMode set. In this case, if we would use this map mode for calculating the control's position/size,
this would lead to wrong results.
Note that this problem was introduced by the fix for #i101398#: During the fix, we postponed the control creation
to a later time (when it is really needed). At this later time, the MapMode at the device is broken, at the earlier
time where we formerly crearted the control (createPrimitive2DSequence), it is not yet broken.
Whether or not the MapMode is defined as "broken" might depend on one's point of view, however ...
I consider it broken, since:
- we need the map mode to obtain the proper zoom level, which is to be forwarded to the control
- there are scenarios where the MapMode is *not* set to MAP_PIXEL (in those scenarios, everything works
fine), and there are scenarios where it *is* set to MAP_PIXEL (in those the bug 103138 appears).
It somehow feels wrong that one cannot rely on the device's map mode this way, but on the other hand
one has no possibility to obtain the current zoom by other means.
Note that one issue (still to be submitted) is left: In the page pane of a Draw/Impress document, controls
have a wrong text size. This is because in this pane, the above-mentioned "broken" map mode is used,
which means the controls have a zoom of "1:1" set, which is wrong here.
2009-06-25 13:41:35 +0200 msc r273380 : #100000# the tabs changed die to new properties
2009-06-24 12:42:40 +0200 msc r273330 : #102082# remove issue warning
2009-06-22 10:43:14 +0200 fs r273201 : createPrimitive2DSequence: care for being disposed
2009-06-18 12:35:13 +0200 oj r273109 : #i102305# make nooptfiles for gcc
2009-06-17 12:14:37 +0200 oj r273056 : #i102305# fix for linux
2009-06-17 07:20:22 +0200 oj r273046 : #i102305# move ValueTransfer into the for loop to avoid a crash under Linux
2009-06-17 07:17:28 +0200 oj r273045 : #i102305# use varchar
2009-06-15 14:11:27 +0200 fs r272983 : added since tag
2009-06-15 12:11:39 +0200 oj r272973 : #i102305# SAL_DLLPUBLIC_EXPORT inserted
2009-06-15 11:08:53 +0200 fs r272969 : #i10000#
2009-06-15 09:25:13 +0200 fs r272963 : merging fix for P1 issue #i102701#
2009-06-11 11:31:24 +0200 fs r272858 : #i10000# copied the fix which before the rebase was done in ../dialog/macropg.src
2009-06-11 09:38:14 +0200 fs r272846 : CWS-TOOLING: rebase CWS dba32c to trunk@272827 (milestone: DEV300:m50)
2009-06-02 09:53:10 +0200 fs r272483 : #i10000#
2009-05-29 15:55:03 +0200 fs r272465 : #i100818#
2009-05-29 12:58:43 +0200 fs r272452 : don't apply comphelper::getString on possibly VOID any
2009-05-29 10:38:35 +0200 oj r272437 : #i101519# handle where condition
2009-05-29 09:53:39 +0200 fs r272434 : #i100818# call into releaseStubs /without/ locked GlobalMutex
2009-05-28 07:53:44 +0200 oj r272375 : #i101369# parse tree changed
2009-05-27 14:53:36 +0200 fs r272347 : #i10000#
2009-05-27 09:29:15 +0200 oj r272327 : #i101626# check for double before hard cast
2009-05-27 09:13:58 +0200 oj r272326 : #i101626# handle void correctly
2009-05-27 08:04:39 +0200 oj r272321 : #i102256# wrong method signature used
2009-05-27 07:55:52 +0200 oj r272320 : #i101519# look up parameter typ if used in function
2009-05-27 06:49:07 +0200 oj r272319 : #i101519# set parameter from rowset as well
2009-05-26 13:30:56 +0200 oj r272297 : #i101987# impl XBatchExecution
2009-05-26 12:44:34 +0200 oj r272293 : #i101700# check if group is not set
2009-05-26 12:16:53 +0200 oj r272290 : #i101369# resolved some reduce7reduce problems with boolean_term and search_condition
2009-05-26 12:12:42 +0200 oj r272289 : #i101369# fix for or on one line criteria
2009-05-25 16:02:25 +0200 fs r272257 : #i999704# +PROPERTY_MOUSE_WHEEL_BEHAVIOR
2009-05-25 16:01:55 +0200 fs r272256 : merging the changes from CWS dba32b herein
2009-05-25 15:49:57 +0200 fs r272254 : #i999704#
2009-05-25 15:32:57 +0200 fs r272252 : #i99704# grid columns also to respect the MouseWheelBehavior property
2009-05-25 15:23:43 +0200 fs r272251 : don't pass empty Anys to ::comphelper::getString
2009-05-25 14:48:43 +0200 fs r272248 : merged changes from CWS dba32b herein
2009-05-25 14:44:40 +0200 fs r272247 : #i99704# support new MouseWheelBehavior property
2009-05-25 14:43:18 +0200 fs r272246 : #i99704# WheelWithoutFocus (peer property) superseded by MouseWheelBehavior (model property)
2009-05-25 14:41:03 +0200 fs r272245 : #i99704# no need to set the mouse wheel behavior at the peer, this is now a model property, having the right default
2009-05-25 14:39:31 +0200 fs r272243 : removed dead import
2009-05-25 14:35:36 +0200 fs r272242 : the new EnableVisible doesn't make sense for grid columns
2009-05-25 14:34:33 +0200 fs r272241 : #i99704# +MouseWheelBehavior - allow to enable/disable the mouse wheel for the control, or make it focus-dependent
2009-05-25 14:26:11 +0200 fs r272240 : #i99704# change MouseSettings wheel flag (NoWheelActionWithoutFocus) to a three-state option, allowing to completely ignore the mouse wheel
2009-05-23 21:35:59 +0200 fs r272213 : localize 'sub component opened/closed' event
2009-05-22 21:42:47 +0200 fs r272211 : #i102003#
2009-05-22 21:42:20 +0200 fs r272210 : grammar
2009-05-22 21:36:10 +0200 fs r272209 : #i102140# load only once, not twice, and show error messages during loading (and during any form action, that is) asynchronously
2009-05-22 21:35:11 +0200 fs r272208 : #i102140# +clear
2009-05-22 14:50:30 +0200 fs r272194 : #i102139# for newly created DB docs, set the MacroExecutionMode to USE_CONFIG
2009-05-22 12:03:42 +0200 fs r272180 : #i88878#
provided by noel.power@novell.com
implement a visibility property (EnableVisible) for toolkit controls, and usage in forms and UNO dialogs
2009-05-15 15:37:31 +0200 fs r271942 : #i100671# corrected some @since tags, so autodoc has better chances of correctly reading them
2009-05-15 15:33:11 +0200 fs r271940 : don't call comphelper::getFOO for VOID values
2009-05-15 15:08:31 +0200 fs r271937 : includes
2009-05-15 13:39:22 +0200 fs r271934 : #i101398# createPrimitive2DSequence: when we already have a control, use the old code. In particular, call positionControlForPaint
2009-05-15 12:33:48 +0200 fs r271933 : make the geometry a part of the ControlPrimitive2D's identity
2009-05-15 10:15:44 +0200 fs r271928 : #i10000#
2009-05-14 20:55:38 +0200 fs r271921 : #i101398# don't reuse the name PRIMITIVE_ID_CONTROLPRIMITIVE2D, make the name of our own ControlPrimitive2D unique
2009-05-14 20:55:31 +0200 fs r271920 : #i101398# don't reuse the name PRIMITIVE_ID_CONTROLPRIMITIVE2D, make the name of our own ControlPrimitive2D unique
2009-05-14 20:23:23 +0200 fs r271919 : #i101622#
2009-05-14 16:04:38 +0200 fs r271898 : don't use comphelper::getInt32 on voids
2009-05-14 16:04:12 +0200 fs r271897 : merge fix for issue whose number just slipped my memory ... (originally fixed in CWS dba32b)
2009-05-14 15:36:55 +0200 fs r271895 : merging changes from DEV300:m48
2009-05-07 14:43:19 +0200 fs r271670 : #i101477#
2009-05-07 14:37:30 +0200 fs r271668 : #i101477#
2009-05-07 09:27:30 +0200 oj r271628 : #i101343# remove pch
2009-05-06 09:36:02 +0200 fs r271568 : getFoo: diagnostics
2009-05-04 09:23:06 +0200 oj r271438 : CWS-TOOLING: rebase CWS dba32c to trunk@271427 (milestone: DEV300:m47)
2009-04-29 23:18:13 +0200 fs r271394 : #i101398# use a dedicated 2DPrimitive for UNO Controls, which is able to provide the B2DRange *without* actually creating the control
2009-04-29 13:52:25 +0200 fs r271366 : #i101308#
2009-07-03 14:21:50 +00:00
|
|
|
|
BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_FALSE | BOOLATTR_INVERSE_SEMANTICS, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_VOID, BOOLATTR_DEFAULT_FALSE
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nIdCount = sizeof(nBooleanPropertyAttributeIds) / sizeof(nBooleanPropertyAttributeIds[0]);
|
|
|
|
|
sal_Int32 nNameCount = sizeof(pBooleanPropertyNames) / sizeof(pBooleanPropertyNames[0]);
|
|
|
|
|
sal_Int32 nFlagsCount = sizeof(nBooleanPropertyAttrFlags) / sizeof(nBooleanPropertyAttrFlags[0]);
|
2001-03-29 11:19:43 +00:00
|
|
|
|
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
"OControlExport::exportCommonControlAttributes: somebody tampered with the maps (2)!");
|
|
|
|
|
#endif
|
2012-05-29 17:23:51 +01:00
|
|
|
|
for (i=0; i<sizeof(nBooleanPropertyAttributeIds)/sizeof(nBooleanPropertyAttributeIds[0]); ++i)
|
2000-11-17 18:03:33 +00:00
|
|
|
|
if (nBooleanPropertyAttributeIds[i] & m_nIncludeCommon)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportBooleanPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(nBooleanPropertyAttributeIds[i]),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(nBooleanPropertyAttributeIds[i]),
|
2012-05-17 14:00:15 +01:00
|
|
|
|
pBooleanPropertyNames[i],
|
2001-03-29 11:19:43 +00:00
|
|
|
|
nBooleanPropertyAttrFlags[i]);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~nBooleanPropertyAttributeIds[i];
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
// some integer properties
|
|
|
|
|
{
|
2003-03-27 17:21:03 +00:00
|
|
|
|
// now the common handling
|
2000-11-17 18:03:33 +00:00
|
|
|
|
static sal_Int32 nIntegerPropertyAttributeIds[] =
|
|
|
|
|
{ // attribute flags
|
2003-03-27 17:21:03 +00:00
|
|
|
|
CCA_SIZE, CCA_TAB_INDEX
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2012-05-17 14:00:15 +01:00
|
|
|
|
static const ConstAsciiString pIntegerPropertyNames[] =
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{ // property names
|
2012-05-17 14:00:15 +01:00
|
|
|
|
PROPERTY_LINECOUNT, PROPERTY_TABINDEX
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
|
|
|
|
static const sal_Int16 nIntegerPropertyAttrDefaults[] =
|
|
|
|
|
{ // attribute defaults
|
2003-03-27 17:21:03 +00:00
|
|
|
|
5, 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2003-03-27 17:21:03 +00:00
|
|
|
|
|
|
|
|
|
if ( m_nIncludeCommon & CCA_MAX_LENGTH )
|
|
|
|
|
exportedProperty(PROPERTY_MAXTEXTLENGTH);
|
|
|
|
|
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nIdCount = sizeof(nIntegerPropertyAttributeIds) / sizeof(nIntegerPropertyAttributeIds[0]);
|
|
|
|
|
sal_Int32 nNameCount = sizeof(pIntegerPropertyNames) / sizeof(pIntegerPropertyNames[0]);
|
|
|
|
|
sal_Int32 nDefaultCount = sizeof(nIntegerPropertyAttrDefaults) / sizeof(nIntegerPropertyAttrDefaults[0]);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount),
|
|
|
|
|
"OControlExport::exportCommonControlAttributes: somebody tampered with the maps (3)!");
|
|
|
|
|
#endif
|
2012-05-29 17:23:51 +01:00
|
|
|
|
for (i=0; i<sizeof(nIntegerPropertyAttributeIds)/sizeof(nIntegerPropertyAttributeIds[0]); ++i)
|
2000-11-17 18:03:33 +00:00
|
|
|
|
if (nIntegerPropertyAttributeIds[i] & m_nIncludeCommon)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportInt16PropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(nIntegerPropertyAttributeIds[i]),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(nIntegerPropertyAttributeIds[i]),
|
2012-05-17 14:00:15 +01:00
|
|
|
|
pIntegerPropertyNames[i],
|
2000-11-17 18:03:33 +00:00
|
|
|
|
nIntegerPropertyAttrDefaults[i]);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~nIntegerPropertyAttributeIds[i];
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2003-03-27 17:21:03 +00:00
|
|
|
|
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
// some enum properties
|
|
|
|
|
{
|
|
|
|
|
if (m_nIncludeCommon & CCA_BUTTON_TYPE)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportEnumPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_BUTTON_TYPE),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_BUTTON_TYPE),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
PROPERTY_BUTTONTYPE,
|
|
|
|
|
OEnumMapper::getEnumMap(OEnumMapper::epButtonType),
|
|
|
|
|
FormButtonType_PUSH);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_BUTTON_TYPE;
|
2003-12-11 11:08:10 +00:00
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
if ( m_nIncludeCommon & CCA_ORIENTATION )
|
|
|
|
|
{
|
|
|
|
|
exportEnumPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace( CCA_ORIENTATION ),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName( CCA_ORIENTATION ),
|
2003-12-11 11:08:10 +00:00
|
|
|
|
PROPERTY_ORIENTATION,
|
|
|
|
|
OEnumMapper::getEnumMap( OEnumMapper::epOrientation ),
|
|
|
|
|
ScrollBarOrientation::HORIZONTAL
|
|
|
|
|
);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2003-12-11 11:08:10 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_ORIENTATION;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
#endif
|
|
|
|
|
}
|
2004-07-05 15:07:26 +00:00
|
|
|
|
|
|
|
|
|
if ( m_nIncludeCommon & CCA_VISUAL_EFFECT )
|
|
|
|
|
{
|
|
|
|
|
exportEnumPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace( CCA_VISUAL_EFFECT ),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName( CCA_VISUAL_EFFECT ),
|
2004-07-05 15:07:26 +00:00
|
|
|
|
PROPERTY_VISUAL_EFFECT,
|
|
|
|
|
OEnumMapper::getEnumMap( OEnumMapper::epVisualEffect ),
|
|
|
|
|
VisualEffect::LOOK3D
|
|
|
|
|
);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2004-07-05 15:07:26 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_VISUAL_EFFECT;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
// some properties which require a special handling
|
|
|
|
|
|
|
|
|
|
// the target frame
|
|
|
|
|
if (m_nIncludeCommon & CCA_TARGET_FRAME)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportTargetFrameAttribute();
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_TARGET_FRAME;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-27 17:21:03 +00:00
|
|
|
|
// max text length
|
|
|
|
|
if ( m_nIncludeCommon & CCA_MAX_LENGTH )
|
|
|
|
|
{
|
|
|
|
|
// normally, the respective property would be "MaxTextLen"
|
|
|
|
|
// However, if the model has a property "PersistenceMaxTextLength", then we prefer this
|
|
|
|
|
|
|
|
|
|
// determine the name of the property to export
|
2006-07-26 06:31:26 +00:00
|
|
|
|
::rtl::OUString sTextLenPropertyName( PROPERTY_MAXTEXTLENGTH );
|
2003-03-27 17:21:03 +00:00
|
|
|
|
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_PERSISTENCE_MAXTEXTLENGTH ) )
|
|
|
|
|
sTextLenPropertyName = PROPERTY_PERSISTENCE_MAXTEXTLENGTH;
|
|
|
|
|
|
|
|
|
|
// export it
|
|
|
|
|
exportInt16PropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace( CCA_MAX_LENGTH ),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName( CCA_MAX_LENGTH ),
|
2003-03-27 17:21:03 +00:00
|
|
|
|
sTextLenPropertyName,
|
|
|
|
|
0
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// in either way, both properties count as "exported"
|
|
|
|
|
exportedProperty( PROPERTY_MAXTEXTLENGTH );
|
|
|
|
|
exportedProperty( PROPERTY_PERSISTENCE_MAXTEXTLENGTH );
|
|
|
|
|
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2003-03-27 17:21:03 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_MAX_LENGTH;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2001-06-25 12:32:38 +00:00
|
|
|
|
if (m_nIncludeCommon & CCA_TARGET_LOCATION)
|
|
|
|
|
{
|
2010-04-20 17:18:54 +02:00
|
|
|
|
exportTargetLocationAttribute(false);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2001-06-25 12:32:38 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_TARGET_LOCATION;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2002-08-22 06:36:10 +00:00
|
|
|
|
// OJ #99721#
|
|
|
|
|
if (m_nIncludeCommon & CCA_IMAGE_DATA)
|
|
|
|
|
{
|
|
|
|
|
exportImageDataAttribute();
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2002-08-22 06:36:10 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_IMAGE_DATA;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// the for attribute
|
|
|
|
|
// the target frame
|
|
|
|
|
if (m_nIncludeCommon & CCA_FOR)
|
|
|
|
|
{
|
2012-01-25 21:59:48 -02:00
|
|
|
|
if (!m_sReferringControls.isEmpty())
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{ // there is at least one control referring to the one we're handling currently
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_FOR),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_FOR),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_sReferringControls);
|
|
|
|
|
}
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~CCA_FOR;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((CCA_CURRENT_VALUE | CCA_VALUE) & m_nIncludeCommon)
|
|
|
|
|
{
|
|
|
|
|
const sal_Char* pCurrentValuePropertyName = NULL;
|
|
|
|
|
const sal_Char* pValuePropertyName = NULL;
|
|
|
|
|
|
|
|
|
|
// get the property names
|
2000-12-13 09:38:10 +00:00
|
|
|
|
getValuePropertyNames(m_eType, m_nClassId, pCurrentValuePropertyName, pValuePropertyName);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
2004-08-02 13:13:42 +00:00
|
|
|
|
static const sal_Char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCA_CURRENT_VALUE);
|
|
|
|
|
static const sal_Char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCA_VALUE);
|
|
|
|
|
static const sal_uInt16 nCurrentValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCA_CURRENT_VALUE);
|
|
|
|
|
static const sal_uInt16 nValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCA_VALUE);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
|
|
|
|
// add the atrtributes if necessary and possible
|
|
|
|
|
if (pCurrentValuePropertyName && (CCA_CURRENT_VALUE & m_nIncludeCommon))
|
2004-06-28 16:04:36 +00:00
|
|
|
|
{
|
|
|
|
|
// don't export the current-value if this value originates from a data binding
|
2011-03-04 00:11:22 +01:00
|
|
|
|
// #i26944#
|
2004-06-28 16:04:36 +00:00
|
|
|
|
if ( controlHasActiveDataBinding() )
|
|
|
|
|
exportedProperty( ::rtl::OUString::createFromAscii( pCurrentValuePropertyName ) );
|
|
|
|
|
else
|
|
|
|
|
exportGenericPropertyAttribute(
|
|
|
|
|
nCurrentValueAttributeNamespaceKey,
|
|
|
|
|
pCurrentValueAttributeName,
|
|
|
|
|
pCurrentValuePropertyName
|
|
|
|
|
);
|
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
|
|
|
|
if (pValuePropertyName && (CCA_VALUE & m_nIncludeCommon))
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportGenericPropertyAttribute(
|
2000-11-17 18:03:33 +00:00
|
|
|
|
nValueAttributeNamespaceKey,
|
|
|
|
|
pValueAttributeName,
|
|
|
|
|
pValuePropertyName);
|
|
|
|
|
|
|
|
|
|
OSL_ENSURE((NULL == pValuePropertyName) == (0 == (CCA_VALUE & m_nIncludeCommon)),
|
|
|
|
|
"OControlExport::exportCommonControlAttributes: no property found for the value attribute!");
|
|
|
|
|
OSL_ENSURE((NULL == pCurrentValuePropertyName ) == (0 == (CCA_CURRENT_VALUE & m_nIncludeCommon)),
|
|
|
|
|
"OControlExport::exportCommonControlAttributes: no property found for the current-value attribute!");
|
2000-11-19 14:41:32 +00:00
|
|
|
|
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeCommon = m_nIncludeCommon & ~(CCA_CURRENT_VALUE | CCA_VALUE);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OSL_ENSURE(0 == m_nIncludeCommon,
|
|
|
|
|
"OControlExport::exportCommonControlAttributes: forgot some flags!");
|
|
|
|
|
// in the dbg_util version, we should have removed every bit we handled from the mask, so it should
|
|
|
|
|
// be 0 now ...
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportDatabaseAttributes()
|
|
|
|
|
{
|
2003-04-15 15:32:55 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2001-11-02 10:45:36 +00:00
|
|
|
|
sal_Int32 nIncludeDatabase = m_nIncludeDatabase;
|
|
|
|
|
#endif
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// the only string property: DataField
|
|
|
|
|
if (DA_DATA_FIELD & m_nIncludeDatabase)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportStringPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getDatabaseAttributeNamespace(DA_DATA_FIELD),
|
|
|
|
|
OAttributeMetaData::getDatabaseAttributeName(DA_DATA_FIELD),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
PROPERTY_DATAFIELD);
|
2008-12-01 12:31:27 +00:00
|
|
|
|
RESET_BIT( nIncludeDatabase, DA_DATA_FIELD );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// InputRequired
|
|
|
|
|
if ( DA_INPUT_REQUIRED & m_nIncludeDatabase )
|
|
|
|
|
{
|
|
|
|
|
exportBooleanPropertyAttribute(
|
|
|
|
|
OAttributeMetaData::getDatabaseAttributeNamespace( DA_INPUT_REQUIRED ),
|
|
|
|
|
OAttributeMetaData::getDatabaseAttributeName( DA_INPUT_REQUIRED ),
|
|
|
|
|
PROPERTY_INPUT_REQUIRED,
|
|
|
|
|
BOOLATTR_DEFAULT_TRUE
|
|
|
|
|
);
|
|
|
|
|
RESET_BIT( nIncludeDatabase, DA_INPUT_REQUIRED );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// the only int16 property: BoundColumn
|
|
|
|
|
if (DA_BOUND_COLUMN & m_nIncludeDatabase)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportInt16PropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getDatabaseAttributeNamespace(DA_BOUND_COLUMN),
|
|
|
|
|
OAttributeMetaData::getDatabaseAttributeName(DA_BOUND_COLUMN),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
PROPERTY_BOUNDCOLUMN,
|
|
|
|
|
0);
|
2008-12-01 12:31:27 +00:00
|
|
|
|
RESET_BIT( nIncludeDatabase, DA_BOUND_COLUMN );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-12-01 12:31:27 +00:00
|
|
|
|
// ConvertEmptyToNull
|
2000-11-17 18:03:33 +00:00
|
|
|
|
if (DA_CONVERT_EMPTY & m_nIncludeDatabase)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportBooleanPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getDatabaseAttributeNamespace(DA_CONVERT_EMPTY),
|
|
|
|
|
OAttributeMetaData::getDatabaseAttributeName(DA_CONVERT_EMPTY),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
PROPERTY_EMPTY_IS_NULL,
|
2001-03-29 11:19:43 +00:00
|
|
|
|
BOOLATTR_DEFAULT_FALSE
|
2000-11-17 18:03:33 +00:00
|
|
|
|
);
|
2008-12-01 12:31:27 +00:00
|
|
|
|
RESET_BIT( nIncludeDatabase, DA_CONVERT_EMPTY );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// the only enum property: ListSourceType
|
|
|
|
|
if (DA_LIST_SOURCE_TYPE & m_nIncludeDatabase)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportEnumPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getDatabaseAttributeNamespace(DA_LIST_SOURCE_TYPE),
|
|
|
|
|
OAttributeMetaData::getDatabaseAttributeName(DA_LIST_SOURCE_TYPE),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
PROPERTY_LISTSOURCETYPE,
|
|
|
|
|
OEnumMapper::getEnumMap(OEnumMapper::epListSourceType),
|
|
|
|
|
ListSourceType_VALUELIST
|
|
|
|
|
);
|
2008-12-01 12:31:27 +00:00
|
|
|
|
RESET_BIT( nIncludeDatabase, DA_LIST_SOURCE_TYPE );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_nIncludeDatabase & DA_LIST_SOURCE)
|
|
|
|
|
{
|
|
|
|
|
exportListSourceAsAttribute();
|
2008-12-01 12:31:27 +00:00
|
|
|
|
RESET_BIT( nIncludeDatabase, DA_LIST_SOURCE );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-04-15 15:32:55 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2001-11-02 10:45:36 +00:00
|
|
|
|
OSL_ENSURE(0 == nIncludeDatabase,
|
2000-11-17 18:03:33 +00:00
|
|
|
|
"OControlExport::exportDatabaseAttributes: forgot some flags!");
|
|
|
|
|
// in the dbg_util version, we should have removed every bit we handled from the mask, so it should
|
|
|
|
|
// be 0 now ...
|
2001-11-02 10:45:36 +00:00
|
|
|
|
#endif
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-10-21 07:38:16 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportBindingAtributes()
|
|
|
|
|
{
|
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
|
|
|
|
sal_Int32 nIncludeBinding = m_nIncludeBindings;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// ....................................................
|
|
|
|
|
if ( m_nIncludeBindings & BA_LINKED_CELL )
|
|
|
|
|
{
|
|
|
|
|
exportCellBindingAttributes( ( m_nIncludeBindings & BA_LIST_LINKING_TYPE ) != 0 );
|
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
nIncludeBinding = nIncludeBinding & ~( BA_LINKED_CELL | BA_LIST_LINKING_TYPE );
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ....................................................
|
|
|
|
|
if ( m_nIncludeBindings & BA_LIST_CELL_RANGE )
|
|
|
|
|
{
|
|
|
|
|
exportCellListSourceRange();
|
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
nIncludeBinding = nIncludeBinding & ~BA_LIST_CELL_RANGE;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-16 09:08:56 +00:00
|
|
|
|
if ( m_nIncludeBindings & BA_XFORMS_BIND )
|
|
|
|
|
{
|
|
|
|
|
exportXFormsBindAttributes();
|
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
nIncludeBinding = nIncludeBinding & ~BA_XFORMS_BIND;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( m_nIncludeBindings & BA_XFORMS_LISTBIND )
|
|
|
|
|
{
|
|
|
|
|
exportXFormsListAttributes();
|
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
nIncludeBinding = nIncludeBinding & ~BA_XFORMS_LISTBIND;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( m_nIncludeBindings & BA_XFORMS_SUBMISSION )
|
|
|
|
|
{
|
|
|
|
|
exportXFormsSubmissionAttributes();
|
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
nIncludeBinding = nIncludeBinding & ~BA_XFORMS_SUBMISSION;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2003-10-21 07:38:16 +00:00
|
|
|
|
|
|
|
|
|
OSL_ENSURE( 0 == nIncludeBinding,
|
|
|
|
|
"OControlExport::exportBindingAtributes: forgot some flags!");
|
|
|
|
|
// in the debug version, we should have removed every bit we handled from the mask, so it should
|
|
|
|
|
// be 0 now ...
|
|
|
|
|
}
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportSpecialAttributes()
|
|
|
|
|
{
|
|
|
|
|
sal_Int32 i=0;
|
|
|
|
|
|
|
|
|
|
// ----------------------
|
|
|
|
|
// the boolean properties
|
|
|
|
|
{
|
2004-07-05 15:07:26 +00:00
|
|
|
|
static const sal_Int32 nBooleanPropertyAttributeIds[] =
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{ // attribute flags
|
2004-07-05 15:07:26 +00:00
|
|
|
|
SCA_VALIDATION, SCA_MULTI_LINE, SCA_AUTOMATIC_COMPLETION, SCA_MULTIPLE, SCA_DEFAULT_BUTTON, SCA_IS_TRISTATE,
|
|
|
|
|
SCA_TOGGLE, SCA_FOCUS_ON_CLICK
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2012-05-17 14:00:15 +01:00
|
|
|
|
static const ConstAsciiString pBooleanPropertyNames[] =
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{ // property names
|
2012-05-17 14:00:15 +01:00
|
|
|
|
PROPERTY_STRICTFORMAT, PROPERTY_MULTILINE, PROPERTY_AUTOCOMPLETE, PROPERTY_MULTISELECTION, PROPERTY_DEFAULTBUTTON, PROPERTY_TRISTATE,
|
|
|
|
|
PROPERTY_TOGGLE, PROPERTY_FOCUS_ON_CLICK
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nIdCount = sizeof(nBooleanPropertyAttributeIds) / sizeof(nBooleanPropertyAttributeIds[0]);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nNameCount = sizeof(pBooleanPropertyNames) / sizeof(pBooleanPropertyNames[0]);
|
2001-03-29 11:19:43 +00:00
|
|
|
|
OSL_ENSURE((nIdCount == nNameCount),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
"OControlExport::exportSpecialAttributes: somebody tampered with the maps (1)!");
|
|
|
|
|
#endif
|
2004-07-05 15:07:26 +00:00
|
|
|
|
const sal_Int32* pAttributeId = nBooleanPropertyAttributeIds;
|
2012-05-17 14:00:15 +01:00
|
|
|
|
for ( i = 0; i < nIdCount; ++i, ++pAttributeId )
|
2004-07-05 15:07:26 +00:00
|
|
|
|
{
|
2012-05-17 14:00:15 +01:00
|
|
|
|
if ( *pAttributeId & m_nIncludeSpecial)
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportBooleanPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getSpecialAttributeNamespace( *pAttributeId ),
|
|
|
|
|
OAttributeMetaData::getSpecialAttributeName( *pAttributeId ),
|
2012-05-17 14:00:15 +01:00
|
|
|
|
pBooleanPropertyNames[i],
|
2004-07-05 15:07:26 +00:00
|
|
|
|
( *pAttributeId == SCA_FOCUS_ON_CLICK ) ? BOOLATTR_DEFAULT_TRUE : BOOLATTR_DEFAULT_FALSE
|
2001-03-29 11:19:43 +00:00
|
|
|
|
);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
2004-07-05 15:07:26 +00:00
|
|
|
|
m_nIncludeSpecial = m_nIncludeSpecial & ~*pAttributeId;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
#endif
|
|
|
|
|
}
|
2004-07-05 15:07:26 +00:00
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-12-11 11:08:10 +00:00
|
|
|
|
// ----------------------
|
|
|
|
|
// the integer properties
|
|
|
|
|
{
|
|
|
|
|
static sal_Int32 nIntegerPropertyAttributeIds[] =
|
|
|
|
|
{ // attribute flags
|
2004-11-26 12:01:22 +00:00
|
|
|
|
SCA_PAGE_STEP_SIZE
|
2003-12-11 11:08:10 +00:00
|
|
|
|
};
|
2012-05-17 14:00:15 +01:00
|
|
|
|
static const ConstAsciiString pIntegerPropertyNames[] =
|
2003-12-11 11:08:10 +00:00
|
|
|
|
{ // property names
|
2012-05-17 14:00:15 +01:00
|
|
|
|
PROPERTY_BLOCK_INCREMENT
|
2003-12-11 11:08:10 +00:00
|
|
|
|
};
|
|
|
|
|
static const sal_Int32 nIntegerPropertyAttrDefaults[] =
|
|
|
|
|
{ // attribute defaults (XML defaults, not runtime defaults!)
|
2004-11-26 12:01:22 +00:00
|
|
|
|
10
|
2003-12-11 11:08:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nIdCount = sizeof( nIntegerPropertyAttributeIds ) / sizeof( nIntegerPropertyAttributeIds[0] );
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nNameCount = sizeof( pIntegerPropertyNames ) / sizeof( pIntegerPropertyNames[0] );
|
2003-12-11 11:08:10 +00:00
|
|
|
|
OSL_ENSURE( ( nIdCount == nNameCount ),
|
|
|
|
|
"OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nDefaultCount = sizeof( nIntegerPropertyAttrDefaults ) / sizeof( nIntegerPropertyAttrDefaults[0] );
|
2003-12-11 11:08:10 +00:00
|
|
|
|
OSL_ENSURE( ( nIdCount == nDefaultCount ),
|
|
|
|
|
"OControlExport::exportSpecialAttributes: somebody tampered with the maps (3)!" );
|
|
|
|
|
#endif
|
|
|
|
|
for ( i = 0; i < nIdCount; ++i )
|
|
|
|
|
if ( nIntegerPropertyAttributeIds[i] & m_nIncludeSpecial )
|
|
|
|
|
{
|
|
|
|
|
exportInt32PropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getSpecialAttributeNamespace( nIntegerPropertyAttributeIds[i] ),
|
|
|
|
|
OAttributeMetaData::getSpecialAttributeName( nIntegerPropertyAttributeIds[i] ),
|
2012-05-17 14:00:15 +01:00
|
|
|
|
pIntegerPropertyNames[i],
|
2003-12-11 11:08:10 +00:00
|
|
|
|
nIntegerPropertyAttrDefaults[i]
|
|
|
|
|
);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2003-12-11 11:08:10 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeSpecial = m_nIncludeSpecial & ~nIntegerPropertyAttributeIds[i];
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( SCA_STEP_SIZE & m_nIncludeSpecial )
|
|
|
|
|
{
|
|
|
|
|
::rtl::OUString sPropertyName;
|
|
|
|
|
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_LINE_INCREMENT ) )
|
|
|
|
|
sPropertyName = PROPERTY_LINE_INCREMENT;
|
|
|
|
|
else if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_SPIN_INCREMENT ) )
|
|
|
|
|
sPropertyName = PROPERTY_SPIN_INCREMENT;
|
|
|
|
|
else
|
2011-03-19 14:09:49 +01:00
|
|
|
|
OSL_FAIL( "OControlExport::exportSpecialAttributes: not property which can be mapped to step-size attribute!" );
|
2003-12-11 11:08:10 +00:00
|
|
|
|
|
2012-01-25 21:59:48 -02:00
|
|
|
|
if ( !sPropertyName.isEmpty() )
|
2003-12-11 11:08:10 +00:00
|
|
|
|
exportInt32PropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getSpecialAttributeNamespace( SCA_STEP_SIZE ),
|
|
|
|
|
OAttributeMetaData::getSpecialAttributeName( SCA_STEP_SIZE ),
|
2003-12-11 11:08:10 +00:00
|
|
|
|
sPropertyName,
|
|
|
|
|
1
|
|
|
|
|
);
|
|
|
|
|
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2003-12-11 11:08:10 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_STEP_SIZE;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// -------------------
|
|
|
|
|
// the enum properties
|
|
|
|
|
{
|
|
|
|
|
if (SCA_STATE & m_nIncludeSpecial)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportEnumPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getSpecialAttributeNamespace(SCA_STATE),
|
|
|
|
|
OAttributeMetaData::getSpecialAttributeName(SCA_STATE),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
PROPERTY_DEFAULT_STATE,
|
|
|
|
|
OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
|
|
|
|
|
STATE_NOCHECK);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_STATE;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (SCA_CURRENT_STATE & m_nIncludeSpecial)
|
|
|
|
|
{
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportEnumPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getSpecialAttributeNamespace(SCA_CURRENT_STATE),
|
|
|
|
|
OAttributeMetaData::getSpecialAttributeName(SCA_CURRENT_STATE),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
PROPERTY_STATE,
|
|
|
|
|
OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
|
|
|
|
|
STATE_NOCHECK);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_CURRENT_STATE;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-26 12:01:22 +00:00
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
// some properties which require a special handling
|
|
|
|
|
// the repeat delay
|
|
|
|
|
{
|
|
|
|
|
if ( m_nIncludeSpecial & SCA_REPEAT_DELAY )
|
|
|
|
|
{
|
|
|
|
|
DBG_CHECK_PROPERTY( PROPERTY_REPEAT_DELAY, sal_Int32 );
|
|
|
|
|
|
|
|
|
|
sal_Int32 nRepeatDelay = 0;
|
|
|
|
|
m_xProps->getPropertyValue( PROPERTY_REPEAT_DELAY ) >>= nRepeatDelay;
|
2011-12-01 21:03:42 +01:00
|
|
|
|
Time aTime( Time::SYSTEM );
|
2004-11-26 12:01:22 +00:00
|
|
|
|
aTime.MakeTimeFromMS( nRepeatDelay );
|
2011-10-11 14:19:08 +02:00
|
|
|
|
util::Duration aDuration;
|
|
|
|
|
aDuration.Hours = aTime.GetHour();
|
|
|
|
|
aDuration.Minutes = aTime.GetMin();
|
|
|
|
|
aDuration.Seconds = aTime.GetSec();
|
|
|
|
|
aDuration.MilliSeconds = nRepeatDelay % 1000;
|
|
|
|
|
|
|
|
|
|
::rtl::OUStringBuffer buf;
|
|
|
|
|
::sax::Converter::convertDuration(buf, aDuration);
|
2004-11-26 12:01:22 +00:00
|
|
|
|
AddAttribute(OAttributeMetaData::getSpecialAttributeNamespace( SCA_REPEAT_DELAY )
|
|
|
|
|
,OAttributeMetaData::getSpecialAttributeName( SCA_REPEAT_DELAY )
|
2011-10-11 14:19:08 +02:00
|
|
|
|
,buf.makeStringAndClear());
|
2004-11-26 12:01:22 +00:00
|
|
|
|
|
|
|
|
|
exportedProperty( PROPERTY_REPEAT_DELAY );
|
|
|
|
|
|
2007-03-09 12:05:16 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2004-11-26 12:01:22 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_REPEAT_DELAY;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// ----------------------------------
|
|
|
|
|
// the EchoChar property needs special handling, cause it's a Int16, but must be stored as one-character-string
|
|
|
|
|
{
|
|
|
|
|
if (SCA_ECHO_CHAR & m_nIncludeSpecial)
|
|
|
|
|
{
|
2002-10-25 06:53:45 +00:00
|
|
|
|
DBG_CHECK_PROPERTY( PROPERTY_ECHO_CHAR, sal_Int16 );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
sal_Int16 nValue(0);
|
|
|
|
|
m_xProps->getPropertyValue(PROPERTY_ECHO_CHAR) >>= nValue;
|
|
|
|
|
if (nValue)
|
|
|
|
|
{
|
|
|
|
|
::rtl::OUString sCharacter(reinterpret_cast<const sal_Unicode*>(&nValue), 1);
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getSpecialAttributeNamespace(SCA_ECHO_CHAR),
|
|
|
|
|
OAttributeMetaData::getSpecialAttributeName(SCA_ECHO_CHAR),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
sCharacter);
|
|
|
|
|
}
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportedProperty(PROPERTY_ECHO_CHAR);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_ECHO_CHAR;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-06 10:16:27 +01:00
|
|
|
|
// ----------------------------------
|
|
|
|
|
// the string properties
|
|
|
|
|
{
|
|
|
|
|
static sal_Int32 nStringPropertyAttributeIds[] =
|
|
|
|
|
{ // attribute flags
|
|
|
|
|
SCA_GROUP_NAME
|
|
|
|
|
};
|
2012-05-17 14:00:15 +01:00
|
|
|
|
static const ConstAsciiString pStringPropertyNames[] =
|
2010-10-06 10:16:27 +01:00
|
|
|
|
{ // property names
|
2012-05-17 14:00:15 +01:00
|
|
|
|
PROPERTY_GROUP_NAME
|
2010-10-06 10:16:27 +01:00
|
|
|
|
};
|
|
|
|
|
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] );
|
2010-10-06 10:16:27 +01:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nNameCount = sizeof( pStringPropertyNames ) / sizeof( pStringPropertyNames[0] );
|
2010-10-06 10:16:27 +01:00
|
|
|
|
OSL_ENSURE( ( nIdCount == nNameCount ),
|
|
|
|
|
"OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
|
|
|
|
|
#endif
|
|
|
|
|
for ( i = 0; i < nIdCount; ++i )
|
|
|
|
|
if ( nStringPropertyAttributeIds[i] & m_nIncludeSpecial )
|
|
|
|
|
{
|
|
|
|
|
exportStringPropertyAttribute(
|
|
|
|
|
OAttributeMetaData::getSpecialAttributeNamespace( nStringPropertyAttributeIds[i] ),
|
|
|
|
|
OAttributeMetaData::getSpecialAttributeName( nStringPropertyAttributeIds[i] ),
|
2012-05-17 14:00:15 +01:00
|
|
|
|
pStringPropertyNames[i]
|
2010-10-06 10:16:27 +01:00
|
|
|
|
);
|
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeSpecial = m_nIncludeSpecial & ~nStringPropertyAttributeIds[i];
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-25 06:53:45 +00:00
|
|
|
|
// ----------------------------------
|
2000-11-17 18:03:33 +00:00
|
|
|
|
if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial)
|
|
|
|
|
{
|
|
|
|
|
// need to export the min value and the max value as attributes
|
|
|
|
|
// It depends on the real type (FormComponentType) of the control, which properties hold these
|
|
|
|
|
// values
|
|
|
|
|
const sal_Char* pMinValuePropertyName = NULL;
|
|
|
|
|
const sal_Char* pMaxValuePropertyName = NULL;
|
2000-12-13 09:38:10 +00:00
|
|
|
|
getValueLimitPropertyNames(m_nClassId, pMinValuePropertyName, pMaxValuePropertyName);
|
|
|
|
|
|
|
|
|
|
OSL_ENSURE((NULL == pMinValuePropertyName) == (0 == (SCA_MIN_VALUE & m_nIncludeSpecial)),
|
|
|
|
|
"OControlExport::exportCommonControlAttributes: no property found for the min value attribute!");
|
|
|
|
|
OSL_ENSURE((NULL == pMaxValuePropertyName) == (0 == (SCA_MAX_VALUE & m_nIncludeSpecial)),
|
2003-12-11 11:08:10 +00:00
|
|
|
|
"OControlExport::exportCommonControlAttributes: no property found for the max value attribute!");
|
2000-12-13 09:38:10 +00:00
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// add the two attributes
|
2004-08-02 13:13:42 +00:00
|
|
|
|
static const sal_Char* pMinValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCA_MIN_VALUE);
|
|
|
|
|
static const sal_Char* pMaxValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCA_MAX_VALUE);
|
|
|
|
|
static const sal_uInt16 nMinValueNamespaceKey = OAttributeMetaData::getSpecialAttributeNamespace(SCA_MIN_VALUE);
|
|
|
|
|
static const sal_uInt16 nMaxValueNamespaceKey = OAttributeMetaData::getSpecialAttributeNamespace(SCA_MAX_VALUE);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
|
|
|
|
if (pMinValuePropertyName && (SCA_MIN_VALUE & m_nIncludeSpecial))
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportGenericPropertyAttribute(
|
2000-11-17 18:03:33 +00:00
|
|
|
|
nMinValueNamespaceKey,
|
|
|
|
|
pMinValueAttributeName,
|
|
|
|
|
pMinValuePropertyName);
|
|
|
|
|
|
|
|
|
|
if (pMaxValuePropertyName && (SCA_MAX_VALUE & m_nIncludeSpecial))
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportGenericPropertyAttribute(
|
2000-11-17 18:03:33 +00:00
|
|
|
|
nMaxValueNamespaceKey,
|
|
|
|
|
pMaxValueAttributeName,
|
|
|
|
|
pMaxValuePropertyName);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// reset the bit for later checking
|
|
|
|
|
m_nIncludeSpecial = m_nIncludeSpecial & ~(SCA_MIN_VALUE | SCA_MAX_VALUE);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2004-07-05 15:07:26 +00:00
|
|
|
|
// ----------------------------------
|
|
|
|
|
if ( SCA_IMAGE_POSITION & m_nIncludeSpecial )
|
|
|
|
|
{
|
|
|
|
|
exportImagePositionAttributes();
|
2008-12-01 12:31:27 +00:00
|
|
|
|
RESET_BIT( m_nIncludeSpecial, SCA_IMAGE_POSITION );
|
2004-07-05 15:07:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
OSL_ENSURE(0 == m_nIncludeSpecial,
|
|
|
|
|
"OControlExport::exportSpecialAttributes: forgot some flags!");
|
|
|
|
|
// in the dbg_util version, we should have removed every bit we handled from the mask, so it should
|
|
|
|
|
// be 0 now ...
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2004-06-28 16:04:36 +00:00
|
|
|
|
::rtl::OUString OControlExport::getScalarListSourceValue() const
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
|
|
|
|
::rtl::OUString sListSource;
|
2004-06-28 16:04:36 +00:00
|
|
|
|
Any aListSource = m_xProps->getPropertyValue( PROPERTY_LISTSOURCE );
|
|
|
|
|
if ( !( aListSource >>= sListSource ) )
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
|
|
|
|
Sequence< ::rtl::OUString > aListSourceSequence;
|
|
|
|
|
aListSource >>= aListSourceSequence;
|
2004-06-28 16:04:36 +00:00
|
|
|
|
if ( aListSourceSequence.getLength() )
|
|
|
|
|
sListSource = aListSourceSequence[ 0 ];
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
2004-06-28 16:04:36 +00:00
|
|
|
|
return sListSource;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportListSourceAsAttribute()
|
|
|
|
|
{
|
|
|
|
|
// DA_LIST_SOURCE needs some special handling
|
|
|
|
|
DBG_CHECK_PROPERTY_NO_TYPE( PROPERTY_LISTSOURCE );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
2004-06-28 16:04:36 +00:00
|
|
|
|
::rtl::OUString sListSource = getScalarListSourceValue();
|
2012-01-25 21:59:48 -02:00
|
|
|
|
if ( !sListSource.isEmpty() )
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{ // the ListSource property needs to be exported as attribute, and it is not empty
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getDatabaseAttributeNamespace(DA_LIST_SOURCE),
|
|
|
|
|
OAttributeMetaData::getDatabaseAttributeName(DA_LIST_SOURCE),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
sListSource);
|
|
|
|
|
}
|
2006-07-26 06:31:26 +00:00
|
|
|
|
|
|
|
|
|
exportedProperty( PROPERTY_LISTSOURCE );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::getSequenceInt16PropertyAsSet(const ::rtl::OUString& _rPropertyName, Int16Set& _rOut)
|
|
|
|
|
{
|
|
|
|
|
Sequence< sal_Int16 > aValueSequence;
|
|
|
|
|
DBG_CHECK_PROPERTY(_rPropertyName, Sequence< sal_Int16 >);
|
|
|
|
|
m_xProps->getPropertyValue(_rPropertyName) >>= aValueSequence;
|
|
|
|
|
|
|
|
|
|
const sal_Int16* pValues = aValueSequence.getConstArray();
|
|
|
|
|
for (sal_Int32 i=0; i<aValueSequence.getLength(); ++i, ++pValues)
|
|
|
|
|
_rOut.insert(*pValues);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportListSourceAsElements()
|
|
|
|
|
{
|
|
|
|
|
// the string lists
|
|
|
|
|
Sequence< ::rtl::OUString > aItems, aValues;
|
2002-10-25 06:53:45 +00:00
|
|
|
|
DBG_CHECK_PROPERTY( PROPERTY_STRING_ITEM_LIST, Sequence< ::rtl::OUString > );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_xProps->getPropertyValue(PROPERTY_STRING_ITEM_LIST) >>= aItems;
|
|
|
|
|
|
2002-10-25 06:53:45 +00:00
|
|
|
|
DBG_CHECK_PROPERTY( PROPERTY_LISTSOURCE, Sequence< ::rtl::OUString > );
|
2001-11-02 10:45:36 +00:00
|
|
|
|
if ( 0 == ( m_nIncludeDatabase & DA_LIST_SOURCE ) )
|
|
|
|
|
m_xProps->getPropertyValue(PROPERTY_LISTSOURCE) >>= aValues;
|
|
|
|
|
// if we exported the list source as attribute, we do not repeat it as sub elements
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
|
|
|
|
// the selection lists
|
|
|
|
|
Int16Set aSelection, aDefaultSelection;
|
|
|
|
|
getSequenceInt16PropertyAsSet(PROPERTY_SELECT_SEQ, aSelection);
|
|
|
|
|
getSequenceInt16PropertyAsSet(PROPERTY_DEFAULT_SELECT_SEQ, aDefaultSelection);
|
|
|
|
|
|
2004-06-28 16:04:36 +00:00
|
|
|
|
// the string for "true"
|
2000-11-17 18:03:33 +00:00
|
|
|
|
::rtl::OUString sTrue;
|
|
|
|
|
::rtl::OUStringBuffer sBuffer;
|
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
2011-10-11 14:19:00 +02:00
|
|
|
|
::sax::Converter::convertBool(sBuffer, true);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
sTrue = sBuffer.makeStringAndClear();
|
|
|
|
|
|
|
|
|
|
// loop through both lists ('til the maximum of both lengths)
|
|
|
|
|
const ::rtl::OUString* pItems = aItems.getConstArray();
|
|
|
|
|
const ::rtl::OUString* pValues = aValues.getConstArray();
|
2001-05-21 12:33:04 +00:00
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
sal_Int32 nItems = aItems.getLength();
|
|
|
|
|
sal_Int32 nValues = aValues.getLength();
|
2001-05-21 12:33:04 +00:00
|
|
|
|
|
2001-10-12 15:36:00 +00:00
|
|
|
|
sal_Int16 nMaxLen = (sal_Int16)std::max(nItems, nValues);
|
2001-05-21 12:33:04 +00:00
|
|
|
|
|
|
|
|
|
for (sal_Int16 i=0; i<nMaxLen; ++i )
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2000-12-18 14:14:35 +00:00
|
|
|
|
m_rContext.getGlobalContext().ClearAttrList();
|
2000-11-17 18:03:33 +00:00
|
|
|
|
if (i < nItems)
|
2001-05-21 12:33:04 +00:00
|
|
|
|
{
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// there is an item at this position
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_LABEL),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
*pItems);
|
2001-05-21 12:33:04 +00:00
|
|
|
|
++pItems;
|
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
if (i < nValues)
|
2001-05-21 12:33:04 +00:00
|
|
|
|
{
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// there is an value at this position
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_VALUE),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_VALUE),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
*pValues);
|
2001-05-21 12:33:04 +00:00
|
|
|
|
++pValues;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Int16SetIterator aSelectedPos = aSelection.find(i);
|
|
|
|
|
if (aSelection.end() != aSelectedPos)
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{ // the item at this position is selected
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_CURRENT_SELECTED),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_CURRENT_SELECTED),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
sTrue
|
|
|
|
|
);
|
2001-05-21 12:33:04 +00:00
|
|
|
|
aSelection.erase(aSelectedPos);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
2001-05-21 12:33:04 +00:00
|
|
|
|
|
|
|
|
|
Int16SetIterator aDefaultSelectedPos = aDefaultSelection.find(i);
|
|
|
|
|
if (aDefaultSelection.end() != aDefaultSelectedPos)
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{ // the item at this position is selected as default
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_SELECTED),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_SELECTED),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
sTrue
|
|
|
|
|
);
|
2001-05-21 12:33:04 +00:00
|
|
|
|
aDefaultSelection.erase(aDefaultSelectedPos);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
2000-12-18 14:14:35 +00:00
|
|
|
|
SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "option", sal_True, sal_True);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
2001-05-21 12:33:04 +00:00
|
|
|
|
|
|
|
|
|
// There may be more "selected" or "default-selected" items than there are in the lists in real,
|
|
|
|
|
// so we need to store some additional "form:option" items which have no name and no label, but
|
|
|
|
|
// one or both of the selected flags.
|
|
|
|
|
// 21.05.2001 - 85388 - frank.schoenheit@germany.sun.com
|
|
|
|
|
|
2009-04-23 10:42:05 +00:00
|
|
|
|
if ( !aSelection.empty() || !aDefaultSelection.empty() )
|
2001-05-21 12:33:04 +00:00
|
|
|
|
{
|
|
|
|
|
sal_Int16 nLastSelected = -1;
|
2009-04-23 10:42:05 +00:00
|
|
|
|
if ( !aSelection.empty() )
|
2001-05-21 12:33:04 +00:00
|
|
|
|
nLastSelected = *(--aSelection.end());
|
|
|
|
|
|
|
|
|
|
sal_Int16 nLastDefaultSelected = -1;
|
2009-04-23 10:42:05 +00:00
|
|
|
|
if ( !aDefaultSelection.empty() )
|
2001-05-21 12:33:04 +00:00
|
|
|
|
nLastDefaultSelected = *(--aDefaultSelection.end());
|
|
|
|
|
|
|
|
|
|
// the maximum element in both sets
|
2001-10-12 15:36:00 +00:00
|
|
|
|
sal_Int16 nLastReferredEntry = std::max(nLastSelected, nLastDefaultSelected);
|
2001-06-14 12:39:35 +00:00
|
|
|
|
OSL_ENSURE(nLastReferredEntry >= nMaxLen, "OControlExport::exportListSourceAsElements: inconsistence!");
|
2001-05-21 12:33:04 +00:00
|
|
|
|
// if the maximum (selected or default selected) entry number is less than the maximum item count
|
|
|
|
|
// in both lists, the entry number should have been removed from the set
|
|
|
|
|
|
|
|
|
|
for (sal_Int16 i=nMaxLen; i<=nLastReferredEntry; ++i)
|
|
|
|
|
{
|
|
|
|
|
if (aSelection.end() != aSelection.find(i))
|
|
|
|
|
{ // the (not existent) item at this position is selected
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_CURRENT_SELECTED),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_CURRENT_SELECTED),
|
2001-05-21 12:33:04 +00:00
|
|
|
|
sTrue
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (aDefaultSelection.end() != aDefaultSelection.find(i))
|
|
|
|
|
{ // the (not existent) item at this position is selected as default
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_SELECTED),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_SELECTED),
|
2001-05-21 12:33:04 +00:00
|
|
|
|
sTrue
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "option", sal_True, sal_True);
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-03 15:25:34 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::implStartElement(const sal_Char* _pName)
|
|
|
|
|
{
|
|
|
|
|
// before we let the base class start it's outer element, we add a wrapper element
|
2004-07-13 07:11:47 +00:00
|
|
|
|
const sal_Char *pOuterElementName = getOuterXMLElementName();
|
|
|
|
|
m_pOuterElement = pOuterElementName
|
|
|
|
|
? new SvXMLElementExport(
|
|
|
|
|
m_rContext.getGlobalContext(),
|
|
|
|
|
XML_NAMESPACE_FORM,
|
|
|
|
|
pOuterElementName, sal_True,
|
|
|
|
|
sal_True)
|
|
|
|
|
: 0;
|
2001-01-03 15:25:34 +00:00
|
|
|
|
|
|
|
|
|
// add the attributes for the inner element
|
|
|
|
|
exportInnerAttributes();
|
|
|
|
|
|
|
|
|
|
// and start the inner element
|
|
|
|
|
OElementExport::implStartElement(_pName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::implEndElement()
|
|
|
|
|
{
|
|
|
|
|
// end the inner element
|
|
|
|
|
OElementExport::implEndElement();
|
|
|
|
|
|
2004-07-13 07:11:47 +00:00
|
|
|
|
// end the outer element if it exists
|
2001-01-03 15:25:34 +00:00
|
|
|
|
delete m_pOuterElement;
|
|
|
|
|
m_pOuterElement = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
const sal_Char* OControlExport::getOuterXMLElementName() const
|
|
|
|
|
{
|
2004-07-13 07:11:47 +00:00
|
|
|
|
return 0;
|
2001-01-03 15:25:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-02 14:58:22 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
const sal_Char* OControlExport::getXMLElementName() const
|
|
|
|
|
{
|
|
|
|
|
return getElementName(m_eType);
|
|
|
|
|
}
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::examine()
|
|
|
|
|
{
|
2004-07-05 15:07:26 +00:00
|
|
|
|
OSL_ENSURE( ( m_nIncludeCommon == 0 ) && ( m_nIncludeSpecial == 0 ) && ( m_nIncludeDatabase == 0 )
|
|
|
|
|
&& ( m_nIncludeEvents == 0 ) && ( m_nIncludeBindings == 0),
|
|
|
|
|
"OControlExport::examine: called me twice? Not initialized?" );
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// get the class id to decide which kind of element we need in the XML stream
|
|
|
|
|
m_nClassId = FormComponentType::CONTROL;
|
2002-10-25 06:53:45 +00:00
|
|
|
|
DBG_CHECK_PROPERTY( PROPERTY_CLASSID, sal_Int16 );
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_xProps->getPropertyValue(PROPERTY_CLASSID) >>= m_nClassId;
|
2010-09-15 13:55:34 +02:00
|
|
|
|
bool knownType = false;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
switch (m_nClassId)
|
|
|
|
|
{
|
|
|
|
|
case FormComponentType::DATEFIELD:
|
2010-09-15 13:55:34 +02:00
|
|
|
|
m_eType = DATE;
|
|
|
|
|
knownType = true;
|
|
|
|
|
// NO BREAK
|
2000-11-17 18:03:33 +00:00
|
|
|
|
case FormComponentType::TIMEFIELD:
|
2010-09-15 13:55:34 +02:00
|
|
|
|
if ( !knownType )
|
|
|
|
|
{
|
|
|
|
|
m_eType = TIME;
|
|
|
|
|
knownType = true;
|
|
|
|
|
}
|
|
|
|
|
m_nIncludeSpecial |= SCA_VALIDATION;
|
|
|
|
|
// NO BREAK
|
2000-11-17 18:03:33 +00:00
|
|
|
|
case FormComponentType::NUMERICFIELD:
|
|
|
|
|
case FormComponentType::CURRENCYFIELD:
|
|
|
|
|
case FormComponentType::PATTERNFIELD:
|
2010-09-15 13:55:34 +02:00
|
|
|
|
if ( !knownType )
|
|
|
|
|
{
|
|
|
|
|
m_eType = FORMATTED_TEXT;
|
|
|
|
|
knownType = true;
|
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// NO BREAK
|
|
|
|
|
case FormComponentType::TEXTFIELD:
|
2000-11-19 14:41:32 +00:00
|
|
|
|
{ // it's some kind of edit. To know which type we need further investigation
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
2010-09-15 13:55:34 +02:00
|
|
|
|
if ( !knownType )
|
|
|
|
|
{
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// check if it's a formatted field
|
2000-11-19 14:41:32 +00:00
|
|
|
|
if (m_xPropertyInfo->hasPropertyByName(PROPERTY_FORMATKEY))
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
|
|
|
|
m_eType = FORMATTED_TEXT;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// all other controls are represented by an ordinary edit control, but which XML control type
|
|
|
|
|
// it is depends on the current values of some properties
|
|
|
|
|
|
|
|
|
|
// if the EchoChar string is not empty, it is a password field
|
|
|
|
|
sal_Int16 nEchoChar = 0;
|
2000-11-19 14:41:32 +00:00
|
|
|
|
if (m_xPropertyInfo->hasPropertyByName(PROPERTY_ECHOCHAR))
|
|
|
|
|
// grid columns do not have this property ....
|
|
|
|
|
m_xProps->getPropertyValue(PROPERTY_ECHOCHAR) >>= nEchoChar;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
if (nEchoChar)
|
|
|
|
|
{
|
|
|
|
|
m_eType = PASSWORD;
|
|
|
|
|
m_nIncludeSpecial |= SCA_ECHO_CHAR;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// if the MultiLine property is sal_True, it is a TextArea
|
2000-11-19 14:41:32 +00:00
|
|
|
|
sal_Bool bMultiLine = sal_False;
|
|
|
|
|
if (m_xPropertyInfo->hasPropertyByName(PROPERTY_MULTILINE))
|
|
|
|
|
// grid columns do not have this property ....
|
|
|
|
|
bMultiLine = ::cppu::any2bool(m_xProps->getPropertyValue(PROPERTY_MULTILINE));
|
2004-05-07 14:59:18 +00:00
|
|
|
|
|
|
|
|
|
if ( bMultiLine )
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_eType = TEXT_AREA;
|
|
|
|
|
else
|
|
|
|
|
// the only case left is represented by a Text element
|
|
|
|
|
m_eType = TEXT;
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-09-15 13:55:34 +02:00
|
|
|
|
knownType = true;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-09-15 13:55:34 +02:00
|
|
|
|
// attributes which are common to all the types:
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// common attributes
|
|
|
|
|
m_nIncludeCommon =
|
2010-09-15 13:55:34 +02:00
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED |
|
2004-05-07 14:59:18 +00:00
|
|
|
|
CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
|
|
|
|
|
|
2010-09-15 13:55:34 +02:00
|
|
|
|
if ( ( m_nClassId != FormComponentType::DATEFIELD )
|
|
|
|
|
&& ( m_nClassId != FormComponentType::TIMEFIELD )
|
|
|
|
|
)
|
|
|
|
|
// date and time field values are handled differently nowadays
|
|
|
|
|
m_nIncludeCommon |= CCA_VALUE;
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// database attributes
|
2008-12-01 12:31:27 +00:00
|
|
|
|
m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
|
2004-05-07 14:59:18 +00:00
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// event attributes
|
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
|
|
|
|
|
|
|
|
|
|
// only text and pattern fields have a ConvertEmptyToNull property
|
2004-05-07 14:59:18 +00:00
|
|
|
|
if ( ( m_nClassId == FormComponentType::TEXTFIELD )
|
|
|
|
|
|| ( m_nClassId == FormComponentType::PATTERNFIELD )
|
|
|
|
|
)
|
2000-11-19 14:41:32 +00:00
|
|
|
|
m_nIncludeDatabase |= DA_CONVERT_EMPTY;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
|
|
|
|
// all controls but the file control fields have a readonly property
|
2004-05-07 14:59:18 +00:00
|
|
|
|
if ( m_nClassId != FormComponentType::FILECONTROL )
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_nIncludeCommon |= CCA_READONLY;
|
|
|
|
|
|
|
|
|
|
// a text field has a max text len
|
2004-05-07 14:59:18 +00:00
|
|
|
|
if ( m_nClassId == FormComponentType::TEXTFIELD )
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_nIncludeCommon |= CCA_MAX_LENGTH;
|
|
|
|
|
|
2000-12-13 09:38:10 +00:00
|
|
|
|
// max and min values and validation:
|
2000-11-17 18:03:33 +00:00
|
|
|
|
if (FORMATTED_TEXT == m_eType)
|
2004-05-07 14:59:18 +00:00
|
|
|
|
{ // in general all controls represented as formatted-text have these props
|
2010-09-15 13:55:34 +02:00
|
|
|
|
if ( FormComponentType::PATTERNFIELD != m_nClassId ) // except the PatternField
|
2000-12-13 09:38:10 +00:00
|
|
|
|
m_nIncludeSpecial |= SCA_MAX_VALUE | SCA_MIN_VALUE;
|
|
|
|
|
|
|
|
|
|
if (FormComponentType::TEXTFIELD != m_nClassId)
|
|
|
|
|
// and the FormattedField does not have a validation flag
|
|
|
|
|
m_nIncludeSpecial |= SCA_VALIDATION;
|
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
2004-05-07 14:59:18 +00:00
|
|
|
|
// if it's not a password field or rich text control, the CurrentValue needs to be stored, too
|
2010-09-15 13:55:34 +02:00
|
|
|
|
if ( ( PASSWORD != m_eType )
|
|
|
|
|
&& ( DATE != m_eType )
|
|
|
|
|
&& ( TIME != m_eType )
|
|
|
|
|
)
|
|
|
|
|
{
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_nIncludeCommon |= CCA_CURRENT_VALUE;
|
2010-09-15 13:55:34 +02:00
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FormComponentType::FILECONTROL:
|
|
|
|
|
m_eType = FILE;
|
|
|
|
|
m_nIncludeCommon =
|
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_CURRENT_VALUE | CCA_DISABLED |
|
|
|
|
|
CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE |
|
|
|
|
|
CCA_VALUE;
|
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FormComponentType::FIXEDTEXT:
|
|
|
|
|
m_eType = FIXED_TEXT;
|
|
|
|
|
m_nIncludeCommon =
|
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_LABEL |
|
|
|
|
|
CCA_PRINTABLE | CCA_TITLE | CCA_FOR;
|
|
|
|
|
m_nIncludeSpecial = SCA_MULTI_LINE;
|
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FormComponentType::COMBOBOX:
|
|
|
|
|
m_eType = COMBOBOX;
|
|
|
|
|
m_nIncludeCommon =
|
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_CURRENT_VALUE |
|
|
|
|
|
CCA_DISABLED | CCA_DROPDOWN | CCA_MAX_LENGTH | CCA_PRINTABLE | CCA_READONLY | CCA_SIZE |
|
2000-11-19 14:41:32 +00:00
|
|
|
|
CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE | CCA_VALUE;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_nIncludeSpecial = SCA_AUTOMATIC_COMPLETION;
|
2008-12-01 12:31:27 +00:00
|
|
|
|
m_nIncludeDatabase = DA_CONVERT_EMPTY | DA_DATA_FIELD | DA_INPUT_REQUIRED | DA_LIST_SOURCE | DA_LIST_SOURCE_TYPE;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FormComponentType::LISTBOX:
|
|
|
|
|
m_eType = LISTBOX;
|
|
|
|
|
m_nIncludeCommon =
|
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_DROPDOWN |
|
|
|
|
|
CCA_PRINTABLE | CCA_SIZE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
|
|
|
|
|
m_nIncludeSpecial = SCA_MULTIPLE;
|
2008-12-01 12:31:27 +00:00
|
|
|
|
m_nIncludeDatabase = DA_BOUND_COLUMN | DA_DATA_FIELD | DA_INPUT_REQUIRED | DA_LIST_SOURCE_TYPE;
|
2004-06-28 16:04:36 +00:00
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_CLICK | EA_ON_DBLCLICK;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// check if we need to export the ListSource as attribute
|
|
|
|
|
{
|
|
|
|
|
// for a list box, if the ListSourceType is VALUE_LIST, no ListSource is stored, but instead
|
|
|
|
|
// a sequence of pairs which is build from the StringItemList and the ValueList
|
|
|
|
|
ListSourceType eListSourceType = ListSourceType_VALUELIST;
|
2003-04-15 15:32:55 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-11-17 18:03:33 +00:00
|
|
|
|
sal_Bool bSuccess =
|
|
|
|
|
#endif
|
|
|
|
|
m_xProps->getPropertyValue(PROPERTY_LISTSOURCETYPE) >>= eListSourceType;
|
|
|
|
|
OSL_ENSURE(bSuccess, "OControlExport::examineControl: could not retrieve the ListSourceType!");
|
|
|
|
|
if (ListSourceType_VALUELIST != eListSourceType)
|
|
|
|
|
{
|
|
|
|
|
m_nIncludeDatabase |= DA_LIST_SOURCE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FormComponentType::COMMANDBUTTON:
|
|
|
|
|
m_eType = BUTTON;
|
2000-11-19 14:41:32 +00:00
|
|
|
|
m_nIncludeCommon |= CCA_TAB_STOP | CCA_LABEL;
|
2004-11-26 12:01:22 +00:00
|
|
|
|
m_nIncludeSpecial = SCA_DEFAULT_BUTTON | SCA_TOGGLE | SCA_FOCUS_ON_CLICK | SCA_IMAGE_POSITION | SCA_REPEAT_DELAY;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// NO BREAK !
|
|
|
|
|
case FormComponentType::IMAGEBUTTON:
|
|
|
|
|
if (BUTTON != m_eType)
|
2008-12-01 12:31:27 +00:00
|
|
|
|
{
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// not coming from the previous case
|
|
|
|
|
m_eType = IMAGE;
|
2008-12-01 12:31:27 +00:00
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_nIncludeCommon |=
|
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_BUTTON_TYPE | CCA_DISABLED |
|
|
|
|
|
CCA_IMAGE_DATA | CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TARGET_FRAME |
|
|
|
|
|
CCA_TARGET_LOCATION | CCA_TITLE;
|
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CLICK | EA_ON_DBLCLICK;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FormComponentType::CHECKBOX:
|
|
|
|
|
m_eType = CHECKBOX;
|
|
|
|
|
m_nIncludeSpecial = SCA_CURRENT_STATE | SCA_IS_TRISTATE | SCA_STATE;
|
|
|
|
|
// NO BREAK !
|
|
|
|
|
case FormComponentType::RADIOBUTTON:
|
|
|
|
|
m_nIncludeCommon =
|
2004-07-05 15:07:26 +00:00
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_LABEL | CCA_PRINTABLE |
|
|
|
|
|
CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE | CCA_VALUE | CCA_VISUAL_EFFECT;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
if (CHECKBOX != m_eType)
|
|
|
|
|
{ // not coming from the previous case
|
|
|
|
|
m_eType = RADIO;
|
|
|
|
|
m_nIncludeCommon |= CCA_CURRENT_SELECTED | CCA_SELECTED;
|
|
|
|
|
}
|
2008-01-30 07:05:37 +00:00
|
|
|
|
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) )
|
|
|
|
|
m_nIncludeSpecial |= SCA_IMAGE_POSITION;
|
2010-10-06 10:16:27 +01:00
|
|
|
|
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_GROUP_NAME ) )
|
|
|
|
|
m_nIncludeSpecial |= SCA_GROUP_NAME;
|
2008-12-01 12:31:27 +00:00
|
|
|
|
m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FormComponentType::GROUPBOX:
|
|
|
|
|
m_eType = FRAME;
|
|
|
|
|
m_nIncludeCommon =
|
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_LABEL |
|
|
|
|
|
CCA_PRINTABLE | CCA_TITLE | CCA_FOR;
|
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FormComponentType::IMAGECONTROL:
|
|
|
|
|
m_eType = IMAGE_FRAME;
|
|
|
|
|
m_nIncludeCommon =
|
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_IMAGE_DATA |
|
|
|
|
|
CCA_PRINTABLE | CCA_READONLY | CCA_TITLE;
|
2008-12-01 12:31:27 +00:00
|
|
|
|
m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FormComponentType::HIDDENCONTROL:
|
|
|
|
|
m_eType = HIDDEN;
|
|
|
|
|
m_nIncludeCommon =
|
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_VALUE;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FormComponentType::GRIDCONTROL:
|
|
|
|
|
m_eType = GRID;
|
|
|
|
|
m_nIncludeCommon =
|
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_PRINTABLE |
|
|
|
|
|
CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
|
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
|
|
|
|
break;
|
|
|
|
|
|
2003-12-11 11:08:10 +00:00
|
|
|
|
case FormComponentType::SCROLLBAR:
|
|
|
|
|
case FormComponentType::SPINBUTTON:
|
|
|
|
|
m_eType = VALUERANGE;
|
|
|
|
|
m_nIncludeCommon =
|
|
|
|
|
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_PRINTABLE |
|
|
|
|
|
CCA_TITLE | CCA_CURRENT_VALUE | CCA_VALUE | CCA_ORIENTATION;
|
|
|
|
|
m_nIncludeSpecial = SCA_MAX_VALUE | SCA_STEP_SIZE | SCA_MIN_VALUE | SCA_REPEAT_DELAY;
|
|
|
|
|
|
|
|
|
|
if ( m_nClassId == FormComponentType::SCROLLBAR )
|
|
|
|
|
m_nIncludeSpecial |= SCA_PAGE_STEP_SIZE ;
|
|
|
|
|
|
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
|
|
|
|
break;
|
|
|
|
|
|
2004-04-13 10:05:13 +00:00
|
|
|
|
default:
|
2011-03-19 14:09:49 +01:00
|
|
|
|
OSL_FAIL("OControlExport::examineControl: unknown control type (class id)!");
|
2004-04-13 10:05:13 +00:00
|
|
|
|
// NO break!
|
|
|
|
|
|
|
|
|
|
case FormComponentType::NAVIGATIONBAR:
|
|
|
|
|
// TODO: should we have an own file format for this?
|
|
|
|
|
// NO break
|
|
|
|
|
|
2000-11-19 14:41:32 +00:00
|
|
|
|
case FormComponentType::CONTROL:
|
2001-01-03 15:25:34 +00:00
|
|
|
|
m_eType = GENERIC_CONTROL;
|
2000-11-19 14:41:32 +00:00
|
|
|
|
// unknown control type
|
|
|
|
|
m_nIncludeCommon = CCA_NAME | CCA_SERVICE_NAME;
|
|
|
|
|
// at least a name should be there, 'cause without a name the control could never have been
|
|
|
|
|
// inserted into it's parent container
|
|
|
|
|
// In addition, the service name is absolutely necessary to create the control upon reading.
|
|
|
|
|
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
|
|
|
|
// we always should be able to export events - this is not control type dependent
|
|
|
|
|
break;
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
2000-11-19 14:41:32 +00:00
|
|
|
|
|
|
|
|
|
// in general, all control types need to export the control id
|
|
|
|
|
m_nIncludeCommon |= CCA_CONTROL_ID;
|
2003-10-21 07:38:16 +00:00
|
|
|
|
|
|
|
|
|
// is is a control bound to a calc cell?
|
|
|
|
|
if ( FormCellBindingHelper::livesInSpreadsheetDocument( m_xProps ) )
|
|
|
|
|
{
|
|
|
|
|
FormCellBindingHelper aHelper( m_xProps, NULL );
|
|
|
|
|
{
|
|
|
|
|
if ( aHelper.isCellBinding( aHelper.getCurrentBinding( ) ) )
|
|
|
|
|
{
|
|
|
|
|
m_nIncludeBindings |= BA_LINKED_CELL;
|
|
|
|
|
if ( m_nClassId == FormComponentType::LISTBOX )
|
|
|
|
|
m_nIncludeBindings |= BA_LIST_LINKING_TYPE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// is it a list-like control which uses a calc cell range as list source?
|
|
|
|
|
{
|
|
|
|
|
if ( aHelper.isCellRangeListSource( aHelper.getCurrentListSource( ) ) )
|
|
|
|
|
m_nIncludeBindings |= BA_LIST_CELL_RANGE;
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-11-16 09:08:56 +00:00
|
|
|
|
|
|
|
|
|
// is control bound to XForms?
|
2012-01-25 21:59:48 -02:00
|
|
|
|
if( !getXFormsBindName( m_xProps ).isEmpty() )
|
2004-11-16 09:08:56 +00:00
|
|
|
|
{
|
|
|
|
|
m_nIncludeBindings |= BA_XFORMS_BIND;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// is (list-)control bound to XForms list?
|
2012-01-25 21:59:48 -02:00
|
|
|
|
if( !getXFormsListBindName( m_xProps ).isEmpty() )
|
2004-11-16 09:08:56 +00:00
|
|
|
|
{
|
|
|
|
|
m_nIncludeBindings |= BA_XFORMS_LISTBIND;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// does the control have an XForms submission?
|
2012-01-25 21:59:48 -02:00
|
|
|
|
if( !getXFormsSubmissionName( m_xProps ).isEmpty() )
|
2004-11-16 09:08:56 +00:00
|
|
|
|
{
|
|
|
|
|
m_nIncludeBindings |= BA_XFORMS_SUBMISSION;
|
|
|
|
|
}
|
2003-10-21 07:38:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportCellBindingAttributes( bool _bIncludeListLinkageType )
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
FormCellBindingHelper aHelper( m_xProps, NULL );
|
|
|
|
|
Reference< XValueBinding > xBinding( aHelper.getCurrentBinding() );
|
|
|
|
|
OSL_ENSURE( xBinding.is(), "OControlExport::exportCellBindingAttributes: invalid bindable or invalid binding!" );
|
|
|
|
|
if ( xBinding.is() )
|
|
|
|
|
{
|
|
|
|
|
// ....................................................
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getBindingAttributeNamespace( BA_LINKED_CELL ),
|
|
|
|
|
OAttributeMetaData::getBindingAttributeName( BA_LINKED_CELL ),
|
2003-10-21 07:38:16 +00:00
|
|
|
|
aHelper.getStringAddressFromCellBinding( xBinding )
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// ....................................................
|
|
|
|
|
if ( _bIncludeListLinkageType )
|
|
|
|
|
{
|
|
|
|
|
sal_Int16 nLinkageType = aHelper.isCellIntegerBinding( xBinding ) ? 1 : 0;
|
|
|
|
|
|
|
|
|
|
::rtl::OUStringBuffer sBuffer;
|
|
|
|
|
m_rContext.getGlobalContext().GetMM100UnitConverter().convertEnum(
|
|
|
|
|
sBuffer,
|
|
|
|
|
(sal_uInt16)nLinkageType,
|
|
|
|
|
OEnumMapper::getEnumMap( OEnumMapper::epListLinkageType )
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getBindingAttributeNamespace( BA_LIST_LINKING_TYPE ),
|
|
|
|
|
OAttributeMetaData::getBindingAttributeName( BA_LIST_LINKING_TYPE ),
|
2003-10-21 07:38:16 +00:00
|
|
|
|
sBuffer.makeStringAndClear()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch( const Exception& )
|
|
|
|
|
{
|
2011-03-19 14:09:49 +01:00
|
|
|
|
OSL_FAIL( "OControlExport::exportCellBindingAttributes: caught an exception!" );
|
2003-10-21 07:38:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-16 09:08:56 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportXFormsBindAttributes()
|
|
|
|
|
{
|
|
|
|
|
rtl::OUString sBindName = getXFormsBindName( m_xProps );
|
2005-03-08 13:56:28 +00:00
|
|
|
|
AddAttribute( XML_NAMESPACE_XFORMS, XML_BIND, sBindName );
|
2004-11-16 09:08:56 +00:00
|
|
|
|
}
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportXFormsListAttributes()
|
|
|
|
|
{
|
|
|
|
|
rtl::OUString sBindName = getXFormsListBindName( m_xProps );
|
2005-03-08 13:56:28 +00:00
|
|
|
|
AddAttribute( XML_NAMESPACE_FORM, XML_XFORMS_LIST_SOURCE, sBindName );
|
2004-11-16 09:08:56 +00:00
|
|
|
|
}
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportXFormsSubmissionAttributes()
|
|
|
|
|
{
|
|
|
|
|
rtl::OUString sSubmission = getXFormsSubmissionName( m_xProps );
|
2005-03-08 13:56:28 +00:00
|
|
|
|
AddAttribute( XML_NAMESPACE_FORM, XML_XFORMS_SUBMISSION, sSubmission );
|
2004-11-16 09:08:56 +00:00
|
|
|
|
}
|
2003-10-21 07:38:16 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportCellListSourceRange( )
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Reference< XListEntrySink > xSink( m_xProps, UNO_QUERY );
|
|
|
|
|
Reference< XListEntrySource > xSource;
|
|
|
|
|
if ( xSink.is() )
|
|
|
|
|
xSource = xSource.query( xSink->getListEntrySource() );
|
|
|
|
|
OSL_ENSURE( xSource.is(), "OControlExport::exportCellListSourceRange: list source or sink!" );
|
|
|
|
|
if ( xSource.is() )
|
|
|
|
|
{
|
|
|
|
|
FormCellBindingHelper aHelper( m_xProps, NULL );
|
|
|
|
|
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getBindingAttributeNamespace( BA_LIST_CELL_RANGE ),
|
|
|
|
|
OAttributeMetaData::getBindingAttributeName( BA_LIST_CELL_RANGE ),
|
2003-10-21 07:38:16 +00:00
|
|
|
|
aHelper.getStringAddressFromCellListSource( xSource )
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch( const Exception& )
|
|
|
|
|
{
|
2011-03-19 14:09:49 +01:00
|
|
|
|
OSL_FAIL( "OControlExport::exportCellListSourceRange: caught an exception!" );
|
2003-10-21 07:38:16 +00:00
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-07-05 15:07:26 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OControlExport::exportImagePositionAttributes()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
sal_Int16 nImagePosition = ImagePosition::Centered;
|
|
|
|
|
OSL_VERIFY( m_xProps->getPropertyValue( PROPERTY_IMAGE_POSITION ) >>= nImagePosition );
|
|
|
|
|
OSL_ENSURE( ( nImagePosition >= ImagePosition::LeftTop ) && ( nImagePosition <= ImagePosition::Centered ),
|
|
|
|
|
"OControlExport::exportImagePositionAttributes: don't know this image position!" );
|
|
|
|
|
|
|
|
|
|
if ( ( nImagePosition < ImagePosition::LeftTop ) || ( nImagePosition > ImagePosition::Centered ) )
|
|
|
|
|
// this is important to prevent potential buffer overflows below, so don't optimize
|
|
|
|
|
nImagePosition = ImagePosition::Centered;
|
|
|
|
|
|
|
|
|
|
if ( nImagePosition == ImagePosition::Centered )
|
|
|
|
|
{
|
|
|
|
|
AddAttribute( XML_NAMESPACE_FORM, GetXMLToken( XML_IMAGE_POSITION ), GetXMLToken( XML_CENTER ) );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
XMLTokenEnum eXmlImagePositions[] =
|
|
|
|
|
{
|
|
|
|
|
XML_START, XML_END, XML_TOP, XML_BOTTOM
|
|
|
|
|
};
|
|
|
|
|
XMLTokenEnum eXmlImageAligns[] =
|
|
|
|
|
{
|
|
|
|
|
XML_START, XML_CENTER, XML_END
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
XMLTokenEnum eXmlImagePosition = eXmlImagePositions[ nImagePosition / 3 ];
|
|
|
|
|
XMLTokenEnum eXmlImageAlign = eXmlImageAligns [ nImagePosition % 3 ];
|
|
|
|
|
|
|
|
|
|
AddAttribute( XML_NAMESPACE_FORM, GetXMLToken( XML_IMAGE_POSITION ), GetXMLToken( eXmlImagePosition ) );
|
|
|
|
|
AddAttribute( XML_NAMESPACE_FORM, GetXMLToken( XML_IMAGE_ALIGN ), GetXMLToken( eXmlImageAlign ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exportedProperty( PROPERTY_IMAGE_POSITION );
|
|
|
|
|
// some of the controls which have an ImagePosition also have an ImageAlign for compatibility
|
|
|
|
|
// reasons. Since the ImageAlign values simply represent a sub set of the ImagePosition values,
|
|
|
|
|
// we don't need to export ImageAlign anymore
|
|
|
|
|
exportedProperty( PROPERTY_IMAGE_ALIGN );
|
|
|
|
|
}
|
|
|
|
|
catch( const Exception& )
|
|
|
|
|
{
|
2008-01-30 07:05:37 +00:00
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2004-07-05 15:07:26 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-06-28 16:04:36 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
bool OControlExport::controlHasActiveDataBinding() const
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// currently exchanging the data with a database column?
|
|
|
|
|
::rtl::OUString sBoundFieldPropertyName( RTL_CONSTASCII_USTRINGPARAM( "BoundField" ) );
|
|
|
|
|
if ( m_xPropertyInfo.is() && m_xPropertyInfo->hasPropertyByName( sBoundFieldPropertyName ) )
|
|
|
|
|
{
|
|
|
|
|
Reference< XPropertySet > xBoundField;
|
|
|
|
|
m_xProps->getPropertyValue( sBoundFieldPropertyName ) >>= xBoundField;
|
|
|
|
|
if ( xBoundField.is() )
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// currently exchanging data with an external binding?
|
|
|
|
|
Reference< XBindableValue > xBindable( m_xProps, UNO_QUERY );
|
|
|
|
|
if ( xBindable.is() && xBindable->getValueBinding().is() )
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
catch( const Exception& )
|
|
|
|
|
{
|
2011-03-19 14:09:49 +01:00
|
|
|
|
OSL_FAIL( "OColumnExport::controlHasActiveDataBinding: caught an exception!" );
|
2004-06-28 16:04:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
bool OControlExport::controlHasUserSuppliedListEntries() const
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// an external list source?
|
|
|
|
|
Reference< XListEntrySink > xEntrySink( m_xProps, UNO_QUERY );
|
|
|
|
|
if ( xEntrySink.is() && xEntrySink->getListEntrySource().is() )
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if ( m_xPropertyInfo.is() && m_xPropertyInfo->hasPropertyByName( PROPERTY_LISTSOURCETYPE ) )
|
|
|
|
|
{
|
|
|
|
|
ListSourceType eListSourceType = ListSourceType_VALUELIST;
|
|
|
|
|
OSL_VERIFY( m_xProps->getPropertyValue( PROPERTY_LISTSOURCETYPE ) >>= eListSourceType );
|
|
|
|
|
if ( eListSourceType == ListSourceType_VALUELIST )
|
|
|
|
|
// for value lists, the list entries as entered by the user are used
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
// for every other type, the list entries are filled with some data obtained
|
|
|
|
|
// from a database - if and only if the ListSource property is not empty
|
2012-01-25 21:59:48 -02:00
|
|
|
|
return getScalarListSourceValue().isEmpty();
|
2004-06-28 16:04:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch( const Exception& )
|
|
|
|
|
{
|
2011-03-19 14:09:49 +01:00
|
|
|
|
OSL_FAIL( "OControlExport::controlHasUserSuppliedListEntries: caught an exception!" );
|
2004-06-28 16:04:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-03-19 14:09:49 +01:00
|
|
|
|
OSL_FAIL( "OControlExport::controlHasUserSuppliedListEntries: unreachable code!" );
|
2004-06-28 16:04:36 +00:00
|
|
|
|
// this method should be called for list and combo boxes only
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2000-11-19 14:41:32 +00:00
|
|
|
|
//=====================================================================
|
|
|
|
|
//= OColumnExport
|
|
|
|
|
//=====================================================================
|
|
|
|
|
//---------------------------------------------------------------------
|
2007-05-10 08:41:07 +00:00
|
|
|
|
OColumnExport::OColumnExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxControl, const ::rtl::OUString& _rControlId,
|
2001-01-02 14:58:22 +00:00
|
|
|
|
const Sequence< ScriptEventDescriptor >& _rEvents)
|
2007-05-10 08:41:07 +00:00
|
|
|
|
:OControlExport(_rContext, _rxControl, _rControlId, ::rtl::OUString(), _rEvents)
|
2000-11-19 14:41:32 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
OColumnExport::~OColumnExport()
|
|
|
|
|
{
|
2001-01-02 14:58:22 +00:00
|
|
|
|
implEndElement();
|
2000-11-19 14:41:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
2001-01-03 15:25:34 +00:00
|
|
|
|
void OColumnExport::exportServiceNameAttribute()
|
2000-11-19 14:41:32 +00:00
|
|
|
|
{
|
|
|
|
|
// the attribute "service name" (which has a slightly different meaning for columns
|
2002-10-25 06:53:45 +00:00
|
|
|
|
DBG_CHECK_PROPERTY( PROPERTY_COLUMNSERVICENAME, ::rtl::OUString );
|
2000-12-13 09:38:10 +00:00
|
|
|
|
::rtl::OUString sColumnServiceName;
|
|
|
|
|
m_xProps->getPropertyValue(PROPERTY_COLUMNSERVICENAME) >>= sColumnServiceName;
|
|
|
|
|
// the service name is a full qualified one (i.e. com.sun.star.form.TextField), but the
|
|
|
|
|
// real service name for the column (for use with the XGridColumnFactory) is only the last
|
|
|
|
|
// token of this complete name.
|
|
|
|
|
sal_Int32 nLastSep = sColumnServiceName.lastIndexOf('.');
|
|
|
|
|
OSL_ENSURE(-1 != nLastSep, "OColumnExport::startExportElement: invalid service name!");
|
|
|
|
|
sColumnServiceName = sColumnServiceName.copy(nLastSep + 1);
|
2004-07-13 07:11:47 +00:00
|
|
|
|
sColumnServiceName =
|
|
|
|
|
m_rContext.getGlobalContext().GetNamespaceMap().GetQNameByKey(
|
|
|
|
|
XML_NAMESPACE_OOO, sColumnServiceName );
|
2000-12-13 09:38:10 +00:00
|
|
|
|
// add the attribute
|
2004-08-02 13:13:42 +00:00
|
|
|
|
AddAttribute( OAttributeMetaData::getCommonControlAttributeNamespace(CCA_SERVICE_NAME)
|
|
|
|
|
, OAttributeMetaData::getCommonControlAttributeName(CCA_SERVICE_NAME)
|
|
|
|
|
, sColumnServiceName);
|
2000-12-13 09:38:10 +00:00
|
|
|
|
// flag the property as "handled"
|
|
|
|
|
exportedProperty(PROPERTY_COLUMNSERVICENAME);
|
2000-11-19 14:41:32 +00:00
|
|
|
|
|
2001-01-03 15:25:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
const sal_Char* OColumnExport::getOuterXMLElementName() const
|
|
|
|
|
{
|
|
|
|
|
return "column";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OColumnExport::exportAttributes()
|
|
|
|
|
{
|
|
|
|
|
OControlExport::exportAttributes();
|
|
|
|
|
|
2000-11-19 14:41:32 +00:00
|
|
|
|
// the attribute "label"
|
|
|
|
|
exportStringPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_LABEL),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL),
|
2000-11-19 14:41:32 +00:00
|
|
|
|
PROPERTY_LABEL);
|
2002-10-25 06:53:45 +00:00
|
|
|
|
|
|
|
|
|
// the style attribute
|
|
|
|
|
::rtl::OUString sStyleName = m_rContext.getObjectStyleName( m_xProps );
|
2012-01-25 21:59:48 -02:00
|
|
|
|
if ( !sStyleName.isEmpty() )
|
2002-10-25 06:53:45 +00:00
|
|
|
|
{
|
|
|
|
|
AddAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getSpecialAttributeNamespace( SCA_COLUMN_STYLE_NAME ),
|
|
|
|
|
OAttributeMetaData::getSpecialAttributeName( SCA_COLUMN_STYLE_NAME ),
|
2002-10-25 06:53:45 +00:00
|
|
|
|
sStyleName
|
|
|
|
|
);
|
|
|
|
|
}
|
2001-01-03 15:25:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OColumnExport::examine()
|
|
|
|
|
{
|
|
|
|
|
OControlExport::examine();
|
2000-11-19 14:41:32 +00:00
|
|
|
|
|
2001-01-03 15:25:34 +00:00
|
|
|
|
// grid columns miss some properties of the controls they're representing
|
2007-05-10 08:41:07 +00:00
|
|
|
|
m_nIncludeCommon &= ~(CCA_FOR | CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_LABEL);
|
2008-12-01 12:31:27 +00:00
|
|
|
|
m_nIncludeSpecial &= ~(SCA_ECHO_CHAR | SCA_AUTOMATIC_COMPLETION | SCA_MULTIPLE | SCA_MULTI_LINE);
|
2000-11-19 14:41:32 +00:00
|
|
|
|
|
2001-01-03 15:25:34 +00:00
|
|
|
|
if (FormComponentType::DATEFIELD != m_nClassId)
|
|
|
|
|
// except date fields, no column has the DropDown property
|
|
|
|
|
m_nIncludeCommon &= ~CCA_DROPDOWN;
|
2000-11-19 14:41:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-11-17 18:03:33 +00:00
|
|
|
|
//=====================================================================
|
|
|
|
|
//= OFormExport
|
|
|
|
|
//=====================================================================
|
|
|
|
|
//---------------------------------------------------------------------
|
2001-01-02 14:58:22 +00:00
|
|
|
|
OFormExport::OFormExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxForm,
|
|
|
|
|
const Sequence< ScriptEventDescriptor >& _rEvents)
|
|
|
|
|
:OElementExport(_rContext, _rxForm, _rEvents)
|
2004-08-02 13:13:42 +00:00
|
|
|
|
,m_bCreateConnectionResourceElement(sal_False)
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2000-12-18 14:14:35 +00:00
|
|
|
|
OSL_ENSURE(m_xProps.is(), "OFormExport::OFormExport: invalid arguments!");
|
2001-01-02 14:58:22 +00:00
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
2001-01-02 14:58:22 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
const sal_Char* OFormExport::getXMLElementName() const
|
|
|
|
|
{
|
|
|
|
|
return "form";
|
|
|
|
|
}
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
2001-01-02 14:58:22 +00:00
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OFormExport::exportSubTags()
|
|
|
|
|
{
|
2004-08-02 13:13:42 +00:00
|
|
|
|
if ( m_bCreateConnectionResourceElement && m_xProps.is() )
|
|
|
|
|
{
|
|
|
|
|
m_rContext.getGlobalContext().ClearAttrList();
|
|
|
|
|
::rtl::OUString sPropValue;
|
|
|
|
|
m_xProps->getPropertyValue( PROPERTY_DATASOURCENAME ) >>= sPropValue; // if set it is a file url
|
2012-01-25 21:59:48 -02:00
|
|
|
|
if ( sPropValue.isEmpty() )
|
2004-08-02 13:13:42 +00:00
|
|
|
|
m_xProps->getPropertyValue( PROPERTY_URL ) >>= sPropValue;
|
2012-01-25 21:59:48 -02:00
|
|
|
|
if ( !sPropValue.isEmpty() )
|
2004-08-02 13:13:42 +00:00
|
|
|
|
AddAttribute(
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_TARGET_LOCATION),
|
|
|
|
|
OAttributeMetaData::getCommonControlAttributeName(CCA_TARGET_LOCATION),
|
|
|
|
|
sPropValue);
|
|
|
|
|
if ( m_rContext.getGlobalContext().GetAttrList().getLength() )
|
|
|
|
|
{
|
|
|
|
|
SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, xmloff::token::XML_CONNECTION_RESOURCE, sal_True, sal_True);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-01-02 14:58:22 +00:00
|
|
|
|
// let the base class export the remaining properties and the events
|
|
|
|
|
OElementExport::exportSubTags();
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// loop through all children
|
|
|
|
|
Reference< XIndexAccess > xCollection(m_xProps, UNO_QUERY);
|
2006-06-19 17:16:39 +00:00
|
|
|
|
OSL_ENSURE(xCollection.is(), "OFormLayerXMLExport::implExportForm: a form which is not an index access? Suspic<69>ous!");
|
2000-11-17 18:03:33 +00:00
|
|
|
|
|
2000-12-18 14:14:35 +00:00
|
|
|
|
if (xCollection.is())
|
|
|
|
|
m_rContext.exportCollectionElements(xCollection);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
void OFormExport::exportAttributes()
|
|
|
|
|
{
|
|
|
|
|
sal_Int32 i=0;
|
|
|
|
|
|
|
|
|
|
// ---------------------
|
|
|
|
|
// the string properties
|
|
|
|
|
{
|
|
|
|
|
static FormAttributes eStringPropertyIds[] =
|
|
|
|
|
{
|
2004-08-02 13:13:42 +00:00
|
|
|
|
faName, /*faAction,*/ faCommand, faFilter, faOrder
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2002-10-25 06:53:45 +00:00
|
|
|
|
static ::rtl::OUString aStringPropertyNames[] =
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2004-08-02 13:13:42 +00:00
|
|
|
|
PROPERTY_NAME, /*PROPERTY_TARGETURL,*/ PROPERTY_COMMAND, PROPERTY_FILTER, PROPERTY_ORDER
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nIdCount = sizeof(eStringPropertyIds) / sizeof(eStringPropertyIds[0]);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nNameCount = sizeof(aStringPropertyNames) / sizeof(aStringPropertyNames[0]);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
OSL_ENSURE((nIdCount == nNameCount),
|
|
|
|
|
"OFormExport::exportAttributes: somebody tampered with the maps (1)!");
|
|
|
|
|
#endif
|
|
|
|
|
for (i=0; i<nIdCount; ++i)
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportStringPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getFormAttributeNamespace(eStringPropertyIds[i]),
|
|
|
|
|
OAttributeMetaData::getFormAttributeName(eStringPropertyIds[i]),
|
2002-10-25 06:53:45 +00:00
|
|
|
|
aStringPropertyNames[i]);
|
2010-04-21 15:17:52 +02:00
|
|
|
|
|
2010-06-04 10:43:31 +02:00
|
|
|
|
// #i112082# xlink:type is added as part of exportTargetLocationAttribute
|
2010-04-21 15:17:52 +02:00
|
|
|
|
|
2004-08-02 13:13:42 +00:00
|
|
|
|
// now export the data source name or databaselocation or connection resource
|
|
|
|
|
::rtl::OUString sPropValue;
|
|
|
|
|
m_xProps->getPropertyValue( PROPERTY_DATASOURCENAME ) >>= sPropValue;
|
2012-01-25 21:59:48 -02:00
|
|
|
|
m_bCreateConnectionResourceElement = sPropValue.isEmpty();
|
2006-07-26 06:31:26 +00:00
|
|
|
|
if ( !m_bCreateConnectionResourceElement )
|
2004-08-02 13:13:42 +00:00
|
|
|
|
{
|
|
|
|
|
INetURLObject aURL(sPropValue);
|
2006-07-26 06:31:26 +00:00
|
|
|
|
m_bCreateConnectionResourceElement = ( aURL.GetProtocol() == INET_PROT_FILE );
|
|
|
|
|
if ( !m_bCreateConnectionResourceElement )
|
2004-08-02 13:13:42 +00:00
|
|
|
|
exportStringPropertyAttribute(
|
|
|
|
|
OAttributeMetaData::getFormAttributeNamespace(faDatasource),
|
|
|
|
|
OAttributeMetaData::getFormAttributeName(faDatasource),
|
|
|
|
|
PROPERTY_DATASOURCENAME);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
exportedProperty(PROPERTY_URL);
|
|
|
|
|
if ( m_bCreateConnectionResourceElement )
|
|
|
|
|
exportedProperty(PROPERTY_DATASOURCENAME);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ----------------------
|
|
|
|
|
// the boolean properties
|
|
|
|
|
{
|
|
|
|
|
static FormAttributes eBooleanPropertyIds[] =
|
|
|
|
|
{
|
|
|
|
|
faAllowDeletes, faAllowInserts, faAllowUpdates, faApplyFilter, faEscapeProcessing, faIgnoreResult
|
|
|
|
|
};
|
2012-05-17 14:00:15 +01:00
|
|
|
|
static const ConstAsciiString pBooleanPropertyNames[] =
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2012-05-17 14:00:15 +01:00
|
|
|
|
PROPERTY_ALLOWDELETES, PROPERTY_ALLOWINSERTS, PROPERTY_ALLOWUPDATES, PROPERTY_APPLYFILTER, PROPERTY_ESCAPEPROCESSING, PROPERTY_IGNORERESULT
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2001-03-29 11:19:43 +00:00
|
|
|
|
static sal_Int8 nBooleanPropertyAttrFlags[] =
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
2001-03-29 11:19:43 +00:00
|
|
|
|
BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nIdCount = sizeof(eBooleanPropertyIds) / sizeof(eBooleanPropertyIds[0]);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nNameCount = sizeof(pBooleanPropertyNames) / sizeof(pBooleanPropertyNames[0]);
|
|
|
|
|
sal_Int32 nFlagsCount = sizeof(nBooleanPropertyAttrFlags) / sizeof(nBooleanPropertyAttrFlags[0]);
|
2001-03-29 11:19:43 +00:00
|
|
|
|
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
"OFormExport::exportAttributes: somebody tampered with the maps (2)!");
|
|
|
|
|
#endif
|
|
|
|
|
for (i=0; i<nIdCount; ++i)
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportBooleanPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getFormAttributeNamespace(eBooleanPropertyIds[i]),
|
|
|
|
|
OAttributeMetaData::getFormAttributeName(eBooleanPropertyIds[i]),
|
2012-05-17 14:00:15 +01:00
|
|
|
|
pBooleanPropertyNames[i],
|
2001-03-29 11:19:43 +00:00
|
|
|
|
nBooleanPropertyAttrFlags[i]
|
|
|
|
|
);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -------------------
|
|
|
|
|
// the enum properties
|
|
|
|
|
{
|
|
|
|
|
static FormAttributes eEnumPropertyIds[] =
|
|
|
|
|
{
|
|
|
|
|
faEnctype, faMethod, faCommandType, faNavigationMode, faTabbingCycle
|
|
|
|
|
};
|
2012-05-17 14:00:15 +01:00
|
|
|
|
static const ConstAsciiString pEnumPropertyNames[] =
|
2000-11-17 18:03:33 +00:00
|
|
|
|
{
|
|
|
|
|
PROPERTY_SUBMIT_ENCODING, PROPERTY_SUBMIT_METHOD, PROPERTY_COMMAND_TYPE, PROPERTY_NAVIGATION, PROPERTY_CYCLE
|
|
|
|
|
};
|
|
|
|
|
static OEnumMapper::EnumProperties eEnumPropertyMaps[] =
|
|
|
|
|
{
|
|
|
|
|
OEnumMapper::epSubmitEncoding, OEnumMapper::epSubmitMethod, OEnumMapper::epCommandType, OEnumMapper::epNavigationType, OEnumMapper::epTabCyle
|
|
|
|
|
};
|
|
|
|
|
static sal_Int32 nEnumPropertyAttrDefaults[] =
|
|
|
|
|
{
|
2001-03-28 12:06:55 +00:00
|
|
|
|
FormSubmitEncoding_URL, FormSubmitMethod_GET, CommandType::COMMAND, NavigationBarMode_CURRENT, TabulatorCycle_RECORDS
|
2000-11-17 18:03:33 +00:00
|
|
|
|
};
|
2001-04-17 06:58:31 +00:00
|
|
|
|
static sal_Bool nEnumPropertyAttrDefaultFlags[] =
|
|
|
|
|
{
|
|
|
|
|
sal_False, sal_False, sal_False, sal_False, sal_True
|
|
|
|
|
};
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nIdCount = sizeof(eEnumPropertyIds) / sizeof(eEnumPropertyIds[0]);
|
2005-03-23 10:24:58 +00:00
|
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2012-05-29 17:23:51 +01:00
|
|
|
|
sal_Int32 nNameCount = sizeof(pEnumPropertyNames) / sizeof(pEnumPropertyNames[0]);
|
|
|
|
|
sal_Int32 nDefaultCount = sizeof(nEnumPropertyAttrDefaults) / sizeof(nEnumPropertyAttrDefaults[0]);
|
|
|
|
|
sal_Int32 nDefaultFlagCount = sizeof(nEnumPropertyAttrDefaultFlags) / sizeof(nEnumPropertyAttrDefaultFlags[0]);
|
|
|
|
|
sal_Int32 nMapCount = sizeof(eEnumPropertyMaps) / sizeof(eEnumPropertyMaps[0]);
|
2001-04-17 06:58:31 +00:00
|
|
|
|
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount) && (nDefaultCount == nDefaultFlagCount) && (nDefaultFlagCount == nMapCount),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
"OFormExport::exportAttributes: somebody tampered with the maps (3)!");
|
|
|
|
|
#endif
|
|
|
|
|
for (i=0; i<nIdCount; ++i)
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportEnumPropertyAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getFormAttributeNamespace(eEnumPropertyIds[i]),
|
|
|
|
|
OAttributeMetaData::getFormAttributeName(eEnumPropertyIds[i]),
|
2000-11-17 18:03:33 +00:00
|
|
|
|
pEnumPropertyNames[i],
|
|
|
|
|
OEnumMapper::getEnumMap(eEnumPropertyMaps[i]),
|
2001-04-17 06:58:31 +00:00
|
|
|
|
nEnumPropertyAttrDefaults[i],
|
|
|
|
|
nEnumPropertyAttrDefaultFlags[i]
|
2003-10-21 07:38:16 +00:00
|
|
|
|
);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// the service name
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportServiceNameAttribute();
|
2000-11-17 18:03:33 +00:00
|
|
|
|
// the target frame
|
2000-11-19 14:41:32 +00:00
|
|
|
|
exportTargetFrameAttribute();
|
2001-06-25 12:32:38 +00:00
|
|
|
|
// the target URL
|
2010-04-20 17:18:54 +02:00
|
|
|
|
exportTargetLocationAttribute(true); // #i110911# add type attribute (for form, but not for control)
|
2000-11-19 14:41:32 +00:00
|
|
|
|
|
|
|
|
|
// master fields
|
|
|
|
|
exportStringSequenceAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getFormAttributeNamespace(faMasterFields),
|
|
|
|
|
OAttributeMetaData::getFormAttributeName(faMasterFields),
|
2000-11-19 14:41:32 +00:00
|
|
|
|
PROPERTY_MASTERFIELDS);
|
|
|
|
|
// detail fields
|
|
|
|
|
exportStringSequenceAttribute(
|
2004-08-02 13:13:42 +00:00
|
|
|
|
OAttributeMetaData::getFormAttributeNamespace(faDetailFiels),
|
|
|
|
|
OAttributeMetaData::getFormAttributeName(faDetailFiels),
|
2000-11-19 14:41:32 +00:00
|
|
|
|
PROPERTY_DETAILFIELDS);
|
2000-11-17 18:03:33 +00:00
|
|
|
|
}
|
|
|
|
|
//.........................................................................
|
|
|
|
|
} // namespace xmloff
|
|
|
|
|
//.........................................................................
|
2010-10-12 15:53:47 +02:00
|
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|