1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <com/sun/star/animations/Timing.hpp>
24 #include "nodetools.hxx"
27 using namespace ::com::sun::star
;
34 static sal_Int32 lcl_nOffset
= 0;
36 OUString
debugGetNodeName( const BaseNode
*pNode
)
38 return OUString::number(lcl_nOffset
) +
40 OUString::number(reinterpret_cast<sal_Int64
>(pNode
), 16);
43 void debugNodesShowTree( const BaseNode
* pNode
)
52 AttributableShapeSharedPtr
lookupAttributableShape( const ShapeManagerSharedPtr
& rShapeManager
,
53 const uno::Reference
< drawing::XShape
>& xShape
)
55 ENSURE_OR_THROW( rShapeManager
,
56 "lookupAttributableShape(): invalid ShapeManager" );
58 ShapeSharedPtr
pShape( rShapeManager
->lookupShape( xShape
) );
60 ENSURE_OR_THROW( pShape
,
61 "lookupAttributableShape(): no shape found for given XShape" );
63 AttributableShapeSharedPtr
pRes(
64 ::std::dynamic_pointer_cast
< AttributableShape
>( pShape
) );
66 // TODO(E3): Cannot throw here, people might set animation info
67 // for non-animatable shapes from the API. AnimationNodes must catch
68 // the exception and handle that differently
69 ENSURE_OR_THROW( pRes
,
70 "lookupAttributableShape(): shape found does not implement AttributableShape interface" );
75 bool isIndefiniteTiming( const uno::Any
& rAny
)
77 if( !rAny
.hasValue() )
80 animations::Timing eTiming
;
82 return (rAny
>>= eTiming
) && eTiming
== animations::Timing_INDEFINITE
;
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */