Commit Graph

288 Commits

Author SHA1 Message Date
a69f8ea61c vcl: convert push flags to type-safe enum-like class
Change-Id: Ib49a0dd5ecee0225f51bea2ff1c0ab5326595a47
2014-08-21 09:17:32 +02:00
794d5ac4ac vcl: use enum for complex text layout constants
Since these constants are bitfield flags, we define some methods to make
working with them reasonably type safe.

Move the definitions to outdevstate.hxx, since we need the values there,
and that appears to be the "root most" header file.

Also dump TEXT_LAYOUT_BIDI_LTR constant, since it means the same thing
as TEXT_LAYOUT_DEFAULT (ie. 0), and leaving it in causes people to write
weird code thinking that it's a real flag.

Change-Id: Iddab86cd6c78181ceb8caa48e77e1f5a8e526343
Reviewed-on: https://gerrit.libreoffice.org/10676
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-08-20 09:01:26 -05:00
43b39d3e47 check that AddToTable can be done validly
Change-Id: I0ee69279e3bb1d9871feba17b908b8307f0ec5b4
2014-08-17 16:24:44 +01:00
b9623def05 blank out the remainder of the buffer
Change-Id: I33b6c2ab1068b7138ce99239f56552529d5206f5
2014-08-17 16:24:44 +01:00
ddc178e07d valgrind + bff: don't add 0xffff oldcode
Invalid read of size 1
   at 0x9DC6247: GIFLZWDecompressor::AddToTable(unsigned short, unsigned short) (decode.cxx:117)

Change-Id: I9cea8dcd4a5eeaa1e793b9be96f82854b9d088af
2014-08-13 09:16:09 +01:00
e5e24bdc33 coverity#1202907 Uninitialized scalar variable
Change-Id: I8cec0ea104fedfd7d89ac91a5b7f395246da8db0
2014-08-07 18:00:45 +01:00
cd3d26b7ed vcl consitent use of long for corrdinate
most of length in vcl are calculated in 'long'
but array of X position tend to be in sal_Int32.
As a prep work to be able to support 'double'
as the base type of Device Coordinate, harmonize
the use of 'long' for non-float coordinate.

Change-Id: I7cb33301ff6a5e2c62247b36a4e07e168a58a323
2014-07-20 22:10:59 +02:00
8f705df122 bnc#881024 Don't world transform font size in WMF/EMF import
Change-Id: Ia865b84ee2b159ff7251ab5a769a2b635dd2a1ea
2014-07-20 21:02:49 +02:00
dac4ca5f68 new loplugin: externalandnotdefined
Find "missing headers," where a function is declared directly in the
.cxx (as extern) and not defined, and should arguably instead be declared
in an include file.

Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2
2014-07-11 14:12:25 +02:00
e50ef195bc New loplugin:stringconcat
Change-Id: Id7c517fb37bc28797c45fc0dde83e866f2aa4aac
2014-07-01 15:45:52 +02:00
290b7e0632 remove use of register keyword in C files
C compilers have been ignoring it for the last decade

Change-Id: I42918263121dd189bab9d27077798b779b9e8da1
Reviewed-on: https://gerrit.libreoffice.org/9873
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-06-24 15:30:16 +00:00
3e82897353 improve the inlinesimplememberfunctions clang plugin
Change-Id: I6d5a952901648e01904ef5c37f953c517304d31e
2014-06-17 10:55:17 +02:00
17b1cf0a03 loplugin:staticcall
Change-Id: I16195f2278ae67f17db55e02bb38fe3c5cd063be
2014-06-13 17:54:36 +02:00
184a00b962 loplugin: inlinesimplememberfunctions
Change-Id: I42119f656ca528286fb25d2d36c0af54b7d04a6b
2014-06-09 10:10:13 +02:00
f3758b71d9 If no bounds can be determined, assume some reasonable defaults
(instead of the twisted huge values with which aBound got initialized)

Change-Id: Ic6fe08639287eb7b5a0520aef8d2a0d43d61c035
2014-06-05 18:32:30 +02:00
90f0af7a9c WMF record size < 3 is clearly broken
...so we should not attempt to (mis-)interpret such broken input.

Change-Id: I97f4f46fdfc0dfe6f9aff42917d23634b844c7f0
2014-06-05 17:36:52 +02:00
53db456c04 Avoid uninitialized memory read/compare on short reads.
Change-Id: I7537f6d22780bace6ab6da06e087a3d27da8de05
2014-06-04 09:45:58 +01:00
6c3245fc69 fdo#68849: Add header guards to all include files
Added header guards to files in directory vcl/

Change-Id: I76ad0c34f2b107d56e92c5a6a8f4c61554c93e2f
Reviewed-on: https://gerrit.libreoffice.org/9597
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-06-01 16:15:36 +00:00
12dd68e3d2 Resolves: #i124717# do not mark *.svm graphic files as *.bmp graphic files
(cherry picked from commit a5cfb91f3dc4b38055fb920f65101cc45d52f8de)

Conflicts:
	svtools/source/filter/filter.cxx

Change-Id: I43f62a453bfa17254cebc07bde95f07f16a329c2
2014-05-23 20:38:13 +01:00
b8624e120e Output record types symbolically in SAL_INFO
Change-Id: I57665f39f9921a11e855d0574f836ef52078660b
2014-05-23 19:59:36 +03:00
47169087c1 Remove unnecessary GZCodec derivation
Change-Id: Id710a1fe4a3c1593add69bb2a7014d26f9499e87
2014-05-21 15:30:16 +02:00
8d54796bf1 enhance pass-by-ref plugin to detect large arguments
Detect arguments larger than 64 chars passed by value.

Change-Id: I9b0ea9ccb99d115984a26eab67c9cf6afd5f6cae
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-05-20 11:17:22 +02:00
fc83bf8bbf fdo#72590 scale or map only when EMR_EXTSELECTCLIPRGN action
Change-Id: Ie42c855e696922b38760876d4090d572deaa689a
2014-05-19 00:01:15 +02:00
10cd55677c vcl wmf: EnhWMFReader more cleanup
Change-Id: Ia6bff28bc70214da965c26cd72ea332573576cc1
2014-05-19 00:01:15 +02:00
e6c5c854d6 vcl wmf: EnhWMFReader constructor, ReadHeader, cleanup
Change-Id: I43b95f3ee7af42b5b1c9110cafbbae325dddb946
2014-05-19 00:01:15 +02:00
8ff29fac52 vcl wmf: cleanup winmtf.hxx
Change-Id: I8d8114378e639438f548b7ee77f8b0ef6275051f
2014-05-19 00:01:14 +02:00
3c1e30b77d Correct common misspellings, and remove some ASCII art along the way.
Change-Id: I42787db31769e8bde984c5f4f0aa90335e889b1c
Reviewed-on: https://gerrit.libreoffice.org/9356
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
2014-05-17 12:38:38 +00:00
1811336b05 wmf: assume WinOrg/ViewportOrg = (0,0) if they are not provided
Change-Id: Ia8a91a565118d102ff769da8bca65f16b5dfece2
2014-05-15 19:51:09 +02:00
154752865f wmf: add SAL_INFOs for interesting things at WMF import
Change-Id: Ic21709896fe156c7393ece54345b00bceb37587d
2014-05-15 19:51:09 +02:00
7da0a6e562 fdo#78603 mixup (Left->Top) in Rectangle construction
Change-Id: I7fa566e036508d43b153c7983dc89fc6660718e7
2014-05-15 19:51:07 +02:00
6a94e8fbcb wmf: put WMFReader constructor out of the header file
Change-Id: I8bf15c9990745759dd1414296257558adf5a42c0
2014-05-15 19:51:07 +02:00
9e5f11aa6e vcl WMF: in non-placable images use SETWINDOW{ORG,EXT} for Bounds
If the image is non-placable the image bounds are bounds of all
elements. Special cases are when both SETWINDOWEXT and SETWINDOWORG
or SETVIEWPORTORG and SETVIEWPORTEXT are available - in those two
cases use those bounds bounds instead.

Change-Id: I60e53cf6c47ccfc0f1139a11a866392f3e8e3ed1
2014-05-15 19:51:06 +02:00
7d69e25354 vcl WMF: some code clean-up
Change-Id: I0b8d433d3d3bf03e3f414b2586a718146380ee2a
2014-05-15 19:51:05 +02:00
618d33c208 fdo#70498 work-around scaling in SetClipPath
Scaling needed to be worked-around again so that the image in the
bug report could be drawn correctly. The issue needs some more
investigation how to detect what are the exact conditions that
scaling is needed.

Change-Id: Icd3f57a8ded92c49848feea92dc5a14362718874
2014-05-15 19:51:05 +02:00
98c55e4c35 WMF: partially revert change as for some documents text is not drawn
revert part of 00e577ac012405f29003533c145bd29d0edbf6db which
causes that the text in some WMF images is not drawn. For example
the document in fdo#56886

Change-Id: I401c702f0567b1f142a82a4417abe719687a86f9
2014-05-15 19:51:05 +02:00
2bd7767d01 Resolves fdo#70681: fixincludeguards.pl: all that's left
Change-Id: I3e51a62710bb46c8255fd228d41d9300c90a1fb5
Reviewed-on: https://gerrit.libreoffice.org/9360
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-05-15 12:50:46 +00:00
867aa217e6 upgrade to jpeg-9a
Includes some type conversion fixes.

Change-Id: I84f886e9f922acd780d46baea97f2d87c5ac700b
Reviewed-on: https://gerrit.libreoffice.org/9306
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-05-11 17:10:33 +00:00
c779eec2e2 coverity#708321 Uninitialized scalar field
Change-Id: Ide820b6648579f8d9cbc395843aff602cf895f15
2014-05-10 21:12:57 +01:00
4f9b21248f simplify ternary conditions "xxx ? yyy : false"
Look for code like:
   xxx ? yyy : false;
Which can be simplified to:
   xxx && yyy

Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d
2014-05-05 12:47:48 +02:00
22f719aa96 coverity#738861 Uninitialized pointer field
Change-Id: I0c39ea58fd1f85471531490401a7b7e8ca7c2a17
2014-05-01 17:19:50 +01:00
09ebcc26f6 coverity#708321 Uninitialized pointer field
Change-Id: Ia08d454e89d4af08b6db171611f14a66e890094b
2014-05-01 17:19:50 +01:00
a9020e4618 fdo#74336 limit the size of the non-placeable WMF image
For a non-placable WMF image the size is unknown and needs to be
calculated by using a bounding box over all elements. Sometimes
this results in a very big image which is not drawn correctly
when using dashes and dots. This change normalizes the size to
reasonable values.

Change-Id: I0e5b71fb011c5a9dff1c5cb13e29d5578570ca65
2014-04-28 17:39:12 +02:00
2ac96e52b0 Revert "fdo#74336 need to transform dash length / dot length / distance"
This reverts commit 17ca93a6e592d3109e47c756fcfe8ac975acae5f.
2014-04-28 17:39:12 +02:00
c7a53e6320 coverity#708319 Uninitialized scalar field
Change-Id: I8f817ba8fc286979f666ad06f4fe21f4703b4652
2014-04-28 10:31:04 +01:00
17ca93a6e5 fdo#74336 need to transform dash length / dot length / distance
Dash length, dot length and distance also need to be world
transformed to be compatible with device metrics.

Change-Id: I57c04f5010006aaf8c1c32e0949cb39b7f2bc67d
2014-04-26 19:28:55 +02:00
927617d69a Renamed ImplGetDPI(X|Y) to GetDPI(X|Y)
Change-Id: If76b99589ddd83431593404c1034b8b726bc3f9b
2014-04-25 12:22:29 +10:00
a85317c67f fdo#77089 if available, use ext. dimensions for non-placable WMF
Change-Id: Idcfaa127ed6abed40d6eec7f81fbbfb36658cc91
2014-04-24 22:51:16 +02:00
0a1e297ac2 fdo#77089 if font width 0, pass 0 - don't take it from font metric
Change-Id: I6c73da1d2470e75774affda836a8d587eebfbe4b
2014-04-24 22:51:15 +02:00
ea9989ad77 wmf: support fat lines for PolyPolygons in wmf filter
Change-Id: I9fe9d7b5237031e3001f64af7001d91fa53f1c64
2014-04-24 22:51:13 +02:00
00e577ac01 wmf: cleanup winmtf.cxx
Change-Id: Ib69a5d651dfffa4ebe4806a1836d78b09103188e
2014-04-24 22:51:13 +02:00