LCOV - code coverage report
Current view: top level - writerfilter/source/rtftok - rtflookahead.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 43 53 81.1 %
Date: 2014-04-11 Functions: 14 20 70.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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             :  */
       9             : 
      10             : #include <boost/shared_ptr.hpp>
      11             : 
      12             : #include <com/sun/star/task/XStatusIndicator.hpp>
      13             : #include <tools/stream.hxx>
      14             : 
      15             : #include <rtflookahead.hxx>
      16             : 
      17             : using namespace com::sun::star;
      18             : 
      19             : namespace writerfilter {
      20             : namespace rtftok {
      21             : 
      22           5 : RTFLookahead::RTFLookahead(SvStream& rStream, sal_Size nGroupStart)
      23             :     : m_rStream(rStream),
      24           5 :     m_bHasTable(false)
      25             : {
      26           5 :     sal_Size nPos = m_rStream.Tell();
      27           5 :     m_rStream.Seek(nGroupStart);
      28           5 :     uno::Reference<task::XStatusIndicator> xStatusIndicator;
      29           5 :     m_pTokenizer.reset(new RTFTokenizer(*this, &m_rStream, xStatusIndicator));
      30           5 :     m_pTokenizer->resolveParse();
      31           5 :     m_rStream.Seek(nPos);
      32           5 : }
      33             : 
      34           5 : RTFLookahead::~RTFLookahead()
      35             : {
      36           5 : }
      37             : 
      38         234 : int RTFLookahead::dispatchDestination(RTFKeyword /*nKeyword*/)
      39             : {
      40         234 :     return 0;
      41             : }
      42             : 
      43         235 : int RTFLookahead::dispatchFlag(RTFKeyword nKeyword)
      44             : {
      45         235 :     if (nKeyword == RTF_INTBL)
      46           6 :         m_bHasTable = true;
      47         235 :     return 0;
      48             : }
      49             : 
      50          30 : int RTFLookahead::dispatchSymbol(RTFKeyword /*nKeyword*/)
      51             : {
      52          30 :     return 0;
      53             : }
      54             : 
      55           1 : int RTFLookahead::dispatchToggle(RTFKeyword /*nKeyword*/, bool /*bParam*/, int /*nParam*/)
      56             : {
      57           1 :     return 0;
      58             : }
      59             : 
      60         133 : int RTFLookahead::dispatchValue(RTFKeyword /*nKeyword*/, int /*nParam*/)
      61             : {
      62         133 :     return 0;
      63             : }
      64             : 
      65         142 : int RTFLookahead::resolveChars(char ch)
      66             : {
      67        1115 :     while(!m_rStream.IsEof() && (ch != '{' && ch != '}' && ch != '\\'))
      68         831 :         m_rStream.ReadChar( ch );
      69         142 :     if (!m_rStream.IsEof())
      70         142 :         m_rStream.SeekRel(-1);
      71         142 :     return 0;
      72             : }
      73             : 
      74         240 : int RTFLookahead::pushState()
      75             : {
      76         240 :     m_pTokenizer->pushGroup();
      77         240 :     return 0;
      78             : }
      79             : 
      80         240 : int RTFLookahead::popState()
      81             : {
      82         240 :     m_pTokenizer->popGroup();
      83         240 :     return 0;
      84             : }
      85             : 
      86         634 : RTFDestinationState RTFLookahead::getDestinationState()
      87             : {
      88         634 :     return DESTINATION_NORMAL;
      89             : }
      90             : 
      91           0 : void RTFLookahead::setDestinationState(RTFDestinationState /*nDestinationState*/)
      92             : {
      93           0 : }
      94             : 
      95        1722 : RTFInternalState RTFLookahead::getInternalState()
      96             : {
      97        1722 :     return INTERNAL_NORMAL;
      98             : }
      99             : 
     100           0 : void RTFLookahead::setInternalState(RTFInternalState /*nInternalState*/)
     101             : {
     102           0 : }
     103             : 
     104           0 : bool RTFLookahead::getSkipUnknown()
     105             : {
     106           0 :     return false;
     107             : }
     108             : 
     109           0 : void RTFLookahead::setSkipUnknown(bool /*bSkipUnknown*/)
     110             : {
     111           0 : }
     112             : 
     113           0 : void RTFLookahead::finishSubstream()
     114             : {
     115           0 : }
     116             : 
     117           5 : bool RTFLookahead::isSubstream() const
     118             : {
     119           5 :     return false;
     120             : }
     121             : 
     122           5 : bool RTFLookahead::hasTable()
     123             : {
     124           5 :     return m_bHasTable;
     125             : }
     126             : 
     127             : } // namespace rtftok
     128             : } // namespace writerfilter
     129             : 
     130             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10