LibreOffice Module sw (master) 1
css1atr.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 <string_view>
23
24#include <hintids.hxx>
25#include <comphelper/string.hxx>
26#include <vcl/svapp.hxx>
27#include <svl/whiter.hxx>
28#include <editeng/boxitem.hxx>
29#include <editeng/ulspitem.hxx>
30#include <editeng/udlnitem.hxx>
32#include <editeng/blinkitem.hxx>
33#include <editeng/cmapitem.hxx>
34#include <editeng/colritem.hxx>
35#include <editeng/fontitem.hxx>
36#include <editeng/fhgtitem.hxx>
37#include <editeng/postitem.hxx>
38#include <editeng/kernitem.hxx>
39#include <editeng/wghtitem.hxx>
40#include <editeng/lspcitem.hxx>
42#include <editeng/lrspitem.hxx>
43#include <editeng/brushitem.hxx>
45#include <editeng/keepitem.hxx>
46#include <editeng/widwitem.hxx>
47#include <editeng/spltitem.hxx>
48#include <editeng/orphitem.hxx>
50#include <svx/xoutbmp.hxx>
51#include <svx/svdobj.hxx>
52#include <editeng/langitem.hxx>
54#include <svtools/htmlout.hxx>
55#include <svtools/htmlkywd.hxx>
56#include <svl/urihelper.hxx>
59#include <charfmt.hxx>
60#include <fmtclds.hxx>
61#include <fmtcol.hxx>
62#include <fmtfsize.hxx>
63#include <fmtornt.hxx>
64#include <fmtpdsc.hxx>
65#include <fmtlsplt.hxx>
66#include <pagedesc.hxx>
67#include <fmtanchr.hxx>
68#include <docary.hxx>
69#include <pam.hxx>
70#include <viewsh.hxx>
71#include <viewopt.hxx>
72#include <swtable.hxx>
73// NOTES
74#include <ftninfo.hxx>
75#include <ftnidx.hxx>
76#include <txtftn.hxx>
77#include <fmtftn.hxx>
78// FOOTNOTES
79#include <doc.hxx>
82#include <swerror.h>
83#include <paratr.hxx>
84#include <frmatr.hxx>
85#include <poolfmt.hxx>
86#include "css1kywd.hxx"
87#include "wrthtml.hxx"
88#include "htmlnum.hxx"
89#include "css1atr.hxx"
90
92#include <numrule.hxx>
95
96#include <rtl/strbuf.hxx>
97#include <osl/diagnose.h>
98
99using namespace css;
101
102#define HTML_HEADSPACE (12*20)
103
104namespace {
105
106enum class Css1FrameSize {
107 NONE = 0x00,
108 Width = 0x01,
109 MinHeight = 0x02,
110 FixHeight = 0x04,
111 Pixel = 0x10,
112};
113
114}
115
116namespace o3tl {
117 template<> struct typed_flags<Css1FrameSize> : is_typed_flags<Css1FrameSize, 0x17> {};
118}
119
120#define DOT_LEADERS_MAX_WIDTH 18
121
122static Writer& OutCSS1_SwFormat( Writer& rWrt, const SwFormat& rFormat,
123 IDocumentStylePoolAccess /*SwDoc*/ *pDoc, SwDoc *pTemplate );
124static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rFormat,
125 IDocumentStylePoolAccess /*SwDoc*/ *pDoc, SwDoc *pTemplate,
126 sal_uInt16 nRefPoolId, bool bExtRef,
127 bool bPseudo=true );
128static Writer& OutCSS1_SwFootnoteInfo( Writer& rWrt, const SwEndNoteInfo& rInfo,
129 SwDoc *pDoc, bool bHasNotes, bool bEndNote );
130static void OutCSS1_SwFormatDropAttrs( SwHTMLWriter& rHWrt,
131 const SwFormatDrop& rDrop,
132 const SfxItemSet *pCharFormatItemSet=nullptr );
134 const SvxUnderlineItem *pUItem,
135 const SvxOverlineItem *pOItem,
136 const SvxCrossedOutItem *pCOItem,
137 const SvxBlinkItem *pBItem );
138static Writer& OutCSS1_SvxFontWeight( Writer& rWrt, const SfxPoolItem& rHt );
139static Writer& OutCSS1_SvxPosture( Writer& rWrt, const SfxPoolItem& rHt );
140static Writer& OutCSS1_SvxULSpace( Writer& rWrt, const SfxPoolItem& rHt );
141static Writer& OutCSS1_SvxLRSpace( Writer& rWrt, const SfxPoolItem& rHt );
143 const SvxULSpaceItem *pULSpace,
144 const SvxLRSpaceItem *pLRSpace );
146 const SfxItemSet& rItemSet );
147static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt,
148 sw::Css1Background nMode,
149 const OUString *pGraphicName );
150static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt );
151static Writer& OutCSS1_SwFormatFrameSize( Writer& rWrt, const SfxPoolItem& rHt,
152 Css1FrameSize nMode );
154 const SfxItemSet& rItemSet,
155 bool bDeep );
156static Writer& OutCSS1_SwFormatLayoutSplit( Writer& rWrt, const SfxPoolItem& rHt );
157
158namespace
159{
160
161const char sCSS1_rule_end[] = " }";
162const char sCSS1_span_tag_end[] = "\">";
163const char cCSS1_style_opt_end = '\"';
164
165const char* const sHTML_FTN_fontheight = "57%";
166
167OString lclConvToHex(sal_uInt16 nHex)
168{
169 char aNToABuf[] = "00";
170
171 // set pointer to end of buffer
172 char *pStr = aNToABuf + (sizeof(aNToABuf)-1);
173 for( sal_uInt8 n = 0; n < 2; ++n )
174 {
175 *(--pStr) = static_cast<char>(nHex & 0xf ) + 48;
176 if( *pStr > '9' )
177 *pStr += 39;
178 nHex >>= 4;
179 }
180
181 return OString(aNToABuf, 2);
182}
183}
184
185bool IgnorePropertyForReqIF(bool bReqIF, std::string_view rProperty, std::string_view rValue,
186 std::optional<sw::Css1Background> oMode)
187{
188 if (!bReqIF)
189 return false;
190
191 if (oMode.has_value() && *oMode != sw::Css1Background::TableCell)
192 {
193 // Table or row.
194 if (rProperty == sCSS1_P_background && rValue == "transparent")
195 {
196 // This is the default already.
197 return true;
198 }
199
200 return false;
201 }
202
203 // Only allow these two keys, nothing else in ReqIF mode.
204 if (rProperty == sCSS1_P_text_decoration)
205 {
206 // Deny other text-decoration values (e.g. "none").
207 if (rValue == "underline" || rValue == "line-through")
208 {
209 return false;
210 }
211
212 return true;
213 }
214
215 if (rProperty == sCSS1_P_color)
216 return false;
217
218 return true;
219}
220
221OString GetCSS1_Color(const Color& rColor)
222{
223 return "#" + lclConvToHex(rColor.GetRed()) + lclConvToHex(rColor.GetGreen()) + lclConvToHex(rColor.GetBlue());
224}
225
226namespace {
227
228class SwCSS1OutMode
229{
230 SwHTMLWriter& rWrt;
231 sal_uInt16 nOldMode;
232
233public:
234
235 SwCSS1OutMode( SwHTMLWriter& rHWrt, sal_uInt16 nMode,
236 const OUString *pSelector ) :
237 rWrt( rHWrt ),
238 nOldMode( rHWrt.m_nCSS1OutMode )
239 {
240 rWrt.m_nCSS1OutMode = nMode;
241 rWrt.m_bFirstCSS1Property = true;
242 if( pSelector )
243 rWrt.m_aCSS1Selector = *pSelector;
244 }
245
246 ~SwCSS1OutMode()
247 {
248 rWrt.m_nCSS1OutMode = nOldMode;
249 }
250};
251
252}
253
254void SwHTMLWriter::OutCSS1_Property( const char *pProp,
255 std::string_view sVal,
256 const OUString *pSVal,
257 std::optional<sw::Css1Background> oMode )
258{
259 OString aPropertyValue(sVal);
260 if (aPropertyValue.isEmpty() && pSVal)
261 {
262 aPropertyValue = pSVal->toUtf8();
263 }
264 if (IgnorePropertyForReqIF(mbReqIF, pProp, aPropertyValue, oMode))
265 return;
266
267 OStringBuffer sOut;
268
270 {
271 m_bFirstCSS1Rule = false;
272 OutNewLine();
273 sOut.append("<" + GetNamespace() + OOO_STRING_SVTOOLS_HTML_style " "
274 OOO_STRING_SVTOOLS_HTML_O_type "=\"text/css\">");
275 // Optional CSS2 code for dot leaders (dotted line between the Table of Contents titles and page numbers):
276 // (More information: http://www.w3.org/Style/Examples/007/leaders.en.html)
277 //
278 // p.leaders {
279 // /* FIXME:
280 // (1) dots line up vertically only in the paragraphs with the same alignment/level
281 // (2) max-width = 18 cm instead of 80em; possible improvement with the new CSS3 calc() */
282 // max-width: 18cm; /* note: need to overwrite max-width with max-width - border-left_of_the_actual_paragraph */
283 // padding: 0;
284 // overflow-x: hidden;
285 // line-height: 120%; /* note: avoid HTML scrollbars and missing descenders of the letters */
286 // }
287 // p.leaders:after {
288 // float: left;
289 // width: 0;
290 // white-space: nowrap;
291 // content: ". . . . . . . . . . . . . . . . . . ...";
292 // }
293 // p.leaders span:first-child {
294 // padding-right: 0.33em;
295 // background: white;
296 // }
297 // p.leaders span + span {
298 // float: right;
299 // padding-left: 0.33em;
300 // background: white;
301 // position: relative;
302 // z-index: 1
303 // }
304
305 if (m_bCfgPrintLayout) {
306 sOut.append(
307 "p." sCSS2_P_CLASS_leaders "{max-width:" + OString::number(DOT_LEADERS_MAX_WIDTH) +
308 "cm;padding:0;overflow-x:hidden;line-height:120%}"
309 "p." sCSS2_P_CLASS_leaders ":after{float:left;width:0;white-space:nowrap;content:\"");
310 for (int i = 0; i < 100; i++ )
311 sOut.append(". ");
312 sOut.append(
313 "\"}p." sCSS2_P_CLASS_leaders " span:first-child{padding-right:0.33em;background:white}"
314 "p." sCSS2_P_CLASS_leaders " span+span{float:right;padding-left:0.33em;"
315 "background:white;position:relative;z-index:1}");
316 }
317 Strm().WriteOString( sOut );
318 sOut.setLength(0);
319
321 }
322
324 {
326 {
329 if( m_bTagOn )
330 {
331 sOut.append("<" + GetNamespace() + OOO_STRING_SVTOOLS_HTML_span
333 }
334 else
335 {
336 HTMLOutFuncs::Out_AsciiTag( Strm(), OStringConcatenation(GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false );
337 return;
338 }
339 break;
340
342 {
343 OutNewLine();
344 sOut.append(OUStringToOString(m_aCSS1Selector, RTL_TEXTENCODING_UTF8) + " { ");
345 }
346 break;
347
349 sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_style "=\"");
350 break;
351 }
352 m_bFirstCSS1Property = false;
353 }
354 else
355 {
356 sOut.append("; ");
357 }
358
359 sOut.append(pProp + OString::Concat(": "));
361 {
362 // for STYLE-Option encode string
363 Strm().WriteOString( sOut );
364 sOut.setLength(0);
365 if( !sVal.empty() )
366 HTMLOutFuncs::Out_String( Strm(), OUString::createFromAscii(sVal) );
367 else if( pSVal )
368 HTMLOutFuncs::Out_String( Strm(), *pSVal );
369 }
370 else
371 {
372 // for STYLE-Tag print string directly
373 if( !sVal.empty() )
374 sOut.append(sVal);
375 else if( pSVal )
376 sOut.append(OUStringToOString(*pSVal, RTL_TEXTENCODING_UTF8));
377 }
378
379 if (!sOut.isEmpty())
380 Strm().WriteOString( sOut );
381}
382
383static void AddUnitPropertyValue(OStringBuffer &rOut, tools::Long nVal,
384 FieldUnit eUnit)
385{
386 if( nVal < 0 )
387 {
388 // special-case sign symbol
389 nVal = -nVal;
390 rOut.append('-');
391 }
392
393 o3tl::Length eTo;
394 int nFac; // used to get specific number of decimals
395 const char *pUnit;
396 switch( eUnit )
397 {
398 case FieldUnit::MM_100TH:
399 OSL_ENSURE( FieldUnit::MM == eUnit, "Measuring unit not supported" );
400 [[fallthrough]];
401 case FieldUnit::MM:
402 eTo = o3tl::Length::mm;
403 nFac = 100;
404 pUnit = sCSS1_UNIT_mm;
405 break;
406
407 case FieldUnit::M:
408 case FieldUnit::KM:
409 OSL_ENSURE( FieldUnit::CM == eUnit, "Measuring unit not supported" );
410 [[fallthrough]];
411 case FieldUnit::CM:
412 eTo = o3tl::Length::cm;
413 nFac = 100;
414 pUnit = sCSS1_UNIT_cm;
415 break;
416
417 case FieldUnit::TWIP:
418 OSL_ENSURE( FieldUnit::POINT == eUnit, "Measuring unit not supported" );
419 [[fallthrough]];
420 case FieldUnit::POINT:
421 eTo = o3tl::Length::pt;
422 nFac = 10;
423 pUnit = sCSS1_UNIT_pt;
424 break;
425
426 case FieldUnit::PICA:
427 eTo = o3tl::Length::pc;
428 nFac = 100;
429 pUnit = sCSS1_UNIT_pc;
430 break;
431
432 case FieldUnit::NONE:
433 case FieldUnit::FOOT:
434 case FieldUnit::MILE:
435 case FieldUnit::CUSTOM:
436 case FieldUnit::PERCENT:
437 case FieldUnit::INCH:
438 default:
439 OSL_ENSURE( FieldUnit::INCH == eUnit, "Measuring unit not supported" );
440 eTo = o3tl::Length::in;
441 nFac = 100;
442 pUnit = sCSS1_UNIT_inch;
443 break;
444 }
445
446 sal_Int64 nResult = o3tl::convert(nVal * nFac, o3tl::Length::twip, eTo);
447 rOut.append(nResult/nFac);
448 if ((nResult % nFac) != 0)
449 {
450 rOut.append('.');
451 while (nFac > 1 && (nResult % nFac) != 0)
452 {
453 nFac /= 10;
454 rOut.append((nResult / nFac) % 10);
455 }
456 }
457
458 rOut.append(pUnit);
459}
460
461void SwHTMLWriter::OutCSS1_UnitProperty( const char *pProp, tools::Long nVal )
462{
463 OStringBuffer sOut;
465 OutCSS1_PropertyAscii(pProp, sOut);
466}
467
469 bool bVert )
470{
471 OString sOut(OString::number(ToPixel(nVal,bVert)) + sCSS1_UNIT_px);
472 OutCSS1_PropertyAscii(pProp, sOut);
473}
474
476{
477 m_bFirstCSS1Rule = true;
478
479// Feature: PrintExt
481 {
482 const SwPageDesc *pFirstPageDesc = nullptr;
483 sal_uInt16 nFirstRefPoolId = RES_POOLPAGE_HTML;
485
486 // First we try to guess how the document is constructed.
487 // Allowed are only the templates: HTML, 1st page, left page, and right page.
488 // A first page is only exported, if it matches the template "1st page".
489 // Left and right pages are only exported, if their templates are linked.
490 // If other templates are used, only very simple cases are exported.
491 const SwPageDesc *pPageDesc = &rPageDesc;
492 const SwPageDesc *pFollow = rPageDesc.GetFollow();
493 if( RES_POOLPAGE_FIRST == pPageDesc->GetPoolFormatId() &&
494 pFollow != pPageDesc &&
495 !IsPoolUserFormat( pFollow->GetPoolFormatId() ) )
496 {
497 // the document has a first page
498 pFirstPageDesc = pPageDesc;
499 pPageDesc = pFollow;
500 pFollow = pPageDesc->GetFollow();
501 }
502
504 if( pPageDesc == pFollow )
505 {
506 // The document is one-sided; no matter what page, we do not create a 2-sided doc.
507 // The attribute is exported relative to the HTML page template.
508 OutCSS1_SwPageDesc( *this, *pPageDesc, pStylePoolAccess, m_xTemplate.get(),
509 RES_POOLPAGE_HTML, true, false );
510 nFirstRefPoolId = pFollow->GetPoolFormatId();
511 }
512 else if( (RES_POOLPAGE_LEFT == pPageDesc->GetPoolFormatId() &&
513 RES_POOLPAGE_RIGHT == pFollow->GetPoolFormatId()) ||
514 (RES_POOLPAGE_RIGHT == pPageDesc->GetPoolFormatId() &&
515 RES_POOLPAGE_LEFT == pFollow->GetPoolFormatId()) )
516 {
517 // the document is double-sided
518 OutCSS1_SwPageDesc( *this, *pPageDesc, pStylePoolAccess, m_xTemplate.get(),
519 RES_POOLPAGE_HTML, true );
520 OutCSS1_SwPageDesc( *this, *pFollow, pStylePoolAccess, m_xTemplate.get(),
521 RES_POOLPAGE_HTML, true );
522 nFirstRefPoolId = RES_POOLPAGE_RIGHT;
524 }
525 // other cases we miss
526
527 if( pFirstPageDesc )
528 OutCSS1_SwPageDesc( *this, *pFirstPageDesc, pStylePoolAccess, m_xTemplate.get(),
529 nFirstRefPoolId, false );
530 }
531
532 // The text body style has to be exported always (if it is changed compared
533 // to the template), because it is used as reference for any style
534 // that maps to <P>, and that's especially the standard style
536
537 // the Default-TextStyle is not also exported !!
538 // 0-Style is the Default; is never exported !!
539 const size_t nTextFormats = m_pDoc->GetTextFormatColls()->size();
540 for( size_t i = 1; i < nTextFormats; ++i )
541 {
542 const SwTextFormatColl* pColl = (*m_pDoc->GetTextFormatColls())[i];
543 sal_uInt16 nPoolId = pColl->GetPoolFormatId();
544 if( nPoolId == RES_POOLCOLL_TEXT || m_pDoc->IsUsed( *pColl ) )
546 }
547
548 // the Default-TextStyle is not also exported !!
549 const size_t nCharFormats = m_pDoc->GetCharFormats()->size();
550 for( size_t i = 1; i < nCharFormats; ++i )
551 {
552 const SwCharFormat *pCFormat = (*m_pDoc->GetCharFormats())[i];
553 sal_uInt16 nPoolId = pCFormat->GetPoolFormatId();
554 if( nPoolId == RES_POOLCHR_INET_NORMAL ||
555 nPoolId == RES_POOLCHR_INET_VISIT ||
556 m_pDoc->IsUsed( *pCFormat ) )
557 OutCSS1_SwFormat( *this, *pCFormat, &m_pDoc->getIDocumentStylePoolAccess(), m_xTemplate.get() );
558 }
559
560 bool bHasEndNotes {false};
561 bool bHasFootNotes {false};
562 const SwFootnoteIdxs& rIdxs = m_pDoc->GetFootnoteIdxs();
563 for( auto pIdx : rIdxs )
564 {
565 if( pIdx->GetFootnote().IsEndNote() )
566 {
567 bHasEndNotes = true;
568 if (bHasFootNotes)
569 break;
570 }
571 else
572 {
573 bHasFootNotes = true;
574 if (bHasEndNotes)
575 break;
576 }
577 }
578 OutCSS1_SwFootnoteInfo( *this, m_pDoc->GetFootnoteInfo(), m_pDoc, bHasFootNotes, false );
579 OutCSS1_SwFootnoteInfo( *this, m_pDoc->GetEndNoteInfo(), m_pDoc, bHasEndNotes, true );
580
581 if( !m_bFirstCSS1Rule )
582 {
584
585 OutNewLine();
586 HTMLOutFuncs::Out_AsciiTag( Strm(), OStringConcatenation(GetNamespace() + OOO_STRING_SVTOOLS_HTML_style), false );
587 }
588 else
589 {
590 m_bFirstCSS1Rule = false;
591 }
592
595}
596
597// if pPseudo is set, Styles-Sheets will be exported;
598// otherwise we only search for Token and Class for a Format
599sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFormat *pFormat, OString& rToken,
600 OUString& rClass, sal_uInt16& rRefPoolId,
601 OUString *pPseudo )
602{
603 sal_uInt16 nDeep = 0;
604 rToken.clear();
605 rClass.clear();
606 rRefPoolId = 0;
607 if( pPseudo )
608 pPseudo->clear();
609
610 bool bChrFormat = RES_CHRFMT==pFormat->Which();
611
612 // search formats above for the nearest standard or HTML-Tag template
613 const SwFormat *pPFormat = pFormat;
614 while( pPFormat && !pPFormat->IsDefault() )
615 {
616 bool bStop = false;
617 sal_uInt16 nPoolId = pPFormat->GetPoolFormatId();
618 if( USER_FMT & nPoolId )
619 {
620 // user templates
621 const OUString& aNm(pPFormat->GetName());
622
623 if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_blockquote)
624 {
625 rRefPoolId = RES_POOLCOLL_HTML_BLOCKQUOTE;
626 rToken = OString(OOO_STRING_SVTOOLS_HTML_blockquote);
627 }
628 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_citation)
629 {
630 rRefPoolId = RES_POOLCHR_HTML_CITATION;
631 rToken = OString(OOO_STRING_SVTOOLS_HTML_citation);
632 }
633 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_code)
634 {
635 rRefPoolId = RES_POOLCHR_HTML_CODE;
636 rToken = OString(OOO_STRING_SVTOOLS_HTML_code);
637 }
638 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_definstance)
639 {
640 rRefPoolId = RES_POOLCHR_HTML_DEFINSTANCE;
641 rToken = OString(OOO_STRING_SVTOOLS_HTML_definstance);
642 }
643 else if (!bChrFormat && (aNm == OOO_STRING_SVTOOLS_HTML_dd ||
645 {
646 sal_uInt16 nDefListLvl = GetDefListLvl(aNm, nPoolId);
647 // Export the templates DD 1/DT 1,
648 // but none of their derived templates,
649 // also not DD 2/DT 2 etc.
650 if (nDefListLvl)
651 {
652 if (pPseudo && (nDeep || (nDefListLvl & 0x0fff) > 1))
653 {
654 bStop = true;
655 }
656 else if (nDefListLvl & HTML_DLCOLL_DD)
657 {
658 rRefPoolId = RES_POOLCOLL_HTML_DD;
659 rToken = OString(OOO_STRING_SVTOOLS_HTML_dd);
660 }
661 else
662 {
663 rRefPoolId = RES_POOLCOLL_HTML_DT;
664 rToken = OString(OOO_STRING_SVTOOLS_HTML_dt);
665 }
666 }
667 }
668 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_emphasis)
669 {
670 rRefPoolId = RES_POOLCHR_HTML_EMPHASIS;
671 rToken = OString(OOO_STRING_SVTOOLS_HTML_emphasis);
672 }
673 else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_horzrule)
674 {
675 // do not export HR !
676 bStop = (nDeep==0);
677 }
678 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_keyboard)
679 {
680 rRefPoolId = RES_POOLCHR_HTML_KEYBOARD;
681 rToken = OString(OOO_STRING_SVTOOLS_HTML_keyboard);
682 }
683 else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_listing)
684 {
685 // Export Listings as PRE or PRE-derived template
686 rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
687 rRefPoolId = RES_POOLCOLL_HTML_PRE;
688 nDeep = CSS1_FMT_CMPREF;
689 }
690 else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_preformtxt)
691 {
692 rRefPoolId = RES_POOLCOLL_HTML_PRE;
693 rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
694 }
695 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_sample)
696 {
697 rRefPoolId = RES_POOLCHR_HTML_SAMPLE;
698 rToken = OString(OOO_STRING_SVTOOLS_HTML_sample);
699 }
700 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_strong)
701 {
702 rRefPoolId = RES_POOLCHR_HTML_STRONG;
703 rToken = OString(OOO_STRING_SVTOOLS_HTML_strong);
704 }
705 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_teletype)
706 {
707 rRefPoolId = RES_POOLCHR_HTML_TELETYPE;
708 rToken = OString(OOO_STRING_SVTOOLS_HTML_teletype);
709 }
710 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_variable)
711 {
712 rRefPoolId = RES_POOLCHR_HTML_VARIABLE;
713 rToken = OString(OOO_STRING_SVTOOLS_HTML_variable);
714 }
715 else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_xmp)
716 {
717 // export XMP as PRE (but not the template as Style)
718 rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
719 rRefPoolId = RES_POOLCOLL_HTML_PRE;
720 nDeep = CSS1_FMT_CMPREF;
721 }
722
723 // if a PoolId is set, the Name of the template is that of the related Token
724 OSL_ENSURE( (rRefPoolId != 0) == (!rToken.isEmpty()),
725 "Token missing" );
726 }
727 else
728 {
729 // Pool templates
730 switch( nPoolId )
731 {
732 // paragraph templates
735 // do not export this template
736 bStop = (nDeep==0);
737 break;
739 rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
740 break;
742 rToken = OString(OOO_STRING_SVTOOLS_HTML_head1);
743 break;
745 rToken = OString(OOO_STRING_SVTOOLS_HTML_head2);
746 break;
748 rToken = OString(OOO_STRING_SVTOOLS_HTML_head3);
749 break;
751 rToken = OString(OOO_STRING_SVTOOLS_HTML_head4);
752 break;
754 rToken = OString(OOO_STRING_SVTOOLS_HTML_head5);
755 break;
757 rToken = OString(OOO_STRING_SVTOOLS_HTML_head6);
758 break;
760 rToken = OString(OOO_STRING_SVTOOLS_HTML_address);
761 break;
763 rToken = OString(OOO_STRING_SVTOOLS_HTML_blockquote);
764 break;
766 rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
767 break;
768
770 rToken = OString(OOO_STRING_SVTOOLS_HTML_dd);
771 break;
773 rToken = OString(OOO_STRING_SVTOOLS_HTML_dt);
774 break;
775
777 if( pPseudo )
778 {
781 }
782 else
784 break;
786 if( pPseudo )
787 {
790 }
791 else
792 rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
793 break;
795 // do not export HR !
796 bStop = (nDeep==0);
797 break;
799 if( !nDeep )
800 {
801 rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
803 rRefPoolId = RES_POOLCOLL_TEXT;
804 nDeep = CSS1_FMT_CMPREF;
805 }
806 break;
808 if( !nDeep )
809 {
810 rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
812 rRefPoolId = RES_POOLCOLL_TEXT;
813 nDeep = CSS1_FMT_CMPREF;
814 }
815 break;
816
817 // character templates
819 rToken = OString(OOO_STRING_SVTOOLS_HTML_emphasis);
820 break;
822 rToken = OString(OOO_STRING_SVTOOLS_HTML_citation);
823 break;
825 rToken = OString(OOO_STRING_SVTOOLS_HTML_strong);
826 break;
828 rToken = OString(OOO_STRING_SVTOOLS_HTML_code);
829 break;
831 rToken = OString(OOO_STRING_SVTOOLS_HTML_sample);
832 break;
834 rToken = OString(OOO_STRING_SVTOOLS_HTML_keyboard);
835 break;
837 rToken = OString(OOO_STRING_SVTOOLS_HTML_variable);
838 break;
840 rToken = OString(OOO_STRING_SVTOOLS_HTML_definstance);
841 break;
843 rToken = OString(OOO_STRING_SVTOOLS_HTML_teletype);
844 break;
845
847 if( pPseudo )
848 {
849 rToken = OString(OOO_STRING_SVTOOLS_HTML_anchor);
850 *pPseudo = OStringToOUString( sCSS1_link, RTL_TEXTENCODING_ASCII_US );
851 }
852 break;
854 if( pPseudo )
855 {
856 rToken = OString(OOO_STRING_SVTOOLS_HTML_anchor);
857 *pPseudo = OStringToOUString( sCSS1_visited, RTL_TEXTENCODING_ASCII_US );
858 }
859 break;
860 }
861
862 // if a token is set, PoolId contains the related template
863 if( !rToken.isEmpty() && !rRefPoolId )
864 rRefPoolId = nPoolId;
865 }
866
867 if( !rToken.isEmpty() || bStop )
868 {
869 // stop if a HTML-Tag template was found
870 break;
871 }
872 else
873 {
874 // continue otherwise
875 nDeep++;
876 pPFormat = pPFormat->DerivedFrom();
877 }
878 }
879
880 if( !rToken.isEmpty() )
881 {
882 // this is a HTML-Tag template
883 if( !nDeep )
884 nDeep = CSS1_FMT_ISTAG;
885 }
886 else
887 {
888 // this is not a HTML-Tag template nor derived from one
889 nDeep = 0;
890 }
891 if( nDeep > 0 && nDeep < CSS1_FMT_SPECIAL )
892 {
893 // If the template is derived from a HTML template,
894 // we export it as <TOKEN>.<CLASS>, otherwise as .<CLASS>.
895 // <CLASS> is the name of the template after removing all characters
896 // before and including the first '.'
897 rClass = pFormat->GetName();
898 sal_Int32 nPos = rClass.indexOf( '.' );
899 if( nPos >= 0 && rClass.getLength() > nPos+1 )
900 {
901 rClass = rClass.replaceAt( 0, nPos+1, u"" );
902 }
903
904 rClass = GetAppCharClass().lowercase( rClass );
905 rClass = rClass.replaceAll( ".", "-" );
906 rClass = rClass.replaceAll( " ", "-" );
907 rClass = rClass.replaceAll( "_", "-" );
908 }
909
910 return nDeep;
911}
912
913static sal_uInt16 GetCSS1Selector( const SwFormat *pFormat, OUString& rSelector,
914 sal_uInt16& rRefPoolId )
915{
916 OString aToken;
917 OUString aClass;
918 OUString aPseudo;
919
920 sal_uInt16 nDeep = SwHTMLWriter::GetCSS1Selector( pFormat, aToken, aClass,
921 rRefPoolId, &aPseudo );
922 if( nDeep )
923 {
924 if( !aToken.isEmpty() )
925 rSelector = OStringToOUString(aToken, RTL_TEXTENCODING_ASCII_US);
926 else
927 rSelector.clear();
928
929 if( !aClass.isEmpty() )
930 rSelector += "." + aClass;
931 if( !aPseudo.isEmpty() )
932 rSelector += ":" + aPseudo;
933 }
934
935 return nDeep;
936}
937
938const SwFormat *SwHTMLWriter::GetTemplateFormat( sal_uInt16 nPoolFormatId,
939 IDocumentStylePoolAccess* pTemplate /*SwDoc *pTemplate*/)
940{
941 const SwFormat *pRefFormat = nullptr;
942
943 if( pTemplate )
944 {
945 OSL_ENSURE( !(USER_FMT & nPoolFormatId),
946 "No user templates found" );
947 if( POOLGRP_NOCOLLID & nPoolFormatId )
948 pRefFormat = pTemplate->GetCharFormatFromPool( nPoolFormatId );
949 else
950 pRefFormat = pTemplate->GetTextCollFromPool( nPoolFormatId, false );
951 }
952
953 return pRefFormat;
954}
955
956const SwFormat *SwHTMLWriter::GetParentFormat( const SwFormat& rFormat, sal_uInt16 nDeep )
957{
958 OSL_ENSURE( nDeep != USHRT_MAX, "Called GetParent for HTML-template!" );
959 const SwFormat *pRefFormat = nullptr;
960
961 if( nDeep > 0 )
962 {
963 // get the pointer for the HTML-Tag template, from which the template is derived
964 pRefFormat = &rFormat;
965 for( sal_uInt16 i=nDeep; i>0; i-- )
966 pRefFormat = pRefFormat->DerivedFrom();
967
968 if( pRefFormat && pRefFormat->IsDefault() )
969 pRefFormat = nullptr;
970 }
971
972 return pRefFormat;
973}
974
976{
977 return static_cast<const SvxFontItem &>(r1).GetFamilyName() ==
978 static_cast<const SvxFontItem &>(r2).GetFamilyName() &&
979 static_cast<const SvxFontItem &>(r1).GetFamily() ==
980 static_cast<const SvxFontItem &>(r2).GetFamily();
981}
982
984 const SfxItemSet& rRefItemSet,
985 bool bSetDefaults,
986 bool bClearSame,
987 const SfxItemSet *pRefScriptItemSet )
988{
989 OSL_ENSURE( bSetDefaults || bClearSame,
990 "SwHTMLWriter::SubtractItemSet: No action for this Flag" );
991 SfxItemSet aRefItemSet( *rRefItemSet.GetPool(), rRefItemSet.GetRanges() );
992 aRefItemSet.Set( rRefItemSet );
993
994 // compare with the Attr-Set of the template
995 SfxWhichIter aIter( rItemSet );
996 sal_uInt16 nWhich = aIter.FirstWhich();
997 while( nWhich )
998 {
999 const SfxPoolItem *pRefItem, *pItem;
1000 bool bItemSet = ( SfxItemState::SET ==
1001 aIter.GetItemState( false, &pItem) );
1002 bool bRefItemSet;
1003
1004 if( pRefScriptItemSet )
1005 {
1006 switch( nWhich )
1007 {
1008 case RES_CHRATR_FONT:
1011 case RES_CHRATR_POSTURE:
1012 case RES_CHRATR_WEIGHT:
1023 bRefItemSet = ( SfxItemState::SET ==
1024 pRefScriptItemSet->GetItemState( nWhich, true, &pRefItem) );
1025 break;
1026 default:
1027 bRefItemSet = ( SfxItemState::SET ==
1028 aRefItemSet.GetItemState( nWhich, false, &pRefItem) );
1029 break;
1030 }
1031 }
1032 else
1033 {
1034 bRefItemSet = ( SfxItemState::SET ==
1035 aRefItemSet.GetItemState( nWhich, false, &pRefItem) );
1036 }
1037
1038 if( bItemSet )
1039 {
1040 if( (bClearSame || pRefScriptItemSet) && bRefItemSet &&
1041 ( *pItem == *pRefItem ||
1042 ((RES_CHRATR_FONT == nWhich ||
1043 RES_CHRATR_CJK_FONT == nWhich ||
1044 RES_CHRATR_CTL_FONT == nWhich) &&
1045 swhtml_css1atr_equalFontItems( *pItem, *pRefItem )) ) )
1046 {
1047 // the Attribute is in both templates with the same value
1048 // and does not need to be exported
1049 rItemSet.ClearItem( nWhich );
1050 }
1051 }
1052 else
1053 {
1054 if( (bSetDefaults || pRefScriptItemSet) && bRefItemSet )
1055 {
1056 // the Attribute exists only in the reference; the default
1057 // might have to be exported
1058 rItemSet.Put( rItemSet.GetPool()->GetDefaultItem(nWhich) );
1059 }
1060 }
1061
1062 nWhich = aIter.NextWhich();
1063 }
1064}
1065
1067 OUString& rNames,
1068 sal_Unicode cQuote, bool bGeneric )
1069{
1070 rNames.clear();
1071 const OUString& rName = rFontItem.GetFamilyName();
1072 bool bContainsKeyword = false;
1073 if( !rName.isEmpty() )
1074 {
1075 sal_Int32 nStrPos = 0;
1076 while( nStrPos != -1 )
1077 {
1078 OUString aName = rName.getToken( 0, ';', nStrPos );
1080 if( aName.isEmpty() )
1081 continue;
1082
1083 bool bIsKeyword = false;
1084 switch( aName[0] )
1085 {
1086 case 'c':
1087 case 'C':
1088 bIsKeyword = aName.equalsIgnoreAsciiCaseAscii( sCSS1_PV_cursive );
1089 break;
1090
1091 case 'f':
1092 case 'F':
1093 bIsKeyword = aName.equalsIgnoreAsciiCaseAscii( sCSS1_PV_fantasy );
1094 break;
1095
1096 case 'm':
1097 case 'M':
1098 bIsKeyword = aName.equalsIgnoreAsciiCaseAscii( sCSS1_PV_monospace );
1099 break;
1100
1101 case 's':
1102 case 'S':
1103 bIsKeyword =
1104 aName.equalsIgnoreAsciiCaseAscii( sCSS1_PV_serif ) ||
1105 aName.equalsIgnoreAsciiCaseAscii( sCSS1_PV_sans_serif );
1106 break;
1107 }
1108
1109 bContainsKeyword |= bIsKeyword;
1110
1111 if( !rNames.isEmpty() )
1112 rNames += ", ";
1113 if( cQuote && !bIsKeyword )
1114 rNames += OUStringChar( cQuote );
1115 rNames += aName;
1116 if( cQuote && !bIsKeyword )
1117 rNames += OUStringChar( cQuote );
1118 }
1119 }
1120
1121 if( bContainsKeyword || !bGeneric )
1122 return;
1123
1124 const char *pStr = nullptr;
1125 switch( rFontItem.GetFamily() )
1126 {
1127 case FAMILY_ROMAN: pStr = sCSS1_PV_serif; break;
1128 case FAMILY_SWISS: pStr = sCSS1_PV_sans_serif; break;
1129 case FAMILY_SCRIPT: pStr = sCSS1_PV_cursive; break;
1130 case FAMILY_DECORATIVE: pStr = sCSS1_PV_fantasy; break;
1131 case FAMILY_MODERN: pStr = sCSS1_PV_monospace; break;
1132 default:
1133 ;
1134 }
1135
1136 if( pStr )
1137 {
1138 if( !rNames.isEmpty() )
1139 rNames += ", ";
1140 rNames += OStringToOUString( pStr, RTL_TEXTENCODING_ASCII_US );
1141 }
1142}
1143
1145 bool bCheckDropCap )
1146{
1147 static const sal_uInt16 aWhichIds[] =
1148 {
1154 0, 0, 0
1155 };
1156
1157 for( int i=0; aWhichIds[i]; i += 3 )
1158 {
1159 const SfxPoolItem *pItem = nullptr, *pItemCJK = nullptr, *pItemCTL = nullptr, *pTmp;
1160 int nItemCount = 0;
1161 if( SfxItemState::SET == rItemSet.GetItemState( aWhichIds[i], false,
1162 &pTmp ) )
1163 {
1164 pItem = pTmp;
1165 nItemCount++;
1166 }
1167 if( SfxItemState::SET == rItemSet.GetItemState( aWhichIds[i+1], false,
1168 &pTmp ) )
1169 {
1170 pItemCJK = pTmp;
1171 nItemCount++;
1172 }
1173 if( SfxItemState::SET == rItemSet.GetItemState( aWhichIds[i+2], false,
1174 &pTmp ) )
1175 {
1176 pItemCTL = pTmp;
1177 nItemCount++;
1178 }
1179
1180 // If some of the items are set, but not all, we need script dependent
1181 // styles
1182 if( nItemCount > 0 && nItemCount < 3 )
1183 return true;
1184
1185 if( 3 == nItemCount )
1186 {
1187 // If all items are set, but some of them have different values,
1188 // we need script dependent styles, too. For font items, we have
1189 // to take care about their special HTML/CSS1 representation.
1190 if( RES_CHRATR_FONT == aWhichIds[i] )
1191 {
1192 if( !swhtml_css1atr_equalFontItems( *pItem, *pItemCJK ) ||
1193 !swhtml_css1atr_equalFontItems( *pItem, *pItemCTL ) ||
1194 !swhtml_css1atr_equalFontItems( *pItemCJK, *pItemCTL ) )
1195 return true;
1196 }
1197 else
1198 {
1199 if( *pItem != *pItemCJK ||
1200 *pItem != *pItemCTL ||
1201 *pItemCJK != *pItemCTL )
1202 return true;
1203 }
1204 }
1205 }
1206
1207 const SwFormatDrop *pDrop;
1208 if( bCheckDropCap &&
1209 (pDrop = rItemSet.GetItemIfSet( RES_PARATR_DROP )) )
1210 {
1211 const SwCharFormat *pDCCharFormat = pDrop->GetCharFormat();
1212 if( pDCCharFormat )
1213 {
1214 //sequence of (start, end) property ranges we want to
1215 //query
1223 aTstItemSet(*pDCCharFormat->GetAttrSet().GetPool());
1224 aTstItemSet.Set( pDCCharFormat->GetAttrSet() );
1225 return HasScriptDependentItems( aTstItemSet, false );
1226 }
1227 }
1228
1229 return false;
1230}
1231
1232static bool OutCSS1Rule( SwHTMLWriter& rHTMLWrt, const OUString& rSelector,
1233 const SfxItemSet& rItemSet, bool bHasClass,
1234 bool bCheckForPseudo )
1235{
1236 bool bScriptDependent = false;
1237 if( SwHTMLWriter::HasScriptDependentItems( rItemSet, bHasClass ) )
1238 {
1239 bScriptDependent = true;
1240 std::u16string_view aSelector( rSelector );
1241
1242 std::u16string_view aPseudo;
1243 if( bCheckForPseudo )
1244 {
1245 size_t nPos = aSelector.rfind( ':' );
1246 if( nPos != std::u16string_view::npos )
1247 {
1248 aPseudo = aSelector.substr( nPos );
1249 aSelector =aSelector.substr( 0, nPos );
1250 }
1251 }
1252
1253 if( !bHasClass )
1254 {
1255 // If we are exporting styles for a tag we have to export a tag
1256 // rule for all properties that aren't style dependent and
1257 // some class rule for the additional style dependen properties
1258 {
1259 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_NO_SCRIPT|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1260 &rSelector );
1261 rHTMLWrt.OutCSS1_SfxItemSet( rItemSet, false );
1262 }
1263
1264 //sequence of (start, end) property ranges we want to
1265 //query
1270 aScriptItemSet( *rItemSet.GetPool() );
1271 aScriptItemSet.Put( rItemSet );
1272
1273 OUString aNewSelector = OUString::Concat(aSelector) + ".western" + aPseudo;
1274 {
1275 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_WESTERN|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1276 &aNewSelector );
1277 rHTMLWrt.OutCSS1_SfxItemSet( aScriptItemSet, false );
1278 }
1279
1280 aNewSelector = OUString::Concat(aSelector) + ".cjk" + aPseudo;
1281 {
1282 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_CJK|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1283 &aNewSelector );
1284 rHTMLWrt.OutCSS1_SfxItemSet( aScriptItemSet, false );
1285 }
1286
1287 aNewSelector = OUString::Concat(aSelector) + ".ctl" + aPseudo;
1288 {
1289 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_CTL|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1290 &aNewSelector );
1291 rHTMLWrt.OutCSS1_SfxItemSet( aScriptItemSet, false );
1292 }
1293 }
1294 else
1295 {
1296 // If there are script dependencies and we are derived from a tag,
1297 // when we have to export a style dependent class for all
1298 // scripts
1299 OUString aNewSelector = OUString::Concat(aSelector) + "-western" + aPseudo;
1300 {
1301 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_WESTERN|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1302 &aNewSelector );
1303 rHTMLWrt.OutCSS1_SfxItemSet( rItemSet, false );
1304 }
1305
1306 aNewSelector = OUString::Concat(aSelector) + "-cjk" + aPseudo;
1307 {
1308 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_CJK|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1309 &aNewSelector );
1310 rHTMLWrt.OutCSS1_SfxItemSet( rItemSet, false );
1311 }
1312
1313 aNewSelector = OUString::Concat(aSelector) + "-ctl" + aPseudo;
1314 {
1315 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_CTL|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1316 &aNewSelector );
1317 rHTMLWrt.OutCSS1_SfxItemSet( rItemSet, false );
1318 }
1319 }
1320 }
1321 else
1322 {
1323 // If there are no script dependencies, when all items are
1324 // exported in one step. For hyperlinks only, a script information
1325 // must be there, because these two chr formats don't support
1326 // script dependencies by now.
1327 SwCSS1OutMode aMode( rHTMLWrt,
1329 &rSelector );
1330 rHTMLWrt.OutCSS1_SfxItemSet( rItemSet, false );
1331 }
1332
1333 return bScriptDependent;
1334}
1335
1337 SwHTMLWriter& rHTMLWrt, const OUString& rSelector,
1338 const SwFormatDrop& rDrop, bool bHasClass,
1339 bool bHasScriptDependencies )
1340{
1341 const SwCharFormat *pDCCharFormat = rDrop.GetCharFormat();
1342 if( (bHasScriptDependencies && bHasClass) ||
1343 (pDCCharFormat && SwHTMLWriter::HasScriptDependentItems( pDCCharFormat->GetAttrSet(), false ) ) )
1344 {
1345 std::u16string_view aSelector( rSelector );
1346
1347 std::u16string_view aPseudo;
1348 size_t nPos = aSelector.rfind( ':' );
1349 if( nPos != std::u16string_view::npos )
1350 {
1351 aPseudo = aSelector.substr( nPos );
1352 aSelector = aSelector.substr( 0, nPos );
1353 }
1354
1355 if( !bHasClass )
1356 {
1357 // If we are exporting styles for a tag we have to export a tag
1358 // rule for all properties that aren't style dependent and
1359 // some class rule for the additional style dependen properties
1360 {
1361 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_NO_SCRIPT|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1362 &rSelector );
1363 OutCSS1_SwFormatDropAttrs( rHTMLWrt, rDrop );
1364 }
1365
1370 aScriptItemSet( rHTMLWrt.m_pDoc->GetAttrPool() );
1371 if( pDCCharFormat )
1372 aScriptItemSet.Set( pDCCharFormat->GetAttrSet() );
1373
1374 OUString aNewSelector = OUString::Concat(aSelector) + ".western" + aPseudo;
1375 {
1376 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_WESTERN|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1377 &aNewSelector );
1378 OutCSS1_SwFormatDropAttrs( rHTMLWrt, rDrop, &aScriptItemSet );
1379 }
1380
1381 aNewSelector = OUString::Concat(aSelector) + ".cjk" + aPseudo;
1382 {
1383 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_CJK|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1384 &aNewSelector );
1385 OutCSS1_SwFormatDropAttrs( rHTMLWrt, rDrop, &aScriptItemSet );
1386 }
1387
1388 aNewSelector = OUString::Concat(aSelector) + ".ctl" + aPseudo;
1389 {
1390 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_CTL|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1391 &aNewSelector );
1392 OutCSS1_SwFormatDropAttrs( rHTMLWrt, rDrop, &aScriptItemSet );
1393 }
1394 }
1395 else
1396 {
1397 // If there are script dependencies and we are derived from a tag,
1398 // when we have to export a style dependent class for all
1399 // scripts
1400 OUString aNewSelector = OUString::Concat(aSelector) + "-western" + aPseudo;
1401 {
1402 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_WESTERN|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1403 &aNewSelector );
1404 OutCSS1_SwFormatDropAttrs( rHTMLWrt, rDrop );
1405 }
1406
1407 aNewSelector = OUString::Concat(aSelector) + "-cjk" + aPseudo;
1408 {
1409 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_CJK|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1410 &aNewSelector );
1411 OutCSS1_SwFormatDropAttrs( rHTMLWrt, rDrop );
1412 }
1413
1414 aNewSelector = OUString::Concat(aSelector) + "-ctl" + aPseudo;
1415 {
1416 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_CTL|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1417 &aNewSelector );
1418 OutCSS1_SwFormatDropAttrs( rHTMLWrt, rDrop );
1419 }
1420 }
1421 }
1422 else
1423 {
1424 // If there are no script dependencies, when all items are
1425 // exported in one step. For hyperlinks only, a script information
1426 // must be there, because these two chr formats don't support
1427 // script dependencies by now.
1428 SwCSS1OutMode aMode( rHTMLWrt,
1430 &rSelector );
1431 OutCSS1_SwFormatDropAttrs( rHTMLWrt, rDrop );
1432 }
1433}
1434
1435static Writer& OutCSS1_SwFormat( Writer& rWrt, const SwFormat& rFormat,
1436 IDocumentStylePoolAccess/*SwDoc*/ *pDoc, SwDoc *pTemplate )
1437{
1438 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1439
1440 bool bCharFormat = false;
1441 switch( rFormat.Which() )
1442 {
1443 case RES_CHRFMT:
1444 bCharFormat = true;
1445 break;
1446
1447 case RES_TXTFMTCOLL:
1448 case RES_CONDTXTFMTCOLL:
1449 // these template-types can be exported
1450 break;
1451
1452 default:
1453 // but not these
1454 return rWrt;
1455 }
1456
1457 // determine Selector and the to-be-exported Attr-Set-depth
1458 OUString aSelector;
1459 sal_uInt16 nRefPoolId = 0;
1460 sal_uInt16 nDeep = GetCSS1Selector( &rFormat, aSelector, nRefPoolId );
1461 if( !nDeep )
1462 return rWrt; // not derived from a HTML-template
1463
1464 sal_uInt16 nPoolFormatId = rFormat.GetPoolFormatId();
1465
1466 // Determine the to-be-exported Attr-Set. We have to distinguish 3 cases:
1467 // - HTML-Tag templates (nDeep==USHRT_MAX):
1468 // Export Attrs...
1469 // - that are set in the template, but not in the original of the HTML template
1470 // - the Default-Attrs for the Attrs, that are set in the Original of the
1471 // HTML template, but not in the current template.
1472 // - templates directly derived from HTML templates (nDeep==1):
1473 // Export only Attributes of the template Item-Set w/o its parents.
1474 // - templates in-directly derived from HTML templates (nDeep>1):
1475 // Export Attributes of the template Item-Set incl. its Parents,
1476 // but w/o Attributes that are set in the HTML-Tag template.
1477
1478 // create Item-Set with all Attributes from the template
1479 // (all but for nDeep==1)
1480 const SfxItemSet& rFormatItemSet = rFormat.GetAttrSet();
1481 SfxItemSet aItemSet( *rFormatItemSet.GetPool(), rFormatItemSet.GetRanges() );
1482 aItemSet.Set( rFormatItemSet ); // Was nDeep!=1 that is not working
1483 // for script dependent items but should
1484 // not make a difference for any other
1485
1486 bool bSetDefaults = true, bClearSame = true;
1487 const SwFormat *pRefFormat = nullptr;
1488 const SwFormat *pRefFormatScript = nullptr;
1489 switch( nDeep )
1490 {
1491 case CSS1_FMT_ISTAG:
1492 pRefFormat = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pTemplate == nullptr ? nullptr : &pTemplate->getIDocumentStylePoolAccess() );
1493 break;
1494 case CSS1_FMT_CMPREF:
1495 pRefFormat = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pDoc );
1496 pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pTemplate == nullptr ? nullptr : &pTemplate->getIDocumentStylePoolAccess() );
1497 bClearSame = false;
1498 break;
1499 default:
1500 pRefFormat = SwHTMLWriter::GetParentFormat( rFormat, nDeep );
1501 pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pTemplate == nullptr ? nullptr : &pTemplate->getIDocumentStylePoolAccess() );
1502 bSetDefaults = false;
1503 break;
1504 }
1505
1506 if( pRefFormat )
1507 {
1508 // subtract Item-Set of the Reference template (incl. its Parents)
1509 SwHTMLWriter::SubtractItemSet( aItemSet, pRefFormat->GetAttrSet(),
1510 bSetDefaults, bClearSame,
1511 pRefFormatScript
1512 ? &pRefFormatScript->GetAttrSet()
1513 : nullptr );
1514
1515 if( !bCharFormat )
1516 {
1517 const SvxULSpaceItem& rULItem = pRefFormat->GetULSpace();
1518 rHTMLWrt.m_nDfltTopMargin = rULItem.GetUpper();
1519 rHTMLWrt.m_nDfltBottomMargin = rULItem.GetLower();
1520 }
1521 }
1522 else if( CSS1_FMT_ISTAG==nDeep && !bCharFormat )
1523 {
1524 // set Default-distance above and below (for the
1525 // case that there is no reference template)
1526 rHTMLWrt.m_nDfltTopMargin = 0;
1528 if( USER_FMT & nPoolFormatId )
1529 {
1530 // user templates
1531 const OUString& aNm(rFormat.GetName());
1532
1533 if (aNm == "DD 1" || aNm == "DT 1")
1534 rHTMLWrt.m_nDfltBottomMargin = 0;
1535 else if (aNm == OOO_STRING_SVTOOLS_HTML_listing)
1536 rHTMLWrt.m_nDfltBottomMargin = 0;
1537 else if (aNm == OOO_STRING_SVTOOLS_HTML_preformtxt)
1538 rHTMLWrt.m_nDfltBottomMargin = 0;
1539 else if (aNm == OOO_STRING_SVTOOLS_HTML_xmp)
1540 rHTMLWrt.m_nDfltBottomMargin = 0;
1541 }
1542 else
1543 {
1544 // Pool templates
1545 switch( nPoolFormatId )
1546 {
1554 break;
1559 rHTMLWrt.m_nDfltBottomMargin = 0;
1560 break;
1561 }
1562 }
1563 }
1564
1565 // if nothing is to be exported ...
1566 if( !aItemSet.Count() )
1567 return rWrt;
1568
1569 // There is no support for script dependent hyperlinks by now.
1570 bool bCheckForPseudo = false;
1571 if( bCharFormat &&
1572 (RES_POOLCHR_INET_NORMAL==nRefPoolId ||
1573 RES_POOLCHR_INET_VISIT==nRefPoolId) )
1574 bCheckForPseudo = true;
1575
1576 // export now the Attributes (incl. selector)
1577 bool bHasScriptDependencies = false;
1578 if( OutCSS1Rule( rHTMLWrt, aSelector, aItemSet, CSS1_FMT_ISTAG != nDeep,
1579 bCheckForPseudo ) )
1580 {
1581 if( bCharFormat )
1582 rHTMLWrt.m_aScriptTextStyles.insert( rFormat.GetName() );
1583 else
1584 {
1585 if( nPoolFormatId==RES_POOLCOLL_TEXT )
1586 rHTMLWrt.m_aScriptParaStyles.insert( pDoc->GetTextCollFromPool( RES_POOLCOLL_STANDARD, false )->GetName() );
1587 rHTMLWrt.m_aScriptParaStyles.insert( rFormat.GetName() );
1588 }
1589 bHasScriptDependencies = true;
1590 }
1591
1592 // export Drop-Caps
1593 if( const SwFormatDrop *pDrop = aItemSet.GetItemIfSet( RES_PARATR_DROP, false ) )
1594 {
1595 OUString sOut = aSelector +
1596 ":" + OStringToOUString( sCSS1_first_letter, RTL_TEXTENCODING_ASCII_US );
1597 OutCSS1DropCapRule( rHTMLWrt, sOut, *pDrop, CSS1_FMT_ISTAG != nDeep, bHasScriptDependencies );
1598 }
1599
1600 return rWrt;
1601}
1602
1603static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc,
1604 IDocumentStylePoolAccess/*SwDoc*/ *pDoc, SwDoc *pTemplate,
1605 sal_uInt16 nRefPoolId, bool bExtRef,
1606 bool bPseudo )
1607{
1608 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1609
1610 const SwPageDesc* pRefPageDesc = nullptr;
1611 if( !bExtRef )
1612 pRefPageDesc = pDoc->GetPageDescFromPool( nRefPoolId, false );
1613 else if( pTemplate )
1614 pRefPageDesc = pTemplate->getIDocumentStylePoolAccess().GetPageDescFromPool( nRefPoolId, false );
1615
1616 OUString aSelector = "@" + OStringToOUString( sCSS1_page, RTL_TEXTENCODING_ASCII_US );
1617
1618 if( bPseudo )
1619 {
1620 const char *pPseudo = nullptr;
1621 switch( rPageDesc.GetPoolFormatId() )
1622 {
1623 case RES_POOLPAGE_FIRST: pPseudo = sCSS1_first; break;
1624 case RES_POOLPAGE_LEFT: pPseudo = sCSS1_left; break;
1625 case RES_POOLPAGE_RIGHT: pPseudo = sCSS1_right; break;
1626 }
1627 if( pPseudo )
1628 aSelector += ":" + OStringToOUString( pPseudo, RTL_TEXTENCODING_ASCII_US );
1629 }
1630
1631 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_RULE_ON|CSS1_OUTMODE_TEMPLATE,
1632 &aSelector );
1633
1634 // Size: If the only difference is the Landscape-Flag,
1635 // only export Portrait or Landscape. Otherwise export size.
1636 bool bRefLandscape = pRefPageDesc && pRefPageDesc->GetLandscape();
1637 Size aRefSz;
1638 const Size& rSz = rPageDesc.GetMaster().GetFrameSize().GetSize();
1639 if( pRefPageDesc )
1640 {
1641 aRefSz = pRefPageDesc->GetMaster().GetFrameSize().GetSize();
1642 if( bRefLandscape != rPageDesc.GetLandscape() )
1643 {
1644 tools::Long nTmp = aRefSz.Height();
1645 aRefSz.setHeight( aRefSz.Width() );
1646 aRefSz.setWidth( nTmp );
1647 }
1648 }
1649
1650 // TODO: Bad Hack: On the Page-Tabpage there are small rounding errors
1651 // for the page size. Partially because of bug 25535, we stupidly still
1652 // use the Size-Item from Dialog, even if nothing changed.
1653 // Thus: once one visited the Page-Dialog and left it with OK, we get a
1654 // new page size that then gets exported here. To avoid that, we allow
1655 // here small deviations.
1656 if( std::abs( rSz.Width() - aRefSz.Width() ) <= 2 &&
1657 std::abs( rSz.Height() - aRefSz.Height() ) <= 2 )
1658 {
1659 if( bRefLandscape != rPageDesc.GetLandscape() )
1660 {
1662 rPageDesc.GetLandscape() ? sCSS1_PV_landscape
1664 }
1665 }
1666 else
1667 {
1668 OStringBuffer sVal;
1669 AddUnitPropertyValue(sVal, rSz.Width(), rHTMLWrt.GetCSS1Unit());
1670 sVal.append(' ');
1671 AddUnitPropertyValue(sVal, rSz.Height(), rHTMLWrt.GetCSS1Unit());
1672 rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_size, sVal);
1673 }
1674
1675 // Export the distance-Attributes as normally
1676 const SwFrameFormat &rMaster = rPageDesc.GetMaster();
1678 aItemSet.Set( rMaster.GetAttrSet() );
1679
1680 if( pRefPageDesc )
1681 {
1683 pRefPageDesc->GetMaster().GetAttrSet(),
1684 true );
1685 }
1686
1687 OutCSS1_SvxULSpace_SvxLRSpace( rWrt, aItemSet );
1688
1689 // If for a Pseudo-Selector no Property had been set, we still
1690 // have to export something, so that the corresponding template is
1691 // created on the next import.
1692 if( rHTMLWrt.m_bFirstCSS1Property && bPseudo )
1693 {
1694 rHTMLWrt.OutNewLine();
1695 OString sTmp(OUStringToOString(aSelector, RTL_TEXTENCODING_UTF8));
1696 rWrt.Strm().WriteOString( sTmp ).WriteCharPtr( " {" );
1697 rHTMLWrt.m_bFirstCSS1Property = false;
1698 }
1699
1700 if( !rHTMLWrt.m_bFirstCSS1Property )
1701 rWrt.Strm().WriteCharPtr( sCSS1_rule_end );
1702
1703 return rWrt;
1704}
1705
1707 SwDoc *pDoc, bool bHasNotes, bool bEndNote )
1708{
1709 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1710
1711 OUString aSelector;
1712
1713 if( bHasNotes )
1714 {
1715 aSelector = OUString::Concat(OOO_STRING_SVTOOLS_HTML_anchor ".") +
1716 ( bEndNote ? std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sdendnote_anc)
1717 : std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sdfootnote_anc) );
1718 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1719 &aSelector );
1721 sHTML_FTN_fontheight );
1722 rHTMLWrt.Strm().WriteCharPtr( sCSS1_rule_end );
1723 }
1724
1725 const SwCharFormat *pSymCharFormat = rInfo.GetCharFormat( *pDoc );
1726 if( pSymCharFormat )
1727 {
1728 const SfxItemSet& rFormatItemSet = pSymCharFormat->GetAttrSet();
1729 SfxItemSet aItemSet( *rFormatItemSet.GetPool(), rFormatItemSet.GetRanges() );
1730 aItemSet.Set( rFormatItemSet );
1731
1732 // If there are footnotes or endnotes, then all Attributes have to be
1733 // exported, so that Netscape displays the document correctly.
1734 // Otherwise it is sufficient, to export the differences to the
1735 // footnote and endnote template.
1736 if( !bHasNotes && rHTMLWrt.m_xTemplate.is() )
1737 {
1738 SwFormat *pRefFormat = rHTMLWrt.m_xTemplate->getIDocumentStylePoolAccess().GetCharFormatFromPool(
1739 static_cast< sal_uInt16 >(bEndNote ? RES_POOLCHR_ENDNOTE : RES_POOLCHR_FOOTNOTE) );
1740 if( pRefFormat )
1741 SwHTMLWriter::SubtractItemSet( aItemSet, pRefFormat->GetAttrSet(),
1742 true );
1743 }
1744 if( aItemSet.Count() )
1745 {
1746 aSelector = OUString::Concat(OOO_STRING_SVTOOLS_HTML_anchor ".") +
1747 ( bEndNote ? std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sdendnote_sym)
1748 : std::u16string_view(
1750 if( OutCSS1Rule( rHTMLWrt, aSelector, aItemSet, true, false ))
1751 rHTMLWrt.m_aScriptTextStyles.insert( pSymCharFormat->GetName() );
1752 }
1753 }
1754
1755 return rWrt;
1756}
1757
1759{
1760 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1761
1762 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_STYLE_OPT_ON |
1764
1765 // Only export the attributes of the page template.
1766 // The attributes of the default paragraph template were
1767 // considered already when exporting the paragraph template.
1768
1769 const SfxPoolItem *pItem;
1770 if( SfxItemState::SET == rItemSet.GetItemState( RES_BACKGROUND, false,
1771 &pItem ) )
1772 {
1773 OUString rEmbeddedGraphicName;
1774 OutCSS1_SvxBrush( rWrt, *pItem, sw::Css1Background::Page, &rEmbeddedGraphicName );
1775 }
1776
1777 if( SfxItemState::SET == rItemSet.GetItemState( RES_BOX, false,
1778 &pItem ))
1779 {
1780 OutCSS1_SvxBox( rWrt, *pItem );
1781 }
1782
1783 if( !rHTMLWrt.m_bFirstCSS1Property )
1784 {
1785 // if a Property was exported as part of a Style-Option,
1786 // the Option still needs to be finished
1787 rWrt.Strm().WriteChar( '\"' );
1788 }
1789
1790 return rWrt;
1791}
1792
1794{
1795 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1796
1797 SwCSS1OutMode aMode( rHTMLWrt, rHTMLWrt.m_nCSS1Script|CSS1_OUTMODE_STYLE_OPT |
1799 rHTMLWrt.OutCSS1_SfxItemSet( rItemSet, false );
1800
1801 return rWrt;
1802}
1803
1805{
1806 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1807
1808 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_STYLE_OPT_ON |
1810 CSS1_OUTMODE_TABLEBOX, nullptr );
1811 OutCSS1_SvxBrush( rWrt, rHt, sw::Css1Background::TableRow, nullptr );
1812
1813 if (!rHTMLWrt.m_bFirstCSS1Property)
1814 rWrt.Strm().WriteChar(cCSS1_style_opt_end);
1815
1816 return rWrt;
1817}
1818
1820 sal_uInt8 nLevel )
1821{
1822 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1823
1824 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_STYLE_OPT |
1826
1827 const SwNumFormat& rNumFormat = rNumRule.Get( nLevel );
1828
1829 tools::Long nLSpace = rNumFormat.GetAbsLSpace();
1831 tools::Long nDfltFirstLineOffset = HTML_NUMBER_BULLET_INDENT;
1832 if( nLevel > 0 )
1833 {
1834 const SwNumFormat& rPrevNumFormat = rNumRule.Get( nLevel-1 );
1835 nLSpace -= rPrevNumFormat.GetAbsLSpace();
1836 nDfltFirstLineOffset = rPrevNumFormat.GetFirstLineOffset();
1837 }
1838
1841 rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_margin_left, nLSpace );
1842
1844 nFirstLineOffset != nDfltFirstLineOffset )
1846
1847 if( !rHTMLWrt.m_bFirstCSS1Property )
1848 rWrt.Strm().WriteChar( '\"' );
1849
1850 return rWrt;
1851}
1852
1854 HtmlFrmOpts nFrameOpts,
1855 const SdrObject *pSdrObj,
1856 const SfxItemSet *pItemSet )
1857{
1858 SwCSS1OutMode aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON |
1860 CSS1_OUTMODE_FRAME, nullptr );
1861
1862 const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient();
1863 SvxLRSpaceItem aLRItem( rFrameFormat.GetLRSpace() );
1864 SvxULSpaceItem aULItem( rFrameFormat.GetULSpace() );
1865 if( nFrameOpts & HtmlFrmOpts::SAlign )
1866 {
1867 const SwFormatAnchor& rAnchor = rFrameFormat.GetAnchor();
1868 switch( rAnchor.GetAnchorId() )
1869 {
1870 case RndStdIds::FLY_AT_PARA:
1871 case RndStdIds::FLY_AT_CHAR:
1872 if( text::RelOrientation::FRAME == rHoriOri.GetRelationOrient() ||
1873 text::RelOrientation::PRINT_AREA == rHoriOri.GetRelationOrient() )
1874 {
1875 if( !(nFrameOpts & HtmlFrmOpts::Align) )
1876 {
1877 // float
1878 const char *pStr = text::HoriOrientation::RIGHT==rHoriOri.GetHoriOrient()
1880 : sCSS1_PV_left;
1882 }
1883 break;
1884 }
1885 [[fallthrough]];
1886
1887 case RndStdIds::FLY_AT_PAGE:
1888 case RndStdIds::FLY_AT_FLY:
1889 {
1890 // position
1892
1893 // For top/left we need to subtract the distance to the frame
1894 // from the position, as in CSS1 it is added to the position.
1895 // This works also for automatically aligned frames, even that
1896 // in this case Writer also adds the distance; because in this
1897 // case the Orient-Attribute contains the correct position.
1898
1899 // top
1900 tools::Long nXPos=0, nYPos=0;
1901 bool bOutXPos = false, bOutYPos = false;
1902 if( RES_DRAWFRMFMT == rFrameFormat.Which() )
1903 {
1904 OSL_ENSURE( pSdrObj, "Do not pass a SdrObject. Inefficient" );
1905 if( !pSdrObj )
1906 pSdrObj = rFrameFormat.FindSdrObject();
1907 OSL_ENSURE( pSdrObj, "Where is the SdrObject" );
1908 if( pSdrObj )
1909 {
1910 Point aPos( pSdrObj->GetRelativePos() );
1911 nXPos = aPos.X();
1912 nYPos = aPos.Y();
1913 }
1914 bOutXPos = bOutYPos = true;
1915 }
1916 else
1917 {
1918 bOutXPos = text::RelOrientation::CHAR != rHoriOri.GetRelationOrient();
1919 nXPos = text::HoriOrientation::NONE == rHoriOri.GetHoriOrient()
1920 ? rHoriOri.GetPos() : 0;
1921
1922 const SwFormatVertOrient& rVertOri = rFrameFormat.GetVertOrient();
1923 bOutYPos = text::RelOrientation::CHAR != rVertOri.GetRelationOrient();
1924 nYPos = text::VertOrientation::NONE == rVertOri.GetVertOrient()
1925 ? rVertOri.GetPos() : 0;
1926 }
1927
1928 if( bOutYPos )
1929 {
1931 {
1932 nYPos -= aULItem.GetUpper();
1933 if( nYPos < 0 )
1934 {
1935 aULItem.SetUpper( o3tl::narrowing<sal_uInt16>(aULItem.GetUpper() + nYPos) );
1936 nYPos = 0;
1937 }
1938 }
1939
1941 }
1942
1943 if( bOutXPos )
1944 {
1945 // left
1947 {
1948 nXPos -= aLRItem.GetLeft();
1949 if( nXPos < 0 )
1950 {
1951 aLRItem.SetLeft( o3tl::narrowing<sal_uInt16>(aLRItem.GetLeft() + nXPos) );
1952 nXPos = 0;
1953 }
1954 }
1955
1957 }
1958 }
1959 break;
1960
1961 default:
1962 ;
1963 }
1964 }
1965
1966 // width/height
1967 if( nFrameOpts & HtmlFrmOpts::SSize )
1968 {
1969 if( RES_DRAWFRMFMT == rFrameFormat.Which() )
1970 {
1971 OSL_ENSURE( pSdrObj, "Do not pass a SdrObject. Inefficient" );
1972 if( !pSdrObj )
1973 pSdrObj = rFrameFormat.FindSdrObject();
1974 OSL_ENSURE( pSdrObj, "Where is the SdrObject" );
1975 if( pSdrObj )
1976 {
1977 Size aTwipSz( pSdrObj->GetLogicRect().GetSize() );
1978 if( nFrameOpts & HtmlFrmOpts::SWidth )
1979 {
1980 if( nFrameOpts & HtmlFrmOpts::SPixSize )
1982 false );
1983 else
1985 }
1986 if( nFrameOpts & HtmlFrmOpts::SHeight )
1987 {
1988 if( nFrameOpts & HtmlFrmOpts::SPixSize )
1990 true );
1991 else
1993 }
1994 }
1995 }
1996 else
1997 {
1998 OSL_ENSURE( HtmlFrmOpts::AbsSize & nFrameOpts,
1999 "Export absolute size" );
2000 OSL_ENSURE( HtmlFrmOpts::AnySize & nFrameOpts,
2001 "Export every size" );
2002 Css1FrameSize nMode = Css1FrameSize::NONE;
2003 if( nFrameOpts & HtmlFrmOpts::SWidth )
2004 nMode |= Css1FrameSize::Width;
2005 if( nFrameOpts & HtmlFrmOpts::SHeight )
2006 nMode |= Css1FrameSize::MinHeight|Css1FrameSize::FixHeight;
2007 if( nFrameOpts & HtmlFrmOpts::SPixSize )
2008 nMode |= Css1FrameSize::Pixel;
2009
2010 OutCSS1_SwFormatFrameSize( *this, rFrameFormat.GetFrameSize(), nMode );
2011 }
2012 }
2013
2014 const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet();
2015 // margin-*
2016 if( (nFrameOpts & HtmlFrmOpts::SSpace) &&
2018 {
2019 const SvxLRSpaceItem *pLRItem = nullptr;
2020 const SvxULSpaceItem *pULItem = nullptr;
2021 if( SfxItemState::SET == rItemSet.GetItemState( RES_LR_SPACE ) )
2022 pLRItem = &aLRItem;
2023 if( SfxItemState::SET == rItemSet.GetItemState( RES_UL_SPACE ) )
2024 pULItem = &aULItem;
2025 if( pLRItem || pULItem )
2026 OutCSS1_SvxULSpace_SvxLRSpace( *this, pULItem, pLRItem );
2027 }
2028
2029 // border
2030 if( nFrameOpts & HtmlFrmOpts::SBorder )
2031 {
2032 const SfxPoolItem* pItem;
2033 if( nFrameOpts & HtmlFrmOpts::SNoBorder )
2034 OutCSS1_SvxBox( *this, rFrameFormat.GetBox() );
2035 else if( SfxItemState::SET==rItemSet.GetItemState( RES_BOX, true, &pItem ) )
2036 OutCSS1_SvxBox( *this, *pItem );
2037 }
2038
2039 // background (if, then the color must be set also)
2040 if( nFrameOpts & HtmlFrmOpts::SBackground )
2041 OutCSS1_FrameFormatBackground( rFrameFormat );
2042
2043 if( pItemSet )
2044 OutCSS1_SfxItemSet( *pItemSet, false );
2045
2047 Strm().WriteChar( '\"' );
2048}
2049
2051{
2052 SwCSS1OutMode aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON |
2054 CSS1_OUTMODE_TABLE, nullptr );
2055
2056 const SfxPoolItem *pItem;
2057 const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet();
2058 if( SfxItemState::SET==rItemSet.GetItemState( RES_BACKGROUND, false, &pItem ) )
2059 OutCSS1_SvxBrush( *this, *pItem, sw::Css1Background::Table, nullptr );
2060
2063
2064 if( SfxItemState::SET==rItemSet.GetItemState( RES_LAYOUT_SPLIT, false, &pItem ) )
2065 OutCSS1_SwFormatLayoutSplit( *this, *pItem );
2066
2068 Strm().WriteChar( '\"' );
2069}
2070
2072{
2073 SwCSS1OutMode const aMode( *this,
2075 if (pBrushItem)
2076 OutCSS1_SvxBrush(*this, *pBrushItem, sw::Css1Background::TableCell, nullptr);
2077 OutCSS1_SvxBox(*this, rFrameFormat.GetBox());
2079 Strm().WriteChar(cCSS1_style_opt_end);
2080}
2081
2083{
2084 SwCSS1OutMode aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON |
2086 CSS1_OUTMODE_SECTION, nullptr );
2087
2088 const SfxPoolItem *pItem;
2089 const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet();
2090 if( SfxItemState::SET==rItemSet.GetItemState( RES_BACKGROUND, false, &pItem ) )
2091 OutCSS1_SvxBrush( *this, *pItem, sw::Css1Background::Section, nullptr );
2092
2093 if (mbXHTML)
2094 {
2095 SvxFrameDirection nDir = GetHTMLDirection(rFrameFormat.GetAttrSet());
2096 OString sConvertedDirection = convertDirection(nDir);
2097 if (!sConvertedDirection.isEmpty())
2098 {
2099 OutCSS1_Property(sCSS1_P_dir, sConvertedDirection, nullptr,
2101 }
2102 }
2103
2104 if (pCol)
2105 {
2106 OString sColumnCount(OString::number(static_cast<sal_Int32>(pCol->GetNumCols())));
2108 }
2109
2111 Strm().WriteChar( '\"' );
2112}
2113
2115 const SvxBrushItem& rBrushItem )
2116{
2117 bool bWritten = false;
2120 if( rBrushItem.GetColor() != COL_TRANSPARENT ||
2121 !rBrushItem.GetGraphicLink().isEmpty() ||
2122 0 != rBrushItem.GetGraphicPos() )
2123 {
2124 OutCSS1_SvxBrush( rWrt, rBrushItem, sw::Css1Background::Fly, nullptr );
2125 bWritten = true;
2126 }
2127 return bWritten;
2128}
2129
2131{
2132 // If the frame itself has a background, then export.
2133 if( OutCSS1_FrameFormatBrush( *this, *rFrameFormat.makeBackgroundBrushItem() ) )
2134 return;
2135
2136 // If the frame is not linked to a page, we use the background of the anchor.
2137 const SwFormatAnchor& rAnchor = rFrameFormat.GetAnchor();
2138 RndStdIds eAnchorId = rAnchor.GetAnchorId();
2139 const SwPosition *pAnchorPos = rAnchor.GetContentAnchor();
2140 if (RndStdIds::FLY_AT_PAGE != eAnchorId && pAnchorPos)
2141 {
2142 const SwNode& rNode = pAnchorPos->GetNode();
2143 if( rNode.IsContentNode() )
2144 {
2145 // If the frame is linked to a content-node,
2146 // we take the background of the content-node, if it has one.
2147 if( OutCSS1_FrameFormatBrush( *this,
2149 return;
2150
2151 // Otherwise we also could be in a table
2152 const SwTableNode *pTableNd = rNode.FindTableNode();
2153 if( pTableNd )
2154 {
2155 const SwStartNode *pBoxSttNd = rNode.FindTableBoxStartNode();
2156 const SwTableBox *pBox =
2157 pTableNd->GetTable().GetTableBox( pBoxSttNd->GetIndex() );
2158
2159 // If the box has a background, we take it.
2160 if( OutCSS1_FrameFormatBrush( *this,
2162 return;
2163
2164 // Otherwise we use that of the lines
2165 const SwTableLine *pLine = pBox->GetUpper();
2166 while( pLine )
2167 {
2168 if( OutCSS1_FrameFormatBrush( *this,
2170 return;
2171 pBox = pLine->GetUpper();
2172 pLine = pBox ? pBox->GetUpper() : nullptr;
2173 }
2174
2175 // If there was none either, we use the background of the table.
2176 if( OutCSS1_FrameFormatBrush( *this,
2177 *pTableNd->GetTable().GetFrameFormat()->makeBackgroundBrushItem() ) )
2178 return;
2179 }
2180
2181 }
2182
2183 // If the anchor is again in a Fly-Frame, use the background of the Fly-Frame.
2184 const SwFrameFormat *pFrameFormat = rNode.GetFlyFormat();
2185 if( pFrameFormat )
2186 {
2187 OutCSS1_FrameFormatBackground( *pFrameFormat );
2188 return;
2189 }
2190 }
2191
2192 // At last there is the background of the page, and as the final rescue
2193 // the value of the Config.
2194 OSL_ENSURE( m_pCurrPageDesc, "no page template found" );
2195 if( OutCSS1_FrameFormatBrush( *this,
2197 return;
2198
2199 Color aColor( COL_WHITE );
2200
2201 // The background color is normally only used in Browse-Mode.
2202 // We always use it for a HTML document, but for a text document
2203 // only if viewed in Browse-Mode.
2206 {
2208 if ( pVSh &&
2210 aColor = pVSh->GetViewOptions()->GetRetoucheColor();
2211 }
2212
2214}
2215
2217 const SvxUnderlineItem *pUItem,
2218 const SvxOverlineItem *pOItem,
2219 const SvxCrossedOutItem *pCOItem,
2220 const SvxBlinkItem *pBItem )
2221{
2222 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2223 bool bNone = false;
2224
2225 const char *pUStr = nullptr;
2226 if( pUItem )
2227 {
2228 switch( pUItem->GetLineStyle() )
2229 {
2230 case LINESTYLE_NONE:
2231 bNone = true;
2232 break;
2233 case LINESTYLE_DONTKNOW:
2234 break;
2235 default:
2236 if( !rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2237 {
2238 // this also works in HTML does not need to be written as
2239 // a STYLE-Options, and must not be written as Hint
2240 OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT) || rHTMLWrt.mbReqIF,
2241 "write underline as Hint?" );
2242 pUStr = sCSS1_PV_underline;
2243 }
2244 break;
2245 }
2246 }
2247
2248 const char *pOStr = nullptr;
2249 if( pOItem )
2250 {
2251 switch( pOItem->GetLineStyle() )
2252 {
2253 case LINESTYLE_NONE:
2254 bNone = true;
2255 break;
2256 case LINESTYLE_DONTKNOW:
2257 break;
2258 default:
2259 if( !rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2260 {
2261 // this also works in HTML does not need to be written as
2262 // a STYLE-Options, and must not be written as Hint
2263 OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2264 "write overline as Hint?" );
2265 pOStr = sCSS1_PV_overline;
2266 }
2267 break;
2268 }
2269 }
2270
2271 const char *pCOStr = nullptr;
2272 if( pCOItem )
2273 {
2274 switch( pCOItem->GetStrikeout() )
2275 {
2276 case STRIKEOUT_NONE:
2277 bNone = true;
2278 break;
2279 case STRIKEOUT_DONTKNOW:
2280 break;
2281 default:
2282 if( !rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2283 {
2284 // this also works in HTML does not need to be written as
2285 // a STYLE-Options, and must not be written as Hint
2286 OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT) || rHTMLWrt.mbReqIF,
2287 "write crossedOut as Hint?" );
2288 pCOStr = sCSS1_PV_line_through;
2289 }
2290 break;
2291 }
2292 }
2293
2294 const char *pBStr = nullptr;
2295 if( pBItem )
2296 {
2297 if( !pBItem->GetValue() )
2298 {
2299 bNone = true;
2300 }
2301 else if( !rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2302 {
2303 // this also works in HTML does not need to be written as
2304 // a STYLE-Options, and must not be written as Hint
2305 OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2306 "write blink as Hint?" );
2307 pBStr = sCSS1_PV_blink;
2308 }
2309 }
2310
2311 OStringBuffer sOut;
2312 if( pUStr )
2313 sOut.append(pUStr);
2314
2315 if( pOStr )
2316 {
2317 if (!sOut.isEmpty())
2318 sOut.append(' ');
2319 sOut.append(pOStr);
2320 }
2321
2322 if( pCOStr )
2323 {
2324 if (!sOut.isEmpty())
2325 sOut.append(' ');
2326 sOut.append(pCOStr);
2327 }
2328
2329 if( pBStr )
2330 {
2331 if (!sOut.isEmpty())
2332 sOut.append(' ');
2333 sOut.append(pBStr);
2334 }
2335
2336 if (!sOut.isEmpty())
2338 else if( bNone )
2340
2341 return rWrt;
2342}
2343
2344static Writer& OutCSS1_SvxCaseMap( Writer& rWrt, const SfxPoolItem& rHt )
2345{
2346 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2347
2348 switch( static_cast<const SvxCaseMapItem&>(rHt).GetCaseMap() )
2349 {
2350 case SvxCaseMap::NotMapped:
2352 break;
2353 case SvxCaseMap::SmallCaps:
2355 break;
2356 case SvxCaseMap::Uppercase:
2358 break;
2359 case SvxCaseMap::Lowercase:
2361 break;
2362 case SvxCaseMap::Capitalize:
2364 break;
2365 default:
2366 ;
2367 }
2368
2369 return rWrt;
2370}
2371
2372static Writer& OutCSS1_SvxColor( Writer& rWrt, const SfxPoolItem& rHt )
2373{
2374 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2375
2376 // Colors do not need to be exported for Style-Option.
2377 if( rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) &&
2378 !rHTMLWrt.m_bCfgPreferStyles )
2379 return rWrt;
2380 OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2381 "write color as Hint?" );
2382
2383 Color aColor( static_cast<const SvxColorItem&>(rHt).GetValue() );
2384 if( COL_AUTO == aColor )
2385 aColor = COL_BLACK;
2386
2388
2389 return rWrt;
2390}
2391
2393{
2394 // This function only exports Hints!
2395 // Otherwise OutCSS1_SvxTextLn_SvxCrOut_SvxBlink() is called directly.
2396
2397 if( static_cast<SwHTMLWriter&>(rWrt).IsCSS1Source(CSS1_OUTMODE_HINT) )
2399 nullptr, nullptr, static_cast<const SvxCrossedOutItem *>(&rHt), nullptr );
2400
2401 return rWrt;
2402}
2403
2404static Writer& OutCSS1_SvxFont( Writer& rWrt, const SfxPoolItem& rHt )
2405{
2406 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2407
2408 // No need to export Fonts for the Style-Option.
2409 if( rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2410 return rWrt;
2411
2412 sal_uInt16 nScript = CSS1_OUTMODE_WESTERN;
2413 switch( rHt.Which() )
2414 {
2415 case RES_CHRATR_CJK_FONT: nScript = CSS1_OUTMODE_CJK; break;
2416 case RES_CHRATR_CTL_FONT: nScript = CSS1_OUTMODE_CTL; break;
2417 }
2418 if( !rHTMLWrt.IsCSS1Script( nScript ) )
2419 return rWrt;
2420
2421 OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2422 "write Font as Hint?" );
2423
2424 OUString sOut;
2425 // MS IE3b1 has problems with single quotes
2426 sal_uInt16 nMode = rHTMLWrt.m_nCSS1OutMode & CSS1_OUTMODE_ANY_ON;
2427 sal_Unicode cQuote = nMode == CSS1_OUTMODE_RULE_ON ? '\"' : '\'';
2428 SwHTMLWriter::PrepareFontList( static_cast<const SvxFontItem&>(rHt), sOut, cQuote,
2429 true );
2430
2431 rHTMLWrt.OutCSS1_Property( sCSS1_P_font_family, sOut );
2432
2433 return rWrt;
2434}
2435
2437{
2438 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2439
2440 // Font-Height need not be exported in the Style-Option.
2441 // For Drop-Caps another Font-Size is exported.
2442 if( rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) ||
2444 return rWrt;
2445
2446 sal_uInt16 nScript = CSS1_OUTMODE_WESTERN;
2447 switch( rHt.Which() )
2448 {
2449 case RES_CHRATR_CJK_FONTSIZE: nScript = CSS1_OUTMODE_CJK; break;
2450 case RES_CHRATR_CTL_FONTSIZE: nScript = CSS1_OUTMODE_CTL; break;
2451 }
2452 if( !rHTMLWrt.IsCSS1Script( nScript ) )
2453 return rWrt;
2454
2455 sal_uInt32 nHeight = static_cast<const SvxFontHeightItem&>(rHt).GetHeight();
2456 OString sHeight(OString::number(nHeight/20) + sCSS1_UNIT_pt);
2457 rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_font_size, sHeight);
2458
2459 return rWrt;
2460}
2461
2462static Writer& OutCSS1_SvxPosture( Writer& rWrt, const SfxPoolItem& rHt )
2463{
2464 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2465
2466 sal_uInt16 nScript = CSS1_OUTMODE_WESTERN;
2467 switch( rHt.Which() )
2468 {
2469 case RES_CHRATR_CJK_POSTURE: nScript = CSS1_OUTMODE_CJK; break;
2470 case RES_CHRATR_CTL_POSTURE: nScript = CSS1_OUTMODE_CTL; break;
2471 }
2472 if( !rHTMLWrt.IsCSS1Script( nScript ) )
2473 return rWrt;
2474
2475 const char *pStr = nullptr;
2476 switch( static_cast<const SvxPostureItem&>(rHt).GetPosture() )
2477 {
2478 case ITALIC_NONE: pStr = sCSS1_PV_normal; break;
2479 case ITALIC_OBLIQUE: pStr = sCSS1_PV_oblique; break;
2480 case ITALIC_NORMAL:
2481 if( !rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2482 {
2483 // this also works in HTML does not need to be written as
2484 // a STYLE-Options, and must not be written as Hint
2485 OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2486 "write italic as Hint?" );
2487 pStr = sCSS1_PV_italic;
2488 }
2489 break;
2490 default:
2491 ;
2492 }
2493
2494 if( pStr )
2495 rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_style, pStr );
2496
2497 return rWrt;
2498}
2499
2500static Writer& OutCSS1_SvxKerning( Writer& rWrt, const SfxPoolItem& rHt )
2501{
2502 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2503
2504 sal_Int16 nValue = static_cast<const SvxKerningItem&>(rHt).GetValue();
2505 if( nValue )
2506 {
2507 OStringBuffer sOut;
2508 if( nValue < 0 )
2509 {
2510 sOut.append('-');
2511 nValue = -nValue;
2512 }
2513
2514 // Width as n.n pt
2515 nValue = (nValue + 1) / 2; // 1/10pt
2516 sOut.append(OString::number(nValue / 10) + "." + OString::number(nValue % 10) +
2518
2520 sOut.setLength(0);
2521 }
2522 else
2523 {
2526 }
2527
2528 return rWrt;
2529}
2530
2531static Writer& OutCSS1_SvxLanguage( Writer& rWrt, const SfxPoolItem& rHt )
2532{
2533 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2534
2535 // Only export Language rules
2536 if( rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2537 return rWrt;
2538
2539 sal_uInt16 nScript = CSS1_OUTMODE_WESTERN;
2540 switch( rHt.Which() )
2541 {
2542 case RES_CHRATR_CJK_LANGUAGE: nScript = CSS1_OUTMODE_CJK; break;
2543 case RES_CHRATR_CTL_LANGUAGE: nScript = CSS1_OUTMODE_CTL; break;
2544 }
2545 if( !rHTMLWrt.IsCSS1Script( nScript ) )
2546 return rWrt;
2547
2548 OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2549 "write Language as Hint?" );
2550
2551 LanguageType eLang = static_cast<const SvxLanguageItem &>(rHt).GetLanguage();
2552 if( LANGUAGE_DONTKNOW == eLang )
2553 return rWrt;
2554
2555 OUString sOut = LanguageTag::convertToBcp47( eLang );
2556
2557 rHTMLWrt.OutCSS1_Property( sCSS1_P_so_language, sOut );
2558
2559 return rWrt;
2560}
2561
2562static Writer& OutCSS1_SvxUnderline( Writer& rWrt, const SfxPoolItem& rHt )
2563{
2564 // This function only exports Hints!
2565 // Otherwise OutCSS1_SvxTextLn_SvxCrOut_SvxBlink() is called directly.
2566
2567 if( static_cast<SwHTMLWriter&>(rWrt).IsCSS1Source(CSS1_OUTMODE_HINT) )
2569 static_cast<const SvxUnderlineItem *>(&rHt), nullptr, nullptr, nullptr );
2570
2571 return rWrt;
2572}
2573
2574static Writer& OutCSS1_SvxOverline( Writer& rWrt, const SfxPoolItem& rHt )
2575{
2576 // This function only exports Hints!
2577 // Otherwise OutCSS1_SvxTextLn_SvxCrOut_SvxBlink() is called directly.
2578
2579 if( static_cast<SwHTMLWriter&>(rWrt).IsCSS1Source(CSS1_OUTMODE_HINT) )
2581 nullptr, static_cast<const SvxOverlineItem *>(&rHt), nullptr, nullptr );
2582
2583 return rWrt;
2584}
2585
2586static Writer& OutCSS1_SvxHidden( Writer& rWrt, const SfxPoolItem& rHt )
2587{
2588 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2589
2590 if ( static_cast<const SvxCharHiddenItem&>(rHt).GetValue() )
2592
2593 return rWrt;
2594}
2595
2597{
2598 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2599
2600 sal_uInt16 nScript = CSS1_OUTMODE_WESTERN;
2601 switch( rHt.Which() )
2602 {
2603 case RES_CHRATR_CJK_WEIGHT: nScript = CSS1_OUTMODE_CJK; break;
2604 case RES_CHRATR_CTL_WEIGHT: nScript = CSS1_OUTMODE_CTL; break;
2605 }
2606 if( !rHTMLWrt.IsCSS1Script( nScript ) )
2607 return rWrt;
2608
2609 const char *pStr = nullptr;
2610 switch( static_cast<const SvxWeightItem&>(rHt).GetWeight() )
2611 {
2612 case WEIGHT_ULTRALIGHT: pStr = sCSS1_PV_extra_light; break;
2613 case WEIGHT_LIGHT: pStr = sCSS1_PV_light; break;
2614 case WEIGHT_SEMILIGHT: pStr = sCSS1_PV_demi_light; break;
2615 case WEIGHT_NORMAL: pStr = sCSS1_PV_normal; break;
2616 case WEIGHT_SEMIBOLD: pStr = sCSS1_PV_demi_bold; break;
2617 case WEIGHT_BOLD:
2618 if( !rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2619 {
2620 // this also works in HTML does not need to be written as
2621 // a STYLE-Options, and must not be written as Hint
2622 OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2623 "write bold as Hint?" );
2624 pStr = sCSS1_PV_bold;
2625 }
2626 break;
2627 case WEIGHT_ULTRABOLD: pStr = sCSS1_PV_extra_bold; break;
2628 default:
2629 pStr = sCSS1_PV_normal;
2630 }
2631
2632 if( pStr )
2634
2635 return rWrt;
2636}
2637
2638static Writer& OutCSS1_SvxBlink( Writer& rWrt, const SfxPoolItem& rHt )
2639{
2640 // This function only exports Hints!
2641 // Otherwise OutCSS1_SvxTextLn_SvxCrOut_SvxBlink() is called directly.
2642
2643 if( static_cast<SwHTMLWriter&>(rWrt).IsCSS1Source(CSS1_OUTMODE_HINT) )
2645 nullptr, nullptr, nullptr, static_cast<const SvxBlinkItem *>(&rHt) );
2646
2647 return rWrt;
2648}
2649
2651{
2652 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2653
2654 // Netscape4 has big problems with cell heights if the line spacing is
2655 // changed within a table and the width of the table is not calculated
2656 // automatically (== if there is a WIDTH-Option)
2657 if( rHTMLWrt.m_bOutTable && rHTMLWrt.m_bCfgNetscape4 )
2658 return rWrt;
2659
2660 const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(rHt);
2661
2662 sal_uInt16 nHeight = 0;
2663 sal_uInt16 nPercentHeight = 0;
2664 SvxLineSpaceRule eLineSpace = rLSItem.GetLineSpaceRule();
2665 switch( rLSItem.GetInterLineSpaceRule() )
2666 {
2667 case SvxInterLineSpaceRule::Off:
2668 case SvxInterLineSpaceRule::Fix:
2669 {
2670 switch( eLineSpace )
2671 {
2672 case SvxLineSpaceRule::Min:
2673 case SvxLineSpaceRule::Fix:
2674 nHeight = rLSItem.GetLineHeight();
2675 break;
2676 case SvxLineSpaceRule::Auto:
2677 nPercentHeight = 100;
2678 break;
2679 default:
2680 ;
2681 }
2682 }
2683 break;
2684 case SvxInterLineSpaceRule::Prop:
2685 nPercentHeight = rLSItem.GetPropLineSpace();
2686 break;
2687
2688 default:
2689 ;
2690 }
2691
2692 if( nHeight )
2693 rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_line_height, static_cast<tools::Long>(nHeight) );
2694 else if( nPercentHeight &&
2695 !(nPercentHeight < 115 && rHTMLWrt.m_bParaDotLeaders )) // avoid HTML scrollbars and missing descenders
2696 {
2697 OString sHeight(OString::number(nPercentHeight) + "%");
2698 rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_line_height, sHeight);
2699 }
2700
2701 return rWrt;
2702}
2703
2704static Writer& OutCSS1_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt )
2705{
2706 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2707
2708 // Export Alignment in Style-Option only if the Tag does not allow ALIGN=xxx
2709 if( rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) &&
2710 !rHTMLWrt.m_bNoAlign)
2711 return rWrt;
2712
2713 const char* pStr = nullptr;
2714 switch( static_cast<const SvxAdjustItem&>(rHt).GetAdjust() )
2715 {
2716 case SvxAdjust::Left: pStr = sCSS1_PV_left; break;
2717 case SvxAdjust::Right: pStr = sCSS1_PV_right; break;
2718 case SvxAdjust::Block: pStr = sCSS1_PV_justify; break;
2719 case SvxAdjust::Center: pStr = sCSS1_PV_center; break;
2720 default:
2721 ;
2722 }
2723
2724 if( pStr )
2725 rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_align, pStr );
2726
2727 return rWrt;
2728}
2729
2731{
2732 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2733
2734 const char *pStr = static_cast<const SvxFormatSplitItem&>(rHt).GetValue()
2738
2739 return rWrt;
2740}
2741
2743{
2744 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2745
2746 const char *pStr = static_cast<const SwFormatLayoutSplit&>(rHt).GetValue()
2750
2751 return rWrt;
2752}
2753
2754static Writer& OutCSS1_SvxWidows( Writer& rWrt, const SfxPoolItem& rHt )
2755{
2756 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2757
2758 OString aStr(OString::number(static_cast<const SvxWidowsItem&>(rHt).GetValue()));
2760
2761 return rWrt;
2762}
2763
2764static Writer& OutCSS1_SvxOrphans( Writer& rWrt, const SfxPoolItem& rHt )
2765{
2766 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2767
2768 OString aStr(OString::number(static_cast<const SvxOrphansItem&>(rHt).GetValue()));
2770
2771 return rWrt;
2772}
2773
2775 const SwFormatDrop& rDrop,
2776 const SfxItemSet *pCharFormatItemSet )
2777{
2778 // Text flows around on right side
2780
2781 // number of lines -> use % for Font-Height!
2782 OString sOut(OString::number(rDrop.GetLines()*100) + "%");
2784
2785 // distance to Text = right margin
2786 sal_uInt16 nDistance = rDrop.GetDistance();
2787 if( nDistance > 0 )
2788 rHWrt.OutCSS1_UnitProperty( sCSS1_P_margin_right, nDistance );
2789
2790 const SwCharFormat *pDCCharFormat = rDrop.GetCharFormat();
2791 if( pCharFormatItemSet )
2792 rHWrt.OutCSS1_SfxItemSet( *pCharFormatItemSet );
2793 else if( pDCCharFormat )
2794 rHWrt.OutCSS1_SfxItemSet( pDCCharFormat->GetAttrSet() );
2796 rHWrt.Strm().WriteCharPtr( sCSS1_rule_end );
2797
2798}
2799
2800static Writer& OutCSS1_SwFormatDrop( Writer& rWrt, const SfxPoolItem& rHt )
2801{
2802 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2803
2804 // never export as an Option of a paragraph, but only as Hints
2805 if( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT) )
2806 return rWrt;
2807
2808 if( rHTMLWrt.m_bTagOn )
2809 {
2810 SwCSS1OutMode aMode( rHTMLWrt,
2812 CSS1_OUTMODE_DROPCAP, nullptr );
2813
2814 OutCSS1_SwFormatDropAttrs( rHTMLWrt, static_cast<const SwFormatDrop&>(rHt) );
2815 // A "> is already printed by the calling OutCSS1_HintAsSpanTag.
2816 }
2817 else
2818 {
2819 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OStringConcatenation(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false );
2820 }
2821
2822 return rWrt;
2823}
2824
2826 Css1FrameSize nMode )
2827{
2828 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2829
2830 const SwFormatFrameSize& rFSItem = static_cast<const SwFormatFrameSize&>(rHt);
2831
2832 if( nMode & Css1FrameSize::Width )
2833 {
2834 sal_uInt8 nPercentWidth = rFSItem.GetWidthPercent();
2835 if( nPercentWidth )
2836 {
2837 OString sOut(OString::number(nPercentWidth) + "%");
2838 rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_width, sOut);
2839 }
2840 else if( nMode & Css1FrameSize::Pixel )
2841 {
2843 rFSItem.GetSize().Width(), false );
2844 }
2845 else
2846 {
2848 rFSItem.GetSize().Width() );
2849 }
2850 }
2851
2852 return rWrt;
2853}
2854
2855static Writer& OutCSS1_SvxLRSpace( Writer& rWrt, const SfxPoolItem& rHt )
2856{
2857 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2858
2859 const SvxLRSpaceItem& rLRItem = static_cast<const SvxLRSpaceItem&>(rHt);
2860
2861 // No Export of a firm attribute is needed if the new values
2862 // match that of the current template
2863
2864 // A left margin can exist because of a list nearby
2865 tools::Long nLeftMargin = rLRItem.GetTextLeft() - rHTMLWrt.m_nLeftMargin;
2866 if( rHTMLWrt.m_nDfltLeftMargin != nLeftMargin )
2867 {
2869
2870 // max-width = max-width - margin-left for TOC paragraphs with dot leaders
2871 if( rHTMLWrt.m_bParaDotLeaders )
2873
2874 }
2875
2876 if( rHTMLWrt.m_nDfltRightMargin != rLRItem.GetRight() )
2877 {
2878 rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_margin_right, rLRItem.GetRight() );
2879 }
2880
2881 // The LineIndent of the first line might contain the room for numbering
2882 tools::Long nFirstLineIndent = static_cast<tools::Long>(rLRItem.GetTextFirstLineOffset()) -
2883 rHTMLWrt.m_nFirstLineIndent;
2884 if( rHTMLWrt.m_nDfltFirstLineIndent != nFirstLineIndent )
2885 {
2887 nFirstLineIndent );
2888 }
2889
2890 return rWrt;
2891}
2892
2893static Writer& OutCSS1_SvxULSpace( Writer& rWrt, const SfxPoolItem& rHt )
2894{
2895 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2896
2897 const SvxULSpaceItem& rULItem = static_cast<const SvxULSpaceItem&>(rHt);
2898
2899 if( rHTMLWrt.m_nDfltTopMargin != rULItem.GetUpper() )
2900 {
2902 static_cast<tools::Long>(rULItem.GetUpper()) );
2903 }
2904
2905 if( rHTMLWrt.m_nDfltBottomMargin != rULItem.GetLower() )
2906 {
2908 static_cast<tools::Long>(rULItem.GetLower()) );
2909 }
2910
2911 return rWrt;
2912}
2913
2915 const SvxULSpaceItem *pULItem,
2916 const SvxLRSpaceItem *pLRItem )
2917{
2918 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2919
2920 if( pLRItem && pULItem &&
2921 pLRItem->GetLeft() == pLRItem->GetRight() &&
2922 pLRItem->GetLeft() == pULItem->GetUpper() &&
2923 pLRItem->GetLeft() == pULItem->GetLower() &&
2924 pLRItem->GetLeft() != rHTMLWrt.m_nDfltLeftMargin &&
2925 pLRItem->GetRight() != rHTMLWrt.m_nDfltRightMargin &&
2926 pULItem->GetUpper() != rHTMLWrt.m_nDfltTopMargin &&
2927 pULItem->GetLower() != rHTMLWrt.m_nDfltBottomMargin )
2928 {
2929 rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_margin, pLRItem->GetLeft() );
2930 }
2931 else
2932 {
2933 if( pLRItem )
2934 OutCSS1_SvxLRSpace( rWrt, *pLRItem );
2935 if( pULItem )
2936 OutCSS1_SvxULSpace( rWrt, *pULItem );
2937 }
2938
2939 return rWrt;
2940}
2941
2943 const SfxItemSet& rItemSet )
2944{
2945 const SvxLRSpaceItem *pLRSpace = rItemSet.GetItemIfSet( RES_LR_SPACE, false/*bDeep*/ );
2946 const SvxULSpaceItem *pULSpace = rItemSet.GetItemIfSet( RES_UL_SPACE, false/*bDeep*/ );
2947
2948 if( pLRSpace || pULSpace )
2949 OutCSS1_SvxULSpace_SvxLRSpace( rWrt, pULSpace, pLRSpace );
2950
2951 return rWrt;
2952}
2953
2955 const SvxFormatBreakItem *pBreakItem,
2956 const SwFormatPageDesc *pPDescItem,
2957 const SvxFormatKeepItem *pKeepItem )
2958{
2959 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2960
2961 if( !rHTMLWrt.IsHTMLMode(HTMLMODE_PRINT_EXT) )
2962 return rWrt;
2963
2964 const char *pBreakBefore = nullptr;
2965 const char *pBreakAfter = nullptr;
2966
2967 if( pKeepItem )
2968 {
2969 pBreakAfter = pKeepItem->GetValue() ? sCSS1_PV_avoid : sCSS1_PV_auto;
2970 }
2971 if( pBreakItem )
2972 {
2973 switch( pBreakItem->GetBreak() )
2974 {
2975 case SvxBreak::NONE:
2976 pBreakBefore = sCSS1_PV_auto;
2977 if( !pBreakAfter )
2978 pBreakAfter = sCSS1_PV_auto;
2979 break;
2980
2981 case SvxBreak::PageBefore:
2982 pBreakBefore = sCSS1_PV_always;
2983 break;
2984
2985 case SvxBreak::PageAfter:
2986 pBreakAfter= sCSS1_PV_always;
2987 break;
2988
2989 default:
2990 ;
2991 }
2992 }
2993 if( pPDescItem )
2994 {
2995 const SwPageDesc *pPDesc = pPDescItem->GetPageDesc();
2996 if( pPDesc )
2997 {
2998 switch( pPDesc->GetPoolFormatId() )
2999 {
3000 case RES_POOLPAGE_LEFT: pBreakBefore = sCSS1_PV_left; break;
3001 case RES_POOLPAGE_RIGHT: pBreakBefore = sCSS1_PV_right; break;
3002 default: pBreakBefore = sCSS1_PV_always; break;
3003 }
3004 }
3005 else if( !pBreakBefore )
3006 {
3007 pBreakBefore = sCSS1_PV_auto;
3008 }
3009 }
3010
3011 if (rHTMLWrt.mbSkipHeaderFooter)
3012 // No page break when writing only a fragment.
3013 return rWrt;
3014
3015 if( pBreakBefore )
3017 pBreakBefore );
3018 if( pBreakAfter )
3020 pBreakAfter );
3021
3022 return rWrt;
3023}
3024
3026 const SfxItemSet& rItemSet,
3027 bool bDeep )
3028{
3029 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
3030 const SvxFormatBreakItem *pBreakItem = rItemSet.GetItemIfSet( RES_BREAK, bDeep );
3031
3032 const SwFormatPageDesc *pPDescItem = nullptr;
3033 if( !rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) ||
3034 !rHTMLWrt.m_bCSS1IgnoreFirstPageDesc ||
3035 rHTMLWrt.m_pStartNdIdx->GetIndex() !=
3036 rHTMLWrt.m_pCurrentPam->GetPoint()->GetNodeIndex() )
3037 pPDescItem = rItemSet.GetItemIfSet( RES_PAGEDESC, bDeep );
3038
3039 const SvxFormatKeepItem *pKeepItem = rItemSet.GetItemIfSet( RES_KEEP, bDeep );
3040
3041 if( pBreakItem || pPDescItem || pKeepItem )
3043 pPDescItem, pKeepItem );
3044
3045 return rWrt;
3046}
3047
3048// Wrapper for OutCSS1_SfxItemSet etc.
3049static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt )
3050{
3051 OutCSS1_SvxBrush( rWrt, rHt, sw::Css1Background::Attr, nullptr );
3052 return rWrt;
3053}
3054
3055static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt,
3056 sw::Css1Background nMode,
3057 const OUString* pGraphicName)
3058{
3059 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
3060
3061 // The Character-Attribute is skipped, if we are about to
3062 // exporting options
3063 if( rHt.Which() < RES_CHRATR_END &&
3064 rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
3065 return rWrt;
3066
3067 // start getting a few values
3068// const Brush &rBrush = static_cast<const SvxBrushItem &>(rHt).GetBrush();
3069 const Color & rColor = static_cast<const SvxBrushItem &>(rHt).GetColor();
3070 OUString aLink = pGraphicName ? *pGraphicName
3071 : static_cast<const SvxBrushItem &>(rHt).GetGraphicLink();
3072 SvxGraphicPosition ePos = static_cast<const SvxBrushItem &>(rHt).GetGraphicPos();
3073 if( sw::Css1Background::Page == nMode && !rHTMLWrt.mbEmbedImages )
3074 {
3075 // page style images are exported if not tiled
3076 if( aLink.isEmpty() || GPOS_TILED==ePos )
3077 return rWrt;
3078 }
3079
3080 // get the color
3081 bool bColor = false;
3083 bool bTransparent = (rColor == COL_TRANSPARENT);
3084 Color aColor;
3085 if( !bTransparent )
3086 {
3087 aColor = rColor;
3088 bColor = true;
3089 }
3090
3091 // and now the Graphic
3092 OUString aGraphicInBase64;
3093
3094 // Embedded Graphic -> export WriteEmbedded
3095 const Graphic* pGrf = nullptr;
3096 if( rHTMLWrt.mbEmbedImages || aLink.isEmpty())
3097 {
3098 pGrf = static_cast<const SvxBrushItem &>(rHt).GetGraphic();
3099 if( pGrf )
3100 {
3101 if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) )
3102 {
3103 rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD;
3104 }
3105 }
3106 aLink.clear();
3107 }
3108 else if( !pGraphicName && rHTMLWrt.m_bCfgCpyLinkedGrfs )
3109 {
3110 OUString aGraphicAsLink = aLink;
3111 rWrt.CopyLocalFileToINet( aGraphicAsLink );
3112 aLink = aGraphicAsLink;
3113 }
3114 // In tables we only export something if there is a Graphic
3115 if( (nMode == sw::Css1Background::Table || nMode == sw::Css1Background::TableRow) && !pGrf && !aLink.isEmpty())
3116 return rWrt;
3117
3118 // if necessary, add the orientation of the Graphic
3119 const char *pRepeat = nullptr, *pHori = nullptr, *pVert = nullptr;
3120 if( pGrf || !aLink.isEmpty() )
3121 {
3122 if( GPOS_TILED==ePos )
3123 {
3124 pRepeat = sCSS1_PV_repeat;
3125 }
3126 else
3127 {
3128 switch( ePos )
3129 {
3130 case GPOS_LT:
3131 case GPOS_MT:
3132 case GPOS_RT:
3133 pHori = sCSS1_PV_top;
3134 break;
3135
3136 case GPOS_LM:
3137 case GPOS_MM:
3138 case GPOS_RM:
3139 pHori = sCSS1_PV_middle;
3140 break;
3141
3142 case GPOS_LB:
3143 case GPOS_MB:
3144 case GPOS_RB:
3145 pHori = sCSS1_PV_bottom;
3146 break;
3147
3148 default:
3149 ;
3150 }
3151
3152 switch( ePos )
3153 {
3154 case GPOS_LT:
3155 case GPOS_LM:
3156 case GPOS_LB:
3157 pVert = sCSS1_PV_left;
3158 break;
3159
3160 case GPOS_MT:
3161 case GPOS_MM:
3162 case GPOS_MB:
3163 pVert = sCSS1_PV_center;
3164 break;
3165
3166 case GPOS_RT:
3167 case GPOS_RM:
3168 case GPOS_RB:
3169 pVert = sCSS1_PV_right;
3170 break;
3171
3172 default:
3173 ;
3174 }
3175
3176 if( pHori || pVert )
3177 pRepeat = sCSS1_PV_no_repeat;
3178 }
3179 }
3180
3181 // now build the string
3182 OUString sOut;
3183 if( !pGrf && aLink.isEmpty() && !bColor )
3184 {
3185 // no color and no Link, but a transparent Brush
3186 if( bTransparent && sw::Css1Background::Fly != nMode )
3187 sOut += OStringToOUString(sCSS1_PV_transparent, RTL_TEXTENCODING_ASCII_US);
3188 }
3189 else
3190 {
3191 if( bColor )
3192 {
3193 OString sTmp(GetCSS1_Color(aColor));
3194 sOut += OStringToOUString(sTmp, RTL_TEXTENCODING_ASCII_US);
3195 }
3196
3197 if( pGrf || !aLink.isEmpty() )
3198 {
3199 if( bColor )
3200 sOut += " ";
3201
3202 if(pGrf)
3203 {
3204 sOut += OStringToOUString(sCSS1_url, RTL_TEXTENCODING_ASCII_US) +
3205 "(\'" OOO_STRING_SVTOOLS_HTML_O_data ":" + aGraphicInBase64 + "\')";
3206 }
3207 else
3208 {
3209 sOut += OStringToOUString(sCSS1_url, RTL_TEXTENCODING_ASCII_US)+
3211 aLink) + ")";
3212 }
3213
3214 if( pRepeat )
3215 {
3216 sOut += " " + OStringToOUString(pRepeat, RTL_TEXTENCODING_ASCII_US);
3217 }
3218
3219 if( pHori )
3220 {
3221 sOut += " " + OStringToOUString(pHori, RTL_TEXTENCODING_ASCII_US);
3222 }
3223 if( pVert )
3224 {
3225 sOut += " " + OStringToOUString(pVert, RTL_TEXTENCODING_ASCII_US);
3226 }
3227
3228 sOut += " " + OStringToOUString(sCSS1_PV_scroll, RTL_TEXTENCODING_ASCII_US) + " ";
3229 }
3230 }
3231
3232 if( !sOut.isEmpty() )
3233 {
3234 rHTMLWrt.OutCSS1_Property(sCSS1_P_background, std::string_view(), &sOut,
3235 nMode);
3236 }
3237
3238 return rWrt;
3239}
3240
3242 const char *pProperty,
3243 const SvxBorderLine *pLine )
3244{
3245 if( !pLine || pLine->isEmpty() )
3246 {
3247 rHTMLWrt.OutCSS1_PropertyAscii( pProperty, sCSS1_PV_none );
3248 return;
3249 }
3250
3251 sal_Int32 nWidth = pLine->GetWidth();
3252
3253 OStringBuffer sOut;
3255 nWidth <= Application::GetDefaultDevice()->PixelToLogic(
3256 Size( 1, 1 ), MapMode( MapUnit::MapTwip) ).Width() )
3257 {
3258 // If the width is smaller than one pixel, then export as 1px
3259 // so that Netscape and IE show the line.
3260 sOut.append("1px");
3261 }
3262 else
3263 {
3264 nWidth *= 5; // 1/100pt
3265
3266 // width in n.nn pt
3267 sOut.append(OString::number(nWidth / 100) + "." + OString::number((nWidth/10) % 10) +
3268 OString::number(nWidth % 10) + sCSS1_UNIT_pt);
3269 }
3270
3271 // Line-Style: solid or double
3272 sOut.append(' ');
3273 switch (pLine->GetBorderLineStyle())
3274 {
3275 case SvxBorderLineStyle::SOLID:
3276 sOut.append(sCSS1_PV_solid);
3277 break;
3278 case SvxBorderLineStyle::DOTTED:
3279 sOut.append(sCSS1_PV_dotted);
3280 break;
3281 case SvxBorderLineStyle::DASHED:
3282 sOut.append(sCSS1_PV_dashed);
3283 break;
3284 case SvxBorderLineStyle::DOUBLE:
3285 case SvxBorderLineStyle::THINTHICK_SMALLGAP:
3286 case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
3287 case SvxBorderLineStyle::THINTHICK_LARGEGAP:
3288 case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
3289 case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
3290 case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
3291 sOut.append(sCSS1_PV_double);
3292 break;
3293 case SvxBorderLineStyle::EMBOSSED:
3294 sOut.append(sCSS1_PV_ridge);
3295 break;
3296 case SvxBorderLineStyle::ENGRAVED:
3297 sOut.append(sCSS1_PV_groove);
3298 break;
3299 case SvxBorderLineStyle::INSET:
3300 sOut.append(sCSS1_PV_inset);
3301 break;
3302 case SvxBorderLineStyle::OUTSET:
3303 sOut.append(sCSS1_PV_outset);
3304 break;
3305 default:
3306 sOut.append(sCSS1_PV_none);
3307 }
3308 sOut.append(' ');
3309
3310 // and also the color
3311 sOut.append(GetCSS1_Color(pLine->GetColor()));
3312
3313 rHTMLWrt.OutCSS1_PropertyAscii(pProperty, sOut);
3314}
3315
3317{
3318 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
3319
3320 // Avoid interference between character and paragraph attributes
3321 if( rHt.Which() < RES_CHRATR_END &&
3322 rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
3323 return rWrt;
3324
3325 if( rHt.Which() == RES_CHRATR_BOX )
3326 {
3327 if( rHTMLWrt.m_bTagOn )
3328 {
3329 // Inline-block to make the line height changing correspond to the character border
3330 rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_display, "inline-block");
3331 }
3332 else
3333 {
3334 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OStringConcatenation(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false );
3335 return rWrt;
3336 }
3337 }
3338
3339 const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(rHt);
3340 const SvxBorderLine *pTop = rBoxItem.GetTop();
3341 const SvxBorderLine *pBottom = rBoxItem.GetBottom();
3342 const SvxBorderLine *pLeft = rBoxItem.GetLeft();
3343 const SvxBorderLine *pRight = rBoxItem.GetRight();
3344
3345 if( (pTop && pBottom && pLeft && pRight &&
3346 *pTop == *pBottom && *pTop == *pLeft && *pTop == *pRight) ||
3347 (!pTop && !pBottom && !pLeft && !pRight) )
3348 {
3349 // all Lines are set and equal, or all Lines are not set
3350 // => border : ...
3351 OutCSS1_SvxBorderLine( rHTMLWrt, sCSS1_P_border, pTop );
3352 }
3353 else
3354 {
3355 // otherwise export all Lines separately
3356 OutCSS1_SvxBorderLine( rHTMLWrt, sCSS1_P_border_top, pTop );
3357 OutCSS1_SvxBorderLine( rHTMLWrt, sCSS1_P_border_bottom, pBottom );
3358 OutCSS1_SvxBorderLine( rHTMLWrt, sCSS1_P_border_left, pLeft );
3359 OutCSS1_SvxBorderLine( rHTMLWrt, sCSS1_P_border_right, pRight );
3360 }
3361
3362 tools::Long nTopDist = pTop ? rBoxItem.GetDistance( SvxBoxItemLine::TOP ) : 0;
3363 tools::Long nBottomDist = pBottom ? rBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ) : 0;
3364 tools::Long nLeftDist = pLeft ? rBoxItem.GetDistance( SvxBoxItemLine::LEFT ) : 0;
3365 tools::Long nRightDist = pRight ? rBoxItem.GetDistance( SvxBoxItemLine::RIGHT ) : 0;
3366
3367 if( nTopDist == nBottomDist && nLeftDist == nRightDist )
3368 {
3369 OStringBuffer sVal;
3370 AddUnitPropertyValue(sVal, nTopDist, rHTMLWrt.GetCSS1Unit());
3371 if( nTopDist != nLeftDist )
3372 {
3373 sVal.append(' ');
3374 AddUnitPropertyValue(sVal, nLeftDist, rHTMLWrt.GetCSS1Unit());
3375 }
3376 rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_padding, sVal);
3377 }
3378 else
3379 {
3380 rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_padding_top, nTopDist );
3381 rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_padding_bottom, nBottomDist );
3382 rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_padding_left, nLeftDist );
3383 rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_padding_right, nRightDist );
3384 }
3385
3386 return rWrt;
3387}
3388
3390{
3391 SwHTMLWriter& rHTMLWrt = static_cast< SwHTMLWriter& >( rWrt );
3392
3393 // Language will be exported rules only
3394 if( !rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_TEMPLATE ) )
3395 return rWrt;
3396
3397 SvxFrameDirection nDir =
3398 static_cast< const SvxFrameDirectionItem& >( rHt ).GetValue();
3399 const char* pStr = nullptr;
3400 switch( nDir )
3401 {
3402 case SvxFrameDirection::Horizontal_LR_TB:
3403 case SvxFrameDirection::Vertical_LR_TB:
3404 pStr = sCSS1_PV_ltr;
3405 break;
3406 case SvxFrameDirection::Horizontal_RL_TB:
3407 case SvxFrameDirection::Vertical_RL_TB:
3408 pStr = sCSS1_PV_rtl;
3409 break;
3410 case SvxFrameDirection::Environment:
3411 pStr = sCSS1_PV_inherit;
3412 break;
3413 default: break;
3414 }
3415
3416 if( pStr )
3417 rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_direction, pStr );
3418
3419 return rWrt;
3420}
3421
3422/*
3423 * Place here the table for the HTML-Function-Pointer to the
3424 * Export-Functions.
3425 * They are local structures, only needed within the HTML-DLL.
3426 */
3427
3429/* RES_CHRATR_CASEMAP */ OutCSS1_SvxCaseMap,
3430/* RES_CHRATR_CHARSETCOLOR */ nullptr,
3431/* RES_CHRATR_COLOR */ OutCSS1_SvxColor,
3432/* RES_CHRATR_CONTOUR */ nullptr,
3433/* RES_CHRATR_CROSSEDOUT */ OutCSS1_SvxCrossedOut,
3434/* RES_CHRATR_ESCAPEMENT */ nullptr,
3435/* RES_CHRATR_FONT */ OutCSS1_SvxFont,
3436/* RES_CHRATR_FONTSIZE */ OutCSS1_SvxFontHeight,
3437/* RES_CHRATR_KERNING */ OutCSS1_SvxKerning,
3438/* RES_CHRATR_LANGUAGE */ OutCSS1_SvxLanguage,
3439/* RES_CHRATR_POSTURE */ OutCSS1_SvxPosture,
3440/* RES_CHRATR_UNUSED1*/ nullptr,
3441/* RES_CHRATR_SHADOWED */ nullptr,
3442/* RES_CHRATR_UNDERLINE */ OutCSS1_SvxUnderline,
3443/* RES_CHRATR_WEIGHT */ OutCSS1_SvxFontWeight,
3444/* RES_CHRATR_WORDLINEMODE */ nullptr,
3445/* RES_CHRATR_AUTOKERN */ nullptr,
3446/* RES_CHRATR_BLINK */ OutCSS1_SvxBlink,
3447/* RES_CHRATR_NOHYPHEN */ nullptr, // new: don't separate
3448/* RES_CHRATR_UNUSED2 */ nullptr,
3449/* RES_CHRATR_BACKGROUND */ OutCSS1_SvxBrush, // new: character background
3450/* RES_CHRATR_CJK_FONT */ OutCSS1_SvxFont,
3451/* RES_CHRATR_CJK_FONTSIZE */ OutCSS1_SvxFontHeight,
3452/* RES_CHRATR_CJK_LANGUAGE */ OutCSS1_SvxLanguage,
3453/* RES_CHRATR_CJK_POSTURE */ OutCSS1_SvxPosture,
3454/* RES_CHRATR_CJK_WEIGHT */ OutCSS1_SvxFontWeight,
3455/* RES_CHRATR_CTL_FONT */ OutCSS1_SvxFont,
3456/* RES_CHRATR_CTL_FONTSIZE */ OutCSS1_SvxFontHeight,
3457/* RES_CHRATR_CTL_LANGUAGE */ OutCSS1_SvxLanguage,
3458/* RES_CHRATR_CTL_POSTURE */ OutCSS1_SvxPosture,
3459/* RES_CHRATR_CTL_WEIGHT */ OutCSS1_SvxFontWeight,
3460/* RES_CHRATR_ROTATE */ nullptr,
3461/* RES_CHRATR_EMPHASIS_MARK */ nullptr,
3462/* RES_CHRATR_TWO_LINES */ nullptr,
3463/* RES_CHRATR_SCALEW */ nullptr,
3464/* RES_CHRATR_RELIEF */ nullptr,
3465/* RES_CHRATR_HIDDEN */ OutCSS1_SvxHidden,
3466/* RES_CHRATR_OVERLINE */ OutCSS1_SvxOverline,
3467/* RES_CHRATR_RSID */ nullptr,
3468/* RES_CHRATR_BOX */ OutCSS1_SvxBox,
3469/* RES_CHRATR_SHADOW */ nullptr,
3470/* RES_CHRATR_HIGHLIGHT */ nullptr,
3471/* RES_CHRATR_GRABBAG */ nullptr,
3472/* RES_CHRATR_BIDIRTL */ nullptr,
3473/* RES_CHRATR_IDCTHINT */ nullptr,
3474
3475/* RES_TXTATR_REFMARK */ nullptr,
3476/* RES_TXTATR_TOXMARK */ nullptr,
3477/* RES_TXTATR_META */ nullptr,
3478/* RES_TXTATR_METAFIELD */ nullptr,
3479/* RES_TXTATR_AUTOFMT */ nullptr,
3480/* RES_TXTATR_INETFMT */ nullptr,
3481/* RES_TXTATR_CHARFMT */ nullptr,
3482/* RES_TXTATR_CJK_RUBY */ nullptr,
3483/* RES_TXTATR_UNKNOWN_CONTAINER */ nullptr,
3484/* RES_TXTATR_INPUTFIELD */ nullptr,
3485/* RES_TXTATR_CONTENTCONTROL */ nullptr,
3486
3487/* RES_TXTATR_FIELD */ nullptr,
3488/* RES_TXTATR_FLYCNT */ nullptr,
3489/* RES_TXTATR_FTN */ nullptr,
3490/* RES_TXTATR_ANNOTATION */ nullptr,
3491/* RES_TXTATR_LINEBREAK */ nullptr,
3492/* RES_TXTATR_DUMMY1 */ nullptr, // Dummy:
3493
3494/* RES_PARATR_LINESPACING */ OutCSS1_SvxLineSpacing,
3495/* RES_PARATR_ADJUST */ OutCSS1_SvxAdjust,
3496/* RES_PARATR_SPLIT */ OutCSS1_SvxFormatSplit,
3497/* RES_PARATR_ORPHANS */ OutCSS1_SvxOrphans,
3498/* RES_PARATR_WIDOWS */ OutCSS1_SvxWidows,
3499/* RES_PARATR_TABSTOP */ nullptr,
3500/* RES_PARATR_HYPHENZONE*/ nullptr,
3501/* RES_PARATR_DROP */ OutCSS1_SwFormatDrop,
3502/* RES_PARATR_REGISTER */ nullptr, // new: register-true
3503/* RES_PARATR_NUMRULE */ nullptr,
3504/* RES_PARATR_SCRIPTSPACE */ nullptr,
3505/* RES_PARATR_HANGINGPUNCTUATION */ nullptr,
3506/* RES_PARATR_FORBIDDEN_RULES */ nullptr, // new
3507/* RES_PARATR_VERTALIGN */ nullptr, // new
3508/* RES_PARATR_SNAPTOGRID*/ nullptr, // new
3509/* RES_PARATR_CONNECT_TO_BORDER */ nullptr, // new
3510/* RES_PARATR_OUTLINELEVEL */ nullptr, // new since cws outlinelevel
3511/* RES_PARATR_RSID */ nullptr, // new
3512/* RES_PARATR_GRABBAG */ nullptr,
3513
3514/* RES_PARATR_LIST_ID */ nullptr, // new
3515/* RES_PARATR_LIST_LEVEL */ nullptr, // new
3516/* RES_PARATR_LIST_ISRESTART */ nullptr, // new
3517/* RES_PARATR_LIST_RESTARTVALUE */ nullptr, // new
3518/* RES_PARATR_LIST_ISCOUNTED */ nullptr, // new
3519/* RES_PARATR_LIST_AUTOFMT */ nullptr, // new
3520
3521/* RES_FILL_ORDER */ nullptr,
3522/* RES_FRM_SIZE */ nullptr,
3523/* RES_PAPER_BIN */ nullptr,
3524/* RES_LR_SPACE */ OutCSS1_SvxLRSpace,
3525/* RES_UL_SPACE */ OutCSS1_SvxULSpace,
3526/* RES_PAGEDESC */ nullptr,
3527/* RES_BREAK */ nullptr,
3528/* RES_CNTNT */ nullptr,
3529/* RES_HEADER */ nullptr,
3530/* RES_FOOTER */ nullptr,
3531/* RES_PRINT */ nullptr,
3532/* RES_OPAQUE */ nullptr,
3533/* RES_PROTECT */ nullptr,
3534/* RES_SURROUND */ nullptr,
3535/* RES_VERT_ORIENT */ nullptr,
3536/* RES_HORI_ORIENT */ nullptr,
3537/* RES_ANCHOR */ nullptr,
3538/* RES_BACKGROUND */ OutCSS1_SvxBrush,
3539/* RES_BOX */ OutCSS1_SvxBox,
3540/* RES_SHADOW */ nullptr,
3541/* RES_FRMMACRO */ nullptr,
3542/* RES_COL */ nullptr,
3543/* RES_KEEP */ nullptr,
3544/* RES_URL */ nullptr,
3545/* RES_EDIT_IN_READONLY */ nullptr,
3546/* RES_LAYOUT_SPLIT */ nullptr,
3547/* RES_CHAIN */ nullptr,
3548/* RES_TEXTGRID */ nullptr,
3549/* RES_LINENUMBER */ nullptr,
3550/* RES_FTN_AT_TXTEND */ nullptr,
3551/* RES_END_AT_TXTEND */ nullptr,
3552/* RES_COLUMNBALANCE */ nullptr,
3553/* RES_FRAMEDIR */ OutCSS1_SvxFrameDirection,
3554/* RES_HEADER_FOOTER_EAT_SPACING */ nullptr,
3555/* RES_ROW_SPLIT */ nullptr,
3556/* RES_FOLLOW_TEXT_FLOW */ nullptr,
3557/* RES_COLLAPSING_BORDERS */ nullptr,
3558/* RES_WRAP_INFLUENCE_ON_OBJPOS */ nullptr,
3559/* RES_AUTO_STYLE */ nullptr,
3560/* RES_FRMATR_STYLE_NAME */ nullptr,
3561/* RES_FRMATR_CONDITIONAL_STYLE_NAME */ nullptr,
3562/* RES_FRMATR_GRABBAG */ nullptr,
3563/* RES_TEXT_VERT_ADJUST */ nullptr,
3564
3565/* RES_GRFATR_MIRRORGRF */ nullptr,
3566/* RES_GRFATR_CROPGRF */ nullptr,
3567/* RES_GRFATR_ROTATION */ nullptr,
3568/* RES_GRFATR_LUMINANCE */ nullptr,
3569/* RES_GRFATR_CONTRAST */ nullptr,
3570/* RES_GRFATR_CHANNELR */ nullptr,
3571/* RES_GRFATR_CHANNELG */ nullptr,
3572/* RES_GRFATR_CHANNELB */ nullptr,
3573/* RES_GRFATR_GAMMA */ nullptr,
3574/* RES_GRFATR_INVERT */ nullptr,
3575/* RES_GRFATR_TRANSPARENCY */ nullptr,
3576/* RES_GRFATR_DRWAMODE */ nullptr,
3577/* RES_GRFATR_DUMMY1 */ nullptr,
3578/* RES_GRFATR_DUMMY2 */ nullptr,
3579/* RES_GRFATR_DUMMY3 */ nullptr,
3580/* RES_GRFATR_DUMMY4 */ nullptr,
3581/* RES_GRFATR_DUMMY5 */ nullptr,
3582
3583/* RES_BOXATR_FORMAT */ nullptr,
3584/* RES_BOXATR_FORMULA */ nullptr,
3585/* RES_BOXATR_VALUE */ nullptr
3586};
3587
3589
3591 bool bDeep )
3592{
3593 // print ItemSet, including all attributes
3594 Out_SfxItemSet( aCSS1AttrFnTab, *this, rItemSet, bDeep );
3595
3596 // some Attributes require special treatment
3597
3598 // Underline, Overline, CrossedOut and Blink form together a CSS1-Property
3599 // (doesn't work of course for Hints)
3601 {
3602 const SvxUnderlineItem *pUnderlineItem =
3603 rItemSet.GetItemIfSet( RES_CHRATR_UNDERLINE, bDeep );
3604
3605 const SvxOverlineItem *pOverlineItem =
3606 rItemSet.GetItemIfSet( RES_CHRATR_OVERLINE, bDeep );
3607
3608 const SvxCrossedOutItem *pCrossedOutItem =
3609 rItemSet.GetItemIfSet( RES_CHRATR_CROSSEDOUT, bDeep );
3610
3611 const SvxBlinkItem *pBlinkItem =
3612 rItemSet.GetItemIfSet( RES_CHRATR_BLINK, bDeep );
3613
3614 if( pUnderlineItem || pOverlineItem || pCrossedOutItem || pBlinkItem )
3615 OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( *this, pUnderlineItem,
3616 pOverlineItem,
3617 pCrossedOutItem,
3618 pBlinkItem );
3619
3621 }
3622
3624 return;
3625
3626 // if a Property was exported as part of a Style-Option,
3627 // the Option still needs to be finished
3628 OStringBuffer sOut;
3630 {
3632 sOut.append(sCSS1_span_tag_end);
3633 break;
3634
3636 sOut.append(cCSS1_style_opt_end);
3637 break;
3638
3640 sOut.append(sCSS1_rule_end);
3641 break;
3642 }
3643 if (!sOut.isEmpty())
3644 Strm().WriteOString( sOut );
3645}
3646
3648{
3649 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
3650
3651 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_SPAN_TAG |
3653
3654 Out( aCSS1AttrFnTab, rHt, rWrt );
3655
3656 if( !rHTMLWrt.m_bFirstCSS1Property && rHTMLWrt.m_bTagOn )
3657 rWrt.Strm().WriteCharPtr( sCSS1_span_tag_end );
3658
3659 return rWrt;
3660}
3661
3663{
3664 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
3665
3666 SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_STYLE_OPT_ON |
3668 CSS1_OUTMODE_HINT, nullptr );
3669
3670 Out( aCSS1AttrFnTab, rHt, rWrt );
3671
3672 if( !rHTMLWrt.m_bFirstCSS1Property )
3673 rWrt.Strm().WriteChar( '\"' );
3674
3675 return rWrt;
3676}
3677
3678/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::chart::ChartAxisLabelPosition ePos
SvxGraphicPosition
GPOS_MT
GPOS_LT
GPOS_RT
GPOS_MM
GPOS_TILED
GPOS_MB
GPOS_LB
GPOS_LM
GPOS_RM
GPOS_RB
static OutputDevice * GetDefaultDevice()
OUString lowercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
sal_uInt8 GetBlue() const
sal_uInt8 GetRed() const
sal_uInt8 GetGreen() const
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
Access to the style pool.
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
static OUString convertToBcp47(LanguageType nLangID)
virtual Point GetRelativePos() const
virtual const tools::Rectangle & GetLogicRect() const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
const WhichRangesContainer & GetRanges() const
SfxItemPool * GetPool() const
sal_uInt16 Count() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
bool Set(const SfxItemSet &, bool bDeep=true)
sal_uInt16 Which() const
sal_uInt16 FirstWhich()
SfxItemState GetItemState(bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
sal_uInt16 NextWhich()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteChar(char nChar)
SvStream & WriteCharPtr(const char *pBuf)
SvxAdjust GetAdjust() const
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetRight() const
const editeng::SvxBorderLine * GetLeft() const
sal_Int16 GetDistance(SvxBoxItemLine nLine, bool bAllowNegative=false) const
const editeng::SvxBorderLine * GetBottom() const
const Color & GetColor() const
const OUString & GetGraphicLink() const
SvxGraphicPosition GetGraphicPos() const
SvxCaseMap GetCaseMap() const
FontStrikeout GetStrikeout() const
FontFamily GetFamily() const
const OUString & GetFamilyName() const
SvxBreak GetBreak() const
short GetTextFirstLineOffset() const
tools::Long GetRight() const
tools::Long GetTextLeft() const
tools::Long GetLeft() const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
sal_uInt16 GetPropLineSpace() const
SvxInterLineSpaceRule GetInterLineSpaceRule() const
SvxLineSpaceRule GetLineSpaceRule() const
sal_uInt16 GetLineHeight() const
sal_Int32 GetFirstLineOffset() const
sal_Int32 GetAbsLSpace() const
FontItalic GetPosture() const
const Size & GetSize() const
FontLineStyle GetLineStyle() const
sal_uInt16 GetUpper() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetLower() const
FontWeight GetWeight() const
SwAttrPool * GetPool() const
Definition: swatrset.hxx:183
const SvxBrushItem & GetBackground(bool=true) const
Definition: frmatr.hxx:58
Represents the style of a text portion.
Definition: charfmt.hxx:27
size_t size() const
Definition: charformats.hxx:71
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:742
Definition: doc.hxx:192
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:634
bool IsUsed(const sw::BroadcastingModify &) const
Definition: poolfmt.cxx:86
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:744
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:406
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:638
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:177
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:782
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:636
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:427
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1322
SwCharFormat * GetCharFormat(SwDoc &rDoc) const
Definition: docftn.cxx:140
FlyAnchors.
Definition: fmtanchr.hxx:37
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:69
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
If SwFormatDrop is a Client, it is the CharFormat that describes the font for the DropCaps.
Definition: paratr.hxx:63
sal_uInt8 GetLines() const
Definition: paratr.hxx:101
const SwCharFormat * GetCharFormat() const
Definition: paratr.hxx:113
sal_uInt16 GetDistance() const
Definition: paratr.hxx:110
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:87
SwTwips GetPos() const
Definition: fmtornt.hxx:92
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:88
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:36
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:61
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:55
SwTwips GetPos() const
Definition: fmtornt.hxx:59
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:54
Base class for various Writer styles.
Definition: format.hxx:47
bool IsDefault() const
Definition: format.hxx:129
const SvxBoxItem & GetBox(bool=true) const
Definition: frmatr.hxx:84
sal_uInt16 GetPoolFormatId() const
Get and set Pool style IDs.
Definition: format.hxx:163
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
const OUString & GetName() const
Definition: format.hxx:131
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:83
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
SwFormat * DerivedFrom() const
Definition: format.hxx:128
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:108
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:76
std::unique_ptr< SvxBrushItem > makeBackgroundBrushItem(bool=true) const
Definition: format.cxx:738
Style of a layout element.
Definition: frmfmt.hxx:62
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:141
bool mbXHTML
If XHTML markup should be written instead of HTML.
Definition: wrthtml.hxx:410
bool m_bNoAlign
Definition: wrthtml.hxx:392
bool m_bOutTable
Definition: wrthtml.hxx:377
bool m_bCfgPreferStyles
Definition: wrthtml.hxx:356
static OString convertDirection(SvxFrameDirection nDirection)
Definition: wrthtml.cxx:1477
bool mbEmbedImages
Definition: wrthtml.hxx:406
bool mbSkipHeaderFooter
If HTML header and footer should be written as well, or just the content itself.
Definition: wrthtml.hxx:405
static bool HasScriptDependentItems(const SfxItemSet &rItemSet, bool bCheckDropCap)
Definition: css1atr.cxx:1144
void IncIndentLevel()
Definition: wrthtml.hxx:525
short m_nFirstLineIndent
Definition: wrthtml.hxx:335
ErrCode m_nWarn
Definition: wrthtml.hxx:323
bool IsCSS1Source(sal_uInt16 n) const
Definition: wrthtml.hxx:620
void OutCSS1_PixelProperty(const char *pProp, tools::Long nVal, bool bVert)
Definition: css1atr.cxx:468
void OutStyleSheet(const SwPageDesc &rPageDesc)
Definition: css1atr.cxx:475
bool m_bFirstCSS1Property
Definition: wrthtml.hxx:385
std::set< OUString > m_aScriptTextStyles
Definition: wrthtml.hxx:301
bool m_bTagOn
Definition: wrthtml.hxx:364
const SwPageDesc * m_pCurrPageDesc
Definition: wrthtml.hxx:318
static sal_uInt16 GetDefListLvl(std::u16string_view rNm, sal_uInt16 nPoolId)
Definition: htmlatr.cxx:96
void OutCSS1_TableFrameFormatOptions(const SwFrameFormat &rFrameFormat)
Writes the formatting for tables.
Definition: css1atr.cxx:2050
static void SubtractItemSet(SfxItemSet &rItemSet, const SfxItemSet &rRefItemSet, bool bSetDefaults, bool bClearSame=true, const SfxItemSet *pRefScriptItemSet=nullptr)
Definition: css1atr.cxx:983
static const SwFormat * GetTemplateFormat(sal_uInt16 nPoolId, IDocumentStylePoolAccess *pTemplate)
Definition: css1atr.cxx:938
bool IsCSS1Script(sal_uInt16 n) const
Definition: wrthtml.hxx:625
static const SwFormat * GetParentFormat(const SwFormat &rFormat, sal_uInt16 nDeep)
Definition: css1atr.cxx:956
sal_Int32 m_nDfltRightMargin
Definition: wrthtml.hxx:334
void OutCSS1_PropertyAscii(const char *pProp, const char *pVal)
Definition: wrthtml.hxx:631
void DecIndentLevel()
Definition: wrthtml.hxx:529
OString GetNamespace() const
Determines the prefix string needed to respect the requested namespace alias.
Definition: wrthtml.cxx:1561
sal_Int32 m_nDfltLeftMargin
Definition: wrthtml.hxx:333
bool mbReqIF
If the ReqIF subset of XHTML should be written.
Definition: wrthtml.hxx:414
sal_Int32 m_nLeftMargin
Definition: wrthtml.hxx:332
sal_uInt16 m_nCSS1OutMode
Definition: wrthtml.hxx:346
bool m_bCSS1IgnoreFirstPageDesc
Definition: wrthtml.hxx:388
void OutCSS1_UnitProperty(const char *pProp, tools::Long nVal)
Definition: css1atr.cxx:461
bool m_bCfgNetscape4
Definition: wrthtml.hxx:401
static sal_uInt16 GetCSS1Selector(const SwFormat *pFormat, OString &rToken, OUString &rClass, sal_uInt16 &rRefPoolId, OUString *pPseudo=nullptr)
Definition: css1atr.cxx:599
void OutCSS1_FrameFormatOptions(const SwFrameFormat &rFrameFormat, HtmlFrmOpts nFrameOpts, const SdrObject *pSdrObj=nullptr, const SfxItemSet *pItemSet=nullptr)
Definition: css1atr.cxx:1853
sal_uInt16 m_nDfltTopMargin
Definition: wrthtml.hxx:337
bool m_bParaDotLeaders
Definition: wrthtml.hxx:418
FieldUnit GetCSS1Unit() const
Definition: wrthtml.hxx:612
sal_uInt16 m_nDfltBottomMargin
Definition: wrthtml.hxx:338
void OutCSS1_SfxItemSet(const SfxItemSet &rItemSet, bool bDeep=true)
Definition: css1atr.cxx:3590
short m_nDfltFirstLineIndent
Definition: wrthtml.hxx:336
void OutNewLine(bool bCheck=false)
Definition: wrthtml.cxx:1512
bool m_bFirstCSS1Rule
Definition: wrthtml.hxx:384
void OutCSS1_Property(const char *pProp, const OUString &rVal)
Definition: wrthtml.hxx:643
static sal_uInt32 ToPixel(sal_uInt32 nVal, const bool bVert)
Definition: htmlatr.cxx:2605
FieldUnit m_eCSS1Unit
Definition: wrthtml.hxx:279
static void PrepareFontList(const SvxFontItem &rFontItem, OUString &rNames, sal_Unicode cQuote, bool bGeneric)
Definition: css1atr.cxx:1066
rtl::Reference< SwDoc > m_xTemplate
Definition: wrthtml.hxx:315
bool IsHTMLMode(sal_uInt32 nMode) const
Definition: wrthtml.hxx:598
SvxFrameDirection GetHTMLDirection(SvxFrameDirection nDir) const
Definition: wrthtml.cxx:1446
bool m_bCfgPrintLayout
Definition: wrthtml.hxx:417
OUString m_aCSS1Selector
Definition: wrthtml.hxx:310
void OutCSS1_FrameFormatBackground(const SwFrameFormat &rFrameFormat)
Definition: css1atr.cxx:2130
SwNodeIndex * m_pStartNdIdx
Definition: wrthtml.hxx:317
bool m_bCfgCpyLinkedGrfs
Definition: wrthtml.hxx:359
void OutCSS1_TableCellBordersAndBG(const SwFrameFormat &rFrameFormat, const SvxBrushItem *pBrushItem)
Writes the borders and background for table cells.
Definition: css1atr.cxx:2071
void OutCSS1_SectionFormatOptions(const SwFrameFormat &rFrameFormat, const SwFormatCol *pCol)
Definition: css1atr.cxx:2082
sal_uInt16 m_nCSS1Script
Definition: wrthtml.hxx:347
std::set< OUString > m_aScriptParaStyles
Definition: wrthtml.hxx:300
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:171
Base class of the Writer document model elements.
Definition: node.hxx:84
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
Definition: node.cxx:731
SwNodeOffset GetIndex() const
Definition: node.hxx:296
const SwStartNode * FindTableBoxStartNode() const
Definition: node.hxx:202
bool IsContentNode() const
Definition: node.hxx:656
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:370
SwContentNode * GetContentNode()
Definition: node.hxx:643
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:87
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
Definition: pagedesc.hxx:275
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
bool GetLandscape() const
Definition: pagedesc.hxx:199
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:267
Starts a section of nodes in the document model.
Definition: node.hxx:325
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:419
SwTableLine * GetUpper()
Definition: swtable.hxx:453
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:457
SwTableLine is one table row in the document model.
Definition: swtable.hxx:358
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:380
SwTableBox * GetUpper()
Definition: swtable.hxx:376
const SwTable & GetTable() const
Definition: node.hxx:521
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:204
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
Definition: swtable.cxx:1340
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
size_t size() const
Definition: docary.hxx:87
const Color & GetRetoucheColor() const
Definition: viewopt.hxx:578
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:436
SvStream & Strm()
Definition: writer.cxx:214
SwDoc * m_pDoc
Definition: shellio.hxx:408
std::shared_ptr< SwUnoCursor > m_pCurrentPam
Definition: shellio.hxx:410
const OUString & GetBaseURL() const
Definition: shellio.hxx:444
IDocumentStylePoolAccess & getIDocumentStylePoolAccess()
Definition: writer.cxx:138
bool CopyLocalFileToINet(OUString &rFileNm)
Definition: writer.cxx:299
static bool GraphicToBase64(const Graphic &rGraphic, OUString &rOUString, bool bAddPrefix=true, ConvertDataFormat aTargetFormat=ConvertDataFormat::Unknown)
const Color & GetColor() const
tools::Long GetWidth() const
SvxBorderLineStyle GetBorderLineStyle() const
constexpr Size GetSize() const
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
static bool OutCSS1Rule(SwHTMLWriter &rHTMLWrt, const OUString &rSelector, const SfxItemSet &rItemSet, bool bHasClass, bool bCheckForPseudo)
Definition: css1atr.cxx:1232
SwAttrFnTab const aCSS1AttrFnTab
Definition: css1atr.cxx:3428
bool IgnorePropertyForReqIF(bool bReqIF, std::string_view rProperty, std::string_view rValue, std::optional< sw::Css1Background > oMode)
Determines if rProperty with a given rValue has to be suppressed due to ReqIF mode.
Definition: css1atr.cxx:185
static void OutCSS1_SvxBorderLine(SwHTMLWriter &rHTMLWrt, const char *pProperty, const SvxBorderLine *pLine)
Definition: css1atr.cxx:3241
static Writer & OutCSS1_SvxCrossedOut(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2392
static Writer & OutCSS1_SwFormatFrameSize(Writer &rWrt, const SfxPoolItem &rHt, Css1FrameSize nMode)
Definition: css1atr.cxx:2825
static Writer & OutCSS1_SwFormatDrop(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2800
Writer & OutCSS1_TableBGStyleOpt(Writer &rWrt, const SfxPoolItem &rHt)
Writes the background of table rows.
Definition: css1atr.cxx:1804
static Writer & OutCSS1_SwPageDesc(Writer &rWrt, const SwPageDesc &rFormat, IDocumentStylePoolAccess *pDoc, SwDoc *pTemplate, sal_uInt16 nRefPoolId, bool bExtRef, bool bPseudo=true)
Definition: css1atr.cxx:1603
#define DOT_LEADERS_MAX_WIDTH
Definition: css1atr.cxx:120
static Writer & OutCSS1_SvxBlink(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2638
Writer & OutCSS1_HintStyleOpt(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:3662
static Writer & OutCSS1_SwFormat(Writer &rWrt, const SwFormat &rFormat, IDocumentStylePoolAccess *pDoc, SwDoc *pTemplate)
Definition: css1atr.cxx:1435
static sal_uInt16 GetCSS1Selector(const SwFormat *pFormat, OUString &rSelector, sal_uInt16 &rRefPoolId)
Definition: css1atr.cxx:913
static Writer & OutCSS1_SvxBrush(Writer &rWrt, const SfxPoolItem &rHt, sw::Css1Background nMode, const OUString *pGraphicName)
Definition: css1atr.cxx:3055
static void OutCSS1_SwFormatDropAttrs(SwHTMLWriter &rHWrt, const SwFormatDrop &rDrop, const SfxItemSet *pCharFormatItemSet=nullptr)
Definition: css1atr.cxx:2774
static Writer & OutCSS1_SwFootnoteInfo(Writer &rWrt, const SwEndNoteInfo &rInfo, SwDoc *pDoc, bool bHasNotes, bool bEndNote)
Definition: css1atr.cxx:1706
static Writer & OutCSS1_SvxFrameDirection(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:3389
static Writer & OutCSS1_SvxULSpace_SvxLRSpace(Writer &rWrt, const SvxULSpaceItem *pULSpace, const SvxLRSpaceItem *pLRSpace)
Definition: css1atr.cxx:2914
static Writer & OutCSS1_SvxHidden(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2586
static Writer & OutCSS1_SvxWidows(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2754
static Writer & OutCSS1_SvxULSpace(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2893
static Writer & OutCSS1_SvxFormatSplit(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2730
Writer & OutCSS1_BodyTagStyleOpt(Writer &rWrt, const SfxItemSet &rItemSet)
Definition: css1atr.cxx:1758
static Writer & OutCSS1_SvxPosture(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2462
static Writer & OutCSS1_SvxFontWeight(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2596
static Writer & OutCSS1_SvxTextLn_SvxCrOut_SvxBlink(Writer &rWrt, const SvxUnderlineItem *pUItem, const SvxOverlineItem *pOItem, const SvxCrossedOutItem *pCOItem, const SvxBlinkItem *pBItem)
Definition: css1atr.cxx:2216
OString GetCSS1_Color(const Color &rColor)
Definition: css1atr.cxx:221
static Writer & OutCSS1_SvxOverline(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2574
Writer & OutCSS1_SvxBox(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:3316
static Writer & OutCSS1_SvxFormatBreak_SwFormatPDesc_SvxFormatKeep(Writer &rWrt, const SfxItemSet &rItemSet, bool bDeep)
Definition: css1atr.cxx:3025
static Writer & OutCSS1_SvxOrphans(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2764
static Writer & OutCSS1_SvxKerning(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2500
static Writer & OutCSS1_SvxLineSpacing(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2650
static Writer & OutCSS1_SvxUnderline(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2562
bool swhtml_css1atr_equalFontItems(const SfxPoolItem &r1, const SfxPoolItem &r2)
Definition: css1atr.cxx:975
Writer & OutCSS1_ParaTagStyleOpt(Writer &rWrt, const SfxItemSet &rItemSet)
Definition: css1atr.cxx:1793
static Writer & OutCSS1_SvxFontHeight(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2436
Writer & OutCSS1_NumberBulletListStyleOpt(Writer &rWrt, const SwNumRule &rNumRule, sal_uInt8 nLevel)
Definition: css1atr.cxx:1819
static Writer & OutCSS1_SwFormatLayoutSplit(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2742
static Writer & OutCSS1_SvxColor(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2372
static void AddUnitPropertyValue(OStringBuffer &rOut, tools::Long nVal, FieldUnit eUnit)
Definition: css1atr.cxx:383
static Writer & OutCSS1_SvxFont(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2404
static Writer & OutCSS1_SvxLRSpace(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2855
static bool OutCSS1_FrameFormatBrush(SwHTMLWriter &rWrt, const SvxBrushItem &rBrushItem)
Definition: css1atr.cxx:2114
static Writer & OutCSS1_SvxLanguage(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2531
Writer & OutCSS1_HintSpanTag(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:3647
static void OutCSS1DropCapRule(SwHTMLWriter &rHTMLWrt, const OUString &rSelector, const SwFormatDrop &rDrop, bool bHasClass, bool bHasScriptDependencies)
Definition: css1atr.cxx:1336
static Writer & OutCSS1_SvxAdjust(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2704
static Writer & OutCSS1_SvxCaseMap(Writer &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2344
#define HTML_HEADSPACE
Definition: css1atr.cxx:102
const char *const sCSS1_page
Definition: css1kywd.cxx:24
const char *const sCSS1_url
Definition: css1kywd.cxx:35
const char *const sCSS1_P_page_break_inside
Definition: css1kywd.cxx:190
const char *const sCSS1_UNIT_px
Definition: css1kywd.cxx:42
const char *const sCSS1_P_direction
Definition: css1kywd.cxx:208
const char *const sCSS1_P_dir
Definition: css1kywd.cxx:174
const char *const sCSS1_P_widows
Definition: css1kywd.cxx:192
const char *const sCSS1_P_font_size
Definition: css1kywd.cxx:81
const char *const sCSS1_PV_normal
Definition: css1kywd.cxx:56
const char *const sCSS1_PV_extra_bold
Definition: css1kywd.cxx:73
const char *const sCSS1_PV_always
Definition: css1kywd.cxx:197
const char *const sCSS1_P_font_weight
Definition: css1kywd.cxx:65
const char *const sCSS1_P_margin_right
Definition: css1kywd.cxx:130
const char *const sCSS1_PV_dashed
Definition: css1kywd.cxx:158
const char *const sCSS1_PV_oblique
Definition: css1kywd.cxx:58
const char *const sCSS1_PV_sans_serif
Definition: css1kywd.cxx:49
const char *const sCSS1_left
Definition: css1kywd.cxx:31
const char *const sCSS1_P_padding_left
Definition: css1kywd.cxx:137
const char *const sCSS1_P_margin_top
Definition: css1kywd.cxx:131
const char *const sCSS1_PV_landscape
Definition: css1kywd.cxx:201
const char *const sCSS1_P_orphans
Definition: css1kywd.cxx:194
const char *const sCSS1_PV_middle
Definition: css1kywd.cxx:98
const char *const sCSS1_P_text_decoration
Definition: css1kywd.cxx:107
const char *const sCSS1_PV_avoid
Definition: css1kywd.cxx:198
const char *const sCSS1_PV_rtl
Definition: css1kywd.cxx:210
const char *const sCSS1_PV_repeat
Definition: css1kywd.cxx:94
const char *const sCSS1_PV_light
Definition: css1kywd.cxx:68
const char *const sCSS1_P_padding_right
Definition: css1kywd.cxx:138
const char *const sCSS1_PV_scroll
Definition: css1kywd.cxx:101
const char *const sCSS1_P_margin
Definition: css1kywd.cxx:133
const char *const sCSS1_PV_lowercase
Definition: css1kywd.cxx:79
const char *const sCSS1_PV_capitalize
Definition: css1kywd.cxx:77
const char *const sCSS1_PV_no_repeat
Definition: css1kywd.cxx:95
const char *const sCSS1_PV_absolute
Definition: css1kywd.cxx:180
const char *const sCSS1_PV_demi_light
Definition: css1kywd.cxx:69
const char *const sCSS1_PV_justify
Definition: css1kywd.cxx:120
const char *const sCSS1_P_padding_top
Definition: css1kywd.cxx:135
const char *const sCSS1_UNIT_mm
Definition: css1kywd.cxx:38
const char *const sCSS1_link
Definition: css1kywd.cxx:27
const char *const sCSS1_P_font_style
Definition: css1kywd.cxx:54
const char *const sCSS1_PV_extra_light
Definition: css1kywd.cxx:67
const char *const sCSS1_visited
Definition: css1kywd.cxx:28
const char *const sCSS1_P_height
Definition: css1kywd.cxx:169
const char *const sCSS1_first
Definition: css1kywd.cxx:33
const char *const sCSS1_P_max_width
Definition: css1kywd.cxx:167
const char *const sCSS1_right
Definition: css1kywd.cxx:32
const char *const sCSS1_PV_serif
Definition: css1kywd.cxx:48
const char *const sCSS1_P_margin_left
Definition: css1kywd.cxx:129
const char *const sCSS1_P_text_transform
Definition: css1kywd.cxx:75
const char *const sCSS1_UNIT_pt
Definition: css1kywd.cxx:37
const char *const sCSS1_P_font_variant
Definition: css1kywd.cxx:60
const char *const sCSS1_PV_uppercase
Definition: css1kywd.cxx:78
const char *const sCSS1_PV_left
Definition: css1kywd.cxx:117
const char *const sCSS1_P_top
Definition: css1kywd.cxx:184
const char *const sCSS1_PV_overline
Definition: css1kywd.cxx:111
const char *const sCSS1_P_line_height
Definition: css1kywd.cxx:124
const char *const sCSS1_P_margin_bottom
Definition: css1kywd.cxx:132
const char *const sCSS1_first_letter
Definition: css1kywd.cxx:29
const char *const sCSS1_PV_top
Definition: css1kywd.cxx:97
const char *const sCSS1_PV_none
Definition: css1kywd.cxx:109
const char *const sCSS1_PV_demi_bold
Definition: css1kywd.cxx:71
const char *const sCSS1_P_border_top
Definition: css1kywd.cxx:152
const char *const sCSS1_PV_monospace
Definition: css1kywd.cxx:52
const char *const sCSS1_P_column_count
Definition: css1kywd.cxx:173
const char *const sCSS1_P_page_break_before
Definition: css1kywd.cxx:188
const char *const sCSS1_P_padding
Definition: css1kywd.cxx:139
const char *const sCSS1_PV_right
Definition: css1kywd.cxx:119
const char *const sCSS1_UNIT_inch
Definition: css1kywd.cxx:41
const char *const sCSS1_P_width
Definition: css1kywd.cxx:166
const char *const sCSS1_PV_solid
Definition: css1kywd.cxx:159
const char *const sCSS1_P_float
Definition: css1kywd.cxx:171
const char *const sCSS1_P_size
Definition: css1kywd.cxx:191
const char *const sCSS1_UNIT_pc
Definition: css1kywd.cxx:40
const char *const sCSS1_P_page_break_after
Definition: css1kywd.cxx:189
const char *const sCSS1_PV_bold
Definition: css1kywd.cxx:72
const char *const sCSS1_P_border_left
Definition: css1kywd.cxx:150
const char *const sCSS1_P_border
Definition: css1kywd.cxx:154
const char *const sCSS1_P_font_family
Definition: css1kywd.cxx:46
const char *const sCSS1_PV_bottom
Definition: css1kywd.cxx:99
const char *const sCSS1_PV_small_caps
Definition: css1kywd.cxx:63
const char *const sCSS1_PV_ridge
Definition: css1kywd.cxx:162
const char *const sCSS1_P_background
Definition: css1kywd.cxx:89
const char *const sCSS1_PV_portrait
Definition: css1kywd.cxx:200
const char *const sCSS1_PV_double
Definition: css1kywd.cxx:160
const char *const sCSS1_PV_fantasy
Definition: css1kywd.cxx:51
const char *const sCSS1_PV_center
Definition: css1kywd.cxx:118
const char *const sCSS1_PV_groove
Definition: css1kywd.cxx:161
const char *const sCSS1_PV_line_through
Definition: css1kywd.cxx:112
const char *const sCSS1_PV_ltr
Definition: css1kywd.cxx:209
const char *const sCSS1_P_padding_bottom
Definition: css1kywd.cxx:136
const char *const sCSS1_P_letter_spacing
Definition: css1kywd.cxx:105
const char *const sCSS1_PV_auto
Definition: css1kywd.cxx:141
const char *const sCSS1_PV_italic
Definition: css1kywd.cxx:57
const char *const sCSS1_PV_inset
Definition: css1kywd.cxx:163
const char *const sCSS1_PV_cursive
Definition: css1kywd.cxx:50
const char *const sCSS1_PV_inherit
Definition: css1kywd.cxx:211
const char *const sCSS1_PV_transparent
Definition: css1kywd.cxx:92
const char *const sCSS1_P_text_align
Definition: css1kywd.cxx:115
const char *const sCSS1_PV_blink
Definition: css1kywd.cxx:113
const char *const sCSS1_P_color
Definition: css1kywd.cxx:87
const char *const sCSS1_P_text_indent
Definition: css1kywd.cxx:122
const char *const sCSS1_PV_dotted
Definition: css1kywd.cxx:157
const char *const sCSS1_P_display
Definition: css1kywd.cxx:213
const char *const sCSS1_PV_outset
Definition: css1kywd.cxx:164
const char *const sCSS1_PV_underline
Definition: css1kywd.cxx:110
const char *const sCSS1_P_position
Definition: css1kywd.cxx:178
const char *const sCSS1_P_so_language
Definition: css1kywd.cxx:206
const char *const sCSS1_P_border_right
Definition: css1kywd.cxx:151
const char *const sCSS1_UNIT_cm
Definition: css1kywd.cxx:39
const char *const sCSS1_P_left
Definition: css1kywd.cxx:182
const char *const sCSS1_P_border_bottom
Definition: css1kywd.cxx:153
float u
FieldUnit
sal_Int16 nValue
LINESTYLE_NONE
LINESTYLE_DONTKNOW
STRIKEOUT_NONE
STRIKEOUT_DONTKNOW
ITALIC_NORMAL
ITALIC_NONE
ITALIC_OBLIQUE
FAMILY_DECORATIVE
FAMILY_SCRIPT
FAMILY_SWISS
FAMILY_MODERN
FAMILY_ROMAN
WEIGHT_ULTRALIGHT
WEIGHT_ULTRABOLD
WEIGHT_BOLD
WEIGHT_NORMAL
WEIGHT_LIGHT
WEIGHT_SEMIBOLD
WEIGHT_SEMILIGHT
SvxFrameDirection
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr sal_uInt16 RES_CHRATR_END(46)
constexpr sal_uInt16 RES_BOXATR_END(153)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwCharFormat > RES_CHRFMT(RES_FMT_BEGIN)
constexpr TypedWhichId< SvxBlinkItem > RES_CHRATR_BLINK(18)
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
constexpr TypedWhichId< SwTextFormatColl > RES_TXTFMTCOLL(157)
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(110)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(160)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
constexpr TypedWhichId< SwFormatLayoutSplit > RES_LAYOUT_SPLIT(113)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
#define OOO_STRING_SVTOOLS_HTML_parabreak
#define OOO_STRING_SVTOOLS_HTML_O_data
#define OOO_STRING_SVTOOLS_HTML_head6
#define OOO_STRING_SVTOOLS_HTML_emphasis
#define OOO_STRING_SVTOOLS_HTML_head1
#define OOO_STRING_SVTOOLS_HTML_tabledata
#define OOO_STRING_SVTOOLS_HTML_dd
#define OOO_STRING_SVTOOLS_HTML_sample
#define OOO_STRING_SVTOOLS_HTML_head4
#define OOO_STRING_SVTOOLS_HTML_tableheader
#define OOO_STRING_SVTOOLS_HTML_style
#define OOO_STRING_SVTOOLS_HTML_xmp
#define OOO_STRING_SVTOOLS_HTML_sdendnote_sym
#define OOO_STRING_SVTOOLS_HTML_code
#define OOO_STRING_SVTOOLS_HTML_anchor
#define OOO_STRING_SVTOOLS_HTML_span
#define OOO_STRING_SVTOOLS_HTML_definstance
#define OOO_STRING_SVTOOLS_HTML_sdendnote
#define OOO_STRING_SVTOOLS_HTML_sdendnote_anc
#define OOO_STRING_SVTOOLS_HTML_address
#define OOO_STRING_SVTOOLS_HTML_teletype
#define OOO_STRING_SVTOOLS_HTML_sdfootnote_anc
#define OOO_STRING_SVTOOLS_HTML_horzrule
#define OOO_STRING_SVTOOLS_HTML_preformtxt
#define OOO_STRING_SVTOOLS_HTML_citation
#define OOO_STRING_SVTOOLS_HTML_dt
#define OOO_STRING_SVTOOLS_HTML_O_type
#define OOO_STRING_SVTOOLS_HTML_listing
#define OOO_STRING_SVTOOLS_HTML_sdfootnote_sym
#define OOO_STRING_SVTOOLS_HTML_sdfootnote
#define OOO_STRING_SVTOOLS_HTML_strong
#define OOO_STRING_SVTOOLS_HTML_variable
#define OOO_STRING_SVTOOLS_HTML_head3
#define OOO_STRING_SVTOOLS_HTML_keyboard
#define OOO_STRING_SVTOOLS_HTML_blockquote
#define OOO_STRING_SVTOOLS_HTML_head5
#define OOO_STRING_SVTOOLS_HTML_head2
#define OOO_STRING_SVTOOLS_HTML_O_style
#define HTML_NUMBER_BULLET_MARGINLEFT
Definition: htmlnum.hxx:25
#define HTML_NUMBER_BULLET_INDENT
Definition: htmlnum.hxx:26
CharClass & GetAppCharClass()
Definition: init.cxx:705
OUString aName
sal_Int64 n
#define LANGUAGE_DONTKNOW
sal_uInt16 nPos
sal_Int32 nFirstLineOffset
#define SAL_N_ELEMENTS(arr)
aStr
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:390
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
tools::Long const nLeftMargin
OString strip(const OString &rIn, char c)
int i
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
Css1Background
Definition: wrthtml.hxx:261
long Long
SwNodeOffset abs(const SwNodeOffset &a)
Definition: nodeoffset.hxx:34
const char GetValue[]
@ RES_POOLCOLL_HEADLINE5
Heading 5.
Definition: poolfmt.hxx:266
@ RES_POOLCOLL_TEXT
Text body.
Definition: poolfmt.hxx:251
@ RES_POOLCOLL_STANDARD
Standard.
Definition: poolfmt.hxx:250
@ RES_POOLCOLL_HEADLINE6
Heading 6.
Definition: poolfmt.hxx:267
@ RES_POOLCOLL_HTML_BLOCKQUOTE
Definition: poolfmt.hxx:432
@ RES_POOLCOLL_HTML_DD
Definition: poolfmt.hxx:435
@ RES_POOLCOLL_TABLE
Subgroup table.
Definition: poolfmt.hxx:341
@ RES_POOLCOLL_HTML_DT
Definition: poolfmt.hxx:436
@ RES_POOLCOLL_HTML_HR
Definition: poolfmt.hxx:434
@ RES_POOLCOLL_HEADLINE_BASE
Subgroup headings.
Definition: poolfmt.hxx:261
@ RES_POOLCOLL_SEND_ADDRESS
Sender.
Definition: poolfmt.hxx:355
@ RES_POOLCOLL_HEADLINE2
Heading 2.
Definition: poolfmt.hxx:263
@ RES_POOLCOLL_HEADLINE4
Heading 4.
Definition: poolfmt.hxx:265
@ RES_POOLCOLL_FOOTNOTE
Footnotes.
Definition: poolfmt.hxx:353
@ RES_POOLCOLL_HTML_PRE
Definition: poolfmt.hxx:433
@ RES_POOLCOLL_HEADLINE1
Heading 1.
Definition: poolfmt.hxx:262
@ RES_POOLCOLL_TABLE_HDLN
Table of Contents - heading.
Definition: poolfmt.hxx:342
@ RES_POOLCOLL_HEADLINE3
Heading 3.
Definition: poolfmt.hxx:264
@ RES_POOLCOLL_ENDNOTE
Endnotes.
Definition: poolfmt.hxx:356
@ RES_POOLPAGE_LEFT
Left page.
Definition: poolfmt.hxx:172
@ RES_POOLPAGE_HTML
HTML.
Definition: poolfmt.hxx:176
@ RES_POOLPAGE_FIRST
First page.
Definition: poolfmt.hxx:171
@ RES_POOLPAGE_RIGHT
Right page.
Definition: poolfmt.hxx:173
@ RES_POOLCHR_HTML_TELETYPE
Definition: poolfmt.hxx:143
@ RES_POOLCHR_INET_VISIT
Internet visited.
Definition: poolfmt.hxx:121
@ RES_POOLCHR_HTML_CODE
Definition: poolfmt.hxx:138
@ RES_POOLCHR_HTML_SAMPLE
Definition: poolfmt.hxx:139
@ RES_POOLCHR_HTML_CITATION
Definition: poolfmt.hxx:136
@ RES_POOLCHR_FOOTNOTE
Footnote.
Definition: poolfmt.hxx:113
@ RES_POOLCHR_HTML_EMPHASIS
Definition: poolfmt.hxx:135
@ RES_POOLCHR_ENDNOTE
Endnote.
Definition: poolfmt.hxx:124
@ RES_POOLCHR_INET_NORMAL
Internet normal.
Definition: poolfmt.hxx:120
@ RES_POOLCHR_HTML_KEYBOARD
Definition: poolfmt.hxx:140
@ RES_POOLCHR_HTML_STRONG
Definition: poolfmt.hxx:137
@ RES_POOLCHR_HTML_DEFINSTANCE
Definition: poolfmt.hxx:142
@ RES_POOLCHR_HTML_VARIABLE
Definition: poolfmt.hxx:141
const sal_uInt16 POOLGRP_NOCOLLID
POOLCOLL-IDs: +-—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ !User! Range ! 0 ! Offset ! +-—+—+—+—+—+—+—+—+—+—+—+...
Definition: poolfmt.hxx:59
const sal_uInt16 USER_FMT
POLLCOLL-groups:
Definition: poolfmt.hxx:63
bool IsPoolUserFormat(sal_uInt16 nId)
Definition: poolfmt.hxx:86
static SVT_DLLPUBLIC SvStream & Out_AsciiTag(SvStream &, std::string_view rStr, bool bOn=true)
static SVT_DLLPUBLIC SvStream & Out_String(SvStream &, const OUString &, OUString *pNonConvertableChars=nullptr)
Marks a position in the document model.
Definition: pam.hxx:37
SwNode & GetNode() const
Definition: pam.hxx:80
SvxLineSpaceRule
#define WARN_SWG_POOR_LOAD
Definition: swerror.h:40
RndStdIds
SvxBoxItem & rBoxItem
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
unsigned long Pixel
Writer & Out_SfxItemSet(const SwAttrFnTab, Writer &, const SfxItemSet &, bool bDeep)
Definition: wrt_fn.cxx:42
Writer & Out(const SwAttrFnTab, const SfxPoolItem &, Writer &)
Definition: wrt_fn.cxx:31
FnAttrOut SwAttrFnTab[POOLATTR_END - POOLATTR_BEGIN]
Definition: wrt_fn.hxx:32
#define CSS1_OUTMODE_SPAN_TAG
Definition: wrthtml.hxx:156
#define CSS1_OUTMODE_CJK
Definition: wrthtml.hxx:182
#define CSS1_OUTMODE_ENCODE
Definition: wrthtml.hxx:174
#define CSS1_OUTMODE_RULE_ON
Definition: wrthtml.hxx:144
#define CSS1_OUTMODE_STYLE_OPT_OFF
Definition: wrthtml.hxx:151
#define CSS1_OUTMODE_DROPCAP
Definition: wrthtml.hxx:169
HtmlFrmOpts
Definition: wrthtml.hxx:76
#define CSS1_OUTMODE_PARA
Definition: wrthtml.hxx:164
#define HTML_PARSPACE
Definition: wrthtml.hxx:70
#define CSS1_OUTMODE_SPAN_TAG_OFF
Definition: wrthtml.hxx:150
#define CSS1_OUTMODE_SPAN_TAG1_ON
Definition: wrthtml.hxx:145
#define HTMLMODE_FRSTLINE_IN_NUMBER_BULLET
Definition: wrthtml.hxx:128
#define CSS1_FMT_CMPREF
Definition: wrthtml.hxx:135
#define CSS1_OUTMODE_RULE
Definition: wrthtml.hxx:158
#define CSS1_OUTMODE_SECTION
Definition: wrthtml.hxx:170
#define CSS1_FMT_ISTAG
Definition: wrthtml.hxx:134
#define CSS1_OUTMODE_BODY
Definition: wrthtml.hxx:163
#define CSS1_FMT_SPECIAL
Definition: wrthtml.hxx:136
#define CSS1_OUTMODE_ANY_ON
Definition: wrthtml.hxx:146
#define sCSS2_P_CLASS_leaders
Definition: wrthtml.hxx:416
#define HTMLMODE_PRINT_EXT
Definition: wrthtml.hxx:122
#define CSS1_OUTMODE_SPAN_TAG_ON
Definition: wrthtml.hxx:142
#define CSS1_OUTMODE_CTL
Definition: wrthtml.hxx:184
#define HTMLMODE_FLY_MARGINS
Definition: wrthtml.hxx:125
#define CSS1_OUTMODE_RULE_OFF
Definition: wrthtml.hxx:152
#define CSS1_OUTMODE_NO_SCRIPT
Definition: wrthtml.hxx:186
#define CSS1_OUTMODE_TABLEBOX
Definition: wrthtml.hxx:168
#define HTMLMODE_LSPACE_IN_NUMBER_BULLET
Definition: wrthtml.hxx:120
#define CSS1_OUTMODE_TEMPLATE
Definition: wrthtml.hxx:162
#define CSS1_OUTMODE_FRAME
Definition: wrthtml.hxx:166
#define CSS1_OUTMODE_WESTERN
Definition: wrthtml.hxx:180
#define CSS1_OUTMODE_TABLE
Definition: wrthtml.hxx:167
#define CSS1_OUTMODE_STYLE_OPT_ON
Definition: wrthtml.hxx:143
#define CSS1_OUTMODE_HINT
Definition: wrthtml.hxx:165
#define CSS1_OUTMODE_ANY_OFF
Definition: wrthtml.hxx:153
#define HTML_DLCOLL_DD
Definition: wrthtml.hxx:131
#define CSS1_OUTMODE_STYLE_OPT
Definition: wrthtml.hxx:157