Commit Graph

111 Commits

Author SHA1 Message Date
Noel Grandin
9348b322a5 clang-tidy readability-simplify-boolean-expr
Change-Id: Iea7ab64683f0b29794d50d774cc482b54a00e70a
Reviewed-on: https://gerrit.libreoffice.org/36450
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-28 11:23:34 +02:00
Miklos Vajna
a5a571307f tdf#82580 tools: rename Rectangle to tools::Rectangle
Mostly generated using

make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle"

Except some modules have their own foo::tools namespace, so there have
to use ::tools::Rectangle. This commit just moves the class from the
global namespace, it does not update pre/postwin.h yet.

Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2
Reviewed-on: https://gerrit.libreoffice.org/35923
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-03-31 06:27:11 +00:00
Noel Grandin
f2a873cd13 convert SvxBorderStyle to scoped enum
and rename to SvxBorderLineStyle

Change-Id: I19e530f162e4ca6290a0ad076e7fe3d5775ae6bc
Reviewed-on: https://gerrit.libreoffice.org/35265
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-17 06:04:30 +00:00
Miklos Vajna
578c8dea8e drawinglayer: work around Android build
Change-Id: I9ec4622314bb92cd8c99451c18146dec774a954b
2017-03-14 17:08:03 +01:00
Caolán McNamara
512afb4189 Resolves: tdf#105998 distort hairline borders to fall inside the canvas
if we are a hairline along the very right/bottom edge
of the canvas then distory the polygon inwards one pixel right/bottom so that
the hairline falls inside the paintable area and becomes visible

Change-Id: Ie5713f6916cf5b47fdf14f86f034e38cda9900fd
Reviewed-on: https://gerrit.libreoffice.org/34243
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-13 15:28:18 +00:00
Noel Grandin
f2beebbfe7 reduce copying when decomposing drawinglayer primitives
instead of returning a Primitive2DContainer from each method which we
are then going to immediately append to another container, pass down a
single container by reference which we can append to

Change-Id: I0f28a499d2ec54f7111a7044c30099767aa079e1
Reviewed-on: https://gerrit.libreoffice.org/30258
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-08 10:40:57 +00:00
Noel Grandin
933c0679d6 convert HatchStyle to scoped enum
Change-Id: Ibef51ae5ae135ae584791959ec3f7bf78c50e2a8
2016-09-05 08:21:46 +02:00
Noel Grandin
a881fd7e66 convert RasterOp to scoped enum
Change-Id: I136423c105316c9b5b18e64d04a248fd7ac5590b
2016-09-05 08:21:46 +02:00
Armin Le Grand
4609380bb0 tdf#82214 optimize performance for primitives
See svg bug doc, which is processed quite slowly. Beyond needing faster
renderers, there is also demand to improve the handling of primitives
created by SVG import.

Conflicts:
	drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
	vcl/win/gdi/gdiimpl.cxx

Change-Id: I10992a5746b8b2d6b50e3ee3fe415a035685c9ba
2016-07-07 22:32:39 +02:00
Noel Grandin
4a98af674c Convert HatchStyle to scoped enum
Change-Id: I27878a67457d32e6922dfb6da73f896ff6ab1d01
Reviewed-on: https://gerrit.libreoffice.org/25271
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-23 07:31:31 +00:00
Tor Lillqvist
7671d64307 loplugin:defaultparams
Not necessary to pass this argument, it defaults to the same value.

Change-Id: I090566ebc968c69351cd019e1a5b2b6a0749f03f
2016-04-26 20:10:16 +03:00
Regina Henschel
32cec4ca8b tdf#48066 render stroke-miterlimit correctly in SVG import
The property stroke-miterlimit is transported to the renderers
via a new member mfMiterMinimumAngle in class LineAttribute
Several drawPolyLine methods are adapted. This patch does not
include changes in MetaAction. Presentation mode, printing, and
PDF-export is still wrong.

Corrected LineJoinMiter to LineJoinBevel in canvas, that s closer
to NONE. Removed DrawPolyLine method without MiterMinimumAngle
and adapted calls accordingly.

Change-Id: I6bcd24add5d85c4d9a39e3788e0682091c5fc9c4
Reviewed-on: https://gerrit.libreoffice.org/23946
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2016-04-26 16:42:27 +00:00
Miklos Vajna
422f10c5d7 tdf#99315 VclPixelProcessor2D: fix double border line width
Regression from commit 2c91cb08d6 (better
drawing support for borders of different width, fdo#33634, 2012-04-04),
the problem is that previously the width of inner/outer double border
lines got rounded to integer values quite early, but after the commit
they are kept at a double precision for much longer, which needs pixel
correction in VclPixelProcessor2D.

Example: if the border with is 1.47, and the line gets moved by 0.2
pixels, then the inner and outer edge of the line will be 0.2 and 1.67,
which gets rounded to 0 -> 2 in the pixel processor. Previously the
input was rounded to 1, so moving by 0.2 resulted in 0.2 -> 1.2, which
got rounded to 0 -> 1. The result is that sometimes the line width is 1
pixel wider than expected.

Fix the problem by allowing VclPixelProcessor2D to request pixel
correction from BorderLinePrimitive2D. It wouldn't be possible to do
pixel correction only in VclPixelProcessor2D, as it has no idea what to
correct: it only gets polygons, so it has no idea if e.g. the top of a
polygon is the outer edge of a top border line or an inner edge of a
bottom border line.

Change-Id: I1971f3a952fbcdc598ab46c659e12d976c13cbe6
Reviewed-on: https://gerrit.libreoffice.org/24221
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-18 19:06:39 +00:00
Noel Grandin
789055bc2a clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at
identifying leftover intermediate variables from previous
refactorings.

Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657
Reviewed-on: https://gerrit.libreoffice.org/24026
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 07:37:31 +00:00
Chris Sherlock
a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00
Tor Lillqvist
d612d921a9 Correct claim made in comment
Change-Id: I7adccb1833ad2823ec7fa85f06752614d38639f9
2015-12-15 11:18:28 +02:00
Noel Grandin
58d8d8ac67 tdf#69977: uno::Sequence is expensive
when used as a mutable data-structure. Plain std::vector halves the time
taken to display the chart dialog

Create a class to represent the std::vector we are going to be passing
around, and move some of the utility methods into it to make the code
prettier.
Also create an optimised append(&&) method for the common case of
appending small temporaries.

Change-Id: I7f5b43fb4a8a84e40e6a52fcb7e9f974091b4485
2015-12-11 10:11:23 +02:00
Ashod Nakashian
d7801c3982 Namespace cleanup and disambiguation
Change-Id: Ib6d2f8b4e71436c3a7c26bdfc9847152ebaf0739
Reviewed-on: https://gerrit.libreoffice.org/19900
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-11-12 10:47:26 +00:00
Stephan Bergmann
90122cfb7e loplugin:nullptr (automatic rewrite)
Change-Id: I3aa15efd12b8c9b20319a1975dbbd541783aea2d
2015-11-10 10:31:23 +01:00
Miklos Vajna
b1a9aba3bc svx, drawinglayer: handle tools Color <-> BackgroundColorPrimitive2D roundtrip
Change-Id: Ia8c080ef50e1ddbfce17b5c5d357a240edea46f2
2015-10-02 14:59:15 +02:00
Norbert Thiebaud
ef46917ff3 Put Polygon from tools under tools:: namespace
Polygon is one of these names that Clash with some system objects
A similar work has been done earlier with PolyPolygon.

Change-Id: Icf2217cb2906292b7275760f1a16be0e150312f5
Reviewed-on: https://gerrit.libreoffice.org/17789
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-08-17 02:07:43 +00:00
Andrea Gelmini
69c88a32aa Fix typos
Change-Id: Ifd126a535f18db79a18aaec61b76cdf26ab33dff
Reviewed-on: https://gerrit.libreoffice.org/16522
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2015-06-28 12:28:31 +00:00
Andrea Gelmini
01532b1ab8 Fix typos
Change-Id: I28cfc629dc3d6ef54128615452667ccce86c1072
Reviewed-on: https://gerrit.libreoffice.org/16297
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-16 11:05:58 +00:00
Noel Grandin
456c379ffd convert ANTIALIASING constants to scoped enum
Change-Id: I175b8ea4e8bc01c3cdd3dd90506eba01b35e0085
2015-05-20 09:52:09 +02:00
Noel Grandin
3cbdf64ad5 convert DRAWMODE constants to scoped enum
Change-Id: I36cbe8057d09226f8b302963bdd94dc5600b686f
2015-05-20 09:52:08 +02:00
Tor Lillqvist
43aa19918a Revert "WaE: unused functions"
This needs to be reverted, too.

This reverts commit 734f304842.
2014-11-21 14:54:54 +02:00
Kohei Yoshida
305461aafe Revert "fdo#81643: Regression in rendering of borders"
This reverts commit c35fae3f6b.

One man's feature (with minor issure) is another man's regressions...
2014-11-21 07:19:05 -05:00
Tor Lillqvist
734f304842 WaE: unused functions
Change-Id: I7c91c90341c9aec75c096d400602877f61f04171
2014-11-21 13:46:36 +02:00
Zolnai Tamás
c35fae3f6b fdo#81643: Regression in rendering of borders
Regerssion from:
6a3fb868b2

The new tryDrawBorderLinePrimitive2DDirect() draws rectangles, but
borders are assumed to be trapezoids. So simple comment this
out and use the original drawing method.

Change-Id: I755d5f0b3621bfc4c999ee994a375d4e5ebbcdf0
2014-11-21 12:13:13 +01:00
Chris Sherlock
498a40f339 vcl: Refactor OutputDevice::TryDrawPolyLineDirect()
I've renamed TryDrawPolyLineDirect() to DrawPolyLineDirect() and also
renamed TryDrawPolyLineDirectNoAACheck() to drawPolyLineDirectNoAACheck().
However, at the same time I feel that there is no need to call on
drawPolyLineDirectNoAACheck in most instances, because DrawPolyLineDirect
does an AA check before it can continue anyway. There is one instance where
constantly checking the AA check is inefficient because it's in a loop, in
that case then we call directly on drawPolyLineDirectNoAACheck, but this is
the only case it is necessary.

Change-Id: Ie0320bfc45b5c0e1ac6ce35912da3e2897af9429
Reviewed-on: https://gerrit.libreoffice.org/12190
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-11-02 05:58:52 +00:00
Noel Grandin
af5ebbf783 create a macro library for implementing bit-flags types
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>,
changed from a macro- to a template-based solution.  (Unfortunately MSVC 2012
does not support explicit conversion operators.  Worked around that with
explicit #ifs rather than some HAVE_EXPLICIT_CONVERSION_OPERATORS and
SAL_EXPLICIT_CONVERSION_OPERATOR ainticipating we hopefully soon move to a
baseline that requires unconditional support for them.)

Change-Id: I4a89643b218d247e8e4a861faba458ec6dfe1396
2014-10-13 17:45:57 +02:00
Noel Grandin
c9d4a2887c fdo#82577: Handle PolyPolygon
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows
PolyPolygon typedef.

Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-30 11:47:41 +02:00
Tomaž Vajngerl
6d0005d95f fdo#74336 draw hairline if line width is small
RenderPolygonStrokePrimitive2D draws a simple hairline if the
line width is less than 1.0 (and less than 1.5 if no AA is used)
so in tryDrawPolygonStrokePrimitive2DDirect we need to reflect
this behaviour - otherwise the lines are drawn too small.

Change-Id: Icd3d8f35a00346b1d624b6df010f43ed21968d04
2014-04-26 19:28:55 +02:00
Tor Lillqvist
b78caf9645 Add a couple of SAL_INFOs using drawinglayer::primitive2d::idToString()
Change-Id: I3fce5ca1af15714b8b20b1b273ccf41a49cb98ff
2014-04-11 13:20:17 +03:00
Tor Lillqvist
6835d9f307 It's "its", not "it's"
Change-Id: Ieaa787afd7cc622b4750a2ee8f17f6dad934ba63
2014-04-10 20:22:50 +03:00
Armin Le Grand
6e61ecd096 Merge back branch alg_writerframes to trunk
(cherry picked from commit b635b4fa4e42053d30ab639643d2236a20243f62)

Conflicts:
	comphelper/inc/comphelper/TypeGeneration.hxx
	comphelper/source/property/TypeGeneration.cxx
	cui/source/factory/dlgfact.hxx
	cui/source/inc/cuitabarea.hxx
	cui/source/tabpages/tabarea.cxx
	cui/source/tabpages/tabarea.hrc
	cui/source/tabpages/tabarea.src
	cui/source/tabpages/tparea.cxx
	drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
	drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
	drawinglayer/source/texture/texture.cxx
	editeng/inc/editeng/unotext.hxx
	editeng/source/items/frmitems.cxx
	include/drawinglayer/texture/texture.hxx
	include/editeng/brushitem.hxx
	include/svx/sdr/primitive2d/sdrdecompositiontools.hxx
	include/svx/svxids.hrc
	include/xmloff/xmltypes.hxx
	reportdesign/source/ui/misc/UITools.cxx
	sc/source/ui/drawfunc/drawsh.cxx
	sfx2/source/dialog/tabdlg.cxx
	svl/source/undo/undo.cxx
	svx/inc/svx/unoshprp.hxx
	sw/Library_sw.mk
	sw/inc/doc.hxx
	sw/inc/format.hxx
	sw/inc/frmfmt.hxx
	sw/inc/swatrset.hxx
	sw/inc/unomap.hxx
	sw/inc/unoprnms.hxx
	sw/source/core/access/accpara.cxx
	sw/source/core/attr/format.cxx
	sw/source/core/attr/swatrset.cxx
	sw/source/core/doc/docdraw.cxx
	sw/source/core/doc/docfly.cxx
	sw/source/core/doc/notxtfrm.cxx
	sw/source/core/inc/frame.hxx
	sw/source/core/inc/frmtool.hxx
	sw/source/core/layout/atrfrm.cxx
	sw/source/core/layout/paintfrm.cxx
	sw/source/core/text/inftxt.cxx
	sw/source/core/text/porfld.cxx
	sw/source/core/text/txtfly.cxx
	sw/source/core/txtnode/fntcache.cxx
	sw/source/core/uibase/app/docst.cxx
	sw/source/core/uibase/app/docstyle.cxx
	sw/source/core/uibase/shells/drawdlg.cxx
	sw/source/core/uibase/shells/frmsh.cxx
	sw/source/core/unocore/unoframe.cxx
	sw/source/core/unocore/unomap.cxx
	sw/source/core/unocore/unoprnms.cxx
	sw/source/core/unocore/unostyle.cxx
	sw/source/ui/fmtui/tmpdlg.cxx
	sw/source/ui/fmtui/tmpdlg.src
	sw/source/ui/frmdlg/frmdlg.cxx
	sw/source/ui/frmdlg/frmpage.src
	sw/source/ui/inc/frmsh.hxx
	xmloff/source/text/txtprhdl.cxx
	xmloff/source/text/txtprmap.cxx

Change-Id: Id3ffaa83bb5594d287f1ac8f2c1c9cf55c70946d
2014-03-28 14:31:08 +01:00
Kohei Yoshida
402fffa1b4 Add dash-dot and dash-dot-dot line styles.
We need these for Excel interop.

Change-Id: I91450c1d205f28636edfb4392aa6ae5091b1d7b7
2014-03-19 00:28:16 -04:00
Kohei Yoshida
2c62596cf2 fdo#75260: Correctly draw double lines for both Writer and Calc.
Fix all sorts of incorrect double line handling in drawinglayer in order to
draw thick-thin double line types correctly.  Also change handling of border
lines in writer tables. There are still some outstanding issues but it's
much better than how it was before.

Also realized that Word and Excel handle simple thin double lines differently;
Word varies widths of all of the lines and the gap whereas Excel only has one
fixed size for its double line.  For this reason I decided to add a separate
double line type (DOUBLE_THIN) to handle Excel's double line.

Change-Id: Iaaa353b6e4f998b524262bea59260b4333e0cdb4
2014-03-04 22:02:37 -05:00
Alexander Wilms
d0d1534b6b Remove visual noise from drawinglayer
Change-Id: Ida745b9d994d09081ad3d18cdf2494a97438dc56
Reviewed-on: https://gerrit.libreoffice.org/8253
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2014-02-27 07:10:49 -06:00
Kohei Yoshida
d17c9ee705 fdo#73886: Let's keep the "left" border outer and "right" inner.
This reduces the complexity a bit.

Change-Id: Ieefb57be86e5b66f319920fa61c88d0027c38164
2014-01-22 11:40:20 -05:00
Kohei Yoshida
d19de47c2d fdo#73886: Check the right width in case the left width is zero.
Change-Id: I6a0b1dd7382f1d3c7266ba56dbfdc557737380c2
2014-01-22 09:03:08 -05:00
Kohei Yoshida
15974abe63 fdo#73487: Center thick border lines around cell grid.
This reduces the amount of gap at line joins. Plus it generally looks better
this way.

Change-Id: Ifd21cd0bc1f61f8a875b1bad9cfb33564c18b9ae
2014-01-20 18:39:54 -05:00
Kohei Yoshida
4b2b4133c2 Handle double lines for screen rendering.
Double lines are always drawn as 2 parallel hair lines that are 1 pixel
apart, at any zoom level.

Change-Id: I2796477d0ea45c9880aa8057bd1a10104df96673
2014-01-20 14:37:04 -05:00
Kohei Yoshida
01104522ef Ensure that the pixel line is at least 1 pixel wide.
Without this, some dashed lines may not get drawn at all at some zoom levels.

Change-Id: I273c1548325d14f56618df8ca4166aac58a3ff3f
2014-01-20 14:37:04 -05:00
Kohei Yoshida
41bee5b831 Do the same when the pixel thickness is zero.
Change-Id: Icfbb295abb19cf58477f4f14f4a7294a540151c2
2014-01-20 14:37:03 -05:00
Kohei Yoshida
30f97564f8 Substitute dashed line with a solid line at lower zoom levels.
Change-Id: I0437409b6a5d6163fadf777df5c028950727e786
2014-01-20 14:37:03 -05:00
Kohei Yoshida
ae22838d2f Better on-screen drawing of vertical dashed lines.
Change-Id: I53d5f8b0278d1228cd941221a07cd360943c5ce6
2014-01-20 14:37:03 -05:00
Kohei Yoshida
b3b57c7a3a Same solid line treatment for vertical lines during on-screen drawing.
Change-Id: Idb352dc2afeb2ee7b48620c972c2a186209228ea
2014-01-20 14:37:02 -05:00
Kohei Yoshida
ec1a3157c1 Better pixelization of dashed lines for screen rendering.
Now the dashed lines are evenly placed on screen.  For now, horizontal lines
only.  I'll work on vertical lines later.

Change-Id: I474e9c8214e5f079ea2cfca12b35381d8fcf2ae1
2014-01-20 14:37:02 -05:00
Kohei Yoshida
6a3fb868b2 Draw horizontal solid border lines directly in the pixel processor.
This makes slightly skinnier solid lines which look better on screen.

Change-Id: Ia7764be4a53d1dd6bb60ecb3ba5c8966403e4e6c
2014-01-20 14:37:01 -05:00