2546 Commits

Author SHA1 Message Date
Stephan Bergmann
de907bf54d Simplify code
Change-Id: I2ac0564a5a6714111abdcff48edff070d75892b7
2016-02-10 08:04:22 +01:00
Stephan Bergmann
5a5dbb31d5 Use rtl::Reference<CppType> instead of HardCppRef<UnoType,CppType>
Change-Id: I089b5caca5e05726105f78aeb00db1869d0a17f4
2016-02-09 18:30:54 +01:00
Chris Sherlock
a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00
Chris Sherlock
538f276ae0 Formatting changes across all modules
+ Removed comment cruft
+ Tab formatting in number of files
+ Some commented out code removed
+ Tab characters replaced with spaces
+ Newline cleanup in quite a few files
+ Tweak header guard #endifs

Change-Id: I3208ff2f047da890edcc49b73389aca22442f5fc
Reviewed-on: https://gerrit.libreoffice.org/22221
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:11:34 +00:00
Noel Grandin
b14224fe97 loplugin:unusedmethods
using an idea from dtardon:

<dtardon> noelgrandin, hi. could you try to run the unusedmethods clang
plugin with "make build-nocheck"? that would catch functions that are
only used in tests. e.g., i just removed the whole o3tl::range class,
which has not been used in many years, but htere was a test for it...
<noelgrandin> dtardon, interesting idea! Sure, I can do that.

Change-Id: I5653953a426a2186a1e43017212d87ffce520387
Reviewed-on: https://gerrit.libreoffice.org/22041
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-08 06:08:14 +00:00
Eike Rathke
599f0cbe1d interface to new XTextSearch2 with SearchOptions2, tdf#72196
Places that had utl::TextSearch::UpgradeToSearchOptions2() introduced
are worth an inspection if the new SearchAlgorithms2::WILDCARD search
should be supported or at least use SearchOptions2 instead of
SearchOptions to eliminate the small performance penalty that conversion
involves.

Change-Id: I565f73af2b551ae9ad0f488e672823dc6c5c1109
2016-02-05 17:02:47 +01: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
8db902785e tdf#94269 Replace "n" prefix for bool variables with "b"
Change-Id: I8999dc2701010424ea4d2504e99ed429030d7d4e
2016-02-04 00:24:51 +11:00
Caolán McNamara
c3224db8ba Related: tdf#97375 a cut doesn't refresh the editview
but a delete does. The diff from delete to cut is the
EnterBlockNotifications/LeaveBlockNotifications calls so try that

Change-Id: I10147043d6fe358bf2f4f4bd6877210b86cbbd1f
2016-02-02 14:52:34 +00:00
Caolán McNamara
ab5c427784 Resolves: tdf#97375 use Invalidate in all modes
makes the crash/hangs go away

Change-Id: I91a4391190ec7aa0ffa5e41a8c1eb86b4bb9c484
2016-02-02 11:51:35 +00:00
Noel Grandin
98c343604d boost::hash->std::hash
Change-Id: If4d1e4071995f07212fad958b0226d5824d168f8
Reviewed-on: https://gerrit.libreoffice.org/21989
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-02 09:20:47 +00:00
Noel Grandin
35f4c0d242 boost::cref->std::cref
Change-Id: I2a4d2052c48f35d69cea2aed2e98079ad8d98a02
Reviewed-on: https://gerrit.libreoffice.org/21982
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-01 11:00:17 +00:00
Caolán McNamara
e9a2e0460e OSL_THIS_FUNC is a rip-off of BOOST_CURRENT_FUNCTION so we can use that
as a direct drop in I guess

Change-Id: I3add63f1459f4e659019bd6db54da2f5431958ce
Reviewed-on: https://gerrit.libreoffice.org/21941
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-01-31 12:29:07 +00:00
Noel Grandin
1ef9f3988e unnecessary use of OUString constructor
Change-Id: Idd31b0a53c8318af69bbcd32f6798721ec8eb8e1
Reviewed-on: https://gerrit.libreoffice.org/21945
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-31 12:04:02 +00:00
Chris Sherlock
3187193a61 tools: rename FontUnderline to FontLineStyle
Change-Id: I4750ad8569a1003b2f8c29052f3e25003ee433ca
Reviewed-on: https://gerrit.libreoffice.org/21892
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-31 04:31:13 +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 8bfccd3a71d911b6d ("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
Noel Grandin
370294f6d1 new loplugin sfxpoolitem
generates a warning about subclasses that add members but do not
override operator==()

Change-Id: If6df1a2cbd115f17bcca22f9b7995181dcf55c03
Reviewed-on: https://gerrit.libreoffice.org/20468
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-01-22 12:14:56 +00:00
Stephan Bergmann
fb50950299 Further uninitialized SvxNumberFormat::mbNumAdjustChanged fixing
The uninitialized read during CppunitTest_sd_html_export_tests mentioned in
d90a20833a815362c344b82fc16b4bbcff0ebf07 "Missing initialization of
SvxNumberFormat::mbNumAdjustChanged" is rather caused by the SvxNumberFormat
copy ctor callling the SvxNumberFormat copy assignment op, which calls
SvxNumberFormat::SetNumberingType before assigning mbNumAdjustChanged.

What is probably wanted here is to simply copy the nNumType member without doing
the eNumAdjust adjustments anyway.  But a rather brittle design, that.

Change-Id: Ic587687038f1ea71173461412350e6b2dee13aa4
2016-01-22 10:50:10 +01:00
Khaled Hosny
65698ffa0e Typo
Change-Id: Ib4c474cab050cdef003dc5e611e8a9bc1fb46e86
2016-01-22 13:34:13 +04:00
Stephan Bergmann
d90a20833a Missing initialization of SvxNumberFormat::mbNumAdjustChanged
introduced in 6517141b6233c5f9667031bc92f66109fddf5b76 "tdf#42788: FORMATTING -
Numbering/ordered list," causing a read of the uninitialized value in
CppunitTest_sd_html_export_tests.

Change-Id: I7955593999e3a2bedca815ee447d96c1b997a358
2016-01-22 09:53:26 +01:00
Miklos Vajna
fb7edcd806 editeng: ImpEditView::mbTiledRendering is never read
Change-Id: Ie8e33d075f0cedbb9f7148717c4318f4494ed419
2016-01-22 09:15:21 +01:00
Nusaiba Al-Kindi
6517141b62 tdf#42788: FORMATTING - Numbering/ordered list
I changed the default numbering alignment of the Roman(upper/ lower) numbers list to the right
instead of left with out any changes in the default alignment of other numbring type lists.
In addition, numbering alignment can be changed by the user and any new list created will not
be affected by the user choice (using the default settings for the new list).

Change-Id: I7a6b7fb31bf40e26910e90538cd336e767f4c056
Reviewed-on: https://gerrit.libreoffice.org/21439
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-01-21 19:39:22 +00:00
Chris Sherlock
5659b68be3 vcl: rename Font::GetFamily to Font::GetFamilyType
Change-Id: Ie427a43bd126dcdd89c6f66582736e67130f2254
Reviewed-on: https://gerrit.libreoffice.org/21633
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-21 06:22:01 +00:00
Noel Grandin
4ff5a55584 loplugin:unusedmethods
Change-Id: Ib2dc804f55d1a96ae01f2cf31b7d55956040a72e
Reviewed-on: https://gerrit.libreoffice.org/21603
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-20 08:13:51 +00:00
Caolán McNamara
6fe8925305 basebmp now only used from vcl/headless code
Change-Id: I068d404431d3565f6ad5741edbd3693225824a4d
2016-01-18 20:47:01 +00:00
Noel Grandin
a7f6efc68b loplugin: unused return values
Change-Id: I9c61a46c57894bc63a57740206c0bcb4a16553af
Reviewed-on: https://gerrit.libreoffice.org/21571
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-18 12:50:09 +00:00
Caolán McNamara
1b299895da drawmodes header gone
Change-Id: Ia1b9ad96dbe41bebc5c2819385950a6d2980608b
2016-01-18 12:14:38 +00:00
Chris Sherlock
cb20f46895 vcl: change Font::SetName() to Font::SetFamilyName()
Change-Id: I9b7bd1ec25955981ebcb9085579cbb9fbaa802d5
Reviewed-on: https://gerrit.libreoffice.org/21560
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-18 05:24:46 +00:00
Chris Sherlock
28c96fc255 vcl: rename Font::GetName to Font::GetFamilyName
Change-Id: Ie20871a3078bf875c1782b7761d60591a9c9704f
Reviewed-on: https://gerrit.libreoffice.org/21529
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-17 23:35:37 +00:00
Julien Nabet
1570957ff9 cppcheck: fix 2 variableScope reports in editeng
Change-Id: Ic87c5b1d8f96b7f25ce323a49455d1ac16d1bf86
Reviewed-on: https://gerrit.libreoffice.org/21533
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-01-17 13:53:44 +00:00
Norbert Thiebaud
45654a1d4d revert vcl patch series that brok Mac and Windows
revert:
9bc2f3de8672e812f3a67541c6d7069b434a7e42
 vcl: add comment about ImplFontMetric::{Get|Set}LineHeight()
26371f105bc44e04469ec03fc5bb12505e651c6b
 vcl: FontAttributes::GetSlantType() -> FontAttributes::GetItalic()
2dd0b4317372b8022efe3911b38b4fa02956d8b9
 vcl: font.hxx and metric.hxx cleanup, make ctors explicit and the dtor virtual
5ab13bf3ead3539e4ad847656da81e7eb6029652
 vcl: tabify font.hxx
f99550dae55e40e49bf9c9875053fe2abb4c71ca
 vcl: change Font::SetName() to Font::SetFamilyName()
2b297116cb6bb1061c43e5714e2609c8ee9f57d2
 vcl: rename Font::GetName to Font::GetFamilyName

Change-Id: I23f38921187d66b970ca815eb30dda4222a2da62
2016-01-16 12:20:45 -06:00
Chris Sherlock
f99550dae5 vcl: change Font::SetName() to Font::SetFamilyName()
Change-Id: I54a4036544c680c4a49607677af776aa7a433fbc
Reviewed-on: https://gerrit.libreoffice.org/21510
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-16 16:12:14 +00:00
Chris Sherlock
2b297116cb vcl: rename Font::GetName to Font::GetFamilyName
Change-Id: I83927e0992dfe0a2a79d139818a9f45d3761aae5
Reviewed-on: https://gerrit.libreoffice.org/21509
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-16 16:11:28 +00:00
Caolán McNamara
570087e762 coverity#3148472 Unused value
Change-Id: I9acdfe0edf8468c6efb708ca13109abe2be0b826
2016-01-15 20:24:47 +00:00
Michael Stahl
228bccb7bc editeng: coverity#1348472 unused value AddNonBrkSpace
Let's hope that shuts up coverity?

Change-Id: I81f56ce9120c1d9328d5f04b1d1869c01402eca1
2016-01-15 13:03:11 +01:00
Miklos Vajna
7b5d20983d editeng: handle SdrModel::isTiledSearching()
Given that the edit/outliner views can come and go, avoid the lifecycle
problems with just passing a pointer to the sdr model to editeng, and
then it'll always have the up to date "are we searching" information.

editeng can't depend on svx, so provide an interface class SdrModel can
implement.

Change-Id: I3b98011593b00ac0fab05b6b9c591dd20d94c579
2016-01-14 14:45:09 +01:00
Chris Sherlock
08bbdaa2f9 vcl: Create accessor and mutator for int and ext leading in FontMetric
Accessor and mutator created for external and internal leading space in
FontMetric.

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

Unit tests
- check to ensure that can set external and leading space
- check equality operator on FontMetric after setting both external
  and internal leading space
- enhanced tests to also check the inequality operator

Change-Id: I973970dd0b0631c5eca3e89039dce57ac3a3eb63
Reviewed-on: https://gerrit.libreoffice.org/21454
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-13 19:50:18 +00:00
Noel Grandin
8bd9eb8334 loplugin:unusedmethods unused return value in include/svl
Change-Id: I759fe8769daccea07c2157bfb5912df8ba285534
2016-01-13 08:44:46 +02:00
Noel Grandin
1f9a610de1 loplugin:unusedmethods unused return value in include/editeng
Change-Id: I1314480950b0d3a3e5ed066d71c175604dd41970
Reviewed-on: https://gerrit.libreoffice.org/21361
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-12 07:39:42 +00:00
Stephan Bergmann
00c62e306f loplugin:privatebase: Publicly derive from binary_/unary_function
Somewhat arbitrarily prefer public over private derivation; ultimately,
derivation from those deprecated (C++11)/removed (C++17) classes should be
removed, anyway.

Change-Id: I5ed24427d37586e72f8c16509cf5002a54af73f1
2016-01-11 13:17:08 +01:00
Stephan Bergmann
9ff5abf2e1 loplugin:privatebase: Make derivation from noncopyable explicitly private
Change-Id: Ia410950353aec0106ea82d025ed3ee89c79ca127
2016-01-11 13:17:07 +01:00
Noel Grandin
1ea49b5bae loplugin:unusedmethods unused return value in extensions
Change-Id: I449ecdb734e796813384a5d015e9ecabe28079eb
2016-01-11 11:59:18 +02:00
Andrea Gelmini
64d624b651 Fix typos
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
Reviewed-on: https://gerrit.libreoffice.org/21209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-10 14:17:20 +00:00
Michael Stahl
63a3c07d7c svx: fix windows build, rename SvxEscapementItem::GetProp()
90e07dd6f5d64a0d0041361c1592a6cd93ff2ac0 introduced a new unit test
which calls SvxEscapementItem::GetProp(), and apparently the unit test
also #includes windows.h somehow, so GetProp macro is defined to
GetPropA and that fails to link since SvxEscapementItem doesn't have
this member function.  Thank you, C preprocessor, you barbarous relic.

Change-Id: I6fd8e9d832ed5e1ce1a4fa7f1516c55d51a3283b
2016-01-07 19:18:31 +01:00
Stephan Bergmann
0f6f21346e Fix memory leak
This e.g. reduces the LSan-reported leakage during CppunitTest_sd_filters_test
from

  SUMMARY: AddressSanitizer: 115048 byte(s) leaked in 4639 allocation(s).

to

  SUMMARY: AddressSanitizer: 6544 byte(s) leaked in 118 allocation(s).

The history is that this happened to (presumably accidentally) get fixed when
switching from an SV_DECL_PTRARR to a boost::ptr_vector in
b35980d9b28f1e3985f94238f7d8c9962f654bd0 "Move away from SV_DECL_PTRARR in
CharAttribList" but then got "fixed" again with
46da0b6837bffa7d8a72624d2587159737e3d7e2 "further sc/editeng unbreaking."  That
latter commit doesn't give any more detail than "this boost::ptr_vector idea is
seriously broken," but I assume it did that change only via code inspection, to
return to the previous (assumed good) status quo, rather than because that
recently introduced deletion actually caused any problems there.

I now see that this has also independently been found and fixed in AOO with
<https://bz.apache.org/ooo/show_bug.cgi?id=120865> "Part of EditAttrib objects
are not released after removing from Character attributes list" (the fix for
which apparently got mis-classified for LO as
"dd127fae0c5661e6488785ed0ecb410d81165a6e prefer:
e4e4b3d65788d14d5f10cd6bccc713cfe2411cb1," i.e., "Another SV_DECL_PTRARR now
gone" about some unrelated XBaseParaPortionList).

Change-Id: Iecee5a4c85bc0c0c36a6690d70f0a4a59dab964a
2016-01-07 11:14:27 +01:00
Chris Sherlock
7eab7f3485 Cleanup after removing vcl::FontInfo class
Change-Id: I544eac439cb7277e47a23a90c6fbc45496161c3b
2016-01-04 05:16:08 +11:00
Chris Sherlock
8227b9955e vcl: Excise vcl::FontInfo class
This may sound crazy, but literally vcl::FontInfo serves no purpose
that I can see. The inheritance chain is like this:

        ┌────────────────────────┐
        │                        │
        │        vcl::Font       │
        │                        │
        └────────────────────────┘
                     ^
                    ╱ ╲
                     │
                     │
        ┌────────────────────────┐
        │                        │
        │      vcl::FontInfo     │
        │                        │
        └────────────────────────┘
                     ^
                    ╱ ╲
                     │
                     │

        ┌────────────────────────┐
        │                        │
        │       FontMetric       │
        │                        │
        └────────────────────────┘

vcl::FontInfo (which, incidentally, needs to be put into the vcl
namespace due to collisions with poppler!) literally does nothing
and is acting as a bridge between FontMetric and vcl::Font. Unlike
a bridge though, this bridge doesn't actually *do* anything.

So I'm removing it, which means one less class to deal with in the
vcl fonts world.

Change-Id: I32725669c9bca7fbb0846b6a062135464046e4f6
Reviewed-on: https://gerrit.libreoffice.org/21058
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-03 16:19:03 +00:00
Matteo Casalin
cb98c423bb sal_uLong/sal_uIntPtr/sal_uInt16 to sal_uInt32
also avoid some explicit temporaries and group some checks.

Change-Id: I7795b208dde53fd383b8c75f72dd9f56429aea2b
2015-12-27 16:51:27 +01:00
Noel Grandin
1dbe54fd2e loplugin:unusedfields in /include
Change-Id: Ia406e727890a365cc89831c96140cad8240f9b61
2015-12-23 08:13:53 +02:00
Julien Nabet
f909e39f98 cppcheck: false positive memleak
Help cppcheck by tweaking a bit the code.
No functional diff

Change-Id: If495b0ff845b16522d19da0b723db08b4481e995
2015-12-20 21:55:42 +01:00