LibreOffice Module sw (master)  1
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
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 .
18  */
19 #pragma once
21 #include <o3tl/deleter.hxx>
22 #include "atrhndl.hxx"
23 #include <swfont.hxx>
25 namespace sw { struct MergedPara; }
26 class SwTextAttr;
27 class SwTextNode;
28 class SwRedlineItr;
29 class SwViewShell;
30 class SwTextFrame;
33 {
34  friend class SwFontSave;
35 protected:
42 private:
45  short m_nChgCnt;
46  std::unique_ptr<SwRedlineItr, o3tl::default_delete<SwRedlineItr>> m_pRedline;
48  size_t m_nStartIndex;
50  size_t m_nEndIndex;
52  sal_Int32 m_nPosition;
60  void SeekFwd(sal_Int32 nOldPos, sal_Int32 nNewPos);
61  void SetFnt( SwFont* pNew ) { m_pFont = pNew; }
63  SwTextNode const& rPropsNode, SwTextNode const& rTextNode,
64  OUString const& rText, bool const* pbVertLayout,
65  bool const* pbVertLayoutLRBT);
67 protected:
68  void Chg( SwTextAttr const *pHt );
69  void Rst( SwTextAttr const *pHt );
70  void CtorInitAttrIter(SwTextNode& rTextNode, SwScriptInfo& rScrInf, SwTextFrame const* pFrame = nullptr);
71  explicit SwAttrIter(SwTextNode const * pTextNode);
73 public:
77  SwAttrIter(SwTextNode& rTextNode, SwScriptInfo& rScrInf, SwTextFrame const*const pFrame = nullptr);
79  virtual ~SwAttrIter();
81  SwRedlineItr *GetRedln() { return m_pRedline.get(); }
82  // The parameter returns the position of the next change before or at the
83  // char position.
86  bool Seek(TextFrameIndex nPos);
87  // Creates the font at the specified position via Seek() and checks
88  // if it's a symbol font.
89  bool IsSymbol(TextFrameIndex nPos);
95  bool SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFont );
97  // Do we possibly have nasty things like footnotes?
98  bool MaybeHasHints() const;
100  // Returns the attribute for a position
101  SwTextAttr *GetAttr(TextFrameIndex nPos) const;
103  SwFont *GetFnt() { return m_pFont; }
104  const SwFont *GetFnt() const { return m_pFont; }
106  sal_uInt8 GetPropFont() const { return m_nPropFont; }
107  void SetPropFont( const sal_uInt8 nNew ) { m_nPropFont = nNew; }
110 };
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwAttrHandler & GetAttrHandler()
Definition: itratr.hxx:109
SwScriptInfo * m_pScriptInfo
Definition: itratr.hxx:40
bool SeekAndChgAttrIter(TextFrameIndex nPos, OutputDevice *pOut)
Executes ChgPhysFnt if Seek() returns true and change font to merge character border with neighbours...
Definition: itratr.cxx:151
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:159
bool MaybeHasHints() const
Definition: itratr.cxx:123
const SwFont * GetFnt() const
Definition: itratr.hxx:104
SwTextAttr * GetAttr(TextFrameIndex nPos) const
Returns the attribute for a position.
Definition: itratr.cxx:143
const SwTextNode * m_pTextNode
input: the current text node
Definition: itratr.hxx:57
void SetPropFont(const sal_uInt8 nNew)
Definition: itratr.hxx:107
size_t m_nEndIndex
current iteration index in HintEnds
Definition: itratr.hxx:50
void SeekFwd(sal_Int32 nOldPos, sal_Int32 nNewPos)
Definition: itratr.cxx:259
TextFrameIndex GetNextAttr() const
Definition: itratr.cxx:731
SwFont * m_pFont
Definition: itratr.hxx:39
Dialog to specify the properties of date form field.
bool Seek(TextFrameIndex nPos)
Enables the attributes used at char pos nPos in the logical font.
Definition: itratr.cxx:302
sal_Int32 m_nPosition
current iteration index in text node
Definition: itratr.hxx:52
SwAttrIter(SwTextNode const *pTextNode)
Definition: itratr.cxx:67
void CtorInitAttrIter(SwTextNode &rTextNode, SwScriptInfo &rScrInf, SwTextFrame const *pFrame=nullptr)
Definition: redlnitr.cxx:520
o3tl::enumarray< SwFontScript, sal_uInt16 > m_aFontIdx
Definition: itratr.hxx:55
void SetFnt(SwFont *pNew)
Definition: itratr.hxx:61
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
Definition: txatbase.hxx:43
Used by Attribute Iterators to organize attributes on stacks to find the valid attribute in each cate...
Definition: atrhndl.hxx:37
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
Definition: txtfrm.hxx:957
bool SeekStartAndChgAttrIter(OutputDevice *pOut, const bool bParaFont)
Definition: itratr.cxx:193
std::unique_ptr< SwRedlineItr, o3tl::default_delete< SwRedlineItr > > m_pRedline
Definition: itratr.hxx:46
void InitFontAndAttrHandler(SwTextNode const &rPropsNode, SwTextNode const &rTextNode, OUString const &rText, bool const *pbVertLayout, bool const *pbVertLayoutLRBT)
Definition: redlnitr.cxx:444
sw::MergedPara const * m_pMergedPara
Definition: itratr.hxx:58
SwFont * GetFnt()
Definition: itratr.hxx:103
size_t m_nStartIndex
current iteration index in HintStarts
Definition: itratr.hxx:48
sal_uInt8 m_nPropFont
Definition: itratr.hxx:53
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void Rst(SwTextAttr const *pHt)
Definition: itratr.cxx:106
o3tl::enumarray< SwFontScript, const void * > m_aFontCacheIds
Definition: itratr.hxx:54
sal_uInt8 GetPropFont() const
Definition: itratr.hxx:106
unsigned char sal_uInt8
SwAttrHandler m_aAttrHandler
Definition: itratr.hxx:37
void Chg(SwTextAttr const *pHt)
Definition: itratr.cxx:96
VclPtr< OutputDevice > m_pLastOut
Definition: itratr.hxx:43
bool IsSymbol(TextFrameIndex nPos)
Definition: itratr.cxx:177
SwViewShell * m_pViewShell
Definition: itratr.hxx:38
short m_nChgCnt
count currently open hints, redlines, ext-input
Definition: itratr.hxx:45
virtual ~SwAttrIter()
Definition: itratr.cxx:117
SwRedlineItr * GetRedln()
Definition: itratr.hxx:81