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>
RTF originally didn't support anchored pictures: they were always
inline. Then it was invented that pictures can be exported anchored, if
they are in fact shapes, but their "pib" property is set to the hexdump
of the picture contents.
The RTF importer handled this situation for quite some time, but not the
exporter -- this commit implements that.
Change-Id: I173ad9f4f2e24620508ca63c0b892b7d5da4e5b2
This reverts commit d2a4e7c7f70a0ff0769ed228320833fa6b29bff9.
We now export SwGlobals::ensure for another test, so no need to use
sw objects in this one...
Somehow this test failed on Windows, because of restoring a "NONE" field
unit to SW_MOD()... apparently the "charborder.odt" test is run first,
and preTest() sees a null SW_MOD() then postTest restores a NONE metric.
Hack around that by calling SwGlobals::ensure() to create SW_MOD().
Change-Id: I6c0cda3aae397071bca16bf0e5d9f8105635550f
When an sw document is embedded inside an sw one, then the inner sw HTML export
should just write what's inside the <body>. Add a filter option for that in sw,
similar to the one already existing in sc.
Change-Id: Id2cef966c1022ba45a3540bff234029c1d396778
When the sc document is embedded inside an sw one, then the sc HTML
export should just write what's inside the <body>. Add a filter option
for that in sc and use it from sw.
Change-Id: I3a9605bd62f0628b78cd782c11661f12bc2c3ae4
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
E.g. Word doesn't do anything if you hit return in the middle of a
title; if that's so, then we should handle this situation on export as
well.
Change-Id: Ib5b52a59250b09c97023b53906b8046f530d0e31
The exporter already handled TextFrames inside TextFrames, a feature
supported by Writer, and not by Word.
Similarly, if DocxSdrExport::writeDMLAndVMLDrawing() starts a shape,
then anchored TextFrames should be posponed till the end of that shape.
Change-Id: I597a8a46b1cf2348a8ccb9af668ea5afab27541b
In order to allow running them in parallel. There are already enough
tests to make it run for a couple of minutes and it's annoying to
see only once core busy with it.
I intentionally left the original file at the same name, without 1
appended, in order to avoid merge problems.
Change-Id: I097c45c34797cc68f5d1790cf31eefc96fbaf44e
A usual problem with SDT is that in case it should end after the last
paragrah of a container, there is no "next" paragraph that could have
the relevant "EndSdtBefore" property. This is usually handled by closing
the SDT tag before the container is closed.
The problem here was that DocxAttributeOutput::WriteSdtBlock() did not
notify DocxSdrExport about opening the SDT, as it thought there is no
draw export in progress. This is because in case of "shape with a
TextBox", the common writeDMLAndVMLDrawing() method is not called,
instead the separate writeDMLTextFrame() and writeVMLTextFrame() methods
are invoked.
Fix the problem by adjusting these methods to writeDMLAndVMLDrawing(),
so that they also set m_bDMLAndVMLDrawingOpen to true during the TextBox
export.
Change-Id: Ie08b0b955cd2d6a645970da3d485e447abfd6495
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
The old rule was: write qFormat for everything that's not a custom
style.
The new rule: write qFormat for everything that's a custom style + have
a whitelist of non-custom, but qFormat styles.
This matches better what Word does (whitelist is from the latent style
section of an empty document, created by Word).
Change-Id: Ie7a0802e886c41b8d26ca9aa154913aa2f3ff87a
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
MSWord, unlike Writer, can anchor even to a page break (i.e. after the last
paragraph). When this document was read, what happended was:
- the last paragraph was read and the current position PaM was set to point
after it
- frame was read and anchored to the PaM
- page break was read, making everything following be moved to the next page;
including whatever ended up at the PaM position
Handle this by checking for this case and inserting an extra empty paragraph
before the break. This shouldn't affect layout of the page itself anyway,
since the break should leave room for it (and MSWord shows a page break
there if control characters are enabled, so there is room).
Change-Id: Ia2a13bf5cf1c959b5aa228254365019a00a22679
The SwFmtCntnt, i.e. the content of the draw format was already copied,
but that's only a pointer to the real content: instead duplicate the
real contents on copy&paste, that's how we copy fly frames as well.
Change-Id: I42475e356aaa1c54c08fb23a6a395d1726e5f33e
Commit 6cac123a8de8357cf11d9b5f818233889d729939 (fdo#45183 import
RTF_SHPFBLWTXT, 2012-12-27) fixed this already once in the past -- fix
it again, this time with a testcase.
Change-Id: I0cbbfb1ba4eef42b2ee32f6f77065afaad3ddc1b
...signed/unsigned mismatch
In history this was sal_Long and then converted to sal_uLong, but the
test never got aligned.
Fix it by adding arbitrary element counts starting from 30.
old: getCount():
{-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9}
(With -5 silently converted to SAL_MAX_UINT32 - 5)
new: getCount():
{30,31,32,33,34,0,1,2,3,4,5,6,7,8,9}
Change-Id: Ic13678094c7bb4dcd122727f028c910513609cef
Into the new class DocumentFieldsManager.
Removed SwDoc::_MakeFldList because it is not defined anywhere.
Also moved a few non interface methods that belong to the manager.
Change-Id: Icefd7ca7adcbb05a18d6fae0529fc54150b862fd
Into the new class DocumentRedlineManager.
Added an non const version of GetRedlineTbl to the interface.
Also Moved SetAutoFmtRedlineComment which is not part of interface.
Change-Id: I600d5821d5d5831557f5fc5375fb1203fe67a295