Commit Graph

956 Commits

Author SHA1 Message Date
Stephan Bergmann
bba50dbe7e Fix previous commit for non-MACOSX
Change-Id: I5192d299910120e65ad577fa63846e13a1c31e76
2017-06-30 08:57:26 +02:00
Stephan Bergmann
c6636c588b loplugin:oncevar
Change-Id: I740ccb3335d602d309422ba26913c4503c6345f0
2017-06-30 08:53:03 +02:00
Noel Grandin
5e028ad5dc simplify some string handling in tracing calls
Change-Id: I0fb76562429e691400a02216019c7f96791cf9b3
Reviewed-on: https://gerrit.libreoffice.org/39159
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23 14:38:14 +02:00
Noel Grandin
f9d5da8b49 loplugin:unusedfields in vcl part2
Change-Id: Icd02f63e9738c0bb91348e2084649f9edc281e67
Reviewed-on: https://gerrit.libreoffice.org/38833
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17 15:07:07 +02:00
Tor Lillqvist
d89fa2bd49 Clean up a set of RTL-related comments
It is fairly pointless to have a comment like "--- RTL --- (mirror
mouse pos)" in front of code that obviously is related to RTL anyway,
like "if( AllSettings::GetLayoutRTL() )". Also, the fact that many
comment were exactly the same indicates that they has been added as an
in-line version control change marker.

In other places, comments were informational, but no need for them to
include yet another metasyntax, "--- RTL ---". Just "RTL:" works fine.

Change-Id: I20feef308ed8ac9d32a8bf440fc20b442753c4ff
2017-05-18 08:06:38 +03:00
Noel Grandin
2962ceec4b remove some unnecessary temporary OUStrings
found with:
git grep -nP 'OUString\(\s*\w+\s*\)' | grep -v new | grep -v return

Change-Id: I923109b4339210aed2639e423fbc4d5f19233f02
Reviewed-on: https://gerrit.libreoffice.org/37463
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-11 09:26:28 +02:00
Noel Grandin
185ed3ddb8 teach loplugin:constantparam about simple constructor calls
Change-Id: I7d2a28ab5951fbdb5a427c84e9ac4c1e32ecf9f9
Reviewed-on: https://gerrit.libreoffice.org/37280
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-08 08:29:03 +02:00
Noel Grandin
a334e85a2f clang-tidy readability-simplify-boolean-expr in vcl
Change-Id: I10ad38bcb5b05a754de9a396f4aaa79d97458d6f
Reviewed-on: https://gerrit.libreoffice.org/36930
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25 12:15:17 +02:00
Caolán McNamara
2b83e73fd7 remove freshly unused menu support from src files
Change-Id: I038711a0c4d440d452d5b2ae1bfcba5c9305815b
Reviewed-on: https://gerrit.libreoffice.org/36646
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-19 13:42:07 +02:00
Michael Meeks
6827da5052 vcl: protect Window from exceptions during construction.
Probable fix for:
http://crashreport.libreoffice.org/stats/crash_details/f69188bd-0fdd-4b74-9ec6-35b544cba0c9

Change-Id: I6442451785867f0fc2daf84776118b092d4d6a18
Reviewed-on: https://gerrit.libreoffice.org/36653
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2017-04-19 12:57:55 +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
Michael Meeks
d93b8268da Attempted fix for mirrored geometry crasher.
Only plausible cause is pWindow->GetParent() being null, while
we have a pParent which has to be valid.

http://crashreport.libreoffice.org/stats/crash_details/6161398d-17b6-4a93-aa70-a559efa07868

Code was initially introduced in this form:
	commit 4716735ba7
	Author: Stephan Schäfer <ssa@openoffice.org>
	Date:   Thu Sep 19 15:46:19 2002 +0000

	#103362# improve positioning and resizing of system windows

No public report, sadly.  And modified by

commit fba46c6efd
Author: Chris Sherlock <chris.sherlock79@gmail.com>
Date:   Mon Feb 3 16:46:04 2014 +1100

    fdo#74424 Use Window::GetOutDev() to access ImplReMirrored()

    Part of the decoupling of Window from OutputDevice. We now get
    he Window's OutputDevice instance and manipulate this. Do not rely
    on the inherited function.

where the GetParent()/pWindow->GetParent() problem surfaces

Change-Id: Ia261028a4719525135e3fe4b00074427c1d9df6c
Reviewed-on: https://gerrit.libreoffice.org/35796
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-03-29 07:57:22 +00:00
Noel Grandin
5a725d1fde loplugin:singlevalfields
Change-Id: I7f05903aaab9b0b274358243d680d0c30694ae61
Reviewed-on: https://gerrit.libreoffice.org/35804
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-29 06:42:30 +00:00
Julien Nabet
7b3825c66e Typos
Change-Id: Id1b96b56b16ebf2d8a99dd6fb64c73906dfd598f
Reviewed-on: https://gerrit.libreoffice.org/35435
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-19 19:24:52 +00:00
Noel Grandin
198c41c4fe new loplugin unoany
Change-Id: I5d6c4a67cb2a09e7cd5bd620c6b262d188701b89
Reviewed-on: https://gerrit.libreoffice.org/34714
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-28 10:17:47 +00:00
Noel Grandin
8c00536d87 Convert WindowType to scoped enum
Change-Id: I85cfe02f28729e13f2c0dd3d91cd89e6f3e3b6a9
Reviewed-on: https://gerrit.libreoffice.org/34219
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-14 10:44:08 +00:00
Noel Grandin
65b7b6322b loplugin:unusedenumconstants read-only constants in vcl
Change-Id: I8c81444cbecdc103cc47d9a4133b0b4d9010e0c2
Reviewed-on: https://gerrit.libreoffice.org/34018
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08 12:42:52 +00:00
Jan-Marek Glogowski
bf110d40ef Change all Idle* LINKs to be Timer*
Seem UBSAN doesn't like my forced reinterpret_cast to set the Idles
Link in the Timer class. Now there are two possible solution:

  1. convert all (DECL|IMPL).*_LINK call sites to use a Timer* or
  2. split the inheritance of Idle from Timer again to maintain
     different Link<>s and move all common code into a TimerBase.

While the 1st is more correct, the 2nd has a better indicator for
Idles. This implements the first solution.

And while at it, this also converts all call sites of SetTimeoutHdl
and SetIdleHdl to SetInvokeHandler and gets rid of some local Link
objects, which are just passed to the SetInvokeHandler call.

It also introduces ClearInvokeHandler() and replaces the respective
call sites of SetInvokeHandler( Link<Timer *, void>() ).

Change-Id: I40c4167b1493997b7f136add4dad2f4ff5504b69
2017-01-23 20:49:05 +01:00
Jan-Marek Glogowski
59b84bc78d Change Idle to be a Timer subclass
Drops a lot of duplicated code, as Idle is just a convenience
class for instant, mostly low priority timers.

Change-Id: I847592e92e86d15ab1cab168bf0e667322e48048
2017-01-17 16:22:57 +01:00
Jan-Marek Glogowski
fdc612619c Refactor Scheduler to add Task class
Moves all the "task-specific" stuff into a Task class and just
keeps the "real" static Scheduler functions in the original
Scheduler class.

Change-Id: I9eb02d46e2bcf1abb06af5bab1fa0ee734d1984c
2017-01-17 16:08:47 +01:00
Michael Meeks
61aa97c1be vcl: hold VclPtrs to avoid possible lifecycle related crashers.
Makes code on common EnableInput crash reporter trace safer.

Change-Id: Ibcf218d0d2460383d12e19f48aaf0ab08e541532
Reviewed-on: https://gerrit.libreoffice.org/32706
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2017-01-04 08:24:51 +00:00
Caolán McNamara
dd801a6231 coverity#1398232 Uninitialized scalar field
Change-Id: Ia5e9ebecc032e59bf98d32b0de0f11617da8b2ba
2016-12-31 14:36:28 +00:00
Jan-Marek Glogowski
35816ab0af Move ImplFrameData initialization into constructor
Change-Id: Id918ae46ed521fca5675845b2eb9cd26a8c7ebbb
2016-12-20 14:19:19 +01:00
Noel Grandin
d15b4e2045 teach sallogareas plugin to catch inconsistencies
Change-Id: I8bcea5ffc74d48148bea78da8c17744e288c069a
Reviewed-on: https://gerrit.libreoffice.org/32004
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-15 06:45:14 +00:00
Noel Grandin
2d48f5fc0a convert VCLEVENT constants to scoped enum
Change-Id: Ic8ccb0a9715ec05182dacddab2c015b0de6a0fba
Reviewed-on: https://gerrit.libreoffice.org/31675
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-07 07:10:39 +00:00
Noel Grandin
cc719ad619 convert IMPL_PAINT constants to typed_flags
Change-Id: I9a38a2927cc626e3a94c9eeaffb94b7fd2b6204c
Reviewed-on: https://gerrit.libreoffice.org/31634
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-06 05:32:06 +00:00
Michael Meeks
115671bf92 tdf#101327 - tolerate exceptions during window construction better.
It appears we can end up being a frame window, which is not added
into the list of frames; so tolerate that.

Change-Id: I7696e79636f7794f327027f0ca73363eef1937e5
Reviewed-on: https://gerrit.libreoffice.org/31235
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-11-26 22:23:29 +00:00
Michael Stahl
6bb20609a2 vcl: rename Window::Notify to EventNotify
There is annoying overloading between Window::Notify and
SfxListener::Notify, and the Window one has apparently fewer
implementations, so rename that and remove lots of disambiguating
"using Notify" in multiply inheriting classes.

Change-Id: I8b597fd9e70cf2e7103b9dfa7cc666e79e7aff49
2016-11-24 22:56:34 +01:00
Tomaž Vajngerl
69b6ab1f8d tdf#100164 change scaling unit to precentage for *.5x factors
Currently we support DPI scaling by a integer factor. This commit
changes that to percentage so we can have scaling factors like
1.5x or 1.25x. This is useful with 2.7k monitors that are in
between standard DPI and HiDPI. Thresholding was adjusted to scale
to 1.5x when DPI is between 120 and 168 DPI.

The old method GetDPIScaleFactor has been changed to return a
float value insted of int. Sometimes it is however more accurate
to use GetDPIScalePercentage which was added in this commit.

Change-Id: Iaecee793ff3d5084d00adeebbcf5d7368c580882
Reviewed-on: https://gerrit.libreoffice.org/30379
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-10-29 21:47:41 +00:00
Noel Grandin
eca5ea9f79 make the AbstractDialog stuff extend from VclReferenceBase
Because some stuff wants to multiple-inherit from VclAbstractDialog and
OutputDevice-subclasses, and we'd prefer to keep all the lifetime
management through a single smart pointer class (VclPtr)

The change in msgbox.cxx and window.cxx is to workaround a bug in
VS2013 to do with virtual inheritance and delegating constructors.

Change-Id: I178e8983b7d20a7d2790aa283be838dca5d14773
Reviewed-on: https://gerrit.libreoffice.org/29140
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-27 06:08:30 +00:00
Caolán McNamara
c1448b4286 no raw Window is loaded from .src anymore
Change-Id: I81e4bb23f4a819f59115cdf58afe19097b4ce68f
2016-10-25 11:41:23 +01:00
Caolán McNamara
637587fc8f drop unused argument
Change-Id: I54a86f98289877abc435e2c7397ff5fd6c516545
2016-10-12 11:38:00 +01:00
Noel Grandin
954f752cf1 convert MapUnit to scoped enum
I left a prefix on the names "Map" so that I would not have to re-arrange
each name too much, since I can't start identifiers with digits like "100thMM"

And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore.

Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224
Reviewed-on: https://gerrit.libreoffice.org/29096
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-05 06:51:20 +00:00
Noel Grandin
702496391b loplugin:constantparam in vcl..xmlscript
Change-Id: Icf66c08071b154259c9e551342d30331caf2b15a
Reviewed-on: https://gerrit.libreoffice.org/28685
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-07 06:48:56 +00:00
Noel Grandin
a881fd7e66 convert RasterOp to scoped enum
Change-Id: I136423c105316c9b5b18e64d04a248fd7ac5590b
2016-09-05 08:21:46 +02:00
Caolán McNamara
9a40590d0c this 0x4000 means KEY_MOD2
Change-Id: Id260c776241cfa5af35c51ccee7ba6942a353f8d
2016-07-29 12:20:49 +01:00
Samuel Mehrbrodt
cec4c3c563 vcl: Guard against invalid states
Got crashes here in 5.0, seem to be gone in master, but better be safe
than sorry

Change-Id: I434800f0e4a465233024b6a1ae1f48b010319f5c
Reviewed-on: https://gerrit.libreoffice.org/27594
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2016-07-28 06:24:03 +00:00
Caolán McNamara
4bc99ab1ac ditch the multiply dialog width * X where X is based on language thing
Which should be unnecessary since the vcl layout work and optimal size widgets,
and its a small and arbitary set of languages for which its set.

Change-Id: Ifa397218510ade251f795cdd9360d6bdccb115b7
2016-07-10 19:12:39 +01:00
Caolán McNamara
ec950f8ebb ditch the font/screen-scaling thing
its of limited utility wrt the vcl layout work and optimal size widgets,
and its confuses people looking for hidpi settings

Change-Id: I37d21b480446f9fe2845b3a2d9fd59cdeddf1a93
2016-07-10 19:12:39 +01:00
Stephan Bergmann
69257ddb57 loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: Ia113176ebeca497c557ace01408467b17bcdfe31
2016-07-07 18:59:55 +02:00
Noel Grandin
1ac18c60bb loplugin:singlevalfields in vcl(part2)
Change-Id: I4782c6f6d3d090ba0f9e29af8afdd7d88aa2d382
Reviewed-on: https://gerrit.libreoffice.org/26598
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-27 05:16:59 +00:00
Noel Grandin
cf5208b671 Convert PART to scoped enum
Change-Id: If4c2849beb207593d3d450ae3846ed24eaf66ca4
Reviewed-on: https://gerrit.libreoffice.org/26173
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-20 09:33:49 +00:00
Markus Mohrhard
ce6285889a uitest: don't use WindowUIObject if not necessary
Change-Id: Iff31ce674651cb2a6150dd9a0822bfbf8f0b5aea
2016-06-18 17:01:52 +02:00
Markus Mohrhard
073c47e371 uitest: move declaration for the uitesting wrapper objects to include/ dir
This allows non-vcl wrapper objects to inherit from the vcl base
classes. This is especially important for the WindowUIObject base class
object.

Change-Id: I91ef69839ff4c031d3bcd21d70b4b9e7d62ad572
2016-06-18 17:01:51 +02:00
Markus Mohrhard
77dd7f8291 uitest: a slightly better approach for the factory problem in the ui testing
Change-Id: I15dbf2446791c4be9be4e18e63c0d03104d8d405
2016-06-18 17:01:50 +02:00
Markus Mohrhard
5bdc19ef7b let us not call getenv for each window
Change-Id: I26c34e9fa4efa34ac47343b4c0894c23bba0c13f
2016-06-18 17:01:48 +02:00
Markus Mohrhard
dde9b4d86f uitest: some more work for the UI testing
Change-Id: I79193190f8f614b2d6a71032f05a0518eb9d1a1d
2016-06-18 16:59:48 +02:00
Markus Mohrhard
af5b008623 uitest: store the id of each vcl::Window
We will use the ID in the UI testing to identify the widget.

Change-Id: I4dd79a02355e1de40f3c2ddc6a61a805b4e30778
2016-06-18 16:59:48 +02:00
Noel Grandin
9c79945ca6 convert DBG_ASSERT in vcl
Change-Id: I732fb1a789f90ca7a7f393cc41a6afe84fecf3d3
Reviewed-on: https://gerrit.libreoffice.org/26200
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-17 06:38:57 +00:00
Caolán McNamara
bdfccfde30 crashreport: 644837b5-c445-4779-a75d-dd69fc2e3a6f
drop hint of previous window to get mouse wheel event
when that window is disposed in order to drop any
references to it immediately that happens to avoid
anything else lingering too late

move the VclPtr into ImplSVData alongside the rest
of the things like this so we can remove the over-the-top
DeleteOnDeinit which itself replaced a relatively harmless
static Window*

Change-Id: I1e172071b711b6e4ded9a813ee3de730d3dfdf38
2016-06-15 21:12:34 +01:00