summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unodraw.cxx
AgeCommit message (Collapse)AuthorFilesLines
2017-11-24tdf#113938 sw: apply new default vertical orientation only during importMichael Stahl1-8/+15
Commit c79467ba954987f1d239c594c1e1b3af3f5515f6 changed the default vertical orientation for shapes in Writer; it turns out that at least one extension assumes the previous default. Tweak SwXShape so that the new default is used for shapes that are created during file import, otherwise the old default. Change-Id: I1dc4d3342dd53ce8e0857984456717b8ffcc97c7
2017-11-21loplugin:flatten in swNoel Grandin1-31/+32
Change-Id: I64176f48d90303f078e326c8838da9eb2daf8126 Reviewed-on: https://gerrit.libreoffice.org/44937 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-15Resolves: tdf#113615 wrong SwXShape from three possibilities returnedCaolán McNamara1-2/+18
There is the group object itself and the two subobjects all registered with this SwFrameFormat and the right line is randomly returned instead of the wanted one. Its possibly the presence of working a11y under gtk3 causing it to be the only platform apparently with this trouble with a11y querying for details of the grouped object Change-Id: I4d1bd3f826b630dd7734eb1decaf0211cd896894 Reviewed-on: https://gerrit.libreoffice.org/44729 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-02sw: ODF import: default as-char shapes to vertical-pos="top"Michael Stahl1-2/+8
The problem is that we don't render ShapesWithWrapping.odt the same as Word does: https://beta.opendocumentformat.org/rendercompare/upload/223/86/191/1 The first shape in the file is anchored "as-char" and has no style:vertical-rel or style:vertical-pos attribute affecting it. If Word would write either style:vertical-rel="baseline" or style:vertical-pos="top" explicitly, the rendering in LO would be the same. So the problem is that, for drawing shapes (note, text frames are images, embedded objects handled differently), LO's default vertical alignment is different, it is hard-coded in SwShapeDescriptor_Impl::GetVOrient() as SwFormatVertOrient(0, text::VertOrientation::NONE, text::RelOrientation::FRAME) This effectively positions as-char shapes *below* the baseline, which, while technically allowed, isn't really a good default. So fix this by making the default alignment dependent on the anchor type, so that as-char shapes sit on top of the baseline. The ODF filter sets the anchor type before inserting the shape in XMLTextShapeImportHelper::addShape(), however as it turns out the various MSO filters insert the shape before setting the anchor, which means the new default in SwXShape has an unwanted effect on them, as inserting the shape causes the default to be created. This requires changes to VML import to always set the VertOrient property, and to RTF import to set the anchor type before inserting. The DrawingML import is unaffected as it already sets VertOrient for every non-as-char shape. The testDmlTextshape "dml-textshape.docx" test still fails, but it turns out that the change in alignment for this test document is a bugfix, as it now has the same vertical alignment as in Word, so adapt the test. Change-Id: Ifcabd96a037515f7803f5474ec995f968b3b4de1
2017-09-29loplugin:flatten check for throw in then clauseNoel Grandin1-45/+42
also make the plugin ignore the case where we have var decl's in the clause we want to flatten, which could lead to problematic extension of variable lifetime Change-Id: I3061f7104e8c6a460bf74f5eac325a516ec50c59 Reviewed-on: https://gerrit.libreoffice.org/42889 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-26Rename the basegfx::tools namespace to basegfx::utilsTor Lillqvist1-1/+1
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-26loplugin:flatten in swNoel Grandin1-254/+248
Change-Id: I77d92e7adc9af5c88ca1930c25a0585713f9e0d3 Reviewed-on: https://gerrit.libreoffice.org/42788 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-25Drop gratuitous initial :: from comphelper::ProfileZoneTor Lillqvist1-1/+1
Change-Id: Iae7d86b857d0563d9ed9d9b4187e009554698412
2017-08-04loplugin:constparams in sw part5Noel Grandin1-1/+1
Change-Id: I6c33709aa407ccb3eee7026ab9b40dc4257de209 Reviewed-on: https://gerrit.libreoffice.org/40769 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-16Make SfxItemSet ranges correct by constructionStephan Bergmann1-4/+4
This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "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-16Profiling API: add ProfileZonesLászló Németh1-0/+3
Change-Id: Ie5669bd75d9b4be047d98402cb69ac313ab618df Reviewed-on: https://gerrit.libreoffice.org/38787 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-28coverity#1406097 Dereference null return valueCaolán McNamara1-2/+3
Change-Id: I6e6c3a87f571274b4bbd09adc1daaa07289240db
2017-05-20Remove "noel" SAL_WARNJulien Nabet1-6/+0
Change-Id: I1557af6563f9dfab03cca5696b4622ae18b805d4 Reviewed-on: https://gerrit.libreoffice.org/37856 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-05-12coverity#1406101 Dereference null return valueCaolán McNamara1-2/+3
and coverity#1406100 Dereference null return value coverity#1406099 Dereference null return value coverity#1406098 Dereference null return value coverity#1406097 Dereference null return value Change-Id: I26d5c0f2e69dc049a87a607ca28586dc575a8ca3
2017-05-12remove unused uno::Reference varsNoel Grandin1-3/+0
found by temporarily marking Reference as SAL_WARN_UNUSED. Change-Id: I18809b62654467f890016adcc92576980ced393b Reviewed-on: https://gerrit.libreoffice.org/37511 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-12convert SdrLayerId to strong_intNoel Grandin1-0/+6
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-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock1-0/+1
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-03use actual UNO enums in swNoel Grandin1-1/+1
Change-Id: If0f4a6532cc255f632d88d97e6b1a9e57462f5fc Reviewed-on: https://gerrit.libreoffice.org/35969 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna1-3/+3
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-25Fix typosAndrea Gelmini1-1/+1
Change-Id: I52604902247e7d8565476fafe98211fff32c5543 Reviewed-on: https://gerrit.libreoffice.org/35658 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-20convert RndStdIds to scoped enumNoel Grandin1-19/+19
Change-Id: I029ad67dfcbc40f3953adf485957efcbd97f23d0 Reviewed-on: https://gerrit.libreoffice.org/35328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-16convert SwUndoId to scoped enumNoel Grandin1-4/+4
Change-Id: I782fdd53641c0d7c629265b6179de70aa54382f9 Reviewed-on: https://gerrit.libreoffice.org/35246 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03Remove redundant 'inline' keywordStephan Bergmann1-2/+2
...from function definitions occurring within class definitions. Done with a rewriting Clang plugin (to be pushed later). Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8 Reviewed-on: https://gerrit.libreoffice.org/34874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-28new loplugin unoanyNoel Grandin1-1/+1
Change-Id: I5d6c4a67cb2a09e7cd5bd620c6b262d188701b89 Reviewed-on: https://gerrit.libreoffice.org/34714 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01loplugin:useuniqueptr extend to check local varsNoel Grandin1-3/+2
just the simple and obvious case for now, of a local var being allocated and deleted inside a single local block, and the delete happening at the end of the block Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625 Reviewed-on: https://gerrit.libreoffice.org/33749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26Remove dynamic exception specificationsStephan Bergmann1-73/+38
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-11-21convert inventorId to scoped enumNoel Grandin1-5/+5
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-09-28GetSvxShape does the same checks, so use it directlyCaolán McNamara1-7/+2
and drop the worthless unused xShapeTunnel Change-Id: Id9875691e8a01a11a84b0dd08a53fdee517924f4
2016-09-28Resolves: tdf#102358 writer cannot save 3d shape inserted from drawCaolán McNamara1-6/+3
because SwXShape::supportsService always returned true for com.sun.star.drawing.Shape I surmise that getSupportedServiceNames should always list com.sun.star.drawing.Shape as a supported service This went awry with... commit 2f50ce6cfab2871cd879c1429e1938d3642616ef Author: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Date: Thu Dec 5 19:17:18 2013 -0200 fdo#54938: Convert sw to use cppu::supportsService Change-Id: Ic27bf31e5eb991ccceb8b97713d1e50a736709c8 Signed-off-by: Stephan Bergmann <sbergman@redhat.com> Change-Id: I9821a620da8bac3b6b59da976a8c25bb2deafcf1
2016-09-22loplugin:unusedmethods in sc..vclNoel Grandin1-6/+0
Change-Id: I70fcf95dfd3db05b4fd6e5cee37866f673d3afa8 Reviewed-on: https://gerrit.libreoffice.org/29183 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann1-1/+1
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-08-29Get rid of pointless indirect function pointer variablesTor Lillqvist1-2/+2
Change-Id: Ic8eddec51d59b531ae22421b796a148267b9f3c1
2016-08-29Switch isTextBox to use the format pointersJan-Marek Glogowski1-30/+6
This replaces all possible occurences of the text box format maps, which just want to know, if a SwFrameFormat is part of a text box to use the direct lookup via the isTextBox, which is now a cheap call. Change-Id: I3b4e2301f816aead1b719cd70a8ef118e685ccfc
2016-08-24convert ShapeProperty to scoped enumNoel Grandin1-1/+1
Change-Id: I2e0dc3aaefb174c8960bb6b8ce9a4ad830626ba4
2016-08-23convert SdrIterMode to scoped enumNoel Grandin1-1/+1
Change-Id: Iaa4631039e6b96627d8e547f21136f107e157d8a
2016-08-18cppcheck: noCopyConstructorCaolán McNamara1-0/+3
Change-Id: Id5323cb6f52666f85965e11b07e4f2bca8af4e78
2016-07-15new loplugin unnecessary overrideNoel Grandin1-7/+0
Change-Id: I88d3e33823d68745b98625050a8a274f9ef04bcb Reviewed-on: https://gerrit.libreoffice.org/27135 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-07-08loplugin:redundantcast: redundant static_casts in swStephan Bergmann1-4/+4
Change-Id: I09c1ebaf5742e983ee05942a4c7c17c6aa5179cc
2016-06-16Remove the :: prefix in ::std for swMark Page1-2/+2
This patch was created using a script Variable name textual alignment is preserved to the same level Change-Id: I6b4858f8059b8cf71fc253e87d6df634362d62e9 Reviewed-on: https://gerrit.libreoffice.org/26306 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-06-10Clean up uses of Any::getValue() in swStephan Bergmann1-38/+35
Change-Id: Ifaa239ab3e285e8cf998339456ece5ce99008af9
2016-06-08tdf#96099 Remove various smart pointer typedefsMark Page1-1/+1
Change-Id: I76843139e43ca1c158a977e24d210d5af93e4d0f Reviewed-on: https://gerrit.libreoffice.org/26014 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-30Some clean up of uses of css::uno::Any::setValueStephan Bergmann1-5/+4
Change-Id: I04e8aef35a6083b61d775c8eb3f96757da2b31bd
2016-04-22Avoid reserved identifiersStephan Bergmann1-24/+24
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann1-1/+1
Change-Id: I5c33d8ed3551d9ad4432824995bfdc3f73cfc5f8
2016-04-18Avoid reserved identifier (_CreateShape -> CreateShape)Stephan Bergmann1-3/+3
Change-Id: Idcdd35302e60392fae9f63de1828e1a41ab89610
2016-04-18Avoid reserved identifier (_CreateSdrObject -> CreateSdrObject_)Stephan Bergmann1-2/+2
Change-Id: Iee63999e4953a083783cb5c9811640150616472d
2016-04-07Avoid reserved identifiersStephan Bergmann1-2/+2
Change-Id: I63ab4de02702c6f74caa3a65f7d297e2a95a65cd
2016-04-01tdf#97966 Drop 'static' keywordsWastack1-1/+1
Including no keywords from extern "C" blocks Change-Id: Ie3160af9decf04ceeda02dc20a6518afaa80f972 Reviewed-on: https://gerrit.libreoffice.org/23677 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-25bin/rename-sw-abbreviations.shlibreoffice-5-1-branch-pointRobinson Tryon1-8/+8
This commit renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
2015-11-16use initialiser list for Sequence<OUString>Noel Grandin1-3/+1
Change-Id: Ia5e47261d1fc6fac2d046656c05a1c5eedb07e02 Reviewed-on: https://gerrit.libreoffice.org/19978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>