[Libreoffice-commits] core.git: 21 commits - cui/source dbaccess/source extensions/source forms/source include/basebmp include/svx sc/inc sc/source sc/uiconfig sd/source starmath/source svx/source sw/source ucb/source
Armin Le Grand
alg at apache.org
Tue Jan 28 06:31:11 PST 2014
cui/source/dialogs/cuigrfflt.cxx | 1
cui/source/tabpages/textattr.cxx | 1
dbaccess/source/core/api/FilteredContainer.cxx | 1
extensions/source/bibliography/bibbeam.cxx | 10
extensions/source/propctrlr/fontdialog.cxx | 11 -
forms/source/misc/InterfaceContainer.cxx | 6
include/basebmp/fillimage.hxx | 4
include/svx/sdr/overlay/overlayanimatedbitmapex.hxx | 12 +
include/svx/sdr/overlay/overlaybitmapex.hxx | 16 +
include/svx/sdr/overlay/overlaytools.hxx | 10
include/svx/svdhdl.hxx | 20 +
include/svx/svdograf.hxx | 3
sc/inc/sc.hrc | 3
sc/inc/scabstdlg.hxx | 1
sc/source/ui/attrdlg/scdlgfact.cxx | 16 -
sc/source/ui/attrdlg/scdlgfact.hxx | 1
sc/source/ui/inc/miscdlgs.hrc | 27 --
sc/source/ui/view/cellsh1.cxx | 5
sc/uiconfig/scalc/ui/pastespecial.ui | 15 -
sd/source/ui/view/PresentationViewShellBase.cxx | 17 -
starmath/source/view.cxx | 4
svx/source/fmcomp/gridcell.cxx | 2
svx/source/form/fmshimp.cxx | 3
svx/source/sdr/overlay/overlayanimatedbitmapex.cxx | 14 +
svx/source/sdr/overlay/overlaybitmapex.cxx | 14 +
svx/source/sdr/overlay/overlaytools.cxx | 35 ++-
svx/source/svdraw/sdrpagewindow.cxx | 2
svx/source/svdraw/svddrgm1.hxx | 5
svx/source/svdraw/svddrgmt.cxx | 220 ++++++++++++++++++--
svx/source/svdraw/svdedxv.cxx | 13 -
svx/source/svdraw/svdhdl.cxx | 53 ++--
svx/source/svdraw/svdmrkv.cxx | 146 +++++--------
svx/source/svdraw/svdograf.cxx | 115 ++++++++++
svx/source/svdraw/svdouno.cxx | 4
svx/source/svdraw/svdxcgv.cxx | 35 ---
sw/source/filter/ww8/ww8par.cxx | 6
ucb/source/sorter/sortdynres.cxx | 3
37 files changed, 562 insertions(+), 292 deletions(-)
New commits:
commit fff58c3379ef03fb8dec51b7b64a053481d48727
Author: Armin Le Grand <alg at apache.org>
Date: Mon Jan 27 17:14:55 2014 +0000
Resolves: #i123950# Corrected/extended interactive crop feature...
to work in all situations
(cherry picked from commit a440c753532e9ae1747ef3b3ed990d8b713913da)
Conflicts:
include/svx/sdr/overlay/overlaybitmapex.hxx
svx/source/svdraw/svddrgm1.hxx
svx/source/svdraw/svddrgmt.cxx
svx/source/svdraw/svdmrkv.cxx
svx/source/svdraw/svdograf.cxx
Change-Id: I33601a429657965fcc9b18da85aa5ffabad65983
diff --git a/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx b/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx
index e895bfb..5182f93 100644
--- a/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx
+++ b/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx
@@ -45,6 +45,10 @@ namespace sdr
// #i53216# added CursorBlinkTime (in ms)
sal_uInt32 mnBlinkTime;
+ // optional shear and rotation
+ double mfShearX;
+ double mfRotation;
+
/// bitfield
// Flag to remember which state to draw. Inited with false (0)
bool mbOverlayState : 1;
@@ -61,7 +65,9 @@ namespace sdr
sal_uInt16 nCenX1 = 0,
sal_uInt16 nCenY1 = 0,
sal_uInt16 nCenX2 = 0,
- sal_uInt16 nCenY2 = 0);
+ sal_uInt16 nCenY2 = 0,
+ double fShearX = 0.0,
+ double fRotation = 0.0);
virtual ~OverlayAnimatedBitmapEx();
const BitmapEx& getBitmapEx1() const { return maBitmapEx1; }
@@ -78,6 +84,10 @@ namespace sdr
// execute event from base class ::sdr::animation::Event. Default
// implementation does nothing and does not create a new event.
virtual void Trigger(sal_uInt32 nTime);
+
+ // get shearX and rotation
+ double getShearX() const { return mfShearX; }
+ double getRotation() const { return mfRotation; }
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/include/svx/sdr/overlay/overlaybitmapex.hxx b/include/svx/sdr/overlay/overlaybitmapex.hxx
index 045c964..c984c30 100644
--- a/include/svx/sdr/overlay/overlaybitmapex.hxx
+++ b/include/svx/sdr/overlay/overlaybitmapex.hxx
@@ -39,8 +39,10 @@ namespace sdr
sal_uInt16 mnCenterX;
sal_uInt16 mnCenterY;
- // optional transparency
- double mfAlpha;
+ // optional transparency, shear and rotation
+ double mfAlpha;
+ double mfShearX;
+ double mfRotation;
virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
@@ -48,13 +50,21 @@ namespace sdr
OverlayBitmapEx(
const basegfx::B2DPoint& rBasePos,
const BitmapEx& rBitmapEx,
- sal_uInt16 nCenX = 0, sal_uInt16 nCenY = 0, double fAlpha = 0.0 );
+ sal_uInt16 nCenX = 0,
+ sal_uInt16 nCenY = 0,
+ double fAlpha = 0.0,
+ double fShearX = 0.0,
+ double fRotation = 0.0);
virtual ~OverlayBitmapEx();
const BitmapEx& getBitmapEx() const { return maBitmapEx; }
sal_uInt16 getCenterX() const { return mnCenterX; }
sal_uInt16 getCenterY() const { return mnCenterY; }
+
+ // get shearX and rotation
+ double getShearX() const { return mfShearX; }
+ double getRotation() const { return mfRotation; }
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/include/svx/sdr/overlay/overlaytools.hxx b/include/svx/sdr/overlay/overlaytools.hxx
index f57d6a8..181f895 100644
--- a/include/svx/sdr/overlay/overlaytools.hxx
+++ b/include/svx/sdr/overlay/overlaytools.hxx
@@ -46,6 +46,10 @@ namespace drawinglayer
sal_uInt16 mnCenterX;
sal_uInt16 mnCenterY;
+ // evtl. rotation and shear around center
+ double mfShearX;
+ double mfRotation;
+
protected:
virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
@@ -54,13 +58,17 @@ namespace drawinglayer
const BitmapEx& rBitmapEx,
const basegfx::B2DPoint& rBasePosition,
sal_uInt16 nCenterX,
- sal_uInt16 nCenterY);
+ sal_uInt16 nCenterY,
+ double fShearX = 0.0,
+ double fRotation = 0.0);
// data access
const BitmapEx& getBitmapEx() const { return maBitmapEx; }
const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; }
sal_uInt16 getCenterX() const { return mnCenterX; }
sal_uInt16 getCenterY() const { return mnCenterY; }
+ double getShearX() const { return mfShearX; }
+ double getRotation() const { return mfRotation; }
// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx
index 599ff9f..fc7382d 100644
--- a/include/svx/svdhdl.hxx
+++ b/include/svx/svdhdl.hxx
@@ -502,8 +502,18 @@ public:
class SVX_DLLPUBLIC SdrCropHdl : public SdrHdl
{
+private:
+ // evtl. shear and rotation, equal to the object's one to allow adaption of
+ // the visualization handles
+ double mfShearX;
+ double mfRotation;
+
public:
- SdrCropHdl(const Point& rPnt, SdrHdlKind eNewKind);
+ SdrCropHdl(
+ const Point& rPnt,
+ SdrHdlKind eNewKind,
+ double fShearX,
+ double fRotation);
protected:
// create marker for this kind
@@ -526,11 +536,6 @@ private:
double mfCropRight;
double mfCropBottom;
- // Argh! The old geometry stuff expresses Y-Mirror using 180 degree rotaton
- // and the bMirrored bool at the SdrGrafObj, so for now I have to give
- // this info here. I am sooo looking forward to aw080 and real transformations :-(
- bool mbExtraMirrorXFromGraphic;
-
public:
SdrCropViewHdl(
const basegfx::B2DHomMatrix& rObjectTransform,
@@ -538,8 +543,7 @@ public:
double fCropLeft,
double fCropTop,
double fCropRight,
- double fCropBottom,
- bool bExtraMirrorXFromGraphic);
+ double fCropBottom);
protected:
// create marker for this kind
diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index 20151dd..eab2bf8 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -197,6 +197,9 @@ public:
// #i103116# FullDrag support
virtual SdrObject* getFullDragClone() const;
+
+ // add handles for crop mode when selected
+ void addCropHandles(SdrHdlList& rTarget) const;
};
#endif // INCLUDED_SVX_SVDOGRAF_HXX
diff --git a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
index ff4d97b..7ea80b6 100644
--- a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
+++ b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
@@ -38,7 +38,9 @@ namespace sdr
getBitmapEx1(),
getBasePosition(),
getCenterX1(),
- getCenterY1()));
+ getCenterY1(),
+ getShearX(),
+ getRotation()));
return drawinglayer::primitive2d::Primitive2DSequence(&aPrimitive, 1);
}
@@ -49,7 +51,9 @@ namespace sdr
getBitmapEx2(),
getBasePosition(),
getCenterX2(),
- getCenterY2()));
+ getCenterY2(),
+ getShearX(),
+ getRotation()));
return drawinglayer::primitive2d::Primitive2DSequence(&aPrimitive, 1);
}
@@ -63,13 +67,17 @@ namespace sdr
sal_uInt16 nCenX1,
sal_uInt16 nCenY1,
sal_uInt16 nCenX2,
- sal_uInt16 nCenY2)
+ sal_uInt16 nCenY2,
+ double fShearX,
+ double fRotation)
: OverlayObjectWithBasePosition(rBasePos, Color(COL_WHITE)),
maBitmapEx1(rBitmapEx1),
maBitmapEx2(rBitmapEx2),
mnCenterX1(nCenX1), mnCenterY1(nCenY1),
mnCenterX2(nCenX2), mnCenterY2(nCenY2),
mnBlinkTime(nBlinkTime),
+ mfShearX(fShearX),
+ mfRotation(fRotation),
mbOverlayState(false)
{
// set AllowsAnimation flag to mark this object as animation capable
diff --git a/svx/source/sdr/overlay/overlaybitmapex.cxx b/svx/source/sdr/overlay/overlaybitmapex.cxx
index d117603..31aca7a 100644
--- a/svx/source/sdr/overlay/overlaybitmapex.cxx
+++ b/svx/source/sdr/overlay/overlaybitmapex.cxx
@@ -36,7 +36,9 @@ namespace sdr
getBitmapEx(),
getBasePosition(),
getCenterX(),
- getCenterY()));
+ getCenterY(),
+ getShearX(),
+ getRotation()));
if(basegfx::fTools::more(mfAlpha, 0.0))
{
@@ -51,12 +53,18 @@ namespace sdr
OverlayBitmapEx::OverlayBitmapEx(
const basegfx::B2DPoint& rBasePos,
const BitmapEx& rBitmapEx,
- sal_uInt16 nCenX, sal_uInt16 nCenY, double fAlpha)
+ sal_uInt16 nCenX,
+ sal_uInt16 nCenY,
+ double fAlpha,
+ double fShearX,
+ double fRotation)
: OverlayObjectWithBasePosition(rBasePos, Color(COL_WHITE)),
maBitmapEx(rBitmapEx),
mnCenterX(nCenX),
mnCenterY(nCenY),
- mfAlpha(fAlpha)
+ mfAlpha(fAlpha),
+ mfShearX(fShearX),
+ mfRotation(fRotation)
{
}
diff --git a/svx/source/sdr/overlay/overlaytools.cxx b/svx/source/sdr/overlay/overlaytools.cxx
index d3ae3f9..71fc768 100644
--- a/svx/source/sdr/overlay/overlaytools.cxx
+++ b/svx/source/sdr/overlay/overlaytools.cxx
@@ -41,12 +41,16 @@ namespace drawinglayer
const BitmapEx& rBitmapEx,
const basegfx::B2DPoint& rBasePosition,
sal_uInt16 nCenterX,
- sal_uInt16 nCenterY)
+ sal_uInt16 nCenterY,
+ double fShearX,
+ double fRotation)
: DiscreteMetricDependentPrimitive2D(),
maBitmapEx(rBitmapEx),
maBasePosition(rBasePosition),
mnCenterX(nCenterX),
- mnCenterY(nCenterY)
+ mnCenterY(nCenterY),
+ mfShearX(fShearX),
+ mfRotation(fRotation)
{}
Primitive2DSequence OverlayBitmapExPrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
@@ -61,10 +65,10 @@ namespace drawinglayer
// the prepared one which expresses how many logic units form a discrete unit)
// for this step. This primitive is to be displayed always unscaled (in it's pixel size)
// and unrotated, more like a marker
- const double fLeft(((0.0 - getCenterX()) * getDiscreteUnit()) + getBasePosition().getX());
- const double fTop(((0.0 - getCenterY()) * getDiscreteUnit()) + getBasePosition().getY());
- const double fRight(((aBitmapSize.getWidth() - getCenterX()) * getDiscreteUnit()) + getBasePosition().getX());
- const double fBottom(((aBitmapSize.getHeight() - getCenterY()) * getDiscreteUnit()) + getBasePosition().getY());
+ const double fLeft((0.0 - getCenterX()) * getDiscreteUnit());
+ const double fTop((0.0 - getCenterY()) * getDiscreteUnit());
+ const double fRight((aBitmapSize.getWidth() - getCenterX()) * getDiscreteUnit());
+ const double fBottom((aBitmapSize.getHeight() - getCenterY()) * getDiscreteUnit());
// create a BitmapPrimitive2D using those positions
basegfx::B2DHomMatrix aTransform;
@@ -74,6 +78,21 @@ namespace drawinglayer
aTransform.set(0, 2, fLeft);
aTransform.set(1, 2, fTop);
+ // if shearX is used, apply it, too
+ if(!basegfx::fTools::equalZero(getShearX()))
+ {
+ aTransform.shearX(getShearX());
+ }
+
+ // if rotation is used, apply it, too
+ if(!basegfx::fTools::equalZero(getRotation()))
+ {
+ aTransform.rotate(getRotation());
+ }
+
+ // add BasePosition
+ aTransform.translate(getBasePosition().getX(), getBasePosition().getY());
+
const Primitive2DReference aPrimitive(new BitmapPrimitive2D(getBitmapEx(), aTransform));
aRetval = Primitive2DSequence(&aPrimitive, 1);
}
@@ -90,7 +109,9 @@ namespace drawinglayer
return (getBitmapEx() == rCompare.getBitmapEx()
&& getBasePosition() == rCompare.getBasePosition()
&& getCenterX() == rCompare.getCenterX()
- && getCenterY() == rCompare.getCenterY());
+ && getCenterY() == rCompare.getCenterY()
+ && getShearX() == rCompare.getShearX()
+ && getRotation() == rCompare.getRotation());
}
return false;
diff --git a/svx/source/svdraw/svddrgm1.hxx b/svx/source/svdraw/svddrgm1.hxx
index e4a2b33..83572a4 100644
--- a/svx/source/svdraw/svddrgm1.hxx
+++ b/svx/source/svdraw/svddrgm1.hxx
@@ -248,13 +248,16 @@ public:
////////////////////////////////////////////////////////////////////////////////////////////////////
// SdrDragCrop
-class SdrDragCrop : public SdrDragResize
+// derive from SdrDragObjOwn to have handles aligned to object when it
+// is sheared or rotated
+class SdrDragCrop : public SdrDragObjOwn
{
public:
TYPEINFO();
SdrDragCrop(SdrDragView& rNewView);
virtual void TakeSdrDragComment(OUString& rStr) const;
+ virtual bool BeginSdrDrag();
virtual bool EndSdrDrag(bool bCopy);
virtual Pointer GetSdrDragPointer() const;
};
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 5a6cba4..df1f835 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -3644,7 +3644,7 @@ void SdrDragDistort::applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPol
TYPEINIT1(SdrDragCrop,SdrDragResize);
SdrDragCrop::SdrDragCrop(SdrDragView& rNewView)
-: SdrDragResize(rNewView)
+: SdrDragObjOwn(rNewView)
{
// switch off solid dragging for crop; it just makes no sense since showing
// a 50% transparent object above the original will not be visible
@@ -3667,7 +3667,21 @@ void SdrDragCrop::TakeSdrDragComment(OUString& rStr) const
rStr += ImpGetResStr(STR_EditWithCopy);
}
-bool SdrDragCrop::EndSdrDrag(bool bCopy)
+bool SdrDragCrop::BeginSdrDrag()
+{
+ // call parent
+ bool bRetval(SdrDragObjOwn::BeginSdrDrag());
+
+ if(!GetDragHdl())
+ {
+ // we need the DragHdl, break if not there
+ bRetval = false;
+ }
+
+ return bRetval;
+}
+
+bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/)
{
Hide();
@@ -3706,34 +3720,204 @@ bool SdrDragCrop::EndSdrDrag(bool bCopy)
ImpTakeDescriptionStr(STR_DragMethCrop, aUndoStr);
getSdrDragView().BegUndo( aUndoStr );
- getSdrDragView().AddUndo( getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
+ getSdrDragView().AddUndo( getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ // also need attr undo, the SdrGrafCropItem will be changed
+ getSdrDragView().AddUndo( getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
}
- Rectangle aOldRect( pObj->GetLogicRect() );
- getSdrDragView().ResizeMarkedObj(DragStat().Ref1(),aXFact,aYFact,bCopy);
- Rectangle aNewRect( pObj->GetLogicRect() );
+ // new part to comute the user's drag activities
+ // get the original objects transformation
+ basegfx::B2DHomMatrix aOriginalMatrix;
+ basegfx::B2DPolyPolygon aPolyPolygon;
+ bool bShearCorrected(false);
- double fScaleX = ( aGraphicSize.Width() - rOldCrop.GetLeft() - rOldCrop.GetRight() ) / (double)aOldRect.GetWidth();
- double fScaleY = ( aGraphicSize.Height() - rOldCrop.GetTop() - rOldCrop.GetBottom() ) / (double)aOldRect.GetHeight();
+ // get transformation from object
+ pObj->TRGetBaseGeometry(aOriginalMatrix, aPolyPolygon);
+
+ { // TTTT correct shear, it comes currently mirrored from TRGetBaseGeometry, can be removed with aw080
+ basegfx::B2DTuple aScale;
+ basegfx::B2DTuple aTranslate;
+ double fRotate(0.0), fShearX(0.0);
+
+ aOriginalMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ if(!basegfx::fTools::equalZero(fShearX))
+ {
+ bShearCorrected = true;
+ aOriginalMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale,
+ -fShearX,
+ fRotate,
+ aTranslate);
+ }
+ }
+
+ // invert it to be able to work on unit coordinates
+ basegfx::B2DHomMatrix aInverse(aOriginalMatrix);
+
+ aInverse.invert();
+
+ // gererate start point of original drag vector in unit coordinates (the
+ // vis-a-vis of the drag point)
+ basegfx::B2DPoint aLocalStart(0.0, 0.0);
+ bool bOnAxis(false);
+
+ switch(GetDragHdlKind())
+ {
+ case HDL_UPLFT: aLocalStart.setX(1.0); aLocalStart.setY(1.0); break;
+ case HDL_UPPER: aLocalStart.setX(0.5); aLocalStart.setY(1.0); bOnAxis = true; break;
+ case HDL_UPRGT: aLocalStart.setX(0.0); aLocalStart.setY(1.0); break;
+ case HDL_LEFT : aLocalStart.setX(1.0); aLocalStart.setY(0.5); bOnAxis = true; break;
+ case HDL_RIGHT: aLocalStart.setX(0.0); aLocalStart.setY(0.5); bOnAxis = true; break;
+ case HDL_LWLFT: aLocalStart.setX(1.0); aLocalStart.setY(0.0); break;
+ case HDL_LOWER: aLocalStart.setX(0.5); aLocalStart.setY(0.0); bOnAxis = true; break;
+ case HDL_LWRGT: aLocalStart.setX(0.0); aLocalStart.setY(0.0); break;
+ default: break;
+ }
+
+ // create the current drag position in unit coordinates
+ basegfx::B2DPoint aLocalCurrent(aInverse * basegfx::B2DPoint(DragStat().GetNow().X(), DragStat().GetNow().Y()));
+
+ // if one of the edge handles is used, limit to X or Y drag only
+ if(bOnAxis)
+ {
+ if(basegfx::fTools::equal(aLocalStart.getX(), 0.5))
+ {
+ aLocalCurrent.setX(aLocalStart.getX());
+ }
+ else
+ {
+ aLocalCurrent.setY(aLocalStart.getY());
+ }
+ }
+
+ // create internal change in unit coordinates
+ basegfx::B2DHomMatrix aDiscreteChangeMatrix;
- // to correct the never working combination of cropped images and mirroring
- // I have to correct the rectangles the calculation is based on here. In the current
- // core geometry stuff a vertical mirror is expressed as 180 degree rotation. All
- // this can be removed again when aw080 will have cleaned up the old
- // (non-)transformation mess in the core.
- if(18000 == pObj->GetGeoStat().nDrehWink)
+ if(!basegfx::fTools::equal(aLocalCurrent.getX(), aLocalStart.getX()))
{
- // old notation of vertical mirror, need to correct diffs since both rects
- // are rotated by 180 degrees
- aOldRect = Rectangle(aOldRect.TopLeft() - (aOldRect.BottomRight() - aOldRect.TopLeft()), aOldRect.TopLeft());
- aNewRect = Rectangle(aNewRect.TopLeft() - (aNewRect.BottomRight() - aNewRect.TopLeft()), aNewRect.TopLeft());
+ if(aLocalStart.getX() < 0.5)
+ {
+ aDiscreteChangeMatrix.scale(aLocalCurrent.getX(), 1.0);
+ }
+ else
+ {
+ aDiscreteChangeMatrix.scale(1.0 - aLocalCurrent.getX(), 1.0);
+ aDiscreteChangeMatrix.translate(aLocalCurrent.getX(), 0.0);
+ }
+ }
+
+ if(!basegfx::fTools::equal(aLocalCurrent.getY(), aLocalStart.getY()))
+ {
+ if(aLocalStart.getY() < 0.5)
+ {
+ aDiscreteChangeMatrix.scale(1.0, aLocalCurrent.getY());
+ }
+ else
+ {
+ aDiscreteChangeMatrix.scale(1.0, 1.0 - aLocalCurrent.getY());
+ aDiscreteChangeMatrix.translate(0.0, aLocalCurrent.getY());
+ }
}
+ // preparematrix to apply to object; evtl. back-correct shear
+ basegfx::B2DHomMatrix aNewObjectMatrix(aOriginalMatrix * aDiscreteChangeMatrix);
+
+ if(bShearCorrected)
+ {
+ // TTTT back-correct shear
+ basegfx::B2DTuple aScale;
+ basegfx::B2DTuple aTranslate;
+ double fRotate(0.0), fShearX(0.0);
+
+ aNewObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+ aNewObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale,
+ -fShearX,
+ fRotate,
+ aTranslate);
+ }
+
+ // apply change to object by applying the unit coordinate change followed
+ // by the original change
+ pObj->TRSetBaseGeometry(aNewObjectMatrix, aPolyPolygon);
+
+ // the following old code uses aOldRect/aNewRect to calculate the crop change for
+ // the crop item. It implies unrotated objects, so create the unrotated original
+ // erctangle and the unrotated modified rectangle. Latter can in case of shear and/or
+ // rotation not be fetched by using
+ //
+ //Rectangle aNewRect( pObj->GetLogicRect() );
+ //
+ // as it was done before because the top-left of that new rect *will* have an offset
+ // caused by the evtl. existing shear and/or rotation, so calculate a unrotated
+ // rectangle how it would be as a result when appling the unit coordinate change
+ // to the unrotated original transformation.
+ basegfx::B2DTuple aScale;
+ basegfx::B2DTuple aTranslate;
+ double fRotate, fShearX;
+
+ // get access to scale and translate
+ aOriginalMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // prepare unsheared/unrotated versions of the old and new transformation
+ const basegfx::B2DHomMatrix aMatrixOriginalNoShearNoRotate(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ basegfx::absolute(aScale),
+ aTranslate));
+
+ // create the ranges for these
+ basegfx::B2DRange aRangeOriginalNoShearNoRotate(0.0, 0.0, 1.0, 1.0);
+ basegfx::B2DRange aRangeNewNoShearNoRotate(0.0, 0.0, 1.0, 1.0);
+
+ aRangeOriginalNoShearNoRotate.transform(aMatrixOriginalNoShearNoRotate);
+ aRangeNewNoShearNoRotate.transform(aMatrixOriginalNoShearNoRotate * aDiscreteChangeMatrix);
+
+ // extract the old Rectangle structures
+ Rectangle aOldRect(
+ basegfx::fround(aRangeOriginalNoShearNoRotate.getMinX()),
+ basegfx::fround(aRangeOriginalNoShearNoRotate.getMinY()),
+ basegfx::fround(aRangeOriginalNoShearNoRotate.getMaxX()),
+ basegfx::fround(aRangeOriginalNoShearNoRotate.getMaxY()));
+ Rectangle aNewRect(
+ basegfx::fround(aRangeNewNoShearNoRotate.getMinX()),
+ basegfx::fround(aRangeNewNoShearNoRotate.getMinY()),
+ basegfx::fround(aRangeNewNoShearNoRotate.getMaxX()),
+ basegfx::fround(aRangeNewNoShearNoRotate.getMaxY()));
+
+ // continue with the old original stuff
+ double fScaleX = ( aGraphicSize.Width() - rOldCrop.GetLeft() - rOldCrop.GetRight() ) / (double)aOldRect.GetWidth();
+ double fScaleY = ( aGraphicSize.Height() - rOldCrop.GetTop() - rOldCrop.GetBottom() ) / (double)aOldRect.GetHeight();
+
+ // not needed since the modification is done in unit coordinates, free from shear/rotate and mirror
+ // // TTTT may be removed or exhanged by other stuff in aw080
+ // // to correct the never working combination of cropped images and mirroring
+ // // I have to correct the rectangles the calculation is based on here. In the current
+ // // core geometry stuff a vertical mirror is expressed as 180 degree rotation. All
+ // // this can be removed again when aw080 will have cleaned up the old
+ // // (non-)transformation mess in the core.
+ // if(18000 == pObj->GetGeoStat().nDrehWink)
+ // {
+ // // old notation of vertical mirror, need to correct diffs since both rects
+ // // are rotated by 180 degrees
+ // aOldRect = Rectangle(aOldRect.TopLeft() - (aOldRect.BottomRight() - aOldRect.TopLeft()), aOldRect.TopLeft());
+ // aNewRect = Rectangle(aNewRect.TopLeft() - (aNewRect.BottomRight() - aNewRect.TopLeft()), aNewRect.TopLeft());
+ // }
+
sal_Int32 nDiffLeft = aNewRect.Left() - aOldRect.Left();
sal_Int32 nDiffTop = aNewRect.Top() - aOldRect.Top();
sal_Int32 nDiffRight = aNewRect.Right() - aOldRect.Right();
sal_Int32 nDiffBottom = aNewRect.Bottom() - aOldRect.Bottom();
+ if(pObj->IsMirrored())
+ {
+ // mirrored X or Y, for old stuff, exchange X
+ // TTTT: check for aw080
+ sal_Int32 nTmp(nDiffLeft);
+ nDiffLeft = -nDiffRight;
+ nDiffRight = -nTmp;
+ }
+
sal_Int32 nLeftCrop = static_cast<sal_Int32>( rOldCrop.GetLeft() + nDiffLeft * fScaleX );
sal_Int32 nTopCrop = static_cast<sal_Int32>( rOldCrop.GetTop() + nDiffTop * fScaleY );
sal_Int32 nRightCrop = static_cast<sal_Int32>( rOldCrop.GetRight() - nDiffRight * fScaleX );
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 64b56e5..a461882 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -2212,8 +2212,14 @@ SdrHdl* SdrHdlList::GetHdl(SdrHdlKind eKind1) const
// SdrCropHdl
// --------------------------------------------------------------------
-SdrCropHdl::SdrCropHdl(const Point& rPnt, SdrHdlKind eNewKind)
-: SdrHdl( rPnt, eNewKind )
+SdrCropHdl::SdrCropHdl(
+ const Point& rPnt,
+ SdrHdlKind eNewKind,
+ double fShearX,
+ double fRotation)
+: SdrHdl(rPnt, eNewKind),
+ mfShearX(fShearX),
+ mfRotation(fRotation)
{
}
@@ -2310,18 +2316,29 @@ void SdrCropHdl::CreateB2dIAObject()
const sal_uInt32 nBlinkTime = sal::static_int_cast<sal_uInt32>(rStyleSettings.GetCursorBlinkTime());
- pOverlayObject = new ::sdr::overlay::OverlayAnimatedBitmapEx(aPosition, aBmpEx1, aBmpEx2, nBlinkTime,
+ pOverlayObject = new ::sdr::overlay::OverlayAnimatedBitmapEx(
+ aPosition,
+ aBmpEx1,
+ aBmpEx2,
+ nBlinkTime,
(sal_uInt16)(aBmpEx1.GetSizePixel().Width() - 1) >> 1,
(sal_uInt16)(aBmpEx1.GetSizePixel().Height() - 1) >> 1,
(sal_uInt16)(aBmpEx2.GetSizePixel().Width() - 1) >> 1,
- (sal_uInt16)(aBmpEx2.GetSizePixel().Height() - 1) >> 1);
+ (sal_uInt16)(aBmpEx2.GetSizePixel().Height() - 1) >> 1,
+ mfShearX,
+ mfRotation);
}
else
{
// create centered handle as default
- pOverlayObject = new ::sdr::overlay::OverlayBitmapEx(aPosition, aBmpEx1,
+ pOverlayObject = new ::sdr::overlay::OverlayBitmapEx(
+ aPosition,
+ aBmpEx1,
(sal_uInt16)(aBmpEx1.GetSizePixel().Width() - 1) >> 1,
- (sal_uInt16)(aBmpEx1.GetSizePixel().Height() - 1) >> 1);
+ (sal_uInt16)(aBmpEx1.GetSizePixel().Height() - 1) >> 1,
+ 0.0,
+ mfShearX,
+ mfRotation);
}
// OVERLAYMANAGER
@@ -2337,6 +2354,8 @@ void SdrCropHdl::CreateB2dIAObject()
}
////////////////////////////////////////////////////////////////////////////////////////////////////
+// with the correction of crop handling I could get rid of the extra mirroring flag, adapted stuff
+// accordingly
SdrCropViewHdl::SdrCropViewHdl(
const basegfx::B2DHomMatrix& rObjectTransform,
@@ -2344,16 +2363,14 @@ SdrCropViewHdl::SdrCropViewHdl(
double fCropLeft,
double fCropTop,
double fCropRight,
- double fCropBottom,
- bool bExtraMirrorXFromGraphic)
+ double fCropBottom)
: SdrHdl(Point(), HDL_USER),
maObjectTransform(rObjectTransform),
maGraphic(rGraphic),
mfCropLeft(fCropLeft),
mfCropTop(fCropTop),
mfCropRight(fCropRight),
- mfCropBottom(fCropBottom),
- mbExtraMirrorXFromGraphic(bExtraMirrorXFromGraphic)
+ mfCropBottom(fCropBottom)
{
}
@@ -2405,15 +2422,11 @@ void SdrCropViewHdl::CreateB2dIAObject()
if(bMirroredX)
{
aScale.setX(-aScale.getX());
- fCropLeft = mfCropRight;
- fCropRight = mfCropLeft;
}
if(bMirroredY)
{
aScale.setY(-aScale.getY());
- fCropTop = mfCropBottom;
- fCropBottom = mfCropTop;
}
// create target translate and scale
@@ -2478,14 +2491,13 @@ void SdrCropViewHdl::CreateB2dIAObject()
// create cropped transformation
basegfx::B2DHomMatrix aCroppedTransform;
- const bool bCombinedMirrorX(mbExtraMirrorXFromGraphic || bMirroredX);
aCroppedTransform.scale(
- bCombinedMirrorX ? -aCropped.getWidth() : aCropped.getWidth(),
- bMirroredY ? -aCropped.getHeight() : aCropped.getHeight());
+ aCropped.getWidth(),
+ aCropped.getHeight());
aCroppedTransform.translate(
- bCombinedMirrorX ? aCropped.getMaxX() : aCropped.getMinX(),
- bMirroredY ? aCropped.getMaxY() : aCropped.getMinY());
+ aCropped.getMinX(),
+ aCropped.getMinY());
aCroppedTransform = maObjectTransform * aCroppedTransform;
// prepare graphic primitive (tranformed)
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 2124482..46433c1 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -593,6 +593,13 @@ sal_Bool SdrMarkView::ImpIsFrameHandles() const
bFrmHdl=!pObj->hasSpecialDrag();
}
}
+
+ // no FrameHdl for crop
+ if(bFrmHdl && SDRDRAG_CROP == eDragMode)
+ {
+ bFrmHdl = sal_False;
+ }
+
return bFrmHdl;
}
@@ -712,67 +719,6 @@ void SdrMarkView::SetMarkHandles()
pHdl->SetObjHdlNum(sal_uInt16(i-nSiz0));
}
}
- else if( eDragMode==SDRDRAG_CROP )
- {
- const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pMarkedObj);
-
- if(pSdrGrafObj)
- {
- const SdrGrafCropItem& rCrop = static_cast< const SdrGrafCropItem& >(pSdrGrafObj->GetMergedItem(SDRATTR_GRAFCROP));
-
- if(rCrop.GetLeft() || rCrop.GetTop() || rCrop.GetRight() ||rCrop.GetBottom())
- {
- basegfx::B2DHomMatrix aMatrix;
- basegfx::B2DPolyPolygon aPolyPolygon;
-
- pSdrGrafObj->TRGetBaseGeometry(aMatrix, aPolyPolygon);
-
- // decompose to have current translate and scale
- basegfx::B2DVector aScale, aTranslate;
- double fRotate, fShearX;
-
- aMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
-
- if(!aScale.equalZero())
- {
- // get crop scale
- const basegfx::B2DVector aCropScaleFactor(
- pSdrGrafObj->GetGraphicObject().calculateCropScaling(
- aScale.getX(),
- aScale.getY(),
- rCrop.GetLeft(),
- rCrop.GetTop(),
- rCrop.GetRight(),
- rCrop.GetBottom()));
-
- // apply crop scale
- const double fCropLeft(rCrop.GetLeft() * aCropScaleFactor.getX());
- const double fCropTop(rCrop.GetTop() * aCropScaleFactor.getY());
- const double fCropRight(rCrop.GetRight() * aCropScaleFactor.getX());
- const double fCropBottom(rCrop.GetBottom() * aCropScaleFactor.getY());
-
- aHdl.AddHdl(
- new SdrCropViewHdl(
- aMatrix,
- pSdrGrafObj->GetGraphicObject().GetGraphic(),
- fCropLeft,
- fCropTop,
- fCropRight,
- fCropBottom,
- pSdrGrafObj->IsMirrored()));
- }
- }
- }
-
- aHdl.AddHdl(new SdrCropHdl(aRect.TopLeft() ,HDL_UPLFT));
- aHdl.AddHdl(new SdrCropHdl(aRect.TopCenter() ,HDL_UPPER));
- aHdl.AddHdl(new SdrCropHdl(aRect.TopRight() ,HDL_UPRGT));
- aHdl.AddHdl(new SdrCropHdl(aRect.LeftCenter() ,HDL_LEFT ));
- aHdl.AddHdl(new SdrCropHdl(aRect.RightCenter() ,HDL_RIGHT));
- aHdl.AddHdl(new SdrCropHdl(aRect.BottomLeft() ,HDL_LWLFT));
- aHdl.AddHdl(new SdrCropHdl(aRect.BottomCenter(),HDL_LOWER));
- aHdl.AddHdl(new SdrCropHdl(aRect.BottomRight() ,HDL_LWRGT));
- }
else
{
bool bWdt0=aRect.Left()==aRect.Right();
@@ -802,47 +748,65 @@ void SdrMarkView::SetMarkHandles()
}
else
{
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++)
+ bool bDone(false);
+
+ // moved crop handling to non-frame part and the handle creation to SdrGrafObj
+ if(1 == nMarkAnz && pMarkedObj && SDRDRAG_CROP == eDragMode)
{
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrPageView* pPV=pM->GetPageView();
- const sal_uIntPtr nSiz0=aHdl.GetHdlCount();
- pObj->AddToHdlList(aHdl);
- const sal_uIntPtr nSiz1=aHdl.GetHdlCount();
- bool bPoly=pObj->IsPolyObj();
- const SdrUShortCont* pMrkPnts=pM->GetMarkedPoints();
- for (sal_uIntPtr i=nSiz0; i<nSiz1; i++)
+ const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pMarkedObj);
+
+ if(pSdrGrafObj)
+ {
+ pSdrGrafObj->addCropHandles(aHdl);
+ bDone = true;
+ }
+ }
+
+ if(!bDone)
+ {
+ for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++)
{
- SdrHdl* pHdl=aHdl.GetHdl(i);
- pHdl->SetPos( pHdl->GetPos() + aGridOff );
- pHdl->SetObj(pObj);
- pHdl->SetPageView(pPV);
- pHdl->SetObjHdlNum(sal_uInt16(i-nSiz0));
- if (bPoly)
+ const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
+ SdrObject* pObj=pM->GetMarkedSdrObj();
+ SdrPageView* pPV=pM->GetPageView();
+ const sal_uIntPtr nSiz0=aHdl.GetHdlCount();
+ pObj->AddToHdlList(aHdl);
+ const sal_uIntPtr nSiz1=aHdl.GetHdlCount();
+ bool bPoly=pObj->IsPolyObj();
+ const SdrUShortCont* pMrkPnts=pM->GetMarkedPoints();
+ for (sal_uIntPtr i=nSiz0; i<nSiz1; i++)
{
- sal_Bool bSelected=pMrkPnts!=NULL
- && pMrkPnts->find( sal_uInt16(i-nSiz0) ) != pMrkPnts->end();
- pHdl->SetSelected(bSelected);
- if (bPlusHdlAlways || bSelected)
+ SdrHdl* pHdl=aHdl.GetHdl(i);
+ pHdl->SetPos( pHdl->GetPos() + aGridOff );
+ pHdl->SetObj(pObj);
+ pHdl->SetPageView(pPV);
+ pHdl->SetObjHdlNum(sal_uInt16(i-nSiz0));
+
+ if (bPoly)
{
- sal_uInt32 nPlusAnz=pObj->GetPlusHdlCount(*pHdl);
- for (sal_uInt32 nPlusNum=0; nPlusNum<nPlusAnz; nPlusNum++)
+ sal_Bool bSelected=pMrkPnts!=NULL
+ && pMrkPnts->find( sal_uInt16(i-nSiz0) ) != pMrkPnts->end();
+ pHdl->SetSelected(bSelected);
+ if (bPlusHdlAlways || bSelected)
{
- SdrHdl* pPlusHdl=pObj->GetPlusHdl(*pHdl,nPlusNum);
- if (pPlusHdl!=NULL)
+ sal_uInt32 nPlusAnz=pObj->GetPlusHdlCount(*pHdl);
+ for (sal_uInt32 nPlusNum=0; nPlusNum<nPlusAnz; nPlusNum++)
{
- pPlusHdl->SetObj(pObj);
- pPlusHdl->SetPageView(pPV);
- pPlusHdl->SetPlusHdl(sal_True);
- aHdl.AddHdl(pPlusHdl);
+ SdrHdl* pPlusHdl=pObj->GetPlusHdl(*pHdl,nPlusNum);
+ if (pPlusHdl!=NULL)
+ {
+ pPlusHdl->SetObj(pObj);
+ pPlusHdl->SetPageView(pPV);
+ pPlusHdl->SetPlusHdl(sal_True);
+ aHdl.AddHdl(pPlusHdl);
+ }
}
}
}
}
}
- } // for nMarkNum
- } // if bFrmHdl else
+ }
+ }
// GluePoint handles
for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++)
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 00f28e3..58688bc 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -55,6 +55,7 @@
#include <editeng/eeitem.hxx>
#include <svx/sdr/properties/graphicproperties.hxx>
#include <svx/sdr/contact/viewcontactofgraphic.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <osl/thread.hxx>
@@ -1499,4 +1500,116 @@ Reference< XInputStream > SdrGrafObj::getInputStream()
return xStream;
}
+// moved crop handle creation here; this is the object type using them
+void SdrGrafObj::addCropHandles(SdrHdlList& rTarget) const
+{
+ basegfx::B2DHomMatrix aMatrix;
+ basegfx::B2DPolyPolygon aPolyPolygon;
+
+ // get object transformation
+ TRGetBaseGeometry(aMatrix, aPolyPolygon);
+
+ // part of object transformation correction, but used later, so defined outside next scope
+ double fShearX(0.0), fRotate(0.0);
+
+ { // TTTT correct shear, it comes currently mirrored from TRGetBaseGeometry, can be removed with aw080
+ basegfx::B2DTuple aScale;
+ basegfx::B2DTuple aTranslate;
+
+ aMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ if(!basegfx::fTools::equalZero(fShearX))
+ {
+ // shearX is used, correct it
+ fShearX = -fShearX;
+ }
+
+ aMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale,
+ fShearX,
+ fRotate,
+ aTranslate);
+ }
+
+ // get crop values
+ const SdrGrafCropItem& rCrop = static_cast< const SdrGrafCropItem& >(GetMergedItem(SDRATTR_GRAFCROP));
+
+ if(rCrop.GetLeft() || rCrop.GetTop() || rCrop.GetRight() ||rCrop.GetBottom())
+ {
+ // decompose object transformation to have current translate and scale
+ basegfx::B2DVector aScale, aTranslate;
+ double fLclRotate, fLclShearX;
+
+ aMatrix.decompose(aScale, aTranslate, fLclRotate, fLclShearX);
+
+ if(!aScale.equalZero())
+ {
+ // get crop scale
+ const basegfx::B2DVector aCropScaleFactor(
+ GetGraphicObject().calculateCropScaling(
+ aScale.getX(),
+ aScale.getY(),
+ rCrop.GetLeft(),
+ rCrop.GetTop(),
+ rCrop.GetRight(),
+ rCrop.GetBottom()));
+
+ // apply crop scale
+ const double fCropLeft(rCrop.GetLeft() * aCropScaleFactor.getX());
+ const double fCropTop(rCrop.GetTop() * aCropScaleFactor.getY());
+ const double fCropRight(rCrop.GetRight() * aCropScaleFactor.getX());
+ const double fCropBottom(rCrop.GetBottom() * aCropScaleFactor.getY());
+ basegfx::B2DHomMatrix aMatrixForCropViewHdl(aMatrix);
+
+ if(IsMirrored())
+ {
+ // create corrected new matrix, TTTT can be removed with aw080
+ // the old mirror only can mirror horizontally; the vertical mirror
+ // is faked by using the horizontal and 180 degree rotation. Since
+ // the object can be rotated differently from 180 degree, this is
+ // not safe to detect. Just correct horizontal mirror (which is
+ // in IsMirrored()) and keep the rotation angle
+ // caution: Do not modify aMatrix, it is used below to calculate
+ // the exact handle positions
+ basegfx::B2DHomMatrix aPreMultiply;
+
+ // mirrored X, apply
+ aPreMultiply.translate(-0.5, 0.0);
+ aPreMultiply.scale(-1.0, 1.0);
+ aPreMultiply.translate(0.5, 0.0);
+
+ aMatrixForCropViewHdl = aMatrixForCropViewHdl * aPreMultiply;
+ }
+
+ rTarget.AddHdl(
+ new SdrCropViewHdl(
+ aMatrixForCropViewHdl,
+ GetGraphicObject().GetGraphic(),
+ fCropLeft,
+ fCropTop,
+ fCropRight,
+ fCropBottom));
+ }
+ }
+
+ basegfx::B2DPoint aPos;
+
+ aPos = aMatrix * basegfx::B2DPoint(0.0, 0.0);
+ rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_UPLFT, fShearX, fRotate));
+ aPos = aMatrix * basegfx::B2DPoint(0.5, 0.0);
+ rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_UPPER, fShearX, fRotate));
+ aPos = aMatrix * basegfx::B2DPoint(1.0, 0.0);
+ rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_UPRGT, fShearX, fRotate));
+ aPos = aMatrix * basegfx::B2DPoint(0.0, 0.5);
+ rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_LEFT , fShearX, fRotate));
+ aPos = aMatrix * basegfx::B2DPoint(1.0, 0.5);
+ rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_RIGHT, fShearX, fRotate));
+ aPos = aMatrix * basegfx::B2DPoint(0.0, 1.0);
+ rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_LWLFT, fShearX, fRotate));
+ aPos = aMatrix * basegfx::B2DPoint(0.5, 1.0);
+ rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_LOWER, fShearX, fRotate));
+ aPos = aMatrix * basegfx::B2DPoint(1.0, 1.0);
+ rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_LWRGT, fShearX, fRotate));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 655397f53d1244b7df00c17487ff3717eb804507
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:18:22 2014 +0000
drop RID_SCDLG_INSCONT, etc. now
Change-Id: Iee2eaf89f662b61fc4ec32b353b13417ee6b2610
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 9c51d90..c1ba5c9 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1003,9 +1003,6 @@
#define RID_SCDLG_INSCELL (SC_DIALOGS_START + 12)
-#define RID_SCDLG_INSCONT (SC_DIALOGS_START + 14)
-
-
#define RID_SCDLG_SELENTRY (SC_DIALOGS_START + 18)
#define RID_SCDLG_AUTOFORMAT (SC_DIALOGS_START + 20)
#define RID_SCDLG_NAMES (SC_DIALOGS_START + 22)
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index 068e544..ef4e45b 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -383,7 +383,6 @@ public:
sal_Bool bDisallowCellMove = false ) = 0;
virtual AbstractScInsertContentsDlg * CreateScInsertContentsDlg( Window* pParent,
- int nId,
sal_uInt16 nCheckDefaults = 0,
const OUString* pStrTitle = NULL ) = 0;
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 0229bfb..fea71db 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -788,23 +788,11 @@ AbstractScInsertCellDlg * ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( W
}
AbstractScInsertContentsDlg * ScAbstractDialogFactory_Impl::CreateScInsertContentsDlg( Window* pParent,
- int nId,
sal_uInt16 nCheckDefaults,
const OUString* pStrTitle )
{
- ScInsertContentsDlg * pDlg=NULL;
- switch ( nId )
- {
- case RID_SCDLG_INSCONT :
- pDlg = new ScInsertContentsDlg( pParent, nCheckDefaults,pStrTitle );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractScInsertContentsDlg_Impl( pDlg );
- return 0;
+ ScInsertContentsDlg * pDlg = new ScInsertContentsDlg(pParent, nCheckDefaults, pStrTitle);
+ return new AbstractScInsertContentsDlg_Impl( pDlg );
}
AbstractScInsertTableDlg * ScAbstractDialogFactory_Impl::CreateScInsertTableDlg(Window* pParent, ScViewData& rViewData,
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index c819c28..8663baa 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -451,7 +451,6 @@ public:
sal_Bool bDisallowCellMove = false );
virtual AbstractScInsertContentsDlg * CreateScInsertContentsDlg( Window* pParent,
- int nId,
sal_uInt16 nCheckDefaults = 0,
const OUString* pStrTitle = NULL );
diff --git a/sc/source/ui/inc/miscdlgs.hrc b/sc/source/ui/inc/miscdlgs.hrc
index b8c9a9e..c0f4982 100644
--- a/sc/source/ui/inc/miscdlgs.hrc
+++ b/sc/source/ui/inc/miscdlgs.hrc
@@ -18,7 +18,6 @@
*/
#include "sc.hrc"
- // -> RID_SCDLG_INSCONT
// -> RID_SCDLG_MOVETAB
// -> RID_SCDLG_SELENTRY
// -> RID_SCDLG_FILLSERIES
@@ -36,32 +35,6 @@
#define STR_BTN_CLOSE 200
-// Insert Contents Dialog
-#define BTN_INSALL 20
-#define BTN_INSSTRINGS 21
-#define BTN_INSNUMBERS 22
-#define BTN_INSDATETIME 23
-#define BTN_INSFORMULAS 24
-#define BTN_INSATTRS 25
-#define BTN_INSNOTES 26
-#define BTN_OP_NOOP 27
-#define BTN_OP_ADD 28
-#define BTN_OP_SUB 29
-#define BTN_OP_MUL 30
-#define BTN_OP_DIV 31
-#define FL_OPERATION 32
-#define BTN_SKIP_EMPTY 33
-#define BTN_TRANSPOSE 34
-#define BTN_LINK 35
-#define FL_OPTIONS 36
-#define BTN_MV_NONE 37
-#define BTN_MV_DOWN 38
-#define BTN_MV_RIGHT 39
-#define FL_MOVE 40
-#define BTN_INSOBJECTS 41
-#define FL_SEP1 51
-#define FL_SEP2 52
-
// String input
#define ED_INPUT 10
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 2f64ea6..acd1980 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -470,7 +470,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
AbstractScInsertContentsDlg* pDlg = pFact->CreateScInsertContentsDlg( pTabViewShell->GetDialogParent(),
- RID_SCDLG_INSCONT, 0, /* nCheckDefaults */
+ 0, /* nCheckDefaults */
&ScGlobal::GetRscString(STR_FILL_TAB));
OSL_ENSURE(pDlg, "Dialog create fail!");
pDlg->SetFillMode(true);
@@ -1333,8 +1333,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- AbstractScInsertContentsDlg* pDlg = pFact->CreateScInsertContentsDlg( pTabViewShell->GetDialogParent(),
- RID_SCDLG_INSCONT);
+ AbstractScInsertContentsDlg* pDlg = pFact->CreateScInsertContentsDlg(pTabViewShell->GetDialogParent());
OSL_ENSURE(pDlg, "Dialog create fail!");
pDlg->SetOtherDoc( bOtherDoc );
// if ChangeTrack MoveMode disable
diff --git a/sc/uiconfig/scalc/ui/pastespecial.ui b/sc/uiconfig/scalc/ui/pastespecial.ui
index 01559c1..7c0d7f1 100644
--- a/sc/uiconfig/scalc/ui/pastespecial.ui
+++ b/sc/uiconfig/scalc/ui/pastespecial.ui
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Tue Jan 28 13:14:40 2014 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="PasteSpecial">
@@ -70,7 +71,7 @@
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="row_spacing">6</property>
+ <property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkFrame" id="frame1">
@@ -84,8 +85,8 @@
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="left_padding">12</property>
<property name="top_padding">6</property>
+ <property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
@@ -254,8 +255,8 @@
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="left_padding">12</property>
<property name="top_padding">6</property>
+ <property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box4">
<property name="visible">True</property>
@@ -386,8 +387,8 @@
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="left_padding">12</property>
<property name="top_padding">6</property>
+ <property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
@@ -401,7 +402,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -419,7 +419,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -437,7 +436,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -482,8 +480,8 @@
<object class="GtkAlignment" id="alignment4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="left_padding">12</property>
<property name="top_padding">6</property>
+ <property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
@@ -533,7 +531,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
commit eab105e9433c4a01b0006b6eac085ba92af0763d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 14:24:05 2014 +0000
coverity#705140 Missing break in switch
Change-Id: I1b08e9afda2eeb3c4c79154376f34cad3e1f0a4c
diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx
index 7e5de81..87f9de9 100644
--- a/dbaccess/source/core/api/FilteredContainer.cxx
+++ b/dbaccess/source/core/api/FilteredContainer.cxx
@@ -462,6 +462,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, ::std::vecto
{
default:
SAL_WARN("dbaccess", "OTableContainer::getAllTableTypeFilter: unknown TableTypeFilterMode!" );
+ /* Fall through */
case FILTER_MODE_MIX_ALL:
_rFilter.realloc( 3 );
_rFilter[0] = sView;
commit 9add737f88c46a21e9d49b9940c41c443207962a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 14:23:12 2014 +0000
coverity#705139 Missing break in switch
Change-Id: Ie4fc12e93a51bc117ec82058c579593f7677cd9b
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index 51a5620..8d9faa6 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -391,6 +391,7 @@ sal_Bool SvxTextAttrPage::FillItemSet( SfxItemSet& rAttrs)
{
default: ; //prevent warning
OSL_FAIL( "svx::SvxTextAttrPage::FillItemSet(), unhandled state!" );
+ /* Fall through */
case STATE_NOCHECK: eFTS = SDRTEXTFIT_NONE; break;
case STATE_CHECK: eFTS = SDRTEXTFIT_AUTOFIT; break;
}
commit ba75754c44b40bad65aa429dbd83cb597542581c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 14:22:15 2014 +0000
coverity#705138 Missing break in switch
Change-Id: Ia7f2211bb4a8c006259c9db6a2eac64593f8e91e
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 0b6da15..4d0fcb9 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -498,6 +498,7 @@ Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic,
switch( maCtlLight.GetActualRP() )
{
default: OSL_FAIL("svx::GraphicFilterEmboss::GetFilteredGraphic(), unknown Reference Point!" );
+ /* Fall through */
case( RP_LT ): nAzim = 4500, nElev = 4500; break;
case( RP_MT ): nAzim = 9000, nElev = 4500; break;
case( RP_RT ): nAzim = 13500, nElev = 4500; break;
commit 1b8179c5f4f2e6470c8a572443342eea666edc3e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 14:14:22 2014 +0000
coverity#705513 Dereference null return value
Change-Id: I7fd1569fe5d5c4383f028915af95fec55b8f8121
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 84965e8..e56207f 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1308,12 +1308,12 @@ const SwNumFmt* SwWW8FltControlStack::GetNumFmtFromStack(const SwPosition &rPos,
const SfxPoolItem *pItem = GetStackAttr(rPos, RES_FLTR_NUMRULE);
if (pItem && rTxtNode.GetNumRule())
{
- OUString sName(((SfxStringItem*)pItem)->GetValue());
if (rTxtNode.IsCountedInList())
{
+ OUString sName(((SfxStringItem*)pItem)->GetValue());
const SwNumRule *pRule = pDoc->FindNumRulePtr(sName);
-
- pRet = GetNumFmtFromSwNumRuleLevel(*pRule, rTxtNode.GetActualListLevel());
+ if (pRule)
+ pRet = GetNumFmtFromSwNumRuleLevel(*pRule, rTxtNode.GetActualListLevel());
}
}
return pRet;
commit 22c0cdc0146598cad53180be9b5f9378d2bc1d0c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 14:10:16 2014 +0000
coverity#705602 Big parameter passed by value
Change-Id: I4f96325d6387bf7e8859d09f1d5b41c605e8227d
diff --git a/include/basebmp/fillimage.hxx b/include/basebmp/fillimage.hxx
index 815ec32..a62ebf6 100644
--- a/include/basebmp/fillimage.hxx
+++ b/include/basebmp/fillimage.hxx
@@ -30,7 +30,7 @@ template< class DestIterator, class DestAccessor, typename T >
void fillImage( DestIterator begin,
DestIterator end,
DestAccessor ad,
- T fillVal )
+ const T& fillVal )
{
const int width ( end.x - begin.x );
const int height( end.y - begin.y );
@@ -51,7 +51,7 @@ void fillImage( DestIterator begin,
template< class DestIterator, class DestAccessor, typename T >
inline void fillImage( vigra::triple<DestIterator,DestIterator,DestAccessor> const& src,
- T fillVal )
+ const T& fillVal )
{
fillImage(src.first,src.second,src.third,fillVal);
}
commit b78b5b1da560bf3a9332a3775d39276275d3709c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 14:06:33 2014 +0000
coverity#705810 Dereference before null check
Change-Id: I2fab51f08c461faaf4b88b4b7c0b887ba877226c
diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx
index 05c78c3..c4619f5 100644
--- a/extensions/source/bibliography/bibbeam.cxx
+++ b/extensions/source/bibliography/bibbeam.cxx
@@ -199,12 +199,9 @@ namespace bib
{
createToolBar();
createGridWin();
- if ( pDatMan )
- pDatMan->SetToolbar(pToolBar);
+ pDatMan->SetToolbar(pToolBar);
pGridWin->Show();
-
- if ( pDatMan )
- connectForm( pDatMan );
+ connectForm( pDatMan );
}
//---------------------------------------------------------------------
@@ -218,8 +215,7 @@ namespace bib
if ( pToolBar )
{
- if ( pDatMan )
- pDatMan->SetToolbar(0);
+ pDatMan->SetToolbar(0);
DELETEZ( pToolBar );
}
commit 40a8fecb58ebd55db5bb3108b838900b7d54d07f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:54:05 2014 +0000
coverity#705811 Dereference before null check
Change-Id: I275739819715f1537e80d621b19a88a6fdbab95b
diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx
index aafe50d..659fb40 100644
--- a/extensions/source/propctrlr/fontdialog.cxx
+++ b/extensions/source/propctrlr/fontdialog.cxx
@@ -565,13 +565,10 @@ namespace pcr
}
// delete the pool
- if (_rpPool)
- {
- _rpPool->ReleaseDefaults(sal_True);
- // the "true" means delete the items, too
- SfxItemPool::Free(_rpPool);
- _rpPool = NULL;
- }
+ _rpPool->ReleaseDefaults(sal_True);
+ // the "true" means delete the items, too
+ SfxItemPool::Free(_rpPool);
+ _rpPool = NULL;
// reset the defaults ptr
_rppDefaults = NULL;
commit d31a216b1f2f1c7bfc241f43b042b289da595647
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:52:45 2014 +0000
coverity#705814 Dereference before null check
Change-Id: Ib5eb5a7058098f7222b1597e60ddc84786403805
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
index 2acb2ef..f76f8a0 100644
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -875,11 +875,11 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper
if ( bHandleVbaEvents )
{
Reference< XEventAttacherManager > xMgr ( pElementMetaData->xInterface, UNO_QUERY );
- if ( xMgr.is() )
+ OInterfaceContainer* pIfcMgr = xMgr.is() ? dynamic_cast<OInterfaceContainer*>(xMgr.get()) : NULL;
+ if (pIfcMgr)
{
- OInterfaceContainer* pIfcMgr = dynamic_cast< OInterfaceContainer* >( xMgr.get() );
sal_Int32 nLen = pIfcMgr->getCount();
- for ( sal_Int32 i = 0; (i < nLen) && pIfcMgr ; ++i )
+ for (sal_Int32 i = 0; i < nLen; ++i)
{
// add fake events to the control at index i
pIfcMgr->impl_addVbEvents_nolck_nothrow( i );
commit 40c78e72656f5373c72bc725724071295c36fd62
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:48:06 2014 +0000
coverity#705872 Dereference before null check
Change-Id: Ia964362f757372862b3f2e5a0a9581171616251b
diff --git a/sd/source/ui/view/PresentationViewShellBase.cxx b/sd/source/ui/view/PresentationViewShellBase.cxx
index 05d5228..f0e1f52 100644
--- a/sd/source/ui/view/PresentationViewShellBase.cxx
+++ b/sd/source/ui/view/PresentationViewShellBase.cxx
@@ -69,18 +69,15 @@ PresentationViewShellBase::PresentationViewShellBase (
: ViewShellBase (_pFrame, pOldShell)
{
// Hide the automatic (non-context sensitive) tool bars.
- if (_pFrame!=NULL)
+ Reference<beans::XPropertySet> xFrameSet (
+ _pFrame->GetFrame().GetFrameInterface(),
+ UNO_QUERY);
+ if (xFrameSet.is())
{
- Reference<beans::XPropertySet> xFrameSet (
- _pFrame->GetFrame().GetFrameInterface(),
- UNO_QUERY);
- if (xFrameSet.is())
+ Reference<beans::XPropertySet> xLayouterSet(xFrameSet->getPropertyValue("LayoutManager"), UNO_QUERY);
+ if (xLayouterSet.is())
{
- Reference<beans::XPropertySet> xLayouterSet(xFrameSet->getPropertyValue("LayoutManager"), UNO_QUERY);
- if (xLayouterSet.is())
- {
- xLayouterSet->setPropertyValue("AutomaticToolbars", makeAny(sal_False));
- }
+ xLayouterSet->setPropertyValue("AutomaticToolbars", makeAny(sal_False));
}
}
}
commit 50d5bd90e007ecc9c826ce2499120e15cc4e3a5c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:44:22 2014 +0000
coverity#705892 Dereference before null check
Change-Id: I8dddc52e5b9af2f97bb41aec6e666d0ae0fcbbb5
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 445b0be..4c8e22c 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1593,7 +1593,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
sal::static_int_cast< sal_uIntPtr >(
xTnnl->getSomething( TransferableHelper::getUnoTunnelId() )));
if( pTrans )
- pTrans->CopyToClipboard( this ? GetEditWindow() : 0 );
+ pTrans->CopyToClipboard(GetEditWindow());
}
}
}
@@ -1601,7 +1601,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
case SID_PASTEOBJECT:
{
- TransferableDataHelper aData( TransferableDataHelper::CreateFromSystemClipboard(this ? GetEditWindow(): 0) );
+ TransferableDataHelper aData( TransferableDataHelper::CreateFromSystemClipboard(GetEditWindow()) );
uno::Reference < io::XInputStream > xStrm;
SotFormatStringId nId;
if( aData.GetTransferable().is() &&
commit b7180fa62c8a4b8414c55a9b8c278ef7400cd563
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:41:39 2014 +0000
coverity#705894 Dereference before null check
Change-Id: Ica2a7b9b53af2b3e17fa51f9b49762c01a1bfa90
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 72b77c5..bed8056 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -3776,7 +3776,7 @@ OUString SAL_CALL FmXEditCell::getText() throw( RuntimeException )
if ( m_pEditImplementation->GetControl().IsVisible() && m_pColumn->GetParent().getDisplaySynchron())
{
// if the display isn't sync with the cursor we can't ask the edit field
- LineEnd eLineEndFormat = m_pColumn ? getModelLineEndSetting( m_pColumn->getModel() ) : LINEEND_LF;
+ LineEnd eLineEndFormat = getModelLineEndSetting( m_pColumn->getModel() );
aText = m_pEditImplementation->GetText( eLineEndFormat );
}
else
commit ab615e29eba8557197f5f462d25dd18af47764d3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:40:26 2014 +0000
coverity#705895 Dereference before null check
Change-Id: I94e7507654e95b15338e1c467de59bf45b3077b0
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 1a8794d..3c66390 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -664,8 +664,7 @@ FmXFormShell::FmXFormShell( FmFormShell& _rShell, SfxViewFrame* _pViewFrame )
m_aMarkTimer.SetTimeout(100);
m_aMarkTimer.SetTimeoutHdl(LINK(this,FmXFormShell,OnTimeOut));
- if ( _pViewFrame )
- m_xAttachedFrame = _pViewFrame->GetFrame().GetFrameInterface();
+ m_xAttachedFrame = _pViewFrame->GetFrame().GetFrameInterface();
// to prevent deletion of this we acquire our refcounter once
::comphelper::increment(FmXFormShell_BASE::m_refCount);
commit d6546c5da8e267c67245fe18a5d6970e65f28f21
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:38:47 2014 +0000
coverity#705897 Dereference before null check
Change-Id: I947abe661c0e85a65d915422f9d800256167d639
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx
index 2f5d2cd..6c479b8 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -337,7 +337,7 @@ void SdrPageWindow::RedrawLayer(const SdrLayerID* pId, sdr::contact::ViewObjectC
// find out if we are painting the ControlLayer
const SdrLayerAdmin& rLayerAdmin = rModel.GetLayerAdmin();
const SdrLayerID nControlLayerId = rLayerAdmin.GetLayerID(rLayerAdmin.GetControlLayerName(), sal_False);
- const bool bControlLayerProcessingActive(pId && nControlLayerId == *pId);
+ const bool bControlLayerProcessingActive(nControlLayerId == *pId);
// create PaintInfoRec, use Rectangle only temporarily
const Region& rRegion = GetPaintWindow().GetRedrawRegion();
commit 0ae60c3c3580bcca595e0e6e277be4651076d3bd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:37:51 2014 +0000
coverity#705898 Dereference before null check
Change-Id: I16029411bd758914e87c7dc020ff8779218fefaa
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 87df053..be05624 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1228,11 +1228,14 @@ sal_Bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, Window* pWin)
}
if (bPostIt) {
Point aPixPos(rMEvt.GetPosPixel());
- Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
- if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
- if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
- if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
- if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
+ if (pWin)
+ {
+ Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
+ if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
+ if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
+ if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
+ if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
+ }
MouseEvent aMEvt(aPixPos,rMEvt.GetClicks(),rMEvt.GetMode(),
rMEvt.GetButtons(),rMEvt.GetModifier());
if (pTextEditOutlinerView->MouseButtonDown(aMEvt)) {
commit 3acf5f61b009160b89491d75ab1153798f653563
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:35:53 2014 +0000
coverity#705899 Dereference before null check
Change-Id: I6938bc2bbedbf830f8f35b875b5b071447b8d7d1
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index c2f824f..64b56e5 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1678,11 +1678,10 @@ void ImpTextframeHdl::CreateB2dIAObject()
500,
true); // allow animation; the Handle is not shown at text edit time
- pNewOverlayObject->setHittable(false);
-
// OVERLAYMANAGER
if(pNewOverlayObject)
{
+ pNewOverlayObject->setHittable(false);
xManager->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
}
commit baa57e5e50805a90519e2e480cfb3e0a6c2afee9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:33:32 2014 +0000
coverity#705900 Dereference before null check
Change-Id: I523aa738d4a15395f708aafa9edd266e5717421e
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 58955ef..00f28e3 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1454,7 +1454,7 @@ Reference< XInputStream > SdrGrafObj::getInputStream()
if( pModel )
{
// can be loaded from the original document stream later
- if( pGraphic->HasUserData() )
+ if( pGraphic && pGraphic->HasUserData() )
{
::comphelper::LifecycleProxy proxy;
xStream.set(
commit 40606287d0cc48dd5ff2d98a310a1b56ca5ed388
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:31:33 2014 +0000
coverity#705902 Dereference before null check
Change-Id: I3c23574125d039aa9671ef2d2fa6d2d91d3dd752
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index 1d15439..8e435a9 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -540,8 +540,8 @@ uno::Reference< awt::XControl > SdrUnoObj::GetUnoControl(const SdrView& _rView,
uno::Reference< awt::XControl > xControl;
SdrPageView* pPageView = _rView.GetSdrPageView();
- OSL_ENSURE( GetPage() == pPageView->GetPage(), "SdrUnoObj::GetUnoControl: This object is not displayed in that particular view!" );
- if ( GetPage() != pPageView->GetPage() )
+ OSL_ENSURE( pPageView && GetPage() == pPageView->GetPage(), "SdrUnoObj::GetUnoControl: This object is not displayed in that particular view!" );
+ if ( !pPageView || GetPage() != pPageView->GetPage() )
return NULL;
SdrPageWindow* pPageWindow = pPageView ? pPageView->FindPageWindow( _rOut ) : NULL;
commit e1bacc188b84ee12c36adda71f14532172f70599
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:30:09 2014 +0000
coverity#705906 Dereference before null check
Change-Id: I977f221a3ffc1b5cc9a07bd7462464f3d2160ca7
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 374f9a9..0bdfb4a 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -743,7 +743,6 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const
// #i13033#
// New mechanism to re-create the connections of cloned connectors
CloneList aCloneList;
- sal_uInt32 nCloneErrCnt(0);
for( sal_uInt32 i(0); i < aSdrObjects.size(); i++ )
{
@@ -765,42 +764,16 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const
pNeuObj->SetModel( pNeuMod );
}
- if( pNeuObj )
- {
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
- pNeuPag->InsertObject(pNeuObj,CONTAINER_APPEND,&aReason);
+ SdrInsertReason aReason(SDRREASON_VIEWCALL);
+ pNeuPag->InsertObject(pNeuObj,CONTAINER_APPEND,&aReason);
- // #i13033#
- aCloneList.AddPair(pObj, pNeuObj);
- }
- else
- nCloneErrCnt++;
+ // #i13033#
+ aCloneList.AddPair(pObj, pNeuObj);
}
// #i13033#
// New mechanism to re-create the connections of cloned connectors
aCloneList.CopyConnections();
-
- if(0L != nCloneErrCnt)
- {
-#ifdef DBG_UTIL
- OStringBuffer aStr("SdrExchangeView::GetMarkedObjModel(): Error when cloning ");
-
- if(nCloneErrCnt == 1)
- {
- aStr.append("a drawing object.");
- }
- else
- {
- aStr.append(static_cast<sal_Int32>(nCloneErrCnt));
- aStr.append(" drawing objects.");
- }
-
- aStr.append(" Not copying object connectors.");
-
- OSL_FAIL(aStr.getStr());
-#endif
- }
}
return pNeuMod;
}
commit 06025bccf8672e7bebb0ccac17097cceb82105d4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 28 13:27:33 2014 +0000
coverity#440748 Explicit null dereferenced
Change-Id: I86c08660f2c01618b661b90c84757a1f7f2b9b83
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index c7a2f53..88cdcab 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -321,6 +321,9 @@ SortedDynamicResultSet::impl_notify( const ListEvent& Changes )
}
}
+ if (!pCurSet)
+ return;
+
Any aRet;
try {
More information about the Libreoffice-commits
mailing list