LibreOffice Module sw (master) 1
svxcss1.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <algorithm>
23#include <cmath>
24#include <limits>
25#include <memory>
26#include <stdlib.h>
27
28#include <svx/svxids.hrc>
30#include <svtools/ctrltool.hxx>
31#include <svl/urihelper.hxx>
32#include <editeng/udlnitem.hxx>
34#include <editeng/blinkitem.hxx>
36#include <editeng/kernitem.hxx>
37#include <editeng/lspcitem.hxx>
38#include <editeng/fontitem.hxx>
39#include <editeng/postitem.hxx>
40#include <editeng/colritem.hxx>
41#include <editeng/cmapitem.hxx>
42#include <editeng/brushitem.hxx>
43#include <editeng/wghtitem.hxx>
44#include <editeng/fhgtitem.hxx>
46#include <editeng/boxitem.hxx>
47#include <editeng/ulspitem.hxx>
48#include <editeng/lrspitem.hxx>
49#include <editeng/langitem.hxx>
50#include <svl/itempool.hxx>
51#include <editeng/spltitem.hxx>
52#include <editeng/widwitem.hxx>
54#include <editeng/orphitem.hxx>
55#include <utility>
56#include <vcl/svapp.hxx>
57#include <sal/log.hxx>
58#include <osl/diagnose.h>
59
60#include "css1kywd.hxx"
61#include "svxcss1.hxx"
62#include "htmlnum.hxx"
63
64using namespace ::com::sun::star;
65
67typedef void (*FnParseCSS1Prop)( const CSS1Expression *pExpr,
68 SfxItemSet& rItemSet,
69 SvxCSS1PropertyInfo& rPropInfo,
70 const SvxCSS1Parser& rParser );
71
73{
74 { "xx-small", 0 },
75 { "x-small", 1 },
76 { "small", 2 },
77 { "medium", 3 },
78 { "large", 4 },
79 { "x-large", 5 },
80 { "xx-large", 6 },
81 { nullptr, 0 }
82};
83
85{
86 { "extra-light", WEIGHT_NORMAL }, // WEIGHT_ULTRALIGHT (OBS)
87 { "light", WEIGHT_NORMAL }, // WEIGHT_LIGHT (OBSOLETE)
88 { "demi-light", WEIGHT_NORMAL }, // WEIGHT_SEMILIGHT (OBS)
89 { "medium", WEIGHT_NORMAL }, // WEIGHT_MEDIUM (OBS)
90 { "normal", WEIGHT_NORMAL }, // WEIGHT_MEDIUM
91 { "demi-bold", WEIGHT_NORMAL }, // WEIGHT_SEMIBOLD (OBS)
92 { "bold", WEIGHT_BOLD }, // WEIGHT_BOLD (OBSOLETE)
93 { "extra-bold", WEIGHT_BOLD }, // WEIGHT_ULTRABOLD (OBS)
94 { "bolder", WEIGHT_BOLD },
95 { "lighter", WEIGHT_NORMAL },
96 { nullptr, 0 }
97};
98
100{
101 { "normal", ITALIC_NONE },
102 { "italic", ITALIC_NORMAL },
103 { "oblique", ITALIC_NORMAL },
104 { nullptr, 0 }
105};
106
108{
109 { "normal", sal_uInt16(SvxCaseMap::NotMapped) },
110 { "small-caps", sal_uInt16(SvxCaseMap::SmallCaps) },
111 { nullptr, 0 }
112};
113
115{
116 { "uppercase", sal_uInt16(SvxCaseMap::Uppercase) },
117 { "lowercase", sal_uInt16(SvxCaseMap::Lowercase) },
118 { "capitalize", sal_uInt16(SvxCaseMap::Capitalize) },
119 { nullptr, 0 }
120};
121
123{
124 { "ltr", sal_uInt16(SvxFrameDirection::Horizontal_LR_TB) },
125 { "rtl", sal_uInt16(SvxFrameDirection::Horizontal_RL_TB) },
126 { "inherit", sal_uInt16(SvxFrameDirection::Environment) },
127 { nullptr, 0 }
128};
129
131{
132 { "repeat", GPOS_TILED },
133 { "repeat-x", GPOS_TILED },
134 { "repeat-y", GPOS_TILED },
135 { "no-repeat", GPOS_NONE },
136 { nullptr, 0 }
137};
138
140{
141 { "left", GPOS_LT },
142 { "center", GPOS_MT },
143 { "right", GPOS_RT },
144 { nullptr, 0 }
145};
146
148{
149 { "top", GPOS_LT },
150 { "middle", GPOS_LM },
151 { "bottom", GPOS_LB },
152 { nullptr, 0 }
153};
154
156{
157 { "left", sal_uInt16(SvxAdjust::Left) },
158 { "center", sal_uInt16(SvxAdjust::Center) },
159 { "right", sal_uInt16(SvxAdjust::Right) },
160 { "justify", sal_uInt16(SvxAdjust::Block) },
161 { nullptr, 0 }
162};
163
165{
166 { "thin", 0 }, // DEF_LINE_WIDTH_0 / DEF_DOUBLE_LINE0
167 { "medium", 1 }, // DEF_LINE_WIDTH_1 / DEF_DOUBLE_LINE1
168 { "thick", 2 }, // DEF_LINE_WIDTH_2 / DEF_DOUBLE_LINE2
169 { nullptr, 0 }
170};
171
172namespace {
173
174enum CSS1BorderStyle { CSS1_BS_NONE, CSS1_BS_SINGLE, CSS1_BS_DOUBLE, CSS1_BS_DOTTED, CSS1_BS_DASHED, CSS1_BS_GROOVE, CSS1_BS_RIDGE, CSS1_BS_INSET, CSS1_BS_OUTSET };
175
176}
177
179{
180 { "none", CSS1_BS_NONE },
181 { "dotted", CSS1_BS_DOTTED },
182 { "dashed", CSS1_BS_DASHED },
183 { "solid", CSS1_BS_SINGLE },
184 { "double", CSS1_BS_DOUBLE },
185 { "groove", CSS1_BS_GROOVE },
186 { "ridge", CSS1_BS_RIDGE },
187 { "inset", CSS1_BS_INSET },
188 { "outset", CSS1_BS_OUTSET },
189 { nullptr, 0 }
190};
191
193{
194 { "left", sal_uInt16(SvxAdjust::Left) },
195 { "right", sal_uInt16(SvxAdjust::Right) },
196 { "none", sal_uInt16(SvxAdjust::End) },
197 { nullptr, 0 }
198};
199
201{
202 { "absolute", SVX_CSS1_POS_ABSOLUTE },
203 { "relative", SVX_CSS1_POS_RELATIVE },
204 { "static", SVX_CSS1_POS_STATIC },
205 { nullptr, 0 }
206};
207
208// Feature: PrintExt
210{
211 { "auto", SVX_CSS1_STYPE_AUTO },
212 { "landscape", SVX_CSS1_STYPE_LANDSCAPE },
213 { "portrait", SVX_CSS1_STYPE_PORTRAIT },
214 { nullptr, 0 }
215};
216
218{
219 { "auto", SVX_CSS1_PBREAK_AUTO },
220 { "always", SVX_CSS1_PBREAK_ALWAYS },
221 { "avoid", SVX_CSS1_PBREAK_AVOID },
222 { "left", SVX_CSS1_PBREAK_LEFT },
223 { "right", SVX_CSS1_PBREAK_RIGHT },
224 { nullptr, 0 }
225};
226
228{
229 { "decimal", SVX_NUM_ARABIC },
230 { "lower-alpha", SVX_NUM_CHARS_LOWER_LETTER },
231 { "lower-latin", SVX_NUM_CHARS_LOWER_LETTER },
232 { "lower-roman", SVX_NUM_ROMAN_LOWER },
233 { "upper-alpha", SVX_NUM_CHARS_UPPER_LETTER },
234 { "upper-latin", SVX_NUM_CHARS_UPPER_LETTER },
235 { "upper-roman", SVX_NUM_ROMAN_UPPER },
236 { nullptr, 0 }
237};
238
240{
241 { "circle", HTML_BULLETCHAR_CIRCLE },
242 { "disc", HTML_BULLETCHAR_DISC },
243 { "square", HTML_BULLETCHAR_SQUARE },
244 { nullptr, 0 }
245};
246
247sal_uInt16 const aBorderWidths[] =
248{
252};
253
254#undef SBORDER_ENTRY
255#undef DBORDER_ENTRY
256
257namespace {
258
259struct SvxCSS1ItemIds
260{
261 sal_uInt16 nFont;
262 sal_uInt16 nFontCJK;
263 sal_uInt16 nFontCTL;
264 sal_uInt16 nPosture;
265 sal_uInt16 nPostureCJK;
266 sal_uInt16 nPostureCTL;
267 sal_uInt16 nWeight;
268 sal_uInt16 nWeightCJK;
269 sal_uInt16 nWeightCTL;
270 sal_uInt16 nFontHeight;
271 sal_uInt16 nFontHeightCJK;
272 sal_uInt16 nFontHeightCTL;
273 sal_uInt16 nUnderline;
274 sal_uInt16 nOverline;
275 sal_uInt16 nCrossedOut;
276 sal_uInt16 nColor;
277 sal_uInt16 nKerning;
278 sal_uInt16 nCaseMap;
279 sal_uInt16 nBlink;
280
281 sal_uInt16 nLineSpacing;
282 sal_uInt16 nAdjust;
283 sal_uInt16 nWidows;
284 sal_uInt16 nOrphans;
285 sal_uInt16 nFormatSplit;
286
289 sal_uInt16 nBox;
290 sal_uInt16 nBrush;
291
292 sal_uInt16 nLanguage;
293 sal_uInt16 nLanguageCJK;
294 sal_uInt16 nLanguageCTL;
295 sal_uInt16 nDirection;
296};
297
298}
299
300static SvxCSS1ItemIds aItemIds;
301
303{
305 sal_uInt16 nAbsWidth;
306 sal_uInt16 nNamedWidth;
307 CSS1BorderStyle eStyle;
308
310 aColor( COL_BLACK ), nAbsWidth( USHRT_MAX ),
311 nNamedWidth( USHRT_MAX ), eStyle( CSS1_BS_NONE )
312 {}
313
314 void SetBorderLine( SvxBoxItemLine nLine, SvxBoxItem &rBoxItem ) const;
315};
316
318{
319 if( CSS1_BS_NONE==eStyle || nAbsWidth==0 ||
320 (nAbsWidth==USHRT_MAX && nNamedWidth==USHRT_MAX) )
321 {
322 rBoxItem.SetLine( nullptr, nLine );
323 return;
324 }
325
326 ::editeng::SvxBorderLine aBorderLine( &aColor );
327
328 // Line style double or single?
329 switch ( eStyle )
330 {
331 case CSS1_BS_SINGLE:
332 aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::SOLID);
333 break;
334 case CSS1_BS_DOUBLE:
335 aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE);
336 break;
337 case CSS1_BS_DOTTED:
338 aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::DOTTED);
339 break;
340 case CSS1_BS_DASHED:
341 aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::DASHED);
342 break;
343 case CSS1_BS_GROOVE:
344 aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::ENGRAVED);
345 break;
346 case CSS1_BS_RIDGE:
347 aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::EMBOSSED);
348 break;
349 case CSS1_BS_INSET:
350 aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::INSET);
351 break;
352 case CSS1_BS_OUTSET:
353 aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::OUTSET);
354 break;
355 default:
356 aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::NONE);
357 break;
358 }
359
360 // convert named width, if no absolute is given
361 if( nAbsWidth==USHRT_MAX )
362 aBorderLine.SetWidth( aBorderWidths[ nNamedWidth ] );
363 else
364 aBorderLine.SetWidth( nAbsWidth );
365
366 rBoxItem.SetLine( &aBorderLine, nLine );
367}
368
370{
371 Clear();
372}
373
375 m_aId( rProp.m_aId ),
376 m_bTopMargin( rProp.m_bTopMargin ),
377 m_bBottomMargin( rProp.m_bBottomMargin ),
378 m_bLeftMargin( rProp.m_bLeftMargin ),
379 m_bRightMargin( rProp.m_bRightMargin ),
380 m_bTextIndent( rProp.m_bTextIndent ),
381 m_bNumbering ( rProp.m_bNumbering ),
382 m_bBullet ( rProp.m_bBullet ),
383 m_eFloat( rProp.m_eFloat ),
384 m_ePosition( rProp.m_ePosition ),
385 m_nTopBorderDistance( rProp.m_nTopBorderDistance ),
386 m_nBottomBorderDistance( rProp.m_nBottomBorderDistance ),
387 m_nLeftBorderDistance( rProp.m_nLeftBorderDistance ),
388 m_nRightBorderDistance( rProp.m_nRightBorderDistance ),
389 m_nNumberingType ( rProp.m_nNumberingType ),
390 m_cBulletChar( rProp.m_cBulletChar ),
391 m_nColumnCount( rProp.m_nColumnCount ),
392 m_nLeft( rProp.m_nLeft ),
393 m_nTop( rProp.m_nTop ),
394 m_nWidth( rProp.m_nWidth ),
395 m_nHeight( rProp.m_nHeight ),
396 m_nLeftMargin( rProp.m_nLeftMargin ),
397 m_nRightMargin( rProp.m_nRightMargin ),
398 m_eLeftType( rProp.m_eLeftType ),
399 m_eTopType( rProp.m_eTopType ),
400 m_eWidthType( rProp.m_eWidthType ),
401 m_eHeightType( rProp.m_eHeightType ),
402 m_eSizeType( rProp.m_eSizeType ),
403 m_ePageBreakBefore( rProp.m_ePageBreakBefore ),
404 m_ePageBreakAfter( rProp.m_ePageBreakAfter )
405{
406 for( size_t i=0; i<m_aBorderInfos.size(); ++i )
407 if (rProp.m_aBorderInfos[i])
408 m_aBorderInfos[i].reset( new SvxCSS1BorderInfo( *rProp.m_aBorderInfos[i] ) );
409}
410
412{
413}
414
416{
417 for(auto & rp : m_aBorderInfos)
418 rp.reset();
419}
420
422{
423 m_aId.clear();
426 m_bNumbering = m_bBullet = false;
428 m_eFloat = SvxAdjust::End;
429
433
435 m_cBulletChar = ' ';
436
437 m_nColumnCount = 0;
438
441
442// Feature: PrintExt
446
448}
449
451{
452 if( rProp.m_bTopMargin )
453 m_bTopMargin = true;
454 if( rProp.m_bBottomMargin )
455 m_bBottomMargin = true;
456
457 if( rProp.m_bLeftMargin )
458 {
459 m_bLeftMargin = true;
461 }
462 if( rProp.m_bRightMargin )
463 {
464 m_bRightMargin = true;
466 }
467 if( rProp.m_bTextIndent )
468 m_bTextIndent = true;
469
470 for( size_t i=0; i<m_aBorderInfos.size(); ++i )
471 {
472 if( rProp.m_aBorderInfos[i] )
473 m_aBorderInfos[i].reset( new SvxCSS1BorderInfo( *rProp.m_aBorderInfos[i] ) );
474 }
475
484
486
487 if( rProp.m_eFloat != SvxAdjust::End )
488 m_eFloat = rProp.m_eFloat;
489
490 if( rProp.m_ePosition != SVX_CSS1_POS_NONE )
491 m_ePosition = rProp.m_ePosition;
492
493// Feature: PrintExt
494 if( rProp.m_eSizeType != SVX_CSS1_STYPE_NONE )
495 {
496 m_eSizeType = rProp.m_eSizeType;
497 m_nWidth = rProp.m_nWidth;
498 m_nHeight = rProp.m_nHeight;
499 }
500
503
506
507 if( rProp.m_eLeftType != SVX_CSS1_LTYPE_NONE )
508 {
509 m_eLeftType = rProp.m_eLeftType;
510 m_nLeft = rProp.m_nLeft;
511 }
512
513 if( rProp.m_eTopType != SVX_CSS1_LTYPE_NONE )
514 {
515 m_eTopType = rProp.m_eTopType;
516 m_nTop = rProp.m_nTop;
517 }
518
519 if( rProp.m_eWidthType != SVX_CSS1_LTYPE_NONE )
520 {
522 m_nWidth = rProp.m_nWidth;
523 }
524
526 {
528 m_nHeight = rProp.m_nHeight;
529 }
530}
531
533{
534 sal_uInt16 nPos = 0;
535 switch( nLine )
536 {
537 case SvxBoxItemLine::TOP: nPos = 0; break;
538 case SvxBoxItemLine::BOTTOM: nPos = 1; break;
539 case SvxBoxItemLine::LEFT: nPos = 2; break;
540 case SvxBoxItemLine::RIGHT: nPos = 3; break;
541 }
542
543 if( !m_aBorderInfos[nPos] && bCreate )
545
546 return m_aBorderInfos[nPos].get();
547}
548
550 sal_uInt16 nWhat )
551{
552 SvxCSS1BorderInfo *pSrcInfo = GetBorderInfo( nSrcLine, false );
553 if( !pSrcInfo )
554 return;
555
556 SvxCSS1BorderInfo *pDstInfo = GetBorderInfo( nDstLine );
557 if( (nWhat & SVX_CSS1_BORDERINFO_WIDTH) != 0 )
558 {
559 pDstInfo->nAbsWidth = pSrcInfo->nAbsWidth;
560 pDstInfo->nNamedWidth = pSrcInfo->nNamedWidth;
561 }
562
563 if( (nWhat & SVX_CSS1_BORDERINFO_COLOR) != 0 )
564 pDstInfo->aColor = pSrcInfo->aColor;
565
566 if( (nWhat & SVX_CSS1_BORDERINFO_STYLE) != 0 )
567 pDstInfo->eStyle = pSrcInfo->eStyle;
568}
569
570void SvxCSS1PropertyInfo::CopyBorderInfo( sal_uInt16 nCount, sal_uInt16 nWhat )
571{
572 if( nCount==0 )
573 {
574 CopyBorderInfo( SvxBoxItemLine::BOTTOM, SvxBoxItemLine::TOP, nWhat );
575 CopyBorderInfo( SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, nWhat );
576 }
577 if( nCount<=1 )
578 {
579 CopyBorderInfo( SvxBoxItemLine::LEFT, SvxBoxItemLine::RIGHT, nWhat );
580 }
581}
582
584 sal_uInt16 nMinBorderDist,
585 const SvxBoxItem *pDfltItem )
586{
591
592 for( size_t i=0; !bChg && i<m_aBorderInfos.size(); ++i )
593 bChg = m_aBorderInfos[i]!=nullptr;
594
595 if( !bChg )
596 return;
597
598 std::shared_ptr<SvxBoxItem> aBoxItem(std::make_shared<SvxBoxItem>(aItemIds.nBox));
599 if( pDfltItem )
600 aBoxItem.reset(pDfltItem->Clone());
601
602 SvxCSS1BorderInfo *pInfo = GetBorderInfo( SvxBoxItemLine::TOP, false );
603 if( pInfo )
604 pInfo->SetBorderLine( SvxBoxItemLine::TOP, *aBoxItem );
605
606 pInfo = GetBorderInfo( SvxBoxItemLine::BOTTOM, false );
607 if( pInfo )
608 pInfo->SetBorderLine( SvxBoxItemLine::BOTTOM, *aBoxItem );
609
610 pInfo = GetBorderInfo( SvxBoxItemLine::LEFT, false );
611 if( pInfo )
612 pInfo->SetBorderLine( SvxBoxItemLine::LEFT, *aBoxItem );
613
614 pInfo = GetBorderInfo( SvxBoxItemLine::RIGHT, false );
615 if( pInfo )
616 pInfo->SetBorderLine( SvxBoxItemLine::RIGHT, *aBoxItem );
617
618 for( size_t i=0; i<m_aBorderInfos.size(); ++i )
619 {
620 SvxBoxItemLine nLine = SvxBoxItemLine::TOP;
621 sal_uInt16 nDist = 0;
622 switch( i )
623 {
624 case 0: nLine = SvxBoxItemLine::TOP;
625 nDist = m_nTopBorderDistance;
627 break;
628 case 1: nLine = SvxBoxItemLine::BOTTOM;
631 break;
632 case 2: nLine = SvxBoxItemLine::LEFT;
633 nDist = m_nLeftBorderDistance;
635 break;
636 case 3: nLine = SvxBoxItemLine::RIGHT;
639 break;
640 }
641
642 if( aBoxItem->GetLine( nLine ) )
643 {
644 if( UNSET_BORDER_DISTANCE == nDist )
645 nDist = aBoxItem->GetDistance( nLine );
646
647 if( nDist < nMinBorderDist )
648 nDist = nMinBorderDist;
649 }
650 else
651 {
652 nDist = 0U;
653 }
654
655 aBoxItem->SetDistance( nDist, nLine );
656 }
657
658 rItemSet.Put( *aBoxItem );
659
661}
662
664 const SvxCSS1PropertyInfo& rProp ) :
665 m_aItemSet(std::move( aItemSet )),
666 m_aPropInfo( rProp )
667{}
668
669void SvxCSS1Parser::StyleParsed( const CSS1Selector * /*pSelector*/,
670 SfxItemSet& /*rItemSet*/,
671 SvxCSS1PropertyInfo& /*rPropInfo*/ )
672{
673 // you see nothing is happening here
674}
675
676void SvxCSS1Parser::SelectorParsed( std::unique_ptr<CSS1Selector> pSelector, bool bFirst )
677{
678 if( bFirst )
679 {
680 OSL_ENSURE( m_pSheetItemSet, "Where is the Item-Set for Style-Sheets?" );
681
682 for (const std::unique_ptr<CSS1Selector> & rpSelection : m_Selectors)
683 {
684 StyleParsed(rpSelection.get(), *m_pSheetItemSet, *m_pSheetPropInfo);
685 }
686 m_pSheetItemSet->ClearItem();
687 m_pSheetPropInfo->Clear();
688
689 // prepare the next rule
690 m_Selectors.clear();
691 }
692
693 m_Selectors.push_back(std::move(pSelector));
694}
695
696SvxCSS1Parser::SvxCSS1Parser( SfxItemPool& rPool, OUString aBaseURL,
697 sal_uInt16 const *pWhichIds, sal_uInt16 nWhichIds ) :
698 m_sBaseURL(std::move( aBaseURL )),
699 m_pItemSet(nullptr),
700 m_pPropInfo( nullptr ),
701 m_eDefaultEnc( RTL_TEXTENCODING_DONTKNOW ),
702 m_bIgnoreFontFamily( false )
703{
704 // also initialize item IDs
705 auto initTrueWhich = [&rPool, this](sal_uInt16 rWid)
706 {
707 rWid = rPool.GetTrueWhich(rWid, false);
708 m_aWhichMap = m_aWhichMap.MergeRange(rWid, rWid);
709 return rWid;
710 };
711
712 aItemIds.nFont = initTrueWhich( SID_ATTR_CHAR_FONT );
713 aItemIds.nFontCJK = initTrueWhich( SID_ATTR_CHAR_CJK_FONT );
714 aItemIds.nFontCTL = initTrueWhich( SID_ATTR_CHAR_CTL_FONT );
715 aItemIds.nPosture = initTrueWhich( SID_ATTR_CHAR_POSTURE );
716 aItemIds.nPostureCJK = initTrueWhich( SID_ATTR_CHAR_CJK_POSTURE );
717 aItemIds.nPostureCTL = initTrueWhich( SID_ATTR_CHAR_CTL_POSTURE );
718 aItemIds.nWeight = initTrueWhich( SID_ATTR_CHAR_WEIGHT );
719 aItemIds.nWeightCJK = initTrueWhich( SID_ATTR_CHAR_CJK_WEIGHT );
720 aItemIds.nWeightCTL = initTrueWhich( SID_ATTR_CHAR_CTL_WEIGHT );
721 aItemIds.nFontHeight = initTrueWhich( SID_ATTR_CHAR_FONTHEIGHT );
722 aItemIds.nFontHeightCJK = initTrueWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT );
723 aItemIds.nFontHeightCTL = initTrueWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT );
724 aItemIds.nUnderline = initTrueWhich( SID_ATTR_CHAR_UNDERLINE );
725 aItemIds.nOverline = initTrueWhich( SID_ATTR_CHAR_OVERLINE );
726 aItemIds.nCrossedOut = initTrueWhich( SID_ATTR_CHAR_STRIKEOUT );
727 aItemIds.nColor = initTrueWhich( SID_ATTR_CHAR_COLOR );
728 aItemIds.nKerning = initTrueWhich( SID_ATTR_CHAR_KERNING );
729 aItemIds.nCaseMap = initTrueWhich( SID_ATTR_CHAR_CASEMAP );
730 aItemIds.nBlink = initTrueWhich( SID_ATTR_FLASH );
731
732 aItemIds.nLineSpacing = initTrueWhich( SID_ATTR_PARA_LINESPACE );
733 aItemIds.nAdjust = initTrueWhich( SID_ATTR_PARA_ADJUST );
734 aItemIds.nWidows = initTrueWhich( SID_ATTR_PARA_WIDOWS );
735 aItemIds.nOrphans = initTrueWhich( SID_ATTR_PARA_ORPHANS );
736 aItemIds.nFormatSplit = initTrueWhich( SID_ATTR_PARA_SPLIT );
737
738 aItemIds.nLRSpace = TypedWhichId<SvxLRSpaceItem>(initTrueWhich( SID_ATTR_LRSPACE ));
739 aItemIds.nULSpace = TypedWhichId<SvxULSpaceItem>(initTrueWhich( SID_ATTR_ULSPACE ));
740 aItemIds.nBox = initTrueWhich( SID_ATTR_BORDER_OUTER );
741 aItemIds.nBrush = initTrueWhich( SID_ATTR_BRUSH );
742
743 aItemIds.nLanguage = initTrueWhich( SID_ATTR_CHAR_LANGUAGE );
744 aItemIds.nLanguageCJK = initTrueWhich( SID_ATTR_CHAR_CJK_LANGUAGE );
745 aItemIds.nLanguageCTL = initTrueWhich( SID_ATTR_CHAR_CTL_LANGUAGE );
746 aItemIds.nDirection = initTrueWhich( SID_ATTR_FRAMEDIRECTION );
747
748 if( pWhichIds && nWhichIds )
749 for (sal_uInt16 i = 0; i < nWhichIds; ++i)
750 m_aWhichMap = m_aWhichMap.MergeRange(pWhichIds[i], pWhichIds[i]);
751
752 m_pSheetItemSet.reset( new SfxItemSet( rPool, m_aWhichMap ) );
754}
755
757{
758 m_pSheetItemSet.reset();
759 m_pSheetPropInfo.reset();
760}
761
762void SvxCSS1Parser::InsertId( const OUString& rId,
763 const SfxItemSet& rItemSet,
764 const SvxCSS1PropertyInfo& rProp )
765{
766 InsertMapEntry( rId, rItemSet, rProp, m_Ids );
767}
768
769const SvxCSS1MapEntry* SvxCSS1Parser::GetId( const OUString& rId ) const
770{
771 CSS1Map::const_iterator itr = m_Ids.find(rId);
772 return itr == m_Ids.end() ? nullptr : itr->second.get();
773}
774
775void SvxCSS1Parser::InsertClass( const OUString& rClass,
776 const SfxItemSet& rItemSet,
777 const SvxCSS1PropertyInfo& rProp )
778{
779 InsertMapEntry( rClass, rItemSet, rProp, m_Classes );
780}
781
782const SvxCSS1MapEntry* SvxCSS1Parser::GetClass( const OUString& rClass ) const
783{
784 CSS1Map::const_iterator itr = m_Classes.find(rClass);
785 return itr == m_Classes.end() ? nullptr : itr->second.get();
786}
787
788void SvxCSS1Parser::InsertPage( const OUString& rPage,
789 bool bPseudo,
790 const SfxItemSet& rItemSet,
791 const SvxCSS1PropertyInfo& rProp )
792{
793 OUString aKey( rPage );
794 if( bPseudo )
795 aKey = ":" + aKey;
796 InsertMapEntry( aKey, rItemSet, rProp, m_Pages );
797}
798
799SvxCSS1MapEntry* SvxCSS1Parser::GetPage( const OUString& rPage, bool bPseudo )
800{
801 OUString aKey( rPage );
802 if( bPseudo )
803 aKey = ":" + aKey;
804
805 CSS1Map::iterator itr = m_Pages.find(aKey);
806 return itr == m_Pages.end() ? nullptr : itr->second.get();
807}
808
809void SvxCSS1Parser::InsertTag( const OUString& rTag,
810 const SfxItemSet& rItemSet,
811 const SvxCSS1PropertyInfo& rProp )
812{
813 InsertMapEntry( rTag, rItemSet, rProp, m_Tags );
814}
815
817{
818 CSS1Map::iterator itr = m_Tags.find(rTag);
819 return itr == m_Tags.end() ? nullptr : itr->second.get();
820}
821
822bool SvxCSS1Parser::ParseStyleSheet( const OUString& rIn )
823{
826
828
829 for (const std::unique_ptr<CSS1Selector> & rpSelector : m_Selectors)
830 {
831 StyleParsed(rpSelector.get(), *m_pSheetItemSet, *m_pSheetPropInfo);
832 }
833
834 // and clean up a little bit
835 m_Selectors.clear();
836 m_pSheetItemSet->ClearItem();
837 m_pSheetPropInfo->Clear();
838
839 m_pItemSet = nullptr;
840 m_pPropInfo = nullptr;
841
842 return true;
843}
844
845void SvxCSS1Parser::ParseStyleOption( const OUString& rIn,
846 SfxItemSet& rItemSet,
847 SvxCSS1PropertyInfo& rPropInfo )
848{
849 m_pItemSet = &rItemSet;
850 m_pPropInfo = &rPropInfo;
851
853 rItemSet.ClearItem( aItemIds.nDirection );
854
855 m_pItemSet = nullptr;
856 m_pPropInfo = nullptr;
857}
858
860 const OUString &rValue, sal_uInt16& rEnum )
861{
862 while( pPropTable->pName )
863 {
864 if( !rValue.equalsIgnoreAsciiCaseAscii( pPropTable->pName ) )
865 pPropTable++;
866 else
867 break;
868 }
869
870 if( pPropTable->pName )
871 rEnum = pPropTable->nEnum;
872
873 return (pPropTable->pName != nullptr);
874}
875
877{
879 {
880 Size aTwipSz( rWidth, rHeight );
881 aTwipSz = Application::GetDefaultDevice()->PixelToLogic( aTwipSz,
882 MapMode(MapUnit::MapTwip) );
883
884 rWidth = aTwipSz.Width();
885 rHeight = aTwipSz.Height();
886 }
887}
888
889sal_uInt32 SvxCSS1Parser::GetFontHeight( sal_uInt16 nSize ) const
890{
891 sal_uInt16 nHeight;
892
893 switch( nSize )
894 {
895 case 0: nHeight = 8*20; break;
896 case 1: nHeight = 10*20; break;
897 case 2: nHeight = 11*20; break;
898 case 3: nHeight = 12*20; break;
899 case 4: nHeight = 17*20; break;
900 case 5: nHeight = 20*20; break;
901 case 6:
902 default: nHeight = 32*20; break;
903 }
904
905 return nHeight;
906}
907
909{
910 return nullptr;
911}
912
913void SvxCSS1Parser::InsertMapEntry( const OUString& rKey,
914 const SfxItemSet& rItemSet,
915 const SvxCSS1PropertyInfo& rProp,
916 CSS1Map& rMap )
917{
918 CSS1Map::iterator itr = rMap.find(rKey);
919 if (itr == rMap.end())
920 {
921 rMap.insert(std::make_pair(rKey, std::make_unique<SvxCSS1MapEntry>(rItemSet, rProp)));
922 }
923 else
924 {
925 SvxCSS1MapEntry *const p = itr->second.get();
926 MergeStyles( rItemSet, rProp,
927 p->GetItemSet(), p->GetPropertyInfo(), true );
928 }
929}
930
932 const SvxCSS1PropertyInfo& rSrcInfo,
933 SfxItemSet& rTargetSet,
934 SvxCSS1PropertyInfo& rTargetInfo,
935 bool bSmart )
936{
937 if( !bSmart )
938 {
939 rTargetSet.Put( rSrcSet );
940 }
941 else
942 {
943 SvxLRSpaceItem aLRSpace( rTargetSet.Get(aItemIds.nLRSpace) );
944 SvxULSpaceItem aULSpace( rTargetSet.Get(aItemIds.nULSpace) );
945
946 rTargetSet.Put( rSrcSet );
947
948 if( rSrcInfo.m_bLeftMargin || rSrcInfo.m_bRightMargin ||
949 rSrcInfo.m_bTextIndent )
950 {
951 const SvxLRSpaceItem& rNewLRSpace = rSrcSet.Get( aItemIds.nLRSpace );
952
953 if( rSrcInfo.m_bLeftMargin )
954 aLRSpace.SetLeft( rNewLRSpace.GetLeft() );
955 if( rSrcInfo.m_bRightMargin )
956 aLRSpace.SetRight( rNewLRSpace.GetRight() );
957 if( rSrcInfo.m_bTextIndent )
958 aLRSpace.SetTextFirstLineOffset( rNewLRSpace.GetTextFirstLineOffset() );
959
960 rTargetSet.Put( aLRSpace );
961 }
962
963 if( rSrcInfo.m_bTopMargin || rSrcInfo.m_bBottomMargin )
964 {
965 const SvxULSpaceItem& rNewULSpace = rSrcSet.Get( aItemIds.nULSpace );
966
967 if( rSrcInfo.m_bTopMargin )
968 aULSpace.SetUpper( rNewULSpace.GetUpper() );
969 if( rSrcInfo.m_bBottomMargin )
970 aULSpace.SetLower( rNewULSpace.GetLower() );
971
972 rTargetSet.Put( aULSpace );
973 }
974 }
975
976 rTargetInfo.Merge( rSrcInfo );
977}
978
979void SvxCSS1Parser::SetDfltEncoding( rtl_TextEncoding eEnc )
980{
981 m_eDefaultEnc = eEnc;
982}
983
984static void ParseCSS1_font_size( const CSS1Expression *pExpr,
985 SfxItemSet &rItemSet,
986 SvxCSS1PropertyInfo& /*rPropInfo*/,
987 const SvxCSS1Parser& rParser )
988{
989 OSL_ENSURE( pExpr, "no expression" );
990
991 sal_uLong nHeight = 0;
992 sal_uInt16 nPropHeight = 100;
993
994 switch( pExpr->GetType() )
995 {
996 case CSS1_LENGTH:
997 nHeight = pExpr->GetULength();
998 break;
999 case CSS1_PIXLENGTH:
1000 {
1001 double fHeight = pExpr->GetNumber();
1002 if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
1003 {
1004 tools::Long nPHeight = static_cast<tools::Long>(fHeight);
1005 tools::Long nPWidth = 0;
1006 SvxCSS1Parser::PixelToTwip(nPWidth, nPHeight);
1007 nHeight = static_cast<sal_uLong>(nPHeight);
1008 }
1009 else
1010 {
1011 SAL_WARN("sw.html", "out-of-size pxlength: " << fHeight);
1012 }
1013 }
1014 break;
1015 case CSS1_PERCENTAGE:
1016 // only for drop caps!
1017 nPropHeight = o3tl::narrowing<sal_uInt16>(pExpr->GetNumber());
1018 break;
1019 case CSS1_IDENT:
1020 {
1021 sal_uInt16 nSize;
1022
1024 nSize ) )
1025 {
1026 nHeight = rParser.GetFontHeight( nSize );
1027 }
1028 }
1029 break;
1030
1031 default:
1032 ;
1033 }
1034
1035 if( nHeight || nPropHeight!=100 )
1036 {
1037 SvxFontHeightItem aFontHeight( nHeight, nPropHeight,
1038 aItemIds.nFontHeight );
1039 rItemSet.Put( aFontHeight );
1040 aFontHeight.SetWhich( aItemIds.nFontHeightCJK );
1041 rItemSet.Put( aFontHeight );
1042 aFontHeight.SetWhich( aItemIds.nFontHeightCTL );
1043 rItemSet.Put( aFontHeight );
1044 }
1045}
1046
1047static void ParseCSS1_font_family( const CSS1Expression *pExpr,
1048 SfxItemSet &rItemSet,
1049 SvxCSS1PropertyInfo& /*rPropInfo*/,
1050 const SvxCSS1Parser& rParser )
1051{
1052 OSL_ENSURE( pExpr, "no expression" );
1053
1054 OUStringBuffer aName;
1055 rtl_TextEncoding eEnc = rParser.GetDfltEncoding();
1056 const FontList *pFList = rParser.GetFontList();
1057 bool bFirst = true;
1058 bool bFound = false;
1059 while( pExpr && (bFirst || ','==pExpr->GetOp() || !pExpr->GetOp()) )
1060 {
1061 CSS1Token eType = pExpr->GetType();
1063 {
1064 OUString aIdent( pExpr->GetString() );
1065
1066 if( CSS1_IDENT==eType )
1067 {
1068 // Collect all following IDs and append them with a space
1069 const CSS1Expression *pNext = pExpr->GetNext();
1070 while( pNext && !pNext->GetOp() &&
1071 CSS1_IDENT==pNext->GetType() )
1072 {
1073 aIdent += " " + pNext->GetString();
1074 pExpr = pNext;
1075 pNext = pExpr->GetNext();
1076 }
1077 }
1078 if( !aIdent.isEmpty() )
1079 {
1080 if( !bFound && pFList )
1081 {
1082 sal_Handle hFont = pFList->GetFirstFontMetric( aIdent );
1083 if( nullptr != hFont )
1084 {
1085 const FontMetric& rFMetric = FontList::GetFontMetric( hFont );
1086 if( RTL_TEXTENCODING_DONTKNOW != rFMetric.GetCharSet() )
1087 {
1088 bFound = true;
1089 if( RTL_TEXTENCODING_SYMBOL == rFMetric.GetCharSet() )
1090 eEnc = RTL_TEXTENCODING_SYMBOL;
1091 }
1092 }
1093 }
1094 if( !bFirst )
1095 aName.append(";");
1096 aName.append(aIdent);
1097 }
1098 }
1099
1100 pExpr = pExpr->GetNext();
1101 bFirst = false;
1102 }
1103
1104 if( !aName.isEmpty() && !rParser.IsIgnoreFontFamily() )
1105 {
1106 SvxFontItem aFont( FAMILY_DONTKNOW, aName.makeStringAndClear(), OUString(), PITCH_DONTKNOW,
1107 eEnc, aItemIds.nFont );
1108 rItemSet.Put( aFont );
1109 aFont.SetWhich( aItemIds.nFontCJK );
1110 rItemSet.Put( aFont );
1111 aFont.SetWhich( aItemIds.nFontCTL );
1112 rItemSet.Put( aFont );
1113 }
1114}
1115
1116static void ParseCSS1_font_weight( const CSS1Expression *pExpr,
1117 SfxItemSet &rItemSet,
1118 SvxCSS1PropertyInfo& /*rPropInfo*/,
1119 const SvxCSS1Parser& /*rParser*/ )
1120{
1121 OSL_ENSURE( pExpr, "no expression" );
1122
1123 switch( pExpr->GetType() )
1124 {
1125 case CSS1_IDENT:
1126 case CSS1_STRING: // MS-IE, what else
1127 {
1128 sal_uInt16 nWeight;
1130 nWeight ) )
1131 {
1132 SvxWeightItem aWeight( static_cast<FontWeight>(nWeight), aItemIds.nWeight );
1133 rItemSet.Put( aWeight );
1134 aWeight.SetWhich( aItemIds.nWeightCJK );
1135 rItemSet.Put( aWeight );
1136 aWeight.SetWhich( aItemIds.nWeightCTL );
1137 rItemSet.Put( aWeight );
1138 }
1139 }
1140 break;
1141 case CSS1_NUMBER:
1142 {
1143 sal_uInt16 nWeight = o3tl::narrowing<sal_uInt16>(pExpr->GetNumber());
1144 SvxWeightItem aWeight( nWeight>400 ? WEIGHT_BOLD : WEIGHT_NORMAL,
1145 aItemIds.nWeight );
1146 rItemSet.Put( aWeight );
1147 aWeight.SetWhich( aItemIds.nWeightCJK );
1148 rItemSet.Put( aWeight );
1149 aWeight.SetWhich( aItemIds.nWeightCTL );
1150 rItemSet.Put( aWeight );
1151 }
1152 break;
1153
1154 default:
1155 ;
1156 }
1157}
1158
1159static void ParseCSS1_font_style( const CSS1Expression *pExpr,
1160 SfxItemSet &rItemSet,
1161 SvxCSS1PropertyInfo& /*rPropInfo*/,
1162 const SvxCSS1Parser& /*rParser*/ )
1163{
1164 OSL_ENSURE( pExpr, "no expression" );
1165
1166 bool bPosture = false;
1167 bool bCaseMap = false;
1168 FontItalic eItalic = ITALIC_NONE;
1169 SvxCaseMap eCaseMap = SvxCaseMap::NotMapped;
1170
1171 // normal | italic || small-caps | oblique || small-caps | small-caps
1172 // (only normal, italic and oblique are valid)
1173
1174 // the value can have two values!
1175 for( int i=0; pExpr && i<2; ++i )
1176 {
1177 // also here MS-IE parser leaves traces
1178 if( (CSS1_IDENT==pExpr->GetType() || CSS1_STRING==pExpr->GetType()) &&
1179 !pExpr->GetOp() )
1180 {
1181 const OUString& rValue = pExpr->GetString();
1182 // first check if the value is italic or 'normal'
1183 sal_uInt16 nItalic;
1184 if( SvxCSS1Parser::GetEnum( aFontStyleTable, rValue, nItalic ) )
1185 {
1186 eItalic = static_cast<FontItalic>(nItalic);
1187 if( !bCaseMap && ITALIC_NONE==eItalic )
1188 {
1189 // for 'normal' we must also exclude case-map
1190 eCaseMap = SvxCaseMap::NotMapped;
1191 bCaseMap = true;
1192 }
1193 bPosture = true;
1194 }
1195 else if( !bCaseMap &&
1196 rValue.equalsIgnoreAsciiCase( "small-caps" ) )
1197 {
1198 eCaseMap = SvxCaseMap::SmallCaps;
1199 bCaseMap = true;
1200 }
1201 }
1202
1203 // fetch next expression
1204 pExpr = pExpr->GetNext();
1205 }
1206
1207 if( bPosture )
1208 {
1209 SvxPostureItem aPosture( eItalic, aItemIds.nPosture );
1210 rItemSet.Put( aPosture );
1211 aPosture.SetWhich( aItemIds.nPostureCJK );
1212 rItemSet.Put( aPosture );
1213 aPosture.SetWhich( aItemIds.nPostureCTL );
1214 rItemSet.Put( aPosture );
1215 }
1216
1217 if( bCaseMap )
1218 rItemSet.Put( SvxCaseMapItem( eCaseMap, aItemIds.nCaseMap ) );
1219}
1220
1221static void ParseCSS1_font_variant( const CSS1Expression *pExpr,
1222 SfxItemSet &rItemSet,
1223 SvxCSS1PropertyInfo& /*rPropInfo*/,
1224 const SvxCSS1Parser& /*rParser*/ )
1225{
1226 assert(pExpr && "no expression");
1227
1228 // normal | small-caps
1229 switch( pExpr->GetType() )
1230 {
1231 case CSS1_IDENT:
1232 {
1233 sal_uInt16 nCaseMap;
1235 nCaseMap ) )
1236 {
1237 rItemSet.Put( SvxCaseMapItem( static_cast<SvxCaseMap>(nCaseMap),
1238 aItemIds.nCaseMap ) );
1239 }
1240 break;
1241 }
1242 default:
1243 break;
1244 }
1245}
1246
1248 SfxItemSet &rItemSet,
1249 SvxCSS1PropertyInfo& /*rPropInfo*/,
1250 const SvxCSS1Parser& /*rParser*/ )
1251{
1252 OSL_ENSURE( pExpr, "no expression" );
1253
1254 // none | capitalize | uppercase | lowercase
1255
1256 switch( pExpr->GetType() )
1257 {
1258 case CSS1_IDENT:
1259 {
1260 sal_uInt16 nCaseMap;
1262 nCaseMap ) )
1263 {
1264 rItemSet.Put( SvxCaseMapItem( static_cast<SvxCaseMap>(nCaseMap),
1265 aItemIds.nCaseMap ) );
1266 }
1267 break;
1268 }
1269 default:
1270 break;
1271 }
1272}
1273
1274static void ParseCSS1_color( const CSS1Expression *pExpr,
1275 SfxItemSet &rItemSet,
1276 SvxCSS1PropertyInfo& /*rPropInfo*/,
1277 const SvxCSS1Parser& /*rParser*/ )
1278{
1279 OSL_ENSURE( pExpr, "no expression" );
1280
1281 switch( pExpr->GetType() )
1282 {
1283 case CSS1_IDENT:
1284 case CSS1_RGB:
1285 case CSS1_HEXCOLOR:
1286 case CSS1_STRING: // because MS-IE
1287 {
1288 Color aColor;
1289 if( pExpr->GetColor( aColor ) )
1290 rItemSet.Put( SvxColorItem( aColor, aItemIds.nColor ) );
1291 }
1292 break;
1293 default:
1294 ;
1295 }
1296}
1297
1298static void ParseCSS1_column_count( const CSS1Expression *pExpr,
1299 SfxItemSet& /*rItemSet*/,
1300 SvxCSS1PropertyInfo &rPropInfo,
1301 const SvxCSS1Parser& /*rParser*/ )
1302{
1303 assert(pExpr && "no expression");
1304
1305 if ( pExpr->GetType() == CSS1_NUMBER )
1306 {
1307 double columnCount = pExpr->GetNumber();
1308 if ( columnCount >= 2 )
1309 {
1310 rPropInfo.m_nColumnCount = columnCount;
1311 }
1312 }
1313}
1314
1315static void ParseCSS1_direction( const CSS1Expression *pExpr,
1316 SfxItemSet &rItemSet,
1317 SvxCSS1PropertyInfo& /*rPropInfo*/,
1318 const SvxCSS1Parser& /*rParser*/ )
1319{
1320 assert(pExpr && "no expression");
1321
1322 sal_uInt16 nDir;
1323 switch( pExpr->GetType() )
1324 {
1325 case CSS1_IDENT:
1326 case CSS1_STRING:
1328 nDir ) )
1329 {
1330 rItemSet.Put( SvxFrameDirectionItem(
1331 static_cast < SvxFrameDirection >( nDir ),
1332 aItemIds.nDirection ) );
1333 }
1334 break;
1335 default:
1336 ;
1337 }
1338}
1339
1341{
1342 OSL_ENSURE( GPOS_LT==eHori || GPOS_MT==eHori || GPOS_RT==eHori,
1343 "vertical position not at the top" );
1344
1345 switch( ePos )
1346 {
1347 case GPOS_LT:
1348 case GPOS_MT:
1349 case GPOS_RT:
1350 ePos = eHori;
1351 break;
1352
1353 case GPOS_LM:
1354 case GPOS_MM:
1355 case GPOS_RM:
1356 ePos = GPOS_LT==eHori ? GPOS_LM : (GPOS_MT==eHori ? GPOS_MM : GPOS_RM);
1357 break;
1358
1359 case GPOS_LB:
1360 case GPOS_MB:
1361 case GPOS_RB:
1362 ePos = GPOS_LT==eHori ? GPOS_LB : (GPOS_MT==eHori ? GPOS_MB : GPOS_RB);
1363 break;
1364
1365 default:
1366 ;
1367 }
1368}
1369
1371{
1372 OSL_ENSURE( GPOS_LT==eVert || GPOS_LM==eVert || GPOS_LB==eVert,
1373 "horizontal position not on the left side" );
1374
1375 switch( ePos )
1376 {
1377 case GPOS_LT:
1378 case GPOS_LM:
1379 case GPOS_LB:
1380 ePos = eVert;
1381 break;
1382
1383 case GPOS_MT:
1384 case GPOS_MM:
1385 case GPOS_MB:
1386 ePos = GPOS_LT==eVert ? GPOS_MT : (GPOS_LM==eVert ? GPOS_MM : GPOS_MB);
1387 break;
1388
1389 case GPOS_RT:
1390 case GPOS_RM:
1391 case GPOS_RB:
1392 ePos = GPOS_LT==eVert ? GPOS_RT : (GPOS_LM==eVert ? GPOS_RM : GPOS_RB);
1393 break;
1394
1395 default:
1396 ;
1397 }
1398}
1399
1400static void ParseCSS1_background( const CSS1Expression *pExpr,
1401 SfxItemSet &rItemSet,
1402 SvxCSS1PropertyInfo& /*rPropInfo*/,
1403 const SvxCSS1Parser& rParser )
1404{
1405 OSL_ENSURE( pExpr, "no expression" );
1406
1407 Color aColor;
1408 OUString aURL;
1409
1410 bool bColor = false, bTransparent = false;
1413 bool bHori = false, bVert = false;
1414
1415 while( pExpr && !pExpr->GetOp() )
1416 {
1417 switch( pExpr->GetType() )
1418 {
1419 case CSS1_URL:
1420 pExpr->GetURL( aURL );
1421 break;
1422
1423 case CSS1_RGB:
1424 bColor = pExpr->GetColor( aColor );
1425 break;
1426
1427 case CSS1_LENGTH:
1428 case CSS1_PIXLENGTH:
1429 {
1430 // since we don't know any absolute position, we
1431 // only distinguish between 0 and !0. Therefore pixel
1432 // can be handled like all other units.
1433
1434 bool nonZero = std::trunc(pExpr->GetNumber()) != 0.0;
1435 if( !bHori )
1436 {
1437 ePos = nonZero ? GPOS_MM : GPOS_LT;
1438 bHori = true;
1439 }
1440 else if( !bVert )
1441 {
1442 MergeVert( ePos, (nonZero ? GPOS_LM : GPOS_LT) );
1443 bVert = true;
1444 }
1445 }
1446 break;
1447
1448 case CSS1_PERCENTAGE:
1449 {
1450 // the percentage is converted to an enum
1451
1452 sal_uInt16 nPerc = o3tl::narrowing<sal_uInt16>(pExpr->GetNumber());
1453 if( !bHori )
1454 {
1455 ePos = nPerc < 25 ? GPOS_LT
1456 : (nPerc < 75 ? GPOS_MM
1457 : GPOS_RB);
1458 }
1459 else if( !bVert )
1460 {
1461 SvxGraphicPosition eVert =
1462 nPerc < 25 ? GPOS_LT: (nPerc < 75 ? GPOS_LM
1463 : GPOS_LB);
1464 MergeVert( ePos, eVert );
1465 }
1466 }
1467 break;
1468
1469 case CSS1_IDENT:
1470 case CSS1_HEXCOLOR:
1471 case CSS1_STRING: // because of MS-IE
1472 {
1473 sal_uInt16 nEnum;
1474 const OUString &rValue = pExpr->GetString();
1475 if( rValue.equalsIgnoreAsciiCase( "transparent" ) )
1476 {
1477 bTransparent = true;
1478 }
1479 if( SvxCSS1Parser::GetEnum( aBGRepeatTable, rValue, nEnum ) )
1480 {
1481 eRepeat = static_cast<SvxGraphicPosition>(nEnum);
1482 }
1483 else if( SvxCSS1Parser::GetEnum( aBGHoriPosTable, rValue, nEnum ) )
1484 {
1485 // <position>, horizontal
1486 MergeHori( ePos, static_cast<SvxGraphicPosition>(nEnum) );
1487 }
1488 else if( SvxCSS1Parser::GetEnum( aBGVertPosTable, rValue, nEnum ) )
1489 {
1490 // <position>, vertical
1491 MergeVert( ePos, static_cast<SvxGraphicPosition>(nEnum) );
1492 }
1493 else if( !bColor )
1494 {
1495 // <color>
1496 bColor = pExpr->GetColor( aColor );
1497 }
1498 // <scroll> we don't know
1499 }
1500 break;
1501
1502 default:
1503 ;
1504 }
1505
1506 pExpr = pExpr->GetNext();
1507 }
1508
1509 // transparent beats everything
1510 if( bTransparent )
1511 {
1512 bColor = false;
1513 aURL.clear();
1514 }
1515
1516 // repeat has priority over a position
1517 if( GPOS_NONE == eRepeat )
1518 eRepeat = ePos;
1519
1520 if( !bTransparent && !bColor && aURL.isEmpty() )
1521 return;
1522
1523 SvxBrushItem aBrushItem( aItemIds.nBrush );
1524
1525 if( bTransparent )
1526 aBrushItem.SetColor( COL_TRANSPARENT);
1527 else if( bColor )
1528 aBrushItem.SetColor( aColor );
1529
1530 if( !aURL.isEmpty() )
1531 {
1533 aBrushItem.SetGraphicPos( eRepeat );
1534 }
1535
1536 rItemSet.Put( aBrushItem );
1537}
1538
1540 SfxItemSet &rItemSet,
1541 SvxCSS1PropertyInfo& /*rPropInfo*/,
1542 const SvxCSS1Parser& /*rParser*/ )
1543{
1544 OSL_ENSURE( pExpr, "no expression" );
1545
1546 Color aColor;
1547
1548 bool bColor = false, bTransparent = false;
1549
1550 switch( pExpr->GetType() )
1551 {
1552 case CSS1_RGB:
1553 bColor = pExpr->GetColor( aColor );
1554 break;
1555 case CSS1_IDENT:
1556 case CSS1_HEXCOLOR:
1557 case CSS1_STRING: // because of MS-IE
1558 if( pExpr->GetString().equalsIgnoreAsciiCase( "transparent" ) )
1559 {
1560 bTransparent = true;
1561 }
1562 else
1563 {
1564 // <color>
1565 bColor = pExpr->GetColor( aColor );
1566 }
1567 break;
1568 default:
1569 ;
1570 }
1571
1572 if( bTransparent || bColor )
1573 {
1574 SvxBrushItem aBrushItem( aItemIds.nBrush );
1575
1576 if( bTransparent )
1577 aBrushItem.SetColor( COL_TRANSPARENT );
1578 else if( bColor )
1579 aBrushItem.SetColor( aColor);
1580
1581 rItemSet.Put( aBrushItem );
1582 }
1583}
1584
1585static void ParseCSS1_line_height( const CSS1Expression *pExpr,
1586 SfxItemSet &rItemSet,
1587 SvxCSS1PropertyInfo& /*rPropInfo*/,
1588 const SvxCSS1Parser& )
1589{
1590 OSL_ENSURE( pExpr, "no expression" );
1591
1592 sal_uInt16 nHeight = 0;
1593 sal_uInt16 nPropHeight = 0;
1594
1595 switch( pExpr->GetType() )
1596 {
1597 case CSS1_LENGTH:
1598 nHeight = o3tl::narrowing<sal_uInt16>(pExpr->GetULength());
1599 break;
1600 case CSS1_PIXLENGTH:
1601 {
1602 double fHeight = pExpr->GetNumber();
1603 if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
1604 {
1605 tools::Long nPHeight = static_cast<tools::Long>(fHeight);
1606 tools::Long nPWidth = 0;
1607 SvxCSS1Parser::PixelToTwip(nPWidth, nPHeight);
1608 nHeight = o3tl::narrowing<sal_uInt16>(nPHeight);
1609 }
1610 }
1611 break;
1612 case CSS1_PERCENTAGE:
1613 {
1614 nPropHeight = o3tl::narrowing<sal_uInt16>(pExpr->GetNumber());
1615 }
1616 break;
1617 case CSS1_NUMBER:
1618 {
1619 nPropHeight = o3tl::narrowing<sal_uInt16>(pExpr->GetNumber() * 100);
1620 }
1621 break;
1622 default:
1623 ;
1624 }
1625
1626 if( nHeight )
1627 {
1628 if( nHeight < SvxCSS1Parser::GetMinFixLineSpace() )
1630 SvxLineSpacingItem aLSItem( nHeight, aItemIds.nLineSpacing );
1631 aLSItem.SetLineHeight( nHeight );
1632 // interpret <line-height> attribute as minimum line height
1633 aLSItem.SetLineSpaceRule( SvxLineSpaceRule::Min );
1634 aLSItem.SetInterLineSpaceRule( SvxInterLineSpaceRule::Off );
1635 rItemSet.Put( aLSItem );
1636 }
1637 else if( nPropHeight )
1638 {
1639 SvxLineSpacingItem aLSItem( nPropHeight, aItemIds.nLineSpacing );
1640 aLSItem.SetLineSpaceRule( SvxLineSpaceRule::Auto );
1641 if( 100 == nPropHeight )
1642 aLSItem.SetInterLineSpaceRule( SvxInterLineSpaceRule::Off );
1643 else
1644 aLSItem.SetPropLineSpace( nPropHeight );
1645 rItemSet.Put( aLSItem );
1646 }
1647
1648}
1649
1651 SfxItemSet & /*rItemSet*/,
1652 SvxCSS1PropertyInfo& rPropInfo,
1653 const SvxCSS1Parser& /*rParser*/ )
1654{
1655 OSL_ENSURE( pExpr, "no expression" );
1656
1657 if( pExpr->GetType() != CSS1_IDENT )
1658 return;
1659
1660 const OUString& rValue = pExpr->GetString();
1661
1662 // values are context-dependent, so fill both
1663 sal_uInt16 nEnum;
1664 if( SvxCSS1Parser::GetEnum( aNumberStyleTable, rValue, nEnum ) )
1665 {
1666 rPropInfo.m_bNumbering = true;
1667 rPropInfo.m_nNumberingType = static_cast<SvxNumType>(nEnum);
1668 }
1669 if( SvxCSS1Parser::GetEnum( aBulletStyleTable, rValue, nEnum ) )
1670 {
1671 rPropInfo.m_bBullet = true;
1672 rPropInfo.m_cBulletChar = nEnum;
1673 }
1674}
1675
1676static void ParseCSS1_font( const CSS1Expression *pExpr,
1677 SfxItemSet &rItemSet,
1678 SvxCSS1PropertyInfo& rPropInfo,
1679 const SvxCSS1Parser& rParser )
1680{
1681 OSL_ENSURE( pExpr, "no expression" );
1682
1683 FontItalic eItalic = ITALIC_NONE;
1684 SvxCaseMap eCaseMap = SvxCaseMap::NotMapped;
1685 FontWeight eWeight = WEIGHT_NORMAL;
1686
1687 // [ <font-style> || <font-variant> || <font-weight> ] ?
1688 while( pExpr && !pExpr->GetOp() &&
1689 (CSS1_IDENT==pExpr->GetType() ||
1690 CSS1_STRING==pExpr->GetType() ||
1691 CSS1_NUMBER==pExpr->GetType()) )
1692 {
1693 if( CSS1_IDENT==pExpr->GetType() ||
1694 CSS1_STRING==pExpr->GetType() )
1695 {
1696 const OUString& rValue = pExpr->GetString();
1697
1698 sal_uInt16 nEnum;
1699
1700 if( SvxCSS1Parser::GetEnum( aFontStyleTable, rValue, nEnum ) )
1701 {
1702 eItalic = static_cast<FontItalic>(nEnum);
1703 }
1704 else if( SvxCSS1Parser::GetEnum( aFontVariantTable, rValue, nEnum ) )
1705 {
1706 eCaseMap = static_cast<SvxCaseMap>(nEnum);
1707 }
1708 else if( SvxCSS1Parser::GetEnum( aFontWeightTable, rValue, nEnum ) )
1709 {
1710 eWeight = static_cast<FontWeight>(nEnum);
1711 }
1712 }
1713 else
1714 {
1715 eWeight = o3tl::narrowing<sal_uInt16>(pExpr->GetNumber()) > 400 ? WEIGHT_BOLD
1716 : WEIGHT_NORMAL;
1717 }
1718
1719 pExpr = pExpr->GetNext();
1720 }
1721
1722 if( !pExpr || pExpr->GetOp() )
1723 return;
1724
1725 // Since "font" resets all values for which nothing is specified,
1726 // we do it here.
1727 SvxPostureItem aPosture( eItalic, aItemIds.nPosture );
1728 rItemSet.Put( aPosture );
1729 aPosture.SetWhich( aItemIds.nPostureCJK );
1730 rItemSet.Put( aPosture );
1731 aPosture.SetWhich( aItemIds.nPostureCTL );
1732 rItemSet.Put( aPosture );
1733
1734 rItemSet.Put( SvxCaseMapItem( eCaseMap, aItemIds.nCaseMap ) );
1735
1736 SvxWeightItem aWeight( eWeight, aItemIds.nWeight );
1737 rItemSet.Put( aWeight );
1738 aWeight.SetWhich( aItemIds.nWeightCJK );
1739 rItemSet.Put( aWeight );
1740 aWeight.SetWhich( aItemIds.nWeightCTL );
1741 rItemSet.Put( aWeight );
1742
1743 // font-size
1744 CSS1Expression aExpr( pExpr->GetType(), pExpr->GetString(),
1745 pExpr->GetNumber() );
1746 ParseCSS1_font_size( &aExpr, rItemSet, rPropInfo, rParser );
1747 pExpr = pExpr->GetNext();
1748
1749 if( !pExpr )
1750 return;
1751
1752 // [ '/' line-height ]?
1753 if( '/' == pExpr->GetOp() )
1754 {
1755 // '/' line-height
1756 aExpr.Set( pExpr->GetType(), pExpr->GetString(), pExpr->GetNumber() );
1757 ParseCSS1_line_height( &aExpr, rItemSet, rPropInfo, rParser );
1758
1759 pExpr = pExpr->GetNext();
1760 }
1761
1762 if( !pExpr || pExpr->GetOp() )
1763 return;
1764
1765 // font-family
1766 ParseCSS1_font_family( pExpr, rItemSet, rPropInfo, rParser );
1767}
1768
1770 SfxItemSet &rItemSet,
1771 SvxCSS1PropertyInfo& /*rPropInfo*/,
1772 const SvxCSS1Parser& /*rParser*/ )
1773{
1774 OSL_ENSURE( pExpr, "no expression" );
1775
1776 switch( pExpr->GetType() )
1777 {
1778 case CSS1_LENGTH:
1779 rItemSet.Put( SvxKerningItem( static_cast<short>(pExpr->GetSLength()),
1780 aItemIds.nKerning ) );
1781 break;
1782
1783 case CSS1_PIXLENGTH:
1784 {
1785 double fHeight = pExpr->GetNumber();
1786 if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
1787 {
1788 tools::Long nPWidth = static_cast<tools::Long>(fHeight);
1789 tools::Long nPHeight = 0;
1790 SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
1791 rItemSet.Put( SvxKerningItem( static_cast<short>(nPWidth), aItemIds.nKerning ) );
1792 }
1793 }
1794 break;
1795
1796 case CSS1_NUMBER:
1797 if( pExpr->GetNumber() == 0 )
1798 {
1799 // normally unnecessary, but we are tolerant
1800 rItemSet.Put( SvxKerningItem( short(0), aItemIds.nKerning ) );
1801 }
1802 break;
1803
1804 case CSS1_IDENT:
1805 case CSS1_STRING: // As a precaution also MS-IE
1806 if( pExpr->GetString().equalsIgnoreAsciiCase( "normal" ) )
1807 {
1808 rItemSet.Put( SvxKerningItem( short(0), aItemIds.nKerning ) );
1809 }
1810 break;
1811 default:
1812 ;
1813 }
1814}
1815
1817 SfxItemSet &rItemSet,
1818 SvxCSS1PropertyInfo& /*rPropInfo*/,
1819 const SvxCSS1Parser& /*rParser*/ )
1820{
1821 OSL_ENSURE( pExpr, "no expression" );
1822
1823 bool bUnderline = false;
1824 bool bOverline = false;
1825 bool bCrossedOut = false;
1826 bool bBlink = false;
1827 bool bBlinkOn = false;
1828 FontLineStyle eUnderline = LINESTYLE_NONE;
1829 FontLineStyle eOverline = LINESTYLE_NONE;
1830 FontStrikeout eCrossedOut = STRIKEOUT_NONE;
1831
1832 // the value can contain two values! And MS-IE also strings
1833 while( pExpr && (pExpr->GetType() == CSS1_IDENT ||
1834 pExpr->GetType() == CSS1_STRING) && !pExpr->GetOp() )
1835 {
1836 OUString aValue = pExpr->GetString().toAsciiLowerCase();
1837 bool bKnown = false;
1838
1839 switch( aValue[0] )
1840 {
1841 case 'n':
1842 if( aValue == "none" )
1843 {
1844 bUnderline = true;
1845 eUnderline = LINESTYLE_NONE;
1846
1847 bOverline = true;
1848 eOverline = LINESTYLE_NONE;
1849
1850 bCrossedOut = true;
1851 eCrossedOut = STRIKEOUT_NONE;
1852
1853 bBlink = true;
1854 bBlinkOn = false;
1855
1856 bKnown = true;
1857 }
1858 break;
1859
1860 case 'u':
1861 if( aValue == "underline" )
1862 {
1863 bUnderline = true;
1864 eUnderline = LINESTYLE_SINGLE;
1865
1866 bKnown = true;
1867 }
1868 break;
1869
1870 case 'o':
1871 if( aValue == "overline" )
1872 {
1873 bOverline = true;
1874 eOverline = LINESTYLE_SINGLE;
1875
1876 bKnown = true;
1877 }
1878 break;
1879
1880 case 'l':
1881 if( aValue == "line-through" )
1882 {
1883 bCrossedOut = true;
1884 eCrossedOut = STRIKEOUT_SINGLE;
1885
1886 bKnown = true;
1887 }
1888 break;
1889
1890 case 'b':
1891 if( aValue == "blink" )
1892 {
1893 bBlink = true;
1894 bBlinkOn = true;
1895
1896 bKnown = true;
1897 }
1898 break;
1899 }
1900
1901 if( !bKnown )
1902 {
1903 bUnderline = true;
1904 eUnderline = LINESTYLE_SINGLE;
1905 }
1906
1907 pExpr = pExpr->GetNext();
1908 }
1909
1910 if( bUnderline )
1911 rItemSet.Put( SvxUnderlineItem( eUnderline, aItemIds.nUnderline ) );
1912
1913 if( bOverline )
1914 rItemSet.Put( SvxOverlineItem( eOverline, aItemIds.nOverline ) );
1915
1916 if( bCrossedOut )
1917 rItemSet.Put( SvxCrossedOutItem( eCrossedOut, aItemIds.nCrossedOut ) );
1918
1919 if( bBlink )
1920 rItemSet.Put( SvxBlinkItem( bBlinkOn, aItemIds.nBlink ) );
1921}
1922
1923static void ParseCSS1_text_align( const CSS1Expression *pExpr,
1924 SfxItemSet &rItemSet,
1925 SvxCSS1PropertyInfo& /*rPropInfo*/,
1926 const SvxCSS1Parser& /*rParser*/ )
1927{
1928 OSL_ENSURE( pExpr, "no expression" );
1929
1930 if( CSS1_IDENT==pExpr->GetType() ||
1931 CSS1_STRING==pExpr->GetType() ) // MS-IE, again
1932 {
1933 sal_uInt16 nAdjust;
1935 nAdjust ) )
1936 {
1937 rItemSet.Put( SvxAdjustItem( static_cast<SvxAdjust>(nAdjust),
1938 aItemIds.nAdjust ) );
1939 }
1940 }
1941}
1942
1943static void ParseCSS1_text_indent( const CSS1Expression *pExpr,
1944 SfxItemSet &rItemSet,
1945 SvxCSS1PropertyInfo& rPropInfo,
1946 const SvxCSS1Parser& /*rParser*/ )
1947{
1948 OSL_ENSURE( pExpr, "no expression" );
1949
1950 short nIndent = 0;
1951 bool bSet = false;
1952 switch( pExpr->GetType() )
1953 {
1954 case CSS1_LENGTH:
1955 {
1956 double n = std::round(pExpr->GetNumber());
1958 n < std::numeric_limits<short>::min() || n > std::numeric_limits<short>::max(),
1959 "sw.html", "clamping length " << n << " to short range");
1960 nIndent = static_cast<short>(
1961 std::clamp(
1963 double(std::numeric_limits<short>::max())));
1964 bSet = true;
1965 }
1966 break;
1967 case CSS1_PIXLENGTH:
1968 {
1969 double fWidth = pExpr->GetNumber();
1970 if (fWidth < SAL_MAX_INT32/2.0 && fWidth > SAL_MIN_INT32/2.0)
1971 {
1972 tools::Long nPWidth = static_cast<tools::Long>(fWidth);
1973 tools::Long nPHeight = 0;
1974 SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
1975 nIndent = static_cast<short>(nPWidth);
1976 bSet = true;
1977 }
1978 }
1979 break;
1980 case CSS1_PERCENTAGE:
1981 // we aren't able
1982 break;
1983 default:
1984 ;
1985 }
1986
1987 if( !bSet )
1988 return;
1989
1990 if( const SvxLRSpaceItem* pItem = rItemSet.GetItemIfSet( aItemIds.nLRSpace, false ) )
1991 {
1992 SvxLRSpaceItem aLRItem( *pItem );
1993 aLRItem.SetTextFirstLineOffset( nIndent );
1994 rItemSet.Put( aLRItem );
1995 }
1996 else
1997 {
1998 SvxLRSpaceItem aLRItem( aItemIds.nLRSpace );
1999 aLRItem.SetTextFirstLineOffset( nIndent );
2000 rItemSet.Put( aLRItem );
2001 }
2002 rPropInfo.m_bTextIndent = true;
2003}
2004
2005static void ParseCSS1_margin_left( const CSS1Expression *pExpr,
2006 SfxItemSet &rItemSet,
2007 SvxCSS1PropertyInfo& rPropInfo,
2008 const SvxCSS1Parser& /*rParser*/ )
2009{
2010 OSL_ENSURE( pExpr, "no expression" );
2011
2012 tools::Long nLeft = 0;
2013 bool bSet = false;
2014 switch( pExpr->GetType() )
2015 {
2016 case CSS1_LENGTH:
2017 {
2018 nLeft = pExpr->GetSLength();
2019 bSet = true;
2020 }
2021 break;
2022 case CSS1_PIXLENGTH:
2023 {
2024 double fLeft = pExpr->GetNumber();
2025 if (fLeft < SAL_MAX_INT32/2.0 && fLeft > SAL_MIN_INT32/2.0)
2026 {
2027 nLeft = static_cast<tools::Long>(fLeft);
2028 tools::Long nPHeight = 0;
2029 SvxCSS1Parser::PixelToTwip( nLeft, nPHeight );
2030 bSet = true;
2031 }
2032 else
2033 {
2034 SAL_WARN("sw.html", "out-of-size pxlength: " << fLeft);
2035 }
2036 }
2037 break;
2038 case CSS1_PERCENTAGE:
2039 // we aren't able
2040 break;
2041 default:
2042 ;
2043 }
2044
2045 if( !bSet )
2046 return;
2047
2048 rPropInfo.m_nLeftMargin = nLeft;
2049 if( nLeft < 0 )
2050 nLeft = 0;
2051 if( const SvxLRSpaceItem* pItem = rItemSet.GetItemIfSet( aItemIds.nLRSpace, false ) )
2052 {
2053 SvxLRSpaceItem aLRItem( *pItem );
2054 aLRItem.SetTextLeft( o3tl::narrowing<sal_uInt16>(nLeft) );
2055 rItemSet.Put( aLRItem );
2056 }
2057 else
2058 {
2059 SvxLRSpaceItem aLRItem( aItemIds.nLRSpace );
2060 aLRItem.SetTextLeft( o3tl::narrowing<sal_uInt16>(nLeft) );
2061 rItemSet.Put( aLRItem );
2062 }
2063 rPropInfo.m_bLeftMargin = true;
2064}
2065
2066static void ParseCSS1_margin_right( const CSS1Expression *pExpr,
2067 SfxItemSet &rItemSet,
2068 SvxCSS1PropertyInfo& rPropInfo,
2069 const SvxCSS1Parser& /*rParser*/ )
2070{
2071 OSL_ENSURE( pExpr, "no expression" );
2072
2073 tools::Long nRight = 0;
2074 bool bSet = false;
2075 switch( pExpr->GetType() )
2076 {
2077 case CSS1_LENGTH:
2078 {
2079 nRight = pExpr->GetSLength();
2080 bSet = true;
2081 }
2082 break;
2083 case CSS1_PIXLENGTH:
2084 {
2085 double fRight = pExpr->GetNumber();
2086 if (fRight < SAL_MAX_INT32/2.0 && fRight > SAL_MIN_INT32/2.0)
2087 {
2088 nRight = static_cast<tools::Long>(fRight);
2089 tools::Long nPHeight = 0;
2090 SvxCSS1Parser::PixelToTwip( nRight, nPHeight );
2091 bSet = true;
2092 }
2093 }
2094 break;
2095 case CSS1_PERCENTAGE:
2096 // we aren't able
2097 break;
2098 default:
2099 ;
2100 }
2101
2102 if( !bSet )
2103 return;
2104
2105 rPropInfo.m_nRightMargin = nRight;
2106 if( nRight < 0 )
2107 nRight = 0;
2108 if( const SvxLRSpaceItem* pItem = rItemSet.GetItemIfSet( aItemIds.nLRSpace, false ) )
2109 {
2110 SvxLRSpaceItem aLRItem( *pItem );
2111 aLRItem.SetRight( o3tl::narrowing<sal_uInt16>(nRight) );
2112 rItemSet.Put( aLRItem );
2113 }
2114 else
2115 {
2116 SvxLRSpaceItem aLRItem( aItemIds.nLRSpace );
2117 aLRItem.SetRight( o3tl::narrowing<sal_uInt16>(nRight) );
2118 rItemSet.Put( aLRItem );
2119 }
2120 rPropInfo.m_bRightMargin = true;
2121}
2122
2123static void ParseCSS1_margin_top( const CSS1Expression *pExpr,
2124 SfxItemSet &rItemSet,
2125 SvxCSS1PropertyInfo& rPropInfo,
2126 const SvxCSS1Parser& /*rParser*/ )
2127{
2128 assert(pExpr && "no expression");
2129
2130 sal_uInt16 nUpper = 0;
2131 bool bSet = false;
2132 switch( pExpr->GetType() )
2133 {
2134 case CSS1_LENGTH:
2135 {
2136 tools::Long nTmp = pExpr->GetSLength();
2137 if( nTmp < 0 )
2138 nTmp = 0;
2139 nUpper = o3tl::narrowing<sal_uInt16>(nTmp);
2140 bSet = true;
2141 }
2142 break;
2143 case CSS1_PIXLENGTH:
2144 {
2145 double fHeight = pExpr->GetNumber();
2146 if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
2147 {
2148 tools::Long nPWidth = 0;
2149 tools::Long nPHeight = static_cast<tools::Long>(fHeight);
2150 if( nPHeight < 0 )
2151 nPHeight = 0;
2152 SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
2153 nUpper = o3tl::narrowing<sal_uInt16>(nPHeight);
2154 bSet = true;
2155 }
2156 }
2157 break;
2158 case CSS1_PERCENTAGE:
2159 // we aren't able
2160 break;
2161 default:
2162 ;
2163 }
2164
2165 if( !bSet )
2166 return;
2167
2168 if( const SvxULSpaceItem* pItem = rItemSet.GetItemIfSet( aItemIds.nULSpace, false ) )
2169 {
2170 SvxULSpaceItem aULItem( *pItem );
2171 aULItem.SetUpper( nUpper );
2172 rItemSet.Put( aULItem );
2173 }
2174 else
2175 {
2176 SvxULSpaceItem aULItem( aItemIds.nULSpace );
2177 aULItem.SetUpper( nUpper );
2178 rItemSet.Put( aULItem );
2179 }
2180 rPropInfo.m_bTopMargin = true;
2181}
2182
2183static void ParseCSS1_margin_bottom( const CSS1Expression *pExpr,
2184 SfxItemSet &rItemSet,
2185 SvxCSS1PropertyInfo& rPropInfo,
2186 const SvxCSS1Parser& /*rParser*/ )
2187{
2188 OSL_ENSURE( pExpr, "no expression" );
2189
2190 sal_uInt16 nLower = 0;
2191 bool bSet = false;
2192 switch( pExpr->GetType() )
2193 {
2194 case CSS1_LENGTH:
2195 {
2196 tools::Long nTmp = pExpr->GetSLength();
2197 if( nTmp < 0 )
2198 nTmp = 0;
2199 nLower = o3tl::narrowing<sal_uInt16>(nTmp);
2200 bSet = true;
2201 }
2202 break;
2203 case CSS1_PIXLENGTH:
2204 {
2205 double fHeight = pExpr->GetNumber();
2206 if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
2207 {
2208 tools::Long nPWidth = 0;
2209 tools::Long nPHeight = static_cast<tools::Long>(fHeight);
2210 if( nPHeight < 0 )
2211 nPHeight = 0;
2212 SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
2213 nLower = o3tl::narrowing<sal_uInt16>(nPHeight);
2214 bSet = true;
2215 }
2216 }
2217 break;
2218 case CSS1_PERCENTAGE:
2219 // we aren't able
2220 break;
2221 default:
2222 ;
2223 }
2224
2225 if( !bSet )
2226 return;
2227
2228 if( const SvxULSpaceItem* pItem = rItemSet.GetItemIfSet( aItemIds.nULSpace, false ) )
2229 {
2230 SvxULSpaceItem aULItem( *pItem );
2231 aULItem.SetLower( nLower );
2232 rItemSet.Put( aULItem );
2233 }
2234 else
2235 {
2236 SvxULSpaceItem aULItem( aItemIds.nULSpace );
2237 aULItem.SetLower( nLower );
2238 rItemSet.Put( aULItem );
2239 }
2240 rPropInfo.m_bBottomMargin = true;
2241}
2242
2243static void ParseCSS1_margin( const CSS1Expression *pExpr,
2244 SfxItemSet &rItemSet,
2245 SvxCSS1PropertyInfo& rPropInfo,
2246 const SvxCSS1Parser& /*rParser*/ )
2247{
2248 OSL_ENSURE( pExpr, "no expression" );
2249
2250 tools::Long nMargins[4] = { 0, 0, 0, 0 };
2251 bool bSetMargins[4] = { false, false, false, false };
2252
2253 for( int i=0; pExpr && i<4 && !pExpr->GetOp(); ++i )
2254 {
2255 bool bSetThis = false;
2256 tools::Long nMargin = 0;
2257
2258 switch( pExpr->GetType() )
2259 {
2260 case CSS1_LENGTH:
2261 {
2262 nMargin = pExpr->GetSLength();
2263 bSetThis = true;
2264 }
2265 break;
2266 case CSS1_PIXLENGTH:
2267 {
2268 double fMargin = pExpr->GetNumber();
2269 if (fMargin < SAL_MAX_INT32/2.0 && fMargin > SAL_MIN_INT32/2.0)
2270 {
2271 nMargin = static_cast<tools::Long>(fMargin);
2272 tools::Long nPWidth = 0;
2273 SvxCSS1Parser::PixelToTwip( nPWidth, nMargin );
2274 bSetThis = true;
2275 }
2276 else
2277 {
2278 SAL_WARN("sw.html", "out-of-size pxlength: " << fMargin);
2279 }
2280 }
2281 break;
2282 case CSS1_PERCENTAGE:
2283 // we aren't able
2284 break;
2285 default:
2286 ;
2287 }
2288
2289 if( bSetThis )
2290 {
2291 // 0 = top
2292 // 1 = right
2293 // 2 = bottom
2294 // 3 = left
2295 switch( i )
2296 {
2297 case 0:
2298 nMargins[0] = nMargins[1] =nMargins[2] = nMargins[3] = nMargin;
2299 bSetMargins[0] = bSetMargins[1] =
2300 bSetMargins[2] = bSetMargins[3] = true;
2301 break;
2302 case 1:
2303 nMargins[1] = nMargins[3] = nMargin; // right + left
2304 bSetMargins[1] = bSetMargins[3] = true;
2305 break;
2306 case 2:
2307 nMargins[2] = nMargin; // bottom
2308 bSetMargins[2] = true;
2309 break;
2310 case 3:
2311 nMargins[3] = nMargin; // left
2312 bSetMargins[3] = true;
2313 break;
2314 }
2315 }
2316 pExpr = pExpr->GetNext();
2317 }
2318
2319 if( bSetMargins[3] || bSetMargins[1] )
2320 {
2321 if( bSetMargins[3] )
2322 {
2323 rPropInfo.m_bLeftMargin = true;
2324 rPropInfo.m_nLeftMargin = nMargins[3];
2325 if( nMargins[3] < 0 )
2326 nMargins[3] = 0;
2327 }
2328 if( bSetMargins[1] )
2329 {
2330 rPropInfo.m_bRightMargin = true;
2331 rPropInfo.m_nRightMargin = nMargins[1];
2332 if( nMargins[1] < 0 )
2333 nMargins[1] = 0;
2334 }
2335
2336 if( const SvxLRSpaceItem* pItem = rItemSet.GetItemIfSet( aItemIds.nLRSpace, false ) )
2337 {
2338 SvxLRSpaceItem aLRItem( *pItem );
2339 if( bSetMargins[3] )
2340 aLRItem.SetLeft( o3tl::narrowing<sal_uInt16>(nMargins[3]) );
2341 if( bSetMargins[1] )
2342 aLRItem.SetRight( o3tl::narrowing<sal_uInt16>(nMargins[1]) );
2343 rItemSet.Put( aLRItem );
2344 }
2345 else
2346 {
2347 SvxLRSpaceItem aLRItem( aItemIds.nLRSpace );
2348 if( bSetMargins[3] )
2349 aLRItem.SetLeft( o3tl::narrowing<sal_uInt16>(nMargins[3]) );
2350 if( bSetMargins[1] )
2351 aLRItem.SetRight( o3tl::narrowing<sal_uInt16>(nMargins[1]) );
2352 rItemSet.Put( aLRItem );
2353 }
2354 }
2355
2356 if( !(bSetMargins[0] || bSetMargins[2]) )
2357 return;
2358
2359 if( nMargins[0] < 0 )
2360 nMargins[0] = 0;
2361 if( nMargins[2] < 0 )
2362 nMargins[2] = 0;
2363
2364 if( const SvxULSpaceItem* pItem = rItemSet.GetItemIfSet( aItemIds.nULSpace, false ) )
2365 {
2366 SvxULSpaceItem aULItem( *pItem );
2367 if( bSetMargins[0] )
2368 aULItem.SetUpper( o3tl::narrowing<sal_uInt16>(nMargins[0]) );
2369 if( bSetMargins[2] )
2370 aULItem.SetLower( o3tl::narrowing<sal_uInt16>(nMargins[2]) );
2371 rItemSet.Put( aULItem );
2372 }
2373 else
2374 {
2375 SvxULSpaceItem aULItem( aItemIds.nULSpace );
2376 if( bSetMargins[0] )
2377 aULItem.SetUpper( o3tl::narrowing<sal_uInt16>(nMargins[0]) );
2378 if( bSetMargins[2] )
2379 aULItem.SetLower( o3tl::narrowing<sal_uInt16>(nMargins[2]) );
2380 rItemSet.Put( aULItem );
2381 }
2382
2383 rPropInfo.m_bTopMargin |= bSetMargins[0];
2384 rPropInfo.m_bBottomMargin |= bSetMargins[2];
2385}
2386
2387static bool ParseCSS1_padding_xxx( const CSS1Expression *pExpr,
2388 SvxCSS1PropertyInfo& rPropInfo,
2389 SvxBoxItemLine nWhichLine )
2390{
2391 OSL_ENSURE( pExpr, "no expression" );
2392
2393 bool bSet = false;
2394 sal_uInt16 nDist = 0;
2395
2396 switch( pExpr->GetType() )
2397 {
2398 case CSS1_LENGTH:
2399 {
2400 tools::Long nTmp = pExpr->GetSLength();
2401 if( nTmp < 0 )
2402 nTmp = 0;
2405 nDist = o3tl::narrowing<sal_uInt16>(nTmp);
2406 bSet = true;
2407 }
2408 break;
2409 case CSS1_PIXLENGTH:
2410 {
2411 double fWidth = pExpr->GetNumber();
2412 if (fWidth < SAL_MAX_INT32/2.0 && fWidth > SAL_MIN_INT32/2.0)
2413 {
2414 tools::Long nPWidth = static_cast<tools::Long>(fWidth);
2415 tools::Long nPHeight = 0;
2416 if( nPWidth < 0 )
2417 nPWidth = 0;
2418 SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
2421 nDist = o3tl::narrowing<sal_uInt16>(nPWidth);
2422 bSet = true;
2423 }
2424 }
2425 break;
2426 case CSS1_PERCENTAGE:
2427 // we aren't able
2428 break;
2429 default:
2430 ;
2431 }
2432
2433 if( bSet )
2434 {
2435 switch( nWhichLine )
2436 {
2437 case SvxBoxItemLine::TOP: rPropInfo.m_nTopBorderDistance = nDist; break;
2438 case SvxBoxItemLine::BOTTOM: rPropInfo.m_nBottomBorderDistance = nDist;break;
2439 case SvxBoxItemLine::LEFT: rPropInfo.m_nLeftBorderDistance = nDist; break;
2440 case SvxBoxItemLine::RIGHT: rPropInfo.m_nRightBorderDistance = nDist; break;
2441 }
2442 }
2443
2444 return bSet;
2445}
2446
2447static void ParseCSS1_padding_top( const CSS1Expression *pExpr,
2448 SfxItemSet & /*rItemSet*/,
2449 SvxCSS1PropertyInfo& rPropInfo,
2450 const SvxCSS1Parser& /*rParser*/ )
2451{
2452 ParseCSS1_padding_xxx( pExpr, rPropInfo, SvxBoxItemLine::TOP );
2453}
2454
2456 SfxItemSet & /*rItemSet*/,
2457 SvxCSS1PropertyInfo& rPropInfo,
2458 const SvxCSS1Parser& /*rParser*/ )
2459{
2460 ParseCSS1_padding_xxx( pExpr, rPropInfo, SvxBoxItemLine::BOTTOM );
2461}
2462
2463static void ParseCSS1_padding_left( const CSS1Expression *pExpr,
2464 SfxItemSet & /*rItemSet*/,
2465 SvxCSS1PropertyInfo& rPropInfo,
2466 const SvxCSS1Parser& /*rParser*/ )
2467{
2468 ParseCSS1_padding_xxx( pExpr, rPropInfo, SvxBoxItemLine::LEFT );
2469}
2470
2471static void ParseCSS1_padding_right( const CSS1Expression *pExpr,
2472 SfxItemSet & /*rItemSet*/,
2473 SvxCSS1PropertyInfo& rPropInfo,
2474 const SvxCSS1Parser& /*rParser*/ )
2475{
2476 ParseCSS1_padding_xxx( pExpr, rPropInfo, SvxBoxItemLine::RIGHT );
2477}
2478
2479static void ParseCSS1_padding( const CSS1Expression *pExpr,
2480 SfxItemSet & /*rItemSet*/,
2481 SvxCSS1PropertyInfo& rPropInfo,
2482 const SvxCSS1Parser& /*rParser*/ )
2483{
2484 int n=0;
2485 while( n<4 && pExpr && !pExpr->GetOp() )
2486 {
2487 SvxBoxItemLine nLine = n==0 || n==2 ? SvxBoxItemLine::BOTTOM : SvxBoxItemLine::LEFT;
2488 if( ParseCSS1_padding_xxx( pExpr, rPropInfo, nLine ) )
2489 {
2490 if( n==0 )
2491 {
2492 rPropInfo.m_nTopBorderDistance = rPropInfo.m_nBottomBorderDistance;
2493 rPropInfo.m_nLeftBorderDistance = rPropInfo.m_nTopBorderDistance;
2494 }
2495 if( n <= 1 )
2496 rPropInfo.m_nRightBorderDistance = rPropInfo.m_nLeftBorderDistance;
2497 }
2498
2499 pExpr = pExpr->GetNext();
2500 n++;
2501 }
2502}
2503
2504static void ParseCSS1_border_xxx( const CSS1Expression *pExpr,
2505 SfxItemSet & /*rItemSet*/,
2506 SvxCSS1PropertyInfo& rPropInfo,
2507 const SvxCSS1Parser& /*rParser*/,
2508 SvxBoxItemLine nWhichLine, bool bAll )
2509{
2510 OSL_ENSURE( pExpr, "no expression" );
2511
2512 sal_uInt16 nWidth = USHRT_MAX; // line thickness
2513 sal_uInt16 nNWidth = 1; // named line thickness (and default)
2514 CSS1BorderStyle eStyle = CSS1_BS_NONE; // line style
2515 Color aColor;
2516 bool bColor = false;
2517
2518 while( pExpr && !pExpr->GetOp() )
2519 {
2520 switch( pExpr->GetType() )
2521 {
2522 case CSS1_RGB:
2523 case CSS1_HEXCOLOR:
2524 if( pExpr->GetColor( aColor ) )
2525 bColor = true;
2526 break;
2527
2528 case CSS1_IDENT:
2529 {
2530 const OUString& rValue = pExpr->GetString();
2531 sal_uInt16 nValue;
2533 {
2534 nNWidth = nValue;
2535 }
2536 else if( SvxCSS1Parser::GetEnum( aBorderStyleTable, rValue, nValue ) )
2537 {
2538 eStyle = static_cast<CSS1BorderStyle>(nValue);
2539 }
2540 else if( pExpr->GetColor( aColor ) )
2541 {
2542 bColor = true;
2543 }
2544 }
2545 break;
2546
2547 case CSS1_LENGTH:
2548 nWidth = o3tl::narrowing<sal_uInt16>(pExpr->GetULength());
2549 break;
2550
2551 case CSS1_PIXLENGTH:
2552 {
2553 // One Pixel becomes a hairline (is prettier)
2554 double fWidth = pExpr->GetNumber();
2555 if (fWidth > 1.0 && fWidth < SAL_MAX_INT32/2.0)
2556 {
2557 bool bHori = nWhichLine == SvxBoxItemLine::TOP ||
2558 nWhichLine == SvxBoxItemLine::BOTTOM;
2559
2560 tools::Long nPWidth = bHori ? 0 : fWidth;
2561 tools::Long nPHeight = bHori ? fWidth : 0;
2562 SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
2563 nWidth = o3tl::narrowing<sal_uInt16>(bHori ? nPHeight : nPWidth);
2564 }
2565 else
2566 nWidth = 1;
2567 }
2568 break;
2569
2570 default:
2571 ;
2572 }
2573
2574 pExpr = pExpr->GetNext();
2575 }
2576
2577 for( int i=0; i<4; ++i )
2578 {
2579 SvxBoxItemLine nLine = SvxBoxItemLine::TOP;
2580 switch( i )
2581 {
2582 case 0: nLine = SvxBoxItemLine::TOP; break;
2583 case 1: nLine = SvxBoxItemLine::BOTTOM; break;
2584 case 2: nLine = SvxBoxItemLine::LEFT; break;
2585 case 3: nLine = SvxBoxItemLine::RIGHT; break;
2586 }
2587
2588 if( bAll || nLine == nWhichLine )
2589 {
2590 SvxCSS1BorderInfo *pInfo = rPropInfo.GetBorderInfo( nLine );
2591 pInfo->eStyle = eStyle;
2592 pInfo->nAbsWidth = nWidth;
2593 pInfo->nNamedWidth = nNWidth;
2594 if( bColor )
2595 pInfo->aColor = aColor;
2596 }
2597 }
2598}
2599
2601 SfxItemSet & /*rItemSet*/,
2602 SvxCSS1PropertyInfo& rPropInfo,
2603 const SvxCSS1Parser& /*rParser*/,
2604 SvxBoxItemLine nWhichLine )
2605{
2606 OSL_ENSURE( pExpr, "no expression" );
2607
2608 sal_uInt16 nWidth = USHRT_MAX; // line thickness
2609 sal_uInt16 nNWidth = 1; // named line thickness (and default)
2610
2611 switch( pExpr->GetType() )
2612 {
2613 case CSS1_IDENT:
2614 {
2615 sal_uInt16 nValue;
2617 {
2618 nNWidth = nValue;
2619 }
2620 }
2621 break;
2622
2623 case CSS1_LENGTH:
2624 nWidth = o3tl::narrowing<sal_uInt16>(pExpr->GetULength());
2625 break;
2626
2627 case CSS1_PIXLENGTH:
2628 {
2629 double fLength = pExpr->GetNumber();
2630 if (fLength < SAL_MAX_INT32/2.0 && fLength > SAL_MIN_INT32/2.0)
2631 {
2632 tools::Long nWidthL = static_cast<tools::Long>(fLength);
2633
2634 bool bHori = nWhichLine == SvxBoxItemLine::TOP ||
2635 nWhichLine == SvxBoxItemLine::BOTTOM;
2636
2637 tools::Long nPWidth = bHori ? 0 : nWidthL;
2638 tools::Long nPHeight = bHori ? nWidthL : 0;
2639 SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
2640 nWidth = o3tl::narrowing<sal_uInt16>(bHori ? nPHeight : nPWidth);
2641 }
2642 }
2643 break;
2644
2645 default:
2646 ;
2647 }
2648
2649 SvxCSS1BorderInfo *pInfo = rPropInfo.GetBorderInfo( nWhichLine );
2650 pInfo->nAbsWidth = nWidth;
2651 pInfo->nNamedWidth = nNWidth;
2652}
2653
2655 SfxItemSet &rItemSet,
2656 SvxCSS1PropertyInfo& rPropInfo,
2657 const SvxCSS1Parser& rParser )
2658{
2659 ParseCSS1_border_xxx_width( pExpr, rItemSet, rPropInfo, rParser, SvxBoxItemLine::TOP );
2660}
2661
2663 SfxItemSet &rItemSet,
2664 SvxCSS1PropertyInfo& rPropInfo,
2665 const SvxCSS1Parser& rParser )
2666{
2667 ParseCSS1_border_xxx_width( pExpr, rItemSet, rPropInfo, rParser, SvxBoxItemLine::RIGHT );
2668}
2669
2671 SfxItemSet &rItemSet,
2672 SvxCSS1PropertyInfo& rPropInfo,
2673 const SvxCSS1Parser& rParser )
2674{
2675 ParseCSS1_border_xxx_width( pExpr, rItemSet, rPropInfo, rParser, SvxBoxItemLine::BOTTOM );
2676}
2677
2679 SfxItemSet &rItemSet,
2680 SvxCSS1PropertyInfo& rPropInfo,
2681 const SvxCSS1Parser& rParser )
2682{
2683 ParseCSS1_border_xxx_width( pExpr, rItemSet, rPropInfo, rParser, SvxBoxItemLine::LEFT );
2684}
2685
2686static void ParseCSS1_border_width( const CSS1Expression *pExpr,
2687 SfxItemSet &rItemSet,
2688 SvxCSS1PropertyInfo& rPropInfo,
2689 const SvxCSS1Parser& rParser )
2690{
2691 sal_uInt16 n=0;
2692 while( n<4 && pExpr && !pExpr->GetOp() )
2693 {
2694 SvxBoxItemLine nLine = n==0 || n==2 ? SvxBoxItemLine::BOTTOM : SvxBoxItemLine::LEFT;
2695 ParseCSS1_border_xxx_width( pExpr, rItemSet, rPropInfo, rParser, nLine );
2697
2698 pExpr = pExpr->GetNext();
2699 n++;
2700 }
2701}
2702
2703static void ParseCSS1_border_color( const CSS1Expression *pExpr,
2704 SfxItemSet & /*rItemSet*/,
2705 SvxCSS1PropertyInfo& rPropInfo,
2706 const SvxCSS1Parser& /*rParser*/ )
2707{
2708 sal_uInt16 n=0;
2709 while( n<4 && pExpr && !pExpr->GetOp() )
2710 {
2711 SvxBoxItemLine nLine = n==0 || n==2 ? SvxBoxItemLine::BOTTOM : SvxBoxItemLine::LEFT;
2712 Color aColor;
2713 switch( pExpr->GetType() )
2714 {
2715 case CSS1_RGB:
2716 case CSS1_HEXCOLOR:
2717 case CSS1_IDENT:
2718 if( pExpr->GetColor( aColor ) )
2719 rPropInfo.GetBorderInfo( nLine )->aColor = aColor;
2720 break;
2721 default:
2722 ;
2723 }
2725
2726 pExpr = pExpr->GetNext();
2727 n++;
2728 }
2729}
2730
2731static void ParseCSS1_border_style( const CSS1Expression *pExpr,
2732 SfxItemSet & /*rItemSet*/,
2733 SvxCSS1PropertyInfo& rPropInfo,
2734 const SvxCSS1Parser& /*rParser*/ )
2735{
2736 sal_uInt16 n=0;
2737 while( n<4 && pExpr && !pExpr->GetOp() )
2738 {
2739 SvxBoxItemLine nLine = n==0 || n==2 ? SvxBoxItemLine::BOTTOM : SvxBoxItemLine::LEFT;
2740 sal_uInt16 nValue = 0;
2741 if( CSS1_IDENT==pExpr->GetType() &&
2743 nValue ) )
2744 {
2745 rPropInfo.GetBorderInfo( nLine )->eStyle = static_cast<CSS1BorderStyle>(nValue);
2746 }
2748
2749 pExpr = pExpr->GetNext();
2750 n++;
2751 }
2752}
2753
2754static void ParseCSS1_border_top( const CSS1Expression *pExpr,
2755 SfxItemSet &rItemSet,
2756 SvxCSS1PropertyInfo& rPropInfo,
2757 const SvxCSS1Parser& rParser )
2758{
2759 ParseCSS1_border_xxx( pExpr, rItemSet, rPropInfo, rParser, SvxBoxItemLine::TOP, false );
2760}
2761
2762static void ParseCSS1_border_right( const CSS1Expression *pExpr,
2763 SfxItemSet &rItemSet,
2764 SvxCSS1PropertyInfo& rPropInfo,
2765 const SvxCSS1Parser& rParser )
2766{
2767 ParseCSS1_border_xxx( pExpr, rItemSet, rPropInfo, rParser, SvxBoxItemLine::RIGHT, false );
2768}
2769
2770static void ParseCSS1_border_bottom( const CSS1Expression *pExpr,
2771 SfxItemSet &rItemSet,
2772 SvxCSS1PropertyInfo& rPropInfo,
2773 const SvxCSS1Parser& rParser )
2774{
2775 ParseCSS1_border_xxx( pExpr, rItemSet, rPropInfo, rParser, SvxBoxItemLine::BOTTOM, false );
2776}
2777
2778static void ParseCSS1_border_left( const CSS1Expression *pExpr,
2779 SfxItemSet &rItemSet,
2780 SvxCSS1PropertyInfo& rPropInfo,
2781 const SvxCSS1Parser& rParser )
2782{
2783 ParseCSS1_border_xxx( pExpr, rItemSet, rPropInfo, rParser, SvxBoxItemLine::LEFT, false );
2784}
2785
2786static void ParseCSS1_border( const CSS1Expression *pExpr,
2787 SfxItemSet &rItemSet,
2788 SvxCSS1PropertyInfo& rPropInfo,
2789 const SvxCSS1Parser& rParser )
2790{
2791 ParseCSS1_border_xxx( pExpr, rItemSet, rPropInfo, rParser, SvxBoxItemLine::TOP, true );
2792}
2793
2794static void ParseCSS1_float( const CSS1Expression *pExpr,
2795 SfxItemSet & /*rItemSet*/,
2796 SvxCSS1PropertyInfo& rPropInfo,
2797 const SvxCSS1Parser& /*rParser*/ )
2798{
2799 OSL_ENSURE( pExpr, "no expression" );
2800
2801 if( CSS1_IDENT==pExpr->GetType() )
2802 {
2803 sal_uInt16 nFloat;
2804 if( SvxCSS1Parser::GetEnum( aFloatTable, pExpr->GetString(), nFloat ) )
2805 rPropInfo.m_eFloat = static_cast<SvxAdjust>(nFloat);
2806 }
2807}
2808
2809static void ParseCSS1_position( const CSS1Expression *pExpr,
2810 SfxItemSet & /*rItemSet*/,
2811 SvxCSS1PropertyInfo& rPropInfo,
2812 const SvxCSS1Parser& /*rParser*/ )
2813{
2814 OSL_ENSURE( pExpr, "no expression" );
2815
2816 if( CSS1_IDENT==pExpr->GetType() )
2817 {
2818 sal_uInt16 nPos;
2820 rPropInfo.m_ePosition = static_cast<SvxCSS1Position>(nPos);
2821 }
2822}
2823
2824static void ParseCSS1_length( const CSS1Expression *pExpr,
2825 tools::Long& rLength,
2826 SvxCSS1LengthType& rLengthType,
2827 bool bHori )
2828{
2829 switch( pExpr->GetType() )
2830 {
2831 case CSS1_IDENT:
2832 if( pExpr->GetString().equalsIgnoreAsciiCase( "auto" ) )
2833 {
2834 rLength = 0;
2835 rLengthType = SVX_CSS1_LTYPE_AUTO;
2836 }
2837 break;
2838
2839 case CSS1_LENGTH:
2840 rLength = pExpr->GetSLength();
2841 rLengthType = SVX_CSS1_LTYPE_TWIP;
2842 break;
2843
2844 case CSS1_PIXLENGTH:
2845 case CSS1_NUMBER: // because of Netscape and IE
2846 {
2847 double fLength = pExpr->GetNumber();
2848 if (fLength < SAL_MAX_INT32/2.0 && fLength > SAL_MIN_INT32/2.0)
2849 {
2850 tools::Long nWidthL = static_cast<tools::Long>(fLength);
2851 tools::Long nPWidth = bHori ? 0 : nWidthL;
2852 tools::Long nPHeight = bHori ? nWidthL : 0;
2853 SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
2854 rLength = (bHori ? nPHeight : nPWidth);
2855 rLengthType = SVX_CSS1_LTYPE_TWIP;
2856 }
2857 }
2858 break;
2859
2860 case CSS1_PERCENTAGE:
2861 rLength = static_cast<tools::Long>(std::min(pExpr->GetNumber(), 100.0));
2862 rLengthType = SVX_CSS1_LTYPE_PERCENTAGE;
2863 break;
2864
2865 default:
2866 ;
2867 }
2868}
2869
2870static void ParseCSS1_width( const CSS1Expression *pExpr,
2871 SfxItemSet & /*rItemSet*/,
2872 SvxCSS1PropertyInfo& rPropInfo,
2873 const SvxCSS1Parser& /*rParser*/ )
2874{
2875 ParseCSS1_length( pExpr, rPropInfo.m_nWidth, rPropInfo.m_eWidthType, true );
2876}
2877
2878static void ParseCSS1_height( const CSS1Expression *pExpr,
2879 SfxItemSet & /*rItemSet*/,
2880 SvxCSS1PropertyInfo& rPropInfo,
2881 const SvxCSS1Parser& /*rParser*/ )
2882{
2883 ParseCSS1_length( pExpr, rPropInfo.m_nHeight, rPropInfo.m_eHeightType, false );
2884}
2885
2886static void ParseCSS1_left( const CSS1Expression *pExpr,
2887 SfxItemSet & /*rItemSet*/,
2888 SvxCSS1PropertyInfo& rPropInfo,
2889 const SvxCSS1Parser& /*rParser*/ )
2890{
2891 ParseCSS1_length( pExpr, rPropInfo.m_nLeft, rPropInfo.m_eLeftType, true );
2892}
2893
2894static void ParseCSS1_top( const CSS1Expression *pExpr,
2895 SfxItemSet & /*rItemSet*/,
2896 SvxCSS1PropertyInfo& rPropInfo,
2897 const SvxCSS1Parser& /*rParser*/ )
2898{
2899 ParseCSS1_length( pExpr, rPropInfo.m_nTop, rPropInfo.m_eTopType, false );
2900}
2901
2902// Feature: PrintExt
2903static void ParseCSS1_size( const CSS1Expression *pExpr,
2904 SfxItemSet & /*rItemSet*/,
2905 SvxCSS1PropertyInfo& rPropInfo,
2906 const SvxCSS1Parser& /*rParser*/ )
2907{
2908 int n=0;
2909 while( n<2 && pExpr && !pExpr->GetOp() )
2910 {
2911 switch( pExpr->GetType() )
2912 {
2913 case CSS1_IDENT:
2914 {
2915 sal_uInt16 nValue;
2917 nValue ) )
2918 {
2919 rPropInfo.m_eSizeType = static_cast<SvxCSS1SizeType>(nValue);
2920 }
2921 }
2922 break;
2923
2924 case CSS1_LENGTH:
2925 rPropInfo.m_nHeight = pExpr->GetSLength();
2926 if( n==0 )
2927 rPropInfo.m_nWidth = rPropInfo.m_nHeight;
2928 rPropInfo.m_eSizeType = SVX_CSS1_STYPE_TWIP;
2929 break;
2930
2931 case CSS1_PIXLENGTH:
2932 {
2933 double fHeight = pExpr->GetNumber();
2934 if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
2935 {
2936 tools::Long nPHeight = static_cast<tools::Long>(fHeight);
2937 tools::Long nPWidth = n==0 ? nPHeight : 0;
2938 SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
2939 rPropInfo.m_nHeight = nPHeight;
2940 if( n==0 )
2941 rPropInfo.m_nWidth = nPWidth;
2942 rPropInfo.m_eSizeType = SVX_CSS1_STYPE_TWIP;
2943 }
2944 break;
2945 }
2946 default:
2947 ;
2948 }
2949
2950 pExpr = pExpr->GetNext();
2951 n++;
2952 }
2953}
2954
2956 SvxCSS1PageBreak& rPBreak )
2957{
2958 if( CSS1_IDENT == pExpr->GetType() )
2959 {
2960 sal_uInt16 nValue;
2962 nValue ) )
2963 {
2964 rPBreak = static_cast<SvxCSS1PageBreak>(nValue);
2965 }
2966 }
2967}
2968
2970 SfxItemSet & /*rItemSet*/,
2971 SvxCSS1PropertyInfo& rPropInfo,
2972 const SvxCSS1Parser& /*rParser*/ )
2973{
2974 ParseCSS1_page_break_xxx( pExpr, rPropInfo.m_ePageBreakBefore );
2975}
2976
2978 SfxItemSet & /*rItemSet*/,
2979 SvxCSS1PropertyInfo& rPropInfo,
2980 const SvxCSS1Parser& /*rParser*/ )
2981{
2982 ParseCSS1_page_break_xxx( pExpr, rPropInfo.m_ePageBreakAfter );
2983}
2984
2986 SfxItemSet &rItemSet,
2987 SvxCSS1PropertyInfo& /*rPropInfo*/,
2988 const SvxCSS1Parser& /*rParser*/ )
2989{
2991 ParseCSS1_page_break_xxx( pExpr, eBreak );
2992
2993 bool bSetSplit = false, bSplit = true;
2994 switch( eBreak )
2995 {
2997 bSetSplit = true;
2998 break;
3000 bSplit = false;
3001 bSetSplit = true;
3002 break;
3003 default:
3004 ;
3005 }
3006
3007 if( bSetSplit )
3008 rItemSet.Put( SvxFormatSplitItem( bSplit, aItemIds.nFormatSplit ) );
3009}
3010
3011static void ParseCSS1_widows( const CSS1Expression *pExpr,
3012 SfxItemSet &rItemSet,
3013 SvxCSS1PropertyInfo& /*rPropInfo*/,
3014 const SvxCSS1Parser& /*rParser*/ )
3015{
3016 if( CSS1_NUMBER == pExpr->GetType() )
3017 {
3018 sal_uInt8 nVal = pExpr->GetNumber() <= 255
3019 ? static_cast<sal_uInt8>(pExpr->GetNumber())
3020 : 255;
3021 SvxWidowsItem aWidowsItem( nVal, aItemIds.nWidows );
3022 rItemSet.Put( aWidowsItem );
3023 }
3024}
3025
3026static void ParseCSS1_orphans( const CSS1Expression *pExpr,
3027 SfxItemSet &rItemSet,
3028 SvxCSS1PropertyInfo& /*rPropInfo*/,
3029 const SvxCSS1Parser& /*rParser*/ )
3030{
3031 if( CSS1_NUMBER == pExpr->GetType() )
3032 {
3033 sal_uInt8 nVal = pExpr->GetNumber() <= 255
3034 ? static_cast<sal_uInt8>(pExpr->GetNumber())
3035 : 255;
3036 SvxOrphansItem aOrphansItem( nVal, aItemIds.nOrphans );
3037 rItemSet.Put( aOrphansItem );
3038 }
3039}
3040
3041static void ParseCSS1_so_language( const CSS1Expression *pExpr,
3042 SfxItemSet &rItemSet,
3043 SvxCSS1PropertyInfo& /*rPropInfo*/,
3044 const SvxCSS1Parser& /*rParser*/ )
3045{
3046 if( CSS1_IDENT != pExpr->GetType() && CSS1_STRING != pExpr->GetType() )
3047 return;
3048
3050 if( LANGUAGE_DONTKNOW != eLang )
3051 {
3052 SvxLanguageItem aLang( eLang, aItemIds.nLanguage );
3053 rItemSet.Put( aLang );
3054 aLang.SetWhich( aItemIds.nLanguageCJK );
3055 rItemSet.Put( aLang );
3056 aLang.SetWhich( aItemIds.nLanguageCTL );
3057 rItemSet.Put( aLang );
3058 }
3059}
3060
3061static void ParseCSS1_visibility(const CSS1Expression* pExpr, SfxItemSet& /*rItemSet*/,
3062 SvxCSS1PropertyInfo& rPropInfo, const SvxCSS1Parser& /*rParser*/)
3063{
3064 if (pExpr->GetType() != CSS1_IDENT)
3065 return;
3066
3067 rPropInfo.m_bVisible = pExpr->GetString() != "hidden";
3068}
3069
3070namespace {
3071
3072// the assignment of property to parsing function
3073struct CSS1PropEntry
3074{
3075 const char * pName;
3076 FnParseCSS1Prop pFunc;
3077};
3078
3079}
3080
3081#define CSS1_PROP_ENTRY(p) \
3082 { sCSS1_P_##p, ParseCSS1_##p }
3083
3084// the table with assignments
3085CSS1PropEntry const aCSS1PropFnTab[] =
3086{
3087 CSS1_PROP_ENTRY(background),
3088 CSS1_PROP_ENTRY(background_color),
3089 CSS1_PROP_ENTRY(border),
3090 CSS1_PROP_ENTRY(border_bottom),
3091 CSS1_PROP_ENTRY(border_bottom_width),
3092 CSS1_PROP_ENTRY(border_color),
3093 CSS1_PROP_ENTRY(border_left),
3094 CSS1_PROP_ENTRY(border_left_width),
3095 CSS1_PROP_ENTRY(border_right),
3096 CSS1_PROP_ENTRY(border_right_width),
3097 CSS1_PROP_ENTRY(border_style),
3098 CSS1_PROP_ENTRY(border_top),
3099 CSS1_PROP_ENTRY(border_top_width),
3100 CSS1_PROP_ENTRY(border_width),
3102 CSS1_PROP_ENTRY(column_count),
3103 CSS1_PROP_ENTRY(direction),
3104 CSS1_PROP_ENTRY(float),
3105 CSS1_PROP_ENTRY(font),
3106 CSS1_PROP_ENTRY(font_family),
3107 CSS1_PROP_ENTRY(font_size),
3108 CSS1_PROP_ENTRY(font_style),
3109 CSS1_PROP_ENTRY(font_variant),
3110 CSS1_PROP_ENTRY(font_weight),
3111 CSS1_PROP_ENTRY(height),
3113 CSS1_PROP_ENTRY(letter_spacing),
3114 CSS1_PROP_ENTRY(line_height),
3115 CSS1_PROP_ENTRY(list_style_type),
3116 CSS1_PROP_ENTRY(margin),
3117 CSS1_PROP_ENTRY(margin_bottom),
3118 CSS1_PROP_ENTRY(margin_left),
3119 CSS1_PROP_ENTRY(margin_right),
3120 CSS1_PROP_ENTRY(margin_top),
3121 CSS1_PROP_ENTRY(orphans),
3122 CSS1_PROP_ENTRY(padding),
3123 CSS1_PROP_ENTRY(padding_bottom),
3124 CSS1_PROP_ENTRY(padding_left),
3125 CSS1_PROP_ENTRY(padding_right),
3126 CSS1_PROP_ENTRY(padding_top),
3127 CSS1_PROP_ENTRY(page_break_after),
3128 CSS1_PROP_ENTRY(page_break_before),
3129 CSS1_PROP_ENTRY(page_break_inside),
3132 CSS1_PROP_ENTRY(so_language),
3133 CSS1_PROP_ENTRY(text_align),
3134 CSS1_PROP_ENTRY(text_decoration),
3135 CSS1_PROP_ENTRY(text_indent),
3136 CSS1_PROP_ENTRY(text_transform),
3138 CSS1_PROP_ENTRY(visibility),
3139 CSS1_PROP_ENTRY(widows),
3140 CSS1_PROP_ENTRY(width),
3141};
3142
3143#if !defined NDEBUG
3144static bool CSS1PropEntryCompare( const CSS1PropEntry &lhs, const CSS1PropEntry &rhs)
3145{
3146 return strcmp(lhs.pName, rhs.pName) < 0;
3147}
3148#endif
3149static bool CSS1PropEntryFindCompare(CSS1PropEntry const & lhs, OUString const & s)
3150{
3151 return s.compareToIgnoreAsciiCaseAscii(lhs.pName) > 0;
3152}
3153
3154void SvxCSS1Parser::DeclarationParsed( const OUString& rProperty,
3155 std::unique_ptr<CSS1Expression> pExpr )
3156{
3157 OSL_ENSURE( m_pItemSet, "DeclarationParsed() without ItemSet" );
3158
3159 static bool bSortedPropFns = false;
3160
3161 if( !bSortedPropFns )
3162 {
3163 assert( std::is_sorted( std::begin(aCSS1PropFnTab), std::end(aCSS1PropFnTab),
3165 bSortedPropFns = true;
3166 }
3167
3168 auto it = std::lower_bound( std::begin(aCSS1PropFnTab), std::end(aCSS1PropFnTab), rProperty,
3170 if( it != std::end(aCSS1PropFnTab) && !CSS1PropEntryFindCompare(*it,rProperty) )
3171 {
3172 it->pFunc( pExpr.get(), *m_pItemSet, *m_pPropInfo, *this );
3173 }
3174}
3175
3176/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::chart::ChartAxisLabelPosition ePos
const char * pName
SvxBoxItemLine
SvxGraphicPosition
GPOS_MT
GPOS_LT
GPOS_RT
GPOS_NONE
GPOS_MM
GPOS_TILED
GPOS_MB
GPOS_LB
GPOS_LM
GPOS_RM
GPOS_RB
static OutputDevice * GetDefaultDevice()
void ParseStyleSheet()
Definition: parcss1.cxx:670
void ParseStyleOption(const OUString &rIn)
parse the content of a HTML style option
Definition: parcss1.cxx:1152
A simple selector.
Definition: parcss1.hxx:93
static const FontMetric & GetFontMetric(sal_Handle hFontMetric)
sal_Handle GetFirstFontMetric(std::u16string_view rName) const
static LanguageType convertToLanguageTypeWithFallback(const OUString &rBcp47)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
sal_uInt16 GetTrueWhich(sal_uInt16 nSlot, bool bDeep=true) const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static const sal_Int16 VeryThin
static const sal_Int16 Thin
static const sal_Int16 Hairline
virtual SvxBoxItem * Clone(SfxItemPool *pPool=nullptr) const override
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
void SetGraphicPos(SvxGraphicPosition eNew)
void SetGraphicLink(const OUString &rNew)
void SetColor(const Color &rCol)
SvxCSS1MapEntry(SfxItemSet aItemSet, const SvxCSS1PropertyInfo &rProp)
Definition: svxcss1.cxx:663
std::unique_ptr< SfxItemSet > m_pSheetItemSet
Definition: svxcss1.hxx:199
void InsertPage(const OUString &rPage, bool bPseudo, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp)
Definition: svxcss1.cxx:788
const SvxCSS1MapEntry * GetId(const OUString &rId) const
Definition: svxcss1.cxx:769
void InsertId(const OUString &rId, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp)
Definition: svxcss1.cxx:762
void ParseStyleOption(const OUString &rIn, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo)
Definition: svxcss1.cxx:845
CSS1Map m_Ids
Definition: svxcss1.hxx:192
CSS1Selectors m_Selectors
Definition: svxcss1.hxx:190
bool IsIgnoreFontFamily() const
Definition: svxcss1.hxx:246
CSS1Map m_Pages
Definition: svxcss1.hxx:194
std::unique_ptr< SvxCSS1PropertyInfo > m_pSheetPropInfo
Definition: svxcss1.hxx:202
SvxCSS1MapEntry * GetTag(const OUString &rTag)
Definition: svxcss1.cxx:816
virtual void SetDfltEncoding(rtl_TextEncoding eEnc)
Definition: svxcss1.cxx:979
rtl_TextEncoding GetDfltEncoding() const
Definition: svxcss1.hxx:303
void InsertClass(const OUString &rClass, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp)
Definition: svxcss1.cxx:775
static void PixelToTwip(tools::Long &nWidth, tools::Long &nHeight)
Definition: svxcss1.cxx:876
CSS1Map m_Tags
Definition: svxcss1.hxx:195
SfxItemSet * m_pItemSet
Definition: svxcss1.hxx:200
static void InsertMapEntry(const OUString &rKey, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp, CSS1Map &rMap)
Definition: svxcss1.cxx:913
virtual void StyleParsed(const CSS1Selector *pSelector, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo)
Definition: svxcss1.cxx:669
static sal_uInt16 GetMinFixLineSpace()
Definition: svxcss1.hxx:300
rtl_TextEncoding m_eDefaultEnc
Definition: svxcss1.hxx:208
std::map< OUString, std::unique_ptr< SvxCSS1MapEntry > > CSS1Map
Definition: svxcss1.hxx:189
static void MergeStyles(const SfxItemSet &rSrcSet, const SvxCSS1PropertyInfo &rSrcInfo, SfxItemSet &rTargetSet, SvxCSS1PropertyInfo &rTargetInfo, bool bSmart)
Definition: svxcss1.cxx:931
virtual void DeclarationParsed(const OUString &rProperty, std::unique_ptr< CSS1Expression > pExpr) override
Will be called for every parsed Property.
Definition: svxcss1.cxx:3154
const SvxCSS1MapEntry * GetClass(const OUString &rClass) const
Definition: svxcss1.cxx:782
SvxCSS1MapEntry * GetPage(const OUString &rPage, bool bPseudo)
Definition: svxcss1.cxx:799
virtual sal_uInt32 GetFontHeight(sal_uInt16 nSize) const
Definition: svxcss1.cxx:889
const OUString & GetBaseURL() const
Definition: svxcss1.hxx:305
void ParseStyleSheet()
Definition: parcss1.cxx:670
virtual void SelectorParsed(std::unique_ptr< CSS1Selector > pSelector, bool bFirst) override
Will be called when a Selector is parsed.
Definition: svxcss1.cxx:676
CSS1Map m_Classes
Definition: svxcss1.hxx:193
virtual ~SvxCSS1Parser() override
Definition: svxcss1.cxx:756
SvxCSS1Parser(SfxItemPool &rPool, OUString aBaseURL, sal_uInt16 const *pWhichIds, sal_uInt16 nWhichIds)
Definition: svxcss1.cxx:696
WhichRangesContainer m_aWhichMap
Definition: svxcss1.hxx:210
virtual const FontList * GetFontList() const
Definition: svxcss1.cxx:908
static bool GetEnum(const CSS1PropertyEnum *pPropTable, const OUString &rValue, sal_uInt16 &rEnum)
Definition: svxcss1.cxx:859
SvxCSS1PropertyInfo * m_pPropInfo
Definition: svxcss1.hxx:203
void InsertTag(const OUString &rTag, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp)
Definition: svxcss1.cxx:809
sal_Unicode m_cBulletChar
Definition: svxcss1.hxx:129
tools::Long m_nHeight
Definition: svxcss1.hxx:134
SvxCSS1PageBreak m_ePageBreakBefore
Definition: svxcss1.hxx:142
tools::Long m_nTop
Definition: svxcss1.hxx:133
void SetBoxItem(SfxItemSet &rItemSet, sal_uInt16 nMinBorderDist, const SvxBoxItem *pDflt=nullptr)
Definition: svxcss1.cxx:583
SvxNumType m_nNumberingType
Definition: svxcss1.hxx:128
sal_uInt16 m_nColumnCount
Definition: svxcss1.hxx:131
SvxCSS1PageBreak m_ePageBreakAfter
Definition: svxcss1.hxx:143
SvxCSS1BorderInfo * GetBorderInfo(SvxBoxItemLine nLine, bool bCreate=true)
Definition: svxcss1.cxx:532
void CopyBorderInfo(SvxBoxItemLine nSrcLine, SvxBoxItemLine nDstLine, sal_uInt16 nWhat)
Definition: svxcss1.cxx:549
SvxCSS1SizeType m_eSizeType
Definition: svxcss1.hxx:140
void DestroyBorderInfos()
Definition: svxcss1.cxx:415
tools::Long m_nRightMargin
Definition: svxcss1.hxx:135
sal_uInt16 m_nBottomBorderDistance
Definition: svxcss1.hxx:124
sal_uInt16 m_nRightBorderDistance
Definition: svxcss1.hxx:126
sal_uInt16 m_nLeftBorderDistance
Definition: svxcss1.hxx:125
SvxCSS1LengthType m_eHeightType
Definition: svxcss1.hxx:138
SvxCSS1Position m_ePosition
Definition: svxcss1.hxx:121
SvxCSS1LengthType m_eWidthType
Definition: svxcss1.hxx:138
void Merge(const SvxCSS1PropertyInfo &rProp)
Definition: svxcss1.cxx:450
tools::Long m_nWidth
Definition: svxcss1.hxx:134
sal_uInt16 m_nTopBorderDistance
Definition: svxcss1.hxx:123
tools::Long m_nLeft
Definition: svxcss1.hxx:133
SvxCSS1LengthType m_eTopType
Definition: svxcss1.hxx:137
SvxAdjust m_eFloat
Definition: svxcss1.hxx:119
static constexpr sal_uInt16 UNSET_BORDER_DISTANCE
Definition: svxcss1.hxx:106
std::array< std::unique_ptr< SvxCSS1BorderInfo >, 4 > m_aBorderInfos
Definition: svxcss1.hxx:101
tools::Long m_nLeftMargin
Definition: svxcss1.hxx:135
SvxCSS1LengthType m_eLeftType
Definition: svxcss1.hxx:137
short GetTextFirstLineOffset() const
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
tools::Long GetLeft() const
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void SetPropLineSpace(const sal_uInt16 nProp)
void SetInterLineSpaceRule(SvxInterLineSpaceRule e)
void SetLineSpaceRule(SvxLineSpaceRule e)
void SetLineHeight(const sal_uInt16 nHeight)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
sal_uInt16 GetUpper() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetLower() const
void SetWidth(tools::Long nWidth)
void SetBorderLineStyle(SvxBorderLineStyle nNew)
rtl_TextEncoding GetCharSet() const
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
int nCount
URL aURL
OString top
DocumentType eType
sal_Int16 nValue
FontLineStyle
LINESTYLE_SINGLE
LINESTYLE_NONE
FontStrikeout
STRIKEOUT_SINGLE
STRIKEOUT_NONE
PITCH_DONTKNOW
FontItalic
ITALIC_NORMAL
ITALIC_NONE
FAMILY_DONTKNOW
WEIGHT_BOLD
WEIGHT_NORMAL
SvxFrameDirection
RubyPosition m_ePosition
#define HTML_BULLETCHAR_SQUARE
Definition: htmlnum.hxx:34
#define HTML_BULLETCHAR_CIRCLE
Definition: htmlnum.hxx:33
#define HTML_BULLETCHAR_DISC
Definition: htmlnum.hxx:32
OUString aName
void * p
sal_Int64 n
#define LANGUAGE_DONTKNOW
sal_uInt16 nPos
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
def position(n=-1)
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
size
int i
FontWeight
long Long
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
CSS1Token
Definition: parcss1.hxx:31
@ CSS1_PIXLENGTH
Definition: parcss1.hxx:39
@ CSS1_NUMBER
Definition: parcss1.hxx:36
@ CSS1_RGB
Definition: parcss1.hxx:62
@ CSS1_PERCENTAGE
Definition: parcss1.hxx:37
@ CSS1_URL
Definition: parcss1.hxx:61
@ CSS1_STRING
Definition: parcss1.hxx:35
@ CSS1_LENGTH
Definition: parcss1.hxx:38
@ CSS1_HEXCOLOR
Definition: parcss1.hxx:42
@ CSS1_IDENT
Definition: parcss1.hxx:34
sal_uIntPtr sal_uLong
a subexpression of a CSS1 declaration
Definition: parcss1.hxx:120
double GetNumber() const
Definition: parcss1.hxx:139
const CSS1Expression * GetNext() const
Definition: parcss1.hxx:148
CSS1Token GetType() const
Definition: parcss1.hxx:137
void Set(CSS1Token eTyp, const OUString &rVal, double nVal)
Definition: parcss1.hxx:151
void GetURL(OUString &rURL) const
Definition: parcss1.cxx:1212
sal_uInt32 GetULength() const
Definition: parcss1.hxx:157
sal_Unicode GetOp() const
Definition: parcss1.hxx:142
const OUString & GetString() const
Definition: parcss1.hxx:138
sal_Int32 GetSLength() const
Definition: parcss1.hxx:162
bool GetColor(Color &rRGB) const
Definition: parcss1.cxx:1238
sal_uInt16 nEnum
Definition: svxcss1.hxx:89
const char * pName
Definition: svxcss1.hxx:88
CSS1BorderStyle eStyle
Definition: svxcss1.cxx:307
sal_uInt16 nNamedWidth
Definition: svxcss1.cxx:306
sal_uInt16 nAbsWidth
Definition: svxcss1.cxx:305
void SetBorderLine(SvxBoxItemLine nLine, SvxBoxItem &rBoxItem) const
Definition: svxcss1.cxx:317
SAL_WARN_UNUSED_RESULT WhichRangesContainer MergeRange(sal_uInt16 nFrom, sal_uInt16 nTo) const
static SvxCSS1ItemIds aItemIds
Definition: svxcss1.cxx:300
static void ParseCSS1_left(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2886
static void ParseCSS1_border_width(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:2686
CSS1PropertyEnum const aFontSizeTable[]
Definition: svxcss1.cxx:72
static void ParseCSS1_border_style(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2731
static void ParseCSS1_padding_left(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2463
static void ParseCSS1_orphans(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:3026
CSS1PropertyEnum const aPositionTable[]
Definition: svxcss1.cxx:200
static void ParseCSS1_border_right(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:2762
static void MergeHori(SvxGraphicPosition &ePos, SvxGraphicPosition eHori)
Definition: svxcss1.cxx:1340
CSS1PropertyEnum const aBorderStyleTable[]
Definition: svxcss1.cxx:178
static void ParseCSS1_letter_spacing(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1769
CSS1PropertyEnum const aFloatTable[]
Definition: svxcss1.cxx:192
static void ParseCSS1_page_break_before(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2969
static void ParseCSS1_border_xxx_width(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &, SvxBoxItemLine nWhichLine)
Definition: svxcss1.cxx:2600
static void ParseCSS1_margin_top(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2123
CSS1PropertyEnum const aSizeTable[]
Definition: svxcss1.cxx:209
static void ParseCSS1_visibility(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:3061
static void ParseCSS1_background(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:1400
static void ParseCSS1_font_size(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:984
static void ParseCSS1_border_top(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:2754
static void ParseCSS1_font_variant(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1221
static void ParseCSS1_so_language(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:3041
static void ParseCSS1_top(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2894
CSS1PropertyEnum const aBorderWidthTable[]
Definition: svxcss1.cxx:164
static void ParseCSS1_widows(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:3011
static bool ParseCSS1_padding_xxx(const CSS1Expression *pExpr, SvxCSS1PropertyInfo &rPropInfo, SvxBoxItemLine nWhichLine)
Definition: svxcss1.cxx:2387
static void ParseCSS1_padding_top(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2447
static void ParseCSS1_padding_bottom(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2455
void(* FnParseCSS1Prop)(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
type of functions to parse CSS1 properties
Definition: svxcss1.cxx:67
static void ParseCSS1_float(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2794
static void ParseCSS1_background_color(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1539
static void ParseCSS1_border_left(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:2778
CSS1PropertyEnum const aTextAlignTable[]
Definition: svxcss1.cxx:155
static void ParseCSS1_line_height(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1585
static void ParseCSS1_margin_right(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2066
CSS1PropertyEnum const aTextTransformTable[]
Definition: svxcss1.cxx:114
static void ParseCSS1_margin_bottom(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2183
CSS1PropertyEnum const aDirectionTable[]
Definition: svxcss1.cxx:122
static void ParseCSS1_font_style(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1159
CSS1PropertyEnum const aPageBreakTable[]
Definition: svxcss1.cxx:217
static void ParseCSS1_width(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2870
static void ParseCSS1_text_transform(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1247
static void ParseCSS1_border_top_width(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:2654
static bool CSS1PropEntryFindCompare(CSS1PropEntry const &lhs, OUString const &s)
Definition: svxcss1.cxx:3149
CSS1PropertyEnum const aBGHoriPosTable[]
Definition: svxcss1.cxx:139
static void ParseCSS1_page_break_xxx(const CSS1Expression *pExpr, SvxCSS1PageBreak &rPBreak)
Definition: svxcss1.cxx:2955
static void ParseCSS1_border_left_width(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:2678
CSS1PropEntry const aCSS1PropFnTab[]
Definition: svxcss1.cxx:3085
static bool CSS1PropEntryCompare(const CSS1PropEntry &lhs, const CSS1PropEntry &rhs)
Definition: svxcss1.cxx:3144
#define CSS1_PROP_ENTRY(p)
Definition: svxcss1.cxx:3081
static void ParseCSS1_padding_right(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2471
CSS1PropertyEnum const aFontVariantTable[]
Definition: svxcss1.cxx:107
static void ParseCSS1_text_indent(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1943
CSS1PropertyEnum const aFontWeightTable[]
Definition: svxcss1.cxx:84
static void ParseCSS1_margin_left(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2005
CSS1PropertyEnum const aNumberStyleTable[]
Definition: svxcss1.cxx:227
static void ParseCSS1_font_family(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:1047
static void ParseCSS1_margin(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2243
static void ParseCSS1_border_right_width(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:2662
static void ParseCSS1_font_weight(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1116
static void ParseCSS1_page_break_after(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2977
static void ParseCSS1_border(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:2786
static void ParseCSS1_position(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2809
static void MergeVert(SvxGraphicPosition &ePos, SvxGraphicPosition eVert)
Definition: svxcss1.cxx:1370
static void ParseCSS1_size(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2903
static void ParseCSS1_column_count(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1298
static void ParseCSS1_height(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2878
CSS1PropertyEnum const aFontStyleTable[]
Definition: svxcss1.cxx:99
static void ParseCSS1_length(const CSS1Expression *pExpr, tools::Long &rLength, SvxCSS1LengthType &rLengthType, bool bHori)
Definition: svxcss1.cxx:2824
static void ParseCSS1_padding(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2479
CSS1PropertyEnum const aBGVertPosTable[]
Definition: svxcss1.cxx:147
static void ParseCSS1_font(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:1676
static void ParseCSS1_page_break_inside(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2985
sal_uInt16 const aBorderWidths[]
Definition: svxcss1.cxx:247
CSS1PropertyEnum const aBGRepeatTable[]
Definition: svxcss1.cxx:130
static void ParseCSS1_text_decoration(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1816
CSS1PropertyEnum const aBulletStyleTable[]
Definition: svxcss1.cxx:239
static void ParseCSS1_list_style_type(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1650
static void ParseCSS1_color(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1274
static void ParseCSS1_border_bottom_width(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:2670
static void ParseCSS1_border_color(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &)
Definition: svxcss1.cxx:2703
static void ParseCSS1_border_xxx(const CSS1Expression *pExpr, SfxItemSet &, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &, SvxBoxItemLine nWhichLine, bool bAll)
Definition: svxcss1.cxx:2504
static void ParseCSS1_border_bottom(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser &rParser)
Definition: svxcss1.cxx:2770
static void ParseCSS1_direction(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1315
static void ParseCSS1_text_align(const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &, const SvxCSS1Parser &)
Definition: svxcss1.cxx:1923
SvxCSS1PageBreak
Definition: svxcss1.hxx:66
@ SVX_CSS1_PBREAK_ALWAYS
Definition: svxcss1.hxx:69
@ SVX_CSS1_PBREAK_AUTO
Definition: svxcss1.hxx:68
@ SVX_CSS1_PBREAK_RIGHT
Definition: svxcss1.hxx:72
@ SVX_CSS1_PBREAK_LEFT
Definition: svxcss1.hxx:71
@ SVX_CSS1_PBREAK_AVOID
Definition: svxcss1.hxx:70
@ SVX_CSS1_PBREAK_NONE
Definition: svxcss1.hxx:67
#define SVX_CSS1_BORDERINFO_STYLE
Definition: svxcss1.hxx:96
#define SVX_CSS1_BORDERINFO_COLOR
Definition: svxcss1.hxx:95
SvxCSS1SizeType
Definition: svxcss1.hxx:57
@ SVX_CSS1_STYPE_NONE
Definition: svxcss1.hxx:58
@ SVX_CSS1_STYPE_LANDSCAPE
Definition: svxcss1.hxx:61
@ SVX_CSS1_STYPE_TWIP
Definition: svxcss1.hxx:60
@ SVX_CSS1_STYPE_AUTO
Definition: svxcss1.hxx:59
@ SVX_CSS1_STYPE_PORTRAIT
Definition: svxcss1.hxx:62
SvxCSS1Position
Definition: svxcss1.hxx:40
@ SVX_CSS1_POS_NONE
Definition: svxcss1.hxx:41
@ SVX_CSS1_POS_ABSOLUTE
Definition: svxcss1.hxx:43
@ SVX_CSS1_POS_STATIC
Definition: svxcss1.hxx:42
@ SVX_CSS1_POS_RELATIVE
Definition: svxcss1.hxx:44
SvxCSS1LengthType
Definition: svxcss1.hxx:48
@ SVX_CSS1_LTYPE_TWIP
Definition: svxcss1.hxx:51
@ SVX_CSS1_LTYPE_AUTO
Definition: svxcss1.hxx:50
@ SVX_CSS1_LTYPE_PERCENTAGE
Definition: svxcss1.hxx:52
@ SVX_CSS1_LTYPE_NONE
Definition: svxcss1.hxx:49
#define SVX_CSS1_BORDERINFO_WIDTH
Definition: svxcss1.hxx:94
SvxNumType
SVX_NUM_CHARS_LOWER_LETTER
SVX_NUM_CHARS_UPPER_LETTER
SVX_NUM_ROMAN_UPPER
SVX_NUM_ROMAN_LOWER
SVX_NUM_ARABIC
SvxCaseMap
SvxAdjust
SvxBoxItem & rBoxItem
unsigned char sal_uInt8
#define SAL_MAX_INT32
#define SAL_MIN_INT32
void * sal_Handle
sal_uInt64 left