summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-10-23sw: fix buildMichael Stahl1-3/+3
should have just reverted that patch... Change-Id: I17c8517a0dfd500423a6cd185abb89f40164daa9
2019-10-23sw: let's insert some paragraph break character in SwPaM::GetText()Michael Stahl5-8/+18
There are just 3 callers of this; 2 redline-related ones should both use DenoteSpecialCharacters() anyway and SwEditWin::FlushInBuffer() would probably be surprised to find any of the other CH_TXTATR in the string, so assume there's something limiting the cursor selection in that case. Change-Id: I83dcdc2b6734b6db22404d1c9b3adc9362451e9b Reviewed-on: https://gerrit.libreoffice.org/81343 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23writerfilter: add config to import all fields as generic, incl. commandsMichael Stahl4-3/+17
Change-Id: I02d178de3672200b69e60ba5841c993fa0d797f9 Reviewed-on: https://gerrit.libreoffice.org/80076 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: DOCX export of nested fieldmarksMichael Stahl4-6/+26
The DocxAttributeOutput was more or less ignoring FieldFlags::CmdEnd; split CmdField_Impl() into 2 functions to write the command text with the Start like WW8/RTF and the separator with the CmdEnd. Change-Id: I7cfa52e2d786a8c9b427057eadc9ccc271d2f90f Reviewed-on: https://gerrit.libreoffice.org/81263 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: RTF export: export fieldmarksMichael Stahl1-8/+13
There was some special code that was used only to export ruby attributes; generalise it a little. Change-Id: Iac5316b97e095fb3811404cad0568b9ab63a96f0 Reviewed-on: https://gerrit.libreoffice.org/81085 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: WW8/RTF/DOCX export: handle CH_TXT_ATR_FIELDSEPMichael Stahl3-4/+21
Move second part of the fieldmark export later, where the separator dummy character is. Somehow this may result in an additional empty run, but that shouldn't matter, other than to a few tests. Change-Id: If6967e91721ae5ad51dc42ff1ba98625018eae84 Reviewed-on: https://gerrit.libreoffice.org/81084 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: WW8 import: be a little more flexible with FORMTEXT fieldsMichael Stahl2-2/+4
The subsequent export change will somehow create things like (rr) p pF->nLCode $1 = 13 (rr) p rStr $2 = " FORMTEXT \001\062\060" ... so be a little less strict with the 0x01. Change-Id: Ie99002d099a3803989b71ae8c26b7f4bfe61c943 Reviewed-on: https://gerrit.libreoffice.org/81083 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23xmloff: ODF import: reimplement fieldmark-start/fieldmark-endMichael Stahl3-86/+118
This needs to work in a similar way to writerfilter, because it has the same problem: fieldmark has 3 positions but attach() only recieves 2 positions. Insert the fieldmark at the fieldmark-start and move the cursor before the CH_TXT_ATR_FIELDEND character, and when the fieldmark-end arrives, move the cursor forward again. This will slightly change the import of invalid documents, e.g. when a fieldmark-end is missing, but that seems not so important and without a name attribute on the fieldmark-end we can't do any better. Change-Id: I3f0bd738277f56a999e79e4def911101b64b07e7 Reviewed-on: https://gerrit.libreoffice.org/81082 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: fix crash after SwXFieldmark::SetFieldType()Michael Stahl1-0/+2
It deletes the existing IFieldmark and creates a new one; meanwhile the SwXFieldmark is disposed and its m_pImpl->m_pDoc is cleared but then it's not initialised again by registerInMark(). (regression from f66a83c95c21b4311918a64bb85016857b49f4d4) Change-Id: I8c4d9b829f68b9e5bd714bcad2061d0ff95bfb82 Reviewed-on: https://gerrit.libreoffice.org/81081 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: remove checks for invalid document model wrt fieldmarks...Michael Stahl1-20/+19
... in MSWordExportBase::OutputTextNode() - better crash so we can fix the bugs. Change-Id: I0d7b58bffa261c9c0c88b4245fcde38c776931f9 Reviewed-on: https://gerrit.libreoffice.org/80919 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23writerfilter: adapt the "real" fieldmark path in CloseFieldCommand()Michael Stahl3-34/+49
... and PopFieldContext() to work the same as the generic fallback path, so that the CH_TXT_FIELDSEP is in the proper position, before the imported field result. Change-Id: Ic9b24dce43e7809a183b91cdc97c037f410cbaa8 Reviewed-on: https://gerrit.libreoffice.org/80918 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23writerfilter: StartOrEndBookmark(): don't hardcode end of documentMichael Stahl1-1/+5
... use xInsertPosition if available. Change-Id: Id9a0ba2842ed88c7a83ffcd5ce9d12334deae755 Reviewed-on: https://gerrit.libreoffice.org/80916 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23tdf#120224 writerfilter: don't suppress all bookmarks inside fieldsMichael Stahl2-3/+2
MSWordExportBase used to erroneously export all sorts of marks as bookmarks, but we fixed that. Apparently this code in DomainMapper_Impl::SetBookmarkName() should prevent import of the bookmarks that were exported as duplicates for fieldmarks; suppress only the marks with the same name as the fieldmark, but not unrelated marks that happen to start inside the field, like the "_GoBack" one in tdf120224_textControlCrossRef.docx. The reason why this was necessary previously is some dubious nonsense in model.xml that caused the ffData stuff to be delayed until the next run, hence the bookmark start is sent to domain mapper before the ffData; this was already helpfully marked with a TODO comment, so just implement the suggestion. (regression from 579c0749bef8c980507229439715e72060c1b077) Change-Id: I15a1865ac34b0b9b3f11849d612e95115582b90b Reviewed-on: https://gerrit.libreoffice.org/80917 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: WW8/RTF/DOCX export: only export actual bookmarks as bookmarksMichael Stahl2-7/+24
Don't export all the other cruft that happens to be represented as some IMark derived type in Writer in MSWordExportBase::GetBookmarks(). Change-Id: I4fc05e84b9fc80bb2186899c58bf140dd3779f83 Reviewed-on: https://gerrit.libreoffice.org/80915 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: fix copying of fieldmarks in lcl_CopyBookmarks()Michael Stahl1-1/+4
Surprisingly this handles CHECKBOX_FIELDMARK differently than the others but clearly it's a bug not to copy a fully selected TEXT_FIELDMARK as seen in CppunitTest_sw_ooxmlexport testMultiPageToc, where a header is copied with its CH_TXT_ATR_FIELD* but not the fieldmark. Change-Id: Ibf4d934ea834c1ac9fe4e541259605a745246049 Reviewed-on: https://gerrit.libreoffice.org/80914 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: SwSubFont::GetTextSize_() assert on presumably dead codeMichael Stahl1-0/+2
Change-Id: Iced0776a719dbc7e9d19db7bd547c408caa6a04f Reviewed-on: https://gerrit.libreoffice.org/80913 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: getFieldmarkFor() and GetCurrentFieldmark() return innermost oneMichael Stahl1-3/+13
In case of nested fieldmarks, this seems plausible to me. Change-Id: Iefa6a3836421fc93d7687eeb608f21d63fb45e81 Reviewed-on: https://gerrit.libreoffice.org/80912 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: SwWrtShell: delete field command when deleting the fieldMichael Stahl3-2/+25
Change-Id: I6dbb7a36bdca103d6e9e72a5b5b48ffc135080a1 Reviewed-on: https://gerrit.libreoffice.org/80676 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23writerfilter: import nested generic fields from RTFMichael Stahl2-7/+30
* for m_bStartGenericField, push new insert position onto the stack in DomainMapper_Impl::CloseFieldCommand(), not in DomainMapper_Impl::appendTextPortion() * how is the field result inserted into the field, instead of after it? - it doesn't seem possible to move the insertion of the field mark to PopFieldContext(), as there's no way to pass 3 positions to attach(), and exposing a writable property for the position(s) is a bad idea - finishParagraph() calls AppendTextNode(), which happily ignores a content index on the given XTextRange - so temporarily insert a paragraph break, override the insert position, and join the paragraphs in PopFieldContext() Change-Id: Ie49084f6ea6451e7d7f9b613cedce326de9a54f1 Reviewed-on: https://gerrit.libreoffice.org/80075 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: fieldmark insert/delete UndoMichael Stahl5-24/+118
SwHistoryTextFieldmark implementation doesn't work that well with its hardcoded +5 etc. so reimplement that storing all 3 positions. Add Undo classes for deletion as well, and use them automatically when deleteMark() is called with Undo enabled. Change-Id: I45a73080b08bde9e046525892c101aa2d622269e Reviewed-on: https://gerrit.libreoffice.org/80627 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: DateFieldmark separator position: hack to put it at the startMichael Stahl4-19/+14
DateFieldmark isn't created for an actual field with a command but for a SDT (Date Picker Content Control), so it's somewhat pointless to insert a separator for it in the first place; but better have an invariant that every pair of FIELDSTART/FIELDEND has a FIELDSEP. TODO: maybe add another pair of distinct START/END for this thing. Change-Id: I37301b578c668ecbf9408a48c227db5991c33f9e Reviewed-on: https://gerrit.libreoffice.org/80675 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: WW8: fix the separator positionMichael Stahl2-3/+5
WW8 inserts the fieldmark at the end of the result, so separator should be at the start; writerfilter inserts fieldmark at the end of command so separator should be at the end. Change-Id: I44c9811139a34f529c553dd2fd46fdaccd554732 Reviewed-on: https://gerrit.libreoffice.org/80674 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: add CH_TXT_ATR_FIELDSEP position parameter when insertingMichael Stahl7-26/+51
Different callers want it at the end, at the start, or in the case of Undo it can even be in an arbitrary position... (except if it is ensured that the field command is deleted before the fieldmark?). So let's just pass in SwPosition and be flexible, if it is missing it will be before the end as before. Change-Id: Ibec222f633bdaf66abd1540027d0f5c75988c738 Reviewed-on: https://gerrit.libreoffice.org/80673 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: actually insert CH_TXT_ATR_FIELDSEPMichael Stahl7-14/+108
Change-Id: I18accf26a05546313aeac498b94e7f418f8f136e Reviewed-on: https://gerrit.libreoffice.org/80073 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-23sw: DocumentContentOperationsManager::CopyImpl()Michael Stahl2-4/+74
Change-Id: I1a6ce9f439be9b8f863f3981fb9fd7ef1123e6c7