Kaydet (Commit) c88d4ddf authored tarafından Ivan Safonov's avatar Ivan Safonov Kaydeden (comit) Julien Nabet

tdf#96099 Remove ActionSharedPtr typedef

Replace ActionSharedPtr by its definition.

Change-Id: Iedd14c85169230d961f0707671885451875529d7
Reviewed-on: https://gerrit.libreoffice.org/40340Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
Tested-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 1a4dd1fa
......@@ -144,9 +144,6 @@ namespace cppcanvas
*/
virtual sal_Int32 getActionCount() const = 0;
};
typedef std::shared_ptr< Action > ActionSharedPtr;
}
}
......
......@@ -199,14 +199,14 @@ static float GetSwapFloat( SvStream& rSt )
// public, since some functors need it, too.
struct MtfAction
{
MtfAction( const ActionSharedPtr& rAction,
MtfAction( const std::shared_ptr<Action>& rAction,
sal_Int32 nOrigIndex ) :
mpAction( rAction ),
mnOrigIndex( nOrigIndex )
{
}
ActionSharedPtr mpAction;
std::shared_ptr<Action> mpAction;
sal_Int32 mnOrigIndex;
};
......
......@@ -197,24 +197,24 @@ namespace cppcanvas
}
}
ActionSharedPtr BitmapActionFactory::createBitmapAction( const ::BitmapEx& rBmpEx,
std::shared_ptr<Action> BitmapActionFactory::createBitmapAction( const ::BitmapEx& rBmpEx,
const ::basegfx::B2DPoint& rDstPoint,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
return ActionSharedPtr( new BitmapAction(rBmpEx,
return std::shared_ptr<Action>( new BitmapAction(rBmpEx,
rDstPoint,
rCanvas,
rState ) );
}
ActionSharedPtr BitmapActionFactory::createBitmapAction( const ::BitmapEx& rBmpEx,
std::shared_ptr<Action> BitmapActionFactory::createBitmapAction( const ::BitmapEx& rBmpEx,
const ::basegfx::B2DPoint& rDstPoint,
const ::basegfx::B2DVector& rDstSize,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
return ActionSharedPtr( new BitmapAction(rBmpEx,
return std::shared_ptr<Action>( new BitmapAction(rBmpEx,
rDstPoint,
rDstSize,
rCanvas,
......
......@@ -47,13 +47,13 @@ namespace cppcanvas
namespace BitmapActionFactory
{
/// Unscaled bitmap action, only references destination point
ActionSharedPtr createBitmapAction( const ::BitmapEx&,
std::shared_ptr<Action> createBitmapAction( const ::BitmapEx&,
const ::basegfx::B2DPoint& rDstPoint,
const CanvasSharedPtr&,
const OutDevState& );
/// Scaled bitmap action, dest point and dest size
ActionSharedPtr createBitmapAction( const ::BitmapEx&,
std::shared_ptr<Action> createBitmapAction( const ::BitmapEx&,
const ::basegfx::B2DPoint& rDstPoint,
const ::basegfx::B2DVector& rDstSize,
const CanvasSharedPtr&,
......
......@@ -307,7 +307,7 @@ namespace cppcanvas
localPolygon.transform( rState.mapModeTransform );
ActionSharedPtr pPolyAction;
std::shared_ptr<Action> pPolyAction;
if (isColor) {
SAL_INFO("cppcanvas.emf", "EMF+\t\tcolor fill:0x" << std::hex << brushIndexOrColor << std::dec);
......@@ -580,7 +580,7 @@ namespace cppcanvas
bool bWasFillColorSet = rState.isFillColorSet;
rState.isFillColorSet = true;
rState.fillColor = rState.lineColor;
ActionSharedPtr pAction2(internal::PolyPolyActionFactory::createPolyPolyAction(aArrow, rParms.mrCanvas, rState));
std::shared_ptr<Action> pAction2(internal::PolyPolyActionFactory::createPolyPolyAction(aArrow, rParms.mrCanvas, rState));
if (pAction2)
{
maActions.push_back(MtfAction(pAction2, rParms.mrCurrActionIndex));
......@@ -590,7 +590,7 @@ namespace cppcanvas
}
else
{
ActionSharedPtr pAction(internal::PolyPolyActionFactory::createPolyPolyAction(aArrow, rParms.mrCanvas, rState, rAttributes));
std::shared_ptr<Action> pAction(internal::PolyPolyActionFactory::createPolyPolyAction(aArrow, rParms.mrCanvas, rState, rAttributes));
if (pAction)
{
maActions.push_back(MtfAction(pAction, rParms.mrCurrActionIndex));
......@@ -685,7 +685,7 @@ namespace cppcanvas
}
// finally render the polygon
ActionSharedPtr pPolyAction(internal::PolyPolyActionFactory::createPolyPolyAction(aFinalPolyPolygon, rParms.mrCanvas, rState, aPolygonAttributes));
std::shared_ptr<Action> pPolyAction(internal::PolyPolyActionFactory::createPolyPolyAction(aFinalPolyPolygon, rParms.mrCanvas, rState, aPolygonAttributes));
if( pPolyAction )
{
maActions.push_back(MtfAction(pPolyAction, rParms.mrCurrActionIndex));
......@@ -1236,7 +1236,7 @@ namespace cppcanvas
Size aSize( aBmp.GetSizePixel() );
SAL_INFO("cppcanvas.emf", "EMF+ bitmap size: " << aSize.Width() << "x" << aSize.Height());
if( aSize.Width() > 0 && aSize.Height() > 0 ) {
ActionSharedPtr pBmpAction (
std::shared_ptr<Action> pBmpAction (
internal::BitmapActionFactory::createBitmapAction (
aBmp,
rState.mapModeTransform * aDstPoint,
......@@ -1296,7 +1296,7 @@ namespace cppcanvas
::basegfx::B2DPoint point( Map( lx + 0.15*cellSize, ly + cellSize ) );
ActionSharedPtr pTextAction(
std::shared_ptr<Action> pTextAction(
TextActionFactory::createTextAction(
// position is just rough guess for now
// we should calculate it exactly from layoutRect or font
......@@ -1613,7 +1613,7 @@ namespace cppcanvas
::basegfx::B2DPoint point( Map( charsPosX[0], charsPosY[0] ) );
ActionSharedPtr pTextAction(
std::shared_ptr<Action> pTextAction(
TextActionFactory::createTextAction(
vcl::unotools::pointFromB2DPoint ( point ),
::Size(),
......
......@@ -142,12 +142,12 @@ namespace cppcanvas
}
}
ActionSharedPtr LineActionFactory::createLineAction( const ::basegfx::B2DPoint& rStartPoint,
std::shared_ptr<Action> LineActionFactory::createLineAction( const ::basegfx::B2DPoint& rStartPoint,
const ::basegfx::B2DPoint& rEndPoint,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
return ActionSharedPtr( new LineAction( rStartPoint,
return std::shared_ptr<Action>( new LineAction( rStartPoint,
rEndPoint,
rCanvas,
rState) );
......
......@@ -46,7 +46,7 @@ namespace cppcanvas
namespace LineActionFactory
{
/// Plain hair line from point 1 to point 2
ActionSharedPtr createLineAction( const ::basegfx::B2DPoint&,
std::shared_ptr<Action> createLineAction( const ::basegfx::B2DPoint&,
const ::basegfx::B2DPoint&,
const CanvasSharedPtr&,
const OutDevState& );
......
......@@ -155,19 +155,19 @@ namespace cppcanvas
}
}
ActionSharedPtr PointActionFactory::createPointAction( const ::basegfx::B2DPoint& rPoint,
std::shared_ptr<Action> PointActionFactory::createPointAction( const ::basegfx::B2DPoint& rPoint,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
return ActionSharedPtr( new PointAction( rPoint, rCanvas, rState ) );
return std::shared_ptr<Action>( new PointAction( rPoint, rCanvas, rState ) );
}
ActionSharedPtr PointActionFactory::createPointAction( const ::basegfx::B2DPoint& rPoint,
std::shared_ptr<Action> PointActionFactory::createPointAction( const ::basegfx::B2DPoint& rPoint,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
const ::Color& rColor )
{
return ActionSharedPtr( new PointAction( rPoint, rCanvas, rState, rColor ) );
return std::shared_ptr<Action>( new PointAction( rPoint, rCanvas, rState, rColor ) );
}
}
}
......
......@@ -46,12 +46,12 @@ namespace cppcanvas
namespace PointActionFactory
{
/// Point in current color
ActionSharedPtr createPointAction( const ::basegfx::B2DPoint&,
std::shared_ptr<Action> createPointAction( const ::basegfx::B2DPoint&,
const CanvasSharedPtr&,
const OutDevState& );
/// Point in given color
ActionSharedPtr createPointAction( const ::basegfx::B2DPoint&,
std::shared_ptr<Action> createPointAction( const ::basegfx::B2DPoint&,
const CanvasSharedPtr&,
const OutDevState&,
const ::Color& );
......
......@@ -449,55 +449,55 @@ namespace cppcanvas
}
}
ActionSharedPtr PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
std::shared_ptr<Action> PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
OSL_ENSURE( rState.isLineColorSet || rState.isFillColorSet,
"PolyPolyActionFactory::createPolyPolyAction() with empty line and fill color" );
return ActionSharedPtr( new PolyPolyAction( rPoly, rCanvas, rState,
return std::shared_ptr<Action>( new PolyPolyAction( rPoly, rCanvas, rState,
rState.isFillColorSet,
rState.isLineColorSet ) );
}
ActionSharedPtr PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
std::shared_ptr<Action> PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
const rendering::Texture& rTexture )
{
return ActionSharedPtr( new TexturedPolyPolyAction( rPoly, rCanvas, rState, rTexture ) );
return std::shared_ptr<Action>( new TexturedPolyPolyAction( rPoly, rCanvas, rState, rTexture ) );
}
ActionSharedPtr PolyPolyActionFactory::createLinePolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
std::shared_ptr<Action> PolyPolyActionFactory::createLinePolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
OSL_ENSURE( rState.isLineColorSet,
"PolyPolyActionFactory::createLinePolyPolyAction() called with empty line color" );
return ActionSharedPtr( new PolyPolyAction( rPoly, rCanvas, rState,
return std::shared_ptr<Action>( new PolyPolyAction( rPoly, rCanvas, rState,
false,
rState.isLineColorSet ) );
}
ActionSharedPtr PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
std::shared_ptr<Action> PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
const rendering::StrokeAttributes& rStrokeAttributes )
{
OSL_ENSURE( rState.isLineColorSet,
"PolyPolyActionFactory::createPolyPolyAction() for strokes called with empty line color" );
return ActionSharedPtr( new StrokedPolyPolyAction( rPoly, rCanvas, rState, rStrokeAttributes ) );
return std::shared_ptr<Action>( new StrokedPolyPolyAction( rPoly, rCanvas, rState, rStrokeAttributes ) );
}
ActionSharedPtr PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
std::shared_ptr<Action> PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
int nTransparency )
{
OSL_ENSURE( rState.isLineColorSet || rState.isFillColorSet,
"PolyPolyActionFactory::createPolyPolyAction() with empty line and fill color" );
return ActionSharedPtr( new PolyPolyAction( rPoly, rCanvas, rState,
return std::shared_ptr<Action>( new PolyPolyAction( rPoly, rCanvas, rState,
rState.isFillColorSet,
rState.isLineColorSet,
nTransparency ) );
......
......@@ -52,29 +52,29 @@ namespace cppcanvas
namespace PolyPolyActionFactory
{
/// Create polygon, fill/stroke according to state
ActionSharedPtr createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
std::shared_ptr<Action> createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
const CanvasSharedPtr&,
const OutDevState& );
/// Create texture-filled polygon
ActionSharedPtr createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
std::shared_ptr<Action> createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
const CanvasSharedPtr&,
const OutDevState&,
const css::rendering::Texture& );
/// Create line polygon (always stroked, not filled)
ActionSharedPtr createLinePolyPolyAction( const ::basegfx::B2DPolyPolygon&,
std::shared_ptr<Action> createLinePolyPolyAction( const ::basegfx::B2DPolyPolygon&,
const CanvasSharedPtr&,
const OutDevState& );
/// Create stroked polygon
ActionSharedPtr createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
std::shared_ptr<Action> createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
const CanvasSharedPtr&,
const OutDevState&,
const css::rendering::StrokeAttributes& );
/// For transparent painting of the given polygon (normally, we take the colors always opaque)
ActionSharedPtr createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
std::shared_ptr<Action> createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
const CanvasSharedPtr&,
const OutDevState&,
int nTransparency );
......
......@@ -1901,7 +1901,7 @@ namespace cppcanvas
text, and creates a properly setup OutlineAction from
it.
*/
ActionSharedPtr createOutline( const ::basegfx::B2DPoint& rStartPoint,
std::shared_ptr<Action> createOutline( const ::basegfx::B2DPoint& rStartPoint,
const ::basegfx::B2DSize& rReliefOffset,
const ::Color& rReliefColor,
const ::basegfx::B2DSize& rShadowOffset,
......@@ -1941,7 +1941,7 @@ namespace cppcanvas
rVDev.SetFont(aOrigFont);
if( !bHaveOutlines )
return ActionSharedPtr();
return std::shared_ptr<Action>();
// remove offsetting from mapmode transformation
// (outline polygons must stay at origin, only need to
......@@ -2000,7 +2000,7 @@ namespace cppcanvas
if( rParms.maTextTransformation.is_initialized() )
{
return ActionSharedPtr(
return std::shared_ptr<Action>(
new OutlineAction(
rStartPoint,
rReliefOffset,
......@@ -2017,7 +2017,7 @@ namespace cppcanvas
}
else
{
return ActionSharedPtr(
return std::shared_ptr<Action>(
new OutlineAction(
rStartPoint,
rReliefOffset,
......@@ -2036,7 +2036,7 @@ namespace cppcanvas
} // namespace
ActionSharedPtr TextActionFactory::createTextAction( const ::Point& rStartPoint,
std::shared_ptr<Action> TextActionFactory::createTextAction( const ::Point& rStartPoint,
const ::Size& rReliefOffset,
const ::Color& rReliefColor,
const ::Size& rShadowOffset,
......@@ -2099,7 +2099,7 @@ namespace cppcanvas
const ::Color aEmptyColor( COL_AUTO );
ActionSharedPtr ret;
std::shared_ptr<Action> ret;
// no DX array, and no need to subset - no need to store
// DX array, then.
......@@ -2115,7 +2115,7 @@ namespace cppcanvas
// nope
if( rParms.maTextTransformation.is_initialized() )
{
ret = ActionSharedPtr( new TextAction(
ret = std::shared_ptr<Action>( new TextAction(
aStartPoint,
rText,
nStartPos,
......@@ -2126,7 +2126,7 @@ namespace cppcanvas
}
else
{
ret = ActionSharedPtr( new TextAction(
ret = std::shared_ptr<Action>( new TextAction(
aStartPoint,
rText,
nStartPos,
......@@ -2139,7 +2139,7 @@ namespace cppcanvas
{
// at least one of the effects requested
if( rParms.maTextTransformation.is_initialized() )
ret = ActionSharedPtr( new EffectTextAction(
ret = std::shared_ptr<Action>( new EffectTextAction(
aStartPoint,
aReliefOffset,
rReliefColor,
......@@ -2153,7 +2153,7 @@ namespace cppcanvas
rState,
*rParms.maTextTransformation ) );
else
ret = ActionSharedPtr( new EffectTextAction(
ret = std::shared_ptr<Action>( new EffectTextAction(
aStartPoint,
aReliefOffset,
rReliefColor,
......@@ -2178,7 +2178,7 @@ namespace cppcanvas
{
// nope
if( rParms.maTextTransformation.is_initialized() )
ret = ActionSharedPtr( new TextArrayAction(
ret = std::shared_ptr<Action>( new TextArrayAction(
aStartPoint,
rText,
nStartPos,
......@@ -2188,7 +2188,7 @@ namespace cppcanvas
rState,
*rParms.maTextTransformation ) );
else
ret = ActionSharedPtr( new TextArrayAction(
ret = std::shared_ptr<Action>( new TextArrayAction(
aStartPoint,
rText,
nStartPos,
......@@ -2201,7 +2201,7 @@ namespace cppcanvas
{
// at least one of the effects requested
if( rParms.maTextTransformation.is_initialized() )
ret = ActionSharedPtr( new EffectTextArrayAction(
ret = std::shared_ptr<Action>( new EffectTextArrayAction(
aStartPoint,
aReliefOffset,
rReliefColor,
......@@ -2216,7 +2216,7 @@ namespace cppcanvas
rState,
*rParms.maTextTransformation ) );
else
ret = ActionSharedPtr( new EffectTextArrayAction(
ret = std::shared_ptr<Action>( new EffectTextArrayAction(
aStartPoint,
aReliefOffset,
rReliefColor,
......
......@@ -61,7 +61,7 @@ namespace cppcanvas
subsettable (Action::render( Subset ) works on
characters)
*/
ActionSharedPtr createTextAction( const ::Point& rStartPoint,
std::shared_ptr<Action> createTextAction( const ::Point& rStartPoint,
const ::Size& rReliefOffset,
const ::Color& rReliefColor,
const ::Size& rShadowOffset,
......
......@@ -477,14 +477,14 @@ namespace cppcanvas
}
ActionSharedPtr TransparencyGroupActionFactory::createTransparencyGroupAction( MtfAutoPtr&& rGroupMtf,
std::shared_ptr<Action> TransparencyGroupActionFactory::createTransparencyGroupAction( MtfAutoPtr&& rGroupMtf,
GradientAutoPtr&& rAlphaGradient,
const ::basegfx::B2DPoint& rDstPoint,
const ::basegfx::B2DVector& rDstSize,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
return ActionSharedPtr( new TransparencyGroupAction(std::move(rGroupMtf),
return std::shared_ptr<Action>( new TransparencyGroupAction(std::move(rGroupMtf),
std::move(rAlphaGradient),
rDstPoint,
rDstSize,
......
......@@ -79,7 +79,7 @@ namespace cppcanvas
Size of the transparency group object, in current
state coordinate system.
*/
ActionSharedPtr createTransparencyGroupAction( MtfAutoPtr&& rGroupMtf,
std::shared_ptr<Action> createTransparencyGroupAction( MtfAutoPtr&& rGroupMtf,
GradientAutoPtr&& rAlphaGradient,
const ::basegfx::B2DPoint& rDstPoint,
const ::basegfx::B2DVector& rDstSize,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment