Commit Graph

9143 Commits

Author SHA1 Message Date
991fb39367 coverity#735653 avoid division by 0
Change-Id: Ie3ec074292467f096e69142dc599b0e29e1e7f7b
2014-10-17 14:06:26 +02:00
3dcbcd120c coverity#735654 avoid division by 0
Change-Id: If368d300c5ed880e1359cbc67df0e13b00fc6ecf
2014-10-17 14:06:25 +02:00
0cb6cb0690 coverity#735655 avoid division by 0
Change-Id: I5eeb4cbcaa19bdf9bcafc3830447468dd8dc5c8c
2014-10-17 13:54:49 +02:00
ecbc1865ce coverity#1209374 avoid division by 0
Change-Id: I6728c0f79e0091b88b3269f5b8b25d27c82d9761
2014-10-17 13:44:38 +02:00
582ef22d3e fdo#84854 it seems long is not enough on 32 bit
Fraction used BigInt internally for computations, rational does nothing
like that.

Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
2014-10-16 17:44:44 +02:00
39428437d5 Related: fdo#84676 try to give floating windows their original stylebits
as they were before becoming .ui components to see if that makes
a difference here

Change-Id: I1699e19f14b18579f6b8c973d64f069b206b7cb8
2014-10-16 15:31:35 +01:00
07f9ccf99c fdo#75757: remove inheritance to std::vector
from TEParaPortions (through ToolsList, close to be deleted ;).

Change-Id: Iec92ebb54ebc44d94ccc8cb30230ffb44b937b35
Reviewed-on: https://gerrit.libreoffice.org/11954
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-10-15 19:35:54 +00:00
44add3e1f1 coverity#704088 Unchecked return value
Change-Id: I0fc00b445db0a6254adbfa335e6971c6787109d5
2014-10-15 16:56:56 +01:00
eea16cb3e6 Resolves: #i63015# always default to WinAnsiEncoding...
for non-symbol PDF-Type1 export

Suggested-By: edv@gruene.de
Reviewed-By: hdu@apache.org
(cherry picked from commit b8186703cb43d2b57460cb23a7a4e3f989e95426)

Conflicts:
	vcl/source/gdi/pdfwriter_impl.cxx

Change-Id: I02227724bff301133ac8ce5562ec5ca1ed94f136
2014-10-15 13:53:41 +01:00
e45136f1ff Resolves: fdo#85032 max len property of -1 -> crash
Change-Id: Ief903c619204f01784e93fd5e2d582632cef032e
2014-10-15 13:49:09 +01:00
d9fa1247be fdo#84938: replace SYMBOL_TYPE constants with enum
Change-Id: Ib3763f20d74c22e28d519a9ac47f6f3ab4e31f51
Reviewed-on: https://gerrit.libreoffice.org/11983
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-15 10:13:04 +00:00
d2ccf8434a vcl: re-factor scaling to use a single fn. pointer based invocation.
Change-Id: Ide61808dbfa82ce67794150f44b6bac4f3c8e302
2014-10-14 20:13:55 -03:00
618c0f8fd8 vcl: Re-factor to use the ScaleContext to pass parameters.
Change-Id: If4359a6b776b4a94a6934e9fd02ede475a0612a7
2014-10-14 20:13:55 -03:00
a70d6e7318 vcl: create a ScaleContext to share copy/paste Bitmap scaling code.
Change-Id: I5a90b7c6065829d74c61b833f0551b8adc3f2711
2014-10-14 20:13:54 -03:00
6786f4b595 vcl: hide bitmap helpers in an anonymous namespace.
Change-Id: I96ad50f538cfb6ecd256c4268feb81796a135b2b
2014-10-14 20:13:54 -03:00
616445cde0 vcl: warning C4717: GetCharCount() recursive on all control paths
Change-Id: Id86dcd2c701510ce15cc2cf71e35c1d908ec6049
2014-10-14 15:07:14 +02:00
affd907cb4 valgrind + bff, multiple failures, initialize ref counts to 0...
for boost::intrusive_ptr

==6595== Conditional jump or move depends on uninitialised value(s)
==6595==    at 0xB21664D: intrusive_ptr_release(FontCharMap*) (metric.hxx:226)
==6595==    by 0xB2172F6: boost::intrusive_ptr<FontCharMap>::~intrusive_ptr() (intrusive_ptr.hpp:97)
==6595==    by 0xB5AE196: FtFontInfo::GetFontCharMap() (gcach_ftyp.cxx:1287)

Change-Id: Iea5ab13b093945c840481f29bc626a16dcbc234b
2014-10-13 20:59:22 +01:00
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
f6d61562d4 vcl: Make ImplFontCharMap a pImpl and move functions to FontCharMap
To do this, I've made FontCharMap a friend class for ImplFontCharMap,
and have moved the functions directly into FontCharMap. In this patch,
I am attempting to stop the direct use of ImplFontCharMap by anything
other than FontCharMap. However, FontCharMap itself requires a
refcounter, so we will use FontCharMapPtr to access the font character
map.

Change-Id: I509b990a8cbd911c5cc1572c7d24fc5348ca06d9
Reviewed-on: https://gerrit.libreoffice.org/11823
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-10-13 09:19:04 +00:00
9863f7db91 coverity#735621 Division or modulo by zero
Change-Id: Ic92bb6946495124d50e57c2c84995cae6465af92
2014-10-11 17:33:53 +01:00
41df2c5c8b coverity#1242425 Dereference after null check
Change-Id: I638d1601ac6cb5e43ee60f60869f6128060e6d05
2014-10-11 17:33:48 +01:00
cb7ede2d99 convert vcl StateChangedType to enum class
Change-Id: Ifa46523619ae7fb8d112525b8df594836e51bb8f
Reviewed-on: https://gerrit.libreoffice.org/11843
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-11 15:14:32 +00:00
cd86543fd4 coverity#1242714 Untrusted value as argument
Change-Id: I1524722feae3ad9f67627cb34dec83632edefec4
2014-10-10 18:14:36 +01:00
6ec9b3a630 coverity#1244944 experiment to silence Untrusted loop bound
there's a warning for nPolygonCount but none for nPointCount. I wonder
what happens if I tweak the code like this

Change-Id: I7e1b02c4790f6b2d1c59e38de1a6a0b17a0485b1
2014-10-10 18:14:36 +01:00
03327cbd66 coverity#1242439 ALPHABITS == nAlphaShift == 8
Change-Id: Ifde395113524df03a2523115ab2234403d405455
2014-10-10 12:50:19 +01:00
0430168696 drop unused ImplBlendLines template
Change-Id: Id680f6031d40f086e74472d14fbf70cbf8cc43a1
2014-10-10 12:50:18 +01:00
53c836701e Fix fdo#84795 Menu, DropDown-List not disappears with right mouse click
Set for menu and float-list-box the PopupModeFlags to
FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK + FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE

Improving the comments

Change-Id: I313e4ec38637fa3d46567e08bdb9560ce8475b6a
Reviewed-on: https://gerrit.libreoffice.org/11881
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-10-10 10:09:44 +00:00
27ff44965e convert BKMODE #defines to 'enum class'
mostly to get the TRANSPARENT #define out of the global namespace

Change-Id: Iec592d26d4d12b5f30f7f9a04dd377a1fb20d643
2014-10-09 14:49:53 +03:00
47a2d7642d fdo#81356: convert Fraction to boost::rational<long> - wip
* Added rational util functions used by Fraction class not
  available in the boost::rational class.
* Replaced usage of Fraction by boost::rational<long>
* Removed code that relies on:
  1. fraction.IsValid() -- rational only allow valid values, ie
     denominator() != 0
  2. rational.denominator() == 0 -- always false
  3. rational.denominator() < 0 -- always false but implementation
     detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
* Simplified code that relies on:
  1. rational.denominator() != 0 -- always true
* BUGS EXIST because Fraction allows the creation of invalid values but
  boost::rational throws the exception boost::bad_rational

Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9
Reviewed-on: https://gerrit.libreoffice.org/11551
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-09 11:33:33 +00:00
3144b8deaf Resolves: fdo#84809 crash when button is too short for text
regression from 4c539fac018dfd44cd8db52161a8cb930c627da7

commit 4c539fac018dfd44cd8db52161a8cb930c627da7
Date:   Tue Dec 17 05:18:35 2013 -0600
    vcl get rid of xub_StrLen and STRING_LEN in outdev3

before this there was a dubious cast which hid the problem

Change-Id: I7c01c0f0ac211196a62acaf02297f29ae829403d
2014-10-09 11:15:24 +01:00
9df8d2a922 coverity#704183 Resource leak in object
Change-Id: I64b995c15a83d71aaa6745323141e71cc55cf000
2014-10-08 20:45:15 +01:00
6707c7514d coverity#1066165 Resource leak
no close on error paths

Change-Id: Ie544bcd6ea7224bee2a092013a589c509d42c735
2014-10-08 20:45:14 +01:00
31d2f8ab0f coverity#1000506 Unchecked return value
Change-Id: I71e824e7f0e279582f12d5cb9443a4177551a705
2014-10-07 21:05:17 +01:00
4b7b013491 Resolves: fdo#44998 crash when opening context menu of a field
If you right click on a field in an inactive text box, then a mouse down,
context command, mouse up sequence is sent. The mouse up is supposed to be
captured by the context menu here. But it doesn't because the mouse down in
draw sends an artificial mouse down to the editengine which eventually sets up
a MouseCapture window so the context menu doesn't get considered (because it
occurs before the capture window is released) so the mouse up gets send to sd
while the context menu is up and that causes all sorts of havoc.

Change-Id: If3b7c501586f8561be484d0828c630d84644f770
2014-10-07 16:55:08 +01:00
445336074c Remove pointless commented-out 'virtual' keywords
Nobody knows any more what such a metacomment was supposed to mean, if
it had any deeper meaning at all.

Change-Id: Iefb4fedc7b833c09ee0e39b3eb28202229323ef2
2014-10-06 22:39:18 +03:00
8f436d3de7 use comphelper::rng::uniform_*_distribution everywhere
and automatically seed from time on first use

coverity#1242393 Don't call rand
coverity#1242404 Don't call rand
coverity#1242410 Don't call rand and additionally allow 0xFF as a value
coverity#1242409 Don't call rand
coverity#1242399 Don't call rand
coverity#1242372 Don't call rand
coverity#1242377 Don't call rand
coverity#1242378 Don't call rand
coverity#1242379 Don't call rand
coverity#1242382 Don't call rand
coverity#1242383 Don't call rand
coverity#1242402 Don't call rand
coverity#1242397 Don't call rand
coverity#1242390 Don't call rand
coverity#1242389 Don't call rand
coverity#1242388 Don't call rand
coverity#1242386 Don't call rand
coverity#1242384 Don't call rand
coverity#1242394 Don't call rand

Change-Id: I241feab9cb370e091fd6ccaba2af941eb95bc7cf
2014-10-06 14:13:27 +01:00
2d8f396d12 Don't unintentionally unload the tk library
Fixes the root cause for the crashes in vcldemo and ui-previewer that
indirectly were fixed by 0b7631bccb2a47ab71a0c1edbabe8a5892ff5f9c and
f5cfed29b05184894ec6ad2d14f73bff0b5a2783. Those two commits are now reverted.

Change-Id: If5dac37f032d2b74c977562c339e9799bbc4454c
2014-10-06 12:38:50 +03:00
0096426086 WaE: implicit conversion of NULL constant to 'nullptr_t'
Change-Id: I93b22ce863294312d323184afdfe46f5a448375e
2014-10-06 08:44:33 +03:00
9177329a42 vcl: FontCharMap to use intrusive_ptr ImplFontCharMap
ImplFontCharMap was using it's own reference counting mechanism,
however we can use intrusive_ptr more effectively.

Added a unit test around FontCharMap.

Change-Id: Ifab6ce002fd1df8feb7e017dea3012ff9ea7f18a
Reviewed-on: https://gerrit.libreoffice.org/11804
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-10-06 00:13:38 +00:00
605dc6596a coverity#1208996 Unchecked return value
Change-Id: I02e79ddeefa3961ab7adeb71fbc57bfd0cbe02a8
2014-10-05 13:26:11 -05:00
ced24ffba2 coverity#1242365: Unchecked return value
Change-Id: Iddb8b1bad29bf372f9485514e2cde195237e3cc3
2014-10-04 15:08:14 -05:00
9ae4b6b996 coverity#1242366: Unchecked return value
Change-Id: I3f3b5b5a7ce5e387dc2acddc086d9f8a2fa2b12b
2014-10-04 15:08:14 -05:00
ad5e8b30ac fix for invalid dynamic_cast
after my loplugin-cstylecast commits.
this is a follow on to the bug reported in fdo#84608

Change-Id: Icc4f4baf3690e939c07a71a949200270bf1f4614
2014-10-04 20:13:07 +02:00
d244a0c1af vcl: remove FontRefCount typedef
There is honestly no real need for FontRefCount. I really cannot see
why this typedef was ever introduced into the codebase

Change-Id: Ifa24a95cf6c788b4b11a4425520a2f6bc0e61169
2014-10-04 15:32:54 +10:00
24fb87501e Resolves fdo#84608: Right-click customize crashes LibO
Regression from 26f2da07b1c6074e519d28557a3d1d5518ff6cb4

Change-Id: I382c4686b5fff0c04bdb36f1859c8ea5b2424772
2014-10-03 22:49:36 +02:00
575c372fb9 coverity#1242968 Unused value
Change-Id: I1cd88014175fe061d4db291b8d1430897c2c0084
2014-10-03 16:30:26 +01:00
c7ee74ceda coverity#1093225 Dereference after null check
Change-Id: I34a7b79b4a7b5d86c3d39fd995ed3bd998eeeab8
2014-10-03 09:07:56 +01:00
d2cf2d813b coverity#1242507 silence Arguments in wrong order
Change-Id: Ice857b6f97f1ac3f720226aa90392fb6e9229869
2014-10-02 14:49:09 +01:00
ba8469f6ef coverity#1242494 Resource leak
Change-Id: I4956890da9978381e2de7e8b1af37495884d4965
2014-10-02 14:49:04 +01:00
fba7c60298 coverity#1242840 Unused value
Change-Id: Ic702d371998d5d6b49f1c27fe80b3651e8135993
2014-10-02 14:48:56 +01:00