21#include <vcl/font.hxx>
27#include <com/sun/star/i18n/ScriptType.hpp>
52 pMyNumRule->
Set(
i, rSubRule );
63 pMyNumRule->
Set(nLevel, aNumFormat);
73 auto const it(
m_Lists.find(rListId));
82 (void) pNewAbstractRule;
95 OUString
const& rListId,
103 assert(numdef != USHRT_MAX);
104 assert(absnumdef != USHRT_MAX);
105 auto const mapping = std::make_pair(numdef, absnumdef);
112 return it.first->first;
116 sal_uInt16 nLevelNum,
130 bool bOutlineRuleAdded(
false );
133 const SwNumRule& rRule = *(*m_pUsedNumTable)[ --
n ];
140 bOutlineRuleAdded =
true;
144 if ( !bOutlineRuleAdded )
162 "<GetWordFirstLineOffset> - misusage: position-and-space-mode does not equal LABEL_WIDTH_AND_POSITION" );
218 for ( sal_uInt16
n = 0;
n <
nCount; ++
n )
220 const SwNumRule * pRule = (*m_pUsedNumTable)[
n ];
229 pRule = (*m_pUsedNumTable)[it->second.first];
258 case style::NumberingType::SYMBOL_CHICAGO:
271 sal_uInt16 nNumberingType,
278 sal_Int16 nFirstLineIndex,
279 sal_Int16 nListTabPos,
280 const OUString &rNumberingString,
296 case SvxAdjust::Center:
299 case SvxAdjust::Right:
320 std::unique_ptr<ww::bytes> pCharAtrs;
358 0x15, 0xc6, 0x05, 0x00, 0x01, 0, 0, 0x06
376 if (pCharAtrs && !pCharAtrs->empty())
398 const SwNumRule& rRule = *(*m_pUsedNumTable)[
n ];
402 for( nLvl = 0; nLvl < nLevels; ++nLvl )
453 OSL_FAIL(
"unknown GetLabelFollowedBy() return value" );
461 bool bWriteBullet =
false;
462 std::optional<vcl::Font> pBulletFont;
463 rtl_TextEncoding eChrSet=0;
470 sNumStr = OUString(&cBullet, 1);
483 OUString sSrch(
"%" + OUString::number(
i+1) +
"%");
484 sal_Int32 nFnd = sNumStr.indexOf(sSrch);
487 *pLvlPos =
static_cast<sal_uInt8>(nFnd + 1);
489 sNumStr = sNumStr.replaceAt(nFnd, sSrch.getLength(), rtl::OUStringChar(
static_cast<char>(
i)));
494 assert(
false &&
"deprecated format still exists and is unhandled. Inform Vasily or Justin");
508 eChrSet = pBulletFont->GetCharSet();
509 sFontName = pBulletFont->GetFamilyName();
510 eFamily = pBulletFont->GetFamilyType();
517 std::unique_ptr<wwFont> pPseudoFont;
533 if (sFontName.isEmpty())
534 sFontName = pBulletFont->GetFamilyName();
536 pPseudoFont.reset(
new wwFont( sFontName, pBulletFont->GetPitch(),
543 sal_Int16 nIndentAt = 0;
544 sal_Int16 nFirstLineIndex = 0;
545 sal_Int16 nListTabPos = -1;
555 nIndentAt =
static_cast<sal_Int16
>(rFormat.
GetIndentAt());
567 pPseudoFont.get(), pOutSet,
568 nIndentAt, nFirstLineIndex, nListTabPos,
611 for( ; nNms <
nCount; ++nNms )
613 const SwNumRule& rRule = *(*m_pUsedNumTable)[ nNms ];
629 rtl_TextEncoding& rChrSet, OUString& rFontName )
const
633 OUString sFontName = rFontName;
636 if (rNumStr[0] !=
u'\0')
638 rNumStr = rNumStr.replaceAt(0, 1, rtl::OUStringChar(
642 rFontName = sFontName;
virtual void NumberingDefinition(sal_uInt16 nId, const SwNumRule &rRule)=0
Definition of a numbering instance.
virtual void NumberingLevel(sal_uInt8 nLevel, sal_uInt16 nStart, sal_uInt16 nNumberingType, SvxAdjust eAdjust, const sal_uInt8 *pNumLvlPos, sal_uInt8 nFollow, const wwFont *pFont, const SfxItemSet *pOutSet, sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, const OUString &rNumberingString, const SvxBrushItem *pBrush, bool isLegal)=0
All the numbering level information.
virtual void OverrideNumberingDefinition(SwNumRule const &, sal_uInt16, sal_uInt16, const std::map< size_t, size_t > &)
Numbering definition that overrides abstract numbering definition.
virtual void StartAbstractNumbering(sal_uInt16)
Start of the abstract numbering definition instance.
virtual void EndAbstractNumbering()
End of the abstract numbering definition instance.
void OutputItemSet(const SfxItemSet &rSet, bool bPapFormat, bool bChpFormat, sal_uInt16 nScript, bool bExportParentItemSet)
Use OutputItem() on an item set according to the parameters.
void SubstituteBullet(OUString &rNumStr, rtl_TextEncoding &rChrSet, OUString &rFontName) const
sal_uInt16 m_nUniqueList
current number for creating unique list names
sal_uInt16 DuplicateNumRule(const SwNumRule *pRule, sal_uInt8 nLevel, sal_uInt16 nVal)
In case of numbering restart.
SwNumRule * DuplicateNumRuleImpl(const SwNumRule *pRule)
void AddListLevelOverride(sal_uInt16 nListId, sal_uInt16 nLevelNum, sal_uInt16 nStartAt)
Store list level overrides (restart of list)
sal_uInt16 OverrideNumRule(SwNumRule const &rExistingRule, OUString const &rListId, SwNumRule const &rAbstractRule)
Create a overriding numbering definition (if it does not yet exist)
bool m_bSubstituteBullets
std::map< size_t, std::pair< size_t, size_t > > m_OverridingNums
overriding numdef index -> (existing numdef index, abstractnumdef index)
void NumberingLevel(SwNumRule const &rRule, sal_uInt8 nLvl)
Write one numbering level.
wwFontHelper m_aFontHelper
int GetGrfIndex(const SvxBrushItem &rBrush)
Returns the index of a picture bullet, used in numberings.
sal_uInt16 GetNumberingId(const SwNumRule &rNumRule)
Return the numeric id of the numbering rule.
std::unique_ptr< SwNumRuleTable > m_pUsedNumTable
virtual AttributeOutputBase & AttrOutput() const =0
Access to the attribute output class.
std::map< OUString, size_t > m_Lists
list-id -> abstractnumdef index
sal_uInt16 DuplicateAbsNum(OUString const &rListId, SwNumRule const &rAbstractRule)
check if a new abstractNum is needed for this list
void AbstractNumberingDefinitions()
Write all Levels for all SwNumRules - LVLF.
std::map< size_t, std::map< size_t, size_t > > m_ListLevelOverrides
Map of maps for list levels overrides listid -> level number -> restart value.
void NumberingDefinitions()
Write static data of SwNumRule - LSTF.
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SvStream & WriteInt32(sal_Int32 nInt32)
std::size_t WriteBytes(const void *pData, std::size_t nSize)
SvStream & WriteInt16(sal_Int16 nInt16)
SvStream & WriteUChar(unsigned char nChar)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
LanguageType GetLanguage() const
SvxNumType GetNumberingType() const
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
bool IsUsed(const sw::BroadcastingModify &) const
const SwNumRuleTable & GetNumRuleTable() const
SwNumRule * GetOutlineNumRule() const
const SwAttrPool & GetAttrPool() const
bool IsContinusNum() const
const OUString & GetDefaultListId() const
const SwNumFormat & Get(sal_uInt16 i) const
void Set(sal_uInt16 i, const SwNumFormat *)
const OUString & GetName() const
static void FillCount(SvStream &rStrm, sal_uLong nCount)
static void WriteLong(SvStream &rStrm, sal_Int32 nVal)
static void WriteString16(SvStream &rStrm, const OUString &rStr, bool bAddZero)
virtual void NumberingDefinition(sal_uInt16 nId, const SwNumRule &rRule) override
Definition of a numbering instance.
virtual void NumberingLevel(sal_uInt8 nLevel, sal_uInt16 nStart, sal_uInt16 nNumberingType, SvxAdjust eAdjust, const sal_uInt8 *pNumLvlPos, sal_uInt8 nFollow, const wwFont *pFont, const SfxItemSet *pOutSet, sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, const OUString &rNumberingString, const SvxBrushItem *pBrush, bool isLegal) override
All the numbering level information.
WW8Export & m_rWW8Export
Reference to the export, where to get the data from.
void InsUInt16(sal_uInt16 n)
virtual void WriteNumbering() override
Output the numbering table.
void InsUInt32(sal_uInt32 n)
std::unique_ptr< WW8Fib > m_pFib
File Information Block.
void OutOverrideListTab()
static sal_uInt8 GetNumId(sal_uInt16 eNumType)
Converts the SVX numbering type to MSONFC.
std::unique_ptr< ww::bytes > m_pO
Buffer.
sal_uInt16 GetId(const SvxFontItem &rFont)
Collects and outputs fonts.
UNOTOOLS_DLLPUBLIC bool IsOpenSymbol(std::u16string_view rFontName)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
#define LANGUAGE_CHINESE_SIMPLIFIED
sal_Int32 nFirstLineOffset
std::unique_ptr< sal_Int32[]> pData
sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cBullet, rtl_TextEncoding &r_ioChrSet, OUString &r_ioFontName)
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
std::vector< sal_uInt8 > bytes
static constexpr sal_uInt16 val
constexpr sal_uInt8 MAXLEVEL
static sal_uInt8 GetLevelNFC(sal_uInt16 eNumType, const SfxItemSet *pOutSet, sal_uInt8 nDefault)
Converts the SVX numbering type to MSONFC.
sal_Int16 GetWordFirstLineOffset(const SwNumFormat &rFormat)
void Set_UInt16(sal_uInt8 *&p, sal_uInt16 n)