Commit Graph

1217 Commits

Author SHA1 Message Date
Jan Holesovsky
0f646b9098 DOCX export: Enhance the style inheritance unit test for docDefaults.
Change-Id: I839cbd6b3499f77867f993ece9f764db8f1c18c3
2013-10-09 14:39:35 +02:00
Miklos Vajna
60535ebcb4 DOCX filter: test CT_LatentStyles and CT_LsdException
Change-Id: I343b1d83db8e7538fcb5276a8701b51fe64a2a67
2013-10-09 12:12:08 +02:00
Faisal M. Al-Otaibi
aa52753785 DOCX:fdo#43093 fix wrong direction and alignment for RTL
Change-Id: If362d80a86a7493f2d43e6d661b94fc03942711f
2013-10-07 11:04:32 +03:00
Miklos Vajna
e450a2c506 Revert "Try to fix TB master Linux-Gentoo-x86_64_2-no-conf"
This reverts commit 1bbfd5a069. Should not
be needed after 4a96bc0c0e is reverted.
2013-10-06 22:34:55 +02:00
Julien Nabet
1bbfd5a069 Try to fix TB master Linux-Gentoo-x86_64_2-no-conf
Change-Id: I9a1ed5b10f059ddf72fcbcfaf9260bbdbd529d03
2013-10-06 17:18:56 +02:00
Jan Holesovsky
457e0aef52 DOCX styles: Check that we roundtrip rPrDefaults.
Change-Id: I3aef9fdedf9877d1243940c429e05ff36f7fa760
2013-10-04 20:27:31 +02:00
Jan Holesovsky
2997d7d10a HighLight -> Highlight.
Change-Id: I2db5102fbc441c0b79d8c28023f3e3bb5613b3cf
2013-10-04 11:23:10 +02:00
Miklos Vajna
5ebe826caf fdo#69384 fix impress -> writer copy&paste
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
2013-10-04 12:19:11 +02:00
Miklos Vajna
fd2d14d554 Implement DOCX export of paragraph outline level
Change-Id: I5648454d50f1df61962fa1516ea62aee5cb3777e
2013-10-04 10:20:30 +02:00
Miklos Vajna
df60b2f768 StyleSheetTable::ApplyStyleSheets: stop clearing NumberingStyleName manually
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
2013-10-03 12:50:53 +02:00
Tor Lillqvist
216768c7d2 WaE: unused variable
Change-Id: I3c5d542ef57afba0d6e308e033bf179af4216975
2013-10-02 21:22:50 +03:00
Miklos Vajna
232df42b8d fdo#69979 SwCrsrShell::ExtendedSelectAll: exclude headers, too
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
2013-10-02 11:40:11 +02:00
Miklos Vajna
bbef85c157 bnc#779620 DOCX import: try harder to convert floating tables to text frames
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
2013-10-01 17:28:18 +02:00
Tushar Bende
7d637b7143 Unit test case added to verify chart rendering in Writer for docx
Unit Test case to verify Width & Height of Chart rendered

Change-Id: I2899b9bdaf251f82400ebee273b23d09add4b468
Reviewed-on: https://gerrit.libreoffice.org/6056
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-10-01 08:24:55 +00:00
Miklos Vajna
959711f127 fdo#69862 SwCrsrShell::ExtendedSelectAll: don't always select footnotes
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
2013-09-30 12:28:58 +02:00
Zolnai Tamás
8b94913444 fdo#65403, fdo#65404 DOCX export/import of character highlight
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
2013-09-29 11:27:34 +02:00
Miklos Vajna
3da8490e6c fdo#69636 VML export: handle mso-layout-flow-alt shape prop for sw frames
Change-Id: Iec798b3db23883d34bfbaff0003330f013df1a3e
2013-09-27 11:25:09 +02:00
Miklos Vajna
8738ded7bb fdo#69636 VML import: handle mso-layout-flow-alt shape prop for sw frames
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
2013-09-26 12:43:32 +02:00
Miklos Vajna
21e07d473d fdo#66743 fix import of some RTF_CLSHDNG values
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
2013-09-23 10:39:44 +02:00
Miklos Vajna
a516ac452e fdo#37606 testcase
Change-Id: I60d34906a90a5143163e516f618648cf7178430e
2013-09-20 15:49:55 +02:00
Miguel Gomez
b5a888d368 fdo#64491: Move SmartArt test from import to export
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>
2013-09-20 11:26:59 +02:00
Andres Gomez
290f03e8bb writerfilter: OOXML theme saved in InteropGrabBag
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>
2013-09-20 08:51:37 +00:00
Jan Holesovsky
f0e3c542ac DOCX styles: Unit test for <w:next> style handling.
[covers both problems fixed in the previous commits.]

Change-Id: I3df3537c52e2f6ebcb60a38f3648a35a5eca9051
2013-09-19 14:52:28 +02:00
Jan Holesovsky
83ea6bf0de DOCX export: XPath should allow checking for the number of returned nodes.
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
2013-09-18 19:11:16 +02:00
Jan Holesovsky
a19bcc4c87 DOCX styles: Unit test for the styleId's.
Change-Id: I309a9c7ed0ad633ca58dce542d5fa2db883a17ec
2013-09-18 19:11:16 +02:00
Zolnai Tamás
f356fd26a1 CharBrd 10: Some documentation
Change-Id: I4c6c2cd4acf8ae4a759a662f92066ad63df74b3c
2013-09-15 18:45:58 +02:00
Tor Lillqvist
b32ca041cd WaE: C4701: potentially uninitialized local variables
Change-Id: I323fa5f1c9b94166d32b0457905ccb1ec06ecd5c
2013-09-12 15:28:59 +03:00
Miklos Vajna
4e653d15ef DOCX import: fix default section break type inside multiple columns
Change-Id: I7c44a2bdb69563953d3257b435aeed5bae50f7b2
2013-09-11 16:14:16 +02:00
Andres Gomez
ab0998c77c oox: Smart-Art DOMs stored in the InteropGrabBag
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>
2013-09-11 07:35:59 +00:00
Miklos Vajna
7cb5537be8 CppunitTest_sw_ooxmlexport: do not build failing testcase
Change-Id: Iec2db10104e79406cb2b9b6bac81d64dbe597d8d
2013-09-10 09:39:12 +02:00
Zolnai Tamás
f4dad76732 Improve border equal check in filter tests 2.
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>
2013-09-10 07:27:09 +00:00
Zolnai Tamás
3b6ad403dd Use hex color code in character border filter tests
Change-Id: I19bd1cbedd42101186fd4afbcd7af9afb630f857
2013-09-09 13:07:52 +02:00
Miklos Vajna
b226dcb50d fdo#68291 RTF paste: don't set PageDescName during paste
In general, paste should not deal with page styles. In this case, it
even caused an additional page break.

Change-Id: Ia7c5a9ad844821b6622babfbd94469ec3c04cf0a
2013-09-09 10:44:18 +02:00
Zolnai Tamás
aa2faee4b3 CharBrd 9.4: DOC filters
-WW8 filter is the only MS filter which ignores padding
of character border.

Change-Id: I17973d8d2ae624d68356729334c701864fe0a10d
2013-09-08 11:23:46 +02:00
Zolnai Tamás
05e1439107 CharBrd 9.3: RTF filters
-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
2013-09-08 11:23:46 +02:00
Zolnai Tamás
cfc64c7e89 CharBrd 9.2: DOCX filters
- 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
2013-09-08 11:23:45 +02:00
Zolnai Tamás
b94b1fe936 CharBrd 9.1: HTML filters
-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
2013-09-08 11:23:45 +02:00
Zolnai Tamás
96e4cc8751 Fix expected and actual order in odf export test
Change-Id: Ib8168112e297571cc99b39fbf365d888e2247da5
2013-09-08 11:23:44 +02:00
Zolnai Tamás
d21dd28891 Improve border equal check in filter tests
With macro the error message will point to the right line.
Check padding distinct.

Change-Id: Id09fbf65350a7a3708923eb07d673068c2943b50
2013-09-08 11:23:44 +02:00
Miklos Vajna
4cbc41bc4e bnc#779642 VML import: handle drawinglayer rectangle char spacing
Change-Id: I79fa72c9235682030d23a03fdb0c7c40370c4a8a
2013-09-06 18:39:00 +02:00
Miklos Vajna
b10afb2629 bnc#779642 VML import: fix TextHorizontalAdjust when layout-flow is vertical
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
2013-09-05 14:48:01 +02:00
Miklos Vajna
3f2774c771 fdo#68787 DOCX export: handle zero width footnote separator
Change-Id: Ieb1d8d1f8609558b4af06630b603a51da3e665f4
2013-09-04 17:34:45 +02:00
Miklos Vajna
330b860205 fdo#68787 DOCX import: handle when w:separator is missing for footnotes
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
2013-09-04 16:44:51 +02:00
Michael Stahl
3c8bee809d fdo#68839: add unit test
Change-Id: Ic47bfdeb1466a3772c95008dbf035f294cc3ece4
2013-09-04 00:17:18 +02:00
Miklos Vajna
60a3f35e63 typo
Change-Id: Icea791684399fb15b5f7940b5691cdc76b3dde1f
2013-09-03 20:57:52 +02:00
Miklos Vajna
78d1f1c283 fdo#68607 bnc#816593 DomainMapperTableHandler: don't always start a frame
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
2013-09-03 12:13:03 +02:00
Miklos Vajna
7d3778e0ef bnc#816593 DOCX import: ignore page breaks in tables
Change-Id: Ibb250148d41d1929fa17dd993bb71c93c0e09dcf
2013-09-02 10:31:14 +02:00
Pierre-Eric Pelloux-Prayer
91455ec39f docx export: add unit test for page size with page borders
Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx

Change-Id: I999fa2893fc404f90136b2a2e79aefa93f177896
Reviewed-on: https://gerrit.libreoffice.org/5665
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-09-01 11:55:11 +00:00
Adam Co
196328c91e fix for IsPlausibleSingleWordSection checking wrong condition
Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx

Change-Id: I503e5944079b6c03413caea27ef940efbd44ced5
Reviewed-on: https://gerrit.libreoffice.org/5548
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-08-30 15:56:57 +00:00
Miklos Vajna
17e904ed66 bnc#816593 DOCX filter: import paragraph spacing from table style
Change-Id: I9dce59ecd8a2d2bfadb8c7273cd46c6c0cf17774
2013-08-29 15:06:17 +02:00