Files
libreoffice/xmloff/source/draw/animationexport.cxx

1722 lines
71 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by: Armin Le Grand. #118558# Correcting OLE attributes of LO3.4 at load time by loading as OOo3.3, details see task. http://svn.apache.org/viewvc?view=revision&revision=1195906 #118485# - Styles for OLEs are not saved. http://svn.apache.org/viewvc?view=revision&revision=1182166 #118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert metafiles http://svn.apache.org/viewvc?view=revision&revision=1293316 #119337# Solves the wrong get/setPropertyValue calls in SvxShapeText (and thus in SvxOle2Shape) http://svn.apache.org/viewvc?view=revision&revision=1344156 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 cws mba34issues01: #i117717#: remove wrong assertion http://svn.apache.org/viewvc?view=revision&revision=1172349 Patch contributed by Herbert Duerr goodbye Registration and License dialogs, don't let the door hit you http://svn.apache.org/viewvc?view=revision&revision=1172613 help gcc 4.6.0 on 32bit ubuntu 11.10" http://svn.apache.org/viewvc?view=revision&revision=1245357 Do not add targets for junit tests when junit is disabled. Patch contributed by Andre Fischer http://svn.apache.org/viewvc?view=revision&revision=1241508 Revert "sb140: #i117082# avoid unncessary static class data members commit 21d97438e2944861e26e4984195f959a0cce1e41. remove obsolete FreeBSD visibility special case. retain consolidated BSD bridge code, remove OS/2 pieces.
2012-11-12 17:21:24 +00:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/animations/XAnimateColor.hpp>
#include <com/sun/star/animations/XAnimateSet.hpp>
#include <com/sun/star/animations/XCommand.hpp>
#include <com/sun/star/animations/Timing.hpp>
#include <com/sun/star/animations/Event.hpp>
#include <com/sun/star/animations/XAnimateMotion.hpp>
#include <com/sun/star/animations/XAnimateTransform.hpp>
#include <com/sun/star/animations/XTransitionFilter.hpp>
#include <com/sun/star/animations/XIterateContainer.hpp>
#include <com/sun/star/animations/XAudio.hpp>
#include <com/sun/star/animations/AnimationColorSpace.hpp>
#include <com/sun/star/animations/AnimationNodeType.hpp>
#include <com/sun/star/animations/AnimationRestart.hpp>
#include <com/sun/star/animations/EventTrigger.hpp>
#include <com/sun/star/animations/AnimationFill.hpp>
#include <com/sun/star/animations/AnimationEndSync.hpp>
#include <com/sun/star/animations/AnimationCalcMode.hpp>
#include <com/sun/star/animations/AnimationAdditiveMode.hpp>
#include <com/sun/star/animations/AnimationTransformType.hpp>
#include <com/sun/star/animations/TransitionType.hpp>
#include <com/sun/star/animations/TransitionSubType.hpp>
#include <com/sun/star/animations/ValuePair.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/presentation/EffectNodeType.hpp>
#include <com/sun/star/presentation/EffectPresetClass.hpp>
#include <com/sun/star/presentation/ParagraphTarget.hpp>
#include <com/sun/star/presentation/TextAnimationType.hpp>
#include <com/sun/star/presentation/ShapeAnimationSubType.hpp>
#include <com/sun/star/presentation/EffectCommands.hpp>
#include <com/sun/star/drawing/XShape.hpp>
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
#include <o3tl/any.hxx>
#include <sax/tools/converter.hxx>
#include <tools/debug.hxx>
#include <xmloff/unointerfacetouniqueidentifiermapper.hxx>
#include "sdxmlexp_impl.hxx"
#include "sdpropls.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnmspe.hxx>
#include <xmloff/xmluconv.hxx>
#include <xmloff/xmlexp.hxx>
#include <xmloff/xmlement.hxx>
#include <xmloff/nmspmap.hxx>
#include <xmloff/shapeexport.hxx>
#include <xmloff/xmlprhdl.hxx>
#include "animations.hxx"
#include <xmloff/animationexport.hxx>
using namespace ::std;
using namespace ::cppu;
using namespace ::com::sun::star::animations;
using namespace ::com::sun::star::presentation;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::beans;
using namespace ::xmloff::token;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::beans::NamedValue;
using ::com::sun::star::container::XEnumerationAccess;
using ::com::sun::star::container::XEnumeration;
namespace xmloff
{
const SvXMLEnumMapEntry* getAnimationsEnumMap( sal_uInt16 nMap )
{
switch( nMap )
{
case Animations_EnumMap_Fill:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_Fill[] =
{
{ XML_DEFAULT, AnimationFill::DEFAULT },
{ XML_REMOVE, AnimationFill::REMOVE },
{ XML_FREEZE, AnimationFill::FREEZE },
{ XML_HOLD, AnimationFill::HOLD },
{ XML_TRANSITION, AnimationFill::TRANSITION },
{ XML_AUTO, AnimationFill::AUTO },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_Fill;
}
case Animations_EnumMap_FillDefault:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_Fill[] =
{
{ XML_INHERIT, AnimationFill::INHERIT },
{ XML_REMOVE, AnimationFill::REMOVE },
{ XML_FREEZE, AnimationFill::FREEZE },
{ XML_HOLD, AnimationFill::HOLD },
{ XML_TRANSITION, AnimationFill::TRANSITION },
{ XML_AUTO, AnimationFill::AUTO },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_Fill;
}
case Animations_EnumMap_Restart:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_Restart[] =
{
{ XML_DEFAULT, AnimationRestart::DEFAULT },
{ XML_ALWAYS, AnimationRestart::ALWAYS },
{ XML_WHENNOTACTIVE,AnimationRestart::WHEN_NOT_ACTIVE },
{ XML_NEVER, AnimationRestart::NEVER },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_Restart;
}
case Animations_EnumMap_RestartDefault:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_RestartDefault[] =
{
{ XML_INHERIT, AnimationRestart::INHERIT },
{ XML_ALWAYS, AnimationRestart::ALWAYS },
{ XML_WHENNOTACTIVE,AnimationRestart::WHEN_NOT_ACTIVE },
{ XML_NEVER, AnimationRestart::NEVER },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_RestartDefault;
}
case Animations_EnumMap_Endsync:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_Endsync[] =
{
{ XML_FIRST, AnimationEndSync::FIRST },
{ XML_LAST, AnimationEndSync::LAST },
{ XML_ALL, AnimationEndSync::ALL },
{ XML_MEDIA, AnimationEndSync::MEDIA },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_Endsync;
}
case Animations_EnumMap_CalcMode:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_CalcMode[] =
{
{ XML_DISCRETE, AnimationCalcMode::DISCRETE },
{ XML_LINEAR, AnimationCalcMode::LINEAR },
{ XML_PACED, AnimationCalcMode::PACED },
{ XML_SPLINE, AnimationCalcMode::SPLINE },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_CalcMode;
}
case Animations_EnumMap_AdditiveMode:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_AdditiveMode[] =
{
{ XML_BASE, AnimationAdditiveMode::BASE },
{ XML_SUM, AnimationAdditiveMode::SUM },
{ XML_REPLACE, AnimationAdditiveMode::REPLACE },
{ XML_MULTIPLY, AnimationAdditiveMode::MULTIPLY },
{ XML_NONE, AnimationAdditiveMode::NONE },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_AdditiveMode;
}
case Animations_EnumMap_TransformType:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_TransformType[] =
{
{ XML_TRANSLATE, AnimationTransformType::TRANSLATE },
{ XML_SCALE, AnimationTransformType::SCALE },
{ XML_ROTATE, AnimationTransformType::ROTATE },
{ XML_SKEWX, AnimationTransformType::SKEWX },
{ XML_SKEWY, AnimationTransformType::SKEWY },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_TransformType;
}
case Animations_EnumMap_TransitionType:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionType[] =
{
{ XML_BARWIPE, TransitionType::BARWIPE },
{ XML_BOXWIPE, TransitionType::BOXWIPE },
{ XML_FOURBOXWIPE, TransitionType::FOURBOXWIPE },
{ XML_BARNDOORWIPE, TransitionType::BARNDOORWIPE },
{ XML_DIAGONALWIPE, TransitionType::DIAGONALWIPE },
{ XML_BOWTIEWIPE, TransitionType::BOWTIEWIPE },
{ XML_MISCDIAGONALWIPE, TransitionType::MISCDIAGONALWIPE },
{ XML_VEEWIPE, TransitionType::VEEWIPE },
{ XML_BARNVEEWIPE, TransitionType::BARNVEEWIPE },
{ XML_ZIGZAGWIPE, TransitionType::ZIGZAGWIPE },
{ XML_BARNZIGZAGWIPE, TransitionType::BARNZIGZAGWIPE },
{ XML_IRISWIPE, TransitionType::IRISWIPE },
{ XML_TRIANGLEWIPE, TransitionType::TRIANGLEWIPE },
{ XML_ARROWHEADWIPE, TransitionType::ARROWHEADWIPE },
{ XML_PENTAGONWIPE, TransitionType::PENTAGONWIPE },
{ XML_HEXAGONWIPE, TransitionType::HEXAGONWIPE },
{ XML_ELLIPSEWIPE, TransitionType::ELLIPSEWIPE },
{ XML_EYEWIPE, TransitionType::EYEWIPE },
{ XML_ROUNDRECTWIPE, TransitionType::ROUNDRECTWIPE },
{ XML_STARWIPE, TransitionType::STARWIPE },
{ XML_MISCSHAPEWIPE, TransitionType::MISCSHAPEWIPE },
{ XML_CLOCKWIPE, TransitionType::CLOCKWIPE },
{ XML_PINWHEELWIPE, TransitionType::PINWHEELWIPE },
{ XML_SINGLESWEEPWIPE, TransitionType::SINGLESWEEPWIPE },
{ XML_FANWIPE, TransitionType::FANWIPE },
{ XML_DOUBLEFANWIPE, TransitionType::DOUBLEFANWIPE },
{ XML_DOUBLESWEEPWIPE, TransitionType::DOUBLESWEEPWIPE },
{ XML_SALOONDOORWIPE, TransitionType::SALOONDOORWIPE },
{ XML_WINDSHIELDWIPE, TransitionType::WINDSHIELDWIPE },
{ XML_SNAKEWIPE, TransitionType::SNAKEWIPE },
{ XML_SPIRALWIPE, TransitionType::SPIRALWIPE },
{ XML_PARALLELSNAKESWIPE,TransitionType::PARALLELSNAKESWIPE },
{ XML_BOXSNAKESWIPE, TransitionType::BOXSNAKESWIPE },
{ XML_WATERFALLWIPE, TransitionType::WATERFALLWIPE },
{ XML_PUSHWIPE, TransitionType::PUSHWIPE },
{ XML_SLIDEWIPE, TransitionType::SLIDEWIPE },
{ XML_FADE, TransitionType::FADE },
{ XML_RANDOMBARWIPE, TransitionType::RANDOMBARWIPE },
{ XML_CHECKERBOARDWIPE, TransitionType::CHECKERBOARDWIPE },
{ XML_DISSOLVE, TransitionType::DISSOLVE },
{ XML_BLINDSWIPE, TransitionType::BLINDSWIPE },
{ XML_RANDOM, TransitionType::RANDOM },
{ XML_ZOOM, TransitionType::ZOOM },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_TransitionType;
}
case Animations_EnumMap_TransitionSubType:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionSubType[] =
{
{ XML_DEFAULT, TransitionSubType::DEFAULT },
{ XML_LEFTTORIGHT, TransitionSubType::LEFTTORIGHT },
{ XML_TOPTOBOTTOM, TransitionSubType::TOPTOBOTTOM },
{ XML_TOPLEFT, TransitionSubType::TOPLEFT },
{ XML_TOPRIGHT, TransitionSubType::TOPRIGHT },
{ XML_BOTTOMRIGHT, TransitionSubType::BOTTOMRIGHT },
{ XML_BOTTOMLEFT, TransitionSubType::BOTTOMLEFT },
{ XML_TOPCENTER, TransitionSubType::TOPCENTER },
{ XML_RIGHTCENTER, TransitionSubType::RIGHTCENTER },
{ XML_BOTTOMCENTER, TransitionSubType::BOTTOMCENTER },
{ XML_LEFTCENTER, TransitionSubType::LEFTCENTER },
{ XML_CORNERSIN, TransitionSubType::CORNERSIN },
{ XML_CORNERSOUT, TransitionSubType::CORNERSOUT },
{ XML_VERTICAL, TransitionSubType::VERTICAL },
{ XML_HORIZONTAL, TransitionSubType::HORIZONTAL },
{ XML_DIAGONALBOTTOMLEFT, TransitionSubType::DIAGONALBOTTOMLEFT },
{ XML_DIAGONALTOPLEFT, TransitionSubType::DIAGONALTOPLEFT },
{ XML_DOUBLEBARNDOOR, TransitionSubType::DOUBLEBARNDOOR },
{ XML_DOUBLEDIAMOND, TransitionSubType::DOUBLEDIAMOND },
{ XML_DOWN, TransitionSubType::DOWN },
{ XML_LEFT, TransitionSubType::LEFT },
{ XML_UP, TransitionSubType::UP },
{ XML_RIGHT, TransitionSubType::RIGHT },
{ XML_RECTANGLE, TransitionSubType::RECTANGLE },
{ XML_DIAMOND, TransitionSubType::DIAMOND },
{ XML_CIRCLE, TransitionSubType::CIRCLE },
{ XML_FOURPOINT, TransitionSubType::FOURPOINT },
{ XML_FIVEPOINT, TransitionSubType::FIVEPOINT },
{ XML_SIXPOINT, TransitionSubType::SIXPOINT },
{ XML_HEART, TransitionSubType::HEART },
{ XML_KEYHOLE, TransitionSubType::KEYHOLE },
{ XML_CLOCKWISETWELVE, TransitionSubType::CLOCKWISETWELVE },
{ XML_CLOCKWISETHREE, TransitionSubType::CLOCKWISETHREE },
{ XML_CLOCKWISESIX, TransitionSubType::CLOCKWISESIX },
{ XML_CLOCKWISENINE, TransitionSubType::CLOCKWISENINE },
{ XML_TWOBLADEVERTICAL, TransitionSubType::TWOBLADEVERTICAL },
{ XML_TWOBLADEHORIZONTAL, TransitionSubType::TWOBLADEHORIZONTAL },
{ XML_FOURBLADE, TransitionSubType::FOURBLADE },
{ XML_CLOCKWISETOP, TransitionSubType::CLOCKWISETOP },
{ XML_CLOCKWISERIGHT, TransitionSubType::CLOCKWISERIGHT },
{ XML_CLOCKWISEBOTTOM, TransitionSubType::CLOCKWISEBOTTOM },
{ XML_CLOCKWISELEFT, TransitionSubType::CLOCKWISELEFT },
{ XML_CLOCKWISETOPLEFT, TransitionSubType::CLOCKWISETOPLEFT },
{ XML_COUNTERCLOCKWISEBOTTOMLEFT,TransitionSubType::COUNTERCLOCKWISEBOTTOMLEFT },
{ XML_CLOCKWISEBOTTOMRIGHT, TransitionSubType::CLOCKWISEBOTTOMRIGHT },
{ XML_COUNTERCLOCKWISETOPRIGHT,TransitionSubType::COUNTERCLOCKWISETOPRIGHT },
{ XML_CENTERTOP, TransitionSubType::CENTERTOP },
{ XML_CENTERRIGHT, TransitionSubType::CENTERRIGHT },
{ XML_TOP, TransitionSubType::TOP },
{ XML_BOTTOM, TransitionSubType::BOTTOM },
{ XML_FANOUTVERTICAL, TransitionSubType::FANOUTVERTICAL },
{ XML_FANOUTHORIZONTAL, TransitionSubType::FANOUTHORIZONTAL },
{ XML_FANINVERTICAL, TransitionSubType::FANINVERTICAL },
{ XML_FANINHORIZONTAL, TransitionSubType::FANINHORIZONTAL },
{ XML_PARALLELVERTICAL, TransitionSubType::PARALLELVERTICAL },
{ XML_PARALLELDIAGONAL, TransitionSubType::PARALLELDIAGONAL },
{ XML_OPPOSITEVERTICAL, TransitionSubType::OPPOSITEVERTICAL },
{ XML_OPPOSITEHORIZONTAL, TransitionSubType::OPPOSITEHORIZONTAL },
{ XML_PARALLELDIAGONALTOPLEFT,TransitionSubType::PARALLELDIAGONALTOPLEFT },
{ XML_PARALLELDIAGONALBOTTOMLEFT,TransitionSubType::PARALLELDIAGONALBOTTOMLEFT },
{ XML_TOPLEFTHORIZONTAL, TransitionSubType::TOPLEFTHORIZONTAL },
{ XML_TOPLEFTDIAGONAL, TransitionSubType::TOPLEFTDIAGONAL },
{ XML_TOPRIGHTDIAGONAL, TransitionSubType::TOPRIGHTDIAGONAL },
{ XML_BOTTOMRIGHTDIAGONAL, TransitionSubType::BOTTOMRIGHTDIAGONAL },
{ XML_BOTTOMLEFTDIAGONAL, TransitionSubType::BOTTOMLEFTDIAGONAL },
{ XML_TOPLEFTCLOCKWISE, TransitionSubType::TOPLEFTCLOCKWISE },
{ XML_TOPRIGHTCLOCKWISE, TransitionSubType::TOPRIGHTCLOCKWISE },
{ XML_BOTTOMRIGHTCLOCKWISE, TransitionSubType::BOTTOMRIGHTCLOCKWISE },
{ XML_BOTTOMLEFTCLOCKWISE, TransitionSubType::BOTTOMLEFTCLOCKWISE },
{ XML_TOPLEFTCOUNTERCLOCKWISE,TransitionSubType::TOPLEFTCOUNTERCLOCKWISE },
{ XML_TOPRIGHTCOUNTERCLOCKWISE,TransitionSubType::TOPRIGHTCOUNTERCLOCKWISE },
{ XML_BOTTOMRIGHTCOUNTERCLOCKWISE,TransitionSubType::BOTTOMRIGHTCOUNTERCLOCKWISE },
{ XML_BOTTOMLEFTCOUNTERCLOCKWISE,TransitionSubType::BOTTOMLEFTCOUNTERCLOCKWISE },
{ XML_VERTICALTOPSAME, TransitionSubType::VERTICALTOPSAME },
{ XML_VERTICALBOTTOMSAME, TransitionSubType::VERTICALBOTTOMSAME },
{ XML_VERTICALTOPLEFTOPPOSITE,TransitionSubType::VERTICALTOPLEFTOPPOSITE },
{ XML_VERTICALBOTTOMLEFTOPPOSITE,TransitionSubType::VERTICALBOTTOMLEFTOPPOSITE },
{ XML_HORIZONTALLEFTSAME, TransitionSubType::HORIZONTALLEFTSAME },
{ XML_HORIZONTALRIGHTSAME, TransitionSubType::HORIZONTALRIGHTSAME },
{ XML_HORIZONTALTOPLEFTOPPOSITE,TransitionSubType::HORIZONTALTOPLEFTOPPOSITE },
{ XML_HORIZONTALTOPRIGHTOPPOSITE,TransitionSubType::HORIZONTALTOPRIGHTOPPOSITE },
{ XML_DIAGONALBOTTOMLEFTOPPOSITE,TransitionSubType::DIAGONALBOTTOMLEFTOPPOSITE },
{ XML_DIAGONALTOPLEFTOPPOSITE,TransitionSubType::DIAGONALTOPLEFTOPPOSITE },
{ XML_TWOBOXTOP, TransitionSubType::TWOBOXTOP },
{ XML_TWOBOXBOTTOM, TransitionSubType::TWOBOXBOTTOM },
{ XML_TWOBOXLEFT, TransitionSubType::TWOBOXLEFT },
{ XML_TWOBOXRIGHT, TransitionSubType::TWOBOXRIGHT },
{ XML_FOURBOXVERTICAL, TransitionSubType::FOURBOXVERTICAL },
{ XML_FOURBOXHORIZONTAL, TransitionSubType::FOURBOXHORIZONTAL },
{ XML_VERTICALLEFT, TransitionSubType::VERTICALLEFT },
{ XML_VERTICALRIGHT, TransitionSubType::VERTICALRIGHT },
{ XML_HORIZONTALLEFT, TransitionSubType::HORIZONTALLEFT },
{ XML_HORIZONTALRIGHT, TransitionSubType::HORIZONTALRIGHT },
{ XML_FROMLEFT, TransitionSubType::FROMLEFT },
{ XML_FROMTOP, TransitionSubType::FROMTOP },
{ XML_FROMRIGHT, TransitionSubType::FROMRIGHT },
{ XML_FROMBOTTOM, TransitionSubType::FROMBOTTOM },
{ XML_CROSSFADE, TransitionSubType::CROSSFADE },
{ XML_FADETOCOLOR, TransitionSubType::FADETOCOLOR },
{ XML_FADEFROMCOLOR, TransitionSubType::FADEFROMCOLOR },
{ XML_FADEOVERCOLOR, TransitionSubType::FADEOVERCOLOR },
{ XML_THREEBLADE, TransitionSubType::THREEBLADE },
{ XML_EIGHTBLADE, TransitionSubType::EIGHTBLADE },
{ XML_ONEBLADE, TransitionSubType::ONEBLADE },
{ XML_ACROSS, TransitionSubType::ACROSS },
{ XML_TOPLEFTVERTICAL, TransitionSubType::TOPLEFTVERTICAL },
{ XML_COMBHORIZONTAL, TransitionSubType::COMBHORIZONTAL },
{ XML_COMBVERTICAL, TransitionSubType::COMBVERTICAL },
{ XML_IN, TransitionSubType::IN },
{ XML_OUT, TransitionSubType::OUT },
{ XML_ROTATEIN, TransitionSubType::ROTATEIN },
{ XML_ROTATEOUT, TransitionSubType::ROTATEOUT },
{ XML_FROMTOPLEFT, TransitionSubType::FROMTOPLEFT },
{ XML_FROMTOPRIGHT, TransitionSubType::FROMTOPRIGHT },
{ XML_FROMBOTTOMLEFT, TransitionSubType::FROMBOTTOMLEFT },
{ XML_FROMBOTTOMRIGHT, TransitionSubType::FROMBOTTOMRIGHT },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_TransitionSubType;
}
case Animations_EnumMap_EventTrigger:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_EventTrigger[] =
{
{ XML_ONBEGIN, EventTrigger::ON_BEGIN },
{ XML_ONEND, EventTrigger::ON_END },
{ XML_BEGIN, EventTrigger::BEGIN_EVENT },
{ XML_END, EventTrigger::END_EVENT },
{ XML_CLICK, EventTrigger::ON_CLICK },
{ XML_DOUBLECLICK, EventTrigger::ON_DBL_CLICK },
{ XML_MOUSEOVER, EventTrigger::ON_MOUSE_ENTER },
{ XML_MOUSEOUT, EventTrigger::ON_MOUSE_LEAVE },
{ XML_NEXT, EventTrigger::ON_NEXT },
{ XML_PREVIOUS, EventTrigger::ON_PREV },
{ XML_STOP_AUDIO, EventTrigger::ON_STOP_AUDIO },
{ XML_REPEAT, EventTrigger::REPEAT },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_EventTrigger;
}
case Animations_EnumMap_EffectPresetClass:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_EffectPresetClass[] =
{
{ XML_CUSTOM, EffectPresetClass::CUSTOM },
{ XML_ENTRANCE, EffectPresetClass::ENTRANCE },
{ XML_EXIT, EffectPresetClass::EXIT },
{ XML_EMPHASIS, EffectPresetClass::EMPHASIS },
{ XML_MOTION_PATH, EffectPresetClass::MOTIONPATH },
{ XML_OLE_ACTION, EffectPresetClass::OLEACTION },
{ XML_MEDIA_CALL, EffectPresetClass::MEDIACALL },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_EffectPresetClass;
}
case Animations_EnumMap_EffectNodeType:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_EffectNodeType[] =
{
{ XML_DEFAULT, EffectNodeType::DEFAULT },
{ XML_ON_CLICK, EffectNodeType::ON_CLICK },
{ XML_WITH_PREVIOUS, EffectNodeType::WITH_PREVIOUS },
{ XML_AFTER_PREVIOUS, EffectNodeType::AFTER_PREVIOUS },
{ XML_MAIN_SEQUENCE, EffectNodeType::MAIN_SEQUENCE },
{ XML_TIMING_ROOT, EffectNodeType::TIMING_ROOT },
{ XML_INTERACTIVE_SEQUENCE, EffectNodeType::INTERACTIVE_SEQUENCE },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_EffectNodeType;
}
case Animations_EnumMap_SubItem:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_SubItem[] =
{
{ XML_WHOLE, ShapeAnimationSubType::AS_WHOLE },
{ XML_BACKGROUND, ShapeAnimationSubType::ONLY_BACKGROUND },
{ XML_TEXT, ShapeAnimationSubType::ONLY_TEXT },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_SubItem;
}
case Animations_EnumMap_IterateType:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_IterateType[] =
{
{ XML_BY_PARAGRAPH, TextAnimationType::BY_PARAGRAPH },
{ XML_BY_WORD, TextAnimationType::BY_WORD },
{ XML_BY_LETTER, TextAnimationType::BY_LETTER },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_IterateType;
}
case Animations_EnumMap_Command:
{
static const SvXMLEnumMapEntry aAnimations_EnumMap_Command[] =
{
{ XML_CUSTOM, EffectCommands::CUSTOM },
{ XML_VERB, EffectCommands::VERB },
{ XML_PLAY, EffectCommands::PLAY },
{ XML_TOGGLE_PAUSE, EffectCommands::TOGGLEPAUSE },
{ XML_STOP, EffectCommands::STOP },
{ XML_STOP_AUDIO, EffectCommands::STOPAUDIO },
{ XML_TOKEN_INVALID, 0 }
};
return aAnimations_EnumMap_Command;
}
}
2011-03-01 19:07:44 +01:00
OSL_FAIL( "xmloff::getAnimationsEnumMap(), invalid map!" );
return nullptr;
}
const struct ImplAttributeNameConversion* getAnimationAttributeNamesConversionList()
{
static const struct ImplAttributeNameConversion gImplConversionList[] =
{
{ XML_X, "X" },
{ XML_Y, "Y" },
{ XML_WIDTH, "Width" },
{ XML_HEIGHT, "Height" },
{ XML_ROTATE, "Rotate" },
{ XML_SKEWX, "SkewX" },
{ XML_FILL_COLOR, "FillColor" },
{ XML_FILL, "FillStyle" },
{ XML_STROKE_COLOR, "LineColor" },
{ XML_STROKE, "LineStyle" },
{ XML_COLOR, "CharColor" },
{ XML_TEXT_ROTATION_ANGLE, "CharRotation" },
{ XML_FONT_WEIGHT, "CharWeight" },
{ XML_TEXT_UNDERLINE, "CharUnderline" },
{ XML_FONT_FAMILY, "CharFontName" },
{ XML_FONT_SIZE, "CharHeight" },
{ XML_FONT_STYLE, "CharPosture" },
{ XML_VISIBILITY, "Visibility" },
{ XML_OPACITY, "Opacity" },
{ XML_DIM, "DimColor" },
{ XML_TOKEN_INVALID, nullptr }
};
return gImplConversionList;
}
class AnimationsExporterImpl
{
public:
AnimationsExporterImpl( SvXMLExport& rExport, const Reference< XPropertySet >& xPageProps );
virtual ~AnimationsExporterImpl();
void prepareNode( const Reference< XAnimationNode >& xNode );
void exportNode( const Reference< XAnimationNode >& xNode );
void exportContainer( const Reference< XTimeContainer >& xNode, sal_Int16 nContainerNodeType );
void exportAnimate( const Reference< XAnimate >& xNode );
void exportAudio( const Reference< XAudio >& xAudio );
void exportCommand( const Reference< XCommand >& xCommand );
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
static Reference< XInterface > getParagraphTarget( const ParagraphTarget& pTarget );
static void convertPath( OUStringBuffer& sTmp, const Any& rPath );
2010-11-25 11:54:13 +00:00
void convertValue( XMLTokenEnum eAttributeName, OUStringBuffer& sTmp, const Any& rValue ) const;
void convertTiming( OUStringBuffer& sTmp, const Any& rTiming ) const;
void convertSource( OUStringBuffer& sTmp, const Any& rSource ) const;
void convertTarget( OUStringBuffer& sTmp, const Any& rTarget ) const;
void prepareValue( const Any& rValue );
void exportTransitionNode();
void prepareTransitionNode();
bool mbHasTransition;
private:
SvXMLExport& mrExport;
Reference< XInterface > mxExport;
Reference< XPropertySet > mxPageProps;
rtl::Reference<XMLSdPropHdlFactory> mxSdPropHdlFactory;
};
AnimationsExporterImpl::AnimationsExporterImpl( SvXMLExport& rExport, const Reference< XPropertySet >& xPageProps )
: mbHasTransition(false)
, mrExport( rExport )
, mxPageProps( xPageProps )
{
try
{
mxExport = static_cast< css::document::XFilter *>(&rExport);
}
2012-02-13 13:26:31 +00:00
catch (const RuntimeException&)
{
2012-02-13 13:26:31 +00:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::AnimationsExporterImpl(), RuntimeException caught!" );
}
mxSdPropHdlFactory = new XMLSdPropHdlFactory( mrExport.GetModel(), mrExport );
}
AnimationsExporterImpl::~AnimationsExporterImpl()
{
}
void AnimationsExporterImpl::exportTransitionNode()
{
if( mbHasTransition && mxPageProps.is() )
{
sal_Int16 nTransition = 0;
mxPageProps->getPropertyValue("TransitionType") >>= nTransition;
Any aSound( mxPageProps->getPropertyValue("Sound") );
OUString sSoundURL;
aSound >>= sSoundURL;
bool bStopSound = false;
if( !(aSound >>= bStopSound) )
bStopSound = false;
OUStringBuffer sTmp;
if( (nTransition != 0) || !sSoundURL.isEmpty() || bStopSound )
{
Reference< XInterface > xSource( mxPageProps.get() );
Event aEvent;
aEvent.Source <<= xSource;
aEvent.Trigger = EventTrigger::BEGIN_EVENT;
aEvent.Repeat = 0;
convertTiming( sTmp, Any( aEvent ) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_BEGIN, sTmp.makeStringAndClear() );
SvXMLElementExport aElement( mrExport, XML_NAMESPACE_ANIMATION, XML_PAR, true, true );
if( nTransition != 0 )
{
sal_Int16 nSubtype = 0;
bool bDirection = false;
sal_Int32 nFadeColor = 0;
double fDuration = 0.0;
mxPageProps->getPropertyValue("TransitionSubtype") >>= nSubtype;
mxPageProps->getPropertyValue("TransitionDirection") >>= bDirection;
mxPageProps->getPropertyValue("TransitionFadeColor") >>= nFadeColor;
mxPageProps->getPropertyValue("TransitionDuration") >>= fDuration;
::sax::Converter::convertDouble( sTmp, fDuration );
sTmp.append( 's');
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DUR, sTmp.makeStringAndClear() );
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTransition, getAnimationsEnumMap(Animations_EnumMap_TransitionType) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TYPE, sTmp.makeStringAndClear() );
if( nSubtype != TransitionSubType::DEFAULT )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nSubtype, getAnimationsEnumMap(Animations_EnumMap_TransitionSubType) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_SUBTYPE, sTmp.makeStringAndClear() );
}
if( !bDirection )
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DIRECTION, XML_REVERSE );
if( (nTransition == TransitionType::FADE) && ((nSubtype == TransitionSubType::FADETOCOLOR) || (nSubtype == TransitionSubType::FADEFROMCOLOR) ))
{
::sax::Converter::convertColor( sTmp, nFadeColor );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FADECOLOR, sTmp.makeStringAndClear() );
}
SvXMLElementExport aElement2( mrExport, XML_NAMESPACE_ANIMATION, XML_TRANSITIONFILTER, true, true );
}
if( bStopSound )
{
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_COMMAND, XML_STOP_AUDIO );
SvXMLElementExport aElement2( mrExport, XML_NAMESPACE_ANIMATION, XML_COMMAND, true, true );
}
else if( !sSoundURL.isEmpty())
{
mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, mrExport.GetRelativeReference( sSoundURL ) );
bool bLoopSound = false;
mxPageProps->getPropertyValue("LoopSound") >>= bLoopSound;
if( bLoopSound )
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_REPEATCOUNT, XML_INDEFINITE );
SvXMLElementExport aElement2( mrExport, XML_NAMESPACE_ANIMATION, XML_AUDIO, true, true );
}
}
}
}
void AnimationsExporterImpl::prepareTransitionNode()
{
if( mxPageProps.is() ) try
{
sal_Int16 nTransition = 0;
mxPageProps->getPropertyValue("TransitionType") >>= nTransition;
bool bStopSound = false;
OUString sSoundURL;
if( nTransition == 0 )
{
Any aSound( mxPageProps->getPropertyValue("Sound") );
aSound >>= sSoundURL;
if( !(aSound >>= bStopSound) )
bStopSound = false;
}
if( (nTransition != 0) || !sSoundURL.isEmpty() || bStopSound )
{
mbHasTransition = true;
Reference< XInterface > xInt( mxPageProps.get() );
mrExport.getInterfaceToIdentifierMapper().registerReference( xInt );
}
}
2012-02-13 13:26:31 +00:00
catch (const Exception&)
{
2011-03-01 19:07:44 +01:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::prepareNode(), Exception caught!" );
}
}
void AnimationsExporterImpl::prepareNode( const Reference< XAnimationNode >& xNode )
{
try
{
prepareValue( xNode->getBegin() );
prepareValue( xNode->getEnd() );
sal_Int16 nNodeType = xNode->getType();
switch( nNodeType )
{
case AnimationNodeType::ITERATE:
{
Reference< XIterateContainer > xIter( xNode, UNO_QUERY_THROW );
prepareValue( xIter->getTarget() );
SAL_FALLTHROUGH;
}
case AnimationNodeType::PAR:
case AnimationNodeType::SEQ:
{
Reference< XEnumerationAccess > xEnumerationAccess( xNode, UNO_QUERY_THROW );
Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), UNO_QUERY_THROW );
while( xEnumeration->hasMoreElements() )
{
Reference< XAnimationNode > xChildNode( xEnumeration->nextElement(), UNO_QUERY_THROW );
prepareNode( xChildNode );
}
}
break;
case AnimationNodeType::ANIMATE:
case AnimationNodeType::SET:
case AnimationNodeType::ANIMATEMOTION:
case AnimationNodeType::ANIMATECOLOR:
case AnimationNodeType::ANIMATETRANSFORM:
case AnimationNodeType::TRANSITIONFILTER:
{
Reference< XAnimate > xAnimate( xNode, UNO_QUERY_THROW );
prepareValue( xAnimate->getTarget() );
}
break;
case AnimationNodeType::COMMAND:
{
Reference< XCommand > xCommand( xNode, UNO_QUERY_THROW );
prepareValue( xCommand->getTarget() );
}
break;
case AnimationNodeType::AUDIO:
{
Reference< XAudio > xAudio( xNode, UNO_QUERY_THROW );
prepareValue( xAudio->getSource() );
}
break;
}
Sequence< NamedValue > aUserData( xNode->getUserData() );
if( aUserData.hasElements() )
{
const NamedValue* pValue = aUserData.getConstArray();
const sal_Int32 nLength = aUserData.getLength();
sal_Int32 nElement;
for( nElement = 0; nElement < nLength; nElement++, pValue++ )
{
if( IsXMLToken( pValue->Name, XML_MASTER_ELEMENT ) )
{
Reference< XInterface > xMaster;
pValue->Value >>= xMaster;
if( xMaster.is() )
mrExport.getInterfaceToIdentifierMapper().registerReference( xMaster );
}
}
}
}
2012-02-13 13:26:31 +00:00
catch (const Exception&)
{
2012-02-13 13:26:31 +00:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::prepareNode(), RuntimeException caught!" );
}
}
void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNode )
{
try
{
OUStringBuffer sTmp;
const OUString& rExportIdentifier = mrExport.getInterfaceToIdentifierMapper().getIdentifier( xNode );
if( !rExportIdentifier.isEmpty() )
{
mrExport.AddAttributeIdLegacy(
XML_NAMESPACE_ANIMATION, rExportIdentifier);
}
Any aTemp( xNode->getBegin() );
if( aTemp.hasValue() )
{
convertTiming( sTmp, aTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_BEGIN, sTmp.makeStringAndClear() );
}
double fTemp = 0;
sal_Int32 nTemp;
aTemp = xNode->getDuration();
if( aTemp.hasValue() )
{
if( aTemp >>= fTemp )
{
::sax::Converter::convertDouble( sTmp, fTemp );
sTmp.append( 's');
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DUR, sTmp.makeStringAndClear() );
}
else
{
Timing eTiming;
if( aTemp >>= eTiming )
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DUR, eTiming == Timing_INDEFINITE ? XML_INDEFINITE : XML_MEDIA );
}
}
aTemp = xNode->getEnd();
if( aTemp.hasValue() )
{
convertTiming( sTmp, aTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_END, sTmp.makeStringAndClear() );
}
nTemp = xNode->getFill();
if( nTemp != AnimationFill::DEFAULT )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_Fill) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FILL, sTmp.makeStringAndClear() );
}
nTemp = xNode->getFillDefault();
if( nTemp != AnimationFill::INHERIT )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_FillDefault) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FILLDEFAULT, sTmp.makeStringAndClear() );
}
nTemp = xNode->getRestart();
if( nTemp != AnimationRestart::DEFAULT )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_Restart) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_RESTART, sTmp.makeStringAndClear() );
}
nTemp = xNode->getRestartDefault();
if( nTemp != AnimationRestart::INHERIT )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_RestartDefault) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_RESTARTDEFAULT, sTmp.makeStringAndClear() );
}
fTemp = xNode->getAcceleration();
if( fTemp != 0.0 )
{
::sax::Converter::convertDouble( sTmp, fTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ACCELERATE, sTmp.makeStringAndClear() );
}
fTemp = xNode->getDecelerate();
if( fTemp != 0.0 )
{
::sax::Converter::convertDouble( sTmp, fTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DECELERATE, sTmp.makeStringAndClear() );
}
bool bTemp = xNode->getAutoReverse();
if( bTemp )
{
::sax::Converter::convertBool( sTmp, bTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_AUTOREVERSE, sTmp.makeStringAndClear() );
}
aTemp = xNode->getRepeatCount();
if( aTemp.hasValue() )
{
Timing eTiming;
if( (aTemp >>= eTiming ) && (eTiming == Timing_INDEFINITE ) )
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_REPEATCOUNT, XML_INDEFINITE );
else if( aTemp >>= fTemp )
{
::sax::Converter::convertDouble( sTmp, fTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_REPEATCOUNT, sTmp.makeStringAndClear() );
}
}
aTemp = xNode->getRepeatDuration();
if( aTemp.hasValue() )
{
Timing eTiming;
if( ( aTemp >>= eTiming ) && (eTiming == Timing_INDEFINITE) )
{
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_REPEATDUR, XML_INDEFINITE );
}
else if( aTemp >>= fTemp )
{
::sax::Converter::convertDouble( sTmp, fTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_REPEATDUR, sTmp.makeStringAndClear() );
}
}
aTemp = xNode->getEndSync();
if( aTemp.hasValue() )
{
if( aTemp >>= nTemp )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_Endsync) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ENDSYNC, sTmp.makeStringAndClear() );
}
}
sal_Int16 nContainerNodeType = EffectNodeType::DEFAULT;
OUString aPresetId;
Sequence< NamedValue > aUserData( xNode->getUserData() );
if( aUserData.hasElements() )
{
const NamedValue* pValue = aUserData.getConstArray();
const sal_Int32 nLength = aUserData.getLength();
sal_Int32 nElement;
for( nElement = 0; nElement < nLength; nElement++, pValue++ )
{
if( IsXMLToken( pValue->Name, XML_NODE_TYPE ) )
{
if( (pValue->Value >>= nContainerNodeType) && (nContainerNodeType != EffectNodeType::DEFAULT) )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nContainerNodeType, getAnimationsEnumMap(Animations_EnumMap_EffectNodeType) );
mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_NODE_TYPE, sTmp.makeStringAndClear() );
}
}
else if( IsXMLToken( pValue->Name, XML_PRESET_ID ) )
{
if( pValue->Value >>= aPresetId )
{
mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PRESET_ID, aPresetId );
}
}
else if( IsXMLToken( pValue->Name, XML_PRESET_SUB_TYPE ) )
{
OUString aPresetSubType;
if( pValue->Value >>= aPresetSubType )
{
mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PRESET_SUB_TYPE, aPresetSubType );
}
}
else if( IsXMLToken( pValue->Name, XML_PRESET_CLASS ) )
{
sal_Int16 nEffectPresetClass = sal_Int16();
if( pValue->Value >>= nEffectPresetClass )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nEffectPresetClass, getAnimationsEnumMap(Animations_EnumMap_EffectPresetClass) );
mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PRESET_CLASS, sTmp.makeStringAndClear() );
}
}
else if( IsXMLToken( pValue->Name, XML_MASTER_ELEMENT ) )
{
Reference< XInterface > xMaster;
pValue->Value >>= xMaster;
if( xMaster.is() )
{
const OUString& rIdentifier = mrExport.getInterfaceToIdentifierMapper().getIdentifier(xMaster);
if( !rIdentifier.isEmpty() )
mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_MASTER_ELEMENT, rIdentifier );
}
}
else if( IsXMLToken( pValue->Name, XML_GROUP_ID ) )
{
sal_Int32 nGroupId = 0;
if( pValue->Value >>= nGroupId )
mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_GROUP_ID, OUString::number( nGroupId ) );
}
else
{
OUString aTmp;
if( pValue->Value >>= aTmp )
mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, pValue->Name, aTmp );
}
}
}
nTemp = xNode->getType();
switch( nTemp )
{
case AnimationNodeType::PAR:
case AnimationNodeType::SEQ:
case AnimationNodeType::ITERATE:
{
Reference< XTimeContainer > xContainer( xNode, UNO_QUERY_THROW );
exportContainer( xContainer, nContainerNodeType );
}
break;
case AnimationNodeType::ANIMATE:
case AnimationNodeType::SET:
case AnimationNodeType::ANIMATEMOTION:
case AnimationNodeType::ANIMATECOLOR:
case AnimationNodeType::ANIMATETRANSFORM:
case AnimationNodeType::TRANSITIONFILTER:
{
Reference< XAnimate > xAnimate( xNode, UNO_QUERY_THROW );
exportAnimate( xAnimate );
}
break;
case AnimationNodeType::AUDIO:
{
Reference< XAudio > xAudio( xNode, UNO_QUERY_THROW );
exportAudio( xAudio );
}
break;
case AnimationNodeType::COMMAND:
{
Reference< XCommand > xCommand( xNode, UNO_QUERY_THROW );
exportCommand( xCommand );
}
break;
default:
2011-03-01 19:07:44 +01:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::exportNode(), invalid AnimationNodeType!" );
}
}
2012-02-13 13:26:31 +00:00
catch (const RuntimeException&)
{
2012-02-13 13:26:31 +00:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::exportNode(), RuntimeException caught!" );
}
// if something goes wrong, its always a good idea to clear the attribute list
mrExport.ClearAttrList();
}
void AnimationsExporterImpl::exportContainer( const Reference< XTimeContainer >& xContainer, sal_Int16 nContainerNodeType )
{
try
{
const sal_Int32 nNodeType = xContainer->getType();
if( nNodeType == AnimationNodeType::ITERATE )
{
OUStringBuffer sTmp;
Reference< XIterateContainer > xIter( xContainer, UNO_QUERY_THROW );
Any aTemp( xIter->getTarget() );
if( aTemp.hasValue() )
{
convertTarget( sTmp, aTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TARGETELEMENT, sTmp.makeStringAndClear() );
}
sal_Int16 nTemp = xIter->getSubItem();
if( nTemp )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_SubItem) );
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_SUB_ITEM, sTmp.makeStringAndClear() );
}
nTemp = xIter->getIterateType();
if( nTemp )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_IterateType) );
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_ITERATE_TYPE, sTmp.makeStringAndClear() );
}
double fTemp = xIter->getIterateInterval();
if( fTemp )
{
if( !( mrExport.getExportFlags() & SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE ) )
{
// issue 146582
OUStringBuffer buf;
::sax::Converter::convertDuration(buf, fTemp / (24*60*60));
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION,
XML_ITERATE_INTERVAL, buf.makeStringAndClear());
}
else
{
sTmp.append( fTemp );
sTmp.append( 's' );
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_ITERATE_INTERVAL, sTmp.makeStringAndClear() );
}
}
}
XMLTokenEnum eElementToken;
switch( nNodeType )
{
case AnimationNodeType::PAR: eElementToken = XML_PAR; break;
case AnimationNodeType::SEQ: eElementToken = XML_SEQ; break;
case AnimationNodeType::ITERATE:eElementToken = XML_ITERATE; break;
default:
2011-03-01 19:07:44 +01:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::exportContainer(), invalid TimeContainerType!" );
return;
}
SvXMLElementExport aElement( mrExport, XML_NAMESPACE_ANIMATION, eElementToken, true, true );
if( nContainerNodeType == EffectNodeType::TIMING_ROOT )
exportTransitionNode();
Reference< XEnumerationAccess > xEnumerationAccess( xContainer, UNO_QUERY_THROW );
Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), UNO_QUERY_THROW );
while( xEnumeration->hasMoreElements() )
{
Reference< XAnimationNode > xChildNode( xEnumeration->nextElement(), UNO_QUERY_THROW );
exportNode( xChildNode );
}
}
2012-02-13 13:26:31 +00:00
catch (const RuntimeException&)
{
2012-02-13 13:26:31 +00:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::exportContainer(), RuntimeException caught!" );
}
}
void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimate )
{
try
{
const sal_Int16 nNodeType = xAnimate->getType();
OUStringBuffer sTmp;
sal_Int32 nTemp;
bool bTemp;
Any aTemp( xAnimate->getTarget() );
if( aTemp.hasValue() )
{
convertTarget( sTmp, aTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TARGETELEMENT, sTmp.makeStringAndClear() );
}
nTemp = xAnimate->getSubItem();
if( nTemp )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_SubItem) );
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_SUB_ITEM, sTmp.makeStringAndClear() );
}
XMLTokenEnum eAttributeName = XML_TOKEN_INVALID;
if( nNodeType == AnimationNodeType::TRANSITIONFILTER )
{
eAttributeName = XML_TRANSITIONFILTER;
}
else if( nNodeType == AnimationNodeType::ANIMATETRANSFORM )
{
eAttributeName = XML_ANIMATETRANSFORM;
}
else if( nNodeType == AnimationNodeType::ANIMATEMOTION )
{
eAttributeName = XML_ANIMATEMOTION;
}
else
{
OUString sTemp( xAnimate->getAttributeName() );
if( !sTemp.isEmpty() )
{
const struct ImplAttributeNameConversion* p = getAnimationAttributeNamesConversionList();
while( p->mpAPIName )
{
if( sTemp.equalsAscii( p->mpAPIName ) )
{
sTemp = GetXMLToken( p->meXMLToken );
eAttributeName = p->meXMLToken;
break;
}
p++;
}
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ATTRIBUTENAME, sTemp );
}
else
{
OUString aStr( "invalid" );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ATTRIBUTENAME, aStr );
}
}
Sequence< Any > aValues( xAnimate->getValues() );
if( aValues.getLength() )
{
aTemp <<= aValues;
convertValue( eAttributeName, sTmp, aTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_VALUES, sTmp.makeStringAndClear() );
}
else
{
aTemp = xAnimate->getFrom();
if( aTemp.hasValue() )
{
convertValue( eAttributeName, sTmp, aTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FROM, sTmp.makeStringAndClear() );
}
aTemp = xAnimate->getBy();
if( aTemp.hasValue() )
{
convertValue( eAttributeName, sTmp, aTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_BY, sTmp.makeStringAndClear() );
}
aTemp = xAnimate->getTo();
if( aTemp.hasValue() )
{
convertValue( eAttributeName, sTmp, aTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TO, sTmp.makeStringAndClear() );
}
}
if(nNodeType != AnimationNodeType::SET)
{
Sequence< double > aKeyTimes( xAnimate->getKeyTimes() );
if( aKeyTimes.getLength() )
{
sal_Int32 nLength = aKeyTimes.getLength();
const double* p = aKeyTimes.getConstArray();
while( nLength-- )
{
if( !sTmp.isEmpty() )
sTmp.append( ';' );
sTmp.append( *p++ );
}
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_KEYTIMES, sTmp.makeStringAndClear() );
}
OUString sTemp( xAnimate->getFormula() );
if( !sTemp.isEmpty() )
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_FORMULA, sTemp );
if( (nNodeType != AnimationNodeType::TRANSITIONFILTER) &&
(nNodeType != AnimationNodeType::AUDIO ) )
{
// calcMode = "discrete | linear | paced | spline"
nTemp = xAnimate->getCalcMode();
if( ((nNodeType == AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::PACED)) ||
((nNodeType != AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::LINEAR)) )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_CalcMode) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_CALCMODE, sTmp.makeStringAndClear() );
}
bTemp = xAnimate->getAccumulate();
if( bTemp )
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ACCUMULATE, XML_SUM );
nTemp = xAnimate->getAdditive();
if( nTemp != AnimationAdditiveMode::REPLACE )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_AdditiveMode) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ADDITIVE, sTmp.makeStringAndClear() );
}
}
Sequence< TimeFilterPair > aTimeFilter( xAnimate->getTimeFilter() );
if( aTimeFilter.getLength() )
{
sal_Int32 nLength = aTimeFilter.getLength();
const TimeFilterPair* p = aTimeFilter.getConstArray();
while( nLength-- )
{
if( !sTmp.isEmpty() )
sTmp.append( ';' );
sTmp.append( OUString::number(p->Time) + "," + OUString::number(p->Progress) );
p++;
}
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_KEYSPLINES, sTmp.makeStringAndClear() );
}
}
XMLTokenEnum eElementToken = XML_ANIMATE;
switch( nNodeType )
{
case AnimationNodeType::ANIMATE:
eElementToken = XML_ANIMATE;
break;
case AnimationNodeType::SET:
eElementToken = XML_SET;
break;
case AnimationNodeType::ANIMATEMOTION:
{
eElementToken = XML_ANIMATEMOTION;
Reference< XAnimateMotion > xAnimateMotion( xAnimate, UNO_QUERY_THROW );
aTemp = xAnimateMotion->getPath();
if( aTemp.hasValue() )
{
convertPath( sTmp, aTemp );
mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_PATH, sTmp.makeStringAndClear() );
}
// TODO: origin = ( parent | layout )
aTemp = xAnimateMotion->getOrigin();
}
break;
case AnimationNodeType::ANIMATECOLOR:
{
eElementToken = XML_ANIMATECOLOR;
Reference< XAnimateColor > xAnimateColor( xAnimate, UNO_QUERY_THROW );
nTemp = xAnimateColor->getColorInterpolation();
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_COLOR_INTERPOLATION, (nTemp == AnimationColorSpace::RGB) ? XML_RGB : XML_HSL );
bTemp = xAnimateColor->getDirection();
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_COLOR_INTERPOLATION_DIRECTION, bTemp ? XML_CLOCKWISE : XML_COUNTER_CLOCKWISE );
}
break;
case AnimationNodeType::ANIMATETRANSFORM:
{
eElementToken = XML_ANIMATETRANSFORM;
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ATTRIBUTENAME, XML_TRANSFORM );
Reference< XAnimateTransform > xTransform( xAnimate, UNO_QUERY_THROW );
nTemp = xTransform->getTransformType();
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_TransformType) );
mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_TYPE, sTmp.makeStringAndClear() );
}
break;
case AnimationNodeType::TRANSITIONFILTER:
{
Reference< XTransitionFilter > xTransitionFilter( xAnimate, UNO_QUERY );
eElementToken = XML_TRANSITIONFILTER;
sal_Int16 nTransition = xTransitionFilter->getTransition();
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTransition, getAnimationsEnumMap(Animations_EnumMap_TransitionType) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TYPE, sTmp.makeStringAndClear() );
sal_Int16 nSubtype = xTransitionFilter->getSubtype();
if( nSubtype != TransitionSubType::DEFAULT )
{
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nSubtype, getAnimationsEnumMap(Animations_EnumMap_TransitionSubType) );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_SUBTYPE, sTmp.makeStringAndClear() );
}
bTemp = xTransitionFilter->getMode();
if( !bTemp )
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_MODE, XML_OUT );
bTemp = xTransitionFilter->getDirection();
if( !bTemp )
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DIRECTION, XML_REVERSE );
if( (nTransition == TransitionType::FADE) && ((nSubtype == TransitionSubType::FADETOCOLOR) || (nSubtype == TransitionSubType::FADEFROMCOLOR) ))
{
nTemp = xTransitionFilter->getFadeColor();
::sax::Converter::convertColor( sTmp, nTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FADECOLOR, sTmp.makeStringAndClear() );
}
}
break;
}
SvXMLElementExport aElement( mrExport, XML_NAMESPACE_ANIMATION, eElementToken, true, true );
}
2012-02-13 13:26:31 +00:00
catch (const Exception&)
{
OSL_FAIL( "xmloff::AnimationsExporterImpl::exportAnimate(), exception caught!" );
}
}
void AnimationsExporterImpl::exportAudio( const Reference< XAudio >& xAudio )
{
if( xAudio.is() ) try
{
OUString aSourceURL;
xAudio->getSource() >>= aSourceURL;
if( !aSourceURL.isEmpty() )
mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, mrExport.GetRelativeReference( aSourceURL ) );
const double fVolume = xAudio->getVolume();
if( fVolume != 1.0 )
{
OUStringBuffer sTmp;
::sax::Converter::convertDouble( sTmp, fVolume );
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_AUDIO_LEVEL, sTmp.makeStringAndClear() );
}
/* todo?
sal_Int32 nEndAfterSlide = 0;
xAudio->getEndAfterSlide() >>= nEndAfterSlide;
if( nEndAfterSlide != 0 )
mrExport.AddAttribute( );
*/
SvXMLElementExport aElement( mrExport, XML_NAMESPACE_ANIMATION, XML_AUDIO, true, true );
}
2012-02-13 13:26:31 +00:00
catch (const Exception&)
{
2011-03-01 19:07:44 +01:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::exportAudio(), exception caught!" );
}
}
void AnimationsExporterImpl::exportCommand( const Reference< XCommand >& xCommand )
{
if( xCommand.is() ) try
{
OUStringBuffer sTmp;
Any aTemp( xCommand->getTarget() );
if( aTemp.hasValue() )
{
convertTarget( sTmp, aTemp );
mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TARGETELEMENT, sTmp.makeStringAndClear() );
}
sal_Int16 nCommand = xCommand->getCommand();
SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nCommand, getAnimationsEnumMap(Animations_EnumMap_Command) );
mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_COMMAND, sTmp.makeStringAndClear() );
// todo virtual css::uno::Any SAL_CALL getParameter() throw (css::uno::RuntimeException) = 0;
SvXMLElementExport aElement( mrExport, XML_NAMESPACE_ANIMATION, XML_COMMAND, true, true );
}
2012-02-13 13:26:31 +00:00
catch (const Exception&)
{
2011-03-01 19:07:44 +01:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::exportCommand(), exception caught!" );
}
}
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
Reference< XInterface > AnimationsExporterImpl::getParagraphTarget( const ParagraphTarget& pTarget )
{
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
try
{
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
Reference< XEnumerationAccess > xParaEnumAccess( pTarget.Shape, UNO_QUERY_THROW );
Reference< XEnumeration > xEnumeration( xParaEnumAccess->createEnumeration(), UNO_QUERY_THROW );
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
sal_Int32 nParagraph = pTarget.Paragraph;
while( xEnumeration->hasMoreElements() )
{
Reference< XInterface > xRef( xEnumeration->nextElement(), UNO_QUERY );
if( nParagraph-- == 0 )
return xRef;
}
}
2012-02-13 13:26:31 +00:00
catch (const RuntimeException&)
{
2012-02-13 13:26:31 +00:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::getParagraphTarget(), RuntimeException caught!" );
}
Reference< XInterface > xRef;
return xRef;
}
void AnimationsExporterImpl::convertPath( OUStringBuffer& sTmp, const Any& rPath )
{
OUString aStr;
rPath >>= aStr;
sTmp = aStr;
}
2010-11-25 11:54:13 +00:00
void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUStringBuffer& sTmp, const Any& rValue ) const
{
if( !rValue.hasValue() )
return;
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
if( auto pValuePair = o3tl::tryGet<ValuePair>(rValue) )
{
OUStringBuffer sTmp2;
convertValue( eAttributeName, sTmp, pValuePair->First );
sTmp.append( ',' );
convertValue( eAttributeName, sTmp2, pValuePair->Second );
sTmp.append( sTmp2.makeStringAndClear() );
}
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
else if( auto pSequence = o3tl::tryGet<Sequence<Any>>(rValue) )
{
const sal_Int32 nLength = pSequence->getLength();
sal_Int32 nElement;
const Any* pAny = pSequence->getConstArray();
OUStringBuffer sTmp2;
for( nElement = 0; nElement < nLength; nElement++, pAny++ )
{
if( !sTmp.isEmpty() )
sTmp.append( ';' );
convertValue( eAttributeName, sTmp2, *pAny );
sTmp.append( sTmp2.makeStringAndClear() );
}
}
else
{
sal_Int32 nType;
switch( eAttributeName )
{
case XML_X:
case XML_Y:
case XML_WIDTH:
case XML_HEIGHT:
case XML_ANIMATETRANSFORM:
case XML_ANIMATEMOTION:
{
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
if( auto aString = o3tl::tryGet<OUString>(rValue) )
{
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
sTmp.append( *aString );
}
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
else if( auto x = o3tl::tryGet<double>(rValue) )
{
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
sTmp.append( *x );
}
else
{
2011-03-01 19:07:44 +01:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::convertValue(), invalid value type!" );
}
return;
}
case XML_SKEWX:
case XML_ROTATE: nType = XML_TYPE_DOUBLE; break;
case XML_TEXT_ROTATION_ANGLE: nType = XML_TYPE_NUMBER16; break;
case XML_FILL_COLOR:
case XML_STROKE_COLOR:
case XML_DIM:
case XML_COLOR: nType = XML_TYPE_COLOR; break;
case XML_FILL: nType = XML_SD_TYPE_FILLSTYLE; break;
case XML_STROKE: nType = XML_SD_TYPE_STROKE; break;
case XML_FONT_WEIGHT: nType = XML_TYPE_TEXT_WEIGHT; break;
case XML_FONT_STYLE: nType = XML_TYPE_TEXT_POSTURE; break;
case XML_TEXT_UNDERLINE: nType = XML_TYPE_TEXT_UNDERLINE_STYLE; break;
CWS-TOOLING: integrate CWS impress171 2009-06-02 16:32:02 +0200 cl r272511 : fixed build error 2009-05-29 16:40:09 +0200 cl r272471 : CWS-TOOLING: rebase CWS impress171 to trunk@272291 (milestone: DEV300:m49) 2009-05-19 15:14:08 +0200 sj r272082 : #i101459# applied patch (writing out StyleTextProperties even if no chars given) 2009-05-19 15:09:31 +0200 sj r272081 : #i101459# applied patch (writing out StyleTextProperties even if no chars given) 2009-05-19 15:09:14 +0200 sj r272080 : #i101459# applied patch (writing out StyleTextProperties even if no chars given) 2009-05-18 13:34:05 +0200 sj r272015 : #i47689# fixed rectangles toolbar 2009-05-13 14:59:08 +0200 sj r271862 : #i101563# fixed crash when loading pptx document 2009-05-12 19:31:58 +0200 sj r271835 : #101684# fixed rotation of customshapes 2009-05-08 16:37:01 +0200 sj r271724 : #i101683,i101584,i48160# added shearing of customshapes, fixed rotation problem 2009-04-28 17:32:14 +0200 sj r271335 : #i48160# fixed gluepoint rotation of customshapes 2009-04-27 16:31:54 +0200 cl r271291 : #i100138# applied patch for japanese reconversion feature 2009-04-27 16:30:52 +0200 cl r271290 : #i100138# applied patch for japanese reconversion feature 2009-04-27 16:28:55 +0200 cl r271289 : #i100138# applied patch for japanese reconversion feature 2009-04-23 14:22:59 +0200 cl r271170 : #i95342# #i96820# #i97298# multiple table handling fixes 2009-04-23 14:18:54 +0200 sj r271169 : #i60368# ignoring gamma values for toolbar/menu icons 2009-04-23 11:54:28 +0200 cl r271146 : #i97298# set style to text even during text edit 2009-04-23 11:46:38 +0200 cl r271145 : fixed compiler error with debug 2009-04-22 19:09:37 +0200 sj r271135 : #i101051# applied patch (proper import of notes page object) 2009-04-22 11:07:54 +0200 cl r271082 : #i96820# modify doc after merging cells 2009-04-22 10:57:35 +0200 cl r271081 : #i100307# applied patch from jlcheng to correctly set modfiy state 2009-04-22 10:31:11 +0200 cl r271079 : #i96736# copy merge information on clone 2009-04-21 08:27:22 +0200 cl r271016 : #i89541# use SfxErrorContext to make the ErrorHandler dialog modal 2009-04-20 17:52:56 +0200 cl r271003 : #i98480# removed 'EndPosition' and 'StartPosition' from styles 2009-04-20 16:41:55 +0200 cl r270994 : #i98403# fixed state handling for selected motion path 2009-04-17 11:35:25 +0200 cl r270931 : #i61274# export to pdf should behave like printing considering layer visibility 2009-04-17 10:00:17 +0200 cl r270924 : #i98967# set default style on any new shape except a page obj 2009-04-16 16:28:20 +0200 cl r270893 : #i98859# use percentage type for relative font height
2009-06-17 10:58:14 +00:00
case XML_FONT_SIZE: nType = XML_TYPE_DOUBLE_PERCENT; break;
case XML_VISIBILITY: nType = XML_SD_TYPE_PRESPAGE_VISIBILITY; break;
case XML_OPACITY:
case XML_TRANSITIONFILTER: nType = XML_TYPE_DOUBLE; break;
default:
2011-03-01 19:07:44 +01:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::convertValue(), invalid AttributeName!" );
nType = XML_TYPE_STRING;
}
//const XMLPropertyHandler* pHandler = static_cast<SdXMLExport*>(&mrExport)->GetSdPropHdlFactory()->GetPropertyHandler( nType );
const XMLPropertyHandler* pHandler = mxSdPropHdlFactory->GetPropertyHandler( nType );
if( pHandler )
{
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
OUString aString;
pHandler->exportXML( aString, rValue, mrExport.GetMM100UnitConverter() );
sTmp.append( aString );
}
}
}
2010-11-25 11:54:13 +00:00
void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rValue ) const
{
if( !rValue.hasValue() )
return;
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
if( auto pSequence = o3tl::tryGet<Sequence<Any>>(rValue) )
{
const sal_Int32 nLength = pSequence->getLength();
sal_Int32 nElement;
const Any* pAny = pSequence->getConstArray();
OUStringBuffer sTmp2;
for( nElement = 0; nElement < nLength; nElement++, pAny++ )
{
if( !sTmp.isEmpty() )
sTmp.append( ';' );
convertTiming( sTmp2, *pAny );
sTmp.append( sTmp2.makeStringAndClear() );
}
}
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
else if( auto x = o3tl::tryGet<double>(rValue) )
{
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
sTmp.append( *x );
sTmp.append( 's');
}
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
else if( auto pTiming = o3tl::tryGet<Timing>(rValue) )
{
sTmp.append( GetXMLToken( (*pTiming == Timing_MEDIA) ? XML_MEDIA : XML_INDEFINITE ) );
}
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
else if( auto pEvent = o3tl::tryGet<Event>(rValue) )
{
OUStringBuffer sTmp2;
if( pEvent->Trigger != EventTrigger::NONE )
{
if( pEvent->Source.hasValue() )
{
convertSource( sTmp, pEvent->Source );
sTmp.append( '.' );
}
SvXMLUnitConverter::convertEnum( sTmp2, (sal_uInt16)pEvent->Trigger, getAnimationsEnumMap(Animations_EnumMap_EventTrigger) );
sTmp.append( sTmp2.makeStringAndClear() );
}
if( pEvent->Offset.hasValue() )
{
convertTiming( sTmp2, pEvent->Offset );
if( !sTmp.isEmpty() )
sTmp.append( '+' );
sTmp.append( sTmp2.makeStringAndClear() );
}
}
else
{
2011-03-01 19:07:44 +01:00
OSL_FAIL( "xmloff::AnimationsExporterImpl::convertTiming(), invalid value type!" );
}
}
2010-11-25 11:54:13 +00:00
void AnimationsExporterImpl::convertSource( OUStringBuffer& sTmp, const Any& rSource ) const
{
convertTarget( sTmp, rSource );
}
2010-11-25 11:54:13 +00:00
void AnimationsExporterImpl::convertTarget( OUStringBuffer& sTmp, const Any& rTarget ) const
{
if( !rTarget.hasValue() )
return;
Reference< XInterface > xRef;
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
if( !(rTarget >>= xRef) )
{
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
if( auto pt = o3tl::tryGet<ParagraphTarget>(rTarget) )
{
xRef = getParagraphTarget( *pt );
}
}
DBG_ASSERT( xRef.is(), "xmloff::AnimationsExporterImpl::convertTarget(), invalid target type!" );
if( xRef.is() )
{
const OUString& rIdentifier = mrExport.getInterfaceToIdentifierMapper().getIdentifier(xRef);
if( !rIdentifier.isEmpty() )
sTmp.append( rIdentifier );
}
}
void AnimationsExporterImpl::prepareValue( const Any& rValue )
{
if( !rValue.hasValue() )
return;
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
if( auto pValuePair = o3tl::tryGet<ValuePair>(rValue) )
{
prepareValue( pValuePair->First );
prepareValue( pValuePair->Second );
}
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
else if( auto pSequence = o3tl::tryGet<Sequence<Any>>(rValue) )
{
const sal_Int32 nLength = pSequence->getLength();
sal_Int32 nElement;
const Any* pAny = pSequence->getConstArray();
for( nElement = 0; nElement < nLength; nElement++, pAny++ )
prepareValue( *pAny );
}
else if( rValue.getValueTypeClass() == css::uno::TypeClass_INTERFACE )
{
Reference< XInterface> xRef( rValue, UNO_QUERY );
if( xRef.is() )
mrExport.getInterfaceToIdentifierMapper().registerReference( xRef );
}
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
else if( auto pt = o3tl::tryGet<ParagraphTarget>(rValue) )
{
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
Reference< XInterface> xRef( getParagraphTarget( *pt ) );
if( xRef.is() )
mrExport.getInterfaceToIdentifierMapper().registerReference( xRef );
}
New o3tl::try/doGet to obtain value from Any ...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-06-02 15:06:06 +02:00
else if( auto pEvent = o3tl::tryGet<Event>(rValue) )
{
prepareValue( pEvent->Source );
}
}
AnimationsExporter::AnimationsExporter( SvXMLExport& rExport, const Reference< XPropertySet >& xPageProps )
: mpImpl( new AnimationsExporterImpl( rExport, xPageProps ) )
{
}
AnimationsExporter::~AnimationsExporter()
{
}
void AnimationsExporter::prepare( const Reference< XAnimationNode >& xRootNode )
{
try
{
if( xRootNode.is() )
{
mpImpl->prepareTransitionNode();
mpImpl->prepareNode( xRootNode );
}
}
2012-02-13 13:26:31 +00:00
catch (const RuntimeException&)
{
2012-02-13 13:26:31 +00:00
OSL_FAIL( "xmloff::AnimationsExporter::prepare(), exception caught" );
}
}
void AnimationsExporter::exportAnimations( const Reference< XAnimationNode >& xRootNode )
{
try
{
if( xRootNode.is() )
{
bool bHasEffects = mpImpl->mbHasTransition;
if( !bHasEffects )
{
// first check if there are no animations
Reference< XEnumerationAccess > xEnumerationAccess( xRootNode, UNO_QUERY_THROW );
Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), UNO_QUERY_THROW );
if( xEnumeration->hasMoreElements() )
{
// first child node may be an empty main sequence, check this
Reference< XAnimationNode > xMainNode( xEnumeration->nextElement(), UNO_QUERY_THROW );
Reference< XEnumerationAccess > xMainEnumerationAccess( xMainNode, UNO_QUERY_THROW );
Reference< XEnumeration > xMainEnumeration( xMainEnumerationAccess->createEnumeration(), UNO_QUERY_THROW );
// only export if the main sequence is not empty or if there are additional
// trigger sequences
bHasEffects = xMainEnumeration->hasMoreElements() || xEnumeration->hasMoreElements();
}
}
if( bHasEffects )
mpImpl->exportNode( xRootNode );
}
}
2012-02-13 13:26:31 +00:00
catch (const RuntimeException&)
{
2012-02-13 13:26:31 +00:00
OSL_FAIL( "xmloff::AnimationsExporter::exportAnimations(), exception caught" );
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */