summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-11-15sw: remove unnecessary castsMichael Stahl
Change-Id: I34e823bc9f57924851a70e04c295b1d2c6e11ab4
2018-11-15sw_redlinehide_3: adapt SwContentTree/SwOutlineContent to gapsMichael Stahl
The SwOutlineContent::GetPos() returns the outline position in the document model / IDocumentOutlineNodesAccess; rename it to make that more clear. Also it's already possible to have gaps in the list entries by setting the outline level so that inner levels are filtered; the SwContentTree::ExecCommand() doesn't appear to handle this properly, it needs some tweaks to skip over the outline nodes that don't have list entries. The GetYPos() does not contain the outline index, it contains the list entry index. Change-Id: Ifae0b9648ce61bb9aa470172ef989b2532370138
2018-11-15sw_redlinehide_3: adapt number tree updates in SetAttr/ResetAttrMichael Stahl
Update both of the SwNodeNums. Change-Id: Iba8aa6cda460099f4a1086d6aaa08ac98c78f097
2018-11-15sw_redlinehide_3: remove dubious fallback code from SwNodes::ChgNode()Michael Stahl
There is no obvious case where such a fallback would be needed, but it does introduce a bug with a delete redline inside a hidden section: on Show, when moving the nodes into the body content, FindPrvNxtFrameNode() will return nullptr because there are no frames inside the hidden section, but then this fallback will cause it to erroneously create a frame. Change-Id: I2328a6f213fdec95857b6e4446e1a8504c17f599
2018-11-15sw_redlinehide_3: invalidate numbered text nodes on Show/HideMichael Stahl
Call the same function as SwNodeNum::NotifyNode(). Change-Id: If2edc5fb9364e97715d4750f3a45c3c918edfebf
2018-11-15sw_redlinehide_3: use the second list number in the text formattingMichael Stahl
Change-Id: Ibe2afae869b1999772fa6132e35a1e951fffddd2
2018-11-15sw_redlinehide_3: have SwTextFrame ensure that list node is ...Michael Stahl
... always the same as pParaPropsNode. Change-Id: I1fb225d147ec3558615ad16ec49f873db7f1628f
2018-11-15sw_redlinehide_3: CheckParaRedlineMerge maintains second list treeMichael Stahl
... by calling AddToListRLHidden/RemoveFromListRLHidden. Do this here because it has all the necessary information. Change-Id: Iac2640b7493267b187e66b1d464c79fe90642afe
2018-11-15sw_redlinehide_3: apparently a live SwNodeNum always has a parentMichael Stahl
... so assert that somewhere. Change-Id: I928c55ffa57ec037e9406618d20b454e11dd80d4
2018-11-15sw_redlinehide_3: add second SwNodeNum to SwTextNodeMichael Stahl
Change-Id: I62ebdb92ee384905bba9ef3865fcdb306775baf2
2018-11-15sw_redlinehide_3: add flag to SwNodeNumMichael Stahl
Disable the NumRule/DocumentListsItemManager manipulations on the second tree; only the "main" tree does that. Change-Id: I0da8ced53f8d55758e3c02fd24b9253bbf603b38
2018-11-15sw_redlinehide_3: add second SwNodeNum tree to SwListMichael Stahl
... so it can be used when redlines are hidden in the layout. Change-Id: I6cb2bca2fb8ba3913bbf6633996341b52639fe41
2018-11-15sw: replace delete with unique_ptr in SwListImplMichael Stahl
Change-Id: I5ee0928bb5ce490b52005eb3f97b56ceb81db062
2018-11-15sw: rename the misleading SwWrtShell::SttDoc/EndDocMichael Stahl
... to StartOfSection/EndOfSection, which corresponds more closely to where they actually move the cursor, in SwNodes::GoStartOfSection. SwCursorShell::SttEndDoc does what one would expect from these. Change-Id: I5005e3ebf230c903a4e63dcdda93892a8658e096
2018-11-15sw_redlinehide_3: fix SetRedlineFlags() skipping over redlinesMichael Stahl
If there's a insert redline inside a footnote whose anchor is in a delete redline, the nested redline will be copied by the first iteration of the loop in SetRedlineFlags() and then deleted in the second iteration, while handling the outer delete redline. This causes the redline immediately following the outer delete redline to be skipped in the 2nd iteration. Change-Id: Iba5c3a7b0d6d8a0d76a6ab6c7066cc4b059edb75
2018-11-15sw_redlinehide_3: invalidate footnotes in UnHideRedlinesMichael Stahl
... so the numbers are repainted, both in the document body and in the footnotes. Change-Id: I4164f1bace1b984a841f520f4832a324b811ab3f
2018-11-15sw_redlinehide_3: update footnote numbers on redline opsMichael Stahl
Needed for FTNNUM_CHAPTER and FTNNUM_DOC, as well as end-notes. It should be enough to update from the start node until the end. Change-Id: I47414f93b9ad29bc4ab4ee0fc25ae40fae160427
2018-11-15sw_redlinehide_3: use appropriate footnote number in text formattingMichael Stahl
Add layout parameter to SwFormatFootnote::GetViewNumStr(). Change-Id: Iff9c9ff31d1793b66ba7e3ebdfa5cfe413324471
2018-11-15sw_redlinehide_3: add second footnote numberMichael Stahl
Add a separate footnote number to SwFormatFootnote for the case when the layout hides redlines. If the footnote is in a delete redline, the value will be an arbitrary number, let's use the same number as the last visible footnote for simplicity. Change-Id: Ic7fff9d1bb2c90f5ad811b859c6501a193b7ae70
2018-11-15sw_redlinehide_3: remove number parameter from SwDoc::SetCurFootnoteMichael Stahl
The number is pretty useless: none of the callers know what the proper auto-counted number is going to be, so they either pass in the number that the footnote already has, or 0. It is particularly funny if the SwPaM is actually a range containing multiple footnotes; fortunately such a call is apparently not possible currently. Just remove the parameter and use the existing footnote number directly. Change-Id: I45dee999b8b0b630eff4347a563ccca2869f84cc
2018-11-15sw_redlinehide_3: fix SwAccessibleParagraph not being disposedMichael Stahl
If it is merged, it doesn't have GetDep(). Change-Id: I5a362c03fe7fcb0a6246aef0a0ac2824c48ede36
2018-11-15tdf#120991 sw_redlinehide_3: fix crash when storing clipboard documentMichael Stahl
It doesn't have a layout, of course. Change-Id: Iec4809ec4a14e1fa9852d09619a8b344419b29e7
2018-11-15sw_redlinehide_3: fix SwAttrIter::SeekFwd()Michael Stahl
This never called Rst() in the loops because the m_nPosition wasn't updated. Change-Id: I5a9cf47d9fe6d92bb7fccf255acbbd22f04b7f47
2018-11-15sw_redlinehide_3: fix SwAccessibleParagraph::getRunAttributes() indexMichael Stahl
... check, which should accept the past-the-last-char index, because as the comments say it returns the hard attributes of the SwTextNode as well, so it should work for empty paragraphs too. (similar fix was done in getCharacterAttributes() in IA2) Change-Id: I01e1a8f66f103b63584e88ce785ac2044c5db2b9
2018-11-15sw_redlinehide_3: rewrite MergedAttrIterByEndMichael Stahl
It doesn't actually work with a similar logic to the other iterators, because it iterates ByEnd but forwards, so the hints and the extents don't come in a matching order. To prevent complicating this further, replace it with a new implementation that does only what the one client expects, and put it directly in SwTextFormatter replacing the previous integer iterator m_nHintEndIndex, so that it is created only once. Change-Id: I144bfcf7e837a4fb0e7ec279edfba4732d0ae897
2018-11-15sw_redlinehide_3: fix MergedAttrIterReverseMichael Stahl
Was using the wrong node when iterating; also the tricky case of empty or without-end hints at the start of an extent was wrong. MergedAttrIter also shouldn't include wihout-end hints and non-empty hints at the end of an extent. Change-Id: Ia0776c1d3043cbd6d76fa04905b4937ebba53398
2018-11-15sw_redlinehide_3: fix typo bug in SwCursorShell::GetSelText()Michael Stahl
Change-Id: Ieee07d149d045b7953ea8d5489f2fb6aed13e5e4
2018-11-15sw_redlinehide_3: [loplugin:blockblock] in accpara.cxxMichael Stahl
Change-Id: Ib401e6d453519890badf13320e6f2123d1a3b11b
2018-11-15sw: simplify & fix SwAccessibleParagraph::getHyperLink()Michael Stahl
There is an inconsistency between getHyperLinkCount and getHyperLink, as the latter uses index 0 as a no-op for some ToC link that was never implemented, so all the real hyperlinks have their index offset by 1. Also it's pointless to call getHyperLinkCount once per loop iteration. (regression from 76c549eb01dcb7b5bf28a271ce00e386f3d388ba) Change-Id: Iec83b6680abbdff5d372ca40358bd1306f3bd991
2018-11-15sw_redlinehide_3: convert SwAccessibleMapMichael Stahl
BuildSelectedParas() needs a little tweak to create idempotent map entries while it iterates over the nodes of a merged paragraph. InvalidateShapeInParaSelection() has some dodgy code to check if flys are selected; probably should check for the start pos. of the frame for AT_PARA anchor. Change-Id: I2abe5dff1fb7fd0b95cc6c78b756f250db5f0872
2018-11-15sw_redlinehide_3: adapt SwAccessibleDocument::getAccFlowTo()Michael Stahl
This looks like it wants to deduplicate paragraphs; just use a std::set for the frames, and retrieve them with a particular SwPosition, which should deduplicate fine. Change-Id: I0d0bd5cc4eb8d41d0a2f64979ccfde62ebc3533a
2018-11-15sw_redlinehide_3: remove SwTextFrame::GetTextNode()Michael Stahl
Change-Id: Ie46d8846887e9282ef40d63255f8a70e22f304e9
2018-11-15sw_redlinehide_3: minimally convert laycache.cxxMichael Stahl
Just fix the TextFrameIndex / GetTextNode usages. This does not make the layout cache actually work if IsHideRedlines is enabled, hence the layout cache remains disabled in that case. Change-Id: I9aa1fb490c3dd4fd26165f2e60513ec267857d78
2018-11-15sw_redlinehide_3: SwXTextViewCursor::getString() without redlinesMichael Stahl
Change-Id: I734e27c95e20373f8de32f8db2183275c94144e5
2018-11-15sw_redlinehide_3: trivial conversions in new code in fntcache.cxxMichael Stahl
Change-Id: Id625ee27e69800780c04ea80d888f606cde0f308
2018-11-15sw_redlinehide_3: trivial conversions in new code in xmldump.cxxMichael Stahl
Change-Id: I37624c92549b4b3cd4d9616a4952163bf51526ef
2018-11-15sw_redlinehide_3: bug in UpdateMergedParaForMoveMichael Stahl
lcl_SetWrong works on model positions. Change-Id: I34353a09260e336c15696a7bc48a5922bfd92e4a
2018-11-15sw_redlinehide_3: convert even more SwAccessibleParagraph functionsMichael Stahl
... and finally remove GetTextNode(). Change-Id: I7ad91bf709b705afcf7ada79fd2a97335329e8b7
2018-11-15sw_redlinehide_3: convert SwAccessibleParagraph::_correctValues()Michael Stahl
Tricky usage of SwWrongList here, let's hope this works... Also, there is a similar bug here, the nIndex is in a11y coordinates but it was used directly as input to SwWrongList; better to convert first. Change-Id: I9b49b4dc84089c03df0e1302512d13d289d16161
2018-11-15sw_redlinehide_3: convert SwAccessibleParagraph::_getRunAttributesImplMichael Stahl
There appears to be a bug here, in that the nIndex is an index into the accessiblity string, but it was used without conversion as a model position in SwPosition; let's try to fix that. Change-Id: I7a43ceacfe59102577f39ab4b8fec3b495db345d
2018-11-15sw_redlinehide_3: convert more SwAccessibleParagraph functionsMichael Stahl
Change-Id: I33079154b4775b1df55693bf6046adbf27b0c1e3
2018-11-15sw_redlinehide_3: convert SwTextMarkupHelper and related ...Michael Stahl
... functions in SwAccessibleParagraph, with the new WrongListIterator. Change-Id: Ie401dd867a06a1963e49fa54afa978ad1f1346f5
2018-11-15sw_redlinehide_3: add another kind of WrongListIteratorMichael Stahl
This is not very efficient but should be good enough for a11y use. Change-Id: Ibb00cf4ae18effb09673f3f7d9b9b2e1d72413b1
2018-11-15sw_redlinehide_3: remove GetSelection/GetSelectionAtIndex duplicationMichael Stahl
Delicious copypasta! Change-Id: I95ab5a1ef58b01f775065a970a0d7eb2b6bf6394
2018-11-15sw_redlinehide_3: convert selection functions of SwAccessibleParagraphMichael Stahl
Do i smell copypasta? Change-Id: I5450118b58540eee5ac8ff2e941d005fda4572c3
2018-11-15sw: fix 2 inverted SAL_WARN_IFsMichael Stahl
(regression from 1397e7dd3061c8995c9c042c59c4f2982bdf5e63) Change-Id: I9daa478092209b2e7c168f45280bd5f873f674f2
2018-11-15sw_redlinehide_3: convert the hyperlink code in SwAccessibleParagraphMichael Stahl
Use MergedAttrIter for the iteration. Fortunately all use of the iterator is transient, i.e. it doesn't live past a UNO method return. Change-Id: I4292a4ecafe94396a9d4cc64c2a26c5f28429ef3
2018-11-15sw_redlinehide_3: SwAccessibleHyperlink listen at SwFormatINetFormatMichael Stahl
There is an annoying problem here: how does a SwAccessibleHyperlink check whether its corresponding model hint still exists or not? The existing check via the hint-position appears not ideal, and with the MergedPara the obvious extension is to add a SwTextNode pointer (or node index?) which would make it even less ideal... Instead, do as a lot of classes in unocore do, and register as a listener on the pool item. There is another aspect there in how the SwAccessibleHyperTextData map gets disposed quite eagerly when anything changes, but the SwAccessibleHyperlink can live longer than this map. Change-Id: I7d0780cf28794b4ef68cff5d640190694f67530e
2018-11-15sw_redlinehide_3: stop SwAccessibleParagraph listening at SwTextNodeMichael Stahl
The SwAccessibleParagraph is a client of SwTextNode, just so that it can dispose its mpParaChangeTrackInfo on any and all editing operations. This won't work with merged paragraphs, but on the other hand it's not necessary with merged paragraphs because the initChangeTrackTextMarkupLists() does nothing if IsHideRedlines(). However there is the problem that the node and the frame might become mis-matched if the frame is "moved around", so to avoid problems due to that, listen on the SwTextFrame instead of the node, and have the SwTextFrame relay any events it gets. Though the frame is only SwClient, this is now possible thanks to the SfxBroadcaster on the SwFrame class, so convert to SfxListener; also the Accessible lifetime is tied to SwTextFrame anyway. In UnHideRedlines(), send a dummy event too so that toggling Show/Hide disposes the mpParaChangeTrackInfo too, which previously happened as a side effect of moving the redlines around in the nodes-array. Change-Id: I4e5a7107cb55d408266ee42463f9fa2a4a8b721b
2018-11-15sw_redlinehide_3: convert SwAccessiblePortionDataMichael Stahl
Change-Id: I0f6d2c09bc06a6de1b46627b205f3c7edd9e594c