LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwpmarker.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 52 280 18.6 %
Date: 2012-08-25 Functions: 9 30 30.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 11 169 6.5 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  *  The Contents of this file are made available subject to the terms of
       5                 :            :  *  either of the following licenses
       6                 :            :  *
       7                 :            :  *         - GNU Lesser General Public License Version 2.1
       8                 :            :  *         - Sun Industry Standards Source License Version 1.1
       9                 :            :  *
      10                 :            :  *  Sun Microsystems Inc., October, 2000
      11                 :            :  *
      12                 :            :  *  GNU Lesser General Public License Version 2.1
      13                 :            :  *  =============================================
      14                 :            :  *  Copyright 2000 by Sun Microsystems, Inc.
      15                 :            :  *  901 San Antonio Road, Palo Alto, CA 94303, USA
      16                 :            :  *
      17                 :            :  *  This library is free software; you can redistribute it and/or
      18                 :            :  *  modify it under the terms of the GNU Lesser General Public
      19                 :            :  *  License version 2.1, as published by the Free Software Foundation.
      20                 :            :  *
      21                 :            :  *  This library is distributed in the hope that it will be useful,
      22                 :            :  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
      23                 :            :  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      24                 :            :  *  Lesser General Public License for more details.
      25                 :            :  *
      26                 :            :  *  You should have received a copy of the GNU Lesser General Public
      27                 :            :  *  License along with this library; if not, write to the Free Software
      28                 :            :  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
      29                 :            :  *  MA  02111-1307  USA
      30                 :            :  *
      31                 :            :  *
      32                 :            :  *  Sun Industry Standards Source License Version 1.1
      33                 :            :  *  =================================================
      34                 :            :  *  The contents of this file are subject to the Sun Industry Standards
      35                 :            :  *  Source License Version 1.1 (the "License"); You may not use this file
      36                 :            :  *  except in compliance with the License. You may obtain a copy of the
      37                 :            :  *  License at http://www.openoffice.org/license.html.
      38                 :            :  *
      39                 :            :  *  Software provided under this License is provided on an "AS IS" basis,
      40                 :            :  *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
      41                 :            :  *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
      42                 :            :  *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
      43                 :            :  *  See the License for the specific provisions governing your rights and
      44                 :            :  *  obligations concerning the Software.
      45                 :            :  *
      46                 :            :  *  The Initial Developer of the Original Code is: IBM Corporation
      47                 :            :  *
      48                 :            :  *  Copyright: 2008 by IBM Corporation
      49                 :            :  *
      50                 :            :  *  All Rights Reserved.
      51                 :            :  *
      52                 :            :  *  Contributor(s): _______________________________________
      53                 :            :  *
      54                 :            :  *
      55                 :            :  ************************************************************************/
      56                 :            : /*************************************************************************
      57                 :            :  * @file
      58                 :            :  *  For LWP filter architecture prototype
      59                 :            :  ************************************************************************/
      60                 :            : /*************************************************************************
      61                 :            :  * Change History
      62                 :            :  Mar 2005           Created
      63                 :            :  ************************************************************************/
      64                 :            : #include "lwpfoundry.hxx"
      65                 :            : #include "lwpfilehdr.hxx"
      66                 :            : #include "lwpstory.hxx"
      67                 :            : #include "lwpmarker.hxx"
      68                 :            : #include "lwpproplist.hxx"
      69                 :            : #include "lwpglobalmgr.hxx"
      70                 :            : #include "xfilter/xfplaceholder.hxx"
      71                 :            : #include "xfilter/xfinputlist.hxx"
      72                 :            : 
      73 [ +  - ][ +  - ]:          6 : LwpMarker::LwpMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm):LwpDLNFPVList(objHdr,pStrm)
                 [ +  - ]
      74                 :            : {
      75                 :          6 : }
      76                 :            : 
      77                 :          6 : void LwpMarker::Read()
      78                 :            : {
      79                 :          6 :     LwpDLNFPVList::Read();
      80                 :          6 :     m_objContent.ReadIndexed(m_pObjStrm);
      81                 :          6 :     m_objLayout.ReadIndexed(m_pObjStrm);
      82                 :          6 :     m_objMarkerList.ReadIndexed(m_pObjStrm);
      83                 :          6 :     m_nNeedUpdate = m_pObjStrm->QuickReaduInt16();
      84                 :          6 :     m_nFlag = m_pObjStrm->QuickReaduInt16();
      85                 :          6 :     m_nPageNumber = m_pObjStrm->QuickReaduInt16();
      86                 :            : 
      87                 :          6 :     m_pObjStrm->SkipExtra();
      88                 :          6 : }
      89                 :            : 
      90                 :          0 : OUString LwpMarker::GetNamedProperty(OUString name)
      91                 :            : {
      92                 :          0 :     LwpPropList* pProp = GetPropList();
      93         [ #  # ]:          0 :     if (pProp)
      94         [ #  # ]:          0 :         return pProp->GetNamedProperty(name);
      95                 :            :     else
      96                 :          0 :         return OUString(A2OUSTR(""));
      97                 :            : }
      98                 :            : 
      99         [ +  - ]:          6 : LwpStoryMarker::LwpStoryMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm):LwpMarker(objHdr,pStrm)
     100                 :            : {
     101                 :          6 : }
     102                 :            : 
     103                 :          6 : void LwpStoryMarker::Read()
     104                 :            : {
     105                 :          6 :     LwpMarker::Read();
     106                 :          6 :     m_nFlag = m_pObjStrm->QuickReaduInt16();
     107                 :          6 :     m_Range.Read(m_pObjStrm);
     108                 :          6 :     m_pObjStrm->SkipExtra();
     109                 :          6 : }
     110                 :            : 
     111                 :          6 : void LwpFribRange::Read(LwpObjectStream* pObjStrm)
     112                 :            : {
     113                 :          6 :     m_StartPara.ReadIndexed(pObjStrm);
     114                 :          6 :     m_EndPara.ReadIndexed(pObjStrm);
     115                 :          6 : }
     116                 :            : 
     117 [ #  # ][ #  # ]:          0 : LwpCHBlkMarker::LwpCHBlkMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm):LwpStoryMarker(objHdr,pStrm)
         [ #  # ][ #  # ]
     118                 :            : {
     119                 :          0 : }
     120                 :            : 
     121                 :          0 : void LwpCHBlkMarker::Read()
     122                 :            : {
     123                 :          0 :     LwpStoryMarker::Read();
     124                 :          0 :     m_objPromptStory.ReadIndexed(m_pObjStrm);
     125                 :          0 :     m_Help.Read(m_pObjStrm);
     126                 :          0 :     m_nAction = m_pObjStrm->QuickReaduInt16();
     127                 :          0 :     m_nTab = m_pObjStrm->QuickReaduInt32();
     128                 :          0 :     m_nFlag = m_pObjStrm->QuickReaduInt16();
     129         [ #  # ]:          0 :     if(m_pObjStrm->CheckExtra())
     130                 :            :     {
     131                 :          0 :         m_Mirror.Read(m_pObjStrm);
     132                 :          0 :         m_pObjStrm->SkipExtra();
     133                 :            :     }
     134                 :          0 : }
     135                 :            : 
     136                 :          0 : OUString LwpCHBlkMarker::GetPromptText()
     137                 :            : {
     138                 :          0 :     LwpStory* pStory = NULL;
     139         [ #  # ]:          0 :     if (m_objPromptStory.obj())
     140         [ #  # ]:          0 :         pStory = dynamic_cast<LwpStory*>(m_objPromptStory.obj());
     141         [ #  # ]:          0 :     if (pStory)
     142                 :          0 :         return pStory->GetContentText();
     143                 :          0 :     return A2OUSTR("");
     144                 :            : }
     145                 :            : 
     146                 :          0 : void LwpCHBlkMarker::ConvertCHBlock(XFContentContainer* pXFPara, sal_uInt8 nType)
     147                 :            : {
     148                 :          0 :     sal_uInt16 nAction = GetAction();
     149                 :            : 
     150   [ #  #  #  # ]:          0 :     switch(nAction)
     151                 :            :     {
     152                 :            :     case CLICKHERE_CHBEHAVIORTEXT:
     153                 :            :     case CLICKHERE_CHBEHAVIORTABLE:
     154                 :            :     case CLICKHERE_CHBEHAVIORPICTURE:
     155                 :            :     case CLICKHERE_CHBEHAVIOROLEOBJECT:
     156                 :          0 :         ProcessPlaceHolder(pXFPara,nAction,nType);
     157                 :          0 :         break;
     158                 :            :     case CLICKHERE_CHBEHAVIORCHART:
     159                 :            :     case CLICKHERE_CHBEHAVIORDRAWING:
     160                 :            :     case CLICKHERE_CHBEHAVIORGLOSSARY:
     161                 :            :     case CLICKHERE_CHBEHAVIOREQUATION:
     162                 :            :     case CLICKHERE_CHBEHAVIORSYMBOL:
     163                 :            :     case CLICKHERE_CHBEHAVIORPAGENUM:
     164                 :            :     case CLICKHERE_CHBEHAVIORDOCFIELD:
     165                 :            :     case CLICKHERE_CHBEHAVIORDATETIME:
     166                 :          0 :         ProcessOtherCHB(pXFPara,nType);
     167                 :          0 :         break;
     168                 :            :     case CLICKHERE_CHBEHAVIORSTRINGLIST:
     169                 :          0 :         ProcessKeylist(pXFPara,nType);
     170                 :          0 :         break;
     171                 :            :     default:
     172                 :          0 :         break;
     173                 :            :     }
     174                 :          0 : }
     175                 :            : 
     176                 :          0 : void LwpCHBlkMarker::ProcessPlaceHolder(XFContentContainer* pXFPara,sal_uInt16 nAction,
     177                 :            :                 sal_uInt8 nType)
     178                 :            : {
     179                 :          0 :     sal_Bool bFillFlag = IsHasFilled();
     180                 :          0 :     sal_Bool bHelpFlag = IsBubbleHelp();
     181                 :            : 
     182         [ #  # ]:          0 :     if ( bFillFlag )
     183                 :          0 :         return;
     184         [ #  # ]:          0 :     if (nType == MARKER_START)
     185                 :            :     {
     186                 :          0 :         XFHolderStart* pHolder= new XFHolderStart;
     187   [ #  #  #  #  :          0 :         switch(nAction)
                      # ]
     188                 :            :         {
     189                 :            :         case CLICKHERE_CHBEHAVIORTEXT:
     190                 :          0 :             pHolder->SetType(A2OUSTR("text"));
     191                 :          0 :             break;
     192                 :            :         case CLICKHERE_CHBEHAVIORTABLE:
     193                 :          0 :             pHolder->SetType(A2OUSTR("table"));
     194                 :          0 :             break;
     195                 :            :         case CLICKHERE_CHBEHAVIORPICTURE:
     196                 :          0 :             pHolder->SetType(A2OUSTR("image"));
     197                 :          0 :             break;
     198                 :            :         case CLICKHERE_CHBEHAVIOROLEOBJECT:
     199                 :          0 :             pHolder->SetType(A2OUSTR("object"));
     200                 :          0 :             break;
     201                 :            :         default:
     202                 :          0 :             break;
     203                 :            :         }
     204                 :            : 
     205         [ #  # ]:          0 :         if (bHelpFlag)
     206                 :          0 :             pHolder->SetDesc(m_Help.str());
     207                 :          0 :         pHolder->SetPrompt(GetPromptText());
     208                 :          0 :         pXFPara->Add(pHolder);
     209                 :            :     }
     210         [ #  # ]:          0 :     else if (nType == MARKER_END)
     211                 :            :     {
     212                 :          0 :         XFHolderEnd* pHolder = new XFHolderEnd;
     213                 :          0 :         pXFPara->Add(pHolder);
     214                 :            :     }
     215                 :            : }
     216                 :            : 
     217                 :          0 : void LwpCHBlkMarker::ProcessOtherCHB(XFContentContainer* pXFPara,sal_uInt8 nType)
     218                 :            : {
     219                 :          0 :     sal_Bool bFillFlag = IsHasFilled();
     220                 :          0 :     sal_Bool bHelpFlag = IsBubbleHelp();
     221                 :            : 
     222         [ #  # ]:          0 :     if ( bFillFlag )
     223                 :          0 :         return;
     224         [ #  # ]:          0 :     if (nType == MARKER_START)
     225                 :            :     {
     226                 :          0 :         XFHolderStart* pHolder= new XFHolderStart;
     227                 :          0 :         pHolder->SetType(A2OUSTR("text"));
     228         [ #  # ]:          0 :         if (bHelpFlag)
     229                 :          0 :             pHolder->SetDesc(m_Help.str());
     230                 :          0 :         pHolder->SetPrompt(GetPromptText());
     231                 :          0 :         pXFPara->Add(pHolder);
     232                 :            :     }
     233         [ #  # ]:          0 :     else if (nType == MARKER_END)
     234                 :            :     {
     235                 :          0 :         XFHolderEnd* pHolder = new XFHolderEnd;
     236                 :          0 :         pXFPara->Add(pHolder);
     237                 :            :     }
     238                 :            : 
     239                 :            : }
     240                 :            : 
     241                 :            : //note: there will be a blank to mark the list
     242                 :            : //all input content of key list processed as normal text
     243                 :          0 : void LwpCHBlkMarker::ProcessKeylist(XFContentContainer* pXFPara,sal_uInt8 nType)
     244                 :            : {
     245                 :          0 :     sal_Bool bFillFlag = IsHasFilled();
     246                 :            : 
     247         [ #  # ]:          0 :     if ( bFillFlag )
     248                 :            :     {
     249         [ #  # ]:          0 :         if (nType == MARKER_START)
     250                 :            :         {
     251                 :          0 :             EnumAllKeywords();//traverse the proplist to find all keywords
     252         [ #  # ]:          0 :             XFInputList* pList = new XFInputList;
     253                 :          0 :             pList->SetName(LwpDLNFPVList::m_Name.str());
     254         [ #  # ]:          0 :             pList->SetLabels(m_Keylist);
     255                 :          0 :             pXFPara->Add(pList);
     256                 :            :         }
     257                 :            :         else if (nType == MARKER_END)//skip
     258                 :            :         {
     259                 :            :         }
     260                 :            :     }
     261                 :            :     else
     262                 :            :     {
     263         [ #  # ]:          0 :         if (nType == MARKER_START)
     264                 :            :         {
     265                 :          0 :             EnumAllKeywords();
     266         [ #  # ]:          0 :             XFInputList* pList = new XFInputList;
     267                 :          0 :             pList->SetName(LwpDLNFPVList::m_Name.str());
     268         [ #  # ]:          0 :             pList->SetLabels(m_Keylist);
     269                 :          0 :             pXFPara->Add(pList);
     270                 :            : 
     271                 :          0 :             XFHolderStart* pHolder= new XFHolderStart;
     272                 :          0 :             pHolder->SetType(A2OUSTR("text"));
     273                 :          0 :             pHolder->SetPrompt(GetPromptText());
     274                 :          0 :             pXFPara->Add(pHolder);
     275                 :            :         }
     276         [ #  # ]:          0 :         else if (nType == MARKER_END)
     277                 :            :         {
     278                 :          0 :             XFHolderEnd* pHolder = new XFHolderEnd;
     279                 :          0 :             pXFPara->Add(pHolder);
     280                 :            :         }
     281                 :            :     }
     282                 :          0 : }
     283                 :            : 
     284                 :          0 : sal_Bool LwpCHBlkMarker::IsHasFilled()
     285                 :            : {
     286         [ #  # ]:          0 :     if (CHB_PROMPT & m_nFlag)
     287                 :          0 :         return sal_False;
     288                 :          0 :     return sal_True;
     289                 :            : }
     290                 :            : 
     291                 :          0 : sal_Bool LwpCHBlkMarker::IsBubbleHelp()
     292                 :            : {
     293                 :          0 :     return (CHB_HELP & m_nFlag);
     294                 :            : }
     295                 :            : 
     296                 :          0 : void LwpCHBlkMarker::EnumAllKeywords()
     297                 :            : {
     298                 :          0 :     OUString name1(A2OUSTR(""));
     299                 :          0 :     OUString value1(A2OUSTR(""));
     300                 :          0 :     OUString name2(A2OUSTR("start"));
     301                 :          0 :     LwpPropList* pProp = GetPropList();
     302         [ #  # ]:          0 :     if (!pProp)
     303                 :          0 :         return;
     304         [ #  # ]:          0 :     while(!name2.isEmpty())
     305                 :            :     {
     306         [ #  # ]:          0 :         name2 = pProp->EnumNamedProperty(name1,value1);
     307         [ #  # ]:          0 :         if ( name1.match(A2OUSTR("LIST"),0) )
     308                 :            :         {
     309         [ #  # ]:          0 :             m_Keylist.push_back(value1);
     310                 :            :         }
     311                 :          0 :         name1 = name2;
     312 [ #  # ][ #  # ]:          0 :     }
                 [ #  # ]
     313                 :            : }
     314                 :            : 
     315                 :            : 
     316                 :          0 : LwpBookMark::LwpBookMark(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
     317         [ #  # ]:          0 :     : LwpDLNFVList(objHdr,pStrm)
     318                 :            : {
     319                 :          0 : }
     320                 :            : 
     321                 :          0 : void LwpBookMark::Read()
     322                 :            : {
     323                 :          0 :     LwpDLNFVList::Read();
     324                 :          0 :     m_objMarker.ReadIndexed(m_pObjStrm);
     325         [ #  # ]:          0 :     if (LwpFileHeader::m_nFileRevision < 0x0008)
     326                 :            :     {
     327         [ #  # ]:          0 :         if (m_pObjStrm->QuickReadBool())
     328                 :          0 :             m_nFlag |= BKMK_NOTESFX;
     329                 :            :     }
     330                 :            :     else
     331                 :          0 :         m_nFlag = m_pObjStrm->QuickReaduInt16();
     332                 :          0 :     m_pObjStrm->SkipExtra();
     333                 :          0 : }
     334                 :            : 
     335                 :          0 : sal_Bool LwpBookMark::IsRightMarker(LwpObjectID objMarker)
     336                 :            : {
     337         [ #  # ]:          0 :     if (objMarker == m_objMarker)
     338                 :          0 :         return sal_True;
     339                 :          0 :     return sal_False;
     340                 :            : }
     341                 :            : 
     342                 :          0 : OUString LwpBookMark::GetName()
     343                 :            : {
     344         [ #  # ]:          0 :     if (LwpDLNFVList::GetName())
     345                 :          0 :         return LwpDLNFVList::GetName()->str();
     346                 :            :     else
     347                 :          0 :         return OUString(A2OUSTR(""));
     348                 :            : }
     349                 :            : 
     350                 :          6 : LwpFieldMark::LwpFieldMark(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
     351                 :            :     : LwpStoryMarker(objHdr,pStrm)
     352                 :            :     , m_nExtra(0)
     353                 :            :     , m_nFlag(0)
     354                 :            :     , m_nFieldType(0)
     355                 :            :     , m_bHasStyle(sal_False)
     356                 :            :     , m_bHasStart(sal_False)
     357                 :            :     , m_pFrib(NULL)
     358 [ +  - ][ +  - ]:          6 :     , m_bRevisionFlag(sal_False)
                 [ +  - ]
     359                 :            : {
     360                 :          6 : }
     361                 :            : 
     362                 :          6 : void LwpFieldMark::Read()
     363                 :            : {
     364                 :          6 :     LwpStoryMarker::Read();
     365                 :          6 :     m_Formula.Read(m_pObjStrm);
     366                 :          6 :     m_objFormulaStory.ReadIndexed(m_pObjStrm);
     367         [ -  + ]:          6 :     if (LwpFileHeader::m_nFileRevision < 0x000B)
     368                 :          6 :         return;
     369                 :          6 :     m_objResultContent.ReadIndexed(m_pObjStrm);
     370                 :          6 :     m_nFlag = m_pObjStrm->QuickReaduInt16();
     371                 :          6 :     m_nFieldType = m_pObjStrm->QuickReaduInt16();
     372                 :          6 :     m_pObjStrm->SkipExtra();
     373                 :            : }
     374                 :            : 
     375                 :          0 : void LwpFieldMark::ParseIndex(OUString& sKey1,OUString& sKey2)
     376                 :            : {
     377                 :          0 :     OUString sFormula = m_Formula.str();
     378                 :            :     sal_Int32 index[4];
     379                 :          0 :     sal_Unicode ch(0x0022);//"
     380                 :          0 :     index[0] = sFormula.indexOf(ch,0);
     381                 :          0 :     index[1] = sFormula.indexOf(ch,index[0]+1);
     382                 :            : 
     383                 :          0 :     index[2] = sFormula.indexOf(ch,index[1]+1);
     384                 :          0 :     index[3] = sFormula.indexOf(ch,index[2]+1);
     385 [ #  # ][ #  # ]:          0 :     if (index[0]>=0 && index[1]>=0)
     386                 :          0 :         sKey1 = sFormula.copy(index[0]+1,index[1]-index[0]-1);
     387                 :            :     else
     388                 :          0 :         sKey1 = A2OUSTR("");
     389 [ #  # ][ #  # ]:          0 :     if (index[2]>=0 && index[3]>=0)
     390                 :          0 :         sKey2 = sFormula.copy(index[2]+1,index[3]-index[2]-1);
     391                 :            :     else
     392                 :          0 :         sKey2 = A2OUSTR("");
     393                 :          0 : }
     394                 :            : 
     395                 :          0 : void LwpFieldMark::ParseTOC(OUString& sLevel,OUString& sText)
     396                 :            : {
     397                 :          0 :     OUString sFormula = m_Formula.str();
     398                 :            :     sal_Int32 index[4];
     399                 :          0 :     sal_Unicode ch1(0x0020);//space
     400                 :          0 :     sal_Unicode ch2(0x0022);//"
     401                 :            : 
     402                 :          0 :     index[0] = sFormula.indexOf(ch1,0);
     403                 :          0 :     index[1] = sFormula.indexOf(ch1,index[0]+1);
     404                 :            : 
     405                 :          0 :     index[2] = sFormula.indexOf(ch2,index[1]+1);
     406                 :          0 :     index[3] = sFormula.indexOf(ch2,index[2]+1);
     407 [ #  # ][ #  # ]:          0 :     if (index[0]>=0 && index[1]>=0)
     408                 :          0 :         sLevel = sFormula.copy(index[0]+1,index[1]-index[0]-1);
     409                 :            :     else
     410                 :          0 :         sLevel = A2OUSTR("");
     411 [ #  # ][ #  # ]:          0 :     if (index[2]>=0 && index[3]>=0)
     412                 :          0 :         sText = sFormula.copy(index[2]+1,index[3]-index[2]-1);
     413                 :            :     else
     414                 :          0 :         sText = A2OUSTR("");
     415                 :          0 : }
     416                 :            : 
     417                 :         12 : sal_Bool LwpFieldMark::IsFormulaInsert()
     418                 :            : {
     419         [ -  + ]:         12 :     if (m_nFlag & FF_FORMULAINSERTED)
     420                 :          0 :         return sal_True;
     421                 :         12 :     return sal_False;
     422                 :            : }
     423                 :            : 
     424                 :         18 : sal_Bool LwpFieldMark::IsDateTimeField(sal_uInt8& type,OUString& formula)
     425                 :            : {
     426                 :         18 :     OUString sFormula = m_Formula.str();
     427                 :            :     sal_Int32 index;
     428                 :         18 :     sal_Unicode ch1(0x0020);//space
     429                 :         18 :     OUString tag;
     430                 :            : 
     431                 :         18 :     index = sFormula.indexOf(ch1,0);
     432         [ -  + ]:         18 :     if (index < 0)
     433                 :            :     {
     434         [ #  # ]:          0 :         if (sFormula == A2OUSTR("TotalEditingTime"))
     435                 :            :         {
     436                 :          0 :             type = DATETIME_TOTALTIME;
     437                 :          0 :             return sal_True;
     438                 :            :         }
     439                 :          0 :         return sal_False;
     440                 :            :     }
     441                 :            : 
     442                 :         18 :     tag = sFormula.copy(0,index);
     443         [ +  - ]:         18 :     if (tag == A2OUSTR("Now()"))
     444                 :            :     {
     445                 :         18 :         type = DATETIME_NOW;
     446                 :         18 :         formula = sFormula.copy(index+1,sFormula.getLength()-index-1);
     447                 :         18 :         return sal_True;
     448                 :            :     }
     449         [ #  # ]:          0 :     else if (tag == A2OUSTR("CreateDate"))
     450                 :            :     {
     451                 :          0 :         type = DATETIME_CREATE;
     452                 :          0 :         formula = sFormula.copy(index+1,sFormula.getLength()-index-1);
     453                 :          0 :         return sal_True;
     454                 :            :     }
     455         [ #  # ]:          0 :     else if (tag == A2OUSTR("EditDate"))
     456                 :            :     {
     457                 :          0 :         type = DATETIME_LASTEDIT;
     458                 :          0 :         formula = sFormula.copy(index+1,sFormula.getLength()-index-1);
     459                 :          0 :         return sal_True;
     460                 :            :     }
     461         [ #  # ]:          0 :     else if (tag == A2OUSTR("YesterdaysDate") || tag == A2OUSTR("TomorrowsDate")
           [ #  #  #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     462         [ #  # ]:          0 :             || tag == A2OUSTR("TodaysDate"))
     463                 :            :     {
     464                 :          0 :         type = DATETIME_SKIP;
     465                 :          0 :         return sal_True;
     466                 :            :     }
     467                 :            :     else
     468                 :         18 :         return sal_False;
     469                 :            : }
     470                 :            : 
     471                 :          0 : sal_Bool LwpFieldMark::IsCrossRefField(sal_uInt8& nType, OUString& sMarkName)
     472                 :            : {
     473                 :          0 :     OUString sFormula = m_Formula.str();
     474                 :            :     sal_Int32 index;
     475                 :          0 :     sal_Unicode ch1(0x0020);//space
     476                 :          0 :     OUString tag;
     477                 :            : 
     478                 :          0 :     index = sFormula.indexOf(ch1,0);
     479         [ #  # ]:          0 :     if (index < 0)
     480                 :            :     {
     481         [ #  # ]:          0 :         LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
     482                 :          0 :         LwpBookmarkMgr* pMarkMgr = pGlobal->GetLwpBookmarkMgr();
     483 [ #  # ][ #  # ]:          0 :         if (pMarkMgr->FindBookmark(sFormula))
     484                 :            :         {
     485                 :          0 :             sMarkName = sFormula;
     486                 :          0 :             nType = CROSSREF_TEXT;
     487                 :          0 :             return sal_True;
     488                 :            :         }
     489                 :            :         else
     490                 :          0 :             return sal_False;
     491                 :            :     }
     492                 :            : 
     493                 :          0 :     tag = sFormula.copy(0,index);
     494         [ #  # ]:          0 :     if (tag == A2OUSTR("PageRef"))
     495                 :            :     {
     496                 :          0 :         sMarkName = sFormula.copy(index+1,sFormula.getLength()-index-1);
     497                 :          0 :         nType = CROSSREF_PAGE;
     498                 :          0 :         return sal_True;
     499                 :            :     }
     500         [ #  # ]:          0 :     else if (tag == A2OUSTR("ParaRef"))
     501                 :            :     {
     502                 :          0 :         sMarkName = sFormula.copy(index+1,sFormula.getLength()-index-1);
     503                 :          0 :         nType = CROSSREF_PARANUMBER;
     504                 :          0 :         return sal_True;
     505                 :            :     }
     506                 :            :     else
     507                 :          0 :         return sal_False;
     508                 :            : }
     509                 :            : 
     510                 :          0 : sal_Bool LwpFieldMark::IsDocPowerField(sal_uInt8& nType,OUString& sFormula)
     511                 :            : {
     512                 :          0 :     sFormula = m_Formula.str();
     513                 :            : 
     514         [ #  # ]:          0 :     if (sFormula == A2OUSTR("Description"))
     515                 :            :     {
     516                 :          0 :         nType = DOC_DESCRIPTION;
     517                 :          0 :         return sal_True;
     518                 :            :     }
     519         [ #  # ]:          0 :     else if (sFormula == A2OUSTR("NumPages"))
     520                 :            :     {
     521                 :          0 :         nType = DOC_NUMPAGES;
     522                 :          0 :         return sal_True;
     523                 :            :     }
     524         [ #  # ]:          0 :     else if (sFormula == A2OUSTR("NumChars"))
     525                 :            :     {
     526                 :          0 :         nType = DOC_NUMCHARS;
     527                 :          0 :         return sal_True;
     528                 :            :     }
     529         [ #  # ]:          0 :     else if (sFormula == A2OUSTR("NumWords"))
     530                 :            :     {
     531                 :          0 :         nType = DOC_NUMWORDS;
     532                 :          0 :         return sal_True;
     533                 :            :     }
     534                 :            :     else
     535                 :            :     {
     536                 :          0 :         return sal_False;
     537                 :            :     }
     538                 :            : }
     539                 :            : 
     540         [ #  # ]:          0 : LwpRubyMarker::LwpRubyMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm):LwpStoryMarker(objHdr,pStrm)
     541                 :            : {
     542                 :          0 : }
     543                 :            : 
     544                 :          0 : void LwpRubyMarker::Read()
     545                 :            : {
     546                 :          0 :     LwpStoryMarker::Read();
     547                 :          0 :     m_objLayout.ReadIndexed(m_pObjStrm);
     548                 :          0 :     m_pObjStrm->SkipExtra();
     549                 :          0 : }
     550                 :            : 
     551                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10