diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-03-11 10:50:25 +0100 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-03-11 16:54:41 +0100 |
commit | 16e4a2034b7d5c454a3681496ef2564e9a97ddf1 (patch) | |
tree | d418f14ce2bf8c708f4374ca7d9c4b284c5cfafd /oox | |
parent | c3234e1d105fd5b77970d07b38418f3c3b4ad00b (diff) |
oox: change w14 CharGrabBag so it is recognised by export
Change-Id: I7b6f4e5ff9d6e1161b3d05c594498d7f0cb7d8a3
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/texteffectscontext.cxx | 76 |
1 files changed, 46 insertions, 30 deletions
diff --git a/oox/source/drawingml/texteffectscontext.cxx b/oox/source/drawingml/texteffectscontext.cxx index 058c5ab96ab9..93031b7e6ff6 100644 --- a/oox/source/drawingml/texteffectscontext.cxx +++ b/oox/source/drawingml/texteffectscontext.cxx @@ -56,23 +56,45 @@ OUString lclGetNameForElementId(sal_uInt32 aId) aIdMap[OOX_TOKEN(w14, contourClr)] = "contourClr"; aIdMap[OOX_TOKEN(w14, styleSet)] = "styleSet"; - aIdMap[OOX_TOKEN(w14, glow)] = "CharGlowTextEffect"; - aIdMap[OOX_TOKEN(w14, shadow)] = "CharShadowTextEffect"; - aIdMap[OOX_TOKEN(w14, reflection)] = "CharReflectionTextEffect"; - aIdMap[OOX_TOKEN(w14, textOutline)] = "CharTextOutlineTextEffect"; - aIdMap[OOX_TOKEN(w14, textFill)] = "CharTextFillTextEffect"; - aIdMap[OOX_TOKEN(w14, scene3d)] = "CharScene3DTextEffect"; - aIdMap[OOX_TOKEN(w14, props3d)] = "CharProps3DTextEffect"; - aIdMap[OOX_TOKEN(w14, ligatures)] = "CharLigaturesTextEffect"; - aIdMap[OOX_TOKEN(w14, numForm)] = "CharNumFormTextEffect"; - aIdMap[OOX_TOKEN(w14, numSpacing)] = "CharNumSpacingTextEffect"; - aIdMap[OOX_TOKEN(w14, stylisticSets)]= "CharStylisticSetsTextEffect"; - aIdMap[OOX_TOKEN(w14, cntxtAlts)] = "CharCntxtAltsTextEffect"; + aIdMap[OOX_TOKEN(w14, glow)] = "glow"; + aIdMap[OOX_TOKEN(w14, shadow)] = "shadow"; + aIdMap[OOX_TOKEN(w14, reflection)] = "reflection"; + aIdMap[OOX_TOKEN(w14, textOutline)] = "textOutline"; + aIdMap[OOX_TOKEN(w14, textFill)] = "textFill"; + aIdMap[OOX_TOKEN(w14, scene3d)] = "scene3d"; + aIdMap[OOX_TOKEN(w14, props3d)] = "props3d"; + aIdMap[OOX_TOKEN(w14, ligatures)] = "ligatures"; + aIdMap[OOX_TOKEN(w14, numForm)] = "numForm"; + aIdMap[OOX_TOKEN(w14, numSpacing)] = "numSpacing"; + aIdMap[OOX_TOKEN(w14, stylisticSets)]= "stylisticSets"; + aIdMap[OOX_TOKEN(w14, cntxtAlts)] = "cntxtAlts"; } return aIdMap[aId]; } +OUString lclGetGrabBagName(sal_uInt32 aId) +{ + static std::map<sal_uInt32, OUString> aGrabBagNameMap; + if(aGrabBagNameMap.empty()) + { + aGrabBagNameMap[OOX_TOKEN(w14, glow)] = "CharGlowTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, shadow)] = "CharShadowTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, reflection)] = "CharReflectionTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, textOutline)] = "CharTextOutlineTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, textFill)] = "CharTextFillTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, scene3d)] = "CharScene3DTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, props3d)] = "CharProps3DTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, ligatures)] = "CharLigaturesTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, numForm)] = "CharNumFormTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, numSpacing)] = "CharNumSpacingTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, stylisticSets)]= "CharStylisticSetsTextEffect"; + aGrabBagNameMap[OOX_TOKEN(w14, cntxtAlts)] = "CharCntxtAltsTextEffect"; + } + + return aGrabBagNameMap[aId]; +} + const char constAttributesSequenceName[] = "attributes"; } @@ -257,9 +279,13 @@ void TextEffectsContext::processAttributes(const AttributeList& rAttribs) void TextEffectsContext::onStartElement(const oox::AttributeList& rAttribs) { - OUString aElementName = lclGetNameForElementId(mnCurrentElement); if(mpGrabBagStack.get() == NULL) - mpGrabBagStack.reset(new GrabBagStack(aElementName)); + { + OUString aGrabBagName = lclGetGrabBagName(mnCurrentElement); + mpGrabBagStack.reset(new GrabBagStack(aGrabBagName)); + } + + OUString aElementName = lclGetNameForElementId(mnCurrentElement); mpGrabBagStack->push(aElementName); processAttributes(rAttribs); } @@ -271,22 +297,12 @@ void TextEffectsContext::onEndElement() if (mpGrabBagStack->isStackEmpty()) { - if (aCurrentElementName == "CharGlowTextEffect" || - aCurrentElementName == "CharShadowTextEffect" || - aCurrentElementName == "CharReflectionTextEffect" || - aCurrentElementName == "CharTextOutlineTextEffect" || - aCurrentElementName == "CharTextFillTextEffect" || - aCurrentElementName == "CharScene3DTextEffect" || - aCurrentElementName == "CharProps3DTextEffect" || - aCurrentElementName == "CharLigaturesTextEffect" || - aCurrentElementName == "CharNumFormTextEffect" || - aCurrentElementName == "CharNumSpacingTextEffect" || - aCurrentElementName == "CharStylisticSetsTextEffect" || - aCurrentElementName == "CharCntxtAltsTextEffect") - { - PropertyValue aValue = mpGrabBagStack->getRootProperty(); - mrTextEffectsProperties.push_back(aValue); - } + Sequence<PropertyValue> aSeq; + PropertyValue aPropertyValue = mpGrabBagStack->getRootProperty(); + aPropertyValue.Value >>= aSeq; + aPropertyValue.Value = makeAny(aSeq[0]); + + mrTextEffectsProperties.push_back(aPropertyValue); } } |