sd/source/ui/unoidl/unopage.cxx |   22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit d07778f62ed386672a60ef7570a89b5fa109e026
Author: Armin Le Grand <a...@apache.org>
Date:   Wed Jul 9 11:57:21 2014 +0000

    i119287 corrected default style for draw objects created using UNO API

diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 2b96447..8a8d9c0 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -67,11 +67,7 @@
 #include <svx/svdview.hxx>
 #include "misc.hxx"
 #include "View.hxx"
-#ifndef SVX_LIGHT
-#ifndef SD_DRAW_DOC_SHELL_HXX
 #include "DrawDocShell.hxx"
-#endif
-#endif
 #include "ViewShell.hxx"
 #include "DrawViewShell.hxx"
 #include "unoobj.hxx"
@@ -80,6 +76,7 @@
 #include "unopback.hxx"
 #include "unohelp.hxx"
 #include <vcl/dibtools.hxx>
+#include <svx/svdograf.hxx>
 
 using ::com::sun::star::animations::XAnimationNode;
 using ::com::sun::star::animations::XAnimationNodeSupplier;
@@ -433,7 +430,22 @@ SdrObject * SdGenericDrawPage::_CreateSdrObject( const 
Reference< drawing::XShap
         {
             SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
             if( pDoc )
-                pObj->NbcSetStyleSheet( pDoc->GetDefaultStyleSheet(), sal_True 
);
+            {
+                // #119287# similar to the code in the SdrObject methods the 
graphic and ole
+                // SdrObjects need another default style than the rest, see 
task. Adding here, too.
+                // TTTT: Same as for #119287#: Can be removed in branch aw080 
again
+                const bool bIsSdrGrafObj(0 != dynamic_cast< SdrGrafObj* 
>(pObj));
+                const bool bIsSdrOle2Obj(0 != dynamic_cast< SdrOle2Obj* 
>(pObj));
+
+                if(bIsSdrGrafObj || bIsSdrOle2Obj)
+                {
+                    
pObj->NbcSetStyleSheet(pDoc->GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(), 
sal_True);
+                }
+                else
+                {
+                    pObj->NbcSetStyleSheet(pDoc->GetDefaultStyleSheet(), 
sal_True);
+                }
+            }
         }
         return pObj;
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to