summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-10 14:13:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-11 09:59:53 +0100
commit96d0cf0d7bccfea0b9d867cf00a17c7a2409aa87 (patch)
treeabc95f9969c4c0e1434228096f1c088c2a4ec627 /vcl/source
parentbea1fe240010d4870d2fd3877ee07ba31d1dcda0 (diff)
weld SfxDocumentPage
Change-Id: I99f342ad1c0620147ce23b4670323056d7ccc508 Reviewed-on: https://gerrit.libreoffice.org/69008 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/salvtables.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e732939aed78..392ecb04ba81 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3302,9 +3302,12 @@ public:
class SalInstanceLabel : public SalInstanceWidget, public virtual weld::Label
{
private:
- VclPtr<FixedText> m_xLabel;
+ // Control instead of FixedText so we can also use this for
+ // SelectableFixedText which is derived from Edit. We just typically need
+ // [G|S]etText which exists in their shared basesclass
+ VclPtr<Control> m_xLabel;
public:
- SalInstanceLabel(FixedText* pLabel, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
+ SalInstanceLabel(Control* pLabel, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
: SalInstanceWidget(pLabel, pBuilder, bTakeOwnership)
, m_xLabel(pLabel)
{
@@ -3322,8 +3325,10 @@ public:
virtual void set_mnemonic_widget(Widget* pTarget) override
{
+ FixedText* pLabel = dynamic_cast<FixedText*>(m_xLabel.get());
+ assert(pLabel && "can't use set_mnemonic_widget on SelectableFixedText");
SalInstanceWidget* pTargetWidget = dynamic_cast<SalInstanceWidget*>(pTarget);
- m_xLabel->set_mnemonic_widget(pTargetWidget ? pTargetWidget->getWidget() : nullptr);
+ pLabel->set_mnemonic_widget(pTargetWidget ? pTargetWidget->getWidget() : nullptr);
}
};
@@ -4356,7 +4361,7 @@ public:
virtual std::unique_ptr<weld::Label> weld_label(const OString &id, bool bTakeOwnership) override
{
- FixedText* pLabel = m_xBuilder->get<FixedText>(id);
+ Control* pLabel = m_xBuilder->get<Control>(id);
return pLabel ? std::make_unique<SalInstanceLabel>(pLabel, this, bTakeOwnership) : nullptr;
}