summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-10 10:37:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-10 18:20:42 +0200
commit17cbd1dcd12b140fd22477635edcb9874fbc439a (patch)
tree9d34aee35974bfb7abe2d183b67c569c5ec3f880 /cui
parentb4ccfe7333345a4338240cbd013170ba4751b3a7 (diff)
weld SvxBulletPickTabPage
Change-Id: I0b3e48cc63984208c8e4a090d6630dd5325d776e Reviewed-on: https://gerrit.libreoffice.org/60257 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/numpages.hxx12
-rw-r--r--cui/source/tabpages/numpages.cxx41
-rw-r--r--cui/uiconfig/ui/pickbulletpage.ui25
3 files changed, 48 insertions, 30 deletions
diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx
index cac9a110959c..2d22a18b8076 100644
--- a/cui/source/inc/numpages.hxx
+++ b/cui/source/inc/numpages.hxx
@@ -37,6 +37,7 @@
#define MN_GALLERY_ENTRY 100
+class NumValueSet;
class SvxColorListBox;
class SvxNumRule;
class SvxBmpNumValueSet;
@@ -121,7 +122,6 @@ class SvxBulletPickTabPage final : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- VclPtr<SvxNumValueSet> m_pExamplesVS;
std::unique_ptr<SvxNumRule> pActNum;
std::unique_ptr<SvxNumRule> pSaveNum;
sal_uInt16 nActNumLvl;
@@ -131,11 +131,13 @@ class SvxBulletPickTabPage final : public SfxTabPage
OUString sBulletCharFormatName;
- DECL_LINK(NumSelectHdl_Impl, ValueSet*, void);
- DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void);
+ std::unique_ptr<NumValueSet> m_xExamplesVS;
+ std::unique_ptr<weld::CustomWeld> m_xExamplesVSWin;
+
+ DECL_LINK(NumSelectHdl_Impl, SvtValueSet*, void);
+ DECL_LINK(DoubleClickHdl_Impl, SvtValueSet*, void);
public:
- SvxBulletPickTabPage(vcl::Window* pParent,
- const SfxItemSet& rSet);
+ SvxBulletPickTabPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~SvxBulletPickTabPage() override;
virtual void dispose() override;
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 6f5445084751..aa40c183bc51 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -357,19 +357,19 @@ IMPL_LINK_NOARG(SvxSingleNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
}
-SvxBulletPickTabPage::SvxBulletPickTabPage(vcl::Window* pParent,
- const SfxItemSet& rSet)
- : SfxTabPage(pParent, "PickBulletPage", "cui/ui/pickbulletpage.ui", &rSet)
+SvxBulletPickTabPage::SvxBulletPickTabPage(TabPageParent pParent, const SfxItemSet& rSet)
+ : SfxTabPage(pParent, "cui/ui/pickbulletpage.ui", "PickBulletPage", &rSet)
, nActNumLvl(SAL_MAX_UINT16)
, bModified(false)
, bPreset(false)
, nNumItemId(SID_ATTR_NUMBERING_RULE)
+ , m_xExamplesVS(new NumValueSet)
+ , m_xExamplesVSWin(new weld::CustomWeld(*m_xBuilder, "valueset", *m_xExamplesVS))
{
SetExchangeSupport();
- get(m_pExamplesVS, "valueset");
- m_pExamplesVS->init(NumberingPageType::BULLET);
- m_pExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl));
- m_pExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl));
+ m_xExamplesVS->init(NumberingPageType::BULLET);
+ m_xExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl));
+ m_xExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl));
}
SvxBulletPickTabPage::~SvxBulletPickTabPage()
@@ -379,16 +379,15 @@ SvxBulletPickTabPage::~SvxBulletPickTabPage()
void SvxBulletPickTabPage::dispose()
{
- pActNum.reset();
- pSaveNum.reset();
- m_pExamplesVS.clear();
+ m_xExamplesVSWin.reset();
+ m_xExamplesVS.reset();
SfxTabPage::dispose();
}
-VclPtr<SfxTabPage> SvxBulletPickTabPage::Create( TabPageParent pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxBulletPickTabPage::Create(TabPageParent pParent,
+ const SfxItemSet* rAttrSet)
{
- return VclPtr<SvxBulletPickTabPage>::Create(pParent.pParent, *rAttrSet);
+ return VclPtr<SvxBulletPickTabPage>::Create(pParent, *rAttrSet);
}
bool SvxBulletPickTabPage::FillItemSet( SfxItemSet* rSet )
@@ -422,13 +421,13 @@ void SvxBulletPickTabPage::ActivatePage(const SfxItemSet& rSet)
if(pActNum && *pSaveNum != *pActNum)
{
*pActNum = *pSaveNum;
- m_pExamplesVS->SetNoSelection();
+ m_xExamplesVS->SetNoSelection();
}
if(pActNum && (!lcl_IsNumFmtSet(pActNum.get(), nActNumLvl) || bIsPreset))
{
- m_pExamplesVS->SelectItem(1);
- NumSelectHdl_Impl(m_pExamplesVS);
+ m_xExamplesVS->SelectItem(1);
+ NumSelectHdl_Impl(m_xExamplesVS.get());
bPreset = true;
}
bPreset |= bIsPreset;
@@ -468,13 +467,13 @@ void SvxBulletPickTabPage::Reset( const SfxItemSet* rSet )
*pActNum = *pSaveNum;
}
-IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
+IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, SvtValueSet*, void)
{
if(pActNum)
{
bPreset = false;
bModified = true;
- sal_Unicode cChar = aBulletTypes[m_pExamplesVS->GetSelectedItemId() - 1];
+ sal_Unicode cChar = aBulletTypes[m_xExamplesVS->GetSelectedItemId() - 1];
const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
sal_uInt16 nMask = 1;
@@ -498,15 +497,13 @@ IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
}
}
-
-IMPL_LINK_NOARG(SvxBulletPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
+IMPL_LINK_NOARG(SvxBulletPickTabPage, DoubleClickHdl_Impl, SvtValueSet*, void)
{
- NumSelectHdl_Impl(m_pExamplesVS);
+ NumSelectHdl_Impl(m_xExamplesVS.get());
PushButton& rOk = GetTabDialog()->GetOKButton();
rOk.GetClickHdl().Call(&rOk);
}
-
void SvxBulletPickTabPage::PageCreated(const SfxAllItemSet& aSet)
{
const SfxStringItem* pBulletCharFmt = aSet.GetItem<SfxStringItem>(SID_BULLET_CHAR_FMT, false);
diff --git a/cui/uiconfig/ui/pickbulletpage.ui b/cui/uiconfig/ui/pickbulletpage.ui
index da2a1dae0198..8070ff6fbd46 100644
--- a/cui/uiconfig/ui/pickbulletpage.ui
+++ b/cui/uiconfig/ui/pickbulletpage.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkFrame" id="PickBulletPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -18,11 +19,29 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
- <object class="svxlo-SvxNumValueSet" id="valueset">
+ <object class="GtkScrolledWindow" id="valuesetwin">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkDrawingArea" id="valueset">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>