summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-10-18 21:55:51 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-11-23 08:30:16 +0100
commit9f7999c6281293d01f143e899056d72496868345 (patch)
tree8afffff8210d3f269e58957b56f656861913e822 /include
parentce35b9480edb331c5f295b83c6132c0e3dee4f78 (diff)
remove textlayoutdevice.{hxx,cxx} from clang-format excludelist
Change-Id: Ia80a0331246b4e25cdc3387c50bd97c6befc4ea4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106382 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/drawinglayer/primitive2d/textlayoutdevice.hxx166
1 files changed, 75 insertions, 91 deletions
diff --git a/include/drawinglayer/primitive2d/textlayoutdevice.hxx b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
index 10f0fc0b23c1..93587769c449 100644
--- a/include/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -28,115 +28,99 @@
// predefines
class VirtualDevice;
-namespace vcl { class Font; }
class GDIMetaFile;
-namespace tools { class Rectangle; }
enum class DrawTextFlags;
-namespace drawinglayer::attribute {
- class FontAttribute;
+namespace vcl
+{
+class Font;
+}
+namespace tools
+{
+class Rectangle;
+}
+namespace drawinglayer::attribute
+{
+class FontAttribute;
+}
+namespace com::sun::star::lang
+{
+struct Locale;
}
-
-namespace com::sun::star::lang { struct Locale; }
// access to one global impTimedRefDev incarnation in namespace drawinglayer::primitive
namespace drawinglayer::primitive2d
{
- /** TextLayouterDevice class
+/** TextLayouterDevice class
- This helper class exists to isolate all accesses to VCL
- text formatting/handling functionality for primitive implementations.
- When in the future FontHandling may move to an own library independent
- from VCL, primitives will be prepared.
- */
- class DRAWINGLAYER_DLLPUBLIC TextLayouterDevice
- {
- /// internally used VirtualDevice
- SolarMutexGuard maSolarGuard;
- VirtualDevice& mrDevice;
-
- public:
- /// constructor/destructor
- TextLayouterDevice();
- ~TextLayouterDevice() COVERITY_NOEXCEPT_FALSE;
-
- /// tooling methods
- void setFont(const vcl::Font& rFont);
- void setFontAttribute(
- const attribute::FontAttribute& rFontAttribute,
- double fFontScaleX,
- double fFontScaleY,
- const css::lang::Locale & rLocale);
-
- double getTextHeight() const;
- double getOverlineHeight() const;
- double getOverlineOffset() const;
- double getUnderlineHeight() const;
- double getUnderlineOffset() const;
- double getStrikeoutOffset() const;
-
- double getTextWidth(
- const OUString& rText,
- sal_uInt32 nIndex,
- sal_uInt32 nLength) const;
-
- void getTextOutlines(
- basegfx::B2DPolyPolygonVector&,
- const OUString& rText,
- sal_uInt32 nIndex,
- sal_uInt32 nLength,
- const ::std::vector< double >& rDXArray) const;
-
- basegfx::B2DRange getTextBoundRect(
- const OUString& rText,
- sal_uInt32 nIndex,
- sal_uInt32 nLength) const;
-
- double getFontAscent() const;
- double getFontDescent() const;
-
- void addTextRectActions(
- const tools::Rectangle& rRectangle,
- const OUString& rText,
- DrawTextFlags nStyle,
- GDIMetaFile& rGDIMetaFile) const;
-
- ::std::vector< double > getTextArray(
- const OUString& rText,
- sal_uInt32 nIndex,
- sal_uInt32 nLength) const;
-
- ::std::vector< double > getCaretPositions(
- const OUString& rText,
- sal_uInt32 nIndex,
- sal_uInt32 nLength) const;
- };
-
- // helper methods for vcl font handling
-
- /** Create a VCL-Font based on the definitions in FontAttribute
+ This helper class exists to isolate all accesses to VCL
+ text formatting/handling functionality for primitive implementations.
+ When in the future FontHandling may move to an own library independent
+ from VCL, primitives will be prepared.
+ */
+class DRAWINGLAYER_DLLPUBLIC TextLayouterDevice
+{
+ /// internally used VirtualDevice
+ SolarMutexGuard maSolarGuard;
+ VirtualDevice& mrDevice;
+
+public:
+ /// constructor/destructor
+ TextLayouterDevice();
+ ~TextLayouterDevice() COVERITY_NOEXCEPT_FALSE;
+
+ /// tooling methods
+ void setFont(const vcl::Font& rFont);
+ void setFontAttribute(const attribute::FontAttribute& rFontAttribute, double fFontScaleX,
+ double fFontScaleY, const css::lang::Locale& rLocale);
+
+ double getTextHeight() const;
+ double getOverlineHeight() const;
+ double getOverlineOffset() const;
+ double getUnderlineHeight() const;
+ double getUnderlineOffset() const;
+ double getStrikeoutOffset() const;
+
+ double getTextWidth(const OUString& rText, sal_uInt32 nIndex, sal_uInt32 nLength) const;
+
+ void getTextOutlines(basegfx::B2DPolyPolygonVector&, const OUString& rText, sal_uInt32 nIndex,
+ sal_uInt32 nLength, const ::std::vector<double>& rDXArray) const;
+
+ basegfx::B2DRange getTextBoundRect(const OUString& rText, sal_uInt32 nIndex,
+ sal_uInt32 nLength) const;
+
+ double getFontAscent() const;
+ double getFontDescent() const;
+
+ void addTextRectActions(const tools::Rectangle& rRectangle, const OUString& rText,
+ DrawTextFlags nStyle, GDIMetaFile& rGDIMetaFile) const;
+
+ ::std::vector<double> getTextArray(const OUString& rText, sal_uInt32 nIndex,
+ sal_uInt32 nLength) const;
+
+ ::std::vector<double> getCaretPositions(const OUString& rText, sal_uInt32 nIndex,
+ sal_uInt32 nLength) const;
+};
+
+// helper methods for vcl font handling
+
+/** Create a VCL-Font based on the definitions in FontAttribute
and the given FontScaling. The FontScaling defines the FontHeight
(fFontScaleY) and the FontWidth (fFontScaleX). The combination of
both defines FontStretching, where no stretching happens at
fFontScaleY == fFontScaleX
*/
- vcl::Font DRAWINGLAYER_DLLPUBLIC getVclFontFromFontAttribute(
- const attribute::FontAttribute& rFontAttribute,
- double fFontScaleX,
- double fFontScaleY,
- double fFontRotation,
- const css::lang::Locale & rLocale);
-
- /** Generate FontAttribute DataSet derived from the given VCL-Font.
+vcl::Font DRAWINGLAYER_DLLPUBLIC getVclFontFromFontAttribute(
+ const attribute::FontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY,
+ double fFontRotation, const css::lang::Locale& rLocale);
+
+/** Generate FontAttribute DataSet derived from the given VCL-Font.
The FontScaling with fFontScaleY, fFontScaleX relationship (see
above) will be set in return parameter o_rSize to allow further
processing
*/
- attribute::FontAttribute DRAWINGLAYER_DLLPUBLIC getFontAttributeFromVclFont(
- basegfx::B2DVector& o_rSize,
- const vcl::Font& rFont,
- bool bRTL,
- bool bBiDiStrong);
+attribute::FontAttribute DRAWINGLAYER_DLLPUBLIC getFontAttributeFromVclFont(
+ basegfx::B2DVector& o_rSize, const vcl::Font& rFont, bool bRTL, bool bBiDiStrong);
} // end of namespace drawinglayer::primitive2d