diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-01-27 10:32:23 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-01-27 13:09:02 +0100 |
commit | e9ec6d58b58739ce43ff563fd78c2326e11d1741 (patch) | |
tree | 21013bfa082299e99c92e2084ec7861e6acd18c3 /sw/source | |
parent | 2233aa52da14ec85331aee1163b885fe9a9fb507 (diff) |
Revert "Removed list and numbering paragraph styles and related option page"
This reverts commits 359d0fbd03a68d9131e8fb25e7dac9f19ddf6dcb,
6a15a2898b7f822ddfba23553dd127e25af15fff and
21352f88caba9dee73d5a87c8e3724d17ac6b428.
This change is not mature enought: needs more work
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/number.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/doc/poolfmt.cxx | 197 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/app/appopt.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/config/fontcfg.cxx | 28 | ||||
-rw-r--r-- | sw/source/ui/config/optdlg.hrc | 26 | ||||
-rw-r--r-- | sw/source/ui/config/optdlg.src | 175 | ||||
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 571 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/inc/fontcfg.hxx | 5 | ||||
-rw-r--r-- | sw/source/ui/inc/optpage.hxx | 85 | ||||
-rw-r--r-- | sw/source/ui/utlui/poolfmt.src | 160 |
13 files changed, 1294 insertions, 2 deletions
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 123f4e7bba62..cc0f58a39d8a 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -173,6 +173,12 @@ sal_uInt16 SwNumRule::GetNumIndent( sal_uInt8 nLvl ) return aDefNumIndents[ nLvl ]; } +sal_uInt16 SwNumRule::GetBullIndent( sal_uInt8 nLvl ) +{ + OSL_ENSURE( MAXLEVEL > nLvl, "NumLevel is out of range" ); + return aDefNumIndents[ nLvl ]; +} + static void lcl_SetRuleChgd( SwTxtNode& rNd, sal_uInt8 nLevel ) { if( rNd.GetActualListLevel() == nLevel ) diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index cd64889640a6..7e30267eb0ae 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -740,7 +740,200 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) break; - case RES_POOLCOLL_DOC_TITEL: // Document titel + + case RES_POOLCOLL_NUM_LEVEL1S: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 0 ), + PT_12, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL1: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 0 ), + 0, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL1E: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 0 ), + 0, PT_12 ); + break; + case RES_POOLCOLL_NUM_NONUM1: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM1, + 0, SwNumRule::GetNumIndent( 0 ), 0, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL2S: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 1 ), + PT_12, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL2: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 1 ), + 0, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL2E: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 1 ), + 0, PT_12 ); + break; + case RES_POOLCOLL_NUM_NONUM2: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM2, + 0, SwNumRule::GetNumIndent( 1 ), 0, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL3S: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 2 ), + PT_12, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL3: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 2 ), + 0, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL3E: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 2 ), + 0, PT_12 ); + break; + case RES_POOLCOLL_NUM_NONUM3: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM3, + 0, SwNumRule::GetNumIndent( 2 ), 0, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL4S: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 3 ), + PT_12, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL4: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 3 ), + 0, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL4E: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 3 ), + 0, PT_12 ); + break; + case RES_POOLCOLL_NUM_NONUM4: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM4, + 0, SwNumRule::GetNumIndent( 3 ), 0, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL5S: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 4 ), + PT_12, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL5: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 4 ), + 0, PT_6 ); + break; + case RES_POOLCOLL_NUM_LEVEL5E: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5, + lNumFirstLineOffset, SwNumRule::GetNumIndent( 4 ), + 0, PT_12 ); + break; + case RES_POOLCOLL_NUM_NONUM5: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM5, + 0, SwNumRule::GetNumIndent( 4 ), 0, PT_6 ); + break; + + case RES_POOLCOLL_BUL_LEVEL1S: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL1, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 0 ), + PT_12, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL1: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL1, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 0 ), + 0, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL1E: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL1, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 0 ), + 0, PT_12 ); + break; + case RES_POOLCOLL_BUL_NONUM1: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM1, + 0, SwNumRule::GetBullIndent( 0 ), 0, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL2S: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL2, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 1 ), + PT_12, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL2: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL2, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 1 ), + 0, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL2E: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL2, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 1 ), + 0, PT_12 ); + break; + case RES_POOLCOLL_BUL_NONUM2: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM2, + 0, SwNumRule::GetBullIndent( 1 ), 0, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL3S: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL3, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 2 ), + PT_12, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL3: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL3, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 2 ), + 0, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL3E: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL3, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 2 ), + 0, PT_12 ); + break; + case RES_POOLCOLL_BUL_NONUM3: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM3, + 0, SwNumRule::GetBullIndent( 2 ), 0, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL4S: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL4, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 3 ), + PT_12, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL4: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL4, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 3 ), + 0, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL4E: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL4, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 3 ), + 0, PT_12 ); + break; + case RES_POOLCOLL_BUL_NONUM4: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM4, + 0, SwNumRule::GetBullIndent( 3 ), 0, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL5S: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL5, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 4 ), + PT_12, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL5: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL5, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 4 ), + 0, PT_6 ); + break; + case RES_POOLCOLL_BUL_LEVEL5E: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL5, + lBullFirstLineOffset, SwNumRule::GetBullIndent( 4 ), + 0, PT_12 ); + break; + case RES_POOLCOLL_BUL_NONUM5: + lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM5, + 0, SwNumRule::GetBullIndent( 4 ), 0, PT_6 ); + break; + + case RES_POOLCOLL_DOC_TITEL: // Document Title { SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); SetAllScriptItem( aSet, SvxFontHeightItem( PT_18, 100, RES_CHRATR_FONTSIZE ) ); @@ -752,7 +945,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) } break; - case RES_POOLCOLL_DOC_SUBTITEL: // Document subtitel + case RES_POOLCOLL_DOC_SUBTITEL: // Document subtitle { SetAllScriptItem( aSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE )); SetAllScriptItem( aSet, SvxFontHeightItem( PT_14, 100, RES_CHRATR_FONTSIZE )); diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 34951a3eae40..e2c57c36b0b7 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1541,6 +1541,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) else { bChgBullet = sal_True; + SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_BUL_LEVEL1 + ( Min( nLvl, cnNumBullColls ) * 4 )) ); } } else @@ -1636,6 +1637,8 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) } } } + else if( !aFlags.bAFmtByInput ) + SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_NUM_LEVEL1 + ( Min( nLvl, cnNumBullColls ) * 4 ) )); else bChgEnum = sal_False; } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 8f4d6cdea5c1..02beffdc226e 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -232,10 +232,26 @@ sal_uInt16 MSWordStyles::GetWWId( const SwFmt& rFmt ) const case RES_POOLCOLL_ENDNOTE: nRet = 43; break; case RES_POOLCOLL_TOX_AUTHORITIESH: nRet = 44; break; case RES_POOLCOLL_TOX_CNTNTH: nRet = 46; break; + case RES_POOLCOLL_BUL_LEVEL1: nRet = 48; break; + case RES_POOLCOLL_LISTS_BEGIN: nRet = 47; break; + case RES_POOLCOLL_NUM_LEVEL1: nRet = 49; break; + case RES_POOLCOLL_BUL_LEVEL2: nRet = 54; break; + case RES_POOLCOLL_BUL_LEVEL3: nRet = 55; break; + case RES_POOLCOLL_BUL_LEVEL4: nRet = 56; break; + case RES_POOLCOLL_BUL_LEVEL5: nRet = 57; break; + case RES_POOLCOLL_NUM_LEVEL2: nRet = 58; break; + case RES_POOLCOLL_NUM_LEVEL3: nRet = 59; break; + case RES_POOLCOLL_NUM_LEVEL4: nRet = 60; break; + case RES_POOLCOLL_NUM_LEVEL5: nRet = 61; break; case RES_POOLCOLL_DOC_TITEL: nRet = 62; break; case RES_POOLCOLL_SIGNATURE: nRet = 64; break; case RES_POOLCOLL_TEXT: nRet = 66; break; case RES_POOLCOLL_TEXT_MOVE: nRet = 67; break; + case RES_POOLCOLL_BUL_NONUM1: nRet = 68; break; + case RES_POOLCOLL_BUL_NONUM2: nRet = 69; break; + case RES_POOLCOLL_BUL_NONUM3: nRet = 70; break; + case RES_POOLCOLL_BUL_NONUM4: nRet = 71; break; + case RES_POOLCOLL_BUL_NONUM5: nRet = 72; break; case RES_POOLCOLL_DOC_SUBTITEL: nRet = 74; break; case RES_POOLCOLL_GREETING: nRet = 75; break; case RES_POOLCOLL_TEXT_IDENT: nRet = 77; break; diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index 3a31f34d9e56..76d33a365a3d 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -462,6 +462,24 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI pRet = SvxGridTabPage::Create(pParent, rSet); break; + case RID_SW_TP_STD_FONT: + case RID_SW_TP_STD_FONT_CJK: + case RID_SW_TP_STD_FONT_CTL: + { + SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); + if ( pFact ) + { + ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId ); + if ( fnCreatePage ) + pRet = (*fnCreatePage)( pParent, rSet ); + } + if(RID_SW_TP_STD_FONT != nId) + { + aSet.Put (SfxUInt16Item(SID_FONTMODE_TYPE, RID_SW_TP_STD_FONT_CJK == nId ? FONT_GROUP_CJK : FONT_GROUP_CTL)); + pRet->PageCreated(aSet); + } + } + break; case RID_SW_TP_HTML_OPTPRINT_PAGE: case RID_SW_TP_OPTPRINT_PAGE: { diff --git a/sw/source/ui/config/fontcfg.cxx b/sw/source/ui/config/fontcfg.cxx index ec97c2a05768..0ae1af36e563 100644 --- a/sw/source/ui/config/fontcfg.cxx +++ b/sw/source/ui/config/fontcfg.cxx @@ -290,6 +290,34 @@ sal_Int32 SwStdFontConfig::GetDefaultHeightFor(sal_uInt16 nFontType, LanguageTyp return nRet; } +void SwStdFontConfig::ChangeInt( sal_uInt16 nFontType, sal_Int32 nHeight ) +{ + OSL_ENSURE( nFontType < DEF_FONT_COUNT, "invalid index in SwStdFontConfig::ChangInt()"); + if( nFontType < DEF_FONT_COUNT && nDefaultFontHeight[nFontType] != nHeight) + { + SvtLinguOptions aLinguOpt; + SvtLinguConfig().GetOptions( aLinguOpt ); + + sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN), + eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN), + eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX); + + // #i92090# default height value sets back to -1 + const sal_Int32 nDefaultHeight = GetDefaultHeightFor(nFontType, lcl_LanguageOfType(nFontType, eWestern, eCJK, eCTL)); + const bool bIsDefaultHeight = nHeight == nDefaultHeight; + if( bIsDefaultHeight && nDefaultFontHeight[nFontType] > 0 ) + { + SetModified(); + nDefaultFontHeight[nFontType] = -1; + } + else if( !bIsDefaultHeight && nHeight != nDefaultFontHeight[nFontType] ) + { + SetModified(); + nDefaultFontHeight[nFontType] = nHeight; + } + } +} + sal_Int32 SwStdFontConfig::GetFontHeight( sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang ) { OSL_ENSURE(nFont + FONT_PER_GROUP * nScriptType < DEF_FONT_COUNT, "wrong index in SwStdFontConfig::GetFontHeight()"); diff --git a/sw/source/ui/config/optdlg.hrc b/sw/source/ui/config/optdlg.hrc index 9906d5c3f5b8..1da9f06f7e35 100644 --- a/sw/source/ui/config/optdlg.hrc +++ b/sw/source/ui/config/optdlg.hrc @@ -124,6 +124,32 @@ #define CB_HIDDEN_TEXT 93 #define CB_TEXT_PLACEHOLDER 94 + +// Tabpage Basic Fonts +#define FT_STANDARD 90 +#define LB_STANDARD 91 +#define FT_TITLE 92 +#define LB_TITLE 93 +#define FT_LIST 94 +#define LB_LIST 95 +#define FT_LABEL 96 +#define LB_LABEL 97 +#define FT_IDX 98 +#define LB_IDX 99 +#define FL_STDCHR 100 +#define PB_STANDARD 101 +#define CB_DOCONLY 102 +#define ST_SCRIPT_WESTERN 103 +#define ST_SCRIPT_ASIAN 104 +#define ST_SCRIPT_CTL 105 +#define FT_TYPE 106 +#define FT_SIZE 107 +#define LB_STANDARD_SIZE 108 +#define LB_TITLE_SIZE 109 +#define LB_LIST_SIZE 110 +#define LB_LABEL_SIZE 111 +#define LB_INDEX_SIZE 112 + //Tabpage Table #define CB_HEADER 101 #define CB_REPEAT_HEADER 102 diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src index 1fd1ae215450..e02d415c9ede 100644 --- a/sw/source/ui/config/optdlg.src +++ b/sw/source/ui/config/optdlg.src @@ -436,6 +436,181 @@ TabPage TP_OPTPRINT_PAGE /* */ /* */ /**************************************************************************/ +TabPage TP_STD_FONT +{ + HelpID = HID_STD_FONT ; + Size = MAP_APPFONT ( 260 , 185 ) ; + Hide = TRUE ; + FixedLine FL_STDCHR + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Basic fonts (%1)"; + }; + FixedText FT_TYPE + { + Pos = MAP_APPFONT ( 63 , 14 ) ; + Size = MAP_APPFONT ( 100 , 8 ) ; + Text [ en-US ] = "Font"; + }; + FixedText FT_SIZE + { + Pos = MAP_APPFONT ( 204 , 14 ) ; + Size = MAP_APPFONT ( 40 , 8 ) ; + Text [ en-US ] = "Size"; + }; + MetricBox LB_STANDARD_SIZE + { + HelpID = "sw:MetricBox:TP_STD_FONT:LB_STANDARD_SIZE"; + Pos = MAP_APPFONT ( 204 , 25 ) ; + Size = MAP_APPFONT ( 30 , 60 ) ; + Border = TRUE ; + DropDown = TRUE; + }; + MetricBox LB_TITLE_SIZE + { + HelpID = "sw:MetricBox:TP_STD_FONT:LB_TITLE_SIZE"; + Pos = MAP_APPFONT ( 204 , 42 ) ; + Size = MAP_APPFONT ( 30 , 60 ) ; + Border = TRUE ; + DropDown = TRUE; + }; + MetricBox LB_LIST_SIZE + { + HelpID = "sw:MetricBox:TP_STD_FONT:LB_LIST_SIZE"; + Pos = MAP_APPFONT ( 204 , 59 ) ; + Size = MAP_APPFONT ( 30 , 60 ) ; + Border = TRUE ; + DropDown = TRUE; + }; + MetricBox LB_LABEL_SIZE + { + HelpID = "sw:MetricBox:TP_STD_FONT:LB_LABEL_SIZE"; + Pos = MAP_APPFONT ( 204 , 76 ) ; + Size = MAP_APPFONT ( 30 , 60 ) ; + Border = TRUE ; + DropDown = TRUE; + }; + MetricBox LB_INDEX_SIZE + { + HelpID = "sw:MetricBox:TP_STD_FONT:LB_INDEX_SIZE"; + Pos = MAP_APPFONT ( 204 , 93 ) ; + Size = MAP_APPFONT ( 30 , 60 ) ; + Border = TRUE ; + DropDown = TRUE; + }; + FixedText FT_STANDARD + { + Pos = MAP_APPFONT ( 12 , 26 ) ; + Size = MAP_APPFONT ( 48 , 10 ) ; + Left = TRUE ; + Text [ en-US ] = "De~fault" ; + }; + FixedText FT_TITLE + { + Pos = MAP_APPFONT ( 12 , 43 ) ; + Size = MAP_APPFONT ( 48 , 10 ) ; + Text [ en-US ] = "Headin~g" ; + Left = TRUE ; + }; + FixedText FT_LIST + { + Pos = MAP_APPFONT ( 12 , 60 ) ; + Size = MAP_APPFONT ( 48 , 10 ) ; + Text [ en-US ] = "~List" ; + Left = TRUE ; + }; + FixedText FT_LABEL + { + Pos = MAP_APPFONT ( 12 , 77 ) ; + Size = MAP_APPFONT ( 48 , 10 ) ; + Text [ en-US ] = "C~aption" ; + Left = TRUE ; + }; + FixedText FT_IDX + { + Pos = MAP_APPFONT ( 12 , 94 ) ; + Size = MAP_APPFONT ( 48 , 10 ) ; + Text [ en-US ] = "~Index" ; + Left = TRUE ; + }; + ComboBox LB_STANDARD + { + HelpID = "sw:ComboBox:TP_STD_FONT:LB_STANDARD"; + Pos = MAP_APPFONT ( 63 , 25 ) ; + Size = MAP_APPFONT ( 135 , 73 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + Sort = TRUE ; + }; + ComboBox LB_TITLE + { + HelpID = "sw:ComboBox:TP_STD_FONT:LB_TITLE"; + Pos = MAP_APPFONT ( 63 , 42 ) ; + Size = MAP_APPFONT ( 135, 73 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + Sort = TRUE ; + }; + ComboBox LB_LIST + { + HelpID = "sw:ComboBox:TP_STD_FONT:LB_LIST"; + Pos = MAP_APPFONT ( 63 , 59 ) ; + Size = MAP_APPFONT ( 135 , 73 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + Sort = TRUE ; + }; + ComboBox LB_LABEL + { + HelpID = "sw:ComboBox:TP_STD_FONT:LB_LABEL"; + Pos = MAP_APPFONT ( 63 , 76 ) ; + Size = MAP_APPFONT ( 135 , 73 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + Sort = TRUE ; + }; + ComboBox LB_IDX + { + HelpID = "sw:ComboBox:TP_STD_FONT:LB_IDX"; + Pos = MAP_APPFONT ( 63 , 94 ) ; + Size = MAP_APPFONT ( 135, 73 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + Sort = TRUE ; + }; + CheckBox CB_DOCONLY + { + HelpID = "sw:CheckBox:TP_STD_FONT:CB_DOCONLY"; + Pos = MAP_APPFONT ( 12 , 111 ) ; + Size = MAP_APPFONT ( 147 , 10 ) ; + Text [ en-US ] = "C~urrent document only" ; + }; + PushButton PB_STANDARD + { + HelpID = "sw:PushButton:TP_STD_FONT:PB_STANDARD"; + Pos = MAP_APPFONT ( 204 , 165 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + Text [ en-US ] = "~Default" ; + }; + String ST_SCRIPT_ASIAN + { + Text [ en-US ] = "Asian"; + }; + String ST_SCRIPT_CTL + { + Text [ en-US ] = "CTL"; + }; + String ST_SCRIPT_WESTERN + { + Text [ en-US ] = "Western"; + }; +}; +/**************************************************************************/ +/* */ +/* */ +/* */ +/**************************************************************************/ TabPage TP_OPTTABLE_PAGE { HelpID = HID_OPTTABLE_PAGE ; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index f08b48790e54..09a10370fa78 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -540,6 +540,577 @@ void SwAddPrinterTabPage::PageCreated (SfxAllItemSet aSet) } } +/*-------------------------------------------------- + Tabpage Standardfonts +--------------------------------------------------*/ +SwStdFontTabPage::SwStdFontTabPage( Window* pParent, + const SfxItemSet& rSet ) : + SfxTabPage( pParent, SW_RES( TP_STD_FONT ), rSet), + aStdChrFL (this, SW_RES(FL_STDCHR )), + aTypeFT( this, SW_RES( FT_TYPE )), + + aStandardLbl(this, SW_RES(FT_STANDARD)), + aStandardBox(this, SW_RES(LB_STANDARD)), + + aHeightFT( this, SW_RES( FT_SIZE )), + aStandardHeightLB(this, SW_RES( LB_STANDARD_SIZE )), + + aTitleLbl (this, SW_RES(FT_TITLE )), + aTitleBox (this, SW_RES(LB_TITLE )), + aTitleHeightLB( this, SW_RES( LB_TITLE_SIZE )), + + aListLbl (this, SW_RES(FT_LIST )), + aListBox (this, SW_RES(LB_LIST )), + aListHeightLB( this, SW_RES( LB_LIST_SIZE )), + + aLabelLbl (this, SW_RES(FT_LABEL )), + aLabelBox (this, SW_RES(LB_LABEL )), + aLabelHeightLB( this, SW_RES( LB_LABEL_SIZE )), + + aIdxLbl (this, SW_RES(FT_IDX )), + aIdxBox (this, SW_RES(LB_IDX )), + aIndexHeightLB( this, SW_RES( LB_INDEX_SIZE )), + + aDocOnlyCB (this, SW_RES(CB_DOCONLY )), + aStandardPB (this, SW_RES(PB_STANDARD)), + pPrt(0), + pFontList(0), + pFontConfig(0), + pWrtShell(0), + eLanguage( GetAppLanguage() ), + + bListDefault(sal_False), + bSetListDefault(sal_True), + bLabelDefault(sal_False), + bSetLabelDefault(sal_True), + bIdxDefault(sal_False), + bSetIdxDefault(sal_True), + bDeletePrinter(sal_False), + + bListHeightDefault (sal_False), + bSetListHeightDefault (sal_False), + bLabelHeightDefault (sal_False), + bSetLabelHeightDefault(sal_False), + bIndexHeightDefault (sal_False), + bSetIndexHeightDefault (sal_False), + + nFontGroup(FONT_GROUP_DEFAULT), + + sScriptWestern(SW_RES(ST_SCRIPT_WESTERN)), + sScriptAsian(SW_RES(ST_SCRIPT_ASIAN)), + sScriptComplex(SW_RES(ST_SCRIPT_CTL)) +{ + FreeResource(); + aStandardPB.SetClickHdl(LINK(this, SwStdFontTabPage, StandardHdl)); + aStandardBox.SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl)); + aListBox .SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl)); + aLabelBox .SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl)); + aIdxBox .SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl)); + Link aFocusLink = LINK( this, SwStdFontTabPage, LoseFocusHdl); + aStandardBox.SetLoseFocusHdl( aFocusLink ); + aTitleBox .SetLoseFocusHdl( aFocusLink ); + aListBox .SetLoseFocusHdl( aFocusLink ); + aLabelBox .SetLoseFocusHdl( aFocusLink ); + aIdxBox .SetLoseFocusHdl( aFocusLink ); + + Link aModifyHeightLink( LINK( this, SwStdFontTabPage, ModifyHeightHdl)); + aStandardHeightLB.SetModifyHdl( aModifyHeightLink ); + aTitleHeightLB. SetModifyHdl( aModifyHeightLink ); + aListHeightLB. SetModifyHdl( aModifyHeightLink ); + aLabelHeightLB. SetModifyHdl( aModifyHeightLink ); + aIndexHeightLB. SetModifyHdl( aModifyHeightLink ); + + aDocOnlyCB.Check(SW_MOD()->GetModuleConfig()->IsDefaultFontInCurrDocOnly()); +} + +SwStdFontTabPage::~SwStdFontTabPage() +{ + if(bDeletePrinter) + delete pPrt; +} + +SfxTabPage* SwStdFontTabPage::Create( Window* pParent, + const SfxItemSet& rAttrSet ) +{ + return new SwStdFontTabPage(pParent, rAttrSet); +} + +void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, + SfxPrinter* pPrt, const String& rStyle, + sal_uInt16 nFontWhich) +{ + Font aFont( rStyle, Size( 0, 10 ) ); + if( pPrt ) + aFont = pPrt->GetFontMetric( aFont ); + SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(nType); + pColl->SetFmtAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(), + aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); +} + +void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, + sal_Int32 nHeight, sal_uInt16 nFontHeightWhich) +{ + float fSize = (float)nHeight / 10; + nHeight = CalcToUnit( fSize, SFX_MAPUNIT_TWIP ); + SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(nType); + pColl->SetFmtAttr(SvxFontHeightItem(nHeight, 100, nFontHeightWhich)); +} + +sal_Bool SwStdFontTabPage::FillItemSet( SfxItemSet& ) +{ + sal_Bool bNotDocOnly = !aDocOnlyCB.IsChecked(); + SW_MOD()->GetModuleConfig()->SetDefaultFontInCurrDocOnly(!bNotDocOnly); + + String sStandard = aStandardBox.GetText(); + String sTitle = aTitleBox .GetText(); + String sList = aListBox .GetText(); + String sLabel = aLabelBox .GetText(); + String sIdx = aIdxBox .GetText(); + String sStandardBak = aStandardBox.GetSavedValue(); + String sTitleBak = aTitleBox .GetSavedValue(); + String sListBak = aListBox .GetSavedValue(); + String sLabelBak = aLabelBox .GetSavedValue(); + String sIdxBak = aIdxBox .GetSavedValue(); + + bool bStandardHeightChanged = aStandardHeightLB.GetSavedValue() != aStandardHeightLB.GetText(); + bool bTitleHeightChanged = aTitleHeightLB.GetSavedValue() != aTitleHeightLB.GetText(); + bool bListHeightChanged = aListHeightLB.GetSavedValue() != aListHeightLB.GetText() && (!bListHeightDefault || !bSetListHeightDefault ); + bool bLabelHeightChanged = aLabelHeightLB.GetSavedValue() != aLabelHeightLB.GetText() && (!bLabelHeightDefault || !bSetLabelHeightDefault ); + bool bIndexHeightChanged = aIndexHeightLB.GetSavedValue() != aIndexHeightLB.GetText() && (!bIndexHeightDefault || !bSetIndexHeightDefault ); + if(bNotDocOnly) + { + pFontConfig->SetFontStandard(sStandard, nFontGroup); + pFontConfig->SetFontOutline(sTitle, nFontGroup); + pFontConfig->SetFontList(sList, nFontGroup); + pFontConfig->SetFontCaption(sLabel, nFontGroup); + pFontConfig->SetFontIndex(sIdx, nFontGroup); + if(bStandardHeightChanged) + { + float fSize = (float)aStandardHeightLB.GetValue() / 10; + pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_STANDARD, nFontGroup ); + } + if(bTitleHeightChanged) + { + float fSize = (float)aTitleHeightLB.GetValue() / 10; + pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_OUTLINE, nFontGroup ); + } + if(bListHeightChanged) + { + float fSize = (float)aListHeightLB.GetValue() / 10; + pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_LIST, nFontGroup ); + } + if(bLabelHeightChanged) + { + float fSize = (float)aLabelHeightLB.GetValue() / 10; + pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_CAPTION, nFontGroup ); + } + if(bIndexHeightChanged) + { + float fSize = (float)aIndexHeightLB.GetValue() / 10; + pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_INDEX, nFontGroup ); + } + } + if(pWrtShell) + { + pWrtShell->StartAllAction(); + SfxPrinter* pPrinter = pWrtShell->getIDocumentDeviceAccess()->getPrinter( false ); + sal_Bool bMod = sal_False; + sal_uInt16 nFontWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >( + nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONT : + FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONT : RES_CHRATR_CTL_FONT); + sal_uInt16 nFontHeightWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >( + nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONTSIZE : + FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE); + if(sStandard != sShellStd) + { + Font aFont( sStandard, Size( 0, 10 ) ); + if( pPrinter ) + aFont = pPrinter->GetFontMetric( aFont ); + pWrtShell->SetDefault(SvxFontItem(aFont.GetFamily(), aFont.GetName(), + aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); + SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD); + pColl->ResetFmtAttr(nFontWhich); + bMod = sal_True; + } + if(bStandardHeightChanged) + { + float fSize = (float)aStandardHeightLB.GetValue() / 10; + pWrtShell->SetDefault(SvxFontHeightItem( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), 100, nFontHeightWhich ) ); + SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD); + pColl->ResetFmtAttr(nFontHeightWhich); + bMod = sal_True; + } + + if(sTitle != sShellTitle ) + { + lcl_SetColl(pWrtShell, RES_POOLCOLL_HEADLINE_BASE, pPrinter, sTitle, nFontWhich); + bMod = sal_True; + } + if(bTitleHeightChanged) + { + lcl_SetColl(pWrtShell, RES_POOLCOLL_HEADLINE_BASE, + sal::static_int_cast< sal_uInt16, sal_Int64 >(aTitleHeightLB.GetValue()), nFontHeightWhich); + bMod = sal_True; + } + if(sList != sShellList && (!bListDefault || !bSetListDefault )) + { + lcl_SetColl(pWrtShell, RES_POOLCOLL_NUMBUL_BASE, pPrinter, sList, nFontWhich); + bMod = sal_True; + } + if(bListHeightChanged) + { + lcl_SetColl(pWrtShell, RES_POOLCOLL_NUMBUL_BASE, + sal::static_int_cast< sal_uInt16, sal_Int64 >(aListHeightLB.GetValue()), nFontHeightWhich); + bMod = sal_True; + } + if(sLabel != sShellLabel && (!bLabelDefault || !bSetLabelDefault)) + { + lcl_SetColl(pWrtShell, RES_POOLCOLL_LABEL, pPrinter, sLabel, nFontWhich); + bMod = sal_True; + } + if(bLabelHeightChanged) + { + lcl_SetColl(pWrtShell, RES_POOLCOLL_LABEL, + sal::static_int_cast< sal_uInt16, sal_Int64 >(aLabelHeightLB.GetValue()), nFontHeightWhich); + bMod = sal_True; + } + if(sIdx != sShellIndex && (!bIdxDefault || !bSetIdxDefault)) + { + lcl_SetColl(pWrtShell, RES_POOLCOLL_REGISTER_BASE, pPrinter, sIdx, nFontWhich); + bMod = sal_True; + } + if(bIndexHeightChanged) + { + lcl_SetColl(pWrtShell, RES_POOLCOLL_REGISTER_BASE, + sal::static_int_cast< sal_uInt16, sal_Int64 >(aIndexHeightLB.GetValue()), nFontHeightWhich); + bMod = sal_True; + } + if ( bMod ) + pWrtShell->SetModified(); + pWrtShell->EndAllAction(); + } + + return sal_False; +} + +void SwStdFontTabPage::Reset( const SfxItemSet& rSet) +{ + const SfxPoolItem* pLang; + sal_uInt16 nLangSlot = nFontGroup == FONT_GROUP_DEFAULT ? SID_ATTR_LANGUAGE : + FONT_GROUP_CJK == nFontGroup ? SID_ATTR_CHAR_CJK_LANGUAGE : SID_ATTR_CHAR_CTL_LANGUAGE; + + + if( SFX_ITEM_SET == rSet.GetItemState(nLangSlot, sal_False, &pLang)) + eLanguage = ((const SvxLanguageItem*)pLang)->GetValue(); + + String sTmp(aStdChrFL.GetText()); + String sToReplace = sScriptWestern; + if(FONT_GROUP_CJK == nFontGroup ) + sToReplace = sScriptAsian; + else if(FONT_GROUP_CTL == nFontGroup ) + sToReplace = sScriptComplex; + + sTmp.SearchAndReplaceAscii("%1", sToReplace); + aStdChrFL.SetText(sTmp); + const SfxPoolItem* pItem; + + if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_PRINTER, sal_False, &pItem)) + { + pPrt = (SfxPrinter*)((const SwPtrItem*)pItem)->GetValue(); + } + else + { + SfxItemSet* pPrinterSet = new SfxItemSet( *rSet.GetPool(), + SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, + SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, + 0 ); + pPrt = new SfxPrinter(pPrinterSet); + bDeletePrinter = sal_True; + } + pFontList = new FontList( pPrt ); + // #i94536# prevent duplication of font entries when 'reset' button is pressed + if( !aStandardBox.GetEntryCount() ) + { + // get the set of disctinct available family names + std::set< String > aFontNames; + int nFontNames = pPrt->GetDevFontCount(); + for( int i = 0; i < nFontNames; i++ ) + { + FontInfo aInf( pPrt->GetDevFont( i ) ); + aFontNames.insert( aInf.GetName() ); + } + + // insert to listboxes + for( std::set< String >::const_iterator it = aFontNames.begin(); + it != aFontNames.end(); ++it ) + { + aStandardBox.InsertEntry( *it ); + aTitleBox .InsertEntry( *it ); + aListBox .InsertEntry( *it ); + aLabelBox .InsertEntry( *it ); + aIdxBox .InsertEntry( *it ); + } + } + if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_STDFONTS, sal_False, &pItem)) + { + pFontConfig = (SwStdFontConfig*)((const SwPtrItem*)pItem)->GetValue(); + } + + if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_WRTSHELL, sal_False, &pItem)) + { + pWrtShell = (SwWrtShell*)((const SwPtrItem*)pItem)->GetValue(); + } + String sStdBackup; + String sOutBackup; + String sListBackup; + String sCapBackup; + String sIdxBackup; + sal_Int32 nStandardHeight = -1; + sal_Int32 nTitleHeight = -1; + sal_Int32 nListHeight = -1; + sal_Int32 nLabelHeight = -1; + sal_Int32 nIndexHeight = -1; + + if(!pWrtShell) + { + sStdBackup = pFontConfig->GetFontStandard(nFontGroup); + sOutBackup = pFontConfig->GetFontOutline(nFontGroup); + sListBackup= pFontConfig->GetFontList(nFontGroup); + sCapBackup = pFontConfig->GetFontCaption(nFontGroup); + sIdxBackup = pFontConfig->GetFontIndex(nFontGroup); + nStandardHeight = pFontConfig->GetFontHeight( FONT_STANDARD, nFontGroup, eLanguage ); + nTitleHeight = pFontConfig->GetFontHeight( FONT_OUTLINE , nFontGroup, eLanguage ); + nListHeight = pFontConfig->GetFontHeight( FONT_LIST , nFontGroup, eLanguage ); + nLabelHeight = pFontConfig->GetFontHeight( FONT_CAPTION , nFontGroup, eLanguage ); + nIndexHeight = pFontConfig->GetFontHeight( FONT_INDEX , nFontGroup, eLanguage ); + if( nStandardHeight <= 0) + nStandardHeight = pFontConfig->GetDefaultHeightFor( FONT_STANDARD + nFontGroup * FONT_PER_GROUP, eLanguage); + if( nTitleHeight <= 0) + nTitleHeight = pFontConfig->GetDefaultHeightFor( FONT_OUTLINE + nFontGroup * FONT_PER_GROUP, eLanguage); + if( nListHeight <= 0) + nListHeight = pFontConfig->GetDefaultHeightFor( FONT_LIST + nFontGroup * FONT_PER_GROUP, eLanguage); + if( nLabelHeight <= 0) + nLabelHeight = pFontConfig->GetDefaultHeightFor( FONT_CAPTION + nFontGroup * FONT_PER_GROUP, eLanguage); + if( nIndexHeight <= 0) + nIndexHeight = pFontConfig->GetDefaultHeightFor( FONT_INDEX + nFontGroup * FONT_PER_GROUP, eLanguage); + + aDocOnlyCB.Enable(sal_False); + } + else + { + SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD); + const SvxFontItem& rFont = !nFontGroup ? pColl->GetFont() : + FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont(); + sShellStd = sStdBackup = rFont.GetFamilyName(); + + sal_uInt16 nFontHeightWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >( + nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONTSIZE : + FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE ); + const SvxFontHeightItem& rFontHeightStandard = (const SvxFontHeightItem& )pColl->GetFmtAttr(nFontHeightWhich); + nStandardHeight = (sal_Int32)rFontHeightStandard.GetHeight(); + + pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_HEADLINE_BASE); + const SvxFontItem& rFontHL = !nFontGroup ? pColl->GetFont() : + FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont(); + sShellTitle = sOutBackup = rFontHL.GetFamilyName(); + + const SvxFontHeightItem& rFontHeightTitle = (const SvxFontHeightItem&)pColl->GetFmtAttr( nFontHeightWhich, sal_True ); + nTitleHeight = (sal_Int32)rFontHeightTitle.GetHeight(); + + sal_uInt16 nFontWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >( + nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONT : + FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONT : RES_CHRATR_CTL_FONT); + pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_NUMBUL_BASE); + const SvxFontItem& rFontLS = !nFontGroup ? pColl->GetFont() : + FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont(); + bListDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False); + sShellList = sListBackup = rFontLS.GetFamilyName(); + + const SvxFontHeightItem& rFontHeightList = (const SvxFontHeightItem&)pColl->GetFmtAttr(nFontHeightWhich, sal_True); + nListHeight = (sal_Int32)rFontHeightList.GetHeight(); + bListHeightDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False); + + + pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_LABEL); + bLabelDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False); + const SvxFontItem& rFontCP = !nFontGroup ? pColl->GetFont() : + FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont(); + sShellLabel = sCapBackup = rFontCP.GetFamilyName(); + const SvxFontHeightItem& rFontHeightLabel = (const SvxFontHeightItem&)pColl->GetFmtAttr(nFontHeightWhich, sal_True); + nLabelHeight = (sal_Int32)rFontHeightLabel.GetHeight(); + bLabelHeightDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False); + + pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_REGISTER_BASE); + bIdxDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False); + const SvxFontItem& rFontIDX = !nFontGroup ? pColl->GetFont() : + FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont(); + sShellIndex = sIdxBackup = rFontIDX.GetFamilyName(); + const SvxFontHeightItem& rFontHeightIndex = (const SvxFontHeightItem&)pColl->GetFmtAttr(nFontHeightWhich, sal_True); + nIndexHeight = (sal_Int32)rFontHeightIndex.GetHeight(); + bIndexHeightDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False); + } + aStandardBox.SetText(sStdBackup ); + aTitleBox .SetText(sOutBackup ); + aListBox .SetText(sListBackup); + aLabelBox .SetText(sCapBackup ); + aIdxBox .SetText(sIdxBackup ); + + FontInfo aFontInfo( pFontList->Get(sStdBackup, sStdBackup) ); + aStandardHeightLB.Fill( &aFontInfo, pFontList ); + aFontInfo = pFontList->Get(sOutBackup, sOutBackup ); + aTitleHeightLB.Fill( &aFontInfo, pFontList ); + aFontInfo = pFontList->Get(sListBackup,sListBackup); + aListHeightLB.Fill( &aFontInfo, pFontList ); + aFontInfo = pFontList->Get(sCapBackup, sCapBackup ); + aLabelHeightLB.Fill( &aFontInfo, pFontList ); + aFontInfo = pFontList->Get(sIdxBackup, sIdxBackup ); + aIndexHeightLB.Fill( &aFontInfo, pFontList ); + + aStandardHeightLB.SetValue( CalcToPoint( nStandardHeight, SFX_MAPUNIT_TWIP, 10 ) ); + aTitleHeightLB. SetValue( CalcToPoint( nTitleHeight , SFX_MAPUNIT_TWIP, 10 ) ); + aListHeightLB. SetValue( CalcToPoint( nListHeight , SFX_MAPUNIT_TWIP, 10 ) ); + aLabelHeightLB. SetValue( CalcToPoint( nLabelHeight , SFX_MAPUNIT_TWIP, 10 )); + aIndexHeightLB. SetValue( CalcToPoint( nIndexHeight , SFX_MAPUNIT_TWIP, 10 )); + + aStandardBox.SaveValue(); + aTitleBox .SaveValue(); + aListBox .SaveValue(); + aLabelBox .SaveValue(); + aIdxBox .SaveValue(); + + aStandardHeightLB.SaveValue(); + aTitleHeightLB. SaveValue(); + aListHeightLB. SaveValue(); + aLabelHeightLB. SaveValue(); + aIndexHeightLB. SaveValue(); +} + +IMPL_LINK( SwStdFontTabPage, StandardHdl, PushButton *, EMPTYARG ) +{ + sal_uInt8 nFontOffset = nFontGroup * FONT_PER_GROUP; + aStandardBox.SetText(SwStdFontConfig::GetDefaultFor(FONT_STANDARD + nFontOffset, eLanguage)); + aTitleBox .SetText(SwStdFontConfig::GetDefaultFor(FONT_OUTLINE + nFontOffset, eLanguage)); + aListBox .SetText(SwStdFontConfig::GetDefaultFor(FONT_LIST + nFontOffset, eLanguage)); + aLabelBox .SetText(SwStdFontConfig::GetDefaultFor(FONT_CAPTION + nFontOffset, eLanguage)); + aIdxBox .SetText(SwStdFontConfig::GetDefaultFor(FONT_INDEX + nFontOffset, eLanguage)); + + aStandardBox.SaveValue(); + aTitleBox .SaveValue(); + aListBox .SaveValue(); + aLabelBox .SaveValue(); + aIdxBox .SaveValue(); + + aStandardHeightLB.SetValue( CalcToPoint( + SwStdFontConfig::GetDefaultHeightFor(FONT_STANDARD + nFontOffset, eLanguage), + SFX_MAPUNIT_TWIP, 10 ) ); + aTitleHeightLB .SetValue(CalcToPoint( + SwStdFontConfig::GetDefaultHeightFor(FONT_OUTLINE + + nFontOffset, eLanguage), SFX_MAPUNIT_TWIP, 10 )); + aListHeightLB .SetValue(CalcToPoint( + SwStdFontConfig::GetDefaultHeightFor(FONT_LIST + nFontOffset, eLanguage), + SFX_MAPUNIT_TWIP, 10 )); + aLabelHeightLB .SetValue(CalcToPoint( + SwStdFontConfig::GetDefaultHeightFor(FONT_CAPTION + nFontOffset, eLanguage), + SFX_MAPUNIT_TWIP, 10 )); + aIndexHeightLB .SetValue(CalcToPoint( + SwStdFontConfig::GetDefaultHeightFor(FONT_INDEX + nFontOffset, eLanguage), + SFX_MAPUNIT_TWIP, 10 )); + + return 0; +} + +IMPL_LINK( SwStdFontTabPage, ModifyHdl, ComboBox*, pBox ) +{ + if(pBox == &aStandardBox) + { + String sEntry = pBox->GetText(); + if(bSetListDefault && bListDefault) + aListBox.SetText(sEntry); + if(bSetLabelDefault && bLabelDefault) + aLabelBox.SetText(sEntry); + if(bSetIdxDefault && bIdxDefault) + aIdxBox.SetText(sEntry); + } + else if(pBox == &aListBox) + { + bSetListDefault = sal_False; + } + else if(pBox == &aLabelBox) + { + bSetLabelDefault = sal_False; + } + else if(pBox == &aIdxBox) + { + bSetIdxDefault = sal_False; + } + return 0; +} + +IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, FontSizeBox*, pBox ) +{ + if(pBox == &aStandardHeightLB) + { + sal_Int64 nValue = pBox->GetValue(FUNIT_TWIP); + if(bSetListHeightDefault && bListHeightDefault) + aListHeightLB.SetValue(nValue, FUNIT_TWIP); + if(bSetLabelHeightDefault && bLabelHeightDefault) + aLabelHeightLB.SetValue(nValue, FUNIT_TWIP); + if(bSetIndexHeightDefault && bIndexHeightDefault) + aIndexHeightLB.SetValue(nValue, FUNIT_TWIP); + } + else if(pBox == &aListHeightLB) + { + bSetListHeightDefault = sal_False; + } + else if(pBox == &aLabelHeightLB) + { + bSetLabelHeightDefault = sal_False; + } + else if(pBox == &aIndexHeightLB) + { + bSetIndexHeightDefault = sal_False; + } + return 0; +} + +IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox ) +{ + FontSizeBox* pHeightLB = 0; + String sEntry = pBox->GetText(); + if(pBox == &aStandardBox) + { + pHeightLB = &aStandardHeightLB; + } + else if(pBox == &aTitleBox) + { + pHeightLB = &aTitleHeightLB; + } + else if(pBox == &aListBox) + { + pHeightLB = &aListHeightLB; + } + else if(pBox == &aLabelBox) + { + pHeightLB = &aLabelHeightLB; + } + else /*if(pBox == &aIdxBox)*/ + { + pHeightLB = &aIndexHeightLB; + } + FontInfo aFontInfo( pFontList->Get(sEntry, sEntry) ); + pHeightLB->Fill( &aFontInfo, pFontList ); + + return 0; +} + + +void SwStdFontTabPage::PageCreated (SfxAllItemSet aSet) +{ + SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt16Item, SID_FONTMODE_TYPE, sal_False); + if (pFlagItem) + SetFontMode(sal::static_int_cast< sal_uInt8, sal_uInt16>( pFlagItem->GetValue())); +} + SwTableOptionsTabPage::SwTableOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage(pParent, SW_RES(TP_OPTTABLE_PAGE), rSet), aTableFL (this, SW_RES(FL_TABLE )), diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 0edd38c4a2ad..71430bcb6679 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1655,6 +1655,12 @@ CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI case RID_SW_TP_OPTPRINT_PAGE: pRet = SwAddPrinterTabPage::Create; break; + case TP_STD_FONT : + case RID_SW_TP_STD_FONT: + case RID_SW_TP_STD_FONT_CJK: + case RID_SW_TP_STD_FONT_CTL: + pRet = SwStdFontTabPage::Create; + break; case TP_OPTTABLE_PAGE : case RID_SW_TP_HTML_OPTTABLE_PAGE: case RID_SW_TP_OPTTABLE_PAGE: diff --git a/sw/source/ui/inc/fontcfg.hxx b/sw/source/ui/inc/fontcfg.hxx index 357013021940..5acd526bd16e 100644 --- a/sw/source/ui/inc/fontcfg.hxx +++ b/sw/source/ui/inc/fontcfg.hxx @@ -79,6 +79,8 @@ class SW_DLLPUBLIC SwStdFontConfig : public utl::ConfigItem } } + void ChangeInt( sal_uInt16 nFontType, sal_Int32 nHeight ); + public: SwStdFontConfig(); ~SwStdFontConfig(); @@ -107,6 +109,9 @@ public: void SetFontIndex (const String& rSet, sal_uInt8 nFontGroup) { ChangeString(FONT_INDEX + FONT_PER_GROUP * nFontGroup, rSet);} + void SetFontHeight( sal_Int32 nHeight, sal_uInt8 nFont, sal_uInt8 nScriptType ) + { ChangeInt(nFont + FONT_PER_GROUP * nScriptType, nHeight);} + sal_Int32 GetFontHeight( sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang ); static String GetDefaultFor(sal_uInt16 nFontType, LanguageType eLang); diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx index 010fe0071193..d78ee967f40d 100644 --- a/sw/source/ui/inc/optpage.hxx +++ b/sw/source/ui/inc/optpage.hxx @@ -42,6 +42,7 @@ #include <svx/fntctrl.hxx> #include <fontcfg.hxx> class SfxPrinter; +class SwStdFontConfig; class SwWrtShell; class FontList; class SwCompareConfig; @@ -154,6 +155,90 @@ public: }; +class SwStdFontTabPage : public SfxTabPage +{ + FixedLine aStdChrFL ; + + FixedText aTypeFT; + + FixedText aStandardLbl; + ComboBox aStandardBox; + + FixedText aHeightFT; + FontSizeBox aStandardHeightLB; + + FixedText aTitleLbl ; + ComboBox aTitleBox ; + FontSizeBox aTitleHeightLB; + + FixedText aListLbl ; + ComboBox aListBox ; + FontSizeBox aListHeightLB; + + FixedText aLabelLbl ; + ComboBox aLabelBox ; + FontSizeBox aLabelHeightLB; + + FixedText aIdxLbl ; + ComboBox aIdxBox ; + FontSizeBox aIndexHeightLB; + + CheckBox aDocOnlyCB ; + PushButton aStandardPB; + + String sShellStd; + String sShellTitle; + String sShellList; + String sShellLabel; + String sShellIndex; + + SfxPrinter* pPrt; + FontList* pFontList; + SwStdFontConfig* pFontConfig; + SwWrtShell* pWrtShell; + LanguageType eLanguage; + // only defaults were there? they were signed with the boxes + sal_Bool bListDefault :1; + sal_Bool bSetListDefault :1; + sal_Bool bLabelDefault :1; + sal_Bool bSetLabelDefault :1; + sal_Bool bIdxDefault :1; + sal_Bool bSetIdxDefault :1; + sal_Bool bDeletePrinter :1; + + sal_Bool bListHeightDefault :1; + sal_Bool bSetListHeightDefault :1; + sal_Bool bLabelHeightDefault :1; + sal_Bool bSetLabelHeightDefault :1; + sal_Bool bIndexHeightDefault :1; + sal_Bool bSetIndexHeightDefault :1; + + sal_uInt8 nFontGroup; //fontcfg.hxx: FONT_GROUP_[STANDARD|CJK|CTL] + + String sScriptWestern; + String sScriptAsian; + String sScriptComplex; + + DECL_LINK( StandardHdl, PushButton * ); + DECL_LINK( ModifyHdl, ComboBox * ); + DECL_LINK( ModifyHeightHdl, FontSizeBox * ); + DECL_LINK( LoseFocusHdl, ComboBox * ); + + SwStdFontTabPage( Window* pParent, + const SfxItemSet& rSet ); + ~SwStdFontTabPage(); + +public: + static SfxTabPage* Create( Window* pParent, + const SfxItemSet& rAttrSet ); + + virtual sal_Bool FillItemSet( SfxItemSet& rSet ); + virtual void Reset( const SfxItemSet& rSet ); + + void SetFontMode(sal_uInt8 nGroup) {nFontGroup = nGroup;} + virtual void PageCreated (SfxAllItemSet aSet); +}; + class SwTableOptionsTabPage : public SfxTabPage { FixedLine aTableFL; diff --git a/sw/source/ui/utlui/poolfmt.src b/sw/source/ui/utlui/poolfmt.src index 8f2564c98a2c..a1d0fcbcfe76 100644 --- a/sw/source/ui/utlui/poolfmt.src +++ b/sw/source/ui/utlui/poolfmt.src @@ -252,6 +252,166 @@ String STR_POOLCOLL_HEADLINE10 { Text [ en-US ] = "Heading 10" ; }; +String STR_POOLCOLL_NUM_LEVEL1S +{ + Text [ en-US ] = "Numbering 1 Start" ; +}; +String STR_POOLCOLL_NUM_LEVEL1 +{ + Text [ en-US ] = "Numbering 1" ; +}; +String STR_POOLCOLL_NUM_LEVEL1E +{ + Text [ en-US ] = "Numbering 1 End" ; +}; +String STR_POOLCOLL_NUM_NONUM1 +{ + Text [ en-US ] = "Numbering 1 Cont." ; +}; +String STR_POOLCOLL_NUM_LEVEL2S +{ + Text [ en-US ] = "Numbering 2 Start" ; +}; +String STR_POOLCOLL_NUM_LEVEL2 +{ + Text [ en-US ] = "Numbering 2" ; +}; +String STR_POOLCOLL_NUM_LEVEL2E +{ + Text [ en-US ] = "Numbering 2 End" ; +}; +String STR_POOLCOLL_NUM_NONUM2 +{ + Text [ en-US ] = "Numbering 2 Cont." ; +}; +String STR_POOLCOLL_NUM_LEVEL3S +{ + Text [ en-US ] = "Numbering 3 Start" ; +}; +String STR_POOLCOLL_NUM_LEVEL3 +{ + Text [ en-US ] = "Numbering 3" ; +}; +String STR_POOLCOLL_NUM_LEVEL3E +{ + Text [ en-US ] = "Numbering 3 End" ; +}; +String STR_POOLCOLL_NUM_NONUM3 +{ + Text [ en-US ] = "Numbering 3 Cont." ; +}; +String STR_POOLCOLL_NUM_LEVEL4S +{ + Text [ en-US ] = "Numbering 4 Start" ; +}; +String STR_POOLCOLL_NUM_LEVEL4 +{ + Text [ en-US ] = "Numbering 4" ; +}; +String STR_POOLCOLL_NUM_LEVEL4E +{ + Text [ en-US ] = "Numbering 4 End" ; +}; +String STR_POOLCOLL_NUM_NONUM4 +{ + Text [ en-US ] = "Numbering 4 Cont." ; +}; +String STR_POOLCOLL_NUM_LEVEL5S +{ + Text [ en-US ] = "Numbering 5 Start" ; +}; +String STR_POOLCOLL_NUM_LEVEL5 +{ + Text [ en-US ] = "Numbering 5" ; +}; +String STR_POOLCOLL_NUM_LEVEL5E +{ + Text [ en-US ] = "Numbering 5 End" ; +}; +String STR_POOLCOLL_NUM_NONUM5 +{ + Text [ en-US ] = "Numbering 5 Cont." ; +}; +String STR_POOLCOLL_BUL_LEVEL1S +{ + Text [ en-US ] = "List 1 Start" ; +}; +String STR_POOLCOLL_BUL_LEVEL1 +{ + Text [ en-US ] = "List 1" ; +}; +String STR_POOLCOLL_BUL_LEVEL1E +{ + Text [ en-US ] = "List 1 End" ; +}; +String STR_POOLCOLL_BUL_NONUM1 +{ + Text [ en-US ] = "List 1 Cont." ; +}; +String STR_POOLCOLL_BUL_LEVEL2S +{ + Text [ en-US ] = "List 2 Start" ; +}; +String STR_POOLCOLL_BUL_LEVEL2 +{ + Text [ en-US ] = "List 2" ; +}; +String STR_POOLCOLL_BUL_LEVEL2E +{ + Text [ en-US ] = "List 2 End" ; +}; +String STR_POOLCOLL_BUL_NONUM2 +{ + Text [ en-US ] = "List 2 Cont." ; +}; +String STR_POOLCOLL_BUL_LEVEL3S +{ + Text [ en-US ] = "List 3 Start" ; +}; +String STR_POOLCOLL_BUL_LEVEL3 +{ + Text [ en-US ] = "List 3" ; +}; +String STR_POOLCOLL_BUL_LEVEL3E +{ + Text [ en-US ] = "List 3 End" ; +}; +String STR_POOLCOLL_BUL_NONUM3 +{ + Text [ en-US ] = "List 3 Cont." ; +}; +String STR_POOLCOLL_BUL_LEVEL4S +{ + Text [ en-US ] = "List 4 Start" ; +}; +String STR_POOLCOLL_BUL_LEVEL4 +{ + Text [ en-US ] = "List 4" ; +}; +String STR_POOLCOLL_BUL_LEVEL4E +{ + Text [ en-US ] = "List 4 End" ; +}; +String STR_POOLCOLL_BUL_NONUM4 +{ + Text [ en-US ] = "List 4 Cont." ; +}; +String STR_POOLCOLL_BUL_LEVEL5S +{ + Text [ en-US ] = "List 5 Start" ; +}; +String STR_POOLCOLL_BUL_LEVEL5 +{ + Text [ en-US ] = "List 5" ; +}; +String STR_POOLCOLL_BUL_LEVEL5E +{ + Text [ en-US ] = "List 5 End" ; +}; +String STR_POOLCOLL_BUL_NONUM5 +{ + Text [ en-US ] = "List 5 Cont." ; +}; String STR_POOLCOLL_HEADER { Text [ en-US ] = "Header" ; |