[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 243 commits - accessibility/inc accessibility/source avmedia/source basctl/source basctl/uiconfig basegfx/source basic/source bin/list-uitest.py canvas/source canvas/workben chart2/qa chart2/source chart2/uiconfig comphelper/source compilerplugins/clang configure.ac connectivity/source cppcanvas/source cui/inc cui/source cui/uiconfig dbaccess/source dbaccess/uiconfig desktop/qa desktop/source desktop/uiconfig drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/inc drawinglayer/Library_drawinglayercore.mk drawinglayer/Library_drawinglayer.mk drawinglayer/Module_drawinglayer.mk drawinglayer/source editeng/inc editeng/qa editeng/source editeng/uiconfig embedserv/source emfio/CppunitTest_emfio_emf.mk emfio/inc emfio/Library_emfio.mk emfio/source extensions/source extensions/uiconfig external/cairo external/nss external/pdfium extras/source filter/Library_pdffilter.mk filter/Library_svgfilter.mk filter/Library_xmlfa.mk filter /source filter/uiconfig forms/source formula/source formula/uiconfig fpicker/source fpicker/uiconfig framework/inc framework/source framework/uiconfig .git-blame-ignore-revs .git-hooks/pre-commit .gitmodules helpcontent2 hwpfilter/source i18nlangtag/source i18npool/source i18nutil/source icon-themes/colibre icon-themes/colibre_svg include/basegfx include/drawinglayer include/editeng include/filter include/i18nutil include/LibreOfficeKit include/o3tl include/sfx2 include/svl include/svtools include/svx include/tools include/unotools include/vcl include/xmloff io/source jvmfwk/source libreofficekit/qa lotuswordpro/inc lotuswordpro/Library_lwpft.mk lotuswordpro/source o3tl/qa offapi/com offapi/UnoApi_offapi.mk officecfg/registry oox/source postprocess/Rdb_services.mk readlicense_oo/docs reportdesign/source reportdesign/uiconfig Repository.mk sal/rtl sax/source sc/CppunitTest_sc_parallelism.mk sc/CppunitTest_sc_ucalc.mk sc/inc sc/Library_sc.mk sc/qa sc/source sc/uiconfig sd/CppunitTest_ sd_uimpress.mk sd/inc sd/Library_sd.mk sd/qa sd/source sd/uiconfig sfx2/inc sfx2/Library_sfx.mk sfx2/source sfx2/uiconfig slideshow/source slideshow/test smoketest/libtest.cxx solenv/bin solenv/clang-format solenv/gbuild solenv/sanitizers sot/source starmath/inc starmath/qa starmath/source starmath/uiconfig starmath/visual-editor-todo svgio/CppunitTest_svgio.mk svgio/Library_svgio.mk svgio/source svl/source svl/unx svtools/inc svtools/source svtools/uiconfig svx/CppunitTest_svx_unit.mk svx/Library_svxcore.mk svx/Library_svx.mk svx/qa svx/source svx/uiconfig svx/UIConfig_svx.mk sw/CppunitTest_sw_uwriter.mk sw/inc sw/Library_sw.mk sw/Library_swui.mk sw/Module_sw.mk sw/qa sw/source sw/uiconfig sw/UITest_sw_navigator.mk toolkit/source tools/inc tools/qa tools/source translations uitest/calc_tests uitest/writer_tests uitest/writer_tests5 uitest/writer_tests7 unoidl/source uui/uiconfig vcl/backendtest vcl/headless vcl/inc vcl/Library_vcl.mk vcl/opengl vcl/osx vcl/Package_tipoftheday.mk vc l/qa vcl/qt5 vcl/quartz vcl/skia vcl/source vcl/uiconfig vcl/UIConfig_vcl.mk vcl/unx vcl/win vcl/workben winaccessibility/source writerfilter/qa writerfilter/source writerperfect/uiconfig xmloff/Library_xof.mk xmloff/source xmlscript/source xmlsecurity/qa xmlsecurity/source xmlsecurity/uiconfig
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Sat Oct 24 15:16:12 UTC 2020
Rebased ref, commits from common ancestor:
commit c8863f05497c0923a2d28d0f1efe10f313f667f4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Oct 21 21:07:40 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:15:12 2020 +0200
remove linestartendattribute.hxx from clang-format excludelist
Change-Id: I2d6cef1d3dff33c6cb2695c645d4f30e899c4616
diff --git a/include/drawinglayer/attribute/linestartendattribute.hxx b/include/drawinglayer/attribute/linestartendattribute.hxx
index ea2bf22235fd..f894a335da4c 100644
--- a/include/drawinglayer/attribute/linestartendattribute.hxx
+++ b/include/drawinglayer/attribute/linestartendattribute.hxx
@@ -22,48 +22,47 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <o3tl/cow_wrapper.hxx>
-namespace basegfx {
- class B2DPolyPolygon;
+namespace basegfx
+{
+class B2DPolyPolygon;
}
-namespace drawinglayer::attribute {
- class ImpLineStartEndAttribute;
+namespace drawinglayer::attribute
+{
+class ImpLineStartEndAttribute;
}
-
namespace drawinglayer::attribute
- {
- class DRAWINGLAYER_DLLPUBLIC LineStartEndAttribute
- {
- public:
- typedef o3tl::cow_wrapper< ImpLineStartEndAttribute > ImplType;
+{
+class DRAWINGLAYER_DLLPUBLIC LineStartEndAttribute
+{
+public:
+ typedef o3tl::cow_wrapper<ImpLineStartEndAttribute> ImplType;
- private:
- ImplType mpLineStartEndAttribute;
+private:
+ ImplType mpLineStartEndAttribute;
- public:
- /// constructors/assignmentoperator/destructor
- LineStartEndAttribute(
- double fWidth,
- const basegfx::B2DPolyPolygon& rPolyPolygon,
- bool bCentered);
- LineStartEndAttribute();
- LineStartEndAttribute(const LineStartEndAttribute&);
- LineStartEndAttribute& operator=(const LineStartEndAttribute&);
- ~LineStartEndAttribute();
+public:
+ /// constructors/assignmentoperator/destructor
+ LineStartEndAttribute(double fWidth, const basegfx::B2DPolyPolygon& rPolyPolygon,
+ bool bCentered);
+ LineStartEndAttribute();
+ LineStartEndAttribute(const LineStartEndAttribute&);
+ LineStartEndAttribute& operator=(const LineStartEndAttribute&);
+ ~LineStartEndAttribute();
- // checks if the incarnation is default constructed
- bool isDefault() const;
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
- // compare operator
- bool operator==(const LineStartEndAttribute& rCandidate) const;
+ // compare operator
+ bool operator==(const LineStartEndAttribute& rCandidate) const;
- // data read access
- double getWidth() const;
- const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const;
- bool isCentered() const;
- bool isActive() const;
- };
+ // data read access
+ double getWidth() const;
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const;
+ bool isCentered() const;
+ bool isActive() const;
+};
} // end of namespace drawinglayer::attribute
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 1d6138d1af43..3280f68e3812 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -5713,7 +5713,6 @@ include/desktop/exithelper.h
include/desktop/minidump.hxx
include/drawinglayer/XShapeDumper.hxx
include/drawinglayer/animation/animationtiming.hxx
-include/drawinglayer/attribute/linestartendattribute.hxx
include/drawinglayer/attribute/materialattribute3d.hxx
include/drawinglayer/attribute/sdrallattribute3d.hxx
include/drawinglayer/attribute/sdrfillattribute.hxx
commit 00dd69cb0e4ac94ff62cd5254cbe2cdbda449678
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Oct 21 21:05:51 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:15:12 2020 +0200
pragma once for linestartendattribute.hxx
Change-Id: Ic5fbc26d35c17159667dbf3a0e579789d14677f0
diff --git a/include/drawinglayer/attribute/linestartendattribute.hxx b/include/drawinglayer/attribute/linestartendattribute.hxx
index bceeb378eec4..ea2bf22235fd 100644
--- a/include/drawinglayer/attribute/linestartendattribute.hxx
+++ b/include/drawinglayer/attribute/linestartendattribute.hxx
@@ -17,15 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX
-#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX
+#pragma once
#include <drawinglayer/drawinglayerdllapi.h>
#include <o3tl/cow_wrapper.hxx>
-
-// predefines
-
namespace basegfx {
class B2DPolyPolygon;
}
@@ -71,7 +67,4 @@ namespace drawinglayer::attribute
} // end of namespace drawinglayer::attribute
-
-#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 44efd7a076ecac0509fdc3388e5a034ff0bd8f04
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Oct 21 21:01:43 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:15:12 2020 +0200
cleanup namespaces for fill*attribute.hxx
Change-Id: I2aee131512e0eb194843f207de63e63af7ed219a
diff --git a/include/drawinglayer/attribute/fillgradientattribute.hxx b/include/drawinglayer/attribute/fillgradientattribute.hxx
index 7b07d7022855..f9d9e2245d9a 100644
--- a/include/drawinglayer/attribute/fillgradientattribute.hxx
+++ b/include/drawinglayer/attribute/fillgradientattribute.hxx
@@ -30,10 +30,7 @@ class BColor;
namespace drawinglayer::attribute
{
class ImpFillGradientAttribute;
-}
-namespace drawinglayer::attribute
-{
enum class GradientStyle
{
Linear,
@@ -44,10 +41,6 @@ enum class GradientStyle
Rect
};
-} // end of namespace drawinglayer::attribute
-
-namespace drawinglayer::attribute
-{
class DRAWINGLAYER_DLLPUBLIC FillGradientAttribute
{
public:
diff --git a/include/drawinglayer/attribute/fillgraphicattribute.hxx b/include/drawinglayer/attribute/fillgraphicattribute.hxx
index 1649d1b38881..976d7bd37586 100644
--- a/include/drawinglayer/attribute/fillgraphicattribute.hxx
+++ b/include/drawinglayer/attribute/fillgraphicattribute.hxx
@@ -32,10 +32,7 @@ class B2DRange;
namespace drawinglayer::attribute
{
class ImpFillGraphicAttribute;
-}
-namespace drawinglayer::attribute
-{
class DRAWINGLAYER_DLLPUBLIC FillGraphicAttribute
{
public:
diff --git a/include/drawinglayer/attribute/fillhatchattribute.hxx b/include/drawinglayer/attribute/fillhatchattribute.hxx
index 5d97fbc17026..a929b5715906 100644
--- a/include/drawinglayer/attribute/fillhatchattribute.hxx
+++ b/include/drawinglayer/attribute/fillhatchattribute.hxx
@@ -30,10 +30,7 @@ class BColor;
namespace drawinglayer::attribute
{
class ImpFillHatchAttribute;
-}
-namespace drawinglayer::attribute
-{
enum class HatchStyle
{
Single,
@@ -41,10 +38,6 @@ enum class HatchStyle
Triple
};
-} // end of namespace drawinglayer::attribute
-
-namespace drawinglayer::attribute
-{
class DRAWINGLAYER_DLLPUBLIC FillHatchAttribute
{
public:
commit 482beab9f7b2036557ddfb35bc1b977580d32ef4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Oct 21 20:59:32 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:15:11 2020 +0200
pragma once for fill*attribute.hxx
Change-Id: I588b0214bcd75b77c9c72b4c6f320a6dd8a82e01
diff --git a/include/drawinglayer/attribute/fillgradientattribute.hxx b/include/drawinglayer/attribute/fillgradientattribute.hxx
index cc2fab0518dc..7b07d7022855 100644
--- a/include/drawinglayer/attribute/fillgradientattribute.hxx
+++ b/include/drawinglayer/attribute/fillgradientattribute.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
-#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
+#pragma once
#include <drawinglayer/drawinglayerdllapi.h>
#include <o3tl/cow_wrapper.hxx>
@@ -88,6 +87,4 @@ public:
} // end of namespace drawinglayer::attribute
-#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/fillgraphicattribute.hxx b/include/drawinglayer/attribute/fillgraphicattribute.hxx
index 4ee0ab3f3ed5..1649d1b38881 100644
--- a/include/drawinglayer/attribute/fillgraphicattribute.hxx
+++ b/include/drawinglayer/attribute/fillgraphicattribute.hxx
@@ -16,8 +16,8 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRAPHICATTRIBUTE_HXX
-#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRAPHICATTRIBUTE_HXX
+
+#pragma once
#include <drawinglayer/drawinglayerdllapi.h>
#include <o3tl/cow_wrapper.hxx>
@@ -68,6 +68,4 @@ public:
} // end of namespace drawinglayer::attribute
-#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRAPHICATTRIBUTE_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/fillhatchattribute.hxx b/include/drawinglayer/attribute/fillhatchattribute.hxx
index f13e46bf903b..5d97fbc17026 100644
--- a/include/drawinglayer/attribute/fillhatchattribute.hxx
+++ b/include/drawinglayer/attribute/fillhatchattribute.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
-#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
+#pragma once
#include <drawinglayer/drawinglayerdllapi.h>
#include <o3tl/cow_wrapper.hxx>
@@ -95,6 +94,4 @@ public:
} // end of namespace drawinglayer::attribute
-#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit cb289e9ea062dbdc89b2583241e73648a961fbd2
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Oct 21 20:55:54 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:15:11 2020 +0200
remove fill*attribute.hxx from clang-format excludelist
Change-Id: Idc70c350b1ed6015d56fd785acf5afbc394056fe
diff --git a/include/drawinglayer/attribute/fillgradientattribute.hxx b/include/drawinglayer/attribute/fillgradientattribute.hxx
index 7363eb4bad89..cc2fab0518dc 100644
--- a/include/drawinglayer/attribute/fillgradientattribute.hxx
+++ b/include/drawinglayer/attribute/fillgradientattribute.hxx
@@ -23,81 +23,71 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <o3tl/cow_wrapper.hxx>
-
-// predefines
-
-namespace basegfx {
- class BColor;
+namespace basegfx
+{
+class BColor;
}
-namespace drawinglayer::attribute {
- class ImpFillGradientAttribute;
+namespace drawinglayer::attribute
+{
+class ImpFillGradientAttribute;
}
-
namespace drawinglayer::attribute
- {
- enum class GradientStyle
- {
- Linear,
- Axial,
- Radial,
- Elliptical,
- Square,
- Rect
- };
+{
+enum class GradientStyle
+{
+ Linear,
+ Axial,
+ Radial,
+ Elliptical,
+ Square,
+ Rect
+};
} // end of namespace drawinglayer::attribute
-
namespace drawinglayer::attribute
- {
- class DRAWINGLAYER_DLLPUBLIC FillGradientAttribute
- {
- public:
- typedef o3tl::cow_wrapper< ImpFillGradientAttribute > ImplType;
-
- private:
- ImplType mpFillGradientAttribute;
-
- public:
- /// constructors/assignmentoperator/destructor
- FillGradientAttribute(
- GradientStyle eStyle,
- double fBorder,
- double fOffsetX,
- double fOffsetY,
- double fAngle,
- const basegfx::BColor& rStartColor,
- const basegfx::BColor& rEndColor,
- sal_uInt16 nSteps);
- FillGradientAttribute();
- FillGradientAttribute(const FillGradientAttribute&);
- FillGradientAttribute(FillGradientAttribute&&);
- FillGradientAttribute& operator=(const FillGradientAttribute&);
- FillGradientAttribute& operator=(FillGradientAttribute&&);
- ~FillGradientAttribute();
-
- // checks if the incarnation is default constructed
- bool isDefault() const;
-
- // compare operator
- bool operator==(const FillGradientAttribute& rCandidate) const;
-
- // data read access
- GradientStyle getStyle() const;
- double getBorder() const;
- double getOffsetX() const;
- double getOffsetY() const;
- double getAngle() const;
- const basegfx::BColor& getStartColor() const;
- const basegfx::BColor& getEndColor() const;
- sal_uInt16 getSteps() const;
- };
+{
+class DRAWINGLAYER_DLLPUBLIC FillGradientAttribute
+{
+public:
+ typedef o3tl::cow_wrapper<ImpFillGradientAttribute> ImplType;
+
+private:
+ ImplType mpFillGradientAttribute;
+
+public:
+ /// constructors/assignmentoperator/destructor
+ FillGradientAttribute(GradientStyle eStyle, double fBorder, double fOffsetX, double fOffsetY,
+ double fAngle, const basegfx::BColor& rStartColor,
+ const basegfx::BColor& rEndColor, sal_uInt16 nSteps);
+ FillGradientAttribute();
+ FillGradientAttribute(const FillGradientAttribute&);
+ FillGradientAttribute(FillGradientAttribute&&);
+ FillGradientAttribute& operator=(const FillGradientAttribute&);
+ FillGradientAttribute& operator=(FillGradientAttribute&&);
+ ~FillGradientAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FillGradientAttribute& rCandidate) const;
+
+ // data read access
+ GradientStyle getStyle() const;
+ double getBorder() const;
+ double getOffsetX() const;
+ double getOffsetY() const;
+ double getAngle() const;
+ const basegfx::BColor& getStartColor() const;
+ const basegfx::BColor& getEndColor() const;
+ sal_uInt16 getSteps() const;
+};
} // end of namespace drawinglayer::attribute
-
#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/fillgraphicattribute.hxx b/include/drawinglayer/attribute/fillgraphicattribute.hxx
index 380ae0742c3c..4ee0ab3f3ed5 100644
--- a/include/drawinglayer/attribute/fillgraphicattribute.hxx
+++ b/include/drawinglayer/attribute/fillgraphicattribute.hxx
@@ -22,59 +22,52 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <o3tl/cow_wrapper.hxx>
-
-// predefines
-
class Graphic;
-namespace basegfx {
- class B2DRange;
+namespace basegfx
+{
+class B2DRange;
}
-namespace drawinglayer::attribute {
- class ImpFillGraphicAttribute;
+namespace drawinglayer::attribute
+{
+class ImpFillGraphicAttribute;
}
-
namespace drawinglayer::attribute
- {
- class DRAWINGLAYER_DLLPUBLIC FillGraphicAttribute
- {
- public:
- typedef o3tl::cow_wrapper< ImpFillGraphicAttribute > ImplType;
-
- private:
- ImplType mpFillGraphicAttribute;
-
- public:
- /// constructors/assignmentoperator/destructor
- FillGraphicAttribute(
- const Graphic& rGraphic,
- const basegfx::B2DRange& rGraphicRange,
- bool bTiling,
- double fOffsetX = 0.0,
- double fOffsetY = 0.0);
- FillGraphicAttribute(const FillGraphicAttribute&);
- FillGraphicAttribute& operator=(const FillGraphicAttribute&);
- ~FillGraphicAttribute();
-
- // checks if the incarnation is default constructed
- bool isDefault() const;
-
- // compare operator
- bool operator==(const FillGraphicAttribute& rCandidate) const;
-
- // data read access
- const Graphic& getGraphic() const;
- const basegfx::B2DRange& getGraphicRange() const;
- bool getTiling() const;
- double getOffsetX() const;
- double getOffsetY() const;
- };
+{
+class DRAWINGLAYER_DLLPUBLIC FillGraphicAttribute
+{
+public:
+ typedef o3tl::cow_wrapper<ImpFillGraphicAttribute> ImplType;
+
+private:
+ ImplType mpFillGraphicAttribute;
+
+public:
+ /// constructors/assignmentoperator/destructor
+ FillGraphicAttribute(const Graphic& rGraphic, const basegfx::B2DRange& rGraphicRange,
+ bool bTiling, double fOffsetX = 0.0, double fOffsetY = 0.0);
+ FillGraphicAttribute(const FillGraphicAttribute&);
+ FillGraphicAttribute& operator=(const FillGraphicAttribute&);
+ ~FillGraphicAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FillGraphicAttribute& rCandidate) const;
+
+ // data read access
+ const Graphic& getGraphic() const;
+ const basegfx::B2DRange& getGraphicRange() const;
+ bool getTiling() const;
+ double getOffsetX() const;
+ double getOffsetY() const;
+};
} // end of namespace drawinglayer::attribute
-
#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRAPHICATTRIBUTE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/fillhatchattribute.hxx b/include/drawinglayer/attribute/fillhatchattribute.hxx
index e3c4c278929e..f13e46bf903b 100644
--- a/include/drawinglayer/attribute/fillhatchattribute.hxx
+++ b/include/drawinglayer/attribute/fillhatchattribute.hxx
@@ -23,86 +23,78 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <o3tl/cow_wrapper.hxx>
-
-// predefines
-
-namespace basegfx {
- class BColor;
+namespace basegfx
+{
+class BColor;
}
-namespace drawinglayer::attribute {
- class ImpFillHatchAttribute;
+namespace drawinglayer::attribute
+{
+class ImpFillHatchAttribute;
}
-
namespace drawinglayer::attribute
- {
- enum class HatchStyle
- {
- Single,
- Double,
- Triple
- };
+{
+enum class HatchStyle
+{
+ Single,
+ Double,
+ Triple
+};
} // end of namespace drawinglayer::attribute
-
namespace drawinglayer::attribute
- {
- class DRAWINGLAYER_DLLPUBLIC FillHatchAttribute
- {
- public:
- typedef o3tl::cow_wrapper< ImpFillHatchAttribute > ImplType;
-
- private:
- ImplType mpFillHatchAttribute;
-
- public:
- /// constructors/assignmentoperator/destructor
- FillHatchAttribute(
- HatchStyle eStyle,
- double fDistance,
- double fAngle,
- const basegfx::BColor& rColor,
- sal_uInt32 nMinimalDiscreteDistance,
- bool bFillBackground);
- FillHatchAttribute();
- FillHatchAttribute(const FillHatchAttribute&);
- FillHatchAttribute(FillHatchAttribute&&);
- FillHatchAttribute& operator=(const FillHatchAttribute&);
- FillHatchAttribute& operator=(FillHatchAttribute&&);
- ~FillHatchAttribute();
-
- // checks if the incarnation is default constructed
- bool isDefault() const;
-
- // compare operator
- bool operator==(const FillHatchAttribute& rCandidate) const;
-
- // data read access
- HatchStyle getStyle() const;
- double getDistance() const;
- double getAngle() const;
- const basegfx::BColor& getColor() const;
-
- // #i120230# If a minimal discrete distance is wanted (VCL used 3,
- // this is the default for the global instance, too), set this
- // unequal to zero. Zero means not to use it. If set bigger zero
- // (should be at least two, one leads to a full plane filled with
- // lines when Distance in discrete views is smaller than one) this
- // will be used when the discrete value is less than the given one.
- // This is used to 'emulate' old VCL behaviour which makes hatches
- // look better by not making distances as small as needed, but
- // keeping them on a minimal discrete value for more appealing
- // visualisation.
- sal_uInt32 getMinimalDiscreteDistance() const;
-
- bool isFillBackground() const;
- };
+{
+class DRAWINGLAYER_DLLPUBLIC FillHatchAttribute
+{
+public:
+ typedef o3tl::cow_wrapper<ImpFillHatchAttribute> ImplType;
+
+private:
+ ImplType mpFillHatchAttribute;
+
+public:
+ /// constructors/assignmentoperator/destructor
+ FillHatchAttribute(HatchStyle eStyle, double fDistance, double fAngle,
+ const basegfx::BColor& rColor, sal_uInt32 nMinimalDiscreteDistance,
+ bool bFillBackground);
+ FillHatchAttribute();
+ FillHatchAttribute(const FillHatchAttribute&);
+ FillHatchAttribute(FillHatchAttribute&&);
+ FillHatchAttribute& operator=(const FillHatchAttribute&);
+ FillHatchAttribute& operator=(FillHatchAttribute&&);
+ ~FillHatchAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FillHatchAttribute& rCandidate) const;
+
+ // data read access
+ HatchStyle getStyle() const;
+ double getDistance() const;
+ double getAngle() const;
+ const basegfx::BColor& getColor() const;
+
+ // #i120230# If a minimal discrete distance is wanted (VCL used 3,
+ // this is the default for the global instance, too), set this
+ // unequal to zero. Zero means not to use it. If set bigger zero
+ // (should be at least two, one leads to a full plane filled with
+ // lines when Distance in discrete views is smaller than one) this
+ // will be used when the discrete value is less than the given one.
+ // This is used to 'emulate' old VCL behaviour which makes hatches
+ // look better by not making distances as small as needed, but
+ // keeping them on a minimal discrete value for more appealing
+ // visualisation.
+ sal_uInt32 getMinimalDiscreteDistance() const;
+
+ bool isFillBackground() const;
+};
} // end of namespace drawinglayer::attribute
-
#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 283f53028962..1d6138d1af43 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -5713,9 +5713,6 @@ include/desktop/exithelper.h
include/desktop/minidump.hxx
include/drawinglayer/XShapeDumper.hxx
include/drawinglayer/animation/animationtiming.hxx
-include/drawinglayer/attribute/fillgradientattribute.hxx
-include/drawinglayer/attribute/fillgraphicattribute.hxx
-include/drawinglayer/attribute/fillhatchattribute.hxx
include/drawinglayer/attribute/linestartendattribute.hxx
include/drawinglayer/attribute/materialattribute3d.hxx
include/drawinglayer/attribute/sdrallattribute3d.hxx
commit 2e2b17d141bbb6f4f85af7690dd2ac769495850c
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Oct 21 20:51:51 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:15:11 2020 +0200
remove fontattribute.cxx from clang-format excludelist
Change-Id: I3720692af45920a4d084fe6ca4dd08bc0598ac13
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
index 33903003f8c7..e423b8367f1c 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -21,182 +21,131 @@
#include <rtl/instance.hxx>
#include <rtl/ustring.hxx>
-
namespace drawinglayer::attribute
{
- class ImpFontAttribute
- {
- public:
- /// core data
- OUString maFamilyName; // Font Family Name
- OUString maStyleName; // Font Style Name
- sal_uInt16 mnWeight; // Font weight
-
- bool mbSymbol : 1; // Symbol Font Flag
- bool mbVertical : 1; // Vertical Text Flag
- bool mbItalic : 1; // Italic Flag
- bool mbOutline : 1; // Outline Flag
- bool mbRTL : 1; // RTL Flag
- bool mbBiDiStrong : 1; // BiDi Flag
- bool mbMonospaced : 1;
-
- ImpFontAttribute(
- const OUString& rFamilyName,
- const OUString& rStyleName,
- sal_uInt16 nWeight,
- bool bSymbol,
- bool bVertical,
- bool bItalic,
- bool bMonospaced,
- bool bOutline,
- bool bRTL,
- bool bBiDiStrong)
- : maFamilyName(rFamilyName),
- maStyleName(rStyleName),
- mnWeight(nWeight),
- mbSymbol(bSymbol),
- mbVertical(bVertical),
- mbItalic(bItalic),
- mbOutline(bOutline),
- mbRTL(bRTL),
- mbBiDiStrong(bBiDiStrong),
- mbMonospaced(bMonospaced)
- {
- }
-
- ImpFontAttribute()
- : maFamilyName(),
- maStyleName(),
- mnWeight(0),
- mbSymbol(false),
- mbVertical(false),
- mbItalic(false),
- mbOutline(false),
- mbRTL(false),
- mbBiDiStrong(false),
- mbMonospaced(false)
- {
- }
-
- // data read access
- const OUString& getFamilyName() const { return maFamilyName; }
- const OUString& getStyleName() const { return maStyleName; }
- sal_uInt16 getWeight() const { return mnWeight; }
- bool getSymbol() const { return mbSymbol; }
- bool getVertical() const { return mbVertical; }
- bool getItalic() const { return mbItalic; }
- bool getOutline() const { return mbOutline; }
- bool getRTL() const { return mbRTL; }
- bool getBiDiStrong() const { return mbBiDiStrong; }
- bool getMonospaced() const { return mbMonospaced; }
-
- bool operator==(const ImpFontAttribute& rCompare) const
- {
- return (getFamilyName() == rCompare.getFamilyName()
- && getStyleName() == rCompare.getStyleName()
- && getWeight() == rCompare.getWeight()
- && getSymbol() == rCompare.getSymbol()
- && getVertical() == rCompare.getVertical()
- && getItalic() == rCompare.getItalic()
- && getOutline() == rCompare.getOutline()
- && getRTL() == rCompare.getRTL()
- && getBiDiStrong() == rCompare.getBiDiStrong()
- && getMonospaced() == rCompare.getMonospaced());
- }
- };
-
- namespace
- {
- struct theGlobalDefault :
- public rtl::Static< FontAttribute::ImplType, theGlobalDefault > {};
- }
-
- FontAttribute::FontAttribute(
- const OUString& rFamilyName,
- const OUString& rStyleName,
- sal_uInt16 nWeight,
- bool bSymbol,
- bool bVertical,
- bool bItalic,
- bool bMonospaced,
- bool bOutline,
- bool bRTL,
- bool bBiDiStrong)
- : mpFontAttribute(ImpFontAttribute(
- rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bMonospaced, bOutline, bRTL, bBiDiStrong))
- {
- }
-
- FontAttribute::FontAttribute()
- : mpFontAttribute(theGlobalDefault::get())
- {
- }
-
- FontAttribute::FontAttribute(const FontAttribute&) = default;
-
- FontAttribute::FontAttribute(FontAttribute&&) = default;
-
- FontAttribute::~FontAttribute() = default;
-
- FontAttribute& FontAttribute::operator=(const FontAttribute&) = default;
-
- FontAttribute& FontAttribute::operator=(FontAttribute&&) = default;
-
- bool FontAttribute::operator==(const FontAttribute& rCandidate) const
- {
- return rCandidate.mpFontAttribute == mpFontAttribute;
- }
-
- const OUString& FontAttribute::getFamilyName() const
- {
- return mpFontAttribute->getFamilyName();
- }
-
- const OUString& FontAttribute::getStyleName() const
- {
- return mpFontAttribute->getStyleName();
- }
-
- sal_uInt16 FontAttribute::getWeight() const
- {
- return mpFontAttribute->getWeight();
- }
-
- bool FontAttribute::getSymbol() const
- {
- return mpFontAttribute->getSymbol();
- }
-
- bool FontAttribute::getVertical() const
- {
- return mpFontAttribute->getVertical();
- }
-
- bool FontAttribute::getItalic() const
- {
- return mpFontAttribute->getItalic();
- }
-
- bool FontAttribute::getOutline() const
- {
- return mpFontAttribute->getOutline();
- }
-
- bool FontAttribute::getRTL() const
- {
- return mpFontAttribute->getRTL();
- }
-
- bool FontAttribute::getBiDiStrong() const
- {
- return mpFontAttribute->getBiDiStrong();
- }
-
- bool FontAttribute::getMonospaced() const
- {
- return mpFontAttribute->getMonospaced();
- }
+class ImpFontAttribute
+{
+public:
+ /// core data
+ OUString maFamilyName; // Font Family Name
+ OUString maStyleName; // Font Style Name
+ sal_uInt16 mnWeight; // Font weight
+
+ bool mbSymbol : 1; // Symbol Font Flag
+ bool mbVertical : 1; // Vertical Text Flag
+ bool mbItalic : 1; // Italic Flag
+ bool mbOutline : 1; // Outline Flag
+ bool mbRTL : 1; // RTL Flag
+ bool mbBiDiStrong : 1; // BiDi Flag
+ bool mbMonospaced : 1;
+
+ ImpFontAttribute(const OUString& rFamilyName, const OUString& rStyleName, sal_uInt16 nWeight,
+ bool bSymbol, bool bVertical, bool bItalic, bool bMonospaced, bool bOutline,
+ bool bRTL, bool bBiDiStrong)
+ : maFamilyName(rFamilyName)
+ , maStyleName(rStyleName)
+ , mnWeight(nWeight)
+ , mbSymbol(bSymbol)
+ , mbVertical(bVertical)
+ , mbItalic(bItalic)
+ , mbOutline(bOutline)
+ , mbRTL(bRTL)
+ , mbBiDiStrong(bBiDiStrong)
+ , mbMonospaced(bMonospaced)
+ {
+ }
+
+ ImpFontAttribute()
+ : maFamilyName()
+ , maStyleName()
+ , mnWeight(0)
+ , mbSymbol(false)
+ , mbVertical(false)
+ , mbItalic(false)
+ , mbOutline(false)
+ , mbRTL(false)
+ , mbBiDiStrong(false)
+ , mbMonospaced(false)
+ {
+ }
+
+ // data read access
+ const OUString& getFamilyName() const { return maFamilyName; }
+ const OUString& getStyleName() const { return maStyleName; }
+ sal_uInt16 getWeight() const { return mnWeight; }
+ bool getSymbol() const { return mbSymbol; }
+ bool getVertical() const { return mbVertical; }
+ bool getItalic() const { return mbItalic; }
+ bool getOutline() const { return mbOutline; }
+ bool getRTL() const { return mbRTL; }
+ bool getBiDiStrong() const { return mbBiDiStrong; }
+ bool getMonospaced() const { return mbMonospaced; }
+
+ bool operator==(const ImpFontAttribute& rCompare) const
+ {
+ return (getFamilyName() == rCompare.getFamilyName()
+ && getStyleName() == rCompare.getStyleName() && getWeight() == rCompare.getWeight()
+ && getSymbol() == rCompare.getSymbol() && getVertical() == rCompare.getVertical()
+ && getItalic() == rCompare.getItalic() && getOutline() == rCompare.getOutline()
+ && getRTL() == rCompare.getRTL() && getBiDiStrong() == rCompare.getBiDiStrong()
+ && getMonospaced() == rCompare.getMonospaced());
+ }
+};
+
+namespace
+{
+struct theGlobalDefault : public rtl::Static<FontAttribute::ImplType, theGlobalDefault>
+{
+};
+}
+
+FontAttribute::FontAttribute(const OUString& rFamilyName, const OUString& rStyleName,
+ sal_uInt16 nWeight, bool bSymbol, bool bVertical, bool bItalic,
+ bool bMonospaced, bool bOutline, bool bRTL, bool bBiDiStrong)
+ : mpFontAttribute(ImpFontAttribute(rFamilyName, rStyleName, nWeight, bSymbol, bVertical,
+ bItalic, bMonospaced, bOutline, bRTL, bBiDiStrong))
+{
+}
+
+FontAttribute::FontAttribute()
+ : mpFontAttribute(theGlobalDefault::get())
+{
+}
+
+FontAttribute::FontAttribute(const FontAttribute&) = default;
+
+FontAttribute::FontAttribute(FontAttribute&&) = default;
+
+FontAttribute::~FontAttribute() = default;
+
+FontAttribute& FontAttribute::operator=(const FontAttribute&) = default;
+
+FontAttribute& FontAttribute::operator=(FontAttribute&&) = default;
+
+bool FontAttribute::operator==(const FontAttribute& rCandidate) const
+{
+ return rCandidate.mpFontAttribute == mpFontAttribute;
+}
+
+const OUString& FontAttribute::getFamilyName() const { return mpFontAttribute->getFamilyName(); }
+
+const OUString& FontAttribute::getStyleName() const { return mpFontAttribute->getStyleName(); }
+
+sal_uInt16 FontAttribute::getWeight() const { return mpFontAttribute->getWeight(); }
+
+bool FontAttribute::getSymbol() const { return mpFontAttribute->getSymbol(); }
+
+bool FontAttribute::getVertical() const { return mpFontAttribute->getVertical(); }
+
+bool FontAttribute::getItalic() const { return mpFontAttribute->getItalic(); }
+
+bool FontAttribute::getOutline() const { return mpFontAttribute->getOutline(); }
+
+bool FontAttribute::getRTL() const { return mpFontAttribute->getRTL(); }
+
+bool FontAttribute::getBiDiStrong() const { return mpFontAttribute->getBiDiStrong(); }
+bool FontAttribute::getMonospaced() const { return mpFontAttribute->getMonospaced(); }
} // end of namespace
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 14aa680ed6bd..283f53028962 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3627,7 +3627,6 @@ drawinglayer/source/animation/animationtiming.cxx
drawinglayer/source/attribute/fillgradientattribute.cxx
drawinglayer/source/attribute/fillgraphicattribute.cxx
drawinglayer/source/attribute/fillhatchattribute.cxx
-drawinglayer/source/attribute/fontattribute.cxx
drawinglayer/source/attribute/lineattribute.cxx
drawinglayer/source/attribute/linestartendattribute.cxx
drawinglayer/source/attribute/materialattribute3d.cxx
commit 78a52ea76dbaefa012310d513b606420f2f31c65
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Oct 21 20:39:46 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:15:10 2020 +0200
move the anonymous namespace into drawinglayer::primitive2d
Change-Id: I66f7e5602c7a47baeadccfe913b9be984f0a5177
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index a756fc22899c..46f10d5f6208 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -27,6 +27,8 @@
using namespace com::sun::star;
+namespace drawinglayer::primitive2d
+{
namespace
{
// adapts fontScale for usage with TextLayouter. Input is rScale which is the extracted
@@ -78,8 +80,6 @@ basegfx::B2DVector getCorrectedScaleAndFontScale(basegfx::B2DVector& rScale)
}
} // end of anonymous namespace
-namespace drawinglayer::primitive2d
-{
void TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation(
basegfx::B2DPolyPolygonVector& rTarget, basegfx::B2DHomMatrix& rTransformation) const
{
commit 5fad10655733e561782a259b53955395d87111f4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Oct 18 21:59:15 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:15:10 2020 +0200
simplify namespaces and clean-up for TextLayouterDevice
Move anonymous namespace into drawinglayer::primitive2d and convert
static function into anonymous functions.
Change-Id: Id8ff161a5ec69154f053fadd1178265fa2675139
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 2aa38393c59e..7758bd53bf97 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -36,12 +36,14 @@
#include <i18nlangtag/languagetag.hxx>
#include <vcl/svapp.hxx>
-// VDev RevDevice provider
-
+namespace drawinglayer::primitive2d
+{
namespace
{
class ImpTimedRefDev;
+// VDev RevDevice provider
+
//the scoped_timed_RefDev owns an ImpTimeRefDev and releases it on dtor
//or disposing of the default XComponentContext which causes the underlying
//OutputDevice to get released
@@ -130,14 +132,8 @@ void ImpTimedRefDev::releaseVirtualDevice()
Start();
}
}
-} // end of anonymous namespace
-
-// access to one global ImpTimedRefDev incarnation in namespace drawinglayer::primitive
-namespace drawinglayer::primitive2d
-{
-// static methods here
-static VirtualDevice& acquireGlobalVirtualDevice()
+VirtualDevice& acquireGlobalVirtualDevice()
{
scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get();
@@ -147,7 +143,7 @@ static VirtualDevice& acquireGlobalVirtualDevice()
return rStdRefDevice->acquireVirtualDevice();
}
-static void releaseGlobalVirtualDevice()
+void releaseGlobalVirtualDevice()
{
scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get();
@@ -156,6 +152,8 @@ static void releaseGlobalVirtualDevice()
rStdRefDevice->releaseVirtualDevice();
}
+} // end of anonymous namespace
+
TextLayouterDevice::TextLayouterDevice()
: maSolarGuard()
, mrDevice(acquireGlobalVirtualDevice())
commit 3127100dd1c65cdb701d63fba187f3a5a6912d38
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Oct 18 21:55:51 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:15:08 2020 +0200
remove textlayoutdevice.{hxx,cxx} from clang-format excludelist
Change-Id: Ia80a0331246b4e25cdc3387c50bd97c6befc4ea4
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index e34fe1822fa4..2aa38393c59e 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -36,460 +36,409 @@
#include <i18nlangtag/languagetag.hxx>
#include <vcl/svapp.hxx>
-
// VDev RevDevice provider
namespace
{
- class ImpTimedRefDev;
+class ImpTimedRefDev;
- //the scoped_timed_RefDev owns an ImpTimeRefDev and releases it on dtor
- //or disposing of the default XComponentContext which causes the underlying
- //OutputDevice to get released
+//the scoped_timed_RefDev owns an ImpTimeRefDev and releases it on dtor
+//or disposing of the default XComponentContext which causes the underlying
+//OutputDevice to get released
- //The ImpTimerRefDev itself, if the timeout ever gets hit, will call
- //reset on the scoped_timed_RefDev to release the ImpTimerRefDev early
- //if it's unused for a few minutes
- class scoped_timed_RefDev : public comphelper::unique_disposing_ptr<ImpTimedRefDev>
+//The ImpTimerRefDev itself, if the timeout ever gets hit, will call
+//reset on the scoped_timed_RefDev to release the ImpTimerRefDev early
+//if it's unused for a few minutes
+class scoped_timed_RefDev : public comphelper::unique_disposing_ptr<ImpTimedRefDev>
+{
+public:
+ scoped_timed_RefDev()
+ : comphelper::unique_disposing_ptr<ImpTimedRefDev>(
+ (css::uno::Reference<css::lang::XComponent>(
+ ::comphelper::getProcessComponentContext(), css::uno::UNO_QUERY_THROW)))
{
- public:
- scoped_timed_RefDev() : comphelper::unique_disposing_ptr<ImpTimedRefDev>((css::uno::Reference<css::lang::XComponent>(::comphelper::getProcessComponentContext(), css::uno::UNO_QUERY_THROW)))
- {
- }
- };
+ }
+};
- class the_scoped_timed_RefDev : public rtl::Static<scoped_timed_RefDev, the_scoped_timed_RefDev> {};
+class the_scoped_timed_RefDev : public rtl::Static<scoped_timed_RefDev, the_scoped_timed_RefDev>
+{
+};
- class ImpTimedRefDev : public Timer
- {
- scoped_timed_RefDev& mrOwnerOfMe;
- VclPtr<VirtualDevice> mpVirDev;
- sal_uInt32 mnUseCount;
-
- public:
- explicit ImpTimedRefDev(scoped_timed_RefDev& rOwnerofMe);
- virtual ~ImpTimedRefDev() override;
- virtual void Invoke() override;
-
- VirtualDevice& acquireVirtualDevice();
- void releaseVirtualDevice();
- };
-
- ImpTimedRefDev::ImpTimedRefDev(scoped_timed_RefDev& rOwnerOfMe)
- : Timer( "drawinglayer ImpTimedRefDev destroy mpVirDev" ),
- mrOwnerOfMe(rOwnerOfMe),
- mpVirDev(nullptr),
- mnUseCount(0)
- {
- SetTimeout(3L * 60L * 1000L); // three minutes
- Start();
- }
+class ImpTimedRefDev : public Timer
+{
+ scoped_timed_RefDev& mrOwnerOfMe;
+ VclPtr<VirtualDevice> mpVirDev;
+ sal_uInt32 mnUseCount;
+
+public:
+ explicit ImpTimedRefDev(scoped_timed_RefDev& rOwnerofMe);
+ virtual ~ImpTimedRefDev() override;
+ virtual void Invoke() override;
+
+ VirtualDevice& acquireVirtualDevice();
+ void releaseVirtualDevice();
+};
+
+ImpTimedRefDev::ImpTimedRefDev(scoped_timed_RefDev& rOwnerOfMe)
+ : Timer("drawinglayer ImpTimedRefDev destroy mpVirDev")
+ , mrOwnerOfMe(rOwnerOfMe)
+ , mpVirDev(nullptr)
+ , mnUseCount(0)
+{
+ SetTimeout(3L * 60L * 1000L); // three minutes
+ Start();
+}
- ImpTimedRefDev::~ImpTimedRefDev()
- {
- OSL_ENSURE(0 == mnUseCount, "destruction of a still used ImpTimedRefDev (!)");
- const SolarMutexGuard aSolarGuard;
- mpVirDev.disposeAndClear();
- }
+ImpTimedRefDev::~ImpTimedRefDev()
+{
+ OSL_ENSURE(0 == mnUseCount, "destruction of a still used ImpTimedRefDev (!)");
+ const SolarMutexGuard aSolarGuard;
+ mpVirDev.disposeAndClear();
+}
+
+void ImpTimedRefDev::Invoke()
+{
+ // for obvious reasons, do not call anything after this
+ mrOwnerOfMe.reset();
+}
- void ImpTimedRefDev::Invoke()
+VirtualDevice& ImpTimedRefDev::acquireVirtualDevice()
+{
+ if (!mpVirDev)
{
- // for obvious reasons, do not call anything after this
- mrOwnerOfMe.reset();
+ mpVirDev = VclPtr<VirtualDevice>::Create();
+ mpVirDev->SetReferenceDevice(VirtualDevice::RefDevMode::MSO1);
}
- VirtualDevice& ImpTimedRefDev::acquireVirtualDevice()
+ if (!mnUseCount)
{
- if(!mpVirDev)
- {
- mpVirDev = VclPtr<VirtualDevice>::Create();
- mpVirDev->SetReferenceDevice( VirtualDevice::RefDevMode::MSO1 );
- }
+ Stop();
+ }
- if(!mnUseCount)
- {
- Stop();
- }
+ mnUseCount++;
- mnUseCount++;
+ return *mpVirDev;
+}
- return *mpVirDev;
- }
+void ImpTimedRefDev::releaseVirtualDevice()
+{
+ OSL_ENSURE(mnUseCount, "mismatch call number to releaseVirtualDevice() (!)");
+ mnUseCount--;
- void ImpTimedRefDev::releaseVirtualDevice()
+ if (!mnUseCount)
{
- OSL_ENSURE(mnUseCount, "mismatch call number to releaseVirtualDevice() (!)");
- mnUseCount--;
-
- if(!mnUseCount)
- {
- Start();
- }
+ Start();
}
+}
} // end of anonymous namespace
-
// access to one global ImpTimedRefDev incarnation in namespace drawinglayer::primitive
namespace drawinglayer::primitive2d
{
- // static methods here
- static VirtualDevice& acquireGlobalVirtualDevice()
- {
- scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get();
+// static methods here
+static VirtualDevice& acquireGlobalVirtualDevice()
+{
+ scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get();
- if(!rStdRefDevice)
- rStdRefDevice.reset(new ImpTimedRefDev(rStdRefDevice));
+ if (!rStdRefDevice)
+ rStdRefDevice.reset(new ImpTimedRefDev(rStdRefDevice));
- return rStdRefDevice->acquireVirtualDevice();
- }
+ return rStdRefDevice->acquireVirtualDevice();
+}
- static void releaseGlobalVirtualDevice()
- {
- scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get();
+static void releaseGlobalVirtualDevice()
+{
+ scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get();
- OSL_ENSURE(rStdRefDevice, "releaseGlobalVirtualDevice() without prior acquireGlobalVirtualDevice() call(!)");
- rStdRefDevice->releaseVirtualDevice();
- }
+ OSL_ENSURE(rStdRefDevice,
+ "releaseGlobalVirtualDevice() without prior acquireGlobalVirtualDevice() call(!)");
+ rStdRefDevice->releaseVirtualDevice();
+}
- TextLayouterDevice::TextLayouterDevice()
- : maSolarGuard(),
- mrDevice(acquireGlobalVirtualDevice())
- {
- }
+TextLayouterDevice::TextLayouterDevice()
+ : maSolarGuard()
+ , mrDevice(acquireGlobalVirtualDevice())
+{
+}
- TextLayouterDevice::~TextLayouterDevice() COVERITY_NOEXCEPT_FALSE
- {
- releaseGlobalVirtualDevice();
- }
+TextLayouterDevice::~TextLayouterDevice() COVERITY_NOEXCEPT_FALSE { releaseGlobalVirtualDevice(); }
- void TextLayouterDevice::setFont(const vcl::Font& rFont)
- {
- mrDevice.SetFont( rFont );
- }
+void TextLayouterDevice::setFont(const vcl::Font& rFont) { mrDevice.SetFont(rFont); }
- void TextLayouterDevice::setFontAttribute(
- const attribute::FontAttribute& rFontAttribute,
- double fFontScaleX,
- double fFontScaleY,
- const css::lang::Locale& rLocale)
- {
- setFont(getVclFontFromFontAttribute(
- rFontAttribute,
- fFontScaleX,
- fFontScaleY,
- 0.0,
- rLocale));
- }
+void TextLayouterDevice::setFontAttribute(const attribute::FontAttribute& rFontAttribute,
+ double fFontScaleX, double fFontScaleY,
+ const css::lang::Locale& rLocale)
+{
+ setFont(getVclFontFromFontAttribute(rFontAttribute, fFontScaleX, fFontScaleY, 0.0, rLocale));
+}
- double TextLayouterDevice::getOverlineOffset() const
- {
- const ::FontMetric& rMetric = mrDevice.GetFontMetric();
- double fRet = (rMetric.GetInternalLeading() / 2.0) - rMetric.GetAscent();
- return fRet;
- }
+double TextLayouterDevice::getOverlineOffset() const
+{
+ const ::FontMetric& rMetric = mrDevice.GetFontMetric();
+ double fRet = (rMetric.GetInternalLeading() / 2.0) - rMetric.GetAscent();
+ return fRet;
+}
- double TextLayouterDevice::getUnderlineOffset() const
- {
- const ::FontMetric& rMetric = mrDevice.GetFontMetric();
- double fRet = rMetric.GetDescent() / 2.0;
- return fRet;
- }
+double TextLayouterDevice::getUnderlineOffset() const
+{
+ const ::FontMetric& rMetric = mrDevice.GetFontMetric();
+ double fRet = rMetric.GetDescent() / 2.0;
+ return fRet;
+}
- double TextLayouterDevice::getStrikeoutOffset() const
- {
- const ::FontMetric& rMetric = mrDevice.GetFontMetric();
- double fRet = (rMetric.GetAscent() - rMetric.GetInternalLeading()) / 3.0;
- return fRet;
- }
+double TextLayouterDevice::getStrikeoutOffset() const
+{
+ const ::FontMetric& rMetric = mrDevice.GetFontMetric();
+ double fRet = (rMetric.GetAscent() - rMetric.GetInternalLeading()) / 3.0;
+ return fRet;
+}
- double TextLayouterDevice::getOverlineHeight() const
- {
- const ::FontMetric& rMetric = mrDevice.GetFontMetric();
- double fRet = rMetric.GetInternalLeading() / 2.5;
- return fRet;
- }
+double TextLayouterDevice::getOverlineHeight() const
+{
+ const ::FontMetric& rMetric = mrDevice.GetFontMetric();
+ double fRet = rMetric.GetInternalLeading() / 2.5;
+ return fRet;
+}
- double TextLayouterDevice::getUnderlineHeight() const
- {
- const ::FontMetric& rMetric = mrDevice.GetFontMetric();
- double fRet = rMetric.GetDescent() / 4.0;
- return fRet;
- }
+double TextLayouterDevice::getUnderlineHeight() const
+{
+ const ::FontMetric& rMetric = mrDevice.GetFontMetric();
+ double fRet = rMetric.GetDescent() / 4.0;
+ return fRet;
+}
- double TextLayouterDevice::getTextHeight() const
- {
- return mrDevice.GetTextHeight();
- }
+double TextLayouterDevice::getTextHeight() const { return mrDevice.GetTextHeight(); }
- double TextLayouterDevice::getTextWidth(
- const OUString& rText,
- sal_uInt32 nIndex,
- sal_uInt32 nLength) const
- {
- return mrDevice.GetTextWidth(rText, nIndex, nLength);
- }
+double TextLayouterDevice::getTextWidth(const OUString& rText, sal_uInt32 nIndex,
+ sal_uInt32 nLength) const
+{
+ return mrDevice.GetTextWidth(rText, nIndex, nLength);
+}
- void TextLayouterDevice::getTextOutlines(
- basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
- const OUString& rText,
- sal_uInt32 nIndex,
- sal_uInt32 nLength,
- const std::vector< double >& rDXArray) const
- {
- const sal_uInt32 nDXArrayCount(rDXArray.size());
- sal_uInt32 nTextLength(nLength);
- const sal_uInt32 nStringLength(rText.getLength());
-
- if(nTextLength + nIndex > nStringLength)
- {
- nTextLength = nStringLength - nIndex;
- }
-
- if(nDXArrayCount)
- {
- OSL_ENSURE(nDXArrayCount == nTextLength, "DXArray size does not correspond to text portion size (!)");
- std::vector< long > aIntegerDXArray(nDXArrayCount);
-
- for(sal_uInt32 a(0); a < nDXArrayCount; a++)
- {
- aIntegerDXArray[a] = basegfx::fround(rDXArray[a]);
- }
-
- mrDevice.GetTextOutlines(
- rB2DPolyPolyVector,
- rText,
- nIndex,
- nIndex,
- nLength,
- 0,
- aIntegerDXArray.data());
- }
- else
- {
- mrDevice.GetTextOutlines(
- rB2DPolyPolyVector,
- rText,
- nIndex,
- nIndex,
- nLength);
- }
- }
+void TextLayouterDevice::getTextOutlines(basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
+ const OUString& rText, sal_uInt32 nIndex,
+ sal_uInt32 nLength,
+ const std::vector<double>& rDXArray) const
+{
+ const sal_uInt32 nDXArrayCount(rDXArray.size());
+ sal_uInt32 nTextLength(nLength);
+ const sal_uInt32 nStringLength(rText.getLength());
- basegfx::B2DRange TextLayouterDevice::getTextBoundRect(
- const OUString& rText,
- sal_uInt32 nIndex,
- sal_uInt32 nLength) const
- {
- sal_uInt32 nTextLength(nLength);
- const sal_uInt32 nStringLength(rText.getLength());
-
- if(nTextLength + nIndex > nStringLength)
- {
- nTextLength = nStringLength - nIndex;
- }
-
- if(nTextLength)
- {
- ::tools::Rectangle aRect;
-
- mrDevice.GetTextBoundRect(
- aRect,
- rText,
- nIndex,
- nIndex,
- nLength);
-
- // #i104432#, #i102556# take empty results into account
- if(!aRect.IsEmpty())
- {
- return vcl::unotools::b2DRectangleFromRectangle(aRect);
- }
- }
-
- return basegfx::B2DRange();
- }
+ if (nTextLength + nIndex > nStringLength)
+ {
+ nTextLength = nStringLength - nIndex;
+ }
- double TextLayouterDevice::getFontAscent() const
- {
- const ::FontMetric& rMetric = mrDevice.GetFontMetric();
- return rMetric.GetAscent();
- }
+ if (nDXArrayCount)
+ {
+ OSL_ENSURE(nDXArrayCount == nTextLength,
+ "DXArray size does not correspond to text portion size (!)");
+ std::vector<long> aIntegerDXArray(nDXArrayCount);
- double TextLayouterDevice::getFontDescent() const
+ for (sal_uInt32 a(0); a < nDXArrayCount; a++)
{
- const ::FontMetric& rMetric = mrDevice.GetFontMetric();
- return rMetric.GetDescent();
+ aIntegerDXArray[a] = basegfx::fround(rDXArray[a]);
}
- void TextLayouterDevice::addTextRectActions(
- const ::tools::Rectangle& rRectangle,
- const OUString& rText,
- DrawTextFlags nStyle,
- GDIMetaFile& rGDIMetaFile) const
- {
- mrDevice.AddTextRectActions(
- rRectangle, rText, nStyle, rGDIMetaFile);
- }
+ mrDevice.GetTextOutlines(rB2DPolyPolyVector, rText, nIndex, nIndex, nLength, 0,
+ aIntegerDXArray.data());
+ }
+ else
+ {
+ mrDevice.GetTextOutlines(rB2DPolyPolyVector, rText, nIndex, nIndex, nLength);
+ }
+}
- std::vector< double > TextLayouterDevice::getTextArray(
- const OUString& rText,
- sal_uInt32 nIndex,
- sal_uInt32 nLength) const
- {
- std::vector< double > aRetval;
- sal_uInt32 nTextLength(nLength);
- const sal_uInt32 nStringLength(rText.getLength());
-
- if(nTextLength + nIndex > nStringLength)
- {
- nTextLength = nStringLength - nIndex;
- }
-
- if(nTextLength)
- {
- aRetval.reserve(nTextLength);
- std::vector<long> aArray(nTextLength);
- mrDevice.GetTextArray(rText, aArray.data(), nIndex, nLength);
- aRetval.assign(aArray.begin(), aArray.end());
- }
-
- return aRetval;
- }
+basegfx::B2DRange TextLayouterDevice::getTextBoundRect(const OUString& rText, sal_uInt32 nIndex,
+ sal_uInt32 nLength) const
+{
+ sal_uInt32 nTextLength(nLength);
+ const sal_uInt32 nStringLength(rText.getLength());
- std::vector< double > TextLayouterDevice::getCaretPositions(
- const OUString& rText,
- sal_uInt32 nIndex,
- sal_uInt32 nLength) const
+ if (nTextLength + nIndex > nStringLength)
+ {
+ nTextLength = nStringLength - nIndex;
+ }
+
+ if (nTextLength)
+ {
+ ::tools::Rectangle aRect;
+
+ mrDevice.GetTextBoundRect(aRect, rText, nIndex, nIndex, nLength);
+
+ // #i104432#, #i102556# take empty results into account
+ if (!aRect.IsEmpty())
{
- std::vector< double > aRetval;
- sal_uInt32 nTextLength(nLength);
- const sal_uInt32 nStringLength(rText.getLength());
-
- if(nTextLength + nIndex > nStringLength)
- {
- nTextLength = nStringLength - nIndex;
- }
-
- if(nTextLength)
- {
- aRetval.reserve(2 * nTextLength);
- std::vector<long> aArray(2 * nTextLength);
- mrDevice.GetCaretPositions(rText, aArray.data(), nIndex, nLength);
- aRetval.assign(aArray.begin(), aArray.end());
- }
-
- return aRetval;
+ return vcl::unotools::b2DRectangleFromRectangle(aRect);
}
+ }
+
+ return basegfx::B2DRange();
+}
+
+double TextLayouterDevice::getFontAscent() const
+{
+ const ::FontMetric& rMetric = mrDevice.GetFontMetric();
+ return rMetric.GetAscent();
+}
+
+double TextLayouterDevice::getFontDescent() const
+{
+ const ::FontMetric& rMetric = mrDevice.GetFontMetric();
+ return rMetric.GetDescent();
+}
+
+void TextLayouterDevice::addTextRectActions(const ::tools::Rectangle& rRectangle,
+ const OUString& rText, DrawTextFlags nStyle,
+ GDIMetaFile& rGDIMetaFile) const
+{
+ mrDevice.AddTextRectActions(rRectangle, rText, nStyle, rGDIMetaFile);
+}
+
+std::vector<double> TextLayouterDevice::getTextArray(const OUString& rText, sal_uInt32 nIndex,
+ sal_uInt32 nLength) const
+{
+ std::vector<double> aRetval;
+ sal_uInt32 nTextLength(nLength);
+ const sal_uInt32 nStringLength(rText.getLength());
+ if (nTextLength + nIndex > nStringLength)
+ {
+ nTextLength = nStringLength - nIndex;
+ }
+
+ if (nTextLength)
+ {
+ aRetval.reserve(nTextLength);
+ std::vector<long> aArray(nTextLength);
+ mrDevice.GetTextArray(rText, aArray.data(), nIndex, nLength);
+ aRetval.assign(aArray.begin(), aArray.end());
+ }
+
+ return aRetval;
+}
+
+std::vector<double> TextLayouterDevice::getCaretPositions(const OUString& rText, sal_uInt32 nIndex,
+ sal_uInt32 nLength) const
+{
+ std::vector<double> aRetval;
+ sal_uInt32 nTextLength(nLength);
+ const sal_uInt32 nStringLength(rText.getLength());
+
+ if (nTextLength + nIndex > nStringLength)
+ {
+ nTextLength = nStringLength - nIndex;
+ }
+
+ if (nTextLength)
+ {
+ aRetval.reserve(2 * nTextLength);
+ std::vector<long> aArray(2 * nTextLength);
+ mrDevice.GetCaretPositions(rText, aArray.data(), nIndex, nLength);
+ aRetval.assign(aArray.begin(), aArray.end());
+ }
+
+ return aRetval;
+}
// helper methods for vcl font handling
- vcl::Font getVclFontFromFontAttribute(
- const attribute::FontAttribute& rFontAttribute,
- double fFontScaleX,
- double fFontScaleY,
- double fFontRotation,
- const css::lang::Locale& rLocale)
- {
- // detect FontScaling
- const sal_uInt32 nHeight(basegfx::fround(fabs(fFontScaleY)));
+vcl::Font getVclFontFromFontAttribute(const attribute::FontAttribute& rFontAttribute,
+ double fFontScaleX, double fFontScaleY, double fFontRotation,
+ const css::lang::Locale& rLocale)
+{
+ // detect FontScaling
+ const sal_uInt32 nHeight(basegfx::fround(fabs(fFontScaleY)));
#ifdef _WIN32
- // for WIN32 systems, start with creating an unscaled font. If FontScaling
- // is wanted, that width needs to be adapted using FontMetric again to get a
- // width of the unscaled font
- vcl::Font aRetval(
- rFontAttribute.getFamilyName(),
- rFontAttribute.getStyleName(),
- Size(0, nHeight));
- (void)fFontScaleX;
+ // for WIN32 systems, start with creating an unscaled font. If FontScaling
+ // is wanted, that width needs to be adapted using FontMetric again to get a
+ // width of the unscaled font
+ vcl::Font aRetval(rFontAttribute.getFamilyName(), rFontAttribute.getStyleName(),
+ Size(0, nHeight));
+ (void)fFontScaleX;
#else
- // for non-WIN32 systems things are easier since these accept a Font creation
- // with initially nWidth != nHeight for FontScaling. Despite that, use zero for
- // FontWidth when no scaling is used to explicitly have that zero when e.g. the
- // Font would be recorded in a MetaFile (The MetaFile FontAction WILL record a
- // set FontWidth; import that in a WIN32 system, and trouble is there)
- const sal_uInt32 nWidth(basegfx::fround(fabs(fFontScaleX)));
- const bool bFontIsScaled(nHeight != nWidth);
- vcl::Font aRetval(
- rFontAttribute.getFamilyName(),
- rFontAttribute.getStyleName(),
- Size(bFontIsScaled ? std::max<sal_uInt32>(nWidth, 1) : 0, nHeight));
+ // for non-WIN32 systems things are easier since these accept a Font creation
+ // with initially nWidth != nHeight for FontScaling. Despite that, use zero for
+ // FontWidth when no scaling is used to explicitly have that zero when e.g. the
+ // Font would be recorded in a MetaFile (The MetaFile FontAction WILL record a
+ // set FontWidth; import that in a WIN32 system, and trouble is there)
+ const sal_uInt32 nWidth(basegfx::fround(fabs(fFontScaleX)));
+ const bool bFontIsScaled(nHeight != nWidth);
+ vcl::Font aRetval(rFontAttribute.getFamilyName(), rFontAttribute.getStyleName(),
+ Size(bFontIsScaled ? std::max<sal_uInt32>(nWidth, 1) : 0, nHeight));
#endif
- // define various other FontAttribute
- aRetval.SetAlignment(ALIGN_BASELINE);
- aRetval.SetCharSet(rFontAttribute.getSymbol() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE);
- aRetval.SetVertical(rFontAttribute.getVertical());
- aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight()));
- aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
- aRetval.SetOutline(rFontAttribute.getOutline());
- aRetval.SetPitch(rFontAttribute.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE);
- aRetval.SetLanguage(LanguageTag::convertToLanguageType( rLocale, false));
-
- // handle FontRotation (if defined)
- if(!basegfx::fTools::equalZero(fFontRotation))
- {
- sal_Int16 aRotate10th(static_cast<sal_Int16>(fFontRotation * (-1800.0/F_PI)));
- aRetval.SetOrientation(Degree10(aRotate10th % 3600));
- }
-
- return aRetval;
- }
- attribute::FontAttribute getFontAttributeFromVclFont(
- basegfx::B2DVector& o_rSize,
- const vcl::Font& rFont,
- bool bRTL,
- bool bBiDiStrong)
- {
- const attribute::FontAttribute aRetval(
- rFont.GetFamilyName(),
- rFont.GetStyleName(),
- static_cast<sal_uInt16>(rFont.GetWeight()),
- RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(),
- rFont.IsVertical(),
- ITALIC_NONE != rFont.GetItalic(),
- PITCH_FIXED == rFont.GetPitch(),
- rFont.IsOutline(),
- bRTL,
- bBiDiStrong);
- // TODO: eKerning
-
- // set FontHeight and init to no FontScaling
- o_rSize.setY(std::max<long>(rFont.GetFontSize().getHeight(), 0));
- o_rSize.setX(o_rSize.getY());
+ // define various other FontAttribute
+ aRetval.SetAlignment(ALIGN_BASELINE);
+ aRetval.SetCharSet(rFontAttribute.getSymbol() ? RTL_TEXTENCODING_SYMBOL
+ : RTL_TEXTENCODING_UNICODE);
+ aRetval.SetVertical(rFontAttribute.getVertical());
+ aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight()));
+ aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
+ aRetval.SetOutline(rFontAttribute.getOutline());
+ aRetval.SetPitch(rFontAttribute.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE);
+ aRetval.SetLanguage(LanguageTag::convertToLanguageType(rLocale, false));
+
+ // handle FontRotation (if defined)
+ if (!basegfx::fTools::equalZero(fFontRotation))
+ {
+ sal_Int16 aRotate10th(static_cast<sal_Int16>(fFontRotation * (-1800.0 / F_PI)));
+ aRetval.SetOrientation(Degree10(aRotate10th % 3600));
+ }
+
+ return aRetval;
+}
+
+attribute::FontAttribute getFontAttributeFromVclFont(basegfx::B2DVector& o_rSize,
+ const vcl::Font& rFont, bool bRTL,
+ bool bBiDiStrong)
+{
+ const attribute::FontAttribute aRetval(
+ rFont.GetFamilyName(), rFont.GetStyleName(), static_cast<sal_uInt16>(rFont.GetWeight()),
+ RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(), rFont.IsVertical(),
+ ITALIC_NONE != rFont.GetItalic(), PITCH_FIXED == rFont.GetPitch(), rFont.IsOutline(), bRTL,
+ bBiDiStrong);
+ // TODO: eKerning
+
+ // set FontHeight and init to no FontScaling
+ o_rSize.setY(std::max<long>(rFont.GetFontSize().getHeight(), 0));
+ o_rSize.setX(o_rSize.getY());
#ifdef _WIN32
- // for WIN32 systems, the FontScaling at the Font is detected by
- // checking that FontWidth != 0. When FontScaling is used, WIN32
- // needs to do extra stuff to detect the correct width (since it's
- // zero and not equal the font height) and its relationship to
- // the height
- if(rFont.GetFontSize().getWidth() > 0)
- {
- vcl::Font aUnscaledFont(rFont);
- aUnscaledFont.SetAverageFontWidth(0);
- const FontMetric aUnscaledFontMetric(Application::GetDefaultDevice()->GetFontMetric(aUnscaledFont));
-
- if(aUnscaledFontMetric.GetAverageFontWidth() > 0)
- {
- const double fScaleFactor(static_cast<double>(rFont.GetFontSize().getWidth()) / static_cast<double>(aUnscaledFontMetric.GetAverageFontWidth()));
- o_rSize.setX(fScaleFactor * o_rSize.getY());
- }
- }
+ // for WIN32 systems, the FontScaling at the Font is detected by
+ // checking that FontWidth != 0. When FontScaling is used, WIN32
+ // needs to do extra stuff to detect the correct width (since it's
+ // zero and not equal the font height) and its relationship to
+ // the height
+ if (rFont.GetFontSize().getWidth() > 0)
+ {
+ vcl::Font aUnscaledFont(rFont);
+ aUnscaledFont.SetAverageFontWidth(0);
+ const FontMetric aUnscaledFontMetric(
+ Application::GetDefaultDevice()->GetFontMetric(aUnscaledFont));
+
+ if (aUnscaledFontMetric.GetAverageFontWidth() > 0)
+ {
+ const double fScaleFactor(
+ static_cast<double>(rFont.GetFontSize().getWidth())
+ / static_cast<double>(aUnscaledFontMetric.GetAverageFontWidth()));
+ o_rSize.setX(fScaleFactor * o_rSize.getY());
+ }
+ }
#else
- // For non-WIN32 systems the detection is the same, but the value
- // is easier achieved since width == height is interpreted as no
- // scaling. Ergo, Width == 0 means width == height, and width != 0
- // means the scaling is in the direct relation of width to height
- if(rFont.GetFontSize().getWidth() > 0)
- {
- o_rSize.setX(static_cast<double>(rFont.GetFontSize().getWidth()));
- }
+ // For non-WIN32 systems the detection is the same, but the value
+ // is easier achieved since width == height is interpreted as no
+ // scaling. Ergo, Width == 0 means width == height, and width != 0
+ // means the scaling is in the direct relation of width to height
+ if (rFont.GetFontSize().getWidth() > 0)
+ {
+ o_rSize.setX(static_cast<double>(rFont.GetFontSize().getWidth()));
+ }
#endif
- return aRetval;
- }
+ return aRetval;
+}
} // end of namespace
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
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 4d07182a1052..14aa680ed6bd 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3687,7 +3687,6 @@ drawinglayer/source/primitive2d/textbreakuphelper.cxx
drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
drawinglayer/source/primitive2d/textenumsprimitive2d.cxx
drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
-drawinglayer/source/primitive2d/textlayoutdevice.cxx
drawinglayer/source/primitive2d/textlineprimitive2d.cxx
drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
drawinglayer/source/primitive2d/transformprimitive2d.cxx
@@ -5764,7 +5763,6 @@ include/drawinglayer/primitive2d/textbreakuphelper.hxx
include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
include/drawinglayer/primitive2d/textenumsprimitive2d.hxx
include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
-include/drawinglayer/primitive2d/textlayoutdevice.hxx
include/drawinglayer/primitive2d/transformprimitive2d.hxx
include/drawinglayer/primitive2d/transparenceprimitive2d.hxx
include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx
commit 3bd59b19177a81a47b9b68eb1a6c808fffe4b2ff
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Oct 17 21:56:16 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:13:03 2020 +0200
remove left-over printf
Change-Id: I2327cfbd8e291820453b4784badfdbc0a6314355
diff --git a/svgio/source/svgreader/svgvisitor.cxx b/svgio/source/svgreader/svgvisitor.cxx
index 1f2ea975c4ca..14d645ecc5d9 100644
--- a/svgio/source/svgreader/svgvisitor.cxx
+++ b/svgio/source/svgreader/svgvisitor.cxx
@@ -46,10 +46,6 @@ void SvgDrawVisitor::visit(svgio::svgreader::SvgNode const& rNode)
if (rGNode.getTransform() != nullptr)
{
basegfx::B2DHomMatrix rMatrix = *rGNode.getTransform();
-
- printf("G [%f %f %f - %f %f %f - %f %f %f]\n", rMatrix.get(0, 0), rMatrix.get(0, 1),
- rMatrix.get(0, 2), rMatrix.get(1, 0), rMatrix.get(1, 1), rMatrix.get(1, 2),
- rMatrix.get(2, 0), rMatrix.get(2, 1), rMatrix.get(2, 2));
}
}
break;
commit 7c85369dfc9ae8ff314c1d4fbe9100d91d0dbd4e
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Oct 17 21:55:12 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:13:02 2020 +0200
remove unneeded namespace re-declarations
Change-Id: I4c90a1548f56cbc5fdeb2824a5eb47bb669c4b4f
diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx
index 419a887cc55f..457039e1ba82 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -143,11 +143,6 @@ namespace svgio::svgreader
}
}
-} // end of namespace svgio::svgreader
-
-
-namespace svgio::svgreader
-{
namespace {
class localTextBreakupHelper : public drawinglayer::primitive2d::TextBreakupHelper
@@ -188,11 +183,6 @@ namespace svgio::svgreader
return true;
}
-} // end of namespace svgio::svgreader
-
-
-namespace svgio::svgreader
-{
SvgCharacterNode::SvgCharacterNode(
SvgDocument& rDocument,
SvgNode* pParent,
@@ -567,11 +557,7 @@ namespace svgio::svgreader
}
}
-} // end of namespace svgio::svgreader
-
-namespace svgio::svgreader
-{
SvgTextPosition::SvgTextPosition(
SvgTextPosition* pParent,
const InfoProvider& rInfoProvider,
commit d31300215cc1ea4e07cf5762c3c87371b59b2caf
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Oct 17 19:46:55 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:13:02 2020 +0200
pragma once for svdobj.hxx
Change-Id: Iceb1c2f0c2e1c488e4bef4fed395dd61a40da8ca
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index a097e26b0f3d..b19dd5278539 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_SVX_SVDOBJ_HXX
-#define INCLUDED_SVX_SVDOBJ_HXX
+#pragma once
#include <memory>
#include <com/sun/star/uno/Any.hxx>
@@ -1082,6 +1081,4 @@ template< typename T > T* SdrObject::CloneHelper(SdrModel& rTargetModel) const
return pObj;
}
-#endif // INCLUDED_SVX_SVDOBJ_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 5d81d6006044c82f45b283c9b81acf5151929289
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Oct 17 18:31:47 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:13:02 2020 +0200
svx: organize forward declarations in svdobj.hxx
Change-Id: I256212175f66b5d0599df990675e7344505b7841
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index cb98d67a2891..a097e26b0f3d 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -75,6 +75,7 @@ class SdrLayerIDSet;
class Fraction;
enum class PointerStyle;
class Graphic;
+class SvxShape;
namespace basegfx
{
@@ -83,31 +84,13 @@ namespace basegfx
class B2DHomMatrix;
}
-namespace sdr
-{
- namespace properties
- {
- class BaseProperties;
- }
+namespace sdr { class ObjectUser; }
+namespace sdr::properties { class BaseProperties; }
+namespace sdr::contact { class ViewContact; }
- class ObjectUser;
-}
+namespace svx { class PropertyChangeNotifier; }
-namespace sdr
-{
- namespace contact
- {
- class ViewContact;
- } // end of namespace contact
-}
-
-namespace svx
-{
- class PropertyChangeNotifier;
-}
-class SvxShape;
-class SdrObject;
struct SVXCORE_DLLPUBLIC SdrObjectFreeOp;
// helper for constructing std::unique_ptr for SdrObjects where a
commit 2f5b558b980ac6599f9c6ac7f24bab7b2d242ada
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Jul 17 15:09:49 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:13:01 2020 +0200
Revert "hack for gradients split into adjacent polygons (tdf#133016)"
This reverts commit 777ac5456a1f24fea29931ede983b5b8ad9a063d.
diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
index 7c9eb8441306..9b9d258046cc 100644
--- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
@@ -30,7 +30,7 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <sal/log.hxx>
#include <cmath>
-#include <vcl/skia/SkiaHelper.hxx>
+
using namespace com::sun::star;
@@ -868,12 +868,6 @@ namespace drawinglayer::primitive2d
// use color distance and discrete lengths to calculate step count
const sal_uInt32 nSteps(calculateStepsForSvgGradient(getColorA(), getColorB(), fDelta, fDiscreteUnit));
- // HACK: Splitting a gradient into adjacent polygons with gradually changing color is silly.
- // If antialiasing is used to draw them, the AA-ed adjacent edges won't line up perfectly
- // because of the AA (see SkiaSalGraphicsImpl::mergePolyPolygonToPrevious()).
- // Make the polygons a bit wider, so they the partial overlap "fixes" this.
- const double fixup = SkiaHelper::isVCLSkiaEnabled() ? fDiscreteUnit / 2 : 0;
-
// tdf#117949 Use a small amount of discrete overlap at the edges. Usually this
// should be exactly 0.0 and 1.0, but there were cases when this gets clipped
// against the mask polygon which got numerically problematic.
@@ -887,7 +881,7 @@ namespace drawinglayer::primitive2d
basegfx::B2DRange(
getOffsetA() - fDiscreteUnit,
-0.0001, // TTTT -> should be 0.0, see comment above
- getOffsetA() + (fDelta / nSteps) + fDiscreteUnit + fixup,
+ getOffsetA() + (fDelta / nSteps) + fDiscreteUnit,
1.0001))); // TTTT -> should be 1.0, see comment above
// prepare loop (inside to outside, [0.0 .. 1.0[)
commit e710557e5fd5ea00da912c0a90dc131117fd1f8f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Jun 15 19:39:35 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:13:01 2020 +0200
vcl: add a Bitmap interface to basegfx, BitmapEx implementing it
Change-Id: I758f421d545191883e615f5016e9fc643459556e
diff --git a/include/basegfx/bitmap/Bitmap.hxx b/include/basegfx/bitmap/Bitmap.hxx
new file mode 100644
index 000000000000..b91b702aa212
--- /dev/null
+++ b/include/basegfx/bitmap/Bitmap.hxx
@@ -0,0 +1,23 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+class BASEGFX_DLLPUBLIC IBitmap
+{
+};
+
+} // end of namespace basegfx
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index dc9f8a837502..cb7d8c2df583 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -26,6 +26,8 @@
#include <tools/color.hxx>
#include <tools/degree.hxx>
+#include <basegfx/bitmap/Bitmap.hxx>
+
#include <sal/types.h>
namespace com::sun::star::rendering {
@@ -41,7 +43,7 @@ enum class TransparentType
Bitmap
};
-class SAL_WARN_UNUSED VCL_DLLPUBLIC BitmapEx
+class SAL_WARN_UNUSED VCL_DLLPUBLIC BitmapEx : basegfx::IBitmap
{
public:
commit cb44c29e247c711cee1e73465f61e189257f0b72
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 12:49:05 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:13:01 2020 +0200
add o3tl version of hash_combine to not depend on boost for this
Change-Id: I081f8d116ef811baa8aa5de35a6cb51fa4de7d56
diff --git a/include/o3tl/hash_combine.hxx b/include/o3tl/hash_combine.hxx
new file mode 100644
index 000000000000..17419b3e2c0f
--- /dev/null
+++ b/include/o3tl/hash_combine.hxx
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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
+
+namespace o3tl
+{
+template <typename T, typename N, std::enable_if_t<(sizeof(N) == 4), bool> = false>
+inline void hash_combine(N& nSeed, T const& nValue)
+{
+ static_assert(sizeof(nSeed) == 4);
+ nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B9u + (nSeed << 6) + (nSeed >> 2);
+}
+
+template <typename T, typename N, std::enable_if_t<(sizeof(N) == 8), bool> = false>
+inline void hash_combine(N& nSeed, T const& nValue)
+{
+ static_assert(sizeof(nSeed) == 8);
+ nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/o3tl/qa/test-lru_map.cxx b/o3tl/qa/test-lru_map.cxx
index a03a6bf37200..3ab285c4329a 100644
--- a/o3tl/qa/test-lru_map.cxx
+++ b/o3tl/qa/test-lru_map.cxx
@@ -15,7 +15,7 @@
#include <o3tl/lru_map.hxx>
-#include <boost/functional/hash.hpp>
+#include <o3tl/hash_combine.hxx>
using namespace ::o3tl;
@@ -206,8 +206,8 @@ struct TestClassKeyHashFunction
std::size_t operator()(TestClassKey const& aKey) const
{
std::size_t seed = 0;
- boost::hash_combine(seed, aKey.mA);
- boost::hash_combine(seed, aKey.mB);
+ o3tl::hash_combine(seed, aKey.mA);
+ o3tl::hash_combine(seed, aKey.mB);
return seed;
}
};
commit 33986dba2def0c5786a2efcb92efafbf8336812b
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue May 26 15:57:38 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:13:00 2020 +0200
GraphicAttributes: put const. and op. '=' into the header file
Change-Id: I1bc38f89457c3593673b445e7571a4fd82d5960b
diff --git a/include/vcl/GraphicAttributes.hxx b/include/vcl/GraphicAttributes.hxx
index 559e3f9fc36c..df937b898d3d 100644
--- a/include/vcl/GraphicAttributes.hxx
+++ b/include/vcl/GraphicAttributes.hxx
@@ -52,9 +52,37 @@ private:
GraphicDrawMode meDrawMode;
public:
- GraphicAttr();
+ GraphicAttr()
+ : mfGamma(1.0)
+ , mnMirrFlags(basegfx::MirrorDirectionFlags::NONE)
+ , mnLeftCrop(0)
+ , mnTopCrop(0)
+ , mnRightCrop(0)
+ , mnBottomCrop(0)
+ , mnRotate10(0)
+ , mnContPercent(0)
+ , mnLumPercent(0)
+ , mnRPercent(0)
+ , mnGPercent(0)
+ , mnBPercent(0)
+ , mbInvert(false)
+ , mcTransparency(0)
+ , meDrawMode(GraphicDrawMode::Standard)
+ {
+ }
+
+ bool operator==(const GraphicAttr& rAttr) const
+ {
+ return mfGamma == rAttr.mfGamma && mnMirrFlags == rAttr.mnMirrFlags
+ && mnLeftCrop == rAttr.mnLeftCrop && mnTopCrop == rAttr.mnTopCrop
+ && mnRightCrop == rAttr.mnRightCrop && mnBottomCrop == rAttr.mnBottomCrop
+ && mnRotate10 == rAttr.mnRotate10 && mnContPercent == rAttr.mnContPercent
+ && mnLumPercent == rAttr.mnLumPercent && mnRPercent == rAttr.mnRPercent
+ && mnGPercent == rAttr.mnGPercent && mnBPercent == rAttr.mnBPercent
+ && mbInvert == rAttr.mbInvert && mcTransparency == rAttr.mcTransparency
+ && meDrawMode == rAttr.meDrawMode;
+ }
- bool operator==(const GraphicAttr& rAttr) const;
bool operator!=(const GraphicAttr& rAttr) const { return !(*this == rAttr); }
void SetDrawMode(GraphicDrawMode eDrawMode) { meDrawMode = eDrawMode; }
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 5d3a1b593850..4b29c2d59a9e 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -328,7 +328,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/graphic/GraphicObject \
vcl/source/graphic/GraphicObject2 \
vcl/source/graphic/GraphicReader \
- vcl/source/graphic/grfattr \
vcl/source/graphic/Manager \
vcl/source/graphic/UnoGraphic \
vcl/source/graphic/UnoGraphicMapper \
diff --git a/vcl/source/graphic/grfattr.cxx b/vcl/source/graphic/grfattr.cxx
deleted file mode 100644
index 36e8605b77de..000000000000
--- a/vcl/source/graphic/grfattr.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <vcl/GraphicAttributes.hxx>
-
-GraphicAttr::GraphicAttr() :
- mfGamma ( 1.0 ),
- mnMirrFlags ( basegfx::MirrorDirectionFlags::NONE ),
- mnLeftCrop ( 0 ),
- mnTopCrop ( 0 ),
- mnRightCrop ( 0 ),
- mnBottomCrop ( 0 ),
- mnRotate10 ( 0 ),
- mnContPercent ( 0 ),
- mnLumPercent ( 0 ),
- mnRPercent ( 0 ),
- mnGPercent ( 0 ),
- mnBPercent ( 0 ),
- mbInvert ( false ),
- mcTransparency ( 0 ),
- meDrawMode ( GraphicDrawMode::Standard )
-{
-}
-
-bool GraphicAttr::operator==( const GraphicAttr& rAttr ) const
-{
- return( ( mfGamma == rAttr.mfGamma ) &&
- ( mnMirrFlags == rAttr.mnMirrFlags ) &&
- ( mnLeftCrop == rAttr.mnLeftCrop ) &&
- ( mnTopCrop == rAttr.mnTopCrop ) &&
- ( mnRightCrop == rAttr.mnRightCrop ) &&
- ( mnBottomCrop == rAttr.mnBottomCrop ) &&
- ( mnRotate10 == rAttr.mnRotate10 ) &&
- ( mnContPercent == rAttr.mnContPercent ) &&
- ( mnLumPercent == rAttr.mnLumPercent ) &&
- ( mnRPercent == rAttr.mnRPercent ) &&
- ( mnGPercent == rAttr.mnGPercent ) &&
- ( mnBPercent == rAttr.mnBPercent ) &&
- ( mbInvert == rAttr.mbInvert ) &&
- ( mcTransparency == rAttr.mcTransparency ) &&
- ( meDrawMode == rAttr.meDrawMode ) );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit a3c27f6a23be3253b2389a311f8c9d52bfc8719d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue May 26 13:39:45 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 24 17:12:58 2020 +0200
basegfx::MirrorDirectionFlags as replacement for BmpMirrorFlags
BmpMirrorFlags in Bitmap is an attribute for bitmap manipulation
(mirroring). This change creates a copy of the flags in basegfx
as MirrorDirectionFlags, which will be used in the fututre as a
general repalcement for the BmpMirrorFlags, that will be changed
step by step.
For now we only use the flags in GraphicAttr to make it independent
form vcl, and cast to/from BmpMirrorFLags and MirrorDirectionFlags
where needed.
Change-Id: I01a69a4d241caa22cff61bdbf87944af57684749
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index 9de4b8a80e64..8f801700ccf4 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -49,8 +49,10 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer,
if (getGraphicAttr().IsMirrored())
{
// content needs mirroring
- const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BmpMirrorFlags::Horizontal);
- const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BmpMirrorFlags::Vertical);
+ const bool bHMirr(getGraphicAttr().GetMirrorFlags()
+ & basegfx::MirrorDirectionFlags::Horizontal);
+ const bool bVMirr(getGraphicAttr().GetMirrorFlags()
+ & basegfx::MirrorDirectionFlags::Vertical);
// mirror by applying negative scale to the unit primitive and
// applying the object transformation on it.
@@ -69,7 +71,7 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer,
aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
aSuppressGraphicAttr.SetRotation(Degree10(0));
- aSuppressGraphicAttr.SetMirrorFlags(BmpMirrorFlags::NONE);
+ aSuppressGraphicAttr.SetMirrorFlags(basegfx::MirrorDirectionFlags::NONE);
aSuppressGraphicAttr.SetTransparency(0);
const GraphicObject& rGraphicObject = getGraphicObject();
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index ce03064a89c0..89fdb8e25846 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1674,7 +1674,7 @@ bool EscherPropertyContainer::CreateGraphicProperties(const uno::Reference<beans
if(bMirrored)
{
- pGraphicAttr->SetMirrorFlags(BmpMirrorFlags::Horizontal);
+ pGraphicAttr->SetMirrorFlags(basegfx::MirrorDirectionFlags::Horizontal);
}
if(nTransparency)
diff --git a/include/basegfx/bitmap/BitmapAttributes.hxx b/include/basegfx/bitmap/BitmapAttributes.hxx
new file mode 100644
index 000000000000..d918d55faa99
--- /dev/null
+++ b/include/basegfx/bitmap/BitmapAttributes.hxx
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <basegfx/basegfxdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
+
+namespace basegfx
+{
+enum class MirrorDirectionFlags
+{
+ NONE = 0x00,
+ Horizontal = 0x01,
+ Vertical = 0x02,
+};
+
+} // end of namespace basegfx
+
+namespace o3tl
+{
+template <>
+struct typed_flags<basegfx::MirrorDirectionFlags>
+ : is_typed_flags<basegfx::MirrorDirectionFlags, 0x03>
+{
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/GraphicAttributes.hxx b/include/vcl/GraphicAttributes.hxx
index 5216d2934166..559e3f9fc36c 100644
--- a/include/vcl/GraphicAttributes.hxx
+++ b/include/vcl/GraphicAttributes.hxx
@@ -22,6 +22,7 @@
#include <tools/degree.hxx>
#include <vcl/dllapi.h>
#include <vcl/bitmap.hxx>
+#include <basegfx/bitmap/BitmapAttributes.hxx>
enum class GraphicDrawMode
{
@@ -35,7 +36,7 @@ class VCL_DLLPUBLIC GraphicAttr
{
private:
double mfGamma;
- BmpMirrorFlags mnMirrFlags;
+ basegfx::MirrorDirectionFlags mnMirrFlags;
tools::Long mnLeftCrop;
tools::Long mnTopCrop;
tools::Long mnRightCrop;
@@ -59,8 +60,8 @@ public:
void SetDrawMode(GraphicDrawMode eDrawMode) { meDrawMode = eDrawMode; }
GraphicDrawMode GetDrawMode() const { return meDrawMode; }
- void SetMirrorFlags(BmpMirrorFlags nMirrFlags) { mnMirrFlags = nMirrFlags; }
- BmpMirrorFlags GetMirrorFlags() const { return mnMirrFlags; }
+ void SetMirrorFlags(basegfx::MirrorDirectionFlags nMirrFlags) { mnMirrFlags = nMirrFlags; }
+ basegfx::MirrorDirectionFlags GetMirrorFlags() const { return mnMirrFlags; }
void SetCrop(tools::Long nLeft_100TH_MM, tools::Long nTop_100TH_MM, tools::Long nRight_100TH_MM,
tools::Long nBottom_100TH_MM)
@@ -103,7 +104,7 @@ public:
sal_uInt8 GetTransparency() const { return mcTransparency; }
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list