diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-06-25 13:16:02 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-06-25 13:16:02 +0000 |
commit | 9f3ba836771070493940a732298d7d4a5ee7e549 (patch) | |
tree | d41037e58ac80c2aa04683b33ba96b0e2844e3f6 /xmloff/source/core | |
parent | d130081857c58b913cd451577219ffee31e720ba (diff) |
INTEGRATION: CWS xformsdocmodify (1.140.2); FILE MERGED
2008/06/04 12:07:17 fs 1.140.2.2: #i90243# don't obtain view/config settings in GetDocumentSpecificSettings, this somehow contradicts the semantics of this (nealy introduced) method
2008/06/03 20:50:24 fs 1.140.2.1: #i90243# allow exporting document-specifc settings, which are neither view nor configuration settings
Diffstat (limited to 'xmloff/source/core')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 74 |
1 files changed, 36 insertions, 38 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index d9959a4ee285..e74a99879a42 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: xmlexp.cxx,v $ - * $Revision: 1.140 $ + * $Revision: 1.141 $ * * This file is part of OpenOffice.org. * @@ -961,22 +961,42 @@ void SvXMLExport::ImplExportSettings() { CheckAttrList(); - uno::Sequence<beans::PropertyValue> aViewProps; - GetViewSettingsAndViews(aViewProps); + ::std::list< SettingsGroup > aSettings; + sal_Int32 nSettingsCount = 0; - uno::Sequence<beans::PropertyValue> aConfigProps; - GetConfigurationSettings(aConfigProps); + // view settings + uno::Sequence< beans::PropertyValue > aViewSettings; + GetViewSettingsAndViews( aViewSettings ); + aSettings.push_back( SettingsGroup( XML_VIEW_SETTINGS, aViewSettings ) ); + nSettingsCount += aViewSettings.getLength(); + + // configuration settings + uno::Sequence<beans::PropertyValue> aConfigSettings; + GetConfigurationSettings( aConfigSettings ); + aSettings.push_back( SettingsGroup( XML_CONFIGURATION_SETTINGS, aConfigSettings ) ); + nSettingsCount += aConfigSettings.getLength(); + + // any document specific settings + nSettingsCount += GetDocumentSpecificSettings( aSettings ); { SvXMLElementExport aElem( *this, - aViewProps.getLength() || aConfigProps.getLength(), + nSettingsCount != 0, XML_NAMESPACE_OFFICE, XML_SETTINGS, sal_True, sal_True ); XMLSettingsExportHelper aSettingsExportHelper(*this); - if( aViewProps.getLength() ) - _ExportViewSettings2(aSettingsExportHelper, aViewProps ); - if( aConfigProps.getLength() ) - _ExportConfigurationSettings2(aSettingsExportHelper, aConfigProps ); + + for ( ::std::list< SettingsGroup >::const_iterator settings = aSettings.begin(); + settings != aSettings.end(); + ++settings + ) + { + if ( !settings->aSettings.getLength() ) + continue; + + OUString sSettingsName( GetXMLToken( settings->eGroupName ) ); + aSettingsExportHelper.exportSettings( settings->aSettings, sSettingsName ); + } } } @@ -1369,34 +1389,6 @@ void SvXMLExport::_ExportMeta() } } -void SvXMLExport::_ExportViewSettings(const XMLSettingsExportHelper& rSettingsExportHelper ) -{ - uno::Sequence<beans::PropertyValue> aViewProps; - GetViewSettingsAndViews(aViewProps); - if( aViewProps.getLength() ) - _ExportViewSettings2(rSettingsExportHelper, aViewProps ); -} - -void SvXMLExport::_ExportViewSettings2(const XMLSettingsExportHelper& rSettingsExportHelper, uno::Sequence<beans::PropertyValue>& rProps ) -{ - OUString sViewSettings(GetXMLToken(XML_VIEW_SETTINGS)); - rSettingsExportHelper.exportSettings(rProps, sViewSettings); -} - -void SvXMLExport::_ExportConfigurationSettings(const XMLSettingsExportHelper& rSettingsExportHelper ) -{ - uno::Sequence<beans::PropertyValue> aConfigProps; - GetConfigurationSettings(aConfigProps); - if( aConfigProps.getLength() ) - _ExportConfigurationSettings2(rSettingsExportHelper, aConfigProps ); -} - -void SvXMLExport::_ExportConfigurationSettings2(const XMLSettingsExportHelper& rSettingsExportHelper, uno::Sequence<beans::PropertyValue>& rProps ) -{ - OUString sConfigurationSettings(GetXMLToken(XML_CONFIGURATION_SETTINGS)); - rSettingsExportHelper.exportSettings(rProps, sConfigurationSettings); -} - void SvXMLExport::_ExportScripts() { SvXMLElementExport aElement( *this, XML_NAMESPACE_OFFICE, XML_SCRIPTS, sal_True, sal_True ); @@ -1734,6 +1726,12 @@ void SvXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>&) { } +sal_Int32 SvXMLExport::GetDocumentSpecificSettings( ::std::list< SettingsGroup >& _out_rSettings ) +{ + (void)_out_rSettings; + return 0; +} + void SvXMLExport::addDataStyle(const sal_Int32 nNumberFormat, sal_Bool /*bTimeFormat*/ ) { if(mpNumExport) |