Issue :
-File was getting corrupt due to wrong SDT Properties were getting export
and only one SDT tag was getting written.
-Issue file contained a Date SDT and a FieldChar SDT(Page numbers)
-Issue was at Import side.
LO GRAB BAGS Properties of SDT using PARA_GRAB_BAG or CHAR_GRAB_BAG
-For Date SDT it should be grab bagged using CHAR_GRAB_BAG in order to get
correct data inside <w:sdtPr>
But LO was handling it with PARA_GRAB_BAG due to which wrong properties were
getting written and
file was getting corrupt.
Implementation :
-Added a check for Date SDT to handle it through CHAR_GRAB_BAG
-Now correct SDT properties are getting exported due to which Date is getting
written inside an SDT tag.
-Added UT at export side.
Change-Id: Ibcfb6dbbec1c23ffd14ba924ab56dc4122b98595
Reviewed-on: https://gerrit.libreoffice.org/11160
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
The binary filter uses this setting to decide if the embedded object is
converted into a native Writer document (so it can be edited) or not (so
it's preserved better), let's do the same.
Change-Id: I47b48867b3d0abf6cd8de2430513587a6776461e
The problem was that SwXTextEmbeddedObject::getEmbeddedObject() returned
an empty reference for those embedded objects, so the HTML filter
couldn't extract their content when it wanted to do so.
It turns out the reason for this was that the DOCX importer only handled
the replacement image + raw native data for the object. Fix this by
creating the embedded object with the correct CLSID and import the
raw data into the empty embedded document model.
This is similar to what is done for XLSX-in-PPTX in
oox::drawingml::ShapeExport::WriteOLE2Shape(), just for the import part.
Change-Id: Ieb1dcb1774d2d4da00117e3a35160053066c78aa
The problem was the following: setPropertyValue("IsAutoUpdate") on the
style failed -> a number of styles was not imported in
StyleSheetTable::ApplyStyleSheets() due to the exception, then when we
tried to use one of the not imported styles, we also got an exception in
DomainMapper_Impl::finishParagraph(), which resulted in not calling
DomainMapperTableManager::handle(), so multiple cells of the same table
wanted the same range for cell contents, and that resulted in a crash.
Regression from cf33af732ed0d3d553bb74636e3b14c55d44c153 (handle
w:gridBefore by faking cells (fdo#38414), 2014-04-23), but that commit
just made the previously hidden problem visible.
Change-Id: I788cb6b4a2c7b7efbfa48297c658bb26450bf583
Issue :
- In issue file there were two runs(first run=SDT, second run=Shape).
- These two runs were consecutive(no text/space/tab was there in between two runs).
- Due to such scenario, "SdtEndBefore" was not getting set on Shape.
- Hence at Export EndSdtBlock() was getting called from EndParagraph().
Due to this SDT was not getting end after first run.
In order to end SDT after run, EndSdtBlock() should get called from EndRun()
(as in Original file)
Implementation :
- Set "SdtEndBefore" on Shape in DomainMapper_Impl::PushShapeContext()
- Retrieved same property at export.
- Added export unit test case.
Note :
Added common functions at Import and Export with reference to
https://gerrit.libreoffice.org/#/c/10827/
Conflicts:
sw/source/filter/ww8/docxattributeoutput.cxx
Reviewed on:
https://gerrit.libreoffice.org/10912
Change-Id: I357d77cd179c83b8ae976db331ee46c8993b6cb8
We map Word's even/odd page breaks to Writer's left/right page styles. And we cannot
just set any page style to be left/right, because that could set e.g. the default
page style as such, which would make all normal pages that way. So instead we need
to make a copy of the relevant page style, as the original page style as its follow,
copy all the properties and headers/footers, and use this copy to get the page break.
Change-Id: Id0d2568de91ac2de4afb0ba3a6eedd9cec46f878
The reason for adding 'DomainMapper' is to be able to check
during import in these classes whether or not the import is
in a 'styles.xml' file or not.
Also added blank handling for new XML nodes.
Reviewed on:
https://gerrit.libreoffice.org/10870
Change-Id: Ib2acde736d96f30eda40ee327991dc6ae0ed7f25
Issue :
- In issue file there were two runs(first run=SDT, second run=Image).
- These two runs were consecutive(no text/space/tab was there in between two runs).
- Due to such scenario, "SdtEndBefore" was not getting set.
- Hence at Export EndSdtBlock() was getting called form EndParagraph()
Instead EndSdtBlock() should ge called from EndRun() in order to end
sdt after first run(as in Original file)
Implementation :
- Set "SdtEndBefore" on Graphic in DomainMapper_Impl::ImportGraphic()
- Retrieved same property at export.
- Added export unit test case.
Change-Id: Id514b91f1831af371924f94388f0a404d762c042
Reviewed-on: https://gerrit.libreoffice.org/10827
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
The motivation is that once all the namespace aliases in
writerfilter/source/ooxml/model.xml match the ones in
oox/source/token/namespaces.txt, then the writerfilter copies could be
dropped.
Change-Id: I1f9abb8bb457189997f28c99b0f6b00660252c14
Date SDT's are normally imported as form controls, while most other SDT
types are just custom properties on regular text portions or paragraphs.
However, given that form controls are not supported in headers/footers,
in that case even date SDT's are just custom properties. So support such
properties on paragraphs in the exporter to properly roundtrip date
SDT's in headers/footers.
Change-Id: I19eb73a3673e387a7b8780756ce7426a1851e796
Turns out form controls are not allowed in headers/footers (see the
comment in the patch), so if that happens, then just fall back to what
we already do for other SDT types.
Change-Id: Icc79c2a825e9eb2a85980489812a4178fde37576
This code actually worked by mistake, thanks to the wrong ordering of
attributes that was caused by the usage of the boost::unordered_map.
Change-Id: I72cc5b54496b03183987d4d004f985d368e63deb
workdir/CustomTarget/writerfilter/source/ooxml/OOXMLFastTokens.hxx was a
duplication of workdir/CustomTarget/oox/generated/oox/token/tokens.hxx,
except when the oox generator changed, the writerfilter copy was not
adjusted and Bad Things happened. We don't need this.
Change-Id: Id92481f110b04ec24cb424421aa0ec029b7896f3
... 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
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
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
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>
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
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
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
... 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
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