diff options
Diffstat (limited to 'sw/source/core/text/porfld.hxx')
-rw-r--r-- | sw/source/core/text/porfld.hxx | 57 |
1 files changed, 41 insertions, 16 deletions
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx index 7519cd578e5b..b92372942425 100644 --- a/sw/source/core/text/porfld.hxx +++ b/sw/source/core/text/porfld.hxx @@ -50,8 +50,8 @@ protected: bool m_bAnimated : 1; // Used by SwGrfNumPortion bool m_bNoPaint : 1; // Used by SwGrfNumPortion bool m_bReplace : 1; // Used by SwGrfNumPortion - const bool m_bPlaceHolder : 1; bool m_bNoLength : 1; // HACK for meta suffix (no CH_TXTATR) + bool m_bContentControl = false; void SetFont( std::unique_ptr<SwFont> pNew ) { m_pFont = std::move(pNew); } bool IsNoLength() const { return m_bNoLength; } @@ -59,10 +59,9 @@ protected: public: SwFieldPortion( const SwFieldPortion& rField ); - SwFieldPortion(const OUString &rExpand, std::unique_ptr<SwFont> pFnt = nullptr, bool bPlaceHolder = false, TextFrameIndex nLen = TextFrameIndex(1)); + SwFieldPortion(OUString aExpand, std::unique_ptr<SwFont> pFnt = nullptr, TextFrameIndex nLen = TextFrameIndex(1)); virtual ~SwFieldPortion() override; - sal_uInt16 m_nAttrFieldType; void TakeNextOffset( const SwFieldPortion* pField ); void CheckScript( const SwTextSizeInfo &rInf ); bool HasFont() const { return nullptr != m_pFont; } @@ -107,6 +106,11 @@ public: // Accessibility: pass information about this portion to the PortionHandler virtual void HandlePortion( SwPortionHandler& rPH ) const override; + + void SetContentControl(bool bContentControl) { m_bContentControl = bContentControl; } + + void dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText, + TextFrameIndex& nOffset) const override; }; /** @@ -128,8 +132,8 @@ public: class SwNumberPortion : public SwFieldPortion { protected: - sal_uInt16 nFixWidth; // See Glues - sal_uInt16 nMinDist; // Minimal distance to the text + sal_uInt16 m_nFixWidth; // See Glues + sal_uInt16 m_nMinDist; // Minimal distance to the text bool mbLabelAlignmentPosAndSpaceModeActive; public: @@ -162,11 +166,11 @@ public: class SwGrfNumPortion : public SwNumberPortion { - std::unique_ptr<SvxBrushItem> pBrush; - tools::Long nId; // For StopAnimation - SwTwips nYPos; // _Always_ contains the current RelPos - SwTwips nGrfHeight; - sal_Int16 eOrient; + std::unique_ptr<SvxBrushItem> m_pBrush; + tools::Long m_nId; // For StopAnimation + SwTwips m_nYPos; // _Always_ contains the current RelPos + SwTwips m_nGrfHeight; + sal_Int16 m_eOrient; public: SwGrfNumPortion( const OUString& rGraphicFollowedBy, const SvxBrushItem* pGrfBrush, @@ -188,12 +192,12 @@ public: bool IsAnimated() const { return m_bAnimated; } void SetAnimated( bool bNew ) { m_bAnimated = bNew; } - void SetRelPos( SwTwips nNew ) { nYPos = nNew; } + void SetRelPos( SwTwips nNew ) { m_nYPos = nNew; } void SetId( tools::Long nNew ) const - { const_cast<SwGrfNumPortion*>(this)->nId = nNew; } - SwTwips GetRelPos() const { return nYPos; } - SwTwips GetGrfHeight() const { return nGrfHeight; } - sal_Int16 GetOrient() const { return eOrient; } + { const_cast<SwGrfNumPortion*>(this)->m_nId = nNew; } + SwTwips GetRelPos() const { return m_nYPos; } + SwTwips GetGrfHeight() const { return m_nGrfHeight; } + sal_Int16 GetOrient() const { return m_eOrient; } }; /** @@ -207,7 +211,7 @@ public: class SwCombinedPortion : public SwFieldPortion { sal_uInt16 m_aPos[6]; // up to six X positions - o3tl::enumarray<SwFontScript,sal_uInt16> m_aWidth = {}; // one width for every scripttype + o3tl::enumarray<SwFontScript,sal_uInt16> m_aWidth; // one width for every scripttype SwFontScript m_aScrType[6]; // scripttype of every character sal_uInt16 m_nUpPos; // the Y position of the upper baseline sal_uInt16 m_nLowPos; // the Y position of the lower baseline @@ -257,4 +261,25 @@ private: bool m_bStart; }; +class SwJumpFieldPortion final : public SwFieldPortion +{ +public: + explicit SwJumpFieldPortion(OUString aExpand, OUString aHelp, std::unique_ptr<SwFont> pFont, + sal_uInt32 nFormat) + : SwFieldPortion(std::move(aExpand), std::move(pFont)) + , m_nFormat(nFormat) + , m_sHelp(std::move(aHelp)) + { + } + virtual SwFieldPortion* Clone(const OUString& rExpand) const override; + + virtual void Paint(const SwTextPaintInfo& rInf) const override; + +private: + sal_uInt32 m_nFormat; // SwJumpEditFormat from SwField::GetFormat() + OUString m_sHelp; + + bool DescribePDFControl(const SwTextPaintInfo& rInf) const; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |