[Libreoffice-commits] .: writerfilter/source
Noel Power
noelp at kemper.freedesktop.org
Tue Mar 1 04:39:37 PST 2011
writerfilter/source/dmapper/FormControlHelper.cxx | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
New commits:
commit cb73e0dc84e608df05016492883f187f732f6e0d
Author: Noel Power <noel.power at novell.com>
Date: Tue Mar 1 11:38:00 2011 +0000
remove references to ODF_FORMCHECKBOX_DEFAULT & ODF_FORMTEXT_DEFAULT
remove currently unnecessary ( but possibly future ) odf attributes for form field controls
diff --git a/writerfilter/source/dmapper/FormControlHelper.cxx b/writerfilter/source/dmapper/FormControlHelper.cxx
index 8d66e41..d26fae4 100644
--- a/writerfilter/source/dmapper/FormControlHelper.cxx
+++ b/writerfilter/source/dmapper/FormControlHelper.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
@@ -225,25 +226,16 @@ bool FormControlHelper::processField(uno::Reference<text::XFormField> xFormField
{
bool bRes = true;
uno::Reference<container::XNameContainer> xNameCont = xFormField->getParameters();
- if ( m_pFFData && xNameCont.is() )
+ uno::Reference<container::XNamed> xNamed( xFormField, uno::UNO_QUERY );
+ if ( m_pFFData && xNamed.is() && xNameCont.is() )
{
if (m_pImpl->m_eFieldId == FIELD_FORMTEXT )
{
xFormField->setFieldType( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT)));
- if ( m_pFFData->getName().getLength() )
- {
- if ( xNameCont->hasByName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT_NAME)) ) )
- xNameCont->replaceByName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT_NAME)), uno::makeAny( m_pFFData->getName() ) );
- else
- xNameCont->insertByName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT_NAME)), uno::makeAny( m_pFFData->getName() ) );
- }
if ( m_pFFData->getTextDefault().getLength() )
{
- if ( xNameCont->hasByName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT_DEFAULT)) ) )
- xNameCont->replaceByName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT_DEFAULT)), uno::makeAny( m_pFFData->getTextDefault() ) );
- else
- xNameCont->insertByName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT_DEFAULT)), uno::makeAny( m_pFFData->getTextDefault() ) );
+ xNamed->setName( m_pFFData->getName() );
}
}
else if (m_pImpl->m_eFieldId == FIELD_FORMCHECKBOX )
More information about the Libreoffice-commits
mailing list