[Libreoffice-commits] core.git: 5 commits - sw/source writerfilter/source
Tomaž Vajngerl
tomaz.vajngerl at collabora.com
Sun Feb 23 15:11:55 PST 2014
sw/source/filter/ww8/docxattributeoutput.cxx | 10 ++
writerfilter/source/dmapper/PropertyIds.cxx | 14 ++-
writerfilter/source/dmapper/PropertyIds.hxx | 10 ++
writerfilter/source/dmapper/TextEffectsHandler.cxx | 77 ++++++++++++-----
writerfilter/source/ooxml/model.xml | 93 +++++++++++++++++++--
5 files changed, 175 insertions(+), 29 deletions(-)
New commits:
commit a086a19714555ea7493e0c9ce71ee85bbc9a3664
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Feb 23 23:37:28 2014 +0100
ooxml export: w14:reflection element
Change-Id: I84cd2cd13b56a2fa369fc4c1e98c5be519a50e78
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b34ce93..d37fe60 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1124,6 +1124,7 @@ void DocxAttributeOutput::InitCollectedRunProperties()
FSNS( XML_w, XML_rPrChange ),
FSNS( XML_w14, XML_glow ),
FSNS( XML_w14, XML_shadow ),
+ FSNS( XML_w14, XML_reflection ),
};
// postpone the output so that we can later [in EndParagraphProperties()]
@@ -1150,12 +1151,18 @@ const NameToId constNameToIdMapping[] =
{
{ OUString("glow"), FSNS( XML_w14, XML_glow ) },
{ OUString("shadow"), FSNS( XML_w14, XML_shadow ) },
+ { OUString("reflection"),FSNS( XML_w14, XML_reflection ) },
{ OUString("val"), FSNS( XML_w14, XML_val ) },
{ OUString("rad"), FSNS( XML_w14, XML_rad ) },
{ OUString("blurRad"), FSNS( XML_w14, XML_blurRad ) },
+ { OUString("stA"), FSNS( XML_w14, XML_stA ) },
+ { OUString("stPos"), FSNS( XML_w14, XML_stPos ) },
+ { OUString("endA"), FSNS( XML_w14, XML_endA ) },
+ { OUString("endPos"), FSNS( XML_w14, XML_endPos ) },
{ OUString("dist"), FSNS( XML_w14, XML_dist ) },
{ OUString("dir"), FSNS( XML_w14, XML_dir ) },
+ { OUString("fadeDir"), FSNS( XML_w14, XML_fadeDir ) },
{ OUString("sx"), FSNS( XML_w14, XML_sx ) },
{ OUString("sy"), FSNS( XML_w14, XML_sy ) },
{ OUString("kx"), FSNS( XML_w14, XML_kx ) },
@@ -6465,7 +6472,8 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem )
// just skip these, they were processed before
}
else if (i->first == "CharGlowTextEffect" ||
- i->first == "CharShadowTextEffect")
+ i->first == "CharShadowTextEffect" ||
+ i->first == "CharReflectionTextEffect")
{
beans::PropertyValue aPropertyValue;
i->second >>= aPropertyValue;
commit 155720819b58f745443ed09a5885159e27480ba6
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Feb 23 23:36:13 2014 +0100
writerfilter: put w14:reflection attributes into a GrabBag
Change-Id: I0738b3a69df9acc6e636849fbb78231621e1cad9
diff --git a/writerfilter/source/dmapper/TextEffectsHandler.cxx b/writerfilter/source/dmapper/TextEffectsHandler.cxx
index 7f292eb..fa0e2ad 100644
--- a/writerfilter/source/dmapper/TextEffectsHandler.cxx
+++ b/writerfilter/source/dmapper/TextEffectsHandler.cxx
@@ -161,6 +161,9 @@ void TextEffectsHandler::convertElementIdToPropertyId(sal_Int32 aElementId)
maElementName = "shadow";
break;
case NS_ooxml::LN_reflection_reflection:
+ maPropertyId = PROP_CHAR_REFLECTION_TEXT_EFFECT;
+ maElementName = "reflection";
+ break;
case NS_ooxml::LN_textOutline_textOutline:
case NS_ooxml::LN_textFill_textFill:
case NS_ooxml::LN_scene3d_scene3d:
@@ -224,27 +227,50 @@ void TextEffectsHandler::lcl_attribute(Id aName, Value& aValue)
}
break;
case NS_ooxml::LN_CT_Shadow_blurRad:
+ case NS_ooxml::LN_CT_Reflection_blurRad:
mpGrabBagStack->addInt32("blurRad", sal_Int32(aValue.getInt()));
break;
+ case NS_ooxml::LN_CT_Reflection_stA:
+ mpGrabBagStack->addInt32("stA", sal_Int32(aValue.getInt()));
+ break;
+ case NS_ooxml::LN_CT_Reflection_stPos:
+ mpGrabBagStack->addInt32("stPos", sal_Int32(aValue.getInt()));
+ break;
+ case NS_ooxml::LN_CT_Reflection_endA:
+ mpGrabBagStack->addInt32("endA", sal_Int32(aValue.getInt()));
+ break;
+ case NS_ooxml::LN_CT_Reflection_endPos:
+ mpGrabBagStack->addInt32("endPos", sal_Int32(aValue.getInt()));
+ break;
case NS_ooxml::LN_CT_Shadow_dist:
+ case NS_ooxml::LN_CT_Reflection_dist:
mpGrabBagStack->addInt32("dist", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_dir:
+ case NS_ooxml::LN_CT_Reflection_dir:
mpGrabBagStack->addInt32("dir", sal_Int32(aValue.getInt()));
break;
+ case NS_ooxml::LN_CT_Reflection_fadeDir:
+ mpGrabBagStack->addInt32("fadeDir", sal_Int32(aValue.getInt()));
+ break;
case NS_ooxml::LN_CT_Shadow_sx:
+ case NS_ooxml::LN_CT_Reflection_sx:
mpGrabBagStack->addInt32("sx", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_sy:
+ case NS_ooxml::LN_CT_Reflection_sy:
mpGrabBagStack->addInt32("sy", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_kx:
+ case NS_ooxml::LN_CT_Reflection_kx:
mpGrabBagStack->addInt32("kx", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_ky:
+ case NS_ooxml::LN_CT_Reflection_ky:
mpGrabBagStack->addInt32("ky", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_algn:
+ case NS_ooxml::LN_CT_Reflection_algn:
{
uno::Any aAny = makeAny(getRectAlignmentString(sal_Int32(aValue.getInt())));
mpGrabBagStack->appendElement("algn", aAny);
commit 7ad918450658dd51853642929828438604fadfb5
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Feb 23 22:59:25 2014 +0100
writerfilter: TextEffectsHandler - simplyfy switch
Change-Id: I9fe8967892f2298729940af3b3781fde760de69d
diff --git a/writerfilter/source/dmapper/TextEffectsHandler.cxx b/writerfilter/source/dmapper/TextEffectsHandler.cxx
index edb219e..7f292eb 100644
--- a/writerfilter/source/dmapper/TextEffectsHandler.cxx
+++ b/writerfilter/source/dmapper/TextEffectsHandler.cxx
@@ -96,6 +96,16 @@ public:
mStack.pop();
appendElement(aName, makeAny(aSequence));
}
+
+ void addInt32(OUString aElementName, sal_Int32 aIntValue)
+ {
+ appendElement(aElementName, makeAny(aIntValue));
+ }
+
+ void addString(OUString aElementName, OUString aStringValue)
+ {
+ appendElement(aElementName, makeAny(aStringValue));
+ }
};
OUString TextEffectsHandler::getSchemeColorValTypeString(sal_Int32 nType)
@@ -191,49 +201,48 @@ void TextEffectsHandler::lcl_attribute(Id aName, Value& aValue)
switch(aName)
{
case NS_ooxml::LN_CT_Percentage_val:
- mpGrabBagStack->appendElement("val", makeAny(sal_Int32(aValue.getInt())));
- break;
case NS_ooxml::LN_CT_PositiveFixedPercentage_val:
- mpGrabBagStack->appendElement("val", makeAny(sal_Int32(aValue.getInt())));
- break;
case NS_ooxml::LN_CT_PositivePercentage_val:
- mpGrabBagStack->appendElement("val", makeAny(sal_Int32(aValue.getInt())));
+ mpGrabBagStack->addInt32("val", sal_Int32(aValue.getInt()));
+ break;
+ case NS_ooxml::LN_CT_Glow_rad:
+ mpGrabBagStack->addInt32("rad", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_SchemeColor_val:
- mpGrabBagStack->appendElement("val", makeAny(getSchemeColorValTypeString(sal_Int32(aValue.getInt()))));
+ {
+ OUString aString = getSchemeColorValTypeString(sal_Int32(aValue.getInt()));
+ mpGrabBagStack->addString("val", aString);
+ }
break;
case NS_ooxml::LN_CT_SRgbColor_val:
{
- OUStringBuffer aBuf = OUString::number(aValue.getInt(), 16);
- OUStringBuffer aStr;
- comphelper::string::padToLength(aStr, 6 - aBuf.getLength(), '0');
- aStr.append(aBuf.getStr());
- mpGrabBagStack->appendElement("val", makeAny(aStr.makeStringAndClear().toAsciiUpperCase()));
+ OUStringBuffer aBuffer = OUString::number(aValue.getInt(), 16);
+ OUStringBuffer aString;
+ comphelper::string::padToLength(aString, 6 - aBuffer.getLength(), '0');
+ aString.append(aBuffer.getStr());
+ mpGrabBagStack->addString("val", aString.makeStringAndClear().toAsciiUpperCase());
}
break;
- case NS_ooxml::LN_CT_Glow_rad:
- mpGrabBagStack->appendElement("rad", makeAny(sal_Int32(aValue.getInt())));
- break;
case NS_ooxml::LN_CT_Shadow_blurRad:
- mpGrabBagStack->appendElement("blurRad", makeAny(sal_Int32(aValue.getInt())));
+ mpGrabBagStack->addInt32("blurRad", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_dist:
- mpGrabBagStack->appendElement("dist", makeAny(sal_Int32(aValue.getInt())));
+ mpGrabBagStack->addInt32("dist", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_dir:
- mpGrabBagStack->appendElement("dir", makeAny(sal_Int32(aValue.getInt())));
+ mpGrabBagStack->addInt32("dir", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_sx:
- mpGrabBagStack->appendElement("sx", makeAny(sal_Int32(aValue.getInt())));
+ mpGrabBagStack->addInt32("sx", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_sy:
- mpGrabBagStack->appendElement("sy", makeAny(sal_Int32(aValue.getInt())));
+ mpGrabBagStack->addInt32("sy", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_kx:
- mpGrabBagStack->appendElement("kx", makeAny(sal_Int32(aValue.getInt())));
+ mpGrabBagStack->addInt32("kx", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_ky:
- mpGrabBagStack->appendElement("ky", makeAny(sal_Int32(aValue.getInt())));
+ mpGrabBagStack->addInt32("ky", sal_Int32(aValue.getInt()));
break;
case NS_ooxml::LN_CT_Shadow_algn:
{
commit add5fc37308fe2a22137aaeddddc8e7831bd5bc7
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Feb 23 22:21:46 2014 +0100
writerfilter: add property ids for all w14 main elements
Change-Id: Ieb622364c1fbb2e5177392ff576a457a57b5cbb0
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index c3792cc..f78c10b 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -375,8 +375,18 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) const
case PROP_TOC_NEW_LINE: sName = "TOCNewLine"; break;
case PROP_TOC_PARAGRAPH_OUTLINE_LEVEL : sName = "TOCParagraphOutlineLevel"; break;
case PROP_CHAR_THEME_COLOR_TINT : sName = "CharThemeColorTint"; break;
- case PROP_CHAR_GLOW_TEXT_EFFECT : sName = "CharGlowTextEffect"; break;
- case PROP_CHAR_SHADOW_TEXT_EFFECT : sName = "CharShadowTextEffect"; break;
+ case PROP_CHAR_GLOW_TEXT_EFFECT : sName = "CharGlowTextEffect"; break;
+ case PROP_CHAR_SHADOW_TEXT_EFFECT : sName = "CharShadowTextEffect"; break;
+ case PROP_CHAR_REFLECTION_TEXT_EFFECT : sName = "CharReflectionTextEffect"; break;
+ case PROP_CHAR_TEXTOUTLINE_TEXT_EFFECT : sName = "CharTextOutlineTextEffect"; break;
+ case PROP_CHAR_TEXTFILL_TEXT_EFFECT : sName = "CharTextFillTextEffect"; break;
+ case PROP_CHAR_SCENE3D_TEXT_EFFECT : sName = "CharScene3DTextEffect"; break;
+ case PROP_CHAR_PROPS3D_TEXT_EFFECT : sName = "CharProps3DTextEffect"; break;
+ case PROP_CHAR_LIGATURES_TEXT_EFFECT : sName = "CharLigaturesTextEffect"; break;
+ case PROP_CHAR_NUMFORM_TEXT_EFFECT : sName = "CharNumFormTextEffect"; break;
+ case PROP_CHAR_NUMSPACING_TEXT_EFFECT : sName = "CharNumSpacingTextEffect"; break;
+ case PROP_CHAR_STYLISTICSETS_TEXT_EFFECT : sName = "CharStylisticSetsTextEffect"; break;
+ case PROP_CHAR_CNTXTALTS_TEXT_EFFECT : sName = "CharCntxtAltsTextEffect"; 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 18ba148..fbbf596 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -349,6 +349,16 @@ enum PropertyIds
,PROP_CHAR_THEME_COLOR_TINT
,PROP_CHAR_GLOW_TEXT_EFFECT
,PROP_CHAR_SHADOW_TEXT_EFFECT
+ ,PROP_CHAR_REFLECTION_TEXT_EFFECT
+ ,PROP_CHAR_TEXTOUTLINE_TEXT_EFFECT
+ ,PROP_CHAR_TEXTFILL_TEXT_EFFECT
+ ,PROP_CHAR_SCENE3D_TEXT_EFFECT
+ ,PROP_CHAR_PROPS3D_TEXT_EFFECT
+ ,PROP_CHAR_LIGATURES_TEXT_EFFECT
+ ,PROP_CHAR_NUMFORM_TEXT_EFFECT
+ ,PROP_CHAR_NUMSPACING_TEXT_EFFECT
+ ,PROP_CHAR_STYLISTICSETS_TEXT_EFFECT
+ ,PROP_CHAR_CNTXTALTS_TEXT_EFFECT
};
struct PropertyNameSupplier_Impl;
class PropertyNameSupplier
commit 52ff05f31ca6e5b3b62366bf50ab92f3a54a5ae4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Feb 23 22:21:06 2014 +0100
writerfilter: add w14:reflection to model.xml
Change-Id: I5d94ebf602d06f334661936136213cb4eddb6a36
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index fed4cda..73d90d8 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -5568,6 +5568,74 @@
</optional>
</define>
+ <define name="CT_Reflection">
+ <optional>
+ <attribute name="blurRad">
+ <ref name="ST_PositiveCoordinate"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="stA">
+ <ref name="ST_PositiveFixedPercentage"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="stPos">
+ <ref name="ST_PositiveFixedPercentage"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="endA">
+ <ref name="ST_PositiveFixedPercentage"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="endPos">
+ <ref name="ST_PositiveFixedPercentage"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="dist">
+ <ref name="ST_PositiveCoordinate"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="dir">
+ <ref name="ST_PositiveFixedAngle"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="fadeDir">
+ <ref name="ST_PositiveFixedAngle"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="sx">
+ <ref name="ST_Percentage"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="sy">
+ <ref name="ST_Percentage"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="kx">
+ <ref name="ST_FixedAngle"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="ky">
+ <ref name="ST_FixedAngle"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="algn">
+ <ref name="ST_RectAlignment"/>
+ </attribute>
+ </optional>
+ </define>
+
<define name="CT_TextOutlineEffect">
<empty/>
</define>
@@ -5586,7 +5654,7 @@
<define name="reflection">
<element name="reflection">
- <empty/>
+ <ref name="CT_Reflection"/>
</element>
</define>
@@ -5728,6 +5796,21 @@
<attribute name="ky" tokenid="ooxml:CT_Shadow_ky"/>
<attribute name="algn" tokenid="ooxml:CT_Shadow_algn"/>
</resource>
+ <resource name="CT_Reflection" resource="Properties" tag="character">
+ <attribute name="blurRad" tokenid="ooxml:CT_Reflection_blurRad"/>
+ <attribute name="stA" tokenid="ooxml:CT_Reflection_stA"/>
+ <attribute name="stPos" tokenid="ooxml:CT_Reflection_stPos"/>
+ <attribute name="endA" tokenid="ooxml:CT_Reflection_endA"/>
+ <attribute name="endPos" tokenid="ooxml:CT_Reflection_endPos"/>
+ <attribute name="dist" tokenid="ooxml:CT_Reflection_dist"/>
+ <attribute name="dir" tokenid="ooxml:CT_Reflection_dir"/>
+ <attribute name="fadeDir" tokenid="ooxml:CT_Reflection_fadeDir"/>
+ <attribute name="sx" tokenid="ooxml:CT_Reflection_sx"/>
+ <attribute name="sy" tokenid="ooxml:CT_Reflection_sy"/>
+ <attribute name="kx" tokenid="ooxml:CT_Reflection_kx"/>
+ <attribute name="ky" tokenid="ooxml:CT_Reflection_ky"/>
+ <attribute name="algn" tokenid="ooxml:CT_Reflection_algn"/>
+ </resource>
<resource name="glow" resource="Properties" tag="character">
<element name="glow" tokenid="ooxml:glow_glow"/>
</resource>
@@ -17407,12 +17490,12 @@
<ref name="BUILT_IN_ANY_TYPE"/>
</element>
</optional>
- <!--<optional>
+ <optional>
<element name="w14:reflection">
<ref name="BUILT_IN_ANY_TYPE"/>
</element>
</optional>
- <optional>
+ <!--<optional>
<element name="w14:textOutline">
<ref name="BUILT_IN_ANY_TYPE"/>
</element>
@@ -23426,8 +23509,8 @@
<element name="oMath" tokenid="ooxml:EG_RPrBase_oMath"/>
<element name="w14:glow" tokenid="ooxml:EG_RPrBase_w14_glow"/>
<element name="w14:shadow" tokenid="ooxml:EG_RPrBase_w14_shadow"/>
- <!--<element name="w14:reflection" tokenid="ooxml:EG_RPrBase_w14_reflection"/>
- <element name="w14:textOutline" tokenid="ooxml:EG_RPrBase_w14_textOutline"/>
+ <element name="w14:reflection" tokenid="ooxml:EG_RPrBase_w14_reflection"/>
+ <!--<element name="w14:textOutline" tokenid="ooxml:EG_RPrBase_w14_textOutline"/>
<element name="w14:textFill" tokenid="ooxml:EG_RPrBase_w14_textFill"/>
<element name="w14:scene3d" tokenid="ooxml:EG_RPrBase_w14_scene3d"/>
<element name="w14:props3d" tokenid="ooxml:EG_RPrBase_w14_props3d"/>
More information about the Libreoffice-commits
mailing list