<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id: table_row-span_missing-cell_bug43633.xml 627324 2008-02-13 09:35:01Z maxberger $ -->
<testcase>
  <info>
    <p>
      Check for bug #43633: the second row of the table has only a spanning cell, and the second
      cell is missing. This was leading to the spanning cell overlapping cell 1.1, because no
      offset was recorded for the second row.
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="normal" page-width="20cm" page-height="15cm" margin="20pt">
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="normal">
        <fo:flow flow-name="xsl-region-body">
          <fo:block>Before the table</fo:block>

          <fo:table table-layout="fixed" width="200pt" border="1pt solid black"
            border-collapse="separate">
            <fo:table-column column-width="proportional-column-width(1)"
              number-columns-repeated="2"/>
            <fo:table-body>
              <fo:table-row>
                <fo:table-cell border="1pt solid black" background-color="#FFC0C0">
                  <fo:block>Cell 1.1</fo:block>
                  <fo:block>Cell 1.1</fo:block>
                </fo:table-cell>
                <fo:table-cell border="1pt solid black" background-color="#FFC0C0">
                  <fo:block>Cell 1.2</fo:block>
                </fo:table-cell>
              </fo:table-row>
              <fo:table-row>
                <fo:table-cell border="1pt solid black" background-color="#C0C0FF"
                  number-rows-spanned="2">
                  <fo:block>Cell 2.1</fo:block>
                  <fo:block>Cell 2.1</fo:block>
                </fo:table-cell>
              </fo:table-row>
              <fo:table-row>
                <fo:table-cell border="1pt solid black" background-color="#C0C0FF">
                  <fo:block>Cell 3.2</fo:block>
                </fo:table-cell>
              </fo:table-row>
            </fo:table-body>
          </fo:table>
          <fo:block>After the table</fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks>

    <!-- cell 1.1 -->
    <eval expected="" xpath="//flow/block[2]/block[1]/@top-offset"/>
    <eval expected="1000" xpath="//flow/block[2]/block[1]/@left-offset"/>
    <eval expected="28800" xpath="//flow/block[2]/block[1]/@bpd"/>
    <eval expected="30800" xpath="//flow/block[2]/block[1]/@bpda"/>
    <!-- cell 1.2 -->
    <eval expected="" xpath="//flow/block[2]/block[2]/@top-offset"/>
    <eval expected="101000" xpath="//flow/block[2]/block[2]/@left-offset"/>
    <eval expected="28800" xpath="//flow/block[2]/block[2]/@bpd"/>
    <eval expected="30800" xpath="//flow/block[2]/block[2]/@bpda"/>

    <!-- cell 2.1 -->
    <eval expected="30800" xpath="//flow/block[2]/block[3]/@top-offset"/>
    <eval expected="1000" xpath="//flow/block[2]/block[3]/@left-offset"/>
    <eval expected="28800" xpath="//flow/block[2]/block[3]/@bpd"/>
    <eval expected="30800" xpath="//flow/block[2]/block[3]/@bpda"/>
    <!-- cell 3.2 -->
    <eval expected="30800" xpath="//flow/block[2]/block[4]/@top-offset"/>
    <eval expected="101000" xpath="//flow/block[2]/block[4]/@left-offset"/>
    <eval expected="28800" xpath="//flow/block[2]/block[4]/@bpd"/>
    <eval expected="30800" xpath="//flow/block[2]/block[4]/@bpda"/>

  </checks>
</testcase>
