[Libreoffice-commits] core.git: 3 commits - extras/source sc/AllLangResTarget_sc.mk sc/inc sc/source sc/uiconfig sc/UIConfig_scalc.mk vcl/source

Caolán McNamara caolanm at redhat.com
Thu Feb 13 12:04:57 CET 2014


 extras/source/glade/libreoffice-catalog.xml.in |   21 
 sc/AllLangResTarget_sc.mk                      |    1 
 sc/UIConfig_scalc.mk                           |    1 
 sc/inc/helpids.h                               |    7 
 sc/inc/sc.hrc                                  |    3 
 sc/source/ui/dbgui/fieldwnd.cxx                |   92 ++-
 sc/source/ui/dbgui/pivot.hrc                   |   70 --
 sc/source/ui/dbgui/pivot.src                   |  340 -----------
 sc/source/ui/dbgui/pvlaydlg.cxx                |  535 +++++++-----------
 sc/source/ui/inc/fieldwnd.hxx                  |   25 
 sc/source/ui/inc/pvlaydlg.hxx                  |   91 +--
 sc/source/ui/src/scstring.src                  |    5 
 sc/uiconfig/scalc/ui/pivottablelayout.ui       |  729 +++++++++++++++++++++++++
 vcl/source/window/layout.cxx                   |    4 
 14 files changed, 1108 insertions(+), 816 deletions(-)

New commits:
commit cc6725773b0bd2b8984f516e8faf01e9aa520681
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 12 13:59:23 2014 +0000

    Various adjustments of the pivot table
    
    especially relative positions were relative
    to the dialog which was assumed to be then
    a direct parent of the widgets so that
    a simple calculation could make the positions
    relative to the widgets
    
    also now the pivot table fits into a 768 pixel high
    screen
    
    Change-Id: I86a4155439872e8273943b90f15320e560e237a4

diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 71c7ac1..7976535 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -613,6 +613,27 @@
                         generic-name="CondFormatList" parent="GtkDrawingArea"
                         icon-name="widget-gtk-drawingarea"/>
 
+    <glade-widget-class title="ScDPPageFieldControl" name="sclo-ScDPPageFieldControl"
+                        generic-name="ScDPPageFieldControl" parent="GtkDrawingArea"
+                        icon-name="widget-gtk-drawingarea"/>
+    <glade-widget-class title="ScDPColFieldControl" name="sclo-ScDPColFieldControl"
+                        generic-name="ScDPColFieldControl" parent="GtkDrawingArea"
+                        icon-name="widget-gtk-drawingarea"/>
+    <glade-widget-class title="ScDPRowFieldControl" name="sclo-ScDPRowFieldControl"
+                        generic-name="ScDPRowFieldControl" parent="GtkDrawingArea"
+                        icon-name="widget-gtk-drawingarea"/>
+    <glade-widget-class title="ScDPDataFieldControl" name="sclo-ScDPDataFieldControl"
+                        generic-name="ScDPDataFieldControl" parent="GtkDrawingArea"
+                        icon-name="widget-gtk-drawingarea"/>
+    <glade-widget-class title="ScDPSelectFieldControl" name="sclo-ScDPSelectFieldControl"
+                        generic-name="ScDPSelectFieldControl" parent="GtkDrawingArea"
+                        icon-name="widget-gtk-drawingarea"/>
+
+
+
+
+
+
     <glade-widget-class title="ScDPFunctionListBox" name="scuilo-ScDPFunctionListBox"
                         generic-name="DPFunctionListBox" parent="GtkTreeView"
                         icon-name="widget-gtk-treeview"/>
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index 6d0c2a8..a732257 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -48,7 +48,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
     sc/source/ui/cctrl/checklistmenu.src \
     sc/source/ui/navipi/navipi.src \
     sc/source/ui/styleui/scstyles.src \
-    sc/source/ui/dbgui/pivot.src \
     sc/source/ui/dbgui/dpgroupdlg.src \
     sc/source/ui/dbgui/pvfundlg.src \
     sc/source/ui/dbgui/dapitype.src \
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 48193dc..b93ca22 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -140,13 +140,6 @@
 #define HID_SELECTTABLES                                        "SC_HID_SELECTTABLES"
 #define HID_SC_REPLCELLSWARN                                    "SC_HID_SC_REPLCELLSWARN"
 
-// data pilot layout dialog
-#define HID_SC_DPLAY_PAGE                                       "SC_HID_SC_DPLAY_PAGE"
-#define HID_SC_DPLAY_COLUMN                                     "SC_HID_SC_DPLAY_COLUMN"
-#define HID_SC_DPLAY_ROW                                        "SC_HID_SC_DPLAY_ROW"
-#define HID_SC_DPLAY_DATA                                       "SC_HID_SC_DPLAY_DATA"
-#define HID_SC_DPLAY_SELECT                                     "SC_HID_SC_DPLAY_SELECT"
-
 #define HID_SC_DRAW_RENAME                                      "SC_HID_SC_DRAW_RENAME"
 
 #define HID_SC_DPSUBT_OPT                                       "SC_HID_SC_DPSUBT_OPT"
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 1c4a370..4cbfb88 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -942,6 +942,8 @@
 #define SCSTR_VALID_RANGE       (STR_START + 317)
 #define SCSTR_VALID_LIST        (STR_START + 318)
 
+#define SCSTR_SELECT            (STR_START + 319)
+
 // media shell
 #define SCSTR_MEDIASHELL        (STR_START + 401)
 
@@ -1012,7 +1014,6 @@
 #define RID_SCPAGE_SUBT_OPTIONS (SC_DIALOGS_START + 29)
 #define RID_SCPAGE_USERLISTS    (SC_DIALOGS_START + 31)
 #define RID_SCDLG_PIVOTFILTER   (SC_DIALOGS_START + 33)
-#define RID_SCDLG_PIVOT_LAYOUT  (SC_DIALOGS_START + 34)
 #define RID_SCDLG_CONSOLIDATE   (SC_DIALOGS_START + 35)
 #define RID_SCDLG_INSERT_TABLE  (SC_DIALOGS_START + 42)
 
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 2026a10..9fe1bb0 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -50,8 +50,8 @@
 #include "dpuiglobal.hxx"
 #include "calcmacros.hxx"
 #include "AccessibleDataPilotControl.hxx"
+#include "sc.hrc"
 #include "scresid.hxx"
-#include "pivot.hrc"
 
 using namespace com::sun::star;
 using ::std::vector;
@@ -116,22 +116,11 @@ ScAccessibleDataPilotControl *ScDPFieldControlBase::AccessRef::operator -> () co
     return static_cast< ScAccessibleDataPilotControl * >( mxRef.get() );
 }
 
-ScDPFieldControlBase::ScDPFieldControlBase(
-    ScPivotLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption, const char* pcHelpId) :
-    Control(pParent),
-    mpDlg(pParent),
-    mpCaption(pCaption),
-    mnFieldSelected(0)
-{
-    SetHelpId( pcHelpId );
-
-    if (pCaption)
-        maName = MnemonicGenerator::EraseAllMnemonicChars( pCaption->GetText() );
-}
-
-ScDPFieldControlBase::ScDPFieldControlBase( Window* pParent ) :
-    Control (pParent),
-    mnFieldSelected(0)
+ScDPFieldControlBase::ScDPFieldControlBase(Window* pParent)
+    : Control(pParent)
+    , mpDlg(NULL)
+    , mpCaption(NULL)
+    , mnFieldSelected(0)
 {
 }
 
@@ -441,7 +430,7 @@ void ScDPFieldControlBase::MouseMove( const MouseEvent& rMEvt )
     {
         Point aScrPos = OutputToScreenPixel(rMEvt.GetPosPixel());
         ScPivotFieldType eFieldType = mpDlg->GetFieldTypeAtPoint(aScrPos);
-        PointerStyle ePtr = mpDlg->GetPointerStyleAtPoint(aScrPos, eFieldType);
+        PointerStyle ePtr = mpDlg->GetPointerStyle(eFieldType);
         SetPointer( Pointer( ePtr ) );
     }
     const FieldNames& rFields = GetFieldNames();
@@ -700,7 +689,7 @@ void ScDPFieldControlBase::DrawInvertSelection()
 
 Size ScDPFieldControlBase::GetStdFieldBtnSize() const
 {
-    return mpDlg->GetStdFieldBtnSize();
+    return Size(approximate_char_width() * 8, FIELD_BTN_HEIGHT);
 }
 
 void ScDPFieldControlBase::MoveField( size_t nDestIndex )
@@ -896,22 +885,14 @@ size_t ScDPFieldControlBase::GetFieldIndexByData( const ScPivotFuncData& rData )
     return it == maFuncData.end() ? PIVOTFIELD_INVALID : std::distance(maFuncData.begin(), it);
 }
 
-//=============================================================================
-
-ScDPHorFieldControl::ScDPHorFieldControl(
-    ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId) :
-    ScDPFieldControlBase(pDialog, rResId, pCaption, pcHelpId),
-    maScroll(this, WB_HORZ | WB_DRAG),
-    mnFieldBtnRowCount(0),
-    mnFieldBtnColCount(0)
+void ScDPFieldControlBase::Resize()
 {
-    maScroll.SetScrollHdl( LINK(this, ScDPHorFieldControl, ScrollHdl) );
-    maScroll.SetEndScrollHdl( LINK(this, ScDPHorFieldControl, EndScrollHdl) );
-    maScroll.Hide();
-
-    AppendPaintable(&maScroll);
+    Control::Resize();
+    CalcSize();
 }
 
+//=============================================================================
+
 ScDPHorFieldControl::ScDPHorFieldControl ( Window* pParent )  :
     ScDPFieldControlBase( pParent ),
     maScroll(this, WB_HORZ | WB_DRAG),
@@ -1040,6 +1021,8 @@ void ScDPHorFieldControl::CalcSize()
     maScroll.SetVisibleSize(mnFieldBtnColCount);
     maScroll.SetPageSize(mnFieldBtnColCount);
     maScroll.SetRange(Range(0, mnFieldBtnColCount));
+
+    ResetScrollBar();
 }
 
 bool ScDPHorFieldControl::IsValidIndex(size_t /*nIndex*/) const
@@ -1171,12 +1154,6 @@ IMPL_LINK_NOARG(ScDPHorFieldControl, EndScrollHdl)
 
 //=============================================================================
 
-ScDPPageFieldControl::ScDPPageFieldControl(
-    ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId) :
-    ScDPHorFieldControl(pDialog, rResId, pCaption, pcHelpId)
-{
-}
-
 ScDPPageFieldControl::ScDPPageFieldControl ( Window* pParent )  :
     ScDPHorFieldControl( pParent )
 {
@@ -1204,12 +1181,6 @@ OUString ScDPPageFieldControl::GetDescription() const
 
 //=============================================================================
 
-ScDPColFieldControl::ScDPColFieldControl(
-    ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId) :
-    ScDPHorFieldControl(pDialog, rResId, pCaption, pcHelpId)
-{
-}
-
 ScDPColFieldControl::ScDPColFieldControl ( Window* pParent )  :
     ScDPHorFieldControl( pParent )
 {
@@ -1236,19 +1207,6 @@ OUString ScDPColFieldControl::GetDescription() const
 
 //=============================================================================
 
-ScDPRowFieldControl::ScDPRowFieldControl(
-    ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId) :
-    ScDPFieldControlBase(pDialog, rResId, pCaption, pcHelpId),
-    maScroll(this, WB_VERT | WB_DRAG),
-    mnColumnBtnCount(0)
-{
-    maScroll.SetScrollHdl( LINK(this, ScDPRowFieldControl, ScrollHdl) );
-    maScroll.SetEndScrollHdl( LINK(this, ScDPRowFieldControl, EndScrollHdl) );
-    maScroll.Show(false);
-
-    AppendPaintable(&maScroll);
-}
-
 ScDPRowFieldControl::ScDPRowFieldControl ( Window* pParent )  :
     ScDPFieldControlBase( pParent ),
     maScroll(this, WB_VERT | WB_DRAG),
@@ -1372,6 +1330,7 @@ void ScDPRowFieldControl::CalcSize()
     maScroll.SetRange(Range(0, mnColumnBtnCount));
     maScroll.DoScroll(0);
 
+    ResetScrollBar();
 }
 
 bool ScDPRowFieldControl::IsValidIndex(size_t /*nIndex*/) const
@@ -1484,17 +1443,10 @@ IMPL_LINK_NOARG(ScDPRowFieldControl, EndScrollHdl)
 
 //=============================================================================
 
-ScDPSelectFieldControl::ScDPSelectFieldControl(
-        ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId) :
-    ScDPHorFieldControl(pDialog, rResId, pCaption, pcHelpId)
-{
-    SetName(OUString(ScResId(STR_SELECT)));
-}
-
 ScDPSelectFieldControl::ScDPSelectFieldControl(  Window* pParent ):
     ScDPHorFieldControl( pParent )
 {
-    //SetName(OUString(ScResId(STR_SELECT)));
+    SetName(OUString(ScResId(SCSTR_SELECT)));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeScDPSelectFieldControl( Window *pParent, VclBuilder::stringmap & )
@@ -1518,12 +1470,6 @@ OUString ScDPSelectFieldControl::GetDescription() const
 
 //=============================================================================
 
-ScDPDataFieldControl::ScDPDataFieldControl(
-    ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId) :
-    ScDPHorFieldControl(pDialog, rResId, pCaption, pcHelpId)
-{
-}
-
 ScDPDataFieldControl::ScDPDataFieldControl(  Window* pParent ):
     ScDPHorFieldControl( pParent )
 {
diff --git a/sc/source/ui/dbgui/pivot.hrc b/sc/source/ui/dbgui/pivot.hrc
deleted file mode 100644
index eec2d7e..0000000
--- a/sc/source/ui/dbgui/pivot.hrc
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include "sc.hrc"
-
-#define BTN_OK                  1
-#define BTN_CANCEL              2
-#define BTN_HELP                3
-#define BTN_MORE                4
-#define BTN_REMOVE              5
-#define BTN_OPTIONS             6
-
-#define FL_LAYOUT               10
-#define WND_COL                 11
-#define WND_ROW                 12
-#define WND_DATA                13
-#define WND_SELECT              14
-#define WND_PAGE                18
-#define FT_COL                  31
-#define FT_ROW                  32
-#define FT_DATA                 33
-#define STR_SELECT              34
-#define FT_PAGE                 35
-
-#define FT_INFO                 19
-
-#define FL_OUTPUT               20
-#define FT_OUTAREA              21
-#define LB_OUTAREA              22
-#define ED_OUTAREA              23
-#define RB_OUTAREA              24
-#define BTN_IGNEMPTYROWS        25
-#define BTN_DETECTCAT           26
-#define BTN_TOTALCOL            27
-#define BTN_TOTALROW            28
-#define BTN_FILTER              29
-#define BTN_DRILLDOWN           30
-
-#define FT_INAREA               40
-#define RB_INAREA               41
-#define ED_INAREA               42
-
-#define PIVOTSTR_SUM            1
-#define PIVOTSTR_COUNT          2
-#define PIVOTSTR_AVG            3
-#define PIVOTSTR_MAX            4
-#define PIVOTSTR_MIN            5
-#define PIVOTSTR_PROD           6
-#define PIVOTSTR_COUNT2         7
-#define PIVOTSTR_DEV            8
-#define PIVOTSTR_DEV2           9
-#define PIVOTSTR_VAR            10
-#define PIVOTSTR_VAR2           11
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/pivot.src b/sc/source/ui/dbgui/pivot.src
deleted file mode 100644
index 5116d2b..0000000
--- a/sc/source/ui/dbgui/pivot.src
+++ /dev/null
@@ -1,340 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- ************************************************************************/
-
-#include "pivot.hrc"
-
-ModelessDialog RID_SCDLG_PIVOT_LAYOUT
-{
-    OutputSize = TRUE ;
-    HelpId = CMD_SID_OPENDLG_PIVOTTABLE ;
-    Size = MAP_APPFONT ( 350 , 216 ) ;
-    Hide = TRUE ;
-    SVLook = TRUE ;
-    Moveable = TRUE ;
-    Closeable = FALSE ;
-    Text [ en-US ] = "Pivot table" ;
-
-    FixedText FT_PAGE
-    {
-        Pos = MAP_APPFONT ( 194 , 168 ) ;
-        Size = MAP_APPFONT ( 37 , 8 ) ;
-        Text[ en-US ] = "Page Fields" ;
-    };
-    Control WND_PAGE
-    {
-        /* Size is calculated in the dialog code. */
-        Pos = MAP_APPFONT ( 20 , 14 ) ;
-        Size = MAP_APPFONT ( 1 , 1 ) ;
-        TabStop = TRUE ;
-    };
-    FixedText FT_COL
-    {
-        Pos = MAP_APPFONT ( 231 , 168 ) ;
-        Size = MAP_APPFONT ( 37 , 8 ) ;
-        Text [ en-US ] = "Column Fields" ;
-    };
-    Control WND_COL
-    {
-        /* Size is calculated in the dialog code. */
-        Pos = MAP_APPFONT ( 56 , 56 ) ;
-        Size = MAP_APPFONT ( 1 , 1 ) ;
-        TabStop = TRUE ;
-    };
-    FixedText FT_ROW
-    {
-        Pos = MAP_APPFONT ( 194 , 176 ) ;
-        Size = MAP_APPFONT ( 37 , 8 ) ;
-        Text [ en-US ] = "Row\nFields" ;
-    };
-    Control WND_ROW
-    {
-        /* Size is calculated in the dialog code. */
-        Pos = MAP_APPFONT ( 6 , 98 ) ;
-        Size = MAP_APPFONT ( 1 , 1 ) ;
-        TabStop = TRUE ;
-    };
-    FixedText FT_DATA
-    {
-        Pos = MAP_APPFONT ( 227, 176 ) ;
-        Size = MAP_APPFONT ( 37 , 8 ) ;
-        Text [ en-US ] = "Data Fields" ;
-    };
-    Control WND_DATA
-    {
-        /* Size is calculated in the dialog code. */
-        Pos = MAP_APPFONT ( 56 , 98 ) ;
-        Size = MAP_APPFONT ( 1 , 1 ) ;
-        TabStop = TRUE ;
-    };
-    Control WND_SELECT
-    {
-        /* Size is calculated in the dialog code. */
-        Pos = MAP_APPFONT ( 210 , 14 ) ;
-        Size = MAP_APPFONT ( 1 , 1 ) ;
-        TabStop = TRUE ;
-    };
-    String STR_SELECT
-    {
-        Text [ en-US ] = "Selection area";
-    };
-    FixedText FT_INFO
-    {
-        Pos = MAP_APPFONT ( 6 , 200 ) ;
-        Size = MAP_APPFONT ( 182 , 16 ) ;
-        WordBreak = TRUE ;
-        Text [ en-US ] = "Drag the fields into the desired position." ;
-    };
-    FixedLine FL_LAYOUT
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 282 , 8 ) ;
-        Text [ en-US ] = "Layout";
-    };
-    OKButton BTN_OK
-    {
-        Pos = MAP_APPFONT ( 294 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton BTN_CANCEL
-    {
-        Pos = MAP_APPFONT ( 294 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    HelpButton BTN_HELP
-    {
-        Pos = MAP_APPFONT ( 294 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    PushButton BTN_REMOVE
-    {
-        HelpID = "sc:PushButton:RID_SCDLG_PIVOT_LAYOUT:BTN_REMOVE";
-        Pos = MAP_APPFONT ( 294 , 63 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "Remove";
-    };
-    PushButton BTN_OPTIONS
-    {
-        HelpID = "sc:PushButton:RID_SCDLG_PIVOT_LAYOUT:BTN_OPTIONS";
-        Pos = MAP_APPFONT ( 294 , 80 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "Options...";
-    };
-    MoreButton BTN_MORE
-    {
-        HelpID = "sc:MoreButton:RID_SCDLG_PIVOT_LAYOUT:BTN_MORE";
-        Pos = MAP_APPFONT ( 294 , 190 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        MapUnit = MAP_APPFONT ;
-        Delta = 90 ;
-    };
-    FixedLine FL_OUTPUT
-    {
-        Pos = MAP_APPFONT ( 6 , 216 ) ;
-        Size = MAP_APPFONT ( 268 , 8 ) ;
-        Text [ en-US ] = "Result" ;
-        Hide = TRUE ;
-    };
-
-    FixedText FT_INAREA
-    {
-        Pos = MAP_APPFONT ( 12 , 229 ) ;
-        Size = MAP_APPFONT ( 59 , 8 ) ;
-        Hide = TRUE ;
-        Text [ en-US ] = "Selection from" ;
-    };
-    Edit ED_INAREA
-    {
-        HelpID = "sc:Edit:RID_SCDLG_PIVOT_LAYOUT:ED_INAREA";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 73 , 227 ) ;
-        Size = MAP_APPFONT ( 100 , 12 ) ;
-        TabStop = TRUE ;
-        Hide = TRUE ;
-    };
-    ImageButton RB_INAREA
-    {
-        HelpID = "sc:ImageButton:RID_SCDLG_PIVOT_LAYOUT:RB_INAREA";
-        Pos = MAP_APPFONT ( 177 , 226 ) ;
-        Size = MAP_APPFONT ( 13 , 15 ) ;
-        TabStop = TRUE ;
-        Hide = TRUE ;
-        QuickHelpText [ en-US ] = "Shrink" ;
-    };
-
-    FixedText FT_OUTAREA
-    {
-        Pos = MAP_APPFONT ( 12 , 247 ) ;
-        Size = MAP_APPFONT ( 59 , 8 ) ;
-        Hide = TRUE ;
-        Text [ en-US ] = "Results to" ;
-    };
-    ListBox LB_OUTAREA
-    {
-        HelpID = "sc:ListBox:RID_SCDLG_PIVOT_LAYOUT:LB_OUTAREA";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 73 , 245 ) ;
-        Size = MAP_APPFONT ( 75 , 90 ) ;
-        TabStop = TRUE ;
-        DropDown = TRUE ;
-        Hide = TRUE ;
-    };
-    Edit ED_OUTAREA
-    {
-        HelpID = "sc:Edit:RID_SCDLG_PIVOT_LAYOUT:ED_OUTAREA";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 152 , 245 ) ;
-        Size = MAP_APPFONT ( 100 , 12 ) ;
-        TabStop = TRUE ;
-        Hide = TRUE ;
-    };
-    ImageButton RB_OUTAREA
-    {
-        HelpID = "sc:ImageButton:RID_SCDLG_PIVOT_LAYOUT:RB_OUTAREA";
-        Pos = MAP_APPFONT ( 256 , 244 ) ;
-        Size = MAP_APPFONT ( 13 , 15 ) ;
-        TabStop = TRUE ;
-        Hide = TRUE ;
-        QuickHelpText [ en-US ] = "Shrink" ;
-    };
-    CheckBox BTN_IGNEMPTYROWS
-    {
-        HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_IGNEMPTYROWS";
-        Pos = MAP_APPFONT ( 12 , 263 ) ;
-        Size = MAP_APPFONT ( 124 , 10 ) ;
-        TabStop = TRUE ;
-        Hide = TRUE ;
-        Text [ en-US ] = "Ignore ~empty rows" ;
-    };
-    CheckBox BTN_DETECTCAT
-    {
-        HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_DETECTCAT";
-        Pos = MAP_APPFONT ( 142 , 263 ) ;
-        Size = MAP_APPFONT ( 124 , 10 ) ;
-        TabStop = TRUE ;
-        Hide = TRUE ;
-        Text [ en-US ] = "~Identify categories" ;
-    };
-    CheckBox BTN_TOTALCOL
-    {
-        HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_TOTALCOL";
-        Pos = MAP_APPFONT ( 12 , 277 ) ;
-        Size = MAP_APPFONT ( 124 , 10 ) ;
-        TabStop = TRUE ;
-        Hide = TRUE ;
-        Text [ en-US ] = "Total columns" ;
-    };
-    CheckBox BTN_TOTALROW
-    {
-        HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_TOTALROW";
-        Pos = MAP_APPFONT ( 142 , 277 ) ;
-        Size = MAP_APPFONT ( 124 , 10 ) ;
-        TabStop = TRUE ;
-        Hide = TRUE ;
-        Text [ en-US ] = "~Total rows" ;
-    };
-    CheckBox BTN_FILTER
-    {
-        HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_FILTER";
-        Pos = MAP_APPFONT ( 12 , 291 ) ;
-        Size = MAP_APPFONT ( 124 , 10 ) ;
-        TabStop = TRUE ;
-        Hide = TRUE ;
-        Text [ en-US ] = "~Add filter" ;
-    };
-    CheckBox BTN_DRILLDOWN
-    {
-        HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_DRILLDOWN";
-        Pos = MAP_APPFONT ( 142 , 291 ) ;
-        Size = MAP_APPFONT ( 124 , 10 ) ;
-        TabStop = TRUE ;
-        Hide = TRUE ;
-        Text [ en-US ] = "Ena~ble drill to details" ;
-    };
-    String PIVOTSTR_SUM
-    {
-        Text [ en-US ] = "Sum - " ;
-    };
-    String PIVOTSTR_COUNT
-    {
-        Text [ en-US ] = "Count - " ;
-    };
-    String PIVOTSTR_AVG
-    {
-        Text [ en-US ] = "Mean - " ;
-    };
-    String PIVOTSTR_MAX
-    {
-        Text [ en-US ] = "Max - " ;
-    };
-    String PIVOTSTR_MIN
-    {
-        Text [ en-US ] = "Min - " ;
-    };
-    String PIVOTSTR_PROD
-    {
-        Text [ en-US ] = "Product - " ;
-    };
-    String PIVOTSTR_COUNT2
-    {
-        Text [ en-US ] = "Count - " ;
-    };
-    String PIVOTSTR_DEV
-    {
-        Text [ en-US ] = "StDev - " ;
-    };
-    String PIVOTSTR_DEV2
-    {
-        Text [ en-US ] = "StDevP - " ;
-    };
-    String PIVOTSTR_VAR
-    {
-        Text [ en-US ] = "Var - " ;
-    };
-    String PIVOTSTR_VAR2
-    {
-        Text [ en-US ] = "VarP - " ;
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index f7e2001..1e4973b 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -56,7 +56,6 @@
 #include "reffact.hxx"
 #include "scresid.hxx"
 #include "globstr.hrc"
-#include "pivot.hrc"
 #include "dpobject.hxx"
 #include "dpsave.hxx"
 #include "dpshttab.hxx"
@@ -76,15 +75,6 @@ namespace {
 
 const sal_uInt16 STD_FORMAT = sal_uInt16( SCA_VALID | SCA_TAB_3D | SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_TAB_ABSOLUTE );
 
-Point DlgPos2WndPos( const Point& rPt, const Window& rWnd )
-{
-    Point aWndPt( rPt );
-    aWndPt.X() = rPt.X()-rWnd.GetPosPixel().X();
-    aWndPt.Y() = rPt.Y()-rWnd.GetPosPixel().Y();
-
-    return aWndPt;
-}
-
 static const OString* getFuncNames()
 {
     static const OString gFuncNames[ PIVOT_MAXFUNC ] =
@@ -135,15 +125,19 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
     mpWndRow->Init( this, mpFtRow );
     mpWndData->Init( this, mpFtData );
     mpWndSelect->Init( this, NULL );
-    mpWndSelect->SetName( get<FixedText>("select_text")->GetText());
+    mpWndSelect->SetName(get<FixedText>("select_text")->GetText());
 
     get( mpFtInArea, "select_from" );
     get( mpEdInPos, "rangesel1" );
+    mpEdInPos->SetReferences(this, mpFtInArea);
     get( mpRbInPos, "changebutton1" );
+    mpRbInPos->SetReferences(this, mpEdInPos);
     get( mpLbOutPos, "target_area" );
     get( mpFtOutArea, "results_to" );
     get( mpEdOutPos, "rangesel2" );
+    mpEdOutPos->SetReferences(this, mpFtOutArea);
     get( mpRbOutPos, "changebutton2" );
+    mpRbOutPos->SetReferences(this, mpEdOutPos);
     get( mpBtnIgnEmptyRows, "ignore_empty" );
     get( mpBtnDetectCat, "detect_category" );
     get( mpBtnTotalCol, "total_cols" );
@@ -392,7 +386,7 @@ void ScPivotLayoutDlg::GrabFieldFocus( ScDPFieldControlBase* rFieldWindow )
         rFieldWindow->GrabFocus();
 }
 
-void ScPivotLayoutDlg::AddField( size_t nFromIndex, ScPivotFieldType eToType, const Point& rAtPos )
+void ScPivotLayoutDlg::AddField( size_t nFromIndex, ScPivotFieldType eToType, const Point& rScrPos )
 {
     ScPivotFuncData aFunc = mpWndSelect->GetFuncData(nFromIndex); // local copy
 
@@ -421,7 +415,7 @@ void ScPivotLayoutDlg::AddField( size_t nFromIndex, ScPivotFieldType eToType, co
         }
 
         aFunc.mnFuncMask = nMask;
-        size_t nAddedAt = toWnd->AddField(aStr, DlgPos2WndPos(rAtPos, *toWnd), aFunc);
+        size_t nAddedAt = toWnd->AddField(aStr, toWnd->ScreenToOutputPixel(rScrPos), aFunc);
         if (nAddedAt != PIVOTFIELD_INVALID)
             toWnd->GrabFocus();
 
@@ -445,7 +439,7 @@ void ScPivotLayoutDlg::AddField( size_t nFromIndex, ScPivotFieldType eToType, co
         }
 
         const ScDPLabelData& rData = maLabelData[nFromIndex+mnOffset];
-        size_t nAddedAt = toWnd->AddField(rData.getDisplayName(), DlgPos2WndPos(rAtPos, *toWnd), aFunc);
+        size_t nAddedAt = toWnd->AddField(rData.getDisplayName(), toWnd->ScreenToOutputPixel(rScrPos), aFunc);
         if (nAddedAt != PIVOTFIELD_INVALID)
             toWnd->GrabFocus();
     }
@@ -504,10 +498,10 @@ void ScPivotLayoutDlg::AppendField(size_t nFromIndex, ScPivotFieldType eToType)
     }
 }
 
-void ScPivotLayoutDlg::MoveField( ScPivotFieldType eFromType, size_t nFromIndex, ScPivotFieldType eToType, const Point& rAtPos )
+void ScPivotLayoutDlg::MoveField( ScPivotFieldType eFromType, size_t nFromIndex, ScPivotFieldType eToType, const Point& rScrPos )
 {
     if ( eFromType == PIVOTFIELDTYPE_SELECT )
-        AddField( nFromIndex, eToType, rAtPos );
+        AddField( nFromIndex, eToType, rScrPos );
     else if (eFromType != PIVOTFIELDTYPE_SELECT && eToType == PIVOTFIELDTYPE_SELECT)
         RemoveField(eFromType, nFromIndex);
     else if ( eFromType != eToType )
@@ -551,7 +545,7 @@ void ScPivotLayoutDlg::MoveField( ScPivotFieldType eFromType, size_t nFromIndex,
                         }
 
                         nAddedAt = toWnd->AddField(
-                            GetLabelString(aFunc.mnCol), DlgPos2WndPos(rAtPos, *toWnd), aFunc);
+                            GetLabelString(aFunc.mnCol), toWnd->ScreenToOutputPixel(rScrPos), aFunc);
                         if (nAddedAt != PIVOTFIELD_INVALID)
                             toWnd->GrabFocus();
                     }
@@ -567,7 +561,7 @@ void ScPivotLayoutDlg::MoveField( ScPivotFieldType eFromType, size_t nFromIndex,
                         }
 
                         aFunc.mnFuncMask = nMask;
-                        nAddedAt = toWnd->AddField(aStr, DlgPos2WndPos(rAtPos, *toWnd), aFunc);
+                        nAddedAt = toWnd->AddField(aStr, toWnd->ScreenToOutputPixel(rScrPos), aFunc);
                         if (nAddedAt != PIVOTFIELD_INVALID)
                             toWnd->GrabFocus();
                     }
@@ -586,7 +580,7 @@ void ScPivotLayoutDlg::MoveField( ScPivotFieldType eFromType, size_t nFromIndex,
         size_t nAt = pWnd->GetFieldIndexByData(rFunc);
         if (nAt != PIVOTFIELD_INVALID)
         {
-            Point aToPos = DlgPos2WndPos( rAtPos, *pWnd );
+            Point aToPos = pWnd->ScreenToOutputPixel(rScrPos);
             size_t nToIndex = 0;
             pWnd->GetExistingIndex(aToPos, nToIndex);
 
@@ -894,10 +888,7 @@ void ScPivotLayoutDlg::NotifyRemoveField( ScPivotFieldType eType, size_t nFieldI
 
 Size ScPivotLayoutDlg::GetStdFieldBtnSize() const
 {
-    // This size is static but is platform dependent.  The field button size
-    // is calculated relative to the size of the OK button.
-    double w = static_cast<double>(mpBtnOk->GetSizePixel().Width()) * 0.70;
-    return Size(static_cast<long>(w), FIELD_BTN_HEIGHT);
+    return Size(approximate_char_width() * 8, FIELD_BTN_HEIGHT);
 }
 
 void ScPivotLayoutDlg::DropFieldItem( const Point& rScrPos, ScPivotFieldType eToType )
@@ -916,12 +907,11 @@ void ScPivotLayoutDlg::DropFieldItem( const Point& rScrPos, ScPivotFieldType eTo
     }
     else
     {
-        Point aOutPos = ScreenToOutputPixel(rScrPos);
-        MoveField(meDnDFromType, mnDnDFromIndex, eToType, aOutPos);
+        MoveField(meDnDFromType, mnDnDFromIndex, eToType, rScrPos);
     }
 }
 
-PointerStyle ScPivotLayoutDlg::GetPointerStyleAtPoint( const Point& /* rScrPos */, ScPivotFieldType eFieldType )
+PointerStyle ScPivotLayoutDlg::GetPointerStyle(ScPivotFieldType eFieldType)
 {
     if (!mbIsDrag)
         return POINTER_ARROW;
@@ -962,14 +952,15 @@ namespace {
 
 class InsideFieldControl : std::unary_function<ScDPFieldControlBase*, bool>
 {
-    Point maOutPos;
+    Point maScrPos;
 public:
-    InsideFieldControl(const Point& rOutPos) : maOutPos(rOutPos) {}
+    InsideFieldControl(const Point& rScrPos) : maScrPos(rScrPos) {}
 
     bool operator() (const ScDPFieldControlBase* p) const
     {
-        Rectangle aRect(p->GetPosPixel(), p->GetSizePixel());
-        return aRect.IsInside(maOutPos);
+        Point aOutputPos = p->ScreenToOutputPixel(maScrPos);
+        Rectangle aRect(Point(0, 0), p->GetSizePixel());
+        return aRect.IsInside(aOutputPos);
     }
 };
 
@@ -977,9 +968,8 @@ public:
 
 ScPivotFieldType ScPivotLayoutDlg::GetFieldTypeAtPoint( const Point& rScrPos ) const
 {
-    Point aOutputPos = ScreenToOutputPixel(rScrPos);
     std::vector<ScDPFieldControlBase*>::const_iterator it =
-        std::find_if(maFieldCtrls.begin(), maFieldCtrls.end(), InsideFieldControl(aOutputPos));
+        std::find_if(maFieldCtrls.begin(), maFieldCtrls.end(), InsideFieldControl(rScrPos));
 
     return it == maFieldCtrls.end() ? PIVOTFIELDTYPE_UNKNOWN : (*it)->GetFieldType();
 }
@@ -1088,113 +1078,26 @@ OUString ScPivotLayoutDlg::GetFuncString( sal_uInt16& rFuncMask, bool bIsValue )
 
 void ScPivotLayoutDlg::InitControlAndDlgSizes()
 {
-    // The pivot.src file only specifies the positions of the controls. Here,
-    // we calculate appropriate size of each control based on how they are
-    // positioned relative to each other.
-
     // row/column/data area sizes
     long nFldW = GetStdFieldBtnSize().Width();
     long nFldH = GetStdFieldBtnSize().Height();
 
-    mpWndData->SetSizePixel(
-        Size(mpWndSelect->GetPosPixel().X() - mpWndData->GetPosPixel().X() - FIELD_AREA_GAP*4,
-             185));
-
-    mpWndPage->SetSizePixel(
-        Size(mpWndData->GetSizePixel().Width() + 85,
-             mpWndCol->GetPosPixel().Y() - mpWndPage->GetPosPixel().Y() - FIELD_AREA_GAP));
-    mpWndRow->SetSizePixel(
-        Size(mpWndData->GetPosPixel().X()-mpWndRow->GetPosPixel().X() - FIELD_AREA_GAP,
-             mpWndData->GetSizePixel().Height()));
-    mpWndCol->SetSizePixel(
-        Size(mpWndData->GetPosPixel().X() - mpWndCol->GetPosPixel().X() + mpWndData->GetSizePixel().Width(),
-             mpWndData->GetPosPixel().Y() - mpWndCol->GetPosPixel().Y() - FIELD_AREA_GAP));
-
-    // #i29203# align right border of page window with data window
-    long nDataPosX = mpWndData->GetPosPixel().X() + mpWndData->GetSizePixel().Width();
-    mpWndPage->SetPosPixel(
-        Point(nDataPosX - mpWndPage->GetSizePixel().Width(),
-              mpWndPage->GetPosPixel().Y()));
+    mpWndPage->set_width_request(approximate_char_width() * 35);
+    mpWndPage->set_height_request(GetTextHeight() * 4);
+    mpWndCol->set_width_request(approximate_char_width() * 30);
+    mpWndCol->set_height_request(GetTextHeight() * 4);
+    mpWndRow->set_width_request(approximate_char_width() * 10);
+    mpWndRow->set_height_request(GetTextHeight() * 8);
+    mpWndData->set_width_request(approximate_char_width() * 30);
+    mpWndData->set_height_request(GetTextHeight() * 8);
 
     // selection area
     long nLineSize = 10; // number of fields per column.
     long nH = OUTER_MARGIN_VER + nLineSize* nFldH + nLineSize * ROW_FIELD_BTN_GAP;
     nH += ROW_FIELD_BTN_GAP;
     nH += GetSettings().GetStyleSettings().GetScrollBarSize() + OUTER_MARGIN_VER;
-    mpWndSelect->SetSizePixel(
-        Size(2 * nFldW + ROW_FIELD_BTN_GAP + 10, nH));
-
-    mpWndPage->CalcSize();
-    mpWndRow->CalcSize();
-    mpWndCol->CalcSize();
-    mpWndData->CalcSize();
-    mpWndSelect->CalcSize();
-
-    AdjustDlgSize();
-}
-
-namespace {
-
-class MoveWndDown : public std::unary_function<Window*, void>
-{
-    long mnDelta;
-public:
-    MoveWndDown(long nDelta) : mnDelta(nDelta) {}
-    void operator() (Window* p) const
-    {
-        Point aPos = p->GetPosPixel();
-        aPos.Y() += mnDelta;
-        p->SetPosPixel(aPos);
-    }
-};
-
-}
-
-void ScPivotLayoutDlg::AdjustDlgSize()
-{
-    // On some platforms such as Windows XP, the dialog is not large enough to
-    // show the 'Drag the fields from the right...' text at the bottom. Check
-    // if it overlaps, and if it does, make the dialog size larger.
-    Size aWndSize = GetSizePixel();
-
-    Point aPosText = mpFtInfo->GetPosPixel();
-    Size aSizeText = mpFtInfo->GetSizePixel();
-    long nYRef = mpWndData->GetPosPixel().Y() + mpWndData->GetSizePixel().Height();
-    if (aPosText.Y() > nYRef)
-        // This text is visible. No need to adjust.
-        return;
-
-    // Calculate the extra height necessary.
-    long nBottomMargin = aWndSize.Height() - (aPosText.Y() + aSizeText.Height());
-    long nHeightNeeded = nYRef + TEXT_INFO_GAP + aSizeText.Height() + nBottomMargin;
-    long nDelta = nHeightNeeded - aWndSize.Height();
-    if (nDelta <= 0)
-        // This should never happen but just in case....
-        return;
-
-    // Make the main dialog taller.
-    aWndSize.Height() += nDelta;
-    SetSizePixel(aWndSize);
-
-    // Move the relevant controls downward.
-    std::vector<Window*> aWndToMove;
-    aWndToMove.reserve(16);
-    aWndToMove.push_back(mpFtInfo);
-    //aWndToMove.push_back(mpBtnMore);
-    aWndToMove.push_back(mpFtInArea);
-    aWndToMove.push_back(mpEdInPos);
-    aWndToMove.push_back(mpRbInPos);
-    aWndToMove.push_back(mpFtOutArea);
-    aWndToMove.push_back(mpLbOutPos);
-    aWndToMove.push_back(mpEdOutPos);
-    aWndToMove.push_back(mpRbOutPos);
-    aWndToMove.push_back(mpBtnIgnEmptyRows);
-    aWndToMove.push_back(mpBtnDetectCat);
-    aWndToMove.push_back(mpBtnTotalCol);
-    aWndToMove.push_back(mpBtnTotalRow);
-    aWndToMove.push_back(mpBtnFilter);
-    aWndToMove.push_back(mpBtnDrillDown);
-    std::for_each(aWndToMove.begin(), aWndToMove.end(), MoveWndDown(nDelta));
+    mpWndSelect->set_width_request(2 * nFldW + ROW_FIELD_BTN_GAP + 10);
+    mpWndSelect->set_height_request(nH);
 }
 
 bool ScPivotLayoutDlg::GetPivotArrays(
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index 3b88bfc..e8ec446 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -90,8 +90,6 @@ public:
         Window* mpParent;
     };
 
-    ScDPFieldControlBase(
-        ScPivotLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption, const char* pcHelpId);
     ScDPFieldControlBase(  Window* pParent );
     virtual ~ScDPFieldControlBase();
 
@@ -185,6 +183,7 @@ protected:
     virtual void            MouseMove( const MouseEvent& rMEvt );
     virtual void            GetFocus();
     virtual void            LoseFocus();
+    virtual void            Resize();
 
 protected:
     FieldNames& GetFieldNames();
@@ -278,9 +277,7 @@ protected:
     virtual void            Redraw();
 
 public:
-    ScDPHorFieldControl(
-        ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId);
-    ScDPHorFieldControl(  Window* pParent );
+    ScDPHorFieldControl(Window* pParent);
 
     virtual                 ~ScDPHorFieldControl();
 
@@ -316,8 +313,6 @@ private:
 class ScDPPageFieldControl : public ScDPHorFieldControl
 {
 public:
-    ScDPPageFieldControl(
-        ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId);
     ScDPPageFieldControl(  Window* pParent );
     virtual ~ScDPPageFieldControl();
 
@@ -330,8 +325,6 @@ public:
 class ScDPColFieldControl : public ScDPHorFieldControl
 {
 public:
-    ScDPColFieldControl(
-        ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId);
     ScDPColFieldControl(  Window* pParent );
     virtual ~ScDPColFieldControl();
 
@@ -347,8 +340,6 @@ public:
 class ScDPRowFieldControl : public ScDPFieldControlBase
 {
 public:
-    ScDPRowFieldControl(
-        ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId);
     ScDPRowFieldControl(  Window* pParent );
 
     virtual                 ~ScDPRowFieldControl();
@@ -389,9 +380,7 @@ private:
 class ScDPSelectFieldControl : public ScDPHorFieldControl
 {
 public:
-    ScDPSelectFieldControl(
-        ScPivotLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption, const char* pcHelpId);
-    ScDPSelectFieldControl(  Window* pParent );
+    ScDPSelectFieldControl( Window* pParent );
     virtual ~ScDPSelectFieldControl();
 
     virtual ScPivotFieldType GetFieldType() const;
@@ -403,9 +392,7 @@ public:
 class ScDPDataFieldControl : public ScDPHorFieldControl
 {
 public:
-    ScDPDataFieldControl(
-        ScPivotLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption, const char* pcHelpId);
-    ScDPDataFieldControl(  Window* pParent );
+    ScDPDataFieldControl( Window* pParent );
     virtual ~ScDPDataFieldControl();
 
     virtual ScPivotFieldType GetFieldType() const;
diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx
index b4548ce..7f3f4c0 100644
--- a/sc/source/ui/inc/pvlaydlg.hxx
+++ b/sc/source/ui/inc/pvlaydlg.hxx
@@ -79,6 +79,18 @@ class ScDocument;
 struct ScPivotFuncData;
 class ScDPObject;
 
+#define PIVOTSTR_SUM            0
+#define PIVOTSTR_COUNT          1
+#define PIVOTSTR_AVG            2
+#define PIVOTSTR_MAX            3
+#define PIVOTSTR_MIN            4
+#define PIVOTSTR_PROD           5
+#define PIVOTSTR_COUNT2         6
+#define PIVOTSTR_DEV            7
+#define PIVOTSTR_DEV2           8
+#define PIVOTSTR_VAR            9
+#define PIVOTSTR_VAR2           10
+
 class ScPivotLayoutDlg : public ScAnyRefDlg
 {
     /** data source type */
@@ -102,7 +114,7 @@ public:
     void                    NotifyMoveFieldToEnd      ( ScPivotFieldType eToType );
     void                    NotifyRemoveField    ( ScPivotFieldType eType, size_t nFieldIndex );
 
-    Size                    GetStdFieldBtnSize() const;
+    Size GetStdFieldBtnSize() const;
 
     /**
      * Drop currently dragged field item into specified position.
@@ -113,10 +125,10 @@ public:
     void DropFieldItem( const Point& rScrPos, ScPivotFieldType eToType );
 
     /**
-     * Get pointer style at current mouse position during dragging of field
+     * Get pointer style during dragging of field
      * item.
      */
-    PointerStyle GetPointerStyleAtPoint( const Point& rScrPos, ScPivotFieldType eFieldType );
+    PointerStyle GetPointerStyle( ScPivotFieldType eFieldType );
 
     /**
      * Determine the type of field at mouse cursor position.
@@ -133,8 +145,8 @@ protected:
     virtual sal_Bool    Close();
 
 private:
-    /** Returns the localized function name for the specified (1-based) resource index. */
-    inline const OUString& GetFuncName( sal_uInt16 nFuncIdx ) const { return maFuncNames[nFuncIdx-1]; }
+    /** Returns the localized function name for the specified resource index. */
+    inline const OUString& GetFuncName( sal_uInt16 nFuncIdx ) const { return maFuncNames[nFuncIdx]; }
 
     /** Fills the field windows from the current pivot table settings. */
     void                InitFieldWindows();
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index ad171d7..e566800 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -865,6 +865,11 @@ String SCSTR_VALERR
     Text [ en-US ] = "Invalid value" ;
 };
 
+String SCSTR_SELECT
+{
+    Text [ en-US ] = "Selection area";
+};
+
 String STR_NOFORMULASPECIFIED
 {
     Text [ en-US ] = "No formula specified." ;
diff --git a/sc/uiconfig/scalc/ui/pivottablelayout.ui b/sc/uiconfig/scalc/ui/pivottablelayout.ui
index efc0716..7564533 100644
--- a/sc/uiconfig/scalc/ui/pivottablelayout.ui
+++ b/sc/uiconfig/scalc/ui/pivottablelayout.ui
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
 <interface>
-  <!-- interface-requires gtk+ 3.0 -->
+  <!-- interface-requires LibreOffice 1.0 -->
+  <requires lib="gtk+" version="3.0"/>
   <object class="GtkDialog" id="PivotTableLayout">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
@@ -19,8 +21,8 @@
                 <property name="label">gtk-ok</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
                 <property name="has_default">True</property>
+                <property name="receives_default">True</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -96,73 +98,99 @@
           <object class="GtkBox" id="box1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
             <property name="orientation">vertical</property>
             <child>
               <object class="GtkBox" id="box2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="spacing">12</property>
                 <child>
                   <object class="GtkBox" id="box5">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
                     <property name="orientation">vertical</property>
                     <property name="spacing">6</property>
                     <child>
-                      <object class="sclo-ScDPPageFieldControl" id="pagefield">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
                       <object class="GtkGrid" id="grid1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
                         <property name="row_spacing">6</property>
                         <property name="column_spacing">6</property>
-                        <child>
-                          <placeholder/>
-                        </child>
+                        <property name="row_homogeneous">True</property>
+                        <property name="column_homogeneous">True</property>
                         <child>
                           <object class="sclo-ScDPColFieldControl" id="columnfield">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
                           </object>
                           <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">0</property>
-                            <property name="width">1</property>
+                            <property name="left_attach">2</property>
+                            <property name="top_attach">1</property>
+                            <property name="width">6</property>
                             <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="sclo-ScDPRowFieldControl" id="rowfield">
+                          <object class="sclo-ScDPDataFieldControl" id="datafield">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
                           </object>
                           <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">1</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
+                            <property name="left_attach">2</property>
+                            <property name="top_attach">2</property>
+                            <property name="width">6</property>
+                            <property name="height">2</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="sclo-ScDPDataFieldControl" id="datafield">
+                          <object class="sclo-ScDPPageFieldControl" id="pagefield">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
-                            <property name="top_attach">1</property>
-                            <property name="width">1</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">7</property>
                             <property name="height">1</property>
                           </packing>
                         </child>
+                        <child>
+                          <object class="sclo-ScDPRowFieldControl" id="rowfield">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">2</property>
+                            <property name="width">2</property>
+                            <property name="height">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -174,6 +202,7 @@
                       <object class="GtkLabel" id="info">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">Drag the fields from the right into the desired position</property>
                       </object>
                       <packing>
@@ -211,6 +240,7 @@
               <object class="GtkExpander" id="more">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
+                <property name="spacing">6</property>
                 <child>
                   <object class="GtkFrame" id="frame1">
                     <property name="visible">True</property>
@@ -221,8 +251,8 @@
                       <object class="GtkAlignment" id="alignment1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="left_padding">12</property>
                         <property name="top_padding">6</property>
+                        <property name="left_padding">12</property>
                         <child>
                           <object class="GtkBox" id="box3">
                             <property name="visible">True</property>
@@ -233,14 +263,110 @@
                               <object class="GtkBox" id="box4">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
+                                <property name="hexpand">True</property>
                                 <property name="spacing">6</property>
                                 <child>
-                                  <object class="GtkLabel" id="select_from">
+                                  <object class="GtkGrid" id="grid2">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="label" translatable="yes">_Selection from:</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="mnemonic_widget">rangesel1</property>
+                                    <property name="row_spacing">6</property>
+                                    <property name="column_spacing">12</property>
+                                    <child>
+                                      <object class="GtkLabel" id="select_from">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="xalign">0</property>
+                                        <property name="label" translatable="yes">_Selection from:</property>
+                                        <property name="use_underline">True</property>
+                                        <property name="mnemonic_widget">rangesel1</property>
+                                        <property name="ellipsize">end</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">0</property>
+                                        <property name="top_attach">0</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="foruilo-RefButton" id="changebutton1">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">3</property>
+                                        <property name="top_attach">0</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="foruilo-RefButton" id="changebutton2">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">3</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="foruilo-RefEdit" id="rangesel2">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="hexpand">True</property>
+                                        <property name="width_chars">25</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">2</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkComboBox" id="target_area">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="results_to">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="xalign">0</property>
+                                        <property name="label" translatable="yes">Res_ults to:</property>
+                                        <property name="use_underline">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">0</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="foruilo-RefEdit" id="rangesel1">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="top_attach">0</property>
+                                        <property name="width">2</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -248,30 +374,6 @@
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
-                                <child>
-                                  <object class="foruilo-RefEdit" id="rangesel1">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="orientation">vertical</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="foruilo-RefButton" id="changebutton1">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="orientation">vertical</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">2</property>
-                                  </packing>
-                                </child>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -280,70 +382,10 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkBox" id="box6">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="spacing">6</property>
-                                <child>
-                                  <object class="GtkLabel" id="results_to">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="label" translatable="yes">Res_ults to:</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="mnemonic_widget">rangesel2</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkComboBox" id="target_area">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="foruilo-RefEdit" id="rangesel2">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="orientation">vertical</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">2</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="foruilo-RefButton" id="changebutton2">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="orientation">vertical</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">3</property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                            <child>
                               <object class="GtkGrid" id="grid3">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
+                                <property name="hexpand">True</property>
                                 <property name="row_spacing">6</property>
                                 <property name="column_spacing">6</property>
                                 <child>
@@ -352,6 +394,7 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="hexpand">True</property>
                                     <property name="use_underline">True</property>
                                     <property name="xalign">0</property>
                                     <property name="draw_indicator">True</property>
@@ -369,6 +412,7 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="hexpand">True</property>
                                     <property name="use_underline">True</property>
                                     <property name="xalign">0</property>
                                     <property name="draw_indicator">True</property>
@@ -386,6 +430,7 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="hexpand">True</property>
                                     <property name="use_underline">True</property>
                                     <property name="xalign">0</property>
                                     <property name="draw_indicator">True</property>
@@ -403,6 +448,7 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="hexpand">True</property>
                                     <property name="use_underline">True</property>
                                     <property name="xalign">0</property>
                                     <property name="draw_indicator">True</property>
@@ -420,6 +466,7 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="hexpand">True</property>
                                     <property name="use_underline">True</property>
                                     <property name="xalign">0</property>
                                     <property name="draw_indicator">True</property>
@@ -437,6 +484,7 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="hexpand">True</property>
                                     <property name="use_underline">True</property>
                                     <property name="xalign">0</property>
                                     <property name="draw_indicator">True</property>
@@ -452,7 +500,7 @@
                               <packing>
                                 <property name="expand">False</property>
                                 <property name="fill">True</property>
-                                <property name="position">2</property>
+                                <property name="position">1</property>
                               </packing>
                             </child>
                           </object>
@@ -487,7 +535,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="page_text">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Page Fields</property>
               </object>
@@ -499,7 +546,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="column_text">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Column Fields</property>
               </object>
@@ -511,7 +557,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="row_text">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Row Fields</property>
               </object>
@@ -523,7 +568,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="data_text">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Data Fields</property>
               </object>
@@ -535,7 +579,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="select_text">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Selection area</property>
               </object>
@@ -547,7 +590,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="sum">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Sum - </property>
               </object>
@@ -559,7 +601,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="count">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Count - </property>
               </object>
@@ -571,7 +612,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="mean">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Mean - </property>
               </object>
@@ -583,7 +623,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="max">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Max - </property>
               </object>
@@ -595,7 +634,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="min">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Min - </property>
               </object>
@@ -607,7 +645,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="product">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Product - </property>
               </object>
@@ -619,7 +656,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="count2">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Count - </property>
               </object>
@@ -631,7 +667,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="stdev">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">StDev - </property>
               </object>
@@ -643,7 +678,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="stdevp">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">StDevP - </property>
               </object>
@@ -655,7 +689,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="var">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Var - </property>
               </object>
@@ -667,7 +700,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="varp">
-                <property name="visible">False</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">VarP - </property>
               </object>
commit 02ef234b77b6c5f4c0d6634881168313e97288d1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 13 10:30:06 2014 +0000

    fix homogeneous grid spanning row/col handling
    
    Change-Id: I26ca29f2b02a1587cfe94d5342809f51a207a194

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index e221147..4cfdc80 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -801,13 +801,13 @@ VclGrid::array_type VclGrid::assembleGrid() const
                 if (get_column_homogeneous())
                 {
                     for (sal_Int32 nSpanX = 1; nSpanX < rEntry.nSpanWidth; ++nSpanX)
-                        aNonEmptyCols[x+1] = true;
+                        aNonEmptyCols[x+nSpanX] = true;
                 }
                 aNonEmptyRows[y] = true;
                 if (get_row_homogeneous())
                 {
                     for (sal_Int32 nSpanY = 1; nSpanY < rEntry.nSpanHeight; ++nSpanY)
-                        aNonEmptyRows[x+1] = true;
+                        aNonEmptyRows[y+nSpanY] = true;
                 }
             }
         }
commit cfa4f622caa155dd8ab1215a324dd409cd447cd6
Author: Katarina Behrens <bubli at bubli.org>
Date:   Tue Feb 4 11:40:48 2014 +0100

    Converted pivot table layout dlg to .ui
    
    pimped up dialog a bit, added mnemonics
    
    Change-Id: I4585d9a3a1c96b45c7eedea8a5be41ec717139dd

diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index f68519b..ac2f383 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -123,6 +123,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/paradialog \
 	sc/uiconfig/scalc/ui/paratemplatedialog \
 	sc/uiconfig/scalc/ui/pivotfielddialog \
+	sc/uiconfig/scalc/ui/pivottablelayout \
 	sc/uiconfig/scalc/ui/printareasdialog \
 	sc/uiconfig/scalc/ui/printeroptions \
 	sc/uiconfig/scalc/ui/protectsheetdlg \
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index ca91ab6..2026a10 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -118,7 +118,7 @@ ScAccessibleDataPilotControl *ScDPFieldControlBase::AccessRef::operator -> () co
 
 ScDPFieldControlBase::ScDPFieldControlBase(
     ScPivotLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption, const char* pcHelpId) :
-    Control(pParent, rResId),
+    Control(pParent),
     mpDlg(pParent),
     mpCaption(pCaption),
     mnFieldSelected(0)
@@ -129,6 +129,21 @@ ScDPFieldControlBase::ScDPFieldControlBase(
         maName = MnemonicGenerator::EraseAllMnemonicChars( pCaption->GetText() );
 }
 
+ScDPFieldControlBase::ScDPFieldControlBase( Window* pParent ) :
+    Control (pParent),
+    mnFieldSelected(0)
+{
+}
+
+void ScDPFieldControlBase::Init( ScPivotLayoutDlg* pDlg, FixedText* pCaption )
+{
+    mpDlg = pDlg;
+    mpCaption = pCaption;
+
+    if (pCaption)
+        maName = MnemonicGenerator::EraseAllMnemonicChars( pCaption->GetText() );
+}
+
 ScDPFieldControlBase::~ScDPFieldControlBase()
 {
     AccessRef aRef( mxAccessible );
@@ -897,6 +912,19 @@ ScDPHorFieldControl::ScDPHorFieldControl(
     AppendPaintable(&maScroll);
 }
 
+ScDPHorFieldControl::ScDPHorFieldControl ( Window* pParent )  :
+    ScDPFieldControlBase( pParent ),
+    maScroll(this, WB_HORZ | WB_DRAG),
+    mnFieldBtnRowCount(0),
+    mnFieldBtnColCount(0)
+{
+    maScroll.SetScrollHdl( LINK(this, ScDPHorFieldControl, ScrollHdl) );
+    maScroll.SetEndScrollHdl( LINK(this, ScDPHorFieldControl, EndScrollHdl) );
+    maScroll.Hide();
+
+    AppendPaintable(&maScroll);
+}
+
 ScDPHorFieldControl::~ScDPHorFieldControl()
 {
 }
@@ -1149,6 +1177,17 @@ ScDPPageFieldControl::ScDPPageFieldControl(
 {
 }
 
+ScDPPageFieldControl::ScDPPageFieldControl ( Window* pParent )  :
+    ScDPHorFieldControl( pParent )
+{
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeScDPPageFieldControl( Window *pParent, VclBuilder::stringmap & )
+{
+    return new ScDPPageFieldControl( pParent );
+}
+
+
 ScDPPageFieldControl::~ScDPPageFieldControl()
 {
 }
@@ -1171,6 +1210,16 @@ ScDPColFieldControl::ScDPColFieldControl(
 {
 }
 
+ScDPColFieldControl::ScDPColFieldControl ( Window* pParent )  :
+    ScDPHorFieldControl( pParent )
+{
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeScDPColFieldControl( Window *pParent, VclBuilder::stringmap & )
+{
+    return new ScDPColFieldControl( pParent );
+}
+
 ScDPColFieldControl::~ScDPColFieldControl()
 {
 }
@@ -1200,6 +1249,24 @@ ScDPRowFieldControl::ScDPRowFieldControl(
     AppendPaintable(&maScroll);
 }
 
+ScDPRowFieldControl::ScDPRowFieldControl ( Window* pParent )  :
+    ScDPFieldControlBase( pParent ),
+    maScroll(this, WB_VERT | WB_DRAG),
+    mnColumnBtnCount(0)
+{
+    maScroll.SetScrollHdl( LINK(this, ScDPRowFieldControl, ScrollHdl) );
+    maScroll.SetEndScrollHdl( LINK(this, ScDPRowFieldControl, EndScrollHdl) );
+    maScroll.Show(false);
+
+    AppendPaintable(&maScroll);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeScDPRowFieldControl( Window *pParent, VclBuilder::stringmap & )
+{
+    return new ScDPRowFieldControl( pParent );
+}
+
+
 ScDPRowFieldControl::~ScDPRowFieldControl()
 {
 }
@@ -1424,6 +1491,17 @@ ScDPSelectFieldControl::ScDPSelectFieldControl(
     SetName(OUString(ScResId(STR_SELECT)));
 }
 
+ScDPSelectFieldControl::ScDPSelectFieldControl(  Window* pParent ):
+    ScDPHorFieldControl( pParent )
+{
+    //SetName(OUString(ScResId(STR_SELECT)));
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeScDPSelectFieldControl( Window *pParent, VclBuilder::stringmap & )
+{
+    return new ScDPSelectFieldControl( pParent );
+}
+
 ScDPSelectFieldControl::~ScDPSelectFieldControl()
 {
 }
@@ -1446,6 +1524,16 @@ ScDPDataFieldControl::ScDPDataFieldControl(
 {
 }
 
+ScDPDataFieldControl::ScDPDataFieldControl(  Window* pParent ):
+    ScDPHorFieldControl( pParent )
+{
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeScDPDataFieldControl( Window *pParent, VclBuilder::stringmap & )
+{
+    return new ScDPDataFieldControl( pParent );
+}
+
 ScDPDataFieldControl::~ScDPDataFieldControl()
 {
 }
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index d7e43d5..f7e2001 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -45,6 +45,7 @@
 
 #include <sfx2/dispatch.hxx>
 #include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
 
 #include "dbdocfun.hxx"
 #include "uiitems.hxx"
@@ -84,50 +85,33 @@ Point DlgPos2WndPos( const Point& rPt, const Window& rWnd )
     return aWndPt;
 }
 
+static const OString* getFuncNames()
+{
+    static const OString gFuncNames[ PIVOT_MAXFUNC ] =
+    {
+        OString("sum") ,
+        OString("count") ,
+        OString("mean") ,
+        OString("max") ,
+        OString("min") ,
+        OString("product"),
+        OString("count2"),
+        OString("stdev") ,
+        OString("stdevp") ,
+        OString("var") ,
+        OString("varp") ,
+    };
+    return &gFuncNames[0];
+}
+
 } // namespace
 
 ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, const ScDPObject& rDPObject, bool bNewOutput ) :
-    ScAnyRefDlg( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ),
-
-    maFlLayout( this, ScResId( FL_LAYOUT ) ),
-    maFtPage( this, ScResId( FT_PAGE ) ),
-    maWndPage( this, ScResId( WND_PAGE ), &maFtPage, HID_SC_DPLAY_PAGE ),
-    maFtCol( this, ScResId( FT_COL ) ),
-    maWndCol( this, ScResId( WND_COL ), &maFtCol, HID_SC_DPLAY_COLUMN ),
-    maFtRow( this, ScResId( FT_ROW ) ),
-    maWndRow( this, ScResId( WND_ROW ), &maFtRow, HID_SC_DPLAY_ROW ),
-    maFtData( this, ScResId( FT_DATA ) ),
-    maWndData( this, ScResId( WND_DATA ), &maFtData, HID_SC_DPLAY_DATA ),
-    maWndSelect( this, ScResId( WND_SELECT ), NULL, HID_SC_DPLAY_SELECT ),
-    maFtInfo( this, ScResId( FT_INFO ) ),
-
-    maFlAreas( this, ScResId( FL_OUTPUT ) ),
-    maFtInArea( this, ScResId( FT_INAREA) ),
-    maEdInPos( this, this, &maFtInArea, ScResId( ED_INAREA) ),
-    maRbInPos( this, ScResId( RB_INAREA ), &maEdInPos, this ),
-    maLbOutPos( this, ScResId( LB_OUTAREA ) ),
-    maFtOutArea( this, ScResId( FT_OUTAREA ) ),
-    maEdOutPos( this, this, &maFtOutArea, ScResId( ED_OUTAREA ) ),
-    maRbOutPos( this, ScResId( RB_OUTAREA ), &maEdOutPos, this ),
-    maBtnIgnEmptyRows( this, ScResId( BTN_IGNEMPTYROWS ) ),
-    maBtnDetectCat( this, ScResId( BTN_DETECTCAT ) ),
-    maBtnTotalCol( this, ScResId( BTN_TOTALCOL ) ),
-    maBtnTotalRow( this, ScResId( BTN_TOTALROW ) ),
-    maBtnFilter( this, ScResId( BTN_FILTER ) ),
-    maBtnDrillDown( this, ScResId( BTN_DRILLDOWN ) ),
-
-    maBtnOk( this, ScResId( BTN_OK ) ),
-    maBtnCancel( this, ScResId( BTN_CANCEL ) ),
-    maBtnHelp( this, ScResId( BTN_HELP ) ),
-    maBtnRemove( this, ScResId( BTN_REMOVE ) ),
-    maBtnOptions( this, ScResId( BTN_OPTIONS ) ),
-    maBtnMore( this, ScResId( BTN_MORE ) ),
-
+    ScAnyRefDlg( pB, pCW, pParent, "PivotTableLayout", "modules/scalc/ui/pivottablelayout.ui" ),
     mxDlgDPObject( new ScDPObject( rDPObject ) ),
     mpViewData( ((ScTabViewShell*)SfxViewShell::Current())->GetViewData() ),
     mpDoc( ((ScTabViewShell*)SfxViewShell::Current())->GetViewData()->GetDocument() ),
     mpRefInputEdit(NULL),
-
     maStrUndefined(SC_RESSTR(SCSTR_UNDEFINED)),
     maStrNewTable(SC_RESSTR(SCSTR_NEWTABLE)),
     mbIsDrag(false),
@@ -135,76 +119,103 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
     mnOffset(0),
     mbRefInputMode( false )
 {
+    get( mpFtPage, "page_text" );
+    get( mpWndPage, "pagefield" );
+    get( mpFtCol, "column_text" );
+    get( mpWndCol, "columnfield" );
+    get( mpFtRow, "row_text" );
+    get( mpWndRow, "rowfield" );
+    get( mpFtData, "data_text" );
+    get( mpWndData, "datafield" );
+    get( mpWndSelect, "buttonfield" );
+    get( mpFtInfo, "info" );
+
+    mpWndPage->Init( this, mpFtPage );
+    mpWndCol->Init( this, mpFtCol );
+    mpWndRow->Init( this, mpFtRow );
+    mpWndData->Init( this, mpFtData );
+    mpWndSelect->Init( this, NULL );
+    mpWndSelect->SetName( get<FixedText>("select_text")->GetText());
+
+    get( mpFtInArea, "select_from" );
+    get( mpEdInPos, "rangesel1" );
+    get( mpRbInPos, "changebutton1" );
+    get( mpLbOutPos, "target_area" );
+    get( mpFtOutArea, "results_to" );
+    get( mpEdOutPos, "rangesel2" );
+    get( mpRbOutPos, "changebutton2" );
+    get( mpBtnIgnEmptyRows, "ignore_empty" );
+    get( mpBtnDetectCat, "detect_category" );
+    get( mpBtnTotalCol, "total_cols" );
+    get( mpBtnTotalRow, "total_rows" );
+    get( mpBtnFilter, "add_filter" );
+    get( mpBtnDrillDown, "drill_down" );
+
+    get( mpBtnOk, "ok" );
+    get( mpBtnCancel, "cancel" );
+    get( mpBtnRemove, "remove" );
+    get( mpBtnOptions, "options" );
+    get( mpExpander, "more" );
+    mpExpander->SetExpandedHdl( LINK( this, ScPivotLayoutDlg, ExpandHdl ) );
+
     mxDlgDPObject->FillOldParam( maPivotData );
     mxDlgDPObject->FillLabelData( maPivotData );
 
-    maBtnRemove.SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
-    maBtnOptions.SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
+    mpBtnRemove->SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
+    mpBtnOptions->SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
 
     maFuncNames.reserve( PIVOT_MAXFUNC );
-    for ( sal_uInt16 i = 1; i <= PIVOT_MAXFUNC; ++i )
-        maFuncNames.push_back(ScResId(i).toString());
-
-    maBtnMore.AddWindow( &maFlAreas );
-    maBtnMore.AddWindow( &maFtInArea );
-    maBtnMore.AddWindow( &maEdInPos );
-    maBtnMore.AddWindow( &maRbInPos );
-    maBtnMore.AddWindow( &maFtOutArea );
-    maBtnMore.AddWindow( &maLbOutPos );
-    maBtnMore.AddWindow( &maEdOutPos );
-    maBtnMore.AddWindow( &maRbOutPos );
-    maBtnMore.AddWindow( &maBtnIgnEmptyRows );
-    maBtnMore.AddWindow( &maBtnDetectCat );
-    maBtnMore.AddWindow( &maBtnTotalCol );
-    maBtnMore.AddWindow( &maBtnTotalRow );
-    maBtnMore.AddWindow( &maBtnFilter );
-    maBtnMore.AddWindow( &maBtnDrillDown );
-    maBtnMore.SetClickHdl( LINK( this, ScPivotLayoutDlg, MoreClickHdl ) );
+    const OString* pFuncNames = getFuncNames();
+    for ( sal_uInt16 i = 0; i < PIVOT_MAXFUNC; ++i )
+    {
+        OUString tmpText = get<FixedText>(pFuncNames[i])->GetText();
+        maFuncNames.push_back(tmpText);
+    }
 
     maFieldCtrls.reserve(5);
-    maFieldCtrls.push_back(&maWndPage);
-    maFieldCtrls.push_back(&maWndCol);
-    maFieldCtrls.push_back(&maWndRow);
-    maFieldCtrls.push_back(&maWndData);
-    maFieldCtrls.push_back(&maWndSelect);
+    maFieldCtrls.push_back(mpWndPage);
+    maFieldCtrls.push_back(mpWndCol);
+    maFieldCtrls.push_back(mpWndRow);
+    maFieldCtrls.push_back(mpWndData);
+    maFieldCtrls.push_back(mpWndSelect);
 
     InitControlAndDlgSizes();
 
     if (mxDlgDPObject->GetSheetDesc())
     {
-        maEdInPos.Enable();
-        maRbInPos.Enable();
+        mpEdInPos->Enable();
+        mpRbInPos->Enable();
         const ScSheetSourceDesc* p = mxDlgDPObject->GetSheetDesc();
         OUString aRangeName = p->GetRangeName();
         if (!aRangeName.isEmpty())
-            maEdInPos.SetText(aRangeName);
+            mpEdInPos->SetText(aRangeName);
         else
         {
             maOldRange = p->GetSourceRange();
             OUString aStr(maOldRange.Format(SCR_ABS_3D, mpDoc, mpDoc->GetAddressConvention()));
-            maEdInPos.SetText(aStr);
+            mpEdInPos->SetText(aStr);
         }
     }
     else
     {
         // data is not reachable, so could be a remote database
-        maEdInPos.Disable();
-        maRbInPos.Disable();
+        mpEdInPos->Disable();
+        mpRbInPos->Disable();
     }
 
     InitFieldWindows();
 
-    maLbOutPos.SetSelectHdl( LINK( this, ScPivotLayoutDlg, SelAreaHdl ) );
-    maEdOutPos.SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdOutModifyHdl ) );
-    maEdInPos.SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdInModifyHdl ) );
-    maBtnOk.SetClickHdl( LINK( this, ScPivotLayoutDlg, OkHdl ) );
-    maBtnCancel.SetClickHdl( LINK( this, ScPivotLayoutDlg, CancelHdl ) );
+    mpLbOutPos->SetSelectHdl( LINK( this, ScPivotLayoutDlg, SelAreaHdl ) );
+    mpEdOutPos->SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdOutModifyHdl ) );
+    mpEdInPos->SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdInModifyHdl ) );
+    mpBtnOk->SetClickHdl( LINK( this, ScPivotLayoutDlg, OkHdl ) );
+    mpBtnCancel->SetClickHdl( LINK( this, ScPivotLayoutDlg, CancelHdl ) );
 
     // Set focus handler for the reference edit text boxes.
     Link aGetFocusLink = LINK(this, ScPivotLayoutDlg, GetRefEditFocusHdl);
-    if (maEdInPos.IsEnabled())
-        maEdInPos.SetGetFocusHdl(aGetFocusLink);
-    maEdOutPos.SetGetFocusHdl(aGetFocusLink);
+    if (mpEdInPos->IsEnabled())
+        mpEdInPos->SetGetFocusHdl(aGetFocusLink);
+    mpEdOutPos->SetGetFocusHdl(aGetFocusLink);
 
     if ( mpViewData && mpDoc )
     {
@@ -214,9 +225,9 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
          * um sinnvolle Bereiche handelt
          */
 
-        maLbOutPos.Clear();
-        maLbOutPos.InsertEntry( maStrUndefined, 0 );
-        maLbOutPos.InsertEntry( maStrNewTable,  1 );
+        mpLbOutPos->Clear();
+        mpLbOutPos->InsertEntry( maStrUndefined, 0 );
+        mpLbOutPos->InsertEntry( maStrNewTable,  1 );
 
         ScAreaNameIterator aIter( mpDoc );
         OUString aName;
@@ -225,11 +236,11 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
         {
             if ( !aIter.WasDBName() )       // hier keine DB-Bereiche !
             {
-                sal_uInt16 nInsert = maLbOutPos.InsertEntry( aName );
+                sal_uInt16 nInsert = mpLbOutPos->InsertEntry( aName );
 
                 OUString aRefStr(aRange.aStart.Format(SCA_ABS_3D, mpDoc, mpDoc->GetAddressConvention()));
                 maRefStrs.push_back(new OUString(aRefStr));
-                maLbOutPos.SetEntryData(nInsert, &maRefStrs.back());
+                mpLbOutPos->SetEntryData(nInsert, &maRefStrs.back());
             }
         }
     }
@@ -237,9 +248,9 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
     if (bNewOutput)
     {
         // Output to a new sheet by default for a brand-new output.
-        maLbOutPos.SelectEntryPos(1);
-        maEdOutPos.Disable();
-        maRbOutPos.Disable();
+        mpLbOutPos->SelectEntryPos(1);
+        mpEdOutPos->Disable();
+        mpRbOutPos->Disable();
     }
     else
     {
@@ -251,29 +262,27 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
                 ScAddress( maPivotData.nCol,
                            maPivotData.nRow,
                            maPivotData.nTab ).Format(STD_FORMAT, mpDoc, mpDoc->GetAddressConvention());
-            maEdOutPos.SetText( aStr );
+            mpEdOutPos->SetText( aStr );
             maOutputRefStr = aStr;
             EdOutModifyHdl(0);
         }
         else
         {
-            maLbOutPos.SelectEntryPos( maLbOutPos.GetEntryCount()-1 );
+            mpLbOutPos->SelectEntryPos( mpLbOutPos->GetEntryCount()-1 );
             SelAreaHdl(NULL);
         }
     }
 
-    maBtnIgnEmptyRows.Check( maPivotData.bIgnoreEmptyRows );
-    maBtnDetectCat   .Check( maPivotData.bDetectCategories );
-    maBtnTotalCol    .Check( maPivotData.bMakeTotalCol );
-    maBtnTotalRow    .Check( maPivotData.bMakeTotalRow );
+    mpBtnIgnEmptyRows->Check( maPivotData.bIgnoreEmptyRows );
+    mpBtnDetectCat->Check( maPivotData.bDetectCategories );
+    mpBtnTotalCol->Check( maPivotData.bMakeTotalCol );
+    mpBtnTotalRow->Check( maPivotData.bMakeTotalRow );
 
     const ScDPSaveData* pSaveData = mxDlgDPObject->GetSaveData();
-    maBtnFilter.Check( !pSaveData || pSaveData->GetFilterButton() );
-    maBtnDrillDown.Check( !pSaveData || pSaveData->GetDrillDown() );
-
-    GrabFieldFocus( maWndSelect );
+    mpBtnFilter->Check( !pSaveData || pSaveData->GetFilterButton() );
+    mpBtnDrillDown->Check( !pSaveData || pSaveData->GetDrillDown() );
 
-    FreeResource();
+    GrabFieldFocus( mpWndSelect );
 }
 
 ScPivotLayoutDlg::~ScPivotLayoutDlg()
@@ -302,11 +311,11 @@ void ScPivotLayoutDlg::InitWndSelect(const ScDPLabelDataVector& rLabels)
             // original dimension if available.  Be aware that duplicate
             // dimensions may have different layout names.
             ScPivotFuncData aFunc(maLabelData[i].mnCol, maLabelData[i].mnFuncMask);
-            maWndSelect.AppendField(maLabelData[i].getDisplayName(), aFunc);
+            mpWndSelect->AppendField(maLabelData[i].getDisplayName(), aFunc);
         }
     }
-    maWndSelect.ResetScrollBar();
-    maWndSelect.Paint(Rectangle());
+    mpWndSelect->ResetScrollBar();
+    mpWndSelect->Paint(Rectangle());
 }
 
 void ScPivotLayoutDlg::InitWndData(const vector<ScPivotField>& rFields)
@@ -332,11 +341,11 @@ void ScPivotLayoutDlg::InitWndData(const vector<ScPivotField>& rFields)
                 aStr += pData->maName;
             }
 
-            maWndData.AppendField(aStr, aFunc);
+            mpWndData->AppendField(aStr, aFunc);
             pData->mnFuncMask = nMask;
         }
     }
-    maWndData.ResetScrollBar();
+    mpWndData->ResetScrollBar();
 }
 
 void ScPivotLayoutDlg::InitFieldWindow( const vector<ScPivotField>& rFields, ScPivotFieldType eType )
@@ -370,22 +379,22 @@ void ScPivotLayoutDlg::InitFieldWindows()
     InitWndData(maPivotData.maDataFields);
 }
 
-void ScPivotLayoutDlg::GrabFieldFocus( ScDPFieldControlBase& rFieldWindow )
+void ScPivotLayoutDlg::GrabFieldFocus( ScDPFieldControlBase* rFieldWindow )
 {
-    if( rFieldWindow.IsEmpty() )
+    if( rFieldWindow->IsEmpty() )
     {
-        if( maWndSelect.IsEmpty() )
-            maBtnOk.GrabFocus();
+        if( mpWndSelect->IsEmpty() )
+            mpBtnOk->GrabFocus();
         else
-            maWndSelect.GrabFocus();
+            mpWndSelect->GrabFocus();
     }
     else
-        rFieldWindow.GrabFocus();
+        rFieldWindow->GrabFocus();
 }
 
 void ScPivotLayoutDlg::AddField( size_t nFromIndex, ScPivotFieldType eToType, const Point& rAtPos )
 {
-    ScPivotFuncData aFunc = maWndSelect.GetFuncData(nFromIndex); // local copy
+    ScPivotFuncData aFunc = mpWndSelect->GetFuncData(nFromIndex); // local copy
 
     bool bAllowed = IsOrientationAllowed(aFunc.mnCol, eToType);
     if (!bAllowed)
@@ -444,7 +453,7 @@ void ScPivotLayoutDlg::AddField( size_t nFromIndex, ScPivotFieldType eToType, co
 
 void ScPivotLayoutDlg::AppendField(size_t nFromIndex, ScPivotFieldType eToType)
 {
-    ScPivotFuncData aFunc = maWndSelect.GetFuncData(nFromIndex); // local copy
+    ScPivotFuncData aFunc = mpWndSelect->GetFuncData(nFromIndex); // local copy
 
     size_t nAt = 0;
     ScDPFieldControlBase* toWnd = GetFieldWindow(eToType);
@@ -707,7 +716,7 @@ void ScPivotLayoutDlg::RemoveField( ScPivotFieldType eFromType, size_t nIndex )
 
     pWnd->DeleteFieldByIndex(nIndex);
     if (pWnd->IsEmpty())
-        GrabFieldFocus(maWndSelect);
+        GrabFieldFocus(mpWndSelect);
 }
 
 PointerStyle ScPivotLayoutDlg::NotifyMouseButtonDown( ScPivotFieldType eType, size_t nFieldIndex )
@@ -763,7 +772,7 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI
             // list of names of all data fields
             vector<ScDPName> aDataFieldNames;
             vector<ScDPFieldControlBase::FuncItem> aFuncItems;
-            maWndData.GetAllFuncItems(aFuncItems);
+            mpWndData->GetAllFuncItems(aFuncItems);
             vector<ScDPFieldControlBase::FuncItem>::const_iterator it = aFuncItems.begin(), itEnd = aFuncItems.end();
             for (; it != itEnd; ++it)
             {
@@ -803,7 +812,7 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI
 
         case PIVOTFIELDTYPE_DATA:
         {
-            ScPivotFuncData& rFuncData = maWndData.GetFuncData(nFieldIndex);
+            ScPivotFuncData& rFuncData = mpWndData->GetFuncData(nFieldIndex);
             boost::scoped_ptr<AbstractScDPFunctionDlg> pDlg(
                 pFact->CreateScDPFunctionDlg(
                     this, maLabelData, *pData, rFuncData));
@@ -816,7 +825,7 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI
 
                 if (bFuncChanged)
                     // Get the new duplicate count since the function has changed.
-                    rFuncData.mnDupCount = maWndData.GetNextDupCount(rFuncData, nFieldIndex);
+                    rFuncData.mnDupCount = mpWndData->GetNextDupCount(rFuncData, nFieldIndex);
 
                 ScDPLabelData* p = GetLabelData(rFuncData.mnCol);
                 OUString aStr = p->maLayoutName;
@@ -826,7 +835,7 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI
                     aStr = GetFuncString (rFuncData.mnFuncMask);
                     aStr += p->maName;
                 }
-                maWndData.SetFieldText(aStr, nFieldIndex, rFuncData.mnDupCount);
+                mpWndData->SetFieldText(aStr, nFieldIndex, rFuncData.mnDupCount);
             }
         }
         break;
@@ -852,8 +861,8 @@ void ScPivotLayoutDlg::NotifyFieldFocus( ScPivotFieldType eType, bool bGotFocus
     if ( bEnable && bGotFocus && pWnd && pWnd->IsEmpty() )
         bEnable = false;
 
-    maBtnRemove.Enable( bEnable );
-    maBtnOptions.Enable( bEnable );
+    mpBtnRemove->Enable( bEnable );
+    mpBtnOptions->Enable( bEnable );
     if( bGotFocus )
         meLastActiveType = eType;
 }
@@ -871,10 +880,10 @@ void ScPivotLayoutDlg::NotifyMoveFieldToEnd( ScPivotFieldType eToType )
         else
             pWnd->GrabFocus();
         if( meLastActiveType == PIVOTFIELDTYPE_SELECT )
-            maWndSelect.SelectNext();
+            mpWndSelect->SelectNext();
     }
     else
-        GrabFieldFocus( maWndSelect );
+        GrabFieldFocus( mpWndSelect );
 }
 
 void ScPivotLayoutDlg::NotifyRemoveField( ScPivotFieldType eType, size_t nFieldIndex )
@@ -887,7 +896,7 @@ Size ScPivotLayoutDlg::GetStdFieldBtnSize() const
 {

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list