Commit Graph

186 Commits

Author SHA1 Message Date
Philippe Jung
3090550b52 tdf#91953 Mixture of icon sizes
Now, whatever the size of toolbar icons, the toolbar
context menu always shows small icons.

Change-Id: Id17df15278d74ae75a3e82d54ecf7af310e0ceb4
Reviewed-on: https://gerrit.libreoffice.org/16361
Reviewed-by: Philippe Jung <phil.jung@free.fr>
Tested-by: Philippe Jung <phil.jung@free.fr>
2015-06-18 13:32:56 +00:00
Noel Grandin
4729774b24 remove unnecessary check for null when calling delete
Idea originally from caolan.
Found using the following command:
find . -name *.cxx | xargs /opt/local/bin/grep -zlP '(?m)if\s*\(\s*\w+\s*\)\s*delete\s+\w+\;'

Change-Id: I3338f4e22193a6dfd6219c8c75835224a3392763
2015-06-15 14:46:41 +02:00
Noel Grandin
566922a98d convert WINDOW constants for GetWindow() methods to scoped enum
Change-Id: I0c7c6d095732704eb4ab48f1277a0592b1c7fa33
2015-05-22 10:37:59 +02:00
Noel Grandin
321b344191 convert TITLE_BUTTON constants to scoped enum
Change-Id: Ibfee4c394724570d9f64098d3703a08b7246ad2c
2015-05-22 10:37:59 +02:00
Jan Holesovsky
9c9db85643 rendercontext toolbar: Invalidate instead of direct paint.
Change-Id: Ib4c11d3f1ec793e66cd47c1f7bb4f7d06820d58f
2015-05-19 16:37:10 +02:00
Noel Grandin
d93915b2ae conver MENU_FLAG_ constants to scoped enum
Change-Id: I969d99fa8881cc89601696a2d8621905a82b147b
2015-05-15 10:05:02 +02:00
Noel Grandin
4f4cff08aa convert POPUPMENU_ constants to scoped enum
Change-Id: I4cdaf36581d1e1daa39929e621070d18a9996852
2015-05-15 10:05:02 +02:00
Michael Meeks
8372b3c3d1 PostUserEvent - first cut at keeping a VclPtr for posted UserEvents.
This should eventually enable more certainty that they are still
live by the time we emit the event later.

Change-Id: I7c9eb4c000753d4efe8c59a9e13ef3e11c93b2fa
2015-05-08 22:40:29 +01:00
Tomaž Vajngerl
a0200bd844 use RenderContext in toolbox, refactor redrawing
Redrawing is done in-place at some places and not in Paint()
chain. This was refactored to delegate such places to
invalidateX method, so it can be changed later.
Refactored some static functions to methods, when that made sense.

Change-Id: Ibdf4211857f4911b48b61edd2ecc846a6e94c864
2015-05-07 09:57:48 +02:00
Stephan Bergmann
98b5f1164b Use typed ToolBox::SetMenuButtonHdl Link
Change-Id: I00cd35374294ccdcc0ac3223ae81ba8129b9a5d7
2015-05-06 12:54:23 +02:00
Stephan Bergmann
1a5f1e82a9 Remove unused ToolBox::Get/SetHighlightHdl
Change-Id: Ieea90173e84dc4d1d0202a3804033d1c42370261
2015-05-06 12:54:22 +02:00
Tor Lillqvist
1fe85984f0 WaE: loplugin:cstylecast
Change-Id: Id59ba5f0fcb27e5a3fec322ba0a016c5fc4bacc1
2015-05-06 12:46:37 +03:00
Caolán McNamara
27d94c482e color bar doesn't fill tool item
since

commit b8f2129828
Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date:   Mon Mar 2 20:57:32 2015 +0900

the color bar is always drawn under the icon and doesn't
get drawn to the right and fill all the empty space of
the tool item, e.g. in impress see the new toolbar color
selector

Change-Id: Ib70fec9c933b9d743e67475899938a5d9f405496
2015-05-06 10:27:18 +01:00
Noel Grandin
662fc8eaa9 convert BMP_MIRROR constants to scoped enum
and fix bug in svx/source/xoutdev/_xoutbmp.cxx,XOutBitmap::MirrorGraphic
where it was not correctly translating between different flags types.

Change-Id: I78b4965544da2aa54b67ec18307fa54c8ffc3aee
2015-05-06 09:01:31 +02:00
Noel Grandin
b13fbd19b7 convert BMP_SCALE constant to scoped enum
Change-Id: Ibc9f88d2588c028cd71aa86c26d970a73025ef22
2015-05-06 09:01:30 +02:00
Stephan Bergmann
b515d1f36f Use various typed ToolBox::Set*Hdl Links
Change-Id: Iddfd36ae0de86fdd2d4febb2c05d1fe0c02801f0
2015-05-06 08:20:55 +02:00
Stephan Bergmann
3ead3ad52f Gradually typed Link
Turn the Link class into a template abstracting over the link's argument and
return types, but provide default template arguments that keep the generic,
unsafe "void* in, sal_IntPtr out" behvior.  That way, individual uses of the
Link class can be updated over time.

All the related macros are duplicated with ..._TYPED counterparts, that
additionally take the RetType (except for LINK_TYPED, which manages to infer the
relevant types from the supplied Member).

(It would have been attractive to change the "untyped" LinkStubs from taking a
void* to a properly typed ArgType parameter, too, but that would cause
-fsanitize=function to flag uses of "untyped" Link::Call.)

Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
2015-04-30 10:20:00 +02:00
Michael Meeks
e8b97a52c9 Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts.

Conflicts:
	accessibility/source/extended/accessiblelistbox.cxx
	accessibility/source/standard/vclxaccessiblecombobox.cxx
	accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
	accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
	accessibility/source/standard/vclxaccessiblelistbox.cxx
	accessibility/source/standard/vclxaccessibletextfield.cxx
	basctl/source/basicide/basidesh.cxx
	cui/source/inc/chardlg.hxx
	cui/source/tabpages/tpbitmap.cxx
	dbaccess/source/ui/dlg/UserAdmin.cxx
	dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
	extensions/source/propctrlr/propertyeditor.hxx
	extensions/source/scanner/sanedlg.cxx
	filter/source/pdf/impdialog.cxx
	include/sfx2/mgetempl.hxx
	include/sfx2/sidebar/SidebarToolBox.hxx
	include/sfx2/viewsh.hxx
	include/svtools/brwbox.hxx
	include/svtools/filectrl.hxx
	include/svtools/scrwin.hxx
	include/svx/dlgctrl.hxx
	include/svx/sidebar/Popup.hxx
	include/svx/sidebar/PopupContainer.hxx
	include/svx/sidebar/PopupControl.hxx
	include/svx/sidebar/SidebarDialControl.hxx
	include/svx/sidebar/ValueSetWithTextControl.hxx
	sc/source/ui/condformat/condformatdlgentry.cxx
	sc/source/ui/navipi/navipi.cxx
	sc/source/ui/sidebar/CellBorderStyleControl.hxx
	sd/source/ui/animations/CustomAnimationDialog.cxx
	sd/source/ui/inc/DrawViewShell.hxx
	sd/source/ui/inc/Ruler.hxx
	sd/source/ui/inc/SlideSorter.hxx
	sd/source/ui/inc/ViewTabBar.hxx
	sd/source/ui/inc/Window.hxx
	sd/source/ui/inc/morphdlg.hxx
	sd/source/ui/inc/sdpreslt.hxx
	sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
	sd/source/ui/sidebar/LayoutMenu.hxx
	sd/source/ui/sidebar/MasterPagesSelector.hxx
	sd/source/ui/sidebar/NavigatorWrapper.hxx
	sd/source/ui/sidebar/PanelBase.hxx
	sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
	sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
	sd/source/ui/slideshow/showwindow.hxx
	sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
	sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
	sd/source/ui/view/ViewShellBase.cxx
	sd/source/ui/view/drviewsa.cxx
	sfx2/source/appl/fileobj.hxx
	sfx2/source/appl/opengrf.cxx
	sfx2/source/control/thumbnailviewacc.hxx
	sfx2/source/dialog/securitypage.cxx
	sfx2/source/dialog/templdlg.cxx
	sfx2/source/doc/docinsert.cxx
	sfx2/source/doc/guisaveas.cxx
	sfx2/source/inc/alienwarn.hxx
	sfx2/source/sidebar/Deck.cxx
	sfx2/source/sidebar/Deck.hxx
	sfx2/source/sidebar/DeckTitleBar.cxx
	sfx2/source/sidebar/DeckTitleBar.hxx
	sfx2/source/sidebar/MenuButton.cxx
	sfx2/source/sidebar/MenuButton.hxx
	sfx2/source/sidebar/Panel.cxx
	sfx2/source/sidebar/Panel.hxx
	sfx2/source/sidebar/PanelTitleBar.hxx
	sfx2/source/sidebar/SidebarDockingWindow.hxx
	sfx2/source/sidebar/SidebarToolBox.cxx
	sfx2/source/sidebar/TabBar.hxx
	sfx2/source/sidebar/TabItem.cxx
	sfx2/source/sidebar/TabItem.hxx
	sfx2/source/sidebar/TitleBar.hxx
	sfx2/source/toolbox/imgmgr.cxx
	starmath/inc/edit.hxx
	starmath/inc/smmod.hxx
	starmath/qa/cppunit/test_starmath.cxx
	starmath/source/edit.cxx
	starmath/source/smmod.cxx
	svtools/source/brwbox/brwbox1.cxx
	svtools/source/brwbox/datwin.hxx
	svtools/source/contnr/fileview.cxx
	svtools/source/contnr/simptabl.cxx
	svtools/source/control/filectrl.cxx
	svtools/source/control/valueimp.hxx
	svx/inc/GalleryControl.hxx
	svx/source/dialog/dlgctrl.cxx
	svx/source/dialog/swframeexample.cxx
	svx/source/fmcomp/fmgridif.cxx
	svx/source/gallery2/GalleryControl.cxx
	svx/source/sidebar/EmptyPanel.hxx
	svx/source/sidebar/area/AreaPropertyPanel.hxx
	svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
	svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
	svx/source/sidebar/insert/InsertPropertyPanel.cxx
	svx/source/sidebar/insert/InsertPropertyPanel.hxx
	svx/source/sidebar/line/LinePropertyPanel.hxx
	svx/source/sidebar/line/LineWidthControl.cxx
	svx/source/sidebar/line/LineWidthControl.hxx
	svx/source/sidebar/line/LineWidthValueSet.hxx
	svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
	svx/source/sidebar/possize/SidebarDialControl.cxx
	svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
	svx/source/sidebar/text/TextPropertyPanel.hxx
	svx/source/sidebar/tools/PopupContainer.cxx
	svx/source/sidebar/tools/PopupControl.cxx
	svx/source/sidebar/tools/ValueSetWithTextControl.cxx
	svx/source/svdraw/svdfmtf.hxx
	svx/source/svdraw/svdibrow.cxx
	svx/source/tbxctrls/colrctrl.cxx
	svx/source/tbxctrls/tbcontrl.cxx
	sw/source/ui/dbui/mmaddressblockpage.cxx
	sw/source/ui/dialog/uiregionsw.cxx
	sw/source/ui/index/cnttab.cxx
	sw/source/uibase/inc/drpcps.hxx
	sw/source/uibase/sidebar/PageColumnControl.hxx
	sw/source/uibase/sidebar/PageMarginControl.hxx
	sw/source/uibase/sidebar/PageOrientationControl.hxx
	sw/source/uibase/sidebar/PagePropertyPanel.hxx
	sw/source/uibase/sidebar/PageSizeControl.hxx
	sw/source/uibase/uiview/view2.cxx
	sw/source/uibase/utlui/navipi.cxx
	vcl/inc/svdata.hxx
	vcl/source/control/combobox.cxx
	vcl/source/control/lstbox.cxx
	vcl/source/window/dockwin.cxx
	vcl/source/window/winproc.cxx

Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
2015-04-28 15:08:48 +01:00
Stephan Bergmann
a9a4d46ce7 loplugin:simplifybool
Change-Id: I8276e8b356ff26241613de64bcd90b5dbcd92f29
2015-04-24 12:36:31 +02:00
Michael Meeks
ae5f75ab05 Allow a common op. on a disposed toolbox.
Change-Id: I4da1f4daaf94456bc951b1d7a96cb28cb7fba0e9
2015-04-14 13:42:45 +01:00
Michael Meeks
49dadad0b5 Encourage disposed toolbox items to play nicely.
Change-Id: I4a28ba4740e9c84666cd85c046598862f20a7a96
2015-04-10 13:13:46 +01:00
Michael Meeks
4f386d0747 more lifecycle cleanup & fixing.
Change-Id: Icc9051bad16c0e66c9e9f631c487a2facde72e9f
2015-04-10 12:01:42 +01:00
Michael Meeks
2269fd1d75 get misc. ordering right and add missing disposes.
Change-Id: I76489f833949a556b657010e5d5cba6f64c89ba7
2015-04-10 11:35:22 +01:00
Caolán McNamara
1a3c99f2c3 callcatcher: update unusedcode
mostly changed due to loplugin:constantfunction

Change-Id: Ib677c78db256f8032a99b3f02a3e363fee68ebcc
2015-04-04 17:13:21 +01:00
Stephan Bergmann
18804c92e1 Clean up C-style casts from pointers to void
Change-Id: Iad602cece6e328c7f5d5f36adb294c97b152ade3
2015-03-28 19:09:28 +01:00
Stephan Bergmann
513fc29160 const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I17c57a85bcda98ef36ddefd6562d4681d0c7d5fc
2015-03-26 15:33:40 +01:00
Noel Grandin
062e40c76b loplugin:constantfunction: vcl
Change-Id: I985b781a8d53190505fcb1182749cdaf5cd0f8d0
2015-03-19 10:45:00 +02:00
Tomaž Vajngerl
b8f2129828 toolbox - preserve the orig. image + use it in menu & color update
In toolbox the images are scaled for HiDPI, which causes various
problems. This change preserves the original image and uses that
when adding images into the menu and also uses that when updating
the color related toolbox-es.

Change-Id: Ib7e7d82ccb1cd774e0e14dd6bab5626eaefea097
2015-03-05 09:46:49 +09:00
Tomaž Vajngerl
0451615fc1 remove maHighImage from toolbox as it is unused (no setter)
Change-Id: I5feaae01fd22252654caba34097d77f75134e045
2015-03-05 09:46:49 +09:00
Niklas Johansson
9b7b177445 tdf#88702 ACCESSIBILITY Toggle buttons state not reliably updated
We need to adapt the accessibility code to handle VCLEVENT_TOOLBOX_ITEMUPDATED,
since it is now sent from vcl/source/window/toolbox2.cxx.
I have tested the patch successfully on Windows and Fedora.

Change-Id: Ia4328d3c34547cc28ce9a3946f90223442ee84e3
Reviewed-on: https://gerrit.libreoffice.org/14190
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-01-27 09:34:06 +00:00
Noel Grandin
f61dbc3029 followup code removal after changing virtual methods to non-virtual
This cleanups up indentation and removes dead classes.

This is a followup patch to commit
272b1dd55797aacf511fb4342b0054e3697243f6
"new loplugin: change virtual methods to non-virtual"

Change-Id: I1c2139589cf8cb23bb9808defe22c51039d38de1
2015-01-26 08:42:29 +02:00
Noel Grandin
b44cbb26ef new loplugin: change virtual methods to non-virtual
Where we can prove that the virtual method is never overriden.

In the case of pure-virtual methods, we remove the method entirely.
Sometimes this leads to entire methods and fields being
eliminated.

Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
2015-01-26 08:42:28 +02:00
Caolán McNamara
06983ef3c0 do TODO: replace ImplCallEventListeners() by CallEventListeners() in vcl
Change-Id: If47baad0ec31f18fcb55c7db86fb2a316dd0807f
2015-01-14 20:30:08 +00:00
Noel Grandin
bae855e667 fdo#84938: replace BUTTONTYPE_ constants with 'enum class'
Change-Id: I54f9019297913683605b5aea9f79b3defc1dcc13
2015-01-06 10:59:40 +02:00
Jennifer Liebel
2a55005675 changed timers to idle
Change-Id: I0d2119a297c9a6d9b99676a561ddf4dd654ecaea
2014-12-09 12:34:59 +00:00
Noel Grandin
3c58f07680 fdo#84938: replace TOOLBOXITEM_ constants with enum
Change-Id: I08c4a456f9e80f70719ca8c3ad5c0f0d2d8282f6
Reviewed-on: https://gerrit.libreoffice.org/12258
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-05 06:45:07 +00:00
Noel Grandin
a7542d38dd fdo#84938: replace MIB_ constants with enum
Change-Id: I58c1b4c9e4c4b3751b233d2fe10b9c953b945c4a
Reviewed-on: https://gerrit.libreoffice.org/12179
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-01 14:53:39 +00:00
Stephan Bergmann
f6101f6d3e Work around workaround for old MSVC 2012
...not allowing certain o3tl::is_typed_flags::Wrap conversion operators to be
explicit, thus causing ambiguities here.

Change-Id: I5108885229eb185ceac57042e67405b393cdcf3b
2014-10-20 15:36:39 +02:00
Noel Grandin
67c9d05451 fdo#84938: replace TIB_ constants with enum
Change-Id: I435ce2331fb49e7ce9fe97bdfddfaef706759a84
Reviewed-on: https://gerrit.libreoffice.org/12023
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-20 07:16:46 +00:00
Noel Grandin
827c46e7d7 fdo#82577: Handle Window
Put the VCL Window class in the vcl namespace. Avoids clash with the X11
Window typedef.

Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-09-23 14:11:39 +03:00
Jan Holesovsky
8da21eca45 vcl: Allow creation of button content from action name (.uno: commands).
Change-Id: If4b2aef59d45a848fb77de9e1b7bf80d49548a75
2014-09-22 11:57:00 +02:00
Caolán McNamara
abbeed7560 callcatcher: update unused code
Change-Id: Ie31c16318b09699e080484292d489a378e3a6dce
2014-09-10 12:46:49 +01:00
Andrzej Hunt
1ae89d1892 fdo79368 Don't process overflow menu items twice.
We reuse the toolbox overflow menu for toolbarmanager's context
menu -- toolbarmanger previously added its menu listener to the
toolboxes menu permanently, meaning that it would try to handle
overflow menu items (in addition to the context menu items which
it should handle), instead we should only add the listener when
we are actually using the menu as a context menu.

Perhaps it would be better in the long run to actually use fully separate
menus instead, and ask toolbox to specifically add its items to that
rather than trying to hack the context menu on top of the overflow menu?

Change-Id: Iecface2c6eae9ab79dbcdb25ffdbaf446e2885ea
2014-06-01 08:42:46 +01:00
Peter Senna Tschudin
3b24dcc8a8 Remove unnecessary semicolons
A simplified version of the semantic match that finds this problem is
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
    cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Change-Id: Ib9708d37fbb4c6060f88d5dae3814a2d37b2091e
Reviewed-on: https://gerrit.libreoffice.org/9493
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-27 01:19:00 -05:00
Stephan Bergmann
93f5d5a919 The opaque PostUserEvent IDs are actually pointers
...so declare them as such.  This avoids the recurring mistake of storing such
IDs as sal_uInt32, truncating in 64 bit environments, causing RemoveUserEvent to
potentially not remove the event, it thus firing "too late" and probably causing
a crash.

While at it, consolidate the trivially unnecessary overloads of both
Application::PostUserEvent and Window::PostUserEvent.  And in each of them, it
looks like deleting the mpLink member was missing from the failure branch.

Change-Id: Iab13afbb06e12ac15dec6a6b5b85a7e402a3c654
2014-05-07 11:49:46 +02:00
Noel Grandin
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
Andrzej Hunt
3dc6808532 Toolbar overflow/context menu: keep ordering and don't discard separator.
Previously the overflow/context menu should have had a separator shown
between the overflow items and the hidden items, however these were
inadvertently removed by ImplClearPopupMenu which filters the items
before the menu is displayed.

The previous ordering of items was also the REVERSE of the ordering in
the toolbar -- the overflow menu is a logical extension of the toolbar
hence items should be in the same order as they were in the toolbar.

Change-Id: I8444f4814fea64be1d8f8790445ad6aa01532e70
2014-04-26 08:26:32 +01:00
Tor Lillqvist
50bf123ddb Kill superfluous vertical whitespace
Change-Id: I81ce8fd7022bf283db668705efdfb0666f87bde9
2014-04-02 16:54:18 +03:00
Norbert Thiebaud
58fae0f715 remove osolete ifdef
now that the ScaleDPI is forced to 1 on mac there is no need
for these ifdef

Change-Id: I0ca3bc301b63f5f4c7d1eb36f27bc9b6ab41af29
2014-03-11 15:44:26 -05:00
Noel Grandin
56b24765f2 remove unused code ToolBox::GetItemExpand(unsigned short)
Change-Id: If28d796a72ca7f375a82fbb0a42e9810db6f34c0
2014-03-05 09:17:45 +02:00