[Libreoffice-commits] core.git: writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Oct 29 11:12:59 CET 2013
writerfilter/source/dmapper/DomainMapper.cxx | 7 +++++++
writerfilter/source/dmapper/StyleSheetTable.cxx | 4 +++-
writerfilter/source/dmapper/ThemeTable.cxx | 24 ++++++++++++++++++++++++
writerfilter/source/dmapper/ThemeTable.hxx | 1 +
4 files changed, 35 insertions(+), 1 deletion(-)
New commits:
commit b103366b92845bde1aff9140c3f6ac2af5597893
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Oct 29 10:54:55 2013 +0100
DOCX import: store table style's rPr in InteropGrabBag
Change-Id: Iadc1831b60c4bd506e34eac42ea693f399973942
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 9760403..75fbe65 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -958,6 +958,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_ASIAN, uno::makeAny( sStringValue ));
break;
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) ) );
break;
@@ -1159,6 +1160,8 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
case NS_ooxml::LN_CT_Language_eastAsia: //90315
case NS_ooxml::LN_CT_Language_bidi: //90316
{
+ if (nName == NS_ooxml::LN_CT_Language_eastAsia)
+ m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "eastAsia", sStringValue);
lang::Locale aLocale( LanguageTag::convertToLocale( sStringValue));
if (m_pImpl->GetTopContext())
m_pImpl->GetTopContext()->Insert(NS_ooxml::LN_CT_Language_val== nName ? PROP_CHAR_LOCALE :
@@ -2998,6 +3001,10 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
resolveSprmProps(*this, rSprm);
if (nSprmId == NS_ooxml::LN_CT_PPrBase_spacing)
m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "spacing", m_pImpl->m_aSubInteropGrabBag);
+ else if (nSprmId == NS_ooxml::LN_EG_RPrBase_rFonts)
+ m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "rFonts", m_pImpl->m_aSubInteropGrabBag);
+ else if (nSprmId == NS_ooxml::LN_EG_RPrBase_lang)
+ m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "lang", m_pImpl->m_aSubInteropGrabBag);
break;
case NS_ooxml::LN_EG_SectPrContents_footnotePr:
case NS_ooxml::LN_EG_SectPrContents_endnotePr:
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index ce5c164..45adc73 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -753,11 +753,13 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
{
if (nSprmId == NS_ooxml::LN_CT_Style_pPr)
m_pImpl->m_rDMapper.enableInteropGrabBag("pPr");
+ else if (nSprmId == NS_ooxml::LN_CT_Style_rPr)
+ m_pImpl->m_rDMapper.enableInteropGrabBag("rPr");
}
m_pImpl->m_rDMapper.sprmWithProps( rSprm, pProps );
if (m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE)
{
- if (nSprmId == NS_ooxml::LN_CT_Style_pPr)
+ if (nSprmId == NS_ooxml::LN_CT_Style_pPr || nSprmId == NS_ooxml::LN_CT_Style_rPr)
{
TableStyleSheetEntry* pTableEntry = static_cast<TableStyleSheetEntry *>(m_pImpl->m_pCurrentEntry.get());
pTableEntry->AppendInteropGrabBag(m_pImpl->m_rDMapper.getInteropGrabBag());
diff --git a/writerfilter/source/dmapper/ThemeTable.cxx b/writerfilter/source/dmapper/ThemeTable.cxx
index bd89130..06a4923 100644
--- a/writerfilter/source/dmapper/ThemeTable.cxx
+++ b/writerfilter/source/dmapper/ThemeTable.cxx
@@ -142,6 +142,30 @@ void ThemeTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Poi
#endif
}
+OUString ThemeTable::getStringForTheme(const Id id)
+{
+ std::map<sal_uInt32, OUString> tmpThemeFontMap;
+ switch (id)
+ {
+ case NS_ooxml::LN_Value_ST_Theme_majorEastAsia:
+ return OUString("majorEastAsia");
+ case NS_ooxml::LN_Value_ST_Theme_majorBidi:
+ return OUString("majorBidi");
+ case NS_ooxml::LN_Value_ST_Theme_majorAscii:
+ return OUString("majorAscii");
+ case NS_ooxml::LN_Value_ST_Theme_majorHAnsi:
+ return OUString("majorHAnsi");
+ case NS_ooxml::LN_Value_ST_Theme_minorEastAsia:
+ return OUString("minorEastAsia");
+ case NS_ooxml::LN_Value_ST_Theme_minorBidi:
+ return OUString("minorBidi");
+ case NS_ooxml::LN_Value_ST_Theme_minorAscii:
+ return OUString("minorAscii");
+ case NS_ooxml::LN_Value_ST_Theme_minorHAnsi:
+ return OUString("minorHAnsi");
+ }
+ return OUString();
+}
const OUString ThemeTable::getFontNameForTheme(const Id id) const
{
std::map<sal_uInt32, OUString> tmpThemeFontMap;
diff --git a/writerfilter/source/dmapper/ThemeTable.hxx b/writerfilter/source/dmapper/ThemeTable.hxx
index 2f1d83e..7514555 100644
--- a/writerfilter/source/dmapper/ThemeTable.hxx
+++ b/writerfilter/source/dmapper/ThemeTable.hxx
@@ -40,6 +40,7 @@ public:
virtual ~ThemeTable();
const OUString getFontNameForTheme(const Id id) const;
+ static OUString getStringForTheme(const Id id);
private:
// Properties
More information about the Libreoffice-commits
mailing list