1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef INCLUDED_DMAPPER_PROPERTYMAP_HXX
24 #define INCLUDED_DMAPPER_PROPERTYMAP_HXX
25 
26 #include <rtl/ustring.hxx>
27 #include <com/sun/star/uno/Sequence.hxx>
28 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HXX_
29 #include <com/sun/star/beans/PropertyValue.hpp>
30 #endif
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/uno/Any.h>
33 #include <PropertyIds.hxx>
34 #include <boost/shared_ptr.hpp>
35 #include <map>
36 #include <vector>
37 
38 #include <resourcemodel/TagLogger.hxx>
39 
40 namespace com{namespace sun{namespace star{
41     namespace beans{
42     struct PropertyValue;
43     }
44     namespace container{
45         class XNameAccess;
46         class XNameContainer;
47     }
48     namespace lang{
49         class XMultiServiceFactory;
50     }
51     namespace text{
52         class XTextRange;
53         class XTextColumns;
54         class XFootnote;
55     }
56     namespace table{
57         struct BorderLine;
58     }
59 }}}
60 
61 namespace writerfilter {
62 namespace dmapper{
63 class DomainMapper_Impl;
64 
65 enum BorderPosition
66 {
67     BORDER_LEFT,
68     BORDER_RIGHT,
69     BORDER_TOP,
70     BORDER_BOTTOM
71 };
72 /*-- 15.06.2006 08:22:33---------------------------------------------------
73 
74   -----------------------------------------------------------------------*/
75 struct PropertyDefinition
76 {
77     PropertyIds eId;
78     bool        bIsTextProperty;
79 
PropertyDefinitionwriterfilter::dmapper::PropertyDefinition80     PropertyDefinition( PropertyIds _eId, bool _bIsTextProperty ) :
81         eId( _eId ),
82         bIsTextProperty( _bIsTextProperty ){}
83 
operator ==writerfilter::dmapper::PropertyDefinition84     bool    operator== (const PropertyDefinition& rDef) const
85             {   return rDef.eId == eId; }
operator <writerfilter::dmapper::PropertyDefinition86     bool    operator< (const PropertyDefinition& rDef) const
87             {   return eId < rDef.eId; }
88 };
89 typedef std::map < PropertyDefinition, ::com::sun::star::uno::Any > _PropertyMap;
90 class PropertyMap : public _PropertyMap
91 {
92     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >   m_aValues;
93     //marks context as footnote context - ::text( ) events contain either the footnote character or can be ignored
94     //depending on sprmCSymbol
95     sal_Unicode                                                                 m_cFootnoteSymbol; // 0 == invalid
96     sal_Int32                                                                   m_nFootnoteFontId; // negative values are invalid ids
97     ::rtl::OUString                                                             m_sFootnoteFontName;
98     ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote >       m_xFootnote;
99 
100 protected:
Invalidate()101     void Invalidate()
102     {
103         if(m_aValues.getLength())
104             m_aValues.realloc( 0 );
105     }
106 
107 public:
108     PropertyMap();
109     virtual ~PropertyMap();
110 
111     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetPropertyValues();
hasEmptyPropertyValues() const112     bool hasEmptyPropertyValues() const {return !m_aValues.getLength();}
113     /** Add property, usually overwrites already available attributes. It shouldn't overwrite in case of default attributes
114      */
115     void Insert( PropertyIds eId, bool bIsTextProperty, const ::com::sun::star::uno::Any& rAny, bool bOverwrite = true );
116     using _PropertyMap::insert;
117     void insert(const boost::shared_ptr<PropertyMap> pMap, bool bOverwrite = true);
118 
119     const ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote>&  GetFootnote() const;
SetFootnote(::com::sun::star::uno::Reference<::com::sun::star::text::XFootnote> xF)120     void SetFootnote( ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote> xF ) { m_xFootnote = xF; }
121 
GetFootnoteSymbol() const122     sal_Unicode GetFootnoteSymbol() const { return m_cFootnoteSymbol;}
SetFootnoteSymbol(sal_Unicode cSet)123     void        SetFootnoteSymbol(sal_Unicode cSet) { m_cFootnoteSymbol = cSet;}
124 
GetFootnoteFontId() const125     sal_Int32   GetFootnoteFontId() const { return m_nFootnoteFontId;}
SetFootnoteFontId(sal_Int32 nSet)126     void        SetFootnoteFontId(sal_Int32 nSet) { m_nFootnoteFontId = nSet;}
127 
GetFootnoteFontName() const128     const ::rtl::OUString&      GetFootnoteFontName() const { return m_sFootnoteFontName;}
SetFootnoteFontName(const::rtl::OUString & rSet)129     void                        SetFootnoteFontName( const ::rtl::OUString& rSet ) { m_sFootnoteFontName = rSet;}
130 
131     virtual void insertTableProperties( const PropertyMap* );
132 
133     virtual XMLTag::Pointer_t toTag() const;
134 };
135 typedef boost::shared_ptr<PropertyMap>  PropertyMapPtr;
136 
137 /*-- 24.07.2006 08:26:33---------------------------------------------------
138 
139   -----------------------------------------------------------------------*/
140 class SectionPropertyMap : public PropertyMap
141 {
142     //--> debug
143     sal_Int32 nSectionNumber;
144     //<-- debug
145     //'temporarily' the section page settings are imported as page styles
146     // empty strings mark page settings as not yet imported
147 
148     bool                                                                        m_bIsFirstSection;
149     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >      m_xStartingRange;
150 
151     ::rtl::OUString                                                             m_sFirstPageStyleName;
152     ::rtl::OUString                                                             m_sFollowPageStyleName;
153     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >   m_aFirstPageStyle;
154     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >   m_aFollowPageStyle;
155 
156     ::com::sun::star::table::BorderLine*    m_pBorderLines[4];
157     sal_Int32                               m_nBorderDistances[4];
158     sal_Int32                               m_nBorderParams;
159 
160     bool                                    m_bTitlePage;
161     sal_Int16                               m_nColumnCount;
162     sal_Int32                               m_nColumnDistance;
163     ::std::vector< sal_Int32 >              m_aColWidth;
164     ::std::vector< sal_Int32 >              m_aColDistance;
165 
166     bool                                    m_bSeparatorLineIsOn;
167     bool                                    m_bEvenlySpaced;
168     bool                                    m_bIsLandscape;
169 
170     bool                                    m_bPageNoRestart;
171     sal_Int32                               m_nPageNumber;
172     sal_Int32                               m_nBreakType;
173     sal_Int32                               m_nPaperBin;
174     sal_Int32                               m_nFirstPaperBin;
175 
176     sal_Int32                               m_nLeftMargin;
177     sal_Int32                               m_nRightMargin;
178     sal_Int32                               m_nTopMargin;
179     sal_Int32                               m_nBottomMargin;
180     sal_Int32                               m_nHeaderTop;
181     sal_Int32                               m_nHeaderBottom;
182 
183     sal_Int32                               m_nDzaGutter;
184     bool                                    m_bGutterRTL;
185     bool                                    m_bSFBiDi;
186 
187     sal_Int32                               m_nGridType;
188     sal_Int32                               m_nGridLinePitch;
189     sal_Int32                               m_nDxtCharSpace;
190 
191     //line numbering
192     sal_Int32                               m_nLnnMod;
193     sal_Int32                               m_nLnc;
194     sal_Int32                               m_ndxaLnn;
195     sal_Int32                               m_nLnnMin;
196 
197     void _ApplyProperties( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xStyle );
198     ::com::sun::star::uno::Reference< com::sun::star::text::XTextColumns > ApplyColumnProperties(
199             ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xFollowPageStyle );
200     void CopyLastHeaderFooter( bool bFirstPage, DomainMapper_Impl& rDM_Impl );
201     void PrepareHeaderFooterProperties( bool bFirstPage );
202     bool HasHeader( bool bFirstPage ) const;
203     bool HasFooter( bool bFirstPage ) const;
204 
205     void SetBorderDistance( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xStyle,
206         PropertyIds eMarginId, PropertyIds eDistId, sal_Int32 nDistance, sal_Int32 nOffsetFrom );
207 
208 public:
209         explicit SectionPropertyMap(bool bIsFirstSection);
210         ~SectionPropertyMap();
211 
212     enum PageType
213     {
214         PAGE_FIRST,
215         PAGE_LEFT,
216         PAGE_RIGHT
217     };
218 
SetStart(const::com::sun::star::uno::Reference<::com::sun::star::text::XTextRange> & xRange)219     void SetStart( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange )
220     {
221         m_xStartingRange = xRange;
222     }
223 
224     const ::rtl::OUString&  GetPageStyleName( bool bFirst );
225     void                    SetPageStyleName( bool bFirst, const ::rtl::OUString& rName);
226 
227     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetPageStyle(
228             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xStyles,
229             const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xTextFactory,
230             bool bFirst );
231 
232     void SetBorder( BorderPosition ePos, sal_Int32 nLineDistance, const ::com::sun::star::table::BorderLine& rBorderLine );
SetBorderParams(sal_Int32 nSet)233     void SetBorderParams( sal_Int32 nSet ) { m_nBorderParams = nSet; }
234 
SetColumnCount(sal_Int16 nCount)235     void SetColumnCount( sal_Int16 nCount ) { m_nColumnCount = nCount; }
SetColumnDistance(sal_Int32 nDist)236     void SetColumnDistance( sal_Int32 nDist ) { m_nColumnDistance = nDist; }
AppendColumnWidth(sal_Int32 nWidth)237     void AppendColumnWidth( sal_Int32 nWidth ) { m_aColWidth.push_back( nWidth ); }
AppendColumnSpacing(sal_Int32 nDist)238     void AppendColumnSpacing( sal_Int32 nDist ) {m_aColDistance.push_back( nDist ); }
239 
SetTitlePage(bool bSet)240     void SetTitlePage( bool bSet ) { m_bTitlePage = bSet; }
SetSeparatorLine(bool bSet)241     void SetSeparatorLine( bool bSet ) { m_bSeparatorLineIsOn = bSet; }
SetEvenlySpaced(bool bSet)242     void SetEvenlySpaced( bool bSet ) {    m_bEvenlySpaced = bSet; }
SetLandscape(bool bSet)243     void SetLandscape( bool bSet ) { m_bIsLandscape = bSet; }
SetPageNoRestart(bool bSet)244     void SetPageNoRestart( bool bSet ) { m_bPageNoRestart = bSet; }
SetPageNumber(sal_Int32 nSet)245     void SetPageNumber( sal_Int32 nSet ) { m_nPageNumber = nSet; }
SetBreakType(sal_Int32 nSet)246     void SetBreakType( sal_Int32 nSet ) { m_nBreakType = nSet; }
247     void SetPaperBin( sal_Int32 nSet );
248     void SetFirstPaperBin( sal_Int32 nSet );
249 
SetLeftMargin(sal_Int32 nSet)250     void SetLeftMargin(    sal_Int32 nSet ) { m_nLeftMargin = nSet; }
SetRightMargin(sal_Int32 nSet)251     void SetRightMargin( sal_Int32 nSet ) { m_nRightMargin = nSet; }
SetTopMargin(sal_Int32 nSet)252     void SetTopMargin(    sal_Int32 nSet ) { m_nTopMargin = nSet; }
SetBottomMargin(sal_Int32 nSet)253     void SetBottomMargin( sal_Int32 nSet ) { m_nBottomMargin = nSet; }
SetHeaderTop(sal_Int32 nSet)254     void SetHeaderTop(    sal_Int32 nSet ) { m_nHeaderTop = nSet; }
SetHeaderBottom(sal_Int32 nSet)255     void SetHeaderBottom( sal_Int32 nSet ) { m_nHeaderBottom = nSet; }
256 
SetGutterRTL(bool bSet)257     void SetGutterRTL( bool bSet ) { m_bGutterRTL = bSet;}
SetDzaGutter(sal_Int32 nSet)258     void SetDzaGutter( sal_Int32 nSet ) {m_nDzaGutter = nSet; }
SetSFBiDi(bool bSet)259     void SetSFBiDi( bool bSet ) { m_bSFBiDi = bSet;}
260 
SetGridType(sal_Int32 nSet)261     void SetGridType(sal_Int32 nSet) { m_nGridType = nSet; }
SetGridLinePitch(sal_Int32 nSet)262     void SetGridLinePitch( sal_Int32 nSet ) { m_nGridLinePitch = nSet; }
SetDxtCharSpace(sal_Int32 nSet)263     void SetDxtCharSpace( sal_Int32 nSet ) { m_nDxtCharSpace = nSet; }
264 
SetLnnMod(sal_Int32 nValue)265     void SetLnnMod( sal_Int32 nValue ) { m_nLnnMod = nValue; }
SetLnc(sal_Int32 nValue)266     void SetLnc(    sal_Int32 nValue ) { m_nLnc    = nValue; }
SetdxaLnn(sal_Int32 nValue)267     void SetdxaLnn( sal_Int32 nValue ) { m_ndxaLnn  = nValue; }
SetLnnMin(sal_Int32 nValue)268     void SetLnnMin( sal_Int32 nValue ) { m_nLnnMin = nValue; }
269 
270     //determine which style gets the borders
271     void ApplyBorderToPageStyles(
272             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xStyles,
273             const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xTextFactory,
274             sal_Int32 nValue );
275 
276     void CloseSectionGroup( DomainMapper_Impl& rDM_Impl );
277 };
278 typedef boost::shared_ptr<SectionPropertyMap> SectionPropertyMapPtr;
279 
280 /*-- 28.12.2007 08:17:34---------------------------------------------------
281 
282   -----------------------------------------------------------------------*/
283 class ParagraphProperties
284 {
285     bool                    m_bFrameMode;
286     sal_Int32               m_nDropCap; //drop, margin ST_DropCap
287     sal_Int32               m_nLines; //number of lines of the drop cap
288     sal_Int32               m_w;    //width
289     sal_Int32               m_h;    //height
290     sal_Int32               m_nWrap;   // from ST_Wrap around, auto, none, notBeside, through, tight
291     sal_Int32               m_hAnchor; // page, from ST_HAnchor  margin, page, text
292     sal_Int32               m_vAnchor; // around from ST_VAnchor margin, page, text
293     sal_Int32               m_x; //x-position
294     bool                    m_bxValid;
295     sal_Int32               m_y; //y-position
296     bool                    m_byValid;
297     sal_Int32               m_hSpace; //frame padding h
298     sal_Int32               m_vSpace; //frame padding v
299     sal_Int32               m_hRule; //  from ST_HeightRule exact, atLeast, auto
300     sal_Int32               m_xAlign; // from ST_XAlign center, inside, left, outside, right
301     sal_Int32               m_yAlign; // from ST_YAlign bottom, center, inline, inside, outside, top
302     bool                    m_bAnchorLock;
303 
304     sal_Int8                m_nDropCapLength; //number of characters
305 
306     ::rtl::OUString         m_sParaStyleName;
307 
308     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >      m_xStartingRange; //start of a frame
309     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >      m_xEndingRange; //end of the frame
310 
311 public:
312     ParagraphProperties();
313     ParagraphProperties(const ParagraphProperties&);
314     ~ParagraphProperties();
315 
316     int operator==(const ParagraphProperties&); //does not compare the starting/ending range, m_sParaStyleName and m_nDropCapLength
317 
SetFrameMode()318     void    SetFrameMode() { m_bFrameMode = true; }
IsFrameMode() const319     bool    IsFrameMode()const { return m_bFrameMode; }
320 
SetDropCap(sal_Int32 nSet)321     void SetDropCap( sal_Int32 nSet ) { m_nDropCap = nSet; }
GetDropCap() const322     sal_Int32 GetDropCap()const { return m_nDropCap; }
323 
SetLines(sal_Int32 nSet)324     void SetLines( sal_Int32 nSet ) { m_nLines = nSet; }
GetLines() const325     sal_Int32 GetLines() const { return m_nLines; }
326 
Setw(sal_Int32 nSet)327     void Setw( sal_Int32 nSet ) { m_w = nSet; }
Getw() const328     sal_Int32 Getw() const { return m_w; }
329 
Seth(sal_Int32 nSet)330     void Seth( sal_Int32 nSet ) { m_h = nSet; }
Geth() const331     sal_Int32 Geth() const { return m_h; }
332 
SetWrap(sal_Int32 nSet)333     void SetWrap( sal_Int32 nSet ) { m_nWrap = nSet; }
GetWrap() const334     sal_Int32 GetWrap() const { return m_nWrap; }
335 
SethAnchor(sal_Int32 nSet)336     void SethAnchor( sal_Int32 nSet ) { m_hAnchor = nSet; }
GethAnchor() const337     sal_Int32 GethAnchor() const { return m_hAnchor;}
338 
SetvAnchor(sal_Int32 nSet)339     void SetvAnchor( sal_Int32 nSet ) { m_vAnchor = nSet; }
GetvAnchor() const340     sal_Int32 GetvAnchor() const { return m_vAnchor; }
341 
Setx(sal_Int32 nSet)342     void Setx( sal_Int32 nSet ) { m_x = nSet; m_bxValid = true;}
Getx() const343     sal_Int32 Getx() const { return m_x; }
IsxValid() const344     bool IsxValid() const {return m_bxValid;}
345 
Sety(sal_Int32 nSet)346     void Sety( sal_Int32 nSet ) { m_y = nSet; m_byValid = true;}
Gety() const347     sal_Int32 Gety()const { return m_y; }
IsyValid() const348     bool IsyValid() const {return m_byValid;}
349 
SethSpace(sal_Int32 nSet)350     void SethSpace( sal_Int32 nSet ) { m_hSpace = nSet; }
GethSpace() const351     sal_Int32 GethSpace()const { return m_hSpace; }
352 
SetvSpace(sal_Int32 nSet)353     void SetvSpace( sal_Int32 nSet ) { m_vSpace = nSet; }
GetvSpace() const354     sal_Int32 GetvSpace()const { return m_vSpace; }
355 
SethRule(sal_Int32 nSet)356     void SethRule( sal_Int32 nSet ) { m_hRule = nSet; }
GethRule() const357     sal_Int32 GethRule() const  { return m_hRule; }
358 
SetxAlign(sal_Int32 nSet)359     void SetxAlign( sal_Int32 nSet ) { m_xAlign = nSet; }
GetxAlign() const360     sal_Int32 GetxAlign()const { return m_xAlign; }
361 
SetyAlign(sal_Int32 nSet)362     void SetyAlign( sal_Int32 nSet ) { m_yAlign = nSet; }
GetyAlign() const363     sal_Int32 GetyAlign()const { return m_yAlign; }
364 
SetAnchorLock(bool bSet)365     void SetAnchorLock( bool bSet ) {m_bAnchorLock = bSet; }
366 
GetDropCapLength() const367     sal_Int8    GetDropCapLength() const { return m_nDropCapLength;}
SetDropCapLength(sal_Int8 nSet)368     void        SetDropCapLength(sal_Int8 nSet) { m_nDropCapLength = nSet;}
369 
GetStartingRange() const370     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetStartingRange() const { return m_xStartingRange; }
SetStartingRange(::com::sun::star::uno::Reference<::com::sun::star::text::XTextRange> xSet)371     void SetStartingRange( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xSet ) { m_xStartingRange = xSet; }
372 
GetEndingRange() const373     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetEndingRange() const { return m_xEndingRange; }
SetEndingRange(::com::sun::star::uno::Reference<::com::sun::star::text::XTextRange> xSet)374     void SetEndingRange( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xSet ) { m_xEndingRange = xSet; }
375 
SetParaStyleName(const::rtl::OUString & rSet)376     void                    SetParaStyleName( const ::rtl::OUString& rSet ) { m_sParaStyleName = rSet;}
GetParaStyleName() const377     const ::rtl::OUString&  GetParaStyleName() const { return m_sParaStyleName;}
378 
379 
380 };
381 typedef boost::shared_ptr<ParagraphProperties>  ParagraphPropertiesPtr;
382 /*-- 14.06.2007 12:12:34---------------------------------------------------
383     property map of a stylesheet
384   -----------------------------------------------------------------------*/
385 
386 #define WW_OUTLINE_MAX  sal_Int16( 9 )
387 #define WW_OUTLINE_MIN  sal_Int16( 0 )
388 
389 class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties
390 
391 {
392     //special table style properties
393 //    sal_Int32               mnCT_Spacing_after;
394     sal_Int32               mnCT_Spacing_line;
395     sal_Int32               mnCT_Spacing_lineRule;
396 
397     ::rtl::OUString         msCT_Fonts_ascii;
398     bool                    mbCT_TrPrBase_tblHeader;
399     sal_Int32               mnCT_TrPrBase_jc;
400     sal_Int32               mnCT_TcPrBase_vAlign;
401 
402     sal_Int32               mnCT_TblWidth_w;
403     sal_Int32               mnCT_TblWidth_type;
404 
405 //    bool                    mbCT_Spacing_afterSet;
406     bool                    mbCT_Spacing_lineSet;
407     bool                    mbCT_Spacing_lineRuleSet;
408 
409     bool                    mbCT_TrPrBase_tblHeaderSet;
410     bool                    mbCT_TrPrBase_jcSet;
411     bool                    mbCT_TcPrBase_vAlignSet;
412 
413     bool                    mbCT_TblWidth_wSet;
414     bool                    mbCT_TblWidth_typeSet;
415 
416     sal_Int32               mnListId;
417     sal_Int16               mnListLevel;
418 
419     sal_Int16               mnOutlineLevel;
420 
421     sal_Int32               mnNumId;
422 public:
423     explicit StyleSheetPropertyMap();
424     ~StyleSheetPropertyMap();
425 
426 //    void SetCT_Spacing_after(      sal_Int32 nSet )
427 //        {mnCT_Spacing_after = nSet;    mbCT_Spacing_afterSet = true;        }
SetCT_Spacing_line(sal_Int32 nSet)428     void SetCT_Spacing_line(       sal_Int32 nSet )
429         {mnCT_Spacing_line = nSet;     mbCT_Spacing_lineSet = true;         }
SetCT_Spacing_lineRule(sal_Int32 nSet)430     void SetCT_Spacing_lineRule(   sal_Int32  nSet )
431         {mnCT_Spacing_lineRule = nSet; mbCT_Spacing_lineRuleSet = true;     }
432 
SetCT_Fonts_ascii(const::rtl::OUString & rSet)433     void SetCT_Fonts_ascii(  const ::rtl::OUString& rSet )
434         {msCT_Fonts_ascii = rSet;          }
SetCT_TrPrBase_tblHeader(bool bSet)435     void SetCT_TrPrBase_tblHeader( bool bSet )
436         {mbCT_TrPrBase_tblHeader = bSet; mbCT_TrPrBase_tblHeaderSet = true; }
SetCT_TrPrBase_jc(sal_Int32 nSet)437     void SetCT_TrPrBase_jc(        sal_Int32 nSet )
438         {mnCT_TrPrBase_jc = nSet;        mbCT_TrPrBase_jcSet = true;     }
SetCT_TcPrBase_vAlign(sal_Int32 nSet)439     void SetCT_TcPrBase_vAlign(    sal_Int32 nSet )
440         {mnCT_TcPrBase_vAlign = nSet;    mbCT_TcPrBase_vAlignSet = true; }
441 
SetCT_TblWidth_w(sal_Int32 nSet)442     void SetCT_TblWidth_w( sal_Int32 nSet )
443         { mnCT_TblWidth_w = nSet;    mbCT_TblWidth_wSet = true; }
SetCT_TblWidth_type(sal_Int32 nSet)444     void SetCT_TblWidth_type( sal_Int32 nSet )
445         {mnCT_TblWidth_type = nSet;    mbCT_TblWidth_typeSet = true; }
446 
447 //    bool GetCT_Spacing_after(   sal_Int32& rToFill) const
448 //    {
449 //        if( mbCT_Spacing_afterSet )
450 //            rToFill = mnCT_Spacing_after;
451 //        return mbCT_Spacing_afterSet;
452 //    }
GetCT_Spacing_line(sal_Int32 & rToFill) const453     bool GetCT_Spacing_line(    sal_Int32& rToFill) const
454     {
455         if( mbCT_Spacing_lineSet )
456             rToFill = mnCT_Spacing_line;
457         return mbCT_Spacing_lineSet;
458     }
GetCT_Spacing_lineRule(sal_Int32 & rToFill) const459     bool GetCT_Spacing_lineRule(sal_Int32& rToFill) const
460     {
461         if( mbCT_Spacing_lineRuleSet )
462             rToFill = mnCT_Spacing_lineRule;
463         return mbCT_Spacing_lineRuleSet;
464     }
465 
GetCT_Fonts_ascii(::rtl::OUString & rToFill) const466     bool GetCT_Fonts_ascii(::rtl::OUString& rToFill) const
467     {
468         if( msCT_Fonts_ascii.getLength() > 0 )
469             rToFill = msCT_Fonts_ascii;
470         return msCT_Fonts_ascii.getLength() > 0;
471     }
GetCT_TrPrBase_tblHeader(bool & rToFill) const472     bool GetCT_TrPrBase_tblHeader(bool& rToFill) const
473     {
474         if( mbCT_TrPrBase_tblHeaderSet )
475             rToFill = mbCT_TrPrBase_tblHeader;
476         return mbCT_TrPrBase_tblHeaderSet;
477     }
GetCT_TrPrBase_jc(sal_Int32 & rToFill) const478     bool GetCT_TrPrBase_jc(     sal_Int32& rToFill)const
479     {
480         if( mbCT_TrPrBase_jcSet )
481             rToFill = mnCT_TrPrBase_jc;
482         return mbCT_TrPrBase_jcSet;
483     }
GetCT_TcPrBase_vAlign(sal_Int32 & rToFill) const484     bool GetCT_TcPrBase_vAlign( sal_Int32& rToFill)const
485     {
486         if( mbCT_TcPrBase_vAlignSet )
487             rToFill = mnCT_TcPrBase_vAlign;
488         return mbCT_TcPrBase_vAlignSet;
489     }
GetListId() const490     sal_Int32   GetListId() const               { return mnListId; }
SetListId(sal_Int32 nId)491     void        SetListId(sal_Int32 nId)        { mnListId = nId; }
492 
GetListLevel() const493     sal_Int16   GetListLevel() const            { return mnListLevel; }
SetListLevel(sal_Int16 nLevel)494     void        SetListLevel(sal_Int16 nLevel)  { mnListLevel = nLevel; }
495 
GetOutlineLevel() const496     sal_Int16   GetOutlineLevel() const            { return mnOutlineLevel; }
SetOutlineLevel(sal_Int16 nLevel)497     void        SetOutlineLevel(sal_Int16 nLevel)
498     {
499         if ( nLevel <= WW_OUTLINE_MAX )
500             mnOutlineLevel = nLevel;
501     }
502 
GetNumId() const503     sal_Int32   GetNumId() const               { return mnNumId; }
SetNumId(sal_Int32 nId)504     void        SetNumId(sal_Int32 nId)        { mnNumId = nId; }
505 };
506 /*-- 27.12.2007 12:38:06---------------------------------------------------
507 
508   -----------------------------------------------------------------------*/
509 class ParagraphPropertyMap : public PropertyMap, public ParagraphProperties
510 {
511 public:
512     explicit ParagraphPropertyMap();
513     ~ParagraphPropertyMap();
514 
515 };
516 /*-- 15.02.2008 16:06:52---------------------------------------------------
517 
518   -----------------------------------------------------------------------*/
519 class TablePropertyMap : public PropertyMap
520 {
521 public:
522     enum TablePropertyMapTarget
523     {
524         TablePropertyMapTarget_START,
525         CELL_MAR_LEFT = TablePropertyMapTarget_START,
526         CELL_MAR_RIGHT,
527         CELL_MAR_TOP,
528         CELL_MAR_BOTTOM,
529         TABLE_WIDTH,
530         GAP_HALF,
531         LEFT_MARGIN,
532         HORI_ORIENT,
533         TablePropertyMapTarget_MAX
534     };
535 private:
536     struct ValidValue
537     {
538         sal_Int32   nValue;
539         bool        bValid;
ValidValuewriterfilter::dmapper::TablePropertyMap::ValidValue540         ValidValue() :
541             nValue( 0 ),
542             bValid( false ){}
543     };
544     ValidValue m_aValidValues[TablePropertyMapTarget_MAX];
545 
546 public:
547     explicit TablePropertyMap();
548     ~TablePropertyMap();
549 
550     bool    getValue( TablePropertyMapTarget eWhich, sal_Int32& nFill );
551     void    setValue( TablePropertyMapTarget eWhich, sal_Int32 nSet );
552 
553     virtual void insertTableProperties( const PropertyMap* );
554 };
555 typedef boost::shared_ptr<TablePropertyMap>  TablePropertyMapPtr;
556 } //namespace dmapper
557 } //namespace writerfilter
558 #endif
559