diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/drawfunc/fuins2.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 183740dc03d2..dde50891601d 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -31,6 +31,8 @@ #include <svx/pfiledlg.hxx> #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> +#include <vcl/syschild.hxx> +#include <vcl/sysdata.hxx> #include <svl/urihelper.hxx> #include <unotools/moduleoptions.hxx> #include <svtools/insdlg.hxx> @@ -53,6 +55,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/chart2/data/XDataProvider.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp> +#include <com/sun/star/chart2/X3DChartWindowProvider.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -541,6 +544,17 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* ScDocument* pScDoc = pScDocSh->GetDocument(); bool bUndo (pScDoc->IsUndoEnabled()); + SystemChildWindow* pChildWindow = new SystemChildWindow(pData->GetActiveWin(), 0); + Size aWindowSize = pChildWindow->LogicToPixel( aSize, MapMode( MAP_100TH_MM ) ); + pChildWindow->SetSizePixel(aWindowSize); + Wallpaper aBackground = pChildWindow->GetBackground(); + aBackground.SetColor(COL_RED); + pChildWindow->SetBackground(aBackground); + pChildWindow->Show(); + uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider( xChartModel, uno::UNO_QUERY_THROW ); + sal_uInt64 nWindowPtr = reinterpret_cast<sal_uInt64>(pChildWindow); + x3DWindowProvider->setWindow(nWindowPtr); + if( pReqArgs ) { const SfxPoolItem* pItem; @@ -615,6 +629,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* // get chart position (from window size and data range) aStart = pViewSh->GetChartInsertPos( aSize, aPositionRange ); } + pChildWindow->SetPosPixel(pChildWindow->LogicToPixel(aStart, MapMode(MAP_100TH_MM))); Rectangle aRect (aStart, aSize); SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect); @@ -709,6 +724,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* sal_Int16 nDialogRet = xDialog->execute(); if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL ) { + delete pWindow; // leave OLE inplace mode and unmark OSL_ASSERT( pViewShell ); OSL_ASSERT( pView ); |