summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx2
-rw-r--r--drawinglayer/source/primitive2d/chartprimitive2d.cxx7
-rw-r--r--svx/inc/svx/svdoole2.hxx6
-rw-r--r--svx/source/editeng/editdoc.cxx2
-rw-r--r--svx/source/editeng/editdoc.hxx13
-rw-r--r--svx/source/editeng/editdoc2.cxx50
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx287
-rw-r--r--svx/source/svdraw/svdoole2.cxx78
8 files changed, 250 insertions, 195 deletions
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
index 2decc0bed799..95c53347debb 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
@@ -67,6 +67,8 @@ namespace drawinglayer
// provide unique ID
DeclPrimitrive2DIDBlock()
+
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/chartprimitive2d.cxx b/drawinglayer/source/primitive2d/chartprimitive2d.cxx
index 6086b54000a1..3df6464f8aeb 100644
--- a/drawinglayer/source/primitive2d/chartprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/chartprimitive2d.cxx
@@ -76,6 +76,13 @@ namespace drawinglayer
// provide unique ID
ImplPrimitrive2DIDBlock(ChartPrimitive2D, PRIMITIVE2D_ID_CHARTPRIMITIVE2D)
+ basegfx::B2DRange ChartPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
+ aRetval.transform(getTransformation());
+ return aRetval;
+ }
+
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/svx/inc/svx/svdoole2.hxx b/svx/inc/svx/svdoole2.hxx
index 50b3ce3a95bd..605e9463bdab 100644
--- a/svx/inc/svx/svdoole2.hxx
+++ b/svx/inc/svx/svdoole2.hxx
@@ -184,11 +184,7 @@ public:
sal_Bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize );
sal_Bool AddOwnLightClient();
- // helper for ViewObjectContactOfSdrOle2Obj. As long as the OLE stuff is not
- // reworked, the things the old Do_PaintObject did at this object need to be
- // emulated. Isolated those things here. Return value tells if the object
- // is active
- bool executeOldDoPaintPreparations(SdrPageView* pPageVew) const;
+ bool executeOldDoPaintPreparations(SdrPageView* pPageVew) const; //remove me with the next incompatible build
// handy to get the empty replacement bitmap without accessing all the old stuff
Bitmap GetEmtyOLEReplacementBitmap() const;
diff --git a/svx/source/editeng/editdoc.cxx b/svx/source/editeng/editdoc.cxx
index c90de8eb5ce0..acf278e2d01f 100644
--- a/svx/source/editeng/editdoc.cxx
+++ b/svx/source/editeng/editdoc.cxx
@@ -258,7 +258,7 @@ USHORT aV5Map[] = {
4035, 4036, 4037, 4038
};
-SV_IMPL_PTRARR( ContentList, ContentNode* );
+SV_IMPL_PTRARR( DummyContentList, ContentNode* );
SV_IMPL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo );
SV_IMPL_VARARR( WritingDirectionInfos, WritingDirectionInfo );
// SV_IMPL_VARARR( ExtraCharInfos, ExtraCharInfo );
diff --git a/svx/source/editeng/editdoc.hxx b/svx/source/editeng/editdoc.hxx
index dd9662d366e5..872f19485ae6 100644
--- a/svx/source/editeng/editdoc.hxx
+++ b/svx/source/editeng/editdoc.hxx
@@ -285,7 +285,15 @@ public:
};
typedef ContentNode* ContentNodePtr;
-SV_DECL_PTRARR( ContentList, ContentNodePtr, 0, 4 )
+SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0, 4 )
+
+class ContentList : public DummyContentList
+{
+ USHORT nLastCache;
+public:
+ ContentList() : DummyContentList( 0, 4 ), nLastCache(0) {}
+ USHORT GetPos( const ContentNodePtr &rPtr ) const;
+};
// -------------------------------------------------------------------------
// class EditPaM
@@ -612,6 +620,7 @@ SV_DECL_PTRARR( DummyParaPortionList, ParaPortionPtr, 0, 4 )
// -------------------------------------------------------------------------
class ParaPortionList : public DummyParaPortionList
{
+ USHORT nLastCache;
public:
ParaPortionList();
~ParaPortionList();
@@ -623,6 +632,8 @@ public:
inline ParaPortion* SaveGetObject( USHORT nPos ) const
{ return ( nPos < Count() ) ? GetObject( nPos ) : 0; }
+ USHORT GetPos( const ParaPortionPtr &rPtr ) const;
+
// temporaer:
void DbgCheck( EditDoc& rDoc );
};
diff --git a/svx/source/editeng/editdoc2.cxx b/svx/source/editeng/editdoc2.cxx
index 2b0967e173a8..030dfb1ad615 100644
--- a/svx/source/editeng/editdoc2.cxx
+++ b/svx/source/editeng/editdoc2.cxx
@@ -324,10 +324,42 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin
DBG_ASSERT( aLineList[ aLineList.Count()-1 ]->GetEnd() == pNode->Len(), "CorrectLines: Ende stimmt nicht!" );
}
- // -------------------------------------------------------------------------
+// Shared reverse lookup acceleration pieces ...
+
+static USHORT FastGetPos( const VoidPtr *pPtrArray, USHORT nPtrArrayLen,
+ VoidPtr pPtr, USHORT &rLastPos )
+{
+ // Through certain filter code-paths we do a lot of appends, which in
+ // turn call GetPos - creating some N^2 nightmares. If we have a
+ // non-trivially large list, do a few checks from the end first.
+ if( rLastPos > 16 )
+ {
+ USHORT nEnd;
+ if (rLastPos > nPtrArrayLen - 2)
+ nEnd = nPtrArrayLen;
+ else
+ nEnd = rLastPos + 2;
+
+ for( USHORT nIdx = rLastPos - 2; nIdx < nEnd; nIdx++ )
+ {
+ if( pPtrArray[ nIdx ] == pPtr )
+ {
+ rLastPos = nIdx;
+ return nIdx;
+ }
+ }
+ }
+ // The world's lamest linear search from svarray ...
+ for( USHORT nIdx = 0; nIdx < nPtrArrayLen; nIdx++ )
+ if (pPtrArray[ nIdx ] == pPtr )
+ return rLastPos = nIdx;
+ return USHRT_MAX;
+}
+
+// -------------------------------------------------------------------------
// class ParaPortionList
// -------------------------------------------------------------------------
-ParaPortionList::ParaPortionList()
+ParaPortionList::ParaPortionList() : nLastCache( 0 )
{
}
@@ -336,6 +368,20 @@ ParaPortionList::~ParaPortionList()
Reset();
}
+USHORT ParaPortionList::GetPos( const ParaPortionPtr &rPtr ) const
+{
+ return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ),
+ Count(), static_cast<VoidPtr>( rPtr ),
+ ((ParaPortionList *)this)->nLastCache );
+}
+
+USHORT ContentList::GetPos( const ContentNodePtr &rPtr ) const
+{
+ return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ),
+ Count(), static_cast<VoidPtr>( rPtr ),
+ ((ContentList *)this)->nLastCache );
+}
+
void ParaPortionList::Reset()
{
for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
index d5681c60463e..6145e0acc301 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
@@ -37,10 +37,13 @@
#include <svx/sdr/contact/viewcontactofsdrole2obj.hxx>
#include <svx/svdoole2.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
+#include <svx/svdview.hxx>
#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <com/sun/star/embed/EmbedMisc.hpp>
+#include <com/sun/star/embed/EmbedStates.hpp>
//////////////////////////////////////////////////////////////////////////////
@@ -60,136 +63,194 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfSdrOle2Obj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
{
// this method is overloaded to do some things the old SdrOle2Obj::DoPaintObject did.
- // In the future, some of these may be solved different, but ATM try to stay compatible
- // with the old behaviour
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- const SdrOle2Obj& rSdrOle2 = getSdrOle2Object();
- const bool bIsActive(rSdrOle2.executeOldDoPaintPreparations(GetObjectContact().TryToGetSdrPageView()));
- const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect());
- const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom());
-
- // create object transform
- basegfx::B2DHomMatrix aObjectTransform;
- aObjectTransform.set(0, 0, aObjectRange.getWidth());
- aObjectTransform.set(1, 1, aObjectRange.getHeight());
- aObjectTransform.set(0, 2, aObjectRange.getMinX());
- aObjectTransform.set(1, 2, aObjectRange.getMinY());
-
- if(GetObjectContact().isDrawModeHighContrast())
- {
- // directly call at the corresponding VC and force OLE Graphic to HighContrast
- const ViewContactOfSdrOle2Obj& rVC = static_cast< const ViewContactOfSdrOle2Obj& >(GetViewContact());
- Graphic* pOLEHighContrastGraphic = rSdrOle2.getEmbeddedObjectRef().GetHCGraphic();
-
- if(pOLEHighContrastGraphic)
+ // In the future, some of these may be solved different, but ATM try to stay compatible
+ // with the old behaviour
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ const SdrOle2Obj& rSdrOle2 = getSdrOle2Object();
+ sal_Int32 nState = -1;
{
- // there is a graphic set, use it
- xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(*pOLEHighContrastGraphic, rSdrOle2.IsEmptyPresObj());
+ const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef();
+ if ( xObjRef.is() )
+ nState = xObjRef->getCurrentState();
}
- else
- {
- // no HighContrast graphic, use default empty OLE bitmap
- const Bitmap aEmptyOLEBitmap(rSdrOle2.GetEmtyOLEReplacementBitmap());
- const Graphic aEmtyOLEGraphic(aEmptyOLEBitmap);
+ const bool bIsOutplaceActive = (nState == embed::EmbedStates::ACTIVE);
+ const bool bIsInplaceActive = (nState == embed::EmbedStates::INPLACE_ACTIVE) || (nState == embed::EmbedStates::UI_ACTIVE);
+ const bool bIsChart = rSdrOle2.IsChart();
- xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(aEmtyOLEGraphic, true);
- }
- }
- else
- {
- // call parent which will use the regular createViewIndependentPrimitive2DSequence
- // at the corresponding VC
- xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo);
- }
-
- if(rSdrOle2.getEmbeddedObjectRef().IsChart())
- {
- // for chart, to not lose the current better quality visualisation which
- // uses a direct paint, use a primtive wrapper for that exceptional case. The renderers
- // will then ATM paint it to an OutputDevice directly.
- // In later versions this should be replaced by getting the Primitive2DSequnce from
- // the chart and using it.
- // to be able to render something in non-VCL using renderers, the wrapper is a
- // GroupPrimitive2D which automatically decomposes to the already created Metafile
- // content.
- // For being completely compatible, ATM Window and VDEV PrettyPrinting is suppressed.
- // It works in the VCL renderers, though. So for activating again with VCL primitive
- // renderers, change conditions here.
-
- // determine if embedding and PrettyPrinting shall be done at all
- uno::Reference< frame::XModel > xChartModel;
- bool bDoChartPrettyPrinting(true);
- static bool bPrettyPrintingForBitmaps(false);
-
- // the original ChartPrettyPainter does not do it for Window
- if(!bPrettyPrintingForBitmaps && bDoChartPrettyPrinting && GetObjectContact().isOutputToWindow())
+ bool bDone = false;
+ if( !bDone && bIsInplaceActive )
{
- bDoChartPrettyPrinting = false;
+ if( !GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile() )
+ {
+ bDone = true;
+ //no need to create a primitive sequence here as the OLE object does render itself
+ //in case of charts the superfluous creation of a metafile is strongly performance relevant!
+ }
}
- // the original ChartPrettyPainter does not do it for VDEV
- if(!bPrettyPrintingForBitmaps && bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice())
+ if( !bDone )
{
- if(GetObjectContact().isOutputToPDFFile())
+ const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect());
+ const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom());
+
+ // create object transform
+ basegfx::B2DHomMatrix aObjectTransform;
+ aObjectTransform.set(0, 0, aObjectRange.getWidth());
+ aObjectTransform.set(1, 1, aObjectRange.getHeight());
+ aObjectTransform.set(0, 2, aObjectRange.getMinX());
+ aObjectTransform.set(1, 2, aObjectRange.getMinY());
+
+ if(bIsChart)
{
- // #i97982#
- // For PDF files, allow PrettyPrinting
+ //charts must be painted resolution dependent!! #i82893#, #i75867#
+
+ // for chart, to not lose the current better quality visualisation which
+ // uses a direct paint, use a primtive wrapper for that exceptional case. The renderers
+ // will then ATM paint it to an OutputDevice directly.
+ // In later versions this should be replaced by getting the Primitive2DSequnce from
+ // the chart and using it.
+ // to be able to render something in non-VCL using renderers, the wrapper is a
+ // GroupPrimitive2D which automatically decomposes to the already created Metafile
+ // content.
+ // For being completely compatible, ATM Window and VDEV PrettyPrinting is suppressed.
+ // It works in the VCL renderers, though. So for activating again with VCL primitive
+ // renderers, change conditions here.
+
+ // determine if embedding and PrettyPrinting shall be done at all
+ uno::Reference< frame::XModel > xChartModel;
+ bool bDoChartPrettyPrinting(true);
+
+ // the original ChartPrettyPainter does not do it for Window
+ if(bDoChartPrettyPrinting && GetObjectContact().isOutputToWindow())
+ {
+ bDoChartPrettyPrinting = false;
+ }
+
+ // the original ChartPrettyPainter does not do it for VDEV
+ if(bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice())
+ {
+ if(GetObjectContact().isOutputToPDFFile())
+ {
+ // #i97982#
+ // For PDF files, allow PrettyPrinting
+ }
+ else
+ {
+ bDoChartPrettyPrinting = false;
+ }
+ }
+
+ // the chart model is needed. Check if it's available
+ if(bDoChartPrettyPrinting)
+ {
+ // get chart model
+ xChartModel = rSdrOle2.getXModel();
+
+ if(!xChartModel.is())
+ {
+ bDoChartPrettyPrinting = false;
+ }
+ }
+
+ if(bDoChartPrettyPrinting)
+ {
+ // embed MetaFile data in a specialized Wrapper Primitive which holds also the ChartModel needed
+ // for PrettyPrinting
+ const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ChartPrimitive2D(
+ xChartModel, aObjectTransform, xRetval));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ bDone = true;
+ }
}
- else
+
+ if( !bDone )
{
- bDoChartPrettyPrinting = false;
- }
- }
+ //old stuff that should be reworked
+ {
+ //if no replacement image is available load the OLE object
+ if(!rSdrOle2.GetGraphic()) //try to fetch the metafile - this can lead to the actual creation of the metafile what can be extremely expensive (e.g. for big charts)!!! #i101925#
+ {
+ // try to create embedded object
+ rSdrOle2.GetObjRef(); //this loads the OLE object if it is not loaded already
+ }
+ const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef();
+ if(xObjRef.is())
+ {
+ const sal_Int64 nMiscStatus(xObjRef->getStatus(rSdrOle2.GetAspect()));
- // the chart model is needed. Check if it's available
- if(bDoChartPrettyPrinting)
- {
- // get chart model
- xChartModel = rSdrOle2.getXModel();
+ // this hack (to change model data during PAINT argh(!)) should be reworked
+ if(!rSdrOle2.IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE))
+ {
+ const_cast< SdrOle2Obj* >(&rSdrOle2)->SetResizeProtect(true);
+ }
+
+ SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
+ if(pPageView && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
+ {
+ // connect plugin object
+ pPageView->GetView().DoConnect(const_cast< SdrOle2Obj* >(&rSdrOle2));
+ }
+ }
+ }//end old stuff to rework
+
+ if(GetObjectContact().isDrawModeHighContrast())
+ {
+ // directly call at the corresponding VC and force OLE Graphic to HighContrast
+ const ViewContactOfSdrOle2Obj& rVC = static_cast< const ViewContactOfSdrOle2Obj& >(GetViewContact());
+ Graphic* pOLEHighContrastGraphic = rSdrOle2.getEmbeddedObjectRef().GetHCGraphic();
+
+ if(pOLEHighContrastGraphic)
+ {
+ // there is a graphic set, use it
+ xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(*pOLEHighContrastGraphic, rSdrOle2.IsEmptyPresObj());
+ }
+ else
+ {
+ // no HighContrast graphic, use default empty OLE bitmap
+ const Bitmap aEmptyOLEBitmap(rSdrOle2.GetEmtyOLEReplacementBitmap());
+ const Graphic aEmtyOLEGraphic(aEmptyOLEBitmap);
+
+ xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(aEmtyOLEGraphic, true);
+ }
+ }
+ else
+ {
+ // call parent which will use the regular createViewIndependentPrimitive2DSequence
+ // at the corresponding VC
+ xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo);
+ }
- if(!xChartModel.is())
- {
- bDoChartPrettyPrinting = false;
}
- }
- if(bDoChartPrettyPrinting)
- {
- // embed MetaFile data in a specialized Wrapper Primitive which holds also the ChartModel needed
- // for PrettyPrinting
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ChartPrimitive2D(
- xChartModel, aObjectTransform, xRetval));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
+ if(bIsOutplaceActive)
+ {
+ // do not shade when printing or PDF exporting
+ if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
+ {
+ // shade the representation if the object is activated outplace
+ basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aObjectOutline.transform(aObjectTransform);
+
+ // Use a FillHatchPrimitive2D with necessary attributes
+ const drawinglayer::attribute::FillHatchAttribute aFillHatch(
+ drawinglayer::attribute::HATCHSTYLE_SINGLE, // single hatch
+ 125.0, // 1.25 mm
+ 45.0 * F_PI180, // 45 degree diagonal
+ Color(COL_BLACK).getBColor(), // black color
+ false); // no filling
+
+ const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D(
+ basegfx::B2DPolyPolygon(aObjectOutline),
+ Color(COL_BLACK).getBColor(),
+ aFillHatch));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReference);
+ }
+ }
- if(bIsActive)
- {
- // do not shade when printing or PDF exporting
- if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
- {
- // shade the representation if the object is activated outplace
- basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
- aObjectOutline.transform(aObjectTransform);
-
- // Use a FillHatchPrimitive2D with necessary attributes
- const drawinglayer::attribute::FillHatchAttribute aFillHatch(
- drawinglayer::attribute::HATCHSTYLE_SINGLE, // single hatch
- 125.0, // 1.25 mm
- 45.0 * F_PI180, // 45 degree diagonal
- Color(COL_BLACK).getBColor(), // black color
- false); // no filling
-
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D(
- basegfx::B2DPolyPolygon(aObjectOutline),
- Color(COL_BLACK).getBColor(),
- aFillHatch));
-
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReference);
}
- }
- return xRetval;
+ return xRetval;
}
ViewObjectContactOfSdrOle2Obj::ViewObjectContactOfSdrOle2Obj(ObjectContact& rObjectContact, ViewContact& rViewContact)
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 5ee97db53a9c..01ef392e941a 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -2208,79 +2208,11 @@ sal_Bool SdrOle2Obj::AddOwnLightClient()
//////////////////////////////////////////////////////////////////////////////
-bool SdrOle2Obj::executeOldDoPaintPreparations(SdrPageView* pPageVew) const
-{
- bool bIsActive(false);
- // copy of the old SdrOle2Obj::Do_PaintObject stuff which evtl. needs
- // to be emulated.
-
- // //charts must be painted resolution dependent!! #i82893#, #i75867#
- // if( ChartPrettyPainter::IsChart(xObjRef) && ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( rOut.GetOutDev() ) )
- // if( !rOut.GetOffset().nA && !rOut.GetOffset().nB )//offset!=0 is the scenario 'copy -> past special gdi metafile' which does not work with direct painting so far
- // if( ChartPrettyPainter::DoPrettyPaintChart( this->getXModel(), rOut.GetOutDev(), aRect ) )
- // return bOk;
- //
- // if( !GetGraphic() )
- // ( (SdrOle2Obj*) this)->GetObjRef_Impl(); // try to create embedded object
-
- // this one can be used directly, just reformatting a bit
- if(!GetGraphic())
- {
- // try to create embedded object
- const_cast< SdrOle2Obj* >(this)->GetObjRef_Impl();
- }
-
- // if ( xObjRef.is() )
- // {
- // sal_Int64 nMiscStatus = xObjRef->getStatus( GetAspect() );
- // if( !bSizProt && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE) )
- // ( (SdrOle2Obj*) this)->bSizProt = TRUE;
-
- // old stuff which relies on xObjRef and nMiscStatus
- if(xObjRef.is())
- {
- const sal_Int64 nMiscStatus(xObjRef->getStatus(GetAspect()));
-
- // this hack (to change model data during PAINT argh(!)) can also be reproduced
- // directly
- if(!IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE))
- {
- const_cast< SdrOle2Obj* >(this)->SetResizeProtect(true);
- }
-
- // OutputDevice* pOut = rOut.GetOutDev();
- //
- // //TODO/LATER: currently it's not possible to compare the windows, the XOutDev contains a virtual device
- // sal_Int32 nState = xObjRef->getCurrentState();
- // //if ( ( nState != embed::EmbedStates::INPLACE_ACTIVE && nState != embed::EmbedStates::UI_ACTIVE ) ||
- // // pModel && SfxInPlaceClient::GetActiveWindow( pModel->GetPersist(), xObjRef ) != pOut )
- // {
- // if ( nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
- // {
- // // PlugIn-Objekt connecten
- // if (rInfoRec.pPV!=NULL)
- // {
- // SdrOle2Obj* pOle2Obj = (SdrOle2Obj*) this;
- // SdrView* pSdrView = (SdrView*) &rInfoRec.pPV->GetView();
- // pSdrView->DoConnect(pOle2Obj);
- // }
- // }
-
- // nState is used in old paint to see if OLE is activated and to do
- // a different paint
- const sal_Int32 nState(xObjRef->getCurrentState());
-
- bIsActive = (nState == embed::EmbedStates::ACTIVE);
-
- // for this one i need the view.
- if(pPageVew && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
- {
- // connect plugin object
- pPageVew->GetView().DoConnect(const_cast< SdrOle2Obj* >(this));
- }
- }
-
- return bIsActive;
+bool SdrOle2Obj::executeOldDoPaintPreparations(SdrPageView* /*pPageVew*/) const
+{
+ //#i101925# moved this stuff to method ViewObjectContactOfSdrOle2Obj::createPrimitive2DSequence and reorganized it further to avoid superfluous metafile creation for charts
+ //this method can be removed with the next incompatible build
+ return false;
}
Bitmap SdrOle2Obj::GetEmtyOLEReplacementBitmap() const