LCOV - code coverage report
Current view: top level - xmloff/source/text - XMLTextNumRuleInfo.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 35 45 77.8 %
Date: 2015-06-13 12:38:46 Functions: 9 14 64.3 %
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             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTNUMRULEINFO_HXX
      21             : #define INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTNUMRULEINFO_HXX
      22             : 
      23             : #include <com/sun/star/uno/Reference.hxx>
      24             : #include <com/sun/star/container/XIndexReplace.hpp>
      25             : 
      26             : namespace com { namespace sun { namespace star {
      27             :     namespace text { class XTextContent; }
      28             : } } }
      29             : #include <sal/types.h>
      30             : 
      31             : class XMLTextListAutoStylePool;
      32             : 
      33             : /** information about list and list style for a certain paragraph
      34             : 
      35             :     OD 2008-04-24 #refactorlists#
      36             :     Complete refactoring of the class and enhancement of the class for lists.
      37             :     These changes are considered by method <XMLTextParagraphExport::exportListChange(..)>
      38             : */
      39        3084 : class XMLTextNumRuleInfo
      40             : {
      41             :     const OUString msNumberingRules;
      42             :     const OUString msNumberingLevel;
      43             :     const OUString msNumberingStartValue;
      44             :     const OUString msParaIsNumberingRestart;
      45             :     const OUString msNumberingIsNumber;
      46             :     const OUString msNumberingIsOutline;
      47             :     const OUString msPropNameListId;
      48             :     const OUString msPropNameStartWith;
      49             :     const OUString msContinueingPreviousSubTree;
      50             :     const OUString msListLabelStringProp;
      51             : 
      52             :     // numbering rules instance and its name
      53             :     ::com::sun::star::uno::Reference <
      54             :                         ::com::sun::star::container::XIndexReplace > mxNumRules;
      55             :     OUString     msNumRulesName;
      56             : 
      57             :     // paragraph's list attributes
      58             :     OUString     msListId;
      59             :     sal_Int16           mnListStartValue;
      60             :     sal_Int16           mnListLevel;
      61             :     bool            mbIsNumbered;
      62             :     bool            mbIsRestart;
      63             : 
      64             :     // numbering rules' attributes
      65             :     sal_Int16           mnListLevelStartValue;
      66             : 
      67             :     // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
      68             :     bool mbOutlineStyleAsNormalListStyle;
      69             : 
      70             :     bool mbContinueingPreviousSubTree;
      71             :     OUString msListLabelString;
      72             : 
      73             : public:
      74             : 
      75             :     XMLTextNumRuleInfo();
      76             : 
      77             :     inline XMLTextNumRuleInfo& operator=( const XMLTextNumRuleInfo& rInfo );
      78             : 
      79             :     void Set( const ::com::sun::star::uno::Reference <
      80             :                         ::com::sun::star::text::XTextContent > & rTextContnt,
      81             :               const bool bOutlineStyleAsNormalListStyle,
      82             :               const XMLTextListAutoStylePool& rListAutoPool,
      83             :               const bool bExportTextNumberElement );
      84             :     inline void Reset();
      85             : 
      86          16 :     inline const OUString& GetNumRulesName() const
      87             :     {
      88          16 :         return msNumRulesName;
      89             :     }
      90             :     inline const ::com::sun::star::uno::Reference <
      91             :         ::com::sun::star::container::XIndexReplace >& GetNumRules() const
      92             :     {
      93             :         return mxNumRules;
      94             :     }
      95           0 :     inline sal_Int16 GetListLevelStartValue() const
      96             :     {
      97           0 :         return mnListLevelStartValue;
      98             :     }
      99             : 
     100          15 :     inline const OUString& GetListId() const
     101             :     {
     102          15 :         return msListId;
     103             :     }
     104             : 
     105        6188 :     inline sal_Int16 GetLevel() const
     106             :     {
     107        6188 :         return mnListLevel;
     108             :     }
     109             : 
     110          34 :     inline bool HasStartValue() const
     111             :     {
     112          34 :         return mnListStartValue != -1;
     113             :     }
     114           0 :     inline sal_uInt32 GetStartValue() const
     115             :     {
     116           0 :         return mnListStartValue;
     117             :     }
     118             : 
     119          49 :     inline bool IsNumbered() const
     120             :     {
     121          49 :         return mbIsNumbered;
     122             :     }
     123          45 :     inline bool IsRestart() const
     124             :     {
     125          45 :         return mbIsRestart;
     126             :     }
     127             : 
     128             :     bool BelongsToSameList( const XMLTextNumRuleInfo& rCmp ) const;
     129             : 
     130           0 :     inline bool HasSameNumRules( const XMLTextNumRuleInfo& rCmp ) const
     131             :     {
     132           0 :         return rCmp.msNumRulesName == msNumRulesName;
     133             :     }
     134             : 
     135           0 :     inline bool IsContinueingPreviousSubTree() const
     136             :     {
     137           0 :         return mbContinueingPreviousSubTree;
     138             :     }
     139           0 :     inline const OUString& ListLabelString() const
     140             :     {
     141           0 :         return msListLabelString;
     142             :     }
     143             : };
     144             : 
     145        1434 : inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=(
     146             :         const XMLTextNumRuleInfo& rInfo )
     147             : {
     148        1434 :     msNumRulesName = rInfo.msNumRulesName;
     149        1434 :     mxNumRules = rInfo.mxNumRules;
     150        1434 :     msListId = rInfo.msListId;
     151        1434 :     mnListStartValue = rInfo.mnListStartValue;
     152        1434 :     mnListLevel = rInfo.mnListLevel;
     153        1434 :     mbIsNumbered = rInfo.mbIsNumbered;
     154        1434 :     mbIsRestart = rInfo.mbIsRestart;
     155             :     // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
     156        1434 :     mbOutlineStyleAsNormalListStyle = rInfo.mbOutlineStyleAsNormalListStyle;
     157        1434 :     mbContinueingPreviousSubTree = rInfo.mbContinueingPreviousSubTree;
     158        1434 :     msListLabelString = rInfo.msListLabelString;
     159             : 
     160        1434 :     return *this;
     161             : }
     162             : 
     163        5030 : inline void XMLTextNumRuleInfo::Reset()
     164             : {
     165        5030 :     mxNumRules = 0;
     166        5030 :     msNumRulesName.clear();
     167        5030 :     msListId.clear();
     168        5030 :     mnListStartValue = -1;
     169        5030 :     mnListLevel = 0;
     170             :     // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
     171             :     mbIsNumbered = mbIsRestart =
     172        5030 :     mbOutlineStyleAsNormalListStyle = false;
     173        5030 :     mbContinueingPreviousSubTree = false;
     174        5030 :     msListLabelString.clear();
     175        5030 : }
     176             : #endif // INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTNUMRULEINFO_HXX
     177             : 
     178             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11