fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / oox / source / shape / ShapeFilterBase.cxx
blob2d886749528eb1f48c1f31b68e3eb628419e868c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include "ShapeFilterBase.hxx"
21 #include "oox/drawingml/chart/chartconverter.hxx"
22 #include "oox/ole/vbaproject.hxx"
23 #include "oox/drawingml/theme.hxx"
25 namespace oox {
26 namespace shape {
28 using namespace ::com::sun::star;
30 ShapeFilterBase::ShapeFilterBase( const uno::Reference< uno::XComponentContext >& rxContext ) throw( uno::RuntimeException ) :
31 XmlFilterBase( rxContext ),
32 mxChartConv( new ::oox::drawingml::chart::ChartConverter )
36 ShapeFilterBase::~ShapeFilterBase()
40 const ::oox::drawingml::Theme* ShapeFilterBase::getCurrentTheme() const
42 return mpTheme.get();
45 void ShapeFilterBase::setCurrentTheme(::oox::drawingml::ThemePtr pTheme)
47 mpTheme = pTheme;
50 ::oox::vml::Drawing* ShapeFilterBase::getVmlDrawing()
52 return 0;
55 const ::oox::drawingml::table::TableStyleListPtr ShapeFilterBase::getTableStyles()
57 return ::oox::drawingml::table::TableStyleListPtr();
60 ::oox::drawingml::chart::ChartConverter* ShapeFilterBase::getChartConverter()
62 return mxChartConv.get();
65 ::oox::ole::VbaProject* ShapeFilterBase::implCreateVbaProject() const
67 return new ::oox::ole::VbaProject( getComponentContext(), getModel(), "Writer" );
70 OUString ShapeFilterBase::getImplementationName() throw (css::uno::RuntimeException, std::exception)
72 return OUString();
75 /// Graphic helper for shapes, that can manage color schemes.
76 class ShapeGraphicHelper : public GraphicHelper
78 public:
79 explicit ShapeGraphicHelper( const ShapeFilterBase& rFilter );
80 virtual sal_Int32 getSchemeColor( sal_Int32 nToken ) const SAL_OVERRIDE;
81 private:
82 const ShapeFilterBase& mrFilter;
85 ShapeGraphicHelper::ShapeGraphicHelper( const ShapeFilterBase& rFilter ) :
86 GraphicHelper( rFilter.getComponentContext(), rFilter.getTargetFrame(), rFilter.getStorage() ),
87 mrFilter( rFilter )
91 sal_Int32 ShapeGraphicHelper::getSchemeColor( sal_Int32 nToken ) const
93 return mrFilter.getSchemeColor( nToken );
96 GraphicHelper* ShapeFilterBase::implCreateGraphicHelper() const
98 return new ShapeGraphicHelper( *this );
101 sal_Int32 ShapeFilterBase::getSchemeColor( sal_Int32 nToken ) const
103 sal_Int32 nColor = 0;
105 if (mpTheme.get())
106 mpTheme->getClrScheme().getColor( nToken, nColor );
108 return nColor;
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */