[Libreoffice-commits] core.git: starmath/inc starmath/source starmath/uiconfig svx/source

Caolán McNamara caolanm at redhat.com
Tue Apr 1 08:23:39 PDT 2014


 starmath/inc/dialog.hxx                       |    2 
 starmath/inc/helpids.h                        |    1 
 starmath/source/dialog.cxx                    |   27 +---
 starmath/source/dialog.hrc                    |   29 ----
 starmath/uiconfig/smath/ui/symdefinedialog.ui |  168 +++++++++++++++-----------
 svx/source/dialog/charmap.cxx                 |    2 
 6 files changed, 115 insertions(+), 114 deletions(-)

New commits:
commit 519f4b75a5f089b6ef98260ff6265f5000fe4659
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 1 16:19:26 2014 +0100

    teach SmShowChar how to resize
    
    and other cleanups
    
    Change-Id: I1f6a57a6cb7c06a37e9c845fa93815d31008e6e1

diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index 4df16cd..ae3d214 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -373,6 +373,7 @@ public:
 class SmShowChar : public Control
 {
     virtual void    Paint(const Rectangle&) SAL_OVERRIDE;
+    virtual void    Resize() SAL_OVERRIDE;
 
 public:
     SmShowChar(Window *pParent, WinBits nStyle)
@@ -424,7 +425,6 @@ class SmSymDefineDialog : public ModalDialog
     DECL_LINK(AddClickHdl, Button *);
     DECL_LINK(ChangeClickHdl, Button *);
     DECL_LINK(DeleteClickHdl, Button *);
-    DECL_LINK(HelpButtonClickHdl, Button *);
 
     void    FillSymbols(ComboBox &rComboBox, bool bDeleteText = true);
     void    FillSymbolSets(ComboBox &rComboBox, bool bDeleteText = true);
diff --git a/starmath/inc/helpids.h b/starmath/inc/helpids.h
index b6d554f..66d8189 100644
--- a/starmath/inc/helpids.h
+++ b/starmath/inc/helpids.h
@@ -21,7 +21,6 @@
 
 #define HID_SMA_FONTDIALOG                                "STARMATH_HID_SMA_FONTDIALOG"
 #define HID_SMA_DISTANCEDIALOG                            "STARMATH_HID_SMA_DISTANCEDIALOG"
-#define HID_SMA_SYMDEFINEDIALOG                           "STARMATH_HID_SMA_SYMDEFINEDIALOG"
 #define HID_SMA_WIN_DOCUMENT                              "STARMATH_HID_SMA_WIN_DOCUMENT"
 #define HID_SMA_COMMAND_WIN_EDIT                          "STARMATH_HID_SMA_COMMAND_WIN_EDIT"
 
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 4c87f59..cc22063 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -269,7 +269,6 @@ void SmShowFont::SetFont(const Font& rFont)
     SetTextColor( aTxtColor );
 }
 
-
 IMPL_LINK_INLINE_START( SmFontDialog, FontSelectHdl, ComboBox *, pComboBox )
 {
     Face.SetName(pComboBox->GetText());
@@ -1615,8 +1614,16 @@ void SmShowChar::SetSymbol( sal_UCS4 cChar, const Font &rFont )
     Invalidate();
 }
 
-
-
+void SmShowChar::Resize()
+{
+    Control::Resize();
+    const OUString &rText = GetText();
+    if (rText.isEmpty())
+        return;
+    sal_Int32 nStrIndex = 0;
+    sal_UCS4 cChar = rText.iterateCodePoints(&nStrIndex);
+    SetSymbol(cChar, GetFont()); //force recalculation of size
+}
 
 void SmSymDefineDialog::FillSymbols(ComboBox &rComboBox, bool bDeleteText)
 {
@@ -1963,17 +1970,6 @@ void SmSymDefineDialog::UpdateButtons()
     pDeleteBtn->Enable(bDelete);
 }
 
-IMPL_LINK( SmSymDefineDialog, HelpButtonClickHdl, Button *, EMPTYARG /*pButton*/ )
-{
-    // start help system
-    Help* pHelp = Application::GetHelp();
-    if( pHelp )
-    {
-        pHelp->Start( OUString( "HID_SMA_SYMDEFINEDIALOG" ), pHelpBtn );
-    }
-    return 0;
-}
-
 SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
         OutputDevice *pFntListDevice, SmSymbolManager &rMgr) :
     ModalDialog         (pParent, "EditSymbols", "modules/smath/ui/symdefinedialog.ui"),
@@ -1995,13 +1991,10 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
     get(pSymbolName, "symbolName");
     get(pSymbolDisplay, "symbolDisplay");
     get(pSymbolSetName, "symbolSetName");
-    get(pHelpBtn, "help");
     get(pAddBtn, "add");
     get(pChangeBtn, "modify");
     get(pDeleteBtn, "delete");
 
-    pHelpBtn->SetClickHdl(LINK(this, SmSymDefineDialog, HelpButtonClickHdl));
-
     pFontList = new FontList( pFntListDevice );
 
     pOrigSymbol = 0;
diff --git a/starmath/source/dialog.hrc b/starmath/source/dialog.hrc
deleted file mode 100644
index a726226..0000000
--- a/starmath/source/dialog.hrc
+++ /dev/null
@@ -1,29 +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 _DIALOG_HRC_
-#define _DIALOG_HRC_
-
-#define FT_FONTS_SUBSET         110
-#define LB_FONTS_SUBSET         111
-
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/uiconfig/smath/ui/symdefinedialog.ui b/starmath/uiconfig/smath/ui/symdefinedialog.ui
index 768b8cd..b21a65d 100644
--- a/starmath/uiconfig/smath/ui/symdefinedialog.ui
+++ b/starmath/uiconfig/smath/ui/symdefinedialog.ui
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
 <interface>
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.0"/>
   <!-- interface-requires LibreOffice 1.0 -->
   <object class="GtkDialog" id="EditSymbols">
     <property name="can_focus">False</property>
@@ -15,57 +16,57 @@
           <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">12</property>
             <child>
               <object class="GtkGrid" id="grid1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="orientation">vertical</property>
-                <property name="column_spacing">6</property>
-                <child>
-                  <object class="GtkLabel" id="oldSymbolText">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="margin_top">6</property>
-                    <property name="yalign">0.49000000953674316</property>
-                    <property name="label" translatable="yes">_Old symbol</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">oldSymbols</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="GtkLabel" id="oldSymbolSetText">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">0.56000000238418579</property>
-                    <property name="label" translatable="yes">O_ld symbol set</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">oldSymbolSets</property>
-                    <property name="ellipsize">start</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">2</property>
-                    <property name="top_attach">0</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
+                <property name="hexpand">True</property>
+                <property name="column_spacing">24</property>
                 <child>
-                  <object class="GtkComboBox" id="oldSymbols">
+                  <object class="GtkGrid" id="grid4">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="has_entry">True</property>
-                    <child internal-child="entry">
-                      <object class="GtkEntry" id="combobox-entry">
+                    <property name="hexpand">True</property>
+                    <property name="orientation">vertical</property>
+                    <property name="column_spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="oldSymbolSetText">
+                        <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">O_ld symbol set</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">oldSymbolSets</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="GtkComboBox" id="oldSymbolSets">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
+                        <property name="has_entry">True</property>
+                        <child internal-child="entry">
+                          <object class="GtkEntry" id="combobox-entry1">
+                            <property name="can_focus">True</property>
+                          </object>
+                        </child>
                       </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
                     </child>
                   </object>
                   <packing>
@@ -76,18 +77,51 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkComboBox" id="oldSymbolSets">
+                  <object class="GtkGrid" id="grid5">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="has_entry">True</property>
-                    <child internal-child="entry">
-                      <object class="GtkEntry" id="combobox-entry1">
+                    <property name="hexpand">True</property>
+                    <property name="orientation">vertical</property>
+                    <property name="column_spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="oldSymbolText">
+                        <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="margin_top">6</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">_Old symbol</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">oldSymbols</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="GtkComboBox" id="oldSymbols">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
+                        <property name="has_entry">True</property>
+                        <child internal-child="entry">
+                          <object class="GtkEntry" id="combobox-entry5">
+                            <property name="can_focus">True</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">3</property>
+                    <property name="left_attach">0</property>
                     <property name="top_attach">0</property>
                     <property name="width">1</property>
                     <property name="height">1</property>
@@ -106,7 +140,6 @@
                 <property name="height_request">250</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="valign">end</property>
                 <property name="hexpand">True</property>
                 <property name="vexpand">True</property>
               </object>
@@ -120,17 +153,21 @@
               <object class="GtkGrid" id="grid2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
                 <property name="column_spacing">24</property>
                 <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">2</property>
                     <property name="column_spacing">6</property>
+                    <property name="row_homogeneous">True</property>
                     <child>
                       <object class="GtkLabel" id="symbolText">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">_Symbol</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">symbols</property>
@@ -146,8 +183,7 @@
                       <object class="GtkLabel" id="symbolSetText">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="margin_top">6</property>
-                        <property name="yalign">0.51999998092651367</property>
+                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">Symbol s_et</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">symbolSets</property>
@@ -163,6 +199,7 @@
                       <object class="GtkLabel" id="fontText">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">_Font</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">fonts</property>
@@ -178,6 +215,7 @@
                       <object class="GtkLabel" id="styleText">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">_Typeface</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">styles</property>
@@ -193,6 +231,7 @@
                       <object class="GtkLabel" id="fontsSubsetFT">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">_Subset</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">fontsSubsetLB</property>
@@ -208,6 +247,8 @@
                       <object class="GtkComboBox" id="fonts">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="valign">center</property>
+                        <property name="hexpand">True</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -220,6 +261,8 @@
                       <object class="GtkComboBox" id="fontsSubsetLB">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="valign">center</property>
+                        <property name="hexpand">True</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -232,8 +275,8 @@
                       <object class="svtlo-FontStyleBox" id="styles">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
+                        <property name="valign">center</property>
                         <property name="hexpand">True</property>
-                        <property name="vexpand">True</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -246,6 +289,8 @@
                       <object class="GtkComboBox" id="symbols">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="valign">center</property>
+                        <property name="hexpand">True</property>
                         <property name="has_entry">True</property>
                         <child internal-child="entry">
                           <object class="GtkEntry" id="combobox-entry2">
@@ -264,6 +309,8 @@
                       <object class="GtkComboBox" id="symbolSets">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="valign">center</property>
+                        <property name="hexpand">True</property>
                         <property name="has_entry">True</property>
                         <child internal-child="entry">
                           <object class="GtkEntry" id="combobox-entry3">
@@ -298,7 +345,6 @@
                       <object class="GtkLabel" id="oldSymbolName">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="yalign">0.49000000953674316</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -308,7 +354,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="smlo-SmShowChar" id="oldSymbolDisplay">
+                      <object class="smlo-SmShowChar" id="oldSymbolDisplay:border">
                         <property name="width_request">60</property>
                         <property name="height_request">60</property>
                         <property name="visible">True</property>
@@ -337,8 +383,6 @@
                       <object class="GtkLabel" id="symbolName">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0.50999999046325684</property>
-                        <property name="yalign">0.49000000953674316</property>
                       </object>
                       <packing>
                         <property name="left_attach">2</property>
@@ -348,7 +392,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="smlo-SmShowChar" id="symbolDisplay">
+                      <object class="smlo-SmShowChar" id="symbolDisplay:border">
                         <property name="width_request">60</property>
                         <property name="height_request">60</property>
                         <property name="visible">True</property>
@@ -376,12 +420,9 @@
                     <child>
                       <object class="GtkButton" id="delete">
                         <property name="label">gtk-delete</property>
-                        <property name="use_action_appearance">False</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="relief">half</property>
                         <property name="use_stock">True</property>
                       </object>
                       <packing>
@@ -394,11 +435,9 @@
                     <child>
                       <object class="GtkButton" id="modify">
                         <property name="label" translatable="yes">_Modify</property>
-                        <property name="use_action_appearance">False</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_underline">True</property>
                       </object>
                       <packing>
@@ -411,11 +450,9 @@
                     <child>
                       <object class="GtkButton" id="add">
                         <property name="label">gtk-add</property>
-                        <property name="use_action_appearance">False</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>
@@ -429,6 +466,8 @@
                       <object class="GtkImage" id="rightArrow">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="halign">center</property>
+                        <property name="valign">center</property>
                         <property name="pixbuf">starmath/res/ar_right.png</property>
                       </object>
                       <packing>
@@ -477,8 +516,9 @@
                 <property name="use_action_appearance">False</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_action_appearance">False</property>
                 <property name="use_stock">True</property>
                 <property name="image_position">bottom</property>
               </object>
@@ -495,7 +535,6 @@
                 <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>
@@ -511,7 +550,6 @@
                 <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>
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 57fbd08..e6cf886 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -65,7 +65,7 @@ SvxShowCharSet::SvxShowCharSet(Window* pParent, const ResId& rResId)
 }
 
 SvxShowCharSet::SvxShowCharSet(Window* pParent)
-    : Control(pParent, WB_TABSTOP)
+    : Control(pParent, WB_TABSTOP | WB_BORDER)
     , m_pAccessible(NULL)
     , aVscrollSB( this, WB_VERT)
 {


More information about the Libreoffice-commits mailing list