diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2013-12-04 10:17:14 +0100 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2013-12-04 18:52:03 +0100 |
commit | 983002475fba1879fd00c75417342be55153b797 (patch) | |
tree | 1ee00cebc88b45b7a8f49244a65745f8a087083a /writerfilter | |
parent | 458b89b303145085a1745fe408f0e860686d7220 (diff) |
fdo#64232: Save font theme attributes in rPrDefault
The default values for run properties are stored in the styles.xml
file, in the <w:rPrDefault> tag. The process of this tag is slightly
different from normal <rPr> tags.
First, we fix DocxAttributeOutput::OutputDefaultItem to be able to
output the contents of the character grab bag.
Second, we fix StyleSheetTable::applyDefaults to read the property
values using the GetPropertyValue method instead of using an iterator
directly, because the former creates the grab bags and returns them
as properties while the latter returns all the properties individually,
including those that should be inside a grab bag.
Change-Id: I91254ba20fd9ca5a1b02afb587f52a449a215d6c
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index ec7816323b12..666e10af60a9 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -1525,15 +1525,14 @@ void StyleSheetTable::applyDefaults(bool bParaProperties) m_pImpl->m_rDMapper.GetTextFactory()->createInstance("com.sun.star.text.Defaults"), uno::UNO_QUERY_THROW ); } - PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier(); if( bParaProperties && m_pImpl->m_pDefaultParaProps.get() && m_pImpl->m_pDefaultParaProps->size()) { - PropertyMap::iterator aMapIter = m_pImpl->m_pDefaultParaProps->begin(); - for( ; aMapIter != m_pImpl->m_pDefaultParaProps->end(); ++aMapIter ) + uno::Sequence< beans::PropertyValue > aPropValues = m_pImpl->m_pDefaultParaProps->GetPropertyValues(); + for( sal_Int32 i = 0; i < aPropValues.getLength(); ++i ) { try { - m_pImpl->m_xTextDefaults->setPropertyValue(rPropNameSupplier.GetName( aMapIter->first ), aMapIter->second.getValue()); + m_pImpl->m_xTextDefaults->setPropertyValue( aPropValues[i].Name, aPropValues[i].Value ); } catch( const uno::Exception& ) { @@ -1543,12 +1542,12 @@ void StyleSheetTable::applyDefaults(bool bParaProperties) } if( !bParaProperties && m_pImpl->m_pDefaultCharProps.get() && m_pImpl->m_pDefaultCharProps->size()) { - PropertyMap::iterator aMapIter = m_pImpl->m_pDefaultCharProps->begin(); - for( ; aMapIter != m_pImpl->m_pDefaultCharProps->end(); ++aMapIter ) + uno::Sequence< beans::PropertyValue > aPropValues = m_pImpl->m_pDefaultCharProps->GetPropertyValues(); + for( sal_Int32 i = 0; i < aPropValues.getLength(); ++i ) { try { - m_pImpl->m_xTextDefaults->setPropertyValue(rPropNameSupplier.GetName( aMapIter->first ), aMapIter->second.getValue()); + m_pImpl->m_xTextDefaults->setPropertyValue( aPropValues[i].Name, aPropValues[i].Value ); } catch( const uno::Exception& ) { |