diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-09-17 10:29:02 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-09-17 10:29:02 +0000 |
commit | 762181f6f1168e0eb54009990222d7cb4cebebd5 (patch) | |
tree | eae0197fb4e9ee2549d31e358f01386145cff5a9 /svx | |
parent | 4e5d76b3cef5a863d5961e33a0c08c26b0b6dc2d (diff) |
CWS-TOOLING: integrate CWS aw077
2009-09-17 Armin Le Grand #resolved conflicts for integration
2009-09-07 Armin Le Grand #i103058# re-added handling of StatusBar texts for DrawObject creation, added FullDrag for circle-similar shapes (all in the ellipse toolbar)
2009-09-03 Armin Le Grand #i100514# extended TextAttributes and handling, adapted for super/subscript, adapted WordBreaking (again)
2009-09-02 Armin Le Grand #i104432# secured TextLayouterDevice::getTextBoundRect implementation and usage
2009-09-02 Armin Le Grand #i104232#, #i100514# Mainly solved 1st one, no more local SpellCheck remembering, but adding to compare op's where needed
2009-08-19 Armin Le Grand #i100514# commited in-between version due to 2week holiday
2009-08-13 Armin Le Grand #i99157# applied changes to BitmapEx and SdrHdlBitmapSet
2009-08-06 Armin Le Grand #i100357# added clipping for too big MetaFiles
Diffstat (limited to 'svx')
22 files changed, 436 insertions, 299 deletions
diff --git a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx index e0dcb51e9460..1759eb18d319 100644 --- a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx +++ b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx @@ -35,6 +35,7 @@ #include <sal/types.h> #include <svx/xenum.hxx> #include <svx/outlobj.hxx> +#include <svx/sdtaitm.hxx> ////////////////////////////////////////////////////////////////////////////// // predefines @@ -68,6 +69,10 @@ namespace drawinglayer // #i101556# use versioning from text attributes to detect changes sal_uInt32 maPropertiesVersion; + // text alignments + SdrTextHorzAdjust maSdrTextHorzAdjust; + SdrTextVertAdjust maSdrTextVertAdjust; + // bitfield unsigned mbContour : 1; unsigned mbFitToSize : 1; @@ -75,6 +80,7 @@ namespace drawinglayer unsigned mbBlink : 1; unsigned mbScroll : 1; unsigned mbInEditMode : 1; + unsigned mbFixedCellHeight : 1; public: SdrTextAttribute( @@ -85,12 +91,15 @@ namespace drawinglayer sal_Int32 aTextUpperDistance, sal_Int32 aTextRightDistance, sal_Int32 aTextLowerDistance, + SdrTextHorzAdjust aSdrTextHorzAdjust, + SdrTextVertAdjust aSdrTextVertAdjust, bool bContour, bool bFitToSize, bool bHideContour, bool bBlink, bool bScroll, - bool bInEditMode); + bool bInEditMode, + bool bFixedCellHeight); ~SdrTextAttribute(); // copy constructor and assigment operator @@ -109,12 +118,15 @@ namespace drawinglayer bool isBlink() const { return mbBlink; } bool isScroll() const { return mbScroll; } bool isInEditMode() const { return mbInEditMode; } + bool isFixedCellHeight() const { return mbFixedCellHeight; } const SdrFormTextAttribute* getSdrFormTextAttribute() const { return mpSdrFormTextAttribute; } sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; } sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; } sal_Int32 getTextRightDistance() const { return maTextRightDistance; } sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; } sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; } + SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; } + SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; } // animation timing generation void getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const; diff --git a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx index 6dd60b45d2d5..132a3ecc2538 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -40,6 +40,7 @@ #include <tools/color.hxx>
#include <svx/sdr/attribute/sdrformtextattribute.hxx> #include <tools/weakbase.hxx> +#include <svx/sdtaitm.hxx> ////////////////////////////////////////////////////////////////////////////// // predefines @@ -82,11 +83,6 @@ namespace drawinglayer Color maLastTextBackgroundColor; // bitfield - // remember if last decomposition was with or without spell checker. In this special - // case the get2DDecomposition implementation has to take care of this aspect. This is - // needed since different views do different text decompositons regarding spell checking. - unsigned mbLastSpellCheck : 1; - // is there a PageNumber, Header, Footer or DateTimeField used? Evaluated at construction unsigned mbContainsPageField : 1; unsigned mbContainsPageCountField : 1; @@ -96,9 +92,6 @@ namespace drawinglayer // support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments Primitive2DSequence encapsulateWithTextHierarchyBlockPrimitive2D(const Primitive2DSequence& rCandidate) const; - bool getLastSpellCheck() const { return (bool)mbLastSpellCheck; } - void setLastSpellCheck(bool bNew) { mbLastSpellCheck = bNew; } - public: SdrTextPrimitive2D( const SdrText* pSdrText, @@ -217,7 +210,12 @@ namespace drawinglayer // text range transformation from unit range ([0.0 .. 1.0]) to text range basegfx::B2DHomMatrix maTextRangeTransform; + // text alignments + SdrTextHorzAdjust maSdrTextHorzAdjust; + SdrTextVertAdjust maSdrTextVertAdjust; + // bitfield + unsigned mbFixedCellHeight : 1; unsigned mbUnlimitedPage : 1; // force layout with no text break unsigned mbCellText : 1; // this is a cell text as block text unsigned mbWordWrap : 1; // for CustomShapes text layout @@ -231,12 +229,18 @@ namespace drawinglayer const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObjectPtr, const basegfx::B2DHomMatrix& rTextRangeTransform, + SdrTextHorzAdjust aSdrTextHorzAdjust, + SdrTextVertAdjust aSdrTextVertAdjust, + bool bFixedCellHeight, bool bUnlimitedPage, bool bCellText, bool bWordWrap); // get data const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; } + SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; } + SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; } + bool isFixedCellHeight() const { return mbFixedCellHeight; } bool getUnlimitedPage() const { return mbUnlimitedPage; } bool getCellText() const { return mbCellText; } bool getWordWrap() const { return mbWordWrap; } @@ -265,6 +269,9 @@ namespace drawinglayer // text range transformation from unit range ([0.0 .. 1.0]) to text range basegfx::B2DHomMatrix maTextRangeTransform; + // bitfield + unsigned mbFixedCellHeight : 1; + protected: // local decomposition. virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const; @@ -273,10 +280,12 @@ namespace drawinglayer SdrStretchTextPrimitive2D( const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObjectPtr, - const basegfx::B2DHomMatrix& rTextRangeTransform); + const basegfx::B2DHomMatrix& rTextRangeTransform, + bool bFixedCellHeight); // get data const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; } + bool isFixedCellHeight() const { return mbFixedCellHeight; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; diff --git a/svx/inc/svx/svdhdl.hxx b/svx/inc/svx/svdhdl.hxx index 11d400b85b8a..4960323feeb7 100644 --- a/svx/inc/svx/svdhdl.hxx +++ b/svx/inc/svx/svdhdl.hxx @@ -58,7 +58,6 @@ class SdrHdlList; class SdrMarkView; class SdrObject; class SdrPageView; -class SdrHdlBitmapSet; //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -155,12 +154,6 @@ class SVX_DLLPUBLIC SdrHdl friend class SdrMarkView; // fuer den Zugriff auf nObjHdlNum friend class SdrHdlList; - static SdrHdlBitmapSet* pSimpleSet; - static SdrHdlBitmapSet* pModernSet; - - // #101928# - static SdrHdlBitmapSet* pHighContrastSet; - // #101928# BitmapEx ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, sal_Bool bFine, sal_Bool bIsHighContrast); diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx index 5298fc2dd79b..6ffa4ab5bd22 100644 --- a/svx/inc/svx/svdotext.hxx +++ b/svx/inc/svx/svdotext.hxx @@ -575,20 +575,19 @@ public: public: ////////////////////////////////////////////////////////////////////////////// // text primitive decomposition helpers - bool impCheckSpellCheckForDecomposeTextPrimitive() const; - bool impDecomposeContourTextPrimitive( + void impDecomposeContourTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; - bool impDecomposePathTextPrimitive( + void impDecomposePathTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; - bool impDecomposeBlockTextPrimitive( + void impDecomposeBlockTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; - bool impDecomposeStretchTextPrimitive( + void impDecomposeStretchTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index 33c958fa6268..ae6204d15bef 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -57,12 +57,15 @@ namespace drawinglayer sal_Int32 aTextUpperDistance, sal_Int32 aTextRightDistance, sal_Int32 aTextLowerDistance, + SdrTextHorzAdjust aSdrTextHorzAdjust, + SdrTextVertAdjust aSdrTextVertAdjust, bool bContour, bool bFitToSize, bool bHideContour, bool bBlink, bool bScroll, - bool bInEditMode) + bool bInEditMode, + bool bFixedCellHeight) : mpSdrText(&rSdrText), maOutlinerParaObject(rOutlinerParaObject), mpSdrFormTextAttribute(0), @@ -71,12 +74,15 @@ namespace drawinglayer maTextRightDistance(aTextRightDistance), maTextLowerDistance(aTextLowerDistance), maPropertiesVersion(0), + maSdrTextHorzAdjust(aSdrTextHorzAdjust), + maSdrTextVertAdjust(aSdrTextVertAdjust), mbContour(bContour), mbFitToSize(bFitToSize), mbHideContour(bHideContour), mbBlink(bBlink), mbScroll(bScroll), - mbInEditMode(bInEditMode) + mbInEditMode(bInEditMode), + mbFixedCellHeight(bFixedCellHeight) { if(XFT_NONE != eFormTextStyle) { @@ -108,12 +114,16 @@ namespace drawinglayer maTextUpperDistance(rCandidate.getTextUpperDistance()), maTextRightDistance(rCandidate.getTextRightDistance()), maTextLowerDistance(rCandidate.getTextLowerDistance()), + maPropertiesVersion(rCandidate.getPropertiesVersion()), + maSdrTextHorzAdjust(rCandidate.getSdrTextHorzAdjust()), + maSdrTextVertAdjust(rCandidate.getSdrTextVertAdjust()), mbContour(rCandidate.isContour()), mbFitToSize(rCandidate.isFitToSize()), mbHideContour(rCandidate.isHideContour()), mbBlink(rCandidate.isBlink()), mbScroll(rCandidate.isScroll()), - mbInEditMode(rCandidate.isInEditMode()) + mbInEditMode(rCandidate.isInEditMode()), + mbFixedCellHeight(rCandidate.isFixedCellHeight()) { if(rCandidate.getSdrFormTextAttribute()) { @@ -142,36 +152,52 @@ namespace drawinglayer maTextUpperDistance = rCandidate.getTextUpperDistance(); maTextRightDistance = rCandidate.getTextRightDistance(); maTextLowerDistance = rCandidate.getTextLowerDistance(); + maPropertiesVersion = rCandidate.getPropertiesVersion(); + + maSdrTextHorzAdjust = rCandidate.getSdrTextHorzAdjust(); + maSdrTextVertAdjust = rCandidate.getSdrTextVertAdjust(); + mbContour = rCandidate.isContour(); mbFitToSize = rCandidate.isFitToSize(); mbHideContour = rCandidate.isHideContour(); mbBlink = rCandidate.isBlink(); mbScroll = rCandidate.isScroll(); mbInEditMode = rCandidate.isInEditMode(); + mbFixedCellHeight = rCandidate.isFixedCellHeight(); return *this; } bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const { - return (getOutlinerParaObject() == rCandidate.getOutlinerParaObject() + return ( + // compares OPO and it's contents, but traditionally not the RedLining + // which is not seen as model, but as temporary information + getOutlinerParaObject() == rCandidate.getOutlinerParaObject() + // #i102062# for primitive visualisation, the WrongList (SpellChecking) // is important, too, so use isWrongListEqual since there is no WrongList // comparison in the regular OutlinerParaObject compare (since it's // not-persistent data) && getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject()) + && pointerOrContentEqual(getSdrFormTextAttribute(), rCandidate.getSdrFormTextAttribute()) && getTextLeftDistance() == rCandidate.getTextLeftDistance() && getTextUpperDistance() == rCandidate.getTextUpperDistance() && getTextRightDistance() == rCandidate.getTextRightDistance() && getTextLowerDistance() == rCandidate.getTextLowerDistance() && getPropertiesVersion() == rCandidate.getPropertiesVersion() + + && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust() + && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust() + && isContour() == rCandidate.isContour() && isFitToSize() == rCandidate.isFitToSize() && isHideContour() == rCandidate.isHideContour() && isBlink() == rCandidate.isBlink() && isScroll() == rCandidate.isScroll() - && isInEditMode() == rCandidate.isInEditMode()); + && isInEditMode() == rCandidate.isInEditMode() + && isFixedCellHeight() == rCandidate.isFixedCellHeight()); } void SdrTextAttribute::getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index b083a1014299..6a92cb27ff8c 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -305,6 +305,9 @@ namespace sdr pSdrText, *pOPO, aTextRangeTransform, + SDRTEXTHORZADJUST_LEFT, + SDRTEXTVERTADJUST_TOP, + false, false, false, false); diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index 2b664e816d42..3fedc40f37cf 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -39,6 +39,7 @@ #include <vcl/bitmap.hxx> #include <tools/stream.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <vcl/cursor.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -255,15 +256,21 @@ namespace sdr maBufferRememberedRangePixel.getMaxX(), maBufferRememberedRangePixel.getMaxY()); aBufferRememberedRangeLogic.transform(getOutputDevice().GetInverseViewTransformation()); + // prepare cursor handling const bool bTargetIsWindow(OUTDEV_WINDOW == rmOutputDevice.GetOutDevType()); - Cursor* pCursor = 0; + bool bCursorWasEnabled(false); - // #i75172# switch off VCL cursor during overlay refresh + // #i80730# switch off VCL cursor during overlay refresh if(bTargetIsWindow) { Window& rWindow = static_cast< Window& >(rmOutputDevice); - pCursor = rWindow.GetCursor(); - rWindow.SetCursor(0); + Cursor* pCursor = rWindow.GetCursor(); + + if(pCursor && pCursor->IsVisible()) + { + pCursor->Hide(); + bCursorWasEnabled = true; + } } if(DoRefreshWithPreRendering()) @@ -363,49 +370,19 @@ namespace sdr OverlayManager::ImpDrawMembers(aBufferRememberedRangeLogic, getOutputDevice()); } - // VCL hack for transparent child windows - // Problem is e.g. a radiobuttion form control in life mode. The used window - // is a transparence vcl childwindow. This flag only allows the parent window to - // paint into the child windows area, but there is no mechanism which takes - // care for a repaint of the child window. A transparent child window is NOT - // a window which always keeps it's content consistent over the parent, but it's - // more like just a paint flag for the parent. - // To get the update, the windows in question are updated manulally here. - if(bTargetIsWindow) + // #i80730# restore visibility of VCL cursor + if(bCursorWasEnabled) { Window& rWindow = static_cast< Window& >(rmOutputDevice); + Cursor* pCursor = rWindow.GetCursor(); - if(rWindow.IsChildTransparentModeEnabled() && rWindow.GetChildCount()) + if(pCursor) { - const Rectangle aRegionRectanglePixel( - maBufferRememberedRangePixel.getMinX(), maBufferRememberedRangePixel.getMinY(), - maBufferRememberedRangePixel.getMaxX(), maBufferRememberedRangePixel.getMaxY()); - - for(sal_uInt16 a(0); a < rWindow.GetChildCount(); a++) - { - Window* pCandidate = rWindow.GetChild(a); - - if(pCandidate && pCandidate->IsPaintTransparent()) - { - const Rectangle aCandidatePosSizePixel(pCandidate->GetPosPixel(), pCandidate->GetSizePixel()); - - if(aCandidatePosSizePixel.IsOver(aRegionRectanglePixel)) - { - pCandidate->Invalidate(INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN); - pCandidate->Update(); - } - } - } + // check if cursor still exists. It may have been deleted from someone + pCursor->Show(); } } - // #i75172# restore VCL cursor - if(bTargetIsWindow) - { - Window& rWindow = static_cast< Window& >(rmOutputDevice); - rWindow.SetCursor(pCursor); - } - // forget remembered Region maBufferRememberedRangePixel.reset(); } diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 277ee70f82ca..4e57166b4723 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -76,6 +76,7 @@ #include <drawinglayer/attribute/sdrattribute3d.hxx> #include <drawinglayer/attribute/sdrallattribute3d.hxx> #include <svx/rectenum.hxx> +#include <svx/sdtfchim.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -519,7 +520,7 @@ namespace drawinglayer } } - const SdrFitToSizeType eFit = rTextObj.GetFitToSize(); + const SdrFitToSizeType eFit(rTextObj.GetFitToSize()); const SdrTextAniKind eAniKind(rTextObj.GetTextAniKind()); pRetval = new attribute::SdrTextAttribute( @@ -530,12 +531,15 @@ namespace drawinglayer pUpper ? *pUpper : rTextObj.GetTextUpperDistance(), pRight ? *pRight : rTextObj.GetTextRightDistance(), pLower ? *pLower : rTextObj.GetTextLowerDistance(), + rTextObj.GetTextHorizontalAdjust(rSet), + rTextObj.GetTextVerticalAdjust(rSet), ((const SdrTextContourFrameItem&)rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(), (SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit), ((const XFormTextHideFormItem&)rSet.Get(XATTR_FORMTXTHIDEFORM)).GetValue(), SDRTEXTANI_BLINK == eAniKind, SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind, - bInEditMode); + bInEditMode, + ((const SdrTextFixedCellHeightItem&)rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); } return pRetval; diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 9666bd2c1ac1..09769a2a013e 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -282,7 +282,8 @@ namespace drawinglayer pNew = new SdrStretchTextPrimitive2D( &rText.getSdrText(), rText.getOutlinerParaObject(), - aAnchorTransform); + aAnchorTransform, + rText.isFixedCellHeight()); } else // text in range { @@ -291,6 +292,9 @@ namespace drawinglayer &rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform, + rText.getSdrTextHorzAdjust(), + rText.getSdrTextVertAdjust(), + rText.isFixedCellHeight(), rText.isScroll(), bCellText, bWordWrap); diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index f515b9b6a5e9..94e59f79c3de 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -129,8 +129,11 @@ namespace drawinglayer &pTextAttribute->getSdrText(), pTextAttribute->getOutlinerParaObject(), aTextMatrix, + SDRTEXTHORZADJUST_CENTER, + SDRTEXTVERTADJUST_CENTER, pTextAttribute->isScroll(), false, + false, false); aTextRange = pBlockText->getB2DRange(aViewInformation); } diff --git a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx index 6c665cbef4c9..25b39ebb07d5 100644 --- a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx +++ b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx @@ -37,6 +37,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/hittestprimitive2d.hxx> +#include <vcl/lazydelete.hxx> ////////////////////////////////////////////////////////////////////////////// // helper methods @@ -47,11 +48,11 @@ namespace drawinglayer { BitmapEx createDefaultCross_3x3(const basegfx::BColor& rBColor) { - static BitmapEx* pRetVal = NULL; + static vcl::DeleteOnDeinit< BitmapEx > aRetVal(0); static basegfx::BColor aColor; ::osl::Mutex m_mutex; - if(pRetVal == NULL || rBColor != aColor) + if(!aRetVal.get() || rBColor != aColor) { // copy values aColor = rBColor; @@ -81,23 +82,21 @@ namespace drawinglayer aContent.ReleaseAccess(pWContent); aMask.ReleaseAccess(pWMask); - if( pRetVal ) - delete pRetVal; - - pRetVal = new BitmapEx(aContent, aMask); + // create and exchange at aRetVal + delete aRetVal.set(new BitmapEx(aContent, aMask)); } - return *pRetVal; + return aRetVal.get() ? *aRetVal.get() : BitmapEx(); } BitmapEx createDefaultGluepoint_7x7(const basegfx::BColor& rBColorA, const basegfx::BColor& rBColorB) { - static BitmapEx* pRetVal = NULL; + static vcl::DeleteOnDeinit< BitmapEx > aRetVal(0); static basegfx::BColor aColorA; static basegfx::BColor aColorB; ::osl::Mutex m_mutex; - if(pRetVal == NULL || rBColorA != aColorA || rBColorB != aColorB) + if(!aRetVal.get() || rBColorA != aColorA || rBColorB != aColorB) { // copy values aColorA = rBColorA; @@ -171,13 +170,11 @@ namespace drawinglayer aContent.ReleaseAccess(pWContent); aMask.ReleaseAccess(pWMask); - if( pRetVal ) - delete pRetVal; - - pRetVal = new BitmapEx(aContent, aMask); + // create and exchange at aRetVal + delete aRetVal.set(new BitmapEx(aContent, aMask)); } - return *pRetVal; + return aRetVal.get() ? *aRetVal.get() : BitmapEx(); } // #i99123# diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index 0cad266f69d1..748270c36977 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -116,7 +116,6 @@ namespace drawinglayer mnLastPageNumber(0), mnLastPageCount(0), maLastTextBackgroundColor(), - mbLastSpellCheck(false), mbContainsPageField(false), mbContainsPageCountField(false), mbContainsOtherFields(false) @@ -137,7 +136,13 @@ namespace drawinglayer { const SdrTextPrimitive2D& rCompare = (SdrTextPrimitive2D&)rPrimitive; - return (getOutlinerParaObject() == rCompare.getOutlinerParaObject()); + return ( + + // compare OPO and content, but not WrongList + getOutlinerParaObject() == rCompare.getOutlinerParaObject() + + // also compare WrongList (not-persistent data, but visualized) + && getOutlinerParaObject().isWrongListEqual(rCompare.getOutlinerParaObject())); } return false; @@ -145,9 +150,6 @@ namespace drawinglayer Primitive2DSequence SdrTextPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { - const bool bCurrentSpellCheck(getSdrText() - ? getSdrText()->GetObject().impCheckSpellCheckForDecomposeTextPrimitive() - : false); uno::Reference< drawing::XDrawPage > xCurrentlyVisualizingPage; bool bCurrentlyVisualizingPageIsSet(false); Color aNewTextBackgroundColor; @@ -157,10 +159,10 @@ namespace drawinglayer if(getLocalDecomposition().hasElements()) { - bool bDoDelete(getLastSpellCheck() != bCurrentSpellCheck); + bool bDoDelete(false); // check visualized page - if(!bDoDelete && (mbContainsPageField || mbContainsPageCountField || mbContainsOtherFields)) + if(mbContainsPageField || mbContainsPageCountField || mbContainsOtherFields) { // get visualized page and remember xCurrentlyVisualizingPage = rViewInformation.getVisualizedPage(); @@ -236,7 +238,6 @@ namespace drawinglayer aNewTextBackgroundColor = rDrawOutliner.GetBackgroundColor(); } - const_cast< SdrTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck); const_cast< SdrTextPrimitive2D* >(this)->mxLastVisualizingPage = xCurrentlyVisualizingPage; const_cast< SdrTextPrimitive2D* >(this)->mnLastPageNumber = nCurrentlyValidPageNumber; const_cast< SdrTextPrimitive2D* >(this)->mnLastPageCount = nCurrentlyValidPageCount; @@ -258,15 +259,7 @@ namespace drawinglayer Primitive2DSequence SdrContourTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText() - ? getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation) - : false); - - if(getLastSpellCheck() != bCurrentSpellCheck) - { - // remember last spell check state; this is part of the decomposition source data definition - const_cast< SdrContourTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck); - } + getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation); return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval); } @@ -319,15 +312,7 @@ namespace drawinglayer Primitive2DSequence SdrPathTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText() - ? getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation) - : false); - - if(getLastSpellCheck() != bCurrentSpellCheck) - { - // remember last spell check state; this is part of the decomposition source data definition - const_cast< SdrPathTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck); - } + getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation); return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval); } @@ -383,15 +368,7 @@ namespace drawinglayer Primitive2DSequence SdrBlockTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText() - ? getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation) - : false); - - if(getLastSpellCheck() != bCurrentSpellCheck) - { - // remember last spell check state; this is part of the decomposition source data definition - const_cast< SdrBlockTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck); - } + getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation); return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval); } @@ -400,11 +377,17 @@ namespace drawinglayer const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObject, const basegfx::B2DHomMatrix& rTextRangeTransform, + SdrTextHorzAdjust aSdrTextHorzAdjust, + SdrTextVertAdjust aSdrTextVertAdjust, + bool bFixedCellHeight, bool bUnlimitedPage, bool bCellText, bool bWordWrap) : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject), maTextRangeTransform(rTextRangeTransform), + maSdrTextHorzAdjust(aSdrTextHorzAdjust), + maSdrTextVertAdjust(aSdrTextVertAdjust), + mbFixedCellHeight(bFixedCellHeight), mbUnlimitedPage(bUnlimitedPage), mbCellText(bCellText), mbWordWrap(bWordWrap) @@ -418,6 +401,9 @@ namespace drawinglayer const SdrBlockTextPrimitive2D& rCompare = (SdrBlockTextPrimitive2D&)rPrimitive; return (getTextRangeTransform() == rCompare.getTextRangeTransform() + && getSdrTextHorzAdjust() == rCompare.getSdrTextHorzAdjust() + && getSdrTextVertAdjust() == rCompare.getSdrTextVertAdjust() + && isFixedCellHeight() == rCompare.isFixedCellHeight() && getUnlimitedPage() == rCompare.getUnlimitedPage() && getCellText() == rCompare.getCellText() && getWordWrap() == rCompare.getWordWrap()); @@ -432,6 +418,9 @@ namespace drawinglayer getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform(), + getSdrTextHorzAdjust(), + getSdrTextVertAdjust(), + isFixedCellHeight(), getUnlimitedPage(), getCellText(), getWordWrap()); @@ -452,15 +441,7 @@ namespace drawinglayer Primitive2DSequence SdrStretchTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; - const bool bCurrentSpellCheck(getSdrText() - ? getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation) - : false); - - if(getLastSpellCheck() != bCurrentSpellCheck) - { - // remember last spell check state; this is part of the decomposition source data definition - const_cast< SdrStretchTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck); - } + getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation); return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval); } @@ -468,9 +449,11 @@ namespace drawinglayer SdrStretchTextPrimitive2D::SdrStretchTextPrimitive2D( const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObject, - const basegfx::B2DHomMatrix& rTextRangeTransform) + const basegfx::B2DHomMatrix& rTextRangeTransform, + bool bFixedCellHeight) : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject), - maTextRangeTransform(rTextRangeTransform) + maTextRangeTransform(rTextRangeTransform), + mbFixedCellHeight(bFixedCellHeight) { } @@ -480,7 +463,8 @@ namespace drawinglayer { const SdrStretchTextPrimitive2D& rCompare = (SdrStretchTextPrimitive2D&)rPrimitive; - return (getTextRangeTransform() == rCompare.getTextRangeTransform()); + return (getTextRangeTransform() == rCompare.getTextRangeTransform() + && isFixedCellHeight() == rCompare.isFixedCellHeight()); } return false; @@ -491,7 +475,8 @@ namespace drawinglayer return new SdrStretchTextPrimitive2D( getSdrText(), getOutlinerParaObject(), - rTransform * getTextRangeTransform()); + rTransform * getTextRangeTransform(), + isFixedCellHeight()); } // provide unique ID diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 341ce6dd90c0..6773b8edf6f5 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -831,7 +831,11 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/) if(pCircObj && OBJ_CIRC != pCircObj->GetObjIdentifier()) { - bUseSolidDragging = false; + // #i103058# Allow SolidDragging with four points + if(aDragStat.GetPointAnz() < 4) + { + bUseSolidDragging = false; + } } } diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index e427e42d80ab..eb6412b20259 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1135,11 +1135,20 @@ void SdrDragObjOwn::createSdrDragEntries() void SdrDragObjOwn::TakeSdrDragComment(XubString& rStr) const { - const SdrObject* pObj = GetDragObj(); - - if(pObj) + // #i103058# get info string from the clone preferred, the original will + // not be changed. For security, use original as fallback + if(mpClone) { - rStr = pObj->getSpecialDragComment(DragStat()); + rStr = mpClone->getSpecialDragComment(DragStat()); + } + else + { + const SdrObject* pObj = GetDragObj(); + + if(pObj) + { + rStr = pObj->getSpecialDragComment(DragStat()); + } } } diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 727e7f0bafcc..936c073f6e84 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -68,6 +68,7 @@ #include <sdrpaintwindow.hxx> #include <vcl/svapp.hxx> #include <svx/sdr/overlay/overlaypolypolygon.hxx> +#include <vcl/lazydelete.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// // #i15222# @@ -275,9 +276,23 @@ const BitmapEx& SdrHdlBitmapSet::GetBitmapEx(BitmapMarkerKind eKindOfMarker, UIN //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrHdlBitmapSet* SdrHdl::pSimpleSet = NULL; -SdrHdlBitmapSet* SdrHdl::pModernSet = NULL; -SdrHdlBitmapSet* SdrHdl::pHighContrastSet = NULL; +SdrHdlBitmapSet& getSimpleSet() +{ + static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aSimpleSet(new SdrHdlBitmapSet(SIP_SA_MARKERS)); + return *aSimpleSet.get(); +} + +SdrHdlBitmapSet& getModernSet() +{ + static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_MARKERS)); + return *aModernSet.get(); +} + +SdrHdlBitmapSet& getHighContrastSet() +{ + static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_MARKERS)); + return *aHighContrastSet.get(); +} //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -296,18 +311,6 @@ SdrHdl::SdrHdl(): bPlusHdl(FALSE), mbMoveOutside(false) { - if(!pSimpleSet) - pSimpleSet = new SdrHdlBitmapSet(SIP_SA_MARKERS); - DBG_ASSERT(pSimpleSet, "Could not construct SdrHdlBitmapSet()!"); - - if(!pModernSet) - pModernSet = new SdrHdlBitmapSet(SIP_SA_FINE_MARKERS); - DBG_ASSERT(pModernSet, "Could not construct SdrHdlBitmapSet()!"); - - // #101928# - if(!pHighContrastSet) - pHighContrastSet = new SdrHdlBitmapSet(SIP_SA_ACCESSIBILITY_MARKERS); - DBG_ASSERT(pHighContrastSet, "Could not construct SdrHdlBitmapSet()!"); } SdrHdl::SdrHdl(const Point& rPnt, SdrHdlKind eNewKind): @@ -326,18 +329,6 @@ SdrHdl::SdrHdl(const Point& rPnt, SdrHdlKind eNewKind): bPlusHdl(FALSE), mbMoveOutside(false) { - if(!pSimpleSet) - pSimpleSet = new SdrHdlBitmapSet(SIP_SA_MARKERS); - DBG_ASSERT(pSimpleSet, "Could not construct SdrHdlBitmapSet()!"); - - if(!pModernSet) - pModernSet = new SdrHdlBitmapSet(SIP_SA_FINE_MARKERS); - DBG_ASSERT(pModernSet, "Could not construct SdrHdlBitmapSet()!"); - - // #101928# - if(!pHighContrastSet) - pHighContrastSet = new SdrHdlBitmapSet(SIP_SA_ACCESSIBILITY_MARKERS); - DBG_ASSERT(pHighContrastSet, "Could not construct SdrHdlBitmapSet()!"); } SdrHdl::~SdrHdl() @@ -670,17 +661,17 @@ BitmapEx SdrHdl::ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, { if(bIsHighContrast) { - return pHighContrastSet->GetBitmapEx(eKindOfMarker, nInd); + return getHighContrastSet().GetBitmapEx(eKindOfMarker, nInd); } else { if(bFine) { - return pModernSet->GetBitmapEx(eKindOfMarker, nInd); + return getModernSet().GetBitmapEx(eKindOfMarker, nInd); } else { - return pSimpleSet->GetBitmapEx(eKindOfMarker, nInd); + return getSimpleSet().GetBitmapEx(eKindOfMarker, nInd); } } } diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 7d41191c99a9..102b5b1eb824 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -401,26 +401,35 @@ bool SdrCaptionObj::applySpecialDrag(SdrDragStat& rDrag) String SdrCaptionObj::getSpecialDragComment(const SdrDragStat& rDrag) const { - const SdrHdl* pHdl = rDrag.GetHdl(); + const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj()); - if(pHdl && 0 == pHdl->GetPolyNum()) + if(bCreateComment) { - return SdrRectObj::getSpecialDragComment(rDrag); + return String(); } else { - XubString aStr; + const SdrHdl* pHdl = rDrag.GetHdl(); - if(!pHdl) + if(pHdl && 0 == pHdl->GetPolyNum()) { - ImpTakeDescriptionStr(STR_DragCaptFram, aStr); + return SdrRectObj::getSpecialDragComment(rDrag); } else { - ImpTakeDescriptionStr(STR_DragCaptTail, aStr); - } + XubString aStr; + + if(!pHdl) + { + ImpTakeDescriptionStr(STR_DragCaptFram, aStr); + } + else + { + ImpTakeDescriptionStr(STR_DragCaptTail, aStr); + } - return aStr; + return aStr; + } } } diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 6af31224ee45..b3175566d561 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -589,23 +589,56 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag) String SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const { - const bool bWink(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj()); - if(bWink) + if(bCreateComment) { XubString aStr; - const sal_Int32 nWink(1 == rDrag.GetHdl()->GetPointNum() ? nStartWink : nEndWink); + ImpTakeDescriptionStr(STR_ViewCreateObj, aStr); + const sal_uInt32 nPntAnz(rDrag.GetPointAnz()); + + if(OBJ_CIRC != meCircleKind && nPntAnz > 2) + { + ImpCircUser* pU = (ImpCircUser*)rDrag.GetUser(); + sal_Int32 nWink; + + aStr.AppendAscii(" ("); + + if(3 == nPntAnz) + { + nWink = pU->nStart; + } + else + { + nWink = pU->nEnd; + } - ImpTakeDescriptionStr(STR_DragCircAngle, aStr); - aStr.AppendAscii(" ("); - aStr += GetWinkStr(nWink,FALSE); - aStr += sal_Unicode(')'); + aStr += GetWinkStr(nWink,FALSE); + aStr += sal_Unicode(')'); + } return aStr; } else { - return SdrTextObj::getSpecialDragComment(rDrag); + const bool bWink(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + + if(bWink) + { + XubString aStr; + const sal_Int32 nWink(1 == rDrag.GetHdl()->GetPointNum() ? nStartWink : nEndWink); + + ImpTakeDescriptionStr(STR_DragCircAngle, aStr); + aStr.AppendAscii(" ("); + aStr += GetWinkStr(nWink,FALSE); + aStr += sal_Unicode(')'); + + return aStr; + } + else + { + return SdrTextObj::getSpecialDragComment(rDrag); + } } } @@ -698,6 +731,14 @@ FASTBOOL SdrCircObj::MovCreate(SdrDragStat& rStat) SetBoundRectDirty(); bSnapRectDirty=TRUE; SetXPolyDirty(); + + // #i103058# push current angle settings to ItemSet to + // allow FullDrag visualisation + if(rStat.GetPointAnz() >= 4) + { + ImpSetCircInfoToAttr(); + } + return TRUE; } diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index abadbf094981..e55eeaae42b7 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -1920,11 +1920,21 @@ bool SdrEdgeObj::applySpecialDrag(SdrDragStat& rDragStat) return true; } -String SdrEdgeObj::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const +String SdrEdgeObj::getSpecialDragComment(const SdrDragStat& rDrag) const { - XubString aStr; - ImpTakeDescriptionStr(STR_DragEdgeTail,aStr); - return aStr; + const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj()); + + if(bCreateComment) + { + return String(); + } + else + { + XubString aStr; + ImpTakeDescriptionStr(STR_DragEdgeTail, aStr); + + return aStr; + } } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 1e9c9b57c52d..f44efe3c5dfa 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -951,32 +951,86 @@ bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat& rDrag) String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag) const { - ImpSdrPathDragData* pDragData = mpSdrPathDragData; + XubString aStr; + const SdrHdl* pHdl = rDrag.GetHdl(); + const bool bCreateComment(rDrag.GetView() && &mrSdrPathObject == rDrag.GetView()->GetCreateObj()); - if(!pDragData) + if(bCreateComment && rDrag.GetUser()) { - // getSpecialDragComment is also used from create, so fallback to GetUser() - // when mpSdrPathDragData is not set - pDragData = (ImpSdrPathDragData*)rDrag.GetUser(); - } + // #i103058# re-add old creation comment mode + ImpPathCreateUser* pU = (ImpPathCreateUser*)rDrag.GetUser(); + const SdrObjKind eKindMerk(meObjectKind); + mrSdrPathObject.meKind = pU->eAktKind; + mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewCreateObj, aStr); + mrSdrPathObject.meKind = eKindMerk; - if(!pDragData) - { - DBG_ERROR("ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData ist ungueltig"); - return String(); - } + Point aPrev(rDrag.GetPrev()); + Point aNow(rDrag.GetNow()); - // Hier auch mal pDragData verwenden !!! - XubString aStr; + if(pU->bLine) + aNow = pU->aLineEnd; - const SdrHdl* pHdl = rDrag.GetHdl(); + aNow -= aPrev; + aStr.AppendAscii(" ("); - if(!mrSdrPathObject.GetModel() || !pHdl) + XubString aMetr; + + if(pU->bCircle) + { + mrSdrPathObject.GetModel()->TakeWinkStr(Abs(pU->nCircRelWink), aMetr); + aStr += aMetr; + aStr.AppendAscii(" r="); + mrSdrPathObject.GetModel()->TakeMetricStr(pU->nCircRadius, aMetr, TRUE); + aStr += aMetr; + } + + aStr.AppendAscii("dx="); + mrSdrPathObject.GetModel()->TakeMetricStr(aNow.X(), aMetr, TRUE); + aStr += aMetr; + + aStr.AppendAscii(" dy="); + mrSdrPathObject.GetModel()->TakeMetricStr(aNow.Y(), aMetr, TRUE); + aStr += aMetr; + + if(!IsFreeHand(meObjectKind)) + { + INT32 nLen(GetLen(aNow)); + aStr.AppendAscii(" l="); + mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, TRUE); + aStr += aMetr; + + INT32 nWink(GetAngle(aNow)); + aStr += sal_Unicode(' '); + mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr); + aStr += aMetr; + } + + aStr += sal_Unicode(')'); + } + else if(!mrSdrPathObject.GetModel() || !pHdl) { + // #i103058# fallback when no model and/or Handle, both needed + // for else-path mrSdrPathObject.ImpTakeDescriptionStr(STR_DragPathObj, aStr); } else { + // #i103058# standard for modification; model and handle needed + ImpSdrPathDragData* pDragData = mpSdrPathDragData; + + if(!pDragData) + { + // getSpecialDragComment is also used from create, so fallback to GetUser() + // when mpSdrPathDragData is not set + pDragData = (ImpSdrPathDragData*)rDrag.GetUser(); + } + + if(!pDragData) + { + DBG_ERROR("ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData ist ungueltig"); + return String(); + } + if(!pDragData->IsMultiPointDrag() && pDragData->bEliminate) { // Punkt von ... @@ -2150,12 +2204,26 @@ bool SdrPathObj::applySpecialDrag(SdrDragStat& rDrag) String SdrPathObj::getSpecialDragComment(const SdrDragStat& rDrag) const { String aRetval; - ImpPathForDragAndCreate aDragAndCreate(*((SdrPathObj*)this)); - bool bDidWork(aDragAndCreate.beginPathDrag((SdrDragStat&)rDrag)); - if(bDidWork) + if(mpDAC) { - aRetval = aDragAndCreate.getSpecialDragComment(rDrag); + // #i103058# also get a comment when in creation + const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj()); + + if(bCreateComment) + { + aRetval = mpDAC->getSpecialDragComment(rDrag); + } + } + else + { + ImpPathForDragAndCreate aDragAndCreate(*((SdrPathObj*)this)); + bool bDidWork(aDragAndCreate.beginPathDrag((SdrDragStat&)rDrag)); + + if(bDidWork) + { + aRetval = aDragAndCreate.getSpecialDragComment(rDrag); + } } return aRetval; diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index 837b75bcf849..7d69955ec441 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -419,33 +419,42 @@ bool SdrRectObj::applySpecialDrag(SdrDragStat& rDrag) String SdrRectObj::getSpecialDragComment(const SdrDragStat& rDrag) const { - const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj()); - if(bRad) + if(bCreateComment) { - Point aPt(rDrag.GetNow()); + return String(); + } + else + { + const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); - // -sin fuer Umkehrung - if(aGeo.nDrehWink) - RotatePoint(aPt, aRect.TopLeft(), -aGeo.nSin, aGeo.nCos); + if(bRad) + { + Point aPt(rDrag.GetNow()); - sal_Int32 nRad(aPt.X() - aRect.Left()); + // -sin fuer Umkehrung + if(aGeo.nDrehWink) + RotatePoint(aPt, aRect.TopLeft(), -aGeo.nSin, aGeo.nCos); - if(nRad < 0) - nRad = 0; + sal_Int32 nRad(aPt.X() - aRect.Left()); - XubString aStr; + if(nRad < 0) + nRad = 0; - ImpTakeDescriptionStr(STR_DragRectEckRad, aStr); - aStr.AppendAscii(" ("); - aStr += GetMetrStr(nRad); - aStr += sal_Unicode(')'); + XubString aStr; - return aStr; - } - else - { - return SdrTextObj::getSpecialDragComment(rDrag); + ImpTakeDescriptionStr(STR_DragRectEckRad, aStr); + aStr.AppendAscii(" ("); + aStr += GetMetrStr(nRad); + aStr += sal_Unicode(')'); + + return aStr; + } + else + { + return SdrTextObj::getSpecialDragComment(rDrag); + } } } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 8ce4390ad6ac..93d3651e3f01 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -215,30 +215,23 @@ namespace { if(rInfo.mrText.Len() && rInfo.mnTextLen) { - basegfx::B2DVector aSize; - drawinglayer::primitive2d::FontAttributes aFontAttributes(drawinglayer::primitive2d::getFontAttributesFromVclFont( - aSize, - rInfo.mrFont, - rInfo.IsRTL(), - false)); + basegfx::B2DVector aFontScaling; + drawinglayer::primitive2d::FontAttributes aFontAttributes( + drawinglayer::primitive2d::getFontAttributesFromVclFont( + aFontScaling, + rInfo.mrFont, + rInfo.IsRTL(), + false)); basegfx::B2DHomMatrix aNewTransform; - // #i100489# need extra scale factor for DXArray which collects all scalings - // which are needed to get the DXArray to unit coordinates - double fDXArrayScaleFactor(aSize.getX()); - // add font scale to new transform - aNewTransform.scale(aSize.getX(), aSize.getY()); + aNewTransform.scale(aFontScaling.getX(), aFontScaling.getY()); // look for proportional font scaling, evtl scale accordingly if(100 != rInfo.mrFont.GetPropr()) { const double fFactor(rInfo.mrFont.GetPropr() / 100.0); aNewTransform.scale(fFactor, fFactor); - - // #i100489# proportional font scaling influences the DXArray, - // add to factor - fDXArrayScaleFactor *= fFactor; } // apply font rotate @@ -271,7 +264,7 @@ namespace } const double fEscapement(nEsc / -100.0); - aNewTransform.translate(0.0, fEscapement * aSize.getY()); + aNewTransform.translate(0.0, fEscapement * aFontScaling.getY()); } // apply transformA @@ -290,13 +283,11 @@ namespace if(!bDisableTextArray && rInfo.mpDXArray && rInfo.mnTextLen) { - // #i100489# use fDXArrayScaleFactor here - const double fScaleFactor(basegfx::fTools::equalZero(fDXArrayScaleFactor) ? 1.0 : 1.0 / fDXArrayScaleFactor); aDXArray.reserve(rInfo.mnTextLen); for(xub_StrLen a(0); a < rInfo.mnTextLen; a++) { - aDXArray.push_back((double)rInfo.mpDXArray[a] * fScaleFactor); + aDXArray.push_back((double)rInfo.mpDXArray[a]); } } @@ -472,6 +463,17 @@ namespace fEnd = fTextWidth - fEnd; } + // need to take FontScaling out of values; it's already part of + // aNewTransform and would be double applied + const double fFontScaleX(aFontScaling.getX()); + + if(!basegfx::fTools::equal(fFontScaleX, 1.0) + && !basegfx::fTools::equalZero(fFontScaleX)) + { + fStart /= fFontScaleX; + fEnd /= fFontScaleX; + } + maTextPortionPrimitives.push_back(new drawinglayer::primitive2d::WrongSpellPrimitive2D( aNewTransform, fStart, @@ -709,16 +711,7 @@ namespace ////////////////////////////////////////////////////////////////////////////// // primitive decompositions -bool SdrTextObj::impCheckSpellCheckForDecomposeTextPrimitive() const -{ - // #i102062# asked TL who killed this feature (CWS tl56). Obviously, there - // is no more support for EE_CNTRL_NOREDLINES anymore; redlining is always - // on nowadays. Unfortunately, not false, but true should be returned then. - // Trying if this is all... - return true; -} - -bool SdrTextObj::impDecomposeContourTextPrimitive( +void SdrTextObj::impDecomposeContourTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const @@ -770,10 +763,9 @@ bool SdrTextObj::impDecomposeContourTextPrimitive( rOutliner.setVisualizedPage(0); rTarget = aConverter.getPrimitive2DSequence(); - return false; } -bool SdrTextObj::impDecomposeBlockTextPrimitive( +void SdrTextObj::impDecomposeBlockTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const @@ -789,19 +781,15 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive( // prepare outliner const bool bIsCell(rSdrBlockTextPrimitive.getCellText()); - const SfxItemSet& rTextItemSet = rSdrBlockTextPrimitive.getSdrText() - ? rSdrBlockTextPrimitive.getSdrText()->GetItemSet() - : GetObjectItemSet(); SdrOutliner& rOutliner = ImpGetDrawOutliner(); - SdrTextVertAdjust eVAdj = GetTextVerticalAdjust(rTextItemSet); - SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust(rTextItemSet); + SdrTextHorzAdjust eHAdj = rSdrBlockTextPrimitive.getSdrTextHorzAdjust(); + SdrTextVertAdjust eVAdj = rSdrBlockTextPrimitive.getSdrTextVertAdjust(); const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord()); const Size aNullSize; // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage())); - - rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)rTextItemSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(rSdrBlockTextPrimitive.isFixedCellHeight()); rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_AUTOPAGESIZE); rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000)); @@ -975,10 +963,9 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive( rOutliner.setVisualizedPage(0); rTarget = aConverter.getPrimitive2DSequence(); - return false; } -bool SdrTextObj::impDecomposeStretchTextPrimitive( +void SdrTextObj::impDecomposeStretchTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const @@ -995,13 +982,10 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive( // prepare outliner SdrOutliner& rOutliner = ImpGetDrawOutliner(); const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord()); - const SfxItemSet& rTextItemSet = rSdrStretchTextPrimitive.getSdrText() - ? rSdrStretchTextPrimitive.getSdrText()->GetItemSet() - : GetObjectItemSet(); const Size aNullSize; rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE); - rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)rTextItemSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(rSdrStretchTextPrimitive.isFixedCellHeight()); rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000)); rOutliner.SetPaperSize(aNullSize); @@ -1059,7 +1043,6 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive( rOutliner.setVisualizedPage(0); rTarget = aConverter.getPrimitive2DSequence(); - return false; } ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index f3bdeeb4811c..f6a30d40b3d5 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -365,12 +365,13 @@ namespace for(sal_uInt32 a(0L); a < rTextPortions.size() && fPolyStart < fPolyEnd; a++) { const impPathTextPortion* pCandidate = rTextPortions[a]; - basegfx::B2DVector aSize; - const drawinglayer::primitive2d::FontAttributes aCandidateFontAttributes(drawinglayer::primitive2d::getFontAttributesFromVclFont( - aSize, - pCandidate->getFont(), - pCandidate->isRTL(), - false)); + basegfx::B2DVector aFontScaling; + const drawinglayer::primitive2d::FontAttributes aCandidateFontAttributes( + drawinglayer::primitive2d::getFontAttributesFromVclFont( + aFontScaling, + pCandidate->getFont(), + pCandidate->isRTL(), + false)); if(pCandidate && pCandidate->getTextLength()) { @@ -397,7 +398,7 @@ namespace basegfx::B2DPoint aEndPos(aStartPos); // add font scaling - aNewTransformA.scale(aSize.getX(), aSize.getY()); + aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY()); // prepare scaling of text primitive if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) @@ -512,15 +513,16 @@ namespace pCandidate->getDoubleDXArray().begin() + nPortionIndex, pCandidate->getDoubleDXArray().begin() + nPortionIndex + nNextGlyphLen); - drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( - aNewTransformB * aNewShadowTransform * aNewTransformA, - pCandidate->getText(), - nPortionIndex, - nNextGlyphLen, - aNewDXArray, - aCandidateFontAttributes, - pCandidate->getLocale(), - aRGBShadowColor); + drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = + new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( + aNewTransformB * aNewShadowTransform * aNewTransformA, + pCandidate->getText(), + nPortionIndex, + nNextGlyphLen, + aNewDXArray, + aCandidateFontAttributes, + pCandidate->getLocale(), + aRGBShadowColor); mrShadowDecomposition.push_back(pNew); } @@ -536,15 +538,16 @@ namespace pCandidate->getDoubleDXArray().begin() + nPortionIndex, pCandidate->getDoubleDXArray().begin() + nPortionIndex + nNextGlyphLen); - drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( - aNewTransformB * aNewTransformA, - pCandidate->getText(), - nPortionIndex, - nNextGlyphLen, - aNewDXArray, - aCandidateFontAttributes, - pCandidate->getLocale(), - aRGBColor); + drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = + new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( + aNewTransformB * aNewTransformA, + pCandidate->getText(), + nPortionIndex, + nNextGlyphLen, + aNewDXArray, + aCandidateFontAttributes, + pCandidate->getLocale(), + aRGBColor); mrDecomposition.push_back(pNew); } @@ -671,7 +674,7 @@ namespace ////////////////////////////////////////////////////////////////////////////// // primitive decomposition -bool SdrTextObj::impDecomposePathTextPrimitive( +void SdrTextObj::impDecomposePathTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const @@ -789,8 +792,6 @@ bool SdrTextObj::impDecomposePathTextPrimitive( // concatenate all results drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aRetvalA); drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aRetvalB); - - return false; } ////////////////////////////////////////////////////////////////////////////// |