diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-03-13 19:27:10 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-03-13 22:10:57 +0100 |
commit | b37b299d5228beeecb913980780f463756c5a878 (patch) | |
tree | c993b0807e392270e57292ad9f641e671876a78e | |
parent | adcf656bb56e09fbb638a44b0cccc96f8cfced7f (diff) |
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/69225
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | sc/qa/extras/scstylefamilyobj.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/qa/extras/scstylefamilyobj.cxx b/sc/qa/extras/scstylefamilyobj.cxx index c2dfffd81491..aa49cb34580a 100644 --- a/sc/qa/extras/scstylefamilyobj.cxx +++ b/sc/qa/extras/scstylefamilyobj.cxx @@ -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") { } |