You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2023/01/02 19:10:13 UTC

[Issue 96958] Problem in importing big HTML files in Writer 3.0

https://bz.apache.org/ooo/show_bug.cgi?id=96958

damjan@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |damjan@apache.org

--- Comment #8 from damjan@apache.org ---
Calc opens the file perfectly, but Writer hangs in an infinite loop. Attaching
a debugger and backtracing a few times, I saw it's often running code in this
function from main/sw/source/core/doc/docbm.cxx:

---snip---
::rtl::OUString MarkManager::getUniqueMarkName(const ::rtl::OUString& rName)
const
{
    OSL_ENSURE(rName.getLength(),
        "<MarkManager::getUniqueMarkName(..)> - a name should be proposed");
    if ( findMark(rName) == getAllMarksEnd() )
    {
        return rName;
    }

    ::rtl::OUStringBuffer sBuf;
    ::rtl::OUString sTmp;
    for(sal_Int32 nCnt = 1; nCnt < SAL_MAX_INT32; nCnt++)
    {
        sTmp = sBuf.append(rName).append(nCnt).makeStringAndClear();
        if ( findMark(sTmp) == getAllMarksEnd() )
        {
            break;
        }
    }
    return sTmp;
}
---snip---

That "for" loop has a limit of SAL_MAX_INT32 (over 2 billion), and the
condition that would cause it to "break" seems to never be met, thus it just
spins there.

Putting a breakpoint on that "if" statement within the "for" loop and printing
the contents of "sTmp" on each loop run, I get:

__tmpTD1547
__tmpTD1548
__tmpTD1549
...

and the "break" is never reached.

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.