svx/source/svdraw/svdobj.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit d6116e6bdb305e4b345bf35bbd80da9a171dc847
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Nov 11 15:55:56 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Nov 12 09:24:23 2024 +0100

    tdf#163486: PVS: simplify while loop
    
    V654    The condition of loop is always true.
    
    Change-Id: I9c7cc133cf197e899ac7e13ee3cedc97b7c4d0be
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176406
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 255dc4018075..fabc748c1975 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1835,13 +1835,11 @@ void 
SdrObject::SetOutlinerParaObject(std::optional<OutlinerParaObject> pTextObj
 
     // Don't do this during import.
     SdrObject* pTopGroupObj = nullptr;
-    if (getParentSdrObjectFromSdrObject())
+    SdrObject* pParent = getParentSdrObjectFromSdrObject();
+    while(pParent)
     {
-        pTopGroupObj = getParentSdrObjectFromSdrObject();
-        while (pTopGroupObj->getParentSdrObjectFromSdrObject())
-        {
-            pTopGroupObj = pTopGroupObj->getParentSdrObjectFromSdrObject();
-        }
+        pTopGroupObj = pParent;
+        pParent = pTopGroupObj->getParentSdrObjectFromSdrObject();
     }
     if (pTopGroupObj)
     {

Reply via email to