[Libreoffice-commits] core.git: 6 commits - include/vcl padmin/source sfx2/source unusedcode.easy vcl/generic vcl/inc vcl/null vcl/source vcl/unx xmloff/source
Caolán McNamara
caolanm at redhat.com
Thu Mar 20 07:41:10 PDT 2014
include/vcl/jobset.hxx | 7
include/vcl/outdev.hxx | 2
include/vcl/print.hxx | 1
include/vcl/printerinfomanager.hxx | 2
padmin/source/adddlg.cxx | 126 --------------
padmin/source/adddlg.hxx | 25 --
padmin/source/cmddlg.cxx | 77 --------
padmin/source/cmddlg.hxx | 7
padmin/source/padialog.cxx | 9 -
padmin/source/padialog.hrc | 13 -
padmin/source/padialog.hxx | 1
padmin/source/padialog.src | 74 --------
padmin/source/rtsetup.hrc | 3
padmin/source/rtsetup.src | 15 -
sfx2/source/view/viewprn.cxx | 4
unusedcode.easy | 1
vcl/generic/print/genprnpsp.cxx | 219 ++++++++++---------------
vcl/generic/print/genpspgraphics.cxx | 84 ---------
vcl/generic/print/printerjob.cxx | 4
vcl/inc/cupsmgr.hxx | 2
vcl/inc/generic/genprn.h | 3
vcl/inc/generic/genpspgraphics.h | 7
vcl/inc/salgdi.hxx | 34 ---
vcl/null/printerinfomanager.cxx | 2
vcl/source/gdi/jobset.cxx | 8
vcl/source/gdi/outdev3.cxx | 36 ----
vcl/source/gdi/salgdilayout.cxx | 5
vcl/unx/generic/printer/cupsmgr.cxx | 23 +-
vcl/unx/generic/printer/printerinfomanager.cxx | 2
xmloff/source/draw/ximpcustomshape.cxx | 43 ++++
30 files changed, 179 insertions(+), 660 deletions(-)
New commits:
commit 7583df0a18585fafbb9124fcefdbc204544df78c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 20 13:19:38 2014 +0000
remove 'add a fax printer' from padmin
Support for passing the phone number through to fax4CUPS is now implemented so
that's now the recommended route for adding fax printers.
Change-Id: I3cc9d4f4295610b322cd738343bd9bbfadeb431e
diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx
index 8374c19..2368a73 100644
--- a/padmin/source/adddlg.cxx
+++ b/padmin/source/adddlg.cxx
@@ -49,18 +49,15 @@ APTabPage::APTabPage( AddPrinterDialog* pParent, const ResId& rResId )
APChooseDevicePage::APChooseDevicePage( AddPrinterDialog* pParent ) :
APTabPage( pParent, PaResId( RID_ADDP_PAGE_CHOOSEDEV ) ),
m_aPrinterBtn( this, PaResId( RID_ADDP_CHDEV_BTN_PRINTER ) ),
- m_aFaxBtn( this, PaResId( RID_ADDP_CHDEV_BTN_FAX ) ),
m_aPDFBtn( this, PaResId( RID_ADDP_CHDEV_BTN_PDF ) ),
m_aOverTxt( this, PaResId( RID_ADDP_CHDEV_TXT_OVER ) )
{
FreeResource();
m_aPrinterBtn.Check( true );
- m_aFaxBtn.Check( false );
m_aPDFBtn.Check( false );
if( ! PrinterInfoManager::get().addOrRemovePossible() )
{
m_aPrinterBtn.Check( false );
- m_aFaxBtn.Check( true );
m_aPrinterBtn.Enable( false );
}
}
@@ -80,16 +77,10 @@ void APChooseDevicePage::fill( PrinterInfo& rInfo )
{
rInfo.m_aFeatures = "pdf=";
}
- else if( m_aFaxBtn.IsChecked() )
- {
- rInfo.m_aFeatures = "fax";
- }
else
rInfo.m_aFeatures = "";
}
-
-
APChooseDriverPage::APChooseDriverPage( AddPrinterDialog* pParent )
: APTabPage( pParent, PaResId( RID_ADDP_PAGE_CHOOSEDRIVER ) ),
m_aDriverTxt( this, PaResId( RID_ADDP_CHDRV_TXT_DRIVER ) ),
@@ -306,31 +297,25 @@ APNamePage::APNamePage( AddPrinterDialog* pParent, const OUString& rInitName, De
m_aNameTxt(
this,
PaResId(
- eKind == DeviceKind::Printer ? RID_ADDP_NAME_TXT_NAME :
- eKind == DeviceKind::Fax ? RID_ADDP_NAME_TXT_FAXNAME : RID_ADDP_NAME_TXT_PDFNAME
+ eKind == DeviceKind::Printer ? RID_ADDP_NAME_TXT_NAME : RID_ADDP_NAME_TXT_PDFNAME
)
),
m_aNameEdt(
this,
PaResId(
- eKind == DeviceKind::Printer ? RID_ADDP_NAME_EDT_NAME :
- eKind == DeviceKind::Fax ? RID_ADDP_NAME_EDT_FAXNAME : RID_ADDP_NAME_EDT_PDFNAME
+ eKind == DeviceKind::Printer ? RID_ADDP_NAME_EDT_NAME : RID_ADDP_NAME_EDT_PDFNAME
)
),
- m_aDefaultBox( this, PaResId( RID_ADDP_NAME_BOX_DEFAULT ) ),
- m_aFaxSwallowBox( this, PaResId( RID_ADDP_NAME_BOX_FAXSWALLOW ) )
+ m_aDefaultBox( this, PaResId( RID_ADDP_NAME_BOX_DEFAULT ) )
{
FreeResource();
if( eKind != DeviceKind::Printer )
m_aDefaultBox.Show( false );
else
m_aNameEdt.SetText( rInitName );
- if( eKind != DeviceKind::Fax )
- m_aFaxSwallowBox.Show( false );
m_aNameEdt.SetText( AddPrinterDialog::uniquePrinterName( m_aNameEdt.GetText() ) );
m_aDefaultBox.Check( false );
- m_aFaxSwallowBox.Check( false );
}
APNamePage::~APNamePage()
@@ -354,7 +339,7 @@ APCommandPage::APCommandPage( AddPrinterDialog* pParent, DeviceKind::type eKind
m_aCommandTxt( this, PaResId( RID_ADDP_CMD_TXT_COMMAND ) ),
m_aCommandBox( this, PaResId( eKind == DeviceKind::Pdf ? RID_ADDP_CMD_BOX_PDFCOMMAND : RID_ADDP_CMD_BOX_COMMAND ) ),
m_aHelpBtn( this, PaResId( RID_ADDP_CMD_BTN_HELP ) ),
- m_aHelpTxt( PaResId( eKind == DeviceKind::Fax ? RID_ADDP_CMD_STR_FAXHELP : RID_ADDP_CMD_STR_PDFHELP ) ),
+ m_aHelpTxt( PaResId( RID_ADDP_CMD_STR_PDFHELP ) ),
m_aPdfDirTxt( this, PaResId( RID_ADDP_CMD_TXT_PDFDIR ) ),
m_aPdfDirEdt( this, PaResId( RID_ADDP_CMD_EDT_PDFDIR ) ),
m_aPdfDirBtn( this, PaResId( RID_ADDP_CMD_BTN_PDFDIR ) ),
@@ -378,7 +363,6 @@ APCommandPage::APCommandPage( AddPrinterDialog* pParent, DeviceKind::type eKind
switch( m_eKind )
{
case DeviceKind::Printer: CommandStore::getPrintCommands( aCommands );break;
- case DeviceKind::Fax: CommandStore::getFaxCommands( aCommands );break;
case DeviceKind::Pdf: CommandStore::getPdfCommands( aCommands );break;
}
// adjust height of command text and help button
@@ -423,7 +407,6 @@ APCommandPage::~APCommandPage()
switch( m_eKind )
{
case DeviceKind::Printer: CommandStore::setPrintCommands( aCommands );break;
- case DeviceKind::Fax: CommandStore::setFaxCommands( aCommands );break;
case DeviceKind::Pdf: CommandStore::setPdfCommands( aCommands );break;
}
}
@@ -463,38 +446,6 @@ void APCommandPage::fill( PrinterInfo& rInfo )
rInfo.m_aCommand = m_aCommandBox.GetText();
}
-APFaxDriverPage::APFaxDriverPage( AddPrinterDialog* pParent )
- : APTabPage( pParent, PaResId( RID_ADDP_PAGE_FAXDRIVER ) ),
- m_aFaxTxt( this, PaResId( RID_ADDP_FAXDRV_TXT_DRIVER ) ),
- m_aDefBtn( this, PaResId( RID_ADDP_FAXDRV_BTN_DEFAULT ) ),
- m_aSelectBtn( this, PaResId( RID_ADDP_FAXDRV_BTN_SELECT ) )
-{
- FreeResource();
-
- m_aDefBtn.Check( true );
- m_aSelectBtn.Check( false );
- m_aSelectBtn.SetStyle( m_aSelectBtn.GetStyle() | WB_WORDBREAK );
-}
-
-APFaxDriverPage::~APFaxDriverPage()
-{
-}
-
-bool APFaxDriverPage::check()
-{
- return true;
-}
-
-void APFaxDriverPage::fill( PrinterInfo& rInfo )
-{
- if( isDefault() )
- {
- rInfo.m_aDriverName = "SGENPRT";
- }
-}
-
-
-
APPdfDriverPage::APPdfDriverPage( AddPrinterDialog* pParent )
: APTabPage( pParent, PaResId( RID_ADDP_PAGE_PDFDRIVER ) ),
m_aPdfTxt( this, PaResId( RID_ADDP_PDFDRV_TXT_DRIVER ) ),
@@ -542,10 +493,6 @@ AddPrinterDialog::AddPrinterDialog( Window* pParent )
m_pCommandPage( NULL ),
m_pChooseDriverPage( NULL ),
m_pNamePage( NULL ),
- m_pFaxDriverPage( NULL ),
- m_pFaxSelectDriverPage( NULL ),
- m_pFaxNamePage( NULL ),
- m_pFaxCommandPage( NULL ),
m_pPdfDriverPage( NULL ),
m_pPdfSelectDriverPage( NULL ),
m_pPdfNamePage( NULL ),
@@ -573,10 +520,6 @@ AddPrinterDialog::~AddPrinterDialog()
delete m_pChooseDriverPage;
delete m_pNamePage;
delete m_pCommandPage;
- delete m_pFaxDriverPage;
- delete m_pFaxSelectDriverPage;
- delete m_pFaxCommandPage;
- delete m_pFaxNamePage;
delete m_pPdfDriverPage;
delete m_pPdfSelectDriverPage;
delete m_pPdfNamePage;
@@ -610,13 +553,6 @@ void AddPrinterDialog::advance()
m_pCurrentPage = m_pChooseDriverPage;
m_aPrevPB.Enable( true );
}
- else if( m_pChooseDevicePage->isFax() )
- {
- if( ! m_pFaxDriverPage )
- m_pFaxDriverPage = new APFaxDriverPage( this );
- m_pCurrentPage = m_pFaxDriverPage;
- m_aPrevPB.Enable( true );
- }
else if( m_pChooseDevicePage->isPDF() )
{
if( ! m_pPdfDriverPage )
@@ -641,35 +577,6 @@ void AddPrinterDialog::advance()
m_aFinishPB.Enable( true );
m_aNextPB.Enable( false );
}
- else if( m_pCurrentPage == m_pFaxDriverPage )
- {
- if( ! m_pFaxDriverPage->isDefault() )
- {
- if( ! m_pFaxSelectDriverPage )
- m_pFaxSelectDriverPage = new APChooseDriverPage( this );
- m_pCurrentPage = m_pFaxSelectDriverPage;
- }
- else
- {
- if( ! m_pFaxCommandPage )
- m_pFaxCommandPage = new APCommandPage( this, DeviceKind::Fax );
- m_pCurrentPage = m_pFaxCommandPage;
- }
- }
- else if( m_pCurrentPage == m_pFaxSelectDriverPage )
- {
- if( ! m_pFaxCommandPage )
- m_pFaxCommandPage = new APCommandPage( this, DeviceKind::Fax );
- m_pCurrentPage = m_pFaxCommandPage;
- }
- else if( m_pCurrentPage == m_pFaxCommandPage )
- {
- if( ! m_pFaxNamePage )
- m_pFaxNamePage = new APNamePage( this, OUString(), DeviceKind::Fax );
- m_pCurrentPage = m_pFaxNamePage;
- m_aNextPB.Enable( false );
- m_aFinishPB.Enable( true );
- }
else if( m_pCurrentPage == m_pPdfDriverPage )
{
if( ! m_pPdfDriverPage->isDefault() && ! m_pPdfDriverPage->isDist() )
@@ -721,25 +628,6 @@ void AddPrinterDialog::back()
{
m_pCurrentPage = m_pChooseDriverPage;
}
- else if( m_pCurrentPage == m_pFaxDriverPage )
- {
- m_pCurrentPage = m_pChooseDevicePage;
- m_aPrevPB.Enable( false );
- }
- else if( m_pCurrentPage == m_pFaxSelectDriverPage )
- {
- m_pCurrentPage = m_pFaxDriverPage;
- }
- else if( m_pCurrentPage == m_pFaxNamePage )
- {
- m_pCurrentPage = m_pFaxCommandPage;
- m_aNextPB.Enable( true );
- }
- else if( m_pCurrentPage == m_pFaxCommandPage )
- {
- m_pCurrentPage = m_pFaxDriverPage->isDefault() ? (APTabPage*)m_pFaxDriverPage : (APTabPage*)m_pFaxSelectDriverPage;
- m_aNextPB.Enable( true );
- }
else if( m_pCurrentPage == m_pPdfDriverPage )
{
m_pCurrentPage = m_pChooseDevicePage;
@@ -776,12 +664,6 @@ void AddPrinterDialog::addPrinter()
if( m_pNamePage->isDefault() )
rManager.setDefaultPrinter( m_aPrinter.m_aPrinterName );
}
- else if( m_pChooseDevicePage->isFax() )
- {
- aInfo.m_aFeatures = "fax=";
- if( m_pFaxNamePage->isFaxSwallow() )
- aInfo.m_aFeatures += "swallow";
- }
else if( m_pChooseDevicePage->isPDF() )
{
OUString aPdf( "pdf=" );
diff --git a/padmin/source/adddlg.hxx b/padmin/source/adddlg.hxx
index a8f3c1d..486b19d 100644
--- a/padmin/source/adddlg.hxx
+++ b/padmin/source/adddlg.hxx
@@ -35,7 +35,7 @@ namespace padmin
class AddPrinterDialog;
-namespace DeviceKind { enum type { Printer, Fax, Pdf }; }
+namespace DeviceKind { enum type { Printer, Pdf }; }
class APTabPage : public TabPage
{
@@ -54,7 +54,6 @@ public:
class APChooseDevicePage : public APTabPage
{
RadioButton m_aPrinterBtn;
- RadioButton m_aFaxBtn;
RadioButton m_aPDFBtn;
FixedText m_aOverTxt;
public:
@@ -62,7 +61,6 @@ public:
~APChooseDevicePage();
bool isPrinter() { return m_aPrinterBtn.IsChecked(); }
- bool isFax() { return m_aFaxBtn.IsChecked(); }
bool isPDF() { return m_aPDFBtn.IsChecked(); }
virtual bool check();
@@ -96,13 +94,11 @@ class APNamePage : public APTabPage
FixedText m_aNameTxt;
Edit m_aNameEdt;
CheckBox m_aDefaultBox;
- CheckBox m_aFaxSwallowBox;
public:
APNamePage( AddPrinterDialog* pParent, const OUString& rInitName, DeviceKind::type eKind );
~APNamePage();
bool isDefault() { return m_aDefaultBox.IsChecked(); }
- bool isFaxSwallow() { return m_aFaxSwallowBox.IsChecked(); }
void setText( const OUString& rText ) { m_aNameEdt.SetText( rText ); }
@@ -154,21 +150,6 @@ public:
void addOldPrinters();
};
-class APFaxDriverPage : public APTabPage
-{
- FixedText m_aFaxTxt;
- RadioButton m_aDefBtn;
- RadioButton m_aSelectBtn;
-public:
- APFaxDriverPage( AddPrinterDialog* pParent );
- ~APFaxDriverPage();
-
- virtual bool check();
- virtual void fill( ::psp::PrinterInfo& rInfo );
-
- bool isDefault() { return m_aDefBtn.IsChecked(); }
-};
-
class APPdfDriverPage : public APTabPage
{
FixedText m_aPdfTxt;
@@ -203,10 +184,6 @@ class AddPrinterDialog : public ModalDialog
APCommandPage* m_pCommandPage;
APChooseDriverPage* m_pChooseDriverPage;
APNamePage* m_pNamePage;
- APFaxDriverPage* m_pFaxDriverPage;
- APChooseDriverPage* m_pFaxSelectDriverPage;
- APNamePage* m_pFaxNamePage;
- APCommandPage* m_pFaxCommandPage;
APPdfDriverPage* m_pPdfDriverPage;
APChooseDriverPage* m_pPdfSelectDriverPage;
APNamePage* m_pPdfNamePage;
diff --git a/padmin/source/cmddlg.cxx b/padmin/source/cmddlg.cxx
index 1190b09..8a4d72e 100644
--- a/padmin/source/cmddlg.cxx
+++ b/padmin/source/cmddlg.cxx
@@ -31,7 +31,6 @@ using namespace psp;
using namespace padmin;
#define PRINTER_PERSISTENCE_GROUP "KnownPrinterCommands"
-#define FAX_PERSISTENCE_GROUP "KnownFaxCommands"
#define PDF_PERSISTENCE_GROUP "KnowPdfCommands"
#define MAX_COMMANDS 50
@@ -184,12 +183,6 @@ void CommandStore::getPdfCommands( ::std::list< OUString >& rCommands )
getStoredCommands( PDF_PERSISTENCE_GROUP, rCommands );
}
-void CommandStore::getFaxCommands( ::std::list< OUString >& rCommands )
-{
- rCommands.clear();
- getStoredCommands( FAX_PERSISTENCE_GROUP, rCommands );
-}
-
void CommandStore::setPrintCommands( const ::std::list< OUString >& rCommands )
{
::std::list< OUString > aSysCmds;
@@ -204,13 +197,6 @@ void CommandStore::setPdfCommands( const ::std::list< OUString >& rCommands )
setCommands( PDF_PERSISTENCE_GROUP, rCommands, aSysCmds );
}
-void CommandStore::setFaxCommands( const ::std::list< OUString >& rCommands )
-{
- ::std::list< OUString > aSysCmds;
- setCommands( FAX_PERSISTENCE_GROUP, rCommands, aSysCmds );
-}
-
-
RTSCommandPage::RTSCommandPage( RTSDialog* pParent ) :
TabPage( pParent->m_pTabControl, PaResId( RID_RTS_COMMANDPAGE ) ),
m_pParent( pParent ),
@@ -227,10 +213,8 @@ RTSCommandPage::RTSCommandPage( RTSDialog* pParent ) :
m_aPdfDirectoryText( this, PaResId( RID_RTS_CMD_TXT_PDFDIR ) ),
m_aPdfDirectoryButton( this, PaResId( RID_RTS_CMD_BTN_PDFDIR ) ),
m_aPdfDirectoryEdit( this, PaResId( RID_RTS_CMD_EDT_PDFDIR ) ),
- m_aFaxSwallowBox( this, PaResId( RID_RTS_CMD_BOX_SWALLOWFAXNO ) ),
m_aHelpButton( this, PaResId( RID_RTS_CMD_BTN_HELP ) ),
m_aRemovePB( this, PaResId( RID_RTS_CMD_BTN_REMOVE ) ),
- m_aFaxHelp( PaResId( RID_RTS_CMD_STR_FAXHELP ) ),
m_aPrinterHelp( PaResId( RID_RTS_CMD_STR_PRINTERHELP ) ),
m_aPdfHelp( PaResId( RID_RTS_CMD_STR_PDFHELP ) ),
m_bWasExternalDialog(false)
@@ -241,13 +225,11 @@ RTSCommandPage::RTSCommandPage( RTSDialog* pParent ) :
m_nPrinterEntry = m_aConfigureBox.InsertEntry( OUString( PaResId( RID_RTS_CMD_STR_CONFIGURE_PRINTER ) ) );
else
m_nPrinterEntry = ~0;
- m_nFaxEntry = m_aConfigureBox.InsertEntry( OUString( PaResId( RID_RTS_CMD_STR_CONFIGURE_FAX ) ) );
m_nPdfEntry = m_aConfigureBox.InsertEntry( OUString( PaResId( RID_RTS_CMD_STR_CONFIGURE_PDF ) ) );
FreeResource();
CommandStore::getPrintCommands( m_aPrinterCommands );
- CommandStore::getFaxCommands( m_aFaxCommands );
CommandStore::getPdfCommands( m_aPdfCommands );
m_aPrinterName.SetText( m_pParent->m_aPrinter );
@@ -264,26 +246,16 @@ RTSCommandPage::RTSCommandPage( RTSDialog* pParent ) :
m_aPdfDirectoryButton.Show( false );
m_aPdfDirectoryEdit.Show( false );
m_aPdfDirectoryText.Show( false );
- m_aFaxSwallowBox.Show( false );
m_aCommandsCB.SetText( m_pParent->m_aJobData.m_aCommand );
m_aQuickCB.SetText( m_pParent->m_aJobData.m_aQuickCommand );
- m_bWasFax = false;
m_bWasPdf = false;
m_aConfigureBox.SelectEntryPos( m_nPrinterEntry );
sal_Int32 nIndex = 0;
while( nIndex != -1 )
{
OUString aToken( m_pParent->m_aJobData.m_aFeatures.getToken( 0, ',', nIndex ) );
- if( aToken.startsWith( "fax" ) )
- {
- m_bWasFax = true;
- m_aFaxSwallowBox.Show( true );
- sal_Int32 nPos = 0;
- m_aFaxSwallowBox.Check( aToken.getToken( 1, '=', nPos ).startsWith( "swallow" ) ? sal_True : sal_False );
- m_aConfigureBox.SelectEntryPos( m_nFaxEntry );
- }
- else if( aToken.startsWith( "pdf=" ) )
+ if( aToken.startsWith( "pdf=" ) )
{
m_bWasPdf = true;
sal_Int32 nPos = 0;
@@ -316,22 +288,18 @@ RTSCommandPage::~RTSCommandPage()
void RTSCommandPage::save()
{
OUString aCommand,aQuickCommand;
- bool bHaveFax = m_aConfigureBox.GetSelectEntryPos() == m_nFaxEntry ? true : false;
bool bHavePdf = m_aConfigureBox.GetSelectEntryPos() == m_nPdfEntry ? true : false;
::std::list< OUString >::iterator it;
OUString aFeatures;
sal_Int32 nIndex = 0;
OUString aOldPdfPath;
- bool bOldFaxSwallow = false;
- bool bFaxSwallow = m_aFaxSwallowBox.IsChecked() ? true : false;
bool bExternalDialog = m_aExternalCB.IsChecked() ? true : false;
while( nIndex != -1 )
{
OUString aToken( m_pParent->m_aJobData.m_aFeatures.getToken( 0, ',', nIndex ) );
- if( !aToken.startsWith( "fax" ) &&
- !aToken.startsWith( "pdf" ) &&
+ if( !aToken.startsWith( "pdf" ) &&
aToken.compareToAscii( "external_dialog" )
)
{
@@ -347,11 +315,6 @@ void RTSCommandPage::save()
sal_Int32 nPos = 0;
aOldPdfPath = aToken.getToken( 1, '=', nPos );
}
- else if( aToken.startsWith( "fax=" ) )
- {
- sal_Int32 nPos = 0;
- bOldFaxSwallow = aToken.getToken( 1, '=', nPos ).startsWith( "swallow" );
- }
}
::std::list< OUString >* pList = &m_aPrinterCommands;
if( bExternalDialog )
@@ -360,15 +323,6 @@ void RTSCommandPage::save()
aFeatures += ",";
aFeatures += "external_dialog" ;
}
- if( bHaveFax )
- {
- if( !aFeatures.isEmpty() )
- aFeatures += ",";
- aFeatures += "fax=" ;
- if( bFaxSwallow )
- aFeatures += "swallow" ;
- pList = &m_aFaxCommands;
- }
if( bHavePdf )
{
if( !aFeatures.isEmpty() )
@@ -386,12 +340,9 @@ void RTSCommandPage::save()
if( aCommand != m_pParent->m_aJobData.m_aCommand ||
aQuickCommand != m_pParent->m_aJobData.m_aQuickCommand ||
- ( m_bWasFax && ! bHaveFax ) ||
- ( ! m_bWasFax && bHaveFax ) ||
( m_bWasPdf && ! bHavePdf ) ||
( ! m_bWasPdf && bHavePdf ) ||
( bHavePdf && aOldPdfPath != m_aPdfDirectoryEdit.GetText() ) ||
- ( bHaveFax && bFaxSwallow != bOldFaxSwallow ) ||
( m_bWasExternalDialog && ! bExternalDialog ) ||
( ! m_bWasExternalDialog && bExternalDialog )
)
@@ -403,7 +354,6 @@ void RTSCommandPage::save()
PrinterInfoManager::get().changePrinterInfo( m_pParent->m_aPrinter, m_pParent->m_aJobData );
}
CommandStore::setPrintCommands( m_aPrinterCommands );
- CommandStore::setFaxCommands( m_aFaxCommands );
CommandStore::setPdfCommands( m_aPdfCommands );
}
@@ -416,8 +366,6 @@ IMPL_LINK( RTSCommandPage, SelectHdl, Control*, pBox )
m_aPdfDirectoryButton.Show( bEnable );
m_aPdfDirectoryEdit.Show( bEnable );
m_aPdfDirectoryText.Show( bEnable );
- bEnable = m_aConfigureBox.GetSelectEntryPos() == m_nFaxEntry ? sal_True : sal_False;
- m_aFaxSwallowBox.Show( bEnable );
UpdateCommands();
}
else if( pBox == &m_aCommandsCB )
@@ -442,8 +390,6 @@ IMPL_LINK( RTSCommandPage, ClickBtnHdl, Button*, pButton )
::std::list< OUString >* pList;
if( m_aConfigureBox.GetSelectEntryPos() == m_nPrinterEntry )
pList = &m_aPrinterCommands;
- else if( m_aConfigureBox.GetSelectEntryPos() == m_nFaxEntry )
- pList = &m_aFaxCommands;
else
pList = &m_aPdfCommands;
@@ -456,8 +402,6 @@ IMPL_LINK( RTSCommandPage, ClickBtnHdl, Button*, pButton )
OUString aHelpText;
if( m_aConfigureBox.GetSelectEntryPos() == m_nPrinterEntry )
aHelpText = m_aPrinterHelp;
- else if( m_aConfigureBox.GetSelectEntryPos() == m_nFaxEntry )
- aHelpText = m_aFaxHelp;
else if( m_aConfigureBox.GetSelectEntryPos() == m_nPdfEntry )
aHelpText = m_aPdfHelp;
@@ -497,22 +441,7 @@ void RTSCommandPage::UpdateCommands()
m_aCommandsCB.InsertEntry( *it );
m_aQuickCB.InsertEntry( *it );
}
- if( ! m_bWasFax )
- m_aCommandsCB.SetText( m_pParent->m_aJobData.m_aCommand );
- else
- m_aCommandsCB.SetText( OUString() );
- }
- else if( m_aConfigureBox.GetSelectEntryPos() == m_nFaxEntry )
- {
- for( it = m_aFaxCommands.begin(); it != m_aFaxCommands.end(); ++it )
- {
- m_aCommandsCB.InsertEntry( *it );
- m_aQuickCB.InsertEntry( *it );
- }
- if( m_bWasFax )
- m_aCommandsCB.SetText( m_pParent->m_aJobData.m_aCommand );
- else
- m_aCommandsCB.SetText( OUString() );
+ m_aCommandsCB.SetText( m_pParent->m_aJobData.m_aCommand );
}
else if( m_aConfigureBox.GetSelectEntryPos() == m_nPdfEntry )
{
diff --git a/padmin/source/cmddlg.hxx b/padmin/source/cmddlg.hxx
index 5db1b46..1fdb0aa 100644
--- a/padmin/source/cmddlg.hxx
+++ b/padmin/source/cmddlg.hxx
@@ -44,11 +44,9 @@ class CommandStore
public:
static void getPrintCommands( ::std::list< OUString >& rCommands );
- static void getFaxCommands( ::std::list< OUString >& rCommands );
static void getPdfCommands( ::std::list< OUString >& rCommands );
static void setPrintCommands( const ::std::list< OUString >& rCommands );
- static void setFaxCommands( const ::std::list< OUString >& rCommands );
static void setPdfCommands( const ::std::list< OUString >& rCommands );
};
@@ -69,25 +67,20 @@ private:
FixedText m_aConfigureText;
ListBox m_aConfigureBox;
sal_uInt16 m_nPrinterEntry;
- sal_uInt16 m_nFaxEntry;
sal_uInt16 m_nPdfEntry;
FixedText m_aPdfDirectoryText;
PushButton m_aPdfDirectoryButton;
Edit m_aPdfDirectoryEdit;
- CheckBox m_aFaxSwallowBox;
PushButton m_aHelpButton;
PushButton m_aRemovePB;
::std::list< OUString > m_aPrinterCommands;
- ::std::list< OUString > m_aFaxCommands;
::std::list< OUString > m_aPdfCommands;
- OUString m_aFaxHelp;
OUString m_aPrinterHelp;
OUString m_aPdfHelp;
- bool m_bWasFax;
bool m_bWasPdf;
bool m_bWasExternalDialog;
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index 286adda..9e8eff3 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -101,7 +101,6 @@ PADialog::PADialog( Window* pParent, sal_Bool /*bAdmin*/ ) :
void PADialog::updateSettings()
{
m_aPrinterImg = Image( BitmapEx( PaResId( RID_BMP_SMALL_PRINTER ) ) );
- m_aFaxImg = Image( BitmapEx( PaResId( RID_BMP_SMALL_FAX ) ) );
m_aPdfImg = Image( BitmapEx( PaResId( RID_BMP_SMALL_PDF ) ) );
}
@@ -688,7 +687,6 @@ void PADialog::UpdateDevice()
const PrinterInfo& rInfo( m_rPIManager.getPrinterInfo( *it ) );
sal_Int32 nIndex = 0;
bool bAutoQueue = false;
- bool bFax = false;
bool bPdf = false;
while( nIndex != -1 && ! bAutoQueue )
{
@@ -699,8 +697,6 @@ void PADialog::UpdateDevice()
bAutoQueue = true;
else if( aToken.startsWith("pdf=") )
bPdf = true;
- else if( aToken.startsWith("fax") )
- bFax = true;
}
}
if( bAutoQueue )
@@ -713,9 +709,7 @@ void PADialog::UpdateDevice()
}
int nPos =
m_aDevicesLB.InsertEntry( aEntry,
- bFax ? m_aFaxImg :
- bPdf ? m_aPdfImg : m_aPrinterImg
- );
+ bPdf ? m_aPdfImg : m_aPrinterImg );
m_aDevicesLB.SetEntryData( nPos, (void*)(sal_IntPtr)it->getLength() );
if( *it == m_rPIManager.getDefaultPrinter() )
{
diff --git a/padmin/source/padialog.hrc b/padmin/source/padialog.hrc
index f438d05..b9b095e 100644
--- a/padmin/source/padialog.hrc
+++ b/padmin/source/padialog.hrc
@@ -87,7 +87,6 @@
#define RID_TXT_TESTPAGE_NAME 1077
#define RID_BMP_SMALL_PRINTER 1096
-#define RID_BMP_SMALL_FAX 1098
#define RID_BMP_SMALL_PDF 1100
#define RID_BMP_PRINTER 1102
@@ -110,8 +109,7 @@
#define RID_ADDP_PAGE_CHOOSEDEV 2001
#define RID_ADDP_CHDEV_TXT_OVER 1
#define RID_ADDP_CHDEV_BTN_PRINTER 2
-#define RID_ADDP_CHDEV_BTN_FAX 3
-#define RID_ADDP_CHDEV_BTN_PDF 4
+#define RID_ADDP_CHDEV_BTN_PDF 3
#define RID_ADDP_PAGE_CHOOSEDRIVER 2002
#define RID_ADDP_CHDRV_TXT_DRIVER 1
@@ -122,30 +120,21 @@
#define RID_ADDP_PAGE_NAME 2003
#define RID_ADDP_NAME_TXT_NAME 1
-#define RID_ADDP_NAME_TXT_FAXNAME 2
#define RID_ADDP_NAME_TXT_PDFNAME 3
#define RID_ADDP_NAME_EDT_NAME 4
-#define RID_ADDP_NAME_EDT_FAXNAME 5
#define RID_ADDP_NAME_EDT_PDFNAME 6
#define RID_ADDP_NAME_BOX_DEFAULT 7
-#define RID_ADDP_NAME_BOX_FAXSWALLOW 8
#define RID_ADDP_PAGE_COMMAND 2004
#define RID_ADDP_CMD_TXT_COMMAND 1
#define RID_ADDP_CMD_BOX_COMMAND 2
#define RID_ADDP_CMD_BTN_HELP 3
-#define RID_ADDP_CMD_STR_FAXHELP 4
#define RID_ADDP_CMD_STR_PDFHELP 5
#define RID_ADDP_CMD_TXT_PDFDIR 6
#define RID_ADDP_CMD_EDT_PDFDIR 7
#define RID_ADDP_CMD_BTN_PDFDIR 8
#define RID_ADDP_CMD_BOX_PDFCOMMAND 9
-#define RID_ADDP_PAGE_FAXDRIVER 2006
-#define RID_ADDP_FAXDRV_TXT_DRIVER 1
-#define RID_ADDP_FAXDRV_BTN_DEFAULT 2
-#define RID_ADDP_FAXDRV_BTN_SELECT 3
-
#define RID_ADDP_PAGE_PDFDRIVER 2007
#define RID_ADDP_PDFDRV_TXT_DRIVER 1
#define RID_ADDP_PDFDRV_BTN_DEFAULT 2
diff --git a/padmin/source/padialog.hxx b/padmin/source/padialog.hxx
index 6dd6834..e7620c2 100644
--- a/padmin/source/padialog.hxx
+++ b/padmin/source/padialog.hxx
@@ -67,7 +67,6 @@ namespace padmin {
::std::list< OUString > m_aPrinters;
Image m_aPrinterImg;
- Image m_aFaxImg;
Image m_aPdfImg;
DECL_LINK( ClickBtnHdl, PushButton* );
diff --git a/padmin/source/padialog.src b/padmin/source/padialog.src
index 3bfffa7..ad16e52 100644
--- a/padmin/source/padialog.src
+++ b/padmin/source/padialog.src
@@ -244,11 +244,6 @@ Bitmap RID_BMP_SMALL_PRINTER
File = "source/print.png";
};
-Bitmap RID_BMP_SMALL_FAX
-{
- File = "source/fax.png";
-};
-
Bitmap RID_BMP_SMALL_PDF
{
File = "source/pdf.png";
@@ -516,7 +511,7 @@ TabPage RID_ADDP_PAGE_CHOOSEDEV
HelpID = "padmin:TabPage:RID_ADDP_PAGE_CHOOSEDEV";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
- Size = MAP_APPFONT( 240, 120 );
+ Size = MAP_APPFONT( 240, 110 );
String RID_ADDP_STR_TITLE
{
Text [ en-US ] = "Choose a device type";
@@ -534,17 +529,10 @@ TabPage RID_ADDP_PAGE_CHOOSEDEV
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Add a ~printer";
};
- RadioButton RID_ADDP_CHDEV_BTN_FAX
- {
- HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_FAX";
- Pos = MAP_APPFONT ( 40, 50 );
- Size = MAP_APPFONT( 180, 10 );
- Text [ en-US ] = "Connect a fa~x device";
- };
RadioButton RID_ADDP_CHDEV_BTN_PDF
{
HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_PDF";
- Pos = MAP_APPFONT ( 40, 60 );
+ Pos = MAP_APPFONT ( 40, 50 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Connect a P~DF converter";
};
@@ -566,12 +554,6 @@ TabPage RID_ADDP_PAGE_NAME
Size = MAP_APPFONT( 220, 8 );
Text [ en-US ] = "Please enter a name for the printer.";
};
- FixedText RID_ADDP_NAME_TXT_FAXNAME
- {
- Pos = MAP_APPFONT( 40, 25 );
- Size = MAP_APPFONT( 220, 8 );
- Text [ en-US ] = "Please enter a name for the fax connection.";
- };
FixedText RID_ADDP_NAME_TXT_PDFNAME
{
Pos = MAP_APPFONT( 40, 25 );
@@ -585,14 +567,6 @@ TabPage RID_ADDP_PAGE_NAME
Size = MAP_APPFONT( 160, 12 );
Border = TRUE;
};
- Edit RID_ADDP_NAME_EDT_FAXNAME
- {
- HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_FAXNAME";
- Pos = MAP_APPFONT( 40, 35 );
- Size = MAP_APPFONT( 160, 12 );
- Border = TRUE;
- Text [ en-US ] = "Fax printer";
- };
Edit RID_ADDP_NAME_EDT_PDFNAME
{
HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_PDFNAME";
@@ -608,13 +582,6 @@ TabPage RID_ADDP_PAGE_NAME
Size = MAP_APPFONT( 160, 12 );
Text [ en-US ] = "~Use as default printer";
};
- CheckBox RID_ADDP_NAME_BOX_FAXSWALLOW
- {
- HelpID = "padmin:CheckBox:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_BOX_FAXSWALLOW";
- Pos = MAP_APPFONT( 40, 50 );
- Size = MAP_APPFONT( 160, 12 );
- Text [ en-US ] = "Remo~ve fax number from output";
- };
};
TabPage RID_ADDP_PAGE_COMMAND
@@ -679,43 +646,6 @@ TabPage RID_ADDP_PAGE_COMMAND
{
Text [ en-US ] = "The command line for PDF converters is executed as follows: for each document printed, \"(TMP)\" in the command line is replaced by a temporary file and \"(OUTFILE)\" in the command line is replaced by the target PDF file name. If \"(TMP)\" is in the command line, the PostScript code will be supplied via a file, otherwise via standard input (i.e. as a pipe).";
};
- String RID_ADDP_CMD_STR_FAXHELP
- {
- Text [ en-US ] = "The command line for fax connections is executed as follows: for each fax sent, \"(TMP)\" in the command line is replaced by a temporary file and \"(PHONE)\" in the command line is replaced by the fax number. If \"(TMP)\" appears in the command line, the PostScript code will be supplied via a file, otherwise it is passed as standard input (i.e. as a pipe).";
- };
-};
-
-TabPage RID_ADDP_PAGE_FAXDRIVER
-{
- HelpID = "padmin:TabPage:RID_ADDP_PAGE_FAXDRIVER";
- Hide = TRUE;
- Pos = MAP_APPFONT( 0, 30 );
- Size = MAP_APPFONT( 240, 120 );
- String RID_ADDP_STR_TITLE
- {
- Text [ en-US ] = "Choose a driver";
- };
- FixedText RID_ADDP_FAXDRV_TXT_DRIVER
- {
- Pos = MAP_APPFONT( 40, 20 );
- Size = MAP_APPFONT( 160, 19 );
- WordBreak = TRUE;
- Text [ en-US ] = "Use the following driver for this fax connection";
- };
- RadioButton RID_ADDP_FAXDRV_BTN_DEFAULT
- {
- HelpID = "padmin:RadioButton:RID_ADDP_PAGE_FAXDRIVER:RID_ADDP_FAXDRV_BTN_DEFAULT";
- Pos = MAP_APPFONT( 40,40 );
- Size = MAP_APPFONT( 160, 10 );
- Text [ en-US ] = "T~he default driver";
- };
- RadioButton RID_ADDP_FAXDRV_BTN_SELECT
- {
- HelpID = "padmin:RadioButton:RID_ADDP_PAGE_FAXDRIVER:RID_ADDP_FAXDRV_BTN_SELECT";
- Pos = MAP_APPFONT( 40, 50 );
- Size = MAP_APPFONT( 160,24 );
- Text [ en-US ] = "A speci~fic driver, to adapt the format to another printer";
- };
};
TabPage RID_ADDP_PAGE_PDFDRIVER
diff --git a/padmin/source/rtsetup.hrc b/padmin/source/rtsetup.hrc
index 42ba728..11bf334 100644
--- a/padmin/source/rtsetup.hrc
+++ b/padmin/source/rtsetup.hrc
@@ -45,16 +45,13 @@
#define RID_RTS_CMD_TXT_CONFIGURE 7
#define RID_RTS_CMD_LB_CONFIGURE 8
#define RID_RTS_CMD_STR_CONFIGURE_PRINTER 9
-#define RID_RTS_CMD_STR_CONFIGURE_FAX 10
#define RID_RTS_CMD_STR_CONFIGURE_PDF 11
#define RID_RTS_CMD_STR_PRINTERHELP 12
-#define RID_RTS_CMD_STR_FAXHELP 13
#define RID_RTS_CMD_STR_PDFHELP 14
#define RID_RTS_CMD_BTN_REMOVE 15
#define RID_RTS_CMD_EDT_PDFDIR 16
#define RID_RTS_CMD_BTN_PDFDIR 17
#define RID_RTS_CMD_TXT_PDFDIR 18
-#define RID_RTS_CMD_BOX_SWALLOWFAXNO 19
#define RID_RTS_CMD_CB_EXTERNAL 20
#define RID_RTS_CMD_FT_QUICKCMD 21
#define RIT_RTS_CMD_CB_QUICKCMD 22
diff --git a/padmin/source/rtsetup.src b/padmin/source/rtsetup.src
index ad8de70..f95a009 100644
--- a/padmin/source/rtsetup.src
+++ b/padmin/source/rtsetup.src
@@ -72,10 +72,6 @@ TabPage RID_RTS_COMMANDPAGE
{
Text [ en-US ] = "Printer";
};
- String RID_RTS_CMD_STR_CONFIGURE_FAX
- {
- Text [ en-US ] = "Fax";
- };
String RID_RTS_CMD_STR_CONFIGURE_PDF
{
Text [ en-US ] = "PDF converter";
@@ -96,13 +92,6 @@ TabPage RID_RTS_COMMANDPAGE
Text [ en-US ] = "~Configure as";
};
- CheckBox RID_RTS_CMD_BOX_SWALLOWFAXNO
- {
- HelpID = "padmin:CheckBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BOX_SWALLOWFAXNO";
- Pos = MAP_APPFONT( 11, 146 );
- Size = MAP_APPFONT( 130, 8 );
- Text [ en-US ] = "~Fax number will be removed from output";
- };
FixedText RID_RTS_CMD_TXT_PDFDIR
{
Pos = MAP_APPFONT( 11, 146 );
@@ -162,10 +151,6 @@ TabPage RID_RTS_COMMANDPAGE
{
Text [ en-US ] = "The command line for printer devices is executed as follows: the generated PostScript code is supplied as standard input (i.e. as a pipe) to the command line.";
};
- String RID_RTS_CMD_STR_FAXHELP
- {
- Text [ en-US ] = "The command line for fax devices is executed as follows: for each fax sent, \"(TMP)\" in the command line is replaced by a temporary file and \"(PHONE)\" in the command line is replaced by the fax number. If \"(TMP)\" appears in the command line, the PostScript code will be supplied via a file, otherwise it is passed as standard input (i.e. as a pipe).";
- };
};
TabPage RID_RTS_OTHERPAGE
commit 7a8815875f2d4f31b05d8b3796c5cfc03b581977
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 20 13:18:25 2014 +0000
all the filterText impls are now no-ops, so remove
Change-Id: I6e67756bb89235198c8d2705833d18ee9fb77fb1
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index e3986ac..2adb4d1 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -783,7 +783,7 @@ public:
SAL_DLLPRIVATE void ReMirror( Region &rRegion ) const;
SAL_DLLPRIVATE SalLayout* ImplLayout( const OUString&, sal_Int32 nIndex, sal_Int32 nLen,
const Point& rLogicPos = Point(0,0), long nLogicWidth=0,
- const sal_Int32* pLogicDXArray=NULL, bool bFilter = false ) const;
+ const sal_Int32* pLogicDXArray=NULL ) const;
SAL_DLLPRIVATE ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, const sal_Int32 nIndex, const sal_Int32 nLen,
long nPixelWidth, const sal_Int32* pPixelDXArray ) const;
SAL_DLLPRIVATE SalLayout* ImplGlyphFallbackLayout( SalLayout*, ImplLayoutArgs& ) const;
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 9e0221f..84eb8be 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -1194,11 +1194,6 @@ void GenPspGraphics::AnnounceFonts( ImplDevFontList* pFontList, const psp::FastP
pFontList->Add( pFD );
}
-bool GenPspGraphics::filterText( const OUString& /*rOrig*/, OUString& /*rNewText*/, sal_Int32 /*nIndex*/, sal_Int32& /*rLen*/, sal_Int32& /*rCutStart*/, sal_Int32& /*rCutStop*/ )
-{
- return false;
-}
-
bool GenPspGraphics::drawAlphaBitmap( const SalTwoRect&,
const SalBitmap&,
const SalBitmap& )
diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h
index 946f79c..6bb3268 100644
--- a/vcl/inc/generic/genpspgraphics.h
+++ b/vcl/inc/generic/genpspgraphics.h
@@ -168,8 +168,6 @@ public:
virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags );
virtual bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
- virtual bool filterText( const OUString& rOrigText, OUString& rNewText, sal_Int32 nIndex, sal_Int32& rLen, sal_Int32& rCutStart, sal_Int32& rCutStop );
-
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index add4547..69920f6 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -310,40 +310,6 @@ public:
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0;
- /** Filter text from DrawText commands in a device specific manner
- <p>
- This function allows a device (or rather the corresponding SalGraphics
- implementation) to prevent text portions from being drawn. This currently
- is used only for filtering out the fax number in a document that is printed
- to one of psprint's specialized "fax" printers.
- </p>
-
- @param rOrigText
- The original text
-
- @param rNewText
- A String that will be filled with the adjusted version
-
- @param nIndex
- The index inside <code>rOrigText</code> that marks the first draw character
-
- @param rLen
- in: length of text beginning at <code>nIndex</code> to be drawn
- out: length of <code>rNewText</code> containing the substituted text
-
- @param rCutStart
- out: index at which the cutout portion of <code>rOrigText</code> begins
-
- @param rCutStop
- out: index at which the cutout portion of <code>rOrigText</code> ends
-
- @returns
- true: a substitution has taken place and rNewText rLen, rCutStart and rCutStop have been filled accordingly
- false: no substitution has taken place, rNewText, rLen, rCutStart, rCutStop remain unchanged
- */
- virtual bool filterText( const OUString& rOrigText, OUString& rNewText,
- sal_Int32 nIndex, sal_Int32& rLen, sal_Int32& rCutStart, sal_Int32& rCutStop );
-
virtual bool supportsOperation( OutDevSupportType ) const = 0;
// mirroring specifica
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index c78794d..78bbb17 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -5468,7 +5468,7 @@ void OutputDevice::DrawText( const Point& rStartPt, const OUString& rStr,
if ( !IsDeviceOutputNecessary() || pVector )
return;
- SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, NULL, true );
+ SalLayout* pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, 0, NULL);
if( pSalLayout )
{
ImplDrawText( *pSalLayout );
@@ -5535,7 +5535,7 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr,
if( mbOutputClipped )
return;
- SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, pDXAry, true );
+ SalLayout* pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, 0, pDXAry);
if( pSalLayout )
{
ImplDrawText( *pSalLayout );
@@ -5681,7 +5681,7 @@ void OutputDevice::DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
if ( !IsDeviceOutputNecessary() )
return;
- SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, nWidth, NULL, true );
+ SalLayout* pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, nWidth, NULL);
if( pSalLayout )
{
ImplDrawText( *pSalLayout );
@@ -5805,9 +5805,10 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
return aLayoutArgs;
}
-SalLayout* OutputDevice::ImplLayout( const OUString& rOrigStr, sal_Int32 nMinIndex, sal_Int32 nLen,
- const Point& rLogicalPos, long nLogicalWidth, const sal_Int32* pDXArray,
- bool bFilter ) const
+SalLayout* OutputDevice::ImplLayout(const OUString& rOrigStr,
+ sal_Int32 nMinIndex, sal_Int32 nLen,
+ const Point& rLogicalPos, long nLogicalWidth,
+ const sal_Int32* pDXArray) const
{
// we need a graphics
if( !mpGraphics )
@@ -5832,27 +5833,6 @@ SalLayout* OutputDevice::ImplLayout( const OUString& rOrigStr, sal_Int32 nMinInd
OUString aStr = rOrigStr;
- // filter out special markers
- if( bFilter )
- {
- sal_Int32 nCutStart, nCutStop, nOrgLen = nLen;
- bool bFiltered = mpGraphics->filterText( rOrigStr, aStr, nMinIndex, nLen, nCutStart, nCutStop );
- if( !nLen )
- return NULL;
-
- if( bFiltered && nCutStop != nCutStart && pDXArray )
- {
- sal_Int32* pAry = (sal_Int32*)alloca(sizeof(sal_Int32)*nLen);
- if( nCutStart > nMinIndex )
- memcpy( pAry, pDXArray, sizeof(sal_Int32)*(nCutStart-nMinIndex) );
- // note: nCutStart will never be smaller than nMinIndex
- memcpy( pAry+nCutStart-nMinIndex,
- pDXArray + nOrgLen - (nCutStop-nMinIndex),
- sizeof(sal_Int32)*(nLen - (nCutStart-nMinIndex)) );
- pDXArray = pAry;
- }
- }
-
// convert from logical units to physical units
// recode string if needed
if( mpFontEntry->mpConversion ) {
@@ -7161,7 +7141,7 @@ SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, c
if ( !IsDeviceOutputNecessary() ) return aSysLayoutData;
- SalLayout* pLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, pDXAry, true );
+ SalLayout* pLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, 0, pDXAry);
if ( !pLayout ) return aSysLayoutData;
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 6ef3509..1d9430f 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -796,9 +796,4 @@ bool SalGraphics::DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
return drawAlphaRect( nX, nY, nWidth, nHeight, nTransparency );
}
-bool SalGraphics::filterText( const OUString&, OUString&, sal_Int32, sal_Int32&, sal_Int32&, sal_Int32& )
-{
- return false;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ed6171632005cdaa987214e84f0ad8fd0dbdd2da
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 20 12:38:03 2014 +0000
Resolves: #i49980# Autosense fax4cups devices and configure automatically
If there is a "Dial" ppd key then it's a fax device. If the Dial is set to
"Manually" then ignore that it's a fax device and don't prompt for a fax
number.
If we have a fax number, then set the jobname to the number given that
"printing will result in sending the fax to the number contained in the job
name"
Remove the weird and wonderful non-macosx-unix-only, non-pdf-print-backend,
text "scraping" of phone numbers out of the print out in the @@#PHONE@@ format.
Allow the phone entry dialog to accept multiple fax numbers separated by ;
Change-Id: Ie1d84b68584e82df15ceda5f32c7c75086b035c8
Related: rhbz#159153, #i49981#, #i49920#
diff --git a/include/vcl/printerinfomanager.hxx b/include/vcl/printerinfomanager.hxx
index d35e1fb..6492f8c 100644
--- a/include/vcl/printerinfomanager.hxx
+++ b/include/vcl/printerinfomanager.hxx
@@ -193,7 +193,7 @@ public:
// set bBanner to "false" will attempt to suppress banner printing
// set bBanner to "true" will rely on the system default
// returns true on success
- virtual bool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
+ virtual bool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner, const OUString &rFaxNumber );
// for spadmin: whether adding or removing a printer is possible
virtual bool addOrRemovePossible() const;
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 022e26c..cc379e5 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -304,69 +304,29 @@ static bool passFileToCommandLine( const OUString& rFilename, const OUString& rC
}
#endif
-static bool sendAFax( const OUString& rFaxNumber, const OUString& rFileName, const OUString& rCommand )
+static std::vector<OUString> getFaxNumbers()
{
-#if defined( UNX )
- std::list< OUString > aFaxNumbers;
+ std::vector<OUString> aFaxNumbers;
- if( rFaxNumber.isEmpty() )
- {
- getPaLib();
- if( pFaxNrFunction )
- {
- OUString aNewNr;
- if( pFaxNrFunction( aNewNr ) )
- aFaxNumbers.push_back( aNewNr );
- }
- }
- else
+#if defined( UNX )
+ getPaLib();
+ if (pFaxNrFunction)
{
- sal_Int32 nIndex = 0;
- OUString aFaxes( rFaxNumber );
- OUString aBeginToken( "<Fax#>" );
- OUString aEndToken( "</Fax#>" );
- while( nIndex != -1 )
+ OUString aNewNr;
+ if( pFaxNrFunction( aNewNr ) )
{
- nIndex = aFaxes.indexOf( aBeginToken, nIndex );
- if( nIndex != -1 )
+ sal_Int32 nIndex = 0;
+ do
{
- sal_Int32 nBegin = nIndex + aBeginToken.getLength();
- nIndex = aFaxes.indexOf( aEndToken, nIndex );
- if( nIndex != -1 )
- {
- aFaxNumbers.push_back( aFaxes.copy( nBegin, nIndex-nBegin ) );
- nIndex += aEndToken.getLength();
- }
+ OUString sToken = aNewNr.getToken( 0, ';', nIndex );
+ aFaxNumbers.push_back(sToken);
}
+ while (nIndex >= 0);
}
}
-
- bool bSuccess = true;
- if( aFaxNumbers.begin() != aFaxNumbers.end() )
- {
- while( aFaxNumbers.begin() != aFaxNumbers.end() && bSuccess )
- {
- OUString aFaxNumber( aFaxNumbers.front() );
- aFaxNumbers.pop_front();
- OUString aCmdLine(
- rCommand.replaceAll("(PHONE)", aFaxNumber));
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "sending fax to \"%s\"\n", OUStringToOString( aFaxNumber, osl_getThreadTextEncoding() ).getStr() );
#endif
- bSuccess = passFileToCommandLine( rFileName, aCmdLine, false );
- }
- }
- else
- bSuccess = false;
-
- // clean up temp file
- unlink(OUStringToOString(rFileName, osl_getThreadTextEncoding()).getStr());
- return bSuccess;
-#else
- (void)rFaxNumber; (void)rFileName; (void)rCommand;
- return false;
-#endif
+ return aFaxNumbers;
}
static bool createPdf( const OUString& rToFile, const OUString& rFromFile, const OUString& rCommandLine )
@@ -544,7 +504,7 @@ SalGraphics* PspSalInfoPrinter::AcquireGraphics()
if( ! m_pGraphics )
{
m_pGraphics = GetGenericInstance()->CreatePrintGraphics();
- m_pGraphics->Init( &m_aJobData, &m_aPrinterGfx, NULL, false, this );
+ m_pGraphics->Init(&m_aJobData, &m_aPrinterGfx, this);
pRet = m_pGraphics;
}
return pRet;
@@ -824,7 +784,19 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal
case PRINTER_CAPABILITIES_SETPAPER:
return 0;
case PRINTER_CAPABILITIES_FAX:
- return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "fax" ) ? 1 : 0;
+ {
+ // see if the PPD contains the fax4CUPS "Dial" option and that it's not set
+ // to "manually"
+ JobData aData = PrinterInfoManager::get().getPrinterInfo(pJobSetup->maPrinterName);
+ if( pJobSetup->mpDriverData )
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+ const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey(OUString("Dial")) : NULL;
+ const PPDValue* pValue = pKey ? aData.m_aContext.getValue(pKey) : NULL;
+ if (pValue && !pValue->m_aOption.equalsIgnoreAsciiCase("Manually"))
+ return 1;
+ return 0;
+ }
+
case PRINTER_CAPABILITIES_PDF:
if( PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) )
return 1;
@@ -855,9 +827,7 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal
* SalPrinter
*/
PspSalPrinter::PspSalPrinter( SalInfoPrinter* pInfoPrinter )
- : m_bFax( false ),
- m_bPdf( false ),
- m_bSwallowFaxNo( false ),
+ : m_bPdf( false ),
m_bIsPDFWriterJob( false ),
m_pGraphics( NULL ),
m_nCopies( 1 ),
@@ -890,8 +860,6 @@ bool PspSalPrinter::StartJob(
{
OSL_TRACE("PspSalPrinter::StartJob");
GetSalData()->m_pInstance->jobStartedPrinterUpdate();
-
- m_bFax = false;
m_bPdf = false;
m_aFileName = pFileName ? *pFileName : OUString();
m_aTmpFile = OUString();
@@ -915,17 +883,6 @@ bool PspSalPrinter::StartJob(
while( nIndex != -1 )
{
OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
- if( aToken.startsWith( "fax" ) )
- {
- m_bFax = true;
- m_aTmpFile = getTmpName();
- nMode = S_IRUSR | S_IWUSR;
-
- sal_Int32 nPos = 0;
- m_bSwallowFaxNo = aToken.getToken( 1, '=', nPos ).startsWith( "swallow" ) ? true : false;
-
- break;
- }
if( aToken.startsWith( "pdf=" ) )
{
m_bPdf = true;
@@ -957,22 +914,12 @@ bool PspSalPrinter::EndJob()
else
{
bSuccess = m_aPrintJob.EndJob();
- OSL_TRACE("PspSalPrinter::EndJob %d", bSuccess);
+ OSL_TRACE("PspSalPrinter::EndJob %d", bSuccess);
- if( bSuccess )
+ if( bSuccess && m_bPdf )
{
- // check for fax
- if( m_bFax )
- {
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
- // sendAFax removes the file after use
- bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand );
- }
- else if( m_bPdf )
- {
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
- bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand );
- }
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+ bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand );
}
}
GetSalData()->m_pInstance->jobEndedPrinterUpdate();
@@ -992,8 +939,8 @@ SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, bool )
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData );
m_pGraphics = GetGenericInstance()->CreatePrintGraphics();
- m_pGraphics->Init( &m_aJobData, &m_aPrinterGfx, m_bFax ? &m_aFaxNr : NULL,
- m_bSwallowFaxNo, m_pInfoPrinter );
+ m_pGraphics->Init(&m_aJobData, &m_aPrinterGfx, m_pInfoPrinter);
+
if( m_nCopies > 1 )
{
// in case user did not do anything (m_nCopies=1)
@@ -1063,6 +1010,8 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo
m_bIsPDFWriterJob = true;
// reset IsLastPage
i_rController.setLastPage( false );
+ // is this a fax device
+ bool bFax = m_pInfoPrinter->GetCapabilities(i_pSetupData, PRINTER_CAPABILITIES_FAX) == 1;
// update job data
if( i_pSetupData )
@@ -1214,58 +1163,77 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo
}
}
- bool bSuccess(true);
+ std::vector<OUString> aFaxNumbers;
+
+ // check for fax numbers
+ if (!bAborted && bFax)
+ {
+ aFaxNumbers = getFaxNumbers();
+ bAborted = aFaxNumbers.empty();
+ }
+ bool bSuccess(true);
// spool files
if( ! i_pFileName && ! bAborted )
{
- bool bFirstJob = true;
- for( int nCurJob = 0; nCurJob < nOuterJobs; nCurJob++ )
+ do
{
- for( size_t i = 0; i < aPDFFiles.size(); i++ )
+ OUString sFaxNumber;
+ if (!aFaxNumbers.empty())
+ {
+ sFaxNumber = aFaxNumbers.back();
+ aFaxNumbers.pop_back();
+ }
+
+ bool bFirstJob = true;
+ for( int nCurJob = 0; nCurJob < nOuterJobs; nCurJob++ )
{
- oslFileHandle pFile = NULL;
- osl_openFile( aPDFFiles[i].maTmpURL.pData, &pFile, osl_File_OpenFlag_Read );
- if (pFile && (osl_setFilePos(pFile, osl_Pos_Absolut, 0) == osl_File_E_None))
+ for( size_t i = 0; i < aPDFFiles.size(); i++ )
{
- std::vector< char > buffer( 0x10000, 0 );
- // update job data with current page size
- Size aPageSize( aPDFFiles[i].maParameters.maPageSize );
- m_aJobData.setPaper( TenMuToPt( aPageSize.Width() ), TenMuToPt( aPageSize.Height() ) );
- // update job data with current paperbin
- m_aJobData.setPaperBin( aPDFFiles[i].maParameters.mnPaperBin );
-
- // spool current file
- FILE* fp = PrinterInfoManager::get().startSpool( pPrinter->GetName(), i_rController.isDirectPrint() );
- if( fp )
+ oslFileHandle pFile = NULL;
+ osl_openFile( aPDFFiles[i].maTmpURL.pData, &pFile, osl_File_OpenFlag_Read );
+ if (pFile && (osl_setFilePos(pFile, osl_Pos_Absolut, 0) == osl_File_E_None))
{
- sal_uInt64 nBytesRead = 0;
- do
+ std::vector< char > buffer( 0x10000, 0 );
+ // update job data with current page size
+ Size aPageSize( aPDFFiles[i].maParameters.maPageSize );
+ m_aJobData.setPaper( TenMuToPt( aPageSize.Width() ), TenMuToPt( aPageSize.Height() ) );
+ // update job data with current paperbin
+ m_aJobData.setPaperBin( aPDFFiles[i].maParameters.mnPaperBin );
+
+ // spool current file
+ FILE* fp = PrinterInfoManager::get().startSpool( pPrinter->GetName(), i_rController.isDirectPrint() );
+ if( fp )
{
- osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead );
- if( nBytesRead > 0 )
+ sal_uInt64 nBytesRead = 0;
+ do
+ {
+ osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead );
+ if( nBytesRead > 0 )
+ {
+ size_t nBytesWritten = fwrite(&buffer[0], 1, nBytesRead, fp);
+ OSL_ENSURE(nBytesRead == nBytesWritten, "short write");
+ if (nBytesRead != nBytesWritten)
+ break;
+ }
+ } while( nBytesRead == buffer.size() );
+ OUStringBuffer aBuf( i_rJobName.getLength() + 8 );
+ aBuf.append( i_rJobName );
+ if( i > 0 || nCurJob > 0 )
{
- size_t nBytesWritten = fwrite(&buffer[0], 1, nBytesRead, fp);
- OSL_ENSURE(nBytesRead == nBytesWritten, "short write");
- if (nBytesRead != nBytesWritten)
- break;
+ aBuf.append( ' ' );
+ aBuf.append( sal_Int32( i + nCurJob * aPDFFiles.size() ) );
}
- } while( nBytesRead == buffer.size() );
- OUStringBuffer aBuf( i_rJobName.getLength() + 8 );
- aBuf.append( i_rJobName );
- if( i > 0 || nCurJob > 0 )
- {
- aBuf.append( ' ' );
- aBuf.append( sal_Int32( i + nCurJob * aPDFFiles.size() ) );
+ bSuccess &=
+ PrinterInfoManager::get().endSpool( pPrinter->GetName(), aBuf.makeStringAndClear(), fp, m_aJobData, bFirstJob, sFaxNumber );
+ bFirstJob = false;
}
- bSuccess &=
- PrinterInfoManager::get().endSpool( pPrinter->GetName(), aBuf.makeStringAndClear(), fp, m_aJobData, bFirstJob );
- bFirstJob = false;
}
+ osl_closeFile( pFile );
}
- osl_closeFile( pFile );
}
}
+ while (!aFaxNumbers.empty());
}
// job has been spooled
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 961d17f..9e0221f 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -266,9 +266,6 @@ SalPrinterBmp::GetPixelIdx (sal_uInt32 nRow, sal_uInt32 nColumn) const
GenPspGraphics::GenPspGraphics()
: m_pJobData( NULL ),
m_pPrinterGfx( NULL ),
- m_pPhoneNr( NULL ),
- m_bSwallowFaxNo( false ),
- m_bPhoneCollectionActive( false ),
m_bFontVertical( false ),
m_pInfoPrinter( NULL )
{
@@ -276,14 +273,11 @@ GenPspGraphics::GenPspGraphics()
m_pServerFont[i] = NULL;
}
-void GenPspGraphics::Init( psp::JobData* pJob, psp::PrinterGfx* pGfx,
- OUString* pPhone, bool bSwallow,
- SalInfoPrinter* pInfoPrinter )
+void GenPspGraphics::Init(psp::JobData* pJob, psp::PrinterGfx* pGfx,
+ SalInfoPrinter* pInfoPrinter)
{
m_pJobData = pJob;
m_pPrinterGfx = pGfx;
- m_pPhoneNr = pPhone;
- m_bSwallowFaxNo = bSwallow;
m_pInfoPrinter = pInfoPrinter;
SetLayout( 0 );
}
@@ -1200,78 +1194,9 @@ void GenPspGraphics::AnnounceFonts( ImplDevFontList* pFontList, const psp::FastP
pFontList->Add( pFD );
}
-bool GenPspGraphics::filterText( const OUString& rOrig, OUString& rNewText, sal_Int32 nIndex, sal_Int32& rLen, sal_Int32& rCutStart, sal_Int32& rCutStop )
+bool GenPspGraphics::filterText( const OUString& /*rOrig*/, OUString& /*rNewText*/, sal_Int32 /*nIndex*/, sal_Int32& /*rLen*/, sal_Int32& /*rCutStart*/, sal_Int32& /*rCutStop*/ )
{
- if( ! m_pPhoneNr )
- return false;
-
- rNewText = rOrig;
- rCutStop = rCutStart = -1;
-
-#define FAX_PHONE_TOKEN "@@#"
-#define FAX_PHONE_TOKEN_LENGTH 3
-#define FAX_END_TOKEN "@@"
-#define FAX_END_TOKEN_LENGTH 2
-
- bool bRet = false;
- bool bStarted = false;
- sal_Int32 nPos;
- sal_Int32 nStart = 0;
- sal_Int32 nStop = rLen;
- OUString aPhone = rOrig.copy( nIndex, rLen );
-
- if( ! m_bPhoneCollectionActive )
- {
- if( ( nPos = aPhone.indexOfAsciiL( FAX_PHONE_TOKEN, FAX_PHONE_TOKEN_LENGTH ) ) != -1 )
- {
- nStart = nPos;
- m_bPhoneCollectionActive = true;
- m_aPhoneCollection = "";
- bRet = true;
- bStarted = true;
- }
- }
- if( m_bPhoneCollectionActive )
- {
- bool bStopped = false;
- bRet = true;
- nPos = bStarted ? nStart + FAX_PHONE_TOKEN_LENGTH : 0;
- if( ( nPos = aPhone.indexOfAsciiL( FAX_END_TOKEN, FAX_END_TOKEN_LENGTH, nPos ) ) != -1 )
- {
- m_bPhoneCollectionActive = false;
- nStop = nPos + FAX_END_TOKEN_LENGTH;
- bStopped = true;
- }
- int nTokenStart = nStart + (bStarted ? FAX_PHONE_TOKEN_LENGTH : 0);
- int nTokenStop = nStop - (bStopped ? FAX_END_TOKEN_LENGTH : 0);
- m_aPhoneCollection += aPhone.copy( nTokenStart, nTokenStop - nTokenStart );
- if( ! m_bPhoneCollectionActive )
- {
- OUStringBuffer aPhoneNr;
- aPhoneNr.append( "<Fax#>" );
- aPhoneNr.append( m_aPhoneCollection );
- aPhoneNr.append( "</Fax#>" );
- *m_pPhoneNr = aPhoneNr.makeStringAndClear();
- m_aPhoneCollection = "";
- }
- }
- if( m_aPhoneCollection.getLength() > 1024 )
- {
- m_bPhoneCollectionActive = false;
- m_aPhoneCollection = "";
- bRet = false;
- }
-
- if( bRet && m_bSwallowFaxNo )
- {
- rLen -= nStop - nStart;
- rCutStart = nStart+nIndex;
- rCutStop = nStop+nIndex;
- if (rCutStart != rCutStop)
- rNewText = ( rCutStart ? rOrig.copy( 0, rCutStart ) : OUString() ) + rOrig.copy( rCutStop );
- }
-
- return bRet && m_bSwallowFaxNo;
+ return false;
}
bool GenPspGraphics::drawAlphaBitmap( const SalTwoRect&,
diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx
index b6ef32f..9575169 100644
--- a/vcl/generic/print/printerjob.cxx
+++ b/vcl/generic/print/printerjob.cxx
@@ -410,7 +410,7 @@ PrinterJob::StartJob (
}
bool
-PrinterJob::EndJob ()
+PrinterJob::EndJob()
{
// no pages ? that really means no print job
if( maPageList.empty() )
@@ -531,7 +531,7 @@ PrinterJob::EndJob ()
{
PrinterInfoManager& rPrinterInfoManager = PrinterInfoManager::get();
if (!rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
- maJobTitle, pDestFILE, m_aDocumentJobData, true ))
+ maJobTitle, pDestFILE, m_aDocumentJobData, true, OUString()))
{
bSuccess = false;
}
diff --git a/vcl/inc/cupsmgr.hxx b/vcl/inc/cupsmgr.hxx
index 08711a3..8454c31 100644
--- a/vcl/inc/cupsmgr.hxx
+++ b/vcl/inc/cupsmgr.hxx
@@ -77,7 +77,7 @@ public:
const char* authenticateUser( const char* );
virtual FILE* startSpool( const OUString& rPrinterName, bool bQuickCommand );
- virtual bool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
+ virtual bool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner, const OUString& rFaxNumber );
virtual void setupJobContextData( JobData& rData );
/// changes the info about a named printer
diff --git a/vcl/inc/generic/genprn.h b/vcl/inc/generic/genprn.h
index d21b97e..d3215f6 100644
--- a/vcl/inc/generic/genprn.h
+++ b/vcl/inc/generic/genprn.h
@@ -59,10 +59,7 @@ class VCL_DLLPUBLIC PspSalPrinter : public SalPrinter
public:
OUString m_aFileName;
OUString m_aTmpFile;
- OUString m_aFaxNr;
- bool m_bFax:1;
bool m_bPdf:1;
- bool m_bSwallowFaxNo:1;
bool m_bIsPDFWriterJob:1;
GenPspGraphics* m_pGraphics;
psp::PrinterJob m_aPrintJob;
diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h
index 9a2c8c5..946f79c 100644
--- a/vcl/inc/generic/genpspgraphics.h
+++ b/vcl/inc/generic/genpspgraphics.h
@@ -39,10 +39,6 @@ class VCL_DLLPUBLIC GenPspGraphics : public SalGraphics
protected:
psp::JobData* m_pJobData;
psp::PrinterGfx* m_pPrinterGfx;
- OUString* m_pPhoneNr;
- bool m_bSwallowFaxNo;
- OUString m_aPhoneCollection;
- bool m_bPhoneCollectionActive;
ServerFont* m_pServerFont[ MAX_FALLBACK ];
bool m_bFontVertical;
@@ -52,7 +48,6 @@ public:
virtual ~GenPspGraphics();
void Init( psp::JobData* pJob, psp::PrinterGfx* pGfx,
- OUString* pPhone, bool bSwallow,
SalInfoPrinter* pInfoPrinter );
// helper methods
diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx
index cc31c86..d102f0c 100644
--- a/vcl/null/printerinfomanager.cxx
+++ b/vcl/null/printerinfomanager.cxx
@@ -142,7 +142,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& /* rPrintername */, bool /
return NULL;
}
-bool PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* /* pFile */, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
+bool PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* /* pFile */, const JobData& /*rDocumentJobData*/, bool /*bBanner*/, const OUString& /*rFaxNumber*/ )
{
return true;
}
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index 2cfcbaa..3627cd7 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -541,7 +541,7 @@ void CUPSManager::setupJobContextData( JobData& rData )
FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand )
{
- OSL_TRACE( "endSpool: %s, %s",
+ OSL_TRACE( "startSpool: %s, %s",
OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
bQuickCommand ? "true" : "false" );
@@ -612,7 +612,7 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner
}
}
-bool CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
+bool CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner, const OUString& rFaxNumber )
{
OSL_TRACE( "endSpool: %s, %s, copy count = %d",
OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
@@ -629,7 +629,7 @@ bool CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTi
if( dest_it == m_aCUPSDestMap.end() )
{
OSL_TRACE( "defer to PrinterInfoManager::endSpool" );
- return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData, bBanner );
+ return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData, bBanner, rFaxNumber );
}
boost::unordered_map< FILE*, OString, FPtrHash >::const_iterator it = m_aSpoolFiles.find( pFile );
@@ -643,11 +643,20 @@ bool CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTi
cups_option_t* pOptions = NULL;
getOptionsFromDocumentSetup( rDocumentJobData, bBanner, nNumOptions, (void**)&pOptions );
+ OString sJobName(OUStringToOString(rJobTitle, aEnc));
+
+ //fax4CUPS, "the job name will be dialled for you"
+ //so override the jobname with the desired number
+ if (!rFaxNumber.isEmpty())
+ {
+ sJobName = OUStringToOString(rFaxNumber, aEnc);
+ }
+
cups_dest_t* pDest = ((cups_dest_t*)m_pDests) + dest_it->second;
- nJobID = cupsPrintFile( pDest->name,
- it->second.getStr(),
- OUStringToOString( rJobTitle, aEnc ).getStr(),
- nNumOptions, pOptions );
+ nJobID = cupsPrintFile(pDest->name,
+ it->second.getStr(),
+ sJobName.getStr(),
+ nNumOptions, pOptions);
SAL_INFO("vcl.unx.print", "cupsPrintFile( " << pDest->name << ", "
<< it->second << ", " << rJobTitle << ", " << nNumOptions
<< ", " << pOptions << " ) returns " << nJobID);
diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
index 0c6e713..01d6ce6 100644
--- a/vcl/unx/generic/printer/printerinfomanager.cxx
+++ b/vcl/unx/generic/printer/printerinfomanager.cxx
@@ -966,7 +966,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC
return popen (aShellCommand.getStr(), "w");
}
-bool PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
+bool PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/, const OUString& /*rFaxNumber*/ )
{
return (0 == pclose( pFile ));
}
commit 872de529584cd001431a2090eca0f52eb0b16539
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 20 09:04:47 2014 +0000
IsQuickJob is never read and FAX# is never written
Change-Id: Id8f852df49b951fa6f5558e7e45018f07a9b104f
diff --git a/include/vcl/jobset.hxx b/include/vcl/jobset.hxx
index 75f48ca..3c2c837 100644
--- a/include/vcl/jobset.hxx
+++ b/include/vcl/jobset.hxx
@@ -46,13 +46,6 @@ public:
OUString GetPrinterName() const;
OUString GetDriverName() const;
- /* Get/SetValue are used to read/store additional
- * Parameters in the job setup that may be used
- * by the printer driver. One possible use are phone
- * numbers for faxes (which disguise as printers)
- */
- void SetValue( const OUString& rKey, const OUString& rValue );
-
JobSetup& operator=( const JobSetup& rJob );
bool operator==( const JobSetup& rJobSetup ) const;
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index f72781c..2e8098d 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -305,7 +305,6 @@ public:
bool SetJobSetup( const JobSetup& rSetup );
const JobSetup& GetJobSetup() const { return maJobSetup; }
- void SetJobValue( const OUString& rKey, const OUString& rValue ) { maJobSetup.SetValue( rKey, rValue ); }
bool Setup( Window* pWindow = NULL );
bool SetPrinterProps( const Printer* pPrinter );
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index 93788e4..286adda 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -579,7 +579,6 @@ void PADialog::PrintTestPage()
boost::shared_ptr<vcl::PrinterController> pController( new SpaPrinterController( pPrinter ) );
JobSetup aJobSetup( pPrinter->GetJobSetup() );
- aJobSetup.SetValue( "IsQuickJob", "true" );
Printer::PrintJob( pController, aJobSetup );
}
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 6a17d5b..6081a9b 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -618,10 +618,6 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
// FIXME: job setup
SfxPrinter* pDocPrt = GetPrinter(false);
JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : GetJobSetup();
- if( bIsDirect )
- aJobSetup.SetValue( OUString( "IsQuickJob" ),
- OUString( "true" ) );
-
Printer::PrintJob( pController, aJobSetup );
}
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index de72bb9..022e26c 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -921,11 +921,6 @@ bool PspSalPrinter::StartJob(
m_aTmpFile = getTmpName();
nMode = S_IRUSR | S_IWUSR;
- ::boost::unordered_map< OUString, OUString, OUStringHash >::const_iterator it;
- it = pJobSetup->maValueMap.find( OUString("FAX#") );
- if( it != pJobSetup->maValueMap.end() )
- m_aFaxNr = it->second;
-
sal_Int32 nPos = 0;
m_bSwallowFaxNo = aToken.getToken( 1, '=', nPos ).startsWith( "swallow" ) ? true : false;
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index 15e49df..82354f1 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -162,14 +162,6 @@ OUString JobSetup::GetDriverName() const
return OUString();
}
-void JobSetup::SetValue( const OUString& rKey, const OUString& rValue )
-{
- if( ! mpData )
- mpData = new ImplJobSetup();
-
- mpData->maValueMap[ rKey ] = rValue;
-}
-
JobSetup& JobSetup::operator=( const JobSetup& rJobSetup )
{
DBG_ASSERT( !rJobSetup.mpData || (rJobSetup.mpData->mnRefCount) < 0xFFFE, "JobSetup: RefCount overflow" );
commit 8188aa06d06eb12bfe564dd12f72489ccc494474
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 20 08:54:35 2014 +0000
callcatcher: update unused code
Change-Id: I277f26d33ad57eca077a36035554c71592f178d9
diff --git a/unusedcode.easy b/unusedcode.easy
index 0a0fa5d..8010406 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -61,6 +61,7 @@ VCLXGraphics::getLineColor()
VCLXGraphics::getRasterOp()
VCLXGraphics::getTextColor()
VCLXGraphics::getTextFillColor()
+XclRef8U::convertToScRange(short)
apitest::CellProperties::testRotateReference()
apitest::CellProperties::testVertJustify()
apitest::DataPilotField::testAutoShowInfo()
commit c6e316f52021cc26d4c5ec9a7b87a07fbf595b62
Author: Armin Le Grand <alg at apache.org>
Date: Wed Mar 19 14:51:18 2014 +0000
Resolves: #i124452# correct svg:viewBox for EnhancedCustomShape...
geometry import when no width and no height are given
(cherry picked from commit 4e04ad3623f2ab4693dcd50a9934fc836e190a6f)
Conflicts:
xmloff/source/draw/ximpcustomshape.cxx
Change-Id: I2589fd28dcbdf767d324f84e0a2342370ad6f061
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index f60580f..31c9e31 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -44,7 +44,9 @@
#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <com/sun/star/drawing/HomogenMatrix3.hpp>
#include <boost/unordered_map.hpp>
+#include <basegfx/vector/b2dvector.hxx>
#include <sax/tools/converter.hxx>
using namespace ::com::sun::star;
@@ -933,7 +935,46 @@ void XMLEnhancedCustomShapeContext::StartElement( const uno::Reference< xml::sax
case EAS_viewBox :
{
SdXMLImExViewBox aViewBox( rValue, GetImport().GetMM100UnitConverter() );
- awt::Rectangle aRect( aViewBox.GetX(), aViewBox.GetY(), aViewBox.GetWidth(), aViewBox.GetHeight() );
+ awt::Rectangle aRect(
+ basegfx::fround(aViewBox.GetX()),
+ basegfx::fround(aViewBox.GetY()),
+ basegfx::fround(aViewBox.GetWidth()),
+ basegfx::fround(aViewBox.GetHeight()));
+
+ if(0 == aRect.Width && 0 == aRect.Height)
+ {
+ // #i124452# If in svg:viewBox no width and height is given the objects should normally
+ // not be visible at all, but in this case it is a bug in LO to write empty svg:viewBox
+ // entries for CustomShapes. To allow for a better ODF user experience, just correct this
+ // here by getting the real object scale from the already set transformation from the xShape.
+ // Hopefully LO will fix that bug (but this will still leave the files with the error), but
+ // even when not this will do no harm as long noone uses this state explicitely for some
+ // purpose (e.g. to really have CustomShapes without content, but unlikely).
+ uno::Reference< beans::XPropertySet > xProps(mrxShape, uno::UNO_QUERY_THROW);
+ uno::Any aObjectTransform = xProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")));
+ drawing::HomogenMatrix3 aTransformMatrix;
+ aObjectTransform >>= aTransformMatrix;
+ basegfx::B2DHomMatrix aMatrix;
+
+ aMatrix.set(0, 0, aTransformMatrix.Line1.Column1);
+ aMatrix.set(0, 1, aTransformMatrix.Line1.Column2);
+ aMatrix.set(0, 2, aTransformMatrix.Line1.Column3);
+ aMatrix.set(1, 0, aTransformMatrix.Line2.Column1);
+ aMatrix.set(1, 1, aTransformMatrix.Line2.Column2);
+ aMatrix.set(1, 2, aTransformMatrix.Line2.Column3);
+ aMatrix.set(2, 0, aTransformMatrix.Line3.Column1);
+ aMatrix.set(2, 1, aTransformMatrix.Line3.Column2);
+ aMatrix.set(2, 2, aTransformMatrix.Line3.Column3);
+
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+
+ aMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ aRect.Width = basegfx::fround(fabs(aScale.getX()));
+ aRect.Height = basegfx::fround(fabs(aScale.getY()));
+ }
+
beans::PropertyValue aProp;
aProp.Name = EASGet( EAS_ViewBox );
aProp.Value <<= aRect;
More information about the Libreoffice-commits
mailing list