summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)Author
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-30Remove unused includesMiklos Vajna
Change-Id: I38784900d5b4fcf99d5fc881f0ec7a9833fe2d5b Reviewed-on: https://gerrit.libreoffice.org/21917 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
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-21oox, writerfilter: incorrect a14 namespaceMichael Stahl
Change-Id: I813ca0510b6cfc26c307c510f3511c01c0f65c85
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-18cppcheck: useInitializationListCaolán McNamara
Change-Id: If87c349a5036c54a83839cd66eb60ef6a09a4a46
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-15writerfilter: coverity#1348470 missing breakMichael Stahl
Change-Id: I1cc56792e3684bd85ecbd5e0cf9c730a5f75beb5
2016-01-15Fix tdf#97035 - FILEOPEN: RTF wrong cell widthGuillaume Smaha
Change-Id: Ifd31ab1672261644a00a32f3a8632dd0dcb33825 Reviewed-on: https://gerrit.libreoffice.org/21382 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
2016-01-13loplugin:unusedmethods unused return value in writerfilter/Noel Grandin
Change-Id: I0eef0cb336a2d9450ede01c8fe1c02fbd3b2b57f
2016-01-12RTF import, fix landscape flag & implement lndscpsxnGuillaume Smaha
Change-Id: Id2e8e9c1a9686fd674d712498acb7374a81077d7 Reviewed-on: https://gerrit.libreoffice.org/20163 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com> Tested-by: Mark Hung <marklh9@gmail.com> Reviewed-by: Michael Stahl <mstahl@redhat.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-08tdf#96308 RTF import: fix tab stop inheritance inside table cellsMiklos Vajna
The tab stop list is a paragraph property, and RTF requires to repeat it after \s as direct formatting, otherwise the parser should be assumed that the tab stop list is cleared as a direct formatting. Non-buffered text handles that in getDefaultSPRM(), handle it directly in the RTF_PARD code for buffered text. Change-Id: I16b09bc4c177df5a74d16653b829b198aa1a800f
2016-01-08Related: tdf#96308 RTF import: fix RTF_DEFTAB handlingMiklos Vajna
Change-Id: Ia2655bf5748ea62155613a222d0cb17b678196c5
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>
2016-01-06tdf#92045 DOCX import: <w:effect w:val="none"/> doesn't mean blinkingMiklos Vajna
Regression from commit eeb8297e47bae11f2aeaa7bae6e51eee921e9e58 (Use constants for ST_TextEffect values, 2014-09-22), the problem was that while the tokenizer stopped using hardcoded token values, the matching dmapper code wasn't adapted. Change-Id: Id61912e9c9458efc87e0a6f8e461663942c555f0
2016-01-06Missing includeStephan Bergmann
Change-Id: I958c2baf2ee1e0505e961d1a9c420df2881dab3f
2016-01-06writefilter: removed superfluous #includesAndrea Gelmini
Change-Id: If9a563767cd1165c4a7363b513447cd975cb20c9 Reviewed-on: https://gerrit.libreoffice.org/15850 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-05loplugin:sallogareasStephan Bergmann
Change-Id: Ia6dc83137fb970046750996b9afd7a54aa4f4c5b
2016-01-05tdf#69640: Treat errors opening OLE stream gracefullyMike Kaganski
The testcase for tdf#69640 includes links (relations) to external pptx files. It demonstrates two non-fatal reasons for failure opening OLE stream: 1. it fails OStorageHelper::IsValidZipEntryFileName check, because the file path contains ":\"; 2. even if that were not the case, the required file can be absent from user's system. I suppose that intercepting the failure at the level of OOXMLOLEHandler::attribute() is the best option, because at the lower level it's unknown if this failure is fatal or not. I suppose that it could be also useful to intercept specifically failures in OStorageHelper::IsValidZipEntryFileName, checking if the file exist externally, and asking users if they want to update external links (as MSO does). Possibly it should be discussed with UX team if that should be done, and if so, do it in separate commit. Change-Id: I240a6f69abe236eb790bb406c79f3b761fb4638a Reviewed-on: https://gerrit.libreoffice.org/19963 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2016-01-04DOC(X) filter: BAF -> BAILS in the smart tag mappingMiklos Vajna
The filters map between a common subset of Word smart tags and Writer RDF annotations, and when doing so, they need to know what path to use for a smart tag namespace and also the other way around: what RDF types are interesting for smart tag purposes. It turns out there is BAILS specification at <http://www.tscp.org/wp-content/uploads/2013/08/TSCP_BAILSv1.pdf> that describes how to refer to BAF objects, so use that instead of our custom RDF statement / document metadata key names. Change-Id: Iac569608b05aa61547f664f2a5df7d46fe46da76
2015-12-22writerfilter: can use a plain instance for the table sequence hereMiklos Vajna
Change-Id: I34dc9cad5e7fb95eee2b0587e0a6b731571d6933
2015-12-21loplugin:unusedfields writerfilter,writerperfectNoel Grandin
Change-Id: I8863fcdb0751d2f1becea5b2487d4070e4fd4195
2015-12-20move saveInteropProperties from writerfilter to ooxMichael Stahl
Change-Id: I4f9769ad496198d2d002775dee4ee0a2f08d6f3b
2015-12-15writerfilter: set a BaseURL on embedded math objectsMichael Stahl
Change-Id: I9a500e079c892e281bdfee9627641f118261e0f8
2015-12-09tdf#95755: Don't discard table properties in endOfRowAction()Mike Kaganski
In the beginning of endOfRowAction(), the current value of m_aTmpTableProperties.back( ) is stored in a temporary variable. Then, the width of table may be put into m_aTmpTableProperties.back( ). In the end, this temp variable is assigned to TableManager::mState.mTableProps and the m_aTmpTableProperties.back( ) is reset. In the middle, the m_aTmpTableProperties.back( ) may be replaced in endLevel()/startLevel() sequence (if new table is started). In that case, the width calculations go to a different object than stored in temp var. Consequently, that value will be discarded and replaced with initial stored in temp var. Fixed that by directly operating with temp var instead of m_aTmpTableProperties.back( ). Also, the value of m_nCell was not kept over endLevel()/startLevel() sequence and that prevented from calculating width. Fixed that. Also, removed leftovers from commit cbd0fbc287051f918e4adb32b3e9b58dfbf8059d. Change-Id: If85dbb715e7c60f60043f9d60d6a3c3d02277add Reviewed-on: https://gerrit.libreoffice.org/20052 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-12-08writerfilter: loplugin:stringconstantMiklos Vajna
Change-Id: Idb0865f4d0db6c4eda33810ab2ef4cff49bc85d1
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-07loplugin:overrideNoel Grandin
Change-Id: I0b7fa4d669a6bbf26c8cbf08ef009686919c9a60
2015-12-07loplugin:mergeclasses OOXMLPropertyImpl into OOXMLPropertyNoel Grandin
Change-Id: I1447cfc76c529332450c90a21b6525d3103fe852
2015-12-07loplugin:mergeclasses, merge OOXMLPropertyImpl into OOXMLPropertyNoel Grandin
Change-Id: I73eb7e664c0a53f135c06c3d8ea450bd9493c780
2015-12-04Wingdi RGB macro handling improvedAshod Nakashian
Improved the isolation of windows headers. Specifically, RGB macro is better handled now. Change-Id: I0eeea16d0de9da3455810c80b0715f7b54ae8c3f Reviewed-on: https://gerrit.libreoffice.org/20039 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-12-03Use comphelper::containerToSequence()Miklos Vajna
Change-Id: I774864241bc15fcfd08cd2becbf34aae0349a9d8
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-12-02tdf#94043 RTF filter: implement column separator handlingMiklos Vajna
Change-Id: I9d74642156d7bb79577671bae24346c75178c5c7