diff options
author | Armin Le Grand <alg@apache.org> | 2013-04-24 14:18:22 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-05-20 11:33:21 +0100 |
commit | b8fe3f84a60ea73aed9748844aee80441eb0fc7d (patch) | |
tree | 7f012f2db005ec41f91268623b475b47f7ea36e9 /svx/source/svdraw/svdedtv1.cxx | |
parent | 0f48d9182530e992114d3338889e631c462fc80b (diff) |
Related: #i122121# moved automatic StartEnd adaption to svx
(cherry picked from commit 81e9ede3e748a40555e87efd1af19521dab5261d)
Conflicts:
sd/source/ui/view/drviews2.cxx
Change-Id: I5ce51fce89e8f29d2f469bf11c5ba6f075f690f2
Diffstat (limited to 'svx/source/svdraw/svdedtv1.cxx')
-rw-r--r-- | svx/source/svdraw/svdedtv1.cxx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 6a1c62e5a269..196779b7770c 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -49,6 +49,9 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <svx/AffineMatrixItem.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <svx/xlnwtit.hxx> +#include <svx/xlnstwit.hxx> +#include <svx/xlnedwit.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1033,6 +1036,16 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll) // #i38135# bool bResetAnimationTimer(false); + // check if LineWidth is part of the change + const bool bLineWidthChange(SFX_ITEM_SET == aAttr.GetItemState(XATTR_LINEWIDTH)); + sal_Int32 nNewLineWidth(0); + sal_Int32 nOldLineWidth(0); + + if(bLineWidthChange) + { + nNewLineWidth = ((const XLineWidthItem&)aAttr.Get(XATTR_LINEWIDTH)).GetValue(); + } + for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) { SdrMark* pM=GetSdrMarkByIndex(nm); @@ -1077,9 +1090,38 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll) aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pObj)); } + if(bLineWidthChange) + { + nOldLineWidth = ((const XLineWidthItem&)pObj->GetMergedItem(XATTR_LINEWIDTH)).GetValue(); + } + // set attributes at object pObj->SetMergedItemSetAndBroadcast(aAttr, bReplaceAll); + if(bLineWidthChange) + { + const SfxItemSet& rSet = pObj->GetMergedItemSet(); + + if(nOldLineWidth != nNewLineWidth) + { + if(SFX_ITEM_DONTCARE != rSet.GetItemState(XATTR_LINESTARTWIDTH)) + { + const sal_Int32 nValAct(((const XLineStartWidthItem&)rSet.Get(XATTR_LINESTARTWIDTH)).GetValue()); + const sal_Int32 nValNewStart(std::max((sal_Int32)0, nValAct + (((nNewLineWidth - nOldLineWidth) * 15) / 10))); + + pObj->SetMergedItem(XLineStartWidthItem(nValNewStart)); + } + + if(SFX_ITEM_DONTCARE != rSet.GetItemState(XATTR_LINEENDWIDTH)) + { + const sal_Int32 nValAct(((const XLineEndWidthItem&)rSet.Get(XATTR_LINEENDWIDTH)).GetValue()); + const sal_Int32 nValNewEnd(std::max((sal_Int32)0, nValAct + (((nNewLineWidth - nOldLineWidth) * 15) / 10))); + + pObj->SetMergedItem(XLineEndWidthItem(nValNewEnd)); + } + } + } + if(pObj->ISA(SdrTextObj)) { SdrTextObj* pTextObj = ((SdrTextObj*)pObj); |