summaryrefslogtreecommitdiff
path: root/sw/source/ui/config
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2002-06-11 07:39:16 +0000
committerOliver Specht <os@openoffice.org>2002-06-11 07:39:16 +0000
commit4cc1143b9f6544dcbd5cac8d2c2c904f2faf5066 (patch)
tree8625e9ea3ba44daaf8962ba3af99ce7a023216e5 /sw/source/ui/config
parent0a2f15ee11f18125762bc9cee39d64d15209b691 (diff)
#99515# tab page Basic Fonts(CTL) added
Diffstat (limited to 'sw/source/ui/config')
-rw-r--r--sw/source/ui/config/fontcfg.cxx33
-rw-r--r--sw/source/ui/config/optdlg.hrc5
-rw-r--r--sw/source/ui/config/optdlg.src9
-rw-r--r--sw/source/ui/config/optpage.cxx82
4 files changed, 86 insertions, 43 deletions
diff --git a/sw/source/ui/config/fontcfg.cxx b/sw/source/ui/config/fontcfg.cxx
index 1804a21e62d4..8b2eb3b82fbf 100644
--- a/sw/source/ui/config/fontcfg.cxx
+++ b/sw/source/ui/config/fontcfg.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fontcfg.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: jp $ $Date: 2001-09-27 17:18:57 $
+ * last change: $Author: os $ $Date: 2002-06-11 08:38:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -110,8 +110,13 @@ Sequence<OUString> SwStdFontConfig::GetPropertyNames()
"DefaultFontCJK/List", // 7
"DefaultFontCJK/Caption", // 8
"DefaultFontCJK/Index", // 9
+ "DefaultFontCTL/Standard", // 10
+ "DefaultFontCTL/Heading", // 11
+ "DefaultFontCTL/List", // 12
+ "DefaultFontCTL/Caption", // 13
+ "DefaultFontCTL/Index", // 14
};
- const int nCount = 10;
+ const int nCount = 15;
Sequence<OUString> aNames(nCount);
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
@@ -178,6 +183,7 @@ BOOL SwStdFontConfig::IsFontDefault(USHORT nFontType) const
LanguageType eLang = GetAppLanguage();
String sDefFont(GetDefaultFor(FONT_STANDARD, eLang));
String sDefFontCJK(GetDefaultFor(FONT_STANDARD_CJK, eLang));
+ String sDefFontCTL(GetDefaultFor(FONT_STANDARD_CTL, eLang));
switch( nFontType )
{
case FONT_STANDARD:
@@ -186,8 +192,12 @@ BOOL SwStdFontConfig::IsFontDefault(USHORT nFontType) const
case FONT_STANDARD_CJK:
bSame = sDefaultFonts[nFontType] == sDefFontCJK;
break;
+ case FONT_STANDARD_CTL:
+ bSame = sDefaultFonts[nFontType] == sDefFontCTL;
+ break;
case FONT_OUTLINE :
case FONT_OUTLINE_CJK :
+ case FONT_OUTLINE_CTL :
bSame = sDefaultFonts[nFontType] ==
GetDefaultFor(nFontType, eLang);
break;
@@ -205,6 +215,14 @@ BOOL SwStdFontConfig::IsFontDefault(USHORT nFontType) const
bSame = b1 && sDefaultFonts[nFontType] == sDefFontCJK;
}
break;
+ case FONT_LIST_CTL :
+ case FONT_CAPTION_CTL :
+ case FONT_INDEX_CTL :
+ {
+ BOOL b1 = sDefaultFonts[FONT_STANDARD_CJK] == sDefFontCTL;
+ bSame = b1 && sDefaultFonts[nFontType] == sDefFontCTL;
+ }
+ break;
}
return bSame;
}
@@ -224,12 +242,21 @@ String SwStdFontConfig::GetDefaultFor(USHORT nFontType, LanguageType eLang)
case FONT_OUTLINE_CJK :
nFontId = DEFAULTFONT_CJK_HEADING;
break;
+ case FONT_OUTLINE_CTL :
+ nFontId = DEFAULTFONT_CTL_HEADING;
+ break;
case FONT_STANDARD_CJK:
case FONT_LIST_CJK :
case FONT_CAPTION_CJK :
case FONT_INDEX_CJK :
nFontId = DEFAULTFONT_CJK_TEXT;
break;
+ case FONT_STANDARD_CTL:
+ case FONT_LIST_CTL :
+ case FONT_CAPTION_CTL :
+ case FONT_INDEX_CTL :
+ nFontId = DEFAULTFONT_CTL_TEXT;
+ break;
// case FONT_STANDARD:
// case FONT_LIST :
// case FONT_CAPTION :
diff --git a/sw/source/ui/config/optdlg.hrc b/sw/source/ui/config/optdlg.hrc
index 2ea494a09738..726525fd982b 100644
--- a/sw/source/ui/config/optdlg.hrc
+++ b/sw/source/ui/config/optdlg.hrc
@@ -2,9 +2,9 @@
*
* $RCSfile: optdlg.hrc,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: os $ $Date: 2002-04-25 13:57:39 $
+ * last change: $Author: os $ $Date: 2002-06-11 08:38:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -169,6 +169,7 @@
#define CB_DOCONLY 102
#define ST_SCRIPT_WESTERN 103
#define ST_SCRIPT_ASIAN 104
+#define ST_SCRIPT_CTL 105
//Tabpage Tabelle
#define CB_HEADER 101
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index bda4d33248d9..9e3b5351c5ad 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -2,9 +2,9 @@
*
* $RCSfile: optdlg.src,v $
*
- * $Revision: 1.72 $
+ * $Revision: 1.73 $
*
- * last change: $Author: os $ $Date: 2002-05-31 07:49:15 $
+ * last change: $Author: os $ $Date: 2002-06-11 08:38:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1669,6 +1669,11 @@ TabPage TP_STD_FONT
Text[ catalan ] = "Asian";
Text[ thai ] = "แบบเอเชีย";
};
+ String ST_SCRIPT_CTL
+ {
+ Text = "CTL" ;
+ Text [ English ] = "CTL" ;
+ };
String ST_SCRIPT_WESTERN
{
Text = "Westlich" ;
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 044ed69cc9dd..dae341c7a658 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: optpage.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: os $ $Date: 2002-04-25 13:57:39 $
+ * last change: $Author: os $ $Date: 2002-06-11 08:38:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -647,6 +647,7 @@ SwStdFontTabPage::SwStdFontTabPage( Window* pParent,
aStandardPB (this, SW_RES(PB_STANDARD)),
sScriptWestern(ResId(ST_SCRIPT_WESTERN)),
sScriptAsian(ResId(ST_SCRIPT_ASIAN)),
+ sScriptComplex(ResId(ST_SCRIPT_CTL)),
pPrt(0),
pFontConfig(0),
pWrtShell(0),
@@ -657,7 +658,7 @@ SwStdFontTabPage::SwStdFontTabPage( Window* pParent,
bSetIdxDefault(TRUE),
bIdxDefault(FALSE),
bDeletePrinter(FALSE),
- bCJKMode(FALSE),
+ nFontGroup(FONT_GROUP_DEFAULT),
eLanguage( GetAppLanguage() )
{
FreeResource();
@@ -734,18 +735,19 @@ BOOL SwStdFontTabPage::FillItemSet( SfxItemSet& rSet )
if(bNotDocOnly)
{
- pFontConfig->SetFontStandard(sStandard, bCJKMode);
- pFontConfig->SetFontOutline(sTitle, bCJKMode);
- pFontConfig->SetFontList(sList, bCJKMode);
- pFontConfig->SetFontCaption(sLabel, bCJKMode);
- pFontConfig->SetFontIndex(sIdx, bCJKMode);
+ pFontConfig->SetFontStandard(sStandard, nFontGroup);
+ pFontConfig->SetFontOutline(sTitle, nFontGroup);
+ pFontConfig->SetFontList(sList, nFontGroup);
+ pFontConfig->SetFontCaption(sLabel, nFontGroup);
+ pFontConfig->SetFontIndex(sIdx, nFontGroup);
}
if(pWrtShell)
{
pWrtShell->StartAllAction();
SfxPrinter* pPrt = pWrtShell->GetPrt();
BOOL bMod = FALSE;
- USHORT nFontWhich = bCJKMode ? RES_CHRATR_CJK_FONT : RES_CHRATR_FONT;
+ USHORT nFontWhich = nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONT :
+ FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONT : RES_CHRATR_CTL_FONT;
if(sStandard != sShellStd)
{
BOOL bDelete = FALSE;
@@ -801,12 +803,21 @@ BOOL SwStdFontTabPage::FillItemSet( SfxItemSet& rSet )
void SwStdFontTabPage::Reset( const SfxItemSet& rSet )
{
const SfxPoolItem* pLang;
- if( SFX_ITEM_SET == rSet.GetItemState(
- bCJKMode ? SID_ATTR_CHAR_CJK_LANGUAGE : SID_ATTR_LANGUAGE, FALSE, &pLang))
+ USHORT 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, FALSE, &pLang))
eLanguage = ((const SvxLanguageItem*)pLang)->GetValue();
String sTmp(aStdChrFL.GetText());
- sTmp.SearchAndReplaceAscii("%1", bCJKMode ? sScriptAsian : sScriptWestern);
+ 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;
@@ -850,37 +861,43 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet )
if(!pWrtShell)
{
- sStdBackup = pFontConfig->GetFontStandard(bCJKMode);
- sOutBackup = pFontConfig->GetFontOutline(bCJKMode);
- sListBackup= pFontConfig->GetFontList(bCJKMode);
- sCapBackup = pFontConfig->GetFontCaption(bCJKMode);
- sIdxBackup = pFontConfig->GetFontIndex(bCJKMode);
+ sStdBackup = pFontConfig->GetFontStandard(nFontGroup);
+ sOutBackup = pFontConfig->GetFontOutline(nFontGroup);
+ sListBackup= pFontConfig->GetFontList(nFontGroup);
+ sCapBackup = pFontConfig->GetFontCaption(nFontGroup);
+ sIdxBackup = pFontConfig->GetFontIndex(nFontGroup);
aDocOnlyCB.Enable(FALSE);
}
else
{
SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
- const SvxFontItem& rFont = bCJKMode ? pColl->GetCJKFont() : pColl->GetFont();
+ const SvxFontItem& rFont = !nFontGroup ? pColl->GetFont() :
+ FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
sShellStd = sStdBackup = rFont.GetFamilyName();
pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_HEADLINE_BASE);
- const SvxFontItem& rFontHL = bCJKMode ? pColl->GetCJKFont() : pColl->GetFont();
+ const SvxFontItem& rFontHL = !nFontGroup ? pColl->GetFont() :
+ FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
sShellTitle = sOutBackup = rFontHL.GetFamilyName();
- USHORT nFontWhich = bCJKMode ? RES_CHRATR_CJK_FONT : RES_CHRATR_FONT;
+ USHORT nFontWhich = 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 = bCJKMode ? pColl->GetCJKFont() : pColl->GetFont();
+ const SvxFontItem& rFontLS = !nFontGroup ? pColl->GetFont() :
+ FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
bListDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, FALSE);
sShellList = sListBackup = rFontLS.GetFamilyName();
pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_LABEL);
bLabelDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, FALSE);
- const SvxFontItem& rFontCP = bCJKMode ? pColl->GetCJKFont() : pColl->GetFont();
+ const SvxFontItem& rFontCP = !nFontGroup ? pColl->GetFont() :
+ FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
sShellLabel = sCapBackup = rFontCP.GetFamilyName();
pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_REGISTER_BASE);
bIdxDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, FALSE);
- const SvxFontItem& rFontIDX = bCJKMode ? pColl->GetCJKFont() : pColl->GetFont();
+ const SvxFontItem& rFontIDX = !nFontGroup ? pColl->GetFont() :
+ FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
sShellIndex = sIdxBackup = rFontIDX.GetFamilyName();
}
aStandardBox.SetText(sStdBackup );
@@ -903,19 +920,12 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet )
IMPL_LINK( SwStdFontTabPage, StandardHdl, PushButton *, EMPTYARG )
{
- static USHORT aIdArr[5][2] = {
- { FONT_STANDARD, FONT_STANDARD_CJK },
- { FONT_OUTLINE, FONT_OUTLINE_CJK },
- { FONT_LIST, FONT_LIST_CJK },
- { FONT_CAPTION, FONT_CAPTION_CJK },
- { FONT_INDEX, FONT_INDEX_CJK }
- };
- USHORT nOff = bCJKMode ? 1 : 0;
- aStandardBox.SetText(SwStdFontConfig::GetDefaultFor(aIdArr[0][nOff], eLanguage));
- aTitleBox .SetText(SwStdFontConfig::GetDefaultFor(aIdArr[1][nOff], eLanguage));
- aListBox .SetText(SwStdFontConfig::GetDefaultFor(aIdArr[2][nOff], eLanguage));
- aLabelBox .SetText(SwStdFontConfig::GetDefaultFor(aIdArr[3][nOff], eLanguage));
- aIdxBox .SetText(SwStdFontConfig::GetDefaultFor(aIdArr[4][nOff], eLanguage));
+ 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();