Kaydet (Commit) 6230cdd2 authored tarafından Khaled Hosny's avatar Khaled Hosny Kaydeden (comit) Caolán McNamara

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/6857Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst c0125d64
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#include "rtsetup.hrc" #include "rtsetup.hrc"
#include "cmddlg.hxx" #include "cmddlg.hxx"
#include "vcl/fontmanager.hxx"
#include "osl/thread.h" #include "osl/thread.h"
#include <officecfg/Office/Common.hxx> #include <officecfg/Office/Common.hxx>
...@@ -83,7 +81,6 @@ RTSDialog::RTSDialog( const PrinterInfo& rJobData, const OUString& rPrinter, boo ...@@ -83,7 +81,6 @@ RTSDialog::RTSDialog( const PrinterInfo& rJobData, const OUString& rPrinter, boo
, m_pPaperPage(NULL) , m_pPaperPage(NULL)
, m_pDevicePage(NULL) , m_pDevicePage(NULL)
, m_pOtherPage(NULL) , m_pOtherPage(NULL)
, m_pFontSubstPage(NULL)
, m_pCommandPage(NULL) , m_pCommandPage(NULL)
, m_aInvalidString(PaResId(RID_RTS_RTSDIALOG_INVALID_TXT).toString()) , m_aInvalidString(PaResId(RID_RTS_RTSDIALOG_INVALID_TXT).toString())
{ {
...@@ -97,7 +94,6 @@ RTSDialog::RTSDialog( const PrinterInfo& rJobData, const OUString& rPrinter, boo ...@@ -97,7 +94,6 @@ RTSDialog::RTSDialog( const PrinterInfo& rJobData, const OUString& rPrinter, boo
if( ! bAllPages ) if( ! bAllPages )
{ {
m_pTabControl->RemovePage(m_pTabControl->GetPageId("other")); m_pTabControl->RemovePage(m_pTabControl->GetPageId("other"));
m_pTabControl->RemovePage(m_pTabControl->GetPageId("font"));
m_pTabControl->RemovePage(m_pTabControl->GetPageId("command")); m_pTabControl->RemovePage(m_pTabControl->GetPageId("command"));
} }
else if( m_aJobData.m_aDriverName.startsWith("CUPS:") && ! PrinterInfoManager::get().isCUPSDisabled() ) else if( m_aJobData.m_aDriverName.startsWith("CUPS:") && ! PrinterInfoManager::get().isCUPSDisabled() )
...@@ -119,7 +115,6 @@ RTSDialog::~RTSDialog() ...@@ -119,7 +115,6 @@ RTSDialog::~RTSDialog()
delete m_pPaperPage; delete m_pPaperPage;
delete m_pDevicePage; delete m_pDevicePage;
delete m_pOtherPage; delete m_pOtherPage;
delete m_pFontSubstPage;
delete m_pCommandPage; delete m_pCommandPage;
} }
...@@ -141,8 +136,6 @@ IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl ) ...@@ -141,8 +136,6 @@ IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl )
pPage = m_pDevicePage = new RTSDevicePage( this ); pPage = m_pDevicePage = new RTSDevicePage( this );
else if (sPage == "other") else if (sPage == "other")
pPage = m_pOtherPage = new RTSOtherPage( this ); pPage = m_pOtherPage = new RTSOtherPage( this );
else if (sPage == "font")
pPage = m_pFontSubstPage = new RTSFontSubstPage( this );
else if (sPage == "command") else if (sPage == "command")
pPage = m_pCommandPage = new RTSCommandPage( this ); pPage = m_pCommandPage = new RTSCommandPage( this );
if( pPage ) if( pPage )
...@@ -620,144 +613,6 @@ IMPL_LINK( RTSOtherPage, ClickBtnHdl, Button*, pButton ) ...@@ -620,144 +613,6 @@ IMPL_LINK( RTSOtherPage, ClickBtnHdl, Button*, pButton )
return 0; 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 class RTSPWDialog : public ModalDialog
{ {
......
...@@ -40,7 +40,6 @@ namespace padmin { ...@@ -40,7 +40,6 @@ namespace padmin {
class RTSPaperPage; class RTSPaperPage;
class RTSDevicePage; class RTSDevicePage;
class RTSOtherPage; class RTSOtherPage;
class RTSFontSubstPage;
class RTSCommandPage; class RTSCommandPage;
class RTSDialog : public TabDialog class RTSDialog : public TabDialog
...@@ -48,7 +47,6 @@ class RTSDialog : public TabDialog ...@@ -48,7 +47,6 @@ class RTSDialog : public TabDialog
friend class RTSPaperPage; friend class RTSPaperPage;
friend class RTSDevicePage; friend class RTSDevicePage;
friend class RTSOtherPage; friend class RTSOtherPage;
friend class RTSFontSubstPage;
friend class RTSCommandPage; friend class RTSCommandPage;
::psp::PrinterInfo m_aJobData; ::psp::PrinterInfo m_aJobData;
...@@ -63,7 +61,6 @@ class RTSDialog : public TabDialog ...@@ -63,7 +61,6 @@ class RTSDialog : public TabDialog
RTSPaperPage* m_pPaperPage; RTSPaperPage* m_pPaperPage;
RTSDevicePage* m_pDevicePage; RTSDevicePage* m_pDevicePage;
RTSOtherPage* m_pOtherPage; RTSOtherPage* m_pOtherPage;
RTSFontSubstPage* m_pFontSubstPage;
RTSCommandPage* m_pCommandPage; RTSCommandPage* m_pCommandPage;
// some resources // some resources
...@@ -162,31 +159,6 @@ public: ...@@ -162,31 +159,6 @@ public:
void save(); 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 } // namespace
#endif // _PAD_PRTSETUP_HXX #endif // _PAD_PRTSETUP_HXX
......
...@@ -35,17 +35,6 @@ ...@@ -35,17 +35,6 @@
#define RID_RTS_OTHER_COMMENT_EDT 10 #define RID_RTS_OTHER_COMMENT_EDT 10
#define RID_RTS_OTHER_DEFAULT_BTN 11 #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_COMMANDPAGE 4006
#define RID_RTS_CMD_TXT_PRTNAME 1 #define RID_RTS_CMD_TXT_PRTNAME 1
#define RID_RTS_CMD_TXT_CONNECT 2 #define RID_RTS_CMD_TXT_CONNECT 2
......
...@@ -24,82 +24,6 @@ String RID_RTS_RTSDIALOG_INVALID_TXT ...@@ -24,82 +24,6 @@ String RID_RTS_RTSDIALOG_INVALID_TXT
Text [ en-US ] = "<ignore>"; 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 TabPage RID_RTS_COMMANDPAGE
{ {
HelpID = "padmin:TabPage:RID_RTS_COMMANDPAGE"; HelpID = "padmin:TabPage:RID_RTS_COMMANDPAGE";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment