diff options
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/tabpages/grfpage.cxx | 25 | ||||
-rw-r--r-- | cui/uiconfig/ui/spinbox.ui | 82 | ||||
-rw-r--r-- | solenv/sanitizers/ui/cui.suppr | 1 |
4 files changed, 98 insertions, 11 deletions
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 38e447aa4b9a..fb243e4eb3c5 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -206,6 +206,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/tsaurldialog \ cui/uiconfig/ui/twolinespage \ cui/uiconfig/ui/wordcompletionpage \ + cui/uiconfig/ui/spinbox \ cui/uiconfig/ui/zoomdialog \ )) diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index d44610dd23b1..96e2fcd1b9e2 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -31,7 +31,6 @@ #include <tools/fract.hxx> #include <svx/svxids.hrc> #include <strings.hrc> -#include <vcl/field.hxx> #include <vcl/fieldvalues.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> @@ -627,16 +626,20 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound ) // display original size const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() ); - ScopedVclPtrInstance< MetricField > aFld(Application::GetDefDialogParent(), WB_HIDE); - SetFieldUnit( *aFld, eMetric ); - aFld->SetDecimalDigits(m_xWidthMF->get_digits()); - aFld->SetMax( LONG_MAX - 1 ); - - aFld->SetValue( aFld->Normalize( aOrigSize.Width() ), eUnit ); - OUString sTemp = aFld->GetText(); - aFld->SetValue( aFld->Normalize( aOrigSize.Height() ), eUnit ); - // multiplication sign (U+00D7) - sTemp += u"\u00D7" + aFld->GetText(); + OUString sTemp; + { + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/spinbox.ui")); + std::unique_ptr<weld::MetricSpinButton> xFld(xBuilder->weld_metric_spin_button("spin", FieldUnit::CM)); + SetFieldUnit( *xFld, eMetric ); + xFld->set_digits(m_xWidthMF->get_digits()); + xFld->set_max(INT_MAX - 1, FieldUnit::NONE); + + xFld->set_value(xFld->normalize(aOrigSize.Width()), eUnit); + sTemp = xFld->get_text(); + xFld->set_value(xFld->normalize(aOrigSize.Height()), eUnit); + // multiplication sign (U+00D7) + sTemp += u"\u00D7" + xFld->get_text(); + } if ( aOrigPixelSize.Width() && aOrigPixelSize.Height() ) { sal_Int32 ax = sal_Int32(floor(static_cast<float>(aOrigPixelSize.Width()) / diff --git a/cui/uiconfig/ui/spinbox.ui b/cui/uiconfig/ui/spinbox.ui new file mode 100644 index 000000000000..0618f37135cd --- /dev/null +++ b/cui/uiconfig/ui/spinbox.ui @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> +<interface domain="cui"> + <requires lib="gtk+" version="3.18"/> + <object class="GtkDialog" id="SpinDialog"> + <property name="can_focus">False</property> + <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> + <child internal-child="vbox"> + <object class="GtkBox"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <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="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="SpinBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkSpinButton" id="spin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="adjustment">adjustment1</property> + <property name="value">1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</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="-5">ok</action-widget> + </action-widgets> + </object> + <object class="GtkAdjustment" id="adjustment1"> + <property name="lower">1</property> + <property name="upper">100000</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> +</interface> diff --git a/solenv/sanitizers/ui/cui.suppr b/solenv/sanitizers/ui/cui.suppr index e58c0a692316..7d71d2e109ad 100644 --- a/solenv/sanitizers/ui/cui.suppr +++ b/solenv/sanitizers/ui/cui.suppr @@ -290,6 +290,7 @@ cui/uiconfig/ui/spellingdialog.ui://GtkLabel[@id='explain'] orphan-label cui/uiconfig/ui/spellingdialog.ui://GtkLabel[@id='resumeft'] orphan-label cui/uiconfig/ui/spellingdialog.ui://GtkLabel[@id='nosuggestionsft'] orphan-label cui/uiconfig/ui/spellingdialog.ui://GtkLabel[@id='alttitleft'] orphan-label +cui/uiconfig/ui/spinbox.ui://GtkSpinButton[@id='spin'] no-labelled-by cui/uiconfig/ui/storedwebconnectiondialog.ui://GtkLabel[@id='label1'] orphan-label cui/uiconfig/ui/textanimtabpage.ui://GtkLabel[@id='FT_COUNT'] orphan-label cui/uiconfig/ui/textanimtabpage.ui://GtkLabel[@id='FT_AMOUNT'] orphan-label |