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