summaryrefslogtreecommitdiff
path: root/editeng
AgeCommit message (Collapse)Author
2021-08-18undo changes to TextAlignCaolán McNamara
revert commit 8689bd5490b473a7ffb149bbe5f7f0683f679c72 Author: Caolán McNamara <caolanm@redhat.com> Date: Thu Jul 29 20:49:29 2021 +0100 convert TextAlign to scoped enum lets leave this as it always was Change-Id: Id4d2a5644974cdd2b0ed6d361d5c52629674d057 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120626 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-17tdf#143858: sw: default value for nInclUpperLevels is 1Vasily Melenchuk
SvxNumberFormat::nInclUpperLevels (matches text:display-levels in ODF) bit incorrect in its name: is counts total amount of levels to display, including current level. So value "0" seems have no sense: display 0 levels in total? In UI you can't select less than 1 level and ODF standard (19.797) using 1 as a default. This looks plausable. Change-Id: I596386c7b3cc4370910cd0ff6e927e501179fbdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120458 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-08-17Make IdleFormatAndUpdate privateMike Kaganski
Change-Id: Ifecc0653de27bbc0cf483147c87a11d5cd307090 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120574 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-16pass OutlinerParaObject around by valueNoel Grandin
since it uses o3tl::cow_wrapper, so it is really just a wrapper around a pointer, no point in allocating it on the heap Remove assert in SdrText::SetOutlinerParaObject, which was bogus anyhow, because it was comparing pointers, not deep equality. And since we are now being more efficient and avoiding copying of the internal data in OutlinerParaObject, we hit this assert. Change-Id: I6dbfaab5ee2ca05b2001baf63110041e469df9c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120510 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-14flatten OFlowChainedTextNoel Grandin
Change-Id: I0836d1f850c71700f8691cf8847e4f4d30d4dbb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120475 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-13rtl::Static -> thread-safe static localNoel Grandin
Change-Id: If5b7181fb1bb3f3f21ec3742680e5a3e12b21b73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120431 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-13split SvNumberFormatter into it's own headerNoel Grandin
so I can make changes without running into cyclic dependencies between header files Change-Id: I98a91c7cc66002ba745cdb8239e5cc267922a45c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-12tdf#95549 speed up load of xlsNoel Grandin
we don't need to perform layout during load, so disable a few places that do that reduces load time by 50% Change-Id: Ie746ca0b46de3b76ca1b7291e0528b525333278f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120384 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-11Drop convertMm100ToTwip in favor of the new o3tl::toTwipsMike Kaganski
Step by step, duplicates from <tools/UnitConversion.hxx> may go Change-Id: Id4c03ff8adc120ae06dbfdbdfb4f5ff0bb51f489 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120315 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-11convert some LogicToLogic calls to use o3tl::convert insteadTomaž Vajngerl
If a LogicToLogic uses fixed units, we can use o3tl::convert instead. We can also do the same for all other cases where LogicToLogic is used, but that needs additional investigation to determine if it is safe to do so. Note: MapUnit::Pixel is converted to o3tl::Length::pt because it assumed 72 PPI for a logical pixel, which corresponds with the conversion rate of a point (72 PPI). Today, 96 PPI is standard, which is also used for o3tl::Length:px. Change-Id: I29126df38bfcfda74b5d83d4cb880a378aecd18b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120230 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-10no need to use unique_ptr for SvxRTFStyleType hereNoel Grandin
Change-Id: I2af75b594096c54403af34d20303fbf3ff79a5f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120214 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-10tdf#142845 editeng: don't update selection when formatting before sd pasteMiklos Vajna
Regression from commit f0c25c751cf8e166a84b289746bce6202a40391d (tdf#115783 sd: fix lost char attributes during in-table copy&paste, 2018-02-16), the problem was that the formatting before paste also created an undo action, and executing it alters the selection, which was not intended. So in case the textbox contains "world" and we paste "hello", then the undo will set the cursor at the end of "world", while the expected result is to just undo the paste and the formatting of "world". Fix the problem by not altering the selection in the undo of Outliner::SetCharAttribs(), which is only called by sd/ in the before-paste case, not anywhere else. Change-Id: Ie4a08f57d22cd1862c02987a5f86089fda8a5d9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120220 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-08-05Pass context and resource string down to boost::locale separatelyNoel Grandin
because this is often on a hot path, and we can avoid the splitting and joining of strings like this. Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-31getArray->getConstArrayNoel Grandin
Change-Id: I951dd4a02c9ead98e7eb13ae2995ba2e1e57b38a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119740 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-31editengine-columns: number of columns is sal_Int16Mike Kaganski
Change-Id: If0e46614a398a1b2fe93eb1bfa25b5670be3511b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119725 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-30cid#1399290 silence Uncaught exceptionCaolán McNamara
Change-Id: I1fecdb09374c3631e005039d38dfd852a7b4b671 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119704 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-30convert TextAlign to scoped enumCaolán McNamara
Change-Id: Id2c466eacb44f0ea6adba75a0ac0be8be8e7ed4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119682 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-29drop some unneeded includesCaolán McNamara
Change-Id: I200d2936e97475dedc67801631222da12c777729 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119649 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-29use the parent as available from HangulHanjaConversionCaolán McNamara
Change-Id: I9b8e34f4358620f2bc3c510ea3d581be8f87bb97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119648 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-28Three identical functions for a class is a bit too muchMike Kaganski
Change-Id: Ia949f3fe2cbbc8aa524347854faa23807d58e252 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119606 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-26sw: use followby parameter of outline in Chapter fieldVasily Melenchuk
When Chapter field with format "Chapter number and name" is used it does not insert any delimiter between number and name. Best is to use outline/list property LabelFollowBy. But since it is done inside field we are limited with supported characters, so practically only space and nothing are correctly supported. Tab and newline are replaced by space. Change-Id: I4583b7051ae5ad963132980443fa70b5a19354e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119428 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-07-26tdf#143424: support for "Chapter number without separator"Vasily Melenchuk
If LO is using list format strings (this is default behavior since aa5c6d12) it was not able to show just numbering without all formatting, as it used in some fields. Change-Id: Ib4695b8e1c2d7a451522c7e04af2216d16aceefe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119309 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Tested-by: Jenkins
2021-07-26use officecfg for security optionsNoel Grandin
Change-Id: I9d91fd5b260b82e05aac6567143386742953ecf6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-22Make static_casting to the only derived class less verboseMike Kaganski
... and assert on correct derived type in debug builds. Change-Id: Iedd37b3ad4139ab1eb1a0a321e3ebd0018ecde99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119360 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-22Simplify EditTextObject's pool initializationMike Kaganski
Old scheme (ever since commit fd069bee7e57ad529c3c0974559fd2d84ec3151a "initial import") was that when source EditTextObject was owner of the pool, the copy created a new pool; and when source was not owner, the copy just re-used existing pool. It made no sense since commit 1545949690c750d7b512000723b564e69cf3c3a6 where pools were made ref-counted using rtl::Reference. This also simplifies the only place which used the EditTextObject ctor taking pool by making the related ctor to take all necessary arguments instead of calling setters after constructing the object, which allows to drop a couple of setters. Change-Id: I843e154dd57f33f7c037063b4a0fcc0ac5a33cd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119358 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-22BinTextObject was renamed to EditTextObject long agoMike Kaganski
... so update comments accordingly Change-Id: I5fe423c510912dc3bc3e113afcd5c5daaba3d717 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119357 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-21Use Append here instead of InsertMike Kaganski
The containers are filled after resetting them. Change-Id: I6cd17fd47a84e755788a3b58fe72b451d6267e99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119323 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-21IsVertical->IsEffectivelyVertical, GetDirectVertical->GetVerticalMike Kaganski
Before commit 653b53287ca09a9ffe3f5ce0242919e719c1086c, editengine objects had a pair IsVertical/SetVertical, which queried and set a boolean flag (and SetVertical also had a second argument to set another flag). The mentioned commit had introduced an inconsistency, changing SetVertical to only set a single flag, but at the same time making IsVertical to return a synthesized result from two values: vertical and rotation. Additionally, GetDirectVertical was introduced to complement SetVertical. In many places, the use of synthetic IsVertical looks suspicious, especially where it is used in combinations with SetVertical. But here I don't change existing logic, and only rename the methods, so that in case someone sees an actual problem, it would be easier to spot the method mismatch. The end result is that now we have a proper getter/setter pair GetVertical/SetVertical, and also IsEffectivelyVertical, named to reflect that it calculates its return value. Change-Id: I38e2b7c5bd7af0787dd7a1c48e1385138dac80b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119315 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-21Use MapUnit directly hereMike Kaganski
Change-Id: I745503ca1cae88519ac32e946849302b46e0ccb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119297 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-21Prefix members of EditTextObjectImplMike Kaganski
... and re-arrange them a bit to optimize memory layout Change-Id: Ia543a68b446b9d9e49828112f3aa0054607cb2a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119296 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-20Use standard algorithm hereMike Kaganski
It also compares sizes, so no need for duplicating check. Change-Id: Ica08af55da2ec8acfbeca333d32fe03929ee2cac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119189 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-20EditTextObject: use virtual interface instead of pimplMike Kaganski
Makes it simpler, and avoids extra allocations Change-Id: I301f628a2898f6421242808cbf8ce36c5acf9b0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119241 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-20no need to allocate child array separately in SvxRTFItemStackTypeNoel Grandin
Change-Id: Ie40cc3b2d05bbb16a2b33a6beb4fdb804454333e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119250 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-20no need to store data separately in SvXMLAttrContainerItemNoel Grandin
Change-Id: Idea4289c600a81f5c8dbb389343ef57a9623d11d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119251 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-19Fix updating WhichRangesContainer using MergeRangeMike Kaganski
I forgot that MergeRange is not modifying its object, but returns a modified copy. Added SAL_WARN_UNUSED_RESULT to it (but it seems to not have effect on Windows). Change-Id: I919146fc25a0992d543890464ccac75737647ee5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119230 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-19Move svl::Items to include/svl/whichranges.hxx, and unify its usageMike Kaganski
... in WhichRangesContainer and SfxItemSet ctors. Now it's not needed to explicitly use 'value' in WhichRangesContainer's ctor, or create an instance for use in SfxItemSet ctor (svl::Items is already defined as a template value of corresponding type). Instead of WhichRangesContainer Foo(svl::Items<1, 2>::value); SfxItemSet Bar(rItemPool, svl::Items<1, 2>{}); now use: WhichRangesContainer Foo(svl::Items<1, 2>); SfxItemSet Bar(rItemPool, svl::Items<1, 2>); Change-Id: I4681d952b6442732025e5a26768098878907a238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119157 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-17blind fix for ubsan div/0Noel Grandin
Change-Id: I0ee929c79d5ac94299adc84ba91d6b0683a8193d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119095 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-16Use WhichRangesContainer in editengMike Kaganski
Change-Id: Ia6516df33341181990c2b8b8affa859395831007 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119013 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-15drop the Pair constructor from SfxItemSetNoel Grandin
just so we have one fewer odd constructors here Change-Id: I81278e9436747a4eb46a33da9bfec7a8b30079b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118982 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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>