summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx13
-rw-r--r--sc/source/ui/inc/gridwin.hxx7
-rw-r--r--sc/source/ui/view/gridwin5.cxx5
3 files changed, 23 insertions, 2 deletions
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 0c941b25788c..2043ff90e49d 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -82,6 +82,7 @@ using namespace ::com::sun::star;
#include "globstr.hrc"
#include "drawview.hxx"
#include "markdata.hxx"
+#include "gridwin.hxx"
namespace {
@@ -544,11 +545,19 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
ScDocument* pScDoc = pScDocSh->GetDocument();
bool bUndo (pScDoc->IsUndoEnabled());
- OpenGLWindow* pChildWindow = new OpenGLWindow(pData->GetActiveWin());
+ Window* pParentWindow = pData->GetActiveWin();
+ ScGridWindow* pGridWindow = dynamic_cast<ScGridWindow*>(pParentWindow);
+ if(pGridWindow)
+ {
+ pGridWindow->AddChildWindow(pGridWindow);
+ }
+ else
+ SAL_WARN("sc", "not a grid window. Youare in serious trouble");
+ OpenGLWindow* pChildWindow = new OpenGLWindow(pParentWindow);
Size aWindowSize = pChildWindow->LogicToPixel( aSize, MapMode( MAP_100TH_MM ) );
pChildWindow->SetSizePixel(aWindowSize);
Wallpaper aBackground = pChildWindow->GetBackground();
- aBackground.SetColor(COL_RED);
+ aBackground.SetColor(COL_BLUE);
pChildWindow->SetBackground(aBackground);
pChildWindow->Show();
uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider( xChartModel, uno::UNO_QUERY_THROW );
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 63e930b28a8b..5170e2567b0d 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -32,6 +32,7 @@
#include <boost/scoped_ptr.hpp>
#include <boost/unordered_map.hpp>
#include <boost/ptr_container/ptr_map.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
namespace editeng {
struct MisspellRanges;
@@ -129,6 +130,7 @@ class ScGridWindow : public Window, public DropTargetHelper, public DragSourceHe
VisibleRange maVisibleRange;
boost::scoped_ptr<sc::SpellCheckContext> mpSpellCheckCxt;
+ boost::ptr_vector<Window> maChildWindows;
ScViewData* pViewData;
ScSplitPos eWhich;
@@ -409,6 +411,11 @@ public:
void UpdateShrinkOverlay();
void UpdateAllOverlays();
+ /**
+ * Takes ownership of the window
+ */
+ void AddChildWindow(Window* pChildWindow);
+
protected:
// #114409#
void ImpCreateOverlayObjects();
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 404ca59652d8..798d34aafb71 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -474,4 +474,9 @@ void ScGridWindow::SwitchView()
}
}
+void ScGridWindow::AddChildWindow(Window* pWindow)
+{
+ maChildWindows.push_back(pWindow);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */