Avoid potential negative array index access to cached text.
[LibreOffice.git] / writerfilter / source / rtftok / rtfskipdestination.cxx
blobad2122318333fc684e1a191b9a6b9591dc5dcf15
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include "rtfskipdestination.hxx"
11 #include <sal/log.hxx>
12 #include "rtflistener.hxx"
14 namespace writerfilter::rtftok
16 RTFSkipDestination::RTFSkipDestination(RTFListener& rImport)
17 : m_rImport(rImport)
18 , m_bParsed(true)
19 , m_bReset(true)
23 RTFSkipDestination::~RTFSkipDestination()
25 if (m_rImport.getSkipUnknown() && m_bReset)
27 if (!m_bParsed)
29 SAL_INFO("writerfilter", __func__ << ": skipping destination");
30 m_rImport.setDestination(Destination::SKIP);
32 m_rImport.setSkipUnknown(false);
36 void RTFSkipDestination::setParsed(bool bParsed) { m_bParsed = bParsed; }
38 void RTFSkipDestination::setReset(bool bReset) { m_bReset = bReset; }
40 } // namespace writerfilter::rtftok
42 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */