summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2015-09-01 15:54:45 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2015-09-01 16:42:51 +0300
commit97acd294518e9c91d8b103d6700768b7ca7e5bbf (patch)
tree311a2467dacdaada1198c7f2e07d068d0eb2f749 /sw/source/ui
parentf565867dfdc3a320e25522122f58491ebcbd0fb5 (diff)
Make saving the default fonts work again
This reverts part of 745c7bce5fe8b218f7d300667a5409bc7ef58c34. The current behavior of affecting only the current document is useless, given that the same can be done by editing the corresponding styles. Actually I'm pretty sure that's why the wiki flagged the "Current document only" option as unnecessary. So let's go back to saving for all documents. Change-Id: I7ed9609bc93ae519ac89a6e6080a3b37b09633d8
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/config/optpage.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index a87396de73a6..519bec7b39bc 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -657,6 +657,8 @@ static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
bool SwStdFontTabPage::FillItemSet( SfxItemSet* )
{
+ SW_MOD()->GetModuleConfig()->SetDefaultFontInCurrDocOnly(false);
+
const OUString sStandard = pStandardBox->GetText();
const OUString sTitle = pTitleBox->GetText();
const OUString sList = pListBox->GetText();
@@ -668,6 +670,38 @@ bool SwStdFontTabPage::FillItemSet( SfxItemSet* )
bool bListHeightChanged = pListHeightLB->IsValueChangedFromSaved() && (!bListHeightDefault || !bSetListHeightDefault );
bool bLabelHeightChanged = pLabelHeightLB->IsValueChangedFromSaved() && (!bLabelHeightDefault || !bSetLabelHeightDefault );
bool bIndexHeightChanged = pIndexHeightLB->IsValueChangedFromSaved() && (!bIndexHeightDefault || !bSetIndexHeightDefault );
+
+ 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)pStandardHeightLB->GetValue() / 10;
+ pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_STANDARD, nFontGroup );
+ }
+ if(bTitleHeightChanged)
+ {
+ float fSize = (float)pTitleHeightLB->GetValue() / 10;
+ pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_OUTLINE, nFontGroup );
+ }
+ if(bListHeightChanged)
+ {
+ float fSize = (float)pListHeightLB->GetValue() / 10;
+ pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_LIST, nFontGroup );
+ }
+ if(bLabelHeightChanged)
+ {
+ float fSize = (float)pLabelHeightLB->GetValue() / 10;
+ pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_CAPTION, nFontGroup );
+ }
+ if(bIndexHeightChanged)
+ {
+ float fSize = (float)pIndexHeightLB->GetValue() / 10;
+ pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_INDEX, nFontGroup );
+ }
+
if(pWrtShell)
{
pWrtShell->StartAllAction();