Commit Graph

429 Commits

Author SHA1 Message Date
Mike Kaganski
362a21d3a1 Use explicit function names for fooA/fooW WinAPI; prefer fooW
We should only use generic foo function name when it takes params
that are also dependent on UNICODE define, like
LoadCursor( nullptr, IDC_ARROW )
where IDC_ARROW is defined in MSVC headers synchronised with
LoadCursor definition.

We should always use Unicode API for any file paths operations,
because otherwise we will get "?" for any character in path that
is not in current non-unicode codepage, which will result in failed
file operations.

Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633
Reviewed-on: https://gerrit.libreoffice.org/42935
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-30 11:23:41 +02:00
Maxim Monastirsky
10e5729fb0 tdf#106762 Avoid warning when opening and closing the color picker
... from the Drawing toolbar in Impress. The warning was
"DockingWindow has become non-layout because extra children
have been added directly to it.", but this DockingWindow is
actually a ToolBox which set as the parent of the color picker,
although it isn't really a parent in layout terms.

Change-Id: Id1384653ceda938ca0cc300c35467e562984bca1
2017-09-24 15:37:29 +03:00
Noel Grandin
d5329c1531 WB_FORCETABCYCLE is dead
since

    commit 7ced337e1f
    Date:   Tue Jun 18 16:59:27 2013 +0200
    startcenter: GSOC Use Widget Layout for the Start Center

Change-Id: I406059568f15500a21a1b41d3a4b8e12b2adb5cf
Reviewed-on: https://gerrit.libreoffice.org/41385
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-21 21:29:25 +02:00
Noel Grandin
cc903aee97 fix some "deffer" spelling
Change-Id: I8fa9782242e92d754eaa131d424eb0a26f04a319
Reviewed-on: https://gerrit.libreoffice.org/40394
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-25 13:25:59 +02:00
Noel Grandin
f24b46c272 loplugin:unusedfields in vcl
Change-Id: I207866df495ec81bb9288e6d0f664b96d90251d6
Reviewed-on: https://gerrit.libreoffice.org/40217
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-20 13:02:31 +02:00
Noel Grandin
72f36adb93 loplugin:constparams in vcl
Change-Id: I36afe2107e07ffb9b73c0b76be600e3e999a0fd4
Reviewed-on: https://gerrit.libreoffice.org/40116
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18 09:57:26 +02:00
Noel Grandin
4250b25c6a teach unnecessaryparen loplugin about identifiers
Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b
Reviewed-on: https://gerrit.libreoffice.org/39737
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10 09:57:24 +02:00
Noel Grandin
4b2262ab5b new loplugin unnecessaryparen
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec
Reviewed-on: https://gerrit.libreoffice.org/39549
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05 11:08:48 +02:00
Noel Grandin
d2d8592160 loplugin:oncevar in vcl
Change-Id: I37a6dacda12e1c2910737d74aa344c7e2e195aeb
Reviewed-on: https://gerrit.libreoffice.org/39328
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-28 08:55:28 +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
Noel Grandin
8914595d46 loplugin:unusedfields in vcl part1
Change-Id: I67d176003f39992cd0ff9271a7d6ce26d2cb6619
Reviewed-on: https://gerrit.libreoffice.org/38828
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17 15:06:52 +02:00
Noel Grandin
2ccde70d60 teach redundantcast plugin about functional casts
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0
Reviewed-on: https://gerrit.libreoffice.org/37910
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30 08:50:31 +02:00
Jochen Nitschke
b3eb843766 cleanup tools/debug.hxx includes
with command
> git grep -l tools/debug.hxx |
  xargs grep -L DBG_ |
  xargs sed -i '/#include *\(<\|\"\)tools\/debug.hxx.*/d'

don't change files in includes/ and */pch

Change-Id: Ie429d6a7dca5dfa1073e0f5ba037f7c84bdbec08
Reviewed-on: https://gerrit.libreoffice.org/37349
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-08 08:33:01 +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
Noel Grandin
8f254a45d7 loplugin:checkunusedparams in vcl
Change-Id: I26661684e634aa15a18f78442de15c9db832f319
Reviewed-on: https://gerrit.libreoffice.org/36886
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25 07:00:51 +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
Jens Carl
7d98edfa49 tdf#39468 Translate German comments
Translate German comments and terms in dbaccess/, extensions/, formula/,
include/, reportdesign/, rsc/, sd/, svtools/, and vcl/

Change-Id: Ie20dadda0eeb0786eb328c6c652287d5481c5e3b
Reviewed-on: https://gerrit.libreoffice.org/36249
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-04-07 11:15:03 +00:00
Caolán McNamara
18713e5e92 coverity#1403664 Dereference null return value
and

coverity#1403663 Dereference null return value

Change-Id: I17b7f977e802aa5bdc5b58895fe2cdeea2c96ebe
2017-04-01 19:51:19 +01: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
Stephan Bergmann
62b50cb69c ToolBox: Remove dead drag'n'drop "customization" support
There was support for an MOD2+drag operation in ToolBox, apparently intended to
allow customization by re-arranging items.  However, in
ImplTBDragMgr::EndDragging that operation would always have ended in doing
nothing:  Ever since at least 8ab086b6cc "initial
import", what happened was a call to virtual ToolBox::Customize, but which had
an empty body and wasn't overridden anywhere (and has since been cleaned away
over a series of commits).

Change-Id: I8c5962d7b29506dc7dc8d803f49847f30fb93ea1
2017-03-14 15:26:43 +01:00
Stephan Bergmann
3c9b130638 ToolBox::mbCommandDrag is always false now
...after 5ac443e180 "ToolBox::mbCustomizeMode is
always false"

Change-Id: I39bd9d07dfd8dee8e935aa612db35e11022f4ed3
2017-03-14 14:19:20 +01:00
Stephan Bergmann
5ac443e180 ToolBox::mbCustomizeMode is always false
...after b2262e8be3 "callcatcher: remove some
unused methods" (and other clean-up of unused functionality that came before)
identified ToolBox::ImplStartCusomizeMode as unused.

Change-Id: Ic2c6720ca5519842796c7e993064aed637503aa2
2017-03-14 12:20:07 +01:00
Stephan Bergmann
6376d23c51 More ToolBox sal_uInt16 -> ImplToolItems::size_type clean-up
Change-Id: I6ec50033a452493852729dc8efe78da2708cbd96
2017-03-13 22:07:01 +01:00
Stephan Bergmann
9e6b3a07f6 Clean up odd non-static member functions with pThis paramter
...and get member function const'ness right overall

Change-Id: Idb422039108d1dde9f6a8b881f6dff742030f6f0
2017-03-13 18:16:06 +01:00
Stephan Bergmann
6e4d3bad80 Clean up integer types representing positions in ToolBox's item vector
(vs. uses of sal_uInt16 representing such items' IDs).  APPEND and ITEM_NOTFOUND
are members of ToolBox now (and have been bumped to the corresponding type's
max).  The payload of VclEventIds

  ToolboxButtonStateChanged
  ToolboxClick
  ToolboxHighlightOff
  ToolboxItemAdded
  ToolboxItemDisabled
  ToolboxItemEnabled
  ToolboxItemRemoved
  ToolboxItemTextChanged
  ToolboxItemUpdated
  ToolboxItemWindowChanged
  ToolboxSelect

has been changed too (note that reading/writing of those payloads isn't very
consistent, though: for some of these, values are written that are never read,
while for some others no values are ever written but the reading code would like
to receive some value if the payload wasn't a nullptr).

Change-Id: I4856ffb3637404b8d866621a3503d7922b1b8141
2017-03-13 13:48:23 +01:00
Stephan Bergmann
6bf42c1cf0 ToolBox::mnFocusPos is unused
...ever since b8f7708176 "#96972# improved key and
focus handling"

Change-Id: I236143997f6e90eaa8cc28e10c17ff5a647da48c
2017-03-12 11:19:38 +01:00
Stephan Bergmann
609b130370 Propagate integer type mismatch out of ToolBox::ImplFindItemPos
Change-Id: I6f0c06491cf3c09d97b637d7456debd1e3decbcd
2017-03-10 17:26:23 +01:00
Andrea Gelmini
65434e8701 Fix typos
Change-Id: I72db7ff99cde394bc161dfd835bfb0d9a47a53d1
Reviewed-on: https://gerrit.libreoffice.org/34780
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-02 12:43:32 +00:00
Stephan Bergmann
18e07fd7d9 loplugin:subtlezeroinit: vcl
Change-Id: I041390c7cea1e246f07e799ee2430c16e86723d8
2017-02-21 07:34:56 +01:00
Maxim Monastirsky
5ccea06524 VclStatusListener: Listener needs to be acquire'd first
because as soon as we're wrapped somewhere with a temp.
uno/rtl::Reference, its destruction will lead to our own
destruction while we're still in ctor. Typical situation
is when the broadcaster rejects our listening request.

Change-Id: I7fd282e53095ab9939f803df9564c9767263b1f8
2017-02-21 01:40:29 +02:00
Maxim Monastirsky
b6994cb75f Use module name when getting labels
Change-Id: I1d5196e1ca888dfb11d5bd6ef4676937dce49fdc
2017-02-21 01:40:19 +02:00
Rohan Kumar
33c51e8002 tdf#95844 Refactor CommandInfoProvider
Instead of a singleton, CommandInfoProvider should just be a set of static methods.

Change-Id: I16d4406e361a72f013d78f18d6bd0ae20c0cc5e9
2017-02-21 01:39:01 +02: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
Maxim Monastirsky
81d4fbc0da tdf#42029 Use a floating toolbar to show clipped items
Change-Id: I6b366f115258ef8497807163179d3e08ab3d5e6f
Reviewed-on: https://gerrit.libreoffice.org/34180
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2017-02-12 21:56:29 +00:00
Julien Nabet
223f1f2b81 Typos
Change-Id: I36f443c266670bd26aa6b813075e18653f372f52
Reviewed-on: https://gerrit.libreoffice.org/33900
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-02-03 21:09:44 +00:00
Noel Grandin
32a461bdd6 loplugin: unnecessary destructor vbahelper..vcl
Change-Id: I6b7800d4a456391251168f7923a1ec7a5ca9efc9
Reviewed-on: https://gerrit.libreoffice.org/33577
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27 06:50:02 +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
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
Jan-Marek Glogowski
9e51007039 tdf#97087 GDB pretty print the Scheduler task list
In addition to the GDB pretty printer, this annotates a lot more
Timers and Idles.

Change-Id: I5b93fab02161b23bb753e65ef92643a04fb0789c
2017-01-17 16:08:46 +01:00
Noel Grandin
e8b49f0907 new loplugin: useuniqueptr: vcl
Change-Id: Idcbc8655108ff57c06c33bbcabd652387bf3c4ec
Reviewed-on: https://gerrit.libreoffice.org/32948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-13 06:49:23 +00:00
Jan-Marek Glogowski
97b2970d09 Fix variable scope and better code readability
Change-Id: Icce8bc0c1031ad0d1b53fa7389e1a75f16e62972
2016-12-20 14:19:15 +01:00
Jan-Marek Glogowski
a4d1dea6c7 Unify drag handles for toolboxes
The custom shape popup toolbars used their own drawing code for
the drag handle. This was dropped in favour of the default toolbox
drag handle code.

This also drops the drag highlighting in favour of a move mouse
cursor as the drag indicator. The drag handle is currently always
drawn on the top, like a window title.

Change-Id: I08cbf715f1e240c2eb6d9a61fad2b705f9bd8014
2016-12-20 14:19:15 +01:00
Tomaž Vajngerl
99fd3b2a27 vcl: set toolbox size correctly when using 32px icons
Change-Id: Ifacff75f80bc8401ccff2a4d4dc90e56e3b4aa84
Reviewed-on: https://gerrit.libreoffice.org/31801
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-12-09 14:42:06 +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
e6ffb539ee loplugin:vclwidgets check for assigning from VclPt<T> to T*
Inspired by a recent bug report where we were assigning the result
of VclPtr<T>::Create to a raw pointer.

As a consequence, we also need to change various methods that were
returning newly created Window subclasses via raw pointer, to
instead return those via VclPtr

Change-Id: I8118e0195a5b2b4780e646cfb0e151692e54ae2b
Reviewed-on: https://gerrit.libreoffice.org/31318
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-29 06:45:42 +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
Caolán McNamara
b79cf88a04 Resolves: tdf#87960 add and use a ToolFontColor for toolbar item entries
instead of using the MenuBar text color, cause for Ambiance theme the
menubar is dark and its font is light, while the toolbars can be light,
so light font on light bg appears greyed out

Change-Id: I0fa4ab8eabdd3cd69eb682e5ddba8314b8c9ff0f
2016-11-17 13:07:26 +00:00
Tomaž Vajngerl
b7c2764145 convert usages of DPIScalingFactor from int to float
Change-Id: I049b3d2cde4dcb8c8c0690d75a015a43cb71b0c0
Reviewed-on: https://gerrit.libreoffice.org/30381
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-10-29 21:48:30 +00:00
Noel Grandin
fe1f1247fa loplugin:expandablemethods in vcl
Change-Id: I1876e203d3a3a5fa36d83a9b282ba49429c1da2a
Reviewed-on: https://gerrit.libreoffice.org/30261
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-26 06:49:31 +00:00