summaryrefslogtreecommitdiff
path: root/include/svx/sdr/contact
AgeCommit message (Collapse)Author
2025-01-03Drop unneeded forward declarations from include/Gabor Kelemen
test drive the new bin/find-unneeded-includes --fwdecl mode Change-Id: I507fa2b172ec9e348d1d91066ea241f02187b5ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179321 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-10-17tdf#159007 Revert "optimization to skip SdrObject::GetViewContent()"Caolán McNamara
This reverts commit 313be607903a381830600c0a60b2e299fcaec685. Change-Id: I2dc7489ecc302473edd763fd0e4d6784fadc9bb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175094 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-29IASS: Update edited Text in other ViewsArmin Le Grand (allotropia)
This was not working for multiple Windows for a document, and also not supported for SlideShow until now. If you edit a Text on a Slide (Object, PresObj, ...) that text is not yet set at the Model until the TextEdit ends. In that situation those changes are now propagated to other views visualizing that object. This is done with slight slowdown to not do it all the time while typing, (currently 350ms, grepped from other places in the office). It will be shown in a running open SlideShow (and evtl. trigger an effect at the Object as Preview). This will allow to get a good preview for how it looks in the SlideShow. This is also done for further EditViews opened for that Document. This was not done before. It is fine-tuned to do this only for the Views besides the EditView with the running TextEdit to not cause slowdowns in that active view - the TextEdit is already running on the Overlay to have no problems with speed, this needs to be preserved. I had to fix a multi-view error in the a11y stack that implied that only one view exists and thus has to have an Outliner - that is wrong for multiple views, only one will have one. Change-Id: I781d32a8fcb8732ee8fcfbae72c02d1f99b6cd06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164160 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-02-12use more UNLESS_MERGELIBSNoel Grandin
Change-Id: I351a9127fb26369d8f598b6d6519d7e490fa476b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163190 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-06Rename ojects to objects!Hannah Meeks
Change-Id: Ia39f59d68a00efea18409a23e243007a9e6a96b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157574 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-03Related: cool#6911 opt to skip SdrObject::GetViewContent() when possibleCaolán McNamara
as seen in: https://user-images.githubusercontent.com/122848/253732636-3dfeddad-f146-4268-bde5-85788b72d539.svg SdrPageView::DrawLayer takes ~11% of the time when scrolling with many comments in calc, but none of these comments actually get drawn, all this effort is to find that they are not to be drawn. optimize ViewContactOfPageHierarchy impl over its parent impl to skip SdrObject::GetViewContent(), etc if the SdrObject isn't shown on the target layer. ViewObjectContactOfSdrobject::getPrimitive2DSequenceHierarchy does the same check, but after a set of allocations which is expensive in the case of SdrCaptions in a calc internal layer where there can be thousands of such objects. Change-Id: Iad86c77e8fa71ec90f54ce06d5a27c0380fb03ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155269 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-03Related: cool#6911 refactor for an optimizationCaolán McNamara
no change intended here Change-Id: I34b72776b1a05979fbe3a02ff1548b6aa8a183df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155268 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-21tdf#154955 svx: PDF/UA export: tag SdrObjGroup properlyMichael Stahl
ISO 14289-1:2014, 7.3 Graphics Graphics that possess semantic value only in combination with other graphics shall be tagged with a single Figure tag for each group. Also produce the missing alt-text. Change-Id: I78e802d8e17a29c2d19fcf3a7ec9961f8f04e391 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154684 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-12tdf#105362 better support for transparency in PNG & GIF exportArmin Le Grand (allotropia)
The granularity to decide at the SdrView what to paint was not fine enough, so I added code to get what we need: Do avoid page decorations (including PageBackgrund aka 'wiese'), but do include/process MasterPage content. Change-Id: I49df05abc89b4bcebc973c37d30be0a0c72e59ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154301 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-05-26tdf#155190 svx,sw: PDF export: don't tag SwNoTextFrame as ArtifactMichael Stahl
The problem is that inside of the Figure tag, in SwNoTextFrame::ImplPaintPictureGraphic(), ViewContactOfSwNoTextFrame and ViewObjectContactOfSwNoTextFrame are used to create and process another primitive sequence. ViewObjectContactOfSwNoTextFrame does not have access to a SdrObject, because that was already processed by the outer layer of code that called the SwFlyFrame painting code. Avoid running the code that assumes anything without an SdrObject is an artifact by disabling PDF tags altogether in ViewObjectContactOfSwNoTextFrame. (regression from commit 81ef84648515965bf67afaced946227d0f63a71e) Change-Id: I9fabe7f7e5296f8d850448ac44865f87cd164591 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152335 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-03-22vcl,drawinglayer,svx,sw,sd: PDF/UA export: Annot StructElem for SdrMediaObjMichael Stahl
veraPDF complains: Specification: ISO 14289-1:2014, Clause: 7.18.1, Test number: 1 An annotation, excluding annotations of subtype Widget, Popup or Link, shall be nested within an Annot tag This is very similar to Link annotations, that is to say, extremely complicated to get it thought the convoluted PDF export code, with additional complication that the StructElem is produced by drawinglayer and the page annotation by sw. Put another map into PDFExtOutDevData where sw code puts stuff for the SdrObject that drawinglayer can find. The test had the problem that PDFObjectParser::parse() could not handle: <</Nums[ 0 [ 6 0 R ] 1 6 0 R ]>> Fix dropping the "1". Change-Id: If5bf7c552e26ebb7e631030b8aaecd4281e77acc (cherry picked from commit c78e90bd28cc4d6d3bde473535107784b12d9c0d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149008 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-11-22tdf#135638 svx,sd: PDF/UA export: tag SdrObject shapes as Figure etc.Armin Le Grand (allotropia)
Move the code that already exists in sd class ImplRenderPaintProc to ViewObjectContact::getPrimitive2DSequence(), where it is used by all applications, and take into account the caching there, which matters for performance. Change-Id: Iabc00b7c894f042673c7217199236a05a5d67959 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142901 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-01-31tdf#146860 Vertical alignment of text inside grouped shapes textbox incorrectNoel Grandin
some stupid side effect at work regression from commit c1916d3ab8f764e465f889334050ce7c863576b3 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Wed Dec 8 12:25:58 2021 +0200 meRememberedAnimationKind is dead Change-Id: I7ba245a2096ed011f88e08f9d3a87021948e0b01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129219 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-12used cache value in ViewObjectContact::getPrimitive2DSequence (2nd attempt)Noel Grandin
Rely on the cached primitives in VOC. But only enable it for calc and draw right now, by adding a flag at the SdrModel level. This way we can leave it disabled for writer, where it definitely doesn't work. Change-Id: I11ca4836eb773c0f078cdb82056c6e0309d15a8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128319 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24tdf#146132 tdf#146327 tdf#146330Noel Grandin
regression from commit fe6a140a537eda1b6703c44ff5ee49d2ba875b81 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Tue Dec 7 14:55:13 2021 +0200 used cache value in ViewObjectContact::getPrimitive2DSequence Unfortunately various things like scrolling/zooming/moving item to new page do not seem to invalidate the VOC, and I can't track down the right place to do that, so just revert. Change-Id: I8009c99417f634b26adc770b6d6d2eb6969d9629 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127389 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24Recheck include/[s-x]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: Iaebddd648c52c175da17d2a55a1e8de82c213f4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127330 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-12-17Fix typosAndrea Gelmini
Change-Id: I7f1636226c4fbe29d9d2ef850318a9d57f1b5450 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127009 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-12-17fix for crash converting ooo31011-1.sxw and tdf#146132Noel Grandin
./instdir/program/soffice.bin --headless --convert-to odt ./ooo31011-1.sxw regression from commit 681e10eecf67a1a01bdec2cc9b834e0345e25206 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Dec 9 11:12:49 2021 +0200 tdf#146137 tdf#146132 image redrawing It is because we cache high-level primitives, and then during paint, we decompose those high-level primitives, and that triggers layout, which triggers an invalidate i.e. an ActionChanged(), which blows away the cached data we are iterating over. Change-Id: Id18e47b6c2b71a5404f24b075a43d2040a5e3509 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126995 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-09meRememberedAnimationKind is deadNoel Grandin
and removing it actually makes chart loading faster, because we now avoid always instantiaing the ObjectItemSet Change-Id: I48420bcc38c61e4f6b211724271bc61db0e1f0d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126572 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-08tdf#146108 Calc slow to change cell focus..Noel Grandin
in a document with a big background image Revert "tdf#136058: remove some caching" This reverts commit 57c40329a2b469813a1f357de355a37c8e3077ae. And add some comments for future would-be optimisers. Change-Id: Ie8686edc38dcdbe7d9e78599c1a259aab68278a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-06Revert "lose the caching in ViewObjectContact" because it breaks...Noel Grandin
bitmap caching. Added some notes for future would-be optimizers. This reverts commit 7f02cb80ac2075b65ee1adee4e29d1d5c4819424. Change-Id: I39c41ea95d23d4a65edd3cef46a5d86fab48a044 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126425 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2021-12-05use visitor in ViewObjectContact::createPrimitive2DSequenceNoel Grandin
to reduce intermediate object creation Change-Id: I03d34d15e88f82027f865868aca08503e38fd6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126372 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-04use visitor in getViewIndependentPrimitive2DContainerNoel Grandin
to reduce intermediate temporary data creation Change-Id: I3f13b0e02c1fa374e8d70768ae47c7f6da254462 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126322 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-03lose the caching in ViewObjectContactNoel Grandin
we reload the data every time anyway, so the caching is useless Change-Id: I575cc2fbe5a2fe9f42c58894f471cabb842cdd46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126273 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-03no need to create Primitive2DContainer hereNoel Grandin
we can just use the visitor API and skip a whole bunch of object creation Change-Id: If3dfa2fc1811e708963b8e6ecf4af6508b9f2a23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126216 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-20use Primitive2DDecompositionVisitor in ViewObjectContact (tdf#105575)Noel Grandin
..to avoid container construction Change-Id: Iae7a8ea8c31b6c8bcf4d161273be7b32fe41a021 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120779 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-16do less copying when constructing 2d sequence (tdf#105575)Noel Grandin
instead of constructing a child sequence, and appending that a parent sequence, just pass the parent sequence down the call hierarchy, so we end up doing less copying. Change-Id: If39a0779e543c6aa01f5e2e3ae63d395e0c85f7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120521 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-19loplugin:finalclassesNoel Grandin
improve the plugin to detect more cases. I only apply the new final changes to classes in /include here. Which reveals that RoadmapWizard::getPageController( TabPage* _pCurrentPage ) will always return nullptr Also needed to sprinkle some SAL_DLLPUBLIC_TEMPLATE around to workaround Visual Studio linking problems. Change-Id: Iadb7d46a9e0e73dabce562375ca013c0fea6690c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117365 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-17remove some cachingNoel Grandin
if we going to recreate it every time we call this method, there is no point in caching the result. Change-Id: Ie1f7bde86eca5cdd998fa8626303d3dead479ad3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114231 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-17tdf#141675 Incorrect position of shapeNoel Grandin
This reverts commit 44711d9eb53eb6247ebdb9293a3eb5e643f78059 tdf#130326 related, speed up drawing because it causes a regression. Change-Id: I19ea236b8541c1fe2557f43375bfef3ba555cfff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114183 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-10tdf#130326 related, speed up drawingNoel Grandin
if we create the list every time we call ViewContact::getViewIndependentPrimitive2DContainer then caching the result is rather worthless. So make the caching worthwhile, which means invalidating it when something changes. Change-Id: I081e9501255ec1c87454bfcc1e0a741109afa99f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113891 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-21tdf#123936 Formatting files in module include with clang-formatPhilipp Hofer
Change-Id: I0507dd797cd5a35e0ae14f4b69ee4e172d08a71a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105681 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2020-08-03tdf#42949 Fix IWYU warnings in include/[t-x]*/*hxxGabor Kelemen
Recheck after 7-0 branchoff Also drop the now unused file include/vcl/field.hxx Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9e54c82f50d1e02a0f99858939cac999fc66f7de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99261 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-19compact namespace: svxNoel Grandin
Change-Id: I15c64c6cc0ae2a0f1fb9a3e1651dda1d6ced7585 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99008 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-03use more compact namespace syntax in /includeNoel Grandin
excluding the UDK headers of course Change-Id: Iac7ab83d60265f7d362c860776f1de9d5e444ec0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93268 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-12move some svx/ headers inside the moduleNoel Grandin
Change-Id: I8d9a50039a8139caebb2cfb83ca476d39432f255 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-02tdf#128302: Split SVXCORE_DLLPUBLIC from SVX_DLLPUBLICStephan Bergmann
Using SVX_DLLPUBLIC for both Library_svxcore and Library_svx had started to cause failures with clang-cl on Windows now, presumably due to devirtualization: > linectrl.o : error LNK2001: unresolved external symbol "protected: virtual void __cdecl SvxMetricField::DataChanged(class DataChangedEvent const &)" (?DataChanged@SvxMetricField@@MEAAXAEBVDataChangedEvent@@@Z) > linectrl.o : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl SvxMetricField::PreNotify(class NotifyEvent &)" (?PreNotify@SvxMetricField@@MEAA_NAEAVNotifyEvent@@@Z) > linectrl.o : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl SvxMetricField::EventNotify(class NotifyEvent &)" (?EventNotify@SvxMetricField@@MEAA_NAEAVNotifyEvent@@@Z) > linectrl.o : error LNK2001: unresolved external symbol "protected: virtual void __cdecl SvxMetricField::Modify(void)" (?Modify@SvxMetricField@@MEAAXXZ) > linectrl.o : error LNK2001: unresolved external symbol "private: virtual bool __cdecl SvxFillAttrBox::PreNotify(class NotifyEvent &)" (?PreNotify@SvxFillAttrBox@@EEAA_NAEAVNotifyEvent@@@Z) > linectrl.o : error LNK2001: unresolved external symbol "private: virtual bool __cdecl SvxFillAttrBox::EventNotify(class NotifyEvent &)" (?EventNotify@SvxFillAttrBox@@EEAA_NAEAVNotifyEvent@@@Z) > C:\lo-clang\core\instdir\program\svxcorelo.dll : fatal error LNK1120: 6 unresolved externals Replacing certain uses of SVX_DLLPUBLIC with the newly introduced SVXCORE_DLLPUBLIC (include/svx/svxdllapi.h) has been done on Linux as follows: > git grep -w --line-number -e SVX_DLLPUBLIC --and --not -e '#define SVX_DLLPUBLIC' >LINES to produce a file LINES containing all 640 uses. (Conveniently, all uses happen to be on different lines.) Manually create a file TOKENS with 640 corresponding lines, each containing the (class or function) name that is made SVX_DLLPUBLIC by in the corresponding line in LINES. Then > nm -D --def instdir/program/libsvxcorelo.so | grep -ivw '[vw]' | c++filt >SVXCORESYMS > nm -D --def instdir/program/libsvxlo.so | grep -ivw '[vw]' | c++filt >SVXSYMS > n=$(cat TOKENS | wc -l) > for ((i=1;i<="$n";++i)); do > tok=$(head -n "$i" TOKENS | tail -1) > printf @ > grep -Fw "$tok" SVXCORESYMS >/dev/null && printf svxcore > printf @ > grep -Fw "$tok" SVXSYMS >/dev/null && printf svx > printf '@ ' > head -n "$i" LINES | tail -1 > done to generate 640 output lines detailing for each SVX_DLLPUBLIC name occurrene whether it is mentioned in exports from neither (@@@), only from svx (@@svx@), only from svxcore (@svxcore@@), or from both libraries (@svxcore@svx@). The numbers that gives is 10 @@@ 180 @@svx@ 424 @svxcore@@ 26 @svxcore@svx@ The 10 @@@ ask for follow-up clean up, but most of them are just left as SVX_DLLPUBLIC for now. The exceptions are sxv::ITextProvider (include/svx/itextprovider.hxx) and SdrCustomShapeGeometryItem::PropertyPairHash (include/svx/sdasitm.hxx, where PropertyPairHash is a member struct of SVXCORE_DLLPUBLIC SdrCustomShapeGeometryItem). Keeping them as SVX_DLLPUBLIC would cause "unresolved externals" errors when linking Library_svxcore on Windows. The 180 @@svx@ are fine to keep as-is, and the 424 @svxcore@@ need rewriting. The 26 @svxcore@svx@ needed manual inspection to decide (in some cases, the chosen name in TOKENS was a too generic function name like Fill, in other cases it was the name of a class exported from one library but also mentioned in the arguments of a function exported from the other). And for sdr::table::SdrTableObj the class itself is defined in svxcore while the static member functions ExportAsRTF and ImportAsRTF are defined in svx. But MSVC does not allow to mark the class as SVXCORE_DLLPUBLIC and the two static member functions as SVX_DLLPLUBIC, so move the two functions out of the class. (There appears to be no real necessity that they were static member functions in the first place; they don't even need to be friends of the class. Nevertheless, this mixture of functionality from svxcore and svx in include/svx/svdotable.hxx may ask for follow-up clean up, one way or another.) All the output lines that need rewriting (all the @svxcore@@ ones, and the manually picked subset of @@@ and @svxcore@svx@ ones) are copied into a new file CHANGE (containing 451 lines). Then > sed -E -e 's|^@.*@.*@ ([^:]+):([0-9]+):.*$|sed -i -e "\2 s/SVX_DLLPUBLIC/SVXCORE_DLLPUBLIC/" \1|' <CHANGE >COMMANDS > . COMMANDS to do the changes. Change-Id: If9b6dd1c9e9ba2eb883dbdac4385d28c6fc8a203 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87794 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-23sal_Char->char in svxNoel Grandin
Change-Id: If7fb907575640b95399419beee5af6cfbd5fafb2 Reviewed-on: https://gerrit.libreoffice.org/85714 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-30Let getPageViewOutputDevice return const OutputDevice*Stephan Bergmann
...instead of boost::optional<const OutputDevice&> (in preparation for replacing boost::optional with std::optional, which doesn't support references types as template arguments) Change-Id: I02d2b617123cfa9ca0d6436c8a4104c5987f4eb5 Reviewed-on: https://gerrit.libreoffice.org/84121 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-22make some classes module-privateNoel Grandin
Change-Id: If7303a082e06f6937fca911c578a40475546cda2 Reviewed-on: https://gerrit.libreoffice.org/83442 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-30loplugin:finalclasses svxNoel Grandin
Change-Id: If55e51b8627083ba3ece2b3270adb47668b25e9d Reviewed-on: https://gerrit.libreoffice.org/81705 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-04reduce Primitive2DContainer copyingNoel Grandin
Change-Id: I418b17034c1949ddda1de7025821ca51f4cdb018 Reviewed-on: https://gerrit.libreoffice.org/78579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-20Fix typosAndrea Gelmini
Change-Id: I8561dc27229a2430bfdfd8ac806139b4450496c7 Reviewed-on: https://gerrit.libreoffice.org/76026 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-19Fix typosAndrea Gelmini
Change-Id: Ia7486fe6c110a4a7f53f1dac82dbff3a15405fd7 Reviewed-on: https://gerrit.libreoffice.org/75947 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-06-11tdf#42949 Fix IWYU warnings in include/svx/[sS][v-Z]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ie2a4122d67d2d40732e6fd00b584f33edd802c5b Reviewed-on: https://gerrit.libreoffice.org/73476 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-06-03tdf#42949 Fix IWYU warnings in include/svx/sdr/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Iec39b6508a43746c99eddb71f444d921cd8cff1a Reviewed-on: https://gerrit.libreoffice.org/73368 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-27loplugin:unusedfields look for classes where we can make all the..Noel Grandin
fields private Change-Id: Id3c6b123f06ab5dcf87628de4c347626110d2d27 Reviewed-on: https://gerrit.libreoffice.org/68302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-30loplugin:unusedmethodsNoel Grandin
Change-Id: Id0d68d659fa06a8230ed0d927b85b6b504525d1e Reviewed-on: https://gerrit.libreoffice.org/64328 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-09-27loplugin:methodcycles more graph theory for the winNoel Grandin
implemeent a reduction approach, which is good at finding virtual methods that only themselves or their virtual partners. The accessibility GetVisArea stuff is dead since commit 891e41fac81fbd8d5cdb277b26639abfd25a7143 Date: Wed Apr 4 11:23:22 2018 +0200 dead code in AccessibleTextHelper_Impl::UpdateVisibleChildren Change-Id: I78d9d8bca585ecec8394f2c3fe2baa93db0e58f5 Reviewed-on: https://gerrit.libreoffice.org/60912 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>