/beanshell/

ce-5-2'>distro/cib/libreoffice-5-2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svddrgmt.cxx
AgeCommit message (Collapse)Author
2020-05-23lok: don't render shape selection overlays in lok mode.Michael Meeks
These are rendered client-side, doing it twice is a bug; also rendering of dashed-lines via drawinglayer decomposition is extraordinarily slow, so avoid it. Change-Id: I821f14699abd6bc9e7a6759c81edded2f792677d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86934 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-10-10rename TakeSdrDragComment to GetSdrDragCommentNoel Grandin
and return the value, instead of using an awkward out-parameter Change-Id: Ie1b2b31d36a2aa352b40b3582e0014e6b1f95390 Reviewed-on: https://gerrit.libreoffice.org/80549 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-09rename ImpTakeDescriptionStr -> ImpGetDescriptionStrNoel Grandin
and make it return the result, rather than doing it via an awkward out-parameter Change-Id: Ia47c66b4f1bae781a679f2f4311e321fdc947928 Reviewed-on: https://gerrit.libreoffice.org/80547 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-05use unique_ptr in SdrObject::getFullDragCloneNoel Grandin
Change-Id: I904f1f13bb4958e3457476e6e682ec7d7b97c670 Reviewed-on: https://gerrit.libreoffice.org/78660 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-12Fix typosAndrea Gelmini
Change-Id: I42f7ec098cb03cdbd4aa54b86f1c0171b317f956 Reviewed-on: https://gerrit.libreoffice.org/77282 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-03tdf#126180: EndTextEdit on all views before delete/cut slideXisco Fauli
This also reworks the fixes tdf#125824 and tdf#111522 to use EndTextEdit instead of blocking the undoing Change-Id: I73c2289a9d950465f020f684e9e736148380f5c5 Reviewed-on: https://gerrit.libreoffice.org/74989 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-06-07Related: tdf#111522 svx: fix crash with view1 doing textedit and resize/rotateMiklos Vajna
The two actually affected functions are SdrEditView::RotateMarkedObj() and SdrDragObjOwn::EndSdrDrag(), but it looks like the other functions in SdrEditView are safe to be changed the same way. I expect IsUndoEnabled() can't be changed, though: that would mean there would be no undo for the text edit itself, either. If other actions still crash, the pattern is the same: put a breakpoint on the SdrUndoAction constructor and see the backtrace to find the function that calls IsUndoEnabled() without calling CanDoSdrUndo() at the same time. Change-Id: If9324e311ec6e9f68a951559e903e14bb72ea31c Reviewed-on: https://gerrit.libreoffice.org/73669 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-05-10tdf#62699 Drop pass-through header file include/svx/svdattr.hxxGabor Kelemen
Change-Id: I04289589196ac69b31f75989d9252c79d03c890f Reviewed-on: https://gerrit.libreoffice.org/71633 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-08improve tools::Rectangle->basegfx::B2?Rectangle conversionNoel Grandin
Improve the conversion method to do something reasonable with empty Rectangle. Use the conversion method in more places. Change-Id: I48c13f3d6dae71f39f03f7939101e545c8125503 Reviewed-on: https://gerrit.libreoffice.org/71853 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-05-07tdf#62699 Drop pass-through header file include/svx/xattr.hxxGabor Kelemen
Change-Id: I8db9a4de494fbd045a0f4da810c3887ce62dd350 Reviewed-on: https://gerrit.libreoffice.org/71595 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-26svdtrans: nPi -> M_PI; nPi180 -> F_PI18000 to remove duplicatesMike Kaganski
Change-Id: Ia2c103a5b530d007f750e4a034b253b3ec5406ec Reviewed-on: https://gerrit.libreoffice.org/68368 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-02-22loplugin:unusedfields in svxNoel Grandin
Change-Id: I9f6a21066224c449d3fcc8a0d97cb32dae0a65f6 Reviewed-on: https://gerrit.libreoffice.org/68193 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-13Pointer is pointlessNoel Grandin
since it is just a wrapper around PointerStyle Change-Id: I51f065e0d4ad8bd91f5c84c5819048c720a19267 Reviewed-on: https://gerrit.libreoffice.org/67711 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29remove unnecessary "if (!empty()" checks before loopsNoel Grandin
found with git grep -n -A4 'if.*!.*empty' | grep -B3 -P '(\bfor)|(\bwhile)|(\bdo)' Change-Id: I582235b7cf977a0f9fb4099eb306fdb4a07b5334 Reviewed-on: https://gerrit.libreoffice.org/64169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-27Refactor calc non-linear ViewToDevice transformArmin Le Grand
This change solves the non-linear World-To-View trans- formation that calc uses due to it's screen rendering as good as currently possible (AFAIK). Calcv view is layouted on pixel base (due to better homogen distances and full pixel lines between cells), but this leads to having a non-linear transformation between discrete units (pixels, view) and model coordinates (World). In principle, each cell has it's own (so called) ViewTransformation -> the position on screen depends on the mappings of all cells top/left from it. This is obvioulsly non-linear and can sometimes be seen by producing 'offset' errors when many cells (small and thin) are shown in low zoom stages. No better solution for this comes to mind easily. The extremes are - on the one hand AntiAliasing the whole calc edit view and accept 'unsharp/AAed' lines - on the other hand what we have now. Maybe a future solution could find a mapping that gets close to linear mapping for the full view. On the long run this state is hard to keep correct. Even with this extended solution the mapping of SdrObjects spawning mutiple cells is assumed 'linear' in that area - which is in reality currently not the case (!) Note: This is only true for the screen visualization, print and/or PDF export do not do that pixel-based layouting. Note2: This mechanism is general in DrawingLayer (look for '.*GridOffset.*'. If it is deactivated by providing no offsets, the result is the unchanged, linear mapping. First step: Add interfaces to get a possible GridOffset at ViewObjectContact. There it belongs, we have a view- dependent offset per object and view. Add mechanisms to create on-demand and reach back to the view (aka calc's derivation of it). Second step: Implement the on-demand creation, adapt to use it in ViewObjectContact::getPrimitive2DSequence, add stuff to reset on zoom change, disable temporarily old mechanism -> paint already works. Need to adapt the places from old mechanism where the GridOffset was used, but no longer the geometry creations. Third step: Isolated and disabled old mechanism (by already removing SetGridOffset). Marked all places that possibly need change with '//Z' tag. Main work now will be to adapt in the SdrView implementations in svx to know about having a SdrObject-dependent ViewTransformation at all (currently not known, was hard-coded at some places from the old code, ViewTransformation set as MapMode at a target OutputDevice, not member at SdrView at all...). Fourth step: Adapt the Handles and OverlayObjects to use an evtl. existing GridOffset. The mechanism is that the SdrHdl(s) can be seen as 'Model-Objects', these get converted to OverlayObjects in the ::CreateB2dIAObject() implementations, for all SdrMarkView and SdrPageView, so this is the place where the ObjectContact is known (the SdrPageWindow *is* a ObjectContact) and the view- dependent GridOffset can be calculated per SdrObject. I modified OverlayObject to be able to work with a set Offset that embeds the created visualization using this additionally. Handles get now correctly set and have a working HitTest (due to that already using the primitives). Some inter- action stuff already working, some will need more adaption. We simply have no concept for this stuff... Refactored to not get dependencies to SdrObject in ObjectContact. Fifth Step: Make HitTest work by adding the View-And- Object dependent GridOffset in the View when HitTest is triggered. This is in SdrMarkView::CheckSingleSdrObjectHit where pObj->GetCurrentBoundRect() is used that gets the view-independent form. To make HitTest work, add a possible GridOffset. Since this will be necessary more often in SdrView hierarchy, added a tooling method (getPossibleGridOffsetForSdrObject) at that level after checking that at that level will be reachable at all potential spots. Inside that method the correct ObjectContact will be identified and the object-specific offset requested there. Sixth Step: Adaptions and started some cleanups. Still some adaptions needed: - After creation of new object, need to relocate from used GridOffset setting to WorldCoordinates - Interactions, e.g. start with dragging handles or full object/points Seventh Step: React on EndCreateObj. Here, the created SdrObject is in model coordinates and needs to be adapted to evtl. GridOffset. This is 'tricky' due to calculating the possible offset based on new coordinates 'close' to the target position, but may be in the wrong cell. Nonetheless this is the best we can do here. Last (hopefully) missing are now all interaction viszualizations. They already work and are applied correctly, but wrong visualized. Have taken the time to unify adding OverlayObjects for selection visualization to OverlayManager, see handleNewOverlayObject. This does all needed when adding OverlayObjects in one place where the GridOffset can also be handled. It makles things more safe - not possible to forget one of the three steps for others. Eighth Step: Do the same unification for creating the OverlayGeometry, also rename methods to make usage more clear. We now have SdrHdl::insertNewlyCreatedOverlayObjectForSdrHdl SdrDragMethod::insertNewlyCreatedOverlayObjectForSdrDragMethod which can do the needed GridOffset changes centralized. Needed to get a ObjectContact for this at SdrDragMethod, so adapted ::CreateOverlayGeometry implementations accordingly. Missing is now the implementation in insertNewlyCreatedOverlayObjectForSdrDragMethod to add the GridOffset - if used. This has no SdrObject at this time, so we will need a fallback to do the same using a Range (Rectangle). The stuff doing this for SdrObject already has a fallback and is based on using the Rectangle from the SdrObject anyways, so this will be possible. Ninth Step: Cleanup of old stuff (no more //Z), adapted some usages of OverlayObject creations to use getViewIndependentPrimitive2DContainer instead of the view dependent parts so that offset applied to drag-overlays is correct and not already added. Adapted insertNewlyCreatedOverlayObjectForSdrDragMethod to use calculateGridOffsetForB2DRange. Use now that instead of SdrObject-based approach in calc - is more generic. Getting closer, but still not complete - there is an error with dragging the grepped handle somehow - the offset for drag is somehow wrong. Tenth Step: Corrected that offset error. Of course at interaction start and progress (move) the coordinates are in GrifOffset coordinates and need to be corrected to Model coordinates. Done that at ::BegDragObj and ::MovDragObj, works well. Of course there are exceptions for the crop-handles, so needed to add setting the correct parameters at SdrHdl when these got created, then all works as expected. The strategy is to *not* change the model data itself in any way, instead do all changes/adaptions in the view-only code. This has minimal impact and is needed due to having a 1:n relationship between model and views anyways. There are two directions: All visualizations are adapted to take the GridOffset into account (SdrObjects, overlay, handles, InteractionObjects, ...). In the other direction input like MousePosition is in principle in calc EditView in 'GridOffset'-coordinates and needs to be mapped back before usage. Change-Id: I2ecdd409def96a7248a26a65a22e59eb962880a0 Reviewed-on: https://gerrit.libreoffice.org/64057 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-11-18Simplify containers iterations in svx/source/[s-u]*Arkadiy Illarionov
Use range-based loop or replace with STL functions Change-Id: I2ec3e58cc46c9286ef863c732912ca7a729bab62 Reviewed-on: https://gerrit.libreoffice.org/63522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-10tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski
Change-Id: I0b3c407331bfa1fa0c5003250d327d4f26de3643 Reviewed-on: https://gerrit.libreoffice.org/63235 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-07loplugin:collapseif in sdext..svxNoel Grandin
Change-Id: I188d9e9b53e00acfbae3c7acd54de28f084c4b3f Reviewed-on: https://gerrit.libreoffice.org/62985 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24clang-tidy performance-unnecessary-copy-init in svxNoel Grandin
Change-Id: I27f4dd0cb08f9b62496a1c51eed732a678e1c2e5 Reviewed-on: https://gerrit.libreoffice.org/62252 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15use range based loops over B2DPolyPolygon in svxJochen Nitschke
avoid copy when adapting polygon in SdrPathObj::ImpForceKind() Change-Id: Ifd830ecd181563102ee269c6a609ef8ebeab670c Reviewed-on: https://gerrit.libreoffice.org/61767 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09use unique_ptr in SfxUndoManager::AddUndoActionNoel Grandin
Change-Id: I11483e3cece12a7373f4276972b4c899edf1ce15 Reviewed-on: https://gerrit.libreoffice.org/61566 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann
...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-08-15loplugin:useuniqueptr in OverlayObjectListNoel Grandin
Change-Id: I641d93e54504c27bcc49bae8edf6286c0a9a471f Reviewed-on: https://gerrit.libreoffice.org/59024 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-10unnecessary null check before dynamic_cast, in svxNoel Grandin
Change-Id: I5174c9530d18e5d88ad8a41cc2bb02c6d090f3cf Reviewed-on: https://gerrit.libreoffice.org/58771 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-03Move angle normalization code from various places to toolsMike Kaganski
Also rename svx angle normalization functions in include/svx/svdtrans.hxx, that deal with 100ths of degree, to avoid confusion: NormAngle180 -> NormAngle18000; NormAngle360 -> NormAngle36000. Some places were fixed that previously returned inclusive ranges (i.e., both 0 and 360), see changes in these files: chart2/source/view/main/PlottingPositionHelper.cxx chart2/source/view/main/PolarLabelPositionHelper.cxx chart2/source/view/main/ShapeFactory.cxx filter/source/graphicfilter/idxf/dxf2mtf.cxx sw/source/core/graphic/grfatr.cxx (the latter now matches the comment in the function). Change-Id: I9f274bbb4168360d60dceff02aeba6332c519a59 Reviewed-on: https://gerrit.libreoffice.org/58556 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-05-08tdf#116977 secured ::Clone methodsArmin Le Grand
Renamed SdrPage::Clone -> SdrPage::CloneSdrPage Renamed SdrObject::Clone -> SdrObject::CloneSdrObject Giving SdrModel is no longer an option, but a must (as reference). This makes future changes more safe by force usage to think about it. Also equals the constructors which already require a target SdrModel. Done the same for ::CloneSdrPage. Change-Id: I06f0129e15140bd8693db27a445037d7e2f7f652 Reviewed-on: https://gerrit.libreoffice.org/53933 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-05-03loplugin:useuniqueptr in SdrDragMethodNoel Grandin
Change-Id: I73411368b55d53e83f45e0347663036f1f72c066 Reviewed-on: https://gerrit.libreoffice.org/53752 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-03tdf#117145 Cleanup MapMode handling between SdrModel/UNO APIArmin Le Grand
In current versions MapMode handling is done in ::TRSet/Get- BaseGeometry methods. These belong to SdrModel level and should not do any MapMode conversions (else all geometry and Rectangle setters/getters should have to do these, too). Instead, the UNO API implementation should do these, there are already some done there and this is the level which offers pure 100ThMM handling to the caller, independent from the used application. Change-Id: I3d7781440fc0fc6a20b5d4e79c747c988677483d Reviewed-on: https://gerrit.libreoffice.org/53748 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-04-26Drop uses of ImpGetResStr l10n method from svxGabor Kelemen
This is a wrapper above SvxResId without added value Change-Id: I1b0cdad3c01e741df1032d6a13aea74d66502144 Reviewed-on: https://gerrit.libreoffice.org/53489 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-18rename Neu->New in svxNoel Grandin
Change-Id: I77a49d55dd49b0fd41f5335ac30a5484ac130250 Reviewed-on: https://gerrit.libreoffice.org/53050 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-21loplugin:changetoolsgen in svxNoel Grandin
and fix the regex in the plugin for matching += operator Change-Id: I26b3e3fac1d4ef3e756cc9431b983b5f27ee76d6 Reviewed-on: https://gerrit.libreoffice.org/50037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-11SdrMarkView: provide OUString as return valueMatteo Casalin
Change-Id: I2d45f4ada683da4f69df6d81a072d2f3ba813dae
2018-02-11SdrModel: provide OUString as return valueMatteo Casalin
instead of modifying it through referenced parameter. Also modify related function names to Get* instead of Take*. Change-Id: Iac824562bb51d5388e6f56116fee01ba8b8909f4
2018-01-12More loplugin:cstylecast: svxStephan Bergmann
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: I100e6c14cbf1d780f0e5ebca6b0c9e71ce1caaf7