Commit Graph

230 Commits

Author SHA1 Message Date
Noel Grandin
ead920a48a loplugin:redundantcast handle dynamic_cast
Change-Id: I7855c76e820efce96778b1c19ec71dffcc4b4abb
Reviewed-on: https://gerrit.libreoffice.org/43621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-21 15:44:11 +02:00
Armin Le Grand
73360bdf0b RotGrfFlyFrame: Implemented Handle Update on rotation change
WIth rotaiton being allowed the handle visualisation may be
dependent on this, so it is necessary to refresh their
visualisation on rotation chnage, e.g. for crop handles

Change-Id: I218e326894999381fc4058b7eba432491a0cf23b
2017-10-20 14:13:23 +02:00
Armin Le Grand
d9b16effed RotGrfFlyFrame: Adapt Crop functionality to rotated Graphic
The FlyFrame which may contain a Graphic needs working Crop,
interactive and in core. Adapted this to work with now possible
rotation, changed common code in svx which has to handle cases
for Draw/Impress/Calc and Writer differently. Tried to use as
much in common as possible. Additionally furter adaptions
to rotation itself.

Change-Id: Ia961e9490e2627c74220b186116f5aa4fcabca78
2017-10-20 14:13:22 +02:00
Armin Le Grand
4ddd74e2d1 RotGrfFlyFrame: Minimal working rotation solution
This version allows rotation (in 10th degrees) and perserves
it over save/load cycles. Rotation of multiples of 90 degree
behave close to original except not changing the contained
Graphic and being adaptable to all kinds of graphic. The
rotated Graphic is displayed centered and under preserved
AspectRatio in the available frame space (so no rotation,
180 degree is identical, 90/-90 is identical with 1:1 ratio
of the graphic)

Change-Id: I54b3385f709ee0d34a55324aca919dcd2ce0c009
2017-10-20 14:13:21 +02:00
Armin Le Grand
a42b0985c7 RotGrfFlyFrame: Initial adaptions
To allow free rotation of Graphic FlyFrames in Writer,
several adaptions are necessary. This change takes care
of all needed changes to internally support a freely
definable rotation angle for that case. Save/Load round
trip is working, the graphic does no longer get modified
and added in 90-degree-changed state to the object, the
original will be preserved. Support for needed slot in
core/ui is implemented. Rotation can be applied from
Menus/Toolbars in the known 90/180 degree steps. Added
a slot/Button/command to reset rotation in these cases.
Added support in Sidebar to rotate using the rotation
wheel and/or numeric field. These fields and support added
to Image TabPage, too, fully functional.
Missing now is a solution for displaying the rotated
Graphic. For now, it just gets rotated, but this will not
be the final state of this change.

Change-Id: I6f3b85ebb5be2b4ad3311c536d54f27a37a494e7

RotGrfFlyFrame: Linux build adaptions

Change-Id: I365287ecd6525b1972e8436d61332f7121d88649
2017-10-20 14:13:20 +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
Armin Le Grand
302af8c2da sw: Use primitive renderer for graphics
To allow using the prepared VectorData of imported
Metafiles (and EMF+), let Writer use a Primitive
Renderer for Graphic output. For now, use a temp
PrimitiveRenderer (until sw is fully adapted to
primitives).

Change-Id: Iaa39111c5ef35a052394be6e4d1b86a5a8e33068
Reviewed-on: https://gerrit.libreoffice.org/41411
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-08-22 14:42:28 +02:00
Noel Grandin
98d7b40986 loplugin:constparams in sw part2
Change-Id: I51ae0e8caaf46f141d3d15ace47612df1e476de7
Reviewed-on: https://gerrit.libreoffice.org/40735
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-03 21:32:05 +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
0265bdb92e convert GRFILTER constants to ERRCODE_GRFILTER_
since various code mixes these constants in with ErrCode values from
other code, let us just make it into real ErrCode values.

Change-Id: Ifa3d0f7526172609a44e6749bed9f730ab6b1a95
Reviewed-on: https://gerrit.libreoffice.org/38313
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-02 09:00:13 +02:00
Miklos Vajna
87d62a6222 tdf#108056 sw SubtractFlys: work with a polypolygon directly
In case the intention is that the clip rectangle should include the
page, except a fly frame, we built a list of rectangles that covered
this area. This introduces the problem if adjacent rectangles don't join
perfectly.

Instead allow lcl_SubtractFlys() to work on a clip state directly, this
way the clip polypolygon will only contain two paths (the page rectangle
and the rectangle of the fly), so rounding errors can't happen.

Change-Id: I5b2e9a382aa7d16f3b16509670de754b5e00bd6d
Reviewed-on: https://gerrit.libreoffice.org/38066
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-05-26 17:25:44 +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
4763091bbe loplugin:constantparam
Change-Id: Ia9500b25602c14aadf49fe373682ae9d87a0a1a2
Reviewed-on: https://gerrit.libreoffice.org/37390
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-09 08:28:04 +02:00
Miklos Vajna
a5a571307f tdf#82580 tools: rename Rectangle to tools::Rectangle
Mostly generated using

make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle"

Except some modules have their own foo::tools namespace, so there have
to use ::tools::Rectangle. This commit just moves the class from the
global namespace, it does not update pre/postwin.h yet.

Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2
Reviewed-on: https://gerrit.libreoffice.org/35923
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-03-31 06:27:11 +00:00
Caolán McNamara
b3545786da Resolves: tdf#106748 infinite dashed line from annotations to FAR_AWAY things
we (very irritatingly) create dashed lines by creating a sequence
of dash drawing layer objects, so if its hugely long we create a hugely
long sequence

Change-Id: I38a0c6052cf058d5e02ebef7dd6a90e27f6e5454
Reviewed-on: https://gerrit.libreoffice.org/35781
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-03-28 15:38:01 +00:00
Noel Grandin
7f8bc0af4b convert MirrorGraph to scoped enum
Change-Id: I2eae815a10e23a7904e1aa54577a959cb8579172
Reviewed-on: https://gerrit.libreoffice.org/35179
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-15 06:45:52 +00:00
Noel Grandin
427678b9cf remove noise UUUU tags in comments
Change-Id: Id8a2940ae7348bf75ca967f31adf8489dc678d00
Reviewed-on: https://gerrit.libreoffice.org/35161
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-14 08:23:53 +00:00
Noel Grandin
bfde4866e0 convert DecodeMechanism to scoped enum
Change-Id: I5c56634b1bca8e37fa73d02d2428645301b6c547
2016-12-05 12:49:02 +02:00
Noel Grandin
803215142e convert INetURLObject::EncodeMechanism to scoped enum
Change-Id: I50ea17c7779c7b5cacddf548f1773fd7d6c8bade
2016-12-05 12:49:02 +02:00
Noel Grandin
b8aa1def37 convert ND constants to o3tl::typed_flags
Change-Id: I5fe3df5515017ec24db1184e8aca823714fcfdb3
Reviewed-on: https://gerrit.libreoffice.org/31343
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-29 08:20:23 +00:00
Justin Luth
d034f273cb tdf#90070 don't clip flys with borders
regression from commit e598ab0447
very aggressively forced a new frame size via compat setting
CLIPPED_PICTURES on any fly - not just images.

This only affects MS-format documents, EXCEPT that it is a document
property, so if the file every spent any part of it's life in MS-format,
it will always retain that compatibility setting. That explains
why the problem was intermittent for me - and was hard to reproduce
in a clean document, even though I'd seen it in .ODTs.

bIgnoreLine (ignore the fact that there is no visible line)
was a confusing word choice for "if there is no line,
then return a spacing size of zero". bEvenIfNoLine=false is better.

Change-Id: I50a3bdef3a67339ae517ee6319920651bc56f9be
Reviewed-on: https://gerrit.libreoffice.org/30585
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
2016-11-05 17:01:57 +00:00
Noel Grandin
e8260df1d6 loplugin:expandablemethodds in sw(part2)
Change-Id: Idc2118899a8063099b66c0f5db40d8402db063d1
Reviewed-on: https://gerrit.libreoffice.org/30083
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-20 17:55:01 +00:00
Noel Grandin
579426f798 loplugin:constantparam in sw
Change-Id: Ic49d1c3c7b57fb213964ddc21b0f774c762aad94
2016-09-08 09:23:40 +02:00
Armin Le Grand
9f0766917a tdf#50613 add support to load charts asynchronously
Generating primitives for chart visualisation can be moved to a
paralell executed task that loads the chart, thus speeding up
initial visualization. This is not possible for e.g. PDF or print
targets, only for edit visualization. On fallback, the replacement
images of the charts are used which are metafiles and have less
quality as primitives, but load quicker.

Change-Id: I68caa9e1bec50832bce535b5f54633d53cdef037
2016-07-07 22:32:38 +02:00
Armin Le Grand
64e1113916 tdf#50613 buffer OLE primitives for charts
If OLE is a chart, buffer the primitives used for presentation as
info at the SwOLEObj, after getting them the first time using the
ChartHelper.

Change-Id: I6d7486185f6eac450de9328d37ea800f424f351b
2016-07-07 22:32:38 +02:00
Noel Grandin
fe6ac2d11a Convert GfxLinkType to scoped enum
Change-Id: Iae074ef0927a55f1fbf401cb66f4f183213f547c
Reviewed-on: https://gerrit.libreoffice.org/25656
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-31 06:26:25 +00:00
Noel Grandin
850a8d27ca Convert GRAPHIC to scoped enum
Change-Id: I1fd09a729cbda00f99841532e0dd3fa66bce7bea
Reviewed-on: https://gerrit.libreoffice.org/25534
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-27 12:59:23 +00:00
Stephan Bergmann
14cd5182c5 Replace fallthrough comments with new SAL_FALLTHROUGH macro
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in
preparation of enabling -Wimplicit-fallthrough.  (This is only relevant for
C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.)

Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but
that would require adding back in dependencies on boost_headers to many
libraries where we carefully removed any remaining Boost dependencies only
recently.  (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its
future evolution will not have any impact on the stable URE interface.)  C++17
will have a proper [[fallthroug]], eventually removing the need for a macro
altogether.

Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-05-10 16:42:16 +02:00
Stephan Bergmann
85825e0fd5 Avoid reserved identifiers
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-04-22 10:08:07 +02:00
Noel Grandin
e15299b327 tdf#84938 convert FRM_ constants to scoped enum
Change-Id: I785d154a5df9a33b7d513dee1d3d859e5e800e7a
2016-03-31 13:23:03 +02:00
Noel Grandin
9585c8b8c8 loplugin:constantparam in sw
Change-Id: I56925a8fd776b3ee787cc26adbaa08c58dd022c0
2016-03-22 11:47:35 +02:00
Noel Grandin
c17ead7dc9 loplugin:commaoperator in sw/
Change-Id: I9b00755707687e4c10c02bf49866571f2c44d8ba
2016-02-22 16:04:36 +02: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
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
Norbert Thiebaud
45654a1d4d revert vcl patch series that brok Mac and Windows
revert:
9bc2f3de86
 vcl: add comment about ImplFontMetric::{Get|Set}LineHeight()
26371f105b
 vcl: FontAttributes::GetSlantType() -> FontAttributes::GetItalic()
2dd0b43173
 vcl: font.hxx and metric.hxx cleanup, make ctors explicit and the dtor virtual
5ab13bf3ea
 vcl: tabify font.hxx
f99550dae5
 vcl: change Font::SetName() to Font::SetFamilyName()
2b297116cb
 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
Andrzej Hunt
9d0b06e9f7 new loplugin rangedforcopy - use reference in range based for
Inspired by 6e6ae98037

Change-Id: Ia0f264d3a6bbf076aa5080e3398683e50bc6ef01
Reviewed-on: https://gerrit.libreoffice.org/20190
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-01-05 11:06:52 +00:00
Noel Grandin
58d8d8ac67 tdf#69977: uno::Sequence is expensive
when used as a mutable data-structure. Plain std::vector halves the time
taken to display the chart dialog

Create a class to represent the std::vector we are going to be passing
around, and move some of the utility methods into it to make the code
prettier.
Also create an optimised append(&&) method for the common case of
appending small temporaries.

Change-Id: I7f5b43fb4a8a84e40e6a52fcb7e9f974091b4485
2015-12-11 10:11:23 +02:00
Robinson Tryon
49c2b9808d bin/rename-sw-abbreviations.sh
This commit renames the most annoying abbreviations in Writer (and
partially in the shared code too).

Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
2015-11-25 06:07:38 -05:00
Michael Stahl
cc77a2a8f3 sw: loplugin:badstatics: convert static SwViewShell::mpReplaceBmp
... and mpErrorBmp to actual members (not just in name only).

Change-Id: Id02553451f1990dbc111e9c842247764bf7554bc
2015-11-13 11:03:08 +01:00
Stephan Bergmann
01b49802c7 loplugin:nullptr (automatic rewrite)
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
2015-11-10 10:31:53 +01:00
Stephan Bergmann
42cf4f9a27 loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)
Change-Id: I55970d363ab53eb78d580192006e52d9240d46fb
2015-11-06 09:37:55 +01:00
Miklos Vajna
580e57d11d sw: prefix members of SwCrsrMoveState
Change-Id: Iad3c970b263b8ee847cf6a7d2e05c5336cad9b26
2015-10-22 09:10:49 +02:00
Oliver Specht
89d39bc100 tdf#94559: 4th step to remove rtti.hxx
replaced use of PTR_CAST, IS_TYPE, ISA in
    idl, editeng, sc, sd, sw, sfx2, sot, starmath

Change-Id: I4a5bba4fdc4829099618c09b690c83f876a3d653
Reviewed-on: https://gerrit.libreoffice.org/19132
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-10-06 07:29:37 +00:00
Noel Grandin
e9c3583c2c improve the returnbyref loplugin
Change-Id: I1b510a6194282dfa4a9001d473127c5ebc8b44eb
Reviewed-on: https://gerrit.libreoffice.org/16731
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-06 07:04:50 +00:00
Andrea Gelmini
462e986e0d Fix typos
Change-Id: Id9296115f30858e7fd470a199e59343a96d7deec
Reviewed-on: https://gerrit.libreoffice.org/16712
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2015-07-04 10:18:19 +00:00
Miklos Vajna
8527dfbd4d SwFrm::Calc: use vcl::RenderContext
Change-Id: I98de3f5413756c494c677d592ea921155e4c08be
2015-06-29 15:39:12 +02:00
Miklos Vajna
a3413204d2 SwPageFrm::MakeAll: use vcl::RenderContext
One tricky part is that in generic SwFrm methods SwRootFrm may not have
a shell and doesn't need a vcl::RenderContext, either; so check for that
situation explicitly where the frame may be a root one.

Change-Id: I48f39fb7195290393fca34f75d8798fb5f960f46
2015-06-26 16:03:51 +02:00
Miklos Vajna
05e50b570f SwTextFrm::Format: use vcl::RenderContext
Change-Id: I468d662a612c951dc1482cfc685dee800bb11f82
2015-06-26 13:40:26 +02:00
Miklos Vajna
702cb2b284 SwAlignRect: use vcl::RenderContext
If the caller has a vcl::RenderContext already, use it. Otherwise just
use GetOut() on the shell in the caller for now.

Change-Id: I8070dd3d6622d211885067514d6eb728716830ee
2015-06-25 10:52:35 +02:00