Kaydet (Commit) 448c6283 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

SdStyleSheetPool::GetBulletFont can be static

...that's why the problem fixed in 0466c0dc "Set
mxStyleSheetPool before using it" had never caused trouble in practice (and its
change to SdDrawDocument ctor can be reverted again)

Change-Id: I662995ab4fcaa7ae461cb9575666825d8a869735
üst 8a5b3971
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
void CreatePseudosIfNecessary(); void CreatePseudosIfNecessary();
void UpdateStdNames(); void UpdateStdNames();
static void PutNumBulletItem( SfxStyleSheetBase* pSheet, Font& rBulletFont ); static void PutNumBulletItem( SfxStyleSheetBase* pSheet, Font& rBulletFont );
Font GetBulletFont() const; static Font GetBulletFont();
SdDrawDocument* GetDoc() const { return mpDoc; } SdDrawDocument* GetDoc() const { return mpDoc; }
......
...@@ -204,12 +204,11 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) ...@@ -204,12 +204,11 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
pItemPool->SetDefaultMetric(SFX_MAPUNIT_100TH_MM); pItemPool->SetDefaultMetric(SFX_MAPUNIT_100TH_MM);
pItemPool->FreezeIdRanges(); pItemPool->FreezeIdRanges();
SetTextDefaults();
// DrawingEngine has to know where it is... // DrawingEngine has to know where it is...
FmFormModel::SetStyleSheetPool( new SdStyleSheetPool( GetPool(), this ) ); FmFormModel::SetStyleSheetPool( new SdStyleSheetPool( GetPool(), this ) );
SetTextDefaults(); // requires the StyleSheetPool set above
// Set StyleSheetPool for DrawOutliner, so text objects can be read correctly. // Set StyleSheetPool for DrawOutliner, so text objects can be read correctly.
// The link to the StyleRequest handler of the document is set later, in // The link to the StyleRequest handler of the document is set later, in
// NewOrLoadCompleted, because only then do all the templates exist. // NewOrLoadCompleted, because only then do all the templates exist.
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#include <sal/config.h> #include <sal/config.h>
#include <cassert>
#include <com/sun/star/style/XStyle.hpp> #include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp>
#include <i18nlangtag/mslangid.hxx> #include <i18nlangtag/mslangid.hxx>
...@@ -243,7 +241,7 @@ void SdDrawDocument::CreateLayoutTemplates() ...@@ -243,7 +241,7 @@ void SdDrawDocument::CreateLayoutTemplates()
aBulletItem.SetStart(1); aBulletItem.SetStart(1);
aBulletItem.SetScale(45); // In percent aBulletItem.SetScale(45); // In percent
Font aBulletFont( pSSPool->GetBulletFont() ); Font aBulletFont( SdStyleSheetPool::GetBulletFont() );
aBulletFont.SetSize(Size(0,635)); // sj: (i33745) changed default from 24 to 18 pt aBulletFont.SetSize(Size(0,635)); // sj: (i33745) changed default from 24 to 18 pt
...@@ -1209,8 +1207,7 @@ void SdDrawDocument::SetTextDefaults() const ...@@ -1209,8 +1207,7 @@ void SdDrawDocument::SetTextDefaults() const
{ {
// BulletItem and BulletFont for Titel and Outline // BulletItem and BulletFont for Titel and Outline
SvxBulletItem aBulletItem(EE_PARA_BULLET); SvxBulletItem aBulletItem(EE_PARA_BULLET);
assert(mxStyleSheetPool.is()); Font aBulletFont( SdStyleSheetPool::GetBulletFont() );
Font aBulletFont( static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->GetBulletFont() );
aBulletFont.SetSize(Size(0,846)); // 24 pt aBulletFont.SetSize(Size(0,846)); // 24 pt
aBulletItem.SetFont(aBulletFont); aBulletItem.SetFont(aBulletFont);
aBulletItem.SetStyle(BS_BULLET); aBulletItem.SetStyle(BS_BULLET);
......
...@@ -1223,7 +1223,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, ...@@ -1223,7 +1223,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
|* |*
\************************************************************************/ \************************************************************************/
Font SdStyleSheetPool::GetBulletFont() const Font SdStyleSheetPool::GetBulletFont()
{ {
Font aBulletFont( OUString( "StarSymbol" ), Size(0, 1000) ); Font aBulletFont( OUString( "StarSymbol" ), Size(0, 1000) );
aBulletFont.SetCharSet(RTL_TEXTENCODING_UNICODE); aBulletFont.SetCharSet(RTL_TEXTENCODING_UNICODE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment