summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper
AgeCommit message (Collapse)Author
2016-05-04use Any constructor instead of temporariesNoel Grandin
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
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-28Related: tdf#65642 RTF filter: import \pgndecMiklos Vajna
This as a side effect also implements support for DOCX <w:pgNumType w:fmt="decimal" .../>. Change-Id: I747c3f610dc13f614b6f962c2a498c987765ebb6 Reviewed-on: https://gerrit.libreoffice.org/24457 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
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-25Some more sal_Bool -> boolStephan Bergmann
Change-Id: I576f264f31fabf58de6cafa28eb7ba5e5f43c148
2016-04-22Avoid reserved identifiersStephan Bergmann
Change-Id: Ie1830e7645b8bb8b8020fdb384471801a1aaca31
2016-04-21Related: tdf#65642 RTF filter: import \pgnlcrmMiklos Vajna
This as a side effect also implements support for DOCX <w:pgNumType w:fmt="lowerRoman" .../>. Change-Id: Ifb524b25236a8bc774690266a4fa205154204109 Reviewed-on: https://gerrit.libreoffice.org/24273 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
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-14Related: tdf#65642 RTF filter: import \pgnucrmMiklos Vajna
This as a side effect also implements support for DOCX <w:pgNumType w:fmt="upperRoman" .../>. Change-Id: Ibf3bedca03c6c2a2b96eecb36ff6c4cf6e2281b4 Reviewed-on: https://gerrit.libreoffice.org/24073 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-14loplugin:passstuffbyref in writerfilterNoel Grandin
Change-Id: Ia85f5a7a9846802de7a1495e70d16c9e3418dc3e
2016-04-12clang-tidy performance-unnecessary-value-param in writerfilterNoel Grandin
Change-Id: I1f61be80ac1ebe42668580b09a261e7e3af1a403
2016-04-12cleanup: remove unused com/sun/star/uno includesJochen Nitschke
Sequence.h(xx), Any.h(xx) and Type.h(xx) and remove unused using-declarations from these files. Add a few missing includes provided by them. Change-Id: I6b91b6d1fdf9d0496dd546c0aab9bdcc6831a5d4 Reviewed-on: https://gerrit.libreoffice.org/23805 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-08tdf#99140 DOCX import: fix table horizontal aligment to be 'from left' ...Miklos Vajna
... when it was 'manual'. Regression from commit c1e563f6efd09cd3463f1b92a3022ae288c92087 (fdo#76741 [DOCX] Table Alignment and width type, 2014-04-04), DOCX import code had to deal with two kinds of horizontal alignment when it came to floating tables: the alignment of the table itself, and the alignment of the float parameters. The problem is, in general it's wanted that the table is aligned according to the floating parameters, but in Writer the "from left" UI setting is described differently for tables and fly frames: tables use LEFT_AND_WIDTH for that, while fly frames use NONE. Fix the problem by touching the default only in case the floating parameters have something that's different from NONE. With this, the width of tables is no longer lost when they are described to be floating ones in the DOCX markup, but FloatingTableConversion() decides to ignore that. Change-Id: Idd41c3e03e6ded8552e9d15b6080e4b45eb18d3d Reviewed-on: https://gerrit.libreoffice.org/23923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-08tdf#99140 DOCX import: fix table at the bottom of the page to span over ...Miklos Vajna
... multiple pages. In short, one more blacklist entry when conversion should not be performed. Change-Id: I764f02cc58ae1b7af802b81e570e4feaf73ee2c1 Reviewed-on: https://gerrit.libreoffice.org/23912 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-07tdf#99140 Factor out FloatingTableConversion() from CloseSectionGroup()Miklos Vajna
No logic changes intended, but makes it easier to add new rules when making the decision. Change-Id: I84d8e6a2b8a4b9ae6fe5cefd381292c2f68be45f Reviewed-on: https://gerrit.libreoffice.org/23901 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
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-04-04Use std::size_tMiklos Vajna
And include <cstddef> where necessary. Change-Id: Icc1208528d6a8b04375d55ccbf3cd6ef046b454f Reviewed-on: https://gerrit.libreoffice.org/23796 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-30Related: tdf#65642 RTF filter: import \pgnlcltrMiklos Vajna
This as a side effect also implements support for DOCX <w:pgNumType w:fmt="lowerLetter" .../>. Change-Id: I47b60a0390ef081dc15b26e40393e35bf7bad130
2016-03-29loplugin:staticmethodsStephan Bergmann
Change-Id: I090c01ef2fc52b8bec74ec78e23f1104877c734f
2016-03-29tdf#98882 DOCX import: set default para properties on the Standard para styleMiklos Vajna
That's what the DOC import does, and that's the reason e.g. the strange unwanted crop of the as-char anchored picture doesn't happen there. This also needs the "reset all existing style properties back to default" logic to be adapted: the Standard style has to be reset before the default are set, and later it should be left alone, otherwise the defaults are lost. Change-Id: Ie422a0b64b80a826fa4f469145a26283fb32d734 Reviewed-on: https://gerrit.libreoffice.org/23593 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-03-22tdf#65642 RTF filter: import \pgnrestart and \pgnucltrMiklos Vajna
This implicitly adds support for DOCX import of <w:pgNumType w:fmt="upperLetter"> as well. Change-Id: Ib19ecb8f7ca0c867ae3be2b41e49ac4cacfd5bb6
2016-03-14remove some unused typedefs, and inline some use-onceNoel Grandin
Change-Id: I5ada1cff98c0a3e065d126444f8052f444323743 Reviewed-on: https://gerrit.libreoffice.org/23234 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-25loplugin:unuseddefaultparams in writerfilter/Noel Grandin
Change-Id: Ib5a2f6f0404e8489a9699eac6b0c50e61f31083f
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-09writerfilter: silence 'failed to initialize RDF' warning on RTF importMiklos Vajna
After all the storage of the real docx input is not interesting, as it won't contain anything RDF-related in ODF markup. Also, the WW8 import uses the same empty storage without problems, so should be enough here, too -- to please RTF, which isn't ZIP-based, either. Change-Id: Iea14291cf56851d60caa3c3303b134067d04faac
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-02-04writerfilter: no need to manually realloc hereMiklos Vajna
Change-Id: I1663109adfa83bcc191953ffeefad1b563e03c14
2016-02-04vcl: take into account the font width is the average font widthChris Sherlock
I'm changing the Font class function names: - SetSize -> SetFontSize - GetSize -> GetFontSize - SetHeight -> SetFontHeight - GetHeight -> GetFontHeight - SetWidth -> SetAverageFontWidth - GetWidth -> GetAverageFontWidth That's because it really makes no sense to say that there is a single constant font width because obviously proportional fonts don't have one - the best we can do is an average font width, which is what folks like Microsoft sort of do already. On a fixed font, the average is still accurate, for obvious reasons :-) I'm also not a fan of GetSize/SetSize as I find it a might too generic. Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70 Reviewed-on: https://gerrit.libreoffice.org/22069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-01writerfilter: tdf#97417: don't insert numbering on end-of-sectionMichael Stahl
... paragraph, it will be copied to every following paragraph. (Before commit 2b78f2cd7b9e4bab0f3b3b9119238f36a1bbc7b2 the properties of the end-of-section paragraph would be overwritten by the properties inside the header) Change-Id: Ibe095cf873a09ef9e12f898d09b5fd6f61c914c9
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-29writerfilter: uno::Sequence -> std::vector for table rangesMiklos Vajna
Change-Id: If9ea1786a8a4b66288267e6bd6ffca7dfe651e6a
2016-01-28tdf#97371 DOCX import: fix text covered by shapeMiklos Vajna
Regression from commit 358666e4204364ce915ee95372dc6f2fca545253 (tdf#90153 DOCX import: fix default sw TextFrame roundtrip, 2015-09-28), the problem was that at the moment SwTextBoxHelper::syncProperty() doesn't handle an AnchorType at-para -> at-char transition, so the importer shouldn't do that for TextBoxes till sw core gets extended to support the scenario. Change-Id: I8308bfd306672bc68984fbf019767c174130e18d Reviewed-on: https://gerrit.libreoffice.org/21885 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-01-28writerfilter: uno::Sequence -> std::vector for table row rangesMiklos Vajna
Change-Id: I16ade5392354ddf030e6ca8969560c56adb0a8f9
2016-01-27writerfilter: uno::Sequence -> std::vector for table cell rangesMiklos Vajna
Change-Id: I858aa0f97d70f245cf5a3d24909de512b33b1249
2016-01-26tdf#95376 DOCX import: fix incorrectly indented tab stopsMiklos Vajna
Regression from commit f4badd9a485f32f787d78431ed673e2932973887 (tdf#92454 DOCX import: allow overriding para prop from num style in para style, 2015-09-22), the problem was yet another priority mishandling in the maze of various styles and indentation handling. In the tdf#92454 bugdoc, both a numbering-from-paragraph-style and a paragraph-style defined indentation, and Word preferred the numbering, while Writer preferred the paragraph style, that's why the import-time conversion was added. However, it turns out there is a 3rd source that's still not direct indentation formatting: a direct numbering. So the correct priority is: direct-ind > ind-from-num > ind-from-parastyle > ind-from-num-from-parastyle Which means in this case the indentation should not be set directly: the two conflicting value (ind-from-num and ind-from-parastyle) will be resolved correctly by Writer core. Given that we always first get the para style info, and only then the numbering, we just need to undo the conversion added for the other bug if we see a direct numbering, then both the old bugdoc and this new one will be handled properly. Change-Id: I09cc84605d5df6159da985ad069d46b580a53358
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-21writerfilter: can use a plain instance for the cell sequence hereMiklos Vajna
Change-Id: I47fee680b6022cc2402341bf523243c526bc8890
2016-01-20writerfilter: can use a plain instance for the row sequence hereMiklos Vajna
Change-Id: Ic9211192310f6a5b36f4ee4637828d96d8f1f7b7
2016-01-20writerfilter: fix VS2015 buildThorsten Behrens
Change-Id: I9cde0ecf2c883b977df4f633e5106d39628444ca
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-18vcl: change Font::SetName() to Font::SetFamilyName()Chris Sherlock
Change-Id: I9b7bd1ec25955981ebcb9085579cbb9fbaa802d5 Reviewed-on: https://gerrit.libreoffice.org/21560 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-16revert vcl patch series that brok Mac and WindowsNorbert Thiebaud
revert: 9bc2f3de8672e812f3a67541c6d7069b434a7e42 vcl: add comment about ImplFontMetric::{Get|Set}LineHeight() 26371f105bc44e04469ec03fc5bb12505e651c6b vcl: FontAttributes::GetSlantType() -> FontAttributes::GetItalic() 2dd0b4317372b8022efe3911b38b4fa02956d8b9 vcl: font.hxx and metric.hxx cleanup, make ctors explicit and the dtor virtual 5ab13bf3ead3539e4ad847656da81e7eb6029652 vcl: tabify font.hxx f99550dae55e40e49bf9c9875053fe2abb4c71ca vcl: change Font::SetName() to Font::SetFamilyName() 2b297116cb6bb1061c43e5714e2609c8ee9f57d2 vcl: rename Font::GetName to Font::GetFamilyName Change-Id: I23f38921187d66b970ca815eb30dda4222a2da62
2016-01-16vcl: change Font::SetName() to Font::SetFamilyName()Chris Sherlock
Change-Id: I54a4036544c680c4a49607677af776aa7a433fbc Reviewed-on: https://gerrit.libreoffice.org/21510 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@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