diff options
-rw-r--r-- | include/drawinglayer/primitive2d/baseprimitive2d.hxx | 17 | ||||
-rw-r--r-- | include/drawinglayer/primitive3d/baseprimitive3d.hxx | 15 | ||||
-rw-r--r-- | include/vcl/svgdata.hxx | 7 | ||||
-rw-r--r-- | svgio/source/svguno/xsvgparser.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/svgdata.cxx | 9 |
5 files changed, 29 insertions, 27 deletions
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx index fbfafae783ca..66250bb59511 100644 --- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx @@ -27,6 +27,7 @@ #include <com/sun/star/util/XAccounting.hpp> #include <cppuhelper/basemutex.hxx> #include <basegfx/range/b2drange.hxx> +#include <deque> /** defines for DeclPrimitive2DIDBlock and ImplPrimitive2DIDBlock @@ -58,21 +59,21 @@ namespace drawinglayer { namespace primitive2d { typedef css::uno::Sequence< Primitive2DReference > Primitive2DSequence; - class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer : public std::vector< Primitive2DReference > + class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer : public std::deque< Primitive2DReference > { public: explicit Primitive2DContainer() {} - explicit Primitive2DContainer( size_type count ) : vector(count) {} - Primitive2DContainer( const Primitive2DContainer& other ) : vector(other) {} - Primitive2DContainer( const Primitive2DContainer&& other ) : vector(other) {} - Primitive2DContainer( const vector< Primitive2DReference >& other ) : vector(other) {} - Primitive2DContainer( std::initializer_list<Primitive2DReference> init ) : vector(init) {} + explicit Primitive2DContainer( size_type count ) : deque(count) {} + Primitive2DContainer( const Primitive2DContainer& other ) : deque(other) {} + Primitive2DContainer( const Primitive2DContainer&& other ) : deque(other) {} + Primitive2DContainer( const std::deque< Primitive2DReference >& other ) : deque(other) {} + Primitive2DContainer( std::initializer_list<Primitive2DReference> init ) : deque(init) {} void append(const Primitive2DContainer& rSource); void append(const Primitive2DSequence& rSource); void append(Primitive2DContainer&& rSource); - Primitive2DContainer& operator=(const Primitive2DContainer& r) { vector::operator=(r); return *this; } - Primitive2DContainer& operator=(const Primitive2DContainer&& r) { vector::operator=(r); return *this; } + Primitive2DContainer& operator=(const Primitive2DContainer& r) { deque::operator=(r); return *this; } + Primitive2DContainer& operator=(const Primitive2DContainer&& r) { deque::operator=(r); return *this; } bool operator==(const Primitive2DContainer& rB) const; bool operator!=(const Primitive2DContainer& rB) const { return !operator==(rB); } basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& aViewInformation) const; diff --git a/include/drawinglayer/primitive3d/baseprimitive3d.hxx b/include/drawinglayer/primitive3d/baseprimitive3d.hxx index ef75d4e808e1..61a563485e75 100644 --- a/include/drawinglayer/primitive3d/baseprimitive3d.hxx +++ b/include/drawinglayer/primitive3d/baseprimitive3d.hxx @@ -26,6 +26,7 @@ #include <cppuhelper/basemutex.hxx> #include <com/sun/star/graphic/XPrimitive3D.hpp> #include <basegfx/range/b3drange.hxx> +#include <deque> /** defines for DeclPrimitive3DIDBlock and ImplPrimitive3DIDBlock @@ -53,18 +54,18 @@ namespace drawinglayer { namespace primitive3d { typedef css::uno::Reference< css::graphic::XPrimitive3D > Primitive3DReference; typedef css::uno::Sequence< Primitive3DReference > Primitive3DSequence; - class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive3DContainer : public std::vector< Primitive3DReference > + class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive3DContainer : public std::deque< Primitive3DReference > { public: explicit Primitive3DContainer() {} - explicit Primitive3DContainer( size_type count ) : vector(count) {} - Primitive3DContainer( const Primitive3DContainer& other ) : vector(other) {} - Primitive3DContainer( const Primitive3DContainer&& other ) : vector(other) {} - Primitive3DContainer( std::initializer_list<Primitive3DReference> init ) : vector(init) {} + explicit Primitive3DContainer( size_type count ) : deque(count) {} + Primitive3DContainer( const Primitive3DContainer& other ) : deque(other) {} + Primitive3DContainer( const Primitive3DContainer&& other ) : deque(other) {} + Primitive3DContainer( std::initializer_list<Primitive3DReference> init ) : deque(init) {} void append(const Primitive3DContainer& rSource); - Primitive3DContainer& operator=(const Primitive3DContainer& r) { vector::operator=(r); return *this; } - Primitive3DContainer& operator=(const Primitive3DContainer&& r) { vector::operator=(r); return *this; } + Primitive3DContainer& operator=(const Primitive3DContainer& r) { deque::operator=(r); return *this; } + Primitive3DContainer& operator=(const Primitive3DContainer&& r) { deque::operator=(r); return *this; } bool operator==(const Primitive3DContainer& rB) const; bool operator!=(const Primitive3DContainer& rB) const { return !operator==(rB); } basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& aViewInformation) const; diff --git a/include/vcl/svgdata.hxx b/include/vcl/svgdata.hxx index 740137804d27..7ab2d8ce89c8 100644 --- a/include/vcl/svgdata.hxx +++ b/include/vcl/svgdata.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/graphic/XPrimitive2D.hpp> #include <vcl/bitmapex.hxx> #include <rtl/ustring.hxx> +#include <deque> typedef css::uno::Sequence<sal_Int8> SvgDataArray; @@ -33,7 +34,7 @@ typedef css::uno::Sequence<sal_Int8> SvgDataArray; // using default parameters and graphic::XPrimitive2DRenderer BitmapEx VCL_DLLPUBLIC convertPrimitive2DSequenceToBitmapEx( - const std::vector< css::uno::Reference< css::graphic::XPrimitive2D > >& rSequence, + const std::deque< css::uno::Reference< css::graphic::XPrimitive2D > >& rSequence, const basegfx::B2DRange& rTargetRange, const sal_uInt32 nMaximumQuadraticPixels = 500000); @@ -49,7 +50,7 @@ private: // on demand created content basegfx::B2DRange maRange; - std::vector< css::uno::Reference< css::graphic::XPrimitive2D > > + std::deque< css::uno::Reference< css::graphic::XPrimitive2D > > maSequence; BitmapEx maReplacement; size_t mNestedBitmapSize; @@ -74,7 +75,7 @@ public: /// data read and evtl. on demand creation const basegfx::B2DRange& getRange() const; - const std::vector< css::uno::Reference< css::graphic::XPrimitive2D > >& getPrimitive2DSequence() const; + const std::deque< css::uno::Reference< css::graphic::XPrimitive2D > >& getPrimitive2DSequence() const; const BitmapEx& getReplacement() const; }; diff --git a/svgio/source/svguno/xsvgparser.cxx b/svgio/source/svguno/xsvgparser.cxx index 91ded1f99b21..e84f5f67e3c0 100644 --- a/svgio/source/svguno/xsvgparser.cxx +++ b/svgio/source/svguno/xsvgparser.cxx @@ -105,7 +105,7 @@ namespace svgio const uno::Reference< ::io::XInputStream >& xSVGStream, const OUString& aAbsolutePath ) throw (uno::RuntimeException, std::exception) { - drawinglayer::primitive2d::Primitive2DSequence aRetval; + drawinglayer::primitive2d::Primitive2DContainer aRetval; if(xSVGStream.is()) { @@ -156,9 +156,7 @@ namespace svgio if(Display_none != pCandidate->getDisplay()) { - drawinglayer::primitive2d::Primitive2DContainer aTmp = comphelper::sequenceToContainer<drawinglayer::primitive2d::Primitive2DContainer>(aRetval); - pCandidate->decomposeSvgNode(aTmp, false); - aRetval = comphelper::containerToSequence(aTmp); + pCandidate->decomposeSvgNode(aRetval, false); } } } @@ -167,7 +165,7 @@ namespace svgio OSL_ENSURE(false, "Invalid stream (!)"); } - return aRetval; + return comphelper::containerToSequence(aRetval); } OUString SAL_CALL XSvgParser::getImplementationName() throw(uno::RuntimeException, std::exception) diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx index 9fd84e6be53f..1ec5014a2847 100644 --- a/vcl/source/gdi/svgdata.cxx +++ b/vcl/source/gdi/svgdata.cxx @@ -34,7 +34,7 @@ using namespace ::com::sun::star; BitmapEx convertPrimitive2DSequenceToBitmapEx( - const std::vector< css::uno::Reference< css::graphic::XPrimitive2D > >& rSequence, + const std::deque< css::uno::Reference< css::graphic::XPrimitive2D > >& rSequence, const basegfx::B2DRange& rTargetRange, const sal_uInt32 nMaximumQuadraticPixels) { @@ -90,7 +90,7 @@ BitmapEx convertPrimitive2DSequenceToBitmapEx( } size_t estimateSize( - std::vector<uno::Reference<graphic::XPrimitive2D>> const& rSequence) + std::deque<uno::Reference<graphic::XPrimitive2D>> const& rSequence) { size_t nRet(0); for (auto& it : rSequence) @@ -131,7 +131,8 @@ void SvgData::ensureSequenceAndRange() { const uno::Reference< graphic::XSvgParser > xSvgParser = graphic::SvgTools::create(xContext); - maSequence = comphelper::sequenceToContainer< std::vector< css::uno::Reference< css::graphic::XPrimitive2D > > >(xSvgParser->getDecomposition(myInputStream, maPath)); + maSequence = comphelper::sequenceToContainer<std::deque<css::uno::Reference< css::graphic::XPrimitive2D >>, + css::uno::Reference< css::graphic::XPrimitive2D >>(xSvgParser->getDecomposition(myInputStream, maPath)); } catch(const uno::Exception&) { @@ -220,7 +221,7 @@ const basegfx::B2DRange& SvgData::getRange() const return maRange; } -const std::vector< css::uno::Reference< css::graphic::XPrimitive2D > >& SvgData::getPrimitive2DSequence() const +const std::deque< css::uno::Reference< css::graphic::XPrimitive2D > >& SvgData::getPrimitive2DSequence() const { const_cast< SvgData* >(this)->ensureSequenceAndRange(); |