[Libreoffice-commits] core.git: vcl/uiconfig vcl/unx
Caolán McNamara
caolanm at redhat.com
Wed Oct 25 15:31:45 UTC 2017
vcl/uiconfig/ui/printerpropertiesdialog.ui | 16 ++++++++++----
vcl/unx/generic/print/prtsetup.cxx | 32 ++++++-----------------------
2 files changed, 19 insertions(+), 29 deletions(-)
New commits:
commit d1e19bd285dfcb60cc088344faa1dd63f095352c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 25 10:53:28 2017 +0100
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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 )
More information about the Libreoffice-commits
mailing list