Commit Graph

1217 Commits

Author SHA1 Message Date
Miklos Vajna
ae38e44ba7 Make CppunitTest_sw_ww8import use DECLARE_SW_IMPORT_TEST()
Change-Id: Id2efe1cacd8b1e7ceb31ee2b7d7ed4671266231b
2013-11-09 19:10:31 +01:00
Miklos Vajna
961e319da7 DOCX filter: handle numbering style's qFormat, rsid and friends
Change-Id: Ia261995b98e2108ab673c7b240a1aa822d3db96e
2013-11-08 14:23:12 +01:00
Miklos Vajna
5ecd8a55ee DOCX filter: handle char style's qFormat, rsid and friends
Change-Id: Ie0bc9aff722d87fcd246d0cf1971ad6f34f0996a
2013-11-08 09:53:13 +01:00
Vinaya Mandke
e3d3b7bb0c Fix for multipe occurrences of attibute in <w:pgMar>
After round trip multiple occurrences of w:left,  w:right etc
were exported.
Also added UT for the test file.

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx

Change-Id: I6a503cf609f627b8f8eb9d33691e51582c15b459
Reviewed-on: https://gerrit.libreoffice.org/6608
2013-11-08 09:38:01 +01:00
Miklos Vajna
7fb73e6c30 Make CppunitTest_sw_ooxmlimport use DECLARE_SW_IMPORT_TEST()
Change-Id: Ic5c204d6766bf5f2c5f346a84d92f1f03b1ff418
2013-11-07 21:07:26 +01:00
Miklos Vajna
660d761bfe fdo#70812 writerfilter: check for nullptr after dynamic_cast
Happens when we set "no number" in the default para style, which is
already the case for Writer anyway.

Change-Id: I3b262e633e52e4aae039c55d6edb744e36f0f354
2013-11-07 16:15:16 +01:00
Miklos Vajna
b4577903f5 DOCX import: handle NS_ooxml::LN_CT_Style_autoRedefine
Change-Id: I8c2c0ca8d060e2c460d0f36aed3050ed335fb3a3
2013-11-07 14:21:55 +01:00
Miklos Vajna
14641f650e DOCX filter: roundtrip paragraph customStyle
Change-Id: I7fec154ff3b39845e91301b4fb607381e80e13f7
2013-11-07 14:21:55 +01:00
Miklos Vajna
c367a7e3ca DOCX filter: roundtrip paragraph style default
Change-Id: I93495b4a2f85fe9729f8e1c810532717783756e4
2013-11-07 14:21:55 +01:00
Miklos Vajna
98fd705924 DOCX filter: roundtrip paragraph style lock
Change-Id: Id656e48c1600bb7b04e8566d5c0f3297f80a89d9
2013-11-07 11:30:43 +01:00
Miklos Vajna
fc46d7f60b DOCX filter: roundtrip paragraph style link
Change-Id: Ide29e98b73410d8917742f2eeb15bdcbd9de87cc
2013-11-07 11:30:42 +01:00
Miklos Vajna
7813bd3113 cp#1000015 DOCX export: fix not-well-formed XML on redline end + hyperlink
Change-Id: I3a87a0277952ba0a422df8988151f8b14e166e06
2013-11-06 18:01:46 +01:00
Miklos Vajna
eb3942a249 DOCX export of para style's qFormat, rsid and friends
Change-Id: I4ed35f2b497fec96d012303001d4861768daef6a
2013-11-06 16:53:55 +01:00
Adam Co
57c5479278 fdo#69644 - fix docx export of wrong number and width of columns
When the DOCX exporter exported a table, it filled the table
column definitions with the column sizes of the FIRST row only.
This was ok for tables that have the same columns on all rows,
but for more complex tables with different cell widths - the
filter exported the wrong number of columns and the wrong width.
A followup fix would fix the rounding problems there still are
with the column widths that are exported in the table
definition.

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx

Change-Id: Ie95dfe60b1c1811776433e457ca04e728623e01e
Reviewed-on: https://gerrit.libreoffice.org/6290
2013-11-05 16:22:49 +01:00
sushil_shinde
8ab553117e [docx] CustomXml saved in InteropGrabBag and exported customxml when saving.
The XDocuments representing the DOM of an OOXML's customxml document is
  stored as the PropertyValue "OOXCustomXml" into the "InteropGraBag".

  Added mxCustomXmlDomList object which holds xDocuments for
  each item.xml from CustomXml.

  Exporting all items dom tree from customxml that has been parsed
  when loading the file.
  This is necessary in order to properly reopen docx files that
  contain data like citation.

  This fix grab bags only item[n].xml's files from CustomXml folder.
  itemProps[n].xml's and item.xml's .rels are not preserved and exported yet.
  (Working on this part)

Change-Id: I330f34f38a7aa4cd39094371bff15ebbc0318167
Reviewed-on: https://gerrit.libreoffice.org/6519
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-11-05 09:07:07 -06:00
Miklos Vajna
2c26e47cdc Avoid msfilter::util::ConvertColor in DocxTableStyleExport
It's more consistent to do all the any to string conversion on the
import side. Also, when we have the ConvertColor calls in a single
place, audit grab-bag-related calls: those should always enable auto
color conversion.

Change-Id: I39ef74986617ee0ed629607e2a069047879b0422
2013-11-05 15:47:59 +01:00
Miklos Vajna
1b76aebcb2 DOCX filter: handle shd's "themeFillTint" attribute inside tblStylePr
Change-Id: Ib2bc21e0fb5d874ed82ac826eeab209dcb9303eb
2013-11-05 15:47:59 +01:00
Miklos Vajna
e21068ff06 DOCX filter: handle spacing's "before" attribute inside tblStylePr
Change-Id: I0617b6d3b9e6d81300f97b0b992081cd10ec2fdd
2013-11-05 15:47:59 +01:00
Miklos Vajna
ebf3df4911 DOCX filter: handle tcMar inside tblStylePr
Change-Id: Ifc7694b39337fb9824c2b57083fee101d48f6b84
2013-11-05 11:12:22 +01:00
Miklos Vajna
a76daca815 Make CppunitTest_sw_rtfimport use DECLARE_SW_IMPORT_TEST()
Change-Id: I670e0460f15951f99f0f750d2798c771f64c3095
2013-11-04 21:33:11 +01:00
Miklos Vajna
4bfa4a69a8 DOCX filter: handle CT_Ind_rightChars and CT_PPrBase_snapToGrid
Also, add InteropGrabBag support to bCs, themeFill, themeFillShade and
w:ind's right attribute.

Change-Id: I0d6ad0ef062218e71d7c71f99c56dd680b6930de
2013-11-04 17:57:44 +01:00
Miklos Vajna
97561260ff DOCX filter: roundtrip themeTint and themeShade
Change-Id: Idaf5f6ef13df1ee821d23b8366d25924d26ff4c2
2013-11-04 15:09:29 +01:00
Miklos Vajna
832586588c DOCX filter: more run properties table style roundtrip work
Implement roundtrip of smallCaps, spacing, caps and color's themeColor
attribute.

Change-Id: I1ac88de030356a5ce08a28ac16cd159a426d2be9
2013-11-04 12:42:45 +01:00
Noel Grandin
5285beeaa4 remove redundant calls to OUString constructor in if expression
Convert code like:
  if( aStr == OUString("xxxx") )
to this:
  if( aStr == "xxxx" )

Change-Id: I8d201f048477731eff590fb988259ef0935c080c
2013-11-04 10:11:08 +02:00
Miklos Vajna
325cee9a60 Make CppunitTest_sw_rtfexport use DECLARE_SW_ROUNDTRIP_TEST()
Change-Id: I50babe172d3c9a46256ac3dc95a3b7591cd3c777
2013-11-01 20:55:26 +01:00
Miklos Vajna
f91775c00d writerfilter: implement BorderHandler::getInteropGrabBag()
Change-Id: I86922585122898692dc4fb1fbbee11e1864dad29
2013-10-31 18:17:48 +01:00
Miklos Vajna
fbe12f72bc DOCX filter: roundtrip more table cell border properties for table styles
Change-Id: Ia93bd2083b00f62770970a4efa783b6b19967acb
2013-10-31 15:50:00 +01:00
Pierre-Eric Pelloux-Prayer
5dc0c27016 sw/qa: adapt ooxmlexport to use new tests macros
Change-Id: Iacdcb70e369f3f48e2885480ec5acabdae422f99
Reviewed-on: https://gerrit.libreoffice.org/6513
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-10-31 13:30:43 +00:00
Miklos Vajna
62f67d64b4 writerfilter: implement TDefTableHandler::getInteropGrabBag
This allows to roundtrip table cell borders in conditional table style
definitions for DOCX.

Change-Id: Ibc0da9996e98e89864c001294695328c15c1549c
2013-10-31 13:02:55 +01:00
Pierre-Eric Pelloux-Prayer
effeb7b039 sw/qa: 1 individual unit test per filter (import/export) test
The goal is to have clearer failure message by distinguishing
failures (only import, import and export, only export).

Change-Id: Ic4fc5f7bfd7c9ddb0705597c3fb994e41d04b5ba
Reviewed-on: https://gerrit.libreoffice.org/6289
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-10-31 11:19:06 +00:00
Miklos Vajna
9ab844c7fa DOCX filter: roundtrip more table style properties
Handle wordWrap, beforeLines, afterLines, beforeAutospacing,
afterAutospacing, asciiTheme, hAnsiTheme, b, i, color, sz and vAlign.

With this, the export filter is now in sync with the import one again.

Change-Id: I7184447baf872374eaa69afdfcb149a7e6e45faa
2013-10-30 17:50:36 +01:00
Miklos Vajna
ef439702fa DOCX export: handle table style's pPr / rPr from InteropGrabBag
Change-Id: I6dfb29db030212e55a207f39e79a1cf01d482e85
2013-10-29 11:45:40 +01:00
Miklos Vajna
95e2a96f02 DOCX filter: roundtrip semiHidden and unhideWhenUsed for table styles
Change-Id: Ie7073a6346553650741a1631096342318d650890
2013-10-28 16:49:37 +01:00
Miklos Vajna
d1eb536c7e fdo#69893 fix SwWrtShell::SelAll() to work with empty table at doc start
In theory, it was a problem to have the table cursor around when having
the selection outside the table; but it didn't cause a problem so far.
However, when the table has one or more empty cells, we really need to
leave table mode, otherwise only the table gets selected.

Change-Id: I766903ed624b9338f0612697b4c03f44de1d2e41
2013-10-28 12:00:22 +01:00
Miklos Vajna
ed2790435f SwUiWriterTest: allow loading a custom bugdoc
Change-Id: I5578e462c21c023d8c9a269f2ca254e20c1a617e
2013-10-28 12:00:06 +01:00
Miklos Vajna
0a8db454e5 DOCX export: more table style export testcases
Change-Id: I84a9dde8620b128ab426722fc06f4a1c71b0c5a2
2013-10-25 18:23:01 +02:00
Miklos Vajna
a6a24677bc DOCX export: initial table style roundtrip testcase
Change-Id: I164833907012f4b94e2be848ea4f26a9e1c8694b
2013-10-25 14:25:05 +02:00
Adam Co
c2ccd20c0f fdo#44689: fix for specific case of page restart-value 0
This bug fix is for roundtripping a DOCX that has
a specific 'start value' for the page numbers.
In most cases LO imports it ok.
However - until now - Word allowed you to start page number
from 0, while LO only allowed starting page numbers from 1.
This was because the 'start value' was stored in an 'unsigned int',
and the value '0' was used to mark 'there is no start value'.
This patch changes the way the 'start value' is stored
from 'unsigned int' to 'optional unsigned int'.
This way - if there is no value applied - the variable will hold NULL.
However - if a value is set - it can be 0 or more.
This meant also tweaking all the places that used to get this value,
so that now they handle an 'optional uint', instead of a 'uint'.

Conflicts:
	sw/source/ui/inc/break.hxx
	sw/source/ui/inc/wrtsh.hxx
	sw/source/ui/shells/textsh1.cxx
	sw/source/ui/utlui/uitool.cxx
	sw/source/ui/wrtsh/wrtsh1.cxx

Change-Id: I6ad9d90e03b42c58eed2271477df43c20ad6f20a
Reviewed-on: https://gerrit.libreoffice.org/5681
2013-10-22 09:53:53 +02:00
Miklos Vajna
a35fa8d8b1 fdo#70221 fix RTF import of multi-group pictures
Pictures typically have a single RTF group, so we imported them at the
end of that group. Though multiple inner groups are also allowed, so
make sure we only do the import at the very end, instead of at the end
of all inner groups as well, resulting in multiple (fake) pictures.

Regression from 13c00ce322 (Enable the
writerfilter-based RTF import in non-experimental mode, 2011-08-18).

Change-Id: Id895b2c6d3b824d09d89bfa01ce59aba76c55d42
2013-10-21 09:36:33 +02:00
Miklos Vajna
8e434a45c2 MSWordStyles: initial DOCX export of list styles
Change-Id: I96522b72de1e0322229105c24913ed011b28d170
2013-10-17 19:03:36 +02:00
Andras Timar
7ee2ce24c4 fdo#69548 do not remove last space from hyperlink target
Conflicts:
	sw/qa/extras/ooxmlimport/ooxmlimport.cxx

Change-Id: I7efd68fe21dddd7d9262d3e0b7400db67504e6bc
2013-10-16 13:21:32 +02:00
Andres Gomez
b3362fc9cb sw: Smart-Art related UTs updated to new option
The "ooxmlexport" unit test for Smart-Art has been updated to just
check for the new rendered bitmap that substitutes the generated basic
shapes.

The "ooxmlimport" has been updated with a new "testSmartart" unit
tests which checks that the importing has been done to just basic
shapes.

For this, the "run" method has been customized so we can set the
proper filter option.

Slightly modified the expected results in the "testChartProp" unit
test since linking it to additional libraries has modified the
dimmensions of the imported chart in few units.

Made the "ooxmlimport" C++ unit tests in the "sw" module to depend on
the "drawinglayer" and "svx" components and the "utl" library.

Conflicts:
	sw/qa/extras/ooxmlimport/ooxmlimport.cxx

Change-Id: I0900a50cfee07999511d071bc9932477ad9430c5
2013-10-16 12:23:34 +02:00
YogeshBharate
764432e36a Code changes & unit tests for fixing multicolumn section separator line issue
Problem Description: In case of multicolumn sections, separator line was getting added during export to docx.
Unit test cases added to verify the code changes.

Change-Id: Id65ac4d3878eed298882c85082cec9575f914d83
Reviewed-on: https://gerrit.libreoffice.org/6211
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-10-16 09:08:12 +00:00
Miklos Vajna
265c7d6236 sw: enable (most of) CppunitTest_sw_ooxmlimport/export on Mac
This used to be problematic due to the flashing windows, but it was
stated recently that we already have those anyway due to e.g. gengal. It
turns out all our DOCX filter tests pass just fine on Mac, except one
checksum test -- make *that* an exception instead.

Change-Id: Id5e620a33b9b05f154e4072a8a49f335837079ea
2013-10-15 17:25:17 +02:00
Miklos Vajna
1f6435d986 WW8 import: fix handling of sprmPIlfo when sprmPIlvl is missing
Commit 542a0d7260 (#100044# Cleanup for
optimization defines->enums, 2002-08-14) added the problematic "else"
without mentioning the reason, so I assume it's safe to just revert that
part.

Change-Id: Id90fbdfb1116be458a76c9653fec0633edc34fac
2013-10-15 17:03:21 +02:00
Miklos Vajna
74904ca6b0 fdo#36868 WW8 import: allow outline numbering and list style in the same ...
.. paragraph style

The original problem (from a user's point of view) was that the second
level of the numbering started from 1.1 instead of 2.1 in the bugdoc.
This was fixed by using outline numbering for level 2 as well, but this
is problematic in many cases: we want to have outline numbering exactly
when outline numbering is enabled for the given paragraph style.

So revert the change in SwWW8ImplReader::SetStylesList() and fix it
differently: SwWW8ImplReader::RegisterNumFmtOnStyle() explicitly ignores
list style if outline numbering is available with no good reason. Both
the WW8 format and Writer core allows to have outline numbering and a
list style at the same time, so set list style even when outline
numbering is available. This fixes the original issue, too -- without
introducing nasty fake outline numbering usage.

Also add a testcase for the original issue.

(regression from e3d5c3e074)

Change-Id: Id7d2d67a96a858aee3230110cb518fea51d19d38
2013-10-15 16:10:04 +02:00
Arnaud Versini
1b45e8a86a Introduce unit test in replace functionnality in Writer
Change-Id: I5ee33965a511c7730610377a2e41f4728a0fe4d2
Reviewed-on: https://gerrit.libreoffice.org/6184
Tested-by: Arnaud Versini <arnaud.versini@libreoffice.org>
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2013-10-13 11:45:21 +00:00
Miklos Vajna
08c104a94c sw: add missing testcase for spellmenu-redline.odt
There are various cases here, as a start just test that any spellcheck
popup menu in a redlined document should at least contain the "go to
prev/next change" menu items.

Change-Id: Ic70b6dae4cac8fd970ad54e5015a61d50b024b2b
2013-10-12 21:07:27 +02:00
Miklos Vajna
e2cdde1f18 sw: make it possible to accept/reject changes if they contain spelling errors
If there were spelling errors in a text portion that is to be
accepted/rejected, right mouse click just shown the spellcheck menu, so
oddly if an inserted text contained spelling mistakes and we wanted to
reject them, Writer didn't allow that.

Fix this by adding the redline operations (accept change, reject change,
next change, previous change) to the spellcheck menu, but make it only a
wrapper around the SwView code, so all the logic on what to do and when
to hide these menu items is not duplicated.

Change-Id: I76cad2f58a47575f8ef9517af51f1ffe7c4b6844
2013-10-11 18:20:14 +02:00
Stephan Bergmann
acbe968ef0 Minor improvements
Change-Id: I1dfe57368f438087d6e6131d36128db4438792eb
2013-10-10 14:26:06 +02:00