Files
libreoffice/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx

1932 lines
72 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2001-02-16 13:14:51 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2001-02-16 13:14:51 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2001-02-16 13:14:51 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2001-02-16 13:14:51 +00:00
*
* This file is part of OpenOffice.org.
2001-02-16 13:14:51 +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.
2001-02-16 13:14:51 +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).
2001-02-16 13:14:51 +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.
2001-02-16 13:14:51 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmlscript.hxx"
2001-02-16 13:14:51 +00:00
#include "imp_share.hxx"
#include <osl/diagnose.h>
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
#include <tools/diagnose_ex.h>
2001-09-19 12:43:18 +00:00
#include <osl/mutex.hxx>
2001-02-16 13:14:51 +00:00
#include <rtl/ustrbuf.hxx>
2001-04-04 13:35:09 +00:00
#include <xmlscript/xml_import.hxx>
2001-02-27 11:45:17 +00:00
#include <comphelper/processfactory.hxx>
2001-02-16 13:14:51 +00:00
#include <com/sun/star/awt/CharSet.hpp>
#include <com/sun/star/awt/FontFamily.hpp>
#include <com/sun/star/awt/FontPitch.hpp>
#include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/awt/FontStrikeout.hpp>
#include <com/sun/star/awt/FontType.hpp>
#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/awt/FontWidth.hpp>
#include <com/sun/star/awt/ImagePosition.hpp>
#include <com/sun/star/awt/LineEndFormat.hpp>
2001-10-22 07:52:22 +00:00
#include <com/sun/star/awt/PushButtonType.hpp>
#include <com/sun/star/awt/VisualEffect.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
2001-02-16 13:14:51 +00:00
2001-02-20 15:51:32 +00:00
#include <com/sun/star/script/XScriptEventsSupplier.hpp>
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
#include <com/sun/star/view/SelectionType.hpp>
#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <com/sun/star/script/DocumentScriptLibraryContainer.hpp>
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
2001-02-16 13:14:51 +00:00
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::frame;
using ::rtl::OUString;
2001-02-16 13:14:51 +00:00
namespace xmlscript
{
2001-02-20 15:51:32 +00:00
//__________________________________________________________________________________________________
void EventElement::endElement()
throw (xml::sax::SAXException, RuntimeException)
{
2001-08-07 09:55:47 +00:00
static_cast< ControlElement * >( _pParent )->_events.push_back( this );
2001-02-20 15:51:32 +00:00
}
2001-02-16 13:14:51 +00:00
//__________________________________________________________________________________________________
ControlElement::ControlElement(
OUString const & rLocalName,
Reference< xml::input::XAttributes > const & xAttributes,
2001-02-16 13:14:51 +00:00
ElementBase * pParent, DialogImport * pImport )
2001-03-14 15:39:59 +00:00
SAL_THROW( () )
: ElementBase(
pImport->XMLNS_DIALOGS_UID, rLocalName, xAttributes, pParent, pImport )
2001-02-16 13:14:51 +00:00
{
if (_pParent)
{
// inherit position
_nBasePosX = static_cast< ControlElement * >( _pParent )->_nBasePosX;
_nBasePosY = static_cast< ControlElement * >( _pParent )->_nBasePosY;
}
else
{
_nBasePosX = 0;
_nBasePosY = 0;
}
}
2001-02-16 13:14:51 +00:00
//__________________________________________________________________________________________________
Reference< xml::input::XElement > ControlElement::getStyle(
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-16 13:14:51 +00:00
{
OUString aStyleId(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID,
OUString( RTL_CONSTASCII_USTRINGPARAM("style-id") ) ) );
2001-02-16 13:14:51 +00:00
if (aStyleId.getLength())
{
return _pImport->getStyle( aStyleId );
}
return Reference< xml::input::XElement >();
2001-02-16 13:14:51 +00:00
}
//__________________________________________________________________________________________________
2001-02-20 13:05:25 +00:00
OUString ControlElement::getControlId(
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-16 13:14:51 +00:00
{
OUString aId(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID,
OUString( RTL_CONSTASCII_USTRINGPARAM("id") ) ) );
2001-02-16 13:14:51 +00:00
if (! aId.getLength())
{
throw xml::sax::SAXException(
2001-02-20 13:05:25 +00:00
OUString( RTL_CONSTASCII_USTRINGPARAM("missing id attribute!") ),
2001-02-16 13:14:51 +00:00
Reference< XInterface >(), Any() );
}
return aId;
}
//##################################################################################################
//__________________________________________________________________________________________________
bool StyleElement::importTextColorStyle(
Reference< beans::XPropertySet > const & xProps )
{
if ((_inited & 0x2) != 0)
2001-02-16 13:14:51 +00:00
{
if ((_hasValue & 0x2) != 0)
2001-02-16 13:14:51 +00:00
{
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ),
makeAny( _textColor ) );
2001-02-16 13:14:51 +00:00
return true;
}
return false;
}
_inited |= 0x2;
2001-02-16 13:14:51 +00:00
if (getLongAttr( &_textColor,
OUString( RTL_CONSTASCII_USTRINGPARAM("text-color") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
_hasValue |= 0x2;
2001-02-16 13:14:51 +00:00
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ),
makeAny( _textColor ) );
2001-02-16 13:14:51 +00:00
return true;
}
return false;
}
//__________________________________________________________________________________________________
2002-03-25 11:03:21 +00:00
bool StyleElement::importTextLineColorStyle(
Reference< beans::XPropertySet > const & xProps )
{
if ((_inited & 0x20) != 0)
{
if ((_hasValue & 0x20) != 0)
{
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ),
makeAny( _textLineColor ) );
2002-03-25 11:03:21 +00:00
return true;
}
return false;
}
_inited |= 0x20;
if (getLongAttr( &_textLineColor,
OUString( RTL_CONSTASCII_USTRINGPARAM("textline-color") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2002-03-25 11:03:21 +00:00
{
_hasValue |= 0x20;
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ),
makeAny( _textLineColor ) );
2002-03-25 11:03:21 +00:00
return true;
}
return false;
}
//__________________________________________________________________________________________________
bool StyleElement::importFillColorStyle(
Reference< beans::XPropertySet > const & xProps )
{
if ((_inited & 0x10) != 0)
{
if ((_hasValue & 0x10) != 0)
{
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("FillColor") ), makeAny( _fillColor ) );
return true;
}
return false;
}
_inited |= 0x10;
if (getLongAttr(
&_fillColor,
OUString( RTL_CONSTASCII_USTRINGPARAM("fill-color") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
{
_hasValue |= 0x10;
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("FillColor") ),
makeAny( _fillColor ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
2001-02-16 13:14:51 +00:00
bool StyleElement::importBackgroundColorStyle(
Reference< beans::XPropertySet > const & xProps )
{
if ((_inited & 0x1) != 0)
2001-02-16 13:14:51 +00:00
{
if ((_hasValue & 0x1) != 0)
2001-02-16 13:14:51 +00:00
{
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ), makeAny( _backgroundColor ) );
return true;
}
return false;
}
_inited |= 0x1;
2001-02-16 13:14:51 +00:00
if (getLongAttr(
&_backgroundColor,
OUString( RTL_CONSTASCII_USTRINGPARAM("background-color") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
_hasValue |= 0x1;
2001-02-16 13:14:51 +00:00
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ), makeAny( _backgroundColor ) );
return true;
}
return false;
}
2001-02-16 13:14:51 +00:00
//__________________________________________________________________________________________________
bool StyleElement::importBorderStyle(
Reference< beans::XPropertySet > const & xProps )
{
if ((_inited & 0x4) != 0)
{
if ((_hasValue & 0x4) != 0)
{
xProps->setPropertyValue(
OUSTR("Border"), makeAny( _border == BORDER_SIMPLE_COLOR
? BORDER_SIMPLE : _border ) );
if (_border == BORDER_SIMPLE_COLOR)
xProps->setPropertyValue( OUSTR("BorderColor"),
makeAny(_borderColor) );
2001-02-16 13:14:51 +00:00
return true;
}
return false;
}
_inited |= 0x4;
OUString aValue;
if (getStringAttr(
&aValue, OUSTR("border"),
_xAttributes, _pImport->XMLNS_DIALOGS_UID )) {
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("none") ))
_border = BORDER_NONE;
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("3d") ))
_border = BORDER_3D;
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("simple") ))
_border = BORDER_SIMPLE;
else {
_border = BORDER_SIMPLE_COLOR;
_borderColor = toInt32(aValue);
}
_hasValue |= 0x4;
importBorderStyle(xProps); // write values
}
return false;
}
//______________________________________________________________________________
bool StyleElement::importVisualEffectStyle(
Reference<beans::XPropertySet> const & xProps )
{
if ((_inited & 0x40) != 0)
{
if ((_hasValue & 0x40) != 0)
{
xProps->setPropertyValue( OUSTR("VisualEffect"),
makeAny(_visualEffect) );
return true;
}
return false;
}
_inited |= 0x40;
OUString aValue;
if (getStringAttr( &aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("look") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("none") ))
{
_visualEffect = awt::VisualEffect::NONE;
2001-02-16 13:14:51 +00:00
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("3d") ))
{
_visualEffect = awt::VisualEffect::LOOK3D;
2001-02-16 13:14:51 +00:00
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("simple") ))
{
_visualEffect = awt::VisualEffect::FLAT;
2001-02-16 13:14:51 +00:00
}
else
OSL_ASSERT( 0 );
2001-02-16 13:14:51 +00:00
_hasValue |= 0x40;
xProps->setPropertyValue( OUSTR("VisualEffect"),
makeAny(_visualEffect) );
2001-02-16 13:14:51 +00:00
}
return false;
}
2001-02-16 13:14:51 +00:00
//__________________________________________________________________________________________________
2002-03-25 11:03:21 +00:00
void StyleElement::setFontProperties(
Reference< beans::XPropertySet > const & xProps )
{
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("FontDescriptor") ), makeAny( _descr ) );
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("FontEmphasisMark") ), makeAny( _fontEmphasisMark ) );
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("FontRelief") ), makeAny( _fontRelief ) );
}
//__________________________________________________________________________________________________
2001-02-16 13:14:51 +00:00
bool StyleElement::importFontStyle(
Reference< beans::XPropertySet > const & xProps )
{
if ((_inited & 0x8) != 0)
{
if ((_hasValue & 0x8) != 0)
{
2002-03-25 11:03:21 +00:00
setFontProperties( xProps );
2001-02-16 13:14:51 +00:00
return true;
}
return false;
}
_inited |= 0x8;
OUString aValue;
bool bFontImport;
// dialog:font-name CDATA #IMPLIED
bFontImport = getStringAttr(
&_descr.Name, OUString( RTL_CONSTASCII_USTRINGPARAM("font-name") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID );
2001-02-16 13:14:51 +00:00
// dialog:font-height %numeric; #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-height") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
_descr.Height = (sal_Int16)toInt32( aValue );
bFontImport = true;
}
// dialog:font-width %numeric; #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-width") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
_descr.Width = (sal_Int16)toInt32( aValue );
bFontImport = true;
}
// dialog:font-stylename CDATA #IMPLIED
bFontImport |= getStringAttr(
&_descr.StyleName,
OUString( RTL_CONSTASCII_USTRINGPARAM("font-stylename") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID );
2001-02-16 13:14:51 +00:00
// dialog:font-family "(decorative|modern|roman|script|swiss|system)" #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-family") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("decorative") ))
{
_descr.Family = awt::FontFamily::DECORATIVE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("modern") ))
{
_descr.Family = awt::FontFamily::MODERN;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("roman") ))
{
_descr.Family = awt::FontFamily::ROMAN;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("script") ))
{
_descr.Family = awt::FontFamily::SCRIPT;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("swiss") ))
{
_descr.Family = awt::FontFamily::SWISS;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("system") ))
{
_descr.Family = awt::FontFamily::SYSTEM;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid font-family style!") ),
Reference< XInterface >(), Any() );
}
bFontImport = true;
}
// dialog:font-charset "(ansi|mac|ibmpc_437|ibmpc_850|ibmpc_860|ibmpc_861|ibmpc_863|ibmpc_865|system|symbol)" #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-charset") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ansi") ))
{
_descr.CharSet = awt::CharSet::ANSI;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("mac") ))
{
_descr.CharSet = awt::CharSet::MAC;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ibmpc_437") ))
{
_descr.CharSet = awt::CharSet::IBMPC_437;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ibmpc_850") ))
{
_descr.CharSet = awt::CharSet::IBMPC_850;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ibmpc_860") ))
{
_descr.CharSet = awt::CharSet::IBMPC_860;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ibmpc_861") ))
{
_descr.CharSet = awt::CharSet::IBMPC_861;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ibmpc_863") ))
{
_descr.CharSet = awt::CharSet::IBMPC_863;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ibmpc_865") ))
{
_descr.CharSet = awt::CharSet::IBMPC_865;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("system") ))
{
_descr.CharSet = awt::CharSet::SYSTEM;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("symbol") ))
{
_descr.CharSet = awt::CharSet::SYMBOL;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid font-charset style!") ),
Reference< XInterface >(), Any() );
}
bFontImport = true;
}
// dialog:font-pitch "(fixed|variable)" #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-pitch") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("fixed") ))
{
_descr.Pitch = awt::FontPitch::FIXED;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("variable") ))
{
_descr.Pitch = awt::FontPitch::VARIABLE;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid font-pitch style!") ),
Reference< XInterface >(), Any() );
}
bFontImport = true;
}
// dialog:font-charwidth CDATA #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-charwidth") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
_descr.CharacterWidth = aValue.toFloat();
bFontImport = true;
}
// dialog:font-weight CDATA #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-weight") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
_descr.Weight = aValue.toFloat();
bFontImport = true;
}
// dialog:font-slant "(oblique|italic|reverse_oblique|reverse_italic)" #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-slant") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("oblique") ))
{
_descr.Slant = awt::FontSlant_OBLIQUE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("italic") ))
{
_descr.Slant = awt::FontSlant_ITALIC;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("reverse_oblique") ))
{
_descr.Slant = awt::FontSlant_REVERSE_OBLIQUE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("reverse_italic") ))
{
_descr.Slant = awt::FontSlant_REVERSE_ITALIC;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid font-slant style!") ),
Reference< XInterface >(), Any() );
}
bFontImport = true;
}
// dialog:font-underline "(single|double|dotted|dash|longdash|dashdot|dashdotdot|smallwave|wave|doublewave|bold|bolddotted|bolddash|boldlongdash|bolddashdot|bolddashdotdot|boldwave)" #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-underline") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("single") ))
{
_descr.Underline = awt::FontUnderline::SINGLE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("double") ))
{
_descr.Underline = awt::FontUnderline::DOUBLE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dotted") ))
{
_descr.Underline = awt::FontUnderline::DOTTED;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dash") ))
{
_descr.Underline = awt::FontUnderline::DASH;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("longdash") ))
{
_descr.Underline = awt::FontUnderline::LONGDASH;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dashdot") ))
{
_descr.Underline = awt::FontUnderline::DASHDOT;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dashdotdot") ))
{
_descr.Underline = awt::FontUnderline::DASHDOTDOT;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("smallwave") ))
{
_descr.Underline = awt::FontUnderline::SMALLWAVE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("wave") ))
{
_descr.Underline = awt::FontUnderline::WAVE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("doublewave") ))
{
_descr.Underline = awt::FontUnderline::DOUBLEWAVE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bold") ))
{
_descr.Underline = awt::FontUnderline::BOLD;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bolddotted") ))
{
_descr.Underline = awt::FontUnderline::BOLDDOTTED;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bolddash") ))
{
_descr.Underline = awt::FontUnderline::BOLDDASH;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("boldlongdash") ))
{
_descr.Underline = awt::FontUnderline::BOLDLONGDASH;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bolddashdot") ))
{
_descr.Underline = awt::FontUnderline::BOLDDASHDOT;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bolddashdotdot") ))
{
_descr.Underline = awt::FontUnderline::BOLDDASHDOTDOT;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("boldwave") ))
{
_descr.Underline = awt::FontUnderline::BOLDWAVE;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid font-underline style!") ),
Reference< XInterface >(), Any() );
}
bFontImport = true;
}
// dialog:font-strikeout "(single|double|bold|slash|x)" #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-strikeout") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("single") ))
{
_descr.Strikeout = awt::FontStrikeout::SINGLE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("double") ))
{
_descr.Strikeout = awt::FontStrikeout::DOUBLE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bold") ))
{
_descr.Strikeout = awt::FontStrikeout::BOLD;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("slash") ))
{
_descr.Strikeout = awt::FontStrikeout::SLASH;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("x") ))
{
_descr.Strikeout = awt::FontStrikeout::X;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid font-strikeout style!") ),
Reference< XInterface >(), Any() );
}
bFontImport = true;
}
// dialog:font-orientation CDATA #IMPLIED
if (getStringAttr(
&aValue,
OUString( RTL_CONSTASCII_USTRINGPARAM("font-orientation") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
_descr.Orientation = aValue.toFloat();
bFontImport = true;
}
// dialog:font-kerning %boolean; #IMPLIED
bFontImport |= getBoolAttr(
&_descr.Kerning,
OUString( RTL_CONSTASCII_USTRINGPARAM("font-kerning") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID );
2001-02-16 13:14:51 +00:00
// dialog:font-wordlinemode %boolean; #IMPLIED
bFontImport |= getBoolAttr(
&_descr.WordLineMode,
OUString( RTL_CONSTASCII_USTRINGPARAM("font-wordlinemode") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID );
2001-02-16 13:14:51 +00:00
// dialog:font-type "(raster|device|scalable)" #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-type") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("raster") ))
{
_descr.Type = awt::FontType::RASTER;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("device") ))
{
_descr.Type = awt::FontType::DEVICE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("scalable") ))
{
_descr.Type = awt::FontType::SCALABLE;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid font-type style!") ),
Reference< XInterface >(), Any() );
}
bFontImport = true;
}
2002-03-25 11:03:21 +00:00
// additional properties which are not part of the FontDescriptor struct
// dialog:font-relief (none|embossed|engraved) #IMPLIED
if (getStringAttr(
&aValue, OUString( RTL_CONSTASCII_USTRINGPARAM("font-relief") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2002-03-25 11:03:21 +00:00
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("none") ))
{
_fontRelief = awt::FontRelief::NONE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("embossed") ))
{
_fontRelief = awt::FontRelief::EMBOSSED;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("engraved") ))
{
_fontRelief = awt::FontRelief::ENGRAVED;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid font-relief style!") ),
Reference< XInterface >(), Any() );
}
bFontImport = true;
}
// dialog:font-emphasismark (none|dot|circle|disc|accent|above|below) #IMPLIED
if (getStringAttr(
&aValue,
OUString( RTL_CONSTASCII_USTRINGPARAM("font-emphasismark") ),
_xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2002-03-25 11:03:21 +00:00
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("none") ))
{
_fontEmphasisMark = awt::FontEmphasisMark::NONE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dot") ))
{
_fontEmphasisMark = awt::FontEmphasisMark::DOT;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("circle") ))
{
_fontEmphasisMark = awt::FontEmphasisMark::CIRCLE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("disc") ))
{
_fontEmphasisMark = awt::FontEmphasisMark::DISC;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("accent") ))
{
_fontEmphasisMark = awt::FontEmphasisMark::ACCENT;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("above") ))
{
_fontEmphasisMark = awt::FontEmphasisMark::ABOVE;
}
else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("below") ))
{
_fontEmphasisMark = awt::FontEmphasisMark::BELOW;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid font-emphasismark style!") ),
Reference< XInterface >(), Any() );
}
bFontImport = true;
}
// ==================================================
2001-02-16 13:14:51 +00:00
if (bFontImport)
{
_hasValue |= 0x8;
2002-03-25 11:03:21 +00:00
setFontProperties( xProps );
2001-02-16 13:14:51 +00:00
}
return bFontImport;
}
//##################################################################################################
//__________________________________________________________________________________________________
2001-04-04 13:35:09 +00:00
bool ImportContext::importStringProperty(
2001-02-16 13:14:51 +00:00
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-16 13:14:51 +00:00
{
OUString aValue(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
2001-02-16 13:14:51 +00:00
if (aValue.getLength())
{
_xControlModel->setPropertyValue( rPropName, makeAny( aValue ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
2001-04-04 13:35:09 +00:00
bool ImportContext::importDoubleProperty(
2001-02-21 19:49:30 +00:00
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-21 19:49:30 +00:00
{
OUString aValue(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
2001-02-21 19:49:30 +00:00
if (aValue.getLength())
{
_xControlModel->setPropertyValue( rPropName, makeAny( aValue.toDouble() ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
2001-04-04 13:35:09 +00:00
bool ImportContext::importBooleanProperty(
2001-02-16 13:14:51 +00:00
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-16 13:14:51 +00:00
{
sal_Bool bBool;
if (getBoolAttr(
&bBool, rAttrName, xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-02-16 13:14:51 +00:00
{
_xControlModel->setPropertyValue( rPropName, makeAny( bBool ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
2001-04-04 13:35:09 +00:00
bool ImportContext::importLongProperty(
2001-02-16 13:14:51 +00:00
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-16 13:14:51 +00:00
{
OUString aValue(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
2001-02-16 13:14:51 +00:00
if (aValue.getLength())
{
_xControlModel->setPropertyValue( rPropName, makeAny( toInt32( aValue ) ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
2001-04-04 13:35:09 +00:00
bool ImportContext::importLongProperty(
2001-02-20 13:05:25 +00:00
sal_Int32 nOffset,
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-20 13:05:25 +00:00
{
OUString aValue(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
2001-02-20 13:05:25 +00:00
if (aValue.getLength())
{
_xControlModel->setPropertyValue( rPropName, makeAny( toInt32( aValue ) + nOffset ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
bool ImportContext::importHexLongProperty(
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
{
OUString aValue(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
if (aValue.getLength())
{
_xControlModel->setPropertyValue( rPropName, makeAny( toInt32( aValue ) ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
2001-04-04 13:35:09 +00:00
bool ImportContext::importShortProperty(
2001-02-16 13:14:51 +00:00
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-16 13:14:51 +00:00
{
OUString aValue(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
2001-02-16 13:14:51 +00:00
if (aValue.getLength())
{
_xControlModel->setPropertyValue( rPropName, makeAny( (sal_Int16)toInt32( aValue ) ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
2001-04-04 13:35:09 +00:00
bool ImportContext::importAlignProperty(
2001-02-20 13:05:25 +00:00
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-20 13:05:25 +00:00
{
OUString aAlign(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
2001-02-20 13:05:25 +00:00
if (aAlign.getLength())
{
sal_Int16 nAlign;
if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("left") ))
{
nAlign = 0;
}
else if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("center") ))
{
nAlign = 1;
}
else if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("right") ))
{
nAlign = 2;
}
else if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("none") ))
{
nAlign = 0; // default
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid align value!") ),
Reference< XInterface >(), Any() );
}
2001-02-21 19:49:30 +00:00
_xControlModel->setPropertyValue( rPropName, makeAny( nAlign ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
bool ImportContext::importVerticalAlignProperty(
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
{
OUString aAlign(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
if (aAlign.getLength())
{
style::VerticalAlignment eAlign;
if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("top") ))
{
eAlign = style::VerticalAlignment_TOP;
}
else if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("center") ))
{
eAlign = style::VerticalAlignment_MIDDLE;
}
else if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bottom") ))
{
eAlign = style::VerticalAlignment_BOTTOM;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid vertical align value!") ),
Reference< XInterface >(), Any() );
}
_xControlModel->setPropertyValue( rPropName, makeAny( eAlign ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
bool ImportContext::importImageAlignProperty(
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
{
OUString aAlign(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
if (aAlign.getLength())
{
sal_Int16 nAlign;
if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("left") ))
{
nAlign = 0;
}
else if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("top") ))
{
nAlign = 1;
}
else if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("right") ))
{
nAlign = 2;
}
else if (aAlign.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bottom") ))
{
nAlign = 3;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid image align value!") ),
Reference< XInterface >(), Any() );
}
_xControlModel->setPropertyValue( rPropName, makeAny( nAlign ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
bool ImportContext::importImagePositionProperty(
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
{
OUString aPosition(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
if (aPosition.getLength())
{
sal_Int16 nPosition;
if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("left-top") ))
{
nPosition = awt::ImagePosition::LeftTop;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("left-center") ))
{
nPosition = awt::ImagePosition::LeftCenter;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("left-bottom") ))
{
nPosition = awt::ImagePosition::LeftBottom;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("right-top") ))
{
nPosition = awt::ImagePosition::RightTop;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("right-center") ))
{
nPosition = awt::ImagePosition::RightCenter;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("right-bottom") ))
{
nPosition = awt::ImagePosition::RightBottom;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("top-left") ))
{
nPosition = awt::ImagePosition::AboveLeft;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("top-center") ))
{
nPosition = awt::ImagePosition::AboveCenter;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("top-right") ))
{
nPosition = awt::ImagePosition::AboveRight;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bottom-left") ))
{
nPosition = awt::ImagePosition::BelowLeft;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bottom-center") ))
{
nPosition = awt::ImagePosition::BelowCenter;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bottom-right") ))
{
nPosition = awt::ImagePosition::BelowRight;
}
else if (aPosition.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("center") ))
{
nPosition = awt::ImagePosition::Centered;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid image position value!") ),
Reference< XInterface >(), Any() );
}
_xControlModel->setPropertyValue( rPropName, makeAny( nPosition ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
2001-10-22 07:52:22 +00:00
bool ImportContext::importButtonTypeProperty(
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-10-22 07:52:22 +00:00
{
OUString buttonType(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
2001-10-22 07:52:22 +00:00
if (buttonType.getLength())
{
sal_Int16 nButtonType;
if (buttonType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("standard") ))
{
nButtonType = awt::PushButtonType_STANDARD;
}
else if (buttonType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ok") ))
{
nButtonType = awt::PushButtonType_OK;
}
else if (buttonType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("cancel") ))
{
nButtonType = awt::PushButtonType_CANCEL;
}
else if (buttonType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("help") ))
{
nButtonType = awt::PushButtonType_HELP;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid button-type value!") ),
Reference< XInterface >(), Any() );
}
_xControlModel->setPropertyValue( rPropName, makeAny( nButtonType ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
2001-04-04 13:35:09 +00:00
bool ImportContext::importDateFormatProperty(
2001-02-21 19:49:30 +00:00
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-21 19:49:30 +00:00
{
OUString aFormat(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
2001-02-21 19:49:30 +00:00
if (aFormat.getLength())
{
sal_Int16 nFormat;
if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("system_short") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 0;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("system_short_YY") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 1;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("system_short_YYYY") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 2;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("system_long") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 3;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("short_DDMMYY") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 4;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("short_MMDDYY") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 5;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("short_YYMMDD") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 6;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("short_DDMMYYYY") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 7;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("short_MMDDYYYY") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 8;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("short_YYYYMMDD") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 9;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("short_YYMMDD_DIN5008") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 10;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("short_YYYYMMDD_DIN5008") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 11;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid date-format value!") ),
Reference< XInterface >(), Any() );
}
_xControlModel->setPropertyValue( rPropName, makeAny( nFormat ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
2001-04-04 13:35:09 +00:00
bool ImportContext::importTimeFormatProperty(
2001-02-21 19:49:30 +00:00
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-21 19:49:30 +00:00
{
OUString aFormat(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
2001-02-21 19:49:30 +00:00
if (aFormat.getLength())
{
sal_Int16 nFormat;
if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("24h_short") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 0;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("24h_long") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 1;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("12h_short") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 2;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("12h_long") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 3;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Duration_short") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 4;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Duration_long") ))
2001-02-21 19:49:30 +00:00
{
nFormat = 5;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid time-format value!") ),
Reference< XInterface >(), Any() );
}
_xControlModel->setPropertyValue( rPropName, makeAny( nFormat ) );
2001-02-20 13:05:25 +00:00
return true;
}
return false;
}
//__________________________________________________________________________________________________
bool ImportContext::importOrientationProperty(
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
{
OUString aOrient(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
if (aOrient.getLength())
{
sal_Int32 nOrient;
if (aOrient.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("horizontal") ))
{
nOrient = 0;
}
else if (aOrient.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("vertical") ))
{
nOrient = 1;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid orientation value!") ),
Reference< XInterface >(), Any() );
}
_xControlModel->setPropertyValue( rPropName, makeAny( nOrient ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
bool ImportContext::importLineEndFormatProperty(
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
{
OUString aFormat(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
if (aFormat.getLength())
{
sal_Int16 nFormat;
if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("carriage-return") ))
{
nFormat = awt::LineEndFormat::CARRIAGE_RETURN;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("line-feed") ))
{
nFormat = awt::LineEndFormat::LINE_FEED;
}
else if (aFormat.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("carriage-return-line-feed") ))
{
nFormat = awt::LineEndFormat::CARRIAGE_RETURN_LINE_FEED;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid line end format value!") ),
Reference< XInterface >(), Any() );
}
_xControlModel->setPropertyValue( rPropName, makeAny( nFormat ) );
return true;
}
return false;
}
//__________________________________________________________________________________________________
bool ImportContext::importSelectionTypeProperty(
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::input::XAttributes > const & xAttributes )
{
OUString aSelectionType(
xAttributes->getValueByUidName(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
if (aSelectionType.getLength())
{
view::SelectionType eSelectionType;
if (aSelectionType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("none") ))
{
eSelectionType = view::SelectionType_NONE;
}
else if (aSelectionType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("single") ))
{
eSelectionType = view::SelectionType_SINGLE;
}
else if (aSelectionType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("multi") ))
{
eSelectionType = view::SelectionType_MULTI;
}
else if (aSelectionType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("range") ))
{
eSelectionType = view::SelectionType_RANGE;
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("invalid selection type value!") ),
Reference< XInterface >(), Any() );
}
_xControlModel->setPropertyValue( rPropName, makeAny( eSelectionType ) );
return true;
}
return false;
}
2001-08-07 09:55:47 +00:00
//==================================================================================================
struct StringTriple
{
char const * first;
char const * second;
char const * third;
};
static StringTriple const s_aEventTranslations[] =
{
// from xmloff/source/forms/formevents.cxx
// 28.09.2001 tbe added on-adjustmentvaluechange
2001-08-07 09:55:47 +00:00
{ "com.sun.star.form.XApproveActionListener", "approveAction", "on-approveaction" },
{ "com.sun.star.awt.XActionListener", "actionPerformed", "on-performaction" },
{ "com.sun.star.form.XChangeListener", "changed", "on-change" },
{ "com.sun.star.awt.XTextListener", "textChanged", "on-textchange" },
{ "com.sun.star.awt.XItemListener", "itemStateChanged", "on-itemstatechange" },
{ "com.sun.star.awt.XFocusListener", "focusGained", "on-focus" },
{ "com.sun.star.awt.XFocusListener", "focusLost", "on-blur" },
{ "com.sun.star.awt.XKeyListener", "keyPressed", "on-keydown" },
{ "com.sun.star.awt.XKeyListener", "keyReleased", "on-keyup" },
{ "com.sun.star.awt.XMouseListener", "mouseEntered", "on-mouseover" },
{ "com.sun.star.awt.XMouseMotionListener", "mouseDragged", "on-mousedrag" },
{ "com.sun.star.awt.XMouseMotionListener", "mouseMoved", "on-mousemove" },
{ "com.sun.star.awt.XMouseListener", "mousePressed", "on-mousedown" },
{ "com.sun.star.awt.XMouseListener", "mouseReleased", "on-mouseup" },
{ "com.sun.star.awt.XMouseListener", "mouseExited", "on-mouseout" },
{ "com.sun.star.form.XResetListener", "approveReset", "on-approvereset" },
{ "com.sun.star.form.XResetListener", "resetted", "on-reset" },
{ "com.sun.star.form.XSubmitListener", "approveSubmit", "on-submit" },
{ "com.sun.star.form.XUpdateListener", "approveUpdate", "on-approveupdate" },
{ "com.sun.star.form.XUpdateListener", "updated", "on-update" },
{ "com.sun.star.form.XLoadListener", "loaded", "on-load" },
{ "com.sun.star.form.XLoadListener", "reloading", "on-startreload" },
{ "com.sun.star.form.XLoadListener", "reloaded", "on-reload" },
{ "com.sun.star.form.XLoadListener", "unloading", "on-startunload" },
{ "com.sun.star.form.XLoadListener", "unloaded", "on-unload" },
{ "com.sun.star.form.XConfirmDeleteListener", "confirmDelete", "on-confirmdelete" },
{ "com.sun.star.sdb.XRowSetApproveListener", "approveRowChange", "on-approverowchange" },
{ "com.sun.star.sdbc.XRowSetListener", "rowChanged", "on-rowchange" },
{ "com.sun.star.sdb.XRowSetApproveListener", "approveCursorMove", "on-approvecursormove" },
{ "com.sun.star.sdbc.XRowSetListener", "cursorMoved", "on-cursormove" },
{ "com.sun.star.form.XDatabaseParameterListener", "approveParameter", "on-supplyparameter" },
{ "com.sun.star.sdb.XSQLErrorListener", "errorOccured", "on-error" },
{ "com.sun.star.awt.XAdjustmentListener", "adjustmentValueChanged", "on-adjustmentvaluechange" },
2001-08-07 09:55:47 +00:00
{ 0, 0, 0 }
};
extern StringTriple const * const g_pEventTranslations;
StringTriple const * const g_pEventTranslations = s_aEventTranslations;
//__________________________________________________________________________________________________
2001-04-04 13:35:09 +00:00
void ImportContext::importEvents(
::std::vector< Reference< xml::input::XElement > > const & rEvents )
2001-04-04 13:35:09 +00:00
{
Reference< script::XScriptEventsSupplier > xSupplier(
_xControlModel, UNO_QUERY );
2001-04-04 13:35:09 +00:00
if (xSupplier.is())
{
Reference< container::XNameContainer > xEvents( xSupplier->getEvents() );
if (xEvents.is())
{
for ( size_t nPos = 0; nPos < rEvents.size(); ++nPos )
{
script::ScriptEventDescriptor descr;
2001-08-07 09:55:47 +00:00
EventElement * pEventElement = static_cast< EventElement * >( rEvents[ nPos ].get() );
sal_Int32 nUid = pEventElement->getUid();
OUString aLocalName( pEventElement->getLocalName() );
Reference< xml::input::XAttributes > xAttributes(
pEventElement->getAttributes() );
2001-08-07 09:55:47 +00:00
// nowadays script events
if (_pImport->XMLNS_SCRIPT_UID == nUid)
2001-04-04 13:35:09 +00:00
{
2001-08-07 09:55:47 +00:00
if (!getStringAttr( &descr.ScriptType,
OUString( RTL_CONSTASCII_USTRINGPARAM(
"language") ),
xAttributes,
_pImport->XMLNS_SCRIPT_UID ) ||
2001-08-07 09:55:47 +00:00
!getStringAttr( &descr.ScriptCode,
OUString( RTL_CONSTASCII_USTRINGPARAM(
"macro-name") ),
xAttributes,
_pImport->XMLNS_SCRIPT_UID ))
2001-08-07 09:55:47 +00:00
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM(
"missing language or macro-name "
"attribute(s) of event!") ),
2001-08-07 09:55:47 +00:00
Reference< XInterface >(), Any() );
}
if ( descr.ScriptType.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( "StarBasic" ) ) ) )
2001-08-07 09:55:47 +00:00
{
OUString aLocation;
if (getStringAttr( &aLocation,
OUString( RTL_CONSTASCII_USTRINGPARAM(
"location") ),
xAttributes,
_pImport->XMLNS_SCRIPT_UID ))
{
// prepend location
::rtl::OUStringBuffer buf;
buf.append( aLocation );
buf.append( (sal_Unicode)':' );
buf.append( descr.ScriptCode );
descr.ScriptCode = buf.makeStringAndClear();
}
2001-08-07 09:55:47 +00:00
}
else if ( descr.ScriptType.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( "Script" ) ) ) )
{
// Check if there is a protocol, if not assume
// this is an early scripting framework url ( without
// the protocol ) and fix it up!!
if ( descr.ScriptCode.indexOf( ':' ) == -1 )
{
::rtl::OUStringBuffer buf;
buf.append( OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:" ) ) );
buf.append( descr.ScriptCode );
descr.ScriptCode = buf.makeStringAndClear();
}
}
2001-08-07 09:55:47 +00:00
// script:event element
if (aLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("event") ))
{
OUString aEventName;
if (! getStringAttr(
&aEventName,
OUString(
RTL_CONSTASCII_USTRINGPARAM("event-name") ),
xAttributes,
_pImport->XMLNS_SCRIPT_UID ))
2001-08-07 09:55:47 +00:00
{
throw xml::sax::SAXException(
OUString(
RTL_CONSTASCII_USTRINGPARAM(
"missing event-name attribute!") ),
2001-08-07 09:55:47 +00:00
Reference< XInterface >(), Any() );
}
// lookup in table
::rtl::OString str(
::rtl::OUStringToOString(
aEventName, RTL_TEXTENCODING_ASCII_US ) );
2001-08-07 09:55:47 +00:00
StringTriple const * p = g_pEventTranslations;
while (p->first)
{
if (0 == ::rtl_str_compare( p->third, str.getStr() ))
{
descr.ListenerType = OUString(
p->first, ::rtl_str_getLength( p->first ),
RTL_TEXTENCODING_ASCII_US );
descr.EventMethod = OUString(
p->second, ::rtl_str_getLength( p->second ),
RTL_TEXTENCODING_ASCII_US );
2001-08-07 09:55:47 +00:00
break;
}
++p;
}
if (! p->first)
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("no matching event-name found!") ),
Reference< XInterface >(), Any() );
}
}
else // script:listener-event element
{
OSL_ASSERT( aLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("listener-event") ) );
if (!getStringAttr(
&descr.ListenerType,
OUString( RTL_CONSTASCII_USTRINGPARAM(
"listener-type") ),
xAttributes,
_pImport->XMLNS_SCRIPT_UID ) ||
!getStringAttr(
&descr.EventMethod,
OUString( RTL_CONSTASCII_USTRINGPARAM(
"listener-method") ),
xAttributes, _pImport->XMLNS_SCRIPT_UID ))
2001-08-07 09:55:47 +00:00
{
throw xml::sax::SAXException(
OUString(
RTL_CONSTASCII_USTRINGPARAM(
"missing listener-type or "
"listener-method attribute(s)!") ),
2001-08-07 09:55:47 +00:00
Reference< XInterface >(), Any() );
}
// optional listener param
getStringAttr(
&descr.AddListenerParam,
OUString( RTL_CONSTASCII_USTRINGPARAM(
"listener-param") ),
xAttributes, _pImport->XMLNS_SCRIPT_UID );
2001-08-07 09:55:47 +00:00
}
}
else // deprecated dlg:event element
{
OSL_ASSERT(
_pImport->XMLNS_DIALOGS_UID == nUid &&
aLocalName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("event") ) );
2001-08-07 09:55:47 +00:00
if (!getStringAttr( &descr.ListenerType,
OUString( RTL_CONSTASCII_USTRINGPARAM(
"listener-type") ),
xAttributes,
_pImport->XMLNS_DIALOGS_UID ) ||
2001-08-07 09:55:47 +00:00
!getStringAttr( &descr.EventMethod,
OUString( RTL_CONSTASCII_USTRINGPARAM(
"event-method") ),
xAttributes,
_pImport->XMLNS_DIALOGS_UID ))
2001-08-07 09:55:47 +00:00
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("missing listener-type or event-method attribute(s)!") ),
Reference< XInterface >(), Any() );
}
getStringAttr(
&descr.ScriptType,
OUString( RTL_CONSTASCII_USTRINGPARAM("script-type") ),
xAttributes, _pImport->XMLNS_DIALOGS_UID );
2001-08-07 09:55:47 +00:00
getStringAttr(
&descr.ScriptCode,
OUString( RTL_CONSTASCII_USTRINGPARAM("script-code") ),
xAttributes, _pImport->XMLNS_DIALOGS_UID );
2001-08-07 09:55:47 +00:00
getStringAttr(
&descr.AddListenerParam,
OUString( RTL_CONSTASCII_USTRINGPARAM("param") ),
xAttributes, _pImport->XMLNS_DIALOGS_UID );
2001-04-04 13:35:09 +00:00
}
::rtl::OUStringBuffer buf;
2001-04-04 13:35:09 +00:00
buf.append( descr.ListenerType );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("::") );
buf.append( descr.EventMethod );
xEvents->insertByName( buf.makeStringAndClear(), makeAny( descr ) );
}
}
}
}
//__________________________________________________________________________________________________
2002-03-25 11:03:21 +00:00
void ImportContext::importDefaults(
2001-02-20 13:05:25 +00:00
sal_Int32 nBaseX, sal_Int32 nBaseY,
Reference< xml::input::XAttributes > const & xAttributes,
2002-03-25 11:03:21 +00:00
bool supportPrintable )
2001-02-16 13:14:51 +00:00
{
2001-02-28 17:22:08 +00:00
_xControlModel->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ),
makeAny( _aId ) );
2001-03-07 13:57:38 +00:00
importShortProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("TabIndex") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("tab-index") ),
xAttributes );
2001-02-28 17:22:08 +00:00
sal_Bool bDisable = sal_False;
if (getBoolAttr(
&bDisable, OUString( RTL_CONSTASCII_USTRINGPARAM("disabled") ),
xAttributes, _pImport->XMLNS_DIALOGS_UID ) &&
2001-02-21 19:49:30 +00:00
bDisable)
{
_xControlModel->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("Enabled") ), makeAny( sal_False ) );
}
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
sal_Bool bVisible = sal_True;
if (getBoolAttr(
&bVisible, OUString( RTL_CONSTASCII_USTRINGPARAM("visible") ),
xAttributes, _pImport->XMLNS_DIALOGS_UID ) && !bVisible)
{
try
{
_xControlModel->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("EnableVisible") ), makeAny( sal_False ) );
}
catch( Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
}
2001-02-20 13:05:25 +00:00
if (!importLongProperty( nBaseX,
OUString( RTL_CONSTASCII_USTRINGPARAM("PositionX") ),
2001-02-16 13:14:51 +00:00
OUString( RTL_CONSTASCII_USTRINGPARAM("left") ),
xAttributes ) ||
2001-02-20 13:05:25 +00:00
!importLongProperty( nBaseY,
OUString( RTL_CONSTASCII_USTRINGPARAM("PositionY") ),
2001-02-16 13:14:51 +00:00
OUString( RTL_CONSTASCII_USTRINGPARAM("top") ),
xAttributes ) ||
!importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("width") ),
xAttributes ) ||
!importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Height") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("height") ),
xAttributes ))
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("missing pos size attribute(s)!") ),
Reference< XInterface >(), Any() );
}
2002-03-25 11:03:21 +00:00
if (supportPrintable)
{
importBooleanProperty(
OUString( RTL_CONSTASCII_USTRINGPARAM("Printable") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("printable") ),
xAttributes );
}
2001-03-07 13:57:38 +00:00
sal_Int32 nLong;
if (! getLongAttr(
&nLong,
OUString( RTL_CONSTASCII_USTRINGPARAM("page") ),
xAttributes, _pImport->XMLNS_DIALOGS_UID ))
2001-03-07 13:57:38 +00:00
{
nLong = 0;
}
_xControlModel->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("Step") ),
makeAny( nLong ) );
importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Tag") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("tag") ),
xAttributes );
2001-03-22 14:43:07 +00:00
importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("HelpText") ),
2001-04-04 13:35:09 +00:00
OUString( RTL_CONSTASCII_USTRINGPARAM("help-text") ),
xAttributes );
importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("HelpURL") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("help-url") ),
2001-03-22 14:43:07 +00:00
xAttributes );
2001-02-20 15:51:32 +00:00
}
2001-02-16 13:14:51 +00:00
//##################################################################################################
//__________________________________________________________________________________________________
Reference< xml::input::XElement > ElementBase::getParent()
2001-02-16 13:14:51 +00:00
throw (RuntimeException)
{
return static_cast< xml::input::XElement * >( _pParent );
2001-02-16 13:14:51 +00:00
}
//__________________________________________________________________________________________________
OUString ElementBase::getLocalName()
throw (RuntimeException)
{
return _aLocalName;
}
//__________________________________________________________________________________________________
sal_Int32 ElementBase::getUid()
throw (RuntimeException)
{
2001-08-07 09:55:47 +00:00
return _nUid;
2001-02-16 13:14:51 +00:00
}
//__________________________________________________________________________________________________
Reference< xml::input::XAttributes > ElementBase::getAttributes()
2001-02-16 13:14:51 +00:00
throw (RuntimeException)
{
return _xAttributes;
}
//__________________________________________________________________________________________________
void ElementBase::ignorableWhitespace(
OUString const & /*rWhitespaces*/ )
2001-02-16 13:14:51 +00:00
throw (xml::sax::SAXException, RuntimeException)
{
// not used
}
//__________________________________________________________________________________________________
void ElementBase::characters( OUString const & /*rChars*/ )
2001-02-16 13:14:51 +00:00
throw (xml::sax::SAXException, RuntimeException)
{
// not used, all characters ignored
}
//__________________________________________________________________________________________________
void ElementBase::endElement()
throw (xml::sax::SAXException, RuntimeException)
{
}
//______________________________________________________________________________
void ElementBase::processingInstruction(
OUString const & /*Target*/, OUString const & /*Data*/ )
throw (xml::sax::SAXException, RuntimeException)
{
}
2001-02-16 13:14:51 +00:00
//__________________________________________________________________________________________________
Reference< xml::input::XElement > ElementBase::startChildElement(
sal_Int32 /*nUid*/, OUString const & /*rLocalName*/,
Reference< xml::input::XAttributes > const & /*xAttributes*/ )
2001-02-16 13:14:51 +00:00
throw (xml::sax::SAXException, RuntimeException)
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("unexpected element!") ),
Reference< XInterface >(), Any() );
}
//__________________________________________________________________________________________________
ElementBase::ElementBase(
2001-08-07 09:55:47 +00:00
sal_Int32 nUid, OUString const & rLocalName,
Reference< xml::input::XAttributes > const & xAttributes,
2001-02-16 13:14:51 +00:00
ElementBase * pParent, DialogImport * pImport )
2001-03-14 15:39:59 +00:00
SAL_THROW( () )
: _pImport( pImport )
2001-02-16 13:14:51 +00:00
, _pParent( pParent )
2001-08-07 09:55:47 +00:00
, _nUid( nUid )
2001-03-14 15:39:59 +00:00
, _aLocalName( rLocalName )
, _xAttributes( xAttributes )
2001-02-16 13:14:51 +00:00
{
_pImport->acquire();
if (_pParent)
{
_pParent->acquire();
}
}
//__________________________________________________________________________________________________
ElementBase::~ElementBase()
2001-03-14 15:39:59 +00:00
SAL_THROW( () )
2001-02-16 13:14:51 +00:00
{
_pImport->release();
if (_pParent)
{
_pParent->release();
}
2001-02-27 11:45:17 +00:00
#if OSL_DEBUG_LEVEL > 1
::rtl::OString aStr( ::rtl::OUStringToOString(
_aLocalName, RTL_TEXTENCODING_ASCII_US ) );
2001-02-27 11:45:17 +00:00
OSL_TRACE( "ElementBase::~ElementBase(): %s\n", aStr.getStr() );
#endif
2001-02-16 13:14:51 +00:00
}
//##################################################################################################
// XRoot
//
//______________________________________________________________________________
void DialogImport::startDocument(
Reference< xml::input::XNamespaceMapping > const & xNamespaceMapping )
2001-02-16 13:14:51 +00:00
throw (xml::sax::SAXException, RuntimeException)
{
XMLNS_DIALOGS_UID = xNamespaceMapping->getUidByUri(
OUSTR(XMLNS_DIALOGS_URI) );
XMLNS_SCRIPT_UID = xNamespaceMapping->getUidByUri(
OUSTR(XMLNS_SCRIPT_URI) );
2001-02-16 13:14:51 +00:00
}
//__________________________________________________________________________________________________
void DialogImport::endDocument()
throw (xml::sax::SAXException, RuntimeException)
{
// ignored
}
//__________________________________________________________________________________________________
void DialogImport::processingInstruction(
OUString const & /*rTarget*/, OUString const & /*rData*/ )
2001-02-16 13:14:51 +00:00
throw (xml::sax::SAXException, RuntimeException)
{
// ignored for now: xxx todo
}
//__________________________________________________________________________________________________
void DialogImport::setDocumentLocator(
Reference< xml::sax::XLocator > const & /*xLocator*/ )
2001-02-16 13:14:51 +00:00
throw (xml::sax::SAXException, RuntimeException)
{
// ignored for now: xxx todo
}
//__________________________________________________________________________________________________
Reference< xml::input::XElement > DialogImport::startRootElement(
2001-02-16 13:14:51 +00:00
sal_Int32 nUid, OUString const & rLocalName,
Reference< xml::input::XAttributes > const & xAttributes )
2001-02-16 13:14:51 +00:00
throw (xml::sax::SAXException, RuntimeException)
{
2001-02-27 11:45:17 +00:00
if (XMLNS_DIALOGS_UID != nUid)
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("illegal namespace!") ),
Reference< XInterface >(), Any() );
}
2001-03-14 15:39:59 +00:00
// window
else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("window") ))
2001-02-16 13:14:51 +00:00
{
2001-03-14 15:39:59 +00:00
return new WindowElement( rLocalName, xAttributes, 0, this );
2001-02-16 13:14:51 +00:00
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM(
"illegal root element (expected window) given: ") ) +
2001-02-16 13:14:51 +00:00
rLocalName, Reference< XInterface >(), Any() );
}
}
2001-02-27 11:45:17 +00:00
//__________________________________________________________________________________________________
DialogImport::~DialogImport()
2001-03-14 15:39:59 +00:00
SAL_THROW( () )
2001-02-27 11:45:17 +00:00
{
#if OSL_DEBUG_LEVEL > 1
2001-02-27 11:45:17 +00:00
OSL_TRACE( "DialogImport::~DialogImport().\n" );
#endif
}
2001-09-19 12:43:18 +00:00
//__________________________________________________________________________________________________
Reference< util::XNumberFormatsSupplier > const & DialogImport::getNumberFormatsSupplier()
{
if (! _xSupplier.is())
{
Reference< XComponentContext > xContext( getComponentContext() );
Reference< util::XNumberFormatsSupplier > xSupplier(
xContext->getServiceManager()->createInstanceWithContext(
OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.util.NumberFormatsSupplier") ),
xContext ), UNO_QUERY );
2001-09-19 12:43:18 +00:00
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if (! _xSupplier.is())
{
_xSupplier = xSupplier;
}
}
return _xSupplier;
}
2001-02-16 13:14:51 +00:00
//__________________________________________________________________________________________________
void DialogImport::addStyle(
OUString const & rStyleId,
Reference< xml::input::XElement > const & xStyle )
2001-03-14 15:39:59 +00:00
SAL_THROW( () )
2001-02-16 13:14:51 +00:00
{
_styleNames.push_back( rStyleId );
_styles.push_back( xStyle );
}
//__________________________________________________________________________________________________
Reference< xml::input::XElement > DialogImport::getStyle(
2001-02-16 13:14:51 +00:00
OUString const & rStyleId ) const
2001-03-14 15:39:59 +00:00
SAL_THROW( () )
2001-02-16 13:14:51 +00:00
{
for ( size_t nPos = 0; nPos < _styleNames.size(); ++nPos )
{
if (_styleNames[ nPos ] == rStyleId)
{
return _styles[ nPos ];
}
}
return 0;
}
//__________________________________________________________________________________________________
Reference< script::XLibraryContainer > DialogImport::getScriptLibraryContainer()
{
if( !_xScriptLibraryContainer.is() )
{
try
{
Reference< beans::XPropertySet > xProps( _xDoc, UNO_QUERY );
if( xProps.is() )
_xScriptLibraryContainer.set( xProps->getPropertyValue( OUSTR("BasicLibraries") ), UNO_QUERY );
}
catch( const Exception& )
{
}
}
return _xScriptLibraryContainer;
}
2001-02-16 13:14:51 +00:00
//##################################################################################################
//==================================================================================================
Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModel(
2001-09-19 07:46:35 +00:00
Reference< container::XNameContainer > const & xDialogModel,
Reference< XComponentContext > const & xContext,
Reference< XModel > const & xDocument )
2001-03-14 15:39:59 +00:00
SAL_THROW( (Exception) )
2001-02-16 13:14:51 +00:00
{
DialogImport* pImport = new DialogImport( xContext, xDialogModel, xDocument );
2001-02-16 13:14:51 +00:00
return ::xmlscript::createDocumentHandler(
static_cast< xml::input::XRoot * >( pImport ) );
2001-02-16 13:14:51 +00:00
}
2001-08-24 10:16:43 +00:00
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */