LibreOffice Module editeng (master) 1
numitem.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <algorithm>
23
24#include <editeng/numitem.hxx>
25
26#include <com/sun/star/text/VertOrientation.hpp>
28#include <editeng/brushitem.hxx>
29#include <rtl/ustrbuf.hxx>
30#include <vcl/font.hxx>
31#include <vcl/settings.hxx>
32#include <editeng/editids.hrc>
33#include <editeng/numdef.hxx>
34#include <vcl/graph.hxx>
35#include <vcl/outdev.hxx>
36#include <vcl/svapp.hxx>
37#include <com/sun/star/text/XNumberingFormatter.hpp>
38#include <com/sun/star/text/DefaultNumberingProvider.hpp>
39#include <com/sun/star/text/XDefaultNumberingProvider.hpp>
40#include <com/sun/star/style/NumberingType.hpp>
41#include <com/sun/star/lang/IllegalArgumentException.hpp>
42#include <com/sun/star/beans/PropertyValue.hpp>
45#include <tools/mapunit.hxx>
46#include <tools/stream.hxx>
47#include <tools/debug.hxx>
50#include <libxml/xmlwriter.h>
51#include <editeng/unonrule.hxx>
52#include <sal/log.hxx>
55
56constexpr sal_Int32 DEF_WRITER_LSPACE = 500; //Standard Indentation
57constexpr sal_Int32 DEF_DRAW_LSPACE = 800; //Standard Indentation
58
59constexpr sal_uInt16 NUMITEM_VERSION_03 = 0x03;
60constexpr sal_uInt16 NUMITEM_VERSION_04 = 0x04;
61
62using namespace ::com::sun::star;
63using namespace ::com::sun::star::lang;
64using namespace ::com::sun::star::uno;
65using namespace ::com::sun::star::text;
66using namespace ::com::sun::star::beans;
67using namespace ::com::sun::star::style;
68
69sal_Int32 SvxNumberType::nRefCount = 0;
70css::uno::Reference<css::text::XNumberingFormatter> SvxNumberType::xFormatter;
71static void lcl_getFormatter(css::uno::Reference<css::text::XNumberingFormatter>& _xFormatter)
72{
73 if(_xFormatter.is())
74 return;
75
76 try
77 {
78 Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
79 Reference<XDefaultNumberingProvider> xRet = text::DefaultNumberingProvider::create(xContext);
80 _xFormatter.set(xRet, UNO_QUERY);
81 }
82 catch(const Exception&)
83 {
84 SAL_WARN("editeng", "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
85 }
86}
87
90 bShowSymbol(true)
91{
92 nRefCount++;
93}
94
96 nNumType(rType.nNumType),
97 bShowSymbol(rType.bShowSymbol)
98{
99 nRefCount++;
100}
101
103{
104 if(!--nRefCount)
105 xFormatter = nullptr;
106}
107
108OUString SvxNumberType::GetNumStr( sal_Int32 nNo ) const
109{
111 LanguageTag("en-US") :
113 return GetNumStr( nNo, aLang.getLocale() );
114}
115
117{
120}
121
122OUString SvxNumberType::GetNumStr( sal_Int32 nNo, const css::lang::Locale& rLocale, bool bIsLegal ) const
123{
125 if(!xFormatter.is())
126 return OUString();
127
128 if(bShowSymbol)
129 {
130 switch(nNumType)
131 {
132 case NumberingType::CHAR_SPECIAL:
133 case NumberingType::BITMAP:
134 break;
135 default:
136 {
137 // '0' allowed for ARABIC numberings
138 if(NumberingType::ARABIC == nNumType && 0 == nNo )
139 return OUString('0');
140 else
141 {
143 static constexpr OUStringLiteral sNumberingType = u"NumberingType";
144 static constexpr OUStringLiteral sValue = u"Value";
145 Sequence< PropertyValue > aProperties
146 {
147 comphelper::makePropertyValue(sNumberingType, static_cast<sal_uInt16>(nActType)),
149 };
150
151 try
152 {
153 return xFormatter->makeNumberingString( aProperties, rLocale );
154 }
155 catch(const Exception&)
156 {
157 }
158 }
159 }
160 }
161 }
162 return OUString();
163}
164
166{
167 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxNumberType"));
168 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("NumType"), BAD_CAST(OString::number(nNumType).getStr()));
169 (void)xmlTextWriterEndElement(pWriter);
170}
171
174 eNumAdjust(SvxAdjust::Left),
175 nInclUpperLevels(1),
176 nStart(1),
177 cBullet(SVX_DEF_BULLET),
178 nBulletRelSize(100),
179 nBulletColor(COL_BLACK),
180 mePositionAndSpaceMode( LABEL_WIDTH_AND_POSITION ),
182 nAbsLSpace(0),
183 nCharTextDistance(0),
184 meLabelFollowedBy( LISTTAB ),
185 mnListtabPos( 0 ),
186 mnFirstLineIndent( 0 ),
187 mnIndentAt( 0 ),
188 eVertOrient(text::VertOrientation::NONE)
189{
190}
191
193 SvxNumberType(rFormat),
194 mePositionAndSpaceMode( rFormat.mePositionAndSpaceMode )
195{
196 *this = rFormat;
197}
198
200 : nStart(0)
201 , nBulletRelSize(100)
203 , nAbsLSpace(0)
204 , nCharTextDistance(0)
205{
206 sal_uInt16 nTmp16(0);
207 sal_Int32 nTmp32(0);
208 rStream.ReadUInt16( nTmp16 ); // Version number
209
210 rStream.ReadUInt16( nTmp16 ); SetNumberingType( static_cast<SvxNumType>(nTmp16) );
211 rStream.ReadUInt16( nTmp16 ); eNumAdjust = static_cast<SvxAdjust>(nTmp16);
212 rStream.ReadUInt16( nTmp16 ); nInclUpperLevels = nTmp16;
213 rStream.ReadUInt16( nStart );
214 rStream.ReadUInt16( nTmp16 ); cBullet = static_cast<sal_Unicode>(nTmp16);
215
216 sal_Int16 temp = 0;
217 rStream.ReadInt16( temp );
218 nFirstLineOffset = temp;
219 temp = 0;
220 rStream.ReadInt16( temp );
221 nAbsLSpace = temp;
222 rStream.SeekRel(2); //skip old now unused nLSpace;
223
224 rStream.ReadInt16( nCharTextDistance );
225
226 sPrefix = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
227 sSuffix = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
229
230 sal_uInt16 hasGraphicBrush = 0;
231 rStream.ReadUInt16( hasGraphicBrush );
232 if ( hasGraphicBrush )
233 {
234 pGraphicBrush.reset(new SvxBrushItem(SID_ATTR_BRUSH));
236 }
237 else pGraphicBrush = nullptr;
238 rStream.ReadUInt16( nTmp16 ); eVertOrient = nTmp16;
239
240 sal_uInt16 hasBulletFont = 0;
241 rStream.ReadUInt16( hasBulletFont );
242 if ( hasBulletFont )
243 {
244 pBulletFont.emplace();
245 ReadFont( rStream, *pBulletFont );
246 }
247 else pBulletFont.reset();
248
249 tools::GenericTypeSerializer aSerializer(rStream);
250 aSerializer.readSize(aGraphicSize);
251 aSerializer.readColor(nBulletColor);
252
253 rStream.ReadUInt16( nBulletRelSize );
254 rStream.ReadUInt16( nTmp16 ); SetShowSymbol( nTmp16 != 0 );
255
256 rStream.ReadUInt16( nTmp16 ); mePositionAndSpaceMode = static_cast<SvxNumPositionAndSpaceMode>(nTmp16);
257 rStream.ReadUInt16( nTmp16 ); meLabelFollowedBy = static_cast<LabelFollowedBy>(nTmp16);
258 rStream.ReadInt32( nTmp32 ); mnListtabPos = nTmp32;
259 rStream.ReadInt32( nTmp32 ); mnFirstLineIndent = nTmp32;
260 rStream.ReadInt32( nTmp32 ); mnIndentAt = nTmp32;
261}
262
264{
265}
266
268{
269 if(pConverter && pBulletFont)
270 {
272 OUString sFontName = GetFontToSubsFontName(pConverter);
273 pBulletFont->SetFamilyName(sFontName);
274 }
275
276 tools::GenericTypeSerializer aSerializer(rStream);
277
279
280 rStream.WriteUInt16( GetNumberingType() );
281 rStream.WriteUInt16( static_cast<sal_uInt16>(eNumAdjust) );
282 rStream.WriteUInt16( nInclUpperLevels );
283 rStream.WriteUInt16( nStart );
284 rStream.WriteUInt16( cBullet );
285
286 rStream.WriteInt16(
287 sal_Int16(std::clamp<sal_Int32>(nFirstLineOffset, SAL_MIN_INT16, SAL_MAX_INT16)) );
288 //TODO: better way to handle out-of-bounds value?
289 rStream.WriteInt16(
290 sal_Int16(std::clamp<sal_Int32>(nAbsLSpace, SAL_MIN_INT16, SAL_MAX_INT16)) );
291 //TODO: better way to handle out-of-bounds value?
292 rStream.WriteInt16( 0 ); // write a dummy for old now unused nLSpace
293
294 rStream.WriteInt16( nCharTextDistance );
295 rtl_TextEncoding eEnc = osl_getThreadTextEncoding();
296 rStream.WriteUniOrByteString(sPrefix, eEnc);
297 rStream.WriteUniOrByteString(sSuffix, eEnc);
299 if(pGraphicBrush)
300 {
301 rStream.WriteUInt16( 1 );
302
303 // in SD or SI force bullet itself to be stored,
304 // for that purpose throw away link when link and graphic
305 // are present, so Brush save is forced
306 if(!pGraphicBrush->GetGraphicLink().isEmpty() && pGraphicBrush->GetGraphic())
307 {
308 pGraphicBrush->SetGraphicLink("");
309 }
310
312 }
313 else
314 rStream.WriteUInt16( 0 );
315
316 rStream.WriteUInt16( eVertOrient );
317 if(pBulletFont)
318 {
319 rStream.WriteUInt16( 1 );
320 WriteFont( rStream, *pBulletFont );
321 }
322 else
323 rStream.WriteUInt16( 0 );
324
325 aSerializer.writeSize(aGraphicSize);
326
327 Color nTempColor = nBulletColor;
329 nTempColor = COL_BLACK;
330
331 aSerializer.writeColor(nTempColor);
332 rStream.WriteUInt16( nBulletRelSize );
333 rStream.WriteUInt16( sal_uInt16(IsShowSymbol()) );
334
337 rStream.WriteInt32( mnListtabPos );
338 rStream.WriteInt32( mnFirstLineIndent );
339 rStream.WriteInt32( mnIndentAt );
340}
341
343{
344 if (& rFormat == this) { return *this; }
345
347 eNumAdjust = rFormat.eNumAdjust ;
349 nStart = rFormat.nStart ;
350 cBullet = rFormat.cBullet ;
353 nAbsLSpace = rFormat.nAbsLSpace ;
356 mnListtabPos = rFormat.mnListtabPos;
358 mnIndentAt = rFormat.mnIndentAt;
359 eVertOrient = rFormat.eVertOrient;
360 sPrefix = rFormat.sPrefix;
361 sSuffix = rFormat.sSuffix;
362 sListFormat = rFormat.sListFormat;
363 aGraphicSize = rFormat.aGraphicSize ;
364 nBulletColor = rFormat.nBulletColor ;
366 SetShowSymbol(rFormat.IsShowSymbol());
368 pGraphicBrush.reset();
369 if(rFormat.pGraphicBrush)
370 {
371 pGraphicBrush.reset( new SvxBrushItem(*rFormat.pGraphicBrush) );
372 }
373 pBulletFont.reset();
374 if(rFormat.pBulletFont)
375 pBulletFont = *rFormat.pBulletFont;
376 mbIsLegal = rFormat.mbIsLegal;
377 return *this;
378}
379
381{
382 if( GetNumberingType() != rFormat.GetNumberingType() ||
383 eNumAdjust != rFormat.eNumAdjust ||
385 nStart != rFormat.nStart ||
386 cBullet != rFormat.cBullet ||
389 nAbsLSpace != rFormat.nAbsLSpace ||
392 mnListtabPos != rFormat.mnListtabPos ||
394 mnIndentAt != rFormat.mnIndentAt ||
395 eVertOrient != rFormat.eVertOrient ||
396 sPrefix != rFormat.sPrefix ||
397 sSuffix != rFormat.sSuffix ||
398 sListFormat != rFormat.sListFormat ||
399 aGraphicSize != rFormat.aGraphicSize ||
400 nBulletColor != rFormat.nBulletColor ||
401 nBulletRelSize != rFormat.nBulletRelSize ||
402 IsShowSymbol() != rFormat.IsShowSymbol() ||
403 sCharStyleName != rFormat.sCharStyleName ||
404 mbIsLegal != rFormat.mbIsLegal
405 )
406 return false;
407 if (
408 (pGraphicBrush && !rFormat.pGraphicBrush) ||
409 (!pGraphicBrush && rFormat.pGraphicBrush) ||
411 )
412 {
413 return false;
414 }
415 if (
416 (pBulletFont && !rFormat.pBulletFont) ||
417 (!pBulletFont && rFormat.pBulletFont) ||
418 (pBulletFont && *pBulletFont != *rFormat.pBulletFont)
419 )
420 {
421 return false;
422 }
423 return true;
424}
425
427 const Size* pSize, const sal_Int16* pOrient)
428{
429 if (!pBrushItem)
430 pGraphicBrush.reset();
431 else if ( !pGraphicBrush || (*pBrushItem != *pGraphicBrush) )
432 pGraphicBrush.reset(pBrushItem->Clone());
433
434 if(pOrient)
435 eVertOrient = *pOrient;
436 else
437 eVertOrient = text::VertOrientation::NONE;
438 if(pSize)
439 aGraphicSize = *pSize;
440 else
441 {
444 }
445}
446
447void SvxNumberFormat::SetGraphic( const OUString& rName )
448{
449 if( pGraphicBrush && pGraphicBrush->GetGraphicLink() == rName )
450 return ;
451
452 pGraphicBrush.reset( new SvxBrushItem( rName, "", GPOS_AREA, 0 ) );
453 if( eVertOrient == text::VertOrientation::NONE )
454 eVertOrient = text::VertOrientation::TOP;
455
458}
459
461{
462 return eVertOrient;
463}
464
466{
467 if (pFont)
468 pBulletFont = *pFont;
469 else
470 pBulletFont.reset();
471}
472
474{
475 mePositionAndSpaceMode = ePositionAndSpaceMode;
476}
477
479{
481 ? nAbsLSpace
482 : static_cast<sal_Int32>( GetFirstLineIndent() + GetIndentAt() );
483}
485{
488 : static_cast<sal_Int32>( GetFirstLineIndent() );
489}
491{
493}
494
496{
497 meLabelFollowedBy = eLabelFollowedBy;
498}
499
501{
502 switch (meLabelFollowedBy)
503 {
504 case LISTTAB:
505 return "\t";
506 case SPACE:
507 return " ";
508 case NEWLINE:
509 return "\n";
510 case NOTHING:
511 // intentionally left blank.
512 return OUString();
513 default:
514 SAL_WARN("editeng", "Unknown SvxNumberFormat::GetLabelFollowedBy() return value");
515 assert(false);
516 }
517 return OUString();
518}
519
521{
522 mnListtabPos = nListtabPos;
523}
525{
526 mnFirstLineIndent = nFirstLineIndent;
527}
529{
530 mnIndentAt = nIndentAt;
531}
532
534{
535 const MapMode aMapMM100( MapUnit::Map100thMM );
536 const Size& rSize = pGraphic->GetPrefSize();
537 Size aRetSize;
538 if ( pGraphic->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
539 {
541 MapMode aOldMap( pOutDev->GetMapMode() );
542 pOutDev->SetMapMode( aMapMM100 );
543 aRetSize = pOutDev->PixelToLogic( rSize );
544 pOutDev->SetMapMode( aOldMap );
545 }
546 else
547 aRetSize = OutputDevice::LogicToLogic( rSize, pGraphic->GetPrefMapMode(), aMapMM100 );
548 return aRetSize;
549}
550
551OUString SvxNumberFormat::CreateRomanString( sal_Int32 nNo, bool bUpper )
552{
553 OUStringBuffer sRet;
554
555 constexpr char romans[][13] = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};
556 constexpr sal_Int32 values[] = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
557
558 for (size_t i = 0; i < std::size(romans); ++i)
559 {
560 while(nNo - values[i] >= 0)
561 {
562 sRet.appendAscii(romans[i]);
563 nNo -= values[i];
564 }
565 }
566
567 return bUpper ? sRet.makeStringAndClear()
568 : sRet.makeStringAndClear().toAsciiLowerCase();
569}
570
571void SvxNumberFormat::SetPrefix(const OUString& rSet)
572{
573 // ListFormat manages the prefix. If badly changed via this function, sListFormat is invalidated
574 if (sListFormat && rSet.getLength() != sPrefix.getLength())
575 sListFormat.reset();
576
577 sPrefix = rSet;
578}
579
580void SvxNumberFormat::SetSuffix(const OUString& rSet)
581{
582 // ListFormat manages the suffix. If badly changed via this function, sListFormat is invalidated
583 if (sListFormat && rSet.getLength() != sSuffix.getLength())
584 sListFormat.reset();
585
586 sSuffix = rSet;
587}
588
589void SvxNumberFormat::SetListFormat(const OUString& rPrefix, const OUString& rSuffix, int nLevel)
590{
591 sPrefix = rPrefix;
592 sSuffix = rSuffix;
593
594 // Generate list format
595 sListFormat = std::make_optional(sPrefix);
596
597 for (int i = 1; i <= nInclUpperLevels; i++)
598 {
599 int nLevelId = nLevel - nInclUpperLevels + i;
600 if (nLevelId < 0)
601 // There can be cases with current level 1, but request to show 10 upper levels. Trim it
602 continue;
603
604 *sListFormat += "%";
605 *sListFormat += OUString::number(nLevelId + 1);
606 *sListFormat += "%";
607 if (i != nInclUpperLevels)
608 *sListFormat += "."; // Default separator for older ODT
609 }
610
612}
613
614void SvxNumberFormat::SetListFormat(std::optional<OUString> oSet)
615{
616 sPrefix.clear();
617 sSuffix.clear();
618
619 sListFormat = oSet;
620
621 if (!oSet.has_value())
622 {
623 return;
624 }
625
626 // For backward compatibility and UI we should create something looking like
627 // a prefix, suffix and included levels also. This is not possible in general case
628 // since level format string is much more flexible. But for most cases is okay
629 sal_Int32 nFirstReplacement = sListFormat->indexOf('%');
630 sal_Int32 nLastReplacement = sListFormat->lastIndexOf('%') + 1;
631 if (nFirstReplacement > 0)
632 // Everything before first '%' will be prefix
633 sPrefix = sListFormat->copy(0, nFirstReplacement);
634 if (nLastReplacement >= 0 && nLastReplacement < sListFormat->getLength())
635 // Everything beyond last '%' is a suffix
636 sSuffix = sListFormat->copy(nLastReplacement);
637
638 sal_uInt8 nPercents = 0;
639 for (sal_Int32 i = 0; i < sListFormat->getLength(); i++)
640 {
641 if ((*sListFormat)[i] == '%')
642 nPercents++;
643 }
644 nInclUpperLevels = nPercents/2;
645 if (nInclUpperLevels < 1)
646 {
647 // There should be always at least one level. This will be not required
648 // in future (when we get rid of prefix/suffix), but nowadays there
649 // are too many conversions "list format" <-> "prefix/suffix/inclUpperLevel"
651 }
652}
653
654OUString SvxNumberFormat::GetListFormat(bool bIncludePrefixSuffix /*= true*/) const
655{
656 assert(sListFormat.has_value());
657
658 if (bIncludePrefixSuffix)
659 return *sListFormat;
660
661 // Strip prefix & suffix from string
662 return sListFormat->copy(sPrefix.getLength(), sListFormat->getLength() - sPrefix.getLength() - sSuffix.getLength());
663}
664
666{
667 return sCharStyleName;
668}
669
670sal_Int32 SvxNumRule::nRefCount = 0;
671static SvxNumberFormat* pStdNumFmt = nullptr;
674 sal_uInt16 nLevels,
675 bool bCont,
676 SvxNumRuleType eType,
678 eDefaultNumberFormatPositionAndSpaceMode )
679 : nLevelCount(nLevels),
680 nFeatureFlags(nFeatures),
681 eNumberingType(eType),
682 bContinuousNumbering(bCont)
683{
684 ++nRefCount;
685 for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
686 {
687 if(i < nLevels)
688 {
690 // It is a distinction between writer and draw
691 if(nFeatures & SvxNumRuleFlags::CONTINUOUS)
692 {
693 if ( eDefaultNumberFormatPositionAndSpaceMode ==
695 {
698 }
699 else if ( eDefaultNumberFormatPositionAndSpaceMode ==
701 {
702 // first line indent of general numbering in inch: -0,25 inch
703 constexpr tools::Long cFirstLineIndent = o3tl::toTwips(-0.25, o3tl::Length::in);
704 // indent values of general numbering in inch:
705 // 0,5 0,75 1,0 1,25 1,5
706 // 1,75 2,0 2,25 2,5 2,75
707 constexpr tools::Long cIndentAt = o3tl::toTwips(0.25, o3tl::Length::in);
708 aFmts[i]->SetPositionAndSpaceMode( SvxNumberFormat::LABEL_ALIGNMENT );
709 aFmts[i]->SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
710 aFmts[i]->SetListtabPos( cIndentAt * (i+2) );
711 aFmts[i]->SetFirstLineIndent( cFirstLineIndent );
712 aFmts[i]->SetIndentAt( cIndentAt * (i+2) );
713 }
714 }
715 else
716 {
717 aFmts[i]->SetAbsLSpace( DEF_DRAW_LSPACE * i );
718 }
719 }
720 else
721 aFmts[i] = nullptr;
722 aFmtsSet[i] = false;
723 }
724}
725
727{
728 ++nRefCount;
729 nLevelCount = rCopy.nLevelCount ;
733 for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
734 {
735 if(rCopy.aFmts[i])
736 aFmts[i].reset( new SvxNumberFormat(*rCopy.aFmts[i]) );
737 else
738 aFmts[i].reset();
739 aFmtsSet[i] = rCopy.aFmtsSet[i];
740 }
741}
742
744{
745 ++nRefCount;
746 nLevelCount = rCopy.nLevelCount ;
747 nFeatureFlags = rCopy.nFeatureFlags ;
748 bContinuousNumbering = rCopy.bContinuousNumbering;
749 eNumberingType = rCopy.eNumberingType;
750 for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
751 {
752 if(rCopy.aFmts[i])
753 aFmts[i] = std::move(rCopy.aFmts[i]);
754 aFmtsSet[i] = rCopy.aFmtsSet[i];
755 }
756}
757
759 : nLevelCount(0)
760{
761 sal_uInt16 nTmp16(0);
762 rStream.ReadUInt16( nTmp16 ); // NUM_ITEM_VERSION
763 rStream.ReadUInt16( nLevelCount );
764
766 {
767 SAL_WARN("editeng", "nLevelCount: " << nLevelCount << " greater than max of: " << SVX_MAX_NUM);
769 }
770
771 // first nFeatureFlags of old Versions
772 rStream.ReadUInt16( nTmp16 ); nFeatureFlags = static_cast<SvxNumRuleFlags>(nTmp16);
773 rStream.ReadUInt16( nTmp16 ); bContinuousNumbering = nTmp16;
774 rStream.ReadUInt16( nTmp16 ); eNumberingType = static_cast<SvxNumRuleType>(nTmp16);
775
776 for (sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
777 {
778 rStream.ReadUInt16( nTmp16 );
779 bool hasNumberingFormat = nTmp16 & 1;
780 aFmtsSet[i] = nTmp16 & 2; // fdo#68648 reset flag
781 if ( hasNumberingFormat ){
782 aFmts[i].reset( new SvxNumberFormat( rStream ) );
783 }
784 else
785 {
786 aFmts[i].reset();
787 aFmtsSet[i] = false; // actually only false is valid
788 }
789 }
790 //second nFeatureFlags for new versions
791 rStream.ReadUInt16( nTmp16 ); nFeatureFlags = static_cast<SvxNumRuleFlags>(nTmp16);
792}
793
795{
797 rStream.WriteUInt16( nLevelCount );
798 //first save of nFeatureFlags for old versions
799 rStream.WriteUInt16( static_cast<sal_uInt16>(nFeatureFlags) );
800 rStream.WriteUInt16( sal_uInt16(bContinuousNumbering) );
801 rStream.WriteUInt16( static_cast<sal_uInt16>(eNumberingType) );
802
803 FontToSubsFontConverter pConverter = nullptr;
804 bool bConvertBulletFont = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_50 ) && ( rStream.GetVersion() );
805 for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
806 {
807 sal_uInt16 nSetFlag(aFmtsSet[i] ? 2 : 0); // fdo#68648 store that too
808 if(aFmts[i])
809 {
810 rStream.WriteUInt16( 1 | nSetFlag );
811 if(bConvertBulletFont && aFmts[i]->GetBulletFont())
812 {
813 if(!pConverter)
814 pConverter =
815 CreateFontToSubsFontConverter(aFmts[i]->GetBulletFont()->GetFamilyName(),
816 FontToSubsFontFlags::EXPORT);
817 }
818 aFmts[i]->Store(rStream, pConverter);
819 }
820 else
821 rStream.WriteUInt16( 0 | nSetFlag );
822 }
823 //second save of nFeatureFlags for new versions
824 rStream.WriteUInt16( static_cast<sal_uInt16>(nFeatureFlags) );
825}
826
828{
829 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxNumRule"));
830 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("levelCount"), BAD_CAST(OString::number(nLevelCount).getStr()));
831 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("continuousNumbering"), BAD_CAST(OString::boolean(bContinuousNumbering).getStr()));
832 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("numberingType"), BAD_CAST(OString::number(static_cast<int>(eNumberingType)).getStr()));
833 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("featureFlags"), BAD_CAST(OString::number(static_cast<int>(nFeatureFlags)).getStr()));
834 for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
835 {
836 if(aFmts[i])
837 {
838 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("aFmts"));
839 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("i"), BAD_CAST(OString::number(i).getStr()));
840 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", aFmts[i].get());
841 (void)xmlTextWriterEndElement(pWriter);
842 }
843 }
844 (void)xmlTextWriterEndElement(pWriter);
845}
846
847
849{
850 if(!--nRefCount)
851 {
852 delete pStdNumFmt;
853 pStdNumFmt = nullptr;
854 delete pStdOutlineNumFmt;
855 pStdOutlineNumFmt = nullptr;
856 }
857}
858
860{
861 if (this != &rCopy)
862 {
863 nLevelCount = rCopy.nLevelCount;
867 for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
868 {
869 if(rCopy.aFmts[i])
870 aFmts[i].reset( new SvxNumberFormat(*rCopy.aFmts[i]) );
871 else
872 aFmts[i].reset();
873 aFmtsSet[i] = rCopy.aFmtsSet[i];
874 }
875 }
876 return *this;
877}
878
880{
881 if (this != &rCopy)
882 {
883 nLevelCount = rCopy.nLevelCount;
884 nFeatureFlags = rCopy.nFeatureFlags;
885 bContinuousNumbering = rCopy.bContinuousNumbering;
886 eNumberingType = rCopy.eNumberingType;
887 for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
888 {
889 if(rCopy.aFmts[i])
890 aFmts[i] = std::move(rCopy.aFmts[i]);
891 aFmtsSet[i] = rCopy.aFmtsSet[i];
892 }
893 }
894 return *this;
895}
896
897bool SvxNumRule::operator==( const SvxNumRule& rCopy) const
898{
899 if(nLevelCount != rCopy.nLevelCount ||
900 nFeatureFlags != rCopy.nFeatureFlags ||
903 return false;
904 for(sal_uInt16 i = 0; i < nLevelCount; i++)
905 {
906 if (
907 (aFmtsSet[i] != rCopy.aFmtsSet[i]) ||
908 (!aFmts[i] && rCopy.aFmts[i]) ||
909 (aFmts[i] && !rCopy.aFmts[i]) ||
910 (aFmts[i] && *aFmts[i] != *rCopy.aFmts[i])
911 )
912 {
913 return false;
914 }
915 }
916 return true;
917}
918
919const SvxNumberFormat* SvxNumRule::Get(sal_uInt16 nLevel)const
920{
921 DBG_ASSERT(nLevel < SVX_MAX_NUM, "Wrong Level" );
922 if( nLevel < SVX_MAX_NUM )
923 return aFmtsSet[nLevel] ? aFmts[nLevel].get() : nullptr;
924 else
925 return nullptr;
926}
927
928const SvxNumberFormat& SvxNumRule::GetLevel(sal_uInt16 nLevel)const
929{
930 if(!pStdNumFmt)
931 {
934 }
935
936 DBG_ASSERT(nLevel < SVX_MAX_NUM, "Wrong Level" );
937
938 return ( ( nLevel < SVX_MAX_NUM ) && aFmts[nLevel] ) ?
941}
942
943void SvxNumRule::SetLevel( sal_uInt16 i, const SvxNumberFormat& rNumFmt, bool bIsValid )
944{
945 DBG_ASSERT(i < SVX_MAX_NUM, "Wrong Level" );
946
947 if( i >= SVX_MAX_NUM )
948 return;
949
950 bool bReplace = !aFmtsSet[i];
951 if (!bReplace)
952 {
953 const SvxNumberFormat *pFmt = Get(i);
954 bReplace = pFmt == nullptr || rNumFmt != *pFmt;
955 }
956
957 if (bReplace)
958 {
959 aFmts[i].reset( new SvxNumberFormat(rNumFmt) );
960 aFmtsSet[i] = bIsValid;
961 }
962}
963
964void SvxNumRule::SetLevel(sal_uInt16 nLevel, const SvxNumberFormat* pFmt)
965{
966 DBG_ASSERT(nLevel < SVX_MAX_NUM, "Wrong Level" );
967
968 if( nLevel < SVX_MAX_NUM )
969 {
970 aFmtsSet[nLevel] = nullptr != pFmt;
971 if(pFmt)
972 SetLevel(nLevel, *pFmt);
973 else
974 {
975 aFmts[nLevel].reset();
976 }
977 }
978}
979
980OUString SvxNumRule::MakeNumString( const SvxNodeNum& rNum ) const
981{
982 OUStringBuffer aStr;
983 if( SVX_NO_NUM > rNum.GetLevel() && !( SVX_NO_NUMLEVEL & rNum.GetLevel() ) )
984 {
985 const SvxNumberFormat& rMyNFmt = GetLevel( rNum.GetLevel() );
986 aStr.append(rMyNFmt.GetPrefix());
987 if( SVX_NUM_NUMBER_NONE != rMyNFmt.GetNumberingType() )
988 {
989 sal_uInt8 i = rNum.GetLevel();
990
991 if( !IsContinuousNumbering() &&
992 1 < rMyNFmt.GetIncludeUpperLevels() ) // only on own level?
993 {
995 if( 1 < n )
996 {
997 if( i+1 >= n )
998 i -= n - 1;
999 else
1000 i = 0;
1001 }
1002 }
1003
1004 for( ; i <= rNum.GetLevel(); ++i )
1005 {
1006 const SvxNumberFormat& rNFmt = GetLevel( i );
1007 if( SVX_NUM_NUMBER_NONE == rNFmt.GetNumberingType() )
1008 {
1009 continue;
1010 }
1011
1012 bool bDot = true;
1013 if( rNum.GetLevelVal()[ i ] )
1014 {
1015 if(SVX_NUM_BITMAP != rNFmt.GetNumberingType())
1016 {
1018 aStr.append(rNFmt.GetNumStr( rNum.GetLevelVal()[ i ], rLang.getLocale(), rMyNFmt.GetIsLegal() ));
1019 }
1020 else
1021 bDot = false;
1022 }
1023 else
1024 aStr.append("0"); // all 0-levels are a 0
1025 if( i != rNum.GetLevel() && bDot)
1026 aStr.append(".");
1027 }
1028 }
1029
1030 aStr.append(rMyNFmt.GetSuffix());
1031 }
1032 return aStr.makeStringAndClear();
1033}
1034
1035// changes linked to embedded bitmaps
1037{
1038 for(sal_uInt16 i = 0; i < GetLevelCount(); i++)
1039 {
1040 SvxNumberFormat aFmt(GetLevel(i));
1041 const SvxBrushItem* pBrush = aFmt.GetBrush();
1042 if(SVX_NUM_BITMAP == aFmt.GetNumberingType())
1043 {
1044 if(pBrush && !pBrush->GetGraphicLink().isEmpty())
1045 {
1046 const Graphic* pGraphic = pBrush->GetGraphic();
1047 if (pGraphic)
1048 {
1049 SvxBrushItem aTempItem(*pBrush);
1050 aTempItem.SetGraphicLink("");
1051 aTempItem.SetGraphic(*pGraphic);
1052 sal_Int16 eOrient = aFmt.GetVertOrient();
1053 aFmt.SetGraphicBrush( &aTempItem, &aFmt.GetGraphicSize(), &eOrient );
1054 }
1055 }
1056 }
1057 else if((SVX_NUM_BITMAP|LINK_TOKEN) == static_cast<int>(aFmt.GetNumberingType()))
1059 SetLevel(i, aFmt);
1060 }
1061}
1062
1064 SfxPoolItem(SID_ATTR_NUMBERING_RULE),
1065 maNumRule(rRule)
1066{
1067}
1068
1070 SfxPoolItem(SID_ATTR_NUMBERING_RULE),
1071 maNumRule(std::move(rRule))
1072{
1073}
1074
1075SvxNumBulletItem::SvxNumBulletItem(SvxNumRule const & rRule, sal_uInt16 _nWhich ) :
1076 SfxPoolItem(_nWhich),
1077 maNumRule(rRule)
1078{
1079}
1080
1081SvxNumBulletItem::SvxNumBulletItem(SvxNumRule && rRule, sal_uInt16 _nWhich ) :
1082 SfxPoolItem(_nWhich),
1083 maNumRule(std::move(rRule))
1084{
1085}
1086
1088 SfxPoolItem(rCopy),
1089 maNumRule(rCopy.maNumRule)
1090{
1091}
1092
1094{
1095}
1096
1098{
1099 return SfxPoolItem::operator==(rCopy) &&
1100 maNumRule == static_cast<const SvxNumBulletItem&>(rCopy).maNumRule;
1101}
1102
1104{
1105 return new SvxNumBulletItem(*this);
1106}
1107
1108bool SvxNumBulletItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
1109{
1110 rVal <<= SvxCreateNumRule( maNumRule );
1111 return true;
1112}
1113
1114bool SvxNumBulletItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
1115{
1116 uno::Reference< container::XIndexReplace > xRule;
1117 if( rVal >>= xRule )
1118 {
1119 try
1120 {
1121 SvxNumRule aNewRule( SvxGetNumRule( xRule ) );
1122 if( aNewRule.GetLevelCount() != maNumRule.GetLevelCount() ||
1123 aNewRule.GetNumRuleType() != maNumRule.GetNumRuleType() )
1124 {
1126 }
1127 maNumRule = std::move( aNewRule );
1128 return true;
1129 }
1130 catch(const lang::IllegalArgumentException&)
1131 {
1132 }
1133 }
1134 return false;
1135}
1136
1138{
1139 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxNumBulletItem"));
1140 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1141 maNumRule.dumpAsXml(pWriter);
1142 (void)xmlTextWriterEndElement(pWriter);
1143}
1144
1145SvxNumRule SvxConvertNumRule( const SvxNumRule& rRule, sal_uInt16 nLevels, SvxNumRuleType eType )
1146{
1147 const sal_uInt16 nSrcLevels = rRule.GetLevelCount();
1148 SvxNumRule aNewRule(rRule.GetFeatureFlags(), nLevels, rRule.IsContinuousNumbering(), eType );
1149
1150 for( sal_uInt16 nLevel = 0; (nLevel < nLevels) && (nLevel < nSrcLevels); nLevel++ )
1151 aNewRule.SetLevel( nLevel, rRule.GetLevel( nLevel ) );
1152
1153 return aNewRule;
1154}
1155
1156/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertiesInfo aProperties
XPropertyListType t
@ GPOS_AREA
Definition: brushitem.hxx:38
constexpr sal_uInt16 BRUSH_GRAPHIC_VERSION
Definition: brushitem.hxx:30
const LanguageTag & GetLanguageTag() const
static OutputDevice * GetDefaultDevice()
static const AllSettings & GetSettings()
Size GetPrefSize() const
MapMode GetPrefMapMode() const
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
MapUnit GetMapUnit() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void SetMapMode()
const MapMode & GetMapMode() const
sal_uInt16 Which() const
virtual bool operator==(const SfxPoolItem &) const=0
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
SvStream & WriteInt32(sal_Int32 nInt32)
SvStream & WriteUniOrByteString(std::u16string_view rStr, rtl_TextEncoding eDestCharSet)
OUString ReadUniOrByteString(rtl_TextEncoding eSrcCharSet)
SvStream & ReadInt16(sal_Int16 &rInt16)
SvStream & WriteInt16(sal_Int16 nInt16)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
sal_Int32 GetVersion() const
SvStream & ReadInt32(sal_Int32 &rInt32)
rtl_TextEncoding GetStreamCharSet() const
sal_uInt64 SeekRel(sal_Int64 nPos)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
void SetGraphicLink(const OUString &rNew)
Definition: frmitems.cxx:4530
const Graphic * GetGraphic(OUString const &referer=OUString()) const
Definition: frmitems.cxx:4465
const OUString & GetGraphicLink() const
Definition: brushitem.hxx:112
void SetGraphic(const Graphic &rNew)
Definition: frmitems.cxx:4490
virtual SvxBrushItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: frmitems.cxx:4387
sal_uInt8 GetLevel() const
Definition: numitem.hxx:342
const sal_uInt16 * GetLevelVal() const
Definition: numitem.hxx:345
SvxNumBulletItem(SvxNumRule const &rRule)
Definition: numitem.cxx:1063
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: numitem.cxx:1108
virtual bool operator==(const SfxPoolItem &) const override
Definition: numitem.cxx:1097
virtual SvxNumBulletItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: numitem.cxx:1103
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: numitem.cxx:1114
SvxNumRule maNumRule
Definition: numitem.hxx:313
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: numitem.cxx:1137
virtual ~SvxNumBulletItem() override
Definition: numitem.cxx:1093
void Store(SvStream &rStream)
Definition: numitem.cxx:794
bool aFmtsSet[SVX_MAX_NUM]
Definition: numitem.hxx:264
OUString MakeNumString(const SvxNodeNum &) const
Definition: numitem.cxx:980
std::unique_ptr< SvxNumberFormat > aFmts[SVX_MAX_NUM]
Definition: numitem.hxx:259
sal_uInt16 GetLevelCount() const
Definition: numitem.hxx:298
SvxNumRuleFlags GetFeatureFlags() const
Definition: numitem.hxx:301
const SvxNumberFormat * Get(sal_uInt16 nLevel) const
Definition: numitem.cxx:919
const SvxNumberFormat & GetLevel(sal_uInt16 nLevel) const
Definition: numitem.cxx:928
static sal_Int32 nRefCount
Definition: numitem.hxx:266
SvxNumRuleType GetNumRuleType() const
Definition: numitem.hxx:306
bool operator==(const SvxNumRule &) const
Definition: numitem.cxx:897
SvxNumRuleType eNumberingType
Definition: numitem.hxx:262
SvxNumRule & operator=(const SvxNumRule &)
Definition: numitem.cxx:859
void UnLinkGraphics()
Definition: numitem.cxx:1036
bool IsContinuousNumbering() const
Definition: numitem.hxx:293
bool bContinuousNumbering
Definition: numitem.hxx:263
SvxNumRuleFlags nFeatureFlags
Definition: numitem.hxx:261
sal_uInt16 nLevelCount
Definition: numitem.hxx:260
SvxNumRule(SvxNumRuleFlags nFeatures, sal_uInt16 nLevels, bool bCont, SvxNumRuleType eType=SvxNumRuleType::NUMBERING, SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
Definition: numitem.cxx:673
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: numitem.cxx:827
void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat &rFmt, bool bIsValid=true)
Definition: numitem.cxx:943
std::optional< OUString > sListFormat
Definition: numitem.hxx:107
tools::Long GetIndentAt() const
Definition: numitem.hxx:224
OUString sSuffix
Definition: numitem.hxx:106
virtual void SetGraphicBrush(const SvxBrushItem *pBrushItem, const Size *pSize=nullptr, const sal_Int16 *pOrient=nullptr)
Definition: numitem.cxx:426
void SetPositionAndSpaceMode(SvxNumPositionAndSpaceMode ePositionAndSpaceMode)
Definition: numitem.cxx:473
void SetFirstLineIndent(const tools::Long nFirstLineIndent)
Definition: numitem.cxx:524
sal_uInt8 GetIncludeUpperLevels() const
Definition: numitem.hxx:195
const SvxBrushItem * GetBrush() const
Definition: numitem.hxx:200
void SetBulletFont(const vcl::Font *pFont)
Definition: numitem.cxx:465
sal_uInt16 nStart
Definition: numitem.hxx:114
bool operator==(const SvxNumberFormat &) const
Definition: numitem.cxx:380
sal_uInt16 nBulletRelSize
Definition: numitem.hxx:117
sal_Int32 nAbsLSpace
Definition: numitem.hxx:132
OUString GetListFormat(bool bIncludePrefixSuffix=true) const
Definition: numitem.cxx:654
tools::Long mnListtabPos
Definition: numitem.hxx:139
sal_Int32 GetFirstLineOffset() const
Definition: numitem.cxx:484
tools::Long GetFirstLineIndent() const
Definition: numitem.hxx:222
void SetSuffix(const OUString &rSet)
Definition: numitem.cxx:580
SvxAdjust eNumAdjust
Definition: numitem.hxx:111
virtual ~SvxNumberFormat()
Definition: numitem.cxx:263
const Size & GetGraphicSize() const
Definition: numitem.hxx:204
sal_Int32 GetAbsLSpace() const
Definition: numitem.cxx:478
void SetListFormat(const OUString &rPrefix, const OUString &rSuffix, int nLevel)
Definition: numitem.cxx:589
bool GetIsLegal() const
Definition: numitem.hxx:229
sal_UCS4 cBullet
Definition: numitem.hxx:116
tools::Long mnFirstLineIndent
Definition: numitem.hxx:141
short nCharTextDistance
Definition: numitem.hxx:133
std::unique_ptr< SvxBrushItem > pGraphicBrush
Definition: numitem.hxx:146
virtual OUString GetCharFormatName() const
Definition: numitem.cxx:665
void Store(SvStream &rStream, FontToSubsFontConverter pConverter)
Definition: numitem.cxx:267
SvxNumPositionAndSpaceMode
Definition: numitem.hxx:92
@ LABEL_WIDTH_AND_POSITION
Definition: numitem.hxx:93
static Size GetGraphicSizeMM100(const Graphic *pGraphic)
Definition: numitem.cxx:533
void SetGraphic(const OUString &rName)
Definition: numitem.cxx:447
Color nBulletColor
Definition: numitem.hxx:118
void SetIndentAt(const tools::Long nIndentAt)
Definition: numitem.cxx:528
sal_Int16 eVertOrient
Definition: numitem.hxx:147
OUString sCharStyleName
Definition: numitem.hxx:153
void SetPrefix(const OUString &rSet)
Definition: numitem.cxx:571
OUString sPrefix
Definition: numitem.hxx:105
sal_Int32 nFirstLineOffset
Definition: numitem.hxx:131
sal_uInt8 nInclUpperLevels
Definition: numitem.hxx:113
tools::Long mnIndentAt
Definition: numitem.hxx:143
LabelFollowedBy meLabelFollowedBy
Definition: numitem.hxx:137
SvxNumberFormat & operator=(const SvxNumberFormat &)
Definition: numitem.cxx:342
static OUString CreateRomanString(sal_Int32 nNo, bool bUpper)
Definition: numitem.cxx:551
SvxNumPositionAndSpaceMode mePositionAndSpaceMode
Definition: numitem.hxx:129
OUString GetLabelFollowedByAsString() const
Definition: numitem.cxx:500
const OUString & GetPrefix() const
Definition: numitem.hxx:173
void SetLabelFollowedBy(const LabelFollowedBy eLabelFollowedBy)
Definition: numitem.cxx:495
SvxNumberFormat(SvxNumType nNumberingType)
Definition: numitem.cxx:172
std::optional< vcl::Font > pBulletFont
Definition: numitem.hxx:151
void SetListtabPos(const tools::Long nListtabPos)
Definition: numitem.cxx:520
const OUString & GetSuffix() const
Definition: numitem.hxx:175
sal_Int16 GetVertOrient() const
Definition: numitem.cxx:460
short GetCharTextDistance() const
Definition: numitem.cxx:490
static css::uno::Reference< css::text::XNumberingFormatter > xFormatter
Definition: numitem.hxx:58
bool bShowSymbol
Definition: numitem.hxx:61
void dumpAsXml(xmlTextWriterPtr w) const
Definition: numitem.cxx:165
bool IsShowSymbol() const
Definition: numitem.hxx:76
SvxNumType nNumType
Definition: numitem.hxx:60
void SetNumberingType(SvxNumType nSet)
Definition: numitem.hxx:72
SvxNumType GetNumberingType() const
Definition: numitem.hxx:73
void SetShowSymbol(bool bSet)
Definition: numitem.hxx:75
SvxNumberType(SvxNumType nType=SVX_NUM_ARABIC)
Definition: numitem.cxx:88
static sal_Int32 nRefCount
Definition: numitem.hxx:57
OUString GetNumStr(sal_Int32 nNo) const
Definition: numitem.cxx:108
void writeColor(const Color &rColor)
void readSize(Size &rSize)
void readColor(Color &rColor)
void writeSize(const Size &rSize)
static bool IsFuzzing()
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
sal_Int32 nRefCount
#define DBG_ASSERT(sCon, aError)
float u
#define SOFFICE_FILEFORMAT_50
struct _xmlTextWriter * xmlTextWriterPtr
DocumentType eType
UNOTOOLS_DLLPUBLIC OUString GetFontToSubsFontName(FontToSubsFontConverter hConverter)
UNOTOOLS_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter(std::u16string_view rFontName, FontToSubsFontFlags nFlags)
UNOTOOLS_DLLPUBLIC sal_Unicode ConvertFontToSubsFontChar(FontToSubsFontConverter hConverter, sal_Unicode c)
void * FontToSubsFontConverter
VCL_DLLPUBLIC SvStream & ReadFont(SvStream &rIStm, vcl::Font &)
VCL_DLLPUBLIC SvStream & WriteFont(SvStream &rOStm, const vcl::Font &)
sal_Int64 n
sal_Int16 nNumType
sal_Int32 nFirstLineOffset
#define SAL_WARN(area, stream)
aStr
def text(shape, orig_st)
NONE
double getLength(const B2DPolygon &rCandidate)
@ Exception
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
int i
SvStream & Store(const SvxBrushItem &rItem, SvStream &rStrm, sal_uInt16)
Definition: legacyitem.cxx:592
void Create(SvxBrushItem &rItem, SvStream &rStrm, sal_uInt16 nItemVersion)
Definition: legacyitem.cxx:489
constexpr auto toTwips(N number, Length from)
long Long
#define SVX_DEF_BULLET
Definition: numdef.hxx:24
#define SVX_MAX_NUM
Definition: numdef.hxx:23
static SvxNumberFormat * pStdNumFmt
Definition: numitem.cxx:671
static void lcl_getFormatter(css::uno::Reference< css::text::XNumberingFormatter > &_xFormatter)
Definition: numitem.cxx:71
constexpr sal_uInt16 NUMITEM_VERSION_04
Definition: numitem.cxx:60
constexpr sal_uInt16 NUMITEM_VERSION_03
Definition: numitem.cxx:59
SvxNumRule SvxConvertNumRule(const SvxNumRule &rRule, sal_uInt16 nLevels, SvxNumRuleType eType)
Definition: numitem.cxx:1145
constexpr sal_Int32 DEF_WRITER_LSPACE
Definition: numitem.cxx:56
constexpr sal_Int32 DEF_DRAW_LSPACE
Definition: numitem.cxx:57
static bool isArabicNumberingType(SvxNumType t)
Definition: numitem.cxx:116
static SvxNumberFormat * pStdOutlineNumFmt
Definition: numitem.cxx:672
SvxNumRuleType
Definition: numitem.hxx:251
SvxNumRuleFlags
Definition: numitem.hxx:235
#define LINK_TOKEN
Definition: numitem.hxx:51
#define SVX_NO_NUM
Definition: numitem.hxx:46
#define SVX_NO_NUMLEVEL
Definition: numitem.hxx:47
std::vector< char * > values
QPRO_FUNC_TYPE nType
static SfxItemSet & rSet
SvxNumType
these must match the values in css::style::NumberingType
Definition: svxenum.hxx:144
@ SVX_NUM_NUMBER_NONE
Definition: svxenum.hxx:150
@ SVX_NUM_CHARS_UPPER_LETTER
Definition: svxenum.hxx:145
@ SVX_NUM_ARABIC_ZERO3
Definition: svxenum.hxx:210
@ SVX_NUM_ARABIC
Definition: svxenum.hxx:149
@ SVX_NUM_ARABIC_ZERO4
Definition: svxenum.hxx:211
@ SVX_NUM_BITMAP
Definition: svxenum.hxx:153
@ SVX_NUM_ARABIC_ZERO5
Definition: svxenum.hxx:212
@ SVX_NUM_ARABIC_ZERO
Definition: svxenum.hxx:209
SvxAdjust
Definition: svxenum.hxx:77
Left
unsigned char sal_uInt8
#define SAL_MIN_INT16
#define SAL_MAX_INT16
sal_uInt16 sal_Unicode
css::uno::Reference< css::container::XIndexReplace > SvxCreateNumRule(const SvxNumRule &rRule)
Definition: unonrule.cxx:481
const SvxNumRule & SvxGetNumRule(Reference< XIndexReplace > const &xRule)
Definition: unonrule.cxx:472