summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-05-06 21:49:36 +0200
committerMichael Stahl <mstahl@redhat.com>2016-05-06 23:37:04 +0200
commit7a2afb2d7776db26e133c6c18bf9715eb43bf4dd (patch)
tree2303d572b7ab50e6623c255e8b7360649c39fbd2 /xmloff
parentf93ab86ea42789e6c3a18de83a2c838e3cd88de2 (diff)
xmloff: C++ is an imperative language, so let's write imperative loops
... instead of some over-engineered pseudo-functional boostified monstrosity. What the hell was the original author thinking? Change-Id: I64581b3f78792933373ed8f74ebbb38a8a27f1f8
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/pch/precompiled_xo.hxx1
-rw-r--r--xmloff/source/core/RDFaExportHelper.cxx24
-rw-r--r--xmloff/source/core/RDFaImportHelper.cxx30
3 files changed, 15 insertions, 40 deletions
diff --git a/xmloff/inc/pch/precompiled_xo.hxx b/xmloff/inc/pch/precompiled_xo.hxx
index b97bc243d605..5659c12e8e35 100644
--- a/xmloff/inc/pch/precompiled_xo.hxx
+++ b/xmloff/inc/pch/precompiled_xo.hxx
@@ -43,7 +43,6 @@
#include <type_traits>
#include <utility>
#include <vector>
-#include <boost/iterator_adaptors.hpp>
#include <osl/diagnose.h>
#include <osl/doublecheckedlocking.h>
#include <osl/endian.h>
diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx
index 42a25f024191..2bc047b02e1a 100644
--- a/xmloff/source/core/RDFaExportHelper.cxx
+++ b/xmloff/source/core/RDFaExportHelper.cxx
@@ -38,14 +38,6 @@
#include <rtl/ustrbuf.hxx>
-#include <boost/iterator_adaptors.hpp>
-#ifndef BOOST_ITERATOR_ADAPTOR_DWA053000_HPP_ // from iterator_adaptors.hpp
-// N.B.: the check for the header guard _of a specific version of boost_
-// is here so this may work on different versions of boost,
-// which sadly put the goods in different header files
-#include <boost/iterator/transform_iterator.hpp>
-#endif
-
#include <functional>
#include <algorithm>
@@ -165,17 +157,13 @@ RDFaExportHelper::AddRDFa(
xContent->getValue());
}
- auto aStatementToCURIE = [this](rdf::Statement const& aStatement) {
- return makeCURIE(&this->m_rExport, aStatement.Predicate);
- };
+ ::std::vector<::rtl::OUString> curies;
+ for (rdf::Statement const& rStatement : rStatements)
+ {
+ curies.push_back(makeCURIE(&m_rExport, rStatement.Predicate));
+ }
OUStringBuffer property;
- ::comphelper::intersperse(
- ::boost::make_transform_iterator(
- rStatements.begin(),
- aStatementToCURIE),
- ::boost::make_transform_iterator(
- rStatements.end(),
- aStatementToCURIE),
+ ::comphelper::intersperse(curies.begin(), curies.end(),
::comphelper::OUStringBufferAppender(property),
OUString(" "));
diff --git a/xmloff/source/core/RDFaImportHelper.cxx b/xmloff/source/core/RDFaImportHelper.cxx
index 7462a990a7ad..6e96e6d5e9f5 100644
--- a/xmloff/source/core/RDFaImportHelper.cxx
+++ b/xmloff/source/core/RDFaImportHelper.cxx
@@ -30,14 +30,6 @@
#include <rtl/ustring.hxx>
-#include <boost/iterator_adaptors.hpp>
-#ifndef BOOST_ITERATOR_ADAPTOR_DWA053000_HPP_ // from iterator_adaptors.hpp
-// N.B.: the check for the header guard _of a specific version of boost_
-// is here so this may work on different versions of boost,
-// which sadly put the goods in different header files
-#include <boost/iterator/transform_iterator.hpp>
-#endif
-
#include <map>
#include <iterator>
#include <functional>
@@ -291,7 +283,7 @@ RDFaInserter::MakeURI( OUString const & i_rURI) const
}
}
-uno::Reference< rdf::XResource>
+uno::Reference<rdf::XResource>
RDFaInserter::MakeResource( OUString const & i_rResource)
{
if (i_rResource.startsWith("_:")) // blank node
@@ -328,18 +320,14 @@ void RDFaInserter::InsertRDFaEntry(
predicates.reserve(i_rEntry.m_xRDFaAttributes->m_Properties.size());
- auto aPropertyToXURI = [this](OUString const& aProperty) { return this->MakeURI(aProperty); };
- // Store as variable so the type matches in both calls.
-
- ::std::remove_copy_if(
- ::boost::make_transform_iterator(
- i_rEntry.m_xRDFaAttributes->m_Properties.begin(),
- aPropertyToXURI),
- ::boost::make_transform_iterator(
- i_rEntry.m_xRDFaAttributes->m_Properties.end(),
- aPropertyToXURI),
- ::std::back_inserter(predicates),
- [this](uno::Reference<rdf::XURI> const& arRef) { return !arRef.is(); } );
+ for (OUString const& prop : i_rEntry.m_xRDFaAttributes->m_Properties)
+ {
+ auto const xURI(MakeURI(prop));
+ if (xURI.is())
+ {
+ predicates.push_back(xURI);
+ }
+ }
if (predicates.empty())
{