summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)Author
2014-08-04more ambiguity fixesMiklos Vajna
Change-Id: I8c3af0976414ae444ec08b7e60485d8886f68a76
2014-08-04fix ambiguityStephan Bergmann
Change-Id: I773aa61c4430aa999c3ea94d352102a4a3f7e9f0
2014-08-04DOCX import: handle all attributes of CT_TblLookMiklos Vajna
Change-Id: I3bbd65af4f52ce28e2962a1b3e0c7f1c348f3a01
2014-08-04fdo#81993: Revert "Resolves: #i119464# Update default alignment ...Michael Stahl
... value for docx [Sub]Title" This reverts commit acc671ec74c874ffd22803bb2ee54a1f2c027155. The commit is clearly unnecessary: 1) commit 3f9e7e72c53ecbe8ee1ab060f811cb41eadfc7e1 appears to be a better fix for alignment 2) commit b95d203bc17c83ec0fe5139f519d53ed1d842d3a should have disabled the Center default in Writer already Change-Id: Ib0cc60af037f12be0a1ab94ab32c743f7fca2b1d
2014-08-04writerfilter: tokenize all attributes of CT_TblLookMiklos Vajna
Change-Id: I0dcaef56804a6998f83afe73d01eb0d5b21a210a
2014-08-04fdo#80986: disable highlight DOCX importZolnai Tamás
Highlight support is not implemented fully, so it seems better to disable DOCX import of it until it is finished. Highlight can't be modified on the UI and is not saved to ODT/DOC (regression). Regression from: 8b949134441056a1455d67ddfdd7e0bc5f2ee682 Change-Id: I94891769766ae90017e8afa70e65d080d5270202
2014-08-03writerfilter: Switch according to first letter in getListValue().Jan Holesovsky
This hopefully makes it more bearable for MSVC, and also breaks down the large data nicely. Change-Id: Ic3028eb78a5dcca4393738d428b6cf03a3ddbaeb
2014-08-03writerfilter: Kill ListValueMap(s) & their construction.Jan Holesovsky
ListValueMaps were completely useless; it is always just few values that used to be in the unordered_map, so doing just a normal comparison couldn't be too much worse than all the hash construction etc. This saves >300k of the libwriterfilter.so size (striped). If this proves to be less performing than what we used to have (which I doubt), now when we generate the code using Python, it would be a piece of cake to construct some deterministic finite automaton in each switch's case to accept the value names, and return the values. Change-Id: I95d0470b73ade1fbf5c9de2299c4adcc59286bc3
2014-08-03redundant <list> around <choice>Miklos Vajna
<list> would mean that multiple values from <choice> would be allowed as value (separated with whitespace), but this isn't actually true here. Not to mention that our parser completely ignores <list>. Change-Id: I43275c588d885429f5ea53c2f950a0011c2bb1bc
2014-08-03Revert "writerfilter: Kill ListValueMap(s) & their construction."David Tardon
Apparently there can be much more than "just a few values" in some cases (186 in OOXMLFactory_dml_shapeGeometry::getListValue) and MSVC compiler cannot handle if statement that deeply nested. This reverts commit 7aa7047eb48e81bc0b32448ff0487c993fe9a4db. Change-Id: I2b4d166e73ce1e616fea81fcfcfc9915c5784d30
2014-08-03writerfilter: Kill ListValueMap(s) & their construction.Jan Holesovsky
ListValueMaps were completely useless; it is always just few values that used to be in the unordered_map, so doing just a normal comparison couldn't be too much worse than all the hash construction etc. This saves >300k of the libwriterfilter.so size (striped). If this proves to be less performing than what we used to have (which I doubt), now when we generate the code using Python, it would be a piece of cake to construct some deterministic finite automaton in each switch's case to accept the value names, and return the values. Change-Id: I95d0470b73ade1fbf5c9de2299c4adcc59286bc3
2014-08-02indentation fixesMiklos Vajna
Change-Id: Iacdaf8bcae8df6ba380a9fb6d78db22f51a4d6f9
2014-08-02writerfilter: PEP 8 fixesMiklos Vajna
Change-Id: I82c14013c906d4e6d16f69dbebe419d0c56673c2
2014-08-02fdo#80742 RTF filter: import RTF_OUTLINELEVELMiklos Vajna
Change-Id: I49d94bd72af610e88128cd405e4786d2e9ba65ed
2014-08-02fdo#81944: writerfilter: RTF import: don't drop fonts in stylesheetMichael Stahl
The font definitions in the style sheet meet an untimely death in StyleSheetTable::lcl_sprm(), which special-cases LN_EG_RPrBase_rFonts, routing it into TblStylePrHandler. Avoid this by sending style entries to the domain mapper in the same way as the OOXML tokenizer, i.e., with paragraph and run properties nested below CT_Style_pPr/rPr. This reveals that the CT_Style_basedOn was wrongly handled as paragraph property. Change-Id: Ic724ba48fe36bf782b1b430bdafdb1df480d5ad3
2014-08-02writerfilter: RTF import: ignore content of \upr, except for \udMichael Stahl
The content of \upr and its nested \ud destination should be the same modulo text encoding, so ignore the legacy one. Change-Id: I007151e3075a9ac879a486ec3b5fb8549435dbba
2014-08-02writerfilter: remove never parsed xs:documentation elementsMiklos Vajna
Such automatic documentation is often useless (e.g. "<xs:documentation>Value</xs:documentation>"), and a more up to date version of them is in the specification anyway. Change-Id: I916abb5dee5e287efe1fe53797376522f79bf970
2014-08-01RTF import: fix as-char anchored OLE objectsMiklos Vajna
Regression from 2a35f5c7945d00b6f6e21fc7cf5b05b184eba88f (DOCX OLE import: inherit anchor type from replacement graphic, 2014-02-18), then problem was that dmapper expected that the anchor type of the replacement graphic is set, but the RTF tokenizer wasn't adapted to fulfill this requirement. Change-Id: I0f7e1a71052f337793d6f844fe5476c3868c03f4
2014-08-01writerfilter: fix dbglevel=2 buildMiklos Vajna
Regression from commit 4c3ba3a413be7339115ea5e6edc825a8434cd345 (fdo#75757: Remove inheritance from std::map., 2014-07-26). Change-Id: I2a532182697ae7a5fe4ec2f880a0f5237a21b723
2014-08-01fdo#81893: writerfilter: RTF import: \qc before \page was lostMichael Stahl
The paragraph properties need to be applied to the paragraph following the \page too, which did not happen in this case. Also the minimized test doc shows that checkNeedPap() must be preceded by checkFirstRun(), since there is no run preceding the \page. (regression from 94765a1b3f543b3b60f8c1de05048d12f2576be4) Change-Id: Id286c4fbdeee688fa4f6b24063b634bac637eab6
2014-08-01fdo#81892: writerfilter: RTF import: add support for table row alignmentMichael Stahl
These keywords were simply not implemented. Change-Id: Ib4d07a4b2dfb07cfd56a4ee07d7c14d1c59323f9
2014-08-01clean up unused OOXMLFastContextHandler::fldData parameterMiklos Vajna
Change-Id: I6af797257c6e6e7bd95597ab786660fd9ade06a0
2014-08-01FILESAVE [DOCX] Hyperlink text is getting lost after RT fdo#81492Vinaya Mandke
The fldData was getting added as instrText. It was handled as CT_Text and hence appended to the fieldCommand in DomainMapper_Impl::AppendFieldCommand. So in RT file the <w:instrText> has both the instrText and the fldData, from the original file. This causes the hyperlink visual loss in RT file. WordprocessingML Page# 5011 [ ISO/IEC 29500-1:2012 ] WordprocessingML Page# 5552 [ ECMA-376 Part 1 ] fldData has been removed. So ignore it while importing Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/10441 Change-Id: Ic2c06f1eb66639d36f3a27ae79181cdbde21b43c
2014-08-01writerfilter: fail on non-existing includesMiklos Vajna
Also remove all such includes that did nothing so far. Hopefully if the script fails on it early, that helps detecting typos during development. Change-Id: I56bcf16263b7556bc237aceeb2041dfcfb3e02fa
2014-07-31writerfilter: fix some -Werror=unused in previous patchMichael Stahl
Change-Id: Iba7db7f9375807e97a4cdddc0c873fa3c9f6cfb6
2014-07-31fdo#75757: Remove inheritance from std::map.Matthew Pottage
Done for writerfilter::dmapper::PropertyMap. Added public functions getPropertyValue, bool isSet and Erase. The function getPropertyValue returns boost::optional<PropertyMap::Property>, where PropertyMap::Property is an alias for std::pair<PropertyIds,css::uno::Any>. Fixed all resulting compilation errors. The functions which iterated the map (ListLevel::GetCharStyleProperties, ListLevel::GetLevelProperties and SectionPropertyMap::_ApplyProperties) have been written to either used GetPropertyValues or not iterate over the PropertyMap's attributes. The properties of the public member functions are now properly used (Erase and Insert(...,false)). Change-Id: Ibd90a4ad831c9b7d18b2a50d4aa4eb3f2610cff8 Reviewed-on: https://gerrit.libreoffice.org/10558 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-07-31SdtHelper::createDateControl: clear the property list after reading itMiklos Vajna
Otherwise it may happen that the property list will be read twice, and on export we'll create two <w:sdt> for a single imported one. Change-Id: I57ab595f956c5e808fc73fe644ee3e249a1fc1ed
2014-07-31DOCX import: merging properties of different SDT's are not wantedMiklos Vajna
When the document starts with a table and both the A1 cell as well as the document start has an SDT start, then we see both at the same time when we check for pending SDT's in lcl_utext(). This leads to merging the properties of the two SDT's, which is clearly not wanted. Fix the problem by clearning the SDT property list when we see a start of a new property list: that produces a valid document. Change-Id: I8fbe7bec02beebb26ed99fa7b08bc62225bff50c
2014-07-31writerfilter: fix ubsan complaints about "-42" enum valueMichael Stahl
Apparently the StyleType enum is specific to the domain-mapper, the OOXML filter has integer constants in its model.xml file... Also surprisingly the section styles only exist in RTF; w_ST_StyleType in "ECMA-376 3rd Edition" only contains the 4 values of StyleType enum. Change-Id: I5407800f801824676df309b3705e233cf1382721
2014-07-30writerfilter: remove unused <namespace-alias id=""> attributesMiklos Vajna
They are confusing and not used in practice: modelpreprocess.py always sets the id to a numeric value anyway. Change-Id: I5bdfd001bc0fe7ee376e2fe27fefecc3613bd1ab
2014-07-30DOCX import: handle exact end of paragraph w:sdt tagsMiklos Vajna
Testcase will be added when the export half of this is also in place. Change-Id: Ic6ef8ea72a45424fcb5a473c74db9e30d6fd3be8
2014-07-30Fix *_component_getFactory function typeStephan Bergmann
Change-Id: If66efdb6a00c383ba72898f601ff3d674e153704
2014-07-30Remove redundant casts to voidStephan Bergmann
...leftovers from de02d221e104f74bfa595d5e6c41248093c640f3 "printfs in comments" Change-Id: I0125ac2b5ea0b4450e8f707f980959443a6c4d27
2014-07-29fdo#81384: writerfilter: turn the horrible btLr cell text dir hackMichael Stahl
... by 5 degrees to starboard, which lets the row in the bugdoc appear, altough the height is a bit insufficient still. Why that works, is a nautic mystery to me, i'd say this whole btLr emulation nonsense needs to be keel-hauled, but after this patch i'll need some rum, arrrr... (regression from commit 0208ead70a9412ccd554fcef3e9308f8ca17037b and commit 970160f78ef6cc7abacfa252daa8451e1f0117bb) Change-Id: Ie0c6ec88b6d6635379b9127f6460647f14776aad
2014-07-29writerfilter: whoever started non-reference variable names with "r"Michael Stahl
... was evidently not a Hungarian speaker. Change-Id: I87b0690d839057272c9653b222ed4dc61a75963a
2014-07-29writerfilter: nobody reads enumnameMiklos Vajna
Change-Id: I4a5eb77ff14bb033061ce8214ef7f65d587b159a
2014-07-29writerfilter: unused OOXMLFactory_*::getName()Miklos Vajna
Change-Id: I9cf482b10b719d40ab553616099d04c7b1572986
2014-07-29DOCX filter: map <w:sdt> outside paragraphs to paragraph propertiesMiklos Vajna
Previously the type of the SDT was used to decide if the SDT will be a character or paragraph property. Improve this situation by always mapping <w:sdt> elements outside paragraph to paragraph properties. In practice, this means that if the SDT was a rectangle (as it wasn't only around a run), then it remains so, while previously it could become a polygon instead (when painted). Fix several testcases that tested that a <w:sdt> outside a paragraph is exported as a character property. Change-Id: Ia26c1a4cf6bc553b46224e4b17ee40725c5f3622
2014-07-29fdo#80580: LO crashes while opening the document on ubuntu buildYogesh Bharate
Problem Description: This issue is reproducible. Step to reproduce : 1. Create .docx contains page break on first page. 2. Second page contains '&'(ampersand) with some character like 'x','z','#' etc. 3. Changes the size or font of '&character' which is on second page. 4. Precaution will be take all this i.e page break and '&character' contains in single paragraph'. Solution: Added a check for Context Type which must be CONTEXT_CHARACTER for deferring character. Change-Id: I27989d2ca8d62fbd9efafe5ba7f4a65d56467c1e Reviewed-on: https://gerrit.libreoffice.org/10532 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Luboš Luňák <l.lunak@collabora.com>
2014-07-29fdo#81486:custom property with the same name as Document Property not importedCharu Tyagi
Change-Id: Ieb9cba7b8969787140d6db3b77765e3a15bf89e1 Reviewed-on: https://gerrit.libreoffice.org/10381 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-07-29DOCX import: handle ooxml::CT_Spacing_lineRule after lineMiklos Vajna
Regression from commit a5f9fb720daeb2df8325768b98b8b720abcc2b9b (fdo#80800 : DOCX: Preservation of Direct Formatting for non first Table Cells, 2014-07-11), CT_Spacing's two attributes (line and lineRule) may come in different order; but the change only handled the case when lineRule is followed by line, and not the other way around. This fixes a unit test failure in CppunitTest_sw_ooxmlexport's testSpacingLineRule. Change-Id: I892d97a97390228a59a129f096be39ce93b822d6
2014-07-28writerfilter: nobody reads the classfordefine attributeMiklos Vajna
Change-Id: I030137cb379de04968fb144516e90dbd1bdd97f6
2014-07-28(related: fdo#81033) writerfilter: default tab fill character is spaceMichael Stahl
This avoids an ugly "Character" box in the dialog with a null byte in it. Change-Id: Iee35a8e1bd6b57fb4eb8ae06722bd79ee1d5d8de
2014-07-28fdo#81033: writerfilter: RTF import: fix tab stop inheritance from styleMichael Stahl
For RTF, the tab stops that are set directly on the paragraph are the tab stops the paragraph has effectively; there is no equivalent of OOXML <w:tab w:val="clear" w:pos="4536"/> that would override a tab stop of the applied style; that is done by simply omitting the tab stop. It would perhaps be possible to implement something to synthesize a NS_ooxml::LN_Value_ST_TabJc_clear in the RTF tokenizer for this case, but it's simpler to just generally disable domain mapper's InitTabStopFromStyle() for RTF. Change-Id: I7b0581be8db19ffda81c8d1da290abf0a0f69529
2014-07-28writerfilter: unneeded whitespace tweakMiklos Vajna
Change-Id: Ib25ae32be6132a9209eaa81db18b0659b73d5b82
2014-07-28writerfilter: add script to detect generated code changesMiklos Vajna
Change-Id: I340ef55dc9a09bd196469ed51848b22ba986de8c
2014-07-28Copy first-header-footer test from ww8 to ooxmlLuke Deller
The test document was converted from doc to docx using MS Word 2010. Several fixes were required to make this test pass: - Do not clear the "FirstIsShared" property on page styles, as the code instead uses the old fashioned method of translating a Word section with "different first page header/footer": two page styles linked together, the first page style and the follow page style. (Also remove a wrong test case which checks the FirstIsShared property) - Do not clear the "HeaderIsShared"/"FooterIsShared" properties on the first page style, only on the follow page style. - Actually set the "FollowStyle" property on the first page style to link it to the follow page style. This didn't matter for the very first Word section because it was mapped to the default page styles "First Page" and "Standard" which are already linked, but it does matter for subsequent Word sections. - For some reason setting a new page style at a section break was excluded in the case where the following section had a title page. Remove this exclusion. - The exclusion mentioned in the last point was masking that bnc#751077 was not entirely fixed. To resolve that issue: When checking if the last paragraph of the section is empty, consider not just text content but also shapes. - Remove a workaround for bnc#780843 involving copying of headers and footers from the "Standard" (first section) page style in the case where the following section had a title page. This workaround is no longer needed as the test case passes without it. Change-Id: Iacc9bba0720c11414da3e852892cff301ebbc4fe
2014-07-27writerfilter: convert factoryimpl_ns to PythonMiklos Vajna
Change-Id: Ia2380a23e31583f40a368168bc09d7fddd3e4ab7
2014-07-27indentation fixesMiklos Vajna
Change-Id: I0a0f04d0f0e008e8947a5a7e3ed6083c1589e61b
2014-07-26coverity#1228873 Division or modulo by float zeroCaolán McNamara
Change-Id: Iffd200c6a7028206d91c036cc3a726ad19bd5bc8