// SPDX-FileCopyrightText: 2010 Brad Hards <bradh@frogmouth.net>
// SPDX-License-Identifier: LGPL-2.1-or-later

#include "GeneratorPcdataDestination_p.h"

#include "AbstractRtfOutput.h"
#include "PcdataDestination_p.h"

#include <QString>

namespace QRtfReader
{
GeneratorPcdataDestination::GeneratorPcdataDestination(AbstractRtfOutput *output, const QString &name)
    : PcdataDestination(output, name)
{
}

GeneratorPcdataDestination::~GeneratorPcdataDestination() = default;

void GeneratorPcdataDestination::aboutToEndDestination()
{
    if (m_pcdata.endsWith(QLatin1Char(';'))) {
        // trim off the trailing semicolon
        m_pcdata.chop(1);
    }
    m_output->setGeneratorInformation(m_pcdata);
}
}
