[Libreoffice-commits] .: Branch 'libreoffice-4-0' - 5 commits - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 17 15:10:05 PST 2012


 sc/source/core/data/conditio.cxx               |   36 +++++++++++++++----------
 sc/source/ui/condformat/condformatdlgentry.cxx |    4 ++
 sc/source/ui/condformat/condformathelper.cxx   |    4 ++
 sc/source/ui/inc/condformatdlg.hxx             |    2 -
 4 files changed, 32 insertions(+), 14 deletions(-)

New commits:
commit 313575bd0d307ab37b0f3ab0d2c47330d546eaa1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Dec 17 23:53:38 2012 +0100

    first check that the number of cells has not been reached yet, fdo#58346
    
    Change-Id: I0fea5719f524584acdbbc560c47b3c427c174845

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index e4d3d75..935ff48 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -865,10 +865,10 @@ bool ScConditionEntry::IsTopNElement( double nArg ) const
     for(ScConditionEntryCache::ValueCacheType::const_reverse_iterator itr = mpCache->maValues.rbegin(),
             itrEnd = mpCache->maValues.rend(); itr != itrEnd; ++itr)
     {
-        if(itr->first <= nArg)
-            return true;
         if(nCells >= nVal1)
             return false;
+        if(itr->first <= nArg)
+            return true;
         nCells += itr->second;
     }
 
@@ -886,10 +886,10 @@ bool ScConditionEntry::IsBottomNElement( double nArg ) const
     for(ScConditionEntryCache::ValueCacheType::const_iterator itr = mpCache->maValues.begin(),
             itrEnd = mpCache->maValues.end(); itr != itrEnd; ++itr)
     {
-        if(itr->first >= nArg)
-            return true;
         if(nCells >= nVal1)
             return false;
+        if(itr->first >= nArg)
+            return true;
         nCells += itr->second;
     }
 
@@ -905,10 +905,10 @@ bool ScConditionEntry::IsTopNPercent( double nArg ) const
     for(ScConditionEntryCache::ValueCacheType::const_reverse_iterator itr = mpCache->maValues.rbegin(),
             itrEnd = mpCache->maValues.rend(); itr != itrEnd; ++itr)
     {
-        if(itr->first <= nArg)
-            return true;
         if(nCells >= nLimitCells)
             return false;
+        if(itr->first <= nArg)
+            return true;
         nCells += itr->second;
     }
 
@@ -924,10 +924,10 @@ bool ScConditionEntry::IsBottomNPercent( double nArg ) const
     for(ScConditionEntryCache::ValueCacheType::const_iterator itr = mpCache->maValues.begin(),
             itrEnd = mpCache->maValues.end(); itr != itrEnd; ++itr)
     {
-        if(itr->first >= nArg)
-            return true;
         if(nCells >= nLimitCells)
             return false;
+        if(itr->first >= nArg)
+            return true;
         nCells += itr->second;
     }
 
commit 4d46369f128393441ca87945cb419fe1350d1feb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Dec 17 22:58:26 2012 +0100

    UI does not update correctly for icon sets, fdo#58308
    
    Change-Id: Iceeab1ea3624fbefa8cb626899262e857b445ac1

diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 36b8ddb..3fc1612 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1354,9 +1354,13 @@ IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl )
         Point aPos = maEntries[0].GetPosPixel();
         aPos.Y() += maEntries[0].GetSizePixel().Height() * i * 1.2;
         maEntries[i].SetPosPixel( aPos );
+        maEntries[i].Show();
     }
     maEntries.back().SetLastEntry();
 
+    SetHeight();
+    static_cast<ScCondFormatList*>(GetParent())->RecalcAll();
+
     return 0;
 }
 
diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx
index 588d04d..68651ff 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -78,7 +78,6 @@ private:
     ScAddress maPos;
     ScRangeList maRanges;
 
-    void RecalcAll();
     void DoScroll(long nDiff);
 
 public:
@@ -86,6 +85,7 @@ public:
             const ScRangeList& rRanges, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType);
 
     ScConditionalFormat* GetConditionalFormat() const;
+    void RecalcAll();
 
     DECL_LINK( AddBtnHdl, void* );
     DECL_LINK( RemoveBtnHdl, void* );
commit f2dac67df505f51e6341d29cd185f25323c75251
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Dec 17 22:57:35 2012 +0100

    workaround FORMULA is not part of the condition is in the UI
    
    Change-Id: I6c51ecfbddeeaed3f8747cde90996f7e236a0afd

diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx
index 67a175d..b594910 100644
--- a/sc/source/ui/condformat/condformathelper.cxx
+++ b/sc/source/ui/condformat/condformathelper.cxx
@@ -153,6 +153,10 @@ rtl::OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sa
     aBuffer.append(rtl::OUString(" "));
     if(eType == CONDITION)
     {
+        // workaround missing FORMULA option in the conditions case
+        // FORMULA is handled later
+        if(nIndex > 9)
+            ++nIndex;
         aBuffer.append(getExpression(nIndex));
         if(nIndex <= 7 || nIndex >= 19)
         {
commit c03d0664cfd060c0f9d706d574c15a396fb67a04
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Dec 17 21:41:22 2012 +0100

    fix the month date formats, related fdo#58340
    
    Change-Id: If9f716fd2d2f5a8488451121067ee068673b3b7a

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 7a2fc99..e4d3d75 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1705,7 +1705,12 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
             }
             break;
         case condformat::LASTMONTH:
-            if( rActDate.GetYear() == aCellDate.GetYear() )
+            if( rActDate.GetMonth() == 1 )
+            {
+                if( aCellDate.GetMonth() == 12 && rActDate.GetYear() == aCellDate.GetYear() + 1 )
+                    return true;
+            }
+            else if( rActDate.GetYear() == aCellDate.GetYear() )
             {
                 if( rActDate.GetMonth() == aCellDate.GetMonth() + 1)
                     return true;
@@ -1719,7 +1724,12 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
             }
             break;
         case condformat::NEXTMONTH:
-            if( rActDate.GetYear() == aCellDate.GetYear() )
+            if( rActDate.GetMonth() == 12 )
+            {
+                if( aCellDate.GetMonth() == 1 && rActDate.GetYear() == aCellDate.GetYear() - 1 )
+                    return true;
+            }
+            else if( rActDate.GetYear() == aCellDate.GetYear() )
             {
                 if( rActDate.GetMonth() == aCellDate.GetMonth() - 1)
                     return true;
commit fe0c61908011f3fee724d6466cd33e82b1c2944a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Dec 15 19:53:26 2012 +0100

    checking for the month is wrong, related fdo#58340
    
    Change-Id: I9920e8ad84da58f32a61a4bd864ea80b011ad746

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index c193607..7a2fc99 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1684,21 +1684,21 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
                 return true;
             break;
         case condformat::LASTWEEK:
-            if( rActDate.GetYear() == aCellDate.GetYear() && rActDate.GetMonth() == aCellDate.GetMonth() )
+            if( rActDate.GetYear() == aCellDate.GetYear() )
             {
                 if( rActDate.GetWeekOfYear( SUNDAY ) == aCellDate.GetWeekOfYear( SUNDAY ) + 1 )
                     return true;
             }
             break;
         case condformat::THISWEEK:
-            if( rActDate.GetYear() == aCellDate.GetYear() && rActDate.GetMonth() == aCellDate.GetMonth() )
+            if( rActDate.GetYear() == aCellDate.GetYear() )
             {
                 if( rActDate.GetWeekOfYear( SUNDAY ) == aCellDate.GetWeekOfYear( SUNDAY ) )
                     return true;
             }
             break;
         case condformat::NEXTWEEK:
-            if( rActDate.GetYear() == aCellDate.GetYear() && rActDate.GetMonth() == aCellDate.GetMonth() )
+            if( rActDate.GetYear() == aCellDate.GetYear() )
             {
                 if( rActDate.GetWeekOfYear( SUNDAY ) == aCellDate.GetWeekOfYear( SUNDAY ) - 1 )
                     return true;


More information about the Libreoffice-commits mailing list