summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2022-05-19sw content controls, picture: replace placeholder image on clickMiklos Vajna
Previous content control types (rich text, checkbox, dropdown) had the cursor somewhere in the content control and click selected the content control in the placeholder case. The picture case is somewhat different: the content control has a single as-char image, and by the time SwWrtShell::GotoContentControl() is invoked, the picture frame is already selected. All we have to do here is to trigger the file picker to select a replacement and then insert that image to replace the already selected frame's bitmap. Change-Id: Id3ad94ed8f7e13b0ebc2f57327bb8c0b1e374a86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134511 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-19tdf#148132: Revert "n#758883 dmapper: paragraph-level..."Vasily Melenchuk
Seems original problem is no longer reprodicible with recent builds but ovewriting of numbering style params with inline values leads to another problems. Removing this mechanics do some impact on RTF filter: it tries to modify numbering styles, so this was also corrected. It is not ideal yet but looks better in support numbering char properties different from paragraph ones. This reverts commit 2123ede032ca64f696ef54af4ad3238974ca2b5d. Change-Id: If8c79d6191de13b2f09c128b59d17efcfdb1a4ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133877 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-19tdf#148720 sw DOCX: fix jumbled group textbox regressionAttila Bakos (NISZ)
Left-aligned group shape was synced to the textbox, resulting jumbled positions after DOCX export/import. To fix it, set horizontal orientation of the textbox back to NONE. Regression from commit 2951cbdf3a6e2b62461665546b47e1d253fcb834 "tdf#143574 OOXML export/import of textboxes in group shapes". Change-Id: I02ee79862344f3495846091e3eef27c24d8ef162 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134149 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-18Fix typosAndrea Gelmini
Change-Id: Ie90f36439bb6ca23c45d1b75494ec1955b35513f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134531 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-05-18no need to take a lock when returning static dataNoel Grandin
Change-Id: I8d836c4a919056e8b600549f82b0d5dee9ab1a47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134536 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-18tdf#148455 docx import/export: improvements to lvlOverrideVasily Melenchuk
On save LO was just emitting w:lvlOverride to actual level where override does happen. But MS Word won't accept override for next level if there are no overrides for previous ones. For example, if we are overriding level 3 we should also emit empty lvlOverride for levels 0-2. Provided fix did cause some problems on DOCX import: overrides were applied to current level, but in this context current != actual level where override did happen. Change-Id: Ia00dd9a5990f7f122027e8126f411642c32da189 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134411 Tested-by: Jenkins Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-18tdf#149017 fix space distribution in SwFntObj::DrawText()Mark Hung
- Fix logic problem for the last element. - Some glyphs may be made of many sal_Unicode ( ex. Unicode IVS ), take care ( fix ) of the following case a) 1 as the second glyph b) n-1 as the previous glyph. c) nCnt-1 as the last glyph. - Move the code to justify.cxx and its own namespace. Change-Id: Ice2236a54e8290a489fb2d887a326ccc4768213e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134243 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2022-05-18Extend loplugin:redundantcast to trivial reinterpret_cast from T to itselfStephan Bergmann
Change-Id: I7c0be7b435d6b5f97bdd40484023584146638d70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134506 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-18fix CID#1504441 for SwFntObj.Mark Hung
Change-Id: Ia5dfb07e2c3e980f6fd8664f648ef96aa2c0d345 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134501 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-17sw: remove images from sample documentXisco Fauli
It was added in 7d20dc2ca69711c61fb1593ad85ccdef282c978d "sw: fix assert in SwObjectFormatterTextFrame" and it contains more than 300kbs of images which are not needed Change-Id: Ib2599baf7b83f83cba45492eccf1f5704aea39e5 Change-Id: I7ecdd5ba7e1251ed334924a3f75f275415d298e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134491 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-05-17sw HTML export: avoid pixel height when height is scale and width is relativeMiklos Vajna
Commit b17180a84cb4561b8a7bbf9e2281c91fffd56f87 (write out image size in html export for 'keep ratio' images, 2021-06-29) changed the sw HTML export to write the layout size of images in case one dimension is "keep ratio" and the other is some more concrete value. This is useful in case that other dimension is a fixed value, because "keep ratio" on the UI only means to keep the ratio as the size changes, it does not mean that the ratio will be the original ratio of the bitmap. However, it's problematic to write this layout size of the "keep ratio" dimension when the other dimension is relative, as this will mean the image's aspect ratio will change if the user resizes the browser window. Fix the problem by extending the way we write the "height" and "width" of fly frames: 1) Write a percentage in case of relative sizes 2) Write an explicit "auto" (or just omit the attribute in XHTML mode) in case the size is "keep ratio" and the other dimension is a relative size 3) Write the layout size in other cases (fixed size or "keep ratio", but the other dimension is a fixed size) Note that HTML itself has no concept of relative sizes where 100% is not the parent's size (e.g. page, not paragraph) and also has no concept of keeping an aspect ratio which is not the aspect ratio of the bitmap, so those cases remain unchanged. Change-Id: Ic5c7dc4d697160eff81e960a2f7d335fb78ab7c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134482 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-17tdf#147220 sw_redlinehide: update frames in ReplaceRangeImpl()Michael Stahl
Change-Id: Ie5d62eaec01a3b06ff1bd6070510384641ea7ad3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134483 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-17sw: fix assert in SwObjectFormatterTextFrameCaolán McNamara
sw/source/core/layout/objectformattertxtfrm.cxx:237: virtual bool SwObjectFormatterTextFrame::DoFormatObj(SwAnchoredObject&, bool): Assertion `GetPageFrame().GetPhyPageNum() == GetPgNumOfCollected(nIdx)' failed. The problem is that there are multiple (9) flys on text frame 324. In the loop in CalcContent(), frame 324 starts out on page 13, then with the first/second fly moves to page 12, then with the 3rd fly moves forward to page 13 - but the pPageFrame that is passed to SwObjectFormatter::FormatObj() was fetched outside of the loop. (regression from commit c799de145f7e289f31e3669646e5bd12814e6c5e and commit 533a998e540b0f04068c876dde0e74adc3f79c93) Change-Id: Iae573900b4b6558634bfed161e5c95bd5ba27151 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121924 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-17tdf#148461 sw_redlinehide: fix assert in SwContentNode::DelFrames()Michael Stahl
The assert(pMerged->pFirstNode->GetIndex() <= i) is intended for when frames are really deleted, but CheckParaRedlineMerge() calls it while the now-outdated MergedPara is still on the frame, but the nodes already have new flags; assign a dummy node in this situation. Change-Id: I23fbfdb6901e6e15abf92913aa252e59877bc280 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134475 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-17tdf#148869 sw_redlinehide: fix SwView::ExecSpellPopup()Michael Stahl
How could i forget that MovePara(GoCurrPara, fnParaStart) will move to a previous paragraph when it's already at the start of the current one, it's so intuitive. (regression from commit d814941b31b4f9cc8b6e9bd4ddc5188015529707) Change-Id: Ief9bcd42b7ea78feef50ac42bc93580c29c080b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134468 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-17tdf#65067 Remove excessive spacing from Formula objectsRafael Lima
As described in bugs tdf#65067, tdf#103816, tdf#149052 and a few other duplicates, Formula objects in Writer receive 2 unnecessary spacings: 1) From the "Formula" frame style, which has a Left/Right internal spacing of 0.2cm 2) From the Math formula editor itself, that adds an additional 1pt of internal spacing (left/right) In MS Word the default behavior is setting all of these spaces to zero, which makes the formula flow better alongside text in paragraphs. Therefore, this patch set both of these spaces to Zero so that Formula objects in Writer behave similarly as Formulas in MS Word. Change-Id: Iedcef7124afed6b799f85bcefe37016c8fd972e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134185 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-17sw content controls, picture: add doc model & UNO APIMiklos Vajna
This is meant to be a content control (providing rich text), which is also a picture placeholder field. Add a new Picture property to track this type, this way the click handler will be able to present a file picker when showing the placeholder. Change-Id: Ibbd3720fc94d0f17654ec813821d218166c76424 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134457 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-17sw: document SwEditShell::InsertTable()Miklos Vajna
How it interacts with SwCursorShell::MoveTable() is far from trivial. Change-Id: I04c9123c0b39192df43fe32984d66852102ebd1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134410 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-16Fix a UITest on WindowsMike Kaganski
Change-Id: I943a7696fd896c8709fdcd25bce650dd80244daf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134367 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-16Fix a UITest on WindowsMike Kaganski
Change-Id: Ieb6d04e344b1d875f2661833e17f64930681e528 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134366 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-16sw content controls, dropdown: edit list items: add modify and deleteMiklos Vajna
Modify is really similar to insert, just we pre-fill the list item properties dialog with old data. Also allow moving items up / down, and eliminate a not needed frame in the inner dialog, which would assert when using the gen backend. With this, the content control dialog is quite complete for dropdowns. Change-Id: I26e77dd881f0a0eea44d2a6137f76fd29ab32fc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134405 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-16tdf#137748 make keyboard accelerators functional in Statistics dialogSeth Chaiklin
Make the keyboard accelerators in the Statistics tab of the File - Properties dialog select the text of the fields that they label. Change-Id: I61a93e227ed1e457355dc971dc4864ab4419a770 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134358 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-16Make media object delete when it is cutJim Raykowski
Change-Id: Id586e015e42c23aa455d6f1a5dc42fbda492d2a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134381 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2022-05-16Related: tdf#137748 "Update" should have use-underlineCaolán McNamara
Change-Id: I8303cd8d2cabd8888797758870480483661d8801 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134391 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Jenkins
2022-05-16sw content controls, dropdown: edit list items in the properties dialogMiklos Vajna
- add a weld::TreeView to show existing display name - value pairs - add a button to add a new list item, together with a new SwContentControlListItemDlg to specify the list item properties + write the changed list back to the doc model Change-Id: I9243be84eb0af65437eccfb48c6780787609bc68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134379 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-16sw: prefix members of SwMSDffManager, SwWW8FltControlStack, ...Miklos Vajna
... SwWW8FltRefStack and SwWW8ReferencedFltEndStack See tdf#94879 for motivation. Change-Id: I93ac7230bc383433d7232c5d14ed98339620316f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134380 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-16std::stable_sort() where libc++ debug mode breaks a unittestLuboš Luňák
Libc++ debug has a feature that randomizes equal elements during sort, which normally wouldn't make a difference, but some tests rely on specific order of tested data. The ones failing without this include: CppunitTest_sw_ooxmlexport testMsoPosition CppunitTest_sw_xhtmlexport testTdf66305 CppunitTest_sw_ww8export testCommentExport Change-Id: Id49846939a264150cc82091718ffe6b904d7130e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134337 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-15tdf#149049 related: fix media object inserts twice in WriterJim Raykowski
Change-Id: Id7a7b845e0255086eb877d21699ddb0b80cc47c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134335 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-14Related tdf#149072: avoid warning "misuse of method"Julien Nabet
complete warning log: <SwTextFormatColl::GetAssignedOutlineStyleLevel()> - misuse of method part of bt when opening attachment of tdf#149072 0 SwTextFormatColl::GetAssignedOutlineStyleLevel() const (this=0x77064d0) at sw/source/core/doc/fmtcol.cxx:608 1 0x00007f8a52aa7941 in sw::(anonymous namespace)::HeaderCheck::check(SwNode*) (this=0xa457630, pCurrent=0x7705e98) at sw/source/core/access/AccessibilityCheck.cxx:622 2 0x00007f8a52a9a6a3 in sw::AccessibilityCheck::check() (this=0x7ffe4a14ab10) at sw/source/core/access/AccessibilityCheck.cxx:947 3 0x00007f8a53ed2ad7 in SwDocShell::runAccessibilityCheck() (this=0x74ef0e0) at sw/source/uibase/app/docst.cxx:1559 4 0x00007f8a16e7fdec in ImpPDFTabDialog::OkHdl(weld::Button&) (this=0xa0e9990) at filter/source/pdf/impdialog.cxx:324 5 0x00007f8a16e7fb2d in ImpPDFTabDialog::LinkStubOkHdl(void*, weld::Button&) (instance=0xa0e9990, data=...) at filter/source/pdf/impdialog.cxx:317 Change-Id: I2ed50f14eff01babd47ada3831c0a051fc767dbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134312 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-05-14tdf#121740 cache hashcode in SequenceAsHashMapNoel Grandin
shaves 2% off load time Change-Id: I5bd4eabf61205df21a27d2822acd2676a7732a3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134315 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-14Partially resolve: tdf#149010 rename section "Names" -> "Accessibility"Seth Chaiklin
Change-Id: I2f9f38ae79f0f05b42e6f209d504c5f8a5896ed3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134182 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2022-05-13tdf#149074 SvHeaderTabListBox not handling lack of preset column widths wellCaolán McNamara
Change-Id: Ibd33fe5c5168850eca1bdc7242afc38ed08b5fa2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134289 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-13sw content controls, dropdown: add an initial properties dialogMiklos Vajna
- read the doc model: show if a content control is a placeholder or not - work with a shared pointer in the dialog, which avoids lifetime issues in case the content control we edit in one view gets deleted in an other view - write the doc model: set the placeholder mode of the content control based on the checkbox state and mark the doc as modified if any widget is touched when pressing OK - handle command state: allow this dialog only inside content controls Change-Id: Ie0b9075ccd3450dd403cc7f8bbf93fc04de3b234 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134278 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-13add SvStream::ReadLine(OStringBuffer... to reduce OString allocationNoel Grandin
and use it where possible Change-Id: I3efc7a642f73661ce606c917c0323ba9948521c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134265 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-13sw content controls, dropdown: add LOK APIMiklos Vajna
- expose the available list items in a new "items" key of the LOK_CALLBACK_CONTENT_CONTROL callback - add a new lok::Document::sendContentControlEvent() function to be able to select a list item from the current drop-down - add a new listbox to the gtktiledviewer toolbar to select a content control list item when the cursor is inside a dropdown - add tests for the array API of tools::JsonWriter Change-Id: I47f1333a7815d67952f7c20a9cba1b248886f6dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134256 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-13CppunitTest_sw_layoutwriter: use more SwParaPortion::dumpAsXml()Miklos Vajna
See commit feeed3e762cf077fbd9cf48f82e949365108ccc1 (CppunitTest_sw_layoutwriter: avoid some a11y-based layout testing, 2022-04-07) for motivation. Change-Id: Ie52b96e1d7a5e5e2d55d9f68f7756e21b86ea9b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134249 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-13tdf#104930 aligning CTL text with hanging baseline.Mark Hung
1. SwTextSizeInfo::GetHangingBaseline() calls SwFont::GetHangingBaseline() to obtain the hanging baseline value. Only CTL script handled, it always return 0 for other two scripts. Eventually Outdev::GetFontMetric() and TextMetric::GetHangingBaseline() are called to obtain the hanging baseline value from vcl. 2. SwTextFormatter::CalcAscent() sets the baseline value for the portion via SwTextSizeInfo::GetHangingBaseline(). 3. SwTextFormatter::InsertPortion() sets the maximum baseline value for the whole line. 4. SwTextCursor::AdjustBaseLine() calculates the new baseline in case hanging baseline is available. Change-Id: I1aae7a34dfc953227b7873fc8e3af5cc7e2fbbff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133668 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2022-05-12sw content controls: fixes for the ending dummy charMiklos Vajna
- make sure the DOC/RTF export doesn't write the dummy char as-is - let "enter" only insert a linebreak while inside a content control, to ensure that the starting and ending dummy char stays inside the same text node - let deletion of the dummy character at the end behave the same as the start dummy character: if trying to delete that single character, then just move the cursor, don't delete it - reject document insertion in the middle of a content control, similar to input fields Change-Id: I9b54ef50261e6b17f38eadadacfe1e1111199e96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134239 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-12sw: fix crash in SwDrawShell::Execute()Miklos Vajna
Crashreport signature: SwDrawShell::Execute(SfxRequest&) [clone .cold] include/svx/svdhdl.hxx:194 SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) sfx2/source/control/dispatch.cxx:255 which is a bit tricky to read (probably due to LTO), but what happens here is that the handle index is user input and we look at index up in a list without error handling. This is a problem since commit 7eed711a6115bf892c998cbd73a2c5b706c6f99d (Extended MoveShapeHandle command for Anchors as well, 2021-05-24), which assumed that handle indexes and the handle list can't get out of sync. Fix the problem similar to what commit 48beccf52413981d3d1c525a81a2c57048abe261 (sw: fix crash in SwView::Execute(), 2021-09-03) did at SID_MOVE_SHAPE_HANDLE handler for Writer images (this one is for Draw shapes). This fix just makes sure we don't crash, there may be some deeper reason why the handle index is out of sync with the handle list in the first place. Change-Id: I8f3a25d74082984cedce09362a690f24d7236ba6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134216 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-12sw content controls, dropdown: add insert UIMiklos Vajna
- introduce a SwContentControlListItem::ToString() that tries to use the display text of the list item, otherwise falls back to its value and use it while building the dropdown widget and when inserting selected list item - handle the dropdown case in SwWrtShell::InsertContentControl() - expose this as a new .uno:InsertDropdownContentControl command - mention the new and all previous content control commands in the MS-compatible forms menu as well Change-Id: I075f77933c1466b5258357d5a661e173c34de34f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134215 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-12tdf#148941 consistency between popup box and option dialog for objectsSeth Chaiklin
cui/uiconfig/ui/objecttitledescdialog.ui * change "Title" to "Text Alternative" to use the terminology from Web Content Accessibility Guidelines (WCAG) 2.1 https://www.w3.org/TR/WCAG21/#dfn-text-alternative which is also consistent with the purpose of this option in LO + add tooltips to "Text Alternative" and "Description" in Description popup box. The idea is that the tooltips will help to understand the purpose of dialog. sw/uiconfig/swriter/ui/frmaddpage.ui * _Alternative (Text only) -> "Text _Alternative" [This change matches the change in the popup box] + add missing : to "vertical alignment", according to HIG officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu + add tooltips for the "Name" and "Description" .unos, primarily for the customize dialog, and icons in notebookbars. Change-Id: I1943b49e13763371823bfcf2cfc8652c907de110 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134066 Tested-by: Jenkins Reviewed-by: Seth Chaiklin <sdc.blanco@youmail.dk>
2022-05-12tdf#148940 improve non Snap-to-char mode textgrid layout.Mark Hung
- Revert b647f9f4bcb24ed9b71c77038da6b754b8d42eb7 , i.e. tdf#107362 don't insert kern if snap to char is not checked. This includes: a) Revert to insert kern portion to align the next CJK text portion to the next grid cell border. b) Revert none snap-to-char code to proecess CJK script only as before. Latin and CTL scripts are processed as witnout text grid. - EvalGridWidthAdd() now uses the 0th element of kern array as the glyph width to calculate the distance to the nearest cell border. This makes layout more accurate and do not generate extra spaces, allow testTdf107362 to pass. - SwFont::GetTextBreak() non snap-to-char mode now uses the same code as snap-to-char mode to calculate the accommodable text length. This fix one excess character per line problem for non snap-to-char mode. - Update testTdf107025 because the character in the test case occupies more than one text grid cells. Layout change has been verified. - tdf#107446 breaks again because of the patch. It needs different solution for Word compatibility. Change-Id: I7fadb065b9cce2d71aaaed39be2881c43d8e4db4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134001 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2022-05-12tdf#142840: doc export: use BookmarkToWord() for hyperlinksVasily Melenchuk
Inernal hyperlinks to bookmarks should not contain spaces. This is not required for RTF or DOC: MS Word is okay with spaces there (unlike in DOCX). But since we are replacing spaces in bookmark names we should do this also in links to these bookmarks. Change-Id: I7a3e530817572ed53032c2be1ad96f8e8498bac3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133590 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-11tdf#148148: Applying Title Case when selection contains only spacesMichael Warner
Previously, if the user's selection does not contain any word characters, but the node does contain characters outside of the user's selection, then searching for the word boundaries when applying title case could result in start and end points that were incorrect. In Writer this results in title case being applied to non-selected characters. In Calc this results in a debug assertion being hit. This commit prevents those issues by skipping transliteration on the node in this case. Change-Id: I20c5ef44793741c5863f838c13ba222452346a97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132801 Tested-by: Jenkins Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-05-11Inline the typedefMike Kaganski
... and simplify SwOLELRUCache::InsertObj a bit Change-Id: I7461e800ade0e0c3f2a1cd79715cecd5cfc971bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134174 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-11Advanced Diagram support: UNDO/REDO support for Diagram DataModelArmin Le Grand (Allotropia)
Added support for UNDO/REDO for changes in Diagram ModelData. This is currenly applied/used in the DiagramDialog for it's Add/Remove actions (also supports Cancel of that dialog 1st time ever). But it is defined more general to add/support manipulating actions like clone/change_text etc. Also the UI/dialog at he end will not be/stay modal, so this is a test implemenation how to use it. It uses an extract/apply mechanism to get/set the Diagram ModelData at/for the UNDO action. That may be expanded as needed for additional data in he future. It may also be considered to modify the Connection/Point ModelData to shared_ptr internally completely to avoid copying these at all. OTOH it is not that much data to handle at all. Change-Id: I4702ed908b79a476177fe66c0e3284898c6adda5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134118 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-05-11sw content controls: introduce a word breaking dummy char at the endMiklos Vajna
- this way double-clicking on the last word of a content control or the first word after the content control selects the correct text range, similar to how the same at the start of content control already worked - this allows not touching the expand flag in the SwTextContentControl ctor, which was overwritten by the ODT import (when the content control was at the end of the paragraph) anyway - hide this dummy character when accessing the paragraph content via the UNO API or the text export - still need to audit a few more places in follow-up commits to maintain the invariant that content controls have the same dummy char at the attribute start and end -- somwhat similar to how SwTextInputField does it with CH_TXT_ATR_INPUTFIELDSTART/END Change-Id: I88763d6db84afedbb865b680f040994c4d6ab7d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134151 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-11sw content controls, drop-down: add DOCX importMiklos Vajna
- inline drop-down content controls were imported as an SwDropDownField previously, but that has the drawback of not being able to store both display texts and values of each list items - adapt tests under sw/qa/ which asserted that the import result is a field, and check content control properties instead - change dmapper so that SdtControlType::dropDown is one more inline SDT that gets mapped to SwContentControl - remove the no longer needed grab-bagging in writerfilter/, otherwise we would write the SDT markup twice on export - improve DomainMapper_Impl::PopSdt() to actually map the collected dropdown properties to properties on the to-be-inserted content control Change-Id: I7e88ec8cd1d73bc1c6c75154d6ab07352cbcec8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134143 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-11CppunitTest_sw_ooxmlexport12: avoid mustTestImportOf()Miklos Vajna
Can use CPPUNIT_TEST_FIXTURE() instead. See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd (CppunitTest_sw_rtfimport: convert one testcase to use CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation. Change-Id: I1f0fdb4947c0a9763d145d4926b37c7576a25cad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134134 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-10sw XHTML export: output table / table row background format using CSSMiklos Vajna
The HTML export uses HTML elements / attributes to describe the background color of tables / table rows. CSS markup is used when exporting styles, not direct formatting. This behavior makes sense for the HTML mode, but XHTML wants to CSS markup whenever possible, and usage of CSS markup for the reqif mode is not even optional. Fix the problem by switching to CSS markup for table and table row backgrounds in the XHTML case -- this is OK for reqif when describing tables (the reqif spec only forbids detailed CSS markup for spans, not tables or table rows). This amends the behavior of commit 4cd3c436923bfba281b1bf16d9785208a2119cea (sw reqif-xhtml export: limit values of the style attribute, 2018-04-11), which avoided invalid table row background markup by losing it on export. Change-Id: Ia0858986c3e8a3ea41adf8a24119442fe5068ee3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134119 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins