summaryrefslogtreecommitdiff
path: root/editeng
AgeCommit message (Collapse)Author
2022-06-09remove incorrect #ifdef DBG_UTIL around normal code (tdf#149476)Luboš Luňák
This code sets sufficient size for the virtual device that saves the content, so it's not some optional debug code. Without this selecting text in Calc formula bar and dragging it around leaves artifacts, because the saved content is not large enough to restore the original widget content. This dates back to d51fe1189dcbe0fe06805c8d99687c125cd254eb, which supposedly made the code warning-free (and also correct-free). Change-Id: I52dab8c8d3a083fff9da8aed27facdf21076622e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135555 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-06-09Revert "tdf#132740 don't broadcast if modified status has not changed"Aron Budea
Causes regression when drag&dropping in formula bar. This reverts commit 60d35f767781de4b8f1e7b264b12015f655c647d. Change-Id: If01534c17cf19f457b993ec9f8e48e6495b29b8c
2022-05-27tdf#148620 Crash in Draw using Format > Lists > Move DownNoel Grandin
This reverts commit 35f03f26799747894d1534796b6cb227bd4f233b speed up loading large ODS a little since ImpEditEngine::ImpMoveParagraphs wants to manipulate ParaPortion's and also identify them by pointer Also convert the OSL_ASSERT in this method to an assert to catch such problems earlier Change-Id: Id924d00c9524223db9a96e487b331ce60e3a4fff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133128 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133300
2022-02-21tdf#147166 EditTextObjectImpl copy ctor doesn't exactly copy EditTextObjectImplCaolán McNamara
and this is apparently relied on, so eliding the copy gives unexpected results. EditTextObjectImpl::Clone returns a copy of *this, but the EditTextObjectImpl copy ctor explicitly does not copy the "PortionInfo" member, so in: commit fb8973f31f111229be5184f4e4223e963ced2c7b Author: Caolán McNamara <caolanm@redhat.com> Date: Sat Oct 10 19:21:38 2020 +0100 ofz#23492 the only user of this ctor throws away the original of the clone so we can take ownership of the original instead where the copy was optimized away we want from a state where there was a new EditTextObjectImpl with an empty PortionInfo member to one where the PortionInfo of the EditTextObjectImpl was retained. So explicitly clear this unwanted info. It's very hard to make rational judgements about code if a copy behaves differently than the orignal :-( Change-Id: I642d60841d6bdccbf830f8a2ccdbd9f542a8aa18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130202 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2022-01-21Resolves: tdf#139974 Do not munge character after forced line breakEike Rathke
A classical +-1 error.. Change-Id: I8b6bc0843fa585d8a710c74f757098ab9c6f823d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128637 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 2cfa04cbf03fe5c2ce32a7384082cdc5de5a4785) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128541 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> (cherry picked from commit 2b8946e52fa170c7df4bf71440e2ed63474db28f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128671 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-01-11editeng: avoid writing past the end of of pLine->GetCharPosArray()Miklos Vajna
Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault. 0x00007ffff6df4951 in ?? () from /usr/lib64/libstdc++.so.6 (gdb) bt 10 #0 0x00007ffff6df4951 in () at /usr/lib64/libstdc++.so.6 #1 0x00007ffff6df5792 in __gnu_debug::_Error_formatter::_M_error() const () at /usr/lib64/libstdc++.so.6 #2 0x00007ffff47384bf in std::__debug::vector<int, std::allocator<int> >::operator[](unsigned long) (this=0x6b3dca0, __n=7) at /usr/include/c++/7/debug/vector:417 #3 0x00007ffff47b5440 in ImpEditEngine::ImpBreakLine(ParaPortion*, EditLine*, TextPortion const*, int, long, bool) (this= 0x1ce0040, pParaPortion=0x206a010, pLine=0x6b3dca0, pPortion=0x6b3e480, nPortionStart=0, nRemainingWidth=5093, bCanHyphenate=false) at editeng/source/editeng/impedit3.cxx:2041 #4 0x00007ffff47b1fb6 in ImpEditEngine::CreateLines(int, unsigned int) (this=0x1ce0040, nPara=0, nStartPosY=0) at editeng/source/editeng/impedit3.cxx:1352 #5 0x00007ffff47ad0c2 in ImpEditEngine::FormatDoc() (this=0x1ce0040) at editeng/source/editeng/impedit3.cxx:387 #6 0x00007ffff47bf516 in ImpEditEngine::FormatAndLayout(EditView*, bool) (this=0x1ce0040, pCurView=0x0, bCalledFromUndo=false) at editeng/source/editeng/impedit3.cxx:4190 #7 0x00007ffff47be333 in ImpEditEngine::SetUpdateLayout(bool, EditView*, bool) (this=0x1ce0040, bUp=true, pCurView=0x0, bForceUpdate=false) at editeng/source/editeng/impedit3.cxx:3927 #8 0x00007ffff46f059e in EditEngine::SetUpdateLayout(bool, bool) (this=0x1ce2b20, bUpdate=true, bRestoring=false) at editeng/source/editeng/editeng.cxx:1472 #9 0x00007ffff48ce5e3 in Outliner::SetText(OutlinerParaObject const&) (this=0x1ce0cc0, rPObj=...) at editeng/source/outliner/outliner.cxx:586 (More stack frames follow...) (gdb) frame 3 #3 0x00007ffff47b5440 in ImpEditEngine::ImpBreakLine (this=0x1ce0040, pParaPortion=0x206a010, pLine=0x6b3dca0, pPortion=0x6b3e480, nPortionStart=0, nRemainingWidth=5093, bCanHyphenate=false) at editeng/source/editeng/impedit3.cxx:2041 2041 pLine->GetCharPosArray()[ nPosInArray ] = rTP.GetSize().Width(); (gdb) print pLine->GetCharPosArray() [Thread 0x7fffd2010700 (LWP 5008) exited] $1 = std::__debug::vector of length 7, capacity 7 = {707, 1414, 2121, 2828, 3535, 4242, 4949} (gdb) print nPosInArray $2 = 7 Change-Id: I3a8121c0c0a3b0949e91eb53c0468f7e629b146f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128223 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 56ded398c9c72810f20b9da0aa98097739423180) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128231 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit e1449eaf3b2b0bf4ebed44bbcf54e5e01d356465) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128242
2021-12-13tdf#146179: fix Dev Tools crash when inspecting object in special fileJulien Nabet
0 0x00007f3177297361 in SvxUnoTextBase::createEnumeration() (this=0x313ba98) at editeng/source/uno/unotext.cxx:1911 1 0x00007f317729751d in non-virtual thunk to SvxUnoTextBase::createEnumeration() () at editeng/source/uno/unotext.cxx:1918 2 0x00007f31755c2a7b in (anonymous namespace)::GenericPropertiesNode::fillChildren(std::unique_ptr<weld::TreeView, std::default_delete<weld::TreeView> >&, weld::TreeIter const*) (this=0x7ffee92c8140, pTree=std::unique_ptr<weld::TreeView> = {...}, pParent=0x0) at sfx2/source/devtools/ObjectInspectorTreeHandler.cxx:719 3 0x00007f31755c15f1 in ObjectInspectorTreeHandler::appendProperties(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) (this=0x8e499d0, xInterface=uno::Reference to (SvxPluginShape *) 0x313b8e0) at sfx2/source/devtools/ObjectInspectorTreeHandler.cxx:1270 4 0x00007f31755c0e85 in ObjectInspectorTreeHandler::NotebookEnterPage(rtl::OString const&) (this=0x8e499d0, rPageId="object_inspector_properties_tab") at sfx2/source/devtools/ObjectInspectorTreeHandler.cxx:1154 5 0x00007f31755befa0 in ObjectInspectorTreeHandler::LinkStubNotebookEnterPage(void*, rtl::OString const&) (instance=0x8e499d0, data="object_inspector_properties_tab") at sfx2/source/devtools/ObjectInspectorTreeHandler.cxx:1129 ... (gdb) p GetEditSource() $2 = (SvxEditSource *) 0x0 See full bt here: https://bugs.documentfoundation.org/attachment.cgi?id=176872 Change-Id: I1f3f48c742a2a3c6a2abcb2ed06d8f60e6f7a77f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126666 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit a5f2f989a0a7a5b602b7f3e39e99d7f4c2342cee) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126678 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 099cd6047360db3bf3df89b9511c24ea507beeb8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126681
2021-12-09ofz#41345 Negative-size-paramCaolán McNamara
Change-Id: I7398fc39c84670f455993c80ea6c9defbcf911d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125724 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-11-17Related: tdf#142719 the first time undo adds an exception it gets lostCaolán McNamara
Change-Id: Ie963e92a15ddd45316f999e950fff359d7dd6f5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125314 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 75a14a1e962793de1483ceea1bc36cc78144e386) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125145 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-15tdf#145610: lists should not have includeUpperLevels < 1Vasily Melenchuk
Unlike its name, this variable stores *total* amount of levels to includes, so during conversion even empty list format to prefix/suffix/includeupperlevels we should keep last one above zero so list even in future will not have issues with levels to display. Change-Id: I4992c1ac0194f381df9f7b965ecdb2d688892b30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125022 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de> (cherry picked from commit a4485bd8e03ad4487fe47a4480a9aacfbaf61980) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125135 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-10-05tdf#144578: numbering: generate include upper levels for UIVasily Melenchuk
In spite of used list format in ODF for UI we still need to show prefix/suffix (already was there) and included upper levels (done in this patch) for correct visualization of level properties. Moved initialization of ListLevel to later steps to avoid overriding of generated values for prefix, suffix and IncludeUpperLevel by some invalid values. Change-Id: I5d132426c06021ed526d16fb09276523105aa7b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122686 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123074
2021-08-19tdf#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> (cherry picked from commit 37dd6e18f5cf498d230ffe8a0a395cfdf9625e0c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120645 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-08-12sw: 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> (cherry picked from commit b67b3e2be0c80c3667ad2cb633e7e932d51d63a8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120355
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. (cherry picked from commit fc4c0747e97bb997cc37263b3e86b07dab21fe25) Change-Id: Ie4a08f57d22cd1862c02987a5f86089fda8a5d9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120254 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-08-04editengine-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> (cherry picked from commit ff1fdf19c44835071916d20e879c383d1513265e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119622 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-27tdf#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 (cherry picked from commit d44730148a95933f4a45a70241cb6d1d0546f626) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119440
2021-07-12editengine-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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118711 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-08tdf#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> (cherry picked from commit 73c9ef661d9ef6237d3fd3c259fd040a545b44cf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118508
2021-07-08tdf#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> (cherry picked from commit 2ca614be3eb65d852b2c811c853b754e5e5ecb36) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118509
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> (cherry picked from commit f5ff7a967b09a715c56630aff92cfb636e7c232b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118305
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) Conflicts: sw/qa/extras/odfexport/odfexport.cxx Change-Id: I9696cc4846375c5f6222539aeaadbca5ae58ce27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117156 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118040 Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
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> (cherry picked from commit e837f50313a703b6b26abb78f224472c1e4734ea) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117558 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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> (cherry picked from commit 59611f7b6acbf643bde0e0121ee51e2df53e7d50) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117304
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>