diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2009-03-15 14:43:10 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2009-03-15 14:43:10 +0000 |
commit | 676528ac3e3fd3d6fc56d1b4e6dcbe346353c51a (patch) | |
tree | f9c93479acc6ad32bdae3567307c1338d9f0056b /svx | |
parent | f810850b20bffd93db8e15c2d9f57d3694e76761 (diff) |
CWS-TOOLING: integrate CWS aw064
2009-02-10 17:39:02 +0100 aw r267569 : #i98314# adapted texture size to object size
2009-02-05 15:26:16 +0100 aw r267427 : #i98532# added mirroring of redline info when RTL is on
2009-02-04 16:31:27 +0100 aw r267392 : #i98314# corrected texturing for E3dPolygonObj's primitive creation
2009-02-02 17:58:49 +0100 aw r267285 : #i98295# corrected orientation of E3dPolygonObj's polygon definition on it's way to prmitives
2009-02-02 17:57:32 +0100 aw r267283 : #i98295# optimized SdrPolyPolygonPrimitive3D::createLocalDecomposition data flow
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sdr/contact/viewcontactofe3dpolygon.cxx | 53 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 11 |
2 files changed, 61 insertions, 3 deletions
diff --git a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx index 5c84da834f..61d5cc78cb 100644 --- a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx @@ -38,6 +38,7 @@ #include <svx/sdr/primitive2d/sdrattributecreator.hxx> #include <svx/sdr/primitive3d/sdrattributecreator3d.hxx> #include <basegfx/polygon/b3dpolygon.hxx> +#include <basegfx/polygon/b3dpolypolygontools.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -120,11 +121,57 @@ namespace sdr if(bTexture) { - const basegfx::B2DRange aTxRange(basegfx::tools::getRange(aPolyTexture2D)); - aTextureSize.setX(aTxRange.getWidth()); - aTextureSize.setY(aTxRange.getHeight()); + // #i98314# + // create texture size from object's size + const basegfx::B3DRange aObjectRange(basegfx::tools::getRange(aPolyPolygon3D)); + + double fWidth(0.0); + double fHeight(0.0); + + // this is a polygon object, so Width/Height and/or Depth may be zero (e.g. left + // wall of chart). Take this into account + if(basegfx::fTools::equalZero(aObjectRange.getWidth())) + { + // width is zero, use height and depth + fWidth = aObjectRange.getHeight(); + fHeight = aObjectRange.getDepth(); + } + else if(basegfx::fTools::equalZero(aObjectRange.getHeight())) + { + // height is zero, use width and depth + fWidth = aObjectRange.getWidth(); + fHeight = aObjectRange.getDepth(); + } + else + { + // use width and height + fWidth = aObjectRange.getWidth(); + fHeight = aObjectRange.getHeight(); + } + + if(basegfx::fTools::lessOrEqual(fWidth, 0.0) ||basegfx::fTools::lessOrEqual(fHeight, 0.0)) + { + // no texture; fallback to very small size + aTextureSize.setX(0.01); + aTextureSize.setY(0.01); + } + else + { + aTextureSize.setX(fWidth); + aTextureSize.setY(fHeight); + } } + // #i98295# + // unfortunately, this SdrObject type which allows a free 3d geometry definition was defined + // wrong topologically in relation to it's plane normal and 3D visibility when it was invented + // a long time ago. Since the API allows creation of this SDrObject type, it is not possible to + // simply change this definition. Only the chart should use it, and at least this object type + // only exists at Runtime (is not saved and/or loaded in any FileFormat). Still someone external + // may have used it in it's API. To not risk wrong 3D lightings, i have to switch the orientation + // of the polygon here + aPolyPolygon3D.flip(); + // create primitive and add const basegfx::B3DHomMatrix aWorldTransform; const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrPolyPolygonPrimitive3D( diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 5d1fb9b3d1..b894b19073 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -435,6 +435,17 @@ namespace if(!basegfx::fTools::equal(fStart, fEnd)) { + if(rInfo.IsRTL()) + { + // #i98523# + // When the portion is RTL, mirror the redlining using the + // full portion width + const double fTextWidth(aDXArray[aDXArray.size() - 1]); + + fStart = fTextWidth - fStart; + fEnd = fTextWidth - fEnd; + } + maTextPortionPrimitives.push_back(new drawinglayer::primitive2d::WrongSpellPrimitive2D( aNewTransform, fStart, |