[Libreoffice-commits] core.git: sw/source
Maxim Monastirsky
momonasmon at gmail.com
Tue Sep 1 06:43:51 PDT 2015
sw/source/ui/config/optpage.cxx | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
New commits:
commit 97acd294518e9c91d8b103d6700768b7ca7e5bbf
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Tue Sep 1 15:54:45 2015 +0300
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
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index a87396d..519bec7 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();
More information about the Libreoffice-commits
mailing list