summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-05-11 14:39:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-03-15 20:07:54 +0000
commit977a05ac719cd4876c1b65d9726615845edc99e9 (patch)
treee1a127a0ed069863a83c0db3752cdb7d8fd58377 /vcl
parent55dd17942cde0a1dd50fb534cff415adbc0b6a5e (diff)
Related: #i119125# Added MetaFloatTransparentAction handling...
...using primitive renderer Conflicts: svx/source/svdraw/svdedtv2.cxx svx/source/svdraw/svdfmtf.cxx svx/source/svdraw/svdfmtf.hxx svx/source/svdraw/svdograf.cxx Change-Id: I2223f86a63be80ecae91af0a6987ac587f07bc30
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/svgdata.hxx8
-rw-r--r--vcl/source/gdi/metaact.cxx3
-rw-r--r--vcl/source/gdi/svgdata.cxx35
3 files changed, 33 insertions, 13 deletions
diff --git a/vcl/inc/vcl/svgdata.hxx b/vcl/inc/vcl/svgdata.hxx
index dc4c9e5e8db2..eaba0041e6fe 100644
--- a/vcl/inc/vcl/svgdata.hxx
+++ b/vcl/inc/vcl/svgdata.hxx
@@ -35,6 +35,14 @@ typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2
typedef ::com::sun::star::uno::Sequence< Primitive2DReference > Primitive2DSequence;
//////////////////////////////////////////////////////////////////////////////
+// helper to convert any Primitive2DSequence to a good quality BitmapEx,
+// using default parameters and graphic::XPrimitive2DRenderer
+
+BitmapEx VCL_DLLPUBLIC convertPrimitive2DSequenceToBitmapEx(
+ const Primitive2DSequence& rSequence,
+ const basegfx::B2DRange& rTargetRange);
+
+//////////////////////////////////////////////////////////////////////////////
class VCL_DLLPUBLIC SvgData : private boost::noncopyable
{
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index f44e14f10c62..b63ca2d17d3f 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -3758,9 +3758,6 @@ MetaAction* MetaFloatTransparentAction::Clone()
void MetaFloatTransparentAction::Move( long nHorzMove, long nVertMove )
{
maPoint.Move( nHorzMove, nVertMove );
-
- // also neeed to move the content metafile
- maMtf.Move( nHorzMove, nVertMove );
}
// ------------------------------------------------------------------------
diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx
index e64646fecea6..9772e92221df 100644
--- a/vcl/source/gdi/svgdata.cxx
+++ b/vcl/source/gdi/svgdata.cxx
@@ -35,11 +35,13 @@ using namespace ::com::sun::star;
//////////////////////////////////////////////////////////////////////////////
-void SvgData::ensureReplacement()
+BitmapEx VCL_DLLPUBLIC convertPrimitive2DSequenceToBitmapEx(
+ const Primitive2DSequence& rSequence,
+ const basegfx::B2DRange& rTargetRange)
{
- ensureSequenceAndRange();
+ BitmapEx aRetval;
- if(maReplacement.IsEmpty() && maSequence.hasElements())
+ if(rSequence.hasElements())
{
// create replacement graphic from maSequence
// create XPrimitive2DRenderer
@@ -53,20 +55,19 @@ void SvgData::ensureReplacement()
if(xPrimitive2DRenderer.is())
{
uno::Sequence< beans::PropertyValue > aViewParameters;
- const basegfx::B2DRange& rRange(getRange());
geometry::RealRectangle2D aRealRect;
- aRealRect.X1 = rRange.getMinX();
- aRealRect.Y1 = rRange.getMinY();
- aRealRect.X2 = rRange.getMaxX();
- aRealRect.Y2 = rRange.getMaxY();
+ aRealRect.X1 = rTargetRange.getMinX();
+ aRealRect.Y1 = rTargetRange.getMinY();
+ aRealRect.X2 = rTargetRange.getMaxX();
+ aRealRect.Y2 = rTargetRange.getMaxY();
// get system DPI
const Size aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), MAP_INCH));
const uno::Reference< rendering::XBitmap > xBitmap(
xPrimitive2DRenderer->rasterize(
- maSequence,
+ rSequence,
aViewParameters,
aDPI.getWidth(),
aDPI.getHeight(),
@@ -79,7 +80,7 @@ void SvgData::ensureReplacement()
if(xIntBmp.is())
{
- maReplacement = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
+ aRetval = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
}
}
}
@@ -89,6 +90,20 @@ void SvgData::ensureReplacement()
OSL_ENSURE(sal_False, "Got no graphic::XPrimitive2DRenderer (!)" );
}
}
+
+ return aRetval;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+void SvgData::ensureReplacement()
+{
+ ensureSequenceAndRange();
+
+ if(maReplacement.IsEmpty() && maSequence.hasElements())
+ {
+ maReplacement = convertPrimitive2DSequenceToBitmapEx(maSequence, getRange());
+ }
}
//////////////////////////////////////////////////////////////////////////////