[Libreoffice-commits] .: sw/source
Noel Power
noelp at kemper.freedesktop.org
Tue Mar 1 04:39:56 PST 2011
sw/source/filter/ww8/docxattributeoutput.cxx | 13 ++++---------
sw/source/filter/ww8/ww8par3.cxx | 5 -----
2 files changed, 4 insertions(+), 14 deletions(-)
New commits:
commit d18d58c7bf533ebf4c7f8dd337303e14d98e3dc7
Author: Noel Power <noel.power at novell.com>
Date: Tue Mar 1 12:30:23 2011 +0000
partial revert of 803409125f4ed896b391acb99266d50691c6fd4a
remove currently unnecessary ( but possibly future ) odf attributes for form field controls to prevent those attributes from being written to odf
Please enter the commit message for your changes. Lines starting
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index a80d257..f0a6eee 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -213,6 +213,7 @@ class FieldMarkParamsHelper
const sw::mark::IFieldmark& mrFieldmark;
public:
FieldMarkParamsHelper( const sw::mark::IFieldmark& rFieldmark ) : mrFieldmark( rFieldmark ) {}
+ rtl::OUString getName() { return mrFieldmark.GetName(); }
template < typename T >
bool extractParam( const rtl::OUString& rKey, T& rResult )
{
@@ -633,9 +634,8 @@ void DocxAttributeOutput::WriteFFData( const FieldInfos& rInfos )
rtl::OUString sName, sHelp, sToolTip, sSelected;
FieldMarkParamsHelper params( rFieldmark );
- params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_NAME) ), sName );
params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_LISTENTRY) ), vListEntries );
-
+ sName = params.getName();
sal_Int32 nSelectedIndex = 0;
if ( params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_RESULT) ), nSelectedIndex ) )
@@ -653,24 +653,19 @@ void DocxAttributeOutput::WriteFFData( const FieldInfos& rInfos )
FieldMarkParamsHelper params( rFieldmark );
params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMCHECKBOX_NAME ) ), sName );
- params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMCHECKBOX_DEFAULT ) ), sDefault );
const sw::mark::ICheckboxFieldmark* pCheckboxFm = dynamic_cast<const sw::mark::ICheckboxFieldmark*>(&rFieldmark);
if ( pCheckboxFm && pCheckboxFm->IsChecked() )
bChecked = true;
FFDataWriterHelper ffdataOut( m_pSerializer );
- ffdataOut.WriteFormCheckbox( sName, sDefault, bChecked );
+ ffdataOut.WriteFormCheckbox( sName, rtl::OUString(), bChecked );
}
else if ( rInfos.eType == ww::eFORMTEXT )
{
- rtl::OUString sName, sDefault;
FieldMarkParamsHelper params( rFieldmark );
- params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMTEXT_NAME ) ), sName );
- params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMTEXT_DEFAULT ) ), sDefault );
-
FFDataWriterHelper ffdataOut( m_pSerializer );
- ffdataOut.WriteFormText( sName, sDefault );
+ ffdataOut.WriteFormText( params.getName(), rtl::OUString() );
}
}
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 98ca608..d6e6b84 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -174,8 +174,6 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, String& rStr )
maFieldStack.back().SetBookmarkType(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT)));
maFieldStack.back().getParameters()[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Description"))] = uno::makeAny(::rtl::OUString(aFormula.sToolTip));
maFieldStack.back().getParameters()[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"))] = uno::makeAny(::rtl::OUString(aFormula.sTitle));
- if ( aFormula.sDefault.Len() )
- maFieldStack.back().getParameters()[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT_DEFAULT))] = uno::makeAny(::rtl::OUString(aFormula.sDefault));
}
return FLD_TEXT;
}
@@ -230,8 +228,6 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr )
ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(pFieldmark);
(*pParameters)[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_NAME))] = uno::makeAny(::rtl::OUString(aFormula.sTitle));
(*pParameters)[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_HELPTEXT))] = uno::makeAny(::rtl::OUString(aFormula.sToolTip));
- if ( aFormula.sDefault.Len() )
- (*pParameters)[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_DEFAULT))] = uno::makeAny(::rtl::OUString(aFormula.sDefault));
if(pCheckboxFm)
pCheckboxFm->SetChecked(aFormula.nChecked);
@@ -306,7 +302,6 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, String& rStr)
uno::Sequence< ::rtl::OUString > vListEntries(aFormula.maListEntries.size());
::std::copy(aFormula.maListEntries.begin(), aFormula.maListEntries.end(), ::comphelper::stl_begin(vListEntries));
(*pFieldmark->GetParameters())[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_LISTENTRY))] = uno::makeAny(vListEntries);
- (*pFieldmark->GetParameters())[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_NAME))] = uno::makeAny(rtl::OUString( aFormula.sTitle ));
sal_Int32 nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size() ? aFormula.fDropdownIndex : 0;
(*pFieldmark->GetParameters())[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_RESULT))] = uno::makeAny(nIndex);
// set field data here...
More information about the Libreoffice-commits
mailing list