20#ifndef INCLUDED_SW_SOURCE_FILTER_WW8_WW8SCAN_HXX
21#define INCLUDED_SW_SOURCE_FILTER_WW8_WW8SCAN_HXX
29#include <unordered_map>
32#include <osl/endian.h>
35#include <rtl/ustring.hxx>
46 inline constexpr OUStringLiteral
a1Table =
u"1Table";
47 inline constexpr OUStringLiteral
a0Table =
u"0Table";
48 inline constexpr OUStringLiteral
aData =
u"Data";
49 inline constexpr OUStringLiteral
aCheckBox =
u"CheckBox";
50 inline constexpr OUStringLiteral
aListBox =
u"ListBox";
70 for (std::size_t
i = 0;
i !=
size; ++
i) {
71 bool ins =
map_.emplace(rows[
i].
nId, rows[
i].info).second;
72 assert(ins); (void) ins;
79 Map::const_iterator
i(
map_.find(
id));
80 return i ==
map_.end() ? nullptr : &
i->second;
84 typedef std::unordered_map<sal_uInt16, SprmInfo>
Map;
187 sal_uInt16 nExtraLen, rtl_TextEncoding eCS, std::vector<OUString> &rArray,
188 std::vector<ww::bytes>* pExtraArray =
nullptr, std::vector<OUString>* pValueArray =
nullptr);
243 bool Get(
WW8_CP& rStart,
void*& rpValue)
const;
248 return ( nInIdx >=
m_nIMax ) ? nullptr
322 WW8_CP nStartPos, sal_Int32 nPN, sal_Int32 ncpN);
334 return ( nInIdx >=
m_nIMax ) ? nullptr :
375 sal_Int32
Where()
const;
415 virtual void SetIdx(sal_uInt32 nIdx) = 0;
416 virtual sal_uInt32
GetIdx2()
const;
417 virtual void SetIdx2(sal_uInt32 nIdx);
423 virtual sal_uInt16
GetIstd()
const {
return 0xffff; }
439 std::vector<std::unique_ptr<sal_uInt8[]>>
const &
mrGrpprls;
449 virtual sal_uInt32
GetIdx()
const override;
450 virtual void SetIdx(sal_uInt32 nI)
override;
454 virtual void advance()
override;
471 WW8_CP nStartCp,
bool bVer67P);
474 virtual sal_uInt32
GetIdx()
const override;
475 virtual void SetIdx(sal_uInt32 nI)
override;
479 virtual void advance()
override;
490 bIsUnicodeAddress = 0 == (0x40000000 & nfc);
491 return bIsUnicodeAddress ? nfc : (nfc & 0x3fffFFFF) / 2;
538 void FillEntry(
Entry &rEntry, std::size_t nDataOffset, sal_uInt16 nLen);
574 void HasSprm(sal_uInt16 nId, std::vector<SprmResult> &rResult);
619 virtual sal_uInt32
GetIdx()
const override;
620 virtual void SetIdx(sal_uInt32 nIdx)
override;
624 virtual void advance()
override;
625 virtual sal_uInt16
GetIstd()
const override;
628 void HasSprm(sal_uInt16 nId, std::vector<SprmResult> &rResult);
652 virtual sal_uInt32
GetIdx2()
const override;
653 virtual void SetIdx2(sal_uInt32 nIdx)
override;
657 virtual void advance()
override;
680 virtual sal_uInt32
GetIdx()
const override;
681 virtual void SetIdx(sal_uInt32 nIdx)
override;
685 virtual void advance()
override;
690 bool Find4Sprms(sal_uInt16 nId1, sal_uInt16 nId2, sal_uInt16 nId3, sal_uInt16 nId4,
708 virtual sal_uInt32
GetIdx()
const override;
709 virtual void SetIdx(sal_uInt32 nIdx)
override;
720 virtual void advance()
override;
736 virtual sal_uInt32
GetIdx()
const override;
737 virtual void SetIdx(sal_uInt32 nIdx)
override;
741 virtual void advance()
override;
767 virtual sal_uInt32
GetIdx()
const override;
768 virtual void SetIdx(sal_uInt32 nI)
override;
769 virtual sal_uInt32
GetIdx2()
const override;
770 virtual void SetIdx2(sal_uInt32 nIdx)
override;
774 virtual void advance()
override;
775 const OUString*
GetName()
const;
804 virtual sal_uInt32
GetIdx()
const override;
805 virtual void SetIdx(sal_uInt32 nI)
override;
806 virtual sal_uInt32
GetIdx2()
const override;
807 virtual void SetIdx2(sal_uInt32 nIdx)
override;
811 virtual void advance()
override;
834 virtual sal_uInt32
GetIdx()
const override;
835 virtual void SetIdx(sal_uInt32 nI)
override;
836 virtual sal_uInt32
GetIdx2()
const override;
837 virtual void SetIdx2(sal_uInt32 nIdx)
override;
841 virtual void advance()
override;
965 void AdvSprm(
short nIdx,
bool bStart);
973 bool bDoingDrawTextBox =
false);
998 void HasCharSprm(sal_uInt16 nId, std::vector<SprmResult> &rResult)
const;
1060 std::unique_ptr<sal_uInt8[]>
1092 WW8_CP* pNextPieceCp =
nullptr,
bool* pTestFlag =
nullptr)
const;
1095 tools::Long nTotalLen, rtl_TextEncoding eEnc )
const;
1576 std::unique_ptr<WW8_STD>
Read1Style(sal_uInt16& rSkip, OUString* pString);
1847 WW8Dop(
SvStream& rSt, sal_Int16 nFib, sal_Int32 nPos, sal_uInt32 nSize);
FIB - the File Information Block.
sal_Int32 m_lcbSttbListNames
sal_Int32 m_lcbPlcfHdrtxbxBkd
sal_Int32 m_lcbPlcfspaHdr
sal_Int32 m_lcbPlcftxbxBkd
sal_Int32 m_lcbPlcfAtnbkf
sal_Int32 m_lcbSttbAutoCaption
sal_Int32 m_lcbSttbfRMark
sal_Int32 m_lcbPlcfHdrtxbxText
WW8_FC m_fcPlcffactoid
0x4ba Plcffactoid offset.
WW8_FC m_fcFormFieldSttbf
sal_Int32 m_lcbSttbfCaption
sal_Int32 m_lcbFormFieldSttbf
sal_Int32 m_lcbPlcfpgdEdn
WW8Fib(SvStream &rStrm, sal_uInt8 nWantedVersion, sal_uInt32 nOffset=0)
sal_uInt32 m_lcbAtrdExtra
sal_uInt32 m_lcbPlcfBklFactoid
0x446 smart-tag bookmark ends length.
WW8_FC m_fcFactoidData
0x44a smart tag data offset.
sal_Int32 m_lcbPlcftxbxText
sal_uInt32 m_lcbFactoidData
0x44e smart tag data length.
sal_Int32 m_lcbPlcffldEdn
void Write(SvStream &rStrm)
WW8_FC m_fcAutosaveSource
sal_Int32 m_lcbGrpStAtnOwners
sal_Int32 m_lcbSttbfAtnbkmk
sal_Int32 m_lcbPlcfpgdFootnote
sal_Int32 m_lcbPlcfbteChpx
sal_Int32 m_lcbPlcfspaMom
void WriteHeader(SvStream &rStrm)
sal_Int32 m_fcIslandFirst
sal_Int32 m_lcbPlcffldMcr
sal_Int32 m_lcbPlcfAtnbkl
sal_uInt8 m_nVersion
Program-Version asked for by us: in Ctor we check if it matches the value of nFib.
WW8_FC m_fcPlcfHdrtxbxText
sal_Int32 m_pnFbpPapFirst
WW8_FC m_fcSttbfBkmkFactoid
0x42a smart-tag bookmark string table offset.
sal_uInt16 m_wMagicCreated
sal_uInt16 m_cswNew
Specifies the count of 16-bit values corresponding to fibRgCswNew that follow.
sal_Int32 m_lcbAutosaveSource
sal_Int32 m_lcbPlcfandText
sal_uInt32 m_lcbPlcfBkfFactoid
0x436 smart-tag bookmark ends length.
sal_uInt32 m_lcbSttbfBkmkFactoid
0x42e smart-tag bookmark string table length.
WW8_FC m_fcPlcfHdrtxbxBkd
sal_Int32 m_lcbPlcfdoaMom
sal_Int32 m_lcbPlcfbtePapx
ww::WordVersion GetFIBVersion() const
WW8_FC m_fcSttbAutoCaption
sal_Int32 m_lcbPlcffldFootnote
sal_uInt16 m_wMagicRevised
sal_Int32 m_lcbPlcffldTxbx
static rtl_TextEncoding GetFIBCharset(sal_uInt16 chs, LanguageType nLidLocale)
WW8_FC m_fcPlcffldFootnote
sal_Int32 m_lcbSttbfAssoc
sal_Int32 m_lcbPlcfdoaHdr
bool m_fReadOnlyRecommended
sal_Unicode m_nNumDecimalSep
sal_Int32 m_lcbPlcfendText
sal_Unicode getNumDecimalSep() const
sal_Int32 m_lcbPlcffndRef
WW8_FC m_fcPlcfpgdFootnote
sal_uInt32 m_lcbPlcffactoid
0x4be Plcffactoid offset.
sal_Int32 m_pnFbpLvcFirst
sal_Int32 m_lcbPlcffldMom
WW8_FC m_fcPlcffldHdrTxbx
WW8_FC m_fcPlcfBkfFactoid
0x432 smart-tag bookmark starts offset.
sal_Int32 m_lcbPlcffldAtn
sal_uInt16 m_wMagicRevisedPrivate
sal_Int32 m_lcbPlcffldHdr
WW8_FC m_fcGrpStAtnOwners
sal_uInt32 m_lcbSttbttmbd
sal_Int32 m_lcbPlcfendRef
sal_Int32 m_lcbPlcffldHdrTxbx
sal_Int32 m_lcbPlcfandRef
sal_uInt16 m_wMagicCreatedPrivate
WW8_FC m_fcPlcfBklFactoid
0x442 smart-tag bookmark ends offset.
bool GetBaseCp(ManTypes nType, WW8_CP *cp) const
sal_Int32 m_lcbPlcffndText
sal_Int32 m_pnFbpChpFirst
WW8Fonts & operator=(const WW8Fonts &)=delete
std::vector< WW8_FFN > m_aFontA
const WW8_FFN * GetFont(sal_uInt16 nNum) const
sal_uInt16 GetMax() const
WW8Fonts(const WW8Fonts &)=delete
void SaveAllPLCFx(WW8PLCFxSaveAll &rSave) const
void GetNoSprmEnd(short nIdx, WW8PLCFManResult *pRes) const
WW8PLCFspecial * GetTxbx() const
void TransferOpenSprms(std::stack< sal_uInt16 > &rStack)
WW8PLCFx_Cp_FKP * GetPapPLCF() const
sal_uInt16 WhereIdx(bool *pbStart, WW8_CP *pPos=nullptr) const
WW8PLCFx_SEPX * GetSepPLCF() const
SprmResult HasParaSprm(sal_uInt16 nId) const
WW8PLCFx_Book * GetBook() const
void SeekPos(tools::Long nNewCp)
sal_uInt16 GetId(const WW8PLCFxDesc *p) const
bool IsSprmLegalForCategory(sal_uInt16 nSprmId, short nIdx) const
bool Get(WW8PLCFManResult *pResult) const
void AdvNoSprm(short nIdx, bool bStart)
sal_uInt8 * m_pExtendedAtrds
sal_uInt16 GetColl() const
void RestoreAllPLCFx(const WW8PLCFxSaveAll &rSave)
static void GetNewNoSprms(WW8PLCFxDesc &rDesc)
void GetSprmEnd(short nIdx, WW8PLCFManResult *pRes) const
wwSprmParser maSprmParser
void GetSprmStart(short nIdx, WW8PLCFManResult *pRes) const
WW8PLCFx_SubDoc * GetAtn() const
ManTypes GetManType() const
WW8PLCFxDesc * m_pFactoidBkm
WW8PLCFx_AtnBook * GetAtnBook() const
WW8PLCFxDesc m_aD[MAN_PLCF_COUNT]
void AdjustEnds(WW8PLCFxDesc &rDesc)
WW8PLCFspecial * GetTxbxBkd() const
WW8PLCFx_SubDoc * GetEdn() const
bool GetDoingDrawTextBox() const
WW8PLCFspecial * GetFdoa() const
WW8PLCFspecial * GetWkbPLCF() const
WW8PLCFMan(const WW8ScannerBase *pBase, ManTypes nType, tools::Long nStartCp, bool bDoingDrawTextBox=false)
WW8PLCFspecial * GetMagicTables() const
WW8PLCFx_FactoidBook * GetFactoidBook() const
tools::Long GetCpOfs() const
SprmResult HasCharSprm(sal_uInt16 nId) const
WW8PLCFx_Cp_FKP * GetChpPLCF() const
WW8PLCFxDesc * GetPap() const
WW8PLCFspecial * m_pMagicTables
WW8PLCFx_FLD * GetField() const
WW8PLCFx_SubDoc * GetFootnote() const
WW8PLCFspecial * m_pSubdocs
void GetNewSprms(WW8PLCFxDesc &rDesc)
void AdvSprm(short nIdx, bool bStart)
sal_uInt8 * GetExtendedAtrds() const
WW8PLCFxDesc * m_pFootnote
void GetNoSprmStart(short nIdx, WW8PLCFManResult *pRes) const
WW8PLCFspecial * m_pTxbxBkd
WW8PLCF_HdFt(SvStream *pSt, WW8Fib const &rFib, WW8Dop const &rDop)
void GetTextPosExact(short nIdx, WW8_CP &rStart, WW8_CP &rLen)
void UpdateIndex(sal_uInt8 grpfIhdt)
bool GetTextPos(sal_uInt8 grpfIhdt, sal_uInt8 nWhich, WW8_CP &rStart, WW8_CP &rLen)
WW8PLCF(SvStream &rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct, WW8_CP nStartPos=-1)
std::unique_ptr< WW8_CP[]> m_pPLCF_PosArray
void ReadPLCF(SvStream &rSt, WW8_FC nFilePos, sal_uInt32 nPLCF)
void GeneratePLCF(SvStream &rSt, sal_Int32 nPN, sal_Int32 ncpN)
sal_Int32 GetIMax() const
bool Get(WW8_CP &rStart, WW8_CP &rEnd, void *&rpValue) const
void SetIdx(sal_Int32 nI)
const void * GetData(sal_Int32 nInIdx) const
void TruncToSortedRange()
bool SeekPos(WW8_CP nPos)
sal_uInt8 * m_pPLCF_Contents
void SetIdx(tools::Long nI)
bool SeekPos(tools::Long nPos)
tools::Long GetIMax() const
WW8PLCFpcd_Iter(const WW8PLCFpcd_Iter &)=delete
WW8PLCFpcd_Iter & operator=(const WW8PLCFpcd_Iter &)=delete
bool Get(WW8_CP &rStart, WW8_CP &rEnd, void *&rpValue) const
tools::Long GetIdx() const
WW8PLCFpcd & operator=(const WW8PLCFpcd &)=delete
std::unique_ptr< WW8_CP[]> m_pPLCF_PosArray
sal_uInt8 * m_pPLCF_Contents
void TruncToSortedRange()
WW8PLCFpcd(const WW8PLCFpcd &)=delete
among others for fields, that is, the same number of attr as positions, if Ctor-Param bNoEnd = false
bool Get(WW8_CP &rStart, void *&rpValue) const
sal_uInt8 * m_pPLCF_Contents
pointer to content-array-part of Pos-array
sal_Int32 GetPos(tools::Long nInIdx) const
bool GetData(tools::Long nIdx, WW8_CP &rPos, void *&rpValue) const
WW8PLCFspecial & operator=(const WW8PLCFspecial &)=delete
std::unique_ptr< sal_Int32[]> m_pPLCF_PosArray
pointer to Pos-array and to the whole structure
bool SeekPosExact(tools::Long nPos)
bool SeekPos(tools::Long nPos)
WW8PLCFspecial(const WW8PLCFspecial &)=delete
tools::Long m_nIdx
marker where we currently are
void SetIdx(tools::Long nI)
tools::Long m_nIMax
number of elements
tools::Long GetIdx() const
const void * GetData(tools::Long nInIdx) const
tools::Long GetIMax() const
Handles the import of PlcfAtnBkf and PlcfAtnBkl: start / end position of annotation marks.
virtual void SetIdx2(sal_uInt32 nIdx) override
std::unique_ptr< WW8PLCFspecial > m_pBook[2]
Start and end positions.
WW8PLCFx_AtnBook(const WW8PLCFx_AtnBook &)=delete
virtual WW8_CP Where() override
sal_Int32 m_nIMax
Number of annotation marks.
virtual sal_uInt32 GetIdx2() const override
virtual ~WW8PLCFx_AtnBook() override
virtual sal_uInt32 GetIdx() const override
WW8PLCFx_AtnBook & operator=(const WW8PLCFx_AtnBook &)=delete
virtual void advance() override
virtual bool SeekPos(WW8_CP nCpPos) override
tools::Long getHandle() const
Handle is the unique ID of an annotation mark.
virtual void SetIdx(sal_uInt32 nI) override
virtual tools::Long GetNoSprms(WW8_CP &rStart, WW8_CP &rEnd, sal_Int32 &rLen) override
void MapName(OUString &rName)
tools::Long GetHandle() const
std::vector< eBookStatus > m_aStatus
virtual WW8_CP Where() override
void SetStatus(sal_uInt16 nIndex, eBookStatus eStat)
virtual void advance() override
virtual void SetIdx(sal_uInt32 nI) override
std::vector< OUString > m_aBookNames
eBookStatus GetStatus() const
OUString GetUniqueBookmarkName(const OUString &rSuggestedName)
WW8PLCFx_Book(const WW8PLCFx_Book &)=delete
virtual sal_uInt32 GetIdx() const override
virtual tools::Long GetNoSprms(WW8_CP &rStart, WW8_CP &rEnd, sal_Int32 &rLen) override
tools::Long GetIMax() const
OUString GetBookmark(tools::Long nStart, tools::Long nEnd, sal_uInt16 &nIndex)
virtual bool SeekPos(WW8_CP nCpPos) override
WW8_CP GetStartPos() const
tools::Long GetLen() const
virtual void SetIdx2(sal_uInt32 nIdx) override
const OUString * GetName() const
virtual ~WW8PLCFx_Book() override
WW8PLCFx_Book & operator=(const WW8PLCFx_Book &)=delete
virtual sal_uInt32 GetIdx2() const override
std::unique_ptr< WW8PLCFspecial > m_pBook[2]
iterator for Piece Table Exceptions of Fkps works on CPs (high-level)
std::unique_ptr< WW8PLCFx_PCD > m_pPcd
WW8PLCFpcd_Iter * m_pPieceIter
WW8PLCFx_Cp_FKP(const WW8PLCFx_Cp_FKP &)=delete
WW8PLCFx_Cp_FKP & operator=(const WW8PLCFx_Cp_FKP &)=delete
virtual WW8_CP Where() override
virtual void Restore(const WW8PLCFxSave1 &rSave) override
virtual sal_uInt32 GetIdx2() const override
virtual void advance() override
virtual void Save(WW8PLCFxSave1 &rSave) const override
const WW8ScannerBase & m_rSBase
virtual bool SeekPos(WW8_CP nCpPos) override
virtual ~WW8PLCFx_Cp_FKP() override
virtual void GetSprms(WW8PLCFxDesc *p) override
sal_uInt32 GetPCDIdx() const
virtual void SetIdx2(sal_uInt32 nIdx) override
virtual void GetSprms(WW8PLCFxDesc *p) override
bool GetPara(tools::Long nIdx, WW8FieldDesc &rF)
virtual WW8_CP Where() override
WW8PLCFx_FLD & operator=(const WW8PLCFx_FLD &)=delete
virtual ~WW8PLCFx_FLD() override
bool StartPosIsFieldStart()
virtual void advance() override
virtual bool SeekPos(WW8_CP nCpPos) override
bool EndPosIsFieldEnd(WW8_CP &)
virtual sal_uInt32 GetIdx() const override
WW8PLCFx_FLD(const WW8PLCFx_FLD &)=delete
virtual void SetIdx(sal_uInt32 nIdx) override
std::unique_ptr< WW8PLCFspecial > m_pPLCF
Handles the import of PlcfBkfFactoid and PlcfBklFactoid: start / end position of factoids.
virtual ~WW8PLCFx_FactoidBook() override
virtual void SetIdx2(sal_uInt32 nIdx) override
virtual sal_uInt32 GetIdx() const override
virtual void SetIdx(sal_uInt32 nI) override
virtual bool SeekPos(WW8_CP nCpPos) override
tools::Long getHandle() const
Handle is the unique ID of a factoid mark.
sal_Int32 m_nIMax
Number of factoid marks.
virtual sal_uInt32 GetIdx2() const override
virtual WW8_CP Where() override
WW8PLCFx_FactoidBook & operator=(const WW8PLCFx_FactoidBook &)=delete
WW8PLCFx_FactoidBook(const WW8PLCFx_FactoidBook &)=delete
std::unique_ptr< WW8PLCFspecial > m_pBook[2]
Start and end positions.
virtual void advance() override
virtual tools::Long GetNoSprms(WW8_CP &rStart, WW8_CP &rEnd, sal_Int32 &rLen) override
Entry & operator=(const Entry &rEntry)
bool operator<(const Entry &rEntry) const
void IncMustRemainCache()
sal_uInt16 GetIstd() const
WW8Fkp(const WW8Fib &rFib, SvStream *pFKPStrm, SvStream *pDataStrm, tools::Long _nFilePos, tools::Long nItemSiz, ePLCFT ePl, WW8_FC nStartFc)
void DecMustRemainCache()
bool IsMustRemainCache() const
sal_uInt8 * Get(WW8_FC &rStart, WW8_FC &rEnd, sal_Int32 &rLen) const
void FillEntry(Entry &rEntry, std::size_t nDataOffset, sal_uInt16 nLen)
void SetIdx(sal_uInt8 nI)
const wwSprmParser & GetSprmParser() const
tools::Long GetFilePos() const
sal_uInt8 * GetLenAndIStdAndSprms(sal_Int32 &rLen) const
std::vector< Entry > maEntries
SprmResult HasSprm(sal_uInt16 nId, bool bFindFirst=true)
wwSprmParser maSprmParser
Iterator for Piece Table Exceptions of Fkps works only with FCs, not with CPs ! ( Low-Level )
virtual sal_uInt16 GetIstd() const override
virtual WW8_FC Where() override
WW8PLCFx_Fc_FKP(const WW8PLCFx_Fc_FKP &)=delete
virtual bool SeekPos(WW8_FC nFcPos) override
virtual ~WW8PLCFx_Fc_FKP() override
sal_uInt8 * GetSprmsAndPos(WW8_FC &rStart, WW8_FC &rEnd, sal_Int32 &rLen)
SprmResult HasSprm(sal_uInt16 nId, bool bFindFirst=true)
std::deque< std::unique_ptr< WW8Fkp > > maFkpCache
virtual void advance() override
std::unique_ptr< WW8PLCF > m_pPLCF
std::unique_ptr< WW8PLCFx_PCDAttrs > m_pPCDAttrs
virtual sal_uInt32 GetIdx() const override
WW8PLCFx_Fc_FKP & operator=(const WW8PLCFx_Fc_FKP &)=delete
virtual void SetIdx(sal_uInt32 nIdx) override
void GetPCDSprms(WW8PLCFxDesc &rDesc)
WW8PLCFx_PCDAttrs(const WW8PLCFx_PCDAttrs &)=delete
virtual bool SeekPos(WW8_CP nCpPos) override
virtual WW8_CP Where() override
virtual sal_uInt32 GetIdx() const override
virtual void advance() override
std::vector< std::unique_ptr< sal_uInt8[]> > const & mrGrpprls
WW8PLCFx_PCDAttrs & operator=(const WW8PLCFx_PCDAttrs &)=delete
WW8PLCFpcd_Iter * GetIter() const
virtual void SetIdx(sal_uInt32 nI) override
virtual void GetSprms(WW8PLCFxDesc *p) override
WW8PLCFpcd_Iter * m_pPcdI
WW8_CP GetClipStart() const
static sal_Int32 TransformPieceAddress(tools::Long nfc, bool &bIsUnicodeAddress)
virtual void SetIdx(sal_uInt32 nI) override
virtual WW8_CP Where() override
virtual void advance() override
virtual sal_uInt32 GetIdx() const override
WW8PLCFpcd_Iter * GetPLCFIter()
virtual ~WW8PLCFx_PCD() override
std::unique_ptr< WW8PLCFpcd_Iter > m_pPcdI
static void CurrentPieceFc2Cp(WW8_CP &rStartPos, WW8_CP &rEndPos, const WW8ScannerBase *pSBase)
sal_uInt32 GetIMax() const
virtual bool SeekPos(WW8_CP nCpPos) override
virtual tools::Long GetNoSprms(WW8_CP &rStart, WW8_CP &, sal_Int32 &rLen) override
void SetClipStart(WW8_CP nIn)
WW8PLCFx_PCD & operator=(const WW8PLCFx_PCD &)=delete
WW8_CP CurrentPieceStartFc2Cp(WW8_FC nStartPos)
WW8PLCFx_PCD(const WW8PLCFx_PCD &)=delete
WW8_FC CurrentPieceStartCp2Fc(WW8_CP nCp)
Iterator for Piece Table Exceptions of Sepx.
WW8PLCFx_SEPX & operator=(const WW8PLCFx_SEPX &)=delete
bool Find4Sprms(sal_uInt16 nId1, sal_uInt16 nId2, sal_uInt16 nId3, sal_uInt16 nId4, SprmResult &r1, SprmResult &r2, SprmResult &r3, SprmResult &r4) const
SprmResult HasSprm(sal_uInt16 nId) const
virtual void GetSprms(WW8PLCFxDesc *p) override
virtual WW8_CP Where() override
std::unique_ptr< WW8PLCF > m_pPLCF
wwSprmParser maSprmParser
virtual void SetIdx(sal_uInt32 nIdx) override
std::unique_ptr< sal_uInt8[]> m_pSprms
WW8PLCFx_SEPX(const WW8PLCFx_SEPX &)=delete
virtual ~WW8PLCFx_SEPX() override
virtual bool SeekPos(WW8_CP nCpPos) override
virtual sal_uInt32 GetIdx() const override
virtual void advance() override
iterator for footnotes/endnotes and comments
virtual WW8_CP Where() override
std::unique_ptr< WW8PLCF > m_pRef
virtual bool SeekPos(WW8_CP nCpPos) override
std::unique_ptr< WW8PLCF > m_pText
tools::Long Count() const
const void * GetData() const
virtual void advance() override
virtual ~WW8PLCFx_SubDoc() override
virtual sal_uInt32 GetIdx() const override
virtual void SetIdx(sal_uInt32 nIdx) override
virtual void GetSprms(WW8PLCFxDesc *p) override
WW8PLCFx_SubDoc & operator=(const WW8PLCFx_SubDoc &)=delete
WW8PLCFx_SubDoc(const WW8PLCFx_SubDoc &)=delete
virtual void SetIdx2(sal_uInt32 nIdx)
virtual sal_uInt32 GetIdx() const =0
void SetStartFc(WW8_FC nFc)
virtual void Restore(const WW8PLCFxSave1 &rSave)
WW8_FC GetStartFc() const
virtual sal_uInt32 GetIdx2() const
virtual void SetIdx(sal_uInt32 nIdx)=0
ww::WordVersion GetFIBVersion() const
WW8PLCFx & operator=(const WW8PLCFx &)=delete
virtual void Save(WW8PLCFxSave1 &rSave) const
virtual void GetSprms(WW8PLCFxDesc *p)
WW8PLCFx(const WW8Fib &rFib, bool bSprm)
const WW8Fib & GetFIB() const
WW8PLCFx(const WW8PLCFx &)=delete
virtual tools::Long GetNoSprms(WW8_CP &rStart, WW8_CP &, sal_Int32 &rLen)
virtual bool SeekPos(WW8_CP nCpPos)=0
virtual sal_uInt16 GetIstd() const
std::unique_ptr< WW8PLCFx_PCD > m_pPLCFx_PCD
std::unique_ptr< WW8PLCFx_SubDoc > m_pFootnotePLCF
std::unique_ptr< WW8PLCFx_Book > m_pBook
bool AreThereEndnotes() const
std::unique_ptr< WW8PLCFx_FLD > m_pFieldEdnPLCF
std::unique_ptr< WW8PLCFspecial > m_pHdFtFdoa
std::unique_ptr< WW8PLCFx_SEPX > m_pSepPLCF
std::unique_ptr< WW8PLCFspecial > m_pSubdocs
std::unique_ptr< WW8PLCFx_FLD > m_pFieldAndPLCF
std::unique_ptr< WW8PLCFx_FLD > m_pFieldFootnotePLCF
std::unique_ptr< WW8PLCFx_SubDoc > m_pEdnPLCF
std::vector< std::unique_ptr< sal_uInt8[]> > m_aPieceGrpprls
std::unique_ptr< WW8PLCFx_FLD > m_pFieldTxbxPLCF
WW8ScannerBase(const WW8ScannerBase &)=delete
std::unique_ptr< WW8PLCFx_FactoidBook > m_pFactoidBook
Smart tag bookmarks.
std::unique_ptr< WW8PLCFpcd > OpenPieceTable(SvStream *pStr, const WW8Fib *pWwF)
std::unique_ptr< WW8PLCFx_FLD > m_pFieldPLCF
WW8ScannerBase & operator=(const WW8ScannerBase &)=delete
std::unique_ptr< sal_uInt8[]> m_pExtendedAtrds
std::unique_ptr< WW8PLCFx_PCDAttrs > m_pPLCFx_PCDAttrs
std::unique_ptr< WW8PLCFx_Cp_FKP > m_pPapPLCF
tools::Long GetEndnoteCount() const
std::unique_ptr< WW8PLCFx_SubDoc > m_pAndPLCF
std::unique_ptr< WW8PLCFspecial > m_pMagicTables
std::unique_ptr< WW8PLCFspecial > m_pMainTxbxBkd
std::unique_ptr< WW8PLCFx_FLD > m_pFieldHdFtPLCF
std::unique_ptr< WW8PLCFspecial > m_pMainFdoa
std::unique_ptr< WW8PLCFspecial > m_pMainTxbx
std::unique_ptr< WW8PLCFspecial > m_pHdFtTxbx
std::unique_ptr< WW8PLCFspecial > m_pHdFtTxbxBkd
std::unique_ptr< WW8PLCFpcd_Iter > m_pPieceIter
WW8_CP WW8Fc2Cp(WW8_FC nFcPos) const
bool AreThereFootnotes() const
std::unique_ptr< WW8PLCFx_Cp_FKP > m_pChpPLCF
std::unique_ptr< WW8PLCFpcd > m_pPiecePLCF
std::unique_ptr< WW8PLCFx_AtnBook > m_pAtnBook
std::unique_ptr< WW8PLCFx_FLD > m_pFieldTxbxHdFtPLCF
WW8_FC WW8Cp2Fc(WW8_CP nCpPos, bool *pIsUnicode=nullptr, WW8_CP *pNextPieceCp=nullptr, bool *pTestFlag=nullptr) const
sal_Int32 WW8ReadString(SvStream &rStrm, OUString &rStr, WW8_CP nCurrentStartCp, tools::Long nTotalLen, rtl_TextEncoding eEnc) const
simple Iterator for SPRMs
const sal_uInt8 * m_pCurrentParams
const sal_uInt8 * GetSprms() const
const wwSprmParser & mrSprmParser
WW8SprmIter(const WW8SprmIter &)=delete
sal_Int32 GetRemLen() const
WW8SprmIter & operator=(const WW8SprmIter &)=delete
const sal_uInt8 * GetCurrentParams() const
void SetSprms(const sal_uInt8 *pSprms_, sal_Int32 nLen_)
SprmResult FindSprm(sal_uInt16 nId, bool bFindFirst, const sal_uInt8 *pNextByteMatch=nullptr)
const sal_uInt8 * m_pSprms
sal_uInt16 GetCurrentId() const
WW8SprmIter(const sal_uInt8 *pSprms_, sal_Int32 nLen_, const wwSprmParser &rSprmParser)
sal_uInt16 m_nVerBuiltInNamesWhenSaved
std::unique_ptr< WW8_STD > Read1STDFixed(sal_uInt16 &rSkip)
std::unique_ptr< WW8_STD > Read1Style(sal_uInt16 &rSkip, OUString *pString)
sal_uInt16 m_istdMaxFixedWhenSaved
sal_uInt16 GetCount() const
WW8Style & operator=(const WW8Style &)
WW8Style(const WW8Style &)
sal_uInt16 m_fStdStylenamesWritten
sal_uInt16 m_cbSTDBaseInFile
sal_uInt16 m_stiMaxWhenSaved
wwSprmParser knows how to take a sequence of bytes and split it up into sprms and their arguments
sal_uInt16 GetSprmId(const sal_uInt8 *pSp) const
Return the SPRM id at the beginning of this byte sequence.
static const wwSprmSearcher * GetWW8SprmSearcher()
wwSprmParser(const WW8Fib &rFib)
static const wwSprmSearcher * GetWW2SprmSearcher()
ww::WordVersion meVersion
const wwSprmSearcher * mpKnownSprms
ww::WordVersion GetFIBVersion() const
sal_Int32 DistanceToData(sal_uInt16 nId) const
Get known len of a sprms head, the bytes of the sprm id + any bytes reserved to hold a variable lengt...
int MinSprmLen() const
The minimum acceptable sprm len possible for this type of parser.
static const wwSprmSearcher * GetWW6SprmSearcher(const WW8Fib &rFib)
sal_uInt16 GetSprmTailLen(sal_uInt16 nId, const sal_uInt8 *pSprm, sal_Int32 nRemLen) const
Get len of a sprms data area, ignoring the bytes of the sprm id and ignoring any len bytes.
SprmInfo GetSprmInfo(sal_uInt16 nId) const
SprmResult findSprmData(sal_uInt16 nId, sal_uInt8 *pSprms, sal_Int32 nLen) const
Returns the offset to data of the first sprm of id nId, 0.
sal_Int32 GetSprmSize(sal_uInt16 nId, const sal_uInt8 *pSprm, sal_Int32 nRemLen) const
sal_uInt8 SprmDataOfs(sal_uInt16 nId) const
SprmInfo const * search(sal_uInt16 id) const
wwSprmSearcher(SprmInfoRow const *rows, std::size_t size, bool bPatchCJK=false)
std::unordered_map< sal_uInt16, SprmInfo > Map
constexpr OUStringLiteral aCheckBox
constexpr OUStringLiteral aMSMacroCmds
constexpr OUStringLiteral aTextField
constexpr OUStringLiteral aObjectPool
constexpr OUStringLiteral aListBox
constexpr OUStringLiteral a0Table
constexpr OUStringLiteral aData
constexpr OUStringLiteral a1Table
const HdFtFlags WW8_HEADER_FIRST
const HdFtFlags WW8_FOOTER_ODD
const HdFtFlags WW8_FOOTER_EVEN
const HdFtFlags WW8_HEADER_EVEN
const HdFtFlags WW8_FOOTER_FIRST
const HdFtFlags WW8_HEADER_ODD
bool IsSevenMinus(WordVersion eVer)
OUString read_uInt8_lenPrefixed_uInt8s_ToOUString(SvStream &rStrm, rtl_TextEncoding eEnc)
OUString read_uInt16_lenPrefixed_uInt16s_ToOUString(SvStream &rStrm)
sal_uInt16 nId
A ww8 sprm is hardcoded as 16bits.
SprmResult(const sal_uInt8 *pInSprm, sal_Int32 nInRemainingData)
bool fCompatibilityOptions_Unknown1_24
bool fCompatibilityOptions_Unknown2_17
bool fCompatibilityOptions_Unknown2_19
bool fDontUseHTMLAutoSpacing
bool fCompatibilityOptions_Unknown2_14
bool fCompatibilityOptions_Unknown1_13
bool fCompatibilityOptions_Unknown2_20
bool fCompatibilityOptions_Unknown2_6
sal_uInt16 grfSuppression
bool fCompatibilityOptions_Unknown1_25
bool fCompatibilityOptions_Unknown1_29
sal_uInt32 GetCompatibilityOptions2() const
bool fCompatibilityOptions_Unknown2_28
bool fCompatibilityOptions_Unknown2_26
bool fCompatibilityOptions_Unknown2_12
bool fTransparentMetafiles
bool fCompatibilityOptions_Unknown1_16
bool copts_fMapPrintTextColor
bool fCompatibilityOptions_Unknown2_16
bool fCompatibilityOptions_Unknown2_22
bool fDontBreakWrappedTables
bool fSuppressTopSpacingMac5
bool fCompatibilityOptions_Unknown2_25
bool fCompatibilityOptions_Unknown2_32
sal_Int32 cParasFootnoteEdn
bool fCompatibilityOptions_Unknown2_27
bool copts_fOrigWordTableRules
bool fCompatibilityOptions_Unknown2_21
bool fReadOnlyRecommended
sal_Int32 cChWSFootnoteEdn
bool bUseThaiLineBreakingRules
bool fCompatibilityOptions_Unknown2_8
bool fCompatibilityOptions_Unknown2_24
sal_Int32 cDBCFootnoteEdn
void SetCompatibilityOptions(sal_uInt32 a32Bit)
bool fCompatibilityOptions_Unknown2_4
bool fCompatibilityOptions_Unknown1_26
bool fCompatibilityOptions_Unknown2_13
sal_Int32 cWordsFootnoteEnd
bool fCompatibilityOptions_Unknown1_23
bool copts_fConvMailMergeEsc
bool copts_fSuppressSpbfAfterPgBrk
bool fCompatibilityOptions_Unknown2_10
bool fSuppressSpbfAfterPageBreak
bool fCompatibilityOptions_Unknown2_23
bool fCompatibilityOptions_Unknown1_28
bool fSwapBordersFacingPgs
bool fCompatibilityOptions_Unknown2_2
bool fCompatibilityOptions_Unknown2_7
bool fCompatibilityOptions_Unknown1_30
bool fCompatibilityOptions_Unknown2_9
bool fCompatibilityOptions_Unknown2_18
bool fCompatibilityOptions_Unknown2_29
sal_uInt16 wScaleSaved
Specifies the zoom percentage that was in use when the document was saved.
bool copts_fNoSpaceRaiseLower
bool fCompatibilityOptions_Unknown1_21
bool copts_fNoColumnBalance
bool fCompatibilityOptions_Unknown2_30
bool fCompatibilityOptions_Unknown1_31
sal_uInt16 iTextLineEnding
void Write(SvStream &rStrm, WW8Fib &rFib) const
bool fCompatibilityOptions_Unknown1_27
bool copts_fShowBreaksInFrames
bool fCompatibilityOptions_Unknown2_1
bool copts_fSuppressTopSpacing
bool fPagSuppressTopSpacing
bool fCompatibilityOptions_Unknown2_31
sal_uInt32 GetCompatibilityOptions() const
sal_Int32 cLinesFootnoteEdn
bool fCompatibilityOptions_Unknown2_5
bool copts_fSwapBordersFacingPgs
WW8DopTypography doptypography
bool fDoNotEmbedSystemFont
bool fCompatibilityOptions_Unknown2_15
bool fUseBackGroundInAllmodes
void SetCompatibilityOptions2(sal_uInt32 a32Bit)
bool copts_fWrapTrailSpaces
bool copts_fTransparentMetafiles
bool fCompatibilityOptions_Unknown1_15
sal_uInt16 nId
WW-id for fields.
WW8_CP nLen
total length (to skip over text)
sal_uInt8 nOpt
WW-Flags ( e.g.: changed by user )
WW8_CP nSCode
start of instructions code
bool bCodeNest
instruction used recursively
WW8_CP nLRes
length ( == 0, if no result )
WW8_CP nSRes
start of result
bool bResNest
instruction inserted into result
const sal_uInt8 * pMemPos
tools::Long nOrigSprmsLen
std::optional< std::stack< sal_uInt16 > > xIdStack
void Save(WW8PLCFxSave1 &rSave) const
sal_Int16 nRelativeJustify
void Restore(const WW8PLCFxSave1 &rSave)
const sal_uInt8 * pMemPos
sal_uInt32 nPLCFxPos2
for PLCF_Cp_Fkp: PieceIter-Pos
WW8_CP nStartCp
for cp based iterator like PAP and CHP
WW8PLCFxSave1 aS[WW8PLCFMan::MAN_PLCF_COUNT]
WW8PLCFxSaveAll()=default
This is what we use in the Parser (and Dumper)
const sal_uInt16 lLetterWidth
OUString read_uInt8_PascalString(SvStream &rStrm, rtl_TextEncoding eEnc)
Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize)
std::vector< sal_uInt8 > ChpxToSprms(const Word2CHPX &rChpx)
void WW8ReadSTTBF(bool bVer8, SvStream &rStrm, sal_uInt32 nStart, sal_Int32 nLen, sal_uInt16 nExtraLen, rtl_TextEncoding eCS, std::vector< OUString > &rArray, std::vector< ww::bytes > *pExtraArray=nullptr, std::vector< OUString > *pValueArray=nullptr)
reads array of strings (see MS documentation: String Table stored in File) returns NOT the original p...
bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength)
OUString read_uInt16_BeltAndBracesString(SvStream &rStrm)
const sal_uInt16 lLetterHeight
OUString read_uInt8_BeltAndBracesString(SvStream &rStrm, rtl_TextEncoding eEnc)
OUString read_uInt16_PascalString(SvStream &rStrm)