diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-10-25 10:53:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-10-25 17:31:24 +0200 |
commit | d1e19bd285dfcb60cc088344faa1dd63f095352c (patch) | |
tree | dd121569f5afda7367b57b8485c712b1ec93f181 | |
parent | ece7f54a6ddcb635822ca51b7558561d69af7934 (diff) |
Resolves: tdf#113435 device tab missing from print dialog
Change-Id: I6119d1cbd5484ac2a26d60a7db4ac8fc11165561
Reviewed-on: https://gerrit.libreoffice.org/43818
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/uiconfig/ui/printerpropertiesdialog.ui | 16 | ||||
-rw-r--r-- | vcl/unx/generic/print/prtsetup.cxx | 32 |
2 files changed, 19 insertions, 29 deletions
diff --git a/vcl/uiconfig/ui/printerpropertiesdialog.ui b/vcl/uiconfig/ui/printerpropertiesdialog.ui index c6fe076145a2..96662860f946 100644 --- a/vcl/uiconfig/ui/printerpropertiesdialog.ui +++ b/vcl/uiconfig/ui/printerpropertiesdialog.ui @@ -71,7 +71,15 @@ </object> </child> <child type="tab"> - <placeholder/> + <object class="GtkLabel" id="paper"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="printerpropertiesdialog|paper">Paper</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> </child> <child> <object class="GtkGrid"> @@ -86,13 +94,13 @@ </packing> </child> <child type="tab"> - <object class="GtkLabel" id="paper"> + <object class="GtkLabel" id="device"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes" context="printerpropertiesdialog|paper">Paper</property> + <property name="label" translatable="yes" context="printerpropertiesdialog|device">Device</property> </object> <packing> - <property name="position">1</property> + <property name="position">2</property> <property name="tab_fill">False</property> </packing> </child> diff --git a/vcl/unx/generic/print/prtsetup.cxx b/vcl/unx/generic/print/prtsetup.cxx index 0faee232cdd6..3faddbf3e7b8 100644 --- a/vcl/unx/generic/print/prtsetup.cxx +++ b/vcl/unx/generic/print/prtsetup.cxx @@ -83,12 +83,10 @@ RTSDialog::RTSDialog(const PrinterInfo& rJobData, vcl::Window* pParent) get(m_pCancelButton, "cancel"); get(m_pTabControl, "notebook"); - sal_uInt16 nPageCount = m_pTabControl->GetPageCount(); - for (sal_uInt16 nPage = 0; nPage < nPageCount; ++nPage) - { - sal_uInt16 nPageId = m_pTabControl->GetPageId(nPage); - m_pTabControl->SetTabPage(nPageId, nullptr); - } + m_pPaperPage = VclPtr<RTSPaperPage>::Create( this ); + m_pDevicePage = VclPtr<RTSDevicePage>::Create( this ); + m_pTabControl->SetTabPage(m_pTabControl->GetPageId("paper"), m_pPaperPage); + m_pTabControl->SetTabPage(m_pTabControl->GetPageId("device"), m_pDevicePage); OUString aTitle(GetText()); SetText(aTitle.replaceAll("%s", m_aJobData.m_aPrinterName)); @@ -114,28 +112,12 @@ void RTSDialog::dispose() TabDialog::dispose(); } -IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl, void ) +IMPL_LINK_NOARG(RTSDialog, ActivatePage, TabControl*, void) { - if( pTabCtrl != m_pTabControl ) - return; - sal_uInt16 nId = m_pTabControl->GetCurPageId(); OString sPage = m_pTabControl->GetPageName(nId); - if ( ! m_pTabControl->GetTabPage( nId ) ) - { - TabPage *pPage = nullptr; - if (sPage == "paper") - pPage = m_pPaperPage = VclPtr<RTSPaperPage>::Create( this ); - else if (sPage == "device") - pPage = m_pDevicePage = VclPtr<RTSDevicePage>::Create( this ); - if( pPage ) - m_pTabControl->SetTabPage( nId, pPage ); - } - else - { - if (sPage == "paper") - m_pPaperPage->update(); - } + if (sPage == "paper") + m_pPaperPage->update(); } IMPL_LINK( RTSDialog, ClickButton, Button*, pButton, void ) |