[Libreoffice-commits] core.git: 2 commits - writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Sat Feb 22 11:36:54 PST 2014
writerfilter/source/dmapper/DomainMapper.cxx | 46 +++----
writerfilter/source/doctok/resources.xmi | 155 -------------------------
writerfilter/source/ooxml/model.xml | 10 -
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 16 +-
4 files changed, 33 insertions(+), 194 deletions(-)
New commits:
commit 148905281d830dedb0e1a7bbe9142eaf40bd3cfb
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Feb 22 20:29:05 2014 +0100
writerfilter: convert sprm:CF{Bold,BoldBi,Italic,ItalicBi}
Change-Id: Ide2116ac380fd563fa7cc9e60f46a7cc62ffc94b
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 9aa4a85..ea39f2c 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1308,12 +1308,10 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
rContext->Insert(PROP_CHAR_EMPHASIS, uno::makeAny ( getEmphasisValue (nIntValue)));
break; // sprmCKcd
case NS_sprm::LN_CFEmboss:// sprmCFEmboss
- case 60:// sprmCFBold
- case NS_sprm::LN_CFBoldBi:// sprmCFBoldBi (offset 0x27 to normal bold)
- case NS_sprm::LN_CFItalicBi:// sprmCFItalicBi (offset 0x27 to normal italic)
- case NS_sprm::LN_CFBold: //sprmCFBold
- case 61: /*sprmCFItalic*/
- case NS_sprm::LN_CFItalic: //sprmCFItalic
+ case NS_ooxml::LN_EG_RPrBase_b:
+ case NS_ooxml::LN_EG_RPrBase_bCs:
+ case NS_ooxml::LN_EG_RPrBase_i:
+ case NS_ooxml::LN_EG_RPrBase_iCs:
case NS_sprm::LN_CFStrike: //sprmCFStrike
case NS_sprm::LN_CFOutline: //sprmCFOutline
case NS_sprm::LN_CFShadow: //sprmCFShadow
@@ -1325,15 +1323,13 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
PropertyIds ePropertyId = PROP_CHAR_WEIGHT; //initialized to prevent warning!
switch( nSprmId )
{
- case 60:// sprmCFBold
- case NS_sprm::LN_CFBoldBi: // sprmCFBoldBi
- case NS_sprm::LN_CFBold: /*sprmCFBold*/
- ePropertyId = nSprmId != NS_sprm::LN_CFBoldBi ? PROP_CHAR_WEIGHT : PROP_CHAR_WEIGHT_COMPLEX;
+ case NS_ooxml::LN_EG_RPrBase_b:
+ case NS_ooxml::LN_EG_RPrBase_bCs:
+ ePropertyId = nSprmId != NS_ooxml::LN_EG_RPrBase_bCs ? PROP_CHAR_WEIGHT : PROP_CHAR_WEIGHT_COMPLEX;
break;
- case 61: /*sprmCFItalic*/
- case NS_sprm::LN_CFItalicBi: // sprmCFItalicBi
- case NS_sprm::LN_CFItalic: /*sprmCFItalic*/
- ePropertyId = nSprmId == 0x836 ? PROP_CHAR_POSTURE : PROP_CHAR_POSTURE_COMPLEX;
+ case NS_ooxml::LN_EG_RPrBase_i:
+ case NS_ooxml::LN_EG_RPrBase_iCs:
+ ePropertyId = nSprmId == NS_ooxml::LN_EG_RPrBase_i ? PROP_CHAR_POSTURE : PROP_CHAR_POSTURE_COMPLEX;
break;
case NS_sprm::LN_CFStrike: /*sprmCFStrike*/
case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/
@@ -1391,34 +1387,32 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
switch( nSprmId )
{
- case 60:/*sprmCFBold*/
- case NS_sprm::LN_CFBold: /*sprmCFBold*/
- case NS_sprm::LN_CFBoldBi: // sprmCFBoldBi
+ case NS_ooxml::LN_EG_RPrBase_b:
+ case NS_ooxml::LN_EG_RPrBase_bCs:
{
uno::Any aBold( uno::makeAny( nIntValue ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL ) );
rContext->Insert(ePropertyId, aBold );
- if( nSprmId != NS_sprm::LN_CFBoldBi ) // sprmCFBoldBi
+ if( nSprmId != NS_ooxml::LN_EG_RPrBase_bCs )
rContext->Insert(PROP_CHAR_WEIGHT_ASIAN, aBold );
uno::Reference<beans::XPropertySet> xCharStyle(m_pImpl->GetCurrentNumberingCharStyle());
if (xCharStyle.is())
xCharStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_CHAR_WEIGHT), aBold);
- if (nSprmId == NS_sprm::LN_CFBold)
+ if (nSprmId == NS_ooxml::LN_EG_RPrBase_b)
m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "b", OUString::number(nIntValue));
- else if (nSprmId == NS_sprm::LN_CFBoldBi)
+ else if (nSprmId == NS_ooxml::LN_EG_RPrBase_bCs)
m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "bCs", OUString::number(nIntValue));
}
break;
- case 61: /*sprmCFItalic*/
- case NS_sprm::LN_CFItalic: /*sprmCFItalic*/
- case NS_sprm::LN_CFItalicBi: // sprmCFItalicBi
+ case NS_ooxml::LN_EG_RPrBase_i:
+ case NS_ooxml::LN_EG_RPrBase_iCs:
{
uno::Any aPosture( uno::makeAny( nIntValue ? awt::FontSlant_ITALIC : awt::FontSlant_NONE ) );
rContext->Insert( ePropertyId, aPosture );
- if( nSprmId != NS_sprm::LN_CFItalicBi ) // sprmCFItalicBi
+ if (nSprmId != NS_ooxml::LN_EG_RPrBase_iCs)
rContext->Insert(PROP_CHAR_POSTURE_ASIAN, aPosture );
- if (nSprmId == NS_sprm::LN_CFItalic)
+ if (nSprmId == NS_ooxml::LN_EG_RPrBase_i)
m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "i", OUString::number(nIntValue));
}
break;
diff --git a/writerfilter/source/doctok/resources.xmi b/writerfilter/source/doctok/resources.xmi
index f7096fa..0d04b51 100644
--- a/writerfilter/source/doctok/resources.xmi
+++ b/writerfilter/source/doctok/resources.xmi
@@ -286,68 +286,6 @@
</UML:ModelElement.taggedValue>
</UML:Class>
<!--SPRM sprmCKcd-->
- <!--SPRM sprmCFBold-->
- <UML:Class xmi.id="sprmCFBold" name="sprmCFBold">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8sprm"/>
- </UML:ModelElement.stereotype>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>0x0835</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="sprmcode"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>rtf:sprmCFBold</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="sprmid"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>character</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="kind"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- </UML:Class>
- <!--SPRM sprmCFBold-->
- <!--SPRM sprmCFItalic-->
- <UML:Class xmi.id="sprmCFItalic" name="sprmCFItalic">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8sprm"/>
- </UML:ModelElement.stereotype>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>0x0836</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="sprmcode"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>rtf:sprmCFItalic</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="sprmid"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>character</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="kind"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- </UML:Class>
- <!--SPRM sprmCFItalic-->
<!--SPRM sprmCFStrike-->
<UML:Class xmi.id="sprmCFStrike" name="sprmCFStrike">
<UML:ModelElement.stereotype>
@@ -1123,68 +1061,6 @@
</UML:ModelElement.taggedValue>
</UML:Class>
<!--SPRM sprmCFBiDi-->
- <!--SPRM sprmCFBoldBi-->
- <UML:Class xmi.id="sprmCFBoldBi" name="sprmCFBoldBi">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8sprm"/>
- </UML:ModelElement.stereotype>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>0x085C</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="sprmcode"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>rtf:sprmCFBoldBi</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="sprmid"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>character</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="kind"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- </UML:Class>
- <!--SPRM sprmCFBoldBi-->
- <!--SPRM sprmCFItalicBi-->
- <UML:Class xmi.id="sprmCFItalicBi" name="sprmCFItalicBi">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8sprm"/>
- </UML:ModelElement.stereotype>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>0x085D</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="sprmcode"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>rtf:sprmCFItalicBi</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="sprmid"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>character</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="kind"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- </UML:Class>
- <!--SPRM sprmCFItalicBi-->
<!--SPRM sprmCLidBi-->
<UML:Class xmi.id="sprmCLidBi" name="sprmCLidBi">
<UML:ModelElement.stereotype>
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 75ad524..bab5704 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -23112,10 +23112,10 @@
<kind name="paragraph"/>
<element name="rStyle" tokenid="ooxml:EG_RPrBase_rStyle"/>
<element name="rFonts" tokenid="ooxml:EG_RPrBase_rFonts"/>
- <element name="b" tokenid="sprm:CFBold"/>
- <element name="bCs" tokenid="sprm:CFBoldBi"/>
- <element name="i" tokenid="sprm:CFItalic"/>
- <element name="iCs" tokenid="sprm:CFItalicBi"/>
+ <element name="b" tokenid="ooxml:EG_RPrBase_b"/>
+ <element name="bCs" tokenid="ooxml:EG_RPrBase_bCs"/>
+ <element name="i" tokenid="ooxml:EG_RPrBase_i"/>
+ <element name="iCs" tokenid="ooxml:EG_RPrBase_iCs"/>
<element name="caps" tokenid="sprm:CFCaps"/>
<element name="smallCaps" tokenid="sprm:CFSmallCaps"/>
<element name="strike" tokenid="sprm:CFStrike"/>
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index d87ddc2..36dfc5a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3841,10 +3841,10 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
// Trivial character sprms.
switch (nKeyword)
{
- case RTF_B: nSprm = NS_sprm::LN_CFBold; break;
- case RTF_AB: nSprm = NS_sprm::LN_CFBoldBi; break;
- case RTF_I: nSprm = NS_sprm::LN_CFItalic; break;
- case RTF_AI: nSprm = NS_sprm::LN_CFItalicBi; break;
+ case RTF_B: nSprm = NS_ooxml::LN_EG_RPrBase_b; break;
+ case RTF_AB: nSprm = NS_ooxml::LN_EG_RPrBase_bCs; break;
+ case RTF_I: nSprm = NS_ooxml::LN_EG_RPrBase_i; break;
+ case RTF_AI: nSprm = NS_ooxml::LN_EG_RPrBase_iCs; break;
case RTF_UL: nSprm = NS_sprm::LN_CKul; break;
case RTF_OUTL: nSprm = NS_sprm::LN_CFOutline; break;
case RTF_SHAD: nSprm = NS_sprm::LN_CFShadow; break;
commit ed9d0db0807fcdeeebfa8c4baf2169309c101a52
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Feb 22 20:16:40 2014 +0100
writerfilter: sprm:SBkc -> ooxml:EG_SectPrContents_type
Change-Id: I6a6b73967e11a9346cd766dde9d04af63466c206
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index e9f57fa..9aa4a85 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1631,7 +1631,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
}
break;
- case NS_sprm::LN_SBkc: // sprmSBkc
+ case NS_ooxml::LN_EG_SectPrContents_type:
/* break type
0 - No break
1 - New Column
diff --git a/writerfilter/source/doctok/resources.xmi b/writerfilter/source/doctok/resources.xmi
index 0b8c40c..f7096fa 100644
--- a/writerfilter/source/doctok/resources.xmi
+++ b/writerfilter/source/doctok/resources.xmi
@@ -1278,37 +1278,6 @@
</UML:ModelElement.taggedValue>
</UML:Class>
<!--SPRM sprmCShd-->
- <!--SPRM sprmSBkc-->
- <UML:Class xmi.id="sprmSBkc" name="sprmSBkc">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8sprm"/>
- </UML:ModelElement.stereotype>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>0x3009</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="sprmcode"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>rtf:sprmSBkc</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="sprmid"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>unknown</UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="kind"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- </UML:Class>
- <!--SPRM sprmSBkc-->
<!--SPRM sprmSTextFlow-->
<UML:Class xmi.id="sprmSTextFlow" name="sprmSTextFlow">
<UML:ModelElement.stereotype>
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index d8a9192..75ad524 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -22958,7 +22958,7 @@
<element name="rtlGutter" tokenid="ooxml:EG_SectPrContents_rtlGutter"/>
<element name="textDirection" tokenid="ooxml:EG_SectPrContents_textDirection"/>
<element name="titlePg" tokenid="ooxml:EG_SectPrContents_titlePg"/>
- <element name="type" tokenid="sprm:SBkc"/>
+ <element name="type" tokenid="ooxml:EG_SectPrContents_type"/>
<element name="vAlign" tokenid="ooxml:EG_SectPrContents_vAlign"/>
</resource>
<resource name="CT_SectPrBase" resource="Properties" tag="section"/>
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 52e2c19..d87ddc2 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -525,7 +525,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false)
{
SAL_INFO("writerfilter", OSL_THIS_FUNC << ": final? " << bFinal << ", needed? " << m_bNeedSect);
bool bNeedSect = m_bNeedSect;
- RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_sprm::LN_SBkc);
+ RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_type);
bool bContinuous = pBreak.get() && pBreak->getInt() == 0;
// If there is no paragraph in this section, then insert a dummy one, as required by Writer,
// unless this is the end of the doc, we had nothing since the last section break and this is not a continuous one.
@@ -550,7 +550,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false)
{
// In case the last section is a continuous one, we don't need to output a section break.
if (bFinal && bContinuous)
- m_aStates.top().aSectionSprms.erase(NS_sprm::LN_SBkc);
+ m_aStates.top().aSectionSprms.erase(NS_ooxml::LN_EG_SectPrContents_type);
}
// Section properties are a paragraph sprm.
@@ -2019,7 +2019,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
case RTF_PAGE:
{
// If we're inside a continuous section, we should send a section break, not a page one.
- RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_sprm::LN_SBkc);
+ RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_type);
// Unless we're on a title page.
RTFValue::Pointer_t pTitlePg = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_titlePg);
if ((pBreak.get() && !pBreak->getInt()) && !(pTitlePg.get() && pTitlePg->getInt()))
@@ -2208,7 +2208,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
if (nParam >= 0)
{
RTFValue::Pointer_t pValue(new RTFValue(nParam));
- m_aStates.top().aSectionSprms.set(NS_sprm::LN_SBkc, pValue);
+ m_aStates.top().aSectionSprms.set(NS_ooxml::LN_EG_SectPrContents_type, pValue);
return 0;
}
More information about the Libreoffice-commits
mailing list