[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source sc/uiconfig sc/UIConfig_scalc.mk
Caolán McNamara
caolanm at redhat.com
Thu Oct 24 05:33:22 PDT 2013
sc/UIConfig_scalc.mk | 1
sc/inc/helpids.h | 1
sc/inc/sc.hrc | 1
sc/source/ui/app/inputhdl.cxx | 2
sc/source/ui/inc/solveroptions.hxx | 13 +--
sc/source/ui/miscdlgs/solveroptions.cxx | 19 ++---
sc/source/ui/src/solveroptions.src | 50 --------------
sc/uiconfig/scalc/ui/integerdialog.ui | 113 ++++++++++++++++++++++++++++++++
8 files changed, 128 insertions(+), 72 deletions(-)
New commits:
commit 8755bef6dd4145f2eac8c18a4a7eb58c52b83d47
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 24 12:46:27 2013 +0100
convert SolverInteger dialog to .ui
Change-Id: Iec4b0d041ec0389630d21572d6c5658639d85b17
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 2bbaf3a..29893fe 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -86,6 +86,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/insertcells \
sc/uiconfig/scalc/ui/insertname \
sc/uiconfig/scalc/ui/insertsheet \
+ sc/uiconfig/scalc/ui/integerdialog \
sc/uiconfig/scalc/ui/leftfooterdialog \
sc/uiconfig/scalc/ui/leftheaderdialog \
sc/uiconfig/scalc/ui/namerangesdialog \
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index b7856b2..126eba6 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -170,7 +170,6 @@
#define HID_SC_SOLVEROPTIONS "SC_HID_SC_SOLVEROPTIONS"
#define HID_SC_SOLVEROPTIONS_LB "SC_HID_SC_SOLVEROPTIONS_LB"
-#define HID_SC_SOLVER_INTEGER "SC_HID_SC_SOLVER_INTEGER"
#define HID_SC_SOLVER_DOUBLE "SC_HID_SC_SOLVER_DOUBLE"
#define HID_SC_SOLVER_PROGRESS "SC_HID_SC_SOLVER_PROGRESS"
#define HID_SC_SOLVER_NOSOLUTION "SC_HID_SC_SOLVER_NOSOLUTION"
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 7e945b6..a8ad8eb 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1090,7 +1090,6 @@
#define RID_SCDLG_DPSHOWDETAIL (SC_DIALOGS_START + 137)
#define RID_SCDLG_SOLVEROPTIONS (SC_DIALOGS_START + 139)
-#define RID_SCDLG_SOLVER_INTEGER (SC_DIALOGS_START + 140)
#define RID_SCDLG_SOLVER_DOUBLE (SC_DIALOGS_START + 141)
#define RID_SCDLG_SOLVER_PROGRESS (SC_DIALOGS_START + 142)
#define RID_SCDLG_SOLVER_NOSOLUTION (SC_DIALOGS_START + 143)
diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx
index b632b47..9dbde59 100644
--- a/sc/source/ui/inc/solveroptions.hxx
+++ b/sc/source/ui/inc/solveroptions.hxx
@@ -20,12 +20,12 @@
#ifndef SC_SOLVEROPTIONS_HXX
#define SC_SOLVEROPTIONS_HXX
-#include <vcl/dialog.hxx>
-
#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
-#include <vcl/field.hxx>
#include <svx/checklbx.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -77,11 +77,8 @@ public:
class ScSolverIntegerDialog : public ModalDialog
{
- FixedText maFtName;
- NumericField maNfValue;
- FixedLine maFlButtons;
- OKButton maBtnOk;
- CancelButton maBtnCancel;
+ VclFrame* m_pFrame;
+ NumericField* m_pNfValue;
public:
ScSolverIntegerDialog( Window * pParent );
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 6488c7b..479f3a4 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -401,15 +401,12 @@ IMPL_LINK_NOARG(ScSolverOptionsDialog, SettingsSelHdl)
//------------------------------------------------------------------
-ScSolverIntegerDialog::ScSolverIntegerDialog( Window * pParent )
- : ModalDialog( pParent, ScResId( RID_SCDLG_SOLVER_INTEGER ) ),
- maFtName ( this, ScResId( FT_OPTIONNAME ) ),
- maNfValue ( this, ScResId( NF_VALUE ) ),
- maFlButtons ( this, ScResId( FL_BUTTONS ) ),
- maBtnOk ( this, ScResId( BTN_OK ) ),
- maBtnCancel ( this, ScResId( BTN_CANCEL ) )
+ScSolverIntegerDialog::ScSolverIntegerDialog(Window * pParent)
+ : ModalDialog( pParent, "IntegerDialog",
+ "modules/scalc/ui/integerdialog.ui" )
{
- FreeResource();
+ get(m_pFrame, "frame");
+ get(m_pNfValue, "value");
}
ScSolverIntegerDialog::~ScSolverIntegerDialog()
@@ -418,17 +415,17 @@ ScSolverIntegerDialog::~ScSolverIntegerDialog()
void ScSolverIntegerDialog::SetOptionName( const OUString& rName )
{
- maFtName.SetText( rName );
+ m_pFrame->set_label(rName);
}
void ScSolverIntegerDialog::SetValue( sal_Int32 nValue )
{
- maNfValue.SetValue( nValue );
+ m_pNfValue->SetValue( nValue );
}
sal_Int32 ScSolverIntegerDialog::GetValue() const
{
- sal_Int64 nValue = maNfValue.GetValue();
+ sal_Int64 nValue = m_pNfValue->GetValue();
if ( nValue < SAL_MIN_INT32 )
return SAL_MIN_INT32;
if ( nValue > SAL_MAX_INT32 )
diff --git a/sc/source/ui/src/solveroptions.src b/sc/source/ui/src/solveroptions.src
index 0d74998..8f7bb13 100644
--- a/sc/source/ui/src/solveroptions.src
+++ b/sc/source/ui/src/solveroptions.src
@@ -89,56 +89,6 @@ ModalDialog RID_SCDLG_SOLVEROPTIONS
Text [ en-US ] = "Options" ;
};
-ModalDialog RID_SCDLG_SOLVER_INTEGER
-{
- OutputSize = TRUE ;
- HelpId = HID_SC_SOLVER_INTEGER ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 118 , 76 ) ;
- Moveable = TRUE ;
- FixedText FT_OPTIONNAME
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 106 , 16 ) ;
- WordBreak = TRUE ;
- // text is dynamic
- };
- NumericField NF_VALUE
- {
- HelpID = "sc:NumericField:RID_SCDLG_SOLVER_INTEGER:NF_VALUE";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 27 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- SpinSize = 1 ;
- Repeat = TRUE ;
- Minimum = -2147483648 ;
- Maximum = 2147483647 ;
- First = 0 ;
- Last = 100 ;
- };
- FixedLine FL_BUTTONS
- {
- Pos = MAP_APPFONT ( 0 , 45 ) ;
- Size = MAP_APPFONT ( 118 , 8 ) ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 6 , 56 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 62 , 56 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- Text [ en-US ] = "Edit Setting" ;
-};
-
ModalDialog RID_SCDLG_SOLVER_DOUBLE
{
OutputSize = TRUE ;
diff --git a/sc/uiconfig/scalc/ui/integerdialog.ui b/sc/uiconfig/scalc/ui/integerdialog.ui
new file mode 100644
index 0000000..dece80a
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/integerdialog.ui
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">2147483647</property>
+ <property name="value">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkDialog" id="IntegerDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Edit Setting</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">start</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>
+ <property name="secondary">True</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>
+ <property name="secondary">True</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="frame">
+ <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="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkSpinButton" id="value">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="invisible_char">â</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </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-widgets>
+ </object>
+</interface>
commit d05918d42a6af99758118970733cd77cb218f28e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 24 12:40:03 2013 +0100
aStr[0] on an empty string is newly disallowed
Change-Id: I0494f06ec8709fdf33ace6772823d7b986ff5847
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 209308e..87713ec 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2069,7 +2069,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
if ( bAutoComplete )
GetColData();
- if ( ( aStr[0] == '=' || aStr[0] == '+' || aStr[0] == '-' ) &&
+ if ( !aStr.isEmpty() && ( aStr[0] == '=' || aStr[0] == '+' || aStr[0] == '-' ) &&
!cTyped && !bCreatingFuncView )
InitRangeFinder(aStr); // Formel wird editiert -> RangeFinder
More information about the Libreoffice-commits
mailing list