LCOV - code coverage report
Current view: top level - xmloff/source/text - XMLTextNumRuleInfo.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 25 45 55.6 %
Date: 2014-11-03 Functions: 4 14 28.6 %
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        3800 : 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           0 :     inline const OUString& GetNumRulesName() const
      87             :     {
      88           0 :         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           0 :     inline const OUString& GetListId() const
     101             :     {
     102           0 :         return msListId;
     103             :     }
     104             : 
     105        4068 :     inline sal_Int16 GetLevel() const
     106             :     {
     107        4068 :         return mnListLevel;
     108             :     }
     109             : 
     110           0 :     inline bool HasStartValue() const
     111             :     {
     112           0 :         return mnListStartValue != -1;
     113             :     }
     114           0 :     inline sal_uInt32 GetStartValue() const
     115             :     {
     116           0 :         return mnListStartValue;
     117             :     }
     118             : 
     119           0 :     inline bool IsNumbered() const
     120             :     {
     121           0 :         return mbIsNumbered;
     122             :     }
     123           0 :     inline bool IsRestart() const
     124             :     {
     125           0 :         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         880 : inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=(
     146             :         const XMLTextNumRuleInfo& rInfo )
     147             : {
     148         880 :     msNumRulesName = rInfo.msNumRulesName;
     149         880 :     mxNumRules = rInfo.mxNumRules;
     150         880 :     msListId = rInfo.msListId;
     151         880 :     mnListStartValue = rInfo.mnListStartValue;
     152         880 :     mnListLevel = rInfo.mnListLevel;
     153         880 :     mbIsNumbered = rInfo.mbIsNumbered;
     154         880 :     mbIsRestart = rInfo.mbIsRestart;
     155             :     // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
     156         880 :     mbOutlineStyleAsNormalListStyle = rInfo.mbOutlineStyleAsNormalListStyle;
     157         880 :     mbContinueingPreviousSubTree = rInfo.mbContinueingPreviousSubTree;
     158         880 :     msListLabelString = rInfo.msListLabelString;
     159             : 
     160         880 :     return *this;
     161             : }
     162             : 
     163        5092 : inline void XMLTextNumRuleInfo::Reset()
     164             : {
     165        5092 :     mxNumRules = 0;
     166        5092 :     msNumRulesName = "";
     167        5092 :     msListId = "";
     168        5092 :     mnListStartValue = -1;
     169        5092 :     mnListLevel = 0;
     170             :     // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
     171             :     mbIsNumbered = mbIsRestart =
     172        5092 :     mbOutlineStyleAsNormalListStyle = false;
     173        5092 :     mbContinueingPreviousSubTree = false;
     174        5092 :     msListLabelString = "";
     175        5092 : }
     176             : #endif // INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTNUMRULEINFO_HXX
     177             : 
     178             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10