[Libreoffice-commits] core.git: 3 commits - extras/source sc/AllLangResTarget_sc.mk sc/source sc/uiconfig sc/UIConfig_scalc.mk sd/uiconfig svtools/source svx/source

Caolán McNamara caolanm at redhat.com
Wed Apr 24 11:32:48 PDT 2013


 extras/source/glade/libreoffice-catalog.xml.in |    3 
 sc/AllLangResTarget_sc.mk                      |    1 
 sc/UIConfig_scalc.mk                           |    1 
 sc/source/ui/inc/protectiondlg.hrc             |   38 ---
 sc/source/ui/inc/protectiondlg.hxx             |   23 --
 sc/source/ui/miscdlgs/protectiondlg.cxx        |   89 +++-----
 sc/source/ui/miscdlgs/protectiondlg.src        |  125 -----------
 sc/uiconfig/scalc/ui/protectsheetdlg.ui        |  108 ++++++----
 sd/uiconfig/sdraw/ui/modifylayer.ui            |  270 -------------------------
 svtools/source/contnr/treelistbox.cxx          |    6 
 svx/source/dialog/checklbx.cxx                 |   13 +
 11 files changed, 135 insertions(+), 542 deletions(-)

New commits:
commit adfacdd91cb67ed7f2ae0d4991537211d263278d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 24 16:57:16 2013 +0100

    adapt code to protect sheet .ui
    
    Change-Id: Ic3c375e87cf89a3956f3703c6facbcbe5ffd5d58

diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 4774077..9275f78 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -132,6 +132,9 @@
     <glade-widget-class title="Tab List" name="svtlo-SvTabListBox"
                         generic-name="Tab List" parent="svtlo-SvTreeListBox"
                         icon-name="widget-gtk-treeview"/>
+    <glade-widget-class title="Checked Tree List" name="svxlo-SvxCheckListBox"
+                        generic-name="Checked Tree List" parent="GtkTreeView"
+                        icon-name="widget-gtk-treeview"/>
     <glade-widget-class title="Dial Control" name="svxlo-DialControl"
                         generic-name="Dial Control" parent="GtkSpinner"
                         icon-name="widget-gtk-spinner"/>
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index c25cc42..2a3adcc 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -82,7 +82,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
     sc/source/ui/miscdlgs/retypepassdlg.src \
     sc/source/ui/miscdlgs/highred.src \
     sc/source/ui/miscdlgs/conflictsdlg.src \
-    sc/source/ui/miscdlgs/protectiondlg.src \
     sc/source/ui/miscdlgs/acredlin.src \
     sc/source/ui/formdlg/formdlgs.src \
     sc/source/ui/formdlg/dwfunctr.src \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 89ad302..48a8da0 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -72,6 +72,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/insertsheet \
 	sc/uiconfig/scalc/ui/managenamesdialog \
 	sc/uiconfig/scalc/ui/printeroptions \
+	sc/uiconfig/scalc/ui/protectsheetdlg \
 	sc/uiconfig/scalc/ui/sheetprintpage \
 	sc/uiconfig/scalc/ui/selectrange \
 	sc/uiconfig/scalc/ui/selectsource \
diff --git a/sc/source/ui/inc/protectiondlg.hrc b/sc/source/ui/inc/protectiondlg.hrc
deleted file mode 100644
index 5c806de..0000000
--- a/sc/source/ui/inc/protectiondlg.hrc
+++ /dev/null
@@ -1,38 +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_PROTECT             4
-#define FT_PASSWORD1            5
-#define ED_PASSWORD1            6
-#define FT_PASSWORD2            7
-#define ED_PASSWORD2            8
-#define FL_OPTIONS              9
-#define FT_OPTIONS             10
-#define CLB_OPTIONS            11
-
-#define ST_SELECT_PROTECTED_CELLS          50
-#define ST_SELECT_UNPROTECTED_CELLS        51
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/protectiondlg.hxx b/sc/source/ui/inc/protectiondlg.hxx
index 2eb6abd..ad1afb9 100644
--- a/sc/source/ui/inc/protectiondlg.hxx
+++ b/sc/source/ui/inc/protectiondlg.hxx
@@ -24,6 +24,7 @@
 #include <vcl/button.hxx>
 #include <vcl/fixed.hxx>
 #include <vcl/edit.hxx>
+#include <vcl/layout.hxx>
 #include <svx/checklbx.hxx>
 
 class Window;
@@ -48,23 +49,19 @@ private:
 
     void EnableOptionalWidgets(bool bEnable = true);
 
-    CheckBox        maBtnProtect;
+    CheckBox*        m_pBtnProtect;
 
-    FixedText       maPassword1Text;
-    Edit            maPassword1Edit;
-    FixedText       maPassword2Text;
-    Edit            maPassword2Edit;
+    VclContainer*    m_pPasswords;
+    VclContainer*    m_pOptions;
+    Edit*            m_pPassword1Edit;
+    Edit*            m_pPassword2Edit;
 
-    FixedLine       maOptionsLine;
-    FixedText       maOptionsText;
-    SvxCheckListBox maOptionsListBox;
+    SvxCheckListBox* m_pOptionsListBox;
 
-    OKButton        maBtnOk;
-    CancelButton    maBtnCancel;
-    HelpButton      maBtnHelp;
+    OKButton*        m_pBtnOk;
 
-    String          maSelectLockedCells;
-    String          maSelectUnlockedCells;
+    OUString         m_aSelectLockedCells;
+    OUString         m_aSelectUnlockedCells;
 
     DECL_LINK( OKHdl, void* );
     DECL_LINK( CheckBoxHdl, CheckBox* );
diff --git a/sc/source/ui/miscdlgs/protectiondlg.cxx b/sc/source/ui/miscdlgs/protectiondlg.cxx
index a5d2c15..8e82455 100644
--- a/sc/source/ui/miscdlgs/protectiondlg.cxx
+++ b/sc/source/ui/miscdlgs/protectiondlg.cxx
@@ -19,7 +19,6 @@
 
 
 #include "protectiondlg.hxx"
-#include "protectiondlg.hrc"
 #include "scresid.hxx"
 #include "tabprotection.hxx"
 
@@ -35,27 +34,21 @@ static const ScTableProtection::Option aOptions[] = {
 static const sal_uInt16 nOptionCount = sizeof(aOptions) / sizeof (aOptions[0]);
 
 
-ScTableProtectionDlg::ScTableProtectionDlg(Window* pParent) :
-    ModalDialog(pParent, ScResId(RID_SCDLG_TABPROTECTION)),
-
-    maBtnProtect    (this, ScResId(BTN_PROTECT)),
-    maPassword1Text (this, ScResId(FT_PASSWORD1)),
-    maPassword1Edit (this, ScResId(ED_PASSWORD1)),
-    maPassword2Text (this, ScResId(FT_PASSWORD2)),
-    maPassword2Edit (this, ScResId(ED_PASSWORD2)),
-    maOptionsLine   (this, ScResId(FL_OPTIONS)),
-    maOptionsText   (this, ScResId(FT_OPTIONS)),
-    maOptionsListBox(this, ScResId(CLB_OPTIONS)),
+ScTableProtectionDlg::ScTableProtectionDlg(Window* pParent)
+    : ModalDialog( pParent, "ProtectSheetDialog", "modules/scalc/ui/protectsheetdlg.ui" )
+{
+    get(m_pPasswords, "passwords");
+    get(m_pOptions, "options");
+    get(m_pBtnProtect, "protect");
+    get(m_pOptionsListBox, "checklist");
+    get(m_pPassword1Edit, "password1");
+    get(m_pPassword2Edit, "password2");
+    get(m_pBtnOk, "ok");
 
-    maBtnOk     (this, ScResId(BTN_OK)),
-    maBtnCancel (this, ScResId(BTN_CANCEL)),
-    maBtnHelp   (this, ScResId(BTN_HELP)),
+    m_aSelectLockedCells = get<FixedText>("protected")->GetText();
+    m_aSelectUnlockedCells = get<FixedText>("unprotected")->GetText();
 
-    maSelectLockedCells(ScResId(ST_SELECT_PROTECTED_CELLS)),
-    maSelectUnlockedCells(ScResId(ST_SELECT_UNPROTECTED_CELLS))
-{
     Init();
-    FreeResource();
 }
 
 ScTableProtectionDlg::~ScTableProtectionDlg()
@@ -70,68 +63,62 @@ short ScTableProtectionDlg::Execute()
 void ScTableProtectionDlg::SetDialogData(const ScTableProtection& rData)
 {
     for (sal_uInt16 i = 0; i < nOptionCount; ++i)
-        maOptionsListBox.CheckEntryPos(i, rData.isOptionEnabled(aOptions[i]));
+        m_pOptionsListBox->CheckEntryPos(i, rData.isOptionEnabled(aOptions[i]));
 }
 
 void ScTableProtectionDlg::WriteData(ScTableProtection& rData) const
 {
-    rData.setProtected(maBtnProtect.IsChecked());
+    rData.setProtected(m_pBtnProtect->IsChecked());
 
     // We assume that the two password texts match.
-    rData.setPassword(maPassword1Edit.GetText());
+    rData.setPassword(m_pPassword1Edit->GetText());
 
     for (sal_uInt16 i = 0; i < nOptionCount; ++i)
-        rData.setOption(aOptions[i], maOptionsListBox.IsChecked(i));
+        rData.setOption(aOptions[i], m_pOptionsListBox->IsChecked(i));
 }
 
 void ScTableProtectionDlg::Init()
 {
     Link aLink = LINK( this, ScTableProtectionDlg, CheckBoxHdl );
-    maBtnProtect.SetClickHdl(aLink);
+    m_pBtnProtect->SetClickHdl(aLink);
 
     aLink = LINK( this, ScTableProtectionDlg, OKHdl );
-    maBtnOk.SetClickHdl(aLink);
+    m_pBtnOk->SetClickHdl(aLink);
 
     aLink = LINK( this, ScTableProtectionDlg, PasswordModifyHdl );
-    maPassword1Edit.SetModifyHdl(aLink);
-    maPassword2Edit.SetModifyHdl(aLink);
+    m_pPassword1Edit->SetModifyHdl(aLink);
+    m_pPassword2Edit->SetModifyHdl(aLink);
 
-    maOptionsListBox.SetUpdateMode(false);
-    maOptionsListBox.Clear();
+    m_pOptionsListBox->SetUpdateMode(false);
+    m_pOptionsListBox->Clear();
 
-    maOptionsListBox.InsertEntry(maSelectLockedCells);
-    maOptionsListBox.InsertEntry(maSelectUnlockedCells);
+    m_pOptionsListBox->InsertEntry(m_aSelectLockedCells);
+    m_pOptionsListBox->InsertEntry(m_aSelectUnlockedCells);
 
-    maOptionsListBox.CheckEntryPos(0, true);
-    maOptionsListBox.CheckEntryPos(1, true);
+    m_pOptionsListBox->CheckEntryPos(0, true);
+    m_pOptionsListBox->CheckEntryPos(1, true);
 
-    maOptionsListBox.SetUpdateMode(true);
+    m_pOptionsListBox->SetUpdateMode(true);
 
     // Set the default state of the dialog.
-    maBtnProtect.Check(true);
-    maPassword1Edit.GrabFocus();
+    m_pBtnProtect->Check(true);
+    m_pPassword1Edit->GrabFocus();
 }
 
 void ScTableProtectionDlg::EnableOptionalWidgets(bool bEnable)
 {
-    maPassword1Text.Enable(bEnable);
-    maPassword1Edit.Enable(bEnable);
-    maPassword2Text.Enable(bEnable);
-    maPassword2Edit.Enable(bEnable);
-    maOptionsLine.Enable(bEnable);
-    maOptionsText.Enable(bEnable);
-
-    maOptionsListBox.Enable(bEnable);
-    maOptionsListBox.Invalidate();
+    m_pPasswords->Enable(bEnable);
+    m_pOptions->Enable(bEnable);
+    m_pOptionsListBox->Invalidate();
 }
 
 IMPL_LINK( ScTableProtectionDlg, CheckBoxHdl, CheckBox*, pBtn )
 {
-    if (pBtn == &maBtnProtect)
+    if (pBtn == m_pBtnProtect)
     {
-        bool bChecked = maBtnProtect.IsChecked();
+        bool bChecked = m_pBtnProtect->IsChecked();
         EnableOptionalWidgets(bChecked);
-        maBtnOk.Enable(bChecked);
+        m_pBtnOk->Enable(bChecked);
     }
 
     return 0;
@@ -145,9 +132,9 @@ IMPL_LINK_NOARG(ScTableProtectionDlg, OKHdl)
 
 IMPL_LINK_NOARG(ScTableProtectionDlg, PasswordModifyHdl)
 {
-    String aPass1 = maPassword1Edit.GetText();
-    String aPass2 = maPassword2Edit.GetText();
-    maBtnOk.Enable(aPass1.Equals(aPass2));
+    OUString aPass1 = m_pPassword1Edit->GetText();
+    OUString aPass2 = m_pPassword2Edit->GetText();
+    m_pBtnOk->Enable(aPass1 == aPass2);
     return 0;
 }
 
diff --git a/sc/source/ui/miscdlgs/protectiondlg.src b/sc/source/ui/miscdlgs/protectiondlg.src
deleted file mode 100644
index 29662ef..0000000
--- a/sc/source/ui/miscdlgs/protectiondlg.src
+++ /dev/null
@@ -1,125 +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 "protectiondlg.hrc"
-
-ModalDialog RID_SCDLG_TABPROTECTION
-{
-    HelpID = "sc:ModalDialog:RID_SCDLG_TABPROTECTION";
-    Text [ en-US ] = "Protect Sheet" ;
-    Size = MAP_APPFONT ( 250 , 135 ) ;
-    Moveable = TRUE ;
-    Closeable = TRUE ;
-
-    OKButton BTN_OK
-    {
-        Pos = MAP_APPFONT ( 194 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        DefButton = TRUE ;
-    };
-    CancelButton BTN_CANCEL
-    {
-        Pos = MAP_APPFONT ( 194 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-    };
-    HelpButton BTN_HELP
-    {
-        Pos = MAP_APPFONT ( 194 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-    };
-
-    CheckBox BTN_PROTECT
-    {
-        HelpID = "sc:CheckBox:RID_SCDLG_TABPROTECTION:BTN_PROTECT";
-        Pos = MAP_APPFONT ( 6 , 6 ) ;
-        Size = MAP_APPFONT ( 180 , 10 );
-
-        Text [ en-US ] = "P~rotect this sheet and the contents of protected cells" ;
-    };
-
-    FixedText FT_PASSWORD1
-    {
-        Pos = MAP_APPFONT ( 11, 23 );
-        Size = MAP_APPFONT ( 42, 10 );
-
-        Text [ en-US ] = "~Password" ;
-    };
-
-    Edit ED_PASSWORD1
-    {
-        HelpID = "sc:Edit:RID_SCDLG_TABPROTECTION:ED_PASSWORD1";
-        Border = TRUE;
-        PassWord = TRUE;
-        Pos = MAP_APPFONT ( 56, 22 );
-        Size = MAP_APPFONT ( 75, 12 );
-    };
-
-    FixedText FT_PASSWORD2
-    {
-        Pos = MAP_APPFONT ( 11, 40 );
-        Size = MAP_APPFONT ( 42, 10 );
-
-        Text [ en-US ] = "~Confirm" ;
-    };
-
-    Edit ED_PASSWORD2
-    {
-        HelpID = "sc:Edit:RID_SCDLG_TABPROTECTION:ED_PASSWORD2";
-        Border = TRUE;
-        PassWord = TRUE;
-        Pos = MAP_APPFONT ( 56, 39 );
-        Size = MAP_APPFONT ( 75, 12 );
-    };
-
-    FixedLine FL_OPTIONS
-    {
-        Pos = MAP_APPFONT ( 6, 60 );
-        Size = MAP_APPFONT ( 180, 8 );
-
-        Text [ en-US ] = "Options";
-    };
-
-    FixedText FT_OPTIONS
-    {
-        Pos = MAP_APPFONT ( 11, 74 );
-        Size = MAP_APPFONT ( 140, 8 );
-
-        Text [ en-US ] = "Allow all users of this sheet to:";
-    };
-
-    Control CLB_OPTIONS
-    {
-        Pos = MAP_APPFONT ( 11, 85 );
-        Size = MAP_APPFONT ( 140, 40 );
-        Border = TRUE ;
-        TabStop = TRUE ;
-    };
-
-    String ST_SELECT_PROTECTED_CELLS
-    {
-        Text [ en-US ] = "Select protected cells";
-    };
-
-    String ST_SELECT_UNPROTECTED_CELLS
-    {
-        Text [ en-US ] = "Select unprotected cells";
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/uiconfig/scalc/ui/protectsheetdlg.ui b/sc/uiconfig/scalc/ui/protectsheetdlg.ui
index be6f5f9..dc1b443 100644
--- a/sc/uiconfig/scalc/ui/protectsheetdlg.ui
+++ b/sc/uiconfig/scalc/ui/protectsheetdlg.ui
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkDialog" id="protectsheet">
+  <!-- interface-requires LibreOffice 1.0 -->
+  <object class="GtkDialog" id="ProtectSheetDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes">Protect Sheet</property>
@@ -20,6 +21,8 @@
                 <property name="label">gtk-ok</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
                 <property name="receives_default">True</property>
                 <property name="use_stock">True</property>
               </object>
@@ -69,16 +72,19 @@
           <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>
-            <property name="spacing">10</property>
+            <property name="spacing">12</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="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="GtkCheckButton" id="checkbutton1">
+                  <object class="GtkCheckButton" id="protect">
                     <property name="label" translatable="yes">P_rotect this sheet and the contents of protected cells</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
@@ -94,11 +100,12 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkGrid" id="grid1">
+                  <object class="GtkGrid" id="passwords">
                     <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">20</property>
+                    <property name="column_spacing">12</property>
                     <child>
                       <object class="GtkLabel" id="label1">
                         <property name="visible">True</property>
@@ -106,6 +113,7 @@
                         <property name="xalign">0</property>
                         <property name="label" translatable="yes">_Password</property>
                         <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">password1</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -121,6 +129,7 @@
                         <property name="xalign">0</property>
                         <property name="label" translatable="yes">_Confirm</property>
                         <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">password2</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -130,10 +139,13 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkEntry" id="entry1">
+                      <object class="GtkEntry" id="password1">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="visibility">False</property>
                         <property name="invisible_char">•</property>
+                        <property name="width_chars">24</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -143,10 +155,13 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkEntry" id="entry2">
+                      <object class="GtkEntry" id="password2">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="visibility">False</property>
                         <property name="invisible_char">•</property>
+                        <property name="width_chars">24</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -170,21 +185,27 @@
               </packing>
             </child>
             <child>
-              <object class="GtkFrame" id="frame1">
+              <object class="GtkFrame" id="options">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
                 <property name="label_xalign">0</property>
                 <property name="shadow_type">none</property>
                 <child>
                   <object class="GtkAlignment" id="alignment1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
                     <property name="top_padding">6</property>
                     <property name="left_padding">12</property>
                     <child>
                       <object class="GtkBox" id="box3">
                         <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>
@@ -193,6 +214,7 @@
                             <property name="can_focus">False</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Allow all users of this sheet to:</property>
+                            <property name="use_underline">True</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -201,52 +223,52 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkViewport" id="viewport1">
+                          <object class="svxlo-SvxCheckListBox" id="checklist:border">
                             <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="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="padding">4</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="box4">
+                            <property name="can_focus">False</property>
+                            <property name="homogeneous">True</property>
+                            <child>
+                              <object class="GtkLabel" id="protected">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Select protected cells</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
                             <child>
-                              <object class="GtkBox" id="box4">
+                              <object class="GtkLabel" id="unprotected">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="orientation">vertical</property>
-                                <child>
-                                  <object class="GtkCheckButton" id="checkbutton2">
-                                    <property name="label" translatable="yes">Select protected cells</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="xalign">0</property>
-                                    <property name="draw_indicator">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkCheckButton" id="checkbutton3">
-                                    <property name="label" translatable="yes">Select unprotected cells</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="xalign">0</property>
-                                    <property name="draw_indicator">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
+                                <property name="label" translatable="yes">Select unprotected cells</property>
                               </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
                             </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="padding">4</property>
-                            <property name="position">1</property>
+                            <property name="position">2</property>
                           </packing>
                         </child>
                       </object>
diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx
index 1a9e019..266eac6 100644
--- a/svx/source/dialog/checklbx.cxx
+++ b/svx/source/dialog/checklbx.cxx
@@ -19,6 +19,8 @@
 
 #include <tools/shl.hxx>
 
+#include <svtools/treelistentry.hxx>
+
 #define _SVX_CHECKLBX_CXX
 
 #include <svx/checklbx.hxx>
@@ -26,7 +28,7 @@
 
 #include <svx/dialogs.hrc>
 
-#include "svtools/treelistentry.hxx"
+#include <vcl/builder.hxx>
 
 // class SvxCheckListBox -------------------------------------------------
 
@@ -38,6 +40,15 @@ SvxCheckListBox::SvxCheckListBox( Window* pParent, WinBits nWinStyle ) :
     Init_Impl();
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxCheckListBox(Window *pParent, VclBuilder::stringmap &rMap)
+{
+    WinBits nWinStyle = WB_TABSTOP;
+    OString sBorder = VclBuilder::extractCustomProperty(rMap);
+    if (!sBorder.isEmpty())
+        nWinStyle |= WB_BORDER;
+    return new SvxCheckListBox(pParent, nWinStyle);
+}
+
 // -----------------------------------------------------------------------
 
 SvxCheckListBox::SvxCheckListBox( Window* pParent, const ResId& rResId ) :
commit f6b05adfb00e2b75c5c8582593c4acff3bd25724
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 24 16:10:43 2013 +0100

    turns out insert layer dialog is reused for modify layer
    
    Change-Id: If6559e7f0e66f3f8b87c8ba4b3b4794317f5d55b

diff --git a/sd/uiconfig/sdraw/ui/modifylayer.ui b/sd/uiconfig/sdraw/ui/modifylayer.ui
deleted file mode 100644
index 5c33d7b..0000000
--- a/sd/uiconfig/sdraw/ui/modifylayer.ui
+++ /dev/null
@@ -1,270 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-  <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkDialog" id="modifylayer">
-    <property name="can_focus">False</property>
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes">Modify Layer</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkBox" id="dialog-vbox2">
-        <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area2">
-            <property name="can_focus">False</property>
-            <property name="layout_style">start</property>
-            <child>
-              <object class="GtkButton" id="help1">
-                <property name="label">gtk-help</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-                <property name="image_position">top</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="ok1">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel1">
-                <property name="label">gtk-cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</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>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkFrame" id="Name">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label_xalign">0</property>
-            <property name="shadow_type">none</property>
-            <child>
-              <object class="GtkAlignment" id="alignment1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="top_padding">6</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkEntry" id="entry2">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="invisible_char">●</property>
-                    <property name="invisible_char_set">True</property>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child type="label">
-              <object class="GtkLabel" id="Name1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes"><b>_Name</b></property>
-                <property name="use_markup">True</property>
-                <property name="use_underline">True</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkFrame" id="title">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label_xalign">0</property>
-            <property name="shadow_type">none</property>
-            <child>
-              <object class="GtkAlignment" id="alignment3">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="top_padding">6</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkEntry" id="entry1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="invisible_char">●</property>
-                    <property name="invisible_char_set">True</property>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child type="label">
-              <object class="GtkLabel" id="titl">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes"><b>_Title</b></property>
-                <property name="use_markup">True</property>
-                <property name="use_underline">True</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkFrame" id="description">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label_xalign">0</property>
-            <property name="shadow_type">none</property>
-            <child>
-              <object class="GtkAlignment" id="alignment2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="top_padding">6</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkBox" id="box1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <child>
-                      <object class="GtkEntry" id="entry3">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="invisible_char">●</property>
-                        <property name="truncate_multiline">True</property>
-                        <property name="invisible_char_set">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkScrollbar" id="scrollbar1">
-                        <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>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child type="label">
-              <object class="GtkLabel" id="descriptio">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes"><b>_Description</b></property>
-                <property name="use_markup">True</property>
-                <property name="use_underline">True</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">3</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton1">
-            <property name="label" translatable="yes">_Visible</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="use_action_appearance">False</property>
-            <property name="use_underline">True</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">4</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton2">
-            <property name="label" translatable="yes">_Printable</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="use_action_appearance">False</property>
-            <property name="use_underline">True</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">5</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton3">
-            <property name="label" translatable="yes">_Locked</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="use_action_appearance">False</property>
-            <property name="use_underline">True</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">6</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="0">help1</action-widget>
-      <action-widget response="0">ok1</action-widget>
-      <action-widget response="0">cancel1</action-widget>
-    </action-widgets>
-  </object>
-</interface>
commit 0d501c40af07fe33e16d16b8acdd3c7a93afa95e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 24 19:28:38 2013 +0100

    add border width to optimal size when present
    
    Change-Id: I37c396c3c61521e140d290fd8f17220f60c43284

diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index a418330..ba81f9e 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3418,6 +3418,12 @@ Size SvTreeListBox::GetOptimalSize() const
     Size aRet(0, getPreferredDimensions(aWidths));
     for (size_t i = 0; i < aWidths.size(); ++i)
         aRet.Width() += aWidths[i];
+    if (GetStyle() & WB_BORDER)
+    {
+        const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+        aRet.Width() += rStyleSettings.GetBorderSize() * 2;
+        aRet.Height() += rStyleSettings.GetBorderSize() * 2;
+    }
     return aRet;
 }
 


More information about the Libreoffice-commits mailing list