Commit Graph

345 Commits

Author SHA1 Message Date
Noel Grandin
f7ce839c78 use unique_ptr in SfxUndoManager::AddUndoAction
Change-Id: I11483e3cece12a7373f4276972b4c899edf1ce15
Reviewed-on: https://gerrit.libreoffice.org/61566
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09 12:09:55 +02:00
Takeshi Abe
7f7e890a10 sd: micro-optimize SdPage::GetPresObj() by sorting less
No need to sort all matched elements.

Change-Id: I4133b28a9c84ab322e55f9987859690e426f600c
Reviewed-on: https://gerrit.libreoffice.org/59691
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-28 13:33:46 +02:00
Noel Grandin
1534025a03 loplugin:methodcycles more graph theory for the win
implemeent a reduction approach, which is good at finding virtual
methods that only themselves or their virtual partners.

The accessibility GetVisArea stuff is dead since
    commit 891e41fac8
    Date:   Wed Apr 4 11:23:22 2018 +0200
    dead code in AccessibleTextHelper_Impl::UpdateVisibleChildren

Change-Id: I78d9d8bca585ecec8394f2c3fe2baa93db0e58f5
Reviewed-on: https://gerrit.libreoffice.org/60912
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-27 11:48:46 +02:00
Gabor Kelemen
8df9935dcb tdf#42949 Fix IWYU warnings in include/comphelper/[a-l]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I22ba2c8aec235e34cd7835b8a0a716bf3057db7a
Reviewed-on: https://gerrit.libreoffice.org/60837
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-24 23:23:20 +02:00
Regina Henschel
a9ec212c1b tdf#67248 Use localized layer name only for display in UI
The internal management of layers was based on localized layer names.
So it could happen, that a custom layer name was a standard layer
name (which includes special handling) in one local and not in the
other. The patch changes the implementation to use the same real
layer names as in file, and use localized standard layer names only
for display in the UI.
Removes no longer needed RestoreLayerName()
Removes convertToInternalName(), ersatz convertToLocalizedName()
Removes no longer needed convertToExternalName()
Includes fix for tdf#119956 in addition

Change-Id: Iaedb73e4017e728f7ca3b0dc4aa7bb7f0e6ce6da
Reviewed-on: https://gerrit.libreoffice.org/60507
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2018-09-21 11:32:34 +02:00
Stephan Bergmann
206b5b2661 New loplugin:external
...warning about (for now only) functions and variables with external linkage
that likely don't need it.

The problems with moving entities into unnamed namespacs and breaking ADL
(as alluded to in comments in compilerplugins/clang/external.cxx) are
illustrated by the fact that while

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    struct S2: S1 { int f() { return 1; } };
    int f(S2 s) { return s.f(); }
  }
  int main() { return f(N::S2()); }

returns 1, both moving just the struct S2 into an nunnamed namespace,

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    namespace { struct S2: S1 { int f() { return 1; } }; }
    int f(S2 s) { return s.f(); }
  }
  int main() { return f(N::S2()); }

as well as moving just the function f overload into an unnamed namespace,

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    struct S2: S1 { int f() { return 1; } };
    namespace { int f(S2 s) { return s.f(); } }
  }
  int main() { return f(N::S2()); }

would each change the program to return 0 instead.

Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c
Reviewed-on: https://gerrit.libreoffice.org/60539
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-17 09:05:38 +02:00
Noel Grandin
6a85925841 loplugin:simplifyconstruct in scaddins..sd
Change-Id: Ia2c04ef9fe5113b8b04304d0f495b948b5371fb4
Reviewed-on: https://gerrit.libreoffice.org/60237
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-10 11:03:26 +02:00
Gabor Kelemen
efdc775d7d Add missing sal/log.hxx headers
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade to be able to remove those unneeded includes.

This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
to directories scripting, sd, sdext

Change-Id: I47889cd889cf1d68353184229bfd4712f1528fbf
Reviewed-on: https://gerrit.libreoffice.org/58220
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-30 17:28:49 +02:00
Noel Grandin
2d71dd52b6 merge IUndoManager into SfxUndoManager
SfxUndoManager is the only implementation of the IUnderManager
"interface", and it lives in the same header.
Plus this way we can get rid of some covariant parameters,
which will make using std::unique_ptr easier.

Change-Id: I6661b9876b18da830bead78794d237886cd3c5c9
Reviewed-on: https://gerrit.libreoffice.org/57317
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-13 08:39:15 +02:00
Noel Grandin
50c63e5c2f pass OutlinerParaObject around by std::unique_ptr
SdrText::SetOutlinerParaObject was modified to not check for
self-assign, and instead assert because
the existing check was no longer possible.

Fix bug in SdrUndoObjSetText::Undo(), where it was calling
SdrText::SetOutlinerParaObject unnecessarily,
because NbcSetOutlinerParaObjectForText already does that.

Optimise Outliner::GetEmptyParaObject by creating a new constructor for
OutlinerParaObject,
so we don't need to copy the new object we get back from
GetEmptyTextObject, unnecessarily.

Change-Id: I57c475583d6c31658c154e24992b3d587bad9841
Reviewed-on: https://gerrit.libreoffice.org/56730
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-02 08:47:58 +02:00
Armin Le Grand
099eef24da AW080: Continued cleanups/remaps/corrections
Change-Id: I953f29e6a8d398e00884a600d6f4ceba880489a5
Reviewed-on: https://gerrit.libreoffice.org/55913
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-06-16 17:29:52 +02:00
Johnny_M
abe5a1a55f Translate German comments and debug strings
And correct a few comments (translation and grammar)

Change-Id: Ifafa521c683e9ca65aeba8031cd4cbfc1fadc137
Reviewed-on: https://gerrit.libreoffice.org/54888
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-06-06 13:46:09 +02:00
Armin Le Grand
4b4942224b SOSAW080: Derive SdrObjGroup from SdrObjList
Also simplify parent/child relationships, get rid
of double data (SdrPage/Parent infos in SdrObjects,
also in SdrObjList). This is all not needed - when a
SdrObject is inserted to a SdrPage, get SdrPage by
traveling over parents (no double info, member as soon
as inserted, ...).
More cleanups/reworks included, will need some more
cleanups, too.

Stabilizing: SetRectsDirty/DefaultStyleSheet

Had to correct the SetRectsDirty stuff for 3D due to
going down the hierarchy while the 2D implementation
goes the other direction -> endless loops. Added special
handling for 3D stuff for now (will be chnaged again when
SnapRect is no longer needed at SdrObject level).
Also had to adapt how the DefaultStyleSheet is set at
incarnated SdrObjects - better: their properties. Since
we now always have a SdrModel, it is possible to correctly
initialize with the correct default StyleSheet from that
SdrModel.
This needs to be done after ForceDefaultAttributes and in a
way that again deletes Items that are set in the StyleSheet.
This leads to an error in CppunitTest_sd_import_tests where
I checked tdf100491 - it is okay and thus I change the control
instance of the imported, XML-dumped file.
The less hard attributes, the better for Styles in general.

Cleanup of comments for last two commits

Corrected SvxShape::getParent()

Needed to get the direct parent, so test for SdrObject
first (to get SdrObjGroup/E3DScene), for SdrPage second

Fixed CppunitTest_sc_subsequent_export_test

Several problems arose. The used SdrCaptionObj was
Cloned, but the clone not inserted to a SdrPage. This
leads to not being able to access a UNO API imlementation
of the SdrPage (SvxPage) on lower levels.
It worked before due to SdrObject having a SdrPage*
additionally to being added to a SdrPage - this is exactly
the main cleanup this change does.
Looked for why it is cloned, could see no reasons. The
SdrCaptionObj exists during all im/export, not difference
to other SdrObjects (that do not get cloned). It is not
changed in any way. It *might* be to suppress a crash that
happened due to UNO API Service emfio/emfio not being
available in the UnitTest scenario. Interestingly it
did not crash with the cloned SdrCaptionObj, but the
Graphic exported was probably wrong.
Fixed by no longer Cloning the SdrCaptionObj and adding
emfio/emfio UNO API Service.

d139f821a5b39535a3e7b9c6261df7e18f8ae8ac
910e7f4bc628a715fda7545dffaf3369d5e76ea0
ca1de01b723051e09ac37d7ec7bba978beea41c5
3a76da1471dfe75e69847f64a6a3519ad21c8c9c

Change-Id: I986586e326b563acebf00d931a7084c6eb09e5f8
Reviewed-on: https://gerrit.libreoffice.org/54689
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-05-25 12:31:32 +02:00
Daniel
6a8ae73b4c tdf#99301 fix handouts selected order
Change-Id: I757d41a4ec2ce832b16243e9d9c6fbd5fba6add6
Reviewed-on: https://gerrit.libreoffice.org/53628
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-05-07 00:29:15 +02:00
Armin Le Grand
0fe7bda233 tdf#116879 Separate SdrObjList::Clear() as needed
SdrObjList::Clear() does broadcast the SdrObject
removals and deletions and a SetChanged() to SdrModel.
The old version avoided this in the destructor (with
a comment to not call virtual methods in destructor,
but  the problem is more that the ::Notify triggered
works on the SdrPage already in destruction). To allow
calls to Clear() without broadcasting I splitted this
to a impClearSdrObjList(bool bBrodacast) and rename
of ::Clear to ::ClearSdrObjList to get all places.
Adapted all places in the code as needed, already pre-
checked on Linux that this fixes the problem.

Change-Id: Iea46758fb6b57f2b3d9896959a35260c6f6d52d5
Reviewed-on: https://gerrit.libreoffice.org/53839
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-05-04 14:48:38 +02:00
Armin Le Grand
fda4b0f65e Take care of E3DObjList
E3DObjList is not needed, remove. Remove memeber from
E3DObject, derive E3DScene directly from SdrObjList, some
cleanups in SdrObject, too

Change-Id: Ifa4620a800c14faf21f8b80fd4dc1d39f71be804
Reviewed-on: https://gerrit.libreoffice.org/52740
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-04-16 21:21:37 +02:00
Noel Grandin
49eb02f07a new loplugin:unusedvariablemore
collection of heuristics to look for local variables that are never read
from i.e. do not contribute to the surrounding logic

This is an expensive plugin, since it walks up the parent tree,
so it is off by default.

Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06
Reviewed-on: https://gerrit.libreoffice.org/52450
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-11 09:48:10 +02:00
Armin Le Grand
dfefe448c4 SOSAW080: Added first bunch of basic changes to helpers
SOSAW080: Make SdrModel& prerequisite to SdrObjects

Added need for SdrModel& in constructors of SdrModel,
SdrPage, SdrView and SdrObjList. Builds, not finished.

SOSAW080: removed and replaced old SdrModel

Removed and replaced GetModel()/SetModel() in all using
classes (SdrObject, SdrPage, SdrView), added accessors
to new referenced SdrModel, adapted all accessing places.
Refactored/Extended ::Clone and ::operator== for these
classes to allow cloning objects to a target SdrModel.
Adapted places where this is done AFAP. Added quite some
comments (tagged with 'TTTT') where possible further work
is needed. Builds completely, thus checking in. This does
not mean that this change is done yet.

SOSAW080: Adapted SdrPage/SdrModel relationship

Also needed to work on copy-construction of SdrPage and hierarchy,
quite some stuff removed, no copy-constructor anymore, no
MigrateItemPool stuff. Builds well, test stuck, will need
some cleanup/finetunung

SOSAW080: Smaller corrections/includes adapted

SOSAW080: Smaller corrections/includes adapted

SOSAW080: Debugging/Stabilizing/MakeUnitTestWork

SOSAW080: Stabilized for UnitTests, cleanups

SOSAW080: Adapted GetObjGraphic to just take a const SdrObject&

SOSAW080: Removed ChangeModel from classes

Classes SvxTextEditSource and SvxDrawPage (including
TextEditSource stuff) do not need change of SdrModel
anymore.

SOSAW080: Adapted some comments to make more readable

SOSAW080: Corrected constructor

SOSAW080: getSdrModelFromUnoModel added override marks

SOSAW080: Added missing includes

SOSAW080: Corrected SdrPage constructor

SOSAW080: Corrected some SdrObject::Clone scenarios

Especially when cloning to another SdrModel and taking
the sdr::properties into account.

SOSAW080: Added include for Mac-Build

SOSAW080: Added Scale to DefaultProperties

If a SdrModel change happens in DefaultProperties copy
constructor (used from Clone()), potentially a Scale
for the SfxItems has to be done.

SOSAW080: Added missing include for MacBuild

SOSAW080: Corrected CppunitTest_sc_anchor_test

An adaption of a SdrPathObj instantiation was missing,
added that. Seems as if that test is no tpart of the
usual 'make' scenario, but used/executed in gerrit builds

SOSAW080: Reworked SvxShape to use SdrObject's SdrModel

SOSAW080: Reworked SvxShape to use SdrObject's SdrModel

SOSAW080: Free SdrObjects when SdrModel goes down

In an UNO API test problem is that SvxShapes reference
SdrShapes, but these are not added to a SdrPage and not
'owned' by the SvxShape. Thus these do not get deleted
at all (same in master, memory leak). I extended
SvxShape::Notify the case for ModelCleared to also
Free the SdrObject when not owner and it's not added to
a SdrPage (in that case it gets deleted with deleting
the SdrModel)

SOSAW080: Solve UNO API calls that move SvxShapes to other Model

Due to UNO API tests I got a call to insert an xShape to a
xDrawPage which was constructed in another Model, this has now to
be done by Cloning the SdrObject to the new SdrModel, getting
rid of the old one and getting all the UNO implementation
stuff right (referemces SdrObject <-> xShape).

1cb7d573d323e98a89761fe662c10c4a654fdec0
24617494a0ef79f6e33dfcb02782a833a81c6434
763f39094b6a48b529a6952d01468f8776c97679
242b9e228a9a042c3a5bdd38b1ea6600144276d5
242b9e228a9a042c3a5bdd38b1ea6600144276d5
33a6f3f306b70c223171aef796dd5ee041ad14df
6878b33f8b05738a44c0910e40a60a0f0d1d58ed
0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2
8c4626274a5cc531dad27f27c0c45d4c528fb2fb
446685a49a6d67aedd01cfbbd5e87b07f97a4d7b
c1b5ed3c99bc7219a0061e4ece24ea42afd2889a
22de9a1c8af7c25be5c108671ddc548ba323ed47
4caf6b6fbbe6e8130741d793dffb560fd01d4ed5
488b9601735ec1822433f82f633990063951fe08
c366d60299f239e3df856ddffedb19e743e4be0c
c5137ba8c597c7b5f90318df50e87b93a39a28dc
f9e646242cf89f6fde1315046952252a2c429779
f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410
1694b54903df784385abaa8452e1201e12344238
17bcb44d2e29920c0c74430c2d9c703b36cfa0ad
17bcb44d2e29920c0c74430c2d9c703b36cfa0ad
7b5c241faec7488924e5935ae8b19f785846b5e4
bf097ee7467895823fbd158a2a9543da3b5a5078

Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c
Reviewed-on: https://gerrit.libreoffice.org/52526
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-04-07 00:28:30 +02:00
Armin Le Grand
eba4d5b2b7 Revert "SOSAW080: Added first bunch of basic changes to helpers"
This reverts commit 6c14c27c75.
2018-04-06 22:32:24 +02:00
Armin Le Grand
6c14c27c75 SOSAW080: Added first bunch of basic changes to helpers
SOSAW080: Make SdrModel& prerequisite to SdrObjects

Added need for SdrModel& in constructors of SdrModel,
SdrPage, SdrView and SdrObjList. Builds, not finished.

SOSAW080: removed and replaced old SdrModel

Removed and replaced GetModel()/SetModel() in all using
classes (SdrObject, SdrPage, SdrView), added accessors
to new referenced SdrModel, adapted all accessing places.
Refactored/Extended ::Clone and ::operator== for these
classes to allow cloning objects to a target SdrModel.
Adapted places where this is done AFAP. Added quite some
comments (tagged with 'TTTT') where possible further work
is needed. Builds completely, thus checking in. This does
not mean that this change is done yet.

SOSAW080: Adapted SdrPage/SdrModel relationship

Also needed to work on copy-construction of SdrPage and hierarchy,
quite some stuff removed, no copy-constructor anymore, no
MigrateItemPool stuff. Builds well, test stuck, will need
some cleanup/finetunung

SOSAW080: Smaller corrections/includes adapted

SOSAW080: Smaller corrections/includes adapted

SOSAW080: Debugging/Stabilizing/MakeUnitTestWork

SOSAW080: Stabilized for UnitTests, cleanups

SOSAW080: Adapted GetObjGraphic to just take a const SdrObject&

SOSAW080: Removed ChangeModel from classes

Classes SvxTextEditSource and SvxDrawPage (including
TextEditSource stuff) do not need change of SdrModel
anymore.

SOSAW080: Adapted some comments to make more readable

SOSAW080: Corrected constructor

SOSAW080: getSdrModelFromUnoModel added override marks

SOSAW080: Added missing includes

SOSAW080: Corrected SdrPage constructor

SOSAW080: Corrected some SdrObject::Clone scenarios

Especially when cloning to another SdrModel and taking
the sdr::properties into account.

SOSAW080: Added include for Mac-Build

SOSAW080: Added Scale to DefaultProperties

If a SdrModel change happens in DefaultProperties copy
constructor (used from Clone()), potentially a Scale
for the SfxItems has to be done.

SOSAW080: Added missing include for MacBuild

SOSAW080: Corrected CppunitTest_sc_anchor_test

An adaption of a SdrPathObj instantiation was missing,
added that. Seems as if that test is no tpart of the
usual 'make' scenario, but used/executed in gerrit builds

SOSAW080: Reworked SvxShape to use SdrObject's SdrModel

SOSAW080: Reworked SvxShape to use SdrObject's SdrModel

SOSAW080: Free SdrObjects when SdrModel goes down

In an UNO API test problem is that SvxShapes reference
SdrShapes, but these are not added to a SdrPage and not
'owned' by the SvxShape. Thus these do not get deleted
at all (same in master, memory leak). I extended
SvxShape::Notify the case for ModelCleared to also
Free the SdrObject when not owner and it's not added to
a SdrPage (in that case it gets deleted with deleting
the SdrModel)

SOSAW080: Solve UNO API calls that move SvxShapes to other Model

Due to UNO API tests I got a call to insert an xShape to a
xDrawPage which was constructed in another Model, this has now to
be done by Cloning the SdrObject to the new SdrModel, getting
rid of the old one and getting all the UNO implementation
stuff right (referemces SdrObject <-> xShape).

Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c
1cb7d573d323e98a89761fe662c10c4a654fdec0
24617494a0ef79f6e33dfcb02782a833a81c6434
763f39094b6a48b529a6952d01468f8776c97679
242b9e228a9a042c3a5bdd38b1ea6600144276d5
242b9e228a9a042c3a5bdd38b1ea6600144276d5
33a6f3f306b70c223171aef796dd5ee041ad14df
6878b33f8b05738a44c0910e40a60a0f0d1d58ed
0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2
8c4626274a5cc531dad27f27c0c45d4c528fb2fb
446685a49a6d67aedd01cfbbd5e87b07f97a4d7b
c1b5ed3c99bc7219a0061e4ece24ea42afd2889a
22de9a1c8af7c25be5c108671ddc548ba323ed47
4caf6b6fbbe6e8130741d793dffb560fd01d4ed5
488b9601735ec1822433f82f633990063951fe08
c366d60299f239e3df856ddffedb19e743e4be0c
c5137ba8c597c7b5f90318df50e87b93a39a28dc
f9e646242cf89f6fde1315046952252a2c429779
f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410
1694b54903df784385abaa8452e1201e12344238
17bcb44d2e29920c0c74430c2d9c703b36cfa0ad
17bcb44d2e29920c0c74430c2d9c703b36cfa0ad
7b5c241faec7488924e5935ae8b19f785846b5e4
bf097ee7467895823fbd158a2a9543da3b5a5078
2018-04-06 22:29:02 +02:00
Noel Grandin
4beed2ba73 Revert "loplugin:changetoolsgen in sd" and reapply the plugin...
because I
(a) forgot to insert parentheses which changes the meaning of some expressions and
(b) I now use the AdjustFoo calls when changing unary operations, which reads much better

This reverts commit 0d9f3f7628.

Change-Id: I33f79bf755aedc1ed48d95f7b82f3fabed1347fb
Reviewed-on: https://gerrit.libreoffice.org/49834
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-16 13:23:40 +01:00
Vasily Melenchuk
3462a55f06 tdf#115345: removed slide orientation setting method.
Slide orientation is dependent value and can be easily calculated
based on slide dimensions.

Also modification of slide orientation without changing of page
dimensions brings page in inconsistent state.

Change-Id: I86921668b648a8110d16b31507f2ce5d6c88484a
Reviewed-on: https://gerrit.libreoffice.org/49334
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-02-15 14:04:02 +01:00
Noel Grandin
0d9f3f7628 loplugin:changetoolsgen in sd
Change-Id: I41c5510f95167fe028f219fb593f12b75709bd65
Reviewed-on: https://gerrit.libreoffice.org/49726
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-15 07:28:07 +01:00
Noel Grandin
d4a066c3e4 inline some defines
which don't add any value anymore

Change-Id: I45977d972d4d02926630b749d3ec736416138cf5
2018-01-19 14:30:50 +02:00
Stephan Bergmann
e1bdc38a0b More loplugin:cstylecast: sd
Change-Id: I77ed2793aad62377ec6fc2513e06e2371c1c77ad
2018-01-15 09:03:36 +01:00
Stephan Bergmann
abf7b94123 More loplugin:cstylecast: sd
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: I144975b94fe2725ac740a953ca2133e99f8a3fce
2018-01-12 20:16:43 +01:00
Noel Grandin
c690d38b06 TypedWhichId for EE_CHAR* constants
Change-Id: I261f8a949ddd858dee196118bb42993a101a2a28
Reviewed-on: https://gerrit.libreoffice.org/44829
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-17 11:11:50 +01:00
Noel Grandin
13b89618c4 use implict conversion operator in TypedWhichId
instead of spreading calls to Which() everywhere.

Change-Id: Ie32d106e44f5cb583908eeebe254ab8b8168ae61
Reviewed-on: https://gerrit.libreoffice.org/44760
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-16 07:54:24 +01:00
Noel Grandin
3588a48a82 TypedWhichId
use a strong-typedef template to give which IDs a type, which we can
carry around to do a
(a) little bit more convenience when Get()'ing them
and
(b) a little bit of enforcement of which PoolItem subclass each ID uses

Fix a bug in casting EE_PARA_BULLETSTATE to the wrong subclass
in AccessibleEditableTextPara::_correctValues

Change-Id: I015ce8b3b0f6d21308af182afa3caf122c877a5b
Reviewed-on: https://gerrit.libreoffice.org/44587
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-15 08:24:29 +01:00
Julien Nabet
127b828766 Revert "A first step to refactor ShapeList (sd)"
This reverts commit c5857a0371.

Change-Id: I59326867bdf71dcf20a86e03499884452675c557
Reviewed-on: https://gerrit.libreoffice.org/44284
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-11-03 19:40:45 +01:00
Julien Nabet
c5857a0371 A first step to refactor ShapeList (sd)
Change-Id: I5b036a9e2ba2b4c5eb784d7264adaa525fd4c08d
Reviewed-on: https://gerrit.libreoffice.org/44156
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-11-03 07:26:12 +01:00
Michael Stahl
11d2f3d6e1 vcl: make MapMode constructor explicit
Insert constructor everywhere, except a couple places that apparently
want to compare GetMapUnit().

Change-Id: I1910deb60562e5e949203435e827057f70a3f988
2017-10-26 23:17:45 +02:00
Caolán McNamara
c8adea5b14 ofz#3760 Divide-by-zero
Change-Id: I951d5f167effe8cb856e28afec890218df698fde
Reviewed-on: https://gerrit.libreoffice.org/43760
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-24 18:23:39 +02:00
Stephan Bergmann
3784e4d5ef loplugin:includeform: sd
Change-Id: I4b75316c8644a591e6d1cfab4945ef123f945b53
2017-10-23 22:45:55 +02:00
ekuiitr
a4a182e24d tdf#112689 - Replace chained O(U)StringBuffer::append() with operator+
replaced use of append with operator+

Change-Id: I9eb36fd1f94475df57de7015f8dfabf95676b87d
Reviewed-on: https://gerrit.libreoffice.org/43403
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-18 06:53:20 +02:00
Noel Grandin
d352dda3db tdf#112836 master view, bottom areas are wrongly positioned
Bug was introduced in
    commit 12b2803f19
    "drop unused PRESOBJ_IMAGE"

Change-Id: I50be74b505a674439bd8b67545b89a9660a85a33
Reviewed-on: https://gerrit.libreoffice.org/43062
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-03 11:01:46 +02:00
Tor Lillqvist
8e7897588d Rename the basegfx::tools namespace to basegfx::utils
Reduce potential confusion with the global tools namespace. Will
hopefully make it possible to remove the annoying initial :: when
referring to the global tools namespace. Unless we have even more
tools subnamespaces somewhere.

Thorsten said it was OK.

Change-Id: Id088dfe8f4244cb79df9aa988995b31a1758c996
Reviewed-on: https://gerrit.libreoffice.org/42644
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-09-26 14:18:41 +02:00
Noel Grandin
7d14555ef7 convert SvxDateFormat to scoped enum
And simplify the code in sd/headerfooterdlg, no
need for the complex encoding of date and time when we
can just index into a static array.

Change-Id: I677400bf1f956c81eba665b71dbda9183b63f55c
Reviewed-on: https://gerrit.libreoffice.org/42346
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-18 13:16:23 +02:00
Noel Grandin
0b021f89f6 rename some unnecessary contractions, Lft-Left, etc.
Change-Id: Idf4ab2d4d2550a02c0c50a981d94c67b111082a9
Reviewed-on: https://gerrit.libreoffice.org/41204
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-16 11:19:21 +02:00
heiko tietze
8fe86fb89b tdf#87592 Consistent terminology for Master Slides
All occurences of Slide Master and Master Pages are renamed to
Master Slide(s).

Change-Id: Idd75089f6c402b3d5e30a812b4c86aacc2f5d9bc
Reviewed-on: https://gerrit.libreoffice.org/40485
Reviewed-by: Yousuf Philips <philipz85@hotmail.com>
Tested-by: Yousuf Philips <philipz85@hotmail.com>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2017-08-06 00:01:37 +02:00
Noel Grandin
dafae0fe31 loplugin:constparams in sd
Change-Id: I833c6da99d5ccb8f6a8b5c905bee73b75fde0a89
Reviewed-on: https://gerrit.libreoffice.org/40700
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-03 11:06:54 +02:00
Noel Grandin
c9253818ec loplugin:oncevar
extend oncevar to any POD type

Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0
Reviewed-on: https://gerrit.libreoffice.org/40564
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31 08:25:07 +02:00
Caolán McNamara
00657aef09 migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl
* all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string")
* ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching
  MODULE .mo files
* UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui
  goes from l10n target to normal one, so the res/lang.zips of UI files go away
* translation via Translation::get(hrc-define-key, imbued-std::locale)
* python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there
  to keep finding the .hrc file uniform) so magic numbers can go away there
* java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation
  mechanism
* en-US res files go away, their strings are now the .hrc keys in the source code
* remaining .res files are replaced by .mo files
* in .res/.ui-lang-zip files, the old scheme missing translations of strings
  results in inserting the english original so something can be found, now the
  standard fallback of using the english original from the source key is used, so
  partial translations shrink dramatically in size
* extract .hrc strings with hrcex which backs onto
   xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap
* extract .ui strings with uiex which backs onto
   xgettext --add-comments --no-wrap
* qtz for gettext translations is generated at runtime as ascii-ified crc32 of
   content + "|" + msgid
* [API CHANGE] remove deprecated binary .res resouce loader related uno apis
      com::sun::resource::OfficeResourceLoader
      com::sun::resource::XResourceBundleLoader
      com::sun::resource::XResourceBundle
    when translating strings via uno apis
      com.sun.star.resource.StringResourceWithLocation
    can continue to be used

Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-21 08:20:50 +01: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
b59b4a38b4 loplugin:oncevar in sd
Change-Id: I56649b4df8c517f152ed4e9132985bbef22f8634
Reviewed-on: https://gerrit.libreoffice.org/39241
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-26 11:01:43 +02:00
Jens Carl
ecddd5ee9c tdf#39468 Translate some random German comments/terms
Change-Id: I5f3b430fa317d7da13d47c21f1fec6c489b05522
Reviewed-on: https://gerrit.libreoffice.org/39141
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-23 15:04:27 +02:00
Stephan Bergmann
13bb5a4b09 Make SfxItemSet ranges correct by construction
This is a follow-up to 45a7f5b62d "Keep WID ranges
sorted, and join adjacent ones".  While SfxItemSet::MergeRange relies on the
m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the
various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT)
that each individual range has an upper bound not smaller than its lower bound.
Arguably, all SfxItemSet instances should fulfill the stronger guarantees
required and checked by MergeRange.

And in many cases the ranges are statically known, so that the checking can
happen at compile time.  Therefore, replace the two SfxItemSet ctors taking
explicit ranges with two other ctors that actually do proper checking.  The
(templated) overload taking an svl::Items struct should be used in all cases
where the range values are statically known at compile time, while the overload
taking a std::initializer_list<Pair> is for the remaining cases (that can only
do runtime checking via assert).  Most of those latter cases are simple cases
with a single range covering a single item, but a few are more complex.

(At least some of the uses of the existing SfxItemSet overload taking a

  const sal_uInt16* pWhichPairTable

can probably also be strengthened, but that is left for another day.)

This commit is the first in a series of two.  Apart from the manual changes to
compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and
svl/source/items/itemset.cxx, it only consists of automatic rewriting of the
relevant SfxItemSet ctor calls (plus a few required manual fixes, see next).
But it does not yet check that the individual ranges are properly sorted (see
the TODO in svl::detail::validGap).  That check will be enabled, and the ensuing
manual fixes will be made in a follow-up commit, to reduce the likelyhood of
accidents.

There were three cases of necessary manual intervention:

* sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in
braced-init-list syntax now, so needs explicit narrowing conversion to
sal_uInt16.

* In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the
definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually.

* In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx,
sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx,
sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx,
some comments had to be put back (see "TODO: the replaced range can contain
relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx).

A few uses of the variadic form erroneously used nullptr instead of 0 for
termination.  But this should have been harmless even if promoted std::nullptr_t
is larger than promoted sal_uInt16, assuming that the part of the nullptr value
that was interpreted as sal_uInt16/promoted int was all-zero bits.  Similarly,
some uses made the harmless error of using 0L instead of 0.

Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35
Reviewed-on: https://gerrit.libreoffice.org/38861
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-16 17:28:41 +02:00
Stephan Bergmann
02d306a23a Use unique_ptr for SdPage::mpItems
Change-Id: I28025e8896331926d30e748f7c945973b978cb32
2017-06-14 11:47:28 +02:00
Caolán McNamara
2155e04d63 make string translation loading more uniform
change various ResId classes that use conversion operator to OUString to
functions that return a OUString

drop various defines

drop unnecessary toString calls

Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92
Reviewed-on: https://gerrit.libreoffice.org/37817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-19 15:40:40 +02:00
Noel Grandin
a651dbcfca convert SdrLayerId to strong_int
Also
- rename SetOfByte to SdrLayerIDSet
- add asserts in SdrLayerAdmin::GetUniqueLayerID so that we don't
  allocate overlapping SdrLayerID values
- add a new constant SDRLAYERPOS_NOTFOUND to be returned from
  SdrLayerAdmin::GetLayerPos

Change-Id: I3bb3489f9338e3d02c4040bcbd811744699941c8
Reviewed-on: https://gerrit.libreoffice.org/37467
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-12 09:54:23 +02:00