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