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