#121448# Aligned default fill color/ line style for all apps

Notes:

merged as: c0eb5e7772c848806db8ab461f77f9549c1d8b2b
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 8e45677..827e9ec 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -417,7 +417,6 @@ private:

    sal_uInt8               nAsianCompression;
    sal_uInt8               nAsianKerning;
    sal_Bool                bSetDrawDefaults;

    sal_Bool                bPastingDrawFromOtherDoc;

@@ -477,8 +476,6 @@ public:
    void                    GetLanguage( LanguageType& rLatin, LanguageType& rCjk, LanguageType& rCtl ) const;
    void                    SetLanguage( LanguageType eLatin, LanguageType eCjk, LanguageType eCtl );

    void                    SetDrawDefaults();

    void                        SetConsolidateDlgData( const ScConsolidateParam* pData );
    const ScConsolidateParam*   GetConsolidateDlgData() const { return pConsolidateDlgData; }

@@ -1868,7 +1865,6 @@ private: // CLOOK-Impl-Methoden

    void    UpdateDrawPrinter();
    void    UpdateDrawLanguages();
    void    UpdateDrawDefaults();
    SC_DLLPUBLIC void   InitClipPtrs( ScDocument* pSourceDoc );

    void    LoadDdeLinks(SvStream& rStream);
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index d514216..cd47933 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -204,7 +204,6 @@ ScDocument::ScDocument( ScDocumentMode  eMode,
        nVisSpellState( 0 ),
        nAsianCompression(SC_ASIANCOMPRESSION_INVALID),
        nAsianKerning(SC_ASIANKERNING_INVALID),
        bSetDrawDefaults( sal_False ),
        bPastingDrawFromOtherDoc( sal_False ),
        nInDdeLinkUpdate( 0 ),
        bInUnoBroadcast( sal_False ),
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 7e19b673..6cacf90 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1914,12 +1914,6 @@ void ScDocument::SetLanguage( LanguageType eLatin, LanguageType eCjk, LanguageTy
    UpdateDrawLanguages();      // set edit engine defaults in drawing layer pool
}

void ScDocument::SetDrawDefaults()
{
    bSetDrawDefaults = sal_True;
    UpdateDrawDefaults();
}

Rectangle ScDocument::GetMMRect( SCCOL nStartCol, SCROW nStartRow,
                                SCCOL nEndCol, SCROW nEndRow, SCTAB nTab )
{
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 7bfc6e3..353816db 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -192,7 +192,11 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell )
        pDrawLayer->SetDefaultTabulator( GetDocOptions().GetTabDistance() );

        UpdateDrawPrinter();
        UpdateDrawDefaults();

        // set draw defaults directly
        SfxItemPool& rDrawPool = pDrawLayer->GetItemPool();
        rDrawPool.SetPoolDefaultItem( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );

        UpdateDrawLanguages();
        if (bImportingXML)
            pDrawLayer->EnableAdjust(sal_False);
@@ -217,18 +221,6 @@ void ScDocument::UpdateDrawLanguages()
    }
}

void ScDocument::UpdateDrawDefaults()
{
    // drawing layer defaults that are set for new documents (if InitNew was called)

    if ( pDrawLayer && bSetDrawDefaults )
    {
        SfxItemPool& rDrawPool = pDrawLayer->GetItemPool();
        rDrawPool.SetPoolDefaultItem( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
        pDrawLayer->SetDrawingLayerPoolDefaults();
    }
}

void ScDocument::UpdateDrawPrinter()
{
    if (pDrawLayer)
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 1deda0f..cbcf6bb 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -86,8 +86,6 @@ sal_Bool __EXPORT ScDocShell::InitNew( const uno::Reference < embed::XStorage >&
        SetVisAreaOrSize( Rectangle( Point(), aSize ), sal_True );
    }

    aDocument.SetDrawDefaults();        // drawing layer defaults that are set only in InitNew

    // InitOptions sets the document languages, must be called before CreateStandardStyles
    InitOptions(false);

diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 85c63cc..8759a98 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -294,7 +294,6 @@ sal_Bool DrawDocShell::InitNew( const ::com::sun::star::uno::Reference< ::com::s

    if (bRet)
    {
        mpDoc->SetDrawingLayerPoolDefaults();
        if( !mbSdDataObj )
            mpDoc->NewOrLoadCompleted(NEW_DOC);  // otherwise calling
                                                // NewOrLoadCompleted(NEW_LOADED) in
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index 51f7335..05814e2 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -742,8 +742,6 @@ public:
        This returns false if undo was disabled using EnableUndo( false ) and
        also during the runtime of the Undo() and Redo() methods. */
    bool IsUndoEnabled() const;

    void SetDrawingLayerPoolDefaults();
};

typedef tools::WeakReference< SdrModel > SdrModelWeakRef;
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 0f198f6..cf6630d 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -2170,18 +2170,6 @@ const ::com::sun::star::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelImpleme
    return *pSeq;
}

void SdrModel::SetDrawingLayerPoolDefaults()
{
    const String aNullStr;
    const Color aNullLineCol(COL_DEFAULT_SHAPE_STROKE);
    const Color aNullFillCol(COL_DEFAULT_SHAPE_FILLING);
    const XHatch aNullHatch(aNullLineCol);

    pItemPool->SetPoolDefaultItem( XFillColorItem(aNullStr,aNullFillCol) );
    pItemPool->SetPoolDefaultItem( XFillHatchItem(pItemPool,aNullHatch) );
    pItemPool->SetPoolDefaultItem( XLineColorItem(aNullStr,aNullLineCol) );
}

//
// i120668, move from the header files, add delete action
//
diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx
index 470bc97..63dc9e0 100644
--- a/svx/source/xoutdev/xpool.cxx
+++ b/svx/source/xoutdev/xpool.cxx
@@ -48,11 +48,11 @@ XOutdevItemPool::XOutdevItemPool(
    const XubString aNullStr;
    const Graphic aNullGraphic;
    const basegfx::B2DPolyPolygon aNullPol;
    const Color aNullLineCol(RGB_Color(COL_BLACK));
    const Color aNullFillCol(RGB_COLORDATA( 153, 204, 255 ));
    const Color aNullLineCol(COL_DEFAULT_SHAPE_STROKE); // #121448# Use defined default color
    const Color aNullFillCol(COL_DEFAULT_SHAPE_FILLING); // #121448# Use defined default color
    const Color aNullShadowCol(RGB_Color(COL_LIGHTGRAY));
    const XDash aNullDash;
    const XGradient aNullGrad(aNullLineCol, RGB_Color(COL_WHITE));
    const XGradient aNullGrad(RGB_Color(COL_BLACK), RGB_Color(COL_WHITE));
    const XHatch aNullHatch(aNullLineCol);

    // get master pointer, evtl. add myself to the end of the pools
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 8eeaf36..d2bcd6a 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -602,8 +602,6 @@ private:

    sal_Bool    mbStartIdleTimer                 ;    // idle timer mode start/stop

    bool        mbSetDrawDefaults                ;    // set draw pool defaults for freshly created documents

    static SwAutoCompleteWord *pACmpltWords;    // Liste aller Worte fuers AutoComplete

    //---------------- private Methoden ------------------------------
@@ -2121,13 +2119,6 @@ public:
    ::sw::UndoManager      & GetUndoManager();
    ::sw::UndoManager const& GetUndoManager() const;
    SfxObjectShell* CreateCopy(bool bCallInitNew) const;

    /// must be called only in SwDocShell::InitNew, causes UpdateDrawDefaults to be called when drawing layer is created
    void SetDrawDefaults();

private:
    /// method to set new graphics pool defaults, must only be called by SetDrawDefaults!
    void UpdateDrawDefaults();
};


diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index b72b2b2..99fd96e 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -705,8 +705,6 @@ void SwDoc::InitDrawModel()
            pViewSh = (ViewShell*)pViewSh->GetNext();
        }while( pViewSh != pCurrentView );
    }

    UpdateDrawDefaults();
}

/** method to notify drawing page view about the invisible layers
@@ -1099,16 +1097,4 @@ namespace docfunc
}
// <--

void SwDoc::SetDrawDefaults()
{
    mbSetDrawDefaults = true;
    UpdateDrawDefaults();
}

void SwDoc::UpdateDrawDefaults()
{
    // drawing layer defaults that are set for new documents (if InitNew was called)
    if ( pDrawModel && mbSetDrawDefaults )
        pDrawModel->SetDrawingLayerPoolDefaults();
}

// eof
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index a5f7041..7682e58 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -299,7 +299,6 @@ SwDoc::SwDoc()
    n32DummyCompatabilityOptions1(0),
    n32DummyCompatabilityOptions2(0),
    mbStartIdleTimer(sal_False),
    mbSetDrawDefaults(false),
    meDocType( DOCTYPE_NATIVE )
{
    RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "SwDoc::SwDoc" );
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index d27396e..e323561 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -347,8 +347,6 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
    //#i16874# AutoKerning as default for new documents
    pDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) );

    pDoc->SetDrawDefaults();

    // --> OD 2005-02-10 #i42080# - Due to the several calls of method <SetDefault(..)>
    // at the document instance, the document is modified. Thus, reset this
    // status here. Note: In method <SubInitNew()> this is also done.