summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lippka ORACLE <christian.lippka@oracle.com>2011-12-06 03:27:48 +0100
committerThorsten Behrens <tbehrens@suse.com>2011-12-06 09:39:12 +0100
commitb97726f4b66aa85db8cb2ab27b8413066930cf4f (patch)
treed7b876c4055f632abf07364b40f48579f3f632fa
parentf0a1b95f99bed6d184e3020b5c7e30bc6c1597f6 (diff)
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
-rw-r--r--sc/source/core/data/documen9.cxx1
-rw-r--r--sd/source/ui/docshell/docshel4.cxx1
-rw-r--r--svx/inc/svx/svdmodel.hxx1
-rw-r--r--svx/source/svdraw/svdmodel.cxx15
-rw-r--r--svx/source/xoutdev/xpool.cxx4
-rw-r--r--sw/inc/doc.hxx9
-rw-r--r--sw/source/core/doc/docdraw.cxx15
-rw-r--r--sw/source/core/doc/docnew.cxx3
-rw-r--r--sw/source/ui/app/docshini.cxx2
9 files changed, 48 insertions, 3 deletions
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index bb374343d7ff..b8cca4c9f52e 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -198,6 +198,7 @@ void ScDocument::UpdateDrawDefaults()
{
SfxItemPool& rDrawPool = pDrawLayer->GetItemPool();
rDrawPool.SetPoolDefaultItem( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
+ pDrawLayer->SetDrawingLayerPoolDefaults();
}
}
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index a63a72848feb..a486f56244fa 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -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
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index 567c821e5f4e..2b74913f2d99 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -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;
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 20f19d5427be..b387f4c14a69 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -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);
diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx
index 25a04473b4c2..343408302313 100644
--- a/svx/source/xoutdev/xpool.cxx
+++ b/svx/source/xoutdev/xpool.cxx
@@ -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));
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 7bd5e2dd9abe..b891b4ec85d1 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -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.
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 75c90adf81e9..2d5671c41f73 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -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: */
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 9587561953ad..cba769405977 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -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" );
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index 98eb84865095..8321abd82adc 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -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.
sing, added that. Seems as if that test is no tpart of the usual 'make' scenario, but used/executed in gerrit builds SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Free SdrObjects when SdrModel goes down In an UNO API test problem is that SvxShapes reference SdrShapes, but these are not added to a SdrPage and not 'owned' by the SvxShape. Thus these do not get deleted at all (same in master, memory leak). I extended SvxShape::Notify the case for ModelCleared to also Free the SdrObject when not owner and it's not added to a SdrPage (in that case it gets deleted with deleting the SdrModel) SOSAW080: Solve UNO API calls that move SvxShapes to other Model Due to UNO API tests I got a call to insert an xShape to a xDrawPage which was constructed in another Model, this has now to be done by Cloning the SdrObject to the new SdrModel, getting rid of the old one and getting all the UNO implementation stuff right (referemces SdrObject <-> xShape). Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c 1cb7d573d323e98a89761fe662c10c4a654fdec0 24617494a0ef79f6e33dfcb02782a833a81c6434 763f39094b6a48b529a6952d01468f8776c97679 242b9e228a9a042c3a5bdd38b1ea6600144276d5 242b9e228a9a042c3a5bdd38b1ea6600144276d5 33a6f3f306b70c223171aef796dd5ee041ad14df 6878b33f8b05738a44c0910e40a60a0f0d1d58ed 0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2 8c4626274a5cc531dad27f27c0c45d4c528fb2fb 446685a49a6d67aedd01cfbbd5e87b07f97a4d7b c1b5ed3c99bc7219a0061e4ece24ea42afd2889a 22de9a1c8af7c25be5c108671ddc548ba323ed47 4caf6b6fbbe6e8130741d793dffb560fd01d4ed5 488b9601735ec1822433f82f633990063951fe08 c366d60299f239e3df856ddffedb19e743e4be0c c5137ba8c597c7b5f90318df50e87b93a39a28dc f9e646242cf89f6fde1315046952252a2c429779 f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410 1694b54903df784385abaa8452e1201e12344238 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 7b5c241faec7488924e5935ae8b19f785846b5e4 bf097ee7467895823fbd158a2a9543da3b5a5078 2018-01-15convert a<b?a:b to std::min(a,b)Noel Grandin with something like git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23 Note: we also convert a>b?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2018-01-11convert (a>b?a:b) to std::max(a,b)Noel Grandin with something like: git grep -nP '(.*)\s*>\s*(.*)\s*\?\s*\g1\s*:\s*\g2' Change-Id: I60b9a3a2a09162bc0de4c13fdde2c209696e5413 Reviewed-on: https://gerrit.libreoffice.org/47602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2017-11-18RotateFlyFrame3: Initial support addedArmin Le Grand First steps to get a rotated FlyFrame and content that only uses layouted sizes/positions and does not change the model data (except rotation). This works with persistence, after reload the rotation can be resetted with going back to the original FrameSize. Lot of stuff not yet working, experimental state. Change-Id: Ie29d501fe2e618a1cb4457d600ce97575ed372d0 2017-10-29ofz#3883 Integer-overflowCaolán McNamara Change-Id: Ie1fd6617d6e598c6e2cfa8a83a0ffe16948e1efd Reviewed-on: https://gerrit.libreoffice.org/44022 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2017-10-09ofz+ubsan: limit double range to sal_Int32 limitsCaolán McNamara wmf fuzzing Change-Id: I37b437717f064c6c85cd383315adf4e989486412 Reviewed-on: https://gerrit.libreoffice.org/43272 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2017-10-04Revert "check for unnecessary DLLPUBLIC annotations"Stephan Bergmann This reverts commit a599eeab786ecbe1b5b6509e3c792e5c1ba31248, plus follow-up fa4431449d0306e8179f53a2a69c549800bd24bd "Avoid bogus loplugin:dllmacro 'unnecessary *DLLPUBLIC declaration ...'". See (abandoned) <https://gerrit.libreoffice.org/#/c/42983/> "loplugin:dllmacro: Handle implicit member functions" how this would have needed to be extended to give consistent results across Linux and macOS, but then would have started to remove DLLPUBLIC from entities that apparently need to at least have default type visibility on macOS and started to make tests fail. 2017-09-29check for unnecessary DLLPUBLIC annotationsNoel Grandin on classes which are fully defined in a header file Rename the dllprivate plugin to dllmacro and add the functionality there. Change-Id: I4581d551c46a8f61213d95973f323359d08278d8