Regression from 2ade071269 (fdo#62044 RTF
import: don't overwrite existing styles when pasting, 2013-06-04),
during paste, if existing style was found, then the intention was to
skip that style, but instead we tried to create one.
Change-Id: I83adaf9fe6b8a578fa60c21b9463fabde7707d7e
This was introduced in commit 9c7ffb6b61
([cbosdo03]Applied the patches to upstream, 2009-12-02), as setting the
outline level also set the NumberingStyleName to "Outline" as well,
which is not what we want.
Since then, commit b95d203bc1 (Don't load
the default values of the styles in writerfilter, 2012-08-20) already
disabled default styles, so the previous manual clearing is no longer
necessary (testcases already fail if this later commit is reverted).
As a result, just remove this manual clearing, it's no longer necessary
and it is problematic, as it triggers copying the SvxLRSpaceItem from
the parent style with no good reason.
Change-Id: Ie17547a979a6b0feadbd2eed0f06e84fcb17fca6
It turns out, normal Ctrl-A doesn't select headers, footers and fly
content, either (just like not selecting footnotes). So do the same when
in the "doc starts with table" special mode.
Change-Id: Ib9bc397944a4d07ea03bc326f1536733c57f42e6
Since 78d1f1c283, we convert floating
tables to text frames only in case it's possible that there will be
wrapping, to give better results for multi-page tables, which are
multi-page, and technically floating ones, but that has no effect on the
layout.
The problem was that we try to do this decision too early, effectively
the page width and margins were counted from the default letter size,
instead of the actual values, which did not arrive at the time of the
decision. Fix this by moving this logic at the section end.
Change-Id: Ic1fbceb54c8ec223ed01836fafe6220bb3b2410a
ExtendedSelectAll() was originally invented to e.g. select the whole
document, change the language of the selection and then inmediately
(before the layout is updated) undo the selection.
When using it for "select all and doc starts with a table" purposes,
then footnotes shouldn't be selected, just like those are not selected
either, when the doc starts with a normal paragraph. Their anchor is
still selected, and that's enough to have correct delete and copy&paste.
Change-Id: I4fc49db628054a4b8a46effc2d0328eaabcaa9f8
Steps
-Add a new character attribute (RES_CHRATR_HIGHLIGHT)
-Get this character attribute via SwFont class just like
background
-If has highlight, then paint that, otherwise paint background
-Extend UNO API
-Implement DOCX export and import filter
Note: By now character highlight can't be set via UI.
It's a next step to add a highlight option.
Change-Id: I7f81e173744bf256891487f898d06dbf372a2f88
Writer core doesn't support this, and this has been a problem for table
cells as well. There the workaround we're using for quite a while is to
do the rotation at a text portion level instead, which results in
reasonable layout for simple cases. Do the same here.
One additional complexity is that the API between oox and writerfilter
is a single UNO shape, we get this property in oox, and we have to
handle it in writerfilter, when the text frame is already attached to
some text. Kill this problem by adding a FrameInteropGrabBag for sw text
frames: it's useful anyway, and then we can pass around this property
inside the grab bag.
Change-Id: Idb5ec83b5cbdde8f29d15b2cebfad24226bb6507
This should be in sync with model.xml, got broken when the somewhat
random values got fixed to be the same as the ones which are in the ww8
spec.
(Regression from 26d40686128e70916a636e20f5ccc5763bbb6cc8.)
Change-Id: Id62047e0b2d5d8402a7c8bce95de487afe627e32
Now that loading and saving SmartArt components is fully working, move
the unit test from the import section to the export one, where both
import and export will be tested.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Change-Id: I5e0d182ee941180ba80c2b310d85528ff75ef296
Reviewed-on: https://gerrit.libreoffice.org/6006
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
The XDocuments representing the DOM of an OOXML's theme document is
now stored as the PropertyValue "OOXTheme" into the "InteropGraBag"
property of the SwXTextDocument.
Added the importSubStream() method to the
writerfilter::ooxml::OOXMLDocumentImpl class in order to create the
XDocument for the theme XML fragment stream and invoked it during the
resolve() method.
Modified the writerfilter::ooxml::OOXMLDocument abstract class to be
able to hold the OOXML's theme XDocument. Added the set/getTheme()
methods to store and obtain the XDocument directly.
Modified the WriterFilter::filter() method to store the OOXML's theme
XDocument in the "InteropGrabBag" property of the TextDocument service
SwXTextDocument implementation.
Updated the UTs accordingly.
Change-Id: I3960590fcf4856caf770908b983ffb6898f061c0
Reviewed-on: https://gerrit.libreoffice.org/6002
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
This is to implement a test that <w:next> style is not exported for styles
where the next style equals to the style itself [which comes with this commit
too].
Change-Id: I5fa9999cf7e741dc96f3538b7c1106e1add6b61e
The XDocuments representing the DOM documents of a
DrawingML diagram (Smart-Art) are now stored as
the PropertyValues "OOXData", "OOXLayout",
"OOXStyle", "OOXColor" and "OOXDrawing" into the
"InteropGraBag" property of the parent
SvxGroupShape created from such diagram.
Modified the oox::drawingml::dgm::Diagram class to
be able to hold the map storing the XDocuments and
its names. Added the getDomMap() method to obtain
the map directly and the getDomsAsPropertyValues
method to get the map as a sequence of Property
Values.
Modified the methods for importing and loading the
Smart-Art into the Diagram so they add
automatically the DOM documents to it.
Modified the oox::drawingml::Shape class to be
able to hold the sequence of PropertyValues
storing the XDocuments and its names coming from
the oox::drawingml::dgm::Diagram class. Added the
getDiagramDoms() and setDiagramDoms() methods.
Enhanced the
oox::shape::ShapeContextHandler::getShape() method
to add the extended drawing document to the
oox::drawingml::Shape class.
Modified the
oox::drawingml::Shape::createAndInsert() method to
store the sequence of XDocuments in the
"InteropGrabBag" property of the GroupShape
service SvxGroupShape implementation representing
a Smart-Art.
Change-Id: I7d0b9dfbfc9d5299ddd25fab394e5e9a422d1dd1
Reviewed-on: https://gerrit.libreoffice.org/5849
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Change the order of words BORDER and EQUAL in the
macro name to become consistent with other macro names.
e.g. CPPUNIT_ASSERT_DOUBLES_EQUAL
Use a function inside the macro to make it type safe.
Add additional message to make clear why the test failed.
Change-Id: I9fc7a5813adf2cac36ae831d438cec498232b06c
Reviewed-on: https://gerrit.libreoffice.org/5885
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
In general, paste should not deal with page styles. In this case, it
even caused an additional page break.
Change-Id: Ia7c5a9ad844821b6622babfbd94469ec3c04cf0a
-Use sprm:CBrc attribute for all MS filter (for ooxml too).
-Extract general code to FormatCharBorder() method, it selects
the border side and decides whether add shadow to the border.
-RTF export has a color table, which must be filled with border
colors before the actual export.temp
Change-Id: Ic3ceae6e19ddc2ed5aaa8de85617f9a592289b4f
- Modify HasTextItem() method to able to get
character attributes during export.
(in this case RES_CHARTR_SHADOW)
- Only one side of the border can be exported.
Selecting order: (top, left, bottom, right)
- During import set all four side and use the Word
default shadow type (back, bottom-right, border width wide)
Change-Id: I3e1e27a2ef2d77b397f2ca8efe578e09271bcf8c
-I don't implement shadow because HTML filter use css1 attributes
and there isn't box-shadow in css1.
-Border merge: skip span open and close tags to get the
right result.
Change-Id: I17edc2e1cc42359b5f1721b8891350c528c7793e
The shape had no special properties about hori/vert text adjustment, so
it should be hori left / vert top. Then it has vertical layout-flow, so
vert should be top and hori should be right (vert was center).
Change-Id: Ia89d8587b6a822ead45198dc5d1ba23907cc3567
There were two problems here:
1) OOXML has no way to explicitly disable the footnote separator, what
is does is that it omits the <w:separator/> element in that case. We
didn't parse that previously -- now we do, and if it's missing, the
separator is disabled.
2) The footnote stream isn't read by the importer, only when the main
stream references the footnote one, the relevant part of it is parsed.
At the moment we always parse the first (special, "separator") entry in
the footnote stream, that may be optimized later if it becomes a
bottleneck.
Change-Id: Ie588270a212fc90fc41095029a362cfd832b24f8
This is a port of commit 8fe8bd6c3b
"Related: fdo#61594 SwWW8ImplReader::StartApo: don't always start a
frame" from the WW8 filter to the DOCX one.
(regression from edc4861a68)
Change-Id: If1bb4a8a3786aacd618585cf859b57ce9be85c51