LCOV - code coverage report
Current view: top level - libreoffice/writerfilter/source/dmapper - PropertyMap.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 80 103 77.7 %
Date: 2012-12-17 Functions: 69 89 77.5 %
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             : #ifndef INCLUDED_DMAPPER_PROPERTYMAP_HXX
      20             : #define INCLUDED_DMAPPER_PROPERTYMAP_HXX
      21             : 
      22             : #include <rtl/ustring.hxx>
      23             : #include <com/sun/star/uno/Sequence.hxx>
      24             : #include <com/sun/star/beans/PropertyValue.hpp>
      25             : #include <com/sun/star/beans/XPropertySet.hpp>
      26             : #include <com/sun/star/uno/Any.h>
      27             : #include "PropertyIds.hxx"
      28             : #include <boost/shared_ptr.hpp>
      29             : #include <map>
      30             : #include <vector>
      31             : 
      32             : #include <resourcemodel/TagLogger.hxx>
      33             : 
      34             : namespace com{namespace sun{namespace star{
      35             :     namespace beans{
      36             :     struct PropertyValue;
      37             :     }
      38             :     namespace container{
      39             :         class XNameContainer;
      40             :     }
      41             :     namespace lang{
      42             :         class XMultiServiceFactory;
      43             :     }
      44             :     namespace text{
      45             :         class XTextRange;
      46             :         class XTextColumns;
      47             :         class XFootnote;
      48             :     }
      49             :     namespace table{
      50             :         struct BorderLine2;
      51             :     }
      52             : }}}
      53             : 
      54             : namespace writerfilter {
      55             : namespace dmapper{
      56             : class DomainMapper_Impl;
      57             : 
      58             : enum BorderPosition
      59             : {
      60             :     BORDER_LEFT,
      61             :     BORDER_RIGHT,
      62             :     BORDER_TOP,
      63             :     BORDER_BOTTOM
      64             : };
      65             : 
      66             : 
      67             : struct PropertyDefinition
      68             : {
      69             :     PropertyIds eId;
      70             :     bool        bIsTextProperty;
      71             : 
      72      204404 :     PropertyDefinition( PropertyIds _eId, bool _bIsTextProperty ) :
      73             :         eId( _eId ),
      74      204404 :         bIsTextProperty( _bIsTextProperty ){}
      75             : 
      76             :     bool    operator== (const PropertyDefinition& rDef) const
      77             :             {   return rDef.eId == eId; }
      78      659826 :     bool    operator< (const PropertyDefinition& rDef) const
      79      659826 :             {   return eId < rDef.eId; }
      80             : };
      81             : typedef std::map < PropertyDefinition, ::com::sun::star::uno::Any > _PropertyMap;
      82             : class PropertyMap : public _PropertyMap
      83             : {
      84             :     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >   m_aValues;
      85             :     //marks context as footnote context - ::text( ) events contain either the footnote character or can be ignored
      86             :     //depending on sprmCSymbol
      87             :     sal_Unicode                                                                 m_cFootnoteSymbol; // 0 == invalid
      88             :     sal_Int32                                                                   m_nFootnoteFontId; // negative values are invalid ids
      89             :     OUString                                                             m_sFootnoteFontName;
      90             :     ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote >       m_xFootnote;
      91             : 
      92             : protected:
      93       92764 :     void Invalidate()
      94             :     {
      95       92764 :         if(m_aValues.getLength())
      96           2 :             m_aValues.realloc( 0 );
      97       92764 :     }
      98             : 
      99             : public:
     100             :     PropertyMap();
     101             :     virtual ~PropertyMap();
     102             : 
     103             :     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetPropertyValues();
     104             :     bool hasEmptyPropertyValues() const {return !m_aValues.getLength();}
     105             :     /** Add property, usually overwrites already available attributes. It shouldn't overwrite in case of default attributes
     106             :      */
     107             :     void Insert( PropertyIds eId, bool bIsTextProperty, const ::com::sun::star::uno::Any& rAny, bool bOverwrite = true );
     108             :     void InsertProps(const boost::shared_ptr<PropertyMap> pMap);
     109             : 
     110             :     const ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote>&  GetFootnote() const;
     111           4 :     void SetFootnote( ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote> xF ) { m_xFootnote = xF; }
     112             : 
     113           4 :     sal_Unicode GetFootnoteSymbol() const { return m_cFootnoteSymbol;}
     114           0 :     void        SetFootnoteSymbol(sal_Unicode cSet) { m_cFootnoteSymbol = cSet;}
     115             : 
     116           4 :     sal_Int32   GetFootnoteFontId() const { return m_nFootnoteFontId;}
     117           0 :     void        SetFootnoteFontId(sal_Int32 nSet) { m_nFootnoteFontId = nSet;}
     118             : 
     119           4 :     const OUString&      GetFootnoteFontName() const { return m_sFootnoteFontName;}
     120             :     void                        SetFootnoteFontName( const OUString& rSet ) { m_sFootnoteFontName = rSet;}
     121             : 
     122             :     virtual void insertTableProperties( const PropertyMap* );
     123             : 
     124             : #if OSL_DEBUG_LEVEL > 1
     125             :     virtual void dumpXml( const TagLogger::Pointer_t pLogger ) const;
     126             : #endif
     127             : 
     128             : };
     129             : typedef boost::shared_ptr<PropertyMap>  PropertyMapPtr;
     130             : 
     131             : 
     132             : 
     133             : class SectionPropertyMap : public PropertyMap
     134             : {
     135             :     //--> debug
     136             :     sal_Int32 nSectionNumber;
     137             :     //<-- debug
     138             :     //'temporarily' the section page settings are imported as page styles
     139             :     // empty strings mark page settings as not yet imported
     140             : 
     141             :     bool                                                                        m_bIsFirstSection;
     142             :     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >      m_xStartingRange;
     143             : 
     144             :     OUString                                                             m_sFirstPageStyleName;
     145             :     OUString                                                             m_sFollowPageStyleName;
     146             :     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >   m_aFirstPageStyle;
     147             :     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >   m_aFollowPageStyle;
     148             : 
     149             :     ::com::sun::star::table::BorderLine2*   m_pBorderLines[4];
     150             :     sal_Int32                               m_nBorderDistances[4];
     151             :     sal_Int32                               m_nBorderParams;
     152             : 
     153             :     bool                                    m_bTitlePage;
     154             :     sal_Int16                               m_nColumnCount;
     155             :     sal_Int32                               m_nColumnDistance;
     156             :     ::std::vector< sal_Int32 >              m_aColWidth;
     157             :     ::std::vector< sal_Int32 >              m_aColDistance;
     158             : 
     159             :     bool                                    m_bSeparatorLineIsOn;
     160             :     bool                                    m_bEvenlySpaced;
     161             :     bool                                    m_bIsLandscape;
     162             : 
     163             :     bool                                    m_bPageNoRestart;
     164             :     sal_Int32                               m_nPageNumber;
     165             :     sal_Int32                               m_nBreakType;
     166             :     sal_Int32                               m_nPaperBin;
     167             :     sal_Int32                               m_nFirstPaperBin;
     168             : 
     169             :     sal_Int32                               m_nLeftMargin;
     170             :     sal_Int32                               m_nRightMargin;
     171             :     sal_Int32                               m_nTopMargin;
     172             :     sal_Int32                               m_nBottomMargin;
     173             :     sal_Int32                               m_nHeaderTop;
     174             :     sal_Int32                               m_nHeaderBottom;
     175             : 
     176             :     sal_Int32                               m_nDzaGutter;
     177             :     bool                                    m_bGutterRTL;
     178             :     bool                                    m_bSFBiDi;
     179             : 
     180             :     sal_Int32                               m_nGridType;
     181             :     sal_Int32                               m_nGridLinePitch;
     182             :     sal_Int32                               m_nDxtCharSpace;
     183             : 
     184             :     //line numbering
     185             :     sal_Int32                               m_nLnnMod;
     186             :     sal_Int32                               m_nLnc;
     187             :     sal_Int32                               m_ndxaLnn;
     188             :     sal_Int32                               m_nLnnMin;
     189             : 
     190             :     void _ApplyProperties( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xStyle );
     191             :     ::com::sun::star::uno::Reference< com::sun::star::text::XTextColumns > ApplyColumnProperties(
     192             :             ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xFollowPageStyle );
     193             :     void CopyLastHeaderFooter( bool bFirstPage, DomainMapper_Impl& rDM_Impl );
     194             :     void PrepareHeaderFooterProperties( bool bFirstPage );
     195             :     bool HasHeader( bool bFirstPage ) const;
     196             :     bool HasFooter( bool bFirstPage ) const;
     197             : 
     198             :     void SetBorderDistance( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xStyle,
     199             :         PropertyIds eMarginId, PropertyIds eDistId, sal_Int32 nDistance, sal_Int32 nOffsetFrom, sal_uInt32 nLineWidth );
     200             : 
     201             : public:
     202             :         explicit SectionPropertyMap(bool bIsFirstSection);
     203             :         ~SectionPropertyMap();
     204             : 
     205             :     enum PageType
     206             :     {
     207             :         PAGE_FIRST,
     208             :         PAGE_LEFT,
     209             :         PAGE_RIGHT
     210             :     };
     211             : 
     212         448 :     void SetStart( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange )
     213             :     {
     214         448 :         m_xStartingRange = xRange;
     215         448 :     }
     216             : 
     217             :     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetPageStyle(
     218             :             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xStyles,
     219             :             const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xTextFactory,
     220             :             bool bFirst );
     221             : 
     222             :     void SetBorder( BorderPosition ePos, sal_Int32 nLineDistance, const ::com::sun::star::table::BorderLine2& rBorderLine );
     223           4 :     void SetBorderParams( sal_Int32 nSet ) { m_nBorderParams = nSet; }
     224             : 
     225           8 :     void SetColumnCount( sal_Int16 nCount ) { m_nColumnCount = nCount; }
     226           8 :     void SetColumnDistance( sal_Int32 nDist ) { m_nColumnDistance = nDist; }
     227          12 :     void AppendColumnWidth( sal_Int32 nWidth ) { m_aColWidth.push_back( nWidth ); }
     228           4 :     void AppendColumnSpacing( sal_Int32 nDist ) {m_aColDistance.push_back( nDist ); }
     229             : 
     230          26 :     void SetTitlePage( bool bSet ) { m_bTitlePage = bSet; }
     231           8 :     void SetSeparatorLine( bool bSet ) { m_bSeparatorLineIsOn = bSet; }
     232           8 :     void SetEvenlySpaced( bool bSet ) {    m_bEvenlySpaced = bSet; }
     233         304 :     void SetLandscape( bool bSet ) { m_bIsLandscape = bSet; }
     234           0 :     void SetPageNoRestart( bool bSet ) { m_bPageNoRestart = bSet; }
     235           0 :     void SetPageNumber( sal_Int32 nSet ) { m_nPageNumber = nSet; }
     236         180 :     void SetBreakType( sal_Int32 nSet ) { m_nBreakType = nSet; }
     237          26 :     sal_Int32 GetBreakType( ) { return m_nBreakType; }
     238             :     void SetPaperBin( sal_Int32 nSet );
     239             :     void SetFirstPaperBin( sal_Int32 nSet );
     240             : 
     241         310 :     void SetLeftMargin(    sal_Int32 nSet ) { m_nLeftMargin = nSet; }
     242         310 :     void SetRightMargin( sal_Int32 nSet ) { m_nRightMargin = nSet; }
     243         310 :     void SetTopMargin(    sal_Int32 nSet ) { m_nTopMargin = nSet; }
     244         310 :     void SetBottomMargin( sal_Int32 nSet ) { m_nBottomMargin = nSet; }
     245         310 :     void SetHeaderTop(    sal_Int32 nSet ) { m_nHeaderTop = nSet; }
     246         310 :     void SetHeaderBottom( sal_Int32 nSet ) { m_nHeaderBottom = nSet; }
     247             : 
     248           0 :     void SetGutterRTL( bool bSet ) { m_bGutterRTL = bSet;}
     249           0 :     void SetDzaGutter( sal_Int32 nSet ) {m_nDzaGutter = nSet; }
     250           0 :     void SetSFBiDi( bool bSet ) { m_bSFBiDi = bSet;}
     251             : 
     252          70 :     void SetGridType(sal_Int32 nSet) { m_nGridType = nSet; }
     253         168 :     void SetGridLinePitch( sal_Int32 nSet ) { m_nGridLinePitch = nSet; }
     254          70 :     void SetDxtCharSpace( sal_Int32 nSet ) { m_nDxtCharSpace = nSet; }
     255             : 
     256           0 :     void SetLnnMod( sal_Int32 nValue ) { m_nLnnMod = nValue; }
     257           0 :     void SetLnc(    sal_Int32 nValue ) { m_nLnc    = nValue; }
     258           0 :     void SetdxaLnn( sal_Int32 nValue ) { m_ndxaLnn  = nValue; }
     259           0 :     void SetLnnMin( sal_Int32 nValue ) { m_nLnnMin = nValue; }
     260             : 
     261             :     //determine which style gets the borders
     262             :     void ApplyBorderToPageStyles(
     263             :             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xStyles,
     264             :             const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xTextFactory,
     265             :             sal_Int32 nValue );
     266             : 
     267             :     void CloseSectionGroup( DomainMapper_Impl& rDM_Impl );
     268             : };
     269             : typedef boost::shared_ptr<SectionPropertyMap> SectionPropertyMapPtr;
     270             : 
     271             : 
     272             : 
     273             : class ParagraphProperties
     274             : {
     275             :     bool                    m_bFrameMode;
     276             :     sal_Int32               m_nDropCap; //drop, margin ST_DropCap
     277             :     sal_Int32               m_nLines; //number of lines of the drop cap
     278             :     sal_Int32               m_w;    //width
     279             :     sal_Int32               m_h;    //height
     280             :     sal_Int32               m_nWrap;   // from ST_Wrap around, auto, none, notBeside, through, tight
     281             :     sal_Int32               m_hAnchor; // page, from ST_HAnchor  margin, page, text
     282             :     sal_Int32               m_vAnchor; // around from ST_VAnchor margin, page, text
     283             :     sal_Int32               m_x; //x-position
     284             :     bool                    m_bxValid;
     285             :     sal_Int32               m_y; //y-position
     286             :     bool                    m_byValid;
     287             :     sal_Int32               m_hSpace; //frame padding h
     288             :     sal_Int32               m_vSpace; //frame padding v
     289             :     sal_Int32               m_hRule; //  from ST_HeightRule exact, atLeast, auto
     290             :     sal_Int32               m_xAlign; // from ST_XAlign center, inside, left, outside, right
     291             :     sal_Int32               m_yAlign; // from ST_YAlign bottom, center, inline, inside, outside, top
     292             :     bool                    m_bAnchorLock;
     293             : 
     294             :     sal_Int8                m_nDropCapLength; //number of characters
     295             : 
     296             :     OUString         m_sParaStyleName;
     297             : 
     298             :     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >      m_xStartingRange; //start of a frame
     299             :     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >      m_xEndingRange; //end of the frame
     300             : 
     301             : public:
     302             :     ParagraphProperties();
     303             :     ParagraphProperties(const ParagraphProperties&);
     304             :     ~ParagraphProperties();
     305             : 
     306             :     int operator==(const ParagraphProperties&); //does not compare the starting/ending range, m_sParaStyleName and m_nDropCapLength
     307             : 
     308          34 :     void    SetFrameMode( bool set = true ) { m_bFrameMode = set; }
     309        2996 :     bool    IsFrameMode()const { return m_bFrameMode; }
     310             : 
     311           0 :     void SetDropCap( sal_Int32 nSet ) { m_nDropCap = nSet; }
     312          62 :     sal_Int32 GetDropCap()const { return m_nDropCap; }
     313             : 
     314           0 :     void SetLines( sal_Int32 nSet ) { m_nLines = nSet; }
     315           0 :     sal_Int32 GetLines() const { return m_nLines; }
     316             : 
     317          34 :     void Setw( sal_Int32 nSet ) { m_w = nSet; }
     318          34 :     sal_Int32 Getw() const { return m_w; }
     319             : 
     320          34 :     void Seth( sal_Int32 nSet ) { m_h = nSet; }
     321          56 :     sal_Int32 Geth() const { return m_h; }
     322             : 
     323           0 :     void SetWrap( sal_Int32 nSet ) { m_nWrap = nSet; }
     324          34 :     sal_Int32 GetWrap() const { return m_nWrap; }
     325             : 
     326          34 :     void SethAnchor( sal_Int32 nSet ) { m_hAnchor = nSet; }
     327          56 :     sal_Int32 GethAnchor() const { return m_hAnchor;}
     328             : 
     329          34 :     void SetvAnchor( sal_Int32 nSet ) { m_vAnchor = nSet; }
     330          56 :     sal_Int32 GetvAnchor() const { return m_vAnchor; }
     331             : 
     332          28 :     void Setx( sal_Int32 nSet ) { m_x = nSet; m_bxValid = true;}
     333          28 :     sal_Int32 Getx() const { return m_x; }
     334          28 :     bool IsxValid() const {return m_bxValid;}
     335             : 
     336          28 :     void Sety( sal_Int32 nSet ) { m_y = nSet; m_byValid = true;}
     337          28 :     sal_Int32 Gety()const { return m_y; }
     338          28 :     bool IsyValid() const {return m_byValid;}
     339             : 
     340           8 :     void SethSpace( sal_Int32 nSet ) { m_hSpace = nSet; }
     341          34 :     sal_Int32 GethSpace()const { return m_hSpace; }
     342             : 
     343           8 :     void SetvSpace( sal_Int32 nSet ) { m_vSpace = nSet; }
     344          34 :     sal_Int32 GetvSpace()const { return m_vSpace; }
     345             : 
     346          34 :     void SethRule( sal_Int32 nSet ) { m_hRule = nSet; }
     347          56 :     sal_Int32 GethRule() const  { return m_hRule; }
     348             : 
     349          34 :     void SetxAlign( sal_Int32 nSet ) { m_xAlign = nSet; }
     350          56 :     sal_Int32 GetxAlign()const { return m_xAlign; }
     351             : 
     352          34 :     void SetyAlign( sal_Int32 nSet ) { m_yAlign = nSet; }
     353          56 :     sal_Int32 GetyAlign()const { return m_yAlign; }
     354             : 
     355             :     void SetAnchorLock( bool bSet ) {m_bAnchorLock = bSet; }
     356             : 
     357           0 :     sal_Int8    GetDropCapLength() const { return m_nDropCapLength;}
     358           0 :     void        SetDropCapLength(sal_Int8 nSet) { m_nDropCapLength = nSet;}
     359             : 
     360          56 :     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetStartingRange() const { return m_xStartingRange; }
     361          26 :     void SetStartingRange( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xSet ) { m_xStartingRange = xSet; }
     362             : 
     363          56 :     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetEndingRange() const { return m_xEndingRange; }
     364          34 :     void SetEndingRange( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xSet ) { m_xEndingRange = xSet; }
     365             : 
     366          26 :     void                    SetParaStyleName( const OUString& rSet ) { m_sParaStyleName = rSet;}
     367          28 :     const OUString&  GetParaStyleName() const { return m_sParaStyleName;}
     368             : 
     369             :     void ResetFrameProperties();
     370             : };
     371             : typedef boost::shared_ptr<ParagraphProperties>  ParagraphPropertiesPtr;
     372             : /*-------------------------------------------------------------------------
     373             :     property map of a stylesheet
     374             :   -----------------------------------------------------------------------*/
     375             : 
     376             : #define WW_OUTLINE_MAX  sal_Int16( 9 )
     377             : 
     378             : class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties
     379             : 
     380             : {
     381             :     //special table style properties
     382             :     sal_Int32               mnCT_Spacing_line;
     383             :     sal_Int32               mnCT_Spacing_lineRule;
     384             : 
     385             :     OUString         msCT_Fonts_ascii;
     386             :     bool                    mbCT_TrPrBase_tblHeader;
     387             :     sal_Int32               mnCT_TrPrBase_jc;
     388             :     sal_Int32               mnCT_TcPrBase_vAlign;
     389             : 
     390             :     sal_Int32               mnCT_TblWidth_w;
     391             :     sal_Int32               mnCT_TblWidth_type;
     392             : 
     393             :     bool                    mbCT_Spacing_lineSet;
     394             :     bool                    mbCT_Spacing_lineRuleSet;
     395             : 
     396             :     bool                    mbCT_TrPrBase_tblHeaderSet;
     397             :     bool                    mbCT_TrPrBase_jcSet;
     398             :     bool                    mbCT_TcPrBase_vAlignSet;
     399             : 
     400             :     bool                    mbCT_TblWidth_wSet;
     401             :     bool                    mbCT_TblWidth_typeSet;
     402             : 
     403             :     sal_Int32               mnListId;
     404             :     sal_Int16               mnListLevel;
     405             : 
     406             :     sal_Int16               mnOutlineLevel;
     407             : public:
     408             :     explicit StyleSheetPropertyMap();
     409             :     ~StyleSheetPropertyMap();
     410             : 
     411             :     void SetCT_Spacing_line(       sal_Int32 nSet )
     412             :         {mnCT_Spacing_line = nSet;     mbCT_Spacing_lineSet = true;         }
     413             :     void SetCT_Spacing_lineRule(   sal_Int32  nSet )
     414             :         {mnCT_Spacing_lineRule = nSet; mbCT_Spacing_lineRuleSet = true;     }
     415             : 
     416             :     void SetCT_Fonts_ascii(  const OUString& rSet )
     417             :         {msCT_Fonts_ascii = rSet;          }
     418             :     void SetCT_TrPrBase_tblHeader( bool bSet )
     419             :         {mbCT_TrPrBase_tblHeader = bSet; mbCT_TrPrBase_tblHeaderSet = true; }
     420           0 :     void SetCT_TrPrBase_jc(        sal_Int32 nSet )
     421           0 :         {mnCT_TrPrBase_jc = nSet;        mbCT_TrPrBase_jcSet = true;     }
     422             :     void SetCT_TcPrBase_vAlign(    sal_Int32 nSet )
     423             :         {mnCT_TcPrBase_vAlign = nSet;    mbCT_TcPrBase_vAlignSet = true; }
     424             : 
     425           0 :     void SetCT_TblWidth_w( sal_Int32 nSet )
     426           0 :         { mnCT_TblWidth_w = nSet;    mbCT_TblWidth_wSet = true; }
     427           0 :     void SetCT_TblWidth_type( sal_Int32 nSet )
     428           0 :         {mnCT_TblWidth_type = nSet;    mbCT_TblWidth_typeSet = true; }
     429             : 
     430             :     bool GetCT_Spacing_line(    sal_Int32& rToFill) const
     431             :     {
     432             :         if( mbCT_Spacing_lineSet )
     433             :             rToFill = mnCT_Spacing_line;
     434             :         return mbCT_Spacing_lineSet;
     435             :     }
     436             :     bool GetCT_Spacing_lineRule(sal_Int32& rToFill) const
     437             :     {
     438             :         if( mbCT_Spacing_lineRuleSet )
     439             :             rToFill = mnCT_Spacing_lineRule;
     440             :         return mbCT_Spacing_lineRuleSet;
     441             :     }
     442             : 
     443             :     bool GetCT_Fonts_ascii(OUString& rToFill) const
     444             :     {
     445             :         if( msCT_Fonts_ascii.getLength() > 0 )
     446             :             rToFill = msCT_Fonts_ascii;
     447             :         return msCT_Fonts_ascii.getLength() > 0;
     448             :     }
     449             :     bool GetCT_TrPrBase_tblHeader(bool& rToFill) const
     450             :     {
     451             :         if( mbCT_TrPrBase_tblHeaderSet )
     452             :             rToFill = mbCT_TrPrBase_tblHeader;
     453             :         return mbCT_TrPrBase_tblHeaderSet;
     454             :     }
     455             :     bool GetCT_TrPrBase_jc(     sal_Int32& rToFill)const
     456             :     {
     457             :         if( mbCT_TrPrBase_jcSet )
     458             :             rToFill = mnCT_TrPrBase_jc;
     459             :         return mbCT_TrPrBase_jcSet;
     460             :     }
     461             :     bool GetCT_TcPrBase_vAlign( sal_Int32& rToFill)const
     462             :     {
     463             :         if( mbCT_TcPrBase_vAlignSet )
     464             :             rToFill = mnCT_TcPrBase_vAlign;
     465             :         return mbCT_TcPrBase_vAlignSet;
     466             :     }
     467         416 :     sal_Int32   GetListId() const               { return mnListId; }
     468          46 :     void        SetListId(sal_Int32 nId)        { mnListId = nId; }
     469             : 
     470         366 :     sal_Int16   GetListLevel() const            { return mnListLevel; }
     471          22 :     void        SetListLevel(sal_Int16 nLevel)  { mnListLevel = nLevel; }
     472             : 
     473        2556 :     sal_Int16   GetOutlineLevel() const            { return mnOutlineLevel; }
     474          76 :     void        SetOutlineLevel(sal_Int16 nLevel)
     475             :     {
     476          76 :         if ( nLevel < WW_OUTLINE_MAX )
     477          76 :             mnOutlineLevel = nLevel;
     478          76 :     }
     479             : };
     480             : 
     481             : 
     482             : class ParagraphPropertyMap : public PropertyMap, public ParagraphProperties
     483             : {
     484             : public:
     485             :     explicit ParagraphPropertyMap();
     486             :     ~ParagraphPropertyMap();
     487             : 
     488             : };
     489             : 
     490             : 
     491             : class TablePropertyMap : public PropertyMap
     492             : {
     493             : public:
     494             :     enum TablePropertyMapTarget
     495             :     {
     496             :         TablePropertyMapTarget_START,
     497             :         CELL_MAR_LEFT = TablePropertyMapTarget_START,
     498             :         CELL_MAR_RIGHT,
     499             :         CELL_MAR_TOP,
     500             :         CELL_MAR_BOTTOM,
     501             :         TABLE_WIDTH,
     502             :         GAP_HALF,
     503             :         LEFT_MARGIN,
     504             :         HORI_ORIENT,
     505             :         TablePropertyMapTarget_MAX
     506             :     };
     507             : private:
     508             :     struct ValidValue
     509             :     {
     510             :         sal_Int32   nValue;
     511             :         bool        bValid;
     512       14144 :         ValidValue() :
     513             :             nValue( 0 ),
     514       14144 :             bValid( false ){}
     515             :     };
     516             :     ValidValue m_aValidValues[TablePropertyMapTarget_MAX];
     517             : 
     518             : public:
     519             :     explicit TablePropertyMap();
     520             :     ~TablePropertyMap();
     521             : 
     522             :     bool    getValue( TablePropertyMapTarget eWhich, sal_Int32& nFill );
     523             :     void    setValue( TablePropertyMapTarget eWhich, sal_Int32 nSet );
     524             : 
     525             :     virtual void insertTableProperties( const PropertyMap* );
     526             : };
     527             : typedef boost::shared_ptr<TablePropertyMap>  TablePropertyMapPtr;
     528             : } //namespace dmapper
     529             : } //namespace writerfilter
     530             : #endif
     531             : 
     532             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10