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 | 1f946080d1a8f65615d612e72a8780f21966f3e8 (patch) | |
tree | e9f2f12bc5a269353954dfb148ba8194147d128a | |
parent | 5707dd005af1cf73e5deb750c5d8e7a78112220d (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
-rwxr-xr-x | sfx2/source/doc/printhelper.cxx | 89 | ||||
-rw-r--r-- | svx/inc/svx/dialogs.hrc | 42 | ||||
-rw-r--r-- | svx/inc/svx/paperinf.hxx | 116 | ||||
-rw-r--r-- | svx/inc/svx/svxenum.hxx | 43 | ||||
-rw-r--r-- | svx/source/cui/page.cxx | 31 | ||||
-rw-r--r-- | svx/source/cui/page.h | 40 | ||||
-rw-r--r-- | svx/source/cui/page.hxx | 9 | ||||
-rw-r--r-- | svx/source/cui/page.src | 138 | ||||
-rw-r--r-- | svx/source/items/paperinf.cxx | 298 | ||||
-rw-r--r-- | svx/source/items/paraitem.cxx | 1 | ||||
-rw-r--r-- | svx/util/makefile.mk | 1 |
11 files changed, 287 insertions, 521 deletions
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 07d218fcd690..cd8e28ee771c 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 diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc index d19518fbcd88..13e835a3d378 100644 --- a/svx/inc/svx/dialogs.hrc +++ b/svx/inc/svx/dialogs.hrc @@ -484,13 +484,13 @@ #define RID_SVXSTR_PAPER_A3 (RID_SVX_START + 103) #define RID_SVXSTR_PAPER_A4 (RID_SVX_START + 104) #define RID_SVXSTR_PAPER_A5 (RID_SVX_START + 105) -#define RID_SVXSTR_PAPER_B4 (RID_SVX_START + 106) -#define RID_SVXSTR_PAPER_B5 (RID_SVX_START + 107) +#define RID_SVXSTR_PAPER_B4_ISO (RID_SVX_START + 106) +#define RID_SVXSTR_PAPER_B5_ISO (RID_SVX_START + 107) #define RID_SVXSTR_PAPER_LETTER (RID_SVX_START + 108) #define RID_SVXSTR_PAPER_LEGAL (RID_SVX_START + 109) #define RID_SVXSTR_PAPER_TABLOID (RID_SVX_START + 110) #define RID_SVXSTR_PAPER_USER (RID_SVX_START + 111) -#define RID_SVXSTR_PAPER_B6 (RID_SVX_START + 112) +#define RID_SVXSTR_PAPER_B6_ISO (RID_SVX_START + 112) #define RID_SVXSTR_PAPER_C4 (RID_SVX_START + 113) #define RID_SVXSTR_PAPER_C5 (RID_SVX_START + 114) #define RID_SVXSTR_PAPER_C6 (RID_SVX_START + 115) @@ -498,25 +498,23 @@ #define RID_SVXSTR_PAPER_DL (RID_SVX_START + 117) #define RID_SVXSTR_PAPER_DIA (RID_SVX_START + 118) #define RID_SVXSTR_PAPER_SCREEN (RID_SVX_START + 119) -#define RID_SVXSTR_PAPER_A (RID_SVX_START + 120) -#define RID_SVXSTR_PAPER_B (RID_SVX_START + 121) -#define RID_SVXSTR_PAPER_C (RID_SVX_START + 122) -#define RID_SVXSTR_PAPER_D (RID_SVX_START + 123) -#define RID_SVXSTR_PAPER_E (RID_SVX_START + 124) -#define RID_SVXSTR_PAPER_EXECUTIVE (RID_SVX_START + 125) -#define RID_SVXSTR_PAPER_LEGAL2 (RID_SVX_START + 126) -#define RID_SVXSTR_PAPER_MONARCH (RID_SVX_START + 127) -#define RID_SVXSTR_PAPER_COM675 (RID_SVX_START + 128) -#define RID_SVXSTR_PAPER_COM9 (RID_SVX_START + 129) -#define RID_SVXSTR_PAPER_COM10 (RID_SVX_START + 130) -#define RID_SVXSTR_PAPER_COM11 (RID_SVX_START + 131) -#define RID_SVXSTR_PAPER_COM12 (RID_SVX_START + 132) -#define RID_SVXSTR_PAPER_KAI16 (RID_SVX_START + 133) -#define RID_SVXSTR_PAPER_KAI32 (RID_SVX_START + 134) -#define RID_SVXSTR_PAPER_KAI32BIG (RID_SVX_START + 135) -#define RID_SVXSTR_PAPER_B4_JIS (RID_SVX_START + 136) -#define RID_SVXSTR_PAPER_B5_JIS (RID_SVX_START + 137) -#define RID_SVXSTR_PAPER_B6_JIS (RID_SVX_START + 138) +#define RID_SVXSTR_PAPER_C (RID_SVX_START + 120) +#define RID_SVXSTR_PAPER_D (RID_SVX_START + 121) +#define RID_SVXSTR_PAPER_E (RID_SVX_START + 122) +#define RID_SVXSTR_PAPER_EXECUTIVE (RID_SVX_START + 123) +#define RID_SVXSTR_PAPER_LEGAL2 (RID_SVX_START + 124) +#define RID_SVXSTR_PAPER_MONARCH (RID_SVX_START + 125) +#define RID_SVXSTR_PAPER_COM675 (RID_SVX_START + 126) +#define RID_SVXSTR_PAPER_COM9 (RID_SVX_START + 127) +#define RID_SVXSTR_PAPER_COM10 (RID_SVX_START + 128) +#define RID_SVXSTR_PAPER_COM11 (RID_SVX_START + 129) +#define RID_SVXSTR_PAPER_COM12 (RID_SVX_START + 130) +#define RID_SVXSTR_PAPER_KAI16 (RID_SVX_START + 131) +#define RID_SVXSTR_PAPER_KAI32 (RID_SVX_START + 132) +#define RID_SVXSTR_PAPER_KAI32BIG (RID_SVX_START + 133) +#define RID_SVXSTR_PAPER_B4_JIS (RID_SVX_START + 134) +#define RID_SVXSTR_PAPER_B5_JIS (RID_SVX_START + 135) +#define RID_SVXSTR_PAPER_B6_JIS (RID_SVX_START + 136) #define RID_SVXSTRARY_PAPERSIZE_STD (RID_SVX_START + 142) #define RID_SVXSTRARY_PAPERSIZE_DRAW (RID_SVX_START + 143) diff --git a/svx/inc/svx/paperinf.hxx b/svx/inc/svx/paperinf.hxx index 1c6ccf02a9f4..9e2503a56ea8 100644 --- a/svx/inc/svx/paperinf.hxx +++ b/svx/inc/svx/paperinf.hxx @@ -32,12 +32,8 @@ // INCLUDE --------------------------------------------------------------- -#ifndef _PRINT_HXX //autogen #include <vcl/print.hxx> -#endif -#ifndef _MAPMOD_HXX //autogen #include <vcl/mapmod.hxx> -#endif #include <svx/svxenum.hxx> #include "svx/svxdllapi.h" @@ -52,19 +48,12 @@ class String; class SVX_DLLPUBLIC SvxPaperInfo { public: - static Size GetPaperSize( const Printer* ); - static Size GetPaperSize( SvxPaper ePaper, - MapUnit eUnit = MAP_TWIP ); - // entfaellt demnaechst - static SvxPaper GetPaper( const Size&, MapUnit eUnit = MAP_TWIP, - BOOL bSloppy = FALSE ); - // dann nur noch diese beiden - static SvxPaper GetSvxPaper( const Size&, MapUnit eUnit = MAP_TWIP, - BOOL bSloppy = FALSE ); - static SvxPaper GetDefaultSvxPaper( LanguageType eLanguage ); - static Paper GetSvPaper( const Size&, MapUnit eUnit = MAP_TWIP, - BOOL bSloppy = FALSE ); - static String GetName( SvxPaper ePaper ); + static Size GetDefaultPaperSize( MapUnit eUnit = MAP_TWIP ); + static Size GetPaperSize( Paper ePaper, MapUnit eUnit = MAP_TWIP ); + static Size GetPaperSize( const Printer* pPrinter ); + static Paper GetSvxPaper( const Size &rSize, MapUnit eUnit = MAP_TWIP, bool bSloppy = FALSE ); + static long GetSloppyPaperDimension( long nSize, MapUnit eUnit = MAP_TWIP ); + static String GetName( Paper ePaper ); }; // INLINE ----------------------------------------------------------------- @@ -84,97 +73,4 @@ inline Size &LandscapeSwap(Size &rSize) return rSize; } -// Masze f"ur Standard- Papiergr"ossen: -// Berechnungsformel: X twips = Y mm * 14400 / 254 (ungerundet!) - -const long lA0Width = 47678; // A0 841mm -const long lA0Height = 67407; // A0 1189mm -const long lA1Width = 33675; // A1 594mm -const long lA1Height = lA0Width; // A1 -const long lA2Width = 23811; // A2 420mm -const long lA2Height = lA1Width; // A2 -const long lA3Width = 16837; // A3 297mm -const long lA3Height = lA2Width; // A3 420mm -const long lA4Width = 11905; // A4 210mm -const long lA4Height = lA3Width; // A4 -const long lA5Width = 8390; // A5 148mm -const long lA5Height = lA4Width; // A5 - -const long lB4Width = 14173; // B4 250mm -const long lB4Height = 20012; // B4 353mm -const long lB5Width = 9977; // B5 176mm -const long lB5Height = lB4Width; // B5 -const long lB6Width = 7086; -const long lB6Height = lB5Width; - -const long lC4Width = 12983; -const long lC4Height = 18368; -const long lC5Width = 9184; -const long lC5Height = lC4Width; -const long lC6Width = 6463; -const long lC6Height = lC5Width; -const long lC65Width = 6463; -const long lC65Height = 12870; -const long lDLWidth = 6236; -const long lDLHeight = 12472; - -const long lJISB4Width = 14570; -const long lJISB4Height = 20636; -const long lJISB5Width = 10318; -const long lJISB5Height = lJISB4Width; -const long lJISB6Width = 7256; -const long lJISB6Height = lJISB5Width; - -// Die folgenden Daten stammen vom WinWord und sind noch -// nicht nach der obigen Formel, -// sondern per 1cm = 567 twips oder 1 Zoll = 1440 twips berechnet worden: - -const long lLetterWidth = 12240; // LETTER -const long lLetterHeight = 15840; // LETTER -const long lLegalWidth = lLetterWidth; // LEGAL -const long lLegalHeight = 20163; // LEGAL -const long lTabloidWidth = 15850; // TABLOID -const long lTabloidHeight = 24450; // TABLOID - -const long lDiaWidth = 10206; // DIA -const long lDiaHeight = 15309; // DIA -const long lScreenWidth = 11905; // SCREEN -const long lScreenHeight = 15874; // SCREEN - -const long lAWidth = 12240; // A 8,5 Zoll -const long lAHeight = 15840; // A 11 Zoll -const long lBWidth = lAHeight; // B -const long lBHeight = 24480; // B 17 Zoll -const long lCWidth = lBHeight; // C -const long lCHeight = 31680; // C 22 Zoll -const long lDWidth = lCHeight; // D -const long lDHeight = 48960; // D 34 Zoll -const long lEWidth = lDHeight; // E -const long lEHeight = 63360; // E 44 Zoll - -const long lExeWidth = 10440; // Executive 7,25 Zoll -const long lExeHeight = 15120; // Executive 10,5 Zoll -const long lLegal2Width = 12240; // Legal2 8,5 Zoll -const long lLegal2Height = 18720; // Legal2 13 Zoll -const long lCom675Width = 5220; // COM-6 3/4 3,625 Zoll -const long lCom675Height = 9360; // COM-6 3/4 6,5 Zoll -const long lCom9Width = 5580; // COM-9 3,875 Zoll -const long lCom9Height = 12780; // COM-9 8,875 Zoll -const long lCom10Width = 5940; // COM-10 4,125 Zoll -const long lCom10Height = 13680; // COM-10 9,5 Zoll -const long lCom11Width = 6480; // COM-11 4,5 Zoll -const long lCom11Height = 14940; // COM-11 10,375 Zoll -const long lCom12Width = 6840; // COM-12 4,75 Zoll -const long lCom12Height = lAHeight; // COM-12 11 Zoll -const long lMonarchWidth = lCom9Width; // Monarch 3,875 Zoll -const long lMonarchHeight = 10800; // Monarch 7,5 Zoll - -const long lKai16Width = 10433; // 16 kai 18,4 cm -const long lKai16Height = 14742; // 16 kai 26 cm -const long lKai32Width = 7371; // 32 kai 13 cm -const long lKai32Height = lKai16Width; // 32 kai 18,4 cm -const long lKai32BigWidth = 7938; // 32 kai gross 14 cm -const long lKai32BigHeight = 11510; // 32 kai gross 20,3 cm - #endif - diff --git a/svx/inc/svx/svxenum.hxx b/svx/inc/svx/svxenum.hxx index 235128039fe4..01a7d80d1351 100644 --- a/svx/inc/svx/svxenum.hxx +++ b/svx/inc/svx/svxenum.hxx @@ -143,49 +143,6 @@ enum SvxCellOrientation SVX_ORIENTATION_STACKED }; -enum SvxPaper -{ - SVX_PAPER_A0, - SVX_PAPER_A1, - SVX_PAPER_A2, - SVX_PAPER_A3, // Aus SV.XXX - SVX_PAPER_A4, - SVX_PAPER_A5, - SVX_PAPER_B4, - SVX_PAPER_B5, - SVX_PAPER_LETTER, - SVX_PAPER_LEGAL, - SVX_PAPER_TABLOID, - SVX_PAPER_USER, - SVX_PAPER_B6, // SVX_-Erweiterungen - SVX_PAPER_C4, - SVX_PAPER_C5, - SVX_PAPER_C6, - SVX_PAPER_C65, - SVX_PAPER_DL, - SVX_PAPER_DIA, - SVX_PAPER_SCREEN, - SVX_PAPER_A, - SVX_PAPER_B, - SVX_PAPER_C, - SVX_PAPER_D, - SVX_PAPER_E, - SVX_PAPER_EXECUTIVE, - SVX_PAPER_LEGAL2, - SVX_PAPER_MONARCH, - SVX_PAPER_COM675, - SVX_PAPER_COM9, - SVX_PAPER_COM10, - SVX_PAPER_COM11, - SVX_PAPER_COM12, - SVX_PAPER_KAI16, - SVX_PAPER_KAI32, - SVX_PAPER_KAI32BIG, - SVX_PAPER_B4_JIS, - SVX_PAPER_B5_JIS, - SVX_PAPER_B6_JIS -}; - enum SvxDrawToolEnum { SVX_SNAP_DRAW_SELECT, diff --git a/svx/source/cui/page.cxx b/svx/source/cui/page.cxx index 140a7cb646ab..deb57fbddfb1 100644 --- a/svx/source/cui/page.cxx +++ b/svx/source/cui/page.cxx @@ -310,8 +310,8 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) : bLandscape ( FALSE ), eMode ( SVX_PAGE_MODE_STANDARD ), - ePaperStart ( SVX_PAPER_A3 ), - ePaperEnd ( SVX_PAPER_DL ), + ePaperStart ( PAPER_A3 ), + ePaperEnd ( PAPER_ENV_DL ), pImpl ( new SvxPage_Impl ) { @@ -455,6 +455,7 @@ void SvxPageDescPage::Init_Impl() // Handler einstellen aLayoutBox.SetSelectHdl( LINK( this, SvxPageDescPage, LayoutHdl_Impl ) ); + aPaperSizeBox.SetDropDownLineCount(10); aPaperTrayBox.SetGetFocusHdl( LINK( this, SvxPageDescPage, PaperBinHdl_Impl ) ); @@ -606,11 +607,11 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet ) if ( bLandscape ) Swap( aTmpSize ); // aktuelles Format - SvxPaper ePaper = SvxPaperInfo::GetPaper( aTmpSize, (MapUnit)eUnit, TRUE ); + Paper ePaper = SvxPaperInfo::GetSvxPaper( aTmpSize, (MapUnit)eUnit, TRUE ); USHORT nActPos = LISTBOX_ENTRY_NOTFOUND; USHORT nAryId = RID_SVXSTRARY_PAPERSIZE_STD; - if ( ePaperStart != SVX_PAPER_A3 ) + if ( ePaperStart != PAPER_A3 ) nAryId = RID_SVXSTRARY_PAPERSIZE_DRAW; ResStringArray aPaperAry( SVX_RES( nAryId ) ); sal_uInt32 nCnt = aPaperAry.Count(); @@ -618,7 +619,7 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet ) for ( sal_uInt32 i = 0; i < nCnt; ++i ) { String aStr = aPaperAry.GetString(i); - SvxPaper eSize = (SvxPaper)aPaperAry.GetValue(i); + Paper eSize = (Paper)aPaperAry.GetValue(i); USHORT nPos = aPaperSizeBox.InsertEntry( aStr ); aPaperSizeBox.SetEntryData( nPos, (void*)(ULONG)eSize ); @@ -825,11 +826,11 @@ BOOL SvxPageDescPage::FillItemSet( SfxItemSet& rSet ) } nPos = aPaperSizeBox.GetSelectEntryPos(); - SvxPaper ePaper = (SvxPaper)(ULONG)aPaperSizeBox.GetEntryData( nPos ); + Paper ePaper = (Paper)(ULONG)aPaperSizeBox.GetEntryData( nPos ); const USHORT nOld = aPaperSizeBox.GetSavedValue(); BOOL bChecked = aLandscapeBtn.IsChecked(); - if ( SVX_PAPER_USER == ePaper ) + if ( PAPER_USER == ePaper ) { if ( nOld != nPos || aPaperWidthEdit.IsValueModified() || @@ -1039,9 +1040,9 @@ IMPL_LINK( SvxPageDescPage, PaperBinHdl_Impl, ListBox *, EMPTYARG ) IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox ) { const USHORT nPos = pBox->GetSelectEntryPos(); - SvxPaper ePaper = (SvxPaper)(ULONG)aPaperSizeBox.GetEntryData( nPos ); + Paper ePaper = (Paper)(ULONG)aPaperSizeBox.GetEntryData( nPos ); - if ( ePaper != SVX_PAPER_USER ) + if ( ePaper != PAPER_USER ) { Size aSize( SvxPaperInfo::GetPaperSize( ePaper ) ); @@ -1067,7 +1068,7 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox ) { // Draw: bei Papierformat soll der Rand 1cm betragen long nTmp = 0; - BOOL bScreen = ( SVX_PAPER_SCREEN == ePaper ); + BOOL bScreen = ( PAPER_SCREEN == ePaper ); if ( !bScreen ) // bei Bildschirm keinen Rand @@ -1116,12 +1117,12 @@ IMPL_LINK( SvxPageDescPage, PaperSizeModify_Impl, Edit *, EMPTYARG ) SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWhich ); Size aSize( GetCoreValue( aPaperWidthEdit, eUnit ), GetCoreValue( aPaperHeightEdit, eUnit ) ); - SvxPaper ePaper = SvxPaperInfo::GetPaper( aSize, (MapUnit)eUnit, TRUE ); + Paper ePaper = SvxPaperInfo::GetSvxPaper( aSize, (MapUnit)eUnit, TRUE ); USHORT nEntryCount = aPaperSizeBox.GetEntryCount(); for ( USHORT i = 0; i < nEntryCount; ++i ) { - SvxPaper eTmp = (SvxPaper)(ULONG)aPaperSizeBox.GetEntryData(i); + Paper eTmp = (Paper)(ULONG)aPaperSizeBox.GetEntryData(i); if ( eTmp == ePaper ) { @@ -1478,9 +1479,9 @@ int SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet ) // Wenn nicht, dann den Anwender fragen, ob sie "ubernommen werden sollen. // Wenn nicht, dann auf der TabPage bleiben. USHORT nPos = aPaperSizeBox.GetSelectEntryPos(); - SvxPaper ePaper = (SvxPaper)(ULONG)aPaperSizeBox.GetEntryData( nPos ); + Paper ePaper = (Paper)(ULONG)aPaperSizeBox.GetEntryData( nPos ); - if ( ePaper != SVX_PAPER_SCREEN && IsMarginOutOfRange() ) + if ( ePaper != PAPER_SCREEN && IsMarginOutOfRange() ) { if ( QueryBox( this, WB_YES_NO | WB_DEF_NO, aPrintRangeQueryText ).Execute() == RET_NO ) { @@ -1775,7 +1776,7 @@ void SvxPageDescPage::PageCreated (SfxAllItemSet aSet) //add CHINA001 if (pModeItem) SetMode((SvxModeType)pModeItem->GetEnumValue()); if (pPaperStartItem && pPaperEndItem) - SetPaperFormatRanges( (SvxPaper)pPaperStartItem->GetEnumValue(), (SvxPaper)pPaperEndItem->GetEnumValue() ); + SetPaperFormatRanges( (Paper)pPaperStartItem->GetEnumValue(), (Paper)pPaperEndItem->GetEnumValue() ); if (pCollectListItem) SetCollectionList(pCollectListItem->GetList()); } diff --git a/svx/source/cui/page.h b/svx/source/cui/page.h index 60f962565d33..4a114b278cca 100644 --- a/svx/source/cui/page.h +++ b/svx/source/cui/page.h @@ -38,13 +38,13 @@ #define PAPERSIZE_A3 3 #define PAPERSIZE_A4 4 #define PAPERSIZE_A5 5 -#define PAPERSIZE_B4 6 -#define PAPERSIZE_B5 7 +#define PAPERSIZE_B4_ISO 6 +#define PAPERSIZE_B5_ISO 7 #define PAPERSIZE_LETTER 8 #define PAPERSIZE_LEGAL 9 #define PAPERSIZE_TABLOID 10 #define PAPERSIZE_USER 11 -#define PAPERSIZE_B6 12 +#define PAPERSIZE_B6_ISO 12 #define PAPERSIZE_C4 13 #define PAPERSIZE_C5 14 #define PAPERSIZE_C6 15 @@ -52,24 +52,22 @@ #define PAPERSIZE_DL 17 #define PAPERSIZE_DIA 18 #define PAPERSIZE_SCREEN 19 -#define PAPERSIZE_A 20 -#define PAPERSIZE_B 21 -#define PAPERSIZE_C 22 -#define PAPERSIZE_D 23 -#define PAPERSIZE_E 24 -#define PAPERSIZE_EXECUTIVE 25 -#define PAPERSIZE_LEGAL2 26 -#define PAPERSIZE_MONARCH 27 -#define PAPERSIZE_COM675 28 -#define PAPERSIZE_COM9 29 -#define PAPERSIZE_COM10 30 -#define PAPERSIZE_COM11 31 -#define PAPERSIZE_COM12 32 -#define PAPERSIZE_KAI16 33 -#define PAPERSIZE_KAI32 34 -#define PAPERSIZE_KAI32BIG 35 -#define PAPERSIZE_B4_JIS 36 -#define PAPERSIZE_B5_JIS 37 +#define PAPERSIZE_C 20 +#define PAPERSIZE_D 21 +#define PAPERSIZE_E 22 +#define PAPERSIZE_EXECUTIVE 23 +#define PAPERSIZE_LEGAL2 24 +#define PAPERSIZE_MONARCH 25 +#define PAPERSIZE_COM675 26 +#define PAPERSIZE_COM9 27 +#define PAPERSIZE_COM10 29 +#define PAPERSIZE_COM11 29 +#define PAPERSIZE_COM12 30 +#define PAPERSIZE_KAI16 31 +#define PAPERSIZE_KAI32 32 +#define PAPERSIZE_KAI32BIG 33 +#define PAPERSIZE_B4_JIS 34 +#define PAPERSIZE_B5_JIS 35 #define PAPERSIZE_B6_JIS 38 #endif diff --git a/svx/source/cui/page.hxx b/svx/source/cui/page.hxx index 5b04e91ac387..a1fae0536af8 100644 --- a/svx/source/cui/page.hxx +++ b/svx/source/cui/page.hxx @@ -53,6 +53,9 @@ #include <svx/frmdirlbox.hxx> #include <svx/svxenum.hxx> + +#include <i18npool/paper.hxx> + #include "flagsdef.hxx" //CHINA001 // enum ------------------------------------------------------------------ @@ -183,8 +186,8 @@ class SvxPageDescPage : public SfxTabPage BOOL bLandscape; FASTBOOL bBorderModified; SvxModeType eMode; - SvxPaper ePaperStart; - SvxPaper ePaperEnd; + Paper ePaperStart; + Paper ePaperEnd; SvxPage_Impl* pImpl; @@ -242,7 +245,7 @@ public: virtual ~SvxPageDescPage(); void SetMode( SvxModeType eMType ) { eMode = eMType; } - void SetPaperFormatRanges( SvxPaper eStart, SvxPaper eEnd ) + void SetPaperFormatRanges( Paper eStart, Paper eEnd ) { ePaperStart = eStart, ePaperEnd = eEnd; } void SetCollectionList(const List* pList); diff --git a/svx/source/cui/page.src b/svx/source/cui/page.src index 697f1416b47c..6a44e41729a7 100644 --- a/svx/source/cui/page.src +++ b/svx/source/cui/page.src @@ -399,11 +399,11 @@ String RID_SVXSTR_PAPER_A5 { Text = "A5" ; }; -String RID_SVXSTR_PAPER_B4 +String RID_SVXSTR_PAPER_B4_ISO { Text = "B4 (ISO)" ; }; -String RID_SVXSTR_PAPER_B5 +String RID_SVXSTR_PAPER_B5_ISO { Text = "B5 (ISO)" ; }; @@ -423,46 +423,38 @@ String RID_SVXSTR_PAPER_USER { Text [ en-US ] = "User Defined" ; }; -String RID_SVXSTR_PAPER_B6 +String RID_SVXSTR_PAPER_B6_ISO { Text = "B6 (ISO)" ; }; String RID_SVXSTR_PAPER_C4 { - Text = "C4" ; + Text = "C4 Envelope" ; }; String RID_SVXSTR_PAPER_C5 { - Text = "C5" ; + Text = "C5 Envelope" ; }; String RID_SVXSTR_PAPER_C6 { - Text = "C6" ; + Text = "C6 Envelope" ; }; String RID_SVXSTR_PAPER_C65 { - Text = "C6/5" ; + Text = "C6/5 Envelope" ; }; String RID_SVXSTR_PAPER_DL { - Text = "DL" ; + Text = "DL Envelope" ; }; String RID_SVXSTR_PAPER_DIA { - Text = "Dia" ; + Text = "Dia Slide" ; }; String RID_SVXSTR_PAPER_SCREEN { Text [ en-US ] = "Screen" ; }; -String RID_SVXSTR_PAPER_A -{ - Text = "A" ; -}; -String RID_SVXSTR_PAPER_B -{ - Text = "B" ; -}; String RID_SVXSTR_PAPER_C { Text = "C" ; @@ -477,47 +469,47 @@ String RID_SVXSTR_PAPER_E }; String RID_SVXSTR_PAPER_EXECUTIVE { - Text = "Executive" ; + Text = "Executive" ; }; String RID_SVXSTR_PAPER_LEGAL2 { - Text = "Legal" ; + Text = "Long Bond" ; }; String RID_SVXSTR_PAPER_MONARCH { - Text = "Monarch" ; + Text = "#8 (Monarch) Envelope" ; }; String RID_SVXSTR_PAPER_COM675 { - Text = "Env. 6¾" ; + Text = "#6 3/4 (Personal) Envelope" ; }; String RID_SVXSTR_PAPER_COM9 { - Text = "Env. 9" ; + Text = "#9 Envelope" ; }; String RID_SVXSTR_PAPER_COM10 { - Text = "Env. 10" ; + Text = "#10 Envelope" ; }; String RID_SVXSTR_PAPER_COM11 { - Text = "Env. 11" ; + Text = "#11 Envelope" ; }; String RID_SVXSTR_PAPER_COM12 { - Text = "Env. 12" ; + Text = "#12 Envelope" ; }; String RID_SVXSTR_PAPER_KAI16 { - Text = "16 kai" ; + Text = "16 Kai" ; }; String RID_SVXSTR_PAPER_KAI32 { - Text = "32 kai" ; + Text = "32 Kai" ; }; String RID_SVXSTR_PAPER_KAI32BIG { - Text = "32 kai big" ; + Text = "Big 32 Kai" ; }; String RID_SVXSTR_PAPER_B4_JIS { @@ -535,67 +527,69 @@ StringArray RID_SVXSTRARY_PAPERSIZE_STD { ItemList [ en-US ] = { - < "A3" ; PAPERSIZE_A3 ; > ; - < "A4" ; PAPERSIZE_A4 ; > ; < "A5" ; PAPERSIZE_A5 ; > ; - < "B4 (ISO)" ; PAPERSIZE_B4 ; > ; - < "B5 (ISO)" ; PAPERSIZE_B5 ; > ; - < "B6 (ISO)" ; PAPERSIZE_B6 ; > ; - < "B4 (JIS)" ; PAPERSIZE_B4_JIS ; > ; - < "B5 (JIS)" ; PAPERSIZE_B5_JIS ; > ; - < "B6 (JIS)" ; PAPERSIZE_B6_JIS ; > ; + < "A4" ; PAPERSIZE_A4 ; > ; + < "A3" ; PAPERSIZE_A3 ; > ; + < "B6 (ISO)" ; PAPERSIZE_B6_ISO ; > ; + < "B5 (ISO)" ; PAPERSIZE_B5_ISO ; > ; + < "B4 (ISO)" ; PAPERSIZE_B4_ISO ; > ; < "Letter" ; PAPERSIZE_LETTER ; > ; < "Legal" ; PAPERSIZE_LEGAL ; > ; + < "Long Bond" ; PAPERSIZE_LEGAL2 ; > ; < "Tabloid" ; PAPERSIZE_TABLOID ; > ; + < "B6 (JIS)" ; PAPERSIZE_B6_JIS ; > ; + < "B5 (JIS)" ; PAPERSIZE_B5_JIS ; > ; + < "B4 (JIS)" ; PAPERSIZE_B4_JIS ; > ; + < "16 Kai" ; PAPERSIZE_KAI16; > ; + < "32 Kai" ; PAPERSIZE_KAI32; > ; + < "Big 32 Kai" ; PAPERSIZE_KAI32BIG; > ; < "User" ; PAPERSIZE_USER ; > ; - < "C4" ; PAPERSIZE_C4 ; > ; - < "C5" ; PAPERSIZE_C5 ; > ; - < "C6" ; PAPERSIZE_C6 ; > ; - < "C6/5" ; PAPERSIZE_C65 ; > ; - < "DL" ; PAPERSIZE_DL ; > ; - < "Env. #6¾" ; PAPERSIZE_COM675; > ; - < "Env. Monarch" ; PAPERSIZE_MONARCH; > ; - < "Env. #9" ; PAPERSIZE_COM9; > ; - < "Env. #10" ; PAPERSIZE_COM10; > ; - < "Env. #11" ; PAPERSIZE_COM11; > ; - < "Env. #12" ; PAPERSIZE_COM12; > ; - < "16 kai" ; PAPERSIZE_KAI16; > ; - < "32 kai" ; PAPERSIZE_KAI32; > ; - < "32 kai large" ; PAPERSIZE_KAI32BIG; > ; - }; + < "DL Envelope" ; PAPERSIZE_DL ; > ; + < "C6 Envelope" ; PAPERSIZE_C6 ; > ; + < "C6/5 Envelope" ; PAPERSIZE_C65 ; > ; + < "C5 Envelope" ; PAPERSIZE_C5 ; > ; + < "C4 Envelope" ; PAPERSIZE_C4 ; > ; + < "#6 3/4 (Personal) Envelope" ; PAPERSIZE_COM675; > ; + < "#8 (Monarch) Envelope" ; PAPERSIZE_MONARCH; > ; + < "#9 Envelope" ; PAPERSIZE_COM9; > ; + < "#10 Envelope" ; PAPERSIZE_COM10; > ; + < "#11 Envelope" ; PAPERSIZE_COM11; > ; + < "#12 Envelope" ; PAPERSIZE_COM12; > ; }; +}; StringArray RID_SVXSTRARY_PAPERSIZE_DRAW { ItemList [ en-US ] = { - < "A0" ; PAPERSIZE_A0 ; > ; - < "A1" ; PAPERSIZE_A1 ; > ; - < "A2" ; PAPERSIZE_A2 ; > ; - < "A3" ; PAPERSIZE_A3 ; > ; - < "A4" ; PAPERSIZE_A4 ; > ; < "A5" ; PAPERSIZE_A5 ; > ; - < "B4 (ISO)" ; PAPERSIZE_B4 ; > ; - < "B5 (ISO)" ; PAPERSIZE_B5 ; > ; - < "B6 (ISO)" ; PAPERSIZE_B6 ; > ; - < "B4 (JIS)" ; PAPERSIZE_B4_JIS ; > ; - < "B5 (JIS)" ; PAPERSIZE_B5_JIS ; > ; - < "B6 (JIS)" ; PAPERSIZE_B6_JIS ; > ; + < "A4" ; PAPERSIZE_A4 ; > ; + < "A3" ; PAPERSIZE_A3 ; > ; + < "A2" ; PAPERSIZE_A2 ; > ; + < "A1" ; PAPERSIZE_A1 ; > ; + < "A0" ; PAPERSIZE_A0 ; > ; + < "B6 (ISO)" ; PAPERSIZE_B6_ISO ; > ; + < "B5 (ISO)" ; PAPERSIZE_B5_ISO ; > ; + < "B4 (ISO)" ; PAPERSIZE_B4_ISO ; > ; < "Letter" ; PAPERSIZE_LETTER ; > ; < "Legal" ; PAPERSIZE_LEGAL ; > ; + < "Long Bond" ; PAPERSIZE_LEGAL2 ; > ; < "Tabloid" ; PAPERSIZE_TABLOID ; > ; + < "B6 (JIS)" ; PAPERSIZE_B6_JIS ; > ; + < "B5 (JIS)" ; PAPERSIZE_B5_JIS ; > ; + < "B4 (JIS)" ; PAPERSIZE_B4_JIS ; > ; + < "16 Kai" ; PAPERSIZE_KAI16; > ; + < "32 Kai" ; PAPERSIZE_KAI32; > ; + < "Big 32 Kai" ; PAPERSIZE_KAI32BIG; > ; < "User" ; PAPERSIZE_USER ; > ; - < "C4" ; PAPERSIZE_C4 ; > ; - < "C5" ; PAPERSIZE_C5 ; > ; - < "C6" ; PAPERSIZE_C6 ; > ; - < "C6/5" ; PAPERSIZE_C65 ; > ; - < "DL" ; PAPERSIZE_DL ; > ; - < "Slide" ; PAPERSIZE_DIA ; > ; + < "DL Envelope" ; PAPERSIZE_DL ; > ; + < "C6 Envelope" ; PAPERSIZE_C6 ; > ; + < "C6/5 Envelope" ; PAPERSIZE_C65 ; > ; + < "C5 Envelope" ; PAPERSIZE_C5 ; > ; + < "C4 Envelope" ; PAPERSIZE_C4 ; > ; + < "Dia Slide" ; PAPERSIZE_DIA ; > ; < "Screen" ; PAPERSIZE_SCREEN ; > ; - < "16 kai" ; PAPERSIZE_KAI16; > ; - < "32 kai" ; PAPERSIZE_KAI32; > ; - < "32 kai large" ; PAPERSIZE_KAI32BIG; > ; - }; }; +}; String RID_SVXSTR_PAPERBIN { Text [ en-US ] = "Paper tray" ; diff --git a/svx/source/items/paperinf.cxx b/svx/source/items/paperinf.cxx index 234b5548567d..161d7af1aba9 100644 --- a/svx/source/items/paperinf.cxx +++ b/svx/source/items/paperinf.cxx @@ -44,129 +44,6 @@ #include <svx/paperinf.hxx> #include <svx/dialmgr.hxx> -#define SVX_PAPER_OFFSET 3 // Anfang: enum Paper A3 - SvxPaper A0; Diff=3 - -// STATIC DATA ----------------------------------------------------------- - -static Size __FAR_DATA aDinTab[] = -{ - Size(lA0Width,lA0Height), // A0 - Size(lA1Width,lA1Height), // A1 - Size(lA2Width,lA2Height), // A2 - Size(lA3Width,lA3Height), // A3 - Size(lA4Width,lA4Height), // A4 - Size(lA5Width,lA5Height), // A5 - Size(lB4Width, lB4Height), // B4 - Size(lB5Width,lB5Height), // B5 - Size(lLetterWidth,lLetterHeight), // LETTER - Size(lLegalWidth,lLegalHeight), // LEGAL - Size(lTabloidWidth,lTabloidHeight), // TABLOID - Size(0, 0), // USER - Size(lB6Width, lB6Height), // B6 - Size(lC4Width, lC4Height), // C4 - Size(lC5Width, lC5Height), // C5 - Size(lC6Width, lC6Height), // C6 - Size(lC65Width, lC65Height), // C65 - Size(lDLWidth, lDLHeight), // DL - Size(lDiaWidth,lDiaHeight ), // DIA - Size(lScreenWidth, lScreenHeight), // SCREEN - Size(lAWidth, lAHeight), // A - Size(lBWidth, lBHeight), // B - Size(lCWidth, lCHeight), // C - Size(lDWidth, lDHeight), // D - Size(lEWidth, lEHeight), // E - Size(lExeWidth, lExeHeight), // Executive - Size(lLegal2Width, lLegal2Height), // Legal2 - Size(lMonarchWidth, lMonarchHeight),// Monarch - Size(lCom675Width, lCom675Height), // COM-6 3/4 - Size(lCom9Width, lCom9Height), // COM-9 - Size(lCom10Width, lCom10Height), // COM-10 - Size(lCom11Width, lCom11Height), // COM-11 - Size(lCom12Width, lCom12Height), // COM-12 - Size(lKai16Width, lKai16Height), // 16 kai - Size(lKai32Width, lKai32Height), // 32 kai - Size(lKai32BigWidth, lKai32BigHeight), // 32 kai gross - Size(lJISB4Width, lJISB4Height), // B4 (JIS) - Size(lJISB5Width, lJISB5Height), // B5 (JIS) - Size(lJISB6Width, lJISB6Height) // B6 (JIS) -}; - -static const int nTabSize = sizeof(aDinTab) / sizeof(aDinTab[0]); - -// ----------------------------------------------------------------------- - -long TwipsTo100thMM( long nIn ) -{ - long nRet = OutputDevice::LogicToLogic( nIn, MAP_TWIP, MAP_100TH_MM ); - long nTmp = nRet % 10; - - if ( nTmp ) - nRet += 10 - nTmp; - return nRet; -} - -// ----------------------------------------------------------------------- - -Size ConvertTo100thMM( Size& rSize ) -{ - // Convert form TWIPS to 100TH_MM - long nW = TwipsTo100thMM( rSize.Width() ); - long nH = TwipsTo100thMM( rSize.Height() ); - - rSize.Width() = nW; - rSize.Height() = nH; - return rSize; -} - -// ----------------------------------------------------------------------- - -long HundMMToTwips( long nIn ) -{ - long nRet = OutputDevice::LogicToLogic( nIn, MAP_100TH_MM, MAP_TWIP ); - return nRet; -} - -// ----------------------------------------------------------------------- - -Size ConvertToTwips( Size& rSize ) -{ - // Convert form TWIPS to 100TH_MM - long nW = HundMMToTwips( rSize.Width() ); - long nH = HundMMToTwips( rSize.Height() ); - - rSize.Width() = nW; - rSize.Height() = nH; - return rSize; -} - -// ----------------------------------------------------------------------- - -SvxPaper GetPaper_Impl( const Size &rSize, MapUnit eUnit, BOOL bSloppy ) -{ - DBG_ASSERT( eUnit == MAP_TWIP || eUnit == MAP_100TH_MM, - "map unit not supported" ); - Size aSize = rSize; - - if ( eUnit == MAP_100TH_MM ) - ConvertToTwips( aSize ); - - for ( USHORT i = 0; i < nTabSize; i++ ) - { - if ( aDinTab[i] == aSize ) - return (SvxPaper)i; - else if ( bSloppy ) - { - long lDiffW = Abs(aDinTab[i].Width () - aSize.Width ()), - lDiffH = Abs(aDinTab[i].Height() - aSize.Height()); - - if ( lDiffW < 6 && lDiffH < 6 ) - return (SvxPaper)i; - } - } - return SVX_PAPER_USER; -} - - /*-------------------------------------------------------------------- Beschreibung: Ist der Printer gueltig --------------------------------------------------------------------*/ @@ -176,22 +53,13 @@ inline BOOL IsValidPrinter( const Printer* pPtr ) return pPtr->GetName().Len() ? TRUE : FALSE; } -/*------------------------------------------------------------------------ - Beschreibung: Konvertierung eines SV-Defines fuer Papiergroesse in - Twips. - Funktioniert logischerweise nicht fuer User Groessen - (ASSERT). -------------------------------------------------------------------------*/ +//------------------------------------------------------------------------ -Size SvxPaperInfo::GetPaperSize( SvxPaper ePaper, MapUnit eUnit ) +Size SvxPaperInfo::GetPaperSize( Paper ePaper, MapUnit eUnit ) { - DBG_ASSERT( ePaper < nTabSize, "Tabelle der Papiergroessen ueberindiziert" ); - DBG_ASSERT( eUnit == MAP_TWIP || eUnit == MAP_100TH_MM, "this MapUnit not supported" ); - Size aSize = aDinTab[ePaper]; // in Twips - - if ( eUnit == MAP_100TH_MM ) - ConvertTo100thMM( aSize ); - return aSize; + PaperInfo aInfo(ePaper); + Size aRet(aInfo.getWidth(), aInfo.getHeight()); // in 100thMM + return eUnit == MAP_100TH_MM ? aRet : OutputDevice::LogicToLogic(aRet, MAP_100TH_MM, eUnit); } /*------------------------------------------------------------------------ @@ -201,21 +69,25 @@ Size SvxPaperInfo::GetPaperSize( SvxPaper ePaper, MapUnit eUnit ) wird DIN A4 Portrait als Defaultpapiergroesse geliefert. ------------------------------------------------------------------------*/ +//Is this method may be confused about the units it returns ? +//Always returns TWIPS for known paper sizes or on failure. +//But in the case of PAPER_USER paper and with a Printer with a mapmode set +//will return in those printer units ? Size SvxPaperInfo::GetPaperSize( const Printer* pPrinter ) { if ( !IsValidPrinter(pPrinter) ) - return GetPaperSize( SVX_PAPER_A4 ); - const SvxPaper ePaper = (SvxPaper)(pPrinter->GetPaper() + SVX_PAPER_OFFSET); + return GetPaperSize( PAPER_A4 ); + const Paper ePaper = pPrinter->GetPaper(); - if ( ePaper == SVX_PAPER_USER ) + if ( ePaper == PAPER_USER ) { - // Orientation nicht beruecksichtigen, da durch SV bereits - // die richtigen Masze eingestellt worden sind. + // Orientation nicht beruecksichtigen, da durch SV bereits + // die richtigen Masze eingestellt worden sind. Size aPaperSize = pPrinter->GetPaperSize(); const Size aInvalidSize; if ( aPaperSize == aInvalidSize ) - return GetPaperSize(SVX_PAPER_A4); + return GetPaperSize(PAPER_A4); MapMode aMap1 = pPrinter->GetMapMode(); MapMode aMap2; @@ -233,64 +105,33 @@ Size SvxPaperInfo::GetPaperSize( const Printer* pPrinter ) return aSize; } -/*------------------------------------------------------------------------ - Beschreibung: Konvertierung einer Papiergroesse in Twips in das - SV-Define. Ist bSloppy TRUE, so wird nur auf 1/10 mm genau - verglichen. -------------------------------------------------------------------------*/ +// ----------------------------------------------------------------------- -SvxPaper SvxPaperInfo::GetPaper( const Size &rSize, MapUnit eUnit, BOOL bSloppy ) +Paper SvxPaperInfo::GetSvxPaper( const Size &rSize, MapUnit eUnit, bool bSloppy ) { - return GetPaper_Impl( rSize, eUnit, bSloppy ); + Size aSize(eUnit == MAP_100TH_MM ? rSize : OutputDevice::LogicToLogic(rSize, eUnit, MAP_100TH_MM)); + PaperInfo aInfo(aSize.Width(), aSize.Height()); + if (bSloppy) + aInfo.doSloppyFit(); + return aInfo.getPaper(); } // ----------------------------------------------------------------------- -SvxPaper SvxPaperInfo::GetSvxPaper( const Size &rSize, MapUnit eUnit, BOOL bSloppy ) +long SvxPaperInfo::GetSloppyPaperDimension( long nSize, MapUnit eUnit ) { - return GetPaper_Impl( rSize, eUnit, bSloppy ); -} - -SvxPaper SvxPaperInfo::GetDefaultSvxPaper( LanguageType eLanguage ) -{ - SvxPaper ePaper; - switch ( eLanguage ) - { - case LANGUAGE_ENGLISH_US: - case LANGUAGE_ENGLISH_CAN: - case LANGUAGE_FRENCH_CANADIAN: - case LANGUAGE_SPANISH_MEXICAN: - case LANGUAGE_SPANISH_VENEZUELA: - ePaper = SvxPaper( SVX_PAPER_LETTER ); - break; - default: - ePaper = SvxPaper( SVX_PAPER_A4 ); - } - return ePaper; + nSize = eUnit == MAP_100TH_MM ? nSize : OutputDevice::LogicToLogic(nSize, eUnit, MAP_100TH_MM); + nSize = PaperInfo::sloppyFitPageDimension(nSize); + return eUnit == MAP_100TH_MM ? nSize : OutputDevice::LogicToLogic(nSize, MAP_100TH_MM, eUnit); } // ----------------------------------------------------------------------- -Paper SvxPaperInfo::GetSvPaper( const Size &rSize, MapUnit eUnit, - BOOL bSloppy ) +Size SvxPaperInfo::GetDefaultPaperSize( MapUnit eUnit ) { - Paper eRet = PAPER_USER; - SvxPaper ePaper = GetPaper_Impl( rSize, eUnit, bSloppy ); - - switch ( ePaper ) - { - case SVX_PAPER_A3: eRet = PAPER_A3; break; - case SVX_PAPER_A4: eRet = PAPER_A4; break; - case SVX_PAPER_A5: eRet = PAPER_A5; break; - case SVX_PAPER_B4: eRet = PAPER_B4; break; - case SVX_PAPER_B5: eRet = PAPER_B5; break; - case SVX_PAPER_LETTER: eRet = PAPER_LETTER; break; - case SVX_PAPER_LEGAL: eRet = PAPER_LEGAL; break; - case SVX_PAPER_TABLOID: eRet = PAPER_TABLOID; break; - default: ;//prevent warning - } - - return eRet; + PaperInfo aInfo(PaperInfo::getSystemDefaultPaper()); + Size aRet(aInfo.getWidth(), aInfo.getHeight()); + return eUnit == MAP_100TH_MM ? aRet : OutputDevice::LogicToLogic(aRet, MAP_100TH_MM, eUnit); } /*------------------------------------------------------------------------ @@ -298,52 +139,49 @@ Paper SvxPaperInfo::GetSvPaper( const Size &rSize, MapUnit eUnit, Papiergroessen. ------------------------------------------------------------------------*/ -String SvxPaperInfo::GetName( SvxPaper ePaper ) +String SvxPaperInfo::GetName( Paper ePaper ) { USHORT nResId = 0; switch ( ePaper ) { - case SVX_PAPER_A0: nResId = RID_SVXSTR_PAPER_A0; break; - case SVX_PAPER_A1: nResId = RID_SVXSTR_PAPER_A1; break; - case SVX_PAPER_A2: nResId = RID_SVXSTR_PAPER_A2; break; - case SVX_PAPER_A3: nResId = RID_SVXSTR_PAPER_A3; break; - case SVX_PAPER_A4: nResId = RID_SVXSTR_PAPER_A4; break; - case SVX_PAPER_A5: nResId = RID_SVXSTR_PAPER_A5; break; - case SVX_PAPER_B4: nResId = RID_SVXSTR_PAPER_B4; break; - case SVX_PAPER_B5: nResId = RID_SVXSTR_PAPER_B5; break; - case SVX_PAPER_LETTER: nResId = RID_SVXSTR_PAPER_LETTER; break; - case SVX_PAPER_LEGAL: nResId = RID_SVXSTR_PAPER_LEGAL; break; - case SVX_PAPER_TABLOID: nResId = RID_SVXSTR_PAPER_TABLOID; break; - case SVX_PAPER_USER: nResId = RID_SVXSTR_PAPER_USER; break; - case SVX_PAPER_B6: nResId = RID_SVXSTR_PAPER_B6; break; - case SVX_PAPER_C4: nResId = RID_SVXSTR_PAPER_C4; break; - case SVX_PAPER_C5: nResId = RID_SVXSTR_PAPER_C5; break; - case SVX_PAPER_C6: nResId = RID_SVXSTR_PAPER_C6; break; - case SVX_PAPER_C65: nResId = RID_SVXSTR_PAPER_C65; break; - case SVX_PAPER_DL: nResId = RID_SVXSTR_PAPER_DL; break; - case SVX_PAPER_DIA: nResId = RID_SVXSTR_PAPER_DIA; break; - case SVX_PAPER_SCREEN: nResId = RID_SVXSTR_PAPER_SCREEN; break; - case SVX_PAPER_A: nResId = RID_SVXSTR_PAPER_A; break; - case SVX_PAPER_B: nResId = RID_SVXSTR_PAPER_B; break; - case SVX_PAPER_C: nResId = RID_SVXSTR_PAPER_C; break; - case SVX_PAPER_D: nResId = RID_SVXSTR_PAPER_D; break; - case SVX_PAPER_E: nResId = RID_SVXSTR_PAPER_E; break; - case SVX_PAPER_EXECUTIVE: nResId = RID_SVXSTR_PAPER_EXECUTIVE;break; - case SVX_PAPER_LEGAL2: nResId = RID_SVXSTR_PAPER_LEGAL2; break; - case SVX_PAPER_MONARCH: nResId = RID_SVXSTR_PAPER_MONARCH; break; - case SVX_PAPER_COM675: nResId = RID_SVXSTR_PAPER_COM675; break; - case SVX_PAPER_COM9: nResId = RID_SVXSTR_PAPER_COM9; break; - case SVX_PAPER_COM10: nResId = RID_SVXSTR_PAPER_COM10; break; - case SVX_PAPER_COM11: nResId = RID_SVXSTR_PAPER_COM11; break; - case SVX_PAPER_COM12: nResId = RID_SVXSTR_PAPER_COM12; break; - case SVX_PAPER_KAI16: nResId = RID_SVXSTR_PAPER_KAI16; break; - case SVX_PAPER_KAI32: nResId = RID_SVXSTR_PAPER_KAI32; break; - case SVX_PAPER_KAI32BIG: nResId = RID_SVXSTR_PAPER_KAI32BIG; break; - case SVX_PAPER_B4_JIS: nResId = RID_SVXSTR_PAPER_B4_JIS; break; - case SVX_PAPER_B5_JIS: nResId = RID_SVXSTR_PAPER_B5_JIS; break; - case SVX_PAPER_B6_JIS: nResId = RID_SVXSTR_PAPER_B6_JIS; break; - + case PAPER_A0: nResId = RID_SVXSTR_PAPER_A0; break; + case PAPER_A1: nResId = RID_SVXSTR_PAPER_A1; break; + case PAPER_A2: nResId = RID_SVXSTR_PAPER_A2; break; + case PAPER_A3: nResId = RID_SVXSTR_PAPER_A3; break; + case PAPER_A4: nResId = RID_SVXSTR_PAPER_A4; break; + case PAPER_A5: nResId = RID_SVXSTR_PAPER_A5; break; + case PAPER_B4_ISO: nResId = RID_SVXSTR_PAPER_B4_ISO; break; + case PAPER_B5_ISO: nResId = RID_SVXSTR_PAPER_B5_ISO; break; + case PAPER_LETTER: nResId = RID_SVXSTR_PAPER_LETTER; break; + case PAPER_LEGAL: nResId = RID_SVXSTR_PAPER_LEGAL; break; + case PAPER_TABLOID: nResId = RID_SVXSTR_PAPER_TABLOID; break; + case PAPER_USER: nResId = RID_SVXSTR_PAPER_USER; break; + case PAPER_B6_ISO: nResId = RID_SVXSTR_PAPER_B6_ISO; break; + case PAPER_ENV_C4: nResId = RID_SVXSTR_PAPER_C4; break; + case PAPER_ENV_C5: nResId = RID_SVXSTR_PAPER_C5; break; + case PAPER_ENV_C6: nResId = RID_SVXSTR_PAPER_C6; break; + case PAPER_ENV_C65: nResId = RID_SVXSTR_PAPER_C65; break; + case PAPER_ENV_DL: nResId = RID_SVXSTR_PAPER_DL; break; + case PAPER_SLIDE_DIA: nResId = RID_SVXSTR_PAPER_DIA; break; + case PAPER_SCREEN: nResId = RID_SVXSTR_PAPER_SCREEN; break; + case PAPER_C: nResId = RID_SVXSTR_PAPER_C; break; + case PAPER_D: nResId = RID_SVXSTR_PAPER_D; break; + case PAPER_E: nResId = RID_SVXSTR_PAPER_E; break; + case PAPER_EXECUTIVE: nResId = RID_SVXSTR_PAPER_EXECUTIVE;break; + case PAPER_FANFOLD_LEGAL_DE: nResId = RID_SVXSTR_PAPER_LEGAL2; break; + case PAPER_ENV_MONARCH: nResId = RID_SVXSTR_PAPER_MONARCH; break; + case PAPER_ENV_PERSONAL: nResId = RID_SVXSTR_PAPER_COM675; break; + case PAPER_ENV_9: nResId = RID_SVXSTR_PAPER_COM9; break; + case PAPER_ENV_10: nResId = RID_SVXSTR_PAPER_COM10; break; + case PAPER_ENV_11: nResId = RID_SVXSTR_PAPER_COM11; break; + case PAPER_ENV_12: nResId = RID_SVXSTR_PAPER_COM12; break; + case PAPER_KAI16: nResId = RID_SVXSTR_PAPER_KAI16; break; + case PAPER_KAI32: nResId = RID_SVXSTR_PAPER_KAI32; break; + case PAPER_KAI32BIG: nResId = RID_SVXSTR_PAPER_KAI32BIG; break; + case PAPER_B4_JIS: nResId = RID_SVXSTR_PAPER_B4_JIS; break; + case PAPER_B5_JIS: nResId = RID_SVXSTR_PAPER_B5_JIS; break; + case PAPER_B6_JIS: nResId = RID_SVXSTR_PAPER_B6_JIS; break; default: DBG_ERRORFILE( "unknown papersize" ); } diff --git a/svx/source/items/paraitem.cxx b/svx/source/items/paraitem.cxx index ebc9c9f59ac2..80af583638e8 100644 --- a/svx/source/items/paraitem.cxx +++ b/svx/source/items/paraitem.cxx @@ -1268,6 +1268,7 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) if( nNew <= nPos + 50 ) nNew += nDefDist; + long lA3Width = SvxPaperInfo::GetPaperSize(PAPER_A3).Width(); nCount = (sal_uInt16)(nNew < lA3Width ? ( lA3Width - nNew ) / nDefDist + 1 : 0); } diff --git a/svx/util/makefile.mk b/svx/util/makefile.mk index f3e180140cdd..f212284fa401 100644 --- a/svx/util/makefile.mk +++ b/svx/util/makefile.mk @@ -125,6 +125,7 @@ SHL1STDLIBS= \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(I18NISOLANGLIB) \ + $(I18NPAPERLIB) \ $(XMLSCRIPTLIB) \ $(COMPHELPERLIB) \ $(UCBHELPERLIB) \ |