tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / sw / source / filter / ww8 / ww8glsy.hxx
blob65dfc328effc2ad8b65f11e5a45f087ec22af023
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_SOURCE_FILTER_WW8_WW8GLSY_HXX
21 #define INCLUDED_SW_SOURCE_FILTER_WW8_WW8GLSY_HXX
23 #include <memory>
24 #include <sot/storage.hxx>
26 #include <doc.hxx>
27 #include "ww8scan.hxx"
29 class SwTextBlocks;
30 class SwNodeIndex;
33 * GlossaryFib takes the document fib and finds the glossary fib which may
34 * not exist. The glossary fib has the offsets into the autotext subdocument
35 * which is at the end of template .dot's
37 class WW8GlossaryFib : public WW8Fib
39 public:
40 WW8GlossaryFib( SvStream& rStrm, sal_uInt8 nWantedVersion, const WW8Fib &rFib)
41 : WW8Fib(rStrm, nWantedVersion, FindGlossaryFibOffset(rFib)) {}
42 // fGlsy will indicate whether this has AutoText or not
43 bool IsGlossaryFib() const {
44 return m_fGlsy;
46 private:
47 static sal_uInt32 FindGlossaryFibOffset(const WW8Fib &rFib);
51 * Imports glossaries from word, given the document it gets the usual word
52 * doc information, then the glossary fib and uses the usual reader class to
53 * wrap the autotext into a star doc. Afterwards taking each section entry and
54 * making it a single star autotext entry.
56 * ToDo currently all autotext entries become resource hungry star autotext
57 * formatted text, need to use a flag in the ww8reader class to determine if
58 * an entry is formatted or not.
60 class WW8Glossary
62 public:
63 WW8Glossary(rtl::Reference<SotStorageStream>& refStrm, sal_uInt8 nVersion, SotStorage* pStg);
64 bool Load( SwTextBlocks &rBlocks, bool bSaveRelFile );
65 std::shared_ptr<WW8GlossaryFib>& GetFib()
67 return m_xGlossary;
69 sal_uInt16 GetNoStrings() const
71 return m_nStrings;
74 private:
75 std::shared_ptr<WW8GlossaryFib> m_xGlossary;
76 rtl::Reference<SotStorageStream> m_xTableStream;
77 rtl::Reference<SotStorageStream> &m_rStrm;
78 rtl::Reference<SotStorage> m_xStg;
79 sal_uInt16 m_nStrings;
81 static bool MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, bool bSaveRelFile,
82 const std::vector<OUString>& rStrings,
83 const std::vector<ww::bytes>& rExtra);
84 static bool HasBareGraphicEnd(SwDoc *pD, SwNode const &rIdx);
86 WW8Glossary(const WW8Glossary&) = delete;
87 WW8Glossary& operator=(const WW8Glossary&) = delete;
89 #endif
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */