offapi/com/sun/star/style/CharacterProperties.idl | 11 ++ sw/inc/hintids.hxx | 2 sw/inc/unoprnms.hxx | 1 sw/qa/extras/ooxmlexport/data/theme-preservation.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 20 ++++ sw/source/core/bastyp/init.cxx | 5 - sw/source/core/unocore/unomap.cxx | 3 sw/source/core/unocore/unoprnms.cxx | 1 sw/source/filter/ww8/attributeoutputbase.hxx | 3 sw/source/filter/ww8/docxattributeoutput.cxx | 86 ++++++++++++++++++ sw/source/filter/ww8/docxattributeoutput.hxx | 3 sw/source/filter/ww8/rtfattributeoutput.cxx | 4 sw/source/filter/ww8/rtfattributeoutput.hxx | 3 sw/source/filter/ww8/wrtw8nds.cxx | 6 + sw/source/filter/ww8/ww8atr.cxx | 7 + sw/source/filter/ww8/ww8attributeoutput.hxx | 3 writerfilter/source/dmapper/DomainMapper.cxx | 29 ++++-- writerfilter/source/dmapper/PropertyIds.cxx | 8 + writerfilter/source/dmapper/PropertyIds.hxx | 8 + writerfilter/source/dmapper/PropertyMap.cxx | 59 ++++++++---- writerfilter/source/dmapper/PropertyMap.hxx | 22 +++- writerfilter/source/dmapper/StyleSheetTable.cxx | 13 +- 22 files changed, 254 insertions(+), 43 deletions(-)
New commits: commit 13ce74fd9b5f7b9ea9d3dab34eed27a63aae5468 Author: Jacobo Aragunde Pérez <jaragu...@igalia.com> Date: Wed Dec 4 14:23:21 2013 +0100 fdo#64232: Unit test for font theme attributes preservation The unit test checks three cases: * attributes in run properties * attributes in default run properties * attributes in style definitions Change-Id: Ie3224f41bd29e8b258dbd6823b7c9549e1ef5b1e diff --git a/sw/qa/extras/ooxmlexport/data/theme-preservation.docx b/sw/qa/extras/ooxmlexport/data/theme-preservation.docx new file mode 100644 index 0000000..c1d879a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/theme-preservation.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 084968c..ab264fd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2040,6 +2040,26 @@ DECLARE_OOXMLEXPORT_TEST(testMce, "mce.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(0x9bbb59), getProperty<sal_Int32>(getShape(1), "FillColor")); } +DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx") +{ + // check default font theme values have been preserved + xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "asciiTheme", "minorHAnsi"); + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "eastAsiaTheme", "minorEastAsia"); + + // check the font theme values in style definitions + assertXPath(pXmlStyles, "/w:styles/w:style[1]/w:rPr/w:rFonts", "eastAsiaTheme", "minorEastAsia"); + + // check direct format font theme values have been preserved + xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts", "hAnsiTheme", "majorBidi"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts", "cstheme", "majorBidi"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); commit 983002475fba1879fd00c75417342be55153b797 Author: Jacobo Aragunde Pérez <jaragu...@igalia.com> Date: Wed Dec 4 10:17:14 2013 +0100 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 diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index c8b4b9b..6e9cf53 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2634,6 +2634,9 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt) case RES_PARATR_SNAPTOGRID: bMustWrite = !static_cast< const SvxParaGridItem& >(rHt).GetValue(); break; + case RES_CHRATR_GRABBAG: + bMustWrite = true; + break; default: SAL_INFO("sw.ww8", "Unhandled SfxPoolItem with id " << rHt.Which() ); diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index ec78163..666e10a 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& ) { commit 458b89b303145085a1745fe408f0e860686d7220 Author: Jacobo Aragunde Pérez <jaragu...@igalia.com> Date: Fri Nov 29 11:01:21 2013 +0100 fdo#64232: Fix and preserve eastAsiaTheme attribute The attribute eastAsiaTheme was not being processed properly (the derived theme font was being assigned to complex-script instead of eastAsia), so this patch fixes that and it also preserves the value of the theme itself. Change-Id: I1a91ab2080eb2bc79f41fda9ae4bf7afb05f69a3 diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 3cb24ae..c8b4b9b 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6242,6 +6242,7 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem ) // get original font names and check if they have changed during the edition sal_Bool bWriteCSTheme = sal_True; sal_Bool bWriteAsciiTheme = sal_True; + sal_Bool bWriteEastAsiaTheme = sal_True; if ( m_pFontsAttrList ) { OUString sFontName; @@ -6259,6 +6260,12 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem ) bWriteAsciiTheme = ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_ascii ) ) == sFontName ); } + else if ( i->first == "CharThemeFontNameEastAsia" ) + { + if ( i->second >>= sFontName ) + bWriteEastAsiaTheme = + ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_eastAsia ) ) == sFontName ); + } } } @@ -6282,6 +6289,14 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem ) m_pFontsAttrList->add( FSNS( XML_w, XML_cstheme ), OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); } + else if ( i->first == "CharThemeNameEastAsia" && bWriteEastAsiaTheme ) + { + i->second >>= str; + if (!m_pFontsAttrList) + m_pFontsAttrList = m_pSerializer->createAttrList(); + m_pFontsAttrList->add( FSNS( XML_w, XML_eastAsiaTheme ), + OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); + } else if ( i->first == "CharThemeNameHAnsi" && bWriteAsciiTheme ) // this is not a mistake: in LibO we don't directly support the hAnsi family // of attributes so we save the same value from ascii attributes instead @@ -6293,7 +6308,8 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem ) OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); } else if( i->first == "CharThemeFontNameCs" || - i->first == "CharThemeFontNameAscii" ) + i->first == "CharThemeFontNameAscii" || + i->first == "CharThemeFontNameEastAsia" ) { // just skip these, they were processed before } diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 7b9cdbb..306ef9c 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -972,7 +972,12 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_Fonts_eastAsiaTheme: m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "eastAsiaTheme", ThemeTable::getStringForTheme(nIntValue)); if (m_pImpl->GetTopContext()) - m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ) ); + { + uno::Any aPropValue = uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme( nIntValue ) ); + m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_ASIAN, aPropValue ); + m_pImpl->GetTopContext()->Insert(PROP_CHAR_THEME_FONT_NAME_EAST_ASIA, aPropValue, true, CHAR_GRAB_BAG ); + m_pImpl->GetTopContext()->Insert(PROP_CHAR_THEME_NAME_EAST_ASIA, uno::makeAny( ThemeTable::getStringForTheme(nIntValue) ), true, CHAR_GRAB_BAG); + } break; case NS_ooxml::LN_CT_Fonts_cs: if (m_pImpl->GetTopContext()) diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index 3e07b70..94568ae 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -348,9 +348,11 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_CHAR_THEME_NAME_ASCII : sName = "CharThemeNameAscii"; break; case PROP_CHAR_THEME_NAME_CS : sName = "CharThemeNameCs"; break; case PROP_CHAR_THEME_NAME_H_ANSI : sName = "CharThemeNameHAnsi"; break; + case PROP_CHAR_THEME_NAME_EAST_ASIA : sName = "CharThemeNameEastAsia"; break; case PROP_CHAR_THEME_FONT_NAME_ASCII : sName = "CharThemeFontNameAscii"; break; case PROP_CHAR_THEME_FONT_NAME_CS : sName = "CharThemeFontNameCs"; break; case PROP_CHAR_THEME_FONT_NAME_H_ANSI : sName = "CharThemeFontNameHAnsi"; break; + case PROP_CHAR_THEME_FONT_NAME_EAST_ASIA: sName = "CharThemeFontNameEastAsia"; break; } ::std::pair<PropertyNameMap_t::iterator,bool> aInsertIt = m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName )); diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index 9d6a7ff..cb6eff0 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -319,9 +319,11 @@ enum PropertyIds ,PROP_CHAR_THEME_NAME_ASCII ,PROP_CHAR_THEME_NAME_CS ,PROP_CHAR_THEME_NAME_H_ANSI + ,PROP_CHAR_THEME_NAME_EAST_ASIA ,PROP_CHAR_THEME_FONT_NAME_ASCII ,PROP_CHAR_THEME_FONT_NAME_CS ,PROP_CHAR_THEME_FONT_NAME_H_ANSI + ,PROP_CHAR_THEME_FONT_NAME_EAST_ASIA }; struct PropertyNameSupplier_Impl; class PropertyNameSupplier commit 9e47df8fd7c3cb1dcf556e009cec2d37b928d9b0 Author: Jacobo Aragunde Pérez <jaragu...@igalia.com> Date: Wed Nov 27 12:40:59 2013 +0100 fdo#64232: Save font theme attributes back to the docx Font theme attributes were saved to an InteropGrabBag on import, and they have to be saved back to the document when exporting to docx. If the user modified the font in a text fragment during edition, the theme attribute should be discarded in favour of the font attribute. The attributes in the grab bag are processed in the last place so we can compare the font attributes with the original fonts to know if they have changed. Change-Id: I2502b4aa96213e74b46fccd1a20f99421f7cf98b diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index f37ebff..8060368 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -588,6 +588,9 @@ protected: /// Sfx item RES_PARATR_GRABBAG virtual void ParaGrabBag( const SfxGrabBagItem& ) = 0; + /// Sfx item RES_CHRATR_GRABBAG + virtual void CharGrabBag( const SfxGrabBagItem& ) = 0; + /// Sfx item RES_PARATR_OUTLINELEVEL virtual void ParaOutlineLevel( const SfxUInt16Item& ) = 0; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index a01788e..3cb24ae 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6235,6 +6235,73 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem) } } +void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem ) +{ + const std::map< OUString, com::sun::star::uno::Any >& rMap = rItem.GetGrabBag(); + + // get original font names and check if they have changed during the edition + sal_Bool bWriteCSTheme = sal_True; + sal_Bool bWriteAsciiTheme = sal_True; + if ( m_pFontsAttrList ) + { + OUString sFontName; + for ( std::map< OUString, com::sun::star::uno::Any >::const_iterator i = rMap.begin(); i != rMap.end(); i++ ) + { + if ( i->first == "CharThemeFontNameCs" ) + { + if ( i->second >>= sFontName ) + bWriteCSTheme = + ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_cs ) ) == sFontName ); + } + else if ( i->first == "CharThemeFontNameAscii" ) + { + if ( i->second >>= sFontName ) + bWriteAsciiTheme = + ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_ascii ) ) == sFontName ); + } + } + } + + // save theme attributes back to the run properties + OUString str; + for ( std::map< OUString, com::sun::star::uno::Any >::const_iterator i = rMap.begin(); i != rMap.end(); i++ ) + { + if ( i->first == "CharThemeNameAscii" && bWriteAsciiTheme ) + { + i->second >>= str; + if (!m_pFontsAttrList) + m_pFontsAttrList = m_pSerializer->createAttrList(); + m_pFontsAttrList->add( FSNS( XML_w, XML_asciiTheme ), + OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); + } + else if ( i->first == "CharThemeNameCs" && bWriteCSTheme ) + { + i->second >>= str; + if (!m_pFontsAttrList) + m_pFontsAttrList = m_pSerializer->createAttrList(); + m_pFontsAttrList->add( FSNS( XML_w, XML_cstheme ), + OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); + } + else if ( i->first == "CharThemeNameHAnsi" && bWriteAsciiTheme ) + // this is not a mistake: in LibO we don't directly support the hAnsi family + // of attributes so we save the same value from ascii attributes instead + { + i->second >>= str; + if (!m_pFontsAttrList) + m_pFontsAttrList = m_pSerializer->createAttrList(); + m_pFontsAttrList->add( FSNS( XML_w, XML_hAnsiTheme ), + OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); + } + else if( i->first == "CharThemeFontNameCs" || + i->first == "CharThemeFontNameAscii" ) + { + // just skip these, they were processed before + } + else + SAL_INFO("sw.ww8", "DocxAttributeOutput::CharGrabBag: unhandled grab bag property " << i->first); + } +} + DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML ) : m_rExport( rExport ), m_pSerializer( pSerializer ), diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 18d6c81..65416af 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -609,6 +609,9 @@ protected: /// Sfx item RES_PARATR_GRABBAG virtual void ParaGrabBag( const SfxGrabBagItem& ); + /// Sfx item RES_CHRATR_GRABBAG + virtual void CharGrabBag( const SfxGrabBagItem& ); + // Sfx item RES_PARATR_OUTLINELEVEL virtual void ParaOutlineLevel( const SfxUInt16Item& ); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 174acb6..fd1eca3 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3132,6 +3132,10 @@ void RtfAttributeOutput::ParaGrabBag(const SfxGrabBagItem& /*rItem*/) { } +void RtfAttributeOutput::CharGrabBag(const SfxGrabBagItem& /*rItem*/) +{ +} + void RtfAttributeOutput::ParaOutlineLevel(const SfxUInt16Item& /*rItem*/) { } diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index e92388f..46a2562 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -419,6 +419,9 @@ protected: /// Sfx item RES_PARATR_GRABBAG virtual void ParaGrabBag( const SfxGrabBagItem& ); + /// Sfx item RES_CHRATR_GRABBAG + virtual void CharGrabBag( const SfxGrabBagItem& ); + /// Sfx item RES_PARATR_OUTLINELEVEL virtual void ParaOutlineLevel( const SfxUInt16Item& ); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 695c113..6899165 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -393,6 +393,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby ) const SvxFontItem &rParentFont = ItemGet<SvxFontItem>( (const SwTxtFmtColl&)rNd.GetAnyFmtColl(), nFontId); const SvxFontItem *pFont = &rParentFont; + const SfxPoolItem *aGrabBag; SfxItemSet aExportSet(*rNd.GetSwAttrSet().GetPool(), RES_CHRATR_BEGIN, RES_TXTATR_END - 1); @@ -436,6 +437,8 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby ) { if (nWhichId == nFontId) pFont = &(item_cast<SvxFontItem>(*pItem)); + else if (nWhichId == RES_CHRATR_GRABBAG) + aGrabBag = pItem; else aRangeItems[nWhichId] = pItem; } @@ -510,6 +513,9 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby ) if ( rParentFont != aFont ) m_rExport.AttrOutput().OutputItem( aFont ); } + + // Output grab bag attributes + m_rExport.AttrOutput().OutputItem( *aGrabBag ); } void SwWW8AttrIter::OutFlys(sal_Int32 nSwPos) diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 349596c..e0a64f8 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -4733,6 +4733,10 @@ void WW8AttributeOutput::ParaGrabBag(const SfxGrabBagItem& /*rItem*/) { } +void WW8AttributeOutput::CharGrabBag(const SfxGrabBagItem& /*rItem*/) +{ +} + void WW8AttributeOutput::ParaOutlineLevel(const SfxUInt16Item& /*rItem*/) { } @@ -5284,6 +5288,9 @@ void AttributeOutputBase::OutputItem( const SfxPoolItem& rHt ) case RES_PARATR_OUTLINELEVEL: ParaOutlineLevel(static_cast<const SfxUInt16Item&>(rHt)); break; + case RES_CHRATR_GRABBAG: + CharGrabBag(static_cast<const SfxGrabBagItem&>(rHt)); + break; default: SAL_INFO("sw.ww8", "Unhandled SfxPoolItem with id " << rHt.Which() ); diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index cea26ef..ef844ea 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -402,6 +402,9 @@ protected: /// Sfx item RES_PARATR_GRABBAG virtual void ParaGrabBag( const SfxGrabBagItem& ); + /// Sfx item RES_TXTATR_GRABBAG + virtual void CharGrabBag( const SfxGrabBagItem& ); + // Sfx item RES_PARATR_OUTLINELEVEL virtual void ParaOutlineLevel( const SfxUInt16Item& ); commit 0fa60a7f5c1d3510c4fe1ea3d2a51527baf102bc Author: Jacobo Aragunde Pérez <jaragu...@igalia.com> Date: Fri Nov 29 10:11:25 2013 +0100 fdo#64232: Add font theme info to CharInteropGrabBag The attributes w:*Theme in the rFonts tag are saved to the character InteropGrabBag so they can be saved back to the document on export. Font attributes are also pushed into the grab bag because they will be needed to check if the user has modified the fonts while editing the document. Change-Id: Ib247845a2d5543823798e1bbd8ed1958a5d9e884 diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index c63429b..7b9cdbb 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -951,12 +951,19 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_Fonts_asciiTheme: m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "asciiTheme", ThemeTable::getStringForTheme(nIntValue)); if (m_pImpl->GetTopContext()) - m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) )); + { + uno::Any aPropValue = uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme( nIntValue ) ); + m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, aPropValue ); + m_pImpl->GetTopContext()->Insert(PROP_CHAR_THEME_FONT_NAME_ASCII, aPropValue, true, CHAR_GRAB_BAG ); + m_pImpl->GetTopContext()->Insert(PROP_CHAR_THEME_NAME_ASCII, uno::makeAny( ThemeTable::getStringForTheme(nIntValue) ), true, CHAR_GRAB_BAG); + } break; case NS_ooxml::LN_CT_Fonts_hAnsi: break;//unsupported case NS_ooxml::LN_CT_Fonts_hAnsiTheme: m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "hAnsiTheme", ThemeTable::getStringForTheme(nIntValue)); + if (m_pImpl->GetTopContext()) + m_pImpl->GetTopContext()->Insert(PROP_CHAR_THEME_NAME_H_ANSI, uno::makeAny( ThemeTable::getStringForTheme(nIntValue) ), true, CHAR_GRAB_BAG); break; case NS_ooxml::LN_CT_Fonts_eastAsia: if (m_pImpl->GetTopContext()) @@ -974,7 +981,12 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_Fonts_cstheme: m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "cstheme", ThemeTable::getStringForTheme(nIntValue)); if (m_pImpl->GetTopContext()) - m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) )); + { + uno::Any aPropValue = uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme( nIntValue ) ); + m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, aPropValue ); + m_pImpl->GetTopContext()->Insert(PROP_CHAR_THEME_FONT_NAME_CS, aPropValue, true, CHAR_GRAB_BAG ); + m_pImpl->GetTopContext()->Insert(PROP_CHAR_THEME_NAME_CS, uno::makeAny( ThemeTable::getStringForTheme(nIntValue) ), true, CHAR_GRAB_BAG); + } break; case NS_ooxml::LN_CT_Spacing_before: m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "before", OUString::number(nIntValue)); diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index 4b05efa..3e07b70 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -345,6 +345,12 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_PARA_SHADOW_FORMAT: sName = "ParaShadowFormat"; break; case PROP_FOOTNOTE_LINE_RELATIVE_WIDTH: sName = "FootnoteLineRelativeWidth"; break; case PROP_TBL_HEADER: sName = "TblHeader"; break; + case PROP_CHAR_THEME_NAME_ASCII : sName = "CharThemeNameAscii"; break; + case PROP_CHAR_THEME_NAME_CS : sName = "CharThemeNameCs"; break; + case PROP_CHAR_THEME_NAME_H_ANSI : sName = "CharThemeNameHAnsi"; break; + case PROP_CHAR_THEME_FONT_NAME_ASCII : sName = "CharThemeFontNameAscii"; break; + case PROP_CHAR_THEME_FONT_NAME_CS : sName = "CharThemeFontNameCs"; break; + case PROP_CHAR_THEME_FONT_NAME_H_ANSI : sName = "CharThemeFontNameHAnsi"; break; } ::std::pair<PropertyNameMap_t::iterator,bool> aInsertIt = m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName )); diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index 0de35ce..9d6a7ff 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -316,6 +316,12 @@ enum PropertyIds ,PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING ,PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING ,PROP_TBL_HEADER + ,PROP_CHAR_THEME_NAME_ASCII + ,PROP_CHAR_THEME_NAME_CS + ,PROP_CHAR_THEME_NAME_H_ANSI + ,PROP_CHAR_THEME_FONT_NAME_ASCII + ,PROP_CHAR_THEME_FONT_NAME_CS + ,PROP_CHAR_THEME_FONT_NAME_H_ANSI }; struct PropertyNameSupplier_Impl; class PropertyNameSupplier commit fb5ee5c9953635a423d3102b901e409d15800096 Author: Jacobo Aragunde Pérez <jaragu...@igalia.com> Date: Fri Nov 29 09:58:18 2013 +0100 sw: Add support for different grab bags at PropertyMap. Now there are two types of grab bags, for character and paragraph attributes. Change-Id: I41362358cd2765e5642499520d94f23f2380631d diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index da510fd..c63429b 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1197,7 +1197,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(default_spacing) ) ); if (nIntValue) // If auto spacing is set, then only store set value in InteropGrabBag { - m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING, uno::makeAny( ConversionHelper::convertTwipToMM100(default_spacing) ),true,true ); + m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING, uno::makeAny( ConversionHelper::convertTwipToMM100(default_spacing) ),true, PARA_GRAB_BAG ); } } break; @@ -1212,7 +1212,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(default_spacing) ) ); if (nIntValue) // If auto spacing is set, then only store set value in InteropGrabBag { - m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING, uno::makeAny( ConversionHelper::convertTwipToMM100(default_spacing) ),true,true ); + m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING, uno::makeAny( ConversionHelper::convertTwipToMM100(default_spacing) ),true, PARA_GRAB_BAG ); } } break; @@ -3475,7 +3475,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType rContext->Insert(PROP_PARA_CONTEXT_MARGIN, uno::makeAny( sal_Bool( nIntValue ) )); break; case 0x2470: // mirrorIndents - rContext->Insert(PROP_MIRROR_INDENTS, uno::makeAny(sal_Bool(nIntValue)), true, true); + rContext->Insert(PROP_MIRROR_INDENTS, uno::makeAny(sal_Bool(nIntValue)), true, PARA_GRAB_BAG); break; case NS_ooxml::LN_EG_SectPrContents_formProt: //section protection, only form editing is enabled - unsupported case NS_ooxml::LN_EG_SectPrContents_vAlign: diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 055916b..efbede5 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -64,19 +64,28 @@ uno::Sequence< beans::PropertyValue > PropertyMap::GetPropertyValues() { if(!m_aValues.getLength() && size()) { - size_t nGrabBag = 0; + size_t nCharGrabBag = 0; + size_t nParaGrabBag = 0; for (PropertyMap::iterator i = begin(); i != end(); ++i) - if (i->second.hasGrabBag()) - nGrabBag++; + { + if ( i->second.getGrabBagType() == CHAR_GRAB_BAG ) + nCharGrabBag++; + else if ( i->second.getGrabBagType() == PARA_GRAB_BAG ) + nParaGrabBag++; + } // If there are any grab bag properties, we need one slot for them. - m_aValues.realloc( size() - nGrabBag + (nGrabBag ? 1 : 0)); + m_aValues.realloc( size() - nCharGrabBag + (nCharGrabBag ? 1 : 0) + - nParaGrabBag + (nParaGrabBag ? 1 : 0)); ::com::sun::star::beans::PropertyValue* pValues = m_aValues.getArray(); - uno::Sequence<beans::PropertyValue> aGrabBagValues(nGrabBag); - beans::PropertyValue* pGrabBagValues = aGrabBagValues.getArray(); + uno::Sequence<beans::PropertyValue> aCharGrabBagValues(nCharGrabBag); + uno::Sequence<beans::PropertyValue> aParaGrabBagValues(nParaGrabBag); + beans::PropertyValue* pCharGrabBagValues = aCharGrabBagValues.getArray(); + beans::PropertyValue* pParaGrabBagValues = aParaGrabBagValues.getArray(); //style names have to be the first elements within the property sequence //otherwise they will overwrite 'hard' attributes sal_Int32 nValue = 0; - sal_Int32 nGrabBagValue = 0; + sal_Int32 nParaGrabBagValue = 0; + sal_Int32 nCharGrabBagValue = 0; PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier(); PropertyMap::iterator aParaStyleIter = find(PROP_PARA_STYLE_NAME); if( aParaStyleIter != end()) @@ -105,24 +114,36 @@ uno::Sequence< beans::PropertyValue > PropertyMap::GetPropertyValues() { if( aMapIter != aParaStyleIter && aMapIter != aCharStyleIter && aMapIter != aNumRuleIter ) { - if (!aMapIter->second.hasGrabBag()) + if ( aMapIter->second.getGrabBagType() == CHAR_GRAB_BAG ) { - pValues[nValue].Name = rPropNameSupplier.GetName( aMapIter->first ); - pValues[nValue].Value = aMapIter->second.getValue(); - ++nValue; + pCharGrabBagValues[nCharGrabBagValue].Name = rPropNameSupplier.GetName( aMapIter->first ); + pCharGrabBagValues[nCharGrabBagValue].Value = aMapIter->second.getValue(); + ++nCharGrabBagValue; + } + else if ( aMapIter->second.getGrabBagType() == PARA_GRAB_BAG ) + { + pParaGrabBagValues[nParaGrabBagValue].Name = rPropNameSupplier.GetName( aMapIter->first ); + pParaGrabBagValues[nParaGrabBagValue].Value = aMapIter->second.getValue(); + ++nParaGrabBagValue; } else { - pGrabBagValues[nGrabBagValue].Name = rPropNameSupplier.GetName( aMapIter->first ); - pGrabBagValues[nGrabBagValue].Value = aMapIter->second.getValue(); - ++nGrabBagValue; + pValues[nValue].Name = rPropNameSupplier.GetName( aMapIter->first ); + pValues[nValue].Value = aMapIter->second.getValue(); + ++nValue; } } } - if (nGrabBag) + if (nCharGrabBag) + { + pValues[nValue].Name = "CharInteropGrabBag"; + pValues[nValue].Value = uno::makeAny(aCharGrabBagValues); + ++nValue; + } + if (nParaGrabBag) { pValues[nValue].Name = "ParaInteropGrabBag"; - pValues[nValue].Value = uno::makeAny(aGrabBagValues); + pValues[nValue].Value = uno::makeAny(aParaGrabBagValues); ++nValue; } } @@ -154,7 +175,7 @@ static void lcl_AnyToTag(const uno::Any & rAny) } #endif -void PropertyMap::Insert( PropertyIds eId, const uno::Any& rAny, bool bOverwrite, bool bGrabBag ) +void PropertyMap::Insert( PropertyIds eId, const uno::Any& rAny, bool bOverwrite, GrabBagType rGrabBagType ) { #ifdef DEBUG_DMAPPER_PROPERTY_MAP const OUString& rInsert = PropertyNameSupplier:: @@ -170,11 +191,11 @@ void PropertyMap::Insert( PropertyIds eId, const uno::Any& rAny, bool bOverwrite if (aElement != end()) { if (bOverwrite) - aElement->second = PropValue(rAny, bGrabBag); + aElement->second = PropValue(rAny, rGrabBagType); return; } - _PropertyMap::insert(_PropertyMap::value_type(eId, PropValue(rAny, bGrabBag))); + _PropertyMap::insert(_PropertyMap::value_type(eId, PropValue(rAny, rGrabBagType))); Invalidate(); } diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx index 456a4809..968d7f1 100644 --- a/writerfilter/source/dmapper/PropertyMap.hxx +++ b/writerfilter/source/dmapper/PropertyMap.hxx @@ -64,21 +64,29 @@ enum BorderPosition BORDER_BOTTOM }; +enum GrabBagType +{ + NO_GRAB_BAG, + PARA_GRAB_BAG, + CHAR_GRAB_BAG +}; + class PropValue { uno::Any m_aValue; - bool m_bGrabBag; + GrabBagType m_rGrabBagType; public: - PropValue(const uno::Any& rValue, bool bGrabBag = false) : - m_aValue(rValue), m_bGrabBag(bGrabBag) {} + PropValue(const uno::Any& rValue, GrabBagType rGrabBagType = NO_GRAB_BAG) : + m_aValue(rValue), m_rGrabBagType(rGrabBagType) {} - PropValue() : m_aValue(), m_bGrabBag() {} + PropValue() : m_aValue(), m_rGrabBagType(NO_GRAB_BAG) {} - PropValue& operator=(const PropValue& rProp) { m_aValue = rProp.m_aValue; m_bGrabBag = rProp.m_bGrabBag; return *this; } + PropValue& operator=(const PropValue& rProp) { m_aValue = rProp.m_aValue; m_rGrabBagType = rProp.m_rGrabBagType; return *this; } const uno::Any& getValue() const { return m_aValue; } - bool hasGrabBag() const { return m_bGrabBag; } + bool hasGrabBag() const { return m_rGrabBagType != NO_GRAB_BAG; } + GrabBagType getGrabBagType() const { return m_rGrabBagType; } }; typedef std::map< PropertyIds, PropValue > _PropertyMap; @@ -108,7 +116,7 @@ public: bool hasEmptyPropertyValues() const {return !m_aValues.getLength();} /** Add property, usually overwrites already available attributes. It shouldn't overwrite in case of default attributes */ - void Insert( PropertyIds eId, const ::com::sun::star::uno::Any& rAny, bool bOverwrite = true, bool bGrabBag = false ); + void Insert( PropertyIds eId, const ::com::sun::star::uno::Any& rAny, bool bOverwrite = true, GrabBagType rGrabBagType = NO_GRAB_BAG ); void Insert( PropertyIds eId, const PropValue& rValue, bool bOverwrite = true ); void InsertProps(const boost::shared_ptr<PropertyMap> pMap); const ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote>& GetFootnote() const; commit 8a631e4718fbd7e6a393d93b006fc693df73a89b Author: Jacobo Aragunde Pérez <jaragu...@igalia.com> Date: Wed Nov 27 10:39:18 2013 +0100 sw: add CharInteropGrabBag uno property to characters Change-Id: I2c6d8b1e4ef6df6a6662d5db89e67e5fba3c6ade diff --git a/offapi/com/sun/star/style/CharacterProperties.idl b/offapi/com/sun/star/style/CharacterProperties.idl index b4dbf62..aadd7a4 100644 --- a/offapi/com/sun/star/style/CharacterProperties.idl +++ b/offapi/com/sun/star/style/CharacterProperties.idl @@ -25,6 +25,7 @@ #include <com/sun/star/container/XNameContainer.idl> #include <com/sun/star/table/BorderLine2.idl> #include <com/sun/star/table/ShadowFormat.idl> +#include <com/sun/star/beans/PropertyValue.idl> module com { module sun { module star { module style { @@ -441,6 +442,16 @@ published service CharacterProperties **/ [optional, property] com::sun::star::util::Color CharHighlight; + /** Grab bag of character properties, used as a string-any map for interim interop purposes. + + @since LibreOffice 4.2 + + <p>This property is intentionally not handled by the ODF filter. Any + member that should be handled there should be first moved out from this grab + bag to a separate property.</p> + */ + [optional, property] sequence<com::sun::star::beans::PropertyValue> CharInteropGrabBag; + }; }; }; }; }; diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 5773c2f..a7b0571 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -95,7 +95,7 @@ RES_CHRATR_BEGIN = HINT_BEGIN, RES_CHRATR_BOX, // 40 RES_CHRATR_SHADOW, // 41 RES_CHRATR_HIGHLIGHT, // 42 - RES_CHRATR_DUMMY2, // 43 + RES_CHRATR_GRABBAG, // 43 RES_CHRATR_DUMMY3, // 44 RES_CHRATR_END }; diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 34d3608..346df4e 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -842,6 +842,7 @@ enum SwPropNameIds /* 0775 */ UNO_NAME_FRAME_INTEROP_GRAB_BAG, /* 0776 */ UNO_NAME_CHAR_HIGHLIGHT, /* 0777 */ UNO_NAME_STYLE_INTEROP_GRAB_BAG, +/* 0778 */ UNO_NAME_CHAR_INTEROP_GRAB_BAG, SW_PROPNAME_END diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index d606aa6..595bb74 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -291,7 +291,7 @@ SfxItemInfo aSlotTab[] = { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_BOX { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_SHADOW { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY1 - { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY2 + { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_GRABBAG { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY3 { 0, 0 }, // RES_TXTATR_REFMARK @@ -497,11 +497,12 @@ void _InitCore() aAttrTab[ RES_CHRATR_BOX - POOLATTR_BEGIN ] = new SvxBoxItem( RES_CHRATR_BOX ); aAttrTab[ RES_CHRATR_SHADOW - POOLATTR_BEGIN ] = new SvxShadowItem( RES_CHRATR_SHADOW ); aAttrTab[ RES_CHRATR_HIGHLIGHT - POOLATTR_BEGIN ] = new SvxBrushItem( RES_CHRATR_HIGHLIGHT ); + aAttrTab[ RES_CHRATR_GRABBAG - POOLATTR_BEGIN ] = new SfxGrabBagItem( RES_CHRATR_GRABBAG ); // CharakterAttr - Dummies - aAttrTab[ RES_CHRATR_DUMMY2 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_CHRATR_DUMMY2 ); aAttrTab[ RES_CHRATR_DUMMY3 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_CHRATR_DUMMY3 ); + aAttrTab[ RES_TXTATR_REFMARK - POOLATTR_BEGIN ] = new SwFmtRefMark( aEmptyOUStr ); aAttrTab[ RES_TXTATR_TOXMARK - POOLATTR_BEGIN ] = new SwTOXMark; aAttrTab[ RES_TXTATR_META - POOLATTR_BEGIN ] = SwFmtMeta::CreatePoolDefault(RES_TXTATR_META); diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 394266f..956d96f 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -75,7 +75,8 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { SW_PROP_NMID(UNO_NAME_CHAR_FONT_PITCH), RES_CHRATR_FONT, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, MID_FONT_PITCH }, \ { SW_PROP_NMID(UNO_NAME_CHAR_POSTURE), RES_CHRATR_POSTURE , CPPU_E2T(CPPUTYPE_FONTSLANT), PropertyAttribute::MAYBEVOID, MID_POSTURE}, \ { SW_PROP_NMID(UNO_NAME_RSID), RES_CHRATR_RSID, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, 0 }, \ - { SW_PROP_NMID(UNO_NAME_CHAR_LOCALE), RES_CHRATR_LANGUAGE , CPPU_E2T(CPPUTYPE_LOCALE) , PropertyAttribute::MAYBEVOID, MID_LANG_LOCALE }, + { SW_PROP_NMID(UNO_NAME_CHAR_LOCALE), RES_CHRATR_LANGUAGE, CPPU_E2T(CPPUTYPE_LOCALE), PropertyAttribute::MAYBEVOID, MID_LANG_LOCALE }, \ + { SW_PROP_NMID(UNO_NAME_CHAR_INTEROP_GRAB_BAG), RES_CHRATR_GRABBAG, CPPU_E2T(CPPUTYPE_PROPERTYVALUE), PROPERTY_NONE, 0 }, \ #define _CJK_FONT_PROPERTIES \ { SW_PROP_NMID(UNO_NAME_CHAR_HEIGHT_ASIAN), RES_CHRATR_CJK_FONTSIZE , CPPU_E2T(CPPUTYPE_FLOAT), PropertyAttribute::MAYBEVOID, MID_FONTHEIGHT|CONVERT_TWIPS}, \ diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx index 1ad38e9..13626c6 100644 --- a/sw/source/core/unocore/unoprnms.cxx +++ b/sw/source/core/unocore/unoprnms.cxx @@ -807,6 +807,7 @@ const SwPropNameTab aPropNameTab = { /* 0775 UNO_NAME_FRAME_INTEROP_GRAB_BAG */ {MAP_CHAR_LEN("FrameInteropGrabBag")}, /* 0776 UNO_NAME_CHAR_HIGHLIGHT */ {MAP_CHAR_LEN("CharHighlight")}, /* 0777 UNO_NAME_STYLE_INTEROP_GRAB_BAG */ {MAP_CHAR_LEN("StyleInteropGrabBag")}, +/* 0778 UNO_NAME_CHAR_INTEROP_GRAB_BAG */ {MAP_CHAR_LEN("CharInteropGrabBag")}, // new items in this array must match enum SwPropNameIds };
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits