Commit Graph

257 Commits

Author SHA1 Message Date
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
Noel Grandin
2da435922f loplugin:constantparam
Change-Id: Ia11bf93768d5f722b7fe62df15f24809cb7e7f04
Reviewed-on: https://gerrit.libreoffice.org/60280
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11 09:15:42 +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
Caolán McNamara
27fb6f2282 Resolves: tdf#119259 reused in-use SdStyleSheet removed by undo
since...

commit a4cd841541
Date:   Thu Feb 13 16:10:47 2014 +0530

    n#757432: Styles (rename &) copy to different decks.

    While copying slides to different slide decks,
    styles were not being copied if there is already one
    with the same name. This patch renames and copies those
    to keep the formatting intact.

if a SdStyleSheet is not freshly created, but reused, it ends up in
the rCreatedSheets list, and so when the copy is undone
(via SdMoveStyleSheetsUndoAction), the SdStyleSheet is unconditionally
remove from the StylePool and so its ref count hits 0 and is removed,
even though there are still objects depending on it.

the problem becames more common since...

bash-4.4$ git show 57db6e24b5
commit 57db6e24b5
Date:   Tue Aug 15 02:51:07 2017 +0530

    Removing old SfxItemSet::getHash usage

improves the SfxItemSet comparison.

Assuming that its correct to leave SdStyleSheetPool::CopySheets
with those reused SdStyleSheets in the list, change things so
that a flag is passed around to indicate if the SdStyleSheet
should be removed or not by undo

Change-Id: I82b5bd93183fd1ff9e67957ccfb5babef81fd36d
Reviewed-on: https://gerrit.libreoffice.org/59432
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-22 17:38:28 +02:00
Andrea Gelmini
e1328b89fa Fix typos
Change-Id: If0d8f4033d9bc20f521d33d732fb349f0df5eeef
Reviewed-on: https://gerrit.libreoffice.org/57822
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2018-07-23 23:38:57 +02:00
Tomaž Vajngerl
eb6ff07605 [API CHANGE] tdf#65353 Add more doc. settings more embedding fonts
- Add setting to embed used fonts only
- Add setting for filtering of Latin, Asian, Complex script fonts

Change-Id: I8d093ed05fdcef3715616c008f6eeaa8cfbcc850
Reviewed-on: https://gerrit.libreoffice.org/57167
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-07-10 16:14:59 +02:00
Armin Le Grand
4be44a7a6f SOSAW080: Cleanup of SdrModel
First step: Find all constructors/derivations, mark
all of them.

Removed two-value-constructors, adapted code as needed

Reduced constructors for SdrModel/FmFormModel
to a single one.

Removed PathName for List creation, this is not
needed and anyways all calls used the default
SvtPathOptions().GetPalettePath(). This is also
true for usage of IsFuzzing() that is also part
of the default creation process (without path).
All usages that need an extra-List were setting
it after construction explicitely.

Removed UseExtColorTable. This prevents a single
List to be not created by default, the ColorTable
which is replaced later by all callers that used
this. This is not needed since the default
ColorTable gets constructed just by default, no
expensive stuff is triggered (e.g. loading the
ColorTable). Thus now a default ColorTable is
created and kept for a short moment, destructed
again when a ColorTable is explicitely set.
Doing so is also more safe - it avoids not
creating a default-ColorTable and then not setting
one (what would be urgently required).

f23c24a8548d5246b77b1cc359ba89564538e81a
f124468c3898c5842d37123bdeb87d79a2b19c62

Change-Id: I865de4bb23f673c6684d83c2c6390439506dc5b6
Reviewed-on: https://gerrit.libreoffice.org/55028
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-05-31 15:53:51 +02:00
Armin Le Grand
3ca7be0983 Replace SVGFilter using SVGIO
Target of this change is to get rid of the SVGFilter
in current LO which is based on the standard-ODF importer
using it's functionality by passing in/handing over
temporary created XML-Stream-Data.

First step is to alternatively import the given SVG
file to a newly created Document and to strip the
existing Filter-Code.

Adding the first prototype of the changed import. It
is capable of importing the given SVG to the created
Draw/Impress document. It adds the SVG which gets imported
by SVGIO as GraphicObject. It adapts sizes and positions of
Page and GraphicObject to have a smooth import.

Adding stripping of SVGFilter and used ressources. Done
as deep as possible, hopefully all places found.

Adapted now to create an Impress document. Also added needed
adaptions to PageSize(s), including layout and PresObj stuff
to make all MasterPages/LayoutPages work correctly.

Added reaction on empty SVG. This is needed since the
PageSize is adapted to the Graphic. With empty Graphic
a Size(0,0) results and this goes wrong.

Change-Id: Ia364a5783bee7dadcbe91e700efbabc121cf98f9
Reviewed-on: https://gerrit.libreoffice.org/54096
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-05-18 20:11:35 +02:00
Jochen Nitschke
b4d36b5dcf remove some unused comphelper includes
and fix the fallout

Change-Id: I5d0c2040f57a3ac354a7e277592da31d09a5f359
Reviewed-on: https://gerrit.libreoffice.org/52894
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-15 11:17:24 +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
2d4988070b loplugin:useuniqueptr in SdDrawDocument
Change-Id: Ia207c25b091923738811aad4f367a76e9e026283
Reviewed-on: https://gerrit.libreoffice.org/51207
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-13 13:26:05 +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
Noel Grandin
fd88c4b454 use std::unique_ptr in SdrModel
Change-Id: I1475a12b600fdb693bad71d27dc628992b92588a
Reviewed-on: https://gerrit.libreoffice.org/46346
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-13 07:49:19 +01:00
Jochen Nitschke
e641975076 clang-tidy modernize-use-equals-default in sd
Change-Id: Ib3d3bb1a0484cb8bb6411444254644252e3614cf
Reviewed-on: https://gerrit.libreoffice.org/45293
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-26 21:15:09 +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
Caolán McNamara
9cb2962197 rename AvoidConfig to Fuzzing
cause that's what its really used for and a couple of cases
are not specifically about avoiding config but avoiding uninteresting
disk acccess and what not

Change-Id: I4c6454f98388579fcd0bf9798321d30408ab65ee
Reviewed-on: https://gerrit.libreoffice.org/44491
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-09 00:16:43 +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
Stephan Bergmann
3784e4d5ef loplugin:includeform: sd
Change-Id: I4b75316c8644a591e6d1cfab4945ef123f945b53
2017-10-23 22:45:55 +02:00
Noel Grandin
d54e586166 use std::unique_ptr in SdDrawDocument
Change-Id: Id02cf2615b7697df589f612d21219200d3fab082
Reviewed-on: https://gerrit.libreoffice.org/43542
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-19 21:21:25 +02:00
Michael Meeks
f2de8a282a Revert "Disable spellcheck when LOK is active"
This reverts commit c92ebc8503.

Change-Id: Idd01cffbd71643d5a9132b518432c5e173b4787a
Reviewed-on: https://gerrit.libreoffice.org/42270
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2017-09-14 12:59:59 +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
Caolán McNamara
6549993b17 ensure safe GlobalEditData release of xForbiddenCharsTable
ensure that when the editeng GlobalEditData dtor is called
that the vtable of the xForbiddenCharsTable shared_ptr will
point to functions that are callable from editeng.

otherwise a shared_ptr created in the sw uwriter cppunit test,
but now belonging to GlobalEditData, will have deleter entries
pointing to functions in uwriter that have been unloaded and
are not available anymore

Change-Id: I375a84156c0b1a0f8b24194fc07f0c512f556dbc
Reviewed-on: https://gerrit.libreoffice.org/39605
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-06 09:29:45 +02:00
Caolán McNamara
12a3f5cefe rework as a shared_ptr
mostly to try and track down a crash on exit of sw uwriter under
windows

Change-Id: Id67e93863056da319dd8225038d60a7f5783b103
Reviewed-on: https://gerrit.libreoffice.org/39604
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-06 09:28:10 +02:00
Noel Grandin
60f3e9b67e loplugin:unusedfields in sd part3
Change-Id: Id8277e4b3dc9776715a7bd85e1a4f6610aad9b19
Reviewed-on: https://gerrit.libreoffice.org/39061
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-22 08:44:08 +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
d4e9fe5a73 loplugin:checkunusedparams in sfx2
Change-Id: Iea88ddd619f10a2a2586ee24edbf07e246dcbb49
Reviewed-on: https://gerrit.libreoffice.org/37191
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-04 12:05:29 +02:00
Noel Grandin
87661a7ab3 loplugin:checkunusedparams in sd
Change-Id: I217a4177e9c2cdc2d85100d253f7f38ec8aad756
Reviewed-on: https://gerrit.libreoffice.org/37162
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-03 09:07:53 +02:00
Noel Grandin
1cfedbc960 drop SvxNumType and rename SvxExtNumType->SvxNumType
Both of them are abstractions over the css::style::NumberingType
constants.
SvxNumType serves no useful purpose, since it's just a typedef to
sal_Int16.
At least SvxExtNumType wraps up the css::style::NumberingType constants
in a nice enum.

Change-Id: I7b3f97cd42b0aa23aff7a4db4930da86149d4f4e
Reviewed-on: https://gerrit.libreoffice.org/34816
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03 12:13:44 +00:00
Noel Grandin
afaa10da25 make SfxItemSet with SAL_WARN_UNUSED
Change-Id: Ia74ca329d8438f614169031acfbe0406faf7c281
Reviewed-on: https://gerrit.libreoffice.org/33268
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-19 05:41:29 +00:00
Bartosz Kosiorek
741b56fc09 tdf#42949 Remove unused uno headers from /sd/source/core
Change-Id: Idab4a8c35474a973ee98e060b99a5ed679dc14ea
Reviewed-on: https://gerrit.libreoffice.org/31098
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-23 07:29:33 +00:00
Noel Grandin
beb8cfcf32 convert inventorId to scoped enum
SW_DRAWLAYER had the same value as SC_DRAWLAYER, so I merged it into the
ScOrSwDraw enum constant

Change-Id: I5c45d378c00364d11cc960c9e48a6e3f10928724
Reviewed-on: https://gerrit.libreoffice.org/31037
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-21 12:09:09 +00:00
Noel Grandin
72ffa98e89 make the element names in dumpAsXml match the class names
Change-Id: I955facfe3e901fcb76798dab342f96a67d5ac63f
Reviewed-on: https://gerrit.libreoffice.org/30894
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-16 09:20:59 +00:00
Arnold Dumas
2b3cf45bb5 tdf#95416: Get rid of #include ../foo/bar.hxx style includes
Change-Id: I6c6e0d4e013c5101f7b78bb8506a6f1f0e1b1497
Reviewed-on: https://gerrit.libreoffice.org/29934
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2016-10-17 08:01:06 +00:00
Dilek Uzulmez
403bb51074 tdf#95416 Get rid of #include ../foo/bar.hxx style includes
Change-Id: Ic8cf5a305a8249ec64f33b23175370708ddf254e
Reviewed-on: https://gerrit.libreoffice.org/29901
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-10-16 12:43:14 +00:00
Noel Grandin
04e544dd51 rename sd::Outliner to SdOutliner
having a top level data structure share a name with one of its
supertypes makes it very hard to grep

Change-Id: Id5145c12c8fd9e8c8fb09897896eae0da7bfdefe
2016-10-14 10:11:10 +02:00
Noel Grandin
e588aa4d34 convert PageKind to scoped enum
Change-Id: I7f90cf2e96b72031bcfff558794e6cb42ea408e8
2016-10-11 14:32:40 +02:00
Noel Grandin
d58c604eb3 convert DocumentType to scoped enum
Change-Id: I5a66d71db075df4680c54676dd1420e94c1a90b2
2016-10-11 14:32:40 +02:00
Jacek Fraczek
f004aa9951 tdf#89307: Removed SvRef::operator T*()
Conditional statements are using SvRef::Is() method.
Changed static_cast<T*>(svRef<T>) occurances to svRef.get().
Added operator == and != to SvRef.

SbxObject::Execute is using SbxVariableRef internally.
SbxObject::FindQualified is using SbxVariableRef internally.

Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395
Reviewed-on: https://gerrit.libreoffice.org/29621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-10 08:48:30 +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
ba3521f288 add more dumpAsXml()
and make it format the output nicely, so I don't have to use 'xmllint
--format' before I can read it.

Change-Id: I065ee93193f3c6c7bab87212ab96021fb0d7c5ed
Reviewed-on: https://gerrit.libreoffice.org/29407
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-03 06:08:14 +00:00
Stephan Bergmann
5e0edd5faf Fix "ubsan: 9 is not a valid value for type ´SvxNumType´" once again
...after 1658bd231b "loplugin:unusedenumvalues"
broke it again after 992fba98f4 "ubsan: 9 is not a
valid value for type ´SvxNumType´" had fixed it the last time.

This time, acknowledge that SvxNumType can apparently take on rather arbitrary
sal_Int16 values from the css::style::NumberingTypes constants, and make it an
alias for sal_Int16 (whether or not keeping such a trivial alias is good or bad
overall).

Or is the bug elsewhere, and values of type SvxNumType should really only take
on the restricted set of values originally encoded by the enum?  At least the
below UBSan backtrace (from CppunitTest_sw_rtfexport) suggests otherwise, but
then again there's also an SvxExtNumType enum (include/editeng/svxenum.hxx),
encompassing more parts of css::style::NumberingTypes.  Oh, my.

> svx/source/items/pageitem.cxx:49:25: runtime error: load of value 9, which is not a valid value for type 'SvxNumType'
>  #0 0x2aafdaebe669 in SvxPageItem::SvxPageItem(SvxPageItem const&) svx/source/items/pageitem.cxx:49:25
>  #1 0x2aafdaebf194 in SvxPageItem::Clone(SfxItemPool*) const svx/source/items/pageitem.cxx:59:16
>  #2 0x2aaf7fab9b7c in SfxItemPool::Put(SfxPoolItem const&, unsigned short) svl/source/items/itempool.cxx:632:40
>  #3 0x2aaf7fc4794a in SfxItemSet::Put(SfxPoolItem const&, unsigned short) svl/source/items/itemset.cxx:467:56
>  #4 0x2aaf7fb96635 in SfxItemSet::Put(SfxPoolItem const&) include/svl/itemset.hxx:131:42
>  #5 0x2aaf7fb89539 in SfxItemPropertySet::setPropertyValue(SfxItemPropertySimpleEntry const&, com::sun::uno::Any const&, SfxItemSet&) const svl/source/items/itemprop.cxx:256:14
>  #6 0x2aaf9ef1a5d4 in void SwXStyle::SetPropertyValue<(unsigned short)1>(SfxItemPropertySimpleEntry const&, SfxItemPropertySet const&, com::sun::uno::Any const&, SwStyleBase_Impl&) sw/source/core/unocore/unostyle.cxx:1596:14
>  #7 0x2aaf9ef3c72f in SwXStyle::SetStyleProperty(SfxItemPropertySimpleEntry const&, SfxItemPropertySet const&, com::sun::uno::Any const&, SwStyleBase_Impl&) sw/source/core/unocore/unostyle.cxx:2013:9
>  #8 0x2aaf9ef8103d in SwXPageStyle::SetPropertyValues_Impl(com::sun::uno::Sequence<rtl::OUString> const&, com::sun::uno::Sequence<com::sun::uno::Any> const&) sw/source/core/unocore/unostyle.cxx:3025:17
>  #9 0x2aaf9ef821ee in SwXPageStyle::setPropertyValues(com::sun::uno::Sequence<rtl::OUString> const&, com::sun::uno::Sequence<com::sun::uno::Any> const&) sw/source/core/unocore/unostyle.cxx:3053:9
>  #10 0x2ab00730d08b in writerfilter::dmapper::SectionPropertyMap::ApplyProperties_(com::sun::uno::Reference<com::sun:🫘:XPropertySet> const&) writerfilter/source/dmapper/PropertyMap.cxx:1489:24
>  #11 0x2ab00731cede in writerfilter::dmapper::SectionPropertyMap::CloseSectionGroup(writerfilter::dmapper::DomainMapper_Impl&) writerfilter/source/dmapper/PropertyMap.cxx:1331:13
>  #12 0x2ab006b9ede2 in writerfilter::dmapper::DomainMapper::lcl_endSectionGroup() writerfilter/source/dmapper/DomainMapper.cxx:2823:30
>  #13 0x2ab0071db9f9 in writerfilter::LoggedStream::endSectionGroup() writerfilter/source/dmapper/LoggedResources.cxx:101:5
>  #14 0x2ab006712a3b in writerfilter::rtftok::RTFDocumentImpl::sectBreak(bool) writerfilter/source/rtftok/rtfdocumentimpl.cxx:633:18
>  #15 0x2ab0067a8c13 in writerfilter::rtftok::RTFDocumentImpl::popState() writerfilter/source/rtftok/rtfdocumentimpl.cxx:2789:13
>  #16 0x2ab006a26134 in writerfilter::rtftok::RTFTokenizer::resolveParse() writerfilter/source/rtftok/rtftokenizer.cxx:105:33
>  #17 0x2ab0067194f9 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) writerfilter/source/rtftok/rtfdocumentimpl.cxx:740:27
>  #18 0x2ab0075ebae7 in RtfFilter::filter(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) writerfilter/source/filter/RtfFilter.cxx:147:20
>  #19 0x2aafcf2873a5 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::uno::Reference<com::sun::text::XTextRange> const&) sfx2/source/doc/objstor.cxx:2261:30
>  #20 0x2aafcf22d4d2 in SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:764:23
>  #21 0x2aafcf4a4d09 in SfxBaseModel::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) sfx2/source/doc/sfxbasemodel.cxx:1841:36
>  #22 0x2aafcfde31b3 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&, com::sun::uno::Reference<com::sun::frame::XFrame> const&) sfx2/source/view/frmload.cxx:698:28
>  #23 0x2aaffef07028 in framework::LoadEnv::impl_loadContent() framework/source/loadenv/loadenv.cxx:1110:37
>  #24 0x2aaffeeead5a in framework::LoadEnv::startLoading() framework/source/loadenv/loadenv.cxx:379:20
>  #25 0x2aaffeee3919 in framework::LoadEnv::loadComponentFromURL(com::sun::uno::Reference<com::sun::frame::XComponentLoader> const&, com::sun::uno::Reference<com::sun::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) framework/source/loadenv/loadenv.cxx:165:14
>  #26 0x2aafff10ddac in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) framework/source/services/desktop.cxx:596:12
>  #27 0x2aafff10e11a in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) framework/source/services/desktop.cxx:582:64
>  #28 0x2aafab4c3938 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) unotest/source/cpp/macros_test.cxx:50:60
>  #29 0x2aaf90aee900 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) sw/qa/extras/inc/swmodeltestbase.hxx:621:23
>  #30 0x2aaf90aed267 in SwModelTestBase::load(char const*, char const*) sw/qa/extras/inc/swmodeltestbase.hxx:610:16
>  #31 0x2aaf90aec404 in SwModelTestBase::executeImportTest(char const*) sw/qa/extras/inc/swmodeltestbase.hxx:222:13
>  #32 0x2aaf90cf4d31 in testTdf65642::Import() sw/qa/extras/rtfexport/rtfexport.cxx:1013:1
>  #33 0x2aaf90cf62af in CppUnit::TestCaller<testTdf65642>::runTest() workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:166:6
>  #34 0x2aaf4ee5d7dd in CppUnit::TestCaseMethodFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5
>  #35 0x2aaf680c4cd6 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) test/source/vclbootstrapprotector.cxx:36:14
>  #36 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
>  #37 0x2aaf5ea4a8a6 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89:12
>  #38 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
>  #39 0x2aaf5abd5ef4 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:65:16
>  #40 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
>  #41 0x2aaf4ed8c2ef in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12
>  #42 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
>  #43 0x2aaf4ee14101 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:77:18
>  #44 0x2aaf4eede065 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:181:28
>  #45 0x2aaf4ee5a929 in CppUnit::TestCase::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91:13
>  #46 0x2aaf4ee60ad3 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
>  #47 0x2aaf4ee5fa3d in CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
>  #48 0x2aaf4ee60ad3 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
>  #49 0x2aaf4ee5fa3d in CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
>  #50 0x2aaf4ef1eeb6 in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:27
>  #51 0x2aaf4eedbe79 in CppUnit::TestResult::runTest(CppUnit::Test*) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:148:9
>  #52 0x2aaf4ef20440 in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96:14
>  #53 0x52b642 in (anonymous namespace)::ProtectedFixtureFunctor::run() const sal/cppunittester/cppunittester.cxx:305:20
>  #54 0x52604d in sal_main() sal/cppunittester/cppunittester.cxx:455:20
>  #55 0x524192 in main sal/cppunittester/cppunittester.cxx:362:1
>  #56 0x2aaf50b3c730 in __libc_start_main (/lib64/libc.so.6+0x20730)
>  #57 0x437658 in _start (workdir/LinkTarget/Executable/cppunittester+0x437658)

Change-Id: Id170860cbff9f4cae5c87cb5cfc70ffe3bc8c9c5
2016-09-20 16:45:47 +02:00
Caolán McNamara
74844277cc disable generation of ole previews in ODF format until after load
so the user update links dialog can control their generation

SdrEmbedObjectLink becomes exposed to calc so it can
detect if the link dialog needs to be used to update
ole links.

Change-Id: Id1dd7ea17342140eab9307d546528747e3a98090
Reviewed-on: https://gerrit.libreoffice.org/28879
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-15 11:55:28 +00:00
Khaled Hosny
cf425acfd4 tdf#56403: Text is right aligned in RTL locales
Draw/Impress is setting writing mode to RTL (which in turn sets text
alignment to right) if the current locale is RTL one. This does not make
sense at all since it means document prepared on a LTR locale and
contains LTR text will appear right aligned on RTL locales.

It would have slightly more sense if SetDefaultWritingMode() actually
just set a default (for e.g. new documents), but that is not the case
here as it affects all documents.

This was introduced in 2c32696a04 with a
branch merge and no further explanation.

Change-Id: Idee0f58e153498a6676a22242d2edd5054b908c6
Reviewed-on: https://gerrit.libreoffice.org/28411
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-08-30 17:22:41 +00:00
Noel Grandin
0552ec9828 convert SdrHintKind to scoped enum
Change-Id: I77ad33425d440263a71bc94f41d8e141f16dfb78
2016-08-22 08:24:48 +02:00
Caolán McNamara
396138a6bc Resolves: coverity#705366 Mixing enum types
and

coverity#705367 Mixing enum types
coverity#705371 Mixing enum types
coverity#982694 Mixing enum types
coverity#1027717 Mixing enum types
coverity#1371228 Mixing enum types
coverity#1371242 Mixing enum types
coverity#1371280 Mixing enum types
coverity#1371310 Mixing enum types

MapUnit and SfxMapUnit share the same values and
are freely cast from one to the other.

Now that

commit d30a4298bd
Date:   Thu Aug 11 15:02:19 2016 +0200

    loplugin:unusedenumconstants in package..svtools

removed the SfxMapUnit entries that were directly unused, they
don't match anymore and casting from one to the other is dangerous.

Why there was two of these anyway escapes me, get rid of SfxMapUnit
and just use MapUnit universally

Change-Id: I4db5dcd04b59be2f85b62b728f96c90afe00c57e
Reviewed-on: https://gerrit.libreoffice.org/28234
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-19 11:25:18 +00:00