Bug-Ubuntu: https://bugs.launchpad.net/allston/+bug/1105157
Applied-Upstream: http://cgit.freedesktop.org/libreoffice/core/commit/?id=7e3923520c27ff139bc3abab35a1c01e1a785fb1
From 7e3923520c27ff139bc3abab35a1c01e1a785fb1 Mon Sep 17 00:00:00 2001
From: CaolÃ¡n McNamara <caolanm@redhat.com>
Date: Thu, 05 Jul 2012 20:37:49 +0000
Subject: Resolves: fdo#49587 apparent loop in style hierarchy

Change-Id: I32317a1a6500377f7e7bb98d1dcc65ad86feb9a2
---
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 5c33f7b..a69e911 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -561,7 +561,14 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId)
             }
         }
         //search until the property is set or no parent is available
-        pEntry = GetStyleSheetTable()->FindParentStyleSheet(pEntry->sBaseStyleIdentifier);
+        StyleSheetEntryPtr pNewEntry = GetStyleSheetTable()->FindParentStyleSheet(pEntry->sBaseStyleIdentifier);
+
+        SAL_WARN_IF( pEntry == pNewEntry, "writerfilter", "circular loop in style hierarchy?");
+
+        if (pEntry == pNewEntry) //fdo#49587
+            break;
+
+        pEntry = pNewEntry;
     }
     return uno::Any();
 }
--
cgit v0.9.0.2-2-gbebe


