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