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