[Libreoffice-commits] core.git: sc/source

David Tardon dtardon at redhat.com
Fri Jun 19 04:55:50 PDT 2015


 sc/source/core/data/table4.cxx |   45 +++++++++++++++++++++++++++--------------
 1 file changed, 30 insertions(+), 15 deletions(-)

New commits:
commit b12cd99fd46e81e710479e2530e80c75404f3443
Author: David Tardon <dtardon at redhat.com>
Date:   Fri Jun 19 13:52:49 2015 +0200

    rhbz#1233420 handle inexistent cond. format
    
    Change-Id: I3fbbd0f3b42a3be1c2a9c54eb8f35dd18f550b16

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index a1bc8ee5..bc8e40e 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -618,9 +618,12 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                                                         itr != itrEnd; ++itr)
                         {
                             ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr);
-                            ScRangeList aRange = pCondFormat->GetRange();
-                            aRange.Join(ScRange(nCol, nY1, nTab, nCol, nY2, nTab));
-                            pCondFormat->SetRange(aRange);
+                            if (pCondFormat)
+                            {
+                                ScRangeList aRange = pCondFormat->GetRange();
+                                aRange.Join(ScRange(nCol, nY1, nTab, nCol, nY2, nTab));
+                                pCondFormat->SetRange(aRange);
+                            }
                         }
                     }
 
@@ -648,9 +651,12 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                             itr != itrEnd; ++itr)
                     {
                         ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr);
-                        ScRangeList aRange = pCondFormat->GetRange();
-                        aRange.Join(ScRange(nCol, nRow, nTab, nCol, nRow, nTab));
-                        pCondFormat->SetRange(aRange);
+                        if (pCondFormat)
+                        {
+                            ScRangeList aRange = pCondFormat->GetRange();
+                            aRange.Join(ScRange(nCol, nRow, nTab, nCol, nRow, nTab));
+                            pCondFormat->SetRange(aRange);
+                        }
                     }
                 }
 
@@ -1568,9 +1574,12 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                             itr != itrEnd; ++itr)
                     {
                         ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr);
-                        ScRangeList aRange = pCondFormat->GetRange();
-                        aRange.Join(ScRange(nCol, nIMin, nTab, nCol, nIMax, nTab));
-                        pCondFormat->SetRange(aRange);
+                        if (pCondFormat)
+                        {
+                            ScRangeList aRange = pCondFormat->GetRange();
+                            aRange.Join(ScRange(nCol, nIMin, nTab, nCol, nIMax, nTab));
+                            pCondFormat->SetRange(aRange);
+                        }
                     }
                 }
                 else
@@ -1585,9 +1594,12 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                                     itr != itrEnd; ++itr)
                             {
                                 ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr);
-                                ScRangeList aRange = pCondFormat->GetRange();
-                                aRange.Join(ScRange(nCol, nAtRow, nTab, nCol, nAtRow, nTab));
-                                pCondFormat->SetRange(aRange);
+                                if (pCondFormat)
+                                {
+                                    ScRangeList aRange = pCondFormat->GetRange();
+                                    aRange.Join(ScRange(nCol, nAtRow, nTab, nCol, nAtRow, nTab));
+                                    pCondFormat->SetRange(aRange);
+                                }
                             }
                         }
                     }
@@ -1603,9 +1615,12 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                                 itr != itrEnd; ++itr)
                         {
                             ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr);
-                            ScRangeList aRange = pCondFormat->GetRange();
-                            aRange.Join(ScRange(nAtCol, static_cast<SCROW>(nRow), nTab, nAtCol, static_cast<SCROW>(nRow), nTab));
-                            pCondFormat->SetRange(aRange);
+                            if (pCondFormat)
+                            {
+                                ScRangeList aRange = pCondFormat->GetRange();
+                                aRange.Join(ScRange(nAtCol, static_cast<SCROW>(nRow), nTab, nAtCol, static_cast<SCROW>(nRow), nTab));
+                                pCondFormat->SetRange(aRange);
+                            }
                         }
                     }
         }


More information about the Libreoffice-commits mailing list