diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 64 |
1 files changed, 26 insertions, 38 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 0c5773b8cdbd..94e145412a34 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1540,55 +1540,43 @@ void SvXMLExport::_ExportFontDecls() mxFontAutoStylePool->exportXML(); } -void lcl_ExportGradientStyle(SvXMLExport& rExport, uno::Reference< lang::XMultiServiceFactory > xFact, OUString aServiceName, std::vector<OUString>& rGradientNames) +void SvXMLExport::_ExportStyles( sal_Bool ) { - try + uno::Reference< lang::XMultiServiceFactory > xFact( GetModel(), uno::UNO_QUERY ); + if( xFact.is()) { - uno::Reference< container::XNameAccess > xGradient( xFact->createInstance( aServiceName ), uno::UNO_QUERY ); - if( xGradient.is() ) + // export (fill-)gradient-styles + try { - XMLGradientStyleExport aGradientStyle( rExport ); - - if( xGradient->hasElements() ) + uno::Reference< container::XNameAccess > xGradient( xFact->createInstance( OUString("com.sun.star.drawing.GradientTable" ) ), uno::UNO_QUERY ); + if( xGradient.is() ) { - uno::Sequence< OUString > aNamesSeq ( xGradient->getElementNames() ); - sal_Int32 nCount = aNamesSeq.getLength(); - for( sal_Int32 i=0; i<nCount; i++ ) - { - const OUString& rStrName = aNamesSeq[ i ]; - - // Avoid duplicated style names. - if (std::find(rGradientNames.begin(), rGradientNames.end(), rStrName) != rGradientNames.end()) - continue; + XMLGradientStyleExport aGradientStyle( *this ); - try + if( xGradient->hasElements() ) + { + uno::Sequence< OUString > aNamesSeq ( xGradient->getElementNames() ); + sal_Int32 nCount = aNamesSeq.getLength(); + for( sal_Int32 i=0; i<nCount; i++ ) { - uno::Any aValue = xGradient->getByName( rStrName ); + const OUString& rStrName = aNamesSeq[ i ]; - aGradientStyle.exportXML( rStrName, aValue ); - rGradientNames.push_back(rStrName); - } - catch(const container::NoSuchElementException&) - { + try + { + uno::Any aValue = xGradient->getByName( rStrName ); + + aGradientStyle.exportXML( rStrName, aValue ); + } + catch(const container::NoSuchElementException&) + { + } } } } } - } - catch(const lang::ServiceNotRegisteredException&) - { - } -} - -void SvXMLExport::_ExportStyles( sal_Bool ) -{ - uno::Reference< lang::XMultiServiceFactory > xFact( GetModel(), uno::UNO_QUERY ); - if( xFact.is()) - { - // export (fill-)gradient-styles - std::vector<OUString> aGradientNames; - lcl_ExportGradientStyle(*this, xFact, "com.sun.star.drawing.GradientTable", aGradientNames); - lcl_ExportGradientStyle(*this, xFact, "com.sun.star.text.GradientTable", aGradientNames); + catch(const lang::ServiceNotRegisteredException&) + { + } // export (fill-)hatch-styles try |