summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper_Impl.cxx
AgeCommit message (Collapse)Author
2018-01-23related to tdf#97417: fix unit test page countJustin Luth
The unit test should have been showing a blank page before the content page. Non-section paragraphs should not remove the first/last status. Frames were already excluded, now this patch also excludes header/footer paragraphs. This is in preparation for tdf#104710. Change-Id: I686944843302160d6f6bbbcb73f01c836179aa9f Reviewed-on: https://gerrit.libreoffice.org/32234 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> tdf#102466 Added unit test: ensure 1st page is not missing Change-Id: Icbc97d6a69447575aa2980a700a663ece226f781 Reviewed-on: https://gerrit.libreoffice.org/44273 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de> Reviewed-on: https://gerrit.libreoffice.org/48300 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-21tdf#86087 DOCX Import link as relative if preferredSzymon Kłos
Change-Id: I92e273aa57db8b4b9779d8d784c5bbad42d720e5 Reviewed-on: https://gerrit.libreoffice.org/44735 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/45049 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-21tdf#86087: Convert relative URLs to absolute upon import of docx etc.Stephan Bergmann
...to fix the import part of tdf#86087. Apparently, "fragment-only" relative same-document URLs (like <#anchor>) are supposed to remain relative; otherwise, various tests like testFdo69548::Import in CppunitTest_sw_ooxmlimport fail. (cherry picked from commit 0dd82f4ffe7ae462bae30b93d245d2234c55ef84) Change-Id: I2dbba2f2f1e225f85e21600e68a3c4cffdb023b2 Reviewed-on: https://gerrit.libreoffice.org/45048 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-10tdf#43017: Support for DOCX hyperlinks character propertiesVasily Melenchuk
Here goes a bunch of related changes: 1. Create new character style based on current character properties 2. Apply created style to hyperlink object 3. Fixes to predefined style names usage in w:rPr 4. Disable style usage for hyperlinks in TOC: they will receive later anoter styles Reviewed-on: https://gerrit.libreoffice.org/41784 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit eaa9cf6a3069fba3d82c046f0041bfb537d9e648) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx writerfilter/source/dmapper/DomainMapper_Impl.hxx Change-Id: I1a228992eb7c1e259a6a811aa7f959debaae4f35
2017-10-18tdf#66398 Import/export docx document protection propertiesSerge Krot
This includes: - original fix, import/export of all doc protection properties - unit test - remove double initialization of the form protection - do not output document protection in docx twice - remove useless breaks - fix cid#1418980: Resource leak - parse and output permissions for DOCX using bookmarks - enhance unit test: check permissions at content level - fix copy-paste: call start() bookmark instead of end() Conflicts: sw/source/filter/ww8/docxexport.cxx writerfilter/source/dmapper/DomainMapper.cxx sw/source/filter/ww8/docxexport.cxx Change-Id: I63bde881507dc3c5d123bbcf96b63027522ea569 (cherry picked from commit faa71d493a8c9ceab3a67ab7d5197d3b8ec020e2)
2017-10-18tdf#90789: DOCX paragraphs in shapes like frames do not belong to section.Vasily Melenchuk
Change-Id: I60644bd62e2a2ac97a97f0a492b146dc69456cd6 Reviewed-on: https://gerrit.libreoffice.org/43291 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit b7e5920bb43c2c7e7d98a235a12c5bb2536f8685)
2017-06-21trac#21081 Aus aDIS generierte RTF-Dokumente werden falsch eingelesenThomas Beck
Backport des fixes aus dem community upstream. Reviewed-on: https://gerrit.libreoffice.org/37814 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 8a71a2a843c31e5eeb5ae4b08ee861ba8f2c4516) trac#21081 Beheben von fehlern die durch backport enstanden sind Beheben von einigen buildfehlern und merge konflikten Change-Id: I55025984e343d04da7fc0f201164ef39e3a26202 901861fab1a72bb2d222dc3b8292b89aa696256d
2017-03-27Resolves: tdf#106724 crash when Title property doesn't already existCaolán McNamara
because we just write past the end instead of resizing before hand (cherry picked from commit 4e32e8900e59f9751a60d9fdef80cdf7d500f72f) Change-Id: I4742980a331b14ca39aff8aa6cfc27db154091ff Reviewed-on: https://gerrit.libreoffice.org/35652 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-01-19tdf#99074 sw: remove duplicate property "IsBrowseMode" againMichael Stahl
Commit e0f9bb795251d950b5dd960fcd030170c8eb67aa added the property "IsBrowseMode" to SwXDocumentSettings, but it is already available in the API as SwXViewSettings property "ShowOnlineLayout". The problem is that both of these properties get exported in ODF into settings.xml, so it contains "IsBrowseMode" twice. Unfortunately the SwXViewSettings are not available in writerfilter, because the XModel::getCurrentController() is null, the view is created after the import. But there is already a way to store ViewData in the SfxBaseModel, which is then used by SfxBaseController::ConnectSfxFrame_Impl() when creating the view. This applies the property at just the right time. (cherry picked from commit 2dce8dd41c208ecda40c054635f3736147ec8914) Change-Id: I842845d09a7b3fe81e27a1ed8ac8a8594da7f4e8 Reviewed-on: https://gerrit.libreoffice.org/33285 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-11-23tdf#82824 DOCX import: fix at-char embedded object handlingMiklos Vajna
The anchor type of embedded object was simply not handled, we always assumed that it's as-char. When it's at-char set the anchor type accordingly, and also set the usual 6 properties determining the position of the anchored object. (cherry picked from commit 10efab2b9a3cf7fc49655c90ba29db4512680c38) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I3f8bede33c6f1a0bdc4f4d4ea59c4fc805802291 Reviewed-on: https://gerrit.libreoffice.org/30965 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-11-11tdf#79329 DOCX import: fix missing outer table with floattable at cell startMiklos Vajna
The bug document has a normal table, then its C1 cell starts with a nested table, which is floating. The problem is that converting the nested table to a textframe invalidates the start text range of the C1 cell in the outer table we store, so the conversion of the outer table from text to table fails. This never worked, so to avoid the regression just don't convert inner floating tables to textframes when they're anchored at the cell start. A more general fix in the future can be addressing the actual invalidation of the cell start/end text ranges, and then this specific fix will not be necessary anymore. (cherry picked from commit c1eebcdac9f2b289fd363399130c485ca5ff444c) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport9.cxx writerfilter/source/dmapper/DomainMapper.cxx Change-Id: I12cefa41977cf719b07b0fb3ef9ec423c17ef3b1 Reviewed-on: https://gerrit.libreoffice.org/30770 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-12fftester: no table managerCaolán McNamara
Change-Id: Icb3c640e04416f9120d37558646a570daeddf0a4 Reviewed-on: https://gerrit.libreoffice.org/28826 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-09-12fftester: no table managerCaolán McNamara
Change-Id: I033454670d1ee662bc80bc07578690155d97ce28 Reviewed-on: https://gerrit.libreoffice.org/28806 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-08-08fftester: guard against empty table manager stackCaolán McNamara
Change-Id: Ibb4cadb58aa17eacfc9741f7f13c780be347cd8b (cherry picked from commit 145e2dfc4501cb3fa01a1771cb6829b5945df4a6) Reviewed-on: https://gerrit.libreoffice.org/27937 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
2016-08-02fftester: another table manager stack checksCaolán McNamara
and a m_xTextFactory check too Change-Id: I9352410c42048b4dd7d6dbc3514351ab8f16790b (cherry picked from commit 8a6b2fb5b94de43316ab3ea95ff07cf5f46b6134) Reviewed-on: https://gerrit.libreoffice.org/27759 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-07-30fftester: another empty table manager stackCaolán McNamara
Change-Id: If3148cb6e16cff4aad28c4f86467c66ed04bcd05 (cherry picked from commit d00fc303bca7765762a602531b7d3b40ce8f1740) Reviewed-on: https://gerrit.libreoffice.org/27703 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-07-18protect against empty m_aTableManagers stackCaolán McNamara
Change-Id: I29fecc5e0efb3b3d907f0c6505d42818fa464ffc (cherry picked from commit 9d76d9d9abb08788f2882612cfe6d0df6e19af39) Reviewed-on: https://gerrit.libreoffice.org/27280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-07-07Resolves: tdf#100770 crash on loading specific docxCaolán McNamara
use same safeguards as RemoveLastParagraph does Change-Id: I43ed4eb28f44654054fd266bc464840af7014fea (cherry picked from commit 000263f799d4aa9ad21e63f474def55438ce601e) Reviewed-on: https://gerrit.libreoffice.org/26943 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-05-18clang-tidy modernize-make-sharedNoel Grandin
Change-Id: I3fa866bfb3093fc876474a9d9db29fe05dc2af3a Reviewed-on: https://gerrit.libreoffice.org/25056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-13clang-tidy modernize-loop-convert in writerfilter to xmlsecurityNoel Grandin
Change-Id: I334411c6b57c028ffb41b5deb72002f9d54038c3 Reviewed-on: https://gerrit.libreoffice.org/24923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-29tdf#99434: import/export documentProtection-forms from .docx incl. testOliver Specht
the setting <w:documentProtection w:edit="forms"> disables editing of content outside of form controls. Change-Id: I0d11373d9010778ed5798598020e453cde06fa0f Reviewed-on: https://gerrit.libreoffice.org/24365 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2016-04-26update loplugin stylepolice to check local pointers varsNoel Grandin
are actually pointer vars. Also convert from regex to normal code, so we can enable this plugin all the time. Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1 Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-22Avoid reserved identifiersStephan Bergmann
Change-Id: Ie1830e7645b8bb8b8020fdb384471801a1aaca31
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann
Change-Id: I5f38167cc2fd0104ad388c63f766bda6acae96e2
2016-04-18clang-tidy performance-unnecessary-copy-initializationNoel Grandin
probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-12clang-tidy performance-unnecessary-value-param in writerfilterNoel Grandin
Change-Id: I1f61be80ac1ebe42668580b09a261e7e3af1a403
2016-04-04tdf#99074 DOCX import: handle <w:view w:val="web"/>Miklos Vajna
Instead of always using the Normal view, use the Web view when the DOCX file contains Web Layout. For this to work, expose sw's DocumentSettingId::BROWSE_MODE via css.document.Settings. Change-Id: I7787ca058d8cb8a346b2001a2bd70c3df86d8673 Reviewed-on: https://gerrit.libreoffice.org/23806 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-03-31use SAL_N_ELEMENTS in for loopsNoel Grandin
for with git grep -n 'for.*sizeof' Change-Id: I6211024385e03ac5eeeb38690d2c1c699e015c2f Reviewed-on: https://gerrit.libreoffice.org/23569 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-11writerfilter: avoid ugly cross-directory includeMiklos Vajna
Change-Id: I16db4e16e5c2fa3aa3bfb22f83d2c36695499b5c
2016-02-23tdf#59699 RTF import: handle INCLUDEPICTURE fieldMiklos Vajna
On one hand, don't handle a fieldmark for it in dmapper. On the other hand, handle the field in the RTF tokenizer as it would be {\pict ...hexdump... }, that will result in an inline picture, as wanted. Change-Id: I554fdf017920350144300fd86617bf74eed8995b
2016-02-09Remove excess newlinesChris Sherlock
A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-05Fix typosAndrea Gelmini
Change-Id: Ice72f8d9971e15dd6ef365e64cd567b8581a92d3 Reviewed-on: https://gerrit.libreoffice.org/21797 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-31boost::tuple -> std::tupleCaolán McNamara
Change-Id: Ia08c184b792ff73d3ed49d6a5d54dec1a35943e9 Reviewed-on: https://gerrit.libreoffice.org/21955 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-01-21oox: import Math objects from PPTX filesMichael Stahl
This is quite hacky and limited: in OOXML these are not OLE objects but occur inside text boxes, and PPT 2010 allows inserting multiple Math objects into one text box but Impress does not have as-character anchored objects, so we can't import that properly; for now only import Math if there is nothing else in the text box. Also for now only import them as children of TextParagraphContext (a:p); it's not clear what the possible parent elements could be since the OOXML standard only lists WordProcessingML parent elements :( Change-Id: I847f810084c9ddae4b60f93896fb73a742683cc2
2016-01-19tdf#85523 DOCX import: fix unexpected extra char at comment endMiklos Vajna
Change-Id: Ic3eb073d11a395a81b90fd1a9292d6ecf2940c09
2016-01-18loplugin: unused return values in writerfilter/Noel Grandin
Change-Id: I048fba90319bd164ddd7bf0078b4615092d5f33a Reviewed-on: https://gerrit.libreoffice.org/21567 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-10Fix typosAndrea Gelmini
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86 Reviewed-on: https://gerrit.libreoffice.org/21209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-08tdf#93640 Fix import of linked left page header/footerLuke Deller
In a docx section, any header/footer which is not defined in the section is considered to be linked to the previous section. In the Word UI this is shown as an option named "Link to Previous", and editing the header/footer in either section affects both sections. LO imports this by copying the header/footer contents from the previous section, but it did not handle the case where a section had different headers for left pages vs right pages. Fix this, which involved changing the mechanism used to detect whether a section has defined a certain header/footer (which unlinks it from the previous section): rather than trying to figure it out from the converted LO page styles, explicitly track which headers/footers have been defined using boolean member variables on the SectionPropertyMap instance. Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: Ic43a867356c2cd5df09d39f2a3ddefa584b6765c
2016-01-07tdf#95213 DOCX import: don't reuse list label stylesMiklos Vajna
We used to optimize the creation of these styles, so in case two list label had the same character properties, then we could avoid creating two styles for those. This isn't correct though: it means if the style is changed later by the user, then unexpected other places in the document will change as well. Do what the binary DOC filter does: create one character style for each level of a numbering separately. Change-Id: I967b30fc078b1be30f7ef81b2706df2962fc3fb0 Reviewed-on: https://gerrit.libreoffice.org/21191 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2015-12-08tdf#54584: adjust skip-slash condition, allow unterminated quoteMike Kaganski
Experimenting with different non-alpha characters in front of field, most of them aren't allowed and result in field not recognized by MS Word: #$%&'()*+,-./:;<>?@[]^_`{|}~ Besides, if backslash "\" is followed by another backslash or space, it is illegal, too. This patch takes care of it. On the other side, not closing quotes is allowed by MS Word. This patch allows this, too. The patch does not handle another allowed field code "=2+2". This should be done in another commit. Change-Id: I842fe59c026b68977e61a7ae0b5495c02803ad83 Reviewed-on: https://gerrit.libreoffice.org/20435 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-12-07tdf#54584: allow backslash before field type in RTF and DOCXMike Kaganski
In some RTF and DOCX files, field type may be prepended with backslash. It seems not strictly standard-conformant (at least not to [MS-RTF]). Still, MS Word reads these fields OK. This patch allows LO to read them, too. Change-Id: I1f6bbdd9d57adbea8882d078761dd97298ca03b3 Reviewed-on: https://gerrit.libreoffice.org/20420 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-12-02DOCX import: handle <w:smartTag>Miklos Vajna
These can be sort of arbitrary key-value pairs around one or multiple runs, handle the following subset: - when they appear at a paragraph context -> we assume they are annotations on the paragraph - when the smart tag's URI/element is RDF -> we map these to RDF metadata statements on paragraphs - when the attribute name's namespace is known, because in ODF we need to specify both a path and a type (namespace) for the RDF graph, and OOXML only provides a namespace As a start, recognize the TSCP BAF namespace from <https://www.tscp.org/wp-content/uploads/2013/08/TSCP_BAFv1.pdf>. Change-Id: Ib188b1395e7ec7e0441b4f12f86cfef99fb9f096
2015-11-24loplugin:unusedfields in writerfilter/Noel Grandin
Change-Id: I32348ef0aed955ab799ba90a59f4b511becb67e8
2015-11-19Simplify writerfilter::dmapper::DomainMapper_Impl::appendGrabBag()Miklos Vajna
Change-Id: I65c893fa8ab8ea6dfb061127c9b0bd31c906ed30
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: Ide85499515bd73f70bca356909683b43cd62f1d1
2015-11-05use uno::Reference::set method instead of assignmentNoel Grandin
Change-Id: I31a69a997098eb1807361b8049c3312a4f287d75
2015-10-22writerfilter: it's enough if dmapper gives the media descriptor to its implMiklos Vajna
Change-Id: Ia973799453d9ede60be3699ff8973e31605f06ef
2015-10-06tdf#91417: import hyperlink with history flag correctlyOliver Specht
ignore '\h' flag in hyperlinks imported from docx including import test Change-Id: I512e811050704f118bf9b2c786378f99e5d04378 Reviewed-on: https://gerrit.libreoffice.org/19154 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-09-29Fix typosAndrea Gelmini
Change-Id: If2e4adb2ce93c02ee14d831eedf4ef31da04b92d Reviewed-on: https://gerrit.libreoffice.org/18996 Reviewed-by: Joren De Cuyper <jorendc@libreoffice.org> Tested-by: Joren De Cuyper <jorendc@libreoffice.org>
2015-08-28Make sure nEnd-nIndex-1 is valid arg to OUString::copyStephan Bergmann
Change-Id: Ie646ae781bcd54be81173db42fe10f61b31ac628