Kaydet (Commit) b37b299d authored tarafından Mike Kaganski's avatar Mike Kaganski

Fix CppunitTest_sc_stylefamilyobj

It is "ScStyleFamilyObj" element that is inserted in the ScStyleFamilyTestObj::init()
which is intended to be tormented in all thinkable ways in the tests; and its name
must be passed to all the different interface ctors here. Trying to remove "Default"
style is not something really expected to work.

In my testing on Windows, I experienced hung XNameContainer::testRemoveByName with
endless loop in SfxStyleSheetBase::SetParent, where it tried to set parent of Para
style "Status" to "Heading"; while iterating over "Heading" parents to check for
recursive linkages, it searched for its parent "Default", already removed at that
stage; that search gave another "Default" style of Page type; that makes
DoesStyleMatchStyleSheetPredicate from DoesStyleMatchStyleSheetPredicate to fail in
IndexedStyleSheets::FindPositionsByNameAndPredicate, which for some reason returns
the next stylesheet matching the predicate *with any name* - and that happens to be
"Footnote". When returned to SfxStyleSheetBase::SetParent, it then tried to test
its parent, which is "Text"; then tests its parent "Default" => endless loop.

Whether this is a problem in IndexedStyleSheets::FindPositionsByNameAndPredicate
that needs fixing or not, setting the test object name here to the object intended
for that fixes the never-finishing subsequenttests problem.

Change-Id: I9a36f5c8f399d5c9b863bf33426b15a4388747dc
Reviewed-on: https://gerrit.libreoffice.org/69225Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
Tested-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst adcf656b
......@@ -87,9 +87,9 @@ ScStyleFamilyObj::ScStyleFamilyObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
, XElementAccess(cppu::UnoType<style::XStyle>::get())
, XIndexAccess(19)
, XNameAccess("Default")
, XNameContainer("Default")
, XNameReplace("Default")
, XNameAccess("ScStyleFamilyObj")
, XNameContainer("ScStyleFamilyObj")
, XNameReplace("ScStyleFamilyObj")
, XServiceInfo("ScStyleFamilyObj", "com.sun.star.style.StyleFamily")
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment