<commit_before>/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
 * This file is part of the libkeynote 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/.
 */

#include <cmath>
#include <deque>

#include <boost/bind.hpp>

#include "KNOutput.h"
#include "KNPath.h"
#include "KNShape.h"
#include "KNText.h"
#include "KNTransformation.h"
#include "KNTypes.h"

using std::deque;

namespace libkeynote
{

KNShape::KNShape()
  : geometry()
  , style()
  , path()
  , text()
{
}

namespace
{

class ShapeObject : public KNObject
{
public:
  ShapeObject(const KNShapePtr_t &shape);
  virtual ~ShapeObject();

private:
  virtual void draw(const KNOutput &output);

private:
  const KNShapePtr_t m_shape;
};

ShapeObject::ShapeObject(const KNShapePtr_t &shape)
  : m_shape(shape)
{
}

ShapeObject::~ShapeObject()
{
}

void ShapeObject::draw(const KNOutput &output)
{
  if (bool(m_shape) && bool(m_shape->path))
  {
    // TODO: make style

    const KNTransformation myTr = bool(m_shape->geometry) ? makeTransformation(*m_shape->geometry) : KNTransformation();
    KNOutput newOutput(output, myTr, m_shape->style);
    const KNPath path = *m_shape->path * newOutput.getTransformation();

    libwpg::WPGPaintInterface *const painter = output.getPainter();

    painter->setStyle(WPXPropertyList(), WPXPropertyListVector());
    painter->drawPath(path.toWPG());<commit_msg>rename variable<commit_after>/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
 * This file is part of the libkeynote 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/.
 */

#include <cmath>
#include <deque>

#include <boost/bind.hpp>

#include "KNOutput.h"
#include "KNPath.h"
#include "KNShape.h"
#include "KNText.h"
#include "KNTransformation.h"
#include "KNTypes.h"

using std::deque;

namespace libkeynote
{

KNShape::KNShape()
  : geometry()
  , style()
  , path()
  , text()
{
}

namespace
{

class ShapeObject : public KNObject
{
public:
  ShapeObject(const KNShapePtr_t &shape);
  virtual ~ShapeObject();

private:
  virtual void draw(const KNOutput &output);

private:
  const KNShapePtr_t m_shape;
};

ShapeObject::ShapeObject(const KNShapePtr_t &shape)
  : m_shape(shape)
{
}

ShapeObject::~ShapeObject()
{
}

void ShapeObject::draw(const KNOutput &output)
{
  if (bool(m_shape) && bool(m_shape->path))
  {
    // TODO: make style

    const KNTransformation tr = bool(m_shape->geometry) ? makeTransformation(*m_shape->geometry) : KNTransformation();
    KNOutput newOutput(output, tr, m_shape->style);
    const KNPath path = *m_shape->path * newOutput.getTransformation();

    libwpg::WPGPaintInterface *const painter = output.getPainter();

    painter->setStyle(WPXPropertyList(), WPXPropertyListVector());
    painter->drawPath(path.toWPG());
{'fraction_non_alphanumeric': 0.14322414900449582, 'fraction_numerical': 0.0038535645472061657, 'mean_word_length': 4.389273356401384, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7016123', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1084, 'n_words': 272}