summaryrefslogtreecommitdiff
path: root/editeng
AgeCommit message (Collapse)Author
2021-07-11editengine-columns: tdf#143258 Fix handling rotated textMike Kaganski
This reverts modifications to existing unit tests made in commit d0a1616ccad0dd5f5a02c1b0204f537b57d0b4b5. My idea that those changes were required because of more correct calculations was wrong, and in fact they were caused by off-by-1 error in height calculations. Change-Id: Ib94878a911238c977c35a8f8e3e5694cedc79a89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118705 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-07tdf#132740 avoid some WeakReference cost in accessibilityNoel Grandin
reduces time by 20% for me Change-Id: Ife78248fd36099298eb2401b362f16a1ae3c0434 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118534 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-07tdf#132740 bypass work if selection has not changedNoel Grandin
takes 10% of the time off Change-Id: Ia0a2f4469088e103f162b7d85abb7fadc5f365cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118532 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-07tdf#132740 don't broadcast if modified status has not changedNoel Grandin
take 10% of the time off Change-Id: I75c8d5e1297de342df711d15260073db59946116 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118531 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-07tdf#57585 Add new bullet behaviour to impressGokce Kuler
Added the feature of removing bullets from blank lines and showing the bullet in a faded color on lines that have not yet added text. Change-Id: Ifb3beed7a0127d85660842555c85ceb466258441 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118450 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-07-05store the SfxItemSet inside SfxSetItem by valueNoel Grandin
rather than on the heap, avoiding an allocation Change-Id: I3f1504f9a2d4178a9ba59e98de182a0ab98cdce0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118356 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-03tdf#143176 Old Hungarian transliteration: fix AutoCorrect->ApplyLászló Németh
and "Apply and Edit Changes". Transliteration worked only during typing, because AutoCorrect->Apply and "Apply and Edit Changes" remove right-to-left text direction silently, which resulted missing transliteration of text (with Default Paragraph Style and right-to-left direction) to Old Hungarian. Change-Id: I1481d958494828b6dce66f2eeecb44b327c70db4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118346 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-07-03ofz#24932 halve limit for fuzzing timeoutCaolán McNamara
Change-Id: Iafbf7e40867ada6918e6e6dc3e1588bb0a6756df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118333 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-02can allocate these SfxItemSet on the stackNoel Grandin
Change-Id: I85a749429a3a14aca5c6eaeaa5da37b25eb9f730 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-30reduce cost of allocating and copying SvxNumRuleNoel Grandin
by using std::move to avoid copying unnecessarily Change-Id: I940b57c9a05c8d75b9a16291fc4f05756fdeea12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118164 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-29Fix typosAndrea Gelmini
Change-Id: Ic943746614b894690768d0d6109123c1af819c52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118081 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2021-06-29new ODF numbered list parameter loext:num-list-formatVasily Melenchuk
Instead of style:num-prefix and style:num-suffix new list format is much more flexible for storing list multilevel numberings. Now it is possible to have not just prefix/suffix but any random separators between levels, arbitrary levels order, etc. Internal LO format for list format is changed: instead of placeholders like %1, %2, etc we right now use %1%, %2%... Reason: for ODT documents, having more than 9 levels there is ambiguity in "%10": it is "%1" followed by "0" suffix, or "%10"? Aux changes: * removed zero width space hack: since format string is always defined this hack is interfering with standard list numbers printing (see changes in ooxmlexport14.cxx, ww8export3.cxx tests) * changed cross-references values to lists: they are now including full list label string: previously this was bit self-contradictory (see changes in odfexport.cxx and check_cross_references.py tests) Change-Id: I9696cc4846375c5f6222539aeaadbca5ae58ce27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117156 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-06-28loplugin:indentation improve checks for brace alignmentNoel Grandin
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-21tdf#142716 Update selection after any text is inserted.Gülşah Köse
When we don't update the selection after insertion of new text SvxUnoTextBase::createEnumeration knows old selection and losts last part of the text. Change-Id: I20f6530f34097ff213ff00cff617139887fd287a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117409 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-06-21Replace these defines with constexprMike Kaganski
Make CH_HYPH OUStringLiteral, because it is converted to OUString in ImpEditEngine::ImpBreakLine. Make WRONG_SHOW_MIN tools::Long, to match the type of nHeight which it is compared to. Change-Id: I5198da4134f1edf28d47f2fc060af482572f5f89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117430 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-20ofz#24932 TimeoutCaolán McNamara
Change-Id: I3251824ac2613ac7fd994f66effb8be26aa8a7ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117512 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-17tdf#142839: do not forget to initialize *pHeightNTPMike Kaganski
Regression after commit d0a1616ccad0dd5f5a02c1b0204f537b57d0b4b5 Change-Id: Iaa8f67e0c7e3d99b057294717d24ffac4ad3534c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117389 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-17use string_view in the Translate APINoel Grandin
Change-Id: I0bb0ea9d39ed623928060ffd3f2e2bc36ba33209 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117272 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-11tdf#130428 remove unnecessary usage of SfxItemState::UNKNOWNArmin Le Grand (Allotropia)
In this case SfxItemState::UNKNOWN was used as boolean state to decide to keep extracted value or replace. First method even throws an exception when SfxItemState::UNKNOWN should happen. I tried to be very careful in changing these methods, so another look/check from reviewers will be welcome. I think that code was unnecessarily complicated, too, butz hope to not have touched semantics (behaviour) at all Change-Id: Id213fedcafcfb655749caf2659f9a15b240ec27d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116999 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-06-10cid#1485166 silence Uninitialized scalar variable harderCaolán McNamara
Change-Id: Ic9d841109cbcc1201e13cebea423139fd760c680 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116966 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-10loplugin:unusedmethodsNoel Grandin
Change-Id: I2890e29b3e18cdf7822bf93ee7c17cd8221497a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116971 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-09Fix typosAndrea Gelmini
Change-Id: I3539edf26a793f89d38f3df376002f4ed4295343 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116869 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-06-08Addendum to: Remove SfxItemState::READONLYArmin Le Grand (Allotropia)
unfortunately forgot to remove some of the out-commented lines in f3b737ab76efaf1a70dfb22c6b60b08b340cf343, thanks to Julien for hinting me to that. So this is no semantic change at all, just syntax. Change-Id: If45b0cf1aeed870723914c2c02f6060d8f1bbfb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116838 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-06-08editengine-columns: Implement layoutMike Kaganski
This changes the way how different parts access positions of lines and paragraphs. Now there is ImpEditEngine::IterateLineAreas, which performs uniform iteration over all ParaPortions and lines in order, calling a user-provided callback function for each portion and line; it passes all information about current portion, line, area, and column to the callback, and checks the return from the callback, to decide if it needs to continue iteration (in case when callback indicated that if doesn't need further data), and if it needs calling the callback for the rest of current portion's lines. This allows to have the code that calculates and iterates dimensions of lines in one central place, without the need to have duplicating logic in several places. One important exception is ImpEditEngine::Paint, which iterates without ImpEditEngine::IterateLineAreas, because it does many atomic paint operations in different points of iteration process, and implementing ImpEditEngine::IterateLineAreas to call callback in the required places would require increased complexity, which is left for a future change. To make that possible, ImpEditEngine::IterFlag should be extended to indicate additional requirements. Note that in fact, ImpEditEngine::Paint was taken as the model for implementation of ImpEditEngine::IterateLineAreas, with its detailed handling of all the vertical offsets like additional line spacing and interparagraph spacings that depend on context. The notable result of the centralization of the iteration code is slight change of heights reported by ImpEditEngine::CalcTextHeight. Previously it simply added all pre-calculated heights of portions, and not taking into account all the spacing handling that ImpEditEngine::Paint did, which was inconsistent (calculated height was different from painted height). Now ImpEditEngine::CalcTextHeight should provide more accurate results, which required small changes in the unit tests. Change-Id: I33cbb978deb974b314d36fda8674186a03991107 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116034 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-08editengine-columns: Create document model and dialog pageMike Kaganski
Change-Id: I056aad9474ca18134d1f1686a53618cc9ab3d525 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116038 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-08cid#1485166 silence Uninitialized scalar variableCaolán McNamara
seeing as there are no warnings about SvxRTFItemStackType::SetStartPos try that pattern Change-Id: Icad28503047323b01d8e048061c6b037bcdcb83c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116817 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-08Remove SfxItemState::READONLYArmin Le Grand
As I experimented with redesigning the whole Item/ItemSet/ItemPool paradigm, I alredy checked that SfxItemState::READONLY is not used (and no one really knows what it should do or stands for). Since a removal of complexity is needed to get forward with that redesign and I already made some experiences in branch item_refactor2, I propose to remove this state. It is not really used (gets never set). It is mirrored/used in the UNO API in css::frame::status::ItemState as 'READ_ONLY', but also not used in the office's code. ItenmState itself is used in three places, but all set the Item involved by using a SfxVoidItem to state SfxItemState::DISABLED, which I described in ItemState.idl. This means that no state of READ_ONLY in UNO API is ever imported to office code as DISABLED state at all, so not used. I also marked it as deprecated in the *.idl file. I think - including the experimenting in the mentioned branch - that this is safe for now. I already run a full 'make check' on the changed stuff. Change-Id: I8c15cf7b4f803076ecaaea67659f6e022ac7ef70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116752 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-06-08sc: lok: apply the previous fix for selections tooDennis Francis
Conflicts: editeng/source/editeng/impedit.cxx Change-Id: Ic1f6c1642da71e0ef8c23831786ae405dda21133 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116427 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit c5e249877b93e9d11788ec04fffee1dcb142a0e5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116541 Tested-by: Jenkins
2021-06-08sc: lokit: fix wrong edit cursor coordinates for numeric cellsDennis Francis
The cursor coordinates returned by editengine implementation is computed with respect to document-visible-area in "display" hmm and not "print" hmm. For numeric cells, the visible top-left is always non-zero, hence triggering this incorrect "refpoint" subtraction to compute "relrect". The fix is to calculate the correct "relrect" by subtracting the display hmm version of "refpoint" from the edit cursor rectange and then convert to twips. Change-Id: I4b663edcb1f74e1bdcc300788769d580fcfe7e17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116426 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com> (cherry picked from commit 77704022556bb97a64ef47666230a2c0232d45d3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116540 Tested-by: Jenkins
2021-06-05cid#1485166 silence Uninitialized scalar variableCaolán McNamara
the markup in the other case seemed to work Change-Id: I2276f370b3f696082fd4ebfcbd29a13e2bea85ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116747 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-04loplugin:virtualdeadNoel Grandin
Change-Id: Ic2e18f9088e7427f0679dab27f0d3acb6f2bb240 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116716 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-03use std::make_unique instead of newCaolán McNamara
Change-Id: I267b82dd573fc8bd30e1c5d47e9b1f2e98c2b412 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116645 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-03cid#1485166 try and suppress bogus Uninitialized scalar variableCaolán McNamara
Change-Id: I250bb79534610952cc78bb5ab3fc8ab5862723c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116646 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-03use std::make_unique instead of newCaolán McNamara
Change-Id: Icc5cb2f5fa5720eb9f6e22ec380397bb88542689 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116644 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-01loplugin:noexceptmoveStephan Bergmann
(not sure exactly why this started to only hit me now on macOS against LLVM 13 trunk libc++) Change-Id: Ib2ea5b52061a870a5eaa4e5c680d19b87831b87c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116536 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-01cid#1485154 try moving initialization into member init listCaolán McNamara
see if it has an effect on bogus "Uninitialized scalar variable" Change-Id: I68d6a466f7fc9aa3412d50223dc53d6b60b721c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116527 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-01use std::make_unique instead of newCaolán McNamara
Change-Id: Idb9dc1897b5617a6e12110638857e153e2ba56dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116525 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-31no need to allocate EditNodeIdx separatelyNoel Grandin
it is just two pointers Change-Id: I80a9206b9f94fb4a4401352b93fcd727f787f52d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116474 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-31EditPosition does not need to be allocated separatelyNoel Grandin
it's just two pointers big Change-Id: Ie2d71f4530fa92a3d125446a6c45035e88617b97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116473 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-31no need to allocate these on the heapNoel Grandin
Change-Id: I189f04c14a7ab7fbc1feba423efda88f3f811efc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-31no need to allocate SvxNumRule separately in SvxNumBulletItemNoel Grandin
Change-Id: I7903565a468fc0fbec603c88b92cca6560a86728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116424 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-31Clean redundant SvxBackgroundColorItem and use SvxColorItem instead.Gülşah Köse
SvxBackgroundColorItem is just copied from SvxColorItem. There is nothing special to SvxBackgroundColorItem class. SvxColorItem is a generic item and it's used on many places related with colors. We can use SvxColorItem for background colors too. Change-Id: Iacea31a7557b806e95f5859ff60add9a2626ec05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116282 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jenkins
2021-05-31flatten SvxItemPropertySet a littleNoel Grandin
Change-Id: Icb76ae5d0ebb0397bc1a2ea3c7d713a56d5ae477 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116422 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-31vcl::Font is already a copy-on-write structureNoel Grandin
with an impl pointer, no need to use unique_ptr when storing in a map Change-Id: I9fa13133df4a8acfb7fd973509ec2b0e194fc5d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116423 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-26Seperate SvxBackgroundColorItem from SvxColorItemGülşah Köse
SvxBackgroundColorItem derivated from SfxPoolItem instead of SvxColorItem. Casting is common usage to control if object is this or not. When we can cast SvxBackgroundColorItem to SvxColorItem we can not seperate them anymore. eg: Char color is a SvxColorItem and char background color is a SvxBackgroundColorItem. They can be hold together and we should understand they are different types. Change-Id: I7b1879a1b00de26c0b8a2d9f8d658aa3aef75ecb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116135 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-05-21add Toggleable as a separate thing to a ButtonCaolán McNamara
and inherit ToggleButton from both it and Button Change-Id: If0e500aca8d0ffa087cb5e2bfc1786372fbff4eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115921 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-20use toggle instead of click for RadioButtonCaolán McNamara
Change-Id: I2a01d78e2e98b35d2cd24dd7d7d2efda41e35ca8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115863 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-20This check is redundant hereMike Kaganski
The check immediately above this guarantees that !rParaPortion.IsInvalid() may only be true when rParaPortion.MustRepaint() is true. Change-Id: Icedeac87b3b8125997640d330b9612eed2cb5095 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115834 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-05-19SetPhysFont always dereferences its OutputDevice* argCaolán McNamara
which is also the case for ChgPhysFont and GetTextSize Change-Id: I7e6a1a7eaa77646c53506a73d8946f8df7593e72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115768 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-19ImplInitDigitMode never passed null OutputDevice*Caolán McNamara
Change-Id: I3bfd250015866e056ce789d772c9a41bbae76ada Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115761 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>