diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-06-12 09:36:34 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-06-12 09:36:34 +0000 |
commit | 1e4b45714508cf8085750a7e9a95fbf2aafc5af8 (patch) | |
tree | 71bb6d45d36fe99bb5a4c962eea2fdedcb8a2f29 /sfx2/source/doc/printhelper.cxx | |
parent | 21d9c95a1df10efcb0f31eeb094eb38e9d666902 (diff) |
CWS-TOOLING: integrate CWS unifypaper01
2009-05-27 17:14:41 +0200 cmc r272362 : #i92819#, psprint moved into vcl
2009-05-19 15:45:46 +0200 cmc r272083 : #i92819# having difficultly in getting this right under windows
2009-05-18 18:04:22 +0200 cmc r272043 : #i92819# missing some export magic somewhere
2009-05-18 15:34:18 +0200 cmc r272028 : #i92819# get depends right
2009-05-18 11:50:43 +0200 cmc r272010 : ##i92819# fix import/export stuff
2009-05-18 10:07:00 +0200 cmc r272000 : #i92819# fix window imp name
2009-05-16 15:17:23 +0200 cmc r271975 : #i92819# fix win paper names
2009-05-16 11:11:29 +0200 cmc r271974 : #i92819# std::abs prolematic for msvc
2009-05-15 15:36:56 +0200 cmc r271941 : #i92819# handle missing setting, at least on mac
2009-05-15 10:13:44 +0200 cmc r271927 : #i92819# adjust for moved page dialog
2009-05-14 13:47:14 +0200 cmc r271887 : remove dead files that reappeared
2009-05-14 09:57:17 +0200 cmc r271872 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@271830 (milestone: DEV300:m48)
2009-05-11 12:27:18 +0200 cmc r271763 : #i92819# check return value
2009-05-06 17:28:25 +0200 cmc r271602 : #i92819# these B4/B5s are the JIS ones according to their dimensions
2009-05-06 17:17:03 +0200 cmc r271601 : #i92819# micro-optimization
2009-05-03 18:20:48 +0200 cmc r271434 : #i92819# paper libs
2009-05-03 16:08:32 +0200 cmc r271433 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@271427 (milestone: DEV300:m47)
2009-04-06 15:33:37 +0200 cmc r270556 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@270033 (milestone: DEV300:m45)
2009-03-12 14:36:35 +0100 cmc r269415 : #i92819# merge paper utilities
2009-03-11 13:44:27 +0100 cmc r269328 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@269297 (milestone: DEV300:m43)
2009-03-09 14:42:07 +0100 cmc r269190 : remove config_office from synced version
2009-03-09 14:34:50 +0100 cmc r269187 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@268395 (milestone: DEV300:m42)
2009-03-09 12:11:29 +0100 cmc r269077 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@265758 (milestone: DEV300:m38)
2009-03-06 17:17:39 +0100 cmc r269027 : #i92819# paper goo
2008-12-04 11:29:30 +0100 cmc r264826 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@264807 (milestone: DEV300:m37)
2008-11-26 10:33:06 +0100 cmc r264357 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@264325 (milestone: DEV300:m36)
2008-11-21 14:09:36 +0100 cmc r264138 : #i92819# paper consolidation
Diffstat (limited to 'sfx2/source/doc/printhelper.cxx')
-rwxr-xr-x | sfx2/source/doc/printhelper.cxx | 89 |
1 files changed, 84 insertions, 5 deletions
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 91079e0ccc..ca0e28d322 100755 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -179,6 +179,85 @@ SfxPrintHelper::~SfxPrintHelper() delete m_pData; } +namespace +{ + view::PaperFormat convertToPaperFormat(Paper eFormat) + { + view::PaperFormat eRet; + switch (eFormat) + { + case PAPER_A3: + eRet = view::PaperFormat_A3; + break; + case PAPER_A4: + eRet = view::PaperFormat_A4; + break; + case PAPER_A5: + eRet = view::PaperFormat_A5; + break; + case PAPER_B4_ISO: + eRet = view::PaperFormat_B4; + break; + case PAPER_B5_ISO: + eRet = view::PaperFormat_B5; + break; + case PAPER_LETTER: + eRet = view::PaperFormat_LETTER; + break; + case PAPER_LEGAL: + eRet = view::PaperFormat_LEGAL; + break; + case PAPER_TABLOID: + eRet = view::PaperFormat_TABLOID; + break; + case PAPER_USER: + default: + eRet = view::PaperFormat_USER; + break; + } + return eRet; + } + + Paper convertToPaper(view::PaperFormat eFormat) + { + Paper eRet(PAPER_USER); + switch (eFormat) + { + case view::PaperFormat_A3: + eRet = PAPER_A3; + break; + case view::PaperFormat_A4: + eRet = PAPER_A4; + break; + case view::PaperFormat_A5: + eRet = PAPER_A5; + break; + case view::PaperFormat_B4: + eRet = PAPER_B4_ISO; + break; + case view::PaperFormat_B5: + eRet = PAPER_B5_ISO; + break; + case view::PaperFormat_LETTER: + eRet = PAPER_LETTER; + break; + case view::PaperFormat_LEGAL: + eRet = PAPER_LEGAL; + break; + case view::PaperFormat_TABLOID: + eRet = PAPER_TABLOID; + break; + case view::PaperFormat_USER: + eRet = PAPER_USER; + break; + case view::PaperFormat_MAKE_FIXED_SIZE: + break; + //deliberate no default to force warn on a new papersize + } + return eRet; + } +} + //________________________________________________________________________________________________________ // XPrintable //________________________________________________________________________________________________________ @@ -218,7 +297,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro aPrinter.getArray()[3].Value <<= aSize; aPrinter.getArray()[2].Name = DEFINE_CONST_UNICODE( "PaperFormat" ); - view::PaperFormat eFormat = (view::PaperFormat)pPrinter->GetPaper(); + view::PaperFormat eFormat = convertToPaperFormat(pPrinter->GetPaper()); aPrinter.getArray()[2].Value <<= eFormat; aPrinter.getArray()[1].Name = DEFINE_CONST_UNICODE( "PaperOrientation" ); @@ -276,7 +355,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } Size aSetPaperSize( 0, 0); - view::PaperFormat nPaperFormat = (view::PaperFormat) PAPER_USER; + view::PaperFormat nPaperFormat = view::PaperFormat_USER; // other properties for ( int i = 0; i < rPrinter.getLength(); ++i ) @@ -312,9 +391,9 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > nPaperFormat = ( view::PaperFormat ) lDummy; } - if ( (Paper) nPaperFormat != pPrinter->GetPaper() ) + if ( convertToPaper(nPaperFormat) != pPrinter->GetPaper() ) { - pPrinter->SetPaper( (Paper) nPaperFormat ); + pPrinter->SetPaper( convertToPaper(nPaperFormat) ); nChangeFlags |= SFX_PRINTER_CHG_SIZE; } } @@ -354,7 +433,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > //os 12.11.98: die PaperSize darf nur gesetzt werden, wenn tatsaechlich //PAPER_USER gilt, sonst koennte vom Treiber ein falsches Format gewaehlt werden - if(nPaperFormat == PAPER_USER && aSetPaperSize.Width()) + if(nPaperFormat == view::PaperFormat_USER && aSetPaperSize.Width()) { //JP 23.09.98 - Bug 56929 - MapMode von 100mm in die am // Device gesetzten umrechnen. Zusaetzlich nur dann |