summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sw/source/ui/app/appopt.cxx20
-rw-r--r--sw/source/ui/app/docshini.cxx121
-rw-r--r--sw/source/ui/config/fontcfg.cxx93
-rw-r--r--sw/source/ui/config/optdlg.hrc6
-rw-r--r--sw/source/ui/config/optdlg.src40
-rw-r--r--sw/source/ui/config/optpage.cxx83
-rw-r--r--sw/source/ui/inc/fontcfg.hxx105
-rw-r--r--sw/source/ui/inc/optpage.hxx11
8 files changed, 218 insertions, 261 deletions
diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx
index 7d91c3576da7..abd2ca4ec48b 100644
--- a/sw/source/ui/app/appopt.cxx
+++ b/sw/source/ui/app/appopt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: appopt.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: os $ $Date: 2001-05-10 08:46:10 $
+ * last change: $Author: os $ $Date: 2001-05-11 10:37:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -178,9 +178,9 @@
#include <globals.h> // globale Konstanten z.B.
#endif
-#if SUPD<629
-#ifndef RID_SW_TP_HTML_OPTSHDWCRSR
-#define RID_SW_TP_HTML_OPTSHDWCRSR (RID_OFA_START + 246)
+#if SUPD<632
+#ifndef RID_SW_TP_STD_FONT_CJK
+#define RID_SW_TP_STD_FONT_CJK (RID_OFA_START + 247)
#endif
#endif
@@ -572,7 +572,12 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItem
break;
break;
- case RID_SW_TP_STD_FONT: pRet = SwStdFontTabPage::Create(pParent, rSet); break;
+ case RID_SW_TP_STD_FONT:
+ case RID_SW_TP_STD_FONT_CJK:
+ pRet = SwStdFontTabPage::Create(pParent, rSet);
+ if(RID_SW_TP_STD_FONT_CJK == nId)
+ ((SwStdFontTabPage*)pRet)->SetCJKMode();
+ break;
case RID_SW_TP_HTML_OPTPRINT_PAGE:
case RID_SW_TP_OPTPRINT_PAGE:
{
@@ -623,6 +628,9 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItem
/*-------------------------------------------------------------------------
$Log: not supported by cvs2svn $
+ Revision 1.12 2001/05/10 08:46:10 os
+ store print options at the document
+
Revision 1.11 2001/05/07 13:58:02 os
#86002# don't apply web settings to text view and vice versa
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index 4110a8bb19d1..2902a2875285 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docshini.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: os $ $Date: 2001-05-10 08:46:10 $
+ * last change: $Author: os $ $Date: 2001-05-11 10:37:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -260,26 +260,6 @@ using namespace ::rtl;
--------------------------------------------------*/
-void lcl_SetColl(SwDoc* pDoc, sal_uInt16 nType,
- SfxPrinter* pPrt, const String& rStyle)
-{
- sal_Bool bDelete = sal_False;
- const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(rStyle): 0;
- if(!pFnt)
- {
- pFnt = new SfxFont( FAMILY_DONTKNOW, rStyle, PITCH_DONTKNOW,
- ::gsl_getSystemTextEncoding() );
- bDelete = sal_True;
- }
- SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(nType);
- pColl->SetAttr(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(),
- aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet()));
- if(bDelete)
- {
- delete (SfxFont*) pFnt;
- }
-}
-
/*--------------------------------------------------------------------
Beschreibung: Document laden
--------------------------------------------------------------------*/
@@ -305,55 +285,70 @@ sal_Bool SwDocShell::InitNew( SvStorage * pStor )
SfxPrinter* pPrt = pDoc->GetPrt();
String sEntry;
- if(!pStdFont->IsFontDefault(FONT_STANDARD))
+ for(USHORT i = 0; i < 2; i++)
{
- sEntry = pStdFont->GetFontStandard();
- sal_Bool bDelete = sal_False;
- const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(sEntry): 0;
- if(!pFnt)
+ USHORT nFontWhich = i ? RES_CHRATR_CJK_FONT : RES_CHRATR_FONT;
+ USHORT nFontId = i ? FONT_STANDARD_CJK : FONT_STANDARD;
+ if(!pStdFont->IsFontDefault(nFontId))
{
- pFnt = new SfxFont( FAMILY_DONTKNOW, sEntry, PITCH_DONTKNOW,
- ::gsl_getSystemTextEncoding() );
- bDelete = sal_True;
- }
- pDoc->SetDefault(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(),
- aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet()));
- SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
- pColl->ResetAttr(RES_CHRATR_FONT);
- if(bDelete)
- {
- delete (SfxFont*) pFnt;
- bDelete = sal_False;
+ sEntry = pStdFont->GetFontFor(nFontId);
+ sal_Bool bDelete = sal_False;
+ const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(sEntry): 0;
+ if(!pFnt)
+ {
+ pFnt = new SfxFont( FAMILY_DONTKNOW, sEntry, PITCH_DONTKNOW,
+ ::gsl_getSystemTextEncoding() );
+ bDelete = sal_True;
+ }
+ pDoc->SetDefault(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(),
+ aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich));
+ SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
+ pColl->ResetAttr(nFontWhich);
+ if(bDelete)
+ {
+ delete (SfxFont*) pFnt;
+ bDelete = sal_False;
+ }
}
-
-// lcl_SetColl(pDoc, RES_POOLCOLL_STANDARD, pPrt, sEntry);
- }
-
- if(!pStdFont->IsFontDefault(FONT_OUTLINE))
- {
- sEntry = pStdFont->GetFontOutline();
- lcl_SetColl(pDoc, RES_POOLCOLL_HEADLINE_BASE, pPrt, sEntry);
- }
-
- if(!pStdFont->IsFontDefault(FONT_LIST))
- {
- sEntry = pStdFont->GetFontList();
- lcl_SetColl(pDoc, RES_POOLCOLL_NUMBUL_BASE, pPrt, sEntry);
}
-
- if(!pStdFont->IsFontDefault(FONT_CAPTION))
+ USHORT aFontIdPoolId[] =
{
- sEntry = pStdFont->GetFontCaption();
- lcl_SetColl(pDoc, RES_POOLCOLL_LABEL, pPrt, sEntry);
- }
-
- if(!pStdFont->IsFontDefault(FONT_INDEX))
+ FONT_OUTLINE, RES_POOLCOLL_HEADLINE_BASE,
+ FONT_LIST, RES_POOLCOLL_NUMBUL_BASE,
+ FONT_CAPTION, RES_POOLCOLL_LABEL,
+ FONT_INDEX, RES_POOLCOLL_REGISTER_BASE,
+ FONT_OUTLINE_CJK, RES_POOLCOLL_HEADLINE_BASE,
+ FONT_LIST_CJK, RES_POOLCOLL_NUMBUL_BASE,
+ FONT_CAPTION_CJK, RES_POOLCOLL_LABEL,
+ FONT_INDEX_CJK, RES_POOLCOLL_REGISTER_BASE
+ };
+
+ USHORT nFontWhich = RES_CHRATR_FONT;
+ for(USHORT nIdx = 0; nIdx < 16; nIdx += 2)
{
- sEntry = pStdFont->GetFontIndex();
- lcl_SetColl(pDoc, RES_POOLCOLL_REGISTER_BASE, pPrt, sEntry);
+ if(nIdx == 8)
+ nFontWhich = RES_CHRATR_CJK_FONT;
+ if(!pStdFont->IsFontDefault(aFontIdPoolId[nIdx]))
+ {
+ sEntry = pStdFont->GetFontFor(aFontIdPoolId[nIdx]);
+ sal_Bool bDelete = sal_False;
+ const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(sEntry): 0;
+ if(!pFnt)
+ {
+ pFnt = new SfxFont( FAMILY_DONTKNOW, sEntry, PITCH_DONTKNOW,
+ ::gsl_getSystemTextEncoding() );
+ bDelete = sal_True;
+ }
+ SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
+ pColl->SetAttr(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(),
+ aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich));
+ if(bDelete)
+ {
+ delete (SfxFont*) pFnt;
+ }
+ }
}
-
/*
//JP 12.07.95: so einfach waere es fuer die neu Mimik
pDoc->SetDefault( SvxTabStopItem( 1,
diff --git a/sw/source/ui/config/fontcfg.cxx b/sw/source/ui/config/fontcfg.cxx
index 6cda5b8fa779..ee105142e4b5 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.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: os $ $Date: 2001-02-09 15:38:22 $
+ * last change: $Author: os $ $Date: 2001-05-11 10:37:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -93,13 +93,18 @@ Sequence<OUString> SwStdFontConfig::GetPropertyNames()
{
static const char* aPropNames[] =
{
- "Standard", // 0
- "Heading", // 1
- "List", // 2
- "Caption", // 3
- "Index", // 4
+ "DefaultFont/Standard", // 0
+ "DefaultFont/Heading", // 1
+ "DefaultFont/List", // 2
+ "DefaultFont/Caption", // 3
+ "DefaultFont/Index", // 4
+ "DefaultFontCJK/Standard", // 5
+ "DefaultFontCJK/Heading", // 6
+ "DefaultFontCJK/List", // 7
+ "DefaultFontCJK/Caption", // 8
+ "DefaultFontCJK/Index", // 9
};
- const int nCount = 5;
+ const int nCount = 10;
Sequence<OUString> aNames(nCount);
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
@@ -112,15 +117,18 @@ Sequence<OUString> SwStdFontConfig::GetPropertyNames()
--------------------------------------------------*/
SwStdFontConfig::SwStdFontConfig() :
- utl::ConfigItem(C2U("Office.Writer/DefaultFont"))
+ utl::ConfigItem(C2U("Office.Writer"))
{
#if defined(UNX)
const String sDefFont(C2S("times"));
#else
const String sDefFont(C2S("Times New Roman"));
#endif
- sFontStandard = sFontList = sFontCaption = sFontIndex = sDefFont;
- sFontOutline = SwStdFontConfig::GetDefaultFor(FONT_OUTLINE);
+ for(sal_Int16 i = 0; i < DEF_FONT_COUNT; i++)
+ sDefaultFonts[i] = sDefFont;
+
+ sDefaultFonts[FONT_OUTLINE] = GetDefaultFor(FONT_OUTLINE);
+ sDefaultFonts[FONT_OUTLINE_CJK] = GetDefaultFor(FONT_OUTLINE_CJK);
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
@@ -134,14 +142,7 @@ SwStdFontConfig::SwStdFontConfig() :
{
OUString sVal;
pValues[nProp] >>= sVal;
- switch(nProp)
- {
- case FONT_STANDARD: sFontStandard= sVal; break;
- case FONT_OUTLINE : sFontOutline = sVal; break;
- case FONT_LIST : sFontList = sVal; break;
- case FONT_CAPTION : sFontCaption = sVal; break;
- case FONT_INDEX : sFontIndex = sVal; break;
- }
+ sDefaultFonts[nProp] = sVal;
}
}
}
@@ -157,29 +158,8 @@ void SwStdFontConfig::Commit()
Any* pValues = aValues.getArray();
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
{
- switch(nProp)
- {
- case FONT_STANDARD:
- if(GetDefaultFor(nProp) != sFontStandard)
- pValues[nProp] <<= OUString(sFontStandard);
- break;
- case FONT_OUTLINE :
- if(GetDefaultFor(nProp) != sFontOutline)
- pValues[nProp] <<= OUString(sFontOutline);
- break;
- case FONT_LIST :
- if(GetDefaultFor(nProp) != sFontList)
- pValues[nProp] <<= OUString(sFontList);
- break;
- case FONT_CAPTION :
- if(GetDefaultFor(nProp) != sFontCaption)
- pValues[nProp] <<= OUString(sFontCaption);
- break;
- case FONT_INDEX :
- if(GetDefaultFor(nProp) != sFontIndex)
- pValues[nProp] <<= OUString(sFontIndex);
- break;
- }
+ if(GetDefaultFor(nProp) != sDefaultFonts[nProp])
+ pValues[nProp] <<= OUString(sDefaultFonts[nProp]);
}
PutProperties(aNames, aValues);
}
@@ -202,29 +182,32 @@ BOOL SwStdFontConfig::IsFontDefault(USHORT nFontType) const
switch( nFontType )
{
case FONT_STANDARD:
- bSame = sFontStandard == rStd;
+ case FONT_STANDARD_CJK:
+ bSame = sDefaultFonts[nFontType] == rStd;
break;
case FONT_OUTLINE :
+ case FONT_OUTLINE_CJK :
#if defined(UNX)
- bSame = sFontOutline == C2S("helvetica");
+ bSame = sDefaultFonts[nFontType] == C2S("helvetica");
#elif defined(WNT) || defined(WIN)
- bSame = sFontOutline == C2S("Arial");
+ bSame = sDefaultFonts[nFontType] == C2S("Arial");
#elif defined(MAC)
- bSame = sFontOutline == C2S("Helvetica");
+ bSame = sDefaultFonts[nFontType] == C2S("Helvetica");
#elif defined(PM20)
- bSame = sFontOutline == C2S("Helvetica");
+ bSame = sDefaultFonts[nFontType] == C2S("Helvetica");
#else
#error Defaultfont fuer diese Plattform?
#endif
break;
case FONT_LIST :
- bSame = (sFontList == rStd) && (sFontStandard == rStd);
- break;
case FONT_CAPTION :
- bSame = (sFontCaption == rStd) && (sFontStandard == rStd);
- break;
case FONT_INDEX :
- bSame = (sFontIndex == rStd) && (sFontStandard == rStd);
+ bSame = (sDefaultFonts[nFontType] == rStd) && (sDefaultFonts[FONT_STANDARD] == rStd);
+ break;
+ case FONT_LIST_CJK :
+ case FONT_CAPTION_CJK :
+ case FONT_INDEX_CJK :
+ bSame = (sDefaultFonts[nFontType] == rStd) && (sDefaultFonts[FONT_STANDARD_CJK] == rStd);
break;
}
return bSame;
@@ -242,12 +225,8 @@ String SwStdFontConfig::GetDefaultFor(USHORT nFontType)
#endif
switch( nFontType )
{
- case FONT_STANDARD:
- case FONT_LIST :
- case FONT_CAPTION :
- case FONT_INDEX :
- break;
case FONT_OUTLINE :
+ case FONT_OUTLINE_CJK :
#if defined(UNX)
sRet = C2S("helvetica");
#elif defined(WNT) || defined(WIN)
diff --git a/sw/source/ui/config/optdlg.hrc b/sw/source/ui/config/optdlg.hrc
index f6d8f1d1ce0a..8acc5b10f1f1 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.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: os $ $Date: 2001-05-04 11:20:22 $
+ * last change: $Author: os $ $Date: 2001-05-11 10:37:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -174,6 +174,8 @@
#define GB_STDCHR 100
#define PB_STANDARD 101
#define CB_DOCONLY 102
+#define ST_SCRIPT_WESTERN 103
+#define ST_SCRIPT_ASIAN 104
//Tabpage Tabelle
#define CB_HEADER 101
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index 9eff819a5129..fc18c6ba0904 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.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: os $ $Date: 2001-05-10 13:29:01 $
+ * last change: $Author: os $ $Date: 2001-05-11 10:37:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1526,30 +1526,8 @@ TabPage TP_STD_FONT
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 195 , 8 ) ;
- Text = "Grundschriften" ;
- Text [ English ] = "Standard fonts" ;
- Text [ norwegian ] = "Standard fonts" ;
- Text [ italian ] = "Caratteri standard" ;
- Text [ portuguese_brazilian ] = "Fontes padrao" ;
- Text [ portuguese ] = "Tipos de letra padrão" ;
- Text [ finnish ] = "Grundschriften" ;
- Text [ danish ] = "Standardskrifttyper" ;
- Text [ french ] = "Polices standard" ;
- Text [ swedish ] = "Standardteckensnitt" ;
- Text [ dutch ] = "Standaardlettertypen" ;
- Text [ spanish ] = "Fuentes estándar" ;
- Text [ english_us ] = "Basic fonts" ;
- Text[ chinese_simplified ] = "±ê×¼×ÖÌå";
- Text[ russian ] = "Îñíîâíûå øðèôòû";
- Text[ polish ] = "Czcionki podstawowe";
- Text[ japanese ] = "Šù’è‚ÌÌ«ÝÄ";
- Text[ chinese_traditional ] = "¼Ð·Ç¦r«¬";
- Text[ arabic ] = "ÇáÎØæØ ÇáÃÓÇÓíÉ";
- Text[ greek ] = "ÂáóéêÝò ãñáììáôïóåéñÝò";
- Text[ korean ] = "±âº» ±Û²Ã";
- Text[ turkish ] = "Standart yazýtipi";
- Text[ language_user1 ] = " ";
- Text[ catalan ] = "Fuentes estándar";
+ Text = "Grundschriften (%1)" ;
+ Text [ English ] = "Basic fonts (%1)" ;
};
FixedText FT_STANDARD
{
@@ -1796,6 +1774,16 @@ TabPage TP_STD_FONT
Text[ finnish ] = "~Oletusarvo";
Text[ catalan ] = "~Predeterminado";
};
+ String ST_SCRIPT_ASIAN
+ {
+ Text = "Asiatisch" ;
+ Text [ English ] = "Asian" ;
+ };
+ String ST_SCRIPT_WESTERN
+ {
+ Text = "Westlich" ;
+ Text [ English ] = "Western" ;
+ };
};
/**************************************************************************/
/* */
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 6d606447897c..1f909f653ccf 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.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: os $ $Date: 2001-05-10 08:47:33 $
+ * last change: $Author: os $ $Date: 2001-05-11 10:37:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -121,6 +121,9 @@
#ifndef _SWTYPES_HXX
#include <swtypes.hxx>
#endif
+#ifndef _CHARATR_HXX
+#include <charatr.hxx>
+#endif
#ifndef _VIEW_HXX
#include <view.hxx>
#endif
@@ -647,6 +650,8 @@ SwStdFontTabPage::SwStdFontTabPage( Window* pParent,
aStdChrFrm (this, SW_RES(GB_STDCHR )),
aDocOnlyCB (this, SW_RES(CB_DOCONLY )),
aStandardPB (this, SW_RES(PB_STANDARD)),
+ sScriptWestern(ResId(ST_SCRIPT_WESTERN)),
+ sScriptAsian(ResId(ST_SCRIPT_ASIAN)),
pPrt(0),
pFontConfig(0),
pWrtShell(0),
@@ -656,7 +661,8 @@ SwStdFontTabPage::SwStdFontTabPage( Window* pParent,
bSetLabelDefault(TRUE),
bSetIdxDefault(TRUE),
bIdxDefault(FALSE),
- bDeletePrinter(FALSE)
+ bDeletePrinter(FALSE),
+ bCJKMode(FALSE)
{
FreeResource();
aStandardPB.SetClickHdl(LINK(this, SwStdFontTabPage, StandardHdl));
@@ -681,8 +687,6 @@ SwStdFontTabPage::~SwStdFontTabPage()
/*-----------------03.09.96 11.53-------------------
--------------------------------------------------*/
-
-
SfxTabPage* SwStdFontTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
@@ -692,10 +696,9 @@ SfxTabPage* SwStdFontTabPage::Create( Window* pParent,
/*-----------------03.09.96 11.53-------------------
--------------------------------------------------*/
-
-
void lcl_SetColl(SwWrtShell* pWrtShell, USHORT nType,
- SfxPrinter* pPrt, const String& rStyle)
+ SfxPrinter* pPrt, const String& rStyle,
+ USHORT nFontWhich)
{
BOOL bDelete = FALSE;
const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(rStyle): 0;
@@ -706,20 +709,16 @@ void lcl_SetColl(SwWrtShell* pWrtShell, USHORT nType,
}
SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(nType);
pColl->SetAttr(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(),
- aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet()));
+ aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich));
if(bDelete)
{
delete (SfxFont*) pFnt;
bDelete = FALSE;
}
}
-
-
/*-----------------03.09.96 11.53-------------------
--------------------------------------------------*/
-
-
BOOL SwStdFontTabPage::FillItemSet( SfxItemSet& rSet )
{
BOOL bNotDocOnly = !aDocOnlyCB.IsChecked();
@@ -739,17 +738,18 @@ BOOL SwStdFontTabPage::FillItemSet( SfxItemSet& rSet )
if(bNotDocOnly)
{
- pFontConfig->SetFontStandard(sStandard);
- pFontConfig->SetFontOutline(sTitle);
- pFontConfig->SetFontList(sList);
- pFontConfig->SetFontCaption(sLabel);
- pFontConfig->SetFontIndex(sIdx);
+ pFontConfig->SetFontStandard(sStandard, bCJKMode);
+ pFontConfig->SetFontOutline(sTitle, bCJKMode);
+ pFontConfig->SetFontList(sList, bCJKMode);
+ pFontConfig->SetFontCaption(sLabel, bCJKMode);
+ pFontConfig->SetFontIndex(sIdx, bCJKMode);
}
if(pWrtShell)
{
pWrtShell->StartAllAction();
SfxPrinter* pPrt = pWrtShell->GetPrt();
BOOL bMod = FALSE;
+ USHORT nFontWhich = bCJKMode ? RES_CHRATR_CJK_FONT : RES_CHRATR_FONT;
if(sStandard != sShellStd)
{
BOOL bDelete = FALSE;
@@ -762,7 +762,7 @@ BOOL SwStdFontTabPage::FillItemSet( SfxItemSet& rSet )
pWrtShell->SetDefault(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(),
aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet()));
SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
- pColl->ResetAttr(RES_CHRATR_FONT);
+ pColl->ResetAttr(nFontWhich);
if(bDelete)
{
delete (SfxFont*) pFnt;
@@ -773,22 +773,22 @@ BOOL SwStdFontTabPage::FillItemSet( SfxItemSet& rSet )
}
if(sTitle != sShellTitle )
{
- lcl_SetColl(pWrtShell, RES_POOLCOLL_HEADLINE_BASE, pPrt, sTitle);
+ lcl_SetColl(pWrtShell, RES_POOLCOLL_HEADLINE_BASE, pPrt, sTitle, nFontWhich);
bMod = TRUE;
}
if(sList != sShellList && (!bListDefault || !bSetListDefault ))
{
- lcl_SetColl(pWrtShell, RES_POOLCOLL_NUMBUL_BASE, pPrt, sList);
+ lcl_SetColl(pWrtShell, RES_POOLCOLL_NUMBUL_BASE, pPrt, sList, nFontWhich);
bMod = TRUE;
}
if(sLabel != sShellLabel && (!bLabelDefault || !bSetLabelDefault))
{
- lcl_SetColl(pWrtShell, RES_POOLCOLL_LABEL, pPrt, sLabel);
+ lcl_SetColl(pWrtShell, RES_POOLCOLL_LABEL, pPrt, sLabel, nFontWhich);
bMod = TRUE;
}
if(sIdx != sShellIndex && (!bIdxDefault || !bSetIdxDefault))
{
- lcl_SetColl(pWrtShell, RES_POOLCOLL_REGISTER_BASE, pPrt, sIdx);
+ lcl_SetColl(pWrtShell, RES_POOLCOLL_REGISTER_BASE, pPrt, sIdx, nFontWhich);
bMod = TRUE;
}
if ( bMod )
@@ -802,9 +802,11 @@ BOOL SwStdFontTabPage::FillItemSet( SfxItemSet& rSet )
/*-----------------03.09.96 11.53-------------------
--------------------------------------------------*/
-
void SwStdFontTabPage::Reset( const SfxItemSet& rSet )
{
+ String sTmp(aStdChrFrm.GetText());
+ sTmp.SearchAndReplaceAscii("%1", bCJKMode ? sScriptAsian : sScriptWestern);
+ aStdChrFrm.SetText(sTmp);
const SfxPoolItem* pItem;
if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_PRINTER, FALSE, &pItem))
@@ -847,32 +849,38 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet )
if(!pWrtShell)
{
- sStdBackup = pFontConfig->GetFontStandard();
- sOutBackup = pFontConfig->GetFontOutline();
- sListBackup= pFontConfig->GetFontList();
- sCapBackup = pFontConfig->GetFontCaption();
- sIdxBackup = pFontConfig->GetFontIndex();
+ sStdBackup = pFontConfig->GetFontStandard(bCJKMode);
+ sOutBackup = pFontConfig->GetFontOutline(bCJKMode);
+ sListBackup= pFontConfig->GetFontList(bCJKMode);
+ sCapBackup = pFontConfig->GetFontCaption(bCJKMode);
+ sIdxBackup = pFontConfig->GetFontIndex(bCJKMode);
aDocOnlyCB.Enable(FALSE);
}
else
{
SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
- sShellStd = sStdBackup = pColl->GetFont().GetFamilyName();
+ const SvxFontItem& rFont = bCJKMode ? pColl->GetCJKFont() : pColl->GetFont();
+ sShellStd = sStdBackup = rFont.GetFamilyName();
pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_HEADLINE_BASE);
- sShellTitle = sOutBackup = pColl->GetFont().GetFamilyName();
+ const SvxFontItem& rFontHL = bCJKMode ? pColl->GetCJKFont() : pColl->GetFont();
+ sShellTitle = sOutBackup = rFontHL.GetFamilyName();
+ USHORT nFontWhich = bCJKMode ? RES_CHRATR_CJK_FONT : RES_CHRATR_FONT;
pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_NUMBUL_BASE);
- bListDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(RES_CHRATR_FONT, FALSE);
- sShellList = sListBackup = pColl->GetFont().GetFamilyName();
+ const SvxFontItem& rFontLS = bCJKMode ? pColl->GetCJKFont() : pColl->GetFont();
+ 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(RES_CHRATR_FONT, FALSE);
- sShellLabel = sCapBackup = pColl->GetFont().GetFamilyName();
+ bLabelDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, FALSE);
+ const SvxFontItem& rFontCP = bCJKMode ? pColl->GetCJKFont() : pColl->GetFont();
+ sShellLabel = sCapBackup = rFontCP.GetFamilyName();
pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_REGISTER_BASE);
- bIdxDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(RES_CHRATR_FONT, FALSE);
- sShellIndex = sIdxBackup = pColl->GetFont().GetFamilyName();
+ bIdxDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, FALSE);
+ const SvxFontItem& rFontIDX = bCJKMode ? pColl->GetCJKFont() : pColl->GetFont();
+ sShellIndex = sIdxBackup = rFontIDX.GetFamilyName();
}
aStandardBox.SetText(sStdBackup );
aTitleBox .SetText(sOutBackup );
@@ -937,7 +945,6 @@ IMPL_LINK( SwStdFontTabPage, ModifyHdl, ComboBox*, pBox )
}
return 0;
}
-
/*-----------------18.01.97 12.14-------------------
Optionen Tabelle
--------------------------------------------------*/
diff --git a/sw/source/ui/inc/fontcfg.hxx b/sw/source/ui/inc/fontcfg.hxx
index 5e83b605d7d9..d09cf63d3e6e 100644
--- a/sw/source/ui/inc/fontcfg.hxx
+++ b/sw/source/ui/inc/fontcfg.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fontcfg.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:14:40 $
+ * last change: $Author: os $ $Date: 2001-05-11 10:37:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,87 +68,62 @@
#include <tools/string.hxx>
#endif
-#define FONT_STANDARD 0
-#define FONT_OUTLINE 1
-#define FONT_LIST 2
-#define FONT_CAPTION 3
-#define FONT_INDEX 4
+#define FONT_STANDARD 0
+#define FONT_OUTLINE 1
+#define FONT_LIST 2
+#define FONT_CAPTION 3
+#define FONT_INDEX 4
+#define FONT_STANDARD_CJK 5
+#define FONT_OUTLINE_CJK 6
+#define FONT_LIST_CJK 7
+#define FONT_CAPTION_CJK 8
+#define FONT_INDEX_CJK 9
+#define DEF_FONT_COUNT 10
+
class SwStdFontConfig : public utl::ConfigItem
{
- String sFontStandard;
- String sFontOutline ;
- String sFontList ;
- String sFontCaption ;
- String sFontIndex ;
+ String sDefaultFonts[DEF_FONT_COUNT];
com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
+ void ChangeString(USHORT nFontType, const String& rSet)
+ {
+ if(sDefaultFonts[nFontType] != rSet)
+ {
+ SetModified();
+ sDefaultFonts[nFontType] = rSet;
+ }
+ }
public:
SwStdFontConfig();
~SwStdFontConfig();
virtual void Commit();
- const String& GetFontStandard() const {return sFontStandard ;}
- const String& GetFontOutline() const {return sFontOutline ;}
- const String& GetFontList () const {return sFontList ;}
- const String& GetFontCaption() const {return sFontCaption ;}
- const String& GetFontIndex () const {return sFontIndex ;}
+ const String& GetFontStandard(sal_Bool bCJK) const {return sDefaultFonts[bCJK ? FONT_STANDARD_CJK : FONT_STANDARD];}
+ const String& GetFontOutline(sal_Bool bCJK) const {return sDefaultFonts[bCJK ? FONT_OUTLINE_CJK : FONT_OUTLINE];}
+ const String& GetFontList (sal_Bool bCJK) const {return sDefaultFonts[bCJK ? FONT_LIST_CJK : FONT_LIST];}
+ const String& GetFontCaption(sal_Bool bCJK) const {return sDefaultFonts[bCJK ? FONT_CAPTION_CJK : FONT_CAPTION];}
+ const String& GetFontIndex (sal_Bool bCJK) const {return sDefaultFonts[bCJK ? FONT_INDEX_CJK : FONT_INDEX];}
+ const String& GetFontFor(USHORT nFontType) const {return sDefaultFonts[nFontType];}
BOOL IsFontDefault(USHORT nFontType) const;
- inline void SetFontStandard(const String& rSet);
- inline void SetFontOutline(const String& rSet);
- inline void SetFontList (const String& rSet);
- inline void SetFontCaption(const String& rSet);
- inline void SetFontIndex (const String& rSet);
+ void SetFontStandard(const String& rSet, sal_Bool bCJK)
+ {ChangeString(bCJK ? FONT_STANDARD_CJK : FONT_STANDARD, rSet);}
+
+ void SetFontOutline(const String& rSet, sal_Bool bCJK)
+ { ChangeString(bCJK ? FONT_OUTLINE_CJK : FONT_OUTLINE, rSet);}
+ void SetFontList (const String& rSet, sal_Bool bCJK)
+ { ChangeString(bCJK ? FONT_LIST_CJK : FONT_LIST, rSet);}
+ void SetFontCaption(const String& rSet, sal_Bool bCJK)
+ { ChangeString(bCJK ? FONT_CAPTION_CJK : FONT_CAPTION, rSet);}
+ void SetFontIndex (const String& rSet, sal_Bool bCJK)
+ { ChangeString(bCJK ? FONT_INDEX_CJK : FONT_INDEX, rSet);}
static String GetDefaultFor(USHORT nFontType);
};
-
-inline void SwStdFontConfig::SetFontStandard (const String& rSet)
-{
- if( sFontStandard != rSet)
- {
- SetModified();
- sFontStandard = rSet;
- }
-}
-inline void SwStdFontConfig::SetFontOutline(const String& rSet)
-{
- if( sFontOutline != rSet)
- {
- SetModified();
- sFontOutline = rSet;
- }
-}
-inline void SwStdFontConfig::SetFontList (const String& rSet)
-{
- if(sFontList != rSet)
- {
- SetModified();
- sFontList = rSet;
- }
-}
-
-inline void SwStdFontConfig::SetFontCaption(const String& rSet)
-{
- if(sFontCaption != rSet)
- {
- SetModified();
- sFontCaption = rSet;
- }
-}
-
-inline void SwStdFontConfig::SetFontIndex (const String& rSet)
-{
- if(sFontIndex != rSet)
- {
- SetModified();
- sFontIndex = rSet;
- }
-}
#endif
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx
index 8997312de7e3..b8d281aa7c15 100644
--- a/sw/source/ui/inc/optpage.hxx
+++ b/sw/source/ui/inc/optpage.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: optpage.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: os $ $Date: 2001-05-04 11:20:32 $
+ * last change: $Author: os $ $Date: 2001-05-11 10:37:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -220,6 +220,7 @@ public:
class SwStdFontTabPage : public SfxTabPage
{
+ FixedLine aStdChrFrm ;
FixedText aStandardLbl;
ComboBox aStandardBox;
FixedText aTitleLbl ;
@@ -231,7 +232,6 @@ class SwStdFontTabPage : public SfxTabPage
FixedText aIdxLbl ;
ComboBox aIdxBox ;
CheckBox aDocOnlyCB ;
- FixedLine aStdChrFrm ;
PushButton aStandardPB;
String sShellStd;
@@ -251,8 +251,10 @@ class SwStdFontTabPage : public SfxTabPage
BOOL bIdxDefault :1;
BOOL bSetIdxDefault :1;
BOOL bDeletePrinter :1;
+ BOOL bCJKMode : 1;
-
+ String sScriptWestern;
+ String sScriptAsian;
DECL_LINK( StandardHdl, PushButton * );
DECL_LINK( ModifyHdl, ComboBox * );
@@ -268,6 +270,7 @@ public:
virtual BOOL FillItemSet( SfxItemSet& rSet );
virtual void Reset( const SfxItemSet& rSet );
+ void SetCJKMode() {bCJKMode = TRUE;}
};
/*-----------------18.01.97 12.10-------------------