| 1 | /** |
| 2 | * SPDX-FileCopyrightText: (C) 2009 Dominik Seichter <[email protected]> |
| 3 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 4 | */ |
| 5 | |
| 6 | #include "DeleteOperation.h" |
| 7 | |
| 8 | #include <podofo/podofo.h> |
| 9 | #include <sstream> |
| 10 | |
| 11 | using namespace std; |
| 12 | using namespace PoDoFo; |
| 13 | |
| 14 | DeleteOperation::DeleteOperation(unsigned pageIndex) |
| 15 | : m_pageIndex(pageIndex) |
| 16 | { |
| 17 | } |
| 18 | |
| 19 | void DeleteOperation::Perform(PdfDocument& doc) |
| 20 | { |
| 21 | doc.GetPages().RemovePageAt(m_pageIndex); |
| 22 | } |
| 23 | |
| 24 | string DeleteOperation::ToString() const |
| 25 | { |
| 26 | ostringstream oss; |
| 27 | oss << "Deleting page: " << m_pageIndex << "." << std::endl; |
| 28 | return oss.str(); |
| 29 | } |