LibreOffice Module sw (master)  1
htmlnumreader.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 <com/sun/star/text/VertOrientation.hpp>
21 #include <com/sun/star/style/NumberingType.hpp>
22 #include <hintids.hxx>
23 #include <svtools/htmltokn.h>
24 #include <svtools/htmlkywd.hxx>
25 #include <svtools/htmlout.hxx>
26 #include <svl/urihelper.hxx>
27 #include <editeng/brushitem.hxx>
28 #include <editeng/lrspitem.hxx>
29 #include <vcl/svapp.hxx>
30 #include <vcl/wrkwin.hxx>
31 #include <sal/log.hxx>
32 #include <osl/diagnose.h>
33 #include <numrule.hxx>
34 #include <doc.hxx>
35 #include <docary.hxx>
36 #include <poolfmt.hxx>
37 #include <ndtxt.hxx>
38 #include <paratr.hxx>
39 
40 #include "htmlnum.hxx"
41 #include "swcss1.hxx"
42 #include "swhtml.hxx"
43 
44 #include <SwNodeNum.hxx>
45 
46 using namespace css;
47 
48 // <UL TYPE=...>
50 {
54  { nullptr, 0 }
55 };
56 
57 
59 {
60  SwHTMLNumRuleInfo& rInfo = GetNumInfo();
61 
62  // Create a new paragraph
63  bool bSpace = (rInfo.GetDepth() + m_nDefListDeep) == 0;
64  if( m_pPam->GetPoint()->nContent.GetIndex() )
65  AppendTextNode( bSpace ? AM_SPACE : AM_NOSPACE, false );
66  else if( bSpace )
67  AddParSpace();
68 
69  // Increment the numbering depth
70  rInfo.IncDepth();
71  sal_uInt8 nLevel = static_cast<sal_uInt8>( (rInfo.GetDepth() <= MAXLEVEL ? rInfo.GetDepth()
72  : MAXLEVEL) - 1 );
73 
74  // Create rules if needed
75  if( !rInfo.GetNumRule() )
76  {
77  sal_uInt16 nPos = m_xDoc->MakeNumRule( m_xDoc->GetUniqueNumRuleName() );
78  rInfo.SetNumRule( m_xDoc->GetNumRuleTable()[nPos] );
79  }
80 
81  // Change the format for this level if that hasn't happened yet for this level
82  bool bNewNumFormat = rInfo.GetNumRule()->GetNumFormat( nLevel ) == nullptr;
83  bool bChangeNumFormat = false;
84 
85  // Create the default numbering format
86  SwNumFormat aNumFormat( rInfo.GetNumRule()->Get(nLevel) );
87  rInfo.SetNodeStartValue( nLevel );
88  if( bNewNumFormat )
89  {
90  sal_uInt16 nChrFormatPoolId = 0;
91  if( HtmlTokenId::ORDERLIST_ON == nToken )
92  {
93  aNumFormat.SetNumberingType(SVX_NUM_ARABIC);
94  nChrFormatPoolId = RES_POOLCHR_NUM_LEVEL;
95  }
96  else
97  {
98  // We'll set a default style because the UI does the same. This meant a 9pt font, which
99  // was not the case in Netscape. That didn't bother anyone so far
100  // #i63395# - Only apply user defined default bullet font
102  {
103  aNumFormat.SetBulletFont( &numfunc::GetDefBulletFont() );
104  }
105  aNumFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
106  aNumFormat.SetBulletChar( cBulletChar );
107  nChrFormatPoolId = RES_POOLCHR_BUL_LEVEL;
108  }
109 
110  sal_Int32 nAbsLSpace = HTML_NUMBUL_MARGINLEFT;
111 
112  sal_Int32 nFirstLineIndent = HTML_NUMBUL_INDENT;
113  if( nLevel > 0 )
114  {
115  const SwNumFormat& rPrevNumFormat = rInfo.GetNumRule()->Get( nLevel-1 );
116  nAbsLSpace = nAbsLSpace + rPrevNumFormat.GetAbsLSpace();
117  nFirstLineIndent = rPrevNumFormat.GetFirstLineOffset();
118  }
119  aNumFormat.SetAbsLSpace( nAbsLSpace );
120  aNumFormat.SetFirstLineOffset( nFirstLineIndent );
121  aNumFormat.SetCharFormat( m_pCSS1Parser->GetCharFormatFromPool(nChrFormatPoolId) );
122 
123  bChangeNumFormat = true;
124  }
125  else if( 1 != aNumFormat.GetStart() )
126  {
127  // If the layer has already been used, the start value may need to be set hard to the paragraph.
128  rInfo.SetNodeStartValue( nLevel, 1 );
129  }
130 
131  // and set that in the options
132  OUString aId, aStyle, aClass, aLang, aDir;
133  OUString aBulletSrc;
134  sal_Int16 eVertOri = text::VertOrientation::NONE;
135  sal_uInt16 nWidth=USHRT_MAX, nHeight=USHRT_MAX;
136  const HTMLOptions& rHTMLOptions = GetOptions();
137  for (size_t i = rHTMLOptions.size(); i; )
138  {
139  const HTMLOption& rOption = rHTMLOptions[--i];
140  switch( rOption.GetToken() )
141  {
142  case HtmlOptionId::ID:
143  aId = rOption.GetString();
144  break;
145  case HtmlOptionId::TYPE:
146  if( bNewNumFormat && !rOption.GetString().isEmpty() )
147  {
148  switch( nToken )
149  {
150  case HtmlTokenId::ORDERLIST_ON:
151  bChangeNumFormat = true;
152  switch( rOption.GetString()[0] )
153  {
154  case 'A': aNumFormat.SetNumberingType(SVX_NUM_CHARS_UPPER_LETTER); break;
155  case 'a': aNumFormat.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER); break;
156  case 'I': aNumFormat.SetNumberingType(SVX_NUM_ROMAN_UPPER); break;
157  case 'i': aNumFormat.SetNumberingType(SVX_NUM_ROMAN_LOWER); break;
158  default: bChangeNumFormat = false;
159  }
160  break;
161 
162  case HtmlTokenId::UNORDERLIST_ON:
163  aNumFormat.SetBulletChar( rOption.GetEnum(
164  aHTMLULTypeTable,aNumFormat.GetBulletChar() ) );
165  bChangeNumFormat = true;
166  break;
167  default: break;
168  }
169  }
170  break;
171  case HtmlOptionId::START:
172  {
173  sal_uInt16 nStart = static_cast<sal_uInt16>(rOption.GetNumber());
174  if( bNewNumFormat )
175  {
176  aNumFormat.SetStart( nStart );
177  bChangeNumFormat = true;
178  }
179  else
180  {
181  rInfo.SetNodeStartValue( nLevel, nStart );
182  }
183  }
184  break;
185  case HtmlOptionId::STYLE:
186  aStyle = rOption.GetString();
187  break;
188  case HtmlOptionId::CLASS:
189  aClass = rOption.GetString();
190  break;
191  case HtmlOptionId::LANG:
192  aLang = rOption.GetString();
193  break;
194  case HtmlOptionId::DIR:
195  aDir = rOption.GetString();
196  break;
197  case HtmlOptionId::SRC:
198  if( bNewNumFormat )
199  {
200  aBulletSrc = rOption.GetString();
201  if( !InternalImgToPrivateURL(aBulletSrc) )
202  aBulletSrc = URIHelper::SmartRel2Abs( INetURLObject( m_sBaseURL ), aBulletSrc, Link<OUString *, bool>(), false );
203  }
204  break;
205  case HtmlOptionId::WIDTH:
206  nWidth = static_cast<sal_uInt16>(rOption.GetNumber());
207  break;
208  case HtmlOptionId::HEIGHT:
209  nHeight = static_cast<sal_uInt16>(rOption.GetNumber());
210  break;
211  case HtmlOptionId::ALIGN:
212  eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri );
213  break;
214  default: break;
215  }
216  }
217 
218  if( !aBulletSrc.isEmpty() )
219  {
220  // A bullet list with graphics
221  aNumFormat.SetNumberingType(SVX_NUM_BITMAP);
222 
223  // Create the graphic as a brush
224  SvxBrushItem aBrushItem( RES_BACKGROUND );
225  aBrushItem.SetGraphicLink( aBulletSrc );
226  aBrushItem.SetGraphicPos( GPOS_AREA );
227 
228  // Only set size if given a width and a height
229  Size aTwipSz( nWidth, nHeight), *pTwipSz=nullptr;
230  if( nWidth!=USHRT_MAX && nHeight!=USHRT_MAX )
231  {
232  aTwipSz =
234  MapMode(MapUnit::MapTwip) );
235  pTwipSz = &aTwipSz;
236  }
237 
238  // Only set orientation if given one
239  aNumFormat.SetGraphicBrush( &aBrushItem, pTwipSz,
240  text::VertOrientation::NONE!=eVertOri ? &eVertOri : nullptr);
241 
242  // Remember the graphic to not put it into the paragraph
243  m_aBulletGrfs[nLevel] = aBulletSrc;
244  bChangeNumFormat = true;
245  }
246  else
247  m_aBulletGrfs[nLevel].clear();
248 
249  // don't number the current paragraph (for now)
250  {
251  sal_uInt8 nLvl = nLevel;
252  SetNodeNum( nLvl );
253  }
254 
255  // create a new context
256  std::unique_ptr<HTMLAttrContext> xCntxt(new HTMLAttrContext(nToken));
257 
258  // Parse styles
259  if( HasStyleOptions( aStyle, aId, aClass, &aLang, &aDir ) )
260  {
261  SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
262  SvxCSS1PropertyInfo aPropInfo;
263 
264  if( ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo, &aLang, &aDir ) )
265  {
266  if( bNewNumFormat )
267  {
268  if( aPropInfo.m_bLeftMargin )
269  {
270  // Default indent has already been added
271  long nAbsLSpace =
272  aNumFormat.GetAbsLSpace() - HTML_NUMBUL_MARGINLEFT;
273  if( aPropInfo.m_nLeftMargin < 0 &&
274  nAbsLSpace < -aPropInfo.m_nLeftMargin )
275  nAbsLSpace = 0U;
276  else if( aPropInfo.m_nLeftMargin > SHRT_MAX ||
277  nAbsLSpace + aPropInfo.m_nLeftMargin > SHRT_MAX )
278  nAbsLSpace = SHRT_MAX;
279  else
280  nAbsLSpace = nAbsLSpace + aPropInfo.m_nLeftMargin;
281 
282  aNumFormat.SetAbsLSpace( nAbsLSpace );
283  bChangeNumFormat = true;
284  }
285  if( aPropInfo.m_bTextIndent )
286  {
287  short nTextIndent =
288  aItemSet.Get( RES_LR_SPACE ).GetTextFirstLineOfst();
289  aNumFormat.SetFirstLineOffset( nTextIndent );
290  bChangeNumFormat = true;
291  }
292  if( aPropInfo.m_bNumbering )
293  {
294  aNumFormat.SetNumberingType(aPropInfo.m_nNumberingType);
295  bChangeNumFormat = true;
296  }
297  if( aPropInfo.m_bBullet )
298  {
299  aNumFormat.SetBulletChar( aPropInfo.m_cBulletChar );
300  bChangeNumFormat = true;
301  }
302  }
303  aPropInfo.m_bLeftMargin = aPropInfo.m_bTextIndent = false;
304  if( !aPropInfo.m_bRightMargin )
305  aItemSet.ClearItem( RES_LR_SPACE );
306 
307  // #i89812# - Perform change to list style before calling <DoPositioning(..)>,
308  // because <DoPositioning(..)> may open a new context and thus may
309  // clear the <SwHTMLNumRuleInfo> instance hold by local variable <rInfo>.
310  if( bChangeNumFormat )
311  {
312  rInfo.GetNumRule()->Set( nLevel, aNumFormat );
313  m_xDoc->ChgNumRuleFormats( *rInfo.GetNumRule() );
314  bChangeNumFormat = false;
315  }
316 
317  DoPositioning(aItemSet, aPropInfo, xCntxt.get());
318 
319  InsertAttrs(aItemSet, aPropInfo, xCntxt.get());
320  }
321  }
322 
323  if( bChangeNumFormat )
324  {
325  rInfo.GetNumRule()->Set( nLevel, aNumFormat );
326  m_xDoc->ChgNumRuleFormats( *rInfo.GetNumRule() );
327  }
328 
329  PushContext(xCntxt);
330 
331  // set attributes to the current template
332  SetTextCollAttrs(m_aContexts.back().get());
333 }
334 
336 {
337  SwHTMLNumRuleInfo& rInfo = GetNumInfo();
338 
339  // A new paragraph needs to be created, when
340  // - the current one isn't empty (it contains text or paragraph-bound objects)
341  // - the current one is numbered
342  bool bAppend = m_pPam->GetPoint()->nContent.GetIndex() > 0;
343  if( !bAppend )
344  {
345  SwTextNode* pTextNode = m_pPam->GetNode().GetTextNode();
346 
347  bAppend = (pTextNode && ! pTextNode->IsOutline() && pTextNode->IsCountedInList()) ||
348 
349  HasCurrentParaFlys();
350  }
351 
352  bool bSpace = (rInfo.GetDepth() + m_nDefListDeep) == 1;
353  if( bAppend )
354  AppendTextNode( bSpace ? AM_SPACE : AM_NOSPACE, false );
355  else if( bSpace )
356  AddParSpace();
357 
358  // get current context from stack
359  std::unique_ptr<HTMLAttrContext> xCntxt(nToken != HtmlTokenId::NONE ? PopContext(getOnToken(nToken)) : nullptr);
360 
361  // Don't end a list because of a token, if the context wasn't created or mustn't be ended
362  if( rInfo.GetDepth()>0 && (nToken == HtmlTokenId::NONE || xCntxt) )
363  {
364  rInfo.DecDepth();
365  if( !rInfo.GetDepth() ) // was that the last level?
366  {
367  // The formats not yet modified are now modified, to ease editing
368  const SwNumFormat *pRefNumFormat = nullptr;
369  bool bChanged = false;
370  for( sal_uInt16 i=0; i<MAXLEVEL; i++ )
371  {
372  const SwNumFormat *pNumFormat = rInfo.GetNumRule()->GetNumFormat(i);
373  if( pNumFormat )
374  {
375  pRefNumFormat = pNumFormat;
376  }
377  else if( pRefNumFormat )
378  {
379  SwNumFormat aNumFormat( rInfo.GetNumRule()->Get(i) );
380  aNumFormat.SetNumberingType(pRefNumFormat->GetNumberingType() != SVX_NUM_BITMAP
381  ? pRefNumFormat->GetNumberingType() : SVX_NUM_CHAR_SPECIAL);
382  if( SVX_NUM_CHAR_SPECIAL == aNumFormat.GetNumberingType() )
383  {
384  // #i63395# - Only apply user defined default bullet font
386  {
387  aNumFormat.SetBulletFont( &numfunc::GetDefBulletFont() );
388  }
389  aNumFormat.SetBulletChar( cBulletChar );
390  }
391  aNumFormat.SetAbsLSpace( (i+1) * HTML_NUMBUL_MARGINLEFT );
392  aNumFormat.SetFirstLineOffset( HTML_NUMBUL_INDENT );
393  aNumFormat.SetCharFormat( pRefNumFormat->GetCharFormat() );
394  rInfo.GetNumRule()->Set( i, aNumFormat );
395  bChanged = true;
396  }
397  }
398  if( bChanged )
399  m_xDoc->ChgNumRuleFormats( *rInfo.GetNumRule() );
400 
401  // On the last append, the NumRule item and NodeNum object were copied.
402  // Now we need to delete them. ResetAttr deletes the NodeNum object as well
403  if (SwTextNode *pTextNode = m_pPam->GetNode().GetTextNode())
404  pTextNode->ResetAttr(RES_PARATR_NUMRULE);
405 
406  rInfo.Clear();
407  }
408  else
409  {
410  // the next paragraph not numbered first
411  SetNodeNum( rInfo.GetLevel() );
412  }
413  }
414 
415  // end attributes
416  bool bSetAttrs = false;
417  if (xCntxt)
418  {
419  EndContext(xCntxt.get());
420  xCntxt.reset();
421  bSetAttrs = true;
422  }
423 
424  if( nToken != HtmlTokenId::NONE )
426 
427  if( bSetAttrs )
428  SetAttr(); // Set paragraph attributes asap because of Javascript
429 
430 }
431 
433 {
434  sal_uInt8 nLevel = GetNumInfo().GetLevel();
435  OUString aId, aStyle, aClass, aLang, aDir;
436  sal_uInt16 nStart = HtmlTokenId::LISTHEADER_ON != nToken
437  ? GetNumInfo().GetNodeStartValue( nLevel )
438  : USHRT_MAX;
439  if( USHRT_MAX != nStart )
440  GetNumInfo().SetNodeStartValue( nLevel );
441 
442  const HTMLOptions& rHTMLOptions = GetOptions();
443  for (size_t i = rHTMLOptions.size(); i; )
444  {
445  const HTMLOption& rOption = rHTMLOptions[--i];
446  switch( rOption.GetToken() )
447  {
448  case HtmlOptionId::VALUE:
449  nStart = static_cast<sal_uInt16>(rOption.GetNumber());
450  break;
451  case HtmlOptionId::ID:
452  aId = rOption.GetString();
453  break;
454  case HtmlOptionId::STYLE:
455  aStyle = rOption.GetString();
456  break;
457  case HtmlOptionId::CLASS:
458  aClass = rOption.GetString();
459  break;
460  case HtmlOptionId::LANG:
461  aLang = rOption.GetString();
462  break;
463  case HtmlOptionId::DIR:
464  aDir = rOption.GetString();
465  break;
466  default: break;
467  }
468  }
469 
470  // create a new paragraph
471  if( m_pPam->GetPoint()->nContent.GetIndex() )
472  AppendTextNode( AM_NOSPACE, false );
473  m_bNoParSpace = false; // no space in <LI>!
474 
475  SwTextNode* pTextNode = m_pPam->GetNode().GetTextNode();
476  if (!pTextNode)
477  {
478  SAL_WARN("sw.html", "No Text-Node at PaM-Position");
479  return;
480  }
481 
482  const bool bCountedInList = nToken != HtmlTokenId::LISTHEADER_ON;
483 
484  std::unique_ptr<HTMLAttrContext> xCntxt(new HTMLAttrContext(nToken));
485 
486  OUString aNumRuleName;
487  if( GetNumInfo().GetNumRule() )
488  {
489  aNumRuleName = GetNumInfo().GetNumRule()->GetName();
490  }
491  else
492  {
493  aNumRuleName = m_xDoc->GetUniqueNumRuleName();
494  SwNumRule aNumRule( aNumRuleName,
496  SwNumFormat aNumFormat( aNumRule.Get( 0 ) );
497  // #i63395# - Only apply user defined default bullet font
499  {
500  aNumFormat.SetBulletFont( &numfunc::GetDefBulletFont() );
501  }
502  aNumFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
503  aNumFormat.SetBulletChar( cBulletChar ); // the bullet character !!
504  aNumFormat.SetCharFormat( m_pCSS1Parser->GetCharFormatFromPool(RES_POOLCHR_BUL_LEVEL) );
505  aNumFormat.SetFirstLineOffset( HTML_NUMBUL_INDENT );
506  aNumRule.Set( 0, aNumFormat );
507 
508  m_xDoc->MakeNumRule( aNumRuleName, &aNumRule );
509 
510  OSL_ENSURE( m_nOpenParaToken == HtmlTokenId::NONE,
511  "Now an open paragraph element is lost" );
512  // We'll act like we're in a paragraph. On the next paragraph, at least numbering is gone,
513  // that's gonna be taken over by the next AppendTextNode
514  m_nOpenParaToken = nToken;
515  }
516 
517  static_cast<SwContentNode *>(pTextNode)->SetAttr( SwNumRuleItem(aNumRuleName) );
518  pTextNode->SetAttrListLevel(nLevel);
519  // #i57656# - <IsCounted()> state of text node has to be adjusted accordingly.
520  if ( nLevel < MAXLEVEL )
521  {
522  pTextNode->SetCountedInList( bCountedInList );
523  }
524  // #i57919#
525  // correction of refactoring done by cws swnumtree
526  // - <nStart> contains the start value, if the numbering has to be restarted
527  // at this text node. Value <USHRT_MAX> indicates, that numbering isn't
528  // restarted at this text node
529  if ( nStart != USHRT_MAX )
530  {
531  pTextNode->SetListRestart( true );
532  pTextNode->SetAttrListRestartValue( nStart );
533  }
534 
535  if( GetNumInfo().GetNumRule() )
536  GetNumInfo().GetNumRule()->SetInvalidRule( true );
537 
538  // parse styles
539  if( HasStyleOptions( aStyle, aId, aClass, &aLang, &aDir ) )
540  {
541  SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
542  SvxCSS1PropertyInfo aPropInfo;
543 
544  if( ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo, &aLang, &aDir ) )
545  {
546  DoPositioning(aItemSet, aPropInfo, xCntxt.get());
547  InsertAttrs(aItemSet, aPropInfo, xCntxt.get());
548  }
549  }
550 
551  PushContext(xCntxt);
552 
553  // set the new template
554  SetTextCollAttrs(m_aContexts.back().get());
555 
556  // Refresh scroll bar
557  ShowStatline();
558 }
559 
560 void SwHTMLParser::EndNumBulListItem( HtmlTokenId nToken, bool bSetColl )
561 {
562  // Create a new paragraph
563  if( nToken == HtmlTokenId::NONE && m_pPam->GetPoint()->nContent.GetIndex() )
564  AppendTextNode( AM_NOSPACE );
565 
566  // Get context to that token and pop it from stack
567  std::unique_ptr<HTMLAttrContext> xCntxt;
568  auto nPos = m_aContexts.size();
569  nToken = getOnToken(nToken);
570  while (!xCntxt && nPos>m_nContextStMin)
571  {
572  HtmlTokenId nCntxtToken = m_aContexts[--nPos]->GetToken();
573  switch( nCntxtToken )
574  {
575  case HtmlTokenId::LI_ON:
576  case HtmlTokenId::LISTHEADER_ON:
577  if( nToken == HtmlTokenId::NONE || nToken == nCntxtToken )
578  {
579  xCntxt = std::move(m_aContexts[nPos]);
580  m_aContexts.erase( m_aContexts.begin() + nPos );
581  }
582  break;
583  case HtmlTokenId::ORDERLIST_ON:
584  case HtmlTokenId::UNORDERLIST_ON:
585  case HtmlTokenId::MENULIST_ON:
586  case HtmlTokenId::DIRLIST_ON:
587  // Don't care about LI/LH outside the current list
588  nPos = m_nContextStMin;
589  break;
590  default: break;
591  }
592  }
593 
594  // end attributes
595  if (xCntxt)
596  {
597  EndContext(xCntxt.get());
598  SetAttr(); // set paragraph attributes asap because of Javascript
599  xCntxt.reset();
600  }
601 
602  // set current template
603  if( bSetColl )
605 }
606 
608 {
609  SwTextNode* pTextNode = m_pPam->GetNode().GetTextNode();
610  if (!pTextNode)
611  {
612  SAL_WARN("sw.html", "No Text-Node at PaM-Position");
613  return;
614  }
615 
616  OSL_ENSURE( GetNumInfo().GetNumRule(), "No numbering rule" );
617  const OUString& rName = GetNumInfo().GetNumRule()->GetName();
618  static_cast<SwContentNode *>(pTextNode)->SetAttr( SwNumRuleItem(rName) );
619 
620  pTextNode->SetAttrListLevel( nLevel );
621  pTextNode->SetCountedInList( false );
622 
623  // Invalidate NumRule, it may have been set valid because of an EndAction
624  GetNumInfo().GetNumRule()->SetInvalidRule( false );
625 }
626 
627 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetNodeNum(sal_uInt8 nLevel)
SvxNumType GetNumberingType() const
sal_uInt8 GetLevel() const
Definition: htmlnum.hxx:110
void SetListRestart(bool bRestart)
Definition: ndtxt.cxx:4103
void EndNumBulListItem(HtmlTokenId nToken, bool bSetColl)
EnumT GetEnum(const HTMLOptionEnum< EnumT > *pOptEnums, EnumT nDflt=static_cast< EnumT >(0)) const
HtmlOptionId GetToken() const
constexpr HtmlTokenId getOnToken(HtmlTokenId nToken)
bool IsOutline() const
Returns if this text node is an outline.
Definition: ndtxt.cxx:4001
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
Definition: number.cxx:93
SVX_NUM_CHARS_UPPER_LETTER
const OUString & GetString() const
const sal_Unicode cBulletChar
Character for lists.
Definition: numrule.hxx:47
static OutputDevice * GetDefaultDevice()
SVX_NUM_ARABIC
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
SVX_NUM_ROMAN_UPPER
Numbering symbols.
Definition: poolfmt.hxx:118
SVX_NUM_ROMAN_LOWER
#define RES_PARATR_NUMRULE
Definition: hintids.hxx:170
void SetCountedInList(bool bCounted)
Definition: ndtxt.cxx:4224
#define HTML_BULLETCHAR_DISC
Definition: htmlnum.hxx:32
void SetNodeStartValue(sal_uInt8 nLvl, sal_uInt16 nVal=USHRT_MAX)
Definition: htmlnum.hxx:118
#define RES_BACKGROUND
Definition: hintids.hxx:210
SVX_NUM_BITMAP
SVX_NUM_CHAR_SPECIAL
SwCharFormat * GetCharFormat() const
Definition: numrule.hxx:74
SVX_NUM_CHARS_LOWER_LETTER
sal_uInt16 GetDepth() const
Definition: htmlnum.hxx:73
void SetBulletFont(const vcl::Font *pFont)
sal_Int32 GetAbsLSpace() const
#define OOO_STRING_SVTOOLS_HTML_ULTYPE_disc
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1264
void SetNumRule(const SwNumRule *pRule)
Definition: htmlnum.hxx:68
void NewNumBulListItem(HtmlTokenId nToken)
int i
#define OOO_STRING_SVTOOLS_HTML_ULTYPE_square
#define HTML_BULLETCHAR_CIRCLE
Definition: htmlnum.hxx:33
#define HTML_NUMBUL_INDENT
Definition: htmlnum.hxx:26
GPOS_AREA
static HTMLOptionEnum< sal_Unicode > const aHTMLULTypeTable[]
HTMLOptionEnum< sal_Int16 > const aHTMLImgVAlignTable[]
Definition: htmlgrin.cxx:87
sal_uInt32 GetNumber() const
#define RES_LR_SPACE
Definition: hintids.hxx:196
HtmlTokenId
Point PixelToLogic(const Point &rDevicePt) const
void SetGraphicPos(SvxGraphicPosition eNew)
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:83
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
Definition: ndtxt.cxx:4066
void Set(sal_uInt16 i, const SwNumFormat *)
Definition: number.cxx:592
bool IsDefBulletFontUserDefined()
determine if default bullet font is user defined
Definition: number.cxx:1259
static void SetTextCollAttrs(SwTextFormatColl *pColl, SfxItemSet &rItemSet, SvxCSS1PropertyInfo const &rPropInfo, SwCSS1Parser *pCSS1Parser)
Definition: htmlcss1.cxx:268
unsigned char sal_uInt8
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
::std::vector< HTMLOption > HTMLOptions
bool IsCountedInList() const
Definition: ndtxt.cxx:4239
sal_Int32 GetFirstLineOffset() const
#define HTML_NUMBUL_MARGINLEFT
Definition: htmlnum.hxx:25
void NewNumBulList(HtmlTokenId nToken)
#define SAL_WARN(area, stream)
void SetGraphicLink(const OUString &rNew)
void SetNumberingType(SvxNumType nSet)
#define OOO_STRING_SVTOOLS_HTML_ULTYPE_circle
sal_Int32 nPos
void EndNumBulList(HtmlTokenId nToken=HtmlTokenId::NONE)
#define HTML_BULLETCHAR_SQUARE
Definition: htmlnum.hxx:34
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
Definition: fmtcol.cxx:75
SwNumRule * GetNumRule()
Definition: htmlnum.hxx:69
void SetAttrListRestartValue(SwNumberTree::tSwNumTreeNumber nNum)
Definition: ndtxt.cxx:4147
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:843
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)