Kaydet (Commit) b97726f4 authored tarafından Christian Lippka ORACLE's avatar Christian Lippka ORACLE Kaydeden (comit) Thorsten Behrens

impress210: #i117133# put new drawing layer fill and stroke styles in pool only…

impress210: #i117133# put new drawing layer fill and stroke styles in pool only for newly created documents

# HG changeset patch
# User Christian Lippka ORACLE <christian.lippka@oracle.com>
# Date 1299763312 -3600
# Node ID 6b1140cdac81a77836e5be80033f328a0956c94a
# Parent  8edc33ef50a3b6ebbc4e88d574b6b1ba57b1dbaa

impress210: #i117133# put new drawing layer fill and stroke styles in pool only for newly created documents
üst f0a1b95f
......@@ -198,6 +198,7 @@ void ScDocument::UpdateDrawDefaults()
{
SfxItemPool& rDrawPool = pDrawLayer->GetItemPool();
rDrawPool.SetPoolDefaultItem( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
pDrawLayer->SetDrawingLayerPoolDefaults();
}
}
......
......@@ -269,6 +269,7 @@ 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
......
......@@ -693,6 +693,7 @@ public:
also during the runtime of the Undo() and Redo() methods. */
bool IsUndoEnabled() const;
void SetDrawingLayerPoolDefaults();
};
typedef tools::WeakReference< SdrModel > SdrModelWeakRef;
......
......@@ -74,6 +74,9 @@
#include "svx/svdstr.hrc" // object's name
#include "svdoutlinercache.hxx"
#include "svx/xflclit.hxx"
#include "svx/xflhtit.hxx"
#include "svx/xlnclit.hxx"
#include <svl/asiancfg.hxx>
#include "editeng/fontitem.hxx"
......@@ -2054,6 +2057,18 @@ const ::com::sun::star::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelImpleme
return theSdrModelUnoTunnelImplementationId::get().getSeq();
}
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) );
}
////////////////////////////////////////////////////////////////////////////////////////////////////
TYPEINIT1(SdrHint,SfxHint);
......
......@@ -51,8 +51,8 @@ XOutdevItemPool::XOutdevItemPool(
const XubString aNullStr;
const Bitmap aNullBmp;
const basegfx::B2DPolyPolygon aNullPol;
const Color aNullLineCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE));
const Color aNullFillCol(RGB_Color(COL_DEFAULT_SHAPE_FILLING));
const Color aNullLineCol(RGB_Color(COL_BLACK));
const Color aNullFillCol(RGB_COLORDATA( 153, 204, 255 ));
const Color aNullShadowCol(RGB_Color(COL_LIGHTGRAY));
const XDash aNullDash;
const XGradient aNullGrad(aNullLineCol, RGB_Color(COL_WHITE));
......
......@@ -591,6 +591,8 @@ private:
sal_Bool mbStartIdleTimer; // idle timer mode start/stop
bool mbSetDrawDefaults; // set draw pool defaults for freshly created documents
static SwAutoCompleteWord *pACmpltWords; // List of all words for AutoComplete
//---------------- private methods ------------------------------
......@@ -2043,6 +2045,13 @@ public:
*/
void dumpAsXml( xmlTextWriterPtr writer = NULL );
#endif
/// 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();
};
// This method is called in Dtor of SwDoc and deletes cache of ContourObjects.
......
......@@ -658,6 +658,8 @@ void SwDoc::InitDrawModel()
pViewSh = (ViewShell*)pViewSh->GetNext();
}while( pViewSh != pCurrentView );
}
UpdateDrawDefaults();
}
/** method to notify drawing page view about the invisible layers */
......@@ -1034,4 +1036,17 @@ 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();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -279,7 +279,8 @@ SwDoc::SwDoc()
mbLastBrowseMode( false ),
n32DummyCompatabilityOptions1(0),
n32DummyCompatabilityOptions2(0),
mbStartIdleTimer(sal_False)
mbStartIdleTimer(sal_False),
mbSetDrawDefaults(false)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::SwDoc" );
......
......@@ -339,6 +339,8 @@ 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();
// #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.
......
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