summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-05-11 14:39:29 +0000
committerArmin Le Grand <alg@apache.org>2012-05-11 14:39:29 +0000
commitb32d15ad6740b5aeb02fd3be9304396014d184bd (patch)
treebb8ee0776ca0ad65a2ede939807fbc90e3c8c554 /vcl/source/gdi
parent30c6421fe7ab8f6397bb30872a3ebcc6f853d7d4 (diff)
#119125# Added MetaFloatTransparentAction handling using primitive renderer
Notes
Notes: merged as: 977a05ac719cd4876c1b65d9726615845edc99e9
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/metaact.cxx3
-rw-r--r--vcl/source/gdi/svgdata.cxx35
2 files changed, 25 insertions, 13 deletions
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index c985ba69809a..df8967fd683d 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -3816,9 +3816,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 4e7ce36a4a4e..78e36c265d75 100644
--- a/vcl/source/gdi/svgdata.cxx
+++ b/vcl/source/gdi/svgdata.cxx
@@ -39,11 +39,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
@@ -57,20 +59,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(),
@@ -83,7 +84,7 @@ void SvgData::ensureReplacement()
if(xIntBmp.is())
{
- maReplacement = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
+ aRetval = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
}
}
}
@@ -93,6 +94,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());
+ }
}
//////////////////////////////////////////////////////////////////////////////