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