Commit Graph

154 Commits

Author SHA1 Message Date
Stephan Bergmann
ca39dddb8b loplugin:includeform: vcl
Change-Id: Id7dea3917740aaf4db8dada5e2bea6e117d714ea
2017-10-23 22:45:47 +02:00
Stephan Bergmann
9e0be8a76e Remove dead code behind Calc "Live Data Streams" dialog's "scriptdata" button
...that has been disabled and hidden ever since
4c90ed782a "Actually hide these two radio buttons
(since there is no choice now)."

This removes the sole user of SvScriptStream.  (Unfortunately, removing the no
longer needed

  #include <osl/process.h>

from include/tools/stream.hxx triggered an avalanche of missing includes
elsewhere.)

Change-Id: I7b0e683b14c0eaf7f4737f62adc9d691826380c0
Reviewed-on: https://gerrit.libreoffice.org/42916
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-09-28 19:13:29 +02:00
Noel Grandin
c856ae17af clang-tidy modernize-use-emplace in vcl
Change-Id: Ie0a6d105b0167431275e628935df4f4c1a36d070
Reviewed-on: https://gerrit.libreoffice.org/42259
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-14 08:29:45 +02:00
Noel Grandin
2e8acde112 remove UL/L suffixes from integer constants on the RHS of expressions
Change-Id: I899a8126c9d971601fea6c77eca165718aea0ac5
Reviewed-on: https://gerrit.libreoffice.org/41237
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17 11:25:21 +02:00
Noel Grandin
804cd2bd56 loplugin:useuniqueptr in vcl
Change-Id: Ieece2f9728755a8ae91275535eaa39319eea274e
Reviewed-on: https://gerrit.libreoffice.org/39740
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10 12:39:37 +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
Caolán McNamara
8d80832a91 xContext only needed for bHyphenate case
Change-Id: I5c1d7d43fb26c4adf14de6395e40833eaa3d0164
Reviewed-on: https://gerrit.libreoffice.org/39669
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-07 09:40:57 +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
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
Tamas Bunth
3b05c3b4b4 Refactor create layout cache in status bar
Create SalLayout in StatusBar instead of getting cache through output
parameter.

Pass cache as a constant to the output device afterwards.

Results in a more readable code, with more evident memory management.

Change-Id: I4f949ea8f390b31379f661d611a183ceb3d91c25
Reviewed-on: https://gerrit.libreoffice.org/38651
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2017-06-12 11:58:58 +02:00
Tamas Bunth
f0821f9a34 Cache text layout of statusbar items
Extend lifecycle of SalLayout created by the output device.
A layout is stored for each status bar item and used as a cache.
The layout may be updated through output device method parameters.

This way it's no longer necessary to calculate the layout again and again when
painting the status bar item multiple times, provided that its text does not
change.

Change-Id: I6494c2d6b676e8f4fdda2cde6165ff0755fd4fa2
Reviewed-on: https://gerrit.libreoffice.org/38578
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Tested-by: Tamás Bunth <btomi96@gmail.com>
2017-06-09 16:29:40 +02:00
Tamas Bunth
cb9be0e492 Replace vcl::SalLayout Release with destructor
Replace SalLayout::Release() with normal destructor mechanism. Release()
uses reference counting for the layout. But in practice, the reference
counting variable is initialized in ctor and is not incremented elsewhere.
So I removed the Release() method and replaced all the Release() calls with
'delete'. It will make easier the use of smart pointers and decrease the
chance of memory leaks.

Change-Id: Ia2e142dea10b87e232d5757d84778e62d87cf081
Reviewed-on: https://gerrit.libreoffice.org/38488
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-07 13:52:17 +02:00
Chris Sherlock
da64d198ec tools: svstream.hxx needs only errcode.hxx & not errinf.hxx
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca
Reviewed-on: https://gerrit.libreoffice.org/36896
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-25 09:31:31 +02:00
Noel Grandin
0514442730 no need to use OUStringToOString in SAL_INFO
Change-Id: I707e0d72aba89b7e644def6f4c251e14f6599ad2
Reviewed-on: https://gerrit.libreoffice.org/36451
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-12 12:49:25 +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
Andrea Gelmini
4c45268adf Fix typos
Change-Id: I623135cd4c76dd6569f4ee521f97dee41de4cb1e
Reviewed-on: https://gerrit.libreoffice.org/35660
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 13:03:21 +00:00
Miklos Vajna
a6209ba6a8 vcl: OutputDevice::GetGlyphBoundRects()'s nIndex and nBase is always the same
So keeping just nIndex is enough.

Change-Id: I5d3a0e6b4a6ce1305a56cf50e7ff181a098f6412
Reviewed-on: https://gerrit.libreoffice.org/35336
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-03-17 20:18:46 +00:00
Khaled Hosny
ded0762409 tdf#105454: Stop ignoring font kerning setting
Make sure the default is for kerning to be enable, and honor the setting
to disable it.

This also updates the expectations for chart2_xshape tests for file that
had kerning disabled and was previously ignored.

Change-Id: Icf6bb75e71cae43868fba323ca3c61e4a3e81523
Reviewed-on: https://gerrit.libreoffice.org/34169
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-03-14 14:50:12 +00:00
Khaled Hosny
72a311533a LigaturesEnabled flag is never set
Change-Id: Id4a4631ff7c69aa01deddd2b88626ff83fd5e7b1
Reviewed-on: https://gerrit.libreoffice.org/34151
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-02-11 17:12:20 +00:00
Caolán McNamara
27a673ac52 coverity#1371289 Missing move assignment operator
Change-Id: Idc26faf904f0c89cfd66f53bb311d8ce9b41eaab
2017-02-08 10:41:06 +00:00
Jochen Nitschke
c9c5c94771 avoid some numeric type conversions
Change-Id: I89329ae1dc2c46b6412fcefd31cdb3dcd907354d
Reviewed-on: https://gerrit.libreoffice.org/32658
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-01-03 10:54:53 +00:00
Jochen Nitschke
17ce9a2578 remove unneeded static_casts
found thanks to old comment

Change-Id: I9dbdd8c2f17243ce0d89468c18abd852c0e5eb78
Reviewed-on: https://gerrit.libreoffice.org/32420
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-25 17:56:19 +00:00
Stephan Bergmann
afa4a05459 Remove the sal.rtl.xub SAL_INFOs
...that were apparently meant to flag cases where conversion from old tools
strings to rtl strings was done wrongly.  But that flagging is probably of no
use: SAL_INFOs are usually disabled, so won't be noticed; and SAL_WARN or assert
would not be acceptable, as cases like 'nLen == 0x0FFFF' can legitimately
happen with long strings.  I did a successful 'make check' with these SAL_INFOs
temporarily turned into assert, so there seems to be at least no gross
conversion error remaining.

Change-Id: I57f11db9119fb12555e3bfef17c077ee5eef3844
2016-12-14 11:33:28 +01:00
Khaled Hosny
24ece87ed4 Typo
Change-Id: Iedf0ccb9c48235e8ffd3c14e4f56813d70b7c0c7
2016-12-14 05:56:25 +02:00
Khaled Hosny
d538d3d841 This fallback code makes no sense any more
Ito probably made sense only with bitmap fonts which we no longer
support, and if we don’t need the fallback for printer devices then we
don’t need it on screen either (that whole printer/screen distinction
needs to die someday).

Change-Id: Icf77cd70f0f1b2c186a3c856900295caba72e903
Reviewed-on: https://gerrit.libreoffice.org/31914
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-14 00:28:15 +00:00
Khaled Hosny
9db5cfc889 Drop ComplexDisabled flags that does nothing
There is no such thing as simple text layout in this brave new world.

Change-Id: I641b7efa5ec8fdd9839c291e7f2fdb736361ef1e
Reviewed-on: https://gerrit.libreoffice.org/31824
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-11 00:26:54 +00:00
Khaled Hosny
a597dc8339 sal_GlyphId is a simple glyph id now
No more cleverness.

Change-Id: I760c602802961b37728c6987c4ade14fb02ca034
Reviewed-on: https://gerrit.libreoffice.org/31819
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-11 00:22:05 +00:00
Khaled Hosny
0fb0a564bf Don’t encode font fallback level in the glyph id
Change-Id: I747d969c3c1dc42b1a3b5d12d06fed3af9a64675
Reviewed-on: https://gerrit.libreoffice.org/31818
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-11 00:21:32 +00:00
Khaled Hosny
b894104a0b Pass GlyphItem around
We have this nice structure that contains (almost) all the information
we need, so pass it around instead of passing separate fragments of said
information.

The ultimate is to kill the horrible sal_GlyphId hack if encoding
various bits of information in the higher bits of a 32-bit integer.

Change-Id: Ie496bb4c2932157527a388e2a94e46bf0a325a70
Reviewed-on: https://gerrit.libreoffice.org/31781
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-10 00:58:26 +00:00
Mark Page
677246466c Extend ScopedBitmapAccess and modify various classes to use it
Exception safety, ensure the Access classes are always destroyed.

Change-Id: I4889358476267853ffbd7fafc24950d84b4e9331
Reviewed-on: https://gerrit.libreoffice.org/31494
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-02 11:18:16 +00:00
Khaled Hosny
d761d952f4 Kill old Core Text layout engine
Change-Id: If80d65899255d8be72f374fbec232d103a08a006
Reviewed-on: https://gerrit.libreoffice.org/31232
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-26 14:28:39 +00:00
Caolán McNamara
955b1abb77 crashtesting: assert on converting ooo66538-1.ppt to pdf
Change-Id: I6bdb31715a4cb9e895fc169679a7465a8f18fc37
2016-10-22 21:28:57 +01:00
Mark Hung
bd041161f3 tdf#43740 Do not use UniscribeLayout for CJK Ideograph Variations.
It used to use UniscribeLayout when any Unicode varaiation selector
were found, disregard whether it is a Asian or a complex script.
However CJK Ideograph Vairations are better layouted by WinSimpleLayout.

Just check the case, differ based on the base character of the
variation sequence.

Change-Id: I4a2ad160a9ab70a6dbc96c301a6a5ad16e140245
Reviewed-on: https://gerrit.libreoffice.org/29619
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2016-10-15 21:20:25 +00: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
673b436c35 loplugin:constantparam in vcl
Change-Id: I0cae8e5de1170dec4c82df7f1f5377143a079876
Reviewed-on: https://gerrit.libreoffice.org/28686
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-07 06:49:12 +00:00
Stephan Bergmann
8baef341d5 loplugin:stringconstant: adapt to improved OUStringLiteral1 (vcl)
Change-Id: Ic04f33413713b592c10ebf27c1e3460a44e3794f
2016-08-30 15:30:04 +02:00
Thorsten Behrens
406e39fad6 vcl: fprintf -> SAL_INFO
Only touching dbglevel > 0 code here, so clearly only
informational..

Change-Id: Id6991c93f971bcc2a8badc809b98870a85322992
Reviewed-on: https://gerrit.libreoffice.org/26531
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2016-06-21 08:06:29 +00: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
Noel Grandin
52225a3b7f Convert ComplexTextLayoutMode to scoped enum
Change-Id: I257f8e15fec92f0701235a6fe4b6a2272498c4f1
Reviewed-on: https://gerrit.libreoffice.org/25667
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 11:34:23 +00:00
Noel Grandin
990082f37c Convert FontRelief to scoped enum
Change-Id: I545c83d742db27f1a004b66e5eb1ef768f62e011
Reviewed-on: https://gerrit.libreoffice.org/25626
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-30 06:41:53 +00:00
Noel Grandin
50ac0f503b convert FONT_EMPHASIS_MARK to scoped enum
Change-Id: I137c78b337e57d3442db08334128e79d186b278f
Reviewed-on: https://gerrit.libreoffice.org/24753
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-09 09:41:34 +00:00
Stephan Bergmann
d81c4d2af9 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Iee861bbf1c7a8bf02ec5f04f0ff936e54cfec7b7
2016-04-20 17:27:31 +02:00
Noel Grandin
f0f973da85 loplugin:constantparams in vcl/
also some improvements to the plugin

Change-Id: I0e3a519d70756e577fcb1bd47dd66864b5b4c871
Reviewed-on: https://gerrit.libreoffice.org/23289
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-16 08:42:37 +00:00
Noel Grandin
37a6bafea8 loplugin:unuseddefaultparam in various
Change-Id: I03d7381aad055cbe9bd905e4082586073f4112e0
Reviewed-on: https://gerrit.libreoffice.org/22900
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-07 05:56:59 +00:00
Noel Grandin
f5e131b2bc loplugin:unuseddefaultparams in vcl and xmloff
and teach the plugin about code that takes the address of a function

Change-Id: Ia9d5afef44520aca236659e8176f1e27135ef4fc
Reviewed-on: https://gerrit.libreoffice.org/22861
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-04 06:13:25 +00:00
Noel Grandin
911ae0aeca loplugin:unuseddefaultparams in /include/vcl
Change-Id: I36daccd90bfa6ba0ee8b9e76bff2bd8494155a04
Reviewed-on: https://gerrit.libreoffice.org/22710
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-26 08:24:32 +00:00
Chris Sherlock
88730cdae3 vcl: bmpacc.hxx -> bitmapaccess.hxx
Change-Id: I4bb19d6103c4a6a902d86b62a857e3478493924c
2016-02-06 21:04:09 +11:00
Chris Sherlock
697d445ed0 vcl: take into account the font width is the average font width
I'm changing the Font class function names:

- SetSize       -> SetFontSize
- GetSize       -> GetFontSize
- SetHeight     -> SetFontHeight
- GetHeight     -> GetFontHeight
- SetWidth      -> SetAverageFontWidth
- GetWidth      -> GetAverageFontWidth

That's because it really makes no sense to say that there is a
single constant font width because obviously proportional fonts
don't have one - the best we can do is an average font width,
which is what folks like Microsoft sort of do already. On a fixed
font, the average is still accurate, for obvious reasons :-)

I'm also not a fan of GetSize/SetSize as I find it a might too
generic.

Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70
Reviewed-on: https://gerrit.libreoffice.org/22069
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-04 03:17:26 +00:00
Chris Sherlock
d1a49df683 vcl: add text alignment functions to ImplFont and FontAttributes
ImplFont and FontAttributes now have GetAlignment and SetAlignment,
and I have renamed Font::GetAlign to Font::GetAlignment, and
Font::SetAlign to Font::SetAlignment.

See commit description in 8bfccd3a71 ("vcl: Create accessor
and mutator for font scaling in FontMetric") for reasoning behind
patch.

Unit test added to vcl/qa/cppunit/font.cxx to test text alignment.

Change-Id: I6272c84fc9416c90616d957d1897eba9469fe7ba
Reviewed-on: https://gerrit.libreoffice.org/21876
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-29 01:59:55 +00:00
Chris Sherlock
3de2c3952b vcl: remove unnecessary header includes from text.cxx
Change-Id: Iefa9cad66248297e4639567cd3f5836abb2e167c
2016-01-26 01:43:09 +11:00