summaryrefslogtreecommitdiff
path: root/xmlscript
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-19 08:30:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-19 13:06:47 +0200
commit935231896925461f36eff5aee58aa64921ccb0e5 (patch)
treedbddae3c667986e298680ccba6572dd1ca58dd54 /xmlscript
parent37192ccc89dda5ca8c274e7cfb8b236fd5aaeb4f (diff)
use rtl::Reference in ElementBase
instead of manual acquire/release Change-Id: Ie4d08dffa0b697e8308b4a3ad8e3504dc7a18e35
Diffstat (limited to 'xmlscript')
-rw-r--r--xmlscript/source/xmldlg_imexp/imp_share.hxx9
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx306
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_import.cxx83
3 files changed, 193 insertions, 205 deletions
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 30c3f9440883..86ae935898e3 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -41,6 +41,7 @@
#include <com/sun/star/container/ElementExistException.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <osl/diagnose.h>
+#include <rtl/ref.hxx>
#include <memory>
#include <vector>
@@ -203,8 +204,8 @@ class ElementBase
: public ::cppu::WeakImplHelper< css::xml::input::XElement >
{
protected:
- DialogImport * const _pImport;
- ElementBase * const _pParent;
+ rtl::Reference<DialogImport> const m_xImport;
+ rtl::Reference<ElementBase> const m_xParent;
private:
const sal_Int32 _nUid;
const OUString _aLocalName;
@@ -1027,7 +1028,7 @@ public:
ElementBase * pParent, DialogImport * pImport )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{
- m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoMultiPageModel" ), css::uno::UNO_QUERY );
+ m_xContainer.set( m_xImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoMultiPageModel" ), css::uno::UNO_QUERY );
}
private:
css::uno::Reference< css::container::XNameContainer > m_xContainer;
@@ -1074,7 +1075,7 @@ public:
ElementBase * pParent, DialogImport * pImport )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{
- m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoPageModel" ), css::uno::UNO_QUERY );
+ m_xContainer.set( m_xImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoPageModel" ), css::uno::UNO_QUERY );
}
private:
css::uno::Reference< css::container::XNameContainer > m_xContainer;
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 006adccdb427..2a94774fb488 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -47,24 +47,24 @@ Reference< xml::input::XElement > Frame::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
if ( !m_xContainer.is() )
- m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoFrameModel" ), UNO_QUERY );
+ m_xContainer.set( m_xImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoFrameModel" ), UNO_QUERY );
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else if ( rLocalName == "bulletinboard" )
{
// Create new DialogImport for this container
- DialogImport* pFrameImport = new DialogImport( *_pImport );
+ DialogImport* pFrameImport = new DialogImport( *m_xImport );
pFrameImport->_xDialogModel = m_xContainer;
return new BulletinBoardElement( rLocalName, xAttributes, this, pFrameImport );
}
else if ( rLocalName == "title" )
{
- getStringAttr( &_label, "value", xAttributes, _pImport->XMLNS_DIALOGS_UID );
+ getStringAttr( &_label, "value", xAttributes, m_xImport->XMLNS_DIALOGS_UID );
- return new ElementBase( _pImport->XMLNS_DIALOGS_UID, rLocalName, xAttributes, this, _pImport );
+ return new ElementBase( m_xImport->XMLNS_DIALOGS_UID, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -77,10 +77,10 @@ void Frame::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
if ( !m_xContainer.is() )
- m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoFrameModel" ), UNO_QUERY );
+ m_xContainer.set( m_xImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoFrameModel" ), UNO_QUERY );
Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
- // _pImport is what we need to add to ( e.g. the dialog in this case )
- ControlImportContext ctx( _pImport, xProps, getControlId( _xAttributes ) );
+ // m_xImport is what we need to add to ( e.g. the dialog in this case )
+ ControlImportContext ctx( m_xImport.get(), xProps, getControlId( _xAttributes ) );
Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
@@ -113,16 +113,16 @@ Reference< xml::input::XElement > MultiPage::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
return new EventElement(
- nUid, rLocalName, xAttributes, this, _pImport );
+ nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else if ( rLocalName == "bulletinboard" )
{
// Create new DialogImport for this container
- DialogImport* pMultiPageImport = new DialogImport( *_pImport );
+ DialogImport* pMultiPageImport = new DialogImport( *m_xImport );
pMultiPageImport->_xDialogModel = m_xContainer;
return new BulletinBoardElement( rLocalName, xAttributes, this, pMultiPageImport );
}
@@ -137,8 +137,8 @@ void MultiPage::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
- // _pImport is what we need to add to ( e.g. the dialog in this case )
- ControlImportContext ctx( _pImport, xProps, getControlId( _xAttributes ));
+ // m_xImport is what we need to add to ( e.g. the dialog in this case )
+ ControlImportContext ctx( m_xImport.get(), xProps, getControlId( _xAttributes ));
Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
@@ -169,15 +169,15 @@ Reference< xml::input::XElement > Page::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
return new EventElement(
- nUid, rLocalName, xAttributes, this, _pImport );
+ nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else if ( rLocalName == "bulletinboard" )
{
- DialogImport* pPageImport = new DialogImport( *_pImport );
+ DialogImport* pPageImport = new DialogImport( *m_xImport );
pPageImport->_xDialogModel = m_xContainer;
return new BulletinBoardElement( rLocalName, xAttributes, this, pPageImport );
}
@@ -193,7 +193,7 @@ void Page::endElement()
{
Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
- ControlImportContext ctx( _pImport, xProps, getControlId( _xAttributes ));
+ ControlImportContext ctx( m_xImport.get(), xProps, getControlId( _xAttributes ));
Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
@@ -224,10 +224,10 @@ Reference< xml::input::XElement > ProgressBarElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
return new EventElement(
- nUid, rLocalName, xAttributes, this, _pImport );
+ nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -239,7 +239,7 @@ Reference< xml::input::XElement > ProgressBarElement::startChildElement(
void ProgressBarElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlProgressBarModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlProgressBarModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -270,9 +270,9 @@ Reference< xml::input::XElement > ScrollBarElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -282,7 +282,7 @@ Reference< xml::input::XElement > ScrollBarElement::startChildElement(
void ScrollBarElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlScrollBarModel" , _xAttributes ) );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlScrollBarModel" , _xAttributes ) );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -322,9 +322,9 @@ Reference< xml::input::XElement > SpinButtonElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -335,7 +335,7 @@ Reference< xml::input::XElement > SpinButtonElement::startChildElement(
void SpinButtonElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlSpinButtonModel", _xAttributes ) );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlSpinButtonModel", _xAttributes ) );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -372,9 +372,9 @@ Reference< xml::input::XElement > FixedLineElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -384,7 +384,7 @@ Reference< xml::input::XElement > FixedLineElement::startChildElement(
void FixedLineElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx(_pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlFixedLineModel" );
+ ControlImportContext ctx(m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlFixedLineModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -414,9 +414,9 @@ Reference< xml::input::XElement > PatternFieldElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -426,7 +426,7 @@ Reference< xml::input::XElement > PatternFieldElement::startChildElement(
void PatternFieldElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlPatternFieldModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlPatternFieldModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -464,9 +464,9 @@ Reference< xml::input::XElement > FormattedFieldElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -477,7 +477,7 @@ Reference< xml::input::XElement > FormattedFieldElement::startChildElement(
void FormattedFieldElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlFormattedFieldModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlFormattedFieldModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -506,7 +506,7 @@ void FormattedFieldElement::endElement()
if (ctx.importLongProperty( "RepeatDelay", "repeat", _xAttributes ))
ctx.getControlModel()->setPropertyValue( "Repeat" , makeAny(true) );
- OUString sDefault(_xAttributes->getValueByUidName(_pImport->XMLNS_DIALOGS_UID, "value-default") );
+ OUString sDefault(_xAttributes->getValueByUidName(m_xImport->XMLNS_DIALOGS_UID, "value-default") );
if (!sDefault.isEmpty())
{
double d = sDefault.toDouble();
@@ -521,14 +521,14 @@ void FormattedFieldElement::endElement()
}
// format spec
- ctx.getControlModel()->setPropertyValue("FormatsSupplier", makeAny( _pImport->getNumberFormatsSupplier() ) );
+ ctx.getControlModel()->setPropertyValue("FormatsSupplier", makeAny( m_xImport->getNumberFormatsSupplier() ) );
- OUString sFormat( _xAttributes->getValueByUidName(_pImport->XMLNS_DIALOGS_UID, "format-code" ) );
+ OUString sFormat( _xAttributes->getValueByUidName(m_xImport->XMLNS_DIALOGS_UID, "format-code" ) );
if (!sFormat.isEmpty())
{
lang::Locale locale;
- OUString sLocale( _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, "format-locale" ) );
+ OUString sLocale( _xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID, "format-locale" ) );
if (!sLocale.isEmpty())
{
// split locale
@@ -560,7 +560,7 @@ void FormattedFieldElement::endElement()
try
{
Reference< util::XNumberFormats > xFormats(
- _pImport->getNumberFormatsSupplier()->getNumberFormats() );
+ m_xImport->getNumberFormatsSupplier()->getNumberFormats() );
sal_Int32 nKey = xFormats->queryKey( sFormat, locale, true );
if (-1 == nKey)
{
@@ -594,9 +594,9 @@ Reference< xml::input::XElement > TimeFieldElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -606,7 +606,7 @@ Reference< xml::input::XElement > TimeFieldElement::startChildElement(
void TimeFieldElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlTimeFieldModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlTimeFieldModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -650,9 +650,9 @@ Reference< xml::input::XElement > NumericFieldElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -662,7 +662,7 @@ Reference< xml::input::XElement > NumericFieldElement::startChildElement(
void NumericFieldElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlNumericFieldModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlNumericFieldModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -708,9 +708,9 @@ Reference< xml::input::XElement > DateFieldElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -720,7 +720,7 @@ Reference< xml::input::XElement > DateFieldElement::startChildElement(
void DateFieldElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlDateFieldModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlDateFieldModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -765,9 +765,9 @@ Reference< xml::input::XElement > CurrencyFieldElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -777,7 +777,7 @@ Reference< xml::input::XElement > CurrencyFieldElement::startChildElement(
void CurrencyFieldElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlCurrencyFieldModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlCurrencyFieldModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -823,9 +823,9 @@ Reference< xml::input::XElement > FileControlElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -835,7 +835,7 @@ Reference< xml::input::XElement > FileControlElement::startChildElement(
void FileControlElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlFileControlModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlFileControlModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -869,9 +869,9 @@ Reference< xml::input::XElement > TreeControlElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -881,7 +881,7 @@ Reference< xml::input::XElement > TreeControlElement::startChildElement(
void TreeControlElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.tree.TreeControlModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.tree.TreeControlModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -917,9 +917,9 @@ Reference< xml::input::XElement > ImageControlElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -930,7 +930,7 @@ Reference< xml::input::XElement > ImageControlElement::startChildElement(
void ImageControlElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlImageControlModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlImageControlModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -961,9 +961,9 @@ Reference< xml::input::XElement > TextElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -974,7 +974,7 @@ Reference< xml::input::XElement > TextElement::startChildElement(
void TextElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlFixedTextModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlFixedTextModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -1010,9 +1010,9 @@ Reference< xml::input::XElement > FixedHyperLinkElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -1022,7 +1022,7 @@ Reference< xml::input::XElement > FixedHyperLinkElement::startChildElement(
void FixedHyperLinkElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlFixedHyperlinkModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlFixedHyperlinkModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -1061,9 +1061,9 @@ Reference< xml::input::XElement > TextFieldElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -1073,7 +1073,7 @@ Reference< xml::input::XElement > TextFieldElement::startChildElement(
void TextFieldElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlEditModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlEditModel" );
Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
@@ -1101,7 +1101,7 @@ void TextFieldElement::endElement()
ctx.importStringProperty( "Text", "value", _xAttributes );
ctx.importLineEndFormatProperty( "LineEndFormat", "lineend-format", _xAttributes );
OUString aValue;
- if (getStringAttr( &aValue, "echochar", _xAttributes, _pImport->XMLNS_DIALOGS_UID ) && !aValue.isEmpty() )
+ if (getStringAttr( &aValue, "echochar", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ) && !aValue.isEmpty() )
{
SAL_WARN_IF( aValue.getLength() != 1, "xmlscript.xmldlg", "### more than one character given for echochar!" );
sal_Int16 nChar = 0;
@@ -1127,20 +1127,20 @@ Reference< xml::input::XElement > TitledBoxElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
- else if (_pImport->XMLNS_DIALOGS_UID != nUid)
+ else if (m_xImport->XMLNS_DIALOGS_UID != nUid)
{
throw xml::sax::SAXException( "illegal namespace!", Reference< XInterface >(), Any() );
}
// title
else if ( rLocalName == "title" )
{
- getStringAttr( &_label, "value", xAttributes, _pImport->XMLNS_DIALOGS_UID );
+ getStringAttr( &_label, "value", xAttributes, m_xImport->XMLNS_DIALOGS_UID );
- return new ElementBase( _pImport->XMLNS_DIALOGS_UID, rLocalName, xAttributes, this, _pImport );
+ return new ElementBase( m_xImport->XMLNS_DIALOGS_UID, rLocalName, xAttributes, this, m_xImport.get() );
}
// radio
else if ( rLocalName == "radio" )
@@ -1148,14 +1148,14 @@ Reference< xml::input::XElement > TitledBoxElement::startChildElement(
// don't create radios here, => titledbox must be inserted first due to radio grouping,
// possible predecessors!
Reference< xml::input::XElement > xRet(
- new RadioElement( rLocalName, xAttributes, this, _pImport ) );
+ new RadioElement( rLocalName, xAttributes, this, m_xImport.get() ) );
_radios.push_back( xRet );
return xRet;
}
// event
- else if (_pImport->isEventElement( nUid, rLocalName ))
+ else if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -1167,7 +1167,7 @@ void TitledBoxElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
{
- ControlImportContext ctx(_pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlGroupBoxModel" );
+ ControlImportContext ctx(m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlGroupBoxModel" );
Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
@@ -1199,7 +1199,7 @@ void TitledBoxElement::endElement()
{
Reference< xml::input::XAttributes > xAttributes( xRadio->getAttributes() );
- ControlImportContext ctx( _pImport, getControlId( xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlRadioButtonModel", xAttributes ) );
+ ControlImportContext ctx( m_xImport.get(), getControlId( xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlRadioButtonModel", xAttributes ) );
Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
Reference< xml::input::XElement > xStyle( getStyle( xAttributes ) );
@@ -1225,7 +1225,7 @@ void TitledBoxElement::endElement()
sal_Int16 nVal = 0;
sal_Bool bChecked = false;
- if (getBoolAttr( &bChecked, "checked", xAttributes, _pImport->XMLNS_DIALOGS_UID ) && bChecked)
+ if (getBoolAttr( &bChecked, "checked", xAttributes, m_xImport->XMLNS_DIALOGS_UID ) && bChecked)
{
nVal = 1;
}
@@ -1252,9 +1252,9 @@ Reference< xml::input::XElement > RadioElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -1268,7 +1268,7 @@ Reference< xml::input::XElement > RadioGroupElement::startChildElement(
Reference< xml::input::XAttributes > const & xAttributes )
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- if (_pImport->XMLNS_DIALOGS_UID != nUid)
+ if (m_xImport->XMLNS_DIALOGS_UID != nUid)
{
throw xml::sax::SAXException( "illegal namespace!", Reference< XInterface >(), Any() );
}
@@ -1278,7 +1278,7 @@ Reference< xml::input::XElement > RadioGroupElement::startChildElement(
// don't create radios here, => titledbox must be inserted first due to radio grouping,
// possible predecessors!
Reference< xml::input::XElement > xRet(
- new RadioElement( rLocalName, xAttributes, this, _pImport ) );
+ new RadioElement( rLocalName, xAttributes, this, m_xImport.get() ) );
_radios.push_back( xRet );
return xRet;
}
@@ -1295,7 +1295,7 @@ void RadioGroupElement::endElement()
Reference< xml::input::XAttributes > xAttributes(
xRadio->getAttributes() );
- ControlImportContext ctx( _pImport, getControlId( xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlRadioButtonModel", xAttributes ) );
+ ControlImportContext ctx( m_xImport.get(), getControlId( xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlRadioButtonModel", xAttributes ) );
Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
Reference< xml::input::XElement > xStyle( getStyle( xAttributes ) );
@@ -1320,7 +1320,7 @@ void RadioGroupElement::endElement()
ctx.importStringProperty( "GroupName", "group-name", xAttributes );
sal_Int16 nVal = 0;
sal_Bool bChecked = false;
- if (getBoolAttr( &bChecked, "checked", xAttributes, _pImport->XMLNS_DIALOGS_UID ) && bChecked)
+ if (getBoolAttr( &bChecked, "checked", xAttributes, m_xImport->XMLNS_DIALOGS_UID ) && bChecked)
{
nVal = 1;
}
@@ -1348,26 +1348,26 @@ Reference< xml::input::XElement > MenuPopupElement::startChildElement(
Reference< xml::input::XAttributes > const & xAttributes )
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- if (_pImport->XMLNS_DIALOGS_UID != nUid)
+ if (m_xImport->XMLNS_DIALOGS_UID != nUid)
{
throw xml::sax::SAXException( "illegal namespace!", Reference< XInterface >(), Any() );
}
// menuitem
else if ( rLocalName == "menuitem" )
{
- OUString aValue( xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID,"value" ) );
+ OUString aValue( xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID,"value" ) );
SAL_WARN_IF( aValue.isEmpty(), "xmlscript.xmldlg", "### menuitem has no value?" );
if (!aValue.isEmpty())
{
_itemValues.push_back( aValue );
- OUString aSel( xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, "selected" ) );
+ OUString aSel( xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID, "selected" ) );
if (!aSel.isEmpty() && aSel == "true")
{
_itemSelected.push_back( static_cast<sal_Int16>(_itemValues.size()) -1 );
}
}
- return new ElementBase( _pImport->XMLNS_DIALOGS_UID, rLocalName, xAttributes, this, _pImport );
+ return new ElementBase( m_xImport->XMLNS_DIALOGS_UID, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -1402,18 +1402,18 @@ Reference< xml::input::XElement > MenuListElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
- else if (_pImport->XMLNS_DIALOGS_UID != nUid)
+ else if (m_xImport->XMLNS_DIALOGS_UID != nUid)
{
throw xml::sax::SAXException( "illegal namespace!", Reference< XInterface >(), Any() );
}
// menupopup
else if ( rLocalName == "menupopup" )
{
- _popup = new MenuPopupElement( rLocalName, xAttributes, this, _pImport );
+ _popup = new MenuPopupElement( rLocalName, xAttributes, this, m_xImport.get() );
return _popup;
}
else
@@ -1425,7 +1425,7 @@ Reference< xml::input::XElement > MenuListElement::startChildElement(
void MenuListElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlListBoxModel", _xAttributes ) );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlListBoxModel", _xAttributes ) );
Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
@@ -1472,18 +1472,18 @@ Reference< xml::input::XElement > ComboBoxElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
- else if (_pImport->XMLNS_DIALOGS_UID != nUid)
+ else if (m_xImport->XMLNS_DIALOGS_UID != nUid)
{
throw xml::sax::SAXException( "illegal namespace!", Reference< XInterface >(), Any() );
}
// menupopup
else if ( rLocalName == "menupopup" )
{
- _popup = new MenuPopupElement( rLocalName, xAttributes, this, _pImport );
+ _popup = new MenuPopupElement( rLocalName, xAttributes, this, m_xImport.get() );
return _popup;
}
else
@@ -1494,7 +1494,7 @@ Reference< xml::input::XElement > ComboBoxElement::startChildElement(
void ComboBoxElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlComboBoxModel", _xAttributes ) );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlComboBoxModel", _xAttributes ) );
Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
@@ -1541,9 +1541,9 @@ Reference< xml::input::XElement > CheckBoxElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -1553,7 +1553,7 @@ Reference< xml::input::XElement > CheckBoxElement::startChildElement(
void CheckBoxElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlCheckBoxModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlCheckBoxModel" );
Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
@@ -1577,12 +1577,12 @@ void CheckBoxElement::endElement()
ctx.importBooleanProperty( "MultiLine", "multiline", _xAttributes );
sal_Bool bTriState = false;
- if (getBoolAttr( &bTriState, "tristate", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getBoolAttr( &bTriState, "tristate", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
xControlModel->setPropertyValue( "TriState", makeAny( bTriState ) );
}
sal_Bool bChecked = false;
- if (getBoolAttr( &bChecked, "checked", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getBoolAttr( &bChecked, "checked", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
// has "checked" attribute
sal_Int16 nVal = (bChecked ? 1 : 0);
@@ -1609,9 +1609,9 @@ Reference< xml::input::XElement > ButtonElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -1622,7 +1622,7 @@ Reference< xml::input::XElement > ButtonElement::startChildElement(
void ButtonElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- ControlImportContext ctx( _pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlButtonModel" );
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.UnoControlButtonModel" );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
@@ -1648,13 +1648,13 @@ void ButtonElement::endElement()
if (ctx.importLongProperty( "RepeatDelay", "repeat", _xAttributes ))
ctx.getControlModel()->setPropertyValue( "Repeat", makeAny(true) );
sal_Int32 toggled = 0;
- if (getLongAttr( &toggled, "toggled", _xAttributes, _pImport->XMLNS_DIALOGS_UID ) && toggled == 1)
+ if (getLongAttr( &toggled, "toggled", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ) && toggled == 1)
ctx.getControlModel()->setPropertyValue( "Toggle" , makeAny(true));
ctx.importBooleanProperty( "FocusOnClick", "grab-focus", _xAttributes );
ctx.importBooleanProperty( "MultiLine", "multiline", _xAttributes );
// State
sal_Bool bChecked = false;
- if (getBoolAttr( &bChecked, "checked", _xAttributes, _pImport->XMLNS_DIALOGS_UID ) && bChecked)
+ if (getBoolAttr( &bChecked, "checked", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ) && bChecked)
{
sal_Int16 nVal = 1;
ctx.getControlModel()->setPropertyValue( "State" , makeAny( nVal ) );
@@ -1674,135 +1674,135 @@ Reference< xml::input::XElement > BulletinBoardElement::startChildElement(
Reference< xml::input::XAttributes > const & xAttributes )
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- if (_pImport->XMLNS_DIALOGS_UID != nUid)
+ if (m_xImport->XMLNS_DIALOGS_UID != nUid)
{
throw xml::sax::SAXException("illegal namespace!", Reference< XInterface >(), Any() );
}
// button
else if ( rLocalName == "button" )
{
- return new ButtonElement( rLocalName, xAttributes, this, _pImport );
+ return new ButtonElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// checkbox
else if ( rLocalName == "checkbox" )
{
- return new CheckBoxElement( rLocalName, xAttributes, this, _pImport );
+ return new CheckBoxElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// combobox
else if ( rLocalName == "combobox" )
{
- return new ComboBoxElement( rLocalName, xAttributes, this, _pImport );
+ return new ComboBoxElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// listbox
else if ( rLocalName == "menulist" )
{
- return new MenuListElement( rLocalName, xAttributes, this, _pImport );
+ return new MenuListElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// radiogroup
else if ( rLocalName == "radiogroup" )
{
- return new RadioGroupElement( rLocalName, xAttributes, this, _pImport );
+ return new RadioGroupElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// titledbox
else if ( rLocalName == "titledbox" )
{
- return new TitledBoxElement( rLocalName, xAttributes, this, _pImport );
+ return new TitledBoxElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// text
else if ( rLocalName == "text" )
{
- return new TextElement( rLocalName, xAttributes, this, _pImport );
+ return new TextElement( rLocalName, xAttributes, this, m_xImport.get() );
}
else if ( rLocalName == "linklabel" )
{
- return new FixedHyperLinkElement( rLocalName, xAttributes, this, _pImport );
+ return new FixedHyperLinkElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// textfield
else if ( rLocalName == "textfield" )
{
- return new TextFieldElement( rLocalName, xAttributes, this, _pImport );
+ return new TextFieldElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// img
else if ( rLocalName == "img" )
{
- return new ImageControlElement( rLocalName, xAttributes, this, _pImport );
+ return new ImageControlElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// filecontrol
else if ( rLocalName == "filecontrol" )
{
- return new FileControlElement( rLocalName, xAttributes, this, _pImport );
+ return new FileControlElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// treecontrol
else if ( rLocalName == "treecontrol" )
{
- return new TreeControlElement( rLocalName, xAttributes, this, _pImport );
+ return new TreeControlElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// currencyfield
else if ( rLocalName == "currencyfield" )
{
- return new CurrencyFieldElement( rLocalName, xAttributes, this, _pImport );
+ return new CurrencyFieldElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// datefield
else if ( rLocalName == "datefield" )
{
- return new DateFieldElement( rLocalName, xAttributes, this, _pImport );
+ return new DateFieldElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// datefield
else if ( rLocalName == "numericfield" )
{
- return new NumericFieldElement( rLocalName, xAttributes, this, _pImport );
+ return new NumericFieldElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// timefield
else if ( rLocalName == "timefield" )
{
- return new TimeFieldElement( rLocalName, xAttributes, this, _pImport );
+ return new TimeFieldElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// patternfield
else if ( rLocalName == "patternfield" )
{
- return new PatternFieldElement( rLocalName, xAttributes, this, _pImport );
+ return new PatternFieldElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// formattedfield
else if ( rLocalName == "formattedfield" )
{
- return new FormattedFieldElement( rLocalName, xAttributes, this, _pImport );
+ return new FormattedFieldElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// fixedline
else if ( rLocalName == "fixedline" )
{
- return new FixedLineElement( rLocalName, xAttributes, this, _pImport );
+ return new FixedLineElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// scrollbar
else if ( rLocalName == "scrollbar" )
{
- return new ScrollBarElement( rLocalName, xAttributes, this, _pImport );
+ return new ScrollBarElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// spinbutton
else if ( rLocalName == "spinbutton" )
{
- return new SpinButtonElement( rLocalName, xAttributes, this, _pImport );
+ return new SpinButtonElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// progressmeter
else if ( rLocalName == "progressmeter" )
{
- return new ProgressBarElement( rLocalName, xAttributes, this, _pImport );
+ return new ProgressBarElement( rLocalName, xAttributes, this, m_xImport.get() );
}
else if ( rLocalName == "multipage" )
{
- return new MultiPage( rLocalName, xAttributes, this, _pImport );
+ return new MultiPage( rLocalName, xAttributes, this, m_xImport.get() );
}
else if ( rLocalName == "frame" )
{
- return new Frame( rLocalName, xAttributes, this, _pImport );
+ return new Frame( rLocalName, xAttributes, this, m_xImport.get() );
}
else if ( rLocalName == "page" )
{
- return new Page( rLocalName, xAttributes, this, _pImport );
+ return new Page( rLocalName, xAttributes, this, m_xImport.get() );
}
// bulletinboard
else if ( rLocalName == "bulletinboard" )
{
- return new BulletinBoardElement( rLocalName, xAttributes, this, _pImport );
+ return new BulletinBoardElement( rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -1816,12 +1816,12 @@ BulletinBoardElement::BulletinBoardElement(
ElementBase * pParent, DialogImport * pImport )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{
- OUString aValue( _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, "left" ) );
+ OUString aValue( _xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID, "left" ) );
if (!aValue.isEmpty())
{
_nBasePosX += toInt32( aValue );
}
- aValue = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, "top" );
+ aValue = _xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID, "top" );
if (!aValue.isEmpty())
{
_nBasePosY += toInt32( aValue );
@@ -1841,10 +1841,10 @@ void StyleElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
Reference< xml::input::XAttributes > xStyle;
- OUString aStyleId( _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, "style-id" ) );
+ OUString aStyleId( _xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID, "style-id" ) );
if (!aStyleId.isEmpty())
{
- _pImport->addStyle( aStyleId, this );
+ m_xImport->addStyle( aStyleId, this );
}
else
{
@@ -1858,14 +1858,14 @@ Reference< xml::input::XElement > StylesElement::startChildElement(
Reference< xml::input::XAttributes > const & xAttributes )
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- if (_pImport->XMLNS_DIALOGS_UID != nUid)
+ if (m_xImport->XMLNS_DIALOGS_UID != nUid)
{
throw xml::sax::SAXException( "illegal namespace!", Reference< XInterface >(), Any() );
}
// style
else if ( rLocalName == "style" )
{
- return new StyleElement( rLocalName, xAttributes, this, _pImport );
+ return new StyleElement( rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -1880,23 +1880,23 @@ Reference< xml::input::XElement > WindowElement::startChildElement(
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
// event
- if (_pImport->isEventElement( nUid, rLocalName ))
+ if (m_xImport->isEventElement( nUid, rLocalName ))
{
- return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
}
- else if (_pImport->XMLNS_DIALOGS_UID != nUid)
+ else if (m_xImport->XMLNS_DIALOGS_UID != nUid)
{
throw xml::sax::SAXException( "illegal namespace!", Reference< XInterface >(), Any() );
}
// styles
else if ( rLocalName == "styles" )
{
- return new StylesElement( rLocalName, xAttributes, this, _pImport );
+ return new StylesElement( rLocalName, xAttributes, this, m_xImport.get() );
}
// bulletinboard
else if ( rLocalName == "bulletinboard" )
{
- return new BulletinBoardElement( rLocalName, xAttributes, this, _pImport );
+ return new BulletinBoardElement( rLocalName, xAttributes, this, m_xImport.get() );
}
else
{
@@ -1908,8 +1908,8 @@ void WindowElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
Reference< beans::XPropertySet > xProps(
- _pImport->_xDialogModel, UNO_QUERY_THROW );
- ImportContext ctx( _pImport, xProps, getControlId( _xAttributes ) );
+ m_xImport->_xDialogModel, UNO_QUERY_THROW );
+ ImportContext ctx( m_xImport.get(), xProps, getControlId( _xAttributes ) );
Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
if (xStyle.is())
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index 88664d91ea36..faa8f733e878 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -69,7 +69,7 @@ namespace xmlscript
void EventElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
- static_cast< ControlElement * >( _pParent )->_events.push_back( this );
+ static_cast< ControlElement * >( m_xParent.get() )->_events.push_back( this );
}
ControlElement::ControlElement(
@@ -79,11 +79,11 @@ ControlElement::ControlElement(
: ElementBase(
pImport->XMLNS_DIALOGS_UID, rLocalName, xAttributes, pParent, pImport )
{
- if (_pParent)
+ if (m_xParent.is())
{
// inherit position
- _nBasePosX = static_cast< ControlElement * >( _pParent )->_nBasePosX;
- _nBasePosY = static_cast< ControlElement * >( _pParent )->_nBasePosY;
+ _nBasePosX = static_cast< ControlElement * >( m_xParent.get() )->_nBasePosX;
+ _nBasePosY = static_cast< ControlElement * >( m_xParent.get() )->_nBasePosY;
}
else
{
@@ -95,10 +95,10 @@ ControlElement::ControlElement(
Reference< xml::input::XElement > ControlElement::getStyle(
Reference< xml::input::XAttributes > const & xAttributes )
{
- OUString aStyleId( xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID,"style-id" ) );
+ OUString aStyleId( xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID,"style-id" ) );
if (!aStyleId.isEmpty())
{
- return _pImport->getStyle( aStyleId );
+ return m_xImport->getStyle( aStyleId );
}
return Reference< xml::input::XElement >();
}
@@ -106,7 +106,7 @@ Reference< xml::input::XElement > ControlElement::getStyle(
OUString ControlElement::getControlId(
Reference< xml::input::XAttributes > const & xAttributes )
{
- OUString aId( xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, "id" ) );
+ OUString aId( xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID, "id" ) );
if (aId.isEmpty())
{
throw xml::sax::SAXException( "missing id attribute!", Reference< XInterface >(), Any() );
@@ -119,7 +119,7 @@ OUString ControlElement::getControlModelName(
Reference< xml::input::XAttributes > const & xAttributes )
{
OUString aModel;
- aModel = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, "control-implementation");
+ aModel = xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID, "control-implementation");
if (aModel.isEmpty())
aModel = rDefaultModel;
return aModel;
@@ -138,7 +138,7 @@ void StyleElement::importTextColorStyle(
}
_inited |= 0x2;
- if (getLongAttr( &_textColor, "text-color", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getLongAttr( &_textColor, "text-color", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_hasValue |= 0x2;
xProps->setPropertyValue( "TextColor", makeAny( _textColor ) );
@@ -159,7 +159,7 @@ void StyleElement::importTextLineColorStyle(
}
_inited |= 0x20;
- if (getLongAttr( &_textLineColor, "textline-color", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getLongAttr( &_textLineColor, "textline-color", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_hasValue |= 0x20;
xProps->setPropertyValue( "TextLineColor", makeAny( _textLineColor ) );
@@ -179,7 +179,7 @@ void StyleElement::importFillColorStyle(
}
_inited |= 0x10;
- if (getLongAttr( &_fillColor, "fill-color", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getLongAttr( &_fillColor, "fill-color", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_hasValue |= 0x10;
xProps->setPropertyValue( "FillColor", makeAny( _fillColor ) );
@@ -199,7 +199,7 @@ void StyleElement::importBackgroundColorStyle(
}
_inited |= 0x1;
- if (getLongAttr( &_backgroundColor, "background-color", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getLongAttr( &_backgroundColor, "background-color", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_hasValue |= 0x1;
xProps->setPropertyValue( "BackgroundColor", makeAny( _backgroundColor ) );
@@ -222,7 +222,7 @@ void StyleElement::importBorderStyle(
_inited |= 0x4;
OUString aValue;
- if (getStringAttr(&aValue, "border", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr(&aValue, "border", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "none" )
_border = BORDER_NONE;
@@ -254,7 +254,7 @@ void StyleElement::importVisualEffectStyle(
_inited |= 0x40;
OUString aValue;
- if (getStringAttr( &aValue, "look", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "look", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "none" )
{
@@ -301,25 +301,25 @@ void StyleElement::importFontStyle(
bool bFontImport;
// dialog:font-name CDATA #IMPLIED
- bFontImport = getStringAttr( &_descr.Name, "font-name", _xAttributes, _pImport->XMLNS_DIALOGS_UID );
+ bFontImport = getStringAttr( &_descr.Name, "font-name", _xAttributes, m_xImport->XMLNS_DIALOGS_UID );
// dialog:font-height %numeric; #IMPLIED
- if (getStringAttr( &aValue, "font-height", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "font-height", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_descr.Height = (sal_Int16)toInt32( aValue );
bFontImport = true;
}
// dialog:font-width %numeric; #IMPLIED
- if (getStringAttr(&aValue, "font-width", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr(&aValue, "font-width", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_descr.Width = (sal_Int16)toInt32( aValue );
bFontImport = true;
}
// dialog:font-stylename CDATA #IMPLIED
- bFontImport |= getStringAttr( &_descr.StyleName, "font-stylename", _xAttributes, _pImport->XMLNS_DIALOGS_UID );
+ bFontImport |= getStringAttr( &_descr.StyleName, "font-stylename", _xAttributes, m_xImport->XMLNS_DIALOGS_UID );
// dialog:font-family "(decorative|modern|roman|script|swiss|system)" #IMPLIED
- if (getStringAttr(&aValue, "font-family", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr(&aValue, "font-family", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "decorative" )
{
@@ -353,7 +353,7 @@ void StyleElement::importFontStyle(
}
// dialog:font-charset "(ansi|mac|ibmpc_437|ibmpc_850|ibmpc_860|ibmpc_861|ibmpc_863|ibmpc_865|system|symbol)" #IMPLIED
- if (getStringAttr(&aValue, "font-charset", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr(&aValue, "font-charset", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "ansi" )
{
@@ -403,7 +403,7 @@ void StyleElement::importFontStyle(
}
// dialog:font-pitch "(fixed|variable)" #IMPLIED
- if (getStringAttr( &aValue, "font-pitch", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "font-pitch", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "fixed" )
{
@@ -421,20 +421,20 @@ void StyleElement::importFontStyle(
}
// dialog:font-charwidth CDATA #IMPLIED
- if (getStringAttr( &aValue, "font-charwidth", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "font-charwidth", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_descr.CharacterWidth = aValue.toFloat();
bFontImport = true;
}
// dialog:font-weight CDATA #IMPLIED
- if (getStringAttr( &aValue, "font-weight", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "font-weight", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_descr.Weight = aValue.toFloat();
bFontImport = true;
}
// dialog:font-slant "(oblique|italic|reverse_oblique|reverse_italic)" #IMPLIED
- if (getStringAttr( &aValue, "font-slant", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "font-slant", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "oblique" )
{
@@ -460,7 +460,7 @@ void StyleElement::importFontStyle(
}
// dialog:font-underline "(single|double|dotted|dash|longdash|dashdot|dashdotdot|smallwave|wave|doublewave|bold|bolddotted|bolddash|boldlongdash|bolddashdot|bolddashdotdot|boldwave)" #IMPLIED
- if (getStringAttr( &aValue, "font-underline", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "font-underline", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "single" )
{
@@ -538,7 +538,7 @@ void StyleElement::importFontStyle(
}
// dialog:font-strikeout "(single|double|bold|slash|x)" #IMPLIED
- if (getStringAttr( &aValue, "font-strikeout", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "font-strikeout", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "single" )
{
@@ -568,18 +568,18 @@ void StyleElement::importFontStyle(
}
// dialog:font-orientation CDATA #IMPLIED
- if (getStringAttr( &aValue, "font-orientation", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "font-orientation", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_descr.Orientation = aValue.toFloat();
bFontImport = true;
}
// dialog:font-kerning %boolean; #IMPLIED
- bFontImport |= getBoolAttr( &_descr.Kerning, "font-kerning", _xAttributes, _pImport->XMLNS_DIALOGS_UID );
+ bFontImport |= getBoolAttr( &_descr.Kerning, "font-kerning", _xAttributes, m_xImport->XMLNS_DIALOGS_UID );
// dialog:font-wordlinemode %boolean; #IMPLIED
- bFontImport |= getBoolAttr( &_descr.WordLineMode,"font-wordlinemode", _xAttributes, _pImport->XMLNS_DIALOGS_UID );
+ bFontImport |= getBoolAttr( &_descr.WordLineMode,"font-wordlinemode", _xAttributes, m_xImport->XMLNS_DIALOGS_UID );
// dialog:font-type "(raster|device|scalable)" #IMPLIED
- if (getStringAttr( &aValue, "font-type", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "font-type", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "raster" )
{
@@ -602,7 +602,7 @@ void StyleElement::importFontStyle(
// additional properties which are not part of the FontDescriptor struct
// dialog:font-relief (none|embossed|engraved) #IMPLIED
- if (getStringAttr( &aValue, "font-relief", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr( &aValue, "font-relief", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "none" )
{
@@ -623,7 +623,7 @@ void StyleElement::importFontStyle(
bFontImport = true;
}
// dialog:font-emphasismark (none|dot|circle|disc|accent|above|below) #IMPLIED
- if (getStringAttr(&aValue, "font-emphasismark", _xAttributes, _pImport->XMLNS_DIALOGS_UID ))
+ if (getStringAttr(&aValue, "font-emphasismark", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
if ( aValue == "none" )
{
@@ -1616,7 +1616,7 @@ void ImportContext::importDefaults(
Reference< xml::input::XElement > ElementBase::getParent()
throw (RuntimeException, std::exception)
{
- return static_cast< xml::input::XElement * >( _pParent );
+ return static_cast< xml::input::XElement * >( m_xParent.get() );
}
OUString ElementBase::getLocalName()
@@ -1673,29 +1673,16 @@ ElementBase::ElementBase(
sal_Int32 nUid, OUString const & rLocalName,
Reference< xml::input::XAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
- : _pImport( pImport )
- , _pParent( pParent )
+ : m_xImport( pImport )
+ , m_xParent( pParent )
, _nUid( nUid )
, _aLocalName( rLocalName )
, _xAttributes( xAttributes )
{
- _pImport->acquire();
-
- if (_pParent)
- {
- _pParent->acquire();
- }
}
ElementBase::~ElementBase()
{
- _pImport->release();
-
- if (_pParent)
- {
- _pParent->release();
- }
-
SAL_INFO("xmlscript.xmldlg", "ElementBase::~ElementBase(): " << _aLocalName );
}