23 #include <osl/diagnose.h>
42 refStrm->SetEndian(SvStreamEndian::LITTLE);
43 WW8Fib aWwFib(*refStrm, nVersion);
49 StreamMode::STD_READ);
54 xGlossary = std::make_shared<WW8GlossaryFib>(*refStrm, nVersion, aWwFib);
71 ((RndStdIds::FLY_AT_PARA == rAnchor.
GetAnchorId()) ||
72 (RndStdIds::FLY_AT_CHAR == rAnchor.
GetAnchorId())) &&
83 bool bSaveRelFile,
const std::vector<OUString>& rStrings,
84 const std::vector<ww::bytes>& rExtra)
88 const OUString aOldURL( rBlocks.
GetBaseURL() );
101 SwNodeIndex aStart( *aDocEnd.GetNode().StartOfSectionNode(), 1 );
105 aStart.GetNode().GetStartNode()->GetStartNodeType()) &&
109 if( aStart < aDocEnd )
113 sal_uInt16 nGlosEntry = 0;
116 SwPaM aPam( aStart );
121 if(
nullptr == pCNd )
148 sal_uInt16
n = SVBT16ToUInt16( &(rData[2]) );
152 const OUString &rLNm = rStrings[nGlosEntry];
154 OUString sShortcut = rLNm;
157 sal_Int32 nStart = 0;
158 sal_uInt16 nCurPos = rBlocks.
GetIndex( sShortcut );
159 while( sal_uInt16(-1) != nCurPos )
161 sShortcut = rLNm + OUString::number(++nStart);
162 nCurPos = rBlocks.
GetIndex( sShortcut );
177 aStart = aStart.GetNode().EndOfSectionIndex() + 1;
179 }
while( aStart.GetNode().IsStartNode() &&
197 std::vector<OUString> aStrings;
198 std::vector<ww::bytes>
aData;
200 rtl_TextEncoding eStructCharSet =
204 xGlossary->m_lcbSttbfglsy, 0, eStructCharSet, aStrings, &aData );
208 nStrings =
static_cast< sal_uInt16
>(aStrings.size());
218 if( !aIdx.GetNode().IsTextNode() )
220 OSL_ENSURE(
false,
"Where is the TextNode?" );
230 bRet =
MakeEntries(pD, rBlocks, bSaveRelFile, aStrings, aData);
241 sal_uInt32 nGlossaryFibOffset = 0;
245 nGlossaryFibOffset = ( rFib.
m_pnNext * 512 );
247 return nGlossaryFibOffset;
tools::SvRef< SotStorage > xStg
virtual sal_Int32 Len() const
constexpr OUStringLiteral a0Table
SwNodeOffset EndOfSectionIndex() const
Represents the style of a paragraph.
Marks a position in the document model.
std::shared_ptr< WW8GlossaryFib > xGlossary
static bool HasBareGraphicEnd(SwDoc *pD, SwNodeIndex const &rIdx)
std::vector< sal_uInt8 > bytes
const ContentProperties & rData
WW8Glossary(tools::SvRef< SotStorageStream > &refStrm, sal_uInt8 nVersion, SotStorage *pStg)
bool Load(SwTextBlocks &rBlocks, bool bSaveRelFile)
tools::SvRef< SotStorageStream > xTableStream
IDocumentContentOperations const & getIDocumentContentOperations() const
const SwFrameFormats * GetSpzFrameFormats() const
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
static bool MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, bool bSaveRelFile, const std::vector< OUString > &rStrings, const std::vector< ww::bytes > &rExtra)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
check if target position is in fly anchored at source range
SwNodeOffset GetIndex() const
constexpr OUStringLiteral aData
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
SwDoc * GetDoc()
returns Doc. But be careful!
PaM is Point and Mark: a selection of the document model.
void SetBaseURL(const OUString &rURL)
const SwStartNode * StartOfSectionNode() const
const SwPosition * GetPoint() const
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
SwIndex & Assign(SwIndexReg *, sal_Int32)
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
tools::SvRef< SotStorageStream > OpenSotStream(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE)
SwContentNode * GetContentNode()
Marks a character position inside a document model node.
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, std::vector< OUString > *pValueArray)
reads array of strings (see MS documentation: String Table stored in File) returns NOT the original p...
void EndPutMuchBlockEntries()
Marks a node in the document model.
constexpr OUStringLiteral a1Table
bool BeginPutDoc(const OUString &, const OUString &)
OUString GetBaseURL() const
sal_uInt16 GetIndex(const OUString &) const
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
static sal_uInt32 FindGlossaryFibOffset(const WW8Fib &rFib)
FIB - the File Information Block.
static rtl_TextEncoding GetFIBCharset(sal_uInt16 chs, LanguageType nLidLocale)
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
tools::SvRef< SotStorageStream > & rStrm
static SwNode * GetStartNode(SwOutlineNodes const *pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type *nOutl)
SwContentNode * GoNext(SwNodeIndex *) const
bool StartPutMuchBlockEntries()
OUString const & GetFileName() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwTextNode * MakeTextNode(const SwNodeIndex &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
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)