[Libreoffice-commits] core.git: 2 commits - cui/AllLangResTarget_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk helpcontent2

Caolán McNamara caolanm at redhat.com
Thu Dec 26 15:28:23 PST 2013


 cui/AllLangResTarget_cui.mk         |    1 
 cui/UIConfig_cui.mk                 |    1 
 cui/source/dialogs/srchxtra.cxx     |   46 +++++--------
 cui/source/dialogs/srchxtra.hrc     |   32 ---------
 cui/source/dialogs/srchxtra.src     |   68 -------------------
 cui/source/inc/cuires.hrc           |    1 
 cui/source/inc/helpid.hrc           |    2 
 cui/source/inc/srchxtra.hxx         |    8 --
 cui/uiconfig/ui/searchattrdialog.ui |  126 ++++++++++++++++++++++++++++++++++++
 helpcontent2                        |    2 
 10 files changed, 148 insertions(+), 139 deletions(-)

New commits:
commit 5b254427b2e884c00c6a7d6d706962c259190622
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 26 10:09:10 2013 +0000

    convert search attribute dialog to .ui
    
    Change-Id: Id1d8ac652af38b80d0126bb80f91120d3e12e993

diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk
index 16a1feb..4819ae8 100644
--- a/cui/AllLangResTarget_cui.mk
+++ b/cui/AllLangResTarget_cui.mk
@@ -40,7 +40,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\
     cui/source/dialogs/multipat.src \
     cui/source/dialogs/passwdomdlg.src \
     cui/source/dialogs/scriptdlg.src \
-    cui/source/dialogs/srchxtra.src \
     cui/source/dialogs/svuidlg.src \
     cui/source/options/certpath.src \
     cui/source/options/connpooloptions.src \
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index 95fdba3..cde65d0 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -128,6 +128,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/recordnumberdialog \
 	cui/uiconfig/ui/rotationtabpage \
 	cui/uiconfig/ui/scriptorganizer \
+	cui/uiconfig/ui/searchattrdialog \
 	cui/uiconfig/ui/searchformatdialog \
 	cui/uiconfig/ui/securityoptionsdialog \
 	cui/uiconfig/ui/select_persona_dialog \
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index 7000d95..16a0434 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -24,7 +24,6 @@
 #include <svl/whiter.hxx>
 #include <sfx2/objsh.hxx>
 #include <cuires.hrc>
-#include "srchxtra.hrc"
 #include <svx/svxitems.hrc>
 #include <svx/dialmgr.hxx>
 #include <editeng/flstitem.hxx>
@@ -111,29 +110,20 @@ void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
     }
 }
 
-// class SvxSearchFormatDialog -------------------------------------------
-
-SvxSearchAttributeDialog::SvxSearchAttributeDialog( Window* pParent,
-                                                    SearchAttrItemList& rLst,
-                                                    const sal_uInt16* pWhRanges ) :
-
-    ModalDialog( pParent, CUI_RES( RID_SVXDLG_SEARCHATTR )  ),
-
-    aAttrFL ( this, CUI_RES( FL_ATTR ) ),
-    aAttrLB ( this, CUI_RES( LB_ATTR ) ),
-    aOKBtn  ( this, CUI_RES( BTN_ATTR_OK ) ),
-    aEscBtn ( this, CUI_RES( BTN_ATTR_CANCEL ) ),
-    aHelpBtn( this, CUI_RES( BTN_ATTR_HELP ) ),
-
-    rList( rLst )
-
+SvxSearchAttributeDialog::SvxSearchAttributeDialog(Window* pParent,
+    SearchAttrItemList& rLst, const sal_uInt16* pWhRanges)
+    : ModalDialog(pParent, "SearchAttrDialog", "cui/ui/searchattrdialog.ui")
+    , rList(rLst)
 {
-    FreeResource();
+    get(m_pOKBtn, "ok");
+    get(m_pAttrLB, "treeview");
+    m_pAttrLB->set_height_request(m_pAttrLB->GetTextHeight() * 12);
+    m_pAttrLB->set_width_request(m_pAttrLB->approximate_char_width() * 56);
 
-    aAttrLB.SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
-    aAttrLB.GetModel()->SetSortMode( SortAscending );
+    m_pAttrLB->SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
+    m_pAttrLB->GetModel()->SetSortMode( SortAscending );
 
-    aOKBtn.SetClickHdl( LINK( this, SvxSearchAttributeDialog, OKHdl ) );
+    m_pOKBtn->SetClickHdl( LINK( this, SvxSearchAttributeDialog, OKHdl ) );
 
     SfxObjectShell* pSh = SfxObjectShell::Current();
     DBG_ASSERT( pSh, "No DocShell" );
@@ -164,21 +154,21 @@ SvxSearchAttributeDialog::SvxSearchAttributeDialog( Window* pParent,
             sal_uInt32 nId  = aAttrNames.FindIndex( nSlot );
             SvTreeListEntry* pEntry = NULL;
             if ( RESARRAY_INDEX_NOTFOUND != nId )
-                pEntry = aAttrLB.SvTreeListBox::InsertEntry( aAttrNames.GetString(nId) );
+                pEntry = m_pAttrLB->SvTreeListBox::InsertEntry( aAttrNames.GetString(nId) );
             else
                 SAL_WARN( "cui.dialogs", "no resource for slot id " << static_cast<sal_Int32>(nSlot) );
 
             if ( pEntry )
             {
-                aAttrLB.SetCheckButtonState( pEntry, bChecked ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
+                m_pAttrLB->SetCheckButtonState( pEntry, bChecked ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
                 pEntry->SetUserData( (void*)(sal_uLong)nSlot );
             }
         }
         nWhich = aIter.NextWhich();
     }
 
-    aAttrLB.SetHighlightRange();
-    aAttrLB.SelectEntryPos( 0 );
+    m_pAttrLB->SetHighlightRange();
+    m_pAttrLB->SelectEntryPos( 0 );
 }
 
 // -----------------------------------------------------------------------
@@ -188,10 +178,10 @@ IMPL_LINK_NOARG(SvxSearchAttributeDialog, OKHdl)
     SearchAttrItem aInvalidItem;
     aInvalidItem.pItem = (SfxPoolItem*)-1;
 
-    for ( sal_uInt16 i = 0; i < aAttrLB.GetEntryCount(); ++i )
+    for ( sal_uInt16 i = 0; i < m_pAttrLB->GetEntryCount(); ++i )
     {
-        sal_uInt16 nSlot = (sal_uInt16)(sal_uLong)aAttrLB.GetEntryData(i);
-        sal_Bool bChecked = aAttrLB.IsChecked(i);
+        sal_uInt16 nSlot = (sal_uInt16)(sal_uLong)m_pAttrLB->GetEntryData(i);
+        sal_Bool bChecked = m_pAttrLB->IsChecked(i);
 
         sal_uInt16 j;
         for ( j = rList.Count(); j; )
diff --git a/cui/source/dialogs/srchxtra.hrc b/cui/source/dialogs/srchxtra.hrc
deleted file mode 100644
index 6bfe114..0000000
--- a/cui/source/dialogs/srchxtra.hrc
+++ /dev/null
@@ -1,32 +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 .
- */
-#ifndef _SVX_SRCHXTRA_HRC
-#define _SVX_SRCHXTRA_HRC
-
-// defines ------------------------------------------------------------------
-
-#define BTN_ATTR_OK         10
-#define BTN_ATTR_CANCEL     11
-#define BTN_ATTR_HELP       12
-#define LB_ATTR             13
-#define FL_ATTR             14
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/srchxtra.src b/cui/source/dialogs/srchxtra.src
deleted file mode 100644
index d8b2b5a..0000000
--- a/cui/source/dialogs/srchxtra.src
+++ /dev/null
@@ -1,68 +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 "helpid.hrc"
-#include <cuires.hrc>
-#include "srchxtra.hrc"
-#include <svx/dialogs.hrc>
-
-// RID_SVXDLG_SEARCHATTRIBUTE --------------------------------------------
-ModalDialog RID_SVXDLG_SEARCHATTR
-{
-    HelpId = HID_SEARCHATTR ;
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 194 , 128 ) ;
-    Text [ en-US ] = "Attributes" ;
-    Moveable = TRUE ;
-    Control LB_ATTR
-    {
-        HelpId = HID_SEARCHATTR_CTL_ATTR ;
-        ClipChildren = TRUE ;
-        Border = TRUE ;
-        TabStop = TRUE ;
-        Pos = MAP_APPFONT ( 6 , 14 ) ;
-        Size = MAP_APPFONT ( 120 , 108 ) ;
-    };
-    FixedText FL_ATTR
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 124 , 8 ) ;
-        Text [ en-US ] = "~Options" ;
-    };
-    OKButton BTN_ATTR_OK
-    {
-        Pos = MAP_APPFONT ( 136 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        DefButton = TRUE ;
-    };
-    CancelButton BTN_ATTR_CANCEL
-    {
-        Pos = MAP_APPFONT ( 136 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-    };
-    HelpButton BTN_ATTR_HELP
-    {
-        Pos = MAP_APPFONT ( 136 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-    };
-};
- // ********************************************************************** EOF
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index b2801ce..e774f80 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -186,7 +186,6 @@
 // dialogs
 #define RID_SVX_WND_COMMON_LINGU            ( RID_SVX_START +  0 )
 #define STR_MODIFY                          (RID_SVX_START + 336)//from optdict.src
-#define RID_SVXDLG_SEARCHATTR               (RID_SVX_START +  22)
 
 // hyperlink dialog
 #define RID_SVXDLG_NEWHYPERLINK             (RID_SVX_START + 227)
diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc
index 858c572..7fdbb6c 100644
--- a/cui/source/inc/helpid.hrc
+++ b/cui/source/inc/helpid.hrc
@@ -195,8 +195,6 @@
 #define HID_HANGULHANJA_EDIT_DLG "CUI_HID_HANGULHANJA_EDIT_DLG"
 #define HID_MULTIPATH "CUI_HID_MULTIPATH"
 #define HID_TPHATCH_CTRL "CUI_HID_TPHATCH_CTRL"
-#define HID_SEARCHATTR_CTL_ATTR "CUI_HID_SEARCHATTR_CTL_ATTR"
-#define HID_SEARCHATTR "CUI_HID_SEARCHATTR"
 #define UID_SEARCH_RECORDSTATUS "CUI_UID_SEARCH_RECORDSTATUS"
 #define HID_TPCOLOR_RGB_1 "CUI_HID_TPCOLOR_RGB_1"
 #define HID_TPCOLOR_RGB_2 "CUI_HID_TPCOLOR_RGB_2"
diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx
index d505204..a3c26e2 100644
--- a/cui/source/inc/srchxtra.hxx
+++ b/cui/source/inc/srchxtra.hxx
@@ -52,12 +52,8 @@ public:
                               const sal_uInt16* pWhRanges );
 
 private:
-    FixedText           aAttrFL;
-    SvxCheckListBox     aAttrLB;
-
-    OKButton            aOKBtn;
-    CancelButton        aEscBtn;
-    HelpButton          aHelpBtn;
+    SvxCheckListBox*    m_pAttrLB;
+    OKButton*           m_pOKBtn;
 
     SearchAttrItemList& rList;
 
diff --git a/cui/uiconfig/ui/searchattrdialog.ui b/cui/uiconfig/ui/searchattrdialog.ui
new file mode 100644
index 0000000..3ba4588
--- /dev/null
+++ b/cui/uiconfig/ui/searchattrdialog.ui
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="SearchAttrDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Attributes</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <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>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <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_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="help">
+                <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_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="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>
+            <child>
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">_Options</property>
+                <property name="use_underline">True</property>
+                <property name="wrap">True</property>
+                <property name="mnemonic_widget">treeview:border</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="svxcorelo-SvxCheckListBox" id="treeview:border">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <child internal-child="selection">
+                  <object class="GtkTreeSelection" id="treeview-selection1"/>
+                </child>
+              </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>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>
commit dbdd937d1c6cce0219851255d962808e1af14127
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 26 23:23:27 2013 +0000

    Updated core
    Project: help  da8a978cf3603ebcfcd61c0bd652836c09d71ded

diff --git a/helpcontent2 b/helpcontent2
index 07e930a..da8a978 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 07e930aa8406a8a85ffe7b3cb08b97f9d7747687
+Subproject commit da8a978cf3603ebcfcd61c0bd652836c09d71ded


More information about the Libreoffice-commits mailing list