[PATCH] Fixes fdo#55814 by reverting bb6bd1ff9

David Ostrovsky (via Code Review) gerrit at gerrit.libreoffice.org
Sat Mar 9 03:43:31 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2613

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/13/2613/1

Fixes fdo#55814 by reverting bb6bd1ff9

This commit revert bb6bd1ff9cd3eecec7eb2cd7bd0a4dcef584c903.
After reverting no crashes happen.

Change-Id: I45018618ed646db20b107251707e65c17068b073
---
M sw/source/core/doc/docfld.cxx
1 file changed, 1 insertion(+), 26 deletions(-)



diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 8c01695..be41983 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1277,15 +1277,6 @@
     SwNewDBMgr* pMgr = GetNewDBMgr();
     pMgr->CloseAll(sal_False);
 
-    // Make sure we don't hide all sections, which would lead to a crash. First, count how many of them do we have.
-    int nShownSections = 0;
-    for( _SetGetExpFlds::const_iterator it = mpUpdtFlds->GetSortLst()->begin(); it != mpUpdtFlds->GetSortLst()->end(); ++it )
-    {
-        SwSection* pSect = (SwSection*)(*it)->GetSection();
-        if ( pSect && !pSect->IsCondHidden())
-            nShownSections++;
-    }
-
     String aNew;
     for( _SetGetExpFlds::const_iterator it = mpUpdtFlds->GetSortLst()->begin(); it != mpUpdtFlds->GetSortLst()->end(); ++it )
     {
@@ -1296,23 +1287,7 @@
             SwSbxValue aValue = aCalc.Calculate(
                                         pSect->GetCondition() );
             if(!aValue.IsVoidValue())
-            {
-                // Do we want to hide this one?
-                bool bHide = aValue.GetBool();
-                if (bHide && !pSect->IsCondHidden())
-                {
-                    // This section will be hidden, but it wasn't before
-                    if (nShownSections == 1)
-                    {
-                        // This would be the last section, so set its condition to false, and avoid hiding it.
-                        OUString aCond("0");
-                        pSect->SetCondition(aCond);
-                        bHide = false;
-                    }
-                    nShownSections--;
-                }
-                pSect->SetCondHidden( bHide );
-            }
+                pSect->SetCondHidden( aValue.GetBool() );
             continue;
         }
 

-- 
To view, visit https://gerrit.libreoffice.org/2613
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I45018618ed646db20b107251707e65c17068b073
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: David Ostrovsky <David.Ostrovsky at gmx.de>



More information about the LibreOffice mailing list