kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone
Blob Blame History Raw
From 2b8f66388450fcf7fb2f8087ee7c66c142fe72c0 Mon Sep 17 00:00:00 2001
From: Armin Le Grand <alg@apache.org>
Date: Wed, 9 Jul 2014 11:57:21 +0000
Subject: [PATCH 003/137] Resolves: #i119287# corrected default style for draw
 objects...

created using UNO API

(cherry picked from commit d07778f62ed386672a60ef7570a89b5fa109e026)

Conflicts:
	sd/source/ui/unoidl/unopage.cxx

(cherry picked from commit 0aa3dee5e88a1494a7a6a8401e084cbdb4324727)
Signed-off-by: Andras Timar <andras.timar@collabora.com>

Conflicts:
	sd/source/ui/unoidl/unopage.cxx

Change-Id: I016d801edefb5ab32b7b6a8e13a1dc3e8fdb866e
---
 sd/source/ui/unoidl/unopage.cxx | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 9ad3473..fa61e5f 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -69,6 +69,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;
@@ -410,7 +411,22 @@ SdrObject * SdGenericDrawPage::_CreateSdrObject( const Reference< drawing::XShap
         {
             SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
             if( pDoc )
+            {
+                // #i119287# 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 #i119287#: 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;
     }
-- 
1.9.3