You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

block_text-align_2.xml 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <testcase>
  18. <info>
  19. <p>
  20. This test checks text-align and text-align-last in special conditions.
  21. </p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  25. <fo:layout-master-set>
  26. <fo:simple-page-master master-name="simple" page-height="10in" page-width="5in">
  27. <fo:region-body/>
  28. </fo:simple-page-master>
  29. </fo:layout-master-set>
  30. <fo:page-sequence master-reference="simple" id="bla1">
  31. <fo:flow flow-name="xsl-region-body">
  32. <fo:block text-align-last="justify">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</fo:block>
  33. <!-- The next block is pretty much like the previous but there is a linefeed that is converted to a space which is then
  34. removed by LineLM.removeElementsForTrailingSpaces(). There used to be a ClassCastException here. -->
  35. <fo:block text-align-last="justify" background-color="yellow">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  36. </fo:block>
  37. <fo:block text-align="justify">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </fo:block>
  38. </fo:flow>
  39. </fo:page-sequence>
  40. </fo:root>
  41. </fo>
  42. <checks>
  43. <!-- all three blocks must be identical -->
  44. <true xpath="not(boolean(//flow/block[1]/lineArea[1]/@start-indent))"/>
  45. <true xpath="not(boolean(//flow/block[2]/lineArea[1]/@start-indent))"/>
  46. <true xpath="not(boolean(//flow/block[3]/lineArea[1]/@start-indent))"/>
  47. <true xpath="//flow/block[1]/lineArea[1]/text/@ipd = //flow/block[2]/lineArea[1]/text/@ipd"/>
  48. <true xpath="//flow/block[1]/lineArea[1]/text/@ipd &gt; //flow/block[3]/lineArea[1]/text/@ipd"/>
  49. </checks>
  50. </testcase>