[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 39 commits - officecfg/registry sc/AllLangResTarget_sc.mk sc/inc sc/Library_sc.mk sc/Library_scui.mk sc/sdi sc/source sc/uiconfig

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Jun 15 07:32:37 PDT 2012


 officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu |    7 
 sc/AllLangResTarget_sc.mk                                         |    3 
 sc/Library_sc.mk                                                  |    1 
 sc/Library_scui.mk                                                |    2 
 sc/inc/colorscale.hxx                                             |   85 
 sc/inc/conditio.hxx                                               |   91 
 sc/inc/document.hxx                                               |   12 
 sc/inc/sc.hrc                                                     |   36 
 sc/inc/scabstdlg.hxx                                              |   17 
 sc/inc/sccommands.h                                               |    3 
 sc/inc/table.hxx                                                  |   12 
 sc/sdi/cellsh.sdi                                                 |    5 
 sc/sdi/scalc.sdi                                                  |   39 
 sc/source/core/data/attarray.cxx                                  |   25 
 sc/source/core/data/colorscale.cxx                                |  210 -
 sc/source/core/data/conditio.cxx                                  |  480 ++--
 sc/source/core/data/documen4.cxx                                  |   52 
 sc/source/core/data/documen7.cxx                                  |   17 
 sc/source/core/data/fillinfo.cxx                                  |   39 
 sc/source/core/data/table1.cxx                                    |   30 
 sc/source/core/data/table2.cxx                                    |   76 
 sc/source/filter/excel/xecontent.cxx                              |   21 
 sc/source/filter/excel/xestyle.cxx                                |    9 
 sc/source/filter/excel/xicontent.cxx                              |    6 
 sc/source/filter/inc/condformatbuffer.hxx                         |    8 
 sc/source/filter/oox/condformatbuffer.cxx                         |  128 -
 sc/source/filter/xml/XMLConverter.cxx                             |   32 
 sc/source/filter/xml/XMLConverter.hxx                             |    2 
 sc/source/filter/xml/xmlcondformat.cxx                            |  170 +
 sc/source/filter/xml/xmlcondformat.hxx                            |   15 
 sc/source/filter/xml/xmlexprt.cxx                                 |  232 +-
 sc/source/filter/xml/xmlimprt.cxx                                 |   24 
 sc/source/filter/xml/xmlimprt.hxx                                 |   16 
 sc/source/filter/xml/xmlstyli.cxx                                 |    2 
 sc/source/ui/app/scdll.cxx                                        |    1 
 sc/source/ui/attrdlg/condfrmt.cxx                                 | 1039 ---------
 sc/source/ui/attrdlg/scdlgfact.cxx                                |   44 
 sc/source/ui/attrdlg/scdlgfact.hxx                                |   19 
 sc/source/ui/condformat/colorformat.cxx                           |  384 +++
 sc/source/ui/condformat/condformatdlg.cxx                         | 1096 ++++++++++
 sc/source/ui/docshell/docfunc.cxx                                 |   23 
 sc/source/ui/inc/colorformat.hrc                                  |   55 
 sc/source/ui/inc/colorformat.hxx                                  |   80 
 sc/source/ui/inc/condformatdlg.hrc                                |   57 
 sc/source/ui/inc/condformatdlg.hxx                                |  198 +
 sc/source/ui/inc/condfrmt.hrc                                     |   85 
 sc/source/ui/inc/condfrmt.hxx                                     |  179 -
 sc/source/ui/inc/docfunc.hxx                                      |    7 
 sc/source/ui/inc/reffact.hxx                                      |    1 
 sc/source/ui/src/colorformat.src                                  |  178 +
 sc/source/ui/src/condformatdlg.src                                |  226 ++
 sc/source/ui/src/condfrmt.src                                     |  442 ----
 sc/source/ui/unoobj/cellsuno.cxx                                  |    9 
 sc/source/ui/unoobj/fmtuno.cxx                                    |   49 
 sc/source/ui/view/cellsh.cxx                                      |   14 
 sc/source/ui/view/cellsh1.cxx                                     |   70 
 sc/source/ui/view/cellsh3.cxx                                     |   10 
 sc/source/ui/view/reffact.cxx                                     |    7 
 sc/source/ui/view/tabview3.cxx                                    |    1 
 sc/source/ui/view/tabvwsh.cxx                                     |    1 
 sc/source/ui/view/tabvwshc.cxx                                    |   15 
 sc/source/ui/view/viewfun2.cxx                                    |    2 
 sc/source/ui/view/viewfunc.cxx                                    |    8 
 sc/uiconfig/scalc/menubar/menubar.xml                             |    6 
 64 files changed, 3423 insertions(+), 2790 deletions(-)

New commits:
commit bce9545d379db6544fa9837eff561f97162ace9f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 12 06:36:34 2012 +0000

    -Werror,-Wmismatched-tags
    
    Change-Id: If2b4118481dd265a81641d5cdf14f5095b8064e9
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index c68875f..2938ca7 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -70,7 +70,7 @@ enum ScConditionMode
 };
 
 class ScConditionalFormat;
-class ScDataBarInfo;
+struct ScDataBarInfo;
 
 namespace condformat
 {
commit 12f4a7ed1448199158bf6ab938fdeca81a66f5d6
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 12 20:00:40 2012 +0000

    -Werror,-Wunused-function
    
    Change-Id: I1b12a923e8c045c7ebca8c0b77b8135d3e072ac9
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index a3a9d39..b0930bb 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -726,36 +726,6 @@ ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListB
     return pEntry;
 }
 
-void GetDataBarType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry )
-{
-    double nVal = 0;
-    switch(rLstBox.GetSelectEntryPos())
-    {
-        case 0:
-            pEntry->SetMin(true);
-            break;
-        case 1:
-            pEntry->SetMax(true);
-            break;
-        case 2:
-            pEntry->SetPercentile(true);
-            nVal = rtl::math::stringToDouble(rEd.GetText(), '.', ',');
-            pEntry->SetValue(nVal);
-            break;
-        case 3:
-            nVal = rtl::math::stringToDouble(rEd.GetText(), '.', ',');
-            pEntry->SetPercent(true);
-            pEntry->SetValue(nVal);
-            break;
-        case 4:
-            nVal = rtl::math::stringToDouble(rEd.GetText(), '.', ',');
-            pEntry->SetValue(nVal);
-            break;
-        case 5:
-            break;
-    }
-}
-
 }
 
 ScFormatEntry* ScCondFrmtEntry::createColorscaleEntry() const
commit 0f68789b08f55fa46ee46d8a035fb5a387fb21a0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jun 15 04:43:32 2012 +0000

    disable two ui elements for 3.6
    
    Change-Id: I55c8932fb5561704626f73e044091fe7b5240229
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 311726c..a3a9d39 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -550,7 +550,8 @@ void ScCondFrmtEntry::SetColorScaleType()
     {
         maEdMiddle.Hide();
         maLbEntryTypeMiddle.Hide();
-        maLbColScale2.Show();
+        // TODO: enale for 3.7 again with good presets
+        //maLbColScale2.Show();
         maLbColScale3.Hide();
         maLbColMiddle.Hide();
     }
@@ -559,7 +560,8 @@ void ScCondFrmtEntry::SetColorScaleType()
         maEdMiddle.Show();
         maLbEntryTypeMiddle.Show();
         maLbColScale2.Hide();
-        maLbColScale3.Show();
+        // TODO: enale for 3.7 again with good presets
+        // maLbColScale3.Show();
         maLbColMiddle.Show();
     }
     maLbEntryTypeMin.Show();
commit eeab3d64fa61d8deeb256145fc37649bf38eb938
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Jun 14 07:03:22 2012 +0000

    handle formula is in new conditional format dlg
    
    Change-Id: Ia492b8fb9ad1406800ba855370daafb40f254093
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 81a681b..311726c 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -219,6 +219,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm
         ScConditionMode eMode = pEntry->GetOperation();
         maLbType.SelectEntryPos(1);
         maEdVal1.SetText(pEntry->GetExpression(maPos, 0));
+        SetCondType();
         switch(eMode)
         {
             case SC_COND_EQUAL:
@@ -255,12 +256,11 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm
                 break;
             case SC_COND_DIRECT:
                 maLbType.SelectEntryPos(2);
+                SwitchToType(FORMULA);
                 break;
             case SC_COND_NONE:
                 break;
         }
-        SwitchToType(CONDITION);
-        SetCondType();
     }
     else if( pFormatEntry && pFormatEntry->GetType() == condformat::COLORSCALE )
     {
@@ -400,6 +400,8 @@ rtl::OUString getTextForType(ScCondFormatEntryType eType)
             return rtl::OUString("Color scale");
         case DATABAR:
             return rtl::OUString("Data Bar");
+        case FORMULA:
+            return rtl::OUString("Formula is");
         default:
             break;
     }
@@ -517,6 +519,7 @@ void ScCondFrmtEntry::SetHeight()
         switch (meType)
         {
             case CONDITION:
+            case FORMULA:
                 aSize.Height() = 120;
                 break;
             case COLORSCALE:
@@ -591,6 +594,18 @@ void ScCondFrmtEntry::SetDataBarType()
     maBtOptions.Show();
 }
 
+void ScCondFrmtEntry::SetFormulaType()
+{
+    SwitchToType(FORMULA);
+    HideColorScaleElements();
+    HideDataBarElements();
+    maEdVal1.Show();
+    maEdVal2.Hide();
+    maLbCondType.Hide();
+    maLbStyle.Show();
+    maWdPreview.Show();
+}
+
 void ScCondFrmtEntry::Select()
 {
     SetControlForeground(Color(COL_RED));
@@ -760,6 +775,18 @@ ScFormatEntry* ScCondFrmtEntry::createDatabarEntry() const
     return pDataBar;
 }
 
+ScFormatEntry* ScCondFrmtEntry::createFormulaEntry() const
+{
+    ScConditionMode eMode = SC_COND_DIRECT;
+    rtl::OUString aFormula = maEdVal1.GetText();
+    if(aFormula.isEmpty())
+        return NULL;
+
+    rtl::OUString aExpr2;
+    ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aFormula, aExpr2, mpDoc, maPos, maLbStyle.GetSelectEntry());
+    return pEntry;
+}
+
 ScFormatEntry* ScCondFrmtEntry::GetEntry() const
 {
     switch(meType)
@@ -773,6 +800,9 @@ ScFormatEntry* ScCondFrmtEntry::GetEntry() const
         case DATABAR:
             return createDatabarEntry();
             break;
+        case FORMULA:
+            return createFormulaEntry();
+            break;
         default:
             break;
     }
@@ -794,7 +824,7 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, TypeListHdl)
                 SetDataBarType();
             break;
         case 2:
-            SetCondType();
+            SetFormulaType();
             break;
         default:
             break;
diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx
index e66c090..2794cfd 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -51,6 +51,7 @@ enum ScCondFormatEntryType
     CONDITION,
     COLORSCALE,
     DATABAR,
+    FORMULA,
     COLLAPSED
 };
 
@@ -107,6 +108,7 @@ private:
     void SetCondType();
     void SetColorScaleType();
     void SetDataBarType();
+    void SetFormulaType();
     void HideCondElements();
     void HideColorScaleElements();
     void HideDataBarElements();
@@ -117,6 +119,7 @@ private:
     ScFormatEntry* createConditionEntry() const;
     ScFormatEntry* createColorscaleEntry() const;
     ScFormatEntry* createDatabarEntry() const;
+    ScFormatEntry* createFormulaEntry() const;
 
     ScDocument* mpDoc;
     ScAddress maPos;
commit 6be6590b2ae5cd289912443a3ea862495351cac7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Jun 12 05:48:41 2012 +0000

    small improvements to data bar dialog
    
    Change-Id: I7eada5e24047d36c1625aa082ecc9e5d52f785ae
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index 8e9c377..72349dc 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -80,6 +80,8 @@ public:
     void SetMax(bool bMax);
     void SetPercent(bool bPercent);
     void SetPercentile(bool bPercentile);
+
+    void SetHasValue();
 };
 
 namespace databar
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index e6a5c8d..c677397 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -242,6 +242,15 @@ void ScColorScaleEntry::SetPercentile(bool bPercentile)
     mbPercentile = bPercentile;
 }
 
+void ScColorScaleEntry::SetHasValue()
+{
+    mbPercentile = false;
+    mbPercent = false;
+    mbMin = false;
+    mbMax = false;
+    mpCell.reset();
+}
+
 namespace {
 
 double getMinValue(const ScRange& rRange, ScDocument* pDoc)
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index de45815..2483364 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -105,12 +105,12 @@ void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry
             pEntry->SetValue(nVal);
             break;
         case 4:
-            //FIXME
-            break;
-        case 5:
             nVal = rtl::math::stringToDouble(rEd.GetText(), '.', ',');
+            pEntry->SetHasValue();
             pEntry->SetValue(nVal);
             break;
+        case 5:
+            break;
     }
 }
 
@@ -146,7 +146,8 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarForma
     maLbTypeMax( this, ScResId( LB_TYPE ) ),
     maLbAxisPos( this, ScResId( LB_AXIS_POSITION ) ),
     maEdMin( this, ScResId( ED_MIN ) ),
-    maEdMax( this, ScResId( ED_MAX ) )
+    maEdMax( this, ScResId( ED_MAX ) ),
+    maStrWarnSameValue( SC_RESSTR( STR_WARN_SAME_VALUE ) )
 {
     Init();
     FreeResource();
@@ -171,6 +172,8 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarForma
     ::SetType(rData.mpUpperLimit.get(), maLbTypeMax);
     SetValue(rData.mpLowerLimit.get(), maEdMin);
     SetValue(rData.mpUpperLimit.get(), maEdMax);
+
+    TypeSelectHdl(NULL);
 }
 
 ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDataBarFormat* pFormat):
@@ -193,7 +196,8 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDataBarFormat* pFo
     maLbTypeMax( this, ScResId( LB_TYPE ) ),
     maLbAxisPos( this, ScResId( LB_AXIS_POSITION ) ),
     maEdMin( this, ScResId( ED_MIN ) ),
-    maEdMax( this, ScResId( ED_MAX ) )
+    maEdMax( this, ScResId( ED_MAX ) ),
+    maStrWarnSameValue( SC_RESSTR( STR_WARN_SAME_VALUE ) )
 {
     Init();
     FreeResource();
@@ -265,6 +269,10 @@ void ScDataBarSettingsDlg::Init()
     Point aPoint = maLbTypeMax.GetPosPixel();
     aPoint.Y() += 50;
     maLbTypeMax.SetPosPixel(aPoint);
+
+    maLbTypeMin.SetSelectHdl( LINK( this, ScDataBarSettingsDlg, TypeSelectHdl ) );
+    maLbTypeMax.SetSelectHdl( LINK( this, ScDataBarSettingsDlg, TypeSelectHdl ) );
+
 }
 
 namespace {
@@ -329,6 +337,8 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl )
     if(bWarn)
     {
         //show warning message and don't close
+        WarningBox aWarn(this, WB_OK, maStrWarnSameValue );
+        aWarn.Execute();
     }
     else
     {
@@ -337,4 +347,38 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl )
     return 0;
 }
 
+IMPL_LINK_NOARG( ScDataBarSettingsDlg, TypeSelectHdl )
+{
+    sal_Int32 nSelectMin = maLbTypeMin.GetSelectEntryPos();
+    if( nSelectMin == 0 || nSelectMin == 1)
+        maEdMin.Disable();
+    else
+    {
+        maEdMin.Enable();
+        if(!maEdMin.GetText().Len())
+        {
+            if(nSelectMin == 2 || nSelectMin == 3)
+                maEdMin.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(50)));
+            else
+                maEdMin.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(0)));
+        }
+    }
+
+    sal_Int32 nSelectMax = maLbTypeMax.GetSelectEntryPos();
+    if(nSelectMax == 0 || nSelectMax == 1)
+        maEdMax.Disable();
+    else
+    {
+        maEdMax.Enable();
+        if(!maEdMax.GetText().Len())
+        {
+            if(nSelectMax == 2 || nSelectMax == 3)
+                maEdMax.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(50)));
+            else
+                maEdMax.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(0)));
+        }
+    }
+    return 0;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 54d5ba1..81a681b 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -685,6 +685,7 @@ void SetColorScaleEntry( ScColorScaleEntry* pEntry, const ListBox& rType, const
             break;
         case 3:
             pEntry->SetValue(nVal);
+            pEntry->SetHasValue();
             break;
         case 4:
             pEntry->SetPercent(true);
@@ -693,6 +694,8 @@ void SetColorScaleEntry( ScColorScaleEntry* pEntry, const ListBox& rType, const
         case 5:
             pEntry->SetFormula(rValue.GetText(), pDoc, rPos);
             break;
+        default:
+            break;
     }
 }
 
@@ -706,6 +709,36 @@ ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListB
     return pEntry;
 }
 
+void GetDataBarType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry )
+{
+    double nVal = 0;
+    switch(rLstBox.GetSelectEntryPos())
+    {
+        case 0:
+            pEntry->SetMin(true);
+            break;
+        case 1:
+            pEntry->SetMax(true);
+            break;
+        case 2:
+            pEntry->SetPercentile(true);
+            nVal = rtl::math::stringToDouble(rEd.GetText(), '.', ',');
+            pEntry->SetValue(nVal);
+            break;
+        case 3:
+            nVal = rtl::math::stringToDouble(rEd.GetText(), '.', ',');
+            pEntry->SetPercent(true);
+            pEntry->SetValue(nVal);
+            break;
+        case 4:
+            nVal = rtl::math::stringToDouble(rEd.GetText(), '.', ',');
+            pEntry->SetValue(nVal);
+            break;
+        case 5:
+            break;
+    }
+}
+
 }
 
 ScFormatEntry* ScCondFrmtEntry::createColorscaleEntry() const
@@ -720,6 +753,8 @@ ScFormatEntry* ScCondFrmtEntry::createColorscaleEntry() const
 
 ScFormatEntry* ScCondFrmtEntry::createDatabarEntry() const
 {
+    SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos);
+    SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos);
     ScDataBarFormat* pDataBar = new ScDataBarFormat(mpDoc);
     pDataBar->SetDataBarData(new ScDataBarFormatData(*mpDataBarData.get()));
     return pDataBar;
@@ -862,6 +897,7 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, OptionBtnHdl )
         mpDataBarData.reset(pDlg->GetData());
         SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin);
         SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax);
+        DataBarTypeSelectHdl(NULL);
     }
     return 0;
 }
diff --git a/sc/source/ui/inc/colorformat.hrc b/sc/source/ui/inc/colorformat.hrc
index fc27609..140cd16 100644
--- a/sc/source/ui/inc/colorformat.hrc
+++ b/sc/source/ui/inc/colorformat.hrc
@@ -50,4 +50,6 @@
 #define ED_MIN 24
 #define ED_MAX 25
 
+#define STR_WARN_SAME_VALUE 26
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx
index 4fe44f9..c85eec5 100644
--- a/sc/source/ui/inc/colorformat.hxx
+++ b/sc/source/ui/inc/colorformat.hxx
@@ -62,7 +62,10 @@ private:
     Edit maEdMin;
     Edit maEdMax;
 
+    rtl::OUString maStrWarnSameValue;
+
     DECL_LINK(OkBtnHdl, void*);
+    DECL_LINK(TypeSelectHdl, void*);
 
     void Init();
 
diff --git a/sc/source/ui/src/colorformat.src b/sc/source/ui/src/colorformat.src
index 18cd823..66ae20e 100644
--- a/sc/source/ui/src/colorformat.src
+++ b/sc/source/ui/src/colorformat.src
@@ -136,8 +136,8 @@ ModalDialog RID_SCDLG_DATABAR
         {
             "Minimum";
             "Maximum";
-            "Percent";
             "Percentile";
+            "Percent";
             "Value";
             "Formula";
         };
@@ -169,6 +169,10 @@ ModalDialog RID_SCDLG_DATABAR
         TabStop = TRUE;
         Border = TRUE;
     };
+    String STR_WARN_SAME_VALUE
+    {
+        Text [ en-US ] = "Min value must be smaller than max value!";
+    };
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7654a4f7252148d8043bc2447ee3f005d4f04a95
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Jun 12 03:25:28 2012 +0000

    seems like windows does not like that
    
    Change-Id: I3c694af4554f984274e179739475077c46db4028
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index e93d5b6..8e9c377 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -85,7 +85,7 @@ public:
 namespace databar
 {
 
-enum SC_DLLPUBLIC ScAxisPostion
+enum ScAxisPostion
 {
     NONE,
     AUTOMATIC,
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index bc958da..54d5ba1 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -870,7 +870,6 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, ConditionTypeSelectHdl )
 {
     if(maLbCondType.GetSelectEntryPos() == 6 || maLbCondType.GetSelectEntryPos() == 7)
     {
-        std::cout << "OldSize: " << maEdVal1.GetSizePixel().Width() << " " << maEdVal1.GetSizePixel().Height() << std::endl;
         maEdVal1.SetSizePixel(maEdVal2.GetSizePixel());
         maEdVal2.Show();
     }
commit 87cd7da8fb3f27fd04347be373d1dad9f085dad7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Jun 12 02:45:51 2012 +0000

    make new conditional format menu appear
    
    Change-Id: I720037b7759a64d99cd08cf44ce9ae26b8f21873
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index 80f6c86..5bf1ec3 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -444,16 +444,6 @@
                     <value xml:lang="en-US">C~onditional Formatting</value>
                 </prop>
             </node>
-            <node oor:name=".uno:DataBarDialog" oor:op="replace">
-                <prop oor:name="Label" oor:type="xs:string">
-                    <value xml:lang="en-US">Data Bar...</value>
-                </prop>
-            </node>
-            <node oor:name=".uno:ColorScaleDialog" oor:op="replace">
-                <prop oor:name="Label" oor:type="xs:string">
-                    <value xml:lang="en-US">Color Scale...</value>
-                </prop>
-            </node>
             <node oor:name=".uno:ConditionalFormatDialog" oor:op="replace">
                 <prop oor:name="Label" oor:type="xs:string">
                     <value xml:lang="en-US">Conditional Formatting...</value>
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index e09ea16..e2949d4 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1229,14 +1229,13 @@
 #define RID_SCDLG_TEXT_IMPORT_OPTIONS   (SC_DIALOGS_START + 152)
 #define RID_POPUP_FILTER                (SC_DIALOGS_START + 153)
 #define RID_SCDLG_TAB_BG_COLOR          (SC_DIALOGS_START + 154)
-#define RID_SCDLG_FORMULA_CALCOPTIONS   (SC_DIALOGS_START + 155)
-#define RID_SCPAGE_SORTKEY_FIELDS       (SC_DIALOGS_START + 156)
-#define RID_SCDLG_SORTKEY               (SC_DIALOGS_START + 157)
-#define RID_SCDLG_COLORSCALE            (SC_DIALOGS_START + 158)
-#define RID_SCDLG_DATABAR               (SC_DIALOGS_START + 159)
-#define RID_COND_ENTRY                  (SC_DIALOGS_START + 160)
-
-#define SC_DIALOGS_END                  (SC_DIALOGS_START + 161)
+#define RID_SCDLG_DATABAR               (SC_DIALOGS_START + 155)
+#define RID_COND_ENTRY                  (SC_DIALOGS_START + 156)
+#define RID_SCDLG_FORMULA_CALCOPTIONS   (SC_DIALOGS_START + 157)
+#define RID_SCPAGE_SORTKEY_FIELDS       (SC_DIALOGS_START + 158)
+#define RID_SCDLG_SORTKEY               (SC_DIALOGS_START + 159)
+
+#define SC_DIALOGS_END                  (SC_DIALOGS_START + 160)
 
 #ifndef STD_MASKCOLOR
 #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index fbea1b9..af9f701 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -261,7 +261,7 @@
             <menu:menuitem menu:id=".uno:AutoFormat"/>
             <menu:menu menu:id=".uno:ConditionalFormatMenu">
 	          <menu:menupopup>
-	            <menu:menuitem menu:id="uno:ConditionalFormatDialog"/>
+	            <menu:menuitem menu:id=".uno:ConditionalFormatDialog"/>
 	          </menu:menupopup>
 	        </menu:menu>
             <menu:menuseparator/>
commit 7ce625965ee7a044c03c6c4900dc5aa71eeded2b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jun 11 21:12:04 2012 +0000

    need to export all symbols for color formats
    
    Change-Id: I18209f594ac6aa9ba03081342532e37a7b686571
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index 56e653e..e93d5b6 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -85,7 +85,7 @@ public:
 namespace databar
 {
 
-enum ScAxisPostion
+enum SC_DLLPUBLIC ScAxisPostion
 {
     NONE,
     AUTOMATIC,
@@ -94,7 +94,7 @@ enum ScAxisPostion
 
 }
 
-struct ScDataBarFormatData
+struct SC_DLLPUBLIC ScDataBarFormatData
 {
     ScDataBarFormatData():
         mbGradient(true),
commit a9d6a5610263f21522a2446b730945f08078ff0a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jun 11 07:29:52 2012 +0000

    replace tabs with spaces
    
    Change-Id: If93a7f9e7dcebed887e31c8a4bd454b7f709ba33
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index fdfdb1a..bc958da 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -59,28 +59,28 @@ namespace {
 void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Edit& rEdit, ColorListBox& rLbCol )
 {
     if(rEntry.GetMin())
-	rLbType.SelectEntryPos(0);
+        rLbType.SelectEntryPos(0);
     else if(rEntry.GetMax())
-	rLbType.SelectEntryPos(1);
+        rLbType.SelectEntryPos(1);
     else if(rEntry.GetPercentile())
     {
-	rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
-	rLbType.SelectEntryPos(2);
+        rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+        rLbType.SelectEntryPos(2);
     }
     else if(rEntry.GetPercent())
     {
-	rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
-	rLbType.SelectEntryPos(4);
+        rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+        rLbType.SelectEntryPos(4);
     }
     else if(rEntry.HasFormula())
     {
-	rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT));
-	rLbType.SelectEntryPos(5);
+        rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT));
+        rLbType.SelectEntryPos(5);
     }
     else
     {
-	rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
-	rLbType.SelectEntryPos(3);
+        rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+        rLbType.SelectEntryPos(3);
     }
     rLbCol.SelectEntry(rEntry.GetColor());
 }
@@ -88,28 +88,28 @@ void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType,
 void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Edit& rEdit )
 {
     if(rEntry.GetMin())
-	rLbType.SelectEntryPos(0);
+        rLbType.SelectEntryPos(0);
     else if(rEntry.GetMax())
-	rLbType.SelectEntryPos(1);
+        rLbType.SelectEntryPos(1);
     else if(rEntry.GetPercentile())
     {
-	rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
-	rLbType.SelectEntryPos(2);
+        rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+        rLbType.SelectEntryPos(2);
     }
     else if(rEntry.GetPercent())
     {
-	rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
-	rLbType.SelectEntryPos(4);
+        rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+        rLbType.SelectEntryPos(4);
     }
     else if(rEntry.HasFormula())
     {
-	rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT));
-	rLbType.SelectEntryPos(5);
+        rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT));
+        rLbType.SelectEntryPos(5);
     }
     else
     {
-	rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
-	rLbType.SelectEntryPos(3);
+        rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+        rLbType.SelectEntryPos(3);
     }
 }
 
@@ -213,84 +213,84 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm
 
     if(pFormatEntry && pFormatEntry->GetType() == condformat::CONDITION)
     {
-	const ScCondFormatEntry* pEntry = static_cast<const ScCondFormatEntry*>(pFormatEntry);
-	rtl::OUString aStyleName = pEntry->GetStyle();
-	maLbStyle.SelectEntry(aStyleName);
-	ScConditionMode eMode = pEntry->GetOperation();
-	maLbType.SelectEntryPos(1);
-	maEdVal1.SetText(pEntry->GetExpression(maPos, 0));
-	switch(eMode)
-	{
-	    case SC_COND_EQUAL:
-		maLbCondType.SelectEntryPos(0);
-		break;
-	    case SC_COND_LESS:
-		maLbCondType.SelectEntryPos(1);
-		break;
-	    case SC_COND_GREATER:
-		maLbCondType.SelectEntryPos(2);
-		break;
-	    case SC_COND_EQLESS:
-		maLbCondType.SelectEntryPos(3);
-		break;
-	    case SC_COND_EQGREATER:
-		maLbCondType.SelectEntryPos(4);
-		break;
-	    case SC_COND_NOTEQUAL:
-		maLbCondType.SelectEntryPos(5);
-		break;
-	    case SC_COND_BETWEEN:
-		maEdVal2.SetText(pEntry->GetExpression(maPos, 1));
-		maLbCondType.SelectEntryPos(6);
-		break;
-	    case SC_COND_NOTBETWEEN:
-		maEdVal2.SetText(pEntry->GetExpression(maPos, 1));
-		maLbCondType.SelectEntryPos(7);
-		break;
-	    case SC_COND_DUPLICATE:
-		maLbCondType.SelectEntryPos(8);
-		break;
-	    case SC_COND_NOTDUPLICATE:
-		maLbCondType.SelectEntryPos(9);
-		break;
-	    case SC_COND_DIRECT:
-		maLbType.SelectEntryPos(2);
-		break;
-	    case SC_COND_NONE:
-		break;
-	}
-	SwitchToType(CONDITION);
-	SetCondType();
+        const ScCondFormatEntry* pEntry = static_cast<const ScCondFormatEntry*>(pFormatEntry);
+        rtl::OUString aStyleName = pEntry->GetStyle();
+        maLbStyle.SelectEntry(aStyleName);
+        ScConditionMode eMode = pEntry->GetOperation();
+        maLbType.SelectEntryPos(1);
+        maEdVal1.SetText(pEntry->GetExpression(maPos, 0));
+        switch(eMode)
+        {
+            case SC_COND_EQUAL:
+                maLbCondType.SelectEntryPos(0);
+                break;
+            case SC_COND_LESS:
+                maLbCondType.SelectEntryPos(1);
+                break;
+            case SC_COND_GREATER:
+                maLbCondType.SelectEntryPos(2);
+                break;
+            case SC_COND_EQLESS:
+                maLbCondType.SelectEntryPos(3);
+                break;
+            case SC_COND_EQGREATER:
+                maLbCondType.SelectEntryPos(4);
+                break;
+            case SC_COND_NOTEQUAL:
+                maLbCondType.SelectEntryPos(5);
+                break;
+            case SC_COND_BETWEEN:
+                maEdVal2.SetText(pEntry->GetExpression(maPos, 1));
+                maLbCondType.SelectEntryPos(6);
+                break;
+            case SC_COND_NOTBETWEEN:
+                maEdVal2.SetText(pEntry->GetExpression(maPos, 1));
+                maLbCondType.SelectEntryPos(7);
+                break;
+            case SC_COND_DUPLICATE:
+                maLbCondType.SelectEntryPos(8);
+                break;
+            case SC_COND_NOTDUPLICATE:
+                maLbCondType.SelectEntryPos(9);
+                break;
+            case SC_COND_DIRECT:
+                maLbType.SelectEntryPos(2);
+                break;
+            case SC_COND_NONE:
+                break;
+        }
+        SwitchToType(CONDITION);
+        SetCondType();
     }
     else if( pFormatEntry && pFormatEntry->GetType() == condformat::COLORSCALE )
     {
-	const ScColorScaleFormat* pEntry = static_cast<const ScColorScaleFormat*>(pFormatEntry);
-	maLbType.SelectEntryPos(0);
-	if(pEntry->size() == 2)
-	    maLbColorFormat.SelectEntryPos(0);
-	else
-	    maLbColorFormat.SelectEntryPos(1);
-	SetColorScaleType();
-	ScColorScaleFormat::const_iterator itr = pEntry->begin();
-	SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin);
-	if(pEntry->size() == 3)
-	{
-	    ++itr;
-	    SetColorScaleEntryTypes(*itr, maLbEntryTypeMiddle, maEdMiddle, maLbColMiddle);
-	}
-	++itr;
-	SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax);
+        const ScColorScaleFormat* pEntry = static_cast<const ScColorScaleFormat*>(pFormatEntry);
+        maLbType.SelectEntryPos(0);
+        if(pEntry->size() == 2)
+            maLbColorFormat.SelectEntryPos(0);
+        else
+            maLbColorFormat.SelectEntryPos(1);
+        SetColorScaleType();
+        ScColorScaleFormat::const_iterator itr = pEntry->begin();
+        SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin);
+        if(pEntry->size() == 3)
+        {
+            ++itr;
+            SetColorScaleEntryTypes(*itr, maLbEntryTypeMiddle, maEdMiddle, maLbColMiddle);
+        }
+        ++itr;
+        SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax);
     }
     else if( pFormatEntry && pFormatEntry->GetType() == condformat::DATABAR )
     {
-	const ScDataBarFormat* pEntry = static_cast<const ScDataBarFormat*>(pFormatEntry);
-	mpDataBarData.reset(new ScDataBarFormatData(*pEntry->GetDataBarData()));
-	maLbType.SelectEntryPos(0);
-	maLbColorFormat.SelectEntryPos(2);
-	SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin);
-	SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax);
-	DataBarTypeSelectHdl(NULL);
-	SetDataBarType();
+        const ScDataBarFormat* pEntry = static_cast<const ScDataBarFormat*>(pFormatEntry);
+        mpDataBarData.reset(new ScDataBarFormatData(*pEntry->GetDataBarData()));
+        maLbType.SelectEntryPos(0);
+        maLbColorFormat.SelectEntryPos(2);
+        SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin);
+        SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax);
+        DataBarTypeSelectHdl(NULL);
+        SetDataBarType();
     }
 
     maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl );
@@ -309,7 +309,7 @@ void ScCondFrmtEntry::Init()
     SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA );
     for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() )
     {
-	rtl::OUString aName = pStyle->GetName();
+        rtl::OUString aName = pStyle->GetName();
         maLbStyle.InsertEntry( aName );
     }
     maLbStyle.SetSelectHdl( LINK( this, ScCondFrmtEntry, StyleSelectHdl ) );
@@ -353,7 +353,7 @@ void ScCondFrmtEntry::Init()
     {
         // filling the line color box
         maLbColMin.SetUpdateMode( false );
-	maLbColMiddle.SetUpdateMode( false );
+        maLbColMiddle.SetUpdateMode( false );
         maLbColMax.SetUpdateMode( false );
 
         for ( long i = 0; i < pColorTable->Count(); ++i )
@@ -394,14 +394,14 @@ rtl::OUString getTextForType(ScCondFormatEntryType eType)
 {
     switch(eType)
     {
-	case CONDITION:
-	    return rtl::OUString("Cell value");
-	case COLORSCALE:
-	    return rtl::OUString("Color scale");
-	case DATABAR:
-	    return rtl::OUString("Data Bar");
-	default:
-	    break;
+        case CONDITION:
+            return rtl::OUString("Cell value");
+        case COLORSCALE:
+            return rtl::OUString("Color scale");
+        case DATABAR:
+            return rtl::OUString("Data Bar");
+        default:
+            break;
     }
 
     return rtl::OUString("");
@@ -411,26 +411,26 @@ rtl::OUString getExpression(sal_Int32 nIndex)
 {
     switch(nIndex)
     {
-	case 0:
-	    return rtl::OUString("=");
-	case 1:
-	    return rtl::OUString("<");
-	case 2:
-	    return rtl::OUString(">");
-	case 3:
-	    return rtl::OUString("<=");
-	case 4:
-	    return rtl::OUString(">=");
-	case 5:
-	    return rtl::OUString("!=");
-	case 6:
-	    return rtl::OUString("between");
-	case 7:
-	    return rtl::OUString("not between");
-	case 8:
-	    return rtl::OUString("duplicate");
-	case 9:
-	    return rtl::OUString("unique");
+        case 0:
+            return rtl::OUString("=");
+        case 1:
+            return rtl::OUString("<");
+        case 2:
+            return rtl::OUString(">");
+        case 3:
+            return rtl::OUString("<=");
+        case 4:
+            return rtl::OUString(">=");
+        case 5:
+            return rtl::OUString("!=");
+        case 6:
+            return rtl::OUString("between");
+        case 7:
+            return rtl::OUString("not between");
+        case 8:
+            return rtl::OUString("duplicate");
+        case 9:
+            return rtl::OUString("unique");
     }
     return rtl::OUString();
 }
@@ -441,7 +441,7 @@ long ScCondFrmtEntry::Notify( NotifyEvent& rNEvt )
 {
     if( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
     {
-	ImplCallEventListenersAndHandler( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, maClickHdl, this );
+        ImplCallEventListenersAndHandler( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, maClickHdl, this );
     }
     return Control::Notify(rNEvt);
 }
@@ -450,23 +450,23 @@ void ScCondFrmtEntry::SwitchToType( ScCondFormatEntryType eType )
 {
     switch(eType)
     {
-	case COLLAPSED:
-	    {
-		maLbType.Hide();
-		rtl::OUStringBuffer maCondText(getTextForType(meType));
-		maCondText.append(rtl::OUString(" "));
-		if(meType == CONDITION)
-		    maCondText.append(getExpression(maLbCondType.GetSelectEntryPos()));
-		maFtCondition.SetText(maCondText.makeStringAndClear());
-		maFtCondition.Show();
-	    }
-	    break;
-	default:
-	    meType = eType;
-	    maLbType.Show();
-	    maFtCondition.SetText(rtl::OUString(""));
-	    maFtCondition.Hide();
-	    break;
+        case COLLAPSED:
+            {
+                maLbType.Hide();
+                rtl::OUStringBuffer maCondText(getTextForType(meType));
+                maCondText.append(rtl::OUString(" "));
+                if(meType == CONDITION)
+                    maCondText.append(getExpression(maLbCondType.GetSelectEntryPos()));
+                maFtCondition.SetText(maCondText.makeStringAndClear());
+                maFtCondition.Show();
+            }
+            break;
+        default:
+            meType = eType;
+            maLbType.Show();
+            maFtCondition.SetText(rtl::OUString(""));
+            maFtCondition.Hide();
+            break;
     }
 }
 
@@ -513,28 +513,28 @@ void ScCondFrmtEntry::SetHeight()
 {
     if(mbActive)
     {
-	Size aSize = GetSizePixel();
-	switch (meType)
-	{
-	    case CONDITION:
-		aSize.Height() = 120;
-		break;
-	    case COLORSCALE:
-		aSize.Height() = 200;
-		break;
-	    case DATABAR:
-		aSize.Height() = 200;
-		break;
-	    default:
-		break;
-	}
-	SetSizePixel(aSize);
+        Size aSize = GetSizePixel();
+        switch (meType)
+        {
+            case CONDITION:
+                aSize.Height() = 120;
+                break;
+            case COLORSCALE:
+                aSize.Height() = 200;
+                break;
+            case DATABAR:
+                aSize.Height() = 200;
+                break;
+            default:
+                break;
+        }
+        SetSizePixel(aSize);
     }
     else
     {
-	Size aSize = GetSizePixel();
-	aSize.Height() = 40;
-	SetSizePixel(aSize);
+        Size aSize = GetSizePixel();
+        aSize.Height() = 40;
+        SetSizePixel(aSize);
     }
 }
 
@@ -545,19 +545,19 @@ void ScCondFrmtEntry::SetColorScaleType()
     maLbColorFormat.Show();
     if(maLbColorFormat.GetSelectEntryPos() == 0)
     {
-	maEdMiddle.Hide();
-	maLbEntryTypeMiddle.Hide();
-	maLbColScale2.Show();
-	maLbColScale3.Hide();
-	maLbColMiddle.Hide();
+        maEdMiddle.Hide();
+        maLbEntryTypeMiddle.Hide();
+        maLbColScale2.Show();
+        maLbColScale3.Hide();
+        maLbColMiddle.Hide();
     }
     else
     {
-	maEdMiddle.Show();
-	maLbEntryTypeMiddle.Show();
-	maLbColScale2.Hide();
-	maLbColScale3.Show();
-	maLbColMiddle.Show();
+        maEdMiddle.Show();
+        maLbEntryTypeMiddle.Show();
+        maLbColScale2.Hide();
+        maLbColScale3.Show();
+        maLbColMiddle.Show();
     }
     maLbEntryTypeMin.Show();
     maLbEntryTypeMax.Show();
@@ -618,45 +618,45 @@ ScFormatEntry* ScCondFrmtEntry::createConditionEntry() const
     rtl::OUString aExpr2;
     switch(maLbCondType.GetSelectEntryPos())
     {
-	case 0:
-	    eMode = SC_COND_EQUAL;
-	    break;
-	case 1:
-	    eMode = SC_COND_LESS;
-	    break;
-	case 2:
-	    eMode = SC_COND_GREATER;
-	    break;
-	case 3:
-	    eMode = SC_COND_EQLESS;
-	    break;
-	case 4:
-	    eMode = SC_COND_EQGREATER;
-	    break;
-	case 5:
-	    eMode = SC_COND_NOTEQUAL;
-	    break;
-	case 6:
-	    aExpr2 = maEdVal2.GetText();
-	    eMode = SC_COND_BETWEEN;
-	    if(aExpr2.isEmpty())
-		return NULL;
-	    break;
-	case 7:
-	    eMode = SC_COND_NOTBETWEEN;
-	    aExpr2 = maEdVal2.GetText();
-	    if(aExpr2.isEmpty())
-		return NULL;
-	    break;
-	case 8:
-	    eMode = SC_COND_DUPLICATE;
-	    break;
-	case 9:
-	    eMode = SC_COND_NOTDUPLICATE;
-	    break;
-	default:
-        assert(false); // this cannot happen
-        return NULL;
+        case 0:
+            eMode = SC_COND_EQUAL;
+            break;
+        case 1:
+            eMode = SC_COND_LESS;
+            break;
+        case 2:
+            eMode = SC_COND_GREATER;
+            break;
+        case 3:
+            eMode = SC_COND_EQLESS;
+            break;
+        case 4:
+            eMode = SC_COND_EQGREATER;
+            break;
+        case 5:
+            eMode = SC_COND_NOTEQUAL;
+            break;
+        case 6:
+            aExpr2 = maEdVal2.GetText();
+            eMode = SC_COND_BETWEEN;
+            if(aExpr2.isEmpty())
+                return NULL;
+            break;
+        case 7:
+            eMode = SC_COND_NOTBETWEEN;
+            aExpr2 = maEdVal2.GetText();
+            if(aExpr2.isEmpty())
+                return NULL;
+            break;
+        case 8:
+            eMode = SC_COND_DUPLICATE;
+            break;
+        case 9:
+            eMode = SC_COND_NOTDUPLICATE;
+            break;
+        default:
+            assert(false); // this cannot happen
+            return NULL;
     }
 
     rtl::OUString aExpr1 = maEdVal1.GetText();
@@ -673,26 +673,26 @@ void SetColorScaleEntry( ScColorScaleEntry* pEntry, const ListBox& rType, const
     double nVal = rtl::math::stringToDouble(rValue.GetText(), '.', ',');
     switch(rType.GetSelectEntryPos())
     {
-	case 0:
-	    pEntry->SetMin(true);
-	    break;
-	case 1:
-	    pEntry->SetMax(true);
-	    break;
-	case 2:
-	    pEntry->SetPercentile(true);
-	    pEntry->SetValue(nVal);
-	    break;
-	case 3:
-	    pEntry->SetValue(nVal);
-	    break;
-	case 4:
-	    pEntry->SetPercent(true);
-	    pEntry->SetValue(nVal);
-	    break;
-	case 5:
-	    pEntry->SetFormula(rValue.GetText(), pDoc, rPos);
-	    break;
+        case 0:
+            pEntry->SetMin(true);
+            break;
+        case 1:
+            pEntry->SetMax(true);
+            break;
+        case 2:
+            pEntry->SetPercentile(true);
+            pEntry->SetValue(nVal);
+            break;
+        case 3:
+            pEntry->SetValue(nVal);
+            break;
+        case 4:
+            pEntry->SetPercent(true);
+            pEntry->SetValue(nVal);
+            break;
+        case 5:
+            pEntry->SetFormula(rValue.GetText(), pDoc, rPos);
+            break;
     }
 }
 
@@ -713,7 +713,7 @@ ScFormatEntry* ScCondFrmtEntry::createColorscaleEntry() const
     ScColorScaleFormat* pColorScale = new ScColorScaleFormat(mpDoc);
     pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMin, maLbColMin, maEdMin, mpDoc, maPos));
     if(maLbColorFormat.GetSelectEntryPos() == 1)
-	pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMiddle, maLbColMiddle, maEdMiddle, mpDoc, maPos));
+        pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMiddle, maLbColMiddle, maEdMiddle, mpDoc, maPos));
     pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMax, maLbColMax, maEdMax, mpDoc, maPos));
     return pColorScale;
 }
@@ -729,17 +729,17 @@ ScFormatEntry* ScCondFrmtEntry::GetEntry() const
 {
     switch(meType)
     {
-	case CONDITION:
-	    return createConditionEntry();
-	    break;
-	case COLORSCALE:
-	    return createColorscaleEntry();
-	    break;
-	case DATABAR:
-	    return createDatabarEntry();
-	    break;
-	default:
-	    break;
+        case CONDITION:
+            return createConditionEntry();
+            break;
+        case COLORSCALE:
+            return createColorscaleEntry();
+            break;
+        case DATABAR:
+            return createDatabarEntry();
+            break;
+        default:
+            break;
     }
     return NULL;
 }
@@ -749,20 +749,20 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, TypeListHdl)
     sal_Int32 nPos = maLbType.GetSelectEntryPos();
     switch(nPos)
     {
-	case 1:
-	    SetCondType();
-	    break;
-	case 0:
-	    if(maLbColorFormat.GetSelectEntryPos() < 2)
-		SetColorScaleType();
-	    else
-		SetDataBarType();
-	    break;
-	case 2:
-	    SetCondType();
-	    break;
-	default:
-	    break;
+        case 1:
+            SetCondType();
+            break;
+        case 0:
+            if(maLbColorFormat.GetSelectEntryPos() < 2)
+                SetColorScaleType();
+            else
+                SetDataBarType();
+            break;
+        case 2:
+            SetCondType();
+            break;
+        default:
+            break;
     }
     SetHeight();
     return 0;
@@ -772,11 +772,11 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, ColFormatTypeHdl)
 {
     if(maLbColorFormat.GetSelectEntryPos() < 2)
     {
-	SetColorScaleType();
+        SetColorScaleType();
     }
     else
     {
-	SetDataBarType();
+        SetDataBarType();
     }
 
     SetHeight();
@@ -788,48 +788,48 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, StyleSelectHdl)
 {
     if(maLbStyle.GetSelectEntryPos() == 0)
     {
-	// call new style dialog
-	SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA );
-	SfxStringItem aRefItem( SID_STYLE_REFERENCE, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
-
-	// unlock the dispatcher so SID_STYLE_NEW can be executed
-	// (SetDispatcherLock would affect all Calc documents)
-	ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
-	SfxDispatcher* pDisp = pViewShell->GetDispatcher();
-	sal_Bool bLocked = pDisp->IsLocked();
-	if (bLocked)
-	    pDisp->Lock(false);
-
-	// Execute the "new style" slot, complete with undo and all necessary updates.
-	// The return value (SfxUInt16Item) is ignored, look for new styles instead.
-	pDisp->Execute( SID_STYLE_NEW, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD | SFX_CALLMODE_MODAL,
-		&aFamilyItem,
-		&aRefItem,
-		0L );
-
-	if (bLocked)
-	    pDisp->Lock(sal_True);
-
-	// Find the new style and add it into the style list boxes
-	rtl::OUString aNewStyle;
-	SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA );
-	for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() )
-	{
-	    rtl::OUString aName = pStyle->GetName();
-	    if ( maLbStyle.GetEntryPos(aName) == LISTBOX_ENTRY_NOTFOUND )    // all lists contain the same entries
-	    {
-		maLbStyle.InsertEntry(aName);
-		maLbStyle.SelectEntry(aName);
-	    }
-	}
+        // call new style dialog
+        SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA );
+        SfxStringItem aRefItem( SID_STYLE_REFERENCE, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
+
+        // unlock the dispatcher so SID_STYLE_NEW can be executed
+        // (SetDispatcherLock would affect all Calc documents)
+        ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+        SfxDispatcher* pDisp = pViewShell->GetDispatcher();
+        sal_Bool bLocked = pDisp->IsLocked();
+        if (bLocked)
+            pDisp->Lock(false);
+
+        // Execute the "new style" slot, complete with undo and all necessary updates.
+        // The return value (SfxUInt16Item) is ignored, look for new styles instead.
+        pDisp->Execute( SID_STYLE_NEW, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD | SFX_CALLMODE_MODAL,
+                &aFamilyItem,
+                &aRefItem,
+                0L );
+
+        if (bLocked)
+            pDisp->Lock(sal_True);
+
+        // Find the new style and add it into the style list boxes
+        rtl::OUString aNewStyle;
+        SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA );
+        for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() )
+        {
+            rtl::OUString aName = pStyle->GetName();
+            if ( maLbStyle.GetEntryPos(aName) == LISTBOX_ENTRY_NOTFOUND )    // all lists contain the same entries
+            {
+                maLbStyle.InsertEntry(aName);
+                maLbStyle.SelectEntry(aName);
+            }
+        }
     }
 
     rtl::OUString aStyleName = maLbStyle.GetSelectEntry();
     SfxStyleSheetBase* pStyleSheet = mpDoc->GetStyleSheetPool()->Find( aStyleName, SFX_STYLE_FAMILY_PARA );
     if(pStyleSheet)
     {
-	const SfxItemSet& rSet = pStyleSheet->GetItemSet();
-	maWdPreview.Init( rSet );
+        const SfxItemSet& rSet = pStyleSheet->GetItemSet();
+        maWdPreview.Init( rSet );
     }
 
     return 0;
@@ -839,15 +839,15 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, DataBarTypeSelectHdl )
 {
     sal_Int32 nSelectPos = maLbDataBarMinType.GetSelectEntryPos();
     if(nSelectPos == 0 || nSelectPos == 1)
-	maEdDataBarMin.Disable();
+        maEdDataBarMin.Disable();
     else
-	maEdDataBarMin.Enable();
+        maEdDataBarMin.Enable();
 
     nSelectPos = maLbDataBarMaxType.GetSelectEntryPos();
     if(nSelectPos == 0 || nSelectPos == 1)
-	maEdDataBarMax.Disable();
+        maEdDataBarMax.Disable();
     else
-	maEdDataBarMax.Enable();
+        maEdDataBarMax.Enable();
 
     return 0;
 }
@@ -859,9 +859,9 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, OptionBtnHdl )
     ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData);
     if( pDlg->Execute() == RET_OK)
     {
-	mpDataBarData.reset(pDlg->GetData());
-	SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin);
-	SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax);
+        mpDataBarData.reset(pDlg->GetData());
+        SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin);
+        SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax);
     }
     return 0;
 }
@@ -870,15 +870,15 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, ConditionTypeSelectHdl )
 {
     if(maLbCondType.GetSelectEntryPos() == 6 || maLbCondType.GetSelectEntryPos() == 7)
     {
-	std::cout << "OldSize: " << maEdVal1.GetSizePixel().Width() << " " << maEdVal1.GetSizePixel().Height() << std::endl;
-	maEdVal1.SetSizePixel(maEdVal2.GetSizePixel());
-	maEdVal2.Show();
+        std::cout << "OldSize: " << maEdVal1.GetSizePixel().Width() << " " << maEdVal1.GetSizePixel().Height() << std::endl;
+        maEdVal1.SetSizePixel(maEdVal2.GetSizePixel());
+        maEdVal2.Show();
     }
     else
     {
-	maEdVal2.Hide();
-	Size aSize(193, 30);
-	maEdVal1.SetSizePixel(aSize);
+        maEdVal2.Hide();
+        Size aSize(193, 30);
+        maEdVal1.SetSizePixel(aSize);
     }
     return 0;
 }
@@ -911,11 +911,11 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocum
 
     if(pFormat)
     {
-	size_t nCount = pFormat->size();
-	for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
-	{
-	    maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, pFormat->GetEntry(nIndex)));
-	}
+        size_t nCount = pFormat->size();
+        for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
+        {
+            maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, pFormat->GetEntry(nIndex)));
+        }
     }
 
     RecalcAll();
@@ -925,14 +925,14 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocum
 ScConditionalFormat* ScCondFormatList::GetConditionalFormat() const
 {
     if(maEntries.empty())
-	return NULL;
+        return NULL;
 
     ScConditionalFormat* pFormat = new ScConditionalFormat(0, mpDoc);
     for(EntryContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
     {
-	ScFormatEntry* pEntry = itr->GetEntry();
-	if(pEntry)
-	    pFormat->AddEntry(pEntry);
+        ScFormatEntry* pEntry = itr->GetEntry();
+        if(pEntry)
+            pFormat->AddEntry(pEntry);
     }
 
     pFormat->AddRange(maRanges);
@@ -945,38 +945,38 @@ void ScCondFormatList::RecalcAll()
     sal_Int32 nTotalHeight = 0;
     for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
     {
-	nTotalHeight += itr->GetSizePixel().Height();
+        nTotalHeight += itr->GetSizePixel().Height();
     }
 
     Size aCtrlSize = GetOutputSize();
     long nSrcBarSize = GetSettings().GetStyleSettings().GetScrollBarSize();
     if(nTotalHeight > GetSizePixel().Height())
     {
-	mbHasScrollBar = true;
-	mpScrollBar->SetPosSizePixel(Point(aCtrlSize.Width() -nSrcBarSize, 0),
-					Size(nSrcBarSize, aCtrlSize.Height()) );
-	mpScrollBar->SetRangeMax(nTotalHeight);
-	mpScrollBar->SetVisibleSize(aCtrlSize.Height());
-	mpScrollBar->Show();
+        mbHasScrollBar = true;
+        mpScrollBar->SetPosSizePixel(Point(aCtrlSize.Width() -nSrcBarSize, 0),
+                Size(nSrcBarSize, aCtrlSize.Height()) );
+        mpScrollBar->SetRangeMax(nTotalHeight);
+        mpScrollBar->SetVisibleSize(aCtrlSize.Height());
+        mpScrollBar->Show();
     }
     else
     {
-	mbHasScrollBar = false;
-	mpScrollBar->Hide();
+        mbHasScrollBar = false;
+        mpScrollBar->Hide();
     }
 
     Point aPoint(0,0);
     for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
     {
-	itr->SetPosPixel(aPoint);
-	Size aSize = itr->GetSizePixel();
-	if(mbHasScrollBar)
-	    aSize.Width() = aCtrlSize.Width() - nSrcBarSize;
-	else
-	    aSize.Width() = aCtrlSize.Width();
-	itr->SetSizePixel(aSize);
-
-	aPoint.Y() += itr->GetSizePixel().Height();
+        itr->SetPosPixel(aPoint);
+        Size aSize = itr->GetSizePixel();
+        if(mbHasScrollBar)
+            aSize.Width() = aCtrlSize.Width() - nSrcBarSize;
+        else
+            aSize.Width() = aCtrlSize.Width();
+        itr->SetSizePixel(aSize);
+
+        aPoint.Y() += itr->GetSizePixel().Height();
     }
 }
 
@@ -1028,11 +1028,11 @@ IMPL_LINK_NOARG( ScCondFormatList, RemoveBtnHdl )
 {
     for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
     {
-	if(itr->IsSelected())
-	{
-	    maEntries.erase(itr);
-	    break;
-	}
+        if(itr->IsSelected())
+        {
+            maEntries.erase(itr);
+            break;
+        }
     }
     RecalcAll();
     return 0;
@@ -1042,7 +1042,7 @@ IMPL_LINK( ScCondFormatList, EntrySelectHdl, ScCondFrmtEntry*, pEntry )
 {
     for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
     {
-	itr->Deselect();
+        itr->Deselect();
     }
     pEntry->Select();
     RecalcAll();
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 1414fce..c3cb2ca 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -5069,7 +5069,7 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
     ScDocument* pDoc = rDocShell.GetDocument();
     if(nOldFormat)
     {
-	pDoc->DeleteConditionalFormat(nOldFormat, nTab);
+        pDoc->DeleteConditionalFormat(nOldFormat, nTab);
     }
     if(pFormat)
     {
diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src
index 48aa50c..26b8d13 100644
--- a/sc/source/ui/src/condformatdlg.src
+++ b/sc/source/ui/src/condformatdlg.src
@@ -50,23 +50,23 @@ ModalDialog RID_SCDLG_CONDFORMAT
     };
     PushButton BTN_ADD
     {
-	Pos = MAP_APPFONT( 5, 155 );
-	Size = MAP_APPFONT( 40, 14 );
-	Text [ en-US ] = "Add";
-	TabStop = TRUE;
+        Pos = MAP_APPFONT( 5, 155 );
+        Size = MAP_APPFONT( 40, 14 );
+        Text [ en-US ] = "Add";
+        TabStop = TRUE;
     };
     PushButton BTN_REMOVE
     {
-	Pos = MAP_APPFONT( 50, 155 );
-	Size = MAP_APPFONT( 40, 14 );
-	Text [ en-US ] = "Remove";
-	TabStop = TRUE;
+        Pos = MAP_APPFONT( 50, 155 );
+        Size = MAP_APPFONT( 40, 14 );
+        Text [ en-US ] = "Remove";
+        TabStop = TRUE;
     };
     Control CTRL_LIST
     {
-	Pos = MAP_APPFONT( 5, 20 );
-	Size = MAP_APPFONT( 190, 120 );
-	Border = TRUE;
+        Pos = MAP_APPFONT( 5, 20 );
+        Size = MAP_APPFONT( 190, 120 );
+        Border = TRUE;
     };
 };
 
@@ -78,148 +78,148 @@ Control RID_COND_ENTRY
 
     FixedText FT_COND_NR
     {
-	Pos = MAP_APPFONT( 2, 2 );
-	Size = MAP_APPFONT( 30, 10 );
-	Text [ en-US ] = "Condition";
+        Pos = MAP_APPFONT( 2, 2 );
+        Size = MAP_APPFONT( 30, 10 );
+        Text [ en-US ] = "Condition";
     };
 
     FixedText FT_CONDITION
     {
-	Pos = MAP_APPFONT( 40, 2 );
-	Size = MAP_APPFONT( 90, 10 );
+        Pos = MAP_APPFONT( 40, 2 );
+        Size = MAP_APPFONT( 90, 10 );
     };
 
     ListBox LB_TYPE
     {
-	Pos = MAP_APPFONT( 5, 15 );
-	Size = MAP_APPFONT( 40, 40 );
-	Border = TRUE;
-	DropDown = TRUE;
-	StringList [ en-US ] =
-	{
-	    "All Cells";
-	    "Cell value is";
-	    "Formula is";
-	};
+        Pos = MAP_APPFONT( 5, 15 );
+        Size = MAP_APPFONT( 40, 40 );
+        Border = TRUE;
+        DropDown = TRUE;
+        StringList [ en-US ] =
+        {
+            "All Cells";
+            "Cell value is";
+            "Formula is";
+        };
     };
     ListBox LB_CELLIS_TYPE
     {
-	Pos = MAP_APPFONT( 50, 15 );
-	Size = MAP_APPFONT( 30, 40 );
-	Border = TRUE;
-	DropDown = TRUE;
-	StringList [ en-US ] =
-	{
-	    "equal to";
-	    "less than";
-	    "greater than";
-	    "less than or equal to";
-	    "greater than or equal to";
-	    "not equal to";
-	    "between";
-	    "not between";
-	    "duplicate";
-	    "not duplicate";
-	};
+        Pos = MAP_APPFONT( 50, 15 );
+        Size = MAP_APPFONT( 30, 40 );
+        Border = TRUE;
+        DropDown = TRUE;
+        StringList [ en-US ] =
+        {
+            "equal to";
+            "less than";
+            "greater than";
+            "less than or equal to";
+            "greater than or equal to";
+            "not equal to";
+            "between";
+            "not between";
+            "duplicate";
+            "not duplicate";
+        };
     };
     FixedText FT_STYLE
     {
-	Pos = MAP_APPFONT( 10, 32 );
-	Size = MAP_APPFONT( 35, 14 );
-	Text [ en-US ] = "Apply Style";
+        Pos = MAP_APPFONT( 10, 32 );
+        Size = MAP_APPFONT( 35, 14 );
+        Text [ en-US ] = "Apply Style";
     };
     Edit ED_VAL1
     {
-	Pos = MAP_APPFONT( 90, 15 );
-	Size = MAP_APPFONT( 70, 12 );
-	Border = TRUE;
+        Pos = MAP_APPFONT( 90, 15 );
+        Size = MAP_APPFONT( 70, 12 );
+        Border = TRUE;
     };
     Edit ED_VAL2
     {
-	Pos = MAP_APPFONT( 130, 15 );
-	Size = MAP_APPFONT( 30, 12 );
-	Border = TRUE;
+        Pos = MAP_APPFONT( 130, 15 );
+        Size = MAP_APPFONT( 30, 12 );
+        Border = TRUE;
     };
     ListBox LB_STYLE
     {
-	Pos = MAP_APPFONT( 50, 32 );
-	Size = MAP_APPFONT( 30, 40 );
-	Border = TRUE;
-	DropDown = TRUE;
-	StringList [ en-US ] =
-	{
-	    "New Style...";
-	};
+        Pos = MAP_APPFONT( 50, 32 );
+        Size = MAP_APPFONT( 30, 40 );
+        Border = TRUE;
+        DropDown = TRUE;
+        StringList [ en-US ] =
+        {
+            "New Style...";
+        };
     };
     ListBox LB_COLOR_FORMAT
     {
-	Pos = MAP_APPFONT( 50, 15 );
-	Size = MAP_APPFONT( 60, 40);
-	Border = TRUE;
-	DropDown = TRUE;
-	StringList [ en-US ] =
-	{
-	    "Color Scale (2 Entries)";
-	    "Color Scale (3 Entries)";
-	    "Data Bar";
-	};
+        Pos = MAP_APPFONT( 50, 15 );
+        Size = MAP_APPFONT( 60, 40);
+        Border = TRUE;
+        DropDown = TRUE;
+        StringList [ en-US ] =
+        {
+            "Color Scale (2 Entries)";
+            "Color Scale (3 Entries)";
+            "Data Bar";
+        };
     };
     ListBox LB_COL_SCALE2
     {
-	Pos = MAP_APPFONT( 120, 15 );
-	Size = MAP_APPFONT( 60, 40 );
-	Border = TRUE;
-	DropDown = TRUE;
+        Pos = MAP_APPFONT( 120, 15 );
+        Size = MAP_APPFONT( 60, 40 );
+        Border = TRUE;
+        DropDown = TRUE;
     };
     ListBox LB_COL_SCALE3
     {
-	Pos = MAP_APPFONT( 120, 15 );
-	Size = MAP_APPFONT( 60, 40 );
-	Border = TRUE;
-	DropDown = TRUE;
+        Pos = MAP_APPFONT( 120, 15 );
+        Size = MAP_APPFONT( 60, 40 );
+        Border = TRUE;
+        DropDown = TRUE;
     };
     ListBox LB_TYPE_COL_SCALE
     {
-	Pos = MAP_APPFONT( 5, 32 );
-	Size = MAP_APPFONT( 40, 40 );
-	Border = TRUE;
-	DropDown = TRUE;
-	StringList [ en-US ] =
-	{
-	    "Min";
-	    "Max";
-	    "Percentile";
-	    "Value";
-	    "Percent";
-	    "Formula";
-	};
+        Pos = MAP_APPFONT( 5, 32 );
+        Size = MAP_APPFONT( 40, 40 );
+        Border = TRUE;
+        DropDown = TRUE;
+        StringList [ en-US ] =
+        {
+            "Min";
+            "Max";
+            "Percentile";
+            "Value";
+            "Percent";
+            "Formula";
+        };
     };
     Edit ED_COL_SCALE
     {
-	Pos = MAP_APPFONT( 5, 48 );
-	Size = MAP_APPFONT( 40, 12 );
-	Border = TRUE;
+        Pos = MAP_APPFONT( 5, 48 );
+        Size = MAP_APPFONT( 40, 12 );
+        Border = TRUE;
     };
     Window WD_PREVIEW
     {
-	Pos = MAP_APPFONT( 90, 32 );
-	Size = MAP_APPFONT( 40, 14 );
-	Text [ en-US ] = "Example";
-	Border = TRUE;
+        Pos = MAP_APPFONT( 90, 32 );
+        Size = MAP_APPFONT( 40, 14 );
+        Text [ en-US ] = "Example";
+        Border = TRUE;
     };
     ListBox LB_COL
     {
-	Pos = MAP_APPFONT( 5, 62 );
-	Size = MAP_APPFONT( 40, 40 );
+        Pos = MAP_APPFONT( 5, 62 );
+        Size = MAP_APPFONT( 40, 40 );
         Border = TRUE;
         DropDown = TRUE;
         DDExtraWidth = TRUE;
     };
     PushButton BTN_OPTIONS
     {
-	Pos = MAP_APPFONT( 120, 62 );
-	Size = MAP_APPFONT( 60, 14 );
-	Text [ en-US ] = "More options ...";
+        Pos = MAP_APPFONT( 120, 62 );
+        Size = MAP_APPFONT( 60, 14 );
+        Text [ en-US ] = "More options ...";
     };
 };
 
commit 6fea8c175b03471cf24481f37dce8a857f2a525c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jun 11 07:29:36 2012 +0000

    eMode may be used uninitialized in this function
    
    Change-Id: Ic5d17c360be7f3cb3d5004327d2a6d76dce40c52
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 27127e9..fdfdb1a 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -51,6 +51,7 @@
 
 #include "globstr.hrc"
 
+#include <cassert>
 #include <iostream>
 
 namespace {
@@ -654,7 +655,8 @@ ScFormatEntry* ScCondFrmtEntry::createConditionEntry() const
 	    eMode = SC_COND_NOTDUPLICATE;
 	    break;
 	default:
-	    break;
+        assert(false); // this cannot happen
+        return NULL;
     }
 
     rtl::OUString aExpr1 = maEdVal1.GetText();
commit 23b2612251e8638e662fddd7e279cefcf1c4d896
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jun 11 07:01:49 2012 +0000

    abstract type in ptr_container needs this workaround
    
    Change-Id: I00be4d0963c9cebc50aff3eb44cb208b6eb8c88c
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 1b241cf..c68875f 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -354,6 +354,13 @@ public:
     void erase(sal_uLong nIndex);
 };
 
+// see http://www.boost.org/doc/libs/1_49_0/libs/ptr_container/doc/tutorial.html#cloneability
+//for MSVC we need:
+inline ScFormatEntry* new_clone( const ScFormatEntry& rFormat )
+{
+    return rFormat.Clone();
+}
+
 #endif
 
 
commit 83ca5dd046ca5528ecdc6498db61843011e18f91
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jun 11 06:37:25 2012 +0000

    make mac tinderbox happy
    
    Change-Id: Ie42f38f65fd4b164c9bebb14f6754392c4abecff
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 32869de..27127e9 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -162,7 +162,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc):
     maLbEntryTypeMax.SelectEntryPos(1);
     maLbDataBarMinType.SelectEntryPos(0);
     maLbDataBarMaxType.SelectEntryPos(1);
-    maEdMiddle.SetText(rtl::OUString::valueOf(50));
+    maEdMiddle.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(50)));
     maEdDataBarMin.Disable();
     maEdDataBarMax.Disable();
 
commit 8bbee1358d7c45edbc4d9b32b47dd45fc87f80b1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jun 11 05:58:51 2012 +0000

    remove unnecessary menu entries for 3-6
    
    they can go back in for 3-7 when we have overlapping conditional formats
    
    Change-Id: I029d247444368165df92dfbc123f4a7a2de647a1
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index ec7c688..fbea1b9 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -261,8 +261,6 @@
             <menu:menuitem menu:id=".uno:AutoFormat"/>
             <menu:menu menu:id=".uno:ConditionalFormatMenu">
 	          <menu:menupopup>
-	            <menu:menuitem menu:id="uno:DataBarDialog"/>
-	            <menu:menuitem menu:id="uno:ColorScaleDialog"/>
 	            <menu:menuitem menu:id="uno:ConditionalFormatDialog"/>
 	          </menu:menupopup>
 	        </menu:menu>
commit 8b8ed03a8c8a72a15e21c20f266b462dc852fcc0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jun 11 05:36:09 2012 +0000

    remove empty conditions for color format export to excel
    
    Change-Id: I8b35869f3e4455bb8cb16d67bd9636462a24e26b
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 3395cf9..6021704 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -972,10 +972,6 @@ XclExpCondfmt::XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat
             {
                 if(pFormatEntry->GetType() == condformat::CONDITION)
                     maCFList.AppendNewRecord( new XclExpCF( GetRoot(), static_cast<const ScCondFormatEntry&>(*pFormatEntry), nIndex ) );
-                else if(pFormatEntry->GetType() == condformat::COLORSCALE)
-                    ;
-                else if(pFormatEntry->GetType() == condformat::DATABAR)
-                    ;
             }
         aScRanges.Format( msSeqRef, SCA_VALID, NULL, formula::FormulaGrammar::CONV_XL_A1 );
     }
commit 39b736d656bf7d6ed09576cfbf1b1ea64b8c6e9a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jun 11 05:33:11 2012 +0000

    fix rebase problems
    
    Change-Id: If025dbfc3364f49151638a606928229dba0ee645
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index e8b3b36..1b241cf 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -322,6 +322,7 @@ private:
 public:
     ScConditionalFormatList() {}
     ScConditionalFormatList(const ScConditionalFormatList& rList);
+    ScConditionalFormatList(ScDocument* pDoc, const ScConditionalFormatList& rList);
     ~ScConditionalFormatList() {}
 
     void    InsertNew( ScConditionalFormat* pNew )
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index d774244..d5ab40a 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1201,6 +1201,8 @@ public:
     SC_DLLPUBLIC void           FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges, SCTAB nTab );
     void            ConditionalChanged( sal_uLong nKey, SCTAB nTab );
 
+    void SetCondFormList( ScConditionalFormatList* pList, SCTAB nTab );
+
     SC_DLLPUBLIC sal_uLong          AddValidationEntry( const ScValidationData& rNew );
 
     SC_DLLPUBLIC const ScValidationData*    GetValidationEntry( sal_uLong nIndex ) const;
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 7756f77..78cd977 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -796,6 +796,7 @@ public:
 
     ScConditionalFormatList* GetCondFormList();
     const ScConditionalFormatList* GetCondFormList() const;
+    void SetCondFormList( ScConditionalFormatList* pList );
 
     void DeleteConditionalFormat(sal_uLong nOldIndex);
 
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index f157dfc..15cb8ba 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1589,12 +1589,14 @@ bool ScConditionalFormat::MarkUsedExternalReferences() const
 
 ScConditionalFormatList::ScConditionalFormatList(const ScConditionalFormatList& rList)
 {
-    //  fuer Ref-Undo - echte Kopie mit neuen Tokens!
-
     for(const_iterator itr = rList.begin(); itr != rList.end(); ++itr)
         InsertNew( itr->Clone() );
+}
 
-    //!     sortierte Eintraege aus rList schneller einfuegen ???
+ScConditionalFormatList::ScConditionalFormatList(ScDocument* pDoc, const ScConditionalFormatList& rList)
+{
+    for(const_iterator itr = rList.begin(); itr != rList.end(); ++itr)
+        InsertNew( itr->Clone(pDoc) );
 }
 
 bool ScConditionalFormatList::operator==( const ScConditionalFormatList& r ) const
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 806ee46..34c1c8f 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -717,6 +717,12 @@ ScConditionalFormatList* ScDocument::GetCondFormList(SCTAB nTab) const
     return NULL;
 }
 
+void ScDocument::SetCondFormList( ScConditionalFormatList* pList, SCTAB nTab )
+{
+    if(VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
+        maTabs[nTab]->SetCondFormList(pList);
+}
+
 
 const ScValidationData* ScDocument::GetValidationEntry( sal_uLong nIndex ) const
 {
commit 27e869767c1d0745cdfefcf1cf0c2f76fc74c942
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jun 10 05:17:49 2012 +0000

    correctly copy the cond formats, fdo#50679
    
    Change-Id: I52d645a8a7662016ced8c1eb6b320c4a14807353
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index a554c20..18dfda4 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -632,6 +632,8 @@ void ScTable::CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
         if ( IsProtected() )
             for (i = nCol1; i <= nCol2; i++)
                 pTable->aCol[i].RemoveProtected(nRow1, nRow2);
+
+        pTable->mpCondFormatList.reset(new ScConditionalFormatList(pTable->pDocument, *mpCondFormatList));
     }
 }
 
@@ -666,8 +668,16 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO
             {
                 ScConditionalFormat* pFormat = pOldCondFormatList->GetFormat(nId);
                 ScConditionalFormat* pNewFormat = pFormat->Clone(pDocument);
-                pNewFormat->SetKey(mpCondFormatList->size()+1);
+                pNewFormat->SetKey(0);
                 //not in list => create entries in both maps and new format
+                sal_uLong nMax = 0;
+                for(ScConditionalFormatList::const_iterator itr = mpCondFormatList->begin();
+                                        itr != mpCondFormatList->end(); ++itr)
+                {
+                    if(itr->GetKey() > nMax)
+                        nMax = itr->GetKey();
+                }
+                pNewFormat->SetKey(nMax + 1);
                 mpCondFormatList->InsertNew(pNewFormat);
                 sal_Int32 nNewId = pNewFormat->GetKey();
                 aOldIdToNewId.insert( std::pair<sal_Int32, sal_Int32>( nId, nNewId ) );
@@ -683,6 +693,9 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO
     {
         sal_uInt32 nNewKey = aOldIdToNewId.find(itr->first)->second;
         ScConditionalFormat* pFormat = mpCondFormatList->GetFormat( nNewKey );
+        if(!pFormat)
+            continue;
+
         pFormat->UpdateReference(URM_MOVE, ScRange(nCol1 - nDx, nRow1 - nDy, pTable->nTab, nCol2 - nDx, nRow2 - nDy, pTable->nTab),
                 nDx, nDy, pTable->nTab - nTab);
         pFormat->AddRange(itr->second);
commit 9fe8948942b8006a4089fbcce90456f68aec677c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jun 10 01:16:02 2012 +0000

    correctly create between/not between entries
    
    Change-Id: I99e553e2e729c46d320f796361b0e04508b63e84
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 1f102f6..32869de 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -636,14 +636,14 @@ ScFormatEntry* ScCondFrmtEntry::createConditionEntry() const
 	    eMode = SC_COND_NOTEQUAL;
 	    break;
 	case 6:
-	    aExpr2 = maEdVal1.GetText();
+	    aExpr2 = maEdVal2.GetText();
 	    eMode = SC_COND_BETWEEN;
 	    if(aExpr2.isEmpty())
 		return NULL;
 	    break;
 	case 7:
 	    eMode = SC_COND_NOTBETWEEN;
-	    aExpr2 = maEdVal1.GetText();
+	    aExpr2 = maEdVal2.GetText();
 	    if(aExpr2.isEmpty())
 		return NULL;
 	    break;
commit c503655664218218b55c9bdc727eb0bf23741241
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jun 10 01:10:57 2012 +0000

    set correct range as title + update for (not) between
    
    Change-Id: I4b819920417c1b2c67b27295170c7a56108fef64
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 0f27399..1f102f6 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -217,6 +217,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm
 	maLbStyle.SelectEntry(aStyleName);
 	ScConditionMode eMode = pEntry->GetOperation();
 	maLbType.SelectEntryPos(1);
+	maEdVal1.SetText(pEntry->GetExpression(maPos, 0));
 	switch(eMode)
 	{
 	    case SC_COND_EQUAL:
@@ -238,9 +239,11 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm
 		maLbCondType.SelectEntryPos(5);
 		break;
 	    case SC_COND_BETWEEN:
+		maEdVal2.SetText(pEntry->GetExpression(maPos, 1));
 		maLbCondType.SelectEntryPos(6);
 		break;
 	    case SC_COND_NOTBETWEEN:
+		maEdVal2.SetText(pEntry->GetExpression(maPos, 1));
 		maLbCondType.SelectEntryPos(7);
 		break;
 	    case SC_COND_DUPLICATE:
@@ -374,6 +377,7 @@ void ScCondFrmtEntry::Init()
     maBtOptions.SetClickHdl( LINK( this, ScCondFrmtEntry, OptionBtnHdl ) );
     maLbDataBarMinType.SetSelectHdl( LINK( this, ScCondFrmtEntry, DataBarTypeSelectHdl ) );
     maLbDataBarMaxType.SetSelectHdl( LINK( this, ScCondFrmtEntry, DataBarTypeSelectHdl ) );
+    maLbCondType.SetSelectHdl( LINK( this, ScCondFrmtEntry, ConditionTypeSelectHdl ) );
 
     mpDataBarData.reset(new ScDataBarFormatData());
     mpDataBarData->mpUpperLimit.reset(new ScColorScaleEntry());
@@ -860,6 +864,23 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, OptionBtnHdl )
     return 0;
 }
 
+IMPL_LINK_NOARG( ScCondFrmtEntry, ConditionTypeSelectHdl )
+{
+    if(maLbCondType.GetSelectEntryPos() == 6 || maLbCondType.GetSelectEntryPos() == 7)
+    {
+	std::cout << "OldSize: " << maEdVal1.GetSizePixel().Width() << " " << maEdVal1.GetSizePixel().Height() << std::endl;
+	maEdVal1.SetSizePixel(maEdVal2.GetSizePixel());
+	maEdVal2.Show();
+    }
+    else
+    {
+	maEdVal2.Hide();
+	Size aSize(193, 30);
+	maEdVal1.SetSizePixel(aSize);
+    }
+    return 0;
+}
+
 ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocument* pDoc):
     Control(pParent, rResId),
     mbHasScrollBar(false),
@@ -981,7 +1002,7 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond
     rtl::OUStringBuffer aTitle( GetText() );
     aTitle.append(rtl::OUString(" "));
     rtl::OUString aRangeString;
-    rRange.Format(aRangeString, 0, pDoc);
+    rRange.Format(aRangeString, SCA_VALID, pDoc, pDoc->GetAddressConvention());
     aTitle.append(aRangeString);
     SetText(aTitle.makeStringAndClear());
     maBtnAdd.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, AddBtnHdl ) );
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index b40a0af..1414fce 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -5080,7 +5080,7 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
 	ScMarkData aMarkData;
 	aMarkData.MarkFromRangeList(rRanges, true);
 	pDoc->ApplySelectionPattern( aPattern , aMarkData );
-	size_t n = rRanges.size()
+	size_t n = rRanges.size();
 	for(size_t i = 0; i < n; ++i)
 	    pFormat->DoRepaint(rRanges[i]);
     }
diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx
index 70fef96..e66c090 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -126,6 +126,7 @@ private:
     DECL_LINK( StyleSelectHdl, void* );
     DECL_LINK( OptionBtnHdl, void* );
     DECL_LINK( DataBarTypeSelectHdl, void* );
+    DECL_LINK( ConditionTypeSelectHdl, void* );
 
 public:
     ScCondFrmtEntry( Window* pParent, ScDocument* pDoc );
commit 1252376ec587419b2dc80e9f6a221185926ed778
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jun 10 00:21:24 2012 +0000

    fix repainting of conditional formats
    
    Change-Id: I14da7e5cdb1bdd4bb3bcd4e03d379f0858c7f999
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 1844363..f157dfc 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1489,87 +1489,7 @@ bool lcl_CutRange( ScRange& rRange, const ScRange& rOther )
 
 void ScConditionalFormat::DoRepaint( const ScRange* pModified )
 {
-    /*
-    SfxObjectShell* pSh = pDoc->GetDocumentShell();
-    if (pSh)
-    {
-        //  Rahmen/Schatten enthalten?
-        //  (alle Bedingungen testen)
-        bool bExtend = false;
-        bool bRotate = false;
-        bool bAttrTested = false;
-
-        if (!pAreas)        //  RangeList ggf. holen
-        {
-            pAreas = new ScRangeList;
-            pDoc->FindConditionalFormat( nKey, pRanges->front()->aStart.Tab(), *pAreas );
-        }
-        for (size_t i = 0, nCount = pAreas->size(); i < nCount; i++ )
-        {
-            ScRange aRange = *(*pAreas)[i];
-            bool bDo = true;
-            if ( pModified )
-            {
-                if ( !lcl_CutRange( aRange, *pModified ) )
-                    bDo = false;
-            }
-            if (bDo)
-            {
-                if ( !bAttrTested )
-                {
-                    // Look at the style's content only if the repaint is necessary
-                    // for any condition, to avoid the time-consuming Find() if there are many
-                    // conditional formats and styles.
-                    for (sal_uInt16 nEntry=0; nEntry<nEntryCount; nEntry++)
-                    {
-                        String aStyle = ppEntries[nEntry]->GetStyle();
-                        if (aStyle.Len())
-                        {
-                            SfxStyleSheetBase* pStyleSheet =
-                                pDoc->GetStyleSheetPool()->Find( aStyle, SFX_STYLE_FAMILY_PARA );
-                            if ( pStyleSheet )
-                            {
-                                const SfxItemSet& rSet = pStyleSheet->GetItemSet();
-                                if (rSet.GetItemState( ATTR_BORDER, true ) == SFX_ITEM_SET ||
-                                    rSet.GetItemState( ATTR_SHADOW, true ) == SFX_ITEM_SET)
-                                {
-                                    bExtend = true;
-                                }
-                                if (rSet.GetItemState( ATTR_ROTATE_VALUE, true ) == SFX_ITEM_SET ||
-                                    rSet.GetItemState( ATTR_ROTATE_MODE, true ) == SFX_ITEM_SET)
-                                {
-                                    bRotate = true;
-                                }
-                            }
-                        }
-                    }
-                    bAttrTested = true;
-                }
-
-                lcl_Extend( aRange, pDoc, bExtend );        // zusammengefasste und bExtend
-                if ( bRotate )
-                {
-                    aRange.aStart.SetCol(0);
-                    aRange.aEnd.SetCol(MAXCOL);     // gedreht: ganze Zeilen
-                }
-
-                // gedreht -> ganze Zeilen
-                if ( aRange.aStart.Col() != 0 || aRange.aEnd.Col() != MAXCOL )
-                {
-                    if ( pDoc->HasAttrib( 0,aRange.aStart.Row(),aRange.aStart.Tab(),
-                                            MAXCOL,aRange.aEnd.Row(),aRange.aEnd.Tab(),
-                                            HASATTR_ROTATE ) )
-                    {
-                        aRange.aStart.SetCol(0);
-                        aRange.aEnd.SetCol(MAXCOL);
-                    }
-                }
-
-                pDoc->RepaintRange( aRange );
-            }
-        }
-    }
-    */
+    pDoc->RepaintRange(*pModified);
 }
 
 void ScConditionalFormat::CompileAll()
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 4dc933b..b40a0af 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -5080,6 +5080,9 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
 	ScMarkData aMarkData;
 	aMarkData.MarkFromRangeList(rRanges, true);
 	pDoc->ApplySelectionPattern( aPattern , aMarkData );
+	size_t n = rRanges.size()
+	for(size_t i = 0; i < n; ++i)
+	    pFormat->DoRepaint(rRanges[i]);
     }
     aModificator.SetDocumentModified();
     SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
commit 3636f18178ea5ef6a7905b3b79aa3c45dbfed878
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Jun 9 23:59:23 2012 +0000

    correctly set new conditional format
    
    Change-Id: I6dc3f1cd99cd15aa3dad72a1417f3e2c1af0108d
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 73e6ece..e8b3b36 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -349,6 +349,8 @@ public:
     SC_DLLPUBLIC const_iterator end() const;
 
     size_t size() const;
+
+    void erase(sal_uLong nIndex);
 };
 
 #endif
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index efd99b7..d774244 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1196,6 +1196,7 @@ public:
     void            ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark );
 
     SC_DLLPUBLIC sal_uLong AddCondFormat( ScConditionalFormat* pNew, SCTAB nTab );
+    void DeleteConditionalFormat( sal_uLong nIndex, SCTAB nTab );
     SC_DLLPUBLIC void           FindConditionalFormat( sal_uLong nKey, SCTAB nTab, ScRangeList& rRanges );
     SC_DLLPUBLIC void           FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges, SCTAB nTab );
     void            ConditionalChanged( sal_uLong nKey, SCTAB nTab );
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 4c5d697..7756f77 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -797,6 +797,8 @@ public:
     ScConditionalFormatList* GetCondFormList();
     const ScConditionalFormatList* GetCondFormList() const;
 
+    void DeleteConditionalFormat(sal_uLong nOldIndex);
+
     sal_uLong          AddCondFormat( ScConditionalFormat* pNew );
 
 private:
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 0a594dd..6479296 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -147,14 +147,6 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, bool bAlloc )
                 aAdrEnd  .SetRow( pData[i].nRow );
                 pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
             }
-            // conditional format or deleted?
-            if ( &pPattern->GetItem(ATTR_CONDITIONAL) != &pOldPattern->GetItem(ATTR_CONDITIONAL) )
-            {
-                pDocument->ConditionalChanged( ((const SfxUInt32Item&)
-                                pOldPattern->GetItem(ATTR_CONDITIONAL)).GetValue(), nTab );
-                pDocument->ConditionalChanged( ((const SfxUInt32Item&)
-                                pPattern->GetItem(ATTR_CONDITIONAL)).GetValue(), nTab );
-            }
             pDocPool->Remove(*pOldPattern);
         }
         delete[] pData;
@@ -373,13 +365,6 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern
                     aAdrEnd  .SetRow( Min(nEndRow,pData[nx].nRow) );
                     pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
                 }
-                if ( &rNewSet.Get(ATTR_CONDITIONAL) != &rOldSet.Get(ATTR_CONDITIONAL) )
-                {
-                    pDocument->ConditionalChanged( ((const SfxUInt32Item&)
-                                    rOldSet.Get(ATTR_CONDITIONAL)).GetValue(), nTab );
-                    pDocument->ConditionalChanged( ((const SfxUInt32Item&)
-                                    rNewSet.Get(ATTR_CONDITIONAL)).GetValue(), nTab );
-                }
                 ns = pData[nx].nRow + 1;
                 nx++;
             }
@@ -776,16 +761,6 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac
                         pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
                     }
 
-                    // Reset conditional formats or delete ?
-
-                    if ( &rNewSet.Get(ATTR_CONDITIONAL) != &rOldSet.Get(ATTR_CONDITIONAL) )
-                    {
-                        pDocument->ConditionalChanged( ((const SfxUInt32Item&)
-                                        rOldSet.Get(ATTR_CONDITIONAL)).GetValue(), nTab );
-                        pDocument->ConditionalChanged( ((const SfxUInt32Item&)
-                                        rNewSet.Get(ATTR_CONDITIONAL)).GetValue(), nTab );
-                    }
-
                     pDocument->GetPool()->Remove(*pData[nPos].pPattern);
                     pData[nPos].pPattern = pNewPattern;
                     if (Concat(nPos))
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 6497ce7..1844363 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1765,4 +1765,16 @@ size_t ScConditionalFormatList::size() const
     return maConditionalFormats.size();
 }
 
+void ScConditionalFormatList::erase( sal_uLong nIndex )
+{
+    for( iterator itr = begin(); itr != end(); ++itr )
+    {
+        if( itr->GetKey() == nIndex )
+        {
+            maConditionalFormats.erase(itr);
+            break;
+        }
+    }
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 0610286..806ee46 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -738,12 +738,10 @@ void ScDocument::FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges, SC
         maTabs[nTab]->FindConditionalFormat( nKey, rRanges );
 }
 
-void ScDocument::ConditionalChanged( sal_uLong nKey, SCTAB nTab )
+void ScDocument::DeleteConditionalFormat(sal_uLong nOldIndex, SCTAB nTab)
 {
-    ScConditionalFormatList* pCondFormList = GetCondFormList(nTab);
-    if ( nKey && pCondFormList && !bIsClip && !bIsUndo )        // nKey==0 -> noop
-    {
-    }
+    if(VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
+        maTabs[nTab]->DeleteConditionalFormat(nOldIndex);
 }
 
 //------------------------------------------------------------------------
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index eb7f283..93b6f5c 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2019,6 +2019,11 @@ sal_uLong ScTable::AddCondFormat( ScConditionalFormat* pNew )
     return nMax + 1;
 }
 
+void ScTable::DeleteConditionalFormat( sal_uLong nIndex )
+{
+    mpCondFormatList->erase(nIndex);
+}
+
 void ScTable::SetCondFormList( ScConditionalFormatList* pNew )
 {
     mpCondFormatList.reset( pNew );
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 6f13586..0f27399 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -84,6 +84,34 @@ void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType,
     rLbCol.SelectEntry(rEntry.GetColor());
 }
 
+void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Edit& rEdit )
+{
+    if(rEntry.GetMin())
+	rLbType.SelectEntryPos(0);
+    else if(rEntry.GetMax())
+	rLbType.SelectEntryPos(1);
+    else if(rEntry.GetPercentile())
+    {
+	rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+	rLbType.SelectEntryPos(2);
+    }
+    else if(rEntry.GetPercent())
+    {
+	rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+	rLbType.SelectEntryPos(4);
+    }
+    else if(rEntry.HasFormula())
+    {
+	rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT));
+	rLbType.SelectEntryPos(5);
+    }
+    else
+    {
+	rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+	rLbType.SelectEntryPos(3);
+    }
+}
+
 }
 
 ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc):
@@ -132,6 +160,11 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc):
     maLbEntryTypeMin.SelectEntryPos(0);
     maLbEntryTypeMiddle.SelectEntryPos(2);
     maLbEntryTypeMax.SelectEntryPos(1);
+    maLbDataBarMinType.SelectEntryPos(0);
+    maLbDataBarMaxType.SelectEntryPos(1);
+    maEdMiddle.SetText(rtl::OUString::valueOf(50));
+    maEdDataBarMin.Disable();
+    maEdDataBarMax.Disable();
 
     Init();
     maLbStyle.SelectEntryPos(1);
@@ -250,6 +283,9 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm
 	mpDataBarData.reset(new ScDataBarFormatData(*pEntry->GetDataBarData()));
 	maLbType.SelectEntryPos(0);
 	maLbColorFormat.SelectEntryPos(2);
+	SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin);
+	SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax);
+	DataBarTypeSelectHdl(NULL);
 	SetDataBarType();
     }
 
@@ -288,7 +324,7 @@ void ScCondFrmtEntry::Init()
     maLbEntryTypeMiddle.SetPosPixel(aPointLb);
     maEdMiddle.SetPosPixel(aPointEd);
     maLbColMiddle.SetPosPixel(aPointCol);
-    maEdDataBarMin.SetPosPixel(aPointEdDataBar);
+    maEdDataBarMax.SetPosPixel(aPointEdDataBar);
     maLbDataBarMaxType.SetPosPixel(aPointLbDataBar);
     aPointLb.X() += nMovePos;
     aPointEd.X() += nMovePos;
@@ -336,12 +372,15 @@ void ScCondFrmtEntry::Init()
     }
 
     maBtOptions.SetClickHdl( LINK( this, ScCondFrmtEntry, OptionBtnHdl ) );
+    maLbDataBarMinType.SetSelectHdl( LINK( this, ScCondFrmtEntry, DataBarTypeSelectHdl ) );
+    maLbDataBarMaxType.SetSelectHdl( LINK( this, ScCondFrmtEntry, DataBarTypeSelectHdl ) );
 
     mpDataBarData.reset(new ScDataBarFormatData());
     mpDataBarData->mpUpperLimit.reset(new ScColorScaleEntry());
     mpDataBarData->mpLowerLimit.reset(new ScColorScaleEntry());
     mpDataBarData->mpLowerLimit->SetMin(true);
     mpDataBarData->mpUpperLimit->SetMax(true);
+    mpDataBarData->maPositiveColor = COL_LIGHTBLUE;
 }
 
 namespace {
@@ -373,10 +412,20 @@ rtl::OUString getExpression(sal_Int32 nIndex)
 	    return rtl::OUString("<");
 	case 2:
 	    return rtl::OUString(">");
+	case 3:
+	    return rtl::OUString("<=");
+	case 4:
+	    return rtl::OUString(">=");
 	case 5:
 	    return rtl::OUString("!=");
-	default:
-	    return rtl::OUString("not yet supported");
+	case 6:
+	    return rtl::OUString("between");
+	case 7:
+	    return rtl::OUString("not between");
+	case 8:
+	    return rtl::OUString("duplicate");
+	case 9:
+	    return rtl::OUString("unique");
     }
     return rtl::OUString();
 }
@@ -401,7 +450,8 @@ void ScCondFrmtEntry::SwitchToType( ScCondFormatEntryType eType )
 		maLbType.Hide();
 		rtl::OUStringBuffer maCondText(getTextForType(meType));
 		maCondText.append(rtl::OUString(" "));
-		maCondText.append(getExpression(maLbCondType.GetSelectEntryPos()));
+		if(meType == CONDITION)
+		    maCondText.append(getExpression(maLbCondType.GetSelectEntryPos()));
 		maFtCondition.SetText(maCondText.makeStringAndClear());
 		maFtCondition.Show();
 	    }
@@ -612,9 +662,8 @@ ScFormatEntry* ScCondFrmtEntry::createConditionEntry() const
 
 namespace {
 
-ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListBox& rColor, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos )
+void SetColorScaleEntry( ScColorScaleEntry* pEntry, const ListBox& rType, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos )
 {
-    ScColorScaleEntry* pEntry = new ScColorScaleEntry();
     double nVal = rtl::math::stringToDouble(rValue.GetText(), '.', ',');
     switch(rType.GetSelectEntryPos())
     {
@@ -639,7 +688,13 @@ ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListB
 	    pEntry->SetFormula(rValue.GetText(), pDoc, rPos);
 	    break;
     }
+}
 
+ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListBox& rColor, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos )
+{
+    ScColorScaleEntry* pEntry = new ScColorScaleEntry();
+
+    SetColorScaleEntry( pEntry, rType, rValue, pDoc, rPos );
     Color aColor = rColor.GetSelectEntryColor();
     pEntry->SetColor(aColor);
     return pEntry;
@@ -774,13 +829,33 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, StyleSelectHdl)
     return 0;
 }
 
+IMPL_LINK_NOARG( ScCondFrmtEntry, DataBarTypeSelectHdl )
+{
+    sal_Int32 nSelectPos = maLbDataBarMinType.GetSelectEntryPos();
+    if(nSelectPos == 0 || nSelectPos == 1)
+	maEdDataBarMin.Disable();
+    else
+	maEdDataBarMin.Enable();
+
+    nSelectPos = maLbDataBarMaxType.GetSelectEntryPos();
+    if(nSelectPos == 0 || nSelectPos == 1)
+	maEdDataBarMax.Disable();
+    else
+	maEdDataBarMax.Enable();
+
+    return 0;
+}
+
 IMPL_LINK_NOARG( ScCondFrmtEntry, OptionBtnHdl )
 {
+    SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos);
+    SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos);
     ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData);
     if( pDlg->Execute() == RET_OK)
     {
-	std::cout << "Ok" << std::endl;
 	mpDataBarData.reset(pDlg->GetData());
+	SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin);
+	SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax);
     }
     return 0;
 }
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 5227044..4dc933b 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -5063,7 +5063,27 @@ sal_Bool ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
     return sal_True;
 }
 
+void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFormat* pFormat, SCTAB nTab, const ScRangeList& rRanges )
+{
+    ScDocShellModificator aModificator(rDocShell);
+    ScDocument* pDoc = rDocShell.GetDocument();
+    if(nOldFormat)
+    {
+	pDoc->DeleteConditionalFormat(nOldFormat, nTab);
+    }
+    if(pFormat)
+    {
+	sal_uLong nIndex = pDoc->AddCondFormat(pFormat, nTab);
 
+	ScPatternAttr aPattern( pDoc->GetPool() );
+	aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nIndex ) );
+	ScMarkData aMarkData;
+	aMarkData.MarkFromRangeList(rRanges, true);
+	pDoc->ApplySelectionPattern( aPattern , aMarkData );
+    }
+    aModificator.SetDocumentModified();
+    SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
+}
 
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx
index d1f80a9..70fef96 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -125,6 +125,7 @@ private:
     DECL_LINK( ColFormatTypeHdl, void*);
     DECL_LINK( StyleSelectHdl, void* );
     DECL_LINK( OptionBtnHdl, void* );
+    DECL_LINK( DataBarTypeSelectHdl, void* );
 
 public:
     ScCondFrmtEntry( Window* pParent, ScDocument* pDoc );
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 9ea375a..f8b6b9b 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -52,6 +52,7 @@ class ScTokenArray;
 struct ScTabOpParam;
 class ScTableProtection;
 struct ScCellMergeOption;
+class ScConditionalFormat;
 
 // ---------------------------------------------------------------------------
 
@@ -202,6 +203,12 @@ public:
                                             const String& rOptions, const String& rSource,
                                             const ScRange& rDestRange, sal_uLong nRefresh,
                                             sal_Bool bFitBlock, sal_Bool bApi );
+
+    /**
+     * @param nOldIndex If 0 don't delete an old format
+     * @param pFormat if NULL only delete an old format
+     */
+    virtual void ReplaceConditionalFormat( sal_uLong nOldIndex, ScConditionalFormat* pFormat, SCTAB nTab, const ScRangeList& rRanges );
 };
 
 class ScDocFuncDirect : public ScDocFunc
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index d9c78cd..c0a59a9 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2056,11 +2056,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
 
                 ScRangeList aRangeList;
-                ScViewData* pViewData = GetViewData();
-                pViewData->GetMarkData().FillRangeListWithMarks(&aRangeList, false);
+                ScViewData* pData = GetViewData();
+                pData->GetMarkData().FillRangeListWithMarks(&aRangeList, false);
                 ScDocument* pDoc = GetViewData()->GetDocument();
 
-                ScAddress aPos(pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo());
+                ScAddress aPos(pData->GetCurX(), pData->GetCurY(), pData->GetTabNo());
                 AbstractScCondFormatDlg* pDlg = NULL;
                 const ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(aPos.Col(), aPos.Row(), aPos.Tab());
                 if(pCondFormat)
@@ -2075,11 +2075,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 if(pDlg->Execute() == RET_OK)
                 {
                     ScConditionalFormat* pFormat = pDlg->GetConditionalFormat();
-                    sal_uLong nIndex = pDoc->AddCondFormat(pFormat, pViewData->GetTabNo());
-
-                    ScPatternAttr aPattern( pDoc->GetPool() );
-                    aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nIndex ) );
-                    pDoc->ApplySelectionPattern( aPattern , pViewData->GetMarkData() );
+                    sal_uLong nOldIndex = 0;
+                    if(pCondFormat)
+                        nOldIndex = pCondFormat->GetKey();
+                    pData->GetDocShell()->GetDocFunc().ReplaceConditionalFormat( nOldIndex, pFormat, pData->GetTabNo(), pFormat->GetRange() );
                 }
                 delete pDlg;
             }
commit 8515f99043e2062516977255e37182ad99cb44d4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jun 8 07:38:01 2012 +0000

    more support for data bars in new dialogs
    
    Change-Id: I2292517a060a12c1d0dffd70558afc8a57e89754
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 745d123..de45815 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -33,6 +33,7 @@
 
 #include <svx/xtable.hxx>
 #include <svx/drawitem.hxx>
+#include <vcl/msgbox.hxx>
 
 ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow):
     ModalDialog( pWindow, ScResId( RID_SCDLG_DATABAR ) ),
@@ -66,7 +67,7 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow):
 
 namespace {
 
-void SetType(ScColorScaleEntry* pEntry, ListBox& aLstBox)
+void SetType(const ScColorScaleEntry* pEntry, ListBox& aLstBox)
 {
     if(pEntry->GetMin())
         aLstBox.SelectEntryPos(0);
@@ -82,6 +83,37 @@ void SetType(ScColorScaleEntry* pEntry, ListBox& aLstBox)
         aLstBox.SelectEntryPos(4);
 }
 
+void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry )
+{
+    double nVal = 0;
+    switch(rLstBox.GetSelectEntryPos())
+    {
+        case 0:
+            pEntry->SetMin(true);
+            break;
+        case 1:
+            pEntry->SetMax(true);
+            break;
+        case 2:
+            pEntry->SetPercentile(true);
+            nVal = rtl::math::stringToDouble(rEd.GetText(), '.', ',');
+            pEntry->SetValue(nVal);
+            break;
+        case 3:
+            nVal = rtl::math::stringToDouble(rEd.GetText(), '.', ',');
+            pEntry->SetPercent(true);
+            pEntry->SetValue(nVal);
+            break;
+        case 4:
+            //FIXME
+            break;
+        case 5:
+            nVal = rtl::math::stringToDouble(rEd.GetText(), '.', ',');
+            pEntry->SetValue(nVal);
+            break;
+    }
+}
+
 void SetValue( ScColorScaleEntry* pEntry, Edit& aEdit)
 {
     if(pEntry->HasFormula())
@@ -94,6 +126,53 @@ void SetValue( ScColorScaleEntry* pEntry, Edit& aEdit)
 
 }
 
+ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarFormatData& rData):
+    ModalDialog( pWindow, ScResId( RID_SCDLG_DATABAR ) ),
+    maBtnOk( this, ScResId( BTN_OK ) ),
+    maBtnCancel( this, ScResId( BTN_CANCEL ) ),
+    maFlBarColors( this, ScResId( FL_BAR_COLORS ) ),

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list