diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2023-09-25 00:24:32 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-10-23 09:42:11 +0200 |
commit | 41e00b105f004b75451e24043dc85af703c91dd3 (patch) | |
tree | b2591976d77037aa9f137f04193800a7785e0125 /include/vcl | |
parent | 8db72aab30ec81c26452a363b8ef9d6a98a07632 (diff) |
vcl: migrate text layout functions out of OutputDevice
OutputDevice is not where text layout should be done. There are a number
of text layout functions that are used across the text layout classes,
so I have moved them into TextLayoutHelper and made the text layout
classes rely on this. I have made TextLayoutHelper implement the
ITextLayout interface because this is still useful to new classes that
need to implement new text layout functionality.
Change-Id: Ic137a938576e7a6a64db0e5780bbbdd8342ef421
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157362
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/vcl')
-rw-r--r-- | include/vcl/outdev.hxx | 23 | ||||
-rw-r--r-- | include/vcl/window.hxx | 2 |
2 files changed, 5 insertions, 20 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 4a6d217c2cb6..bea1e00d9b7f 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -102,7 +102,7 @@ class SalLayoutGlyphs; namespace vcl { class ExtOutDevData; - class ITextLayout; + class TextLayoutCommon; struct FontCapabilities; class Window; class WindowOutputDevice; @@ -869,11 +869,11 @@ public: void DrawText( const tools::Rectangle& rRect, const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::NONE, std::vector< tools::Rectangle >* pVector = nullptr, OUString* pDisplayText = nullptr, - vcl::ITextLayout* _pTextLayout = nullptr ); + vcl::TextLayoutCommon* _pTextLayout = nullptr ); static void ImplDrawText( OutputDevice& rTargetDevice, const tools::Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle, - std::vector< tools::Rectangle >* pVector, OUString* pDisplayText, vcl::ITextLayout& _rLayout ); + std::vector< tools::Rectangle >* pVector, OUString* pDisplayText, vcl::TextLayoutCommon& _rLayout ); void ImplDrawText( SalLayout& ); @@ -904,7 +904,7 @@ public: tools::Rectangle GetTextRect( const tools::Rectangle& rRect, const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::WordBreak, TextRectInfo* pInfo = nullptr, - const vcl::ITextLayout* _pTextLayout = nullptr ) const; + const vcl::TextLayoutCommon* _pTextLayout = nullptr ) const; /** Return the exact bounding rectangle of rStr. @@ -1073,17 +1073,6 @@ public: protected: SAL_DLLPRIVATE void ImplInitTextLineSize(); SAL_DLLPRIVATE void ImplInitAboveTextLineSize(); - static - SAL_DLLPRIVATE tools::Long ImplGetTextLines( const tools::Rectangle& rRect, tools::Long nTextHeight, ImplMultiTextLineInfo& rLineInfo, tools::Long nWidth, const OUString& rStr, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout ); - static - SAL_DLLPRIVATE sal_Int32 ImplBreakLinesWithIterator(const tools::Long nWidth, const OUString& rStr, const vcl::ITextLayout& _rLayout, - const css::uno::Reference<css::linguistic2::XHyphenator>& xHyph, - const css::uno::Reference<css::i18n::XBreakIterator>& xBI, - const bool bHyphenate, - const sal_Int32 nPos, sal_Int32 nBreakPos); - static - SAL_DLLPRIVATE sal_Int32 ImplBreakLinesSimple( const tools::Long nWidth, const OUString& rStr, - const vcl::ITextLayout& _rLayout, const sal_Int32 nPos, sal_Int32 nBreakPos, tools::Long& nLineWidth ); SAL_DLLPRIVATE float approximate_char_width() const; virtual bool shouldDrawWavePixelAsRect(tools::Long nLineWidth) const; @@ -1200,10 +1189,6 @@ private: SAL_DLLPRIVATE static void ImplUpdateFontDataForAllFrames( FontUpdateHandler_t pHdl, bool bNewFontLists ); - static - SAL_DLLPRIVATE OUString ImplGetEllipsisString( const OUString& rStr, - tools::Long nMaxWidth, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout ); - SAL_DLLPRIVATE void ImplDrawEmphasisMark( tools::Long nBaseX, tools::Long nX, tools::Long nY, const tools::PolyPolygon& rPolyPoly, bool bPolyLine, const tools::Rectangle& rRect1, const tools::Rectangle& rRect2 ); SAL_DLLPRIVATE void ImplDrawEmphasisMarks( SalLayout& ); ///@} diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 73f2e4e5bc03..640e9c6c9983 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1494,7 +1494,7 @@ public: tools::Rectangle GetTextRect( const tools::Rectangle& rRect, const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::WordBreak, TextRectInfo* pInfo = nullptr, - const vcl::ITextLayout* _pTextLayout = nullptr ) const; + const vcl::TextLayoutCommon* _pTextLayout = nullptr ) const; float GetDPIScaleFactor() const; tools::Long GetOutOffXPixel() const; tools::Long GetOutOffYPixel() const; |