diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2013-11-26 14:40:07 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-04 04:55:11 -0600 |
commit | 6230cdd2d8971147dcb629c8bd61daa1fefcb7c7 (patch) | |
tree | c2cb3afa2ff1e75c8387cfacc90c27db770b20d6 | |
parent | c0125d64cbf8adcf070d0bf715e98e57fbeecf8c (diff) |
Drop font substitution tab page
The relevant VCL code will be dropped in the next commits.
Change-Id: Ieaa550d671fa43f2e5a96e2df7f256de2faf2fa4
Reviewed-on: https://gerrit.libreoffice.org/6857
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | padmin/source/prtsetup.cxx | 145 | ||||
-rw-r--r-- | padmin/source/prtsetup.hxx | 28 | ||||
-rw-r--r-- | padmin/source/rtsetup.hrc | 11 | ||||
-rw-r--r-- | padmin/source/rtsetup.src | 76 |
4 files changed, 0 insertions, 260 deletions
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx index 65884581b925..a91d43f2a43d 100644 --- a/padmin/source/prtsetup.cxx +++ b/padmin/source/prtsetup.cxx @@ -22,8 +22,6 @@ #include "rtsetup.hrc" #include "cmddlg.hxx" -#include "vcl/fontmanager.hxx" - #include "osl/thread.h" #include <officecfg/Office/Common.hxx> @@ -83,7 +81,6 @@ RTSDialog::RTSDialog( const PrinterInfo& rJobData, const OUString& rPrinter, boo , m_pPaperPage(NULL) , m_pDevicePage(NULL) , m_pOtherPage(NULL) - , m_pFontSubstPage(NULL) , m_pCommandPage(NULL) , m_aInvalidString(PaResId(RID_RTS_RTSDIALOG_INVALID_TXT).toString()) { @@ -97,7 +94,6 @@ RTSDialog::RTSDialog( const PrinterInfo& rJobData, const OUString& rPrinter, boo if( ! bAllPages ) { m_pTabControl->RemovePage(m_pTabControl->GetPageId("other")); - m_pTabControl->RemovePage(m_pTabControl->GetPageId("font")); m_pTabControl->RemovePage(m_pTabControl->GetPageId("command")); } else if( m_aJobData.m_aDriverName.startsWith("CUPS:") && ! PrinterInfoManager::get().isCUPSDisabled() ) @@ -119,7 +115,6 @@ RTSDialog::~RTSDialog() delete m_pPaperPage; delete m_pDevicePage; delete m_pOtherPage; - delete m_pFontSubstPage; delete m_pCommandPage; } @@ -141,8 +136,6 @@ IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl ) pPage = m_pDevicePage = new RTSDevicePage( this ); else if (sPage == "other") pPage = m_pOtherPage = new RTSOtherPage( this ); - else if (sPage == "font") - pPage = m_pFontSubstPage = new RTSFontSubstPage( this ); else if (sPage == "command") pPage = m_pCommandPage = new RTSCommandPage( this ); if( pPage ) @@ -620,144 +613,6 @@ IMPL_LINK( RTSOtherPage, ClickBtnHdl, Button*, pButton ) return 0; } -// ------------------------------------------------------------------ - -/* - * RTSFontSubstPage - */ - -RTSFontSubstPage::RTSFontSubstPage( RTSDialog* pParent ) : - TabPage( pParent->m_pTabControl, PaResId( RID_RTS_FONTSUBSTPAGE ) ), - m_pParent( pParent ), - m_aSubstitutionsText( this, PaResId( RID_RTS_FS_SUBST_TXT ) ), - m_aSubstitutionsBox( this, PaResId( RID_RTS_FS_SUBST_BOX ) ), - m_aFromFontText( this, PaResId( RID_RTS_FS_FROM_TXT ) ), - m_aFromFontBox( this, PaResId( RID_RTS_FS_FROM_BOX ) ), - m_aToFontText( this, PaResId( RID_RTS_FS_TO_TXT ) ), - m_aToFontBox( this, PaResId( RID_RTS_FS_TO_BOX ) ), - m_aAddButton( this, PaResId( RID_RTS_FS_ADD_BTN ) ), - m_aRemoveButton( this, PaResId( RID_RTS_FS_REMOVE_BTN ) ), - m_aEnableBox( this, PaResId( RID_RTS_FS_ENABLE_BTN ) ) -{ - FreeResource(); - - // fill to box - PrintFontManager& rFontManager = PrintFontManager::get(); - ::std::list< FastPrintFontInfo > aFonts; - rFontManager.getFontListWithFastInfo( aFonts, m_pParent->m_aJobData.m_pParser ); - ::std::list< FastPrintFontInfo >::const_iterator it; - ::boost::unordered_map< OUString, int, OUStringHash > aToMap, aFromMap; - for( it = aFonts.begin(); it != aFonts.end(); ++it ) - { - if( it->m_eType == fonttype::Builtin ) - { - if( aToMap.find( it->m_aFamilyName ) == aToMap.end() ) - { - m_aToFontBox.InsertEntry( it->m_aFamilyName ); - aToMap[ it->m_aFamilyName ] = 1; - } - } - else - { - if( aFromMap.find( it->m_aFamilyName ) == aFromMap.end() ) - { - m_aFromFontBox.InsertEntry( it->m_aFamilyName ); - aFromMap[ it->m_aFamilyName ] = 1; - } - } - } - - m_aEnableBox.Check( m_pParent->m_aJobData.m_bPerformFontSubstitution ); - m_aRemoveButton.Enable( sal_False ); - if( ! m_pParent->m_aJobData.m_bPerformFontSubstitution ) - { - m_aSubstitutionsBox.Enable( sal_False ); - m_aSubstitutionsText.Enable( sal_False ); - m_aAddButton.Enable( sal_False ); - m_aToFontBox.Enable( sal_False ); - m_aToFontText.Enable( sal_False ); - m_aFromFontBox.Enable( sal_False ); - m_aFromFontText.Enable( sal_False ); - } - - update(); - - m_aAddButton.SetClickHdl( LINK( this, RTSFontSubstPage, ClickBtnHdl ) ); - m_aRemoveButton.SetClickHdl( LINK( this, RTSFontSubstPage, ClickBtnHdl ) ); - m_aEnableBox.SetClickHdl( LINK( this, RTSFontSubstPage, ClickBtnHdl ) ); - m_aSubstitutionsBox.SetSelectHdl( LINK( this, RTSFontSubstPage, SelectHdl ) ); - m_aSubstitutionsBox.setDelPressedLink( LINK( this, RTSFontSubstPage, DelPressedHdl ) ); -} - -RTSFontSubstPage::~RTSFontSubstPage() -{ -} - -void RTSFontSubstPage::update() -{ - m_aSubstitutionsBox.Clear(); - m_aRemoveButton.Enable( sal_False ); - // fill substitutions box - ::boost::unordered_map< OUString, OUString, OUStringHash >::const_iterator it; - for( it = m_pParent->m_aJobData.m_aFontSubstitutes.begin(); - it != m_pParent->m_aJobData.m_aFontSubstitutes.end(); ++it ) - { - OUString aEntry = it->first + " -> " + it->second; - m_aSubstitutionsBox.InsertEntry( aEntry ); - } -} - -IMPL_LINK( RTSFontSubstPage, DelPressedHdl, ListBox*, pBox ) -{ - if( pBox == &m_aSubstitutionsBox && - m_aRemoveButton.IsEnabled() ) - ClickBtnHdl( &m_aRemoveButton ); - return 0; -} - -IMPL_LINK( RTSFontSubstPage, SelectHdl, ListBox*, pBox ) -{ - if( pBox == &m_aSubstitutionsBox ) - { - m_aRemoveButton.Enable( m_aSubstitutionsBox.GetSelectEntryCount() && m_pParent->m_aJobData.m_bPerformFontSubstitution ); - } - return 0; -} - -IMPL_LINK( RTSFontSubstPage, ClickBtnHdl, Button*, pButton ) -{ - if( pButton == &m_aAddButton ) - { - m_pParent->m_aJobData.m_aFontSubstitutes[ m_aFromFontBox.GetText() ] = m_aToFontBox.GetSelectEntry(); - update(); - } - else if( pButton == &m_aRemoveButton ) - { - for( int i = 0; i < m_aSubstitutionsBox.GetSelectEntryCount(); i++ ) - { - OUString aEntry( m_aSubstitutionsBox.GetSelectEntry( i ) ); - sal_Int32 nPos = aEntry.indexOf(" -> "); - if (nPos != -1) - aEntry = aEntry.copy(0, nPos); - m_pParent->m_aJobData.m_aFontSubstitutes.erase( aEntry ); - } - update(); - } - else if( pButton == &m_aEnableBox ) - { - m_pParent->m_aJobData.m_bPerformFontSubstitution = m_aEnableBox.IsChecked() ? true : false; - m_aSubstitutionsBox.Enable( m_pParent->m_aJobData.m_bPerformFontSubstitution ); - m_aSubstitutionsText.Enable( m_pParent->m_aJobData.m_bPerformFontSubstitution ); - m_aAddButton.Enable( m_pParent->m_aJobData.m_bPerformFontSubstitution ); - m_aRemoveButton.Enable( m_aSubstitutionsBox.GetSelectEntryCount() && m_pParent->m_aJobData.m_bPerformFontSubstitution ); - m_aToFontBox.Enable( m_pParent->m_aJobData.m_bPerformFontSubstitution ); - m_aToFontText.Enable( m_pParent->m_aJobData.m_bPerformFontSubstitution ); - m_aFromFontBox.Enable( m_pParent->m_aJobData.m_bPerformFontSubstitution ); - m_aFromFontText.Enable( m_pParent->m_aJobData.m_bPerformFontSubstitution ); - } - return 0; -} - class RTSPWDialog : public ModalDialog { diff --git a/padmin/source/prtsetup.hxx b/padmin/source/prtsetup.hxx index 7bb97d26e1ec..c93938675852 100644 --- a/padmin/source/prtsetup.hxx +++ b/padmin/source/prtsetup.hxx @@ -40,7 +40,6 @@ namespace padmin { class RTSPaperPage; class RTSDevicePage; class RTSOtherPage; -class RTSFontSubstPage; class RTSCommandPage; class RTSDialog : public TabDialog @@ -48,7 +47,6 @@ class RTSDialog : public TabDialog friend class RTSPaperPage; friend class RTSDevicePage; friend class RTSOtherPage; - friend class RTSFontSubstPage; friend class RTSCommandPage; ::psp::PrinterInfo m_aJobData; @@ -63,7 +61,6 @@ class RTSDialog : public TabDialog RTSPaperPage* m_pPaperPage; RTSDevicePage* m_pDevicePage; RTSOtherPage* m_pOtherPage; - RTSFontSubstPage* m_pFontSubstPage; RTSCommandPage* m_pCommandPage; // some resources @@ -162,31 +159,6 @@ public: void save(); }; -class RTSFontSubstPage : public TabPage -{ - RTSDialog* m_pParent; - - FixedText m_aSubstitutionsText; - DelMultiListBox m_aSubstitutionsBox; - FixedText m_aFromFontText; - ComboBox m_aFromFontBox; - FixedText m_aToFontText; - ListBox m_aToFontBox; - - PushButton m_aAddButton; - PushButton m_aRemoveButton; - CheckBox m_aEnableBox; - - DECL_LINK( ClickBtnHdl, Button* ); - DECL_LINK( SelectHdl, ListBox* ); - DECL_LINK( DelPressedHdl, ListBox* ); - - void update(); -public: - RTSFontSubstPage( RTSDialog* ); - ~RTSFontSubstPage(); -}; - } // namespace #endif // _PAD_PRTSETUP_HXX diff --git a/padmin/source/rtsetup.hrc b/padmin/source/rtsetup.hrc index 694a5aceecd9..42ba728a4e10 100644 --- a/padmin/source/rtsetup.hrc +++ b/padmin/source/rtsetup.hrc @@ -35,17 +35,6 @@ #define RID_RTS_OTHER_COMMENT_EDT 10 #define RID_RTS_OTHER_DEFAULT_BTN 11 -#define RID_RTS_FONTSUBSTPAGE 4005 -#define RID_RTS_FS_SUBST_TXT 1 -#define RID_RTS_FS_SUBST_BOX 2 -#define RID_RTS_FS_FROM_TXT 3 -#define RID_RTS_FS_FROM_BOX 4 -#define RID_RTS_FS_TO_TXT 5 -#define RID_RTS_FS_TO_BOX 6 -#define RID_RTS_FS_ADD_BTN 7 -#define RID_RTS_FS_REMOVE_BTN 8 -#define RID_RTS_FS_ENABLE_BTN 9 - #define RID_RTS_COMMANDPAGE 4006 #define RID_RTS_CMD_TXT_PRTNAME 1 #define RID_RTS_CMD_TXT_CONNECT 2 diff --git a/padmin/source/rtsetup.src b/padmin/source/rtsetup.src index 21bbf9e35b3b..ad8de70bd9d7 100644 --- a/padmin/source/rtsetup.src +++ b/padmin/source/rtsetup.src @@ -24,82 +24,6 @@ String RID_RTS_RTSDIALOG_INVALID_TXT Text [ en-US ] = "<ignore>"; }; -TabPage RID_RTS_FONTSUBSTPAGE -{ - HelpID = "padmin:TabPage:RID_RTS_FONTSUBSTPAGE"; - Hide = TRUE; - Size = MAP_APPFONT( 230, 175 ); - - CheckBox RID_RTS_FS_ENABLE_BTN - { - HelpID = "padmin:CheckBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_ENABLE_BTN"; - Pos = MAP_APPFONT( 5, 5 ); - Size = MAP_APPFONT( 180, 10 ); - Text [ en-US ] = "~Enable font replacement"; - }; - - FixedText RID_RTS_FS_SUBST_TXT - { - Pos = MAP_APPFONT( 5,20 ); - Size = MAP_APPFONT( 180, 8 ); - Text [ en-US ] = "Replaced ~fonts"; - }; - MultiListBox RID_RTS_FS_SUBST_BOX - { - HelpID = "padmin:MultiListBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_SUBST_BOX"; - AutoHScroll = TRUE; - Border = TRUE; - Sort = TRUE; - SimpleMode = TRUE; - Pos = MAP_APPFONT( 5, 30 ); - Size = MAP_APPFONT( 220, 90 ); - }; - PushButton RID_RTS_FS_ADD_BTN - { - HelpID = "padmin:PushButton:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_ADD_BTN"; - Pos = MAP_APPFONT( 5, 125 ); - Size = MAP_APPFONT( 107, 12 ); - Text [ en-US ] = "~Add"; - }; - PushButton RID_RTS_FS_REMOVE_BTN - { - HelpID = "padmin:PushButton:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_REMOVE_BTN"; - Pos = MAP_APPFONT( 117, 125 ); - Size = MAP_APPFONT( 107, 12 ); - Text [ en-US ] = "~Remove"; - }; - FixedText RID_RTS_FS_FROM_TXT - { - Pos = MAP_APPFONT( 5, 145 ); - Size = MAP_APPFONT( 107, 8 ); - Text [ en-US ] = "Repla~ce font"; - }; - ComboBox RID_RTS_FS_FROM_BOX - { - HelpID = "padmin:ComboBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_FROM_BOX"; - Border = TRUE; - DropDown = TRUE; - Sort = TRUE; - Pos = MAP_APPFONT( 5, 155 ); - Size = MAP_APPFONT( 107, 200 ); - }; - FixedText RID_RTS_FS_TO_TXT - { - Pos = MAP_APPFONT( 117, 145 ); - Size = MAP_APPFONT( 107, 8 ); - Text [ en-US ] = "by ~printer font"; - }; - ListBox RID_RTS_FS_TO_BOX - { - HelpID = "padmin:ListBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_TO_BOX"; - Border = TRUE; - DropDown = TRUE; - Sort = TRUE; - Pos = MAP_APPFONT( 117, 155 ); - Size = MAP_APPFONT( 107, 200 ); - }; -}; - TabPage RID_RTS_COMMANDPAGE { HelpID = "padmin:TabPage:RID_RTS_COMMANDPAGE"; |