summaryrefslogtreecommitdiff
path: root/vcl/inc/font/EmphasisMark.hxx
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2022-08-13 17:20:32 +1000
committerTomaž Vajngerl <quikee@gmail.com>2022-09-07 15:26:55 +0200
commit5791c779635b5d42de3c5691bdbadf4a079e096e (patch)
tree18a15c89fab20c2ae53ee547f7858bef7c0c1638 /vcl/inc/font/EmphasisMark.hxx
parent980c3721f0eb7665a2af5d7d5c363f8b5d0c3152 (diff)
vcl: convert ImplGetEmphasisMark() to EmphasisMark class
It makes more sense for an emphasis mark to be an object that can be queried, than it is for it to be a function with lots of output parameters. I have added a unit test, note that for now something doesn't seem right with polypolygon equality checks (test fails, but the disc is generated the same way) so not testing the shape creation. Change-Id: I7597603419b69639b8d9764afdb68e266da7a56b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122601 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/inc/font/EmphasisMark.hxx')
-rw-r--r--vcl/inc/font/EmphasisMark.hxx45
1 files changed, 45 insertions, 0 deletions
diff --git a/vcl/inc/font/EmphasisMark.hxx b/vcl/inc/font/EmphasisMark.hxx
new file mode 100644
index 000000000000..5e902da26294
--- /dev/null
+++ b/vcl/inc/font/EmphasisMark.hxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <sal/config.h>
+
+#include <tools/fontenum.hxx>
+#include <tools/gen.hxx>
+#include <tools/long.hxx>
+#include <tools/poly.hxx>
+
+#include <vcl/dllapi.h>
+
+namespace vcl::font
+{
+class VCL_DLLPUBLIC EmphasisMark
+{
+public:
+ EmphasisMark(FontEmphasisMark eEmphasis, tools::Long nHeight, sal_Int32 nDPIY);
+
+ tools::PolyPolygon GetShape() const { return maPolyPoly; }
+ bool IsShapePolyLine() const { return mbIsPolyLine; }
+ tools::Rectangle GetRect1() const { return maRect1; }
+ tools::Rectangle GetRect2() const { return maRect2; }
+ tools::Long GetYOffset() const { return mnYOff; }
+ tools::Long GetWidth() const { return mnWidth; }
+
+private:
+ tools::PolyPolygon maPolyPoly;
+ bool mbIsPolyLine;
+ tools::Rectangle maRect1;
+ tools::Rectangle maRect2;
+ tools::Long mnYOff;
+ tools::Long mnWidth;
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */