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