File legacy-fragment-import-impress.diff of Package libreoffice

commit 67d27248749f1880febf64ba62a734b89fff02a4
Author: Muthu Subramanian K <sumuthu@suse.com>
Date:   Fri Oct 7 19:38:07 2011 +0530

    n#699334: Legacy Diagram Text Import.

diff --git a/sd/qa/unit/makefile.mk b/sd/qa/unit/makefile.mk
index 94e7941..3a0a254 100644
--- sd/qa/unit/makefile.mk
+++ sd/qa/unit/makefile.mk
@@ -56,6 +56,7 @@ SHL1STDLIBS= \
     $(CPPCANVASLIB)	\
     $(CPPUHELPERLIB)	\
     $(COMPHELPERLIB)	\
+    $(MSFILTERLIB)  \
     $(UCBHELPERLIB)	\
     $(SALLIB)		\
     $(SALHELPERLIB)	\
diff --git a/sd/source/ui/inc/unoprnms.hxx b/sd/source/ui/inc/unoprnms.hxx
index c3d0ff4..2e382d2 100644
--- sd/source/ui/inc/unoprnms.hxx
+++ sd/source/ui/inc/unoprnms.hxx
@@ -69,6 +69,7 @@
 #define UNO_NAME_OBJ_STYLE				"Style"
 #define UNO_NAME_OBJ_MASTERDEPENDENT	"IsPlaceholderDependent"
 #define UNO_NAME_OBJ_ANIMATIONPATH		"AnimationPath"
+#define UNO_NAME_OBJ_LEGACYFRAGMENT     "LegacyFragment"
 
 #define UNO_NAME_LAYER_LOCKED			"IsLocked"
 #define UNO_NAME_LAYER_PRINTABLE		"IsPrintable"
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index b67d15b..85c0197 100644
--- sd/source/ui/unoidl/unoobj.cxx
+++ sd/source/ui/unoidl/unoobj.cxx
@@ -56,6 +56,8 @@
 #include <svx/svdopath.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/svdograf.hxx>
+#include <filter/msfilter/msdffimp.hxx>
+#include <svl/instrm.hxx>
 #include <editeng/outlobj.hxx>
 #include "CustomAnimationPreset.hxx"
 #include "Outliner.hxx"
@@ -133,19 +135,19 @@ static SdTypesCache gImplTypesCache;
 #define WID_ANIMPATH		16
 #define WID_IMAGEMAP		17
 #define WID_ISANIMATION		18
+#define WID_THAT_NEED_ANIMINFO 19
 
 #define WID_ISEMPTYPRESOBJ	20
 #define WID_ISPRESOBJ		21
 #define WID_MASTERDEPEND	22
 
 #define WID_NAVORDER		23
-
-#define WID_THAT_NEED_ANIMINFO 19
-
 #define WID_PLACEHOLDERTEXT 24
+#define WID_LEGACYFRAGMENT  25
 
 
         #define IMPRESS_MAP_ENTRIES \
+        { MAP_CHAR_LEN(UNO_NAME_OBJ_LEGACYFRAGMENT),WID_LEGACYFRAGMENT,  &ITYPE(drawing::XShape),                                   0, 0},\
         { MAP_CHAR_LEN(UNO_NAME_OBJ_ANIMATIONPATH),	WID_ANIMPATH,		 &ITYPE(drawing::XShape),									0, 0},\
         { MAP_CHAR_LEN(UNO_NAME_OBJ_BOOKMARK),		WID_BOOKMARK,		 &::getCppuType((const OUString*)0),						0, 0},\
         { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMCOLOR),		WID_DIMCOLOR,		 &::getCppuType((const sal_Int32*)0),						0, 0},\
@@ -686,6 +688,18 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName,
                     break;
                 }
 */
+                case WID_LEGACYFRAGMENT:
+                    {
+                        uno::Reference< io::XInputStream > xInputStream;
+                        aValue >>= xInputStream;
+                        if( xInputStream.is() )
+                        {
+                            SvInputStream aStream( xInputStream );
+                            SdrObject* pObject = mpShape->GetSdrObject();
+                            SvxMSDffManager::ReadObjText( aStream, pObject );
+                        }
+                    }
+                    break;
                 case WID_IMAGEMAP:
                 {
                     SdDrawDocument* pDoc = mpModel?mpModel->GetDoc():NULL;
@@ -711,6 +725,7 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName,
                         }
                     }
                 }
+                break;
             }
         }
     }
diff --git a/sd/util/makefile.mk b/sd/util/makefile.mk
index 1d25951..ddbb8cf 100755
--- sd/util/makefile.mk
+++ sd/util/makefile.mk
@@ -84,6 +84,7 @@ SHL1STDLIBS+= \
     $(OOXLIB) \
     $(SAXLIB) \
     $(COMPHELPERLIB) \
+    $(MSFILTERLIB) \
     $(UCBHELPERLIB) \
     $(CPPUHELPERLIB) \
     $(CPPULIB) \
@@ -213,6 +214,7 @@ SHL4STDLIBS= \
     $(TOOLSLIB) \
     $(I18NISOLANGLIB) \
     $(COMPHELPERLIB) \
+    $(MSFILTERLIB) \
     $(CPPUHELPERLIB) \
     $(CPPULIB) \
     $(CANVASLIB) \
@@ -266,6 +268,7 @@ SHL5STDLIBS = $(ISDLIB) \
               $(TOOLSLIB)         \
               $(UCBHELPERLIB)     \
               $(CPPUHELPERLIB)    \
+              $(MSFILTERLIB)      \
               $(CPPULIB)          \
               $(SALLIB)           \
               $(COMPHELPERLIB)    \
openSUSE Build Service is sponsored by