diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-12-17 14:58:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-12-17 16:51:16 +0100 |
commit | ba3a9184045f7862ee94de8b3210dcbe9558f61a (patch) | |
tree | 6b6042d146c4d3833cc0ecdec5e5feb4a5debe97 /xmloff | |
parent | 21e72c5f1d315068b0aa6afd3b9750c2ad878dcb (diff) |
Remove trivial class XMLTransformerContextVector
Change-Id: I140614895d5727ffd97681ddd06bf7439fe7a443
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/transform/ChartPlotAreaOOoTContext.hxx | 5 | ||||
-rw-r--r-- | xmloff/source/transform/CreateElemTContext.cxx | 13 | ||||
-rw-r--r-- | xmloff/source/transform/DeepTContext.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/transform/DeepTContext.hxx | 3 | ||||
-rw-r--r-- | xmloff/source/transform/TContextVector.hxx | 35 | ||||
-rw-r--r-- | xmloff/source/transform/TransformerBase.cxx | 34 | ||||
-rw-r--r-- | xmloff/source/transform/TransformerBase.hxx | 8 |
7 files changed, 34 insertions, 70 deletions
diff --git a/xmloff/source/transform/ChartPlotAreaOOoTContext.hxx b/xmloff/source/transform/ChartPlotAreaOOoTContext.hxx index 75a14f59c1ec..b18df34be5dc 100644 --- a/xmloff/source/transform/ChartPlotAreaOOoTContext.hxx +++ b/xmloff/source/transform/ChartPlotAreaOOoTContext.hxx @@ -19,8 +19,11 @@ #ifndef INCLUDED_XMLOFF_SOURCE_TRANSFORM_CHARTPLOTAREAOOOTCONTEXT_HXX #define INCLUDED_XMLOFF_SOURCE_TRANSFORM_CHARTPLOTAREAOOOTCONTEXT_HXX +#include <sal/config.h> + +#include <vector> + #include "ProcAttrTContext.hxx" -#include "TContextVector.hxx" class XMLAxisOOoContext; diff --git a/xmloff/source/transform/CreateElemTContext.cxx b/xmloff/source/transform/CreateElemTContext.cxx index 2a39c9a69bc3..48fad335200d 100644 --- a/xmloff/source/transform/CreateElemTContext.cxx +++ b/xmloff/source/transform/CreateElemTContext.cxx @@ -17,11 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <vector> + #include "CreateElemTContext.hxx" #include "MutableAttrList.hxx" #include "TransformerBase.hxx" #include "TransformerActions.hxx" -#include "TContextVector.hxx" #include "FlatTContext.hxx" #include "AttrTransformerAction.hxx" #include <xmloff/nmspmap.hxx> @@ -49,7 +52,7 @@ void XMLCreateElemTransformerContext::StartElement( { Reference< XAttributeList > xAttrList( rAttrList ); - XMLTransformerContextVector aChildContexts; + std::vector<rtl::Reference<XMLTransformerContext>> aChildContexts; XMLMutableAttributeList *pMutableAttrList = nullptr; XMLTransformerActions *pActions = @@ -106,11 +109,9 @@ void XMLCreateElemTransformerContext::StartElement( } XMLTransformerContext::StartElement( xAttrList ); - XMLTransformerContextVector::iterator aIter = aChildContexts.begin(); - - for( ; aIter != aChildContexts.end(); ++aIter ) + for (auto const & i: aChildContexts) { - (*aIter)->Export(); + i->Export(); } } diff --git a/xmloff/source/transform/DeepTContext.cxx b/xmloff/source/transform/DeepTContext.cxx index d078cff27c31..86680110d86e 100644 --- a/xmloff/source/transform/DeepTContext.cxx +++ b/xmloff/source/transform/DeepTContext.cxx @@ -152,11 +152,9 @@ rtl::Reference<XMLTransformerContext> XMLPersElemContentTContext::CreateChildCon void XMLPersElemContentTContext::ExportContent() { - XMLTransformerContextVector::iterator aIter = m_aChildContexts.begin(); - - for( ; aIter != m_aChildContexts.end(); ++aIter ) + for (auto const & i: m_aChildContexts) { - (*aIter)->Export(); + i->Export(); } } diff --git a/xmloff/source/transform/DeepTContext.hxx b/xmloff/source/transform/DeepTContext.hxx index 8031b15f7251..d1e9c068aca3 100644 --- a/xmloff/source/transform/DeepTContext.hxx +++ b/xmloff/source/transform/DeepTContext.hxx @@ -24,11 +24,10 @@ #include <vector> #include "PersAttrListTContext.hxx" -#include "TContextVector.hxx" class XMLPersElemContentTContext : public XMLPersAttrListTContext { - XMLTransformerContextVector m_aChildContexts; + std::vector<rtl::Reference<XMLTransformerContext>> m_aChildContexts; public: // element content persistence only diff --git a/xmloff/source/transform/TContextVector.hxx b/xmloff/source/transform/TContextVector.hxx deleted file mode 100644 index ed4e62a3da75..000000000000 --- a/xmloff/source/transform/TContextVector.hxx +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 . - */ - -#ifndef INCLUDED_XMLOFF_SOURCE_TRANSFORM_TCONTEXTVECTOR_HXX -#define INCLUDED_XMLOFF_SOURCE_TRANSFORM_TCONTEXTVECTOR_HXX - -#include <rtl/ref.hxx> - -#include <vector> -#include "TransformerContext.hxx" - -class XMLTransformerContextVector : - public ::std::vector< ::rtl::Reference< XMLTransformerContext > > -{ -}; - -#endif // INCLUDED_XMLOFF_SOURCE_TRANSFORM_TCONTEXTVECTOR_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index 4b4341fd2fec..71a78dde00dc 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -40,7 +40,6 @@ #include "TransformerTokenMap.hxx" #include "TransformerBase.hxx" -#include "TContextVector.hxx" using namespace ::osl; using namespace ::xmloff::token; @@ -187,7 +186,6 @@ XMLTransformerBase::XMLTransformerBase( XMLTransformerActionInit *pInit, throw () : m_pNamespaceMap( new SvXMLNamespaceMap ), m_pReplaceNamespaceMap( new SvXMLNamespaceMap ), - m_pContexts( new XMLTransformerContextVector ), m_pElemActions( new XMLTransformerActions( pInit ) ), m_pTokenMap( new XMLTransformerTokenMap( pTKMapInit ) ) { @@ -204,7 +202,6 @@ XMLTransformerBase::~XMLTransformerBase() throw () { delete m_pNamespaceMap; delete m_pReplaceNamespaceMap; - delete m_pContexts; delete m_pElemActions; delete m_pTokenMap; } @@ -288,9 +285,9 @@ void SAL_CALL XMLTransformerBase::startElement( const OUString& rName, // If there are contexts already, call a CreateChildContext at the topmost // context. Otherwise, create a default context. ::rtl::Reference < XMLTransformerContext > xContext; - if( !m_pContexts->empty() ) + if( !m_pContexts.empty() ) { - xContext = m_pContexts->back()->CreateChildContext( nPrefix, + xContext = m_pContexts.back()->CreateChildContext( nPrefix, aLocalName, rName, xAttrList ); @@ -309,7 +306,7 @@ void SAL_CALL XMLTransformerBase::startElement( const OUString& rName, xContext->SetRewindMap( pRewindMap ); // Push context on stack. - m_pContexts->push_back( xContext ); + m_pContexts.push_back( xContext ); // Call a startElement at the new context. xContext->StartElement( xAttrList ); @@ -322,10 +319,10 @@ rName ) throw(SAXException, RuntimeException, std::exception) { - if( !m_pContexts->empty() ) + if( !m_pContexts.empty() ) { // Get topmost context - ::rtl::Reference< XMLTransformerContext > xContext = m_pContexts->back(); + ::rtl::Reference< XMLTransformerContext > xContext = m_pContexts.back(); #if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( xContext->GetQName() == rName, @@ -336,7 +333,7 @@ rName xContext->EndElement(); // and remove it from the stack. - m_pContexts->pop_back(); + m_pContexts.pop_back(); // Get a namespace map to rewind. SvXMLNamespaceMap *pRewindMap = xContext->GetRewindMap(); @@ -356,9 +353,9 @@ rName void SAL_CALL XMLTransformerBase::characters( const OUString& rChars ) throw(SAXException, RuntimeException, std::exception) { - if( !m_pContexts->empty() ) + if( !m_pContexts.empty() ) { - m_pContexts->back()->Characters( rChars ); + m_pContexts.back()->Characters( rChars ); } } @@ -852,7 +849,7 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( case XML_ATACTION_WRITER_BACK_GRAPHIC_TRANSPARENCY: { // determine, if it's the transparency of a document style - XMLTransformerContext* pFirstContext = (*m_pContexts)[0].get(); + XMLTransformerContext* pFirstContext = m_pContexts[0].get(); OUString aFirstContextLocalName; /* sal_uInt16 nFirstContextPrefix = */ GetNamespaceMap().GetKeyByAttrName( pFirstContext->GetQName(), @@ -1427,23 +1424,20 @@ XMLTokenEnum XMLTransformerBase::GetToken( const OUString& rStr ) const const XMLTransformerContext *XMLTransformerBase::GetCurrentContext() const { - OSL_ENSURE( !m_pContexts->empty(), "empty stack" ); + OSL_ENSURE( !m_pContexts.empty(), "empty stack" ); - return m_pContexts->empty() ? nullptr : m_pContexts->back().get(); + return m_pContexts.empty() ? nullptr : m_pContexts.back().get(); } const XMLTransformerContext *XMLTransformerBase::GetAncestorContext( sal_uInt32 n ) const { - XMLTransformerContextVector::size_type nSize = - m_pContexts->size(); - XMLTransformerContextVector::size_type nPos = - static_cast<XMLTransformerContextVector::size_type>( n ); + auto nSize = m_pContexts.size(); - OSL_ENSURE( nSize >nPos+2 , "invalid context" ); + OSL_ENSURE( nSize > n + 2 , "invalid context" ); - return nSize > nPos+2 ? (*m_pContexts)[nSize-(nPos+2)].get() : nullptr; + return nSize > n + 2 ? m_pContexts[nSize - (n + 2)].get() : nullptr; } bool XMLTransformerBase::isWriter() const diff --git a/xmloff/source/transform/TransformerBase.hxx b/xmloff/source/transform/TransformerBase.hxx index 18ccf6b71d86..4dbb03cbcfc7 100644 --- a/xmloff/source/transform/TransformerBase.hxx +++ b/xmloff/source/transform/TransformerBase.hxx @@ -20,12 +20,17 @@ #ifndef INCLUDED_XMLOFF_SOURCE_TRANSFORM_TRANSFORMERBASE_HXX #define INCLUDED_XMLOFF_SOURCE_TRANSFORM_TRANSFORMERBASE_HXX +#include <sal/config.h> + +#include <vector> + #include <com/sun/star/xml/sax/SAXParseException.hpp> #include <com/sun/star/xml/sax/SAXException.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/xml/sax/XLocator.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/XModel.hpp> +#include <rtl/ref.hxx> #include <xmloff/xmltoken.hxx> #include "Transformer.hxx" @@ -36,7 +41,6 @@ namespace com { namespace sun { namespace star { class SvXMLNamespaceMap; class XMLTransformerContext; -class XMLTransformerContextVector; class XMLTransformerActions; struct XMLTransformerActionInit; struct TransformerAction_Impl; @@ -60,7 +64,7 @@ class XMLTransformerBase : public XMLTransformer SvXMLNamespaceMap *m_pNamespaceMap; SvXMLNamespaceMap *m_pReplaceNamespaceMap; - XMLTransformerContextVector *m_pContexts; + std::vector<rtl::Reference<XMLTransformerContext>> m_pContexts; XMLTransformerActions *m_pElemActions; XMLTransformerTokenMap *m_pTokenMap; |