[Libreoffice-commits] core.git: 5 commits - include/svtools include/svx officecfg/registry sc/inc sc/Library_sc.mk sc/sdi sc/source sc/uiconfig sc/UIConfig_scalc.mk svtools/source svx/source

Tomaž Vajngerl quikee at gmail.com
Tue Jul 23 11:55:15 PDT 2013


 include/svtools/ruler.hxx                                         |   14 
 include/svx/ruler.hxx                                             |    5 
 officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu |    8 
 sc/Library_sc.mk                                                  |    2 
 sc/UIConfig_scalc.mk                                              |    1 
 sc/inc/sc.hrc                                                     |    3 
 sc/sdi/cellsh.sdi                                                 |    3 
 sc/sdi/scalc.sdi                                                  |   26 
 sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx       |  318 ++
 sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx    |  155 -
 sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx    |  178 +
 sc/source/ui/app/scdll.cxx                                        |    1 
 sc/source/ui/inc/AnalysisOfVarianceDialog.hxx                     |   44 
 sc/source/ui/inc/ChildWindowWrapper.hxx                           |   94 
 sc/source/ui/inc/DescriptiveStatisticsDialog.hxx                  |   48 
 sc/source/ui/inc/StatisticsInputOutputDialog.hxx                  |   82 
 sc/source/ui/inc/reffact.hxx                                      |   22 
 sc/source/ui/view/cellsh.cxx                                      |   11 
 sc/source/ui/view/cellsh1.cxx                                     |   11 
 sc/source/ui/view/reffact.cxx                                     |   12 
 sc/source/ui/view/tabvwsh.cxx                                     |    1 
 sc/source/ui/view/tabvwshc.cxx                                    |   19 
 sc/uiconfig/scalc/menubar/menubar.xml                             |    1 
 sc/uiconfig/scalc/ui/analysisofvariancedialog.ui                  |  226 ++
 svtools/source/control/ruler.cxx                                  |   20 
 svx/source/dialog/svxruler.cxx                                    | 1067 +++-------
 26 files changed, 1470 insertions(+), 902 deletions(-)

New commits:
commit 98608e57f21820ec1d2c6cd77f433b6963e249a6
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Tue Jul 23 20:43:29 2013 +0200

    fdo#38144 In ruler snap to markers for tab stops, margins, etc.
    
    Change-Id: Ie7f829b0ec36af79a2a97d9de7b6e37034c22e61

diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index bee6f05..4c08745 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -586,6 +586,18 @@ struct RulerLine
     sal_uInt16  nStyle;
 };
 
+struct RulerUnitData
+{
+    MapUnit         eMapUnit;           // MAP_UNIT for calculaion
+    long            nTickUnit;          // Unit divider
+    long            nTick1;             // Minimal step
+    long            nTick2;             // Tick half unit
+    long            nTick3;             // Tick whole unit
+    long            n100THMM;           // 100mm Unit divider
+    sal_uInt16      nUnitDigits;        // Number of digits
+    sal_Char        aUnitStr[8];        // Unit string
+};
+
 class ImplRulerData;
 // ---------
 // - Ruler -
@@ -681,6 +693,8 @@ private:
 
 protected:
     long GetRulerVirHeight() const;
+    MapMode GetMapMode() const { return maMapMode; }
+    RulerUnitData GetCurrentRulerUnit() const;
 
 public:
                         Ruler( Window* pParent, WinBits nWinStyle = WB_STDRULER );
diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx
index aa18893..a6faad7 100644
--- a/include/svx/ruler.hxx
+++ b/include/svx/ruler.hxx
@@ -22,7 +22,7 @@
 #include <vcl/menu.hxx>
 #include <svtools/ruler.hxx>
 #include <svl/lstner.hxx>
-#include "svx/svxdllapi.h"
+#include <svx/svxdllapi.h>
 
 class SvxProtectItem;
 class SvxRulerItem;
@@ -124,6 +124,9 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener
     void UpdateColumns();
     void UpdateObject();
 
+    // Normalize position to the ruler's tick value
+    void NormalizePosition(long& rValue) const;
+
     long PixelHAdjust(long lPos, long lPos2) const;
     long PixelVAdjust(long lPos, long lPos2) const;
     long PixelAdjust(long lPos, long lPos2) const;
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 0a68369..d128975 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -105,20 +105,7 @@ public:
     ImplRulerData&      operator=( const ImplRulerData& rData );
 };
 
-
-struct ImplRulerUnitData
-{
-    MapUnit         eMapUnit;           // MAP_UNIT zum Umrechnen
-    long            nTickUnit;          // Teiler fuer Einheit
-    long            nTick1;             // Schrittweite
-    long            nTick2;             // Tick fuer halbe Werte
-    long            nTick3;             // Tick fuer Zahlenausgabe
-    long            n100THMM;           // Teiler fuer Einheit
-    sal_uInt16          nUnitDigits;        // Anzahl Nachkommastellen
-    sal_Char        aUnitStr[8];        // Einheiten-String
-};
-
-static ImplRulerUnitData aImplRulerUnitTab[RULER_UNIT_COUNT] =
+static RulerUnitData aImplRulerUnitTab[RULER_UNIT_COUNT] =
 {
 { MAP_100TH_MM,        100,    25,     50,    100,     100, 3, " mm"    }, // MM
 { MAP_100TH_MM,       1000,   250,    500,   1000,    1000, 3, " cm"    }, // CM
@@ -2776,6 +2763,11 @@ long    Ruler::GetMargin1() const { return mpData->nMargin1; }
 long    Ruler::GetMargin2() const { return mpData->nMargin2; }
 long Ruler::GetRulerVirHeight() const { return mnVirHeight; }
 
+RulerUnitData Ruler::GetCurrentRulerUnit() const
+{
+    return aImplRulerUnitTab[mnUnitIndex];
+}
+
 void Ruler::DrawTicks()
 {
     mbFormat = sal_True;
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index fe648c2..ff87c51 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -19,23 +19,24 @@
 
 #include <string.h>
 #include <limits.h>
+
 #include <tools/shl.hxx>
 #include <vcl/image.hxx>
+#include <vcl/svapp.hxx>
 #include <svl/eitem.hxx>
 #include <svl/rectitem.hxx>
-#include <sfx2/dispatch.hxx>
-
 #include <svl/smplhint.hxx>
-
+#include <sfx2/dispatch.hxx>
 #include <svx/dialogs.hrc>
 #include <svx/dialmgr.hxx>
 #include <svx/ruler.hxx>
-#include "rlrcitem.hxx"
-#include "svx/rulritem.hxx"
+#include <svx/rulritem.hxx>
 #include <editeng/tstpitem.hxx>
 #include <editeng/lrspitem.hxx>
-#include "editeng/protitem.hxx"
-#include <vcl/svapp.hxx>
+#include <editeng/protitem.hxx>
+
+#include "rlrcitem.hxx"
+
 #ifndef RULER_TAB_RTL
 #define RULER_TAB_RTL           ((sal_uInt16)0x0010)
 #endif
@@ -269,7 +270,6 @@ void SvxRuler_Impl::SetPercSize(sal_uInt16 nSize)
 // expects: something like SwTabCols
 // Ruler: SetBorders
 
-
 SvxRuler::SvxRuler(
             Window* pParent,        // StarView Parent
             Window* pWin,           // Output window: is used for conversion
@@ -433,6 +433,15 @@ SvxRuler::~SvxRuler()
 }
 
 /* Internal conversion routines */
+
+void SvxRuler::NormalizePosition(long& rValue) const
+{
+    long aNewPositionLogic = pEditWin->PixelToLogic(Size(0, rValue), GetMapMode()).Height();
+    long aTickDivider = GetCurrentRulerUnit().nTick1;
+    aNewPositionLogic = (aNewPositionLogic / aTickDivider) * aTickDivider;
+    rValue = pEditWin->LogicToPixel(Size(0, aNewPositionLogic), GetMapMode()).Height();
+}
+
 long SvxRuler::ConvertHPosPixel(long nVal) const
 {
     return pEditWin->LogicToPixel(Size(nVal, 0)).Width();
@@ -1360,10 +1369,15 @@ void ModifyTabs_Impl( sal_uInt16 nCount, // Number of Tabs
 void SvxRuler::DragMargin1()
 {
     /* Dragging the left edge of frame */
-    const long lDragPos = GetCorrectedDragPos( !TAB_FLAG || !NEG_FLAG, sal_True );
+    long lDragPos = GetCorrectedDragPos( !TAB_FLAG || !NEG_FLAG, sal_True );
+    NormalizePosition(lDragPos);
+
+    // Check if position changed
+    if (lDragPos == 0)
+        return;
+
     DrawLine_Impl(lTabPos, ( TAB_FLAG && NEG_FLAG ) ? 3 : 7, bHorz);
-    if(pColumnItem&&
-       (nDragType & DRAG_OBJECT_SIZE_PROPORTIONAL))
+    if(pColumnItem && (nDragType & DRAG_OBJECT_SIZE_PROPORTIONAL))
         DragBorders();
     AdjustMargin1(lDragPos);
 }
@@ -1486,13 +1500,19 @@ void SvxRuler::AdjustMargin1(long lDiff)
 void SvxRuler::DragMargin2()
 {
     /* Dragging the right edge of frame */
-    const long lDragPos = GetCorrectedDragPos( sal_True, !TAB_FLAG || !NEG_FLAG);
-    DrawLine_Impl(lTabPos, ( TAB_FLAG && NEG_FLAG ) ? 5 : 7, bHorz);
+    long lDragPos = GetCorrectedDragPos( sal_True, !TAB_FLAG || !NEG_FLAG);
+    NormalizePosition(lDragPos);
     long lDiff = lDragPos - GetMargin2();
 
-    if(pRuler_Imp->bIsTableRows && !bHorz && pColumnItem&&
+    // Check if position changed
+    if (lDiff == 0)
+        return;
+
+    if(pRuler_Imp->bIsTableRows && !bHorz && pColumnItem &&
        (nDragType & DRAG_OBJECT_SIZE_PROPORTIONAL))
+    {
         DragBorders();
+    }
 
     sal_Bool bProtectColumns =
         pRuler_Imp->aProtectItem.IsSizeProtected() ||
@@ -1507,76 +1527,86 @@ void SvxRuler::DragMargin2()
         pIndents[INDENT_FIRST_LINE].nPos += lDiff;
         SetIndents(INDENT_COUNT, pIndents+INDENT_GAP);
     }
+
+    DrawLine_Impl(lTabPos, ( TAB_FLAG && NEG_FLAG ) ? 5 : 7, bHorz);
 }
 
 void SvxRuler::DragIndents()
 {
     /* Dragging the paragraph indents */
-    const long lDragPos = NEG_FLAG ? GetDragPos() : GetCorrectedDragPos();
-    const sal_uInt16 nIdx = GetDragAryPos()+INDENT_GAP;
-    const long lDiff = pIndents[nIdx].nPos - lDragPos;
-
-    if((nIdx == INDENT_FIRST_LINE ||
-            nIdx == INDENT_LEFT_MARGIN )  &&
-        (nDragType & DRAG_OBJECT_LEFT_INDENT_ONLY) !=
-        DRAG_OBJECT_LEFT_INDENT_ONLY)
+    long lDragPos = NEG_FLAG ? GetDragPos() : GetCorrectedDragPos();
+    const sal_uInt16 nIndex = GetDragAryPos() + INDENT_GAP;
+    NormalizePosition(lDragPos);
+    const long lDiff = pIndents[nIndex].nPos - lDragPos;
+
+    // Check if position changed
+    if (lDiff == 0)
+        return;
+
+    if((nIndex == INDENT_FIRST_LINE || nIndex == INDENT_LEFT_MARGIN )  &&
+        (nDragType & DRAG_OBJECT_LEFT_INDENT_ONLY) != DRAG_OBJECT_LEFT_INDENT_ONLY)
+    {
         pIndents[INDENT_FIRST_LINE].nPos -= lDiff;
+    }
 
-    pIndents[nIdx].nPos = lDragPos;
+    pIndents[nIndex].nPos = lDragPos;
 
     SetIndents(INDENT_COUNT, pIndents + INDENT_GAP);
     DrawLine_Impl(lTabPos, 1, bHorz);
 }
 
-void SvxRuler::DrawLine_Impl(long &_lTabPos, int nNew, sal_Bool Hori)
+void SvxRuler::DrawLine_Impl(long& lTabPosition, int nNew, sal_Bool bHorizontal)
 {
     /*
        Output routine for the ledger line when moving tabs, tables and other
        columns
     */
-    if(Hori)
+    if(bHorizontal)
     {
         const long nHeight = pEditWin->GetOutputSize().Height();
-        Point aZero=pEditWin->GetMapMode().GetOrigin();
-        if(_lTabPos!=-1)
+        Point aZero = pEditWin->GetMapMode().GetOrigin();
+        if(lTabPosition != -1)
+        {
             pEditWin->InvertTracking(
-                Rectangle( Point(_lTabPos, -aZero.Y()),
-                           Point(_lTabPos, -aZero.Y()+nHeight)),
+                Rectangle( Point(lTabPosition, -aZero.Y()),
+                           Point(lTabPosition, -aZero.Y() + nHeight)),
                 SHOWTRACK_SPLIT | SHOWTRACK_CLIP );
+        }
         if( nNew & 1 )
         {
-
-            _lTabPos = ConvertHSizeLogic(
-                GetCorrectedDragPos( ( nNew&4 ) != 0, ( nNew&2 ) != 0 ) +
-                GetNullOffset() );
+            long nDrapPosition = GetCorrectedDragPos( ( nNew & 4 ) != 0, ( nNew & 2 ) != 0 );
+            NormalizePosition(nDrapPosition);
+            lTabPosition = ConvertHSizeLogic( nDrapPosition + GetNullOffset() );
             if(pPagePosItem)
-                _lTabPos += pPagePosItem->GetPos().X();
+                lTabPosition += pPagePosItem->GetPos().X();
             pEditWin->InvertTracking(
-                Rectangle(Point(_lTabPos, -aZero.Y()),
-                          Point(_lTabPos, -aZero.Y()+nHeight)),
+                Rectangle( Point(lTabPosition, -aZero.Y()),
+                           Point(lTabPosition, -aZero.Y() + nHeight) ),
                 SHOWTRACK_CLIP | SHOWTRACK_SPLIT );
         }
     }
     else
     {
         const long nWidth = pEditWin->GetOutputSize().Width();
-        Point aZero=pEditWin->GetMapMode().GetOrigin();
-        if(_lTabPos != -1)
+        Point aZero = pEditWin->GetMapMode().GetOrigin();
+        if(lTabPosition != -1)
         {
             pEditWin->InvertTracking(
-                Rectangle( Point(-aZero.X(), _lTabPos),
-                           Point(-aZero.X()+nWidth, _lTabPos)),
+                Rectangle( Point(-aZero.X(),          lTabPosition),
+                           Point(-aZero.X() + nWidth, lTabPosition)),
                 SHOWTRACK_SPLIT | SHOWTRACK_CLIP );
         }
 
         if(nNew & 1)
         {
-            _lTabPos = ConvertVSizeLogic(GetCorrectedDragPos()+GetNullOffset());
+            long nDrapPosition = GetCorrectedDragPos();
+            NormalizePosition(nDrapPosition);
+            lTabPosition = ConvertVSizeLogic(nDrapPosition + GetNullOffset());
             if(pPagePosItem)
-                _lTabPos += pPagePosItem->GetPos().Y();
+                lTabPosition += pPagePosItem->GetPos().Y();
             pEditWin->InvertTracking(
-                Rectangle( Point(-aZero.X(), _lTabPos),
-                           Point(-aZero.X()+nWidth, _lTabPos)),
+                Rectangle( Point(-aZero.X(),        lTabPosition),
+                           Point(-aZero.X()+nWidth, lTabPosition)),
                 SHOWTRACK_CLIP | SHOWTRACK_SPLIT );
         }
     }
@@ -1586,12 +1616,14 @@ void SvxRuler::DragTabs()
 {
     /* Dragging of Tabs */
     long lDragPos = GetCorrectedDragPos(sal_True, sal_False);
+    NormalizePosition(lDragPos);
+    sal_uInt16 nIdx = GetDragAryPos() + TAB_GAP;
+    long nDiff = lDragPos - pTabs[nIdx].nPos;
+    if (nDiff == 0)
+        return;
 
-    sal_uInt16 nIdx = GetDragAryPos()+TAB_GAP;
     DrawLine_Impl(lTabPos, 7, bHorz);
 
-    long nDiff = lDragPos - pTabs[nIdx].nPos;
-
     if(nDragType & DRAG_OBJECT_SIZE_LINEAR)
     {
 
@@ -1624,7 +1656,10 @@ void SvxRuler::DragTabs()
         }
     }
     else
+    {
         pTabs[nIdx].nPos = lDragPos;
+    }
+
 
     if(IsDragDelete())
         pTabs[nIdx].nStyle |= RULER_STYLE_INVISIBLE;
@@ -1686,7 +1721,8 @@ void SvxRuler::UpdateParaContents_Impl(
 void SvxRuler::DragBorders()
 {
     /* Dragging of Borders (Tables and other columns) */
-    sal_Bool bLeftIndentsCorrected = sal_False, bRightIndentsCorrected = sal_False;
+    sal_Bool bLeftIndentsCorrected  = sal_False;
+    sal_Bool bRightIndentsCorrected = sal_False;
     int nIdx;
 
     if(GetDragType()==RULER_TYPE_BORDER)
@@ -1695,7 +1731,9 @@ void SvxRuler::DragBorders()
         nIdx = GetDragAryPos();
     }
     else
+    {
         nIdx=0;
+    }
 
     sal_uInt16 nDragSize = GetDragSize();
     long lDiff = 0;
@@ -1703,7 +1741,6 @@ void SvxRuler::DragBorders()
     // the drag position has to be corrected to be able to prevent borders from passing each other
     long lPos = GetCorrectedDragPos();
 
-
     switch(nDragSize)
     {
       case RULER_DRAGSIZE_MOVE:
@@ -1973,7 +2010,7 @@ void SvxRuler::ApplyIndents()
 {
     /* Applying paragraph settings; changed by dragging. */
     long nNewTxtLeft;
-    if(pColumnItem&&!IsActFirstColumn( sal_True ))
+    if(pColumnItem && !IsActFirstColumn( sal_True ))
     {
         long nLeftCol=GetActLeftColumn( sal_True );
         nNewTxtLeft =
@@ -1985,10 +2022,11 @@ void SvxRuler::ApplyIndents()
                 lAppNullOffset,pParaItem->GetTxtLeft());
     }
     else
-        nNewTxtLeft =
-            PixelHAdjust(
-                ConvertHPosLogic(pIndents[INDENT_LEFT_MARGIN].nPos),
-                pParaItem->GetTxtLeft());
+    {
+        nNewTxtLeft = PixelHAdjust(
+                        ConvertHPosLogic(pIndents[INDENT_LEFT_MARGIN].nPos),
+                        pParaItem->GetTxtLeft());
+    }
 
     sal_Bool bRTL = pRuler_Imp->pTextRTLItem && pRuler_Imp->pTextRTLItem->GetValue();
 
@@ -1996,18 +2034,20 @@ void SvxRuler::ApplyIndents()
     if(bRTL)
     {
         long nRightFrameMargin = GetRightFrameMargin();
-        nNewFirstLineOffset =   PixelHAdjust(nRightFrameMargin -
-                ConvertHPosLogic(pIndents[INDENT_FIRST_LINE].nPos ) -
-                lAppNullOffset,
-                pParaItem->GetTxtFirstLineOfst());
+        nNewFirstLineOffset = PixelHAdjust(
+                                nRightFrameMargin -
+                                    ConvertHPosLogic(pIndents[INDENT_FIRST_LINE].nPos ) -
+                                    lAppNullOffset,
+                                pParaItem->GetTxtFirstLineOfst());
     }
     else
-        nNewFirstLineOffset=
-            PixelHAdjust(
-                ConvertHPosLogic(pIndents[INDENT_FIRST_LINE].nPos -
-                             pIndents[INDENT_LEFT_MARGIN].nPos) -
-                lAppNullOffset,
-                pParaItem->GetTxtFirstLineOfst());
+    {
+        nNewFirstLineOffset = PixelHAdjust(
+                                ConvertHPosLogic(pIndents[INDENT_FIRST_LINE].nPos -
+                                    pIndents[INDENT_LEFT_MARGIN].nPos) -
+                                    lAppNullOffset,
+                                pParaItem->GetTxtFirstLineOfst());
+    }
 
     // If the new TxtLeft is smaller than the old FirstLineIndent, then the
     // difference is lost and the paragraph is in total indented too far,
@@ -2025,11 +2065,10 @@ void SvxRuler::ApplyIndents()
             nNewFirstLineOffset -= pParaBorderItem->GetRight();
         }
     }
-    pParaItem->SetTxtFirstLineOfst(
-        sal::static_int_cast< short >(nNewFirstLineOffset));
+    pParaItem->SetTxtFirstLineOfst(sal::static_int_cast< short >(nNewFirstLineOffset));
     pParaItem->SetTxtLeft(nNewTxtLeft);
 
-    if(pColumnItem && ((!bRTL && !IsActLastColumn( sal_True ))|| (bRTL && !IsActFirstColumn())))
+    if(pColumnItem && ((!bRTL && !IsActLastColumn( sal_True )) || (bRTL && !IsActFirstColumn())))
     {
         if(bRTL)
         {
@@ -2044,9 +2083,9 @@ void SvxRuler::ApplyIndents()
                 PixelHAdjust(
                     ConvertHPosLogic(
                         pBorders[GetActRightColumn( sal_True )].nPos -
-                        pIndents[INDENT_RIGHT_MARGIN].nPos) -
-                    lAppNullOffset,
-                    pParaItem->GetRight()));
+                            pIndents[INDENT_RIGHT_MARGIN].nPos) -
+                            lAppNullOffset,
+                        pParaItem->GetRight()));
         }
 
     }
@@ -3091,7 +3130,7 @@ void  SvxRuler::Drag()
     switch(GetDragType()) {
     case RULER_TYPE_MARGIN1:        // left edge of the surrounding Frame
         DragMargin1();
-        pRuler_Imp->lLastLMargin=GetMargin1();
+        pRuler_Imp->lLastLMargin = GetMargin1();
         break;
     case RULER_TYPE_MARGIN2:        // right edge of the surrounding Frame
         DragMargin2();
commit 06c416be33ae727d1b87e5a79cec4a0582aea832
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Mon Jul 22 20:35:44 2013 +0200

    Cleanup strangely formatted code in SvxRuler.
    
    Change-Id: I69b87dd737ac6a1195cbd023398179580fa0fd24

diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index b878b3b..fe648c2 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -231,8 +231,6 @@ struct SvxRuler_Impl  {
 
 };
 
-
-
 void SvxRuler_Impl::SetPercSize(sal_uInt16 nSize)
 {
     if(nSize > nPercSize)
@@ -247,7 +245,6 @@ void SvxRuler_Impl::SetPercSize(sal_uInt16 nSize)
     memset(pBlockBuf, 0, nSize2);
 }
 
-
 // Constructor of the ruler
 
 // SID_ATTR_ULSPACE, SID_ATTR_LRSPACE
@@ -273,66 +270,61 @@ void SvxRuler_Impl::SetPercSize(sal_uInt16 nSize)
 // Ruler: SetBorders
 
 
-SvxRuler::SvxRuler
-(
- Window* pParent,                               // StarView Parent
- Window* pWin,            // Output window: is used for conversion
-                          // logical units <-> pixels
- sal_uInt16  flags,       // Display flags, see ruler.hxx
- SfxBindings &rBindings,  // associated Bindings
- WinBits nWinStyle                              // StarView WinBits
-)
-: Ruler(pParent, nWinStyle),
-  pCtrlItem(new SvxRulerItem *[CTRL_ITEM_COUNT]),
-  pLRSpaceItem(0),
-  pMinMaxItem(0),
-  pULSpaceItem(0),
-  pTabStopItem(0),
-  pParaItem(0),
-  pParaBorderItem(0),
-  pPagePosItem(0),
-  pColumnItem(0),
-  pObjectItem(0),
-  pEditWin(pWin),
-  pRuler_Imp(new SvxRuler_Impl),
-  bAppSetNullOffset(sal_False),  // Is the 0-offset of the ruler set by the application?
-  lLogicNullOffset(0),
-  lAppNullOffset(LONG_MAX),
-  lMinFrame(5),
-  lInitialDragPos(0),
-  nFlags(flags),
-  nDragType(NONE),
-  nDefTabType(RULER_TAB_LEFT),
-  nTabCount(0),
-  nTabBufSize(0),
-  lDefTabDist(50),
-  lTabPos(-1),
-  pTabs(0),
-  pIndents(0),
-  pBorders(new RulerBorder[1]), // due to one column tables
-  nBorderCount(0),
-  pObjectBorders(0),
-  pBindings(&rBindings),
-  nDragOffset(0),
-  nMaxLeft(0),
-  nMaxRight(0),
-  bValid(sal_False),
-  bListening(sal_False),
-  bActive(sal_True)
-
-/* [Description]
-
-   Constructor; Initialize data buffer; controller items are created
-*/
-{
+SvxRuler::SvxRuler(
+            Window* pParent,        // StarView Parent
+            Window* pWin,           // Output window: is used for conversion
+                                    // logical units <-> pixels
+            sal_uInt16 flags,       // Display flags, see ruler.hxx
+            SfxBindings &rBindings, // associated Bindings
+            WinBits nWinStyle) :    // StarView WinBits
+    Ruler(pParent, nWinStyle),
+    pCtrlItem(new SvxRulerItem *[CTRL_ITEM_COUNT]),
+    pLRSpaceItem(0),
+    pMinMaxItem(0),
+    pULSpaceItem(0),
+    pTabStopItem(0),
+    pParaItem(0),
+    pParaBorderItem(0),
+    pPagePosItem(0),
+    pColumnItem(0),
+    pObjectItem(0),
+    pEditWin(pWin),
+    pRuler_Imp(new SvxRuler_Impl),
+    bAppSetNullOffset(sal_False),  // Is the 0-offset of the ruler set by the application?
+    lLogicNullOffset(0),
+    lAppNullOffset(LONG_MAX),
+    lMinFrame(5),
+    lInitialDragPos(0),
+    nFlags(flags),
+    nDragType(NONE),
+    nDefTabType(RULER_TAB_LEFT),
+    nTabCount(0),
+    nTabBufSize(0),
+    lDefTabDist(50),
+    lTabPos(-1),
+    pTabs(0),
+    pIndents(0),
+    pBorders(new RulerBorder[1]), // due to one column tables
+    nBorderCount(0),
+    pObjectBorders(0),
+    pBindings(&rBindings),
+    nDragOffset(0),
+    nMaxLeft(0),
+    nMaxRight(0),
+    bValid(sal_False),
+    bListening(sal_False),
+    bActive(sal_True)
+{
+    /* Constructor; Initialize data buffer; controller items are created */
+
     memset(pCtrlItem, 0, sizeof(SvxRulerItem *) * CTRL_ITEM_COUNT);
 
     rBindings.EnterRegistrations();
 
     // Create Supported Items
     sal_uInt16 i = 0;
-    // Page edges
 
+    // Page edges
     pCtrlItem[i++] = new SvxRulerItem(SID_RULER_LR_MIN_MAX, *this, rBindings);
     if((nWinStyle & WB_VSCROLL) == WB_VSCROLL)
     {
@@ -410,12 +402,8 @@ SvxRuler::SvxRuler
 
 
 SvxRuler::~SvxRuler()
-
-/* [Description]
-
-   Destructor ruler; release internal buffer
-*/
 {
+    /* Destructor ruler; release internal buffer */
     REMOVE_DEBUG_WINDOW
     if(bListening)
         EndListening(*pBindings);
@@ -444,11 +432,7 @@ SvxRuler::~SvxRuler()
     pBindings->LeaveRegistrations();
 }
 
-/* [Description]
-
-   Internal conversion routines
-*/
-
+/* Internal conversion routines */
 long SvxRuler::ConvertHPosPixel(long nVal) const
 {
     return pEditWin->LogicToPixel(Size(nVal, 0)).Width();
@@ -479,7 +463,6 @@ long SvxRuler::ConvertSizePixel(long nVal) const
     return bHorz? ConvertHSizePixel(nVal): ConvertVSizePixel(nVal);
 }
 
-
 inline long SvxRuler::ConvertHPosLogic(long nVal) const
 {
     return pEditWin->PixelToLogic(Size(nVal, 0)).Width();
@@ -512,43 +495,38 @@ inline long SvxRuler::ConvertSizeLogic(long nVal) const
 
 long SvxRuler::PixelHAdjust(long nVal, long nValOld) const
 {
-        if(ConvertHSizePixel(nVal)!=ConvertHSizePixel(nValOld))
-                return  nVal;
-        else
-                return  nValOld;
+    if(ConvertHSizePixel(nVal)!=ConvertHSizePixel(nValOld))
+        return  nVal;
+    else
+        return  nValOld;
 }
 
 long SvxRuler::PixelVAdjust(long nVal, long nValOld) const
 {
-        if(ConvertVSizePixel(nVal)!=ConvertVSizePixel(nValOld))
-                return  nVal;
-        else
-                return  nValOld;
+    if(ConvertVSizePixel(nVal)!=ConvertVSizePixel(nValOld))
+        return  nVal;
+    else
+        return  nValOld;
 }
 
 long SvxRuler::PixelAdjust(long nVal, long nValOld) const
 {
-        if(ConvertSizePixel(nVal)!=ConvertSizePixel(nValOld))
-                return  nVal;
-        else
-                return  nValOld;
+    if(ConvertSizePixel(nVal)!=ConvertSizePixel(nValOld))
+        return  nVal;
+    else
+        return  nValOld;
 }
 
-
 inline sal_uInt16 SvxRuler::GetObjectBordersOff(sal_uInt16 nIdx) const
 {
-    return bHorz? nIdx: nIdx + 2;
+    return bHorz ? nIdx : nIdx + 2;
 }
 
-
-void SvxRuler::UpdateFrame()
-
-/* [Description]
-
-   Update Upper Left edge.
+/*
+    Update Upper Left edge.
    Items are translated into the representation of the ruler.
 */
-
+void SvxRuler::UpdateFrame()
 {
     const sal_uInt16 nMarginStyle =
         ( pRuler_Imp->aProtectItem.IsSizeProtected() ||
@@ -583,30 +561,29 @@ void SvxRuler::UpdateFrame()
                                     lLogicNullOffset + lAppNullOffset);
         SetMargin2( aWidth, nMarginStyle );
     }
-    else
-        if(pULSpaceItem && pPagePosItem)
-        {
-            // relative the upper edge of the surrounding frame
-            const long nOld = lLogicNullOffset;
-            lLogicNullOffset = pColumnItem?
-                pColumnItem->GetLeft(): pULSpaceItem->GetUpper();
-            if(bAppSetNullOffset)
-                lAppNullOffset += lLogicNullOffset - nOld;
-            if(!bAppSetNullOffset || lAppNullOffset == LONG_MAX) {
-                Ruler::SetNullOffset(ConvertVPosPixel(lLogicNullOffset));
-                lAppNullOffset = 0;
-                SetMargin1( 0, nMarginStyle );
-            }
-            else
-                SetMargin1( ConvertVPosPixel( lAppNullOffset ),nMarginStyle );
+    else if(pULSpaceItem && pPagePosItem)
+    {
+        // relative the upper edge of the surrounding frame
+        const long nOld = lLogicNullOffset;
+        lLogicNullOffset = pColumnItem?
+            pColumnItem->GetLeft(): pULSpaceItem->GetUpper();
+        if(bAppSetNullOffset)
+            lAppNullOffset += lLogicNullOffset - nOld;
+        if(!bAppSetNullOffset || lAppNullOffset == LONG_MAX) {
+            Ruler::SetNullOffset(ConvertVPosPixel(lLogicNullOffset));
+            lAppNullOffset = 0;
+            SetMargin1( 0, nMarginStyle );
+        }
+        else
+            SetMargin1( ConvertVPosPixel( lAppNullOffset ),nMarginStyle );
 
-            long lLower = pColumnItem ?
-                pColumnItem->GetRight() : pULSpaceItem->GetLower();
+        long lLower = pColumnItem ?
+            pColumnItem->GetRight() : pULSpaceItem->GetLower();
 
-            SetMargin2(ConvertVPosPixel(pPagePosItem->GetHeight() - lLower -
-                                        lLogicNullOffset + lAppNullOffset),
-                                        nMarginStyle );
-        }
+        SetMargin2(ConvertVPosPixel(pPagePosItem->GetHeight() - lLower -
+                                    lLogicNullOffset + lAppNullOffset),
+                                    nMarginStyle );
+    }
     else
     {
         // turns off the view
@@ -618,7 +595,6 @@ void SvxRuler::UpdateFrame()
         pRuler_Imp->nColLeftPix = (sal_uInt16) ConvertSizePixel(pColumnItem->GetLeft());
         pRuler_Imp->nColRightPix = (sal_uInt16) ConvertSizePixel(pColumnItem->GetRight());
     }
-
 }
 
 void SvxRuler::MouseMove( const MouseEvent& rMEvt )
@@ -648,97 +624,69 @@ void SvxRuler::StartListening_Impl()
     }
 }
 
-void SvxRuler::UpdateFrame
-(
- const SvxLongLRSpaceItem *pItem    // new value LRSpace
-)
-
-/* [Description]
-
-   Store new value LRSpace; delete old ones if possible
-*/
-
+void SvxRuler::UpdateFrame(const SvxLongLRSpaceItem *pItem) // new value LRSpace
 {
-  if(bActive)
-  {
-    delete pLRSpaceItem; pLRSpaceItem = 0;
-    if(pItem)
-        pLRSpaceItem = new SvxLongLRSpaceItem(*pItem);
-    StartListening_Impl();
-  }
+    /* Store new value LRSpace; delete old ones if possible */
+    if(bActive)
+    {
+        delete pLRSpaceItem;
+        pLRSpaceItem = 0;
+        if(pItem)
+            pLRSpaceItem = new SvxLongLRSpaceItem(*pItem);
+        StartListening_Impl();
+    }
 }
 
-
-void SvxRuler::UpdateFrameMinMax
-(
- const SfxRectangleItem *pItem  // value for MinMax
-)
-
-/* [Description]
-
-   Set new value for MinMax; delete old ones if possible
-*/
-
+void SvxRuler::UpdateFrameMinMax(const SfxRectangleItem *pItem) // value for MinMax
 {
+    /* Set new value for MinMax; delete old ones if possible */
     if(bActive)
     {
-        delete pMinMaxItem; pMinMaxItem = 0;
+        delete pMinMaxItem;
+        pMinMaxItem = 0;
         if(pItem)
             pMinMaxItem = new SfxRectangleItem(*pItem);
     }
 }
 
 
-void SvxRuler::UpdateFrame
-(
- const SvxLongULSpaceItem *pItem    // new value
-)
-
-/* [Description]
-
-   Update Right/bottom margin
-*/
-
-
+void SvxRuler::UpdateFrame(const SvxLongULSpaceItem *pItem) // new value
 {
-  if(bActive && !bHorz)
-  {
-    delete pULSpaceItem; pULSpaceItem = 0;
-    if(pItem)
-        pULSpaceItem = new SvxLongULSpaceItem(*pItem);
-    StartListening_Impl();
-  }
+    /* Update Right/bottom margin */
+    if(bActive && !bHorz)
+    {
+        delete pULSpaceItem;
+        pULSpaceItem = 0;
+        if(pItem)
+            pULSpaceItem = new SvxLongULSpaceItem(*pItem);
+        StartListening_Impl();
+    }
 }
 
 void SvxRuler::Update( const SvxProtectItem* pItem )
 {
-    if( pItem ) pRuler_Imp->aProtectItem = *pItem;
+    if( pItem )
+        pRuler_Imp->aProtectItem = *pItem;
 }
 
 void SvxRuler::UpdateTextRTL(const SfxBoolItem* pItem)
 {
-  if(bActive && bHorz)
-  {
-    delete pRuler_Imp->pTextRTLItem; pRuler_Imp->pTextRTLItem = 0;
-    if(pItem)
-        pRuler_Imp->pTextRTLItem = new SfxBoolItem(*pItem);
-    SetTextRTL(pRuler_Imp->pTextRTLItem && pRuler_Imp->pTextRTLItem->GetValue());
-    StartListening_Impl();
-  }
+    if(bActive && bHorz)
+    {
+        delete pRuler_Imp->pTextRTLItem;
+        pRuler_Imp->pTextRTLItem = 0;
+        if(pItem)
+            pRuler_Imp->pTextRTLItem = new SfxBoolItem(*pItem);
+        SetTextRTL(pRuler_Imp->pTextRTLItem && pRuler_Imp->pTextRTLItem->GetValue());
+        StartListening_Impl();
+    }
 }
 
-void SvxRuler::Update
-(
- const SvxColumnItem *pItem,  // new value
- sal_uInt16 nSID //Slot Id to identify NULL items
-)
-
-/* [Description]
-
-   Set new value for column view
-*/
-
+void SvxRuler::Update(
+                const SvxColumnItem *pItem,  // new value
+                sal_uInt16 nSID) //Slot Id to identify NULL items
 {
+    /* Set new value for column view */
     if(bActive)
     {
         if(pItem)
@@ -766,12 +714,8 @@ void SvxRuler::Update
 
 
 void SvxRuler::UpdateColumns()
-
-/* [Description]
-
-   Update column view
-*/
 {
+    /* Update column view */
     if(pColumnItem && pColumnItem->Count() > 1)
     {
         if( nBorderCount < pColumnItem->Count())
@@ -788,9 +732,8 @@ void SvxRuler::UpdateColumns()
             _nFlags |= RULER_BORDER_MOVEABLE;
         if( pColumnItem->IsTable() )
             _nFlags |= RULER_BORDER_TABLE;
-        else
-            if ( !bProtectColumns )
-                _nFlags |= RULER_BORDER_SIZEABLE;
+        else if ( !bProtectColumns )
+            _nFlags |= RULER_BORDER_SIZEABLE;
 
         sal_uInt16 nBorders = pColumnItem->Count();
         if(!pRuler_Imp->bIsTableRows)
@@ -827,15 +770,9 @@ void SvxRuler::UpdateColumns()
     }
 }
 
-
 void SvxRuler::UpdateObject()
-
-/* [Description]
-
-   Update view of object representation
-*/
-
 {
+    /* Update view of object representation */
     if(pObjectItem)
     {
         DBG_ASSERT(pObjectBorders, "no Buffer");
@@ -862,24 +799,20 @@ void SvxRuler::UpdateObject()
     }
 }
 
-
 void SvxRuler::UpdatePara()
+{
 
-/* [Description]
-
-   Update the view for paragraph indents:
-   Left margin, first line indent, right margin paragraph update
-   pIndents[0] = Buffer for old intent
-   pIndents[1] = Buffer for old intent
-   pIndents[INDENT_FIRST_LINE] = First line indent
-   pIndents[3] = left margin
-   pIndents[4] = right margin
-   pIndents[5] = left border distance
-   pIndents[6] = right border distance
-
-*/
+    /*  Update the view for paragraph indents:
+        Left margin, first line indent, right margin paragraph update
+        pIndents[0] = Buffer for old intent
+        pIndents[1] = Buffer for old intent
+        pIndents[INDENT_FIRST_LINE] = First line indent
+        pIndents[3] = left margin
+        pIndents[4] = right margin
+        pIndents[5] = left border distance
+        pIndents[6] = right border distance
+    */
 
-{
     // Dependence on PagePosItem
     if(pParaItem && pPagePosItem && !pObjectItem)
     {
@@ -888,18 +821,22 @@ void SvxRuler::UpdatePara()
         long nLeftFrameMargin = GetLeftFrameMargin();
         long nRightFrameMargin = GetRightFrameMargin();
         if(bRTLText)
+        {
             pIndents[INDENT_FIRST_LINE].nPos =
                 ConvertHPosPixel(
                 nRightFrameMargin -
                 pParaItem->GetTxtLeft() -
                 pParaItem->GetTxtFirstLineOfst() + lAppNullOffset );
+        }
         else
+        {
             pIndents[INDENT_FIRST_LINE].nPos =
                 ConvertHPosPixel(
                     nLeftFrameMargin +
                     pParaItem->GetTxtLeft() +
                     pParaItem->GetTxtFirstLineOfst() +
                     lAppNullOffset);
+        }
         if( pParaItem->IsAutoFirst() )
             pIndents[INDENT_FIRST_LINE].nStyle |= RULER_STYLE_INVISIBLE;
         else
@@ -956,70 +893,59 @@ void SvxRuler::UpdatePara()
     }
 }
 
-
-void SvxRuler::UpdatePara
-(
- const SvxLRSpaceItem *pItem    // new value of paragraph indents
-)
-
-/* [Description]
-
-   Store new value of paragraph indents
-*/
-
+void SvxRuler::UpdatePara(const SvxLRSpaceItem *pItem) // new value of paragraph indents
 {
+    /* Store new value of paragraph indents */
     if(bActive)
     {
-        delete pParaItem; pParaItem = 0;
+        delete pParaItem;
+        pParaItem = 0;
         if(pItem)
             pParaItem = new SvxLRSpaceItem(*pItem);
         StartListening_Impl();
     }
 }
-void SvxRuler::UpdateParaBorder(const SvxLRSpaceItem * pItem )
-
-/* [Description]
-
-   Border distance
-*/
 
+void SvxRuler::UpdateParaBorder(const SvxLRSpaceItem * pItem )
 {
+    /* Border distance */
     if(bActive)
     {
-        delete pParaBorderItem; pParaBorderItem = 0;
+        delete pParaBorderItem;
+        pParaBorderItem = 0;
         if(pItem)
             pParaBorderItem = new SvxLRSpaceItem(*pItem);
         StartListening_Impl();
     }
 }
 
-
 void SvxRuler::UpdatePage()
-
-/* [Description]
-
-   Update view of position and width of page
-*/
-
 {
+    /* Update view of position and width of page */
     if(pPagePosItem)
     {
         // all objects are automatically adjusted
         if(bHorz)
+        {
             SetPagePos(
                 pEditWin->LogicToPixel(pPagePosItem->GetPos()).X(),
                 pEditWin->LogicToPixel(Size(pPagePosItem->GetWidth(),0)).
                 Width());
+        }
         else
+        {
             SetPagePos(
                 pEditWin->LogicToPixel(pPagePosItem->GetPos()).Y(),
                 pEditWin->LogicToPixel(Size(0, pPagePosItem->GetHeight())).
                 Height());
+        }
         if(bAppSetNullOffset)
             SetNullOffset(ConvertSizePixel(-lAppNullOffset + lLogicNullOffset));
     }
     else
+    {
         SetPagePos();
+    }
 
     long lPos = 0;
     Point aOwnPos = GetPosPixel();
@@ -1039,8 +965,8 @@ void SvxRuler::UpdatePage()
         lPos= bHorz ? aPos.X() : aPos.Y();
     }
 
-// Unfortunately, we get the offset of the edit window to the ruler never
-// through a status message. So we set it ourselves if necessary.
+    // Unfortunately, we get the offset of the edit window to the ruler never
+    // through a status message. So we set it ourselves if necessary.
     if(lPos!=pRuler_Imp->lOldWinPos)
     {
         pRuler_Imp->lOldWinPos=lPos;
@@ -1048,87 +974,53 @@ void SvxRuler::UpdatePage()
     }
 }
 
-
-void SvxRuler::Update
-(
- const SvxPagePosSizeItem *pItem // new value of page attributes
-)
-
-/* [Description]
-
-   Store new value of page attributes
-*/
-
+void SvxRuler::Update(const SvxPagePosSizeItem *pItem) // new value of page attributes
 {
+    /* Store new value of page attributes */
     if(bActive)
     {
-        delete pPagePosItem; pPagePosItem = 0;
+        delete pPagePosItem;
+        pPagePosItem = 0;
         if(pItem)
             pPagePosItem = new SvxPagePosSizeItem(*pItem);
         StartListening_Impl();
     }
 }
 
-
-//
-
-void SvxRuler::SetDefTabDist
-(
- long l  // New distance for DefaultTabs in App-Metrics
-)
-
-/* [Description]
-
-   New distance is set for DefaultTabs
-*/
-
+void SvxRuler::SetDefTabDist(long inDefTabDist)  // New distance for DefaultTabs in App-Metrics
 {
-
-    lDefTabDist = l;
+    /* New distance is set for DefaultTabs */
+    lDefTabDist = inDefTabDist;
     UpdateTabs();
 }
 
-
 sal_uInt16 ToSvTab_Impl(SvxTabAdjust eAdj)
-
-/* [Description]
-
-   Internal convertion routine between SV-Tab.-Enum and Svx
-*/
-
 {
+    /* Internal convertion routine between SV-Tab.-Enum and Svx */
     switch(eAdj) {
-    case SVX_TAB_ADJUST_LEFT:    return RULER_TAB_LEFT;
-    case SVX_TAB_ADJUST_RIGHT:   return RULER_TAB_RIGHT;
-    case SVX_TAB_ADJUST_DECIMAL: return RULER_TAB_DECIMAL;
-    case SVX_TAB_ADJUST_CENTER:  return RULER_TAB_CENTER;
-    case SVX_TAB_ADJUST_DEFAULT: return RULER_TAB_DEFAULT;
-    default: ;//prevent warning
+        case SVX_TAB_ADJUST_LEFT:    return RULER_TAB_LEFT;
+        case SVX_TAB_ADJUST_RIGHT:   return RULER_TAB_RIGHT;
+        case SVX_TAB_ADJUST_DECIMAL: return RULER_TAB_DECIMAL;
+        case SVX_TAB_ADJUST_CENTER:  return RULER_TAB_CENTER;
+        case SVX_TAB_ADJUST_DEFAULT: return RULER_TAB_DEFAULT;
+        default: ; //prevent warning
     }
     return 0;
 }
 
-
 SvxTabAdjust ToAttrTab_Impl(sal_uInt16 eAdj)
 {
     switch(eAdj) {
-    case RULER_TAB_LEFT:    return SVX_TAB_ADJUST_LEFT    ;
-    case RULER_TAB_RIGHT:   return SVX_TAB_ADJUST_RIGHT   ;
-    case RULER_TAB_DECIMAL: return SVX_TAB_ADJUST_DECIMAL ;
-    case RULER_TAB_CENTER:  return SVX_TAB_ADJUST_CENTER  ;
-    case RULER_TAB_DEFAULT: return SVX_TAB_ADJUST_DEFAULT ;
+        case RULER_TAB_LEFT:    return SVX_TAB_ADJUST_LEFT    ;
+        case RULER_TAB_RIGHT:   return SVX_TAB_ADJUST_RIGHT   ;
+        case RULER_TAB_DECIMAL: return SVX_TAB_ADJUST_DECIMAL ;
+        case RULER_TAB_CENTER:  return SVX_TAB_ADJUST_CENTER  ;
+        case RULER_TAB_DEFAULT: return SVX_TAB_ADJUST_DEFAULT ;
     }
     return SVX_TAB_ADJUST_LEFT;
 }
 
-
 void SvxRuler::UpdateTabs()
-
-/* [Description]
-
-   Update of Tabs
-*/
-
 {
     if(IsDrag())
         return;
@@ -1257,21 +1149,13 @@ void SvxRuler::UpdateTabs()
     }
 }
 
-
-void SvxRuler::Update
-(
- const SvxTabStopItem *pItem    // new value for tabs
-)
-
-/* [Description]
-
-   Store new value for tabs; delete old ones if possible
-*/
-
+void SvxRuler::Update(const SvxTabStopItem *pItem) // new value for tabs
 {
+    /* Store new value for tabs; delete old ones if possible */
     if(bActive)
     {
-        delete pTabStopItem; pTabStopItem = 0;
+        delete pTabStopItem;
+        pTabStopItem = 0;
         if(pItem)
         {
             pTabStopItem = new SvxTabStopItem(*pItem);
@@ -1282,32 +1166,20 @@ void SvxRuler::Update
     }
 }
 
-
-void SvxRuler::Update
-(
- const SvxObjectItem *pItem             // new value for objects
-)
-
-/* [Description]
-
-   Store new value for objects
-*/
-
+void SvxRuler::Update(const SvxObjectItem *pItem) // new value for objects
 {
+    /* Store new value for objects */
     if(bActive)
     {
-        delete pObjectItem; pObjectItem = 0;
+        delete pObjectItem;
+        pObjectItem = 0;
         if(pItem)
             pObjectItem = new SvxObjectItem(*pItem);
         StartListening_Impl();
     }
 }
 
-
-void SvxRuler::SetNullOffsetLogic
-(
- long lVal  // Setting of the logic NullOffsets
-)
+void SvxRuler::SetNullOffsetLogic(long lVal) // Setting of the logic NullOffsets
 {
     lAppNullOffset = lLogicNullOffset - lVal;
     bAppSetNullOffset = sal_True;
@@ -1315,15 +1187,9 @@ void SvxRuler::SetNullOffsetLogic
     Update();
 }
 
-
 void SvxRuler::Update()
-
-/* [Description]
-
-   Perform update of view
-*/
-
 {
+    /* Perform update of view */
     if(IsDrag())
         return;
     UpdatePage();
@@ -1339,7 +1205,6 @@ void SvxRuler::Update()
       UpdateTabs();
 }
 
-
 long SvxRuler::GetPageWidth() const
 {
     if ( !pPagePosItem )
@@ -1347,29 +1212,17 @@ long SvxRuler::GetPageWidth() const
     return bHorz ? pPagePosItem->GetWidth() : pPagePosItem->GetHeight();
 }
 
-
 inline long SvxRuler::GetFrameLeft() const
-
-/* [Description]
-
-   Get Left margin in Pixels
-*/
-
-
 {
-    return  bAppSetNullOffset?
-            GetMargin1() + ConvertSizePixel(lLogicNullOffset):
+    /* Get Left margin in Pixels */
+    return  bAppSetNullOffset ?
+            GetMargin1() + ConvertSizePixel(lLogicNullOffset) :
             Ruler::GetNullOffset();
 }
 
 inline void SvxRuler::SetFrameLeft(long l)
-
-/* [Description]
-
-   Set Left margin in Pixels
-*/
-
 {
+    /* Set Left margin in Pixels */
     sal_Bool bProtectColumns =
         pRuler_Imp->aProtectItem.IsSizeProtected() ||
         pRuler_Imp->aProtectItem.IsPosProtected();
@@ -1380,52 +1233,28 @@ inline void SvxRuler::SetFrameLeft(long l)
         Ruler::SetNullOffset(l);
 }
 
-
 long SvxRuler::GetFirstLineIndent() const
-
-/* [Description]
-
-   Get First-line indent in pixels
-*/
-
 {
+    /* Get First-line indent in pixels */
     return pParaItem? pIndents[INDENT_FIRST_LINE].nPos: GetMargin1();
 }
 
-
 long SvxRuler::GetLeftIndent() const
-
-/* [Description]
-
-   Get Left paragraph margin in Pixels
-*/
-
 {
+    /* Get Left paragraph margin in Pixels */
     return pParaItem? pIndents[INDENT_LEFT_MARGIN].nPos: GetMargin1();
 }
 
-
-
 long SvxRuler::GetRightIndent() const
-
-/* [Description]
-
-   Get Right paragraph margin in Pixels
-*/
-
 {
+    /* Get Right paragraph margin in Pixels */
     return pParaItem? pIndents[INDENT_RIGHT_MARGIN].nPos: GetMargin2();
 }
 
 
 long SvxRuler::GetLogicRightIndent() const
-
-/* [Description]
-
-   Get Right paragraph margin in Logic
-*/
-
 {
+    /* Get Right paragraph margin in Logic */
     return pParaItem ? GetRightFrameMargin()-pParaItem->GetRight() : GetRightFrameMargin();
 }
 
@@ -1462,13 +1291,8 @@ inline long SvxRuler::GetRightMax() const
 
 
 long SvxRuler::GetRightFrameMargin() const
-
-/* [Description]
-
-   Get right frame margin (in logical units)
-*/
-
 {
+    /* Get right frame margin (in logical units) */
     if(pColumnItem)
     {
         if(!IsActLastColumn( sal_True ))
@@ -1506,14 +1330,12 @@ long SvxRuler::GetRightFrameMargin() const
 #define TAB_FLAG ( pColumnItem && pColumnItem->IsTable() )
 
 long SvxRuler::GetCorrectedDragPos( sal_Bool bLeft, sal_Bool bRight )
-
-/* [Description]
-
-   Corrects the position within the calculated limits. The limit values are in
-   pixels relative to the page edge.
-*/
-
 {
+    /*
+        Corrects the position within the calculated limits. The limit values are in
+        pixels relative to the page edge.
+    */
+
     const long lNullPix = Ruler::GetNullOffset();
     long lDragPos = GetDragPos() + lNullPix;
 ADD_DEBUG_TEXT("lDragPos: ", OUString::number(lDragPos))
@@ -1525,33 +1347,19 @@ ADD_DEBUG_TEXT("lDragPos: ", OUString::number(lDragPos))
     return lDragPos - lNullPix;
 }
 
-
-
-void ModifyTabs_Impl
-(
- sal_uInt16 nCount,                             // Number of Tabs
- RulerTab *pTabs,                               // Tab buffer
- long lDiff                                     // difference to be added
- )
-
-/* [Description]
-
-   Helper function, move all the tabs by a fixed value
-*/
+void ModifyTabs_Impl( sal_uInt16 nCount, // Number of Tabs
+                      RulerTab *pTabs,   // Tab buffer
+                      long lDiff)        // difference to be added
 {
+    /* Helper function, move all the tabs by a fixed value */
     if( pTabs )
-        for(sal_uInt16 i = 0; i < nCount; ++i)  pTabs[i].nPos += lDiff;
+        for(sal_uInt16 i = 0; i < nCount; ++i)
+            pTabs[i].nPos += lDiff;
 }
 
-
-
 void SvxRuler::DragMargin1()
-
-/* [Description]
-
-   Dragging the left edge of frame
-*/
 {
+    /* Dragging the left edge of frame */
     const long lDragPos = GetCorrectedDragPos( !TAB_FLAG || !NEG_FLAG, sal_True );
     DrawLine_Impl(lTabPos, ( TAB_FLAG && NEG_FLAG ) ? 3 : 7, bHorz);
     if(pColumnItem&&
@@ -1559,6 +1367,7 @@ void SvxRuler::DragMargin1()
         DragBorders();
     AdjustMargin1(lDragPos);
 }
+
 void SvxRuler::AdjustMargin1(long lDiff)
 {
     const long nOld = bAppSetNullOffset? GetMargin1(): GetNullOffset();
@@ -1674,14 +1483,9 @@ void SvxRuler::AdjustMargin1(long lDiff)
     }
 }
 
-
 void SvxRuler::DragMargin2()
-
-/* [Description]
-
-   Dragging the right edge of frame
-*/
 {
+    /* Dragging the right edge of frame */
     const long lDragPos = GetCorrectedDragPos( sal_True, !TAB_FLAG || !NEG_FLAG);
     DrawLine_Impl(lTabPos, ( TAB_FLAG && NEG_FLAG ) ? 5 : 7, bHorz);
     long lDiff = lDragPos - GetMargin2();
@@ -1705,14 +1509,9 @@ void SvxRuler::DragMargin2()
     }
 }
 
-
 void SvxRuler::DragIndents()
-
-/* [Description]
-
-   Dragging the paragraph indents
-*/
 {
+    /* Dragging the paragraph indents */
     const long lDragPos = NEG_FLAG ? GetDragPos() : GetCorrectedDragPos();
     const sal_uInt16 nIdx = GetDragAryPos()+INDENT_GAP;
     const long lDiff = pIndents[nIdx].nPos - lDragPos;
@@ -1729,15 +1528,12 @@ void SvxRuler::DragIndents()
     DrawLine_Impl(lTabPos, 1, bHorz);
 }
 
-
 void SvxRuler::DrawLine_Impl(long &_lTabPos, int nNew, sal_Bool Hori)
-
-/* [Description]
-
-   Output routine for the ledger line when moving tabs, tables and other
-   columns
-*/
 {
+    /*
+       Output routine for the ledger line when moving tabs, tables and other
+       columns
+    */
     if(Hori)
     {
         const long nHeight = pEditWin->GetOutputSize().Height();
@@ -1786,17 +1582,9 @@ void SvxRuler::DrawLine_Impl(long &_lTabPos, int nNew, sal_Bool Hori)
     }
 }
 
-
-
-
 void SvxRuler::DragTabs()
-
-/* [Description]
-
-   Dragging of Tabs
-*/
 {
-
+    /* Dragging of Tabs */
     long lDragPos = GetCorrectedDragPos(sal_True, sal_False);
 
     sal_uInt16 nIdx = GetDragAryPos()+TAB_GAP;
@@ -1845,8 +1633,6 @@ void SvxRuler::DragTabs()
     SetTabs(nTabCount, pTabs+TAB_GAP);
 }
 
-
-
 void SvxRuler::SetActive(sal_Bool bOn)
 {
     if(bOn)
@@ -1869,20 +1655,11 @@ void SvxRuler::SetActive(sal_Bool bOn)
     bActive = bOn;
 }
 
-
-
-
-void SvxRuler::UpdateParaContents_Impl
-(
- long l,           // Difference
- UpdateType eType  // Art (all, left or right)
-)
-
-/* [Description]
-
-   Helper function; carry Tabs and Paragraph Margins
-*/
+void SvxRuler::UpdateParaContents_Impl(
+                            long l,            // Difference
+                            UpdateType eType)  // Art (all, left or right)
 {
+    /* Helper function; carry Tabs and Paragraph Margins */
     switch(eType) {
     case MOVE_RIGHT:
         pIndents[INDENT_RIGHT_MARGIN].nPos += l;
@@ -1906,14 +1683,9 @@ void SvxRuler::UpdateParaContents_Impl
     SetIndents(INDENT_COUNT, pIndents+INDENT_GAP);
 }
 
-
 void SvxRuler::DragBorders()
-
-/* [Description]
-
-   Dragging of Borders (Tables and other columns)
-*/
 {
+    /* Dragging of Borders (Tables and other columns) */
     sal_Bool bLeftIndentsCorrected = sal_False, bRightIndentsCorrected = sal_False;
     int nIdx;
 
@@ -2124,14 +1896,9 @@ ADD_DEBUG_TEXT("lLastLMargin: ", OUString::number(pRuler_Imp->lLastLMargin))
     SetBorders(pColumnItem->Count()-1, pBorders);
 }
 
-
 void SvxRuler::DragObjectBorder()
-
-/* [Description]
-
-   Dragging of object edges
-*/
 {
+    /* Dragging of object edges */
     if(RULER_DRAGSIZE_MOVE == GetDragSize())
     {
         const long lPos = GetCorrectedDragPos();
@@ -2143,14 +1910,9 @@ void SvxRuler::DragObjectBorder()
     }
 }
 
-
 void SvxRuler::ApplyMargins()
-
-/* [Description]
-
-   Applying margins; changed by dragging.
-*/
 {
+    /* Applying margins; changed by dragging. */
     const SfxPoolItem *pItem = 0;
     sal_uInt16 nId = SID_ATTR_LONG_LRSPACE;
     if(bHorz)
@@ -2207,14 +1969,9 @@ void SvxRuler::ApplyMargins()
         UpdateTabs();
 }
 
-
 void SvxRuler::ApplyIndents()
-
-/* [Description]
-
-   Applying paragraph settings; changed by dragging.
-*/
 {
+    /* Applying paragraph settings; changed by dragging. */
     long nNewTxtLeft;
     if(pColumnItem&&!IsActFirstColumn( sal_True ))
     {
@@ -2316,14 +2073,9 @@ void SvxRuler::ApplyIndents()
     UpdateTabs();
 }
 
-
 void SvxRuler::ApplyTabs()
-
-/* [Description]
-
-   Apply tab settings, changed by dragging.
-*/
 {
+    /* Apply tab settings, changed by dragging. */
     sal_Bool bRTL = pRuler_Imp->pTextRTLItem && pRuler_Imp->pTextRTLItem->GetValue();
     const sal_uInt16 nCoreIdx = GetDragAryPos();
     if(IsDragDelete())
@@ -2404,14 +2156,9 @@ void SvxRuler::ApplyTabs()
     UpdateTabs();
 }
 
-
 void SvxRuler::ApplyBorders()
-
-/* [Description]
-
-   Applying (table) column settings; changed by dragging.
-*/
 {
+    /* Applying (table) column settings; changed by dragging. */
     if(pColumnItem->IsTable())
     {
         long l = GetFrameLeft();
@@ -2455,12 +2202,9 @@ void SvxRuler::ApplyBorders()
 }
 
 void SvxRuler::ApplyObject()
-
-/* [Description]
-
-   Applying object settings, changed by dragging.
-*/
 {
+    /* Applying object settings, changed by dragging. */
+
     // to the page margin
     long nMargin = pLRSpaceItem? pLRSpaceItem->GetLeft(): 0;
     pObjectItem->SetStartX(
@@ -2484,13 +2228,11 @@ void SvxRuler::ApplyObject()
 }
 
 void SvxRuler::PrepareProportional_Impl(RulerType eType)
-
-/* [Description]
-
-   Preparation proportional dragging, and it is calculated based on the
-   proportional share of the total width in parts per thousand.
-*/
 {
+    /*
+       Preparation proportional dragging, and it is calculated based on the
+       proportional share of the total width in parts per thousand.
+    */
     pRuler_Imp->nTotalDist = GetMargin2();
     switch((int)eType)
     {
@@ -2611,21 +2353,17 @@ void SvxRuler::PrepareProportional_Impl(RulerType eType)
     }
 }
 
-
 void SvxRuler::EvalModifier()
+{
+    /*
+    Eval Drag Modifier
+    Shift: move linear
+    Control: move proportional
+    Shift+Control: Table: only current line
+    Alt: dimension arrows (not implemented) //!!
 
-/* [Description]
-
-   Eval Drag Modifier
-
-   Shift: move linear
-   Control: move proportional
-   Shift+Control: Table: only current line
-   Alt: dimension arrows (not implemented) //!!
+    */
 
-*/
-
-{
     sal_uInt16 nModifier = GetDragModifier();
     if(pRuler_Imp->bIsTableRows)
     {
@@ -2657,15 +2395,9 @@ void SvxRuler::EvalModifier()
     }
 }
 
-
 void SvxRuler::Click()
-
-/* [Description]
-
-   Overloaded handler SV; sets Tab per dispatcher call
-*/
-
 {
+    /* Overloaded handler SV; sets Tab per dispatcher call */
     Ruler::Click();
     if( bActive )
     {
@@ -2713,35 +2445,25 @@ void SvxRuler::Click()
     }
 }
 
-
-sal_Bool SvxRuler::CalcLimits
-(
- long &nMax1,                                   // minimum value to be set
- long &nMax2,                                   // minimum value to be set
- sal_Bool
-) const
-
-/* [Description]
-
-   Default implementation of the virtual function; the application can be
-   overloaded to implement customized limits. The values are based on the page.
-*/
+sal_Bool SvxRuler::CalcLimits ( long &nMax1,    // minimum value to be set
+                                long &nMax2,    // minimum value to be set
+                                sal_Bool ) const
 {
+    /*
+       Default implementation of the virtual function; the application can be
+       overloaded to implement customized limits. The values are based on the page.
+    */
     nMax1 = LONG_MIN;
     nMax2 = LONG_MAX;
     return sal_False;
 }
 
-
 void SvxRuler::CalcMinMax()
-
-/* [Description]
-
-   Calculates the limits for dragging; which are in pixels relative to the
-   page edge
-*/
-
 {
+    /*
+       Calculates the limits for dragging; which are in pixels relative to the
+       page edge
+    */
     sal_Bool bRTL = pRuler_Imp->pTextRTLItem && pRuler_Imp->pTextRTLItem->GetValue();
     const long lNullPix = ConvertPosPixel(lLogicNullOffset);
     pRuler_Imp->lMaxLeftLogic=pRuler_Imp->lMaxRightLogic=-1;
@@ -3279,22 +3001,18 @@ void SvxRuler::CalcMinMax()
 #endif
 }
 
-
 long SvxRuler::StartDrag()
+{
+    /*
+       Beginning of a drag operation (SV-handler) evaluates modifier and
+       calculated values
 
-/* [Description]
-
-   Beginning of a drag operation (SV-handler) evaluates modifier and
-   calculated values
-
-   [Cross-reference]
+       [Cross-reference]
 
-   <SvxRuler::EvalModifier()>
-   <SvxRuler::CalcMinMax()>
-   <SvxRuler::EndDrag()>
-*/
-
-{
+       <SvxRuler::EvalModifier()>
+       <SvxRuler::CalcMinMax()>
+       <SvxRuler::EndDrag()>
+    */
     sal_Bool bContentProtected = pRuler_Imp->aProtectItem.IsCntntProtected();
     if(!bValid)
         return sal_False;
@@ -3362,14 +3080,9 @@ long SvxRuler::StartDrag()
     return bOk;
 }
 
-
 void  SvxRuler::Drag()
-
-/* [Description]
-
-   SV-Draghandler
-*/
 {
+    /* SV-Draghandler */
     if(IsDragCanceled())
     {
         Ruler::Drag();
@@ -3401,16 +3114,13 @@ void  SvxRuler::Drag()
     Ruler::Drag();
 }
 
-
 void SvxRuler::EndDrag()
-
-/* [Description]
-
-   SV-handler; is called when ending the dragging. Triggers the updating of data
-   on the application, by calling the respective Apply...() methods to send the
-   data to the application.
-*/
 {
+    /*
+       SV-handler; is called when ending the dragging. Triggers the updating of data
+       on the application, by calling the respective Apply...() methods to send the
+       data to the application.
+    */
     const sal_Bool bUndo = IsDragCanceled();
     const long lPos = GetDragPos();
     DrawLine_Impl(lTabPos, 6, bHorz);
@@ -3462,22 +3172,19 @@ void SvxRuler::EndDrag()
     nDragType = NONE;
     Ruler::EndDrag();
     if(bUndo)
+    {
         for(sal_uInt16 i=0;i<pRuler_Imp->nControlerItems;i++)
         {
             pCtrlItem[i]->ClearCache();
             pCtrlItem[i]->GetBindings().Invalidate(pCtrlItem[i]->GetId());
         }
+    }
 }
 
-
 void SvxRuler::ExtraDown()
-
-/* [Description]
-
-   Overloaded SV method, sets the new type for the Default tab.
-*/
-
 {
+    /* Overloaded SV method, sets the new type for the Default tab. */
+
     // Switch Tab Type
     if(pTabStopItem &&
         (nFlags & SVXRULER_SUPPORT_TABS) ==        SVXRULER_SUPPORT_TABS) {
@@ -3489,16 +3196,13 @@ void SvxRuler::ExtraDown()
     Ruler::ExtraDown();
 }
 
-
 void SvxRuler::Notify(SfxBroadcaster&, const SfxHint& rHint)
-
-/* [Description]
-
-   Report through the bindings that the status update is completed. The ruler
-   updates its appearance and gets registered again in the bindings.
-*/
-
 {
+    /*
+       Report through the bindings that the status update is completed. The ruler
+       updates its appearance and gets registered again in the bindings.
+    */
+
     // start update
     if(bActive &&
         rHint.Type() == TYPE(SfxSimpleHint) &&
@@ -3512,27 +3216,17 @@ void SvxRuler::Notify(SfxBroadcaster&, const SfxHint& rHint)
 
 
 IMPL_LINK_INLINE_START( SvxRuler, MenuSelect, Menu *, pMenu )
-
-/* [Description]
-
-   Handler of the context menus for switching the unit of measurement
-*/
-
 {
+    /* Handler of the context menus for switching the unit of measurement */
+
     SetUnit(FieldUnit(pMenu->GetCurItemId()));
     return 0;
 }
 IMPL_LINK_INLINE_END( SvxRuler, MenuSelect, Menu *, pMenu )
 
-
 IMPL_LINK( SvxRuler, TabMenuSelect, Menu *, pMenu )
-
-/* [Description]
-
-   Handler of the tab menu for setting the type
-*/
-
 {
+    /* Handler of the tab menu for setting the type */
     if(pTabStopItem && pTabStopItem->Count() > pRuler_Imp->nIdx)
     {
         SvxTabStop aTabStop = (*pTabStopItem)[pRuler_Imp->nIdx];
@@ -3547,15 +3241,9 @@ IMPL_LINK( SvxRuler, TabMenuSelect, Menu *, pMenu )
     return 0;
 }
 
-
 void SvxRuler::Command( const CommandEvent& rCEvt )
-
-/* [Description]
-
-   Mouse context menu for switching the unit of measurement
-*/
-
 {
+    /* Mouse context menu for switching the unit of measurement */
     if ( COMMAND_CONTEXTMENU == rCEvt.GetCommand() )
     {
         CancelDrag();
@@ -3622,9 +3310,9 @@ void SvxRuler::Command( const CommandEvent& rCEvt )
         Ruler::Command( rCEvt );
 }
 
-
 sal_uInt16 SvxRuler::GetActRightColumn(
-    sal_Bool bForceDontConsiderHidden, sal_uInt16 nAct ) const
+                        sal_Bool bForceDontConsiderHidden,
+                        sal_uInt16 nAct ) const
 {
     if( nAct == USHRT_MAX )
         nAct = pColumnItem->GetActColumn();
@@ -3643,10 +3331,9 @@ sal_uInt16 SvxRuler::GetActRightColumn(
     return USHRT_MAX;
 }
 
-
-
 sal_uInt16 SvxRuler::GetActLeftColumn(
-    sal_Bool bForceDontConsiderHidden, sal_uInt16 nAct ) const
+                        sal_Bool bForceDontConsiderHidden,
+                        sal_uInt16 nAct ) const
 {
     if(nAct==USHRT_MAX)
         nAct=pColumnItem->GetActColumn();
@@ -3666,15 +3353,16 @@ sal_uInt16 SvxRuler::GetActLeftColumn(
     return USHRT_MAX;
 }
 
-
 sal_Bool SvxRuler::IsActLastColumn(
-    sal_Bool bForceDontConsiderHidden, sal_uInt16 nAct) const
+                        sal_Bool bForceDontConsiderHidden,
+                        sal_uInt16 nAct) const
 {
     return GetActRightColumn(bForceDontConsiderHidden, nAct)==USHRT_MAX;
 }
 
 sal_Bool SvxRuler::IsActFirstColumn(
-    sal_Bool bForceDontConsiderHidden, sal_uInt16 nAct) const
+                        sal_Bool bForceDontConsiderHidden,
+                        sal_uInt16 nAct) const
 {
     return GetActLeftColumn(bForceDontConsiderHidden, nAct)==USHRT_MAX;
 }
commit 462799e61432a62022ca0b521f62e94e4acbd37f
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Mon Jul 22 18:41:14 2013 +0200

    just rename header define
    
    Change-Id: I90053c4d99d47939f35b084b4d2995bebd5e8d63

diff --git a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
index 366c02a..27df39d 100644
--- a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
+++ b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
@@ -8,8 +8,8 @@
  *
  */
 
-#ifndef ANOVA_ONE_FACTOR_DIALOG_HXX
-#define ANOVA_ONE_FACTOR_DIALOG_HXX
+#ifndef ANALYSIS_OF_VARIANCE_DIALOG_HXX
+#define ANALYSIS_OF_VARIANCE_DIALOG_HXX
 
 #include "global.hxx"
 #include "address.hxx"
commit ba17605d5e75dc926c3f7c61795c77d855aa3458
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Mon Jul 22 18:35:07 2013 +0200

    Add ANOVA (analysis of variance) calculation to Statistics.
    
    Currently supported calculation is one factor ANOVA calculation.
    
    Additionally refactor "descriptive statistics" and extract common
    functionallity with ANOVA into StatisticsInputOutput class.
    
    Change-Id: Ib9c3083019058c63738b3e92097411ba1b428648

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index fb8ed57..e602c13 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -653,6 +653,14 @@
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:AnalysisOfVarianceDialog" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">~Analysis of Variance (ANOVA)...</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
       <node oor:name=".uno:EditHeaderAndFooter" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">~Headers & Footers...</value>
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index c192566..6db0794 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -476,6 +476,8 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
 	sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog \
 	sc/source/ui/StatisticsDialogs/SamplingDialog \
 	sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog \
+	sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog \
+	sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog \
 	sc/source/ui/undo/areasave \
 	sc/source/ui/undo/refundo \
 	sc/source/ui/undo/target \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index f14e8dc..06588d8 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -61,6 +61,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/scalc,\
 $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/advancedfilterdialog \
 	sc/uiconfig/scalc/ui/allheaderfooterdialog \
+	sc/uiconfig/scalc/ui/analysisofvariancedialog \
 	sc/uiconfig/scalc/ui/cellprotectionpage \
 	sc/uiconfig/scalc/ui/createnamesdialog \
 	sc/uiconfig/scalc/ui/dataform \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index d075e04..b552fa0 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -252,9 +252,10 @@
 #define SID_OPENDLG_ICONSET         (SC_MESSAGE_START + 68)
 #define SID_OPENDLG_CONDDATE        (SC_MESSAGE_START + 69)
 
-#define SID_OPENDLG_RANDOM_NUMBER_GENERATOR (SC_MESSAGE_START + 70)
+#define SID_RANDOM_NUMBER_GENERATOR_DIALOG  (SC_MESSAGE_START + 70)
 #define SID_SAMPLING_DIALOG                 (SC_MESSAGE_START + 71)
 #define SID_DESCRIPTIVE_STATISTICS_DIALOG   (SC_MESSAGE_START + 72)
+#define SID_ANALYSIS_OF_VARIANCE_DIALOG     (SC_MESSAGE_START + 73)
 
 // functions
 
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index 07fce83..31ff7f0 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -147,9 +147,10 @@ interface CellSelection
     FID_FILL_TAB        [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
     FID_FILL_SERIES     [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
     FID_FILL_AUTO       [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
-    SID_OPENDLG_RANDOM_NUMBER_GENERATOR [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
+    SID_RANDOM_NUMBER_GENERATOR_DIALOG  [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
     SID_SAMPLING_DIALOG                 [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
     SID_DESCRIPTIVE_STATISTICS_DIALOG   [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
+    SID_ANALYSIS_OF_VARIANCE_DIALOG     [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
     SID_MARKDATAAREA    [ ExecMethod = ExecuteMove; StateMethod = GetStateCursor; ]
     SID_MARKARRAYFORMULA [ ExecMethod = ExecuteMove; StateMethod = GetStateCursor; ]
     SID_SETINPUTMODE    [ ExecMethod = ExecuteMove; StateMethod = GetStateCursor; ]
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 7ac69ac..0a7c0eb 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -2942,7 +2942,7 @@ SfxVoidItem GoalSeekDialog SID_OPENDLG_SOLVE
     GroupId = GID_OPTIONS;
 ]
 
-SfxVoidItem RandomNumberGeneratorDialog SID_OPENDLG_RANDOM_NUMBER_GENERATOR
+SfxVoidItem RandomNumberGeneratorDialog SID_RANDOM_NUMBER_GENERATOR_DIALOG
 ()
 [
     /* flags: */
@@ -3014,6 +3014,30 @@ SfxVoidItem DescriptiveStatisticsDialog SID_DESCRIPTIVE_STATISTICS_DIALOG
     GroupId = GID_OPTIONS;
 ]
 
+SfxVoidItem AnalysisOfVarianceDialog SID_ANALYSIS_OF_VARIANCE_DIALOG
+()
+[
+    /* flags: */
+    AutoUpdate = FALSE,
+    Cachable = Cachable,
+    FastCall = FALSE,
+    HasCoreId = FALSE,
+    HasDialog = TRUE,
+    ReadOnlyDoc = TRUE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Synchron;
+
+    /* config: */
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = TRUE,
+    GroupId = GID_OPTIONS;
+]
+
 //--------------------------------------------------------------------------
 SfxVoidItem SolverDialog SID_OPENDLG_OPTSOLVER
 ()
diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
new file mode 100644
index 0000000..cb00bac
--- /dev/null
+++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
@@ -0,0 +1,318 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <sfx2/dispatch.hxx>
+#include <svl/zforlist.hxx>
+#include <svl/undo.hxx>
+
+#include "formulacell.hxx"
+#include "rangelst.hxx"
+#include "scitems.hxx"
+#include "docsh.hxx"
+#include "document.hxx"
+#include "uiitems.hxx"
+#include "reffact.hxx"
+#include "scresid.hxx"
+#include "random.hxx"
+#include "docfunc.hxx"
+#include "globstr.hrc"
+#include "sc.hrc"
+
+#include "AnalysisOfVarianceDialog.hxx"
+
+namespace
+{
+
+static const char* lclBasicStatisticsLabels[] =
+{
+    "Groups", "Count", "Sum", "Mean", "Variance", NULL
+};
+
+static const char* lclAnovaLabels[] =
+{
+    "Source of Variation", "SS", "df", "MS", "F", "P-value", "F critical", NULL
+};
+
+static const char* lclAnovaFormula[] =
+{
+    "=COUNT(%RANGE%)", "=SUM(%RANGE%)", "=AVERAGE(%RANGE%)", "=VAR(%RANGE%)", NULL
+};
+
+static const OUString lclWildcardRange("%RANGE%");
+
+OUString lclCreateMultiParameterFormula(
+            ScRangeList&        aRangeList, const OUString& aFormulaTemplate,
+            const OUString&     aWildcard,  ScDocument*     pDocument,
+            ScAddress::Details& aAddressDetails)
+{
+    OUString aResult;
+    for (size_t i = 0; i < aRangeList.size(); i++)
+    {
+        OUString aRangeString;
+        aRangeList[i]->Format( aRangeString, SCR_ABS, pDocument, aAddressDetails );
+        OUString aFormulaString = aFormulaTemplate.replaceAll(aWildcard, aRangeString);
+        aResult += aFormulaString;
+        if(i != aRangeList.size() - 1) // Not Last
+            aResult+= ";";
+    }
+    return aResult;
+}
+
+class CellAddressIterator
+{
+public:
+    CellAddressIterator(ScAddress& aStartAddress)
+    {}
+
+    virtual ~CellAddressIterator()
+    {}
+};
+
+}
+
+ScAnalysisOfVarianceDialog::ScAnalysisOfVarianceDialog(
+                    SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
+                    Window* pParent, ScViewData* pViewData ) :
+    ScStatisticsInputOutputDialog(
+            pSfxBindings, pChildWindow, pParent, pViewData,
+            "AnalysisOfVarianceDialog", "modules/scalc/ui/analysisofvariancedialog.ui" )
+{
+    get(mpAlpha,        "alpha-spin");
+}
+
+ScAnalysisOfVarianceDialog::~ScAnalysisOfVarianceDialog()
+{}
+
+sal_Bool ScAnalysisOfVarianceDialog::Close()
+{
+    return DoClose( ScAnalysisOfVarianceDialogWrapper::GetChildWindowId() );
+}
+
+void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( )
+{
+    OUString aUndo("Analysis Of Variance");
+    ScDocShell* pDocShell = mViewData->GetDocShell();
+    svl::IUndoManager* pUndoManager = pDocShell->GetUndoManager();
+    pUndoManager->EnterListAction( aUndo, aUndo );
+
+    ScAddress aStart = mInputRange.aStart;
+    ScAddress aEnd   = mInputRange.aEnd;
+
+    SCTAB outTab = mOutputAddress.Tab();
+    SCCOL outCol = mOutputAddress.Col();
+    SCROW outRow = mOutputAddress.Row();
+
+    OUString aReferenceString;
+    ScAddress aAddress;
+
+    for (SCROW inTab = aStart.Tab(); inTab <= aEnd.Tab(); inTab++)
+    {
+        outCol = mOutputAddress.Col();
+
+        // Write labels
+        for(sal_Int32 i = 0; lclBasicStatisticsLabels[i] != NULL; i++)
+        {
+            aAddress = ScAddress(outCol, outRow, outTab);
+            OUString aCalculationName(OUString::createFromAscii(lclBasicStatisticsLabels[i]));
+            pDocShell->GetDocFunc().SetStringCell(aAddress, aCalculationName, true);
+            outCol++;
+        }
+        outRow++;
+
+        ScRangeList aRangeList;
+
+        // Write statistic formulas for columns
+        for (SCCOL inCol = aStart.Col(); inCol <= aEnd.Col(); inCol++)
+        {
+            outCol = mOutputAddress.Col();
+            aAddress = ScAddress(outCol, outRow, outTab);
+            OUString aGroupName = OUString("Column ") + OUString::number(inCol - aStart.Col() + 1);
+            pDocShell->GetDocFunc().SetStringCell(aAddress, aGroupName, true);
+            outCol++;
+
+            ScRange aColumnRange (
+                ScAddress(inCol, aStart.Row(), inTab),
+                ScAddress(inCol, aEnd.Row(), inTab)
+            );
+            aRangeList.Append(aColumnRange);
+
+            aColumnRange.Format( aReferenceString, SCR_ABS, mDocument, mAddressDetails );
+            OUString aFormulaString;
+            OUString aFormulaTemplate;
+
+            for(sal_Int32 i = 0; lclAnovaFormula[i] != NULL; i++)
+            {
+                aAddress = ScAddress(outCol, outRow, outTab);
+                aFormulaTemplate = OUString::createFromAscii(lclAnovaFormula[i]);
+                aFormulaString = aFormulaTemplate.replaceAll(lclWildcardRange, aReferenceString);
+                pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
+                outCol++;
+            }
+            outRow++;
+        }
+
+        outRow++; // Blank row
+
+        // Write ANOVA labels
+        outCol = mOutputAddress.Col();
+        for(sal_Int32 i = 0; lclAnovaLabels[i] != NULL; i++)
+        {
+            aAddress = ScAddress(outCol, outRow, outTab);
+            OUString aCalculationName(OUString::createFromAscii(lclAnovaLabels[i]));
+            pDocShell->GetDocFunc().SetStringCell(aAddress, aCalculationName, true);
+            outCol++;
+        }
+        outRow++;
+
+        // Between Groups
+        {
+            // Label
+            outCol = mOutputAddress.Col();
+            aAddress = ScAddress(outCol, outRow, outTab);
+            pDocShell->GetDocFunc().SetStringCell(aAddress, OUString("Between Groups"), true);
+            outCol++;
+
+            // Sum of Squares
+            aAddress = ScAddress(outCol, outRow, outTab);
+            OUString aReferenceTotal;
+            OUString aReferenceWithin;
+            ScAddress aAddressTotal(outCol, outRow+2, outTab);
+            aAddressTotal.Format( aReferenceTotal, SCR_ABS, mDocument, mAddressDetails );
+            ScAddress aAddressWithin(outCol, outRow+1, outTab);
+            aAddressWithin.Format( aReferenceWithin, SCR_ABS, mDocument, mAddressDetails );
+            OUString aFormulaString = "=" + aReferenceTotal + "-" + aReferenceWithin;
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
+            outCol++;
+
+            // Degree of freedom
+            aAddress = ScAddress(outCol, outRow, outTab);
+            aAddressTotal = ScAddress(outCol, outRow+2, outTab);
+            aAddressTotal.Format( aReferenceTotal, SCR_ABS, mDocument, mAddressDetails );
+            aAddressWithin = ScAddress(outCol, outRow+1, outTab);
+            aAddressWithin.Format( aReferenceWithin, SCR_ABS, mDocument, mAddressDetails );
+            aFormulaString = "=" + aReferenceTotal + "-" + aReferenceWithin;
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
+            outCol++;
+
+            // MS
+            OUString aSSRef;
+            ScAddress(outCol-2, outRow, outTab).Format( aSSRef, SCR_ABS, mDocument, mAddressDetails );
+            OUString aDFRef;
+            ScAddress(outCol-1, outRow, outTab).Format( aDFRef, SCR_ABS, mDocument, mAddressDetails );
+            aFormulaString = "=" + aSSRef + "/" + aDFRef;
+            aAddress = ScAddress(outCol, outRow, outTab);
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
+            outCol++;
+
+            // F
+            aAddress = ScAddress(outCol, outRow, outTab);
+            OUString aMSBetween;
+            ScAddress(outCol-1, outRow, outTab).Format( aMSBetween, SCR_ABS, mDocument, mAddressDetails );
+            OUString aMSWithin;
+            ScAddress(outCol-1, outRow+1, outTab).Format( aMSWithin, SCR_ABS, mDocument, mAddressDetails );
+            aFormulaString = "=" + aMSBetween + "/" + aMSWithin;
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
+            outCol++;
+
+            // P-value
+            aAddress = ScAddress(outCol, outRow, outTab);
+            OUString aFValue;
+            ScAddress(outCol-1, outRow, outTab).Format( aFValue, SCR_ABS, mDocument, mAddressDetails );
+            OUString aDFBetween;
+            ScAddress(outCol-3, outRow, outTab).Format( aDFBetween, SCR_ABS, mDocument, mAddressDetails );
+            OUString aDFWithin;
+            ScAddress(outCol-3, outRow+1, outTab).Format( aDFWithin, SCR_ABS, mDocument, mAddressDetails );
+            aFormulaString = "=FDIST("+ aFValue + ";" + aDFBetween + ";" + aDFWithin + ")";
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
+            outCol++;
+
+            // F critical
+            double aAlphaValue = mpAlpha->GetValue() / 100.0;
+            OUString aAlphaString = rtl::math::doubleToUString(
+                                        aAlphaValue, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
+                                        ScGlobal::pLocaleData->getNumDecimalSep()[0], true);
+            aAddress = ScAddress(outCol, outRow, outTab);
+            aFormulaString = "=FINV(" + aAlphaString + ";" + aDFBetween + ";" + aDFWithin + ")";
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
+        }
+        outRow++;
+
+        // Within Groups
+        {
+            // Label
+            outCol = mOutputAddress.Col();
+            aAddress = ScAddress(outCol, outRow, outTab);
+            pDocShell->GetDocFunc().SetStringCell(aAddress, OUString("Within Groups"), true);
+            outCol++;
+
+            // Sum of Squares
+            aAddress = ScAddress(outCol, outRow, outTab);
+            OUString aSum("=SUM(%RANGE%)");
+            OUString aDevSQ("DEVSQ(%RANGE%)");
+            OUString aSSPart = lclCreateMultiParameterFormula(aRangeList, aDevSQ, lclWildcardRange, mDocument, mAddressDetails);
+            OUString aSS = aSum.replaceAll(lclWildcardRange, aSSPart);
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aSS), true);
+            outCol++;
+
+            // Degree of freedom
+            aAddress = ScAddress(outCol, outRow, outTab);
+            OUString aCountMinusOne("COUNT(%RANGE%)-1");
+            OUString aDFPart = lclCreateMultiParameterFormula(aRangeList, aCountMinusOne, lclWildcardRange, mDocument, mAddressDetails);
+            OUString aDF = aSum.replaceAll(lclWildcardRange, aDFPart);
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aDF), true);
+            outCol++;
+
+            // MS
+            OUString aSSRef;
+            OUString aDFRef;
+            ScAddress aAddressSS(outCol-2, outRow, outTab);
+            aAddressSS.Format( aSSRef, SCR_ABS, mDocument, mAddressDetails );
+            ScAddress aAddressDF(outCol-1, outRow, outTab);
+            aAddressDF.Format( aDFRef, SCR_ABS, mDocument, mAddressDetails );
+            OUString aFormulaString = "=" + aSSRef + "/" + aDFRef;
+            aAddress = ScAddress(outCol, outRow, outTab);
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
+        }
+        outRow++;
+
+        // Total
+        {
+            // Label
+            outCol = mOutputAddress.Col();
+            aAddress = ScAddress(outCol, outRow, outTab);
+            pDocShell->GetDocFunc().SetStringCell(aAddress, OUString("Total"), true);
+            outCol++;
+
+            // Sum of Squares
+            OUString aDevSQ("DEVSQ(%RANGE%)");
+            aRangeList.Format( aReferenceString, SCR_ABS, mDocument );
+            OUString aFormulaString = aDevSQ.replaceAll(lclWildcardRange, aReferenceString);
+
+            aAddress = ScAddress(outCol, outRow, outTab);
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, "=" + aFormulaString), true);
+            outCol++;
+
+            // Degree of freedom
+            aAddress = ScAddress(outCol, outRow, outTab);
+            OUString aCount("COUNT(%RANGE%)");
+            OUString aSumMinusOne("=SUM(%RANGE%)-1");
+            OUString aDFPart = lclCreateMultiParameterFormula(aRangeList, aCount, lclWildcardRange, mDocument, mAddressDetails);
+            OUString aDF = aSumMinusOne.replaceAll(lclWildcardRange, aDFPart);
+            pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aDF), true);
+        }
+        outRow++;
+    }
+
+    ScRange aOutputRange(mOutputAddress, ScAddress(outTab, outRow, outTab) );
+    pUndoManager->LeaveListAction();
+    pDocShell->PostPaint( aOutputRange, PAINT_GRID );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
index a37d2ed..ed9d57b 100644
--- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
@@ -55,124 +55,27 @@ static const StatisticCalculation lclCalcDefinitions[] =
     { 0,                       NULL }
 };
 
+static const OUString lclWildcardRange("%RANGE%");
+
 }
 
 ScDescriptiveStatisticsDialog::ScDescriptiveStatisticsDialog(
                     SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
                     Window* pParent, ScViewData* pViewData ) :
-    ScAnyRefDlg     ( pSfxBindings, pChildWindow, pParent,
-                      "DescriptiveStatisticsDialog", "modules/scalc/ui/descriptivestatisticsdialog.ui" ),
-    mViewData       ( pViewData ),
-    mDocument       ( pViewData->GetDocument() ),
-    mAddressDetails ( mDocument->GetAddressConvention(), 0, 0 ),
-    mCurrentAddress ( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() ),
-    mDialogLostFocus( false )
-{
-    get(mpInputRangeLabel,  "input-range-label");
-    get(mpInputRangeEdit,   "input-range-edit");
-    get(mpInputRangeButton, "input-range-button");
-    mpInputRangeEdit->SetReferences(this, mpInputRangeLabel);
-    mpInputRangeButton->SetReferences(this, mpInputRangeEdit);
-
-    get(mpOutputRangeLabel,  "output-range-label");
-    get(mpOutputRangeEdit,   "output-range-edit");
-    get(mpOutputRangeButton, "output-range-button");
-    mpOutputRangeEdit->SetReferences(this, mpOutputRangeLabel);
-    mpOutputRangeButton->SetReferences(this, mpOutputRangeEdit);
-
-    get(mpButtonOk,     "ok");
-    get(mpButtonApply,  "apply");
-    get(mpButtonClose,  "close");
-
-    Init();
-    GetRangeFromSelection();
-}
-
-void ScDescriptiveStatisticsDialog::Init()
-{
-    mpButtonOk->SetClickHdl( LINK( this, ScDescriptiveStatisticsDialog, OkClicked ) );
-    mpButtonClose->SetClickHdl( LINK( this, ScDescriptiveStatisticsDialog, CloseClicked ) );
-    mpButtonApply->SetClickHdl( LINK( this, ScDescriptiveStatisticsDialog, ApplyClicked ) );
-    mpButtonOk->Enable(false);
-    mpButtonApply->Enable(false);
-
-    Link aLink = LINK( this, ScDescriptiveStatisticsDialog, GetFocusHandler );
-    mpInputRangeEdit->SetGetFocusHdl( aLink );
-    mpInputRangeButton->SetGetFocusHdl( aLink );
-    mpOutputRangeEdit->SetGetFocusHdl( aLink );
-    mpOutputRangeButton->SetGetFocusHdl( aLink );
-
-    aLink = LINK( this, ScDescriptiveStatisticsDialog, LoseFocusHandler );
-    mpInputRangeEdit->SetLoseFocusHdl( aLink );
-    mpInputRangeButton->SetLoseFocusHdl( aLink );
-    mpOutputRangeEdit->SetLoseFocusHdl( aLink );
-    mpOutputRangeButton->SetLoseFocusHdl( aLink );
-
-    mpOutputRangeEdit->GrabFocus();
-}
-
-void ScDescriptiveStatisticsDialog::GetRangeFromSelection()
-{
-    OUString aCurrentString;
-    mViewData->GetSimpleArea(mInputRange);
-    mInputRange.Format(aCurrentString, SCR_ABS_3D, mDocument, mAddressDetails);
-    mpInputRangeEdit->SetText(aCurrentString);
-}
+    ScStatisticsInputOutputDialog(
+            pSfxBindings, pChildWindow, pParent, pViewData,
+            "DescriptiveStatisticsDialog", "modules/scalc/ui/descriptivestatisticsdialog.ui" )
+{}
 
 ScDescriptiveStatisticsDialog::~ScDescriptiveStatisticsDialog()
 {}
 
-void ScDescriptiveStatisticsDialog::SetActive()
-{
-    if ( mDialogLostFocus )
-    {
-        mDialogLostFocus = false;
-        if( mpActiveEdit )
-            mpActiveEdit->GrabFocus();
-    }
-    else
-    {
-        GrabFocus();
-    }
-    RefInputDone();
-}
-
 sal_Bool ScDescriptiveStatisticsDialog::Close()
 {
     return DoClose( ScDescriptiveStatisticsDialogWrapper::GetChildWindowId() );
 }
 
-void ScDescriptiveStatisticsDialog::SetReference( const ScRange& rReferenceRange, ScDocument* pDocument )
-{
-    if ( mpActiveEdit )
-    {
-        if ( rReferenceRange.aStart != rReferenceRange.aEnd )
-            RefInputStart( mpActiveEdit );
-
-        String aReferenceString;
-
-        if ( mpActiveEdit == mpInputRangeEdit )
-        {
-            mInputRange = rReferenceRange;
-            mInputRange.Format( aReferenceString, SCR_ABS_3D, pDocument, mAddressDetails );
-            mpInputRangeEdit->SetRefString( aReferenceString );
-        }
-        else if ( mpActiveEdit == mpOutputRangeEdit )
-        {
-            mOutputAddress = rReferenceRange.aStart;
-
-            sal_uInt16 nFormat = ( mOutputAddress.Tab() == mCurrentAddress.Tab() ) ? SCA_ABS : SCA_ABS_3D;
-            mOutputAddress.Format( aReferenceString, nFormat, pDocument, pDocument->GetAddressConvention() );
-            mpOutputRangeEdit->SetRefString( aReferenceString );
-
-            // Enable OK, Cancel if output range is set
-            mpButtonOk->Enable(!mpOutputRangeEdit->GetText().isEmpty());
-            mpButtonApply->Enable(!mpOutputRangeEdit->GetText().isEmpty());
-        }
-    }
-}
-
-void ScDescriptiveStatisticsDialog::ApplyCalculationsFormulas( )
+void ScDescriptiveStatisticsDialog::CalculateInputAndWriteToOutput( )
 {
     OUString aUndo(SC_RESSTR(STR_DESCRIPTIVE_STATISTICS_UNDO_NAME));
     ScDocShell* pDocShell = mViewData->GetDocShell();
@@ -211,7 +114,6 @@ void ScDescriptiveStatisticsDialog::ApplyCalculationsFormulas( )
             );
 
             aColumnRange.Format( aReferenceString, SCR_ABS, mDocument, mAddressDetails );
-            OUString sRange("%RANGE%");
             OUString aFormulaString;
             OUString aFormulaTemplate;
 
@@ -219,7 +121,7 @@ void ScDescriptiveStatisticsDialog::ApplyCalculationsFormulas( )
             {
                 aAddress = ScAddress(outCol, outRow, outTab);
                 aFormulaTemplate = OUString::createFromAscii(lclCalcDefinitions[i].aFormula);
-                aFormulaString = aFormulaTemplate.replaceAll(sRange, aReferenceString);
+                aFormulaString = aFormulaTemplate.replaceAll(lclWildcardRange, aReferenceString);
                 pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
                 outRow++;
             }
@@ -233,45 +135,4 @@ void ScDescriptiveStatisticsDialog::ApplyCalculationsFormulas( )
     pDocShell->PostPaint( aOutputRange, PAINT_GRID );
 }
 
-IMPL_LINK( ScDescriptiveStatisticsDialog, OkClicked, PushButton*, /*pButton*/ )
-{
-    ApplyClicked(NULL);
-    CloseClicked(NULL);
-    return 0;
-}
-
-
-IMPL_LINK( ScDescriptiveStatisticsDialog, ApplyClicked, PushButton*, /*pButton*/ )
-{
-    ApplyCalculationsFormulas();
-    return 0;
-}
-
-IMPL_LINK( ScDescriptiveStatisticsDialog, CloseClicked, PushButton*, /*pButton*/ )
-{
-    Close();
-    return 0;
-}
-
-IMPL_LINK( ScDescriptiveStatisticsDialog, GetFocusHandler, Control*, pCtrl )
-{
-    mpActiveEdit = NULL;
-
-    if(      (pCtrl == (Control*) mpInputRangeEdit)  || (pCtrl == (Control*) mpInputRangeButton) )
-        mpActiveEdit = mpInputRangeEdit;
-    else if( (pCtrl == (Control*) mpOutputRangeEdit) || (pCtrl == (Control*) mpOutputRangeButton) )
-        mpActiveEdit = mpOutputRangeEdit;
-
-    if( mpActiveEdit )
-        mpActiveEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
-
-    return 0;
-}
-
-IMPL_LINK_NOARG(ScDescriptiveStatisticsDialog, LoseFocusHandler)
-{
-    mDialogLostFocus = !IsActive();
-    return 0;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
new file mode 100644
index 0000000..7a01131
--- /dev/null
+++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
@@ -0,0 +1,178 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <sfx2/dispatch.hxx>
+#include <svl/zforlist.hxx>
+#include <svl/undo.hxx>
+
+#include "formulacell.hxx"
+#include "rangelst.hxx"
+#include "scitems.hxx"
+#include "docsh.hxx"
+#include "document.hxx"
+#include "uiitems.hxx"
+#include "reffact.hxx"
+#include "scresid.hxx"
+#include "random.hxx"
+#include "docfunc.hxx"
+
+#include "StatisticsInputOutputDialog.hxx"
+
+ScStatisticsInputOutputDialog::ScStatisticsInputOutputDialog(
+                    SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
+                    Window* pParent, ScViewData* pViewData, const OString& rID, const OUString& rUIXMLDescription ) :
+    ScAnyRefDlg     ( pSfxBindings, pChildWindow, pParent, rID, rUIXMLDescription ),
+    mViewData       ( pViewData ),
+    mDocument       ( pViewData->GetDocument() ),
+    mAddressDetails ( mDocument->GetAddressConvention(), 0, 0 ),
+    mCurrentAddress ( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() ),
+    mDialogLostFocus( false )
+{
+    get(mpInputRangeLabel,  "input-range-label");
+    get(mpInputRangeEdit,   "input-range-edit");
+    get(mpInputRangeButton, "input-range-button");
+    mpInputRangeEdit->SetReferences(this, mpInputRangeLabel);
+    mpInputRangeButton->SetReferences(this, mpInputRangeEdit);
+
+    get(mpOutputRangeLabel,  "output-range-label");
+    get(mpOutputRangeEdit,   "output-range-edit");
+    get(mpOutputRangeButton, "output-range-button");
+    mpOutputRangeEdit->SetReferences(this, mpOutputRangeLabel);
+    mpOutputRangeButton->SetReferences(this, mpOutputRangeEdit);
+
+    get(mpButtonOk,     "ok");
+    get(mpButtonApply,  "apply");
+    get(mpButtonClose,  "close");
+
+    Init();
+    GetRangeFromSelection();
+}
+
+ScStatisticsInputOutputDialog::~ScStatisticsInputOutputDialog()
+{}
+
+void ScStatisticsInputOutputDialog::Init()
+{
+    mpButtonOk->SetClickHdl( LINK( this, ScStatisticsInputOutputDialog, OkClicked ) );
+    mpButtonClose->SetClickHdl( LINK( this, ScStatisticsInputOutputDialog, CloseClicked ) );
+    mpButtonApply->SetClickHdl( LINK( this, ScStatisticsInputOutputDialog, ApplyClicked ) );
+    mpButtonOk->Enable(false);
+    mpButtonApply->Enable(false);
+
+    Link aLink = LINK( this, ScStatisticsInputOutputDialog, GetFocusHandler );
+    mpInputRangeEdit->SetGetFocusHdl( aLink );
+    mpInputRangeButton->SetGetFocusHdl( aLink );
+    mpOutputRangeEdit->SetGetFocusHdl( aLink );
+    mpOutputRangeButton->SetGetFocusHdl( aLink );
+
+    aLink = LINK( this, ScStatisticsInputOutputDialog, LoseFocusHandler );
+    mpInputRangeEdit->SetLoseFocusHdl( aLink );
+    mpInputRangeButton->SetLoseFocusHdl( aLink );
+    mpOutputRangeEdit->SetLoseFocusHdl( aLink );
+    mpOutputRangeButton->SetLoseFocusHdl( aLink );
+
+    mpOutputRangeEdit->GrabFocus();
+}
+
+void ScStatisticsInputOutputDialog::GetRangeFromSelection()
+{
+    OUString aCurrentString;
+    mViewData->GetSimpleArea(mInputRange);
+    mInputRange.Format(aCurrentString, SCR_ABS_3D, mDocument, mAddressDetails);
+    mpInputRangeEdit->SetText(aCurrentString);
+}
+
+void ScStatisticsInputOutputDialog::SetActive()
+{
+    if ( mDialogLostFocus )
+    {
+        mDialogLostFocus = false;
+        if( mpActiveEdit )
+            mpActiveEdit->GrabFocus();
+    }
+    else
+    {
+        GrabFocus();
+    }
+    RefInputDone();
+}
+
+void ScStatisticsInputOutputDialog::SetReference( const ScRange& rReferenceRange, ScDocument* pDocument )
+{
+    if ( mpActiveEdit )
+    {
+        if ( rReferenceRange.aStart != rReferenceRange.aEnd )
+            RefInputStart( mpActiveEdit );
+
+        String aReferenceString;
+
+        if ( mpActiveEdit == mpInputRangeEdit )
+        {
+            mInputRange = rReferenceRange;
+            mInputRange.Format( aReferenceString, SCR_ABS_3D, pDocument, mAddressDetails );
+            mpInputRangeEdit->SetRefString( aReferenceString );
+        }
+        else if ( mpActiveEdit == mpOutputRangeEdit )
+        {
+            mOutputAddress = rReferenceRange.aStart;
+
+            sal_uInt16 nFormat = ( mOutputAddress.Tab() == mCurrentAddress.Tab() ) ? SCA_ABS : SCA_ABS_3D;
+            mOutputAddress.Format( aReferenceString, nFormat, pDocument, pDocument->GetAddressConvention() );
+            mpOutputRangeEdit->SetRefString( aReferenceString );
+
+            // Enable OK, Cancel if output range is set
+            mpButtonOk->Enable(!mpOutputRangeEdit->GetText().isEmpty());
+            mpButtonApply->Enable(!mpOutputRangeEdit->GetText().isEmpty());
+        }
+    }
+}
+
+IMPL_LINK( ScStatisticsInputOutputDialog, OkClicked, PushButton*, /*pButton*/ )
+{
+    ApplyClicked(NULL);
+    CloseClicked(NULL);
+    return 0;
+}
+
+
+IMPL_LINK( ScStatisticsInputOutputDialog, ApplyClicked, PushButton*, /*pButton*/ )
+{
+    CalculateInputAndWriteToOutput();
+    return 0;
+}
+
+IMPL_LINK( ScStatisticsInputOutputDialog, CloseClicked, PushButton*, /*pButton*/ )
+{
+    Close();
+    return 0;
+}
+
+IMPL_LINK( ScStatisticsInputOutputDialog, GetFocusHandler, Control*, pCtrl )
+{
+    mpActiveEdit = NULL;
+
+    if(      (pCtrl == (Control*) mpInputRangeEdit)  || (pCtrl == (Control*) mpInputRangeButton) )
+        mpActiveEdit = mpInputRangeEdit;
+    else if( (pCtrl == (Control*) mpOutputRangeEdit) || (pCtrl == (Control*) mpOutputRangeButton) )
+        mpActiveEdit = mpOutputRangeEdit;
+
+    if( mpActiveEdit )
+        mpActiveEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
+
+    return 0;
+}
+
+IMPL_LINK_NOARG( ScStatisticsInputOutputDialog, LoseFocusHandler )
+{
+    mDialogLostFocus = !IsActive();
+    return 0;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 02ef88b..e0b4489 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -270,6 +270,7 @@ void ScDLL::Init()
     ScRandomNumberGeneratorDialogWrapper::RegisterChildWindow(false, pMod);
     ScSamplingDialogWrapper             ::RegisterChildWindow(false, pMod);
     ScDescriptiveStatisticsDialogWrapper::RegisterChildWindow(false, pMod);
+    ScAnalysisOfVarianceDialogWrapper   ::RegisterChildWindow(false, pMod);
 
     // First docking Window for Calc
     ScFunctionChildWindow       ::RegisterChildWindow(false, pMod);
diff --git a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
new file mode 100644
index 0000000..366c02a
--- /dev/null
+++ b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef ANOVA_ONE_FACTOR_DIALOG_HXX
+#define ANOVA_ONE_FACTOR_DIALOG_HXX
+
+#include "global.hxx"
+#include "address.hxx"
+#include "anyrefdg.hxx"
+
+#include <vcl/fixed.hxx>
+#include <vcl/group.hxx>
+#include <vcl/lstbox.hxx>
+
+#include "StatisticsInputOutputDialog.hxx"
+
+class ScAnalysisOfVarianceDialog : public ScStatisticsInputOutputDialog
+{
+public:
+    ScAnalysisOfVarianceDialog(
+        SfxBindings* pB, SfxChildWindow* pCW,
+        Window* pParent, ScViewData* pViewData );
+
+    virtual ~ScAnalysisOfVarianceDialog();
+
+    virtual sal_Bool Close();
+
+    NumericField* mpAlpha;
+
+protected:
+    virtual void CalculateInputAndWriteToOutput();
+};
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/DescriptiveStatisticsDialog.hxx b/sc/source/ui/inc/DescriptiveStatisticsDialog.hxx
index c375d27..b2003b6 100644
--- a/sc/source/ui/inc/DescriptiveStatisticsDialog.hxx
+++ b/sc/source/ui/inc/DescriptiveStatisticsDialog.hxx
@@ -19,7 +19,9 @@
 #include <vcl/group.hxx>
 #include <vcl/lstbox.hxx>
 
-class ScDescriptiveStatisticsDialog : public ScAnyRefDlg
+#include "StatisticsInputOutputDialog.hxx"
+
+class ScDescriptiveStatisticsDialog : public ScStatisticsInputOutputDialog
 {
 public:
     ScDescriptiveStatisticsDialog(
@@ -28,48 +30,10 @@ public:
 
     virtual ~ScDescriptiveStatisticsDialog();
 
-    virtual void        SetReference( const ScRange& rRef, ScDocument* pDoc );
-    virtual void        SetActive();
-    virtual sal_Bool    Close();
-
-private:
-    // Widgets
-    FixedText*          mpInputRangeLabel;
-    formula::RefEdit*   mpInputRangeEdit;
-    formula::RefButton* mpInputRangeButton;
-
-    FixedText*          mpOutputRangeLabel;
-    formula::RefEdit*   mpOutputRangeEdit;
-    formula::RefButton* mpOutputRangeButton;
-
-    PushButton*         mpButtonApply;
-    OKButton*           mpButtonOk;
-    CloseButton*        mpButtonClose;
-
-    //
-    formula::RefEdit*   mpActiveEdit;
-
-    // Data
-    ScViewData*         mViewData;
-    ScDocument*         mDocument;
-
-    ScRange             mInputRange;
-    ScAddress::Details  mAddressDetails;
-    ScAddress           mOutputAddress;
-
-    ScAddress           mCurrentAddress;
-
-    bool                mDialogLostFocus;
-
-    void Init();
-    void GetRangeFromSelection();
-    void ApplyCalculationsFormulas();
+    virtual sal_Bool Close();
 
-    DECL_LINK( OkClicked,        PushButton* );
-    DECL_LINK( CloseClicked,     PushButton* );
-    DECL_LINK( ApplyClicked,     PushButton* );
-    DECL_LINK( GetFocusHandler,  Control* );
-    DECL_LINK( LoseFocusHandler, void* );
+protected:
+    virtual void CalculateInputAndWriteToOutput();
 };
 
 #endif
diff --git a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
new file mode 100644
index 0000000..4d0c0bb
--- /dev/null
+++ b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef STATISTICS_INPUT_OUTPUT_DIALOG_HXX
+#define STATISTICS_INPUT_OUTPUT_DIALOG_HXX
+
+#include "global.hxx"
+#include "address.hxx"
+#include "anyrefdg.hxx"
+
+#include <vcl/fixed.hxx>
+#include <vcl/group.hxx>
+#include <vcl/lstbox.hxx>
+
+class ScStatisticsInputOutputDialog : public ScAnyRefDlg
+{
+public:
+    ScStatisticsInputOutputDialog(
+        SfxBindings* pB, SfxChildWindow* pCW,
+        Window* pParent, ScViewData* pViewData,
+        const OString& rID, const OUString& rUIXMLDescription );
+
+    virtual ~ScStatisticsInputOutputDialog();
+
+    virtual void        SetReference( const ScRange& rRef, ScDocument* pDoc );
+    virtual void        SetActive();
+
+protected:
+    virtual void CalculateInputAndWriteToOutput() = 0;
+
+    // Widgets
+    FixedText*          mpInputRangeLabel;
+    formula::RefEdit*   mpInputRangeEdit;
+    formula::RefButton* mpInputRangeButton;
+
+    FixedText*          mpOutputRangeLabel;
+    formula::RefEdit*   mpOutputRangeEdit;
+    formula::RefButton* mpOutputRangeButton;
+
+    // Data
+    ScViewData*         mViewData;
+    ScDocument*         mDocument;
+
+    ScRange             mInputRange;
+    ScAddress::Details  mAddressDetails;
+    ScAddress           mOutputAddress;
+
+private:
+    // Widgets
+    PushButton*         mpButtonApply;
+    OKButton*           mpButtonOk;
+    CloseButton*        mpButtonClose;
+
+
+    formula::RefEdit*   mpActiveEdit;
+
+
+    ScAddress           mCurrentAddress;
+
+    bool                mDialogLostFocus;
+
+    void Init();
+    void GetRangeFromSelection();
+
+    DECL_LINK( OkClicked,        PushButton* );
+    DECL_LINK( CloseClicked,     PushButton* );
+    DECL_LINK( ApplyClicked,     PushButton* );
+    DECL_LINK( GetFocusHandler,  Control* );
+    DECL_LINK( LoseFocusHandler, void* );
+};
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx
index b0490f3..eb131e3 100644
--- a/sc/source/ui/inc/reffact.hxx
+++ b/sc/source/ui/inc/reffact.hxx
@@ -21,9 +21,12 @@
 #define SC_REFFACT_HXX
 
 #include <sfx2/childwin.hxx>
+#include "ChildWindowWrapper.hxx"
 
 #include "dbfunc.hxx"
 
+#include "sc.hrc"
+
 #define DECL_WRAPPER_WITHID(Class) \
     class Class : public SfxChildWindow                                         \
     {                                                                           \
@@ -50,9 +53,22 @@ DECL_WRAPPER_WITHID(ScColRowNameRangesDlgWrapper)
 DECL_WRAPPER_WITHID(ScFormulaDlgWrapper)
 DECL_WRAPPER_WITHID(ScHighlightChgDlgWrapper)
 
-DECL_WRAPPER_WITHID(ScRandomNumberGeneratorDialogWrapper)
-DECL_WRAPPER_WITHID(ScSamplingDialogWrapper)
-DECL_WRAPPER_WITHID(ScDescriptiveStatisticsDialogWrapper)
+class ScDescriptiveStatisticsDialogWrapper :
+    public ChildWindowWrapper<SID_DESCRIPTIVE_STATISTICS_DIALOG>
+{};
+
+class ScSamplingDialogWrapper :
+    public ChildWindowWrapper<SID_SAMPLING_DIALOG>
+{};
+
+class ScRandomNumberGeneratorDialogWrapper :
+    public ChildWindowWrapper<SID_RANDOM_NUMBER_GENERATOR_DIALOG>
+{};
+
+class ScAnalysisOfVarianceDialogWrapper :
+    public ChildWindowWrapper<SID_ANALYSIS_OF_VARIANCE_DIALOG>
+{};
+
 
 class ScAcceptChgDlgWrapper: public SfxChildWindow
 {
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 8a24814..85a7506 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -170,10 +170,17 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
                 }
             }
             break;
-            case FID_FILL_SERIES:       // fill block
-            case SID_OPENDLG_RANDOM_NUMBER_GENERATOR:
+
+            case SID_RANDOM_NUMBER_GENERATOR_DIALOG:
             case SID_SAMPLING_DIALOG:
             case SID_DESCRIPTIVE_STATISTICS_DIALOG:
+            case SID_ANALYSIS_OF_VARIANCE_DIALOG:
+            {
+                bDisable = !bSimpleArea;
+            }
+            break;
+
+            case FID_FILL_SERIES:       // fill block
             case SID_OPENDLG_TABOP:     // multiple-cell operations, are at least 2 cells marked?
                 if (pDoc->GetChangeTrack()!=NULL &&nWhich ==SID_OPENDLG_TABOP)
                     bDisable = sal_True;
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 829269b..3e7ff8b 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -903,7 +903,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 }
             }
             break;
-        case SID_OPENDLG_RANDOM_NUMBER_GENERATOR:
+        case SID_RANDOM_NUMBER_GENERATOR_DIALOG:
             {
                 sal_uInt16 nId  = ScRandomNumberGeneratorDialogWrapper::GetChildWindowId();
                 SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
@@ -930,6 +930,15 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
             }
             break;
+        case SID_ANALYSIS_OF_VARIANCE_DIALOG:
+            {
+                sal_uInt16 nId  = ScAnalysisOfVarianceDialogWrapper::GetChildWindowId();
+                SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list