https://issues.apache.org/ooo/show_bug.cgi?id=125549

          Issue ID: 125549
        Issue Type: DEFECT
           Summary: Table in ODT file generated by Office 2013 crushing
                    OpenOffice
           Product: Writer
           Version: 4.1.1
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: code
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 83910
  --> https://issues.apache.org/ooo/attachment.cgi?id=83910&action=edit
File causing a crush. Actual content were replaced as dots manually.

Two divided by 0 issues were spotted by the attached file:
main/sw/source/core/text/txtfly.cxx:631
           const sal_uLong i = nTmpWidth / nGridWidth + 1;

main/sw/source/core/layout/paintfrm.cxx:5242
                    SwTwips nX = aGrid.Left() + nGridWidth *
                        ( ( aInter.Left() - aGrid.Left() )/ nGridWidth );



Setting the following breakpoints condition and commands allows me to open the
file correctly.

break /home/mh/aoo/main/sw/source/core/text/txtfly.cxx:631
  condition $bpnum nGridWidth==0
  commands
    set nGridWidth=1
    continue
  end
break /home/mh/aoo/main/sw/source/core/layout/paintfrm.cxx:5242
  condition $bpnum nGridWidth==0
  commands
    set nGridWidth=1
    continue
  end

Maybe the macro GETGRIDWIDTH should return 1 as minimum value?

For reference:
grep -n -r nGridWidth * |grep -v .svn |grep ':.*/.*nGridWidth'
source/core/layout/paintfrm.cxx:5243:                        ( ( aInter.Left()
- aGrid.Left() )/ nGridWidth );
source/core/txtnode/fntcache.cxx:1017:            //const sal_uInt16 nGridWidth
= pGrid->GetBaseHeight();
source/core/txtnode/fntcache.cxx:1032:                                (
nWidthPerChar - 1 ) / nGridWidth + 1:
source/core/txtnode/fntcache.cxx:1951:                            (
nWidthPerChar - 1 ) / nGridWidth + 1:
source/core/txtnode/fntcache.cxx:2219:                      ( nWidthPerChar - 1
) / nGridWidth + 1:
source/core/txtnode/fntcache.cxx:2483:                            (
nWidthPerChar - 1 ) / nGridWidth + 1:
source/core/text/itrtxt.cxx:341:                //const sal_uInt16 nLineNetto =
( nPorHeight > nGridWidth ) ?
source/core/text/itrtxt.cxx:343:                 //                          
nGridWidth;
source/core/text/itrform2.cxx:541:                                ( ( nOfst - 1
) / nGridWidth + 1 ) :
source/core/text/itrform2.cxx:680:                                 ( nSumWidth
- 1 ) / nGridWidth + 1 :
source/core/text/txtfly.cxx:632:            const sal_uLong i = nTmpWidth /
nGridWidth + 1;

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

Reply via email to