summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-10 13:59:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-11 09:56:34 +0200
commitbc65992929392d597070237471aa4d5a7eec674d (patch)
tree7a071b3544917b6674278cd4b635e97bf10e8955 /cui
parenttdf#108028 OOXML: Fix line breaking of chart title (diff)
downloadcore-bc65992929392d597070237471aa4d5a7eec674d.tar.gz
core-bc65992929392d597070237471aa4d5a7eec674d.zip
weld SvxNumPickTabPage
Change-Id: I575927d125af684e1133d6b46c0f637d996cbb88 Reviewed-on: https://gerrit.libreoffice.org/60265 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.hxx11
-rw-r--r--cui/source/tabpages/numpages.cxx42
-rw-r--r--cui/uiconfig/ui/pickoutlinepage.ui22
3 files changed, 45 insertions, 30 deletions
diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx
index bef652167040..920ffbf6b3c1 100644
--- a/cui/source/inc/numpages.hxx
+++ b/cui/source/inc/numpages.hxx
@@ -41,7 +41,6 @@ class NumValueSet;
class SvxColorListBox;
class SvxNumRule;
class SvxBmpNumValueSet;
-class SvxNumValueSet;
class SvxBrushItem;
class ValueSet;
@@ -160,7 +159,6 @@ class SvxNumPickTabPage final : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- VclPtr<SvxNumValueSet> m_pExamplesVS;
OUString sNumCharFmtName;
OUString sBulletCharFormatName;
@@ -173,13 +171,14 @@ class SvxNumPickTabPage final : public SfxTabPage
bool bModified : 1;
bool bPreset : 1;
+ std::unique_ptr<NumValueSet> m_xExamplesVS;
+ std::unique_ptr<weld::CustomWeld> m_xExamplesVSWin;
- DECL_LINK(NumSelectHdl_Impl, ValueSet*, void);
- DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void);
+ DECL_LINK(NumSelectHdl_Impl, SvtValueSet*, void);
+ DECL_LINK(DoubleClickHdl_Impl, SvtValueSet*, void);
public:
- SvxNumPickTabPage(vcl::Window* pParent,
- const SfxItemSet& rSet);
+ SvxNumPickTabPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~SvxNumPickTabPage() override;
virtual void dispose() override;
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index f8a411f9ff4f..58cdf26ee997 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -510,21 +510,20 @@ void SvxBulletPickTabPage::PageCreated(const SfxAllItemSet& aSet)
sBulletCharFormatName = pBulletCharFmt->GetValue();
}
-
-SvxNumPickTabPage::SvxNumPickTabPage(vcl::Window* pParent,
- const SfxItemSet& rSet)
- : SfxTabPage(pParent, "PickOutlinePage", "cui/ui/pickoutlinepage.ui", &rSet)
+SvxNumPickTabPage::SvxNumPickTabPage(TabPageParent pParent, const SfxItemSet& rSet)
+ : SfxTabPage(pParent, "cui/ui/pickoutlinepage.ui", "PickOutlinePage", &rSet)
, nActNumLvl(SAL_MAX_UINT16)
, nNumItemId(SID_ATTR_NUMBERING_RULE)
, bModified(false)
, bPreset(false)
+ , m_xExamplesVS(new NumValueSet)
+ , m_xExamplesVSWin(new weld::CustomWeld(*m_xBuilder, "valueset", *m_xExamplesVS))
{
SetExchangeSupport();
- get(m_pExamplesVS, "valueset");
- m_pExamplesVS->init(NumberingPageType::OUTLINE);
- m_pExamplesVS->SetSelectHdl(LINK(this, SvxNumPickTabPage, NumSelectHdl_Impl));
- m_pExamplesVS->SetDoubleClickHdl(LINK(this, SvxNumPickTabPage, DoubleClickHdl_Impl));
+ m_xExamplesVS->init(NumberingPageType::OUTLINE);
+ m_xExamplesVS->SetSelectHdl(LINK(this, SvxNumPickTabPage, NumSelectHdl_Impl));
+ m_xExamplesVS->SetDoubleClickHdl(LINK(this, SvxNumPickTabPage, DoubleClickHdl_Impl));
Reference<XDefaultNumberingProvider> xDefNum = SvxNumOptionsTabPageHelper::GetNumberingProvider();
if(xDefNum.is())
@@ -556,7 +555,7 @@ SvxNumPickTabPage::SvxNumPickTabPage(vcl::Window* pParent,
{
}
Reference<XNumberingFormatter> xFormat(xDefNum, UNO_QUERY);
- m_pExamplesVS->SetOutlineNumberingSettings(aOutlineAccess, xFormat, rLocale);
+ m_xExamplesVS->SetOutlineNumberingSettings(aOutlineAccess, xFormat, rLocale);
}
}
@@ -567,16 +566,15 @@ SvxNumPickTabPage::~SvxNumPickTabPage()
void SvxNumPickTabPage::dispose()
{
- pActNum.reset();
- pSaveNum.reset();
- m_pExamplesVS.clear();
+ m_xExamplesVSWin.reset();
+ m_xExamplesVS.reset();
SfxTabPage::dispose();
}
-VclPtr<SfxTabPage> SvxNumPickTabPage::Create( TabPageParent pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxNumPickTabPage::Create(TabPageParent pParent,
+ const SfxItemSet* rAttrSet)
{
- return VclPtr<SvxNumPickTabPage>::Create(pParent.pParent, *rAttrSet);
+ return VclPtr<SvxNumPickTabPage>::Create(pParent, *rAttrSet);
}
bool SvxNumPickTabPage::FillItemSet( SfxItemSet* rSet )
@@ -610,13 +608,13 @@ void SvxNumPickTabPage::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;
@@ -658,7 +656,7 @@ void SvxNumPickTabPage::Reset( const SfxItemSet* rSet )
}
// all levels are changed here
-IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
+IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl, SvtValueSet*, void)
{
if(pActNum)
{
@@ -667,7 +665,7 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
const FontList* pList = nullptr;
- SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[m_pExamplesVS->GetSelectedItemId() - 1];
+ SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[m_xExamplesVS->GetSelectedItemId() - 1];
const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
SvxNumSettings_Impl* pLevelSettings = nullptr;
@@ -740,9 +738,9 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
}
}
-IMPL_LINK_NOARG(SvxNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
+IMPL_LINK_NOARG(SvxNumPickTabPage, DoubleClickHdl_Impl, SvtValueSet*, void)
{
- NumSelectHdl_Impl(m_pExamplesVS);
+ NumSelectHdl_Impl(m_xExamplesVS.get());
PushButton& rOk = GetTabDialog()->GetOKButton();
rOk.GetClickHdl().Call(&rOk);
}
diff --git a/cui/uiconfig/ui/pickoutlinepage.ui b/cui/uiconfig/ui/pickoutlinepage.ui
index bfcbdf12a5d9..a1360ea11d3f 100644
--- a/cui/uiconfig/ui/pickoutlinepage.ui
+++ b/cui/uiconfig/ui/pickoutlinepage.ui
@@ -18,11 +18,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>