156 Commits

Author SHA1 Message Date
Caolán McNamara
0d1d6aa26e coverity#1158103 Unchecked dynamic_cast
Change-Id: Id08897c1dcb9df59458a29d5d20d57cd6a9039f8
2014-02-07 12:24:45 +00:00
Caolán McNamara
38e7e67248 coverity#1158104 Unchecked dynamic_cast
Change-Id: I725d1adc028597123dec10c2de6c609211c8e7a4
2014-02-07 12:24:44 +00:00
Caolán McNamara
ade3a42423 coverity#1158105 Unchecked dynamic_cast
Change-Id: Ia908b5cc3f7d18e376496eacd71a2e55f75bf8b3
2014-02-07 12:24:44 +00:00
Caolán McNamara
e04eee9a59 coverity#1158106 Unchecked dynamic_cast
Change-Id: I52af351a470bec9acb7a1981faf0ae6943ceba43
2014-02-07 12:24:44 +00:00
Jacobo Aragunde Pérez
0583c889c3 sd/qa: Remove InteropGrabBag property from XML dumps
The InteropGrabBag property adds a lot of noise to this tests and it
doesn't actually have any purpose, because we are building their own
tests for InteropGrabBag-supported document attributes.

We have removed this property by default but we left a flag to enable
it when it's convenient for debugging.

Change-Id: I97cc7ba171783222a57ab5a96e5755070b949505
2014-01-28 10:36:11 +01:00
Jacobo Aragunde Pérez
bc0a9076aa ooxml: Preserve shape theme attribute for solid fill
Users can select the fill color for a shape among the theme-defined
colors. This results in the following XML:

  <wps:spPr>
    ...
    <a:solidFill>
      <a:schemeClr val="accent2"/>
    </a:solidFill>
    ...
  </wps:spPr>

Now we store both the original fill color and the name of the
theme-defined color, if it exists, on the import phase. They are put
into the InteropGrabBag of the shape with the names
OriginalSolidFillClr and SpPrSolidFillSchemeClr. Additionally, we
needed to to store the decoded theme color inside StyleFillRef.

On the export phase we have to take into account several combinations
of factors:
* If the final color for the shape fill is different from the
  original color, we must ignore any theme attributes and write the
  new color.
* If the fill color is unchanged and some theme color exists, we must
  write the theme color.
* If the fill color is unchanged and no theme color exists, we must
  check if the original color matches the style-defined color. If it
  does, we must not write any <a:solidFill> tag.
* Otherwise we must write the <a:solidFill> tag with the RGB color.

The method putPropertiesToGrabBag was added to the Shape object for
convenience.

The data files for some /sd/qa/ unit tests were updated to reflect
the new properties inside the Shape InteropGrabBag.

Change-Id: If0915c5442872a8acab0a8a081f60c89c97277bd
2014-01-18 14:51:43 +01:00
Jacobo Aragunde Pérez
15e01d90b9 ooxml: Preserve shape style attribute fillRef
Shape style attributes contain the default format for the shape in
case that no direct format is specified for it. This is an example
of the attribute we want to preserve with this patch:

  <wps:style>
    ...
    <a:fillRef idx="1">
      <a:schemeClr val="accent1"/>
    </a:fillRef>
    ...
  </wps:style>

The relevant values in these tags are stored at the maShapeStyleRefs
member in the Shape object. The storage happens at
ShapeStyleContext::onCreateContext which is run when the <a:fillRef>
tag is opened. The ShapeStyleRef object contains the idx value and a
Color object which will contain the inner tag <a:schemeClr>.

The Color object has been modified to store the string value of
schemeClr. The storage happens at ColorValueContext::onStartElement
which is run when the tag <a:schemeClr> is opened.

Later, Shape::createAndInsert is called by the ShapeContextHandler to
create the actual XShape, this happens when the tag <wps:wsp> is
closed. createAndInsert puts idx and schemeClr values into the
InteropGrabBag property of the XShape with the name StyleFillRef.

On export time, when the shape data is written at
ShapeExport::WriteCustomShape, we added a call to
DrawingML::WriteShapeStyle. This method will check the existence of
the InteropGrabBag property in the shape, read the StyleFillRef prop
inside it and output the proper XML to the style definition.

DrawingML::WriteShapeStyle also writes some mock tags into the
<wps:style> because we found that they are compulsory. We will
replace them with the proper data in further patches.

The method putPropertyToGrabBag was added to the Shape object for
convenience.

The data files for some /sd/qa/ unit tests were updated to reflect
the new property StyleFillRef inside the InteropGrabBag.

Change-Id: I5ffa5242852461a1a709a8f169d40f0d7a2c9aa3
2014-01-18 14:51:42 +01:00
Muthu Subramanian
ee6eadfc61 fdo#72998: Add unit test case. 2013-12-30 18:07:00 +05:30
Muthu Subramanian
beba4603ee fdo#72998: Custom shapes have improper size. 2013-12-27 19:59:22 +05:30
Muthu Subramanian
3b9b2e2d98 n#828390: Unit test for bullet's relative size. 2013-12-19 18:17:27 +05:30
Muthu Subramanian
33b59c5557 n#828390: Add unit test for font properties export. 2013-12-18 20:01:11 +05:30
Muthu Subramanian
eea8c671e4 n#828390: Unit test for resetting char escapement. 2013-12-12 18:54:00 +05:30
Muthu Subramanian
0b578e51cd n#828390: Add unit test for new line import. 2013-12-12 13:21:33 +05:30
Muthu Subramanian
a850e62cd2 Fix unit test case.
This would test for white spaces in text import.
2013-12-10 21:57:11 +05:30
Korrawit Pruegsanusak
6fd352dc3a unittest for fdo#71434
Change-Id: I4ef376e048aa0ba37e5c1bc7664e9e8cd3e283b6
Reviewed-on: https://gerrit.libreoffice.org/6985
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2013-12-08 09:15:51 +00:00
Korrawit Pruegsanusak
a9562d5e3c XShapeDumper: empty name should not be dumped
Change-Id: Ic1ab8840c9e543cebf322de922b01739684789ad
2013-12-08 14:18:56 +07:00
Korrawit Pruegsanusak
4db9ae4479 sd/qa/unit: move and rename some files for consistency 2013-12-08 14:18:55 +07:00
Muthu Subramanian
32f700a683 fdo#68594: Adding unit test. 2013-11-25 19:39:20 +05:30
Muthu Subramanian
22db67c9b6 n#828390: Add unit test case for subscript export. 2013-11-14 13:45:09 +05:30
Muthu Subramanian
5656393f02 Add export unit test helper to testDocumentLayout. 2013-11-13 20:58:30 +05:30
Muthu Subramanian
9694f8bc26 Adding unit test case helper for export and reload.
[Similar to the one in the sc module]
2013-11-13 20:58:30 +05:30
Muthu Subramanian
3752d67c05 fdo#71075: Adding unit test for chart import (odp) 2013-11-06 15:40:30 +05:30
Thomas Arnhold
3b58ababc5 fixincludeguards.sh: sd
Change-Id: Ic831838b377656015d645eec9d439424378e08af
2013-10-23 23:22:33 +02:00
Jacobo Aragunde Pérez
3f8e73a36a sd: Fix output for unit test file n819614.pptx
Change-Id: Ida2d2bab3a30beaa8e686a23355e4d6f41182f3f
Reviewed-on: https://gerrit.libreoffice.org/6257
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-10-16 10:24:26 +00:00
Muthu Subramanian
cd40d2ba9e n#819614: Lines running off the screens.
Also fixed the test cases.
2013-10-10 12:22:13 +05:30
Ivan Timofeev
d5fc6f6141 change default line color to Tango: Sky Blue 2
Change-Id: I3e2139cb1d12fe1849d87b438ab3f55fc21fa574
2013-10-07 22:29:10 +04:00
Andres Gomez
a2e73b061f drawinglayer: added dumping of InteropGrabBag prop
XShapeDumper is now also dumping the
InteropGrabBag property as a new empty element.

In the future, new "private" properties added to
the grab bag could be dumped too.

Updated the unit tests accordingly.

Change-Id: I7526dbd64bdc08915dc71f1167f05224118f17a6
Reviewed-on: https://gerrit.libreoffice.org/5848
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-09-09 09:27:48 +00:00
Muthu Subramanian
29c43f6900 n#831457: Recommiting the patch.
Fixed the test cases - false negatives.
2013-08-16 17:48:16 +05:30
Caolán McNamara
11b8aaf293 add EDB 26517 test case
Change-Id: I463c390259f0ddc73497fb5c87fc55bea1887735
2013-07-19 11:50:47 +01:00
Thomas Arnhold
ba0a57702c remove OUString wrap for string literals
For some functions and all kinds of Exceptions.

CannotConvertException
CloseVetoException
DisposedException
EmptyUndoStackException
ErrorCodeIOException
Exception
GridInvalidDataException
GridInvalidModelException
IOException
IllegalAccessException
IllegalArgumentException
IllegalTypeException
IndexOutOfBoundsException
NoMasterException
NoSuchElementException
NoSupportException
PropertyVetoException
RuntimeException
SAXException
ScannerException
StorageWrappedTargetException
UnsupportedFlavorException
VetoException
WrappedTargetException
ZipIOException
throwGenericSQLException
throwIllegallArgumentException

createInstance
createInstanceWithContext
forName
getByName
getPackageManager
getPropertyValue
getUnpackedValueOrDefault
getValueByName
hasPropertyByName
openKey
setName
setPropertyValue
supportsService

bash command:

for i in `cat list`; do git grep "$i\s*(\s*OUString(\s*\"" -- '*.[hc]xx'
	| cut -d ':' -f1 | sort -u
	| xargs sed -i
		-e "s/\(\<$i\s*(\)\s*OUString(\s*\(\"[^\")\\]*\"\)\s*)\s*/\1\2/g"
		-e "s/\($i.*\)\"+ /\1\" + /g";
done

Change-Id: Iaf8e641b0abf28c082906014f87a183517630535
Reviewed-on: https://gerrit.libreoffice.org/4624
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2013-06-29 21:52:54 +00:00
Jan Holesovsky
e2ba9b895b Better description of the sd unit tests creation.
Change-Id: I7d3ac7997f54f4cb3fc826601d89248ea42549f4
2013-06-21 13:14:06 +02:00
Felix Zhang
422ce23ea6 bnc#593612: font size: Unit test.
Change-Id: I3cda692b93f0e08c3e666e03b04966abaca00057
2013-06-21 10:06:54 +02:00
Jan Holesovsky
90197a2375 Unit test to avoid the regression...
...that appeared thanks to the bnc#819614 fix.

Thanks Fridrich for constructing the document!

Change-Id: I780f65ca436caee83094a8591dd9e36b33d921e8
2013-06-13 16:48:19 +02:00
Jan Holesovsky
b0f10dd326 Revert "bnc#819614: Fix runaway lines."
This reverts commit 5fe65c0c5e5a8d815d9d15ef192e7652726662e6.

Unfortunately this causes a regression elsewhere.

This also disables the unit test for this bug - will re-enable when I find
a fix that both fixes this, and does not regress other stuff :-)

Change-Id: Iad334e3c59c928edb78f25c0f36a33a26a7e6125
2013-06-13 16:22:51 +02:00
Julien Nabet
52a377585c Revert "Fix qa tests after "non-primitive" patch"
This reverts commit eaeaafbf20629e2e2eb111b71ddcc78ab81aec55.
I must recognize I don't understand why it doesn't work but since most of the tinderboxes are red...
2013-06-09 01:24:49 +02:00
Julien Nabet
eaeaafbf20 Fix qa tests after "non-primitive" patch
Change-Id: I438a1b09d74a87858b23046cc34995a9fbab396a
2013-06-08 23:15:48 +02:00
Caolán McNamara
88b8bd644e Resolves: #i119874 Fixed text alignment in RTL layout
This reverts commit 979def88090633bfee0e0445b19999a1dac71ed4,
this time manually confirmed that the import layout does change, but that it
appears to be all desirable changes

Change-Id: Iee5e5ebd16989f65569b02f8b4f6570985157dfc
2013-05-25 12:11:51 +01:00
Jan Holesovsky
47a208560f bnc#820786: Unit test for patterns / hatches.
Change-Id: I988439f8be9822c73d19c292da37e2cb102b1c78
2013-05-23 14:27:24 +02:00
Regina Henschel
d3dde5d940 Resolves: #i120642# expand target to maximum edge not to diagonal
(cherry picked from commit 2e1700bf4f7cf913c23d35f325a50d3aa25426cc)

Change-Id: Ic27fb3b18f42667419765a6adca41e1df27561c2
2013-05-19 20:07:33 +01:00
Armin Le Grand
042717e05e Resolves: #i116244# need to reset rotation...
This reverts commit f47ed987388e4df58ba74b9aca574a7d1fba396a.

update layout tests

Change-Id: I8a9daaa78acc98bf497241ebce856d5798b187f5
2013-05-18 17:51:04 +01:00
Thorsten Behrens
8230290c98 Add unit test for xml:id loading.
Guard against xml:id load breakage, that cause fdo#64512 and
fdo#60075. Both connector shape and animation references need it
to work.

Change-Id: I7883d1d27eae02f605c83217a2e1b83934b31483
2013-05-18 01:27:54 +02:00
Jan Holesovsky
2fcf944788 bnc#819614: Test for the runaway lines fix.
Change-Id: I60c072720392822eb5866310f3607271d72815b7
2013-05-16 04:57:15 +02:00
Jan Holesovsky
225b41088a XShapeDumper: Dump more values, to be able to test n#819614.
Change-Id: I19cbae855996bffb18206b9003e22a2bcc0c75d9
2013-05-16 04:57:15 +02:00
Jan Holesovsky
d84b22e9a8 sd unittests: Do not dump the font name, depends on installed fonts.
Change-Id: Id401feed7d629cbc0c24428b0c1273afdb31be89
2013-05-15 14:43:01 +02:00
Jan Holesovsky
826f28e64d sd unittests: Update XShapeDumper to dump also (some) font properties.
+ update the expected dumps together with that.

This allows testing of the other part (wrong text color and size, commit
55c63ccfd460895af22e91979967cec15d80b72d) of n#758621 too.

Change-Id: Ie93feb9d9d05eb4e11106bf9aa1f237947351b4e
2013-05-15 11:31:15 +02:00
Jan Holesovsky
1a357b7394 fdo#64586: Fix incorrect import non-empty placeholders + unit test.
Change-Id: Ibcb61dfa12c67fd9f93713ba7eb93f947b122f07
2013-05-15 09:43:07 +02:00
Jan Holesovsky
d97732f635 sd unittests: Fix the loading of .ppt tests, and introduce test for n#758621.
This also adds instructions how to easily add tests for which it is enough to
check the drawinglayer dump.

Change-Id: Ieaf261a9be0c8da2fa81c075dadebcac0c07def5
2013-05-14 16:50:48 +02:00
Jan Holesovsky
afdbd50992 sd unittests: Cleanup in filters-test.
Change-Id: I4dde07c4f796fa33b23cc3e67924270bb3e45ec1
2013-05-14 16:50:47 +02:00
Jan Holesovsky
7f33959d0b sd unittests: Move Autofit test to the import tests.
Change-Id: I6c49345fa518f19c942ff0fd7849c689d0cd5db6
2013-05-14 16:50:47 +02:00
Jan Holesovsky
39ee11db03 sd unittests: Move a smoketest where it belongs.
Change-Id: I495f8698f58a2a4a11999e8e439eddd6a703b321
2013-05-14 16:50:47 +02:00