[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 82 commits - basctl/source chart2/inc chart2/qa chart2/source comphelper/CppunitTest_comphelper_test.mk comphelper/qa compilerplugins/clang connectivity/source cui/inc cui/source cui/uiconfig desktop/source download.lst drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/inc drawinglayer/Library_drawinglayercore.mk drawinglayer/Library_drawinglayer.mk drawinglayer/Module_drawinglayer.mk drawinglayer/source editeng/source emfio/CppunitTest_emfio_emf_test.mk emfio/Library_emfio.mk extras/source filter/Library_svgfilter.mk filter/source .gitignore helpcontent2 icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_dark_svg icon-themes/breeze_svg icon-themes/colibre icon-themes/colibre_svg icon-themes/elementary icon-themes/elementary_svg icon-themes/karasa_jaga icon-themes/karasa_jaga_svg icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_dark_svg icon-themes/sifr_svg icon-themes/sukapura icon-themes/sukapura_sv g include/connectivity include/drawinglayer include/filter include/oox include/sfx2 include/svl include/svx include/vcl include/xmloff leak-suppress.txt Makefile.in oox/source reportdesign/IwyuFilter_reportdesign.yaml reportdesign/qa reportdesign/source RepositoryExternal.mk Repository.mk sc/CppunitTest_sc_ucalc.mk sc/inc sc/Library_sc.mk sc/qa sc/source sd/CppunitTest_sd_pdf_import_test.mk sd/CppunitTest_sd_uimpress.mk sd/Library_sd.mk sd/Module_sd.mk sd/qa sd/source setup_native/source sfx2/Library_sfx.mk sfx2/source solenv/clang-format svgio/CppunitTest_svgio.mk svgio/Library_svgio.mk svl/source svx/CppunitTest_svx_unit.mk svx/inc svx/Library_svxcore.mk svx/Library_svx.mk svx/source svx/uiconfig sw/CppunitTest_sw_htmlexport.mk sw/CppunitTest_sw_uwriter.mk sw/inc sw/Library_sw.mk sw/Library_swui.mk sw/qa sw/source vcl/CppunitTest_vcl_backend_test.mk vcl/headless vcl/inc vcl/Library_vcl.mk vcl/Library_vclplug_gen.mk vcl/Library_vclplug_win.mk vcl/opengl vcl/qa vcl/qt5 vcl/quartz vc l/skia vcl/source vcl/unx vcl/win writerfilter/source xmloff/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Tue May 5 20:33:40 UTC 2020
Rebased ref, commits from common ancestor:
commit cd1e382d462d4500cce020b1b86de97dc458f118
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue May 5 22:32:15 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue May 5 22:32:15 2020 +0200
drawinglayer: organize imports in vclmetafileprocessor2d.cxx
Change-Id: Ic6be2a42a7b1ed294cc86e3aee967ffec7b1e514
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 73438efc40f9..d853820abbdc 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -19,12 +19,24 @@
#include <memory>
#include "vclmetafileprocessor2d.hxx"
+#include "vclpixelprocessor2d.hxx"
+#include <rtl/ustring.hxx>
#include <rtl/math.hxx>
#include <tools/gen.hxx>
+#include <tools/stream.hxx>
#include <tools/diagnose_ex.h>
+#include <comphelper/processfactory.hxx>
+#include <basegfx/polygon/b2dpolygonclipper.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dlinegeometry.hxx>
#include <vcl/virdev.hxx>
#include <vcl/gdimtf.hxx>
#include <vcl/gradient.hxx>
+#include <vcl/graphictools.hxx>
+#include <vcl/metaact.hxx>
+#include <vcl/graph.hxx> // for PDFExtOutDevData Graphic support
+#include <toolkit/helper/formpdfexport.hxx> // for PDFExtOutDevData Graphic support
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/primitive2d/PolyPolygonHairlinePrimitive2D.hxx>
@@ -37,45 +49,26 @@
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
-#include <basegfx/polygon/b2dpolygonclipper.hxx>
-#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
-#include "vclpixelprocessor2d.hxx"
-#include <tools/stream.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
-#include <vcl/graphictools.hxx>
-#include <vcl/metaact.hxx>
#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
-#include <comphelper/processfactory.hxx>
-#include <rtl/ustring.hxx>
-#include <com/sun/star/awt/XControl.hpp>
-#include <com/sun/star/i18n/BreakIterator.hpp>
-#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
-#include <com/sun/star/i18n/WordType.hpp>
#include <drawinglayer/primitive2d/controlprimitive2d.hxx>
#include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
-#include <basegfx/polygon/b2dlinegeometry.hxx>
-
-// for PDFExtOutDevData Graphic support
-#include <vcl/graph.hxx>
-#include <toolkit/helper/formpdfexport.hxx>
-
-// for Control printing
-#include <com/sun/star/beans/XPropertySet.hpp>
-
-// for StructureTagPrimitive support in sd's unomodel.cxx
#include <drawinglayer/primitive2d/structuretagprimitive2d.hxx>
+#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx> // for Title/Description metadata
-// for support of Title/Description in all apps when embedding pictures
-#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
+#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
+#include <com/sun/star/i18n/WordType.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
using namespace com::sun::star;
commit 2c29c9d27a7f4625c7cb72ba527b0f4e3bcbc670
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue May 5 22:21:42 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue May 5 22:21:42 2020 +0200
dl: move {Eps,FillHatch,PointArray}Primitive2D to global include
Change-Id: I85c10cb957f5065d964863360ca03355c87b7980
diff --git a/drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx b/drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx
index 17140a549436..ad85c02f22c1 100644
--- a/drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx
+++ b/drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx
@@ -21,7 +21,7 @@
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
-#include <primitive2d/fillhatchprimitive2d.hxx>
+#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
using namespace com::sun::star;
diff --git a/drawinglayer/source/primitive2d/epsprimitive2d.cxx b/drawinglayer/source/primitive2d/epsprimitive2d.cxx
index 8ad1db87ac4d..b519547c00d7 100644
--- a/drawinglayer/source/primitive2d/epsprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/epsprimitive2d.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <primitive2d/epsprimitive2d.hxx>
+#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index 5919847ab33c..9c4ef03bfba3 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <primitive2d/fillhatchprimitive2d.hxx>
+#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
#include <texture/texture.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
diff --git a/drawinglayer/source/primitive2d/gridprimitive2d.cxx b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
index 66a747452103..e1d0841678e2 100644
--- a/drawinglayer/source/primitive2d/gridprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
@@ -18,7 +18,7 @@
*/
#include <drawinglayer/primitive2d/gridprimitive2d.hxx>
-#include <primitive2d/pointarrayprimitive2d.hxx>
+#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
diff --git a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx
index 66ca43bd8004..7e527487eb85 100644
--- a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <primitive2d/pointarrayprimitive2d.hxx>
+#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 225fe4d5fb97..65a03548cb1c 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -27,7 +27,7 @@
#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
-#include <primitive2d/pointarrayprimitive2d.hxx>
+#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <drawinglayer/processor3d/cutfindprocessor3d.hxx>
#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index b3c0d773fbff..73438efc40f9 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -47,7 +47,7 @@
#include <tools/stream.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
-#include <primitive2d/pointarrayprimitive2d.hxx>
+#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <vcl/graphictools.hxx>
#include <vcl/metaact.hxx>
#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
@@ -61,7 +61,7 @@
#include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
-#include <primitive2d/epsprimitive2d.hxx>
+#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
// for PDFExtOutDevData Graphic support
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index bba66e2d4272..b2928a408547 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -56,9 +56,9 @@
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
#include <drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx>
#include <drawinglayer/primitive2d/svggradientprimitive2d.hxx>
-#include <primitive2d/pointarrayprimitive2d.hxx>
-#include <primitive2d/fillhatchprimitive2d.hxx>
-#include <primitive2d/epsprimitive2d.hxx>
+#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
+#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
+#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XControl.hpp>
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 96b0bf9a97b5..5af4dcac755f 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -61,8 +61,8 @@
// control support
#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
-#include <primitive2d/pointarrayprimitive2d.hxx>
-#include <primitive2d/epsprimitive2d.hxx>
+#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
+#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
using namespace com::sun::star;
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index eb3236a0e0b3..cfab0426ef74 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -18,7 +18,7 @@
*/
#include <wmfemfhelper.hxx>
-#include <primitive2d/pointarrayprimitive2d.hxx>
+#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <vcl/lineinfo.hxx>
#include <vcl/metaact.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
@@ -38,7 +38,7 @@
#include <vcl/BitmapPalette.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
-#include <primitive2d/fillhatchprimitive2d.hxx>
+#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
@@ -48,7 +48,7 @@
#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
#include <primitive2d/textlineprimitive2d.hxx>
#include <primitive2d/textstrikeoutprimitive2d.hxx>
-#include <primitive2d/epsprimitive2d.hxx>
+#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
#include <sal/log.hxx>
#include <tools/fract.hxx>
#include <tools/stream.hxx>
diff --git a/drawinglayer/inc/primitive2d/epsprimitive2d.hxx b/include/drawinglayer/primitive2d/epsprimitive2d.hxx
similarity index 100%
rename from drawinglayer/inc/primitive2d/epsprimitive2d.hxx
rename to include/drawinglayer/primitive2d/epsprimitive2d.hxx
diff --git a/drawinglayer/inc/primitive2d/fillhatchprimitive2d.hxx b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
similarity index 100%
rename from drawinglayer/inc/primitive2d/fillhatchprimitive2d.hxx
rename to include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
diff --git a/drawinglayer/inc/primitive2d/pointarrayprimitive2d.hxx b/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
similarity index 100%
rename from drawinglayer/inc/primitive2d/pointarrayprimitive2d.hxx
rename to include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index db09c4a5d8a9..b47c320783a6 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -3624,10 +3624,7 @@ desktop/win32/source/unoinfo.cxx
drawinglayer/inc/converters.hxx
drawinglayer/inc/emfplushelper.hxx
drawinglayer/inc/primitive2d/cropprimitive2d.hxx
-drawinglayer/inc/primitive2d/epsprimitive2d.hxx
-drawinglayer/inc/primitive2d/fillhatchprimitive2d.hxx
drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
-drawinglayer/inc/primitive2d/pointarrayprimitive2d.hxx
drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
@@ -5843,6 +5840,9 @@ include/drawinglayer/attribute/sdrobjectattribute3d.hxx
include/drawinglayer/attribute/sdrsceneattribute3d.hxx
include/drawinglayer/attribute/sdrshadowattribute.hxx
include/drawinglayer/geometry/viewinformation3d.hxx
+include/drawinglayer/primitive2d/epsprimitive2d.hxx
+include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
include/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx
include/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx
include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
commit 148f1c6df21e163c44418239ce291fee021cee8c
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue May 5 20:54:43 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue May 5 21:00:06 2020 +0200
remove "using std::vector" in SdrEditView
Change-Id: Ide7e72effd4568a988b9c8c942daf2ec3a3b0479
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index fa36984bb4ec..661dd0779e18 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -51,7 +51,6 @@
#include <vector>
#include <vcl/graph.hxx>
-using ::std::vector;
using namespace com::sun::star;
SdrObject* SdrEditView::GetMaxToTopObj(SdrObject* /*pObj*/) const
@@ -767,7 +766,7 @@ struct ImpDistributeEntry
}
-typedef vector<ImpDistributeEntry> ImpDistributeEntryList;
+typedef std::vector<ImpDistributeEntry> ImpDistributeEntryList;
void SdrEditView::DistributeMarkedObjects(weld::Window* pParent)
{
commit 1d442efeedbe32c14eb19eb9c7be1e7ba509b53b
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Apr 1 13:00:25 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue May 5 20:57:26 2020 +0200
Add OutputDevice::drawPrimitive2D to OutputDevice
Change-Id: Ifc22eca62df72bddd247ba097054f34756520614
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 1df0137cdcee..9cd127d3490c 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -49,6 +49,8 @@
#include <com/sun/star/drawing/LineCap.hpp>
#include <com/sun/star/uno/Reference.h>
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
+
#include <memory>
#include <vector>
@@ -1955,6 +1957,9 @@ public:
///@}
+ bool drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D);
+
+
/** @name Native Widget Rendering functions
These all just call through to the private mpGraphics functions of the same name.
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 9780ca3575a1..3a56406b9adf 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_use_libraries,vcl,\
basegfx \
comphelper \
cppuhelper \
+ drawinglayercore \
i18nlangtag \
i18nutil \
$(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 0dcdd84a5d0a..52f31234caa3 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -713,4 +713,9 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
return bDrawn;
}
+bool OutputDevice::drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D)
+{
+ return false;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 585fa3197b3f35c314a7467f42af314674095334
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Mar 7 14:33:43 2020 +0100
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue May 5 20:57:25 2020 +0200
Separate core drawinglayer func. into drawinglayercore library
This separates the drawinglayer core functionallity into a
separate library, to keep a strict separation what is backend
dependent and what is not. More strict separation can be done
at a later date.
This will make it possible to push part of drawinglayer
(part of processor2d) directly into VCL.
Change-Id: Ibc26580067e50bf20d7cdd37fa0e44eb10200878
diff --git a/Repository.mk b/Repository.mk
index 4479ed901e23..78b146096bdd 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -350,6 +350,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
$(call gb_Helper_optional,SCRIPTING,dlgprov) \
$(if $(filter WNT,$(OS)),directx9canvas) \
$(if $(ENABLE_OPENGL_CANVAS),oglcanvas) \
+ drawinglayercore \
drawinglayer \
editeng \
$(if $(filter WNT,$(OS)),emser) \
diff --git a/drawinglayer/CppunitTest_drawinglayer_border.mk b/drawinglayer/CppunitTest_drawinglayer_border.mk
index fa2f715590cd..e00006c18dba 100644
--- a/drawinglayer/CppunitTest_drawinglayer_border.mk
+++ b/drawinglayer/CppunitTest_drawinglayer_border.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,drawinglayer_border, \
sal \
salhelper \
drawinglayer \
+ drawinglayercore \
vcl \
test \
tl \
diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 2a0f1030a789..46f21f56b6b6 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_Library_use_externals,drawinglayer,\
))
$(eval $(call gb_Library_use_libraries,drawinglayer,\
+ drawinglayercore \
basegfx \
canvastools \
comphelper \
@@ -67,11 +68,9 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/attribute/sdrsceneattribute3d \
drawinglayer/source/attribute/sdrshadowattribute \
drawinglayer/source/attribute/strokeattribute \
- drawinglayer/source/geometry/viewinformation2d \
drawinglayer/source/geometry/viewinformation3d \
drawinglayer/source/primitive2d/animatedprimitive2d \
drawinglayer/source/primitive2d/backgroundcolorprimitive2d \
- drawinglayer/source/primitive2d/baseprimitive2d \
drawinglayer/source/primitive2d/bitmapprimitive2d \
drawinglayer/source/primitive2d/borderlineprimitive2d \
drawinglayer/source/primitive2d/controlprimitive2d \
@@ -111,7 +110,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D \
drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \
drawinglayer/source/primitive2d/primitivetools2d \
- drawinglayer/source/primitive2d/Primitive2DContainer \
drawinglayer/source/primitive2d/sceneprimitive2d \
drawinglayer/source/primitive2d/sdrdecompositiontools2d \
drawinglayer/source/primitive2d/shadowprimitive2d \
@@ -126,7 +124,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/primitive2d/textlineprimitive2d \
drawinglayer/source/primitive2d/textprimitive2d \
drawinglayer/source/primitive2d/textstrikeoutprimitive2d \
- drawinglayer/source/primitive2d/Tools \
drawinglayer/source/primitive2d/transformprimitive2d \
drawinglayer/source/primitive2d/transparenceprimitive2d \
drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \
diff --git a/drawinglayer/Library_drawinglayercore.mk b/drawinglayer/Library_drawinglayercore.mk
new file mode 100644
index 000000000000..f1643d27014d
--- /dev/null
+++ b/drawinglayer/Library_drawinglayercore.mk
@@ -0,0 +1,49 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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/.
+#
+
+$(eval $(call gb_Library_Library,drawinglayercore))
+
+$(eval $(call gb_Library_set_include,drawinglayercore,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/drawinglayer/inc \
+))
+
+$(eval $(call gb_Library_add_defs,drawinglayercore,\
+ -DDRAWINGLAYERCORE_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_set_precompiled_header,drawinglayercore,drawinglayer/inc/pch/precompiled_drawinglayercore))
+
+$(eval $(call gb_Library_use_sdk_api,drawinglayercore))
+
+$(eval $(call gb_Library_use_externals,drawinglayercore,\
+ boost_headers \
+ libxml2 \
+))
+
+$(eval $(call gb_Library_use_libraries,drawinglayercore,\
+ basegfx \
+ comphelper \
+ cppu \
+ cppuhelper \
+ i18nlangtag \
+ sal \
+ salhelper \
+ svl \
+ tl \
+))
+
+$(eval $(call gb_Library_add_exception_objects,drawinglayercore,\
+ drawinglayer/source/primitive2d/baseprimitive2d \
+ drawinglayer/source/primitive2d/Primitive2DContainer \
+ drawinglayer/source/primitive2d/Tools \
+ drawinglayer/source/geometry/viewinformation2d \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/drawinglayer/Module_drawinglayer.mk b/drawinglayer/Module_drawinglayer.mk
index 6d329e95c60a..687cd9c2671f 100644
--- a/drawinglayer/Module_drawinglayer.mk
+++ b/drawinglayer/Module_drawinglayer.mk
@@ -10,6 +10,7 @@
$(eval $(call gb_Module_Module,drawinglayer))
$(eval $(call gb_Module_add_targets,drawinglayer,\
+ Library_drawinglayercore \
Library_drawinglayer \
))
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
index 9aaf7bace296..d60954dab588 100644
--- a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
+++ b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
@@ -93,7 +93,6 @@
#include <basegfx/range/basicrange.hxx>
#include <basegfx/tuple/b2dtuple.hxx>
#include <basegfx/tuple/b3dtuple.hxx>
-#include <basegfx/utils/canvastools.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/vector/b2enums.hxx>
#include <basegfx/vector/b2ivector.hxx>
@@ -105,7 +104,7 @@
#include <com/sun/star/drawing/TextureMode.hpp>
#include <com/sun/star/drawing/TextureProjectionMode.hpp>
#include <com/sun/star/graphic/XPrimitive3D.hpp>
-#include <com/sun/star/util/XAccounting.hpp>
+#include <com/sun/star/uno/Reference.hxx>
#include <comphelper/comphelperdllapi.h>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
@@ -139,7 +138,6 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
-#include <drawinglayer/primitive2d/CommonTypes.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonGradientPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonGraphicPrimitive2D.hxx>
@@ -147,9 +145,6 @@
#include <drawinglayer/primitive2d/PolyPolygonHatchPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonMarkerPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx>
-#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
-#include <drawinglayer/primitive2d/Primitive2DVisitor.hxx>
-#include <drawinglayer/primitive2d/Tools.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx
new file mode 100644
index 000000000000..4a8c23ea8e65
--- /dev/null
+++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx
@@ -0,0 +1,12 @@
+/* -*- 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/.
+ */
+
+#include "precompiled_drawinglayercore.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx
new file mode 100644
index 000000000000..4cc5ca4612c9
--- /dev/null
+++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx
@@ -0,0 +1,46 @@
+/* -*- 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 has been autogenerated by update_pch.sh. It is possible to edit it
+ manually (such as when an include file has been moved/renamed/removed). All such
+ manual changes will be rewritten by the next run of update_pch.sh (which presumably
+ also fixes all possible problems, so it's usually better to use it).
+
+ Generated on 2020-03-07 12:37:18 using:
+ ./bin/update_pch drawinglayer drawinglayercore --cutoff=4 --exclude:system --exclude:module --exclude:local
+
+ If after updating build fails, use the following command to locate conflicting headers:
+ ./bin/update_pch_bisect ./drawinglayer/inc/pch/precompiled_drawinglayercore.hxx "make drawinglayer.build" --find-conflicts
+*/
+
+#if PCH_LEVEL >= 1
+#include <ostream>
+#include <vector>
+#endif // PCH_LEVEL >= 1
+#if PCH_LEVEL >= 2
+#include <osl/diagnose.h>
+#include <osl/interlck.h>
+#include <sal/config.h>
+#include <sal/types.h>
+#endif // PCH_LEVEL >= 2
+#if PCH_LEVEL >= 3
+#include <basegfx/basegfxdllapi.h>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/range/basicrange.hxx>
+#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/utils/canvastools.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#endif // PCH_LEVEL >= 3
+#if PCH_LEVEL >= 4
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif // PCH_LEVEL >= 4
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/emfio/CppunitTest_emfio_emf_test.mk b/emfio/CppunitTest_emfio_emf_test.mk
index 123e4b3549bd..2679c0a604d9 100644
--- a/emfio/CppunitTest_emfio_emf_test.mk
+++ b/emfio/CppunitTest_emfio_emf_test.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_sdk_api,emfio_emf))
$(eval $(call gb_CppunitTest_use_libraries,emfio_emf,\
basegfx \
drawinglayer \
+ drawinglayercore \
cppu \
cppuhelper \
comphelper \
diff --git a/emfio/Library_emfio.mk b/emfio/Library_emfio.mk
index 52fde14885b3..89add50b781a 100644
--- a/emfio/Library_emfio.mk
+++ b/emfio/Library_emfio.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_sdk_api,emfio))
$(eval $(call gb_Library_use_libraries,emfio,\
basegfx \
+ drawinglayercore \
drawinglayer \
cppu \
cppuhelper \
diff --git a/filter/Library_svgfilter.mk b/filter/Library_svgfilter.mk
index 21318aa1fd03..1f0caf11758c 100644
--- a/filter/Library_svgfilter.mk
+++ b/filter/Library_svgfilter.mk
@@ -56,6 +56,7 @@ $(eval $(call gb_Library_use_libraries,svgfilter,\
sax \
salhelper \
comphelper \
+ drawinglayercore \
drawinglayer \
basegfx \
cppuhelper \
diff --git a/include/drawinglayer/drawinglayerdllapi.h b/include/drawinglayer/drawinglayerdllapi.h
index 0b3983504919..36a0d8abfea2 100644
--- a/include/drawinglayer/drawinglayerdllapi.h
+++ b/include/drawinglayer/drawinglayerdllapi.h
@@ -19,6 +19,12 @@
#endif
#define DRAWINGLAYER_DLLPRIVATE SAL_DLLPRIVATE
+#if defined(DRAWINGLAYERCORE_DLLIMPLEMENTATION)
+#define DRAWINGLAYERCORE_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define DRAWINGLAYERCORE_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx
index 95be29a72bda..06b17248d213 100644
--- a/include/drawinglayer/geometry/viewinformation2d.hxx
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -63,7 +63,7 @@ namespace drawinglayer::geometry
It is an implementation to support the sequence of PropertyValues used in a
css::graphic::XPrimitive2D for C++ implementations working with those
*/
-class DRAWINGLAYER_DLLPUBLIC ViewInformation2D
+class DRAWINGLAYERCORE_DLLPUBLIC ViewInformation2D
{
public:
typedef o3tl::cow_wrapper<ImpViewInformation2D, o3tl::ThreadSafeRefCountingPolicy> ImplType;
diff --git a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
index cca3a0a91485..c096e9a8cc2f 100644
--- a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
+++ b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
@@ -34,7 +34,7 @@ class ViewInformation2D;
namespace drawinglayer::primitive2d
{
-class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer
+class SAL_WARN_UNUSED DRAWINGLAYERCORE_DLLPUBLIC Primitive2DContainer
: public std::deque<Primitive2DReference>,
public Primitive2DDecompositionVisitor
{
diff --git a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
index dfe04b32a320..e174d1e0878d 100644
--- a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
+++ b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
@@ -27,7 +27,7 @@ namespace drawinglayer::primitive2d
class Primitive2DContainer;
// Visitor class for walking a tree of Primitive2DReference
-class DRAWINGLAYER_DLLPUBLIC Primitive2DDecompositionVisitor
+class DRAWINGLAYERCORE_DLLPUBLIC Primitive2DDecompositionVisitor
{
public:
virtual void append(const Primitive2DReference&) = 0;
diff --git a/include/drawinglayer/primitive2d/Tools.hxx b/include/drawinglayer/primitive2d/Tools.hxx
index fbb6f5717c01..1c30565c8c1b 100644
--- a/include/drawinglayer/primitive2d/Tools.hxx
+++ b/include/drawinglayer/primitive2d/Tools.hxx
@@ -31,16 +31,16 @@ class ViewInformation2D;
namespace drawinglayer::primitive2d
{
/// get B2DRange from a given Primitive2DReference
-basegfx::B2DRange DRAWINGLAYER_DLLPUBLIC getB2DRangeFromPrimitive2DReference(
+basegfx::B2DRange DRAWINGLAYERCORE_DLLPUBLIC getB2DRangeFromPrimitive2DReference(
const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation);
/** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
and using compare operator
*/
-bool DRAWINGLAYER_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA,
- const Primitive2DReference& rB);
+bool DRAWINGLAYERCORE_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA,
+ const Primitive2DReference& rB);
-OUString DRAWINGLAYER_DLLPUBLIC idToString(sal_uInt32 nId);
+OUString DRAWINGLAYERCORE_DLLPUBLIC idToString(sal_uInt32 nId);
} // end of namespace drawinglayer::primitive2d
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index 5e1a96429ff3..8818cdd0bcde 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -121,8 +121,8 @@ typedef cppu::WeakComponentImplHelper<css::graphic::XPrimitive2D, css::util::XAc
for view-independent primitives which are defined by not using ViewInformation2D
in their get2DDecomposition/getB2DRange implementations.
*/
-class DRAWINGLAYER_DLLPUBLIC BasePrimitive2D : protected cppu::BaseMutex,
- public BasePrimitive2DImplBase
+class DRAWINGLAYERCORE_DLLPUBLIC BasePrimitive2D : protected cppu::BaseMutex,
+ public BasePrimitive2DImplBase
{
BasePrimitive2D(const BasePrimitive2D&) = delete;
BasePrimitive2D& operator=(const BasePrimitive2D&) = delete;
@@ -200,7 +200,7 @@ public:
to identify if a new decomposition is needed at the next call
(f) return maBuffered2DDecomposition
*/
-class DRAWINGLAYER_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D
+class DRAWINGLAYERCORE_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D
{
private:
/// a sequence used for buffering the last create2DDecomposition() result
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 8943de7ab4c3..60fb6676dab9 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \
cppuhelper \
dbtools \
drawinglayer \
+ drawinglayercore \
editeng \
for \
forui \
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 997b14c0add9..b540b27c9834 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -70,6 +70,7 @@ $(eval $(call gb_Library_use_libraries,sc,\
cppu \
cppuhelper \
dbtools \
+ drawinglayercore \
drawinglayer \
editeng \
for \
diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index 93426dfc3a55..63f143978231 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\
cppu \
cppuhelper \
drawinglayer \
+ drawinglayercore \
editeng \
i18nlangtag \
i18nutil \
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 43b168be8d8c..24520633e77f 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -74,6 +74,7 @@ $(eval $(call gb_Library_use_libraries,sd,\
cppcanvas \
cppu \
cppuhelper \
+ drawinglayercore \
drawinglayer \
editeng \
i18nlangtag \
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 67a66ef2d211..a6d6b7d6b71a 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_Library_use_libraries,sfx,\
comphelper \
cppu \
cppuhelper \
+ drawinglayercore \
drawinglayer \
fwe \
i18nlangtag \
diff --git a/svgio/CppunitTest_svgio.mk b/svgio/CppunitTest_svgio.mk
index c6f4db91fc60..24fb7a39af32 100644
--- a/svgio/CppunitTest_svgio.mk
+++ b/svgio/CppunitTest_svgio.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_CppunitTest_use_library_objects,svgio,\
$(eval $(call gb_CppunitTest_use_libraries,svgio,\
basegfx \
drawinglayer \
+ drawinglayercore \
cppu \
cppuhelper \
comphelper \
diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk
index 449c17f61196..7ef1aeb19513 100644
--- a/svgio/Library_svgio.mk
+++ b/svgio/Library_svgio.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_Library_use_sdk_api,svgio))
$(eval $(call gb_Library_use_libraries,svgio,\
basegfx \
+ drawinglayercore \
drawinglayer \
comphelper \
cppu \
diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk
index 92feb45d6578..c78b8d7769eb 100644
--- a/svx/CppunitTest_svx_unit.mk
+++ b/svx/CppunitTest_svx_unit.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_unit, \
$(eval $(call gb_CppunitTest_use_libraries,svx_unit, \
basegfx \
drawinglayer \
+ drawinglayercore \
sal \
sfx \
svxcore \
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index d3eff20b6769..9ccba33a748c 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,svx,\
crashreport) \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
+ drawinglayercore \
drawinglayer \
editeng \
fwe \
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 222d69bb6c8a..7a9b31e58b77 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -57,6 +57,7 @@ $(eval $(call gb_Library_use_libraries,svxcore,\
cppu \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
+ drawinglayercore \
drawinglayer \
editeng \
fwe \
diff --git a/sw/CppunitTest_sw_uwriter.mk b/sw/CppunitTest_sw_uwriter.mk
index 6b9ffa4ba683..a881587735e4 100644
--- a/sw/CppunitTest_sw_uwriter.mk
+++ b/sw/CppunitTest_sw_uwriter.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_uwriter, \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
drawinglayer \
+ drawinglayercore \
editeng \
i18nlangtag \
i18nutil \
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index b6d75fd890bf..d99c59a58a4b 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -58,6 +58,7 @@ $(eval $(call gb_Library_use_libraries,sw,\
cppuhelper \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
+ drawinglayercore \
drawinglayer \
editeng \
i18nlangtag \
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index 99f1dd20ae3d..4c09d1cc4bda 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_Library_use_libraries,swui,\
ucbhelper \
utl \
vcl \
+ drawinglayercore \
drawinglayer \
))
commit 0c8ee2e0182facbbaaf440054e6c72c21bdaaefb
Author: andreas kainz <kainz.a at gmail.com>
AuthorDate: Tue May 5 17:01:52 2020 +0200
Commit: andreas_kainz <kainz.a at gmail.com>
CommitDate: Tue May 5 20:40:03 2020 +0200
Gallery: add styles support to bpmn gallery items
Change-Id: I80e94b07fb4b5665bc4c677d1accb6939c131af7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93498
Tested-by: Jenkins
Reviewed-by: andreas_kainz <kainz.a at gmail.com>
diff --git a/extras/source/gallery/gallery_mytheme/bpmn.sdg b/extras/source/gallery/gallery_mytheme/bpmn.sdg
index 4c4bacb9e69a..e88a7fc5084f 100644
Binary files a/extras/source/gallery/gallery_mytheme/bpmn.sdg and b/extras/source/gallery/gallery_mytheme/bpmn.sdg differ
diff --git a/extras/source/gallery/gallery_mytheme/bpmn.sdv b/extras/source/gallery/gallery_mytheme/bpmn.sdv
index 82bdfc1c4ada..0d701bad01e5 100644
Binary files a/extras/source/gallery/gallery_mytheme/bpmn.sdv and b/extras/source/gallery/gallery_mytheme/bpmn.sdv differ
diff --git a/extras/source/gallery/gallery_mytheme/bpmn.thm b/extras/source/gallery/gallery_mytheme/bpmn.thm
index 9616f093889a..110a5ef97610 100644
Binary files a/extras/source/gallery/gallery_mytheme/bpmn.thm and b/extras/source/gallery/gallery_mytheme/bpmn.thm differ
commit 37f472c8d0e8a195c887e34cda796cdeae550ed6
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Thu Apr 30 12:23:28 2020 +0200
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue May 5 20:36:12 2020 +0200
fix line width in DrawPolyLine() with matrix (tdf#132498)
For backends that do the object-to-device coordinates transformation
directly, it's necessary to also convert the size of line width.
But simply multiplying it with the matrix can also rotate the line
width "vector", making it e.g. negative. So don't use just the X
coordinate, use vector length for the transformation, which is ok.
In fact it doesn't even make sense to treat width as a vector, because
a width simply is not a vector (and for this reason it's also not
actually used).
Change-Id: I1241c9cb29155df105170d568a879ebc32b11a5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93203
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
Tested-by: Jenkins
diff --git a/vcl/CppunitTest_vcl_backend_test.mk b/vcl/CppunitTest_vcl_backend_test.mk
index f146cb6238fe..5a886224034a 100644
--- a/vcl/CppunitTest_vcl_backend_test.mk
+++ b/vcl/CppunitTest_vcl_backend_test.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,vcl_backend_test, \
))
$(eval $(call gb_CppunitTest_use_libraries,vcl_backend_test, \
+ basegfx \
comphelper \
cppu \
cppuhelper \
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index b5649b093e31..fadf641fd290 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1092,7 +1092,7 @@ void SvpSalGraphics::drawPolyLine(sal_uInt32 nPoints, const SalPoint* pPtAry)
basegfx::B2DHomMatrix(),
aPoly,
0.0,
- basegfx::B2DVector(1.0, 1.0),
+ 1.0,
nullptr, // MM01
basegfx::B2DLineJoin::Miter,
css::drawing::LineCap_BUTT,
@@ -1456,7 +1456,7 @@ bool SvpSalGraphics::drawPolyLine(
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolyLine,
double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap,
@@ -1488,7 +1488,7 @@ bool SvpSalGraphics::drawPolyLine(
rObjectToDevice,
rPolyLine,
fTransparency,
- rLineWidth,
+ fLineWidth,
pStroke, // MM01
eLineJoin,
eLineCap,
@@ -1508,7 +1508,7 @@ bool SvpSalGraphics::drawPolyLine(
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolyLine,
double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap,
@@ -1522,21 +1522,20 @@ bool SvpSalGraphics::drawPolyLine(
}
// need to check/handle LineWidth when ObjectToDevice transformation is used
- basegfx::B2DVector aLineWidth(rLineWidth);
const bool bObjectToDeviceIsIdentity(rObjectToDevice.isIdentity());
// tdf#124848 calculate-back logical LineWidth for a hairline
// since this implementation hands over the transformation to
// the graphic sub-system
- if(aLineWidth.equalZero())
+ if(fLineWidth == 0)
{
- aLineWidth = basegfx::B2DVector(1.0, 1.0);
+ fLineWidth = 1.0;
if(!bObjectToDeviceIsIdentity)
{
basegfx::B2DHomMatrix aObjectToDeviceInv(rObjectToDevice);
aObjectToDeviceInv.invert();
- aLineWidth = aObjectToDeviceInv * aLineWidth;
+ fLineWidth = (aObjectToDeviceInv * basegfx::B2DVector(fLineWidth, 0)).getLength();
}
}
@@ -1617,7 +1616,7 @@ bool SvpSalGraphics::drawPolyLine(
cairo_set_line_join(cr, eCairoLineJoin);
cairo_set_line_cap(cr, eCairoLineCap);
- cairo_set_line_width(cr, aLineWidth.getX());
+ cairo_set_line_width(cr, fLineWidth);
cairo_set_miter_limit(cr, fMiterLimit);
// try to access buffered data
@@ -1654,7 +1653,7 @@ bool SvpSalGraphics::drawPolyLine(
// check for basegfx::B2DLineJoin::NONE to react accordingly
const bool bNoJoin((basegfx::B2DLineJoin::NONE == eLineJoin
- && basegfx::fTools::more(aLineWidth.getX(), 0.0)));
+ && basegfx::fTools::more(fLineWidth, 0.0)));
if(pSystemDependentData_CairoPath)
{
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 99300ed03a53..3d1617d07100 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -113,7 +113,7 @@ public:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolyLine,
double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap,
@@ -211,7 +211,7 @@ public:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon&,
double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin,
css::drawing::LineCap,
diff --git a/vcl/inc/opengl/RenderList.hxx b/vcl/inc/opengl/RenderList.hxx
index 06dd03b4d7d1..213a2f43b554 100644
--- a/vcl/inc/opengl/RenderList.hxx
+++ b/vcl/inc/opengl/RenderList.hxx
@@ -163,7 +163,7 @@ public:
Color nLineColor, Color nFillColor, bool bUseAA);
void addDrawPolyLine(const basegfx::B2DPolygon& rPolygon, double fTransparency,
- const basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin eLineJoin,
+ double fLineWidth, basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap, double fMiterMinimumAngle,
Color nLineColor, bool bUseAA);
};
diff --git a/vcl/inc/opengl/gdiimpl.hxx b/vcl/inc/opengl/gdiimpl.hxx
index ac488a28116e..a6de106a6018 100644
--- a/vcl/inc/opengl/gdiimpl.hxx
+++ b/vcl/inc/opengl/gdiimpl.hxx
@@ -259,7 +259,7 @@ public:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon&,
double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin,
css::drawing::LineCap,
diff --git a/vcl/inc/qt5/Qt5Graphics.hxx b/vcl/inc/qt5/Qt5Graphics.hxx
index 0a66271c34e5..bc4870ee7e18 100644
--- a/vcl/inc/qt5/Qt5Graphics.hxx
+++ b/vcl/inc/qt5/Qt5Graphics.hxx
@@ -118,8 +118,7 @@ public:
const SalPoint* const* pPtAry,
const PolyFlags* const* pFlgAry) override;
virtual bool drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice,
- const basegfx::B2DPolygon&, double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ const basegfx::B2DPolygon&, double fTransparency, double fLineWidths,
const std::vector<double>* pStroke, // MM01
basegfx::B2DLineJoin, css::drawing::LineCap eLineCap,
double fMiterMinimumAngle, bool bPixelSnapHairline) override;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 3fa3a0e38e77..5e0222be05df 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -240,7 +240,7 @@ public:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon&,
double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ double rLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin,
css::drawing::LineCap eLineCap,
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index 8ae88aba161a..2161ebeb6358 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -246,7 +246,7 @@ public:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& i_rPolygon,
double i_fTransparency,
- const basegfx::B2DVector& i_rLineWidth,
+ double i_fLineWidth,
const std::vector< double >* i_pStroke, // MM01
basegfx::B2DLineJoin i_eLineJoin,
css::drawing::LineCap i_eLineCap,
@@ -466,7 +466,7 @@ protected:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon&,
double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin,
css::drawing::LineCap,
diff --git a/vcl/inc/salgdiimpl.hxx b/vcl/inc/salgdiimpl.hxx
index 3b179a7131ad..0e62669d654e 100644
--- a/vcl/inc/salgdiimpl.hxx
+++ b/vcl/inc/salgdiimpl.hxx
@@ -109,7 +109,7 @@ public:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon&,
double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin,
css::drawing::LineCap,
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index 68652cacc790..c78845fe6ffa 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -103,8 +103,7 @@ public:
const basegfx::B2DPolyPolygon&, double fTransparency) override;
virtual bool drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice,
- const basegfx::B2DPolygon&, double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ const basegfx::B2DPolygon&, double fTransparency, double fLineWidth,
const std::vector<double>* pStroke, // MM01
basegfx::B2DLineJoin, css::drawing::LineCap,
double fMiterMinimumAngle, bool bPixelSnapHairline) override;
diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h
index 6dfca7548f4b..6e68c9695c98 100644
--- a/vcl/inc/unx/genpspgraphics.h
+++ b/vcl/inc/unx/genpspgraphics.h
@@ -131,7 +131,7 @@ public:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon&,
double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin,
css::drawing::LineCap,
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index 19abfa0b8133..4216b703c14e 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -169,7 +169,7 @@ public:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon&,
double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin,
css::drawing::LineCap,
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index c45611a6e36e..4d1029167a85 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -241,7 +241,7 @@ protected:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon&,
double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin,
css::drawing::LineCap,
diff --git a/vcl/opengl/RenderList.cxx b/vcl/opengl/RenderList.cxx
index 81817950d05a..4830f1040de9 100644
--- a/vcl/opengl/RenderList.cxx
+++ b/vcl/opengl/RenderList.cxx
@@ -372,7 +372,7 @@ void RenderList::addDrawTextureWithMaskColor(OpenGLTexture const & rTexture, Col
}
void RenderList::addDrawPolyLine(const basegfx::B2DPolygon& rPolygon, double fTransparency,
- const basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin eLineJoin,
+ double fLineWidth, basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap, double fMiterMinimumAngle,
Color nLineColor, bool bUseAA)
{
@@ -383,8 +383,8 @@ void RenderList::addDrawPolyLine(const basegfx::B2DPolygon& rPolygon, double fTr
if (fTransparency == 1.0)
return;
- const bool bIsHairline = (rLineWidth.getX() == rLineWidth.getY()) && (rLineWidth.getX() <= 1.2);
- const float fLineWidth = bIsHairline ? 1.0f : rLineWidth.getX();
+ const bool bIsHairline = fLineWidth <= 1.2;
+ fLineWidth = bIsHairline ? 1.0f : fLineWidth;
basegfx::B2DPolygon aPolygon(rPolygon);
if (rPolygon.areControlPointsUsed())
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 25cac157a56b..6c76154ea498 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1560,7 +1560,7 @@ void OpenGLSalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pP
basegfx::B2DHomMatrix(),
aPoly,
0.0,
- basegfx::B2DVector(1.0, 1.0),
+ 1.0,
nullptr, // MM01
basegfx::B2DLineJoin::Miter,
css::drawing::LineCap_BUTT,
@@ -1638,7 +1638,7 @@ bool OpenGLSalGraphicsImpl::drawPolyLine(
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolygon,
double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap,
@@ -1680,10 +1680,10 @@ bool OpenGLSalGraphicsImpl::drawPolyLine(
if(bPixelSnapHairline) { aPolyPolygonLine = basegfx::utils::snapPointsOfHorizontalOrVerticalEdges(aPolyPolygonLine); }
// tdf#124848 get correct LineWidth in discrete coordinates,
- // take hairline case into account
- const basegfx::B2DVector aLineWidth(rLineWidth.equalZero()
- ? basegfx::B2DVector(1.0, 1.0)
- : rObjectToDevice * rLineWidth);
+ if(fLineWidth == 0) // hairline
+ fLineWidth = 1.0;
+ else // Adjust line width for object-to-device scale.
+ fLineWidth = (rObjectToDevice * basegfx::B2DVector(fLineWidth, 0)).getLength();
for(sal_uInt32 a(0); a < aPolyPolygonLine.count(); a++)
{
@@ -1695,7 +1695,7 @@ bool OpenGLSalGraphicsImpl::drawPolyLine(
mpRenderList->addDrawPolyLine(
aPolyLine,
fTransparency,
- aLineWidth,
+ fLineWidth,
eLineJoin,
eLineCap,
fMiterMinimumAngle,
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index 802e4eb239c6..f06d8fccb648 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -13,6 +13,7 @@
#include <vcl/bitmap.hxx>
#include <tools/stream.hxx>
#include <vcl/graphicfilter.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
#include <test/outputdevice.hxx>
@@ -44,6 +45,16 @@ class BackendTest : public test::BootstrapFixture
}
}
+ void exportDevice(const OUString& filename, const VclPtr<VirtualDevice>& device)
+ {
+ if (mbExportBitmap)
+ {
+ BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), device->GetOutputSizePixel()));
+ SvFileStream aStream(filename, StreamMode::WRITE | StreamMode::TRUNC);
+ GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, aStream);
+ }
+ }
+
public:
BackendTest()
: BootstrapFixture(true, false)
@@ -444,6 +455,36 @@ public:
CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
}
+ void testTdf124848()
+ {
+ ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ device->SetOutputSizePixel(Size(100, 100));
+ device->SetBackground(Wallpaper(COL_WHITE));
+ device->Erase();
+ device->SetAntialiasing(AntialiasingFlags::EnableB2dDraw);
+ device->SetLineColor(COL_BLACK);
+ basegfx::B2DHomMatrix matrix;
+ // DrawPolyLine() would apply the whole matrix to the line width, making it negative
+ // in case of a larger rotation.
+ matrix.rotate(M_PI); //180 degrees
+ matrix.translate(100, 100);
+ CPPUNIT_ASSERT(device->DrawPolyLineDirect(
+ matrix, basegfx::B2DPolygon{ { 50, 50 }, { 50, 100 } }, 100));
+ exportDevice("/tmp/tdf124848-1.png", device);
+ // 100px wide line should fill the entire width of the upper half
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, device->GetPixel(Point(2, 2)));
+
+ // Also check hairline.
+ device->Erase();
+ CPPUNIT_ASSERT(
+ device->DrawPolyLineDirect(matrix, basegfx::B2DPolygon{ { 50, 50 }, { 50, 100 } }, 0));
+ exportDevice("/tmp/tdf124848-2.png", device);
+ // 1px wide
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, device->GetPixel(Point(50, 20)));
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, device->GetPixel(Point(49, 20)));
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, device->GetPixel(Point(51, 20)));
+ }
+
CPPUNIT_TEST_SUITE(BackendTest);
CPPUNIT_TEST(testDrawRectWithRectangle);
CPPUNIT_TEST(testDrawRectWithPixel);
@@ -487,6 +528,8 @@ public:
CPPUNIT_TEST(testDrawBlend);
CPPUNIT_TEST(testDrawXor);
+ CPPUNIT_TEST(testTdf124848);
+
CPPUNIT_TEST_SUITE_END();
};
diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx
index eb43811466d4..cfebca7c6acb 100644
--- a/vcl/qt5/Qt5Graphics_GDI.cxx
+++ b/vcl/qt5/Qt5Graphics_GDI.cxx
@@ -325,7 +325,7 @@ bool Qt5Graphics::drawPolyPolygonBezier(sal_uInt32 /*nPoly*/, const sal_uInt32*
bool Qt5Graphics::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolyLine, double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector<double>* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin, css::drawing::LineCap eLineCap,
double fMiterMinimumAngle, bool bPixelSnapHairline)
@@ -371,9 +371,10 @@ bool Qt5Graphics::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice,
}
// tdf#124848 get correct LineWidth in discrete coordinates,
- // take hairline case into account
- const basegfx::B2DVector aLineWidth(rLineWidth.equalZero() ? basegfx::B2DVector(1.0, 1.0)
- : rObjectToDevice * rLineWidth);
+ if (fLineWidth == 0) // hairline
+ fLineWidth = 1.0;
+ else // Adjust line width for object-to-device scale.
+ fLineWidth = (rObjectToDevice * basegfx::B2DVector(fLineWidth, 0)).getLength();
// setup poly-polygon path
QPainterPath aPath;
@@ -390,7 +391,7 @@ bool Qt5Graphics::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice,
// setup line attributes
QPen aPen = aPainter.pen();
- aPen.setWidth(aLineWidth.getX());
+ aPen.setWidth(fLineWidth);
switch (eLineJoin)
{
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 51de3820f93d..3126400709f2 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -817,7 +817,7 @@ bool AquaSalGraphics::drawPolyLine(
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolyLine,
double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap,
@@ -836,15 +836,15 @@ bool AquaSalGraphics::drawPolyLine(
#endif
// tdf#124848 get correct LineWidth in discrete coordinates,
- // take hairline case into account
- const basegfx::B2DVector aLineWidth(rLineWidth.equalZero()
- ? basegfx::B2DVector(1.0, 1.0)
- : rObjectToDevice * rLineWidth);
+ if(fLineWidth == 0) // hairline
+ fLineWidth = 1.0;
+ else // Adjust line width for object-to-device scale.
+ fLineWidth = (rObjectToDevice * basegfx::B2DVector(fLineWidth, 0)).getLength();
// #i101491# Aqua does not support B2DLineJoin::NONE; return false to use
// the fallback (own geometry preparation)
// #i104886# linejoin-mode and thus the above only applies to "fat" lines
- if( (basegfx::B2DLineJoin::NONE == eLineJoin) && (aLineWidth.getX() > 1.3) )
+ if( (basegfx::B2DLineJoin::NONE == eLineJoin) && (fLineWidth > 1.3) )
return false;
// MM01 need to do line dashing as fallback stuff here now
@@ -935,12 +935,7 @@ bool AquaSalGraphics::drawPolyLine(
CGContextSetAlpha( maContextHolder.get(), 1.0 - fTransparency );
CGContextSetLineJoin( maContextHolder.get(), aCGLineJoin );
CGContextSetLineCap( maContextHolder.get(), aCGLineCap );
-
- // aLineWidth.getX() can be negative here. That causes a warning that shows up in the debugger.
- if (aLineWidth.getX() > 0)
- {
- CGContextSetLineWidth( maContextHolder.get(), aLineWidth.getX() );
- }
+ CGContextSetLineWidth( maContextHolder.get(), fLineWidth );
CGContextSetMiterLimit(maContextHolder.get(), fCGMiterLimit);
CGContextDrawPath( maContextHolder.get(), kCGPathStroke );
maContextHolder.restoreState();
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index bd55aaf8a044..00cf34d0eda6 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -650,7 +650,7 @@ void SkiaSalGraphicsImpl::drawPolyLine(sal_uInt32 nPoints, const SalPoint* pPtAr
aPolygon.setB2DPoint(i, basegfx::B2DPoint(pPtAry[i].mnX, pPtAry[i].mnY));
aPolygon.setClosed(false);
- drawPolyLine(basegfx::B2DHomMatrix(), aPolygon, 0.0, basegfx::B2DVector(1.0, 1.0),
+ drawPolyLine(basegfx::B2DHomMatrix(), aPolygon, 0.0, 1.0,
nullptr, // MM01
basegfx::B2DLineJoin::Miter, css::drawing::LineCap_BUTT,
basegfx::deg2rad(15.0) /*default*/, false);
@@ -742,7 +742,7 @@ bool SkiaSalGraphicsImpl::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectTo
bool SkiaSalGraphicsImpl::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolyLine, double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector<double>* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap, double fMiterMinimumAngle,
@@ -759,9 +759,10 @@ bool SkiaSalGraphicsImpl::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDev
SAL_INFO("vcl.skia.trace", "drawpolyline(" << this << "): " << rPolyLine << ":" << mLineColor);
// tdf#124848 get correct LineWidth in discrete coordinates,
- // take hairline case into account
- const basegfx::B2DVector aLineWidth(rLineWidth.equalZero() ? basegfx::B2DVector(1.0, 1.0)
- : rObjectToDevice * rLineWidth);
+ if (fLineWidth == 0) // hairline
+ fLineWidth = 1.0;
+ else // Adjust line width for object-to-device scale.
+ fLineWidth = (rObjectToDevice * basegfx::B2DVector(fLineWidth, 0)).getLength();
// MM01 need to do line dashing as fallback stuff here now
const double fDotDashLength(
@@ -833,7 +834,7 @@ bool SkiaSalGraphicsImpl::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDev
aPaint.setStrokeJoin(eSkLineJoin);
aPaint.setColor(toSkColorWithTransparency(mLineColor, fTransparency));
aPaint.setStrokeMiter(fMiterLimit);
- aPaint.setStrokeWidth(aLineWidth.getX());
+ aPaint.setStrokeWidth(fLineWidth);
aPaint.setAntiAlias(mParent.getAntiAliasB2DDraw());
if (eLineJoin != basegfx::B2DLineJoin::NONE)
diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 80bcda56b2a6..01698c4e3d6f 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -295,12 +295,11 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics
{
rGraphics.SetLineColor(Color(*rRectangle.mpStrokeColor));
rGraphics.SetFillColor();
- rGraphics.DrawPolyLine(
- basegfx::B2DHomMatrix(), aB2DPolygon, 1.0 - rRectangle.mnOpacity,
- basegfx::B2DVector(rRectangle.mnStrokeWidth, rRectangle.mnStrokeWidth),
- nullptr, // MM01
- basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false,
- nullptr);
+ rGraphics.DrawPolyLine(basegfx::B2DHomMatrix(), aB2DPolygon,
+ 1.0 - rRectangle.mnOpacity, rRectangle.mnStrokeWidth,
+ nullptr, // MM01
+ basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND,
+ 0.0f, false, nullptr);
}
}
break;
@@ -343,12 +342,11 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics
rGraphics.SetFillColor();
for (auto const& rPolygon : aPolyPolygon)
{
- rGraphics.DrawPolyLine(
- basegfx::B2DHomMatrix(), rPolygon, 1.0 - rPath.mnOpacity,
- basegfx::B2DVector(rPath.mnStrokeWidth, rPath.mnStrokeWidth),
- nullptr, // MM01
- basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false,
- nullptr);
+ rGraphics.DrawPolyLine(basegfx::B2DHomMatrix(), rPolygon,
+ 1.0 - rPath.mnOpacity, rPath.mnStrokeWidth,
+ nullptr, // MM01
+ basegfx::B2DLineJoin::Round,
+ css::drawing::LineCap_ROUND, 0.0f, false, nullptr);
}
}
}
@@ -387,8 +385,7 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr
rGraphics.SetLineColor(rWidgetDraw.maStrokeColor);
rGraphics.SetFillColor();
rGraphics.DrawPolyLine(
- basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f,
- basegfx::B2DVector(rWidgetDraw.mnStrokeWidth, rWidgetDraw.mnStrokeWidth),
+ basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f, rWidgetDraw.mnStrokeWidth,
nullptr, // MM01
basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false, nullptr);
}
@@ -411,8 +408,7 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr
};
rGraphics.DrawPolyLine(
- basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f,
- basegfx::B2DVector(rWidgetDraw.mnStrokeWidth, rWidgetDraw.mnStrokeWidth),
+ basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f, rWidgetDraw.mnStrokeWidth,
nullptr, // MM01
basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false, nullptr);
}
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 16a308064b12..0a50329f62f0 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -572,7 +572,7 @@ bool SalGraphics::DrawPolyLine(
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& i_rPolygon,
double i_fTransparency,
- const basegfx::B2DVector& i_rLineWidth,
+ double i_rLineWidth,
const std::vector< double >* i_pStroke, // MM01
basegfx::B2DLineJoin i_eLineJoin,
css::drawing::LineCap i_eLineCap,
diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx
index e88dd383e7f3..f451b6e1f645 100644
--- a/vcl/source/outdev/line.cxx
+++ b/vcl/source/outdev/line.cxx
@@ -128,8 +128,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt )
basegfx::B2DHomMatrix(),
aB2DPolyLine,
0.0,
- // tdf#124848 hairline
- basegfx::B2DVector::getEmptyVector(),
+ 0.0, // tdf#124848 hairline
nullptr, // MM01
basegfx::B2DLineJoin::NONE,
css::drawing::LineCap_BUTT,
@@ -241,8 +240,7 @@ void OutputDevice::drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const Lin
basegfx::B2DHomMatrix(),
rB2DPolygon,
0.0,
- // tdf#124848 hairline
- basegfx::B2DVector::getEmptyVector(),
+ 0.0, // tdf#124848 hairline
nullptr, // MM01
basegfx::B2DLineJoin::NONE,
css::drawing::LineCap_BUTT,
diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx
index c742379d39de..60deaceb822c 100644
--- a/vcl/source/outdev/polygon.cxx
+++ b/vcl/source/outdev/polygon.cxx
@@ -96,8 +96,7 @@ void OutputDevice::DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly )
aTransform,
rPolygon,
0.0,
- // tdf#124848 hairline
- basegfx::B2DVector::getEmptyVector(),
+ 0.0, // tdf#124848 hairline
nullptr, // MM01
basegfx::B2DLineJoin::NONE,
css::drawing::LineCap_BUTT,
@@ -215,8 +214,7 @@ void OutputDevice::DrawPolygon( const tools::Polygon& rPoly )
aTransform,
aB2DPolygon,
0.0,
- // tdf#124848 hairline
- basegfx::B2DVector::getEmptyVector(),
+ 0.0, // tdf#124848 hairline
nullptr, // MM01
basegfx::B2DLineJoin::NONE,
css::drawing::LineCap_BUTT,
@@ -326,8 +324,7 @@ void OutputDevice::ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyP
aTransform,
rPolygon,
0.0,
- // tdf#124848 hairline
- basegfx::B2DVector::getEmptyVector(),
+ 0.0, // tdf#124848 hairline
nullptr, // MM01
basegfx::B2DLineJoin::NONE,
css::drawing::LineCap_BUTT,
diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx
index 3e2ed372e01b..d17056d58e13 100644
--- a/vcl/source/outdev/polyline.cxx
+++ b/vcl/source/outdev/polyline.cxx
@@ -71,8 +71,7 @@ void OutputDevice::DrawPolyLine( const tools::Polygon& rPoly )
aTransform,
aB2DPolyLine,
0.0,
- // tdf#124848 hairline
- basegfx::B2DVector::getEmptyVector(),
+ 0.0, // tdf#124848 hairline
nullptr, // MM01
basegfx::B2DLineJoin::NONE,
css::drawing::LineCap_BUTT,
@@ -348,8 +347,7 @@ bool OutputDevice::DrawPolyLineDirect(
aTransform,
rB2DPolygon,
fTransparency,
- // tdf#124848 use LineWidth direct, do not try to solve for zero-case (aka hairline)
- basegfx::B2DVector(fLineWidth, fLineWidth),
+ fLineWidth, // tdf#124848 use LineWidth direct, do not try to solve for zero-case (aka hairline)
pStroke, // MM01
eLineJoin,
eLineCap,
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index a6eaa6b1c3a7..6ade6113fc99 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -1004,7 +1004,6 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, const Point& rEndPos, lo
const basegfx::B2DRectangle aWaveLineRectangle(nStartX, nStartY, nEndX, nEndY + nWaveHeight);
const basegfx::B2DPolygon aWaveLinePolygon = basegfx::createWaveLinePolygon(aWaveLineRectangle);
const basegfx::B2DHomMatrix aRotationMatrix = basegfx::utils::createRotateAroundPoint(nStartX, nStartY, basegfx::deg2rad(-fOrientation));
- const basegfx::B2DVector aLineWidth(nLineWidth, nLineWidth);
const bool bPixelSnapHairline(mnAntialiasing & AntialiasingFlags::PixelSnapHairline);
mpGraphics->SetLineColor(GetLineColor());
@@ -1012,7 +1011,7 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, const Point& rEndPos, lo
aRotationMatrix,
aWaveLinePolygon,
0.0,
- aLineWidth,
+ nLineWidth,
nullptr, // MM01
basegfx::B2DLineJoin::NONE,
css::drawing::LineCap_BUTT,
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index 0cf325d0b40a..e35d4dfbf959 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -269,8 +269,7 @@ void OutputDevice::DrawTransparent(
aFullTransform,
rPolygon,
fTransparency,
- // tdf#124848 hairline
- basegfx::B2DVector::getEmptyVector(),
+ 0.0, // tdf#124848 hairline
nullptr, // MM01
basegfx::B2DLineJoin::NONE,
css::drawing::LineCap_BUTT,
@@ -392,8 +391,7 @@ bool OutputDevice::DrawTransparentNatively ( const tools::PolyPolygon& rPolyPoly
aTransform,
rPolygon,
fTransparency,
- // tdf#124848 hairline
- basegfx::B2DVector::getEmptyVector(),
+ 0.0, // tdf#124848 hairline
nullptr, // MM01
basegfx::B2DLineJoin::NONE,
css::drawing::LineCap_BUTT,
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index 99884a4c0941..ee45815a7c83 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -1582,7 +1582,7 @@ private:
// all other values the triangulation is based on and
// need to be compared with to check for data validity
- basegfx::B2DVector maLineWidth;
+ double mfLineWidth;
basegfx::B2DLineJoin meJoin;
css::drawing::LineCap meCap;
double mfMiterMinimumAngle;
@@ -1592,7 +1592,7 @@ public:
SystemDependentData_Triangulation(
basegfx::SystemDependentDataManager& rSystemDependentDataManager,
const basegfx::triangulator::B2DTriangleVector& rTriangles,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
basegfx::B2DLineJoin eJoin,
css::drawing::LineCap eCap,
double fMiterMinimumAngle,
@@ -1600,7 +1600,7 @@ public:
// read access
const basegfx::triangulator::B2DTriangleVector& getTriangles() const { return maTriangles; }
- const basegfx::B2DVector& getLineWidth() const { return maLineWidth; }
+ double getLineWidth() const { return mfLineWidth; }
const basegfx::B2DLineJoin& getJoin() const { return meJoin; }
const css::drawing::LineCap& getCap() const { return meCap; }
double getMiterMinimumAngle() const { return mfMiterMinimumAngle; }
@@ -1614,14 +1614,14 @@ public:
SystemDependentData_Triangulation::SystemDependentData_Triangulation(
basegfx::SystemDependentDataManager& rSystemDependentDataManager,
const basegfx::triangulator::B2DTriangleVector& rTriangles,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
basegfx::B2DLineJoin eJoin,
css::drawing::LineCap eCap,
double fMiterMinimumAngle,
const std::vector< double >* pStroke)
: basegfx::SystemDependentData(rSystemDependentDataManager),
maTriangles(rTriangles),
- maLineWidth(rLineWidth),
+ mfLineWidth(fLineWidth),
meJoin(eJoin),
meCap(eCap),
mfMiterMinimumAngle(fMiterMinimumAngle),
@@ -1649,7 +1649,7 @@ bool X11SalGraphicsImpl::drawPolyLine(
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolygon,
double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap,
@@ -1663,7 +1663,6 @@ bool X11SalGraphicsImpl::drawPolyLine(
}
// need to check/handle LineWidth when ObjectToDevice transformation is used
- basegfx::B2DVector aLineWidth(rLineWidth);
const bool bObjectToDeviceIsIdentity(rObjectToDevice.isIdentity());
basegfx::B2DHomMatrix aObjectToDeviceInv;
@@ -1672,9 +1671,9 @@ bool X11SalGraphicsImpl::drawPolyLine(
// the graphic sub-system, but the triangulation data is prepared
// view-independent based on the logic LineWidth, so we need to
// know it
- if(aLineWidth.equalZero())
+ if(fLineWidth == 0)
{
- aLineWidth = basegfx::B2DVector(1.0, 1.0);
+ fLineWidth = 1.0;
if(!bObjectToDeviceIsIdentity)
{
@@ -1684,7 +1683,7 @@ bool X11SalGraphicsImpl::drawPolyLine(
aObjectToDeviceInv.invert();
}
- aLineWidth = aObjectToDeviceInv * aLineWidth;
+ fLineWidth = (aObjectToDeviceInv * basegfx::B2DVector(fLineWidth, 0)).getLength();
}
}
@@ -1727,18 +1726,14 @@ bool X11SalGraphicsImpl::drawPolyLine(
if(pSystemDependentData_Triangulation)
{
// check data validity (II)
- if(pSystemDependentData_Triangulation->getLineWidth() != aLineWidth)
+ if(pSystemDependentData_Triangulation->getLineWidth() != fLineWidth)
{
// sometimes small inconsistencies, use a percentage tolerance
- const double fFactorX(basegfx::fTools::equalZero(aLineWidth.getX())
+ const double fFactor(basegfx::fTools::equalZero(fLineWidth)
? 0.0
- : fabs(1.0 - (pSystemDependentData_Triangulation->getLineWidth().getX() / aLineWidth.getX())));
- const double fFactorY(basegfx::fTools::equalZero(aLineWidth.getY())
- ? 0.0
- : fabs(1.0 - (pSystemDependentData_Triangulation->getLineWidth().getY() / aLineWidth.getY())));
-
+ : fabs(1.0 - (pSystemDependentData_Triangulation->getLineWidth() / fLineWidth)));
// compare with 5.0% tolerance
- if(basegfx::fTools::more(fFactorX, 0.05) || basegfx::fTools::more(fFactorY, 0.05))
+ if(basegfx::fTools::more(fFactor, 0.05))
{
// data invalid, forget
pSystemDependentData_Triangulation.reset();
@@ -1803,7 +1798,7 @@ bool X11SalGraphicsImpl::drawPolyLine(
// aTriangles data (!)
basegfx::utils::createAreaGeometry(
aPolyLine,
- 0.5 * aLineWidth.getX(),
+ 0.5 * fLineWidth,
eLineJoin,
eLineCap,
basegfx::deg2rad(12.5),
@@ -1820,7 +1815,7 @@ bool X11SalGraphicsImpl::drawPolyLine(
pSystemDependentData_Triangulation = rPolygon.addOrReplaceSystemDependentData<SystemDependentData_Triangulation>(
ImplGetSystemDependentDataManager(),
aTriangles,
- aLineWidth,
+ fLineWidth,
eLineJoin,
eLineCap,
fMiterMinimumAngle,
diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx
index 9a4940eab7d0..061993bb80df 100644
--- a/vcl/unx/generic/gdi/gdiimpl.hxx
+++ b/vcl/unx/generic/gdi/gdiimpl.hxx
@@ -171,7 +171,7 @@ public:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon&,
double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin,
css::drawing::LineCap,
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index eeb67195dfb7..3ecbe013a88d 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -702,7 +702,7 @@ bool X11SalGraphics::drawPolyLine(
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolygon,
double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap,
@@ -739,7 +739,7 @@ bool X11SalGraphics::drawPolyLine(
rObjectToDevice,
rPolygon,
fTransparency,
- rLineWidth,
+ fLineWidth,
pStroke, // MM01
eLineJoin,
eLineCap,
@@ -759,7 +759,7 @@ bool X11SalGraphics::drawPolyLine(
rObjectToDevice,
rPolygon,
fTransparency,
- rLineWidth,
+ fLineWidth,
pStroke, // MM01
eLineJoin,
eLineCap,
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index f9bb988047c5..86044621e4ad 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -432,7 +432,7 @@ bool GenPspGraphics::drawPolyLine(
const basegfx::B2DHomMatrix& /* rObjectToDevice */,
const basegfx::B2DPolygon&,
double /*fTransparency*/,
- const basegfx::B2DVector& /*rLineWidths*/,
+ double /*fLineWidth*/,
const std::vector< double >* /*pStroke*/, // MM01
basegfx::B2DLineJoin /*eJoin*/,
css::drawing::LineCap /*eLineCap*/,
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 08c5f7861e8e..b019692726eb 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -2204,7 +2204,7 @@ bool WinSalGraphicsImpl::drawPolyLine(
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolygon,
double fTransparency,
- const basegfx::B2DVector& rLineWidth,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap,
@@ -2218,29 +2218,28 @@ bool WinSalGraphicsImpl::drawPolyLine(
}
// need to check/handle LineWidth when ObjectToDevice transformation is used
- basegfx::B2DVector aLineWidth(rLineWidth);
const bool bObjectToDeviceIsIdentity(rObjectToDevice.isIdentity());
- const bool bIsHairline(aLineWidth.equalZero());
+ const bool bIsHairline(fLineWidth == 0);
// tdf#124848 calculate-back logical LineWidth for a hairline
// since this implementation hands over the transformation to
// the graphic sub-system
if(bIsHairline)
{
- aLineWidth = basegfx::B2DVector(1.0, 1.0);
+ fLineWidth = 1.0;
if(!bObjectToDeviceIsIdentity)
{
basegfx::B2DHomMatrix aObjectToDeviceInv(rObjectToDevice);
aObjectToDeviceInv.invert();
- aLineWidth = aObjectToDeviceInv * aLineWidth;
+ fLineWidth = (aObjectToDeviceInv * basegfx::B2DVector(fLineWidth, 0)).getLength();
}
}
Gdiplus::Graphics aGraphics(mrParent.getHDC());
const sal_uInt8 aTrans = static_cast<sal_uInt8>(basegfx::fround( 255 * (1.0 - fTransparency) ));
const Gdiplus::Color aTestColor(aTrans, maLineColor.GetRed(), maLineColor.GetGreen(), maLineColor.GetBlue());
- Gdiplus::Pen aPen(aTestColor.GetValue(), Gdiplus::REAL(aLineWidth.getX()));
+ Gdiplus::Pen aPen(aTestColor.GetValue(), Gdiplus::REAL(fLineWidth));
bool bNoLineJoin(false);
// Set full (Object-to-Device) transformation - if used
@@ -2340,7 +2339,7 @@ bool WinSalGraphicsImpl::drawPolyLine(
// the back-calculated logical linewidth is already here, just use it.
// Still be careful - a zero LineWidth *should* not happen, but...
std::vector<Gdiplus::REAL> aDashArray(pStroke->size());
- const double fFactor(aLineWidth.equalZero() ? 1.0 : 1.0 / aLineWidth.getX());
+ const double fFactor(fLineWidth == 0 ? 1.0 : 1.0 / fLineWidth);
for(size_t a(0); a < pStroke->size(); a++)
{
diff --git a/vcl/win/gdi/gdiimpl.hxx b/vcl/win/gdi/gdiimpl.hxx
index eb56388ff42d..748afbcf04d4 100644
--- a/vcl/win/gdi/gdiimpl.hxx
+++ b/vcl/win/gdi/gdiimpl.hxx
@@ -129,7 +129,7 @@ public:
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon&,
double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin,
css::drawing::LineCap,
diff --git a/vcl/win/gdi/salgdi_gdiplus.cxx b/vcl/win/gdi/salgdi_gdiplus.cxx
index ce2f2cc69c20..f56a227609f9 100644
--- a/vcl/win/gdi/salgdi_gdiplus.cxx
+++ b/vcl/win/gdi/salgdi_gdiplus.cxx
@@ -41,7 +41,7 @@ bool WinSalGraphics::drawPolyLine(
const basegfx::B2DHomMatrix& rObjectToDevice,
const basegfx::B2DPolygon& rPolygon,
double fTransparency,
- const basegfx::B2DVector& rLineWidths,
+ double fLineWidth,
const std::vector< double >* pStroke, // MM01
basegfx::B2DLineJoin eLineJoin,
css::drawing::LineCap eLineCap,
@@ -52,7 +52,7 @@ bool WinSalGraphics::drawPolyLine(
rObjectToDevice,
rPolygon,
fTransparency,
- rLineWidths,
+ fLineWidth,
pStroke, // MM01
eLineJoin,
eLineCap,
commit 2cdec016bc763f5fc9dede8835c8f45139e811ca
Author: Justin Luth <justin.luth at collabora.com>
AuthorDate: Mon May 4 09:32:16 2020 +0300
Commit: Justin Luth <justin_luth at sil.org>
CommitDate: Tue May 5 20:35:42 2020 +0200
writerfilter: cleanup out-of-order xText <-> xCrsr
This looks mostly like copy/paste proliferation of
a pointless test for xText after it has already
been used.
Since this has already been working for years,
there is no point in testing if xText.is(),
since it would have crashed if it wasn't
during the xCrsr definition.
Change-Id: I6a032c0bdc7bb587f223f191623a2e3885d444bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93412
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f385565c8429..0465981ca6ba 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -467,8 +467,7 @@ void DomainMapper_Impl::AddDummyParaForTableInSection()
{
uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
uno::Reference< text::XTextCursor > xCrsr = xTextAppend->getText()->createTextCursor();
- uno::Reference< text::XText > xText = xTextAppend->getText();
- if(xCrsr.is() && xText.is())
+ if (xCrsr.is())
{
xTextAppend->finishParagraph( uno::Sequence< beans::PropertyValue >() );
SetIsDummyParaAddedForTableInSection(true);
@@ -4828,8 +4827,7 @@ void DomainMapper_Impl::CloseFieldCommand()
if (xTextAppend.is())
{
uno::Reference< text::XTextCursor > xCrsr = xTextAppend->getText()->createTextCursor();
- uno::Reference< text::XText > xText = xTextAppend->getText();
- if(xCrsr.is() && xText.is())
+ if (xCrsr.is())
{
xCrsr->gotoEnd(false);
uno::Reference< beans::XPropertySet > xProp( xCrsr, uno::UNO_QUERY );
@@ -5410,9 +5408,9 @@ void DomainMapper_Impl::CloseFieldCommand()
if (xTextAppend.is())
{
- uno::Reference< text::XTextCursor > xCrsr = xTextAppend->getText()->createTextCursor();
uno::Reference< text::XText > xText = xTextAppend->getText();
- if(xCrsr.is() && xText.is())
+ uno::Reference< text::XTextCursor > xCrsr = xText->createTextCursor();
+ if (xCrsr.is())
{
xCrsr->gotoEnd(false);
xText->insertString(xCrsr, sSymbol, true);
@@ -5485,10 +5483,9 @@ void DomainMapper_Impl::CloseFieldCommand()
uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
if (xTextAppend.is())
{
- uno::Reference< text::XTextCursor > xCrsr = xTextAppend->getText()->createTextCursor();
-
uno::Reference< text::XText > xText = xTextAppend->getText();
- if(xCrsr.is() && xText.is())
+ uno::Reference< text::XTextCursor > xCrsr = xText->createTextCursor();
+ if (xCrsr.is())
{
xCrsr->gotoEnd(false);
xText->insertTextContent(uno::Reference< text::XTextRange >( xCrsr, uno::UNO_QUERY_THROW ), xToInsert, false);
commit b41b339529da0e53af6b300a3faaacd2053c85e2
Author: Aditya <adityasahu1511 at gmail.com>
AuthorDate: Mon May 4 19:30:44 2020 +0530
Commit: Jim Raykowski <raykowj at gmail.com>
CommitDate: Tue May 5 20:34:47 2020 +0200
tdf#118655:Move Wildcard/Comments option above Regular expressions
Place "Wildcard/Comments" option in find and replace dialog above
"Regular expressions" option and the "sounds like (Japanese)"
option in place of the older location of "Wildcard/Comments".
Change-Id: I83dffb0689f128ad31b9223bc98ecc5914e4bf41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93410
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj at gmail.com>
diff --git a/svx/uiconfig/ui/findreplacedialog.ui b/svx/uiconfig/ui/findreplacedialog.ui
index 84863685b070..d57a3e73d76e 100644
--- a/svx/uiconfig/ui/findreplacedialog.ui
+++ b/svx/uiconfig/ui/findreplacedialog.ui
@@ -688,7 +688,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
@@ -847,7 +847,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
@@ -889,7 +889,7 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
+ <property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
@@ -931,8 +931,8 @@
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
commit ebcd29ab3b16ab93a523122a672c5f08fcbce4a0
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue May 5 15:18:40 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue May 5 20:15:02 2020 +0200
remove unused nSearchFamily and nMask members
and so SetSearchMask which doesn't have any effect anymore
Change-Id: I0b7f402ce0317971d5196fc448fe2945a6a292f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93393
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index bb7115b39add..5f6ae38d3ad9 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1961,7 +1961,6 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage(weld::Container* pPage, weld::Dia
if ( pSh )
{
SfxStyleSheetBasePool* pPool = pSh->GetStyleSheetPool();
- pPool->SetSearchMask( SfxStyleFamily::Page );
SfxStyleSheetBase* pStyle = pPool->First(SfxStyleFamily::Page);
OUString aStdName;
diff --git a/include/svl/style.hxx b/include/svl/style.hxx
index 34db45a58792..ea2efab759f4 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -235,8 +235,6 @@ protected:
SfxStyleSheetIterator* GetCachedIterator();
SfxItemPool& rPool;
- SfxStyleFamily nSearchFamily;
- SfxStyleSearchBits nMask;
void ChangeParent(const OUString& rOld, const OUString& rNew, SfxStyleFamily eFamily, bool bVirtual = true);
virtual SfxStyleSheetBase* Create( const OUString&, SfxStyleFamily, SfxStyleSearchBits );
@@ -281,8 +279,6 @@ public:
const OUString &rStyle,
const OUString &rParent);
- void SetSearchMask(SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All );
-
void Reindex();
/** Add a style sheet.
* Not an actual public function. Do not call it from non-subclasses.
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 136941bd3965..18124981f0ba 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -438,7 +438,6 @@ const SfxItemSet& ScHTMLExport::PageDefaults( SCTAB nTab )
// remember defaults for compare in WriteCell
if ( !aHTMLStyle.bInitialized )
{
- pStylePool->SetSearchMask( SfxStyleFamily::Para );
pStyleSheet = pStylePool->Find(
ScResId(STR_STYLENAME_STANDARD),
SfxStyleFamily::Para );
@@ -461,7 +460,6 @@ const SfxItemSet& ScHTMLExport::PageDefaults( SCTAB nTab )
// Page style sheet printer settings, e.g. for background graphics.
// There's only one background graphic in HTML!
- pStylePool->SetSearchMask( SfxStyleFamily::Page );
pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SfxStyleFamily::Page );
OSL_ENSURE( pStyleSheet, "PageStyle not found! :-(" );
if (!pStyleSheet)
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index b5bc2303d0e9..103d05e954de 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -204,7 +204,6 @@ SfxStyleSheetBasePool* ScDocShell::GetStyleSheetPool()
static void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool )
{
- pStylePool->SetSearchMask(SfxStyleFamily::Page);
SfxStyleSheetBase *pStyle = pStylePool->First(SfxStyleFamily::Page);
while ( pStyle )
{
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 3ee7479df5f3..48ee79cafaac 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -369,8 +369,6 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
OUString aStyleName;
sal_uInt16 nRetMask = 0xffff;
- pStylePool->SetSearchMask( eFamily );
-
switch ( nSlotId )
{
case SID_STYLE_NEW:
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 91e833156256..8d6b3976cada 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1511,8 +1511,6 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
// only worry about presentation templates
OUString aName;
SdStyleSheetPool* pSourceStyleSheetPool = static_cast<SdStyleSheetPool*>( pSourceDoc->GetStyleSheetPool() );
- pSourceStyleSheetPool->SetSearchMask(SfxStyleFamily::Page);
- static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->SetSearchMask(SfxStyleFamily::Page);
StyleSheetCopyResultVector aCreatedStyles; // List of created stylesheets
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list