summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdoole2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw/svdoole2.cxx')
-rw-r--r--svx/source/svdraw/svdoole2.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index e3656a4ffa84..034f5b8b8b08 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -87,6 +87,8 @@
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <editeng/outlobj.hxx>
+#include <svx/svdpage.hxx>
+
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -1449,6 +1451,26 @@ void SdrOle2Obj::SetPage(SdrPage* pNewPage)
if (bRemove && mpImpl->mbConnected )
Disconnect();
+ if(!pModel && !GetStyleSheet() && pNewPage->GetModel())
+ {
+ // #i119287# Set default StyleSheet for SdrGrafObj here, it is different from 'Default'. This
+ // needs to be done before the style 'Default' is set from the :SetModel() call which is triggered
+ // from the following :SetPage().
+ // TTTT: Needs to be moved in branch aw080 due to having a SdrModel from the beginning, is at this
+ // place for convenience currently (works in both versions, is not in the way)
+ SfxStyleSheet* pSheet = pNewPage->GetModel()->GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj();
+
+ if(pSheet)
+ {
+ SetStyleSheet(pSheet, false);
+ }
+ else
+ {
+ SetMergedItem(XFillStyleItem(XFILL_NONE));
+ SetMergedItem(XLineStyleItem(XLINE_NONE));
+ }
+ }
+
SdrRectObj::SetPage(pNewPage);
if (bInsert && !mpImpl->mbConnected )