Commits

Anonymous committed b2192ba

CWS-TOOLING: integrate CWS impress168
2009-04-24 11:26:33 +0200 wg r271204 : i101157
2009-04-24 10:17:59 +0200 wg r271200 : i101157
2009-04-23 15:50:12 +0200 wg r271178 : i101157
2009-04-23 15:16:58 +0200 wg r271176 : i101157
2009-04-23 13:04:41 +0200 wg r271158 : i101157
2009-04-22 15:39:32 +0200 wg r271123 : i101157
2009-04-22 14:27:24 +0200 wg r271111 : i101157
2009-04-22 14:14:02 +0200 wg r271109 : i101157
2009-04-17 14:34:19 +0200 wg r270946 : i101157
2009-04-17 13:49:15 +0200 wg r270939 : i101157
2009-03-31 14:54:52 +0200 sj r270281 : CWS-TOOLING: rebase CWS impress168 to trunk@270033 (milestone: DEV300:m45)
2009-03-26 16:56:44 +0100 sj r270089 : removed invalid file names
2009-03-24 14:02:54 +0100 sj r269944 : CWS-TOOLING: rebase CWS impress168 to trunk@269781 (milestone: DEV300:m44)
2009-03-06 16:32:14 +0100 sj r269020 : #i99970# importing customshapes without group object, taking care of the correct text alignment
2009-02-27 13:53:24 +0100 sj r268591 : #158501,158483# fixed positioning problem of 3d customshapes
2009-02-19 16:02:00 +0100 sj r268292 : #76543# fixed interactive hyperlink program action with relativ url
2009-02-18 15:36:52 +0100 sj r268233 : #158503# added import of circular gradients for ellipse shapes
2009-02-16 19:51:54 +0100 sj r267836 : #i99146# calculating correct text bounds
2009-02-12 13:59:46 +0100 sj r267654 : #i96179# fixed bullet problem
2009-02-10 17:26:41 +0100 sj r267566 : #158476# fixed import of the ribbon shape
2009-02-10 17:10:27 +0100 cl r267561 : #i95364# fixed type detection of linked images
2009-02-09 18:31:59 +0100 cl r267531 : #i98352# removed assertion
2009-02-09 18:31:17 +0100 cl r267530 : #i98355# fixed alien attribute import for sd in binfilter
2009-02-09 18:30:53 +0100 cl r267529 : #i98355# fixed alien attribute import for sd in binfilter
2009-02-09 09:52:15 +0100 cl r267501 : #i98573# fixed build error
2009-02-06 17:02:21 +0100 sj r267476 : #i96179# fixed bullet problem
2009-02-06 14:58:39 +0100 cl r267466 : #i14832# fixed page count field for handout printing
2009-02-06 10:23:01 +0100 cl r267447 : #i98573# fixed GetEditOutlinerParaObject() memory leak
2009-02-05 18:03:34 +0100 cl r267435 : #i98573# fixed GetEditOutlinerParaObject() memory leak
2009-02-05 18:03:08 +0100 cl r267434 : #i85481# added XMultiPropertyStates to text implementations
2009-02-05 18:02:54 +0100 cl r267433 : #i85481# added XMultiPropertyStates to text implementations
2009-02-05 18:02:42 +0100 cl r267432 : #i85481# added XMultiPropertyStates to text implementations
2009-02-04 18:54:46 +0100 sj r267400 : #i33630# fixed arrow size of word import
2009-02-04 15:40:16 +0100 cl r267389 : #i58702# fixed tiled bitmap fill for vcl canvas
2009-02-04 15:39:07 +0100 cl r267388 : #i58702# fixed tiled bitmap fill for vcl canvas
2009-02-04 14:23:27 +0100 cl r267382 : #i98573# fixed memory leaks caused by wron usage of GetEditOutlinerParaObject()
2009-02-04 14:22:34 +0100 cl r267381 : #i98573# fixed memory leaks caused by wron usage of GetEditOutlinerParaObject()
2009-02-04 12:51:50 +0100 cl r267371 : #i14832# added Page Count field to impress
2009-02-04 12:41:31 +0100 cl r267368 : #i14832# added Page Count field to impress

Comments (0)

Files changed (54)

binfilter/bf_sd/source/core/sd_sdpage.cxx

 	ePageKind(PK_STANDARD),
 	bScaleObjects(TRUE),
 	bBackgroundFullSize( FALSE ),
-	nPaperBin(PAPERBIN_PRINTER_SETTINGS)
+	nPaperBin(PAPERBIN_PRINTER_SETTINGS),
+    mpItems(NULL)
 {
 	aLayoutName  = String(SdResId(STR_LAYOUT_DEFAULT_NAME));
 	aLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
 SdPage::~SdPage()
 {
 	EndListenOutlineText();
+    if( mpItems )
+        delete mpItems;
 }
 
 SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, USHORT nIndex)

binfilter/bf_sd/source/core/sd_sdpage2.cxx

 	return FmFormPage::GetTextStyleSheetForObject( pObj );
 }
 
+SfxItemSet* SdPage::getOrCreateItems()
+{
+ 	if( mpItems == NULL )
+		mpItems = new SfxItemSet( pModel->GetItemPool(), SDRATTR_XMLATTRIBUTES, SDRATTR_XMLATTRIBUTES );
+ 
+ 	return mpItems;
+}
+
 sal_Bool SdPage::setAlienAttributes( const ::com::sun::star::uno::Any& rAttributes )
 {
-	maAlienAttributes = rAttributes;
+	SfxItemSet* pSet = getOrCreateItems();
+
+	SvXMLAttrContainerItem aAlienAttributes( SDRATTR_XMLATTRIBUTES );
+	if( aAlienAttributes.PutValue( rAttributes, 0 ) )
+	{
+		pSet->Put( aAlienAttributes );
+		return sal_True;
+	}
+
 	return sal_False;
 }
 
 void SdPage::getAlienAttributes( ::com::sun::star::uno::Any& rAttributes )
 {
-	rAttributes = maAlienAttributes;
+	const SfxPoolItem* pItem;
+
+	if( (mpItems == NULL) || ( SFX_ITEM_SET != mpItems->GetItemState( SDRATTR_XMLATTRIBUTES, sal_False, &pItem ) ) )
+	{
+		SvXMLAttrContainerItem aAlienAttributes;
+		aAlienAttributes.QueryValue( rAttributes, 0 );
+	}
+	else
+	{
+		((SvXMLAttrContainerItem*)pItem)->QueryValue( rAttributes, 0 );
+	}
 }
 
 

binfilter/bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx

 							}
 							catch( uno::Exception& )
 							{
-								DBG_ERROR( "Exception while importing forbidden characters" );
+//								DBG_ERROR( "Exception while importing forbidden characters" );
 							}
 						}
 					}

binfilter/inc/bf_sd/sdpage.hxx

 
 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
 
-	::com::sun::star::uno::Any maAlienAttributes;
+	SfxItemSet*	mpItems;
+    SfxItemSet* getOrCreateItems();
 
 public:
 	TYPEINFO();

canvas/source/vcl/canvashelper_texturefill.cxx

             }
             else if( textures[0].Bitmap.is() )
             {
-                OSL_ENSURE( textures[0].RepeatModeX == rendering::TexturingMode::REPEAT &&
-                            textures[0].RepeatModeY == rendering::TexturingMode::REPEAT,
-                            "CanvasHelper::fillTexturedPolyPolygon(): VCL canvas cannot currently clamp textures." );
+//                OSL_ENSURE( textures[0].RepeatModeX == rendering::TexturingMode::REPEAT &&
+//                            textures[0].RepeatModeY == rendering::TexturingMode::REPEAT,
+//                            "CanvasHelper::fillTexturedPolyPolygon(): VCL canvas cannot currently clamp textures." );
                     
                 const geometry::IntegerSize2D aBmpSize( textures[0].Bitmap->getSize() );
                 
                                            aLocalState );
                     }
                 }
+                else if ( textures[0].RepeatModeX == rendering::TexturingMode::CLAMP &&
+                          textures[0].RepeatModeY == rendering::TexturingMode::CLAMP )
+                {
+                    rendering::RenderState aLocalState( renderState );
+                    ::canvas::tools::appendToRenderState(aLocalState,
+                                                         aTextureTransform);
+                    ::basegfx::B2DHomMatrix aScaleCorrection;
+                    aScaleCorrection.scale( 1.0/aBmpSize.Width,
+                                            1.0/aBmpSize.Height );
+                    ::canvas::tools::appendToRenderState(aLocalState,
+                                                         aScaleCorrection);
+
+                    return drawBitmap( pCanvas, 
+                                       textures[0].Bitmap,
+                                       viewState,
+                                       aLocalState );
+                }
                 else
                 {
                     // No easy mapping to drawBitmap() - calculate

cppcanvas/source/mtfrenderer/implrenderer.cxx

                                         ::vcl::unotools::xBitmapFromBitmapEx( 
                                             rCanvas->getUNOCanvas()->getDevice(), 
                                             aBmpEx );
-                                    aTexture.RepeatModeX = rendering::TexturingMode::REPEAT;
-                                    aTexture.RepeatModeY = rendering::TexturingMode::REPEAT;
+                                    if( aFill.isTiling() )
+                                    {
+                                        aTexture.RepeatModeX = rendering::TexturingMode::REPEAT;
+                                        aTexture.RepeatModeY = rendering::TexturingMode::REPEAT;
+                                    }
+                                    else
+                                    {
+                                        aTexture.RepeatModeX = rendering::TexturingMode::CLAMP;
+                                        aTexture.RepeatModeY = rendering::TexturingMode::CLAMP;
+                                    }
                                     
                                     ::PolyPolygon aPath;
                                     aFill.getPath( aPath );

officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu

 					<value xml:lang="en-US">~Page Number</value>
 				</prop>
 			</node>
-			<node oor:name=".uno:ModifyField" oor:op="replace">
+      <node oor:name=".uno:InsertPagesField" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+
+          <value xml:lang="en-US">Page ~Count</value>
+        </prop>
+      </node>
+      <node oor:name=".uno:ModifyField" oor:op="replace">
 				<prop oor:name="Label" oor:type="xs:string">
 
 					<value xml:lang="en-US">F~ields...</value>
 #define SID_PREVIEW_QUALITY_BLACKWHITE		(SID_SD_START+371)
 #define SID_VECTORIZE						(SID_SD_START+372)
 
+#define SID_INSERT_FLD_PAGES				(SID_SD_START+373)
+
 #define SID_CONVERT_TO_BITMAP				(SID_SD_START+378)
 #define SID_CONVERT_TO_METAFILE				(SID_SD_START+379)
 

sd/sdi/_drvwsh.sdi

         ExecMethod = FuTemporary ;
         StateMethod = GetMenuState ;
     ]
+    SID_INSERT_FLD_PAGES // ole : no, status : play rec
+    [
+        ExecMethod = FuTemporary ;
+        StateMethod = GetMenuState ;
+    ]
     SID_INSERT_FLD_FILE // ole : no, status : play rec
     [
         ExecMethod = FuTemporary ;

sd/sdi/outlnvsh.sdi

 		ExecMethod = FuTemporaryModify ;
 		StateMethod = GetMenuState ;
 	]
+	SID_INSERT_FLD_PAGES // ole : no, status : play rec
+	[
+		ExecMethod = FuTemporaryModify ;
+		StateMethod = GetMenuState ;
+	]
 	SID_INSERT_FLD_FILE // ole : no, status : play rec
 	[
 		ExecMethod = FuTemporaryModify ;
 ]
 
 //--------------------------------------------------------------------------
+SfxVoidItem InsertPagesField SID_INSERT_FLD_PAGES
+()
+[
+	/* flags: */  
+	AutoUpdate = FALSE, 
+	Cachable = Cachable, 
+	FastCall = FALSE, 
+	HasCoreId = FALSE, 
+	HasDialog = FALSE, 
+	ReadOnlyDoc = FALSE, 
+	Toggle = FALSE, 
+	Container = FALSE, 
+	RecordAbsolute = FALSE, 
+	RecordPerSet;
+	Synchron;
+
+	/* config: */ 
+	AccelConfig = TRUE, 
+	MenuConfig = TRUE, 
+	StatusBarConfig = FALSE, 
+	ToolBoxConfig = TRUE, 
+	GroupId = GID_INSERT;
+]
+
+//--------------------------------------------------------------------------
 SfxVoidItem InsertPageQuick SID_INSERTPAGE_QUICK
 ()
 [

sd/source/filter/grf/sdgrffilter.cxx

 	
 		// detect mime type of graphic
 		OUString aMimeType;
+        OUString sGraphicURL;
 
 		// first try to detect from graphic object
 		Reference< XPropertySet > xGraphicSet( xShapeSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic" ) ) ), UNO_QUERY_THROW );
-		xGraphicSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MimeType" ) ) ) >>= aMimeType;
+        xShapeSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ) ) >>= sGraphicURL;
 
-		if( aMimeType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "image/x-vclgraphic" ) ) || !aMimeType.getLength() )
+        bool bIsLinked = (sGraphicURL.getLength() != 0) && (sGraphicURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.GraphicObject:") ) != 0);
+
+        if( !bIsLinked )
+       		xGraphicSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MimeType" ) ) ) >>= aMimeType;
+
+		if( bIsLinked || aMimeType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "image/x-vclgraphic" ) ) || !aMimeType.getLength() )
 		{
 			// this failed, try to detect it from graphic stream and URL
-			OUString aURL;
-			xShapeSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ) ) >>= aURL;
+			OUString aURL( sGraphicURL );
 
 			if( aURL.getLength() == 0 )
 				xShapeSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "GraphicStreamURL" ) ) ) >>= aURL;

sd/source/filter/pptin.cxx

 #ifndef _SVXIDS_HRC
 #include <svx/svxids.hrc>
 #endif
+#include <svtools/urihelper.hxx>
 #include <svx/svdfppt.hxx>
 #include <svx/svditer.hxx>
 #include <sfx2/docfile.hxx>
 				switch( pIAtom->nHyperlinkType )
 				{
 					case 9:
-					case 10:
-					break;
 					case 8: 										// hyperlink : URL
 					{
 						if ( pPtr->aTarget.Len() )
 						{
-							pInfo->maBookmark = String( pPtr->aTarget );
-							pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_DOCUMENT;
+							::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
+							if ( pDocShell )
+							{
+								String aBaseURL = pDocShell->GetMedium()->GetBaseURL();
+								INetURLObject aURL( pPtr->aTarget );
+								if( INET_PROT_NOT_VALID == aURL.GetProtocol() )
+									utl::LocalFileHelper::ConvertSystemPathToURL( pPtr->aTarget, aBaseURL, pInfo->maBookmark );
+								if( !pInfo->maBookmark.Len() )
+									pInfo->maBookmark = URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), pPtr->aTarget, URIHelper::GetMaybeFileHdl(), true );
+								pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_PROGRAM;
+							}
 						}
 					}
 					break;
+
+					case 10:
+					break;
+
 					case 7: 										// hyperlink auf eine Seite
 					{
 						if ( pPtr->aConvSubString.Len() )

sd/source/ui/app/sdmod2.cxx

 
 			pInfo->SetRepresentation( aRepresentation );
 		}
+		else if( dynamic_cast< const SvxPagesField*  >(pField) )
+		{
+			String aRepresentation;
+			aRepresentation += sal_Unicode( ' ' );
+
+			::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
+			if(pViewSh == NULL)
+            {
+                ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
+                if(pBase)
+                    pViewSh = pBase->GetMainViewShell().get();
+            }
+			if( !pDoc && pViewSh )
+				pDoc = pViewSh->GetDoc();
+
+			bool bMasterView;
+			SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
+
+            USHORT nPageCount = 0;
+
+            if( !bMasterView )
+            {
+			    if( pPage && (pPage->GetPageKind() == PK_HANDOUT) && pViewSh )
+			    {
+				    nPageCount = pViewSh->GetPrintedHandoutPageCount();
+			    }
+			    else if( pDoc )
+			    {
+                    nPageCount = (USHORT)pDoc->GetSdPageCount(PK_STANDARD);
+                }
+            }
+
+            if( nPageCount > 0 )
+            {
+				aRepresentation = pDoc->CreatePageNumValue(nPageCount);
+			}
+			else
+			{
+				static String aNumberText( SdResId( STR_FIELD_PLACEHOLDER_COUNT ) );
+				aRepresentation = aNumberText;
+			}
+
+			pInfo->SetRepresentation( aRepresentation );
+		}
 		else if( (pURLField = dynamic_cast< const SvxURLField* >(pField)) != 0 )
 		{
 			switch ( pURLField->GetFormat() )

sd/source/ui/app/strings.src

 {
     Text [ en-US ] = "<number>" ;
 };
+String STR_FIELD_PLACEHOLDER_COUNT
+{
+	Text [ en-US ]="<count>" ;
+};
 
 String STR_PLACEHOLDER_DESCRIPTION_NOTES
 {

sd/source/ui/inc/ViewShell.hxx

 	USHORT GetPrintedHandoutPageNum (void) const { return mnPrintedHandoutPageNum; }
 	void SetPrintedHandoutPageNum (USHORT nPageNumber) {mnPrintedHandoutPageNum=nPageNumber; }
 
+    USHORT GetPrintedHandoutPageCount(void) const { return mnPrintedHandoutPageCount; }
+    void SetPrintedHandoutPageCount (USHORT nPageCount) {mnPrintedHandoutPageCount=nPageCount; }
+
 	virtual USHORT PrepareClose( BOOL bUI = TRUE, BOOL bForBrowsing = FALSE );
 
 	void GetMenuState(SfxItemSet& rSet);
 
 	BOOL		mbStartShowWithDialog;	// Praesentation wurde ueber Dialog gestartet
 	USHORT		mnPrintedHandoutPageNum; // Page number of the handout page that is to be printed.
+    USHORT      mnPrintedHandoutPageCount; // Page count of the handout pages that are to be printed.
 
     //af	BOOL		bPrintDirectSelected;		// Print only selected objects in direct print
 	//afString		sPageRange;					// pagerange if selected objects in direct print

sd/source/ui/inc/strings.hrc

 #define STR_FIELD_PLACEHOLDER_NUMBER			(RID_APP_START+695)
 
 #define STR_UNDO_HANGULHANJACONVERSION                  (RID_APP_START+696)
+#define STR_FIELD_PLACEHOLDER_COUNT				(RID_APP_START+697)
 
 #define STR_LEFT_PANE_DRAW_TITLE                        (RID_APP_START+700)
 #define STR_LEFT_PANE_IMPRESS_TITLE                     (RID_APP_START+701)

sd/source/ui/unoidl/unoobj.cxx

 sal_Bool SdXShape::IsEmptyPresObj() const throw()
 {
 	SdrObject* pObj = mpShape->GetSdrObject();
-	if( pObj == NULL || !pObj->IsEmptyPresObj() )
-		return sal_False;
+	if( (pObj != NULL) && pObj->IsEmptyPresObj() )
+    {
+	    // check if the object is in edit, than its temporarely not empty
+	    SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj );
+        if( pTextObj == 0 )
+            return sal_True;
 
-	// check if the object is in edit, than its temporarely not empty
-	SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, pObj );
-	return (NULL == pTextObj) || ( NULL == pTextObj->GetEditOutlinerParaObject() );
+        OutlinerParaObject* pParaObj = pTextObj->GetEditOutlinerParaObject();
+        if( pParaObj )
+        {
+            delete pParaObj;
+            return sal_True;
+        }
+    }
+
+    return sal_False;
 }
 
 /** sets/reset the empty status of a presentation object

sd/source/ui/view/PrintManager.cxx

 		if( aPageObjVector.empty() )
 			return;
 
+        rInfo.mrViewShell.SetPrintedHandoutPageCount( (USHORT)((aPagesVector.size() + aPageObjVector.size() - 1)  / aPageObjVector.size()) );
+
 /*
 		sal_Int32 nHandoutPageCount = aPagesVector.size() / aPageObjVector.size();
 		sal_Int32 nHandoutPage = 0;
 		}
 
 		rInfo.mrViewShell.SetPrintedHandoutPageNum(1);
+        rInfo.mrViewShell.SetPrintedHandoutPageCount(0);
 		delete pPrintView;
 		rInfo.mrPrinter.SetMapMode(aOldMap);
 	}

sd/source/ui/view/drviews7.cxx

         rSet.DisableItem( SID_INSERT_FLD_TIME_VAR );
         rSet.DisableItem( SID_INSERT_FLD_AUTHOR );
         rSet.DisableItem( SID_INSERT_FLD_PAGE );
+        rSet.DisableItem( SID_INSERT_FLD_PAGES );
         rSet.DisableItem( SID_INSERT_FLD_FILE );
 
 		rSet.DisableItem( SID_INSERT_GRAPHIC );

sd/source/ui/view/drviewsb.cxx

 		case SID_INSERT_FLD_TIME_VAR:
 		case SID_INSERT_FLD_AUTHOR:
 		case SID_INSERT_FLD_PAGE:
+		case SID_INSERT_FLD_PAGES:
 		case SID_INSERT_FLD_FILE:
 		{
 			USHORT nMul = 1;
 				}
 				break;
 
+                case SID_INSERT_FLD_PAGES:
+				{
+                    pFieldItem = new SvxFieldItem( SvxPagesField(), EE_FEATURE_FIELD );
+					nMul = 3;
+				}
+				break;
+
 				case SID_INSERT_FLD_FILE:
 				{
 					String aName;

sd/source/ui/view/outlnvs2.cxx

 		case SID_INSERT_FLD_TIME_VAR:
 		case SID_INSERT_FLD_AUTHOR:
 		case SID_INSERT_FLD_PAGE:
+		case SID_INSERT_FLD_PAGES:
 		case SID_INSERT_FLD_FILE:
 		{
 			SvxFieldItem* pFieldItem = 0;
                     pFieldItem = new SvxFieldItem( SvxPageField(), EE_FEATURE_FIELD );
 				break;
 
+				case SID_INSERT_FLD_PAGES:
+                    pFieldItem = new SvxFieldItem( SvxPagesField(), EE_FEATURE_FIELD );
+				break;
+
 				case SID_INSERT_FLD_FILE:
 				{
 					String aName;
 								pOldFldItem->GetField()->ISA( SvxExtTimeField ) ||
 								pOldFldItem->GetField()->ISA( SvxExtFileField ) ||
 								pOldFldItem->GetField()->ISA( SvxAuthorField ) ||
-								pOldFldItem->GetField()->ISA( SvxPageField ) ) )
+								pOldFldItem->GetField()->ISA( SvxPageField ) || 
+                                pOldFldItem->GetField()->ISA( SvxPagesField )) )
 			{
 				// Feld selektieren, so dass es beim Insert geloescht wird
 				ESelection aSel = pOutlinerView->GetSelection();

sd/source/ui/view/viewshel.cxx

 	mpZoomList = 0;
 	mbStartShowWithDialog = FALSE;
 	mnPrintedHandoutPageNum = 1;
+    mnPrintedHandoutPageCount = 0;
 	mpWindowUpdater.reset( new ::sd::WindowUpdater() );
 	mpImpl.reset(new Implementation(*this));
 	meShellType = ST_NONE;

sd/uiconfig/sdraw/menubar/menubar.xml

 					<menu:menuseparator/>
 					<menu:menuitem menu:id=".uno:InsertAuthorField"/>
 					<menu:menuitem menu:id=".uno:InsertPageField"/>
-					<menu:menuitem menu:id=".uno:InsertFileField"/>
+          <menu:menuitem menu:id=".uno:InsertPagesField"/>
+          <menu:menuitem menu:id=".uno:InsertFileField"/>
 				</menu:menupopup>
 			</menu:menu>
                         <menu:menuitem menu:id=".uno:InsertSymbol"/>

sd/uiconfig/simpress/menubar/menubar.xml

 					<menu:menuseparator/>
 					<menu:menuitem menu:id=".uno:InsertAuthorField"/>
 					<menu:menuitem menu:id=".uno:InsertPageField"/>
-					<menu:menuitem menu:id=".uno:InsertFileField"/>
+          <menu:menuitem menu:id=".uno:InsertPagesField"/>
+          <menu:menuitem menu:id=".uno:InsertFileField"/>
 				</menu:menupopup>
 			</menu:menu>
                         <menu:menuitem menu:id=".uno:InsertSymbol"/>

svx/inc/svx/svdfppt.hxx

 								~PPTParagraphObj();
 
 		UINT32					GetTextSize();
-		sal_uInt16				GetLevel( sal_uInt32 nMappedInstance );
 		PPTPortionObj*			First();
 		PPTPortionObj*			Next();
 

svx/inc/svx/unotext.hxx

 #include <com/sun/star/beans/XPropertyState.hpp>
 #include <com/sun/star/beans/XMultiPropertySet.hpp>
 #include <com/sun/star/text/XTextRangeCompare.hpp>
+#include <com/sun/star/beans/XMultiPropertyStates.hpp>
 #include <com/sun/star/text/XTextAppend.hpp>
 #include <com/sun/star/text/XTextCopy.hpp>
 #include <cppuhelper/weak.hxx>
 class SVX_DLLPUBLIC SvxUnoTextRangeBase : public ::com::sun::star::text::XTextRange,
 							public ::com::sun::star::beans::XPropertySet,
 							public ::com::sun::star::beans::XMultiPropertySet,
+                            public ::com::sun::star::beans::XMultiPropertyStates,
 							public ::com::sun::star::beans::XPropertyState,
 							public ::com::sun::star::lang::XServiceInfo,
 							public ::com::sun::star::text::XTextRangeCompare,
     virtual sal_Bool _getOnePropertyStates(const SfxItemSet* pSet, const SfxItemPropertyMap* pMap, ::com::sun::star::beans::PropertyState& rState);
 
     virtual void SAL_CALL _setPropertyToDefault( const ::rtl::OUString& PropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
-
+    virtual void _setPropertyToDefault( SvxTextForwarder* pForwarder, const SfxItemPropertyMap* pMap, sal_Int32 nPara ) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException );
 	void SetEditSource( SvxEditSource* _pEditSource ) throw();
 
 	virtual void getPropertyValue( const SfxItemPropertyMap* pMap, com::sun::star::uno::Any& rAny, const SfxItemSet& rSet ) throw(::com::sun::star::beans::UnknownPropertyException );
 	virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
 
+    // ::com::sun::star::beans::XMultiPropertyStates
+    //virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setAllPropertiesToDefault(  ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
     // XTextRangeCompare
     virtual ::sal_Int16 SAL_CALL compareRegionStarts( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
     virtual ::sal_Int16 SAL_CALL compareRegionEnds( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);

svx/source/accessibility/AccessibleShape.cxx

 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 #include <com/sun/star/drawing/FillStyle.hpp>
 #include <com/sun/star/text/XText.hpp>
+#include <svx/outlobj.hxx>
 #include <rtl/ref.hxx>
 #include <svx/unoedsrc.hxx>
 #include <svx/unoshtxt.hxx>
                 if( pTextObj )
                     pOutlinerParaObject = pTextObj->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
 
+                bool bOwnParaObj = pOutlinerParaObject != NULL;
+
                 if( !pOutlinerParaObject && pSdrObject )
                     pOutlinerParaObject = pSdrObject->GetOutlinerParaObject();
 
                     mpText = new AccessibleTextHelper( pEditSource );
                 }
 
+                if( bOwnParaObj )
+                    delete pOutlinerParaObject;
+
                 mpText->SetEventSource(this);
             }
         }

svx/source/customshapes/EnhancedCustomShape2d.cxx

 		break;
 		case mso_sptCurvedDownArrow :			nFlags |= DFF_CUSTOMSHAPE_EXCH; break;
 		case mso_sptRibbon2 :					nColorData = 0x30dd0000; break;
-		case mso_sptRibbon :
-		{
-			if ( ( seqAdjustmentValues.getLength() > 1 ) && ( seqAdjustmentValues[ 1 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE ) )
-			{
-				double fValue;
-				seqAdjustmentValues[ 1 ].Value >>= fValue;
-				fValue = 21600 - fValue;
-				seqAdjustmentValues[ 1 ].Value <<= fValue;
-			}
-			nFlags |= DFF_CUSTOMSHAPE_FLIP_V;
-			nColorData = 0x30dd0000;
-		}
-		break;
+		case mso_sptRibbon :					nColorData = 0x30dd0000; break;
+
 		case mso_sptEllipseRibbon2 :			nColorData = 0x30dd0000; break;
-		case mso_sptEllipseRibbon :				// !!!!!!!!!!
-		{
-			if ( ( seqAdjustmentValues.getLength() > 1 ) && ( seqAdjustmentValues[ 1 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE ) )
-			{
-				double fValue;
-				seqAdjustmentValues[ 1 ].Value >>= fValue;
-				fValue = 21600 - fValue;
-				seqAdjustmentValues[ 1 ].Value <<= fValue;
-			}
-			nFlags |= DFF_CUSTOMSHAPE_FLIP_V;
-			nColorData = 0x30dd0000;
-		}
-		break;
+		case mso_sptEllipseRibbon :				nColorData = 0x30dd0000; break;
+
 		case mso_sptVerticalScroll :			nColorData = 0x30dd0000; break;
 		case mso_sptHorizontalScroll :			nColorData = 0x30dd0000; break;
 		default:

svx/source/customshapes/EnhancedCustomShape3d.cxx

 			if ( fZRotate != 0.0 )
 				aNewTransform.rotate( 0.0, 0.0, fZRotate );
 			if ( bIsMirroredX )
-				aNewTransform.scale( -1.0, 0.0, 0.0 );
+				aNewTransform.scale( -1.0, 1, 1 );
 			if ( bIsMirroredY )
-				aNewTransform.scale( 0.0, -1.0, 0.0 );
+				aNewTransform.scale( 1, -1.0, 1 );
 			if( fYRotate != 0.0 )
 				aNewTransform.rotate( 0.0, -fYRotate, 0.0 );
 			if( fXRotate != 0.0 )
 			pScene->GetProperties().SetObjectItem( Svx3DMaterialSpecularItem( aSpecularCol ) );
 			pScene->GetProperties().SetObjectItem( Svx3DMaterialSpecularIntensityItem( (sal_uInt16)nIntensity ) );
 
-// SJ: not setting model, so we save a lot of broadcasting and the model is not modified any longer
-//			pScene->SetModel( pModel );
-			pRet->SetSnapRect( CalculateNewSnapRect( pCustomShape, aBoundRect2d, pMap ) );
+			pScene->SetLogicRect( CalculateNewSnapRect( pCustomShape, aSnapRect, aBoundRect2d, pMap ) );
 
 			// removing placeholder objects
 			std::vector< E3dCompoundObject* >::iterator aObjectListIter( aPlaceholderObjectList.begin() );
 	return pRet;
 }
 
-Rectangle EnhancedCustomShape3d::CalculateNewSnapRect( const SdrObject* pCustomShape, const Rectangle& rBoundRect, const double* pMap )
+Rectangle EnhancedCustomShape3d::CalculateNewSnapRect( const SdrObject* pCustomShape, const Rectangle& rSnapRect, const Rectangle& rBoundRect, const double* pMap )
 {
 	SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
-	const Point aCenter( pCustomShape->GetSnapRect().Center() );
+	const Point aCenter( rSnapRect.Center() );
 	double fExtrusionBackward, fExtrusionForward;
 	GetExtrusionDepth( rGeometryItem, pMap, fExtrusionBackward, fExtrusionForward );
 	sal_uInt32 i;
 
 	double fXRotate, fYRotate;
 	GetRotateAngle( rGeometryItem, fXRotate, fYRotate );
-	double fZRotate = -(360.0-(double)pCustomShape->GetRotateAngle()/100.0) * F_PI180;
-	// double fRotationAngle = Fix16ToAngle( rPropSet.GetPropertyValue( DFF_Prop_c3DRotationAngle, 0 ) );		// * F_PI180;
+	double fZRotate = - ((SdrObjCustomShape*)pCustomShape)->GetObjectRotation() * F_PI180;
 
 	// rotating bound volume
 	basegfx::B3DHomMatrix aMatrix;
 	aMatrix.translate(-aRotationCenter.DirectionX, -aRotationCenter.DirectionY, -aRotationCenter.DirectionZ);
-	aMatrix.rotate(fXRotate, fYRotate, fZRotate);
+	if ( fZRotate != 0.0 )
+		aMatrix.rotate( 0.0, 0.0, fZRotate );
+	if ( ((SdrObjCustomShape*)pCustomShape)->IsMirroredX() )
+		aMatrix.scale( -1.0, 1, 1 );
+	if ( ((SdrObjCustomShape*)pCustomShape)->IsMirroredY() )
+		aMatrix.scale( 1, -1.0, 1 );
+	if( fYRotate != 0.0 )
+		aMatrix.rotate( 0.0, fYRotate, 0.0 );
+	if( fXRotate != 0.0 )
+		aMatrix.rotate( -fXRotate, 0.0, 0.0 );
 	aMatrix.translate(aRotationCenter.DirectionX, aRotationCenter.DirectionY, aRotationCenter.DirectionZ);
 	aBoundVolume.transform(aMatrix);
 
-//	for( i = 0L; i < 8L; i++ )		
-//	{
-//		basegfx::B3DPoint aPoint(aBoundVolume.getB3DPoint(i));
-//		aPoint.setX(aPoint.getX() - aRotationCenter.DirectionX);
-//		aPoint.setY(aPoint.getY() - aRotationCenter.DirectionY);
-//		aPoint.setZ(aPoint.getZ() - aRotationCenter.DirectionZ);
-//		Rotate( rPoint, fXRotate, fYRotate, fZRotate );
-//		aPoint.setX(aPoint.getX() + aRotationCenter.DirectionX);
-//		aPoint.setY(aPoint.getY() + aRotationCenter.DirectionY);
-//		aPoint.setZ(aPoint.getZ() + aRotationCenter.DirectionZ);
-//		aBoundVolume.setB3DPoint(i, aPoint);
-//	}
-
-	Transformation2D aTransformation2D( pCustomShape, rBoundRect, pMap );
+	Transformation2D aTransformation2D( pCustomShape, rSnapRect, pMap );
 	if ( aTransformation2D.IsParallel() )
 		aBoundVolume = aTransformation2D.ApplySkewSettings( aBoundVolume );
 
 	Polygon aTransformed( 8 );
 	for ( i = 0L; i < 8L; i++ )
 		aTransformed[ (sal_uInt16)i ] = aTransformation2D.Transform2D( aBoundVolume.getB3DPoint( i ) );
+
 	return aTransformed.GetBoundRect();
 }

svx/source/customshapes/EnhancedCustomShape3d.hxx

 	friend class Transformation2D;
 
 	protected :
-		static Rectangle CalculateNewSnapRect( const SdrObject* pCustomShape, const Rectangle& rBoundRect, const double* pMap );
+		static Rectangle CalculateNewSnapRect( const SdrObject* pCustomShape, const Rectangle& rSnapRect, const Rectangle& rBoundRect, const double* pMap );
 
 	public :
 		static SdrObject* Create3DObject( const SdrObject* pShape2d, const SdrObject* pCustomShape );

svx/source/customshapes/EnhancedCustomShapeEngine.cxx

 
 			// get the text bounds and set at text object
 			Rectangle aTextBounds = pCustoObj->GetSnapRect();
-			if( pCustoObj->GetTextBounds( aTextBounds ) )
-				pTextObj->SetSnapRect( aTextBounds );
+			SdrObject* pSdrObjCustomShape( GetSdrObjectFromXShape( mxShape ) );
+			if ( pSdrObjCustomShape )
+			{
+				EnhancedCustomShape2d aCustomShape2d( pSdrObjCustomShape );
+				aTextBounds = aCustomShape2d.GetTextRect();
+			}
+			pTextObj->SetSnapRect( aTextBounds );
 
 			// if rotated, copy GeoStat, too.
 			const GeoStat& rSourceGeo = pCustoObj->GetGeoStat();

svx/source/customshapes/EnhancedCustomShapeGeometry.cxx

 	(SvxMSDffHandle*)mso_sptRibbon2Handle, sizeof( mso_sptRibbon2Handle ) / sizeof( SvxMSDffHandle )
 };
 
+static const SvxMSDffVertPair mso_sptRibbonVert[] =
+{
+	{ 0, 0 }, { 3 MSO_I, 0 },
+	{ 4 MSO_I, 11 MSO_I }, { 4 MSO_I, 10 MSO_I }, { 5 MSO_I, 10 MSO_I }, { 5 MSO_I, 11 MSO_I },
+	{ 6 MSO_I, 0 }, { 21600, 0 }, { 18 MSO_I, 14 MSO_I }, { 21600, 15 MSO_I }, { 9 MSO_I, 15 MSO_I }, { 9 MSO_I, 16 MSO_I }, { 8 MSO_I, 21600 }, { 1 MSO_I, 21600 },
+	{ 0 MSO_I, 16 MSO_I }, { 0 MSO_I, 15 MSO_I }, { 0, 15 MSO_I }, { 2700, 14 MSO_I },
+
+	{ 4 MSO_I, 11 MSO_I },
+	{ 3 MSO_I, 12 MSO_I }, { 1 MSO_I, 12 MSO_I },
+	{ 0 MSO_I, 13 MSO_I }, { 1 MSO_I, 10 MSO_I }, { 4 MSO_I, 10 MSO_I },
+	{ 5 MSO_I, 11 MSO_I },
+	{ 6 MSO_I, 12 MSO_I }, { 8 MSO_I, 12 MSO_I },
+	{ 9 MSO_I, 13 MSO_I }, { 8 MSO_I, 10 MSO_I }, { 5 MSO_I, 10 MSO_I },
+	{ 0 MSO_I, 13 MSO_I },
+	{ 0 MSO_I, 15 MSO_I },
+	{ 9 MSO_I, 13 MSO_I },
+	{ 9 MSO_I, 15 MSO_I }
+};
+static const sal_uInt16 mso_sptRibbonSegm[] =
+{
+	0x4000, 0x0001, 0xa701, 0x0003, 0xa801, 0x0005, 0xa801, 0x0001, 0xa701, 0x0003, 0x6000, 0x8000,
+	0x4000, 0xaa00, 0xa801, 0x0001, 0xa702, 0x0001, 0x8000,
+	0x4000, 0xaa00, 0xa801, 0x0001, 0xa702, 0x0001, 0x8000,
+	0x4000, 0xaa00, 0x0001, 0x8000,
+	0x4000, 0xaa00, 0x0001, 0x8000
+};
+static const SvxMSDffCalculationData mso_sptRibbonCalc[] =
+{
+	{ 0x2000, { DFF_Prop_adjustValue, 0, 0 } },				// 00
+	{ 0x2000, { 0x400, 675, 0 } },							// 01
+	{ 0x2000, { 0x401, 675, 0 } },							// 02
+	{ 0x2000, { 0x402, 675, 0 } },							// 03
+	{ 0x2000, { 0x403, 675, 0 } },							// 04
+	{ 0x8000, { 21600, 0, 0x404 } },						// 05
+	{ 0x8000, { 21600, 0, 0x403 } },						// 06
+	{ 0x8000, { 21600, 0, 0x402 } },						// 07
+	{ 0x8000, { 21600, 0, 0x401 } },						// 08
+	{ 0x8000, { 21600, 0, 0x400 } },						// 09
+	{ 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },			// 10
+	{ 0x2001, { 0x40a, 1, 4 } },							// 11
+	{ 0x2001, { 0x40b, 2, 1 } },							// 12
+	{ 0x2001, { 0x40b, 3, 1 } },							// 13
+	{ 0x8000, { 10800, 0, 0x40c } },						// 14
+	{ 0x8000, { 21600, 0, 0x40a } },						// 15
+	{ 0x8000, { 21600, 0, 0x40b } },						// 16
+	{ 0x0001, { 21600, 1, 2 } },							// 17
+	{ 0x0000, { 21600, 0, 2700 } },							// 18
+	{ 0x2000, { 0x411, 0, 2700 } }							// 19
+};
+static const sal_Int32 mso_sptRibbonDefault[] =
+{
+	2, 5400, 2700
+};
+static const SvxMSDffTextRectangles mso_sptRibbonTextRect[] =
+{
+	{ { 0 MSO_I, 10 MSO_I }, { 9 MSO_I, 21600 } }
+};
+static const SvxMSDffVertPair mso_sptRibbonGluePoints[] =
+{
+	{ 17 MSO_I, 10 MSO_I }, { 2700, 14 MSO_I }, { 17 MSO_I, 21600 }, { 18 MSO_I, 14 MSO_I }
+};
+static const SvxMSDffHandle mso_sptRibbonHandle[] =
+{
+	{	MSDFF_HANDLE_FLAGS_RANGE,
+		0x100, 0, 10800, 10800, 2700, 8100, 0x80000000, 0x7fffffff },
+	{	MSDFF_HANDLE_FLAGS_RANGE,
+		10800, 0x101, 10800, 10800, 0x80000000, 0x7fffffff, 0, 7200 }
+};
+static const mso_CustomShape msoRibbon =
+{
+	(SvxMSDffVertPair*)mso_sptRibbonVert, sizeof( mso_sptRibbonVert ) / sizeof( SvxMSDffVertPair ),
+	(sal_uInt16*)mso_sptRibbonSegm, sizeof( mso_sptRibbonSegm ) >> 1,
+	(SvxMSDffCalculationData*)mso_sptRibbonCalc, sizeof( mso_sptRibbonCalc ) / sizeof( SvxMSDffCalculationData ),
+	(sal_Int32*)mso_sptRibbonDefault,
+	(SvxMSDffTextRectangles*)mso_sptRibbonTextRect, sizeof( mso_sptRibbonTextRect ) / sizeof( SvxMSDffTextRectangles ),
+	21600, 21600,
+	0x80000000, 0x80000000,
+	(SvxMSDffVertPair*)mso_sptRibbonGluePoints, sizeof( mso_sptRibbonGluePoints ) / sizeof( SvxMSDffVertPair ),
+	(SvxMSDffHandle*)mso_sptRibbonHandle, sizeof( mso_sptRibbonHandle ) / sizeof( SvxMSDffHandle )
+};
+
 static const SvxMSDffVertPair mso_sptVerticalScrollVert[] =	// adjustment1 : 0 - 5400
 {
 	{ 1 MSO_I, 21600 }, { 0, 11 MSO_I }, { 1 MSO_I, 12 MSO_I }, { 0 MSO_I, 12 MSO_I },
 		case mso_sptSeal24 :					pCustomShape = &msoSeal24; break;
 		case mso_sptSeal32 :					pCustomShape = &msoSeal32; break;
 		case mso_sptRibbon2 :					pCustomShape = &msoRibbon2; break;
-		case mso_sptRibbon :					pCustomShape = &msoRibbon2; break;
+		case mso_sptRibbon :					pCustomShape = &msoRibbon; break;
 		case mso_sptEllipseRibbon2 :			pCustomShape = &msoRibbon2; break;	// SJ: TODO
-		case mso_sptEllipseRibbon :				pCustomShape = &msoRibbon2; break;	// SJ: TODO
+		case mso_sptEllipseRibbon :				pCustomShape = &msoRibbon; break;	// SJ: TODO
 		case mso_sptVerticalScroll :			pCustomShape = &msoVerticalScroll;	break;
 		case mso_sptHorizontalScroll :			pCustomShape = &msoHorizontalScroll; break;
 		case mso_sptFlowChartProcess :			pCustomShape = &msoFlowChartProcess; break;

svx/source/msfilter/msashape.cxx

 			break;
 			case mso_sptCurvedDownArrow :			nFlags |= DFF_CUSTOMSHAPE_EXCH; break;
 			case mso_sptRibbon2 :					nColorData = 0x30dd0000; break;
-			case mso_sptRibbon :
-			{
-				if ( nHandlesSet & 2 )
-					nHandles[ 1 ] = 21600 - nHandles[ 1 ];
-				nFlags |= DFF_CUSTOMSHAPE_FLIP_V;
-				nColorData = 0x30dd0000;
-			}
-			break;
+			case mso_sptRibbon :					nColorData = 0x30dd0000; break;
+
 			case mso_sptEllipseRibbon2 :			nColorData = 0x30dd0000; break;
-			case mso_sptEllipseRibbon :				// !!!!!!!!!!
-			{
-				if ( nHandlesSet & 2 )
-					nHandles[ 1 ] = 21600 - nHandles[ 1 ];
-				nFlags |= DFF_CUSTOMSHAPE_FLIP_V;
-				nColorData = 0x30dd0000;
-			}
-			break;
+			case mso_sptEllipseRibbon :				nColorData = 0x30dd0000; break;
+
 			case mso_sptVerticalScroll :			nColorData = 0x30dd0000; break;
 			case mso_sptHorizontalScroll :			nColorData = 0x30dd0000; break;
 			default: break;

svx/source/msfilter/msdffimp.cxx

 static basegfx::B2DPolygon GetLineArrow( const sal_Int32 nLineWidth, const MSO_LineEnd eLineEnd,
 	const MSO_LineEndWidth eLineWidth, const MSO_LineEndLength eLineLenght,
 	sal_Int32& rnArrowWidth, sal_Bool& rbArrowCenter,
-	String& rsArrowName )
+	String& rsArrowName, sal_Bool bScaleArrow )
 {
 	basegfx::B2DPolygon aRetval;
 	double		fLineWidth = nLineWidth < 70 ? 70.0 : nLineWidth;
 		case mso_lineNarrowArrow		: fWidthMul = 2.0; break;
 		case mso_lineWideArrow			: fWidthMul = 5.0; nLineNumber += 6; break;
 	}
+
+	if ( bScaleArrow )	// #i33630 arrows imported from Word are too big
+	{
+		fWidthMul /= 1.75;
+		fLenghtMul/= 1.75;
+	}
+
 	rbArrowCenter = sal_False;
 	switch ( eLineEnd )
 	{
 
 		if ( nLineFlags & 0x10 )
 		{
+			sal_Bool bScaleArrows = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP;
 			///////////////
 			// LineStart //
 			///////////////
 				sal_Int32	nArrowWidth;
 				sal_Bool	bArrowCenter;
 				String		aArrowName;
-				basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName ));
+				basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName, bScaleArrows ));
 
 				rSet.Put( XLineStartWidthItem( nArrowWidth ) );
 				rSet.Put( XLineStartItem( aArrowName, basegfx::B2DPolyPolygon(aPoly) ) );
 				sal_Int32	nArrowWidth;
 				sal_Bool	bArrowCenter;
 				String		aArrowName;
-				basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName ));
+				basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName, bScaleArrows ));
 
 				rSet.Put( XLineEndWidthItem( nArrowWidth ) );
 				rSet.Put( XLineEndItem( aArrowName, basegfx::B2DPolyPolygon(aPoly) ) );
 			case mso_fillPicture :			// Center a picture in the shape
 				eXFill = XFILL_BITMAP;
 			break;
+			case mso_fillShadeShape :		// Shade from shape outline to end point
 			case mso_fillShade :			// Shade from start to end points
 			case mso_fillShadeCenter :		// Shade from bounding rectangle to end point
-			case mso_fillShadeShape :		// Shade from shape outline to end point
 			case mso_fillShadeScale :		// Similar to mso_fillShade, but the fillAngle
 			case mso_fillShadeTitle :		// special type - shade to title ---  for PP
 				eXFill = XFILL_GRADIENT;
 				aCol1 = aCol2;
 				aCol2 = aZwi;
 			}
+			if ( ( eShapeType == mso_sptEllipse ) && ( eMSO_FillType == mso_fillShadeShape ) )
+				eGrad = XGRAD_ELLIPTICAL;
+
 			XGradient aGrad( aCol2, aCol1, eGrad, nAngle, nFocusX, nFocusY );
 			aGrad.SetStartIntens( 100 );
 			aGrad.SetEndIntens( 100 );

svx/source/svdraw/svdfppt.cxx

 				UINT32	nIsBullet2 = 0; //, nInstance = nDestinationInstance != 0xffffffff ? nDestinationInstance : pTextObj->GetInstance();
 				pPara->GetAttrib( PPT_ParaAttr_BulletOn, nIsBullet2, nDestinationInstance );
 				if ( !nIsBullet2 )
-					rOutliner.SetDepth( rOutliner.GetParagraph( nParaIndex ), -1 );
+					aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, FALSE ) );
 
 				if ( oStartNumbering )
 				{
 	nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_TextOfs, nTextOfs, nDestinationInstance );
 	nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletOfs, nBulletOfs, nDestinationInstance );
 
-	UINT32 nFontHeight = 24;
-	PPTPortionObj* pPtr = pParaObj->First();
-	if ( pPtr )
-		pPtr->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
-	nHardCount += ImplGetExtNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth,
-												pParaObj->mnInstance, nDestinationInstance, rStartNumbering, nFontHeight, pParaObj );
-
-	if ( rNumberFormat.GetNumberingType() != SVX_NUM_BITMAP )
-		pParaObj->UpdateBulletRelSize( nBulletHeight );
-	if ( nHardCount )
-		ImplGetNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth );
+	if ( nIsBullet )
+	{
+		rNumberFormat.SetNumberingType( SVX_NUM_CHAR_SPECIAL );
+
+		UINT32 nFontHeight = 24;
+		PPTPortionObj* pPtr = pParaObj->First();
+		if ( pPtr )
+			pPtr->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
+		nHardCount += ImplGetExtNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth,
+													pParaObj->mnInstance, nDestinationInstance, rStartNumbering, nFontHeight, pParaObj );
+
+		if ( rNumberFormat.GetNumberingType() != SVX_NUM_BITMAP )
+			pParaObj->UpdateBulletRelSize( nBulletHeight );
+		if ( nHardCount )
+			ImplGetNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth );
+	}
 
 	if ( nHardCount )
 	{
 			case SVX_NUM_CHARS_UPPER_LETTER_N :
 			case SVX_NUM_CHARS_LOWER_LETTER_N :
 			{
+				PPTPortionObj* pPtr = pParaObj->First();
 				if ( pPtr )
 				{
 					sal_uInt32 nFont;
 		SvxNumBulletItem* pNumBulletItem = mrStyleSheet.mpNumBulletItem[ nInstance ];
 		if ( pNumBulletItem )
 		{
-			SvxNumberFormat aNumberFormat( SVX_NUM_CHAR_SPECIAL );
-			aNumberFormat.SetBulletChar( ' ' );
+			SvxNumberFormat aNumberFormat( SVX_NUM_NUMBER_NONE );
 			if ( GetNumberFormat( rManager, aNumberFormat, this, nDestinationInstance, rStartNumbering ) )
 			{
+				if ( aNumberFormat.GetNumberingType() == SVX_NUM_NUMBER_NONE )
+				{
+					aNumberFormat.SetLSpace( 0 );
+					aNumberFormat.SetAbsLSpace( 0 );
+					aNumberFormat.SetFirstLineOffset( 0 );
+					aNumberFormat.SetCharTextDistance( 0 );
+					aNumberFormat.SetFirstLineIndent( 0 );
+					aNumberFormat.SetIndentAt( 0 );
+				}
 				SvxNumBulletItem aNewNumBulletItem( *pNumBulletItem );
 				SvxNumRule* pRule = aNewNumBulletItem.GetNumRule();
 				if ( pRule )

svx/source/table/accessiblecell.cxx

 
 #include <unotools/accessiblestatesethelper.hxx>
 
+#include <svx/outlobj.hxx>
 #include <svx/unoshtxt.hxx>
 #include <svx/svdotext.hxx>
 
 	{
         OutlinerParaObject* pOutlinerParaObject = mxCell->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
 
+        bool bOwnParaObject = pOutlinerParaObject != 0;
+
 		if( !pOutlinerParaObject )
 			pOutlinerParaObject = mxCell->GetOutlinerParaObject();
 
             mpText = new AccessibleTextHelper( pEditSource );
 			mpText->SetEventSource(this);
         }
+
+        if( bOwnParaObject)
+            delete pOutlinerParaObject;
     }
 }
 

svx/source/table/cell.cxx

 			{
 				OutlinerParaObject* pParaObj = mxCell->GetEditOutlinerParaObject();
 				
+                bool bOwnParaObj = pParaObj != 0;
+
 				if( pParaObj == 0 )
 					pParaObj = mxCell->GetOutlinerParaObject();
 				
 
 						mxCell->SetOutlinerParaObject(pTemp);
 					}
+
+                    if( bOwnParaObj )
+                        delete pParaObj;
 				}
 			}
 
 
 bool Cell::IsTextEditActive()
 {
+    bool isActive = false;
 	SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
 	if(rTableObj.getActiveCell().get() == this )
-		return rTableObj.GetEditOutlinerParaObject() != 0;
-	return false;
+    {
+        OutlinerParaObject* pParaObj = rTableObj.GetEditOutlinerParaObject();
+        if( pParaObj != 0 )
+        {
+            isActive = true;
+		    delete pParaObj;
+        }
+    }
+	return isActive;
 }
 
 // -----------------------------------------------------------------------------
 	if( rType == XLayoutConstrains::static_type() )
 		return Any( Reference< XLayoutConstrains >( this ) );
 
-	if( rType == XMultiPropertyStates::static_type() )
-		return Any( Reference< XMultiPropertyStates >( this ) );
-
 	Any aRet( SvxUnoTextBase::queryAggregation( rType ) );
 	if( aRet.hasValue() )
 		return aRet;
     Sequence< Type > aTypes( SvxUnoTextBase::getTypes() );
 
     sal_Int32 nLen = aTypes.getLength();
-    aTypes.realloc(nLen + 3);
+    aTypes.realloc(nLen + 2);
 	aTypes[nLen++] = XMergeableCell::static_type();
 	aTypes[nLen++] = XLayoutConstrains::static_type();
-	aTypes[nLen++] = XMultiPropertyStates::static_type();
 
 	return aTypes;
 }

svx/source/table/cell.hxx

 				public SvxUnoTextBase,
 				public ::com::sun::star::table::XMergeableCell,
 				public ::com::sun::star::awt::XLayoutConstrains,
-				public ::com::sun::star::beans::XMultiPropertyStates,
 				public ::cppu::OWeakObject
 {
 	friend class CellUndo;

svx/source/table/celleditsource.cxx

 	{
 		mpTextForwarder->flushCache();
 
-		OutlinerParaObject* mpOutlinerParaObject = NULL;
+		OutlinerParaObject* pOutlinerParaObject = NULL;
 		bool bTextEditActive = false;
 
-		mpOutlinerParaObject = mxCell->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
+		pOutlinerParaObject = mxCell->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
 
-		if( mpOutlinerParaObject )
+		if( pOutlinerParaObject )
 			bTextEditActive = true;	// text edit active
 		else
-			mpOutlinerParaObject = mxCell->GetOutlinerParaObject();
+			pOutlinerParaObject = mxCell->GetOutlinerParaObject();
         
-		if( mpOutlinerParaObject )
+		if( pOutlinerParaObject )
 		{
-			mpOutliner->SetText( *mpOutlinerParaObject );
+			mpOutliner->SetText( *pOutlinerParaObject );
 		}
 		else
 		{
 			}
 		}
 
+        if( bTextEditActive )
+            delete pOutlinerParaObject;
+
 		mbDataValid = true;
 	}
 

svx/source/table/tablertfexporter.cxx

 #include "svx/svdotable.hxx"
 #include "svx/svdoutl.hxx"
 #include "svx/editeng.hxx"
+#include "svx/outlobj.hxx"
 
 //#include <tablertfexporter.hxx>
 
 	String aContent;
 
 	OutlinerParaObject* pParaObj = xCell->GetEditOutlinerParaObject();
-	
+	bool bOwnParaObj = pParaObj != 0;
+
 	if( pParaObj == 0 )
 		pParaObj = xCell->GetOutlinerParaObject();
 	
 		aContent = rOutliner.GetEditEngine().GetText( LINEEND_LF );
 
 		rOutliner.Clear();
+
+        if( bOwnParaObj )
+            delete pParaObj;
 	}
 
 	bool bResetPar, bResetAttr;

svx/source/unodraw/unoshtxt.cxx

 	{
 		mpTextForwarder->flushCache();
 
-		OutlinerParaObject* mpOutlinerParaObject = NULL;
-		BOOL bTextEditActive = FALSE;
+		OutlinerParaObject* pOutlinerParaObject = NULL;
+		bool bTextEditActive = false;
 		SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
 		if( pTextObj && pTextObj->getActiveText() == mpText )
-			mpOutlinerParaObject = pTextObj->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
+			pOutlinerParaObject = pTextObj->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
 
-		if( mpOutlinerParaObject )
-			bTextEditActive = TRUE;	// text edit active
+		if( pOutlinerParaObject )
+			bTextEditActive = true;	// text edit active
 		else
-			mpOutlinerParaObject = mpText->GetOutlinerParaObject();
+			pOutlinerParaObject = mpText->GetOutlinerParaObject();
         
-		if( mpOutlinerParaObject && ( bTextEditActive || !mpObject->IsEmptyPresObj() || mpObject->GetPage()->IsMasterPage() ) )
+		if( pOutlinerParaObject && ( bTextEditActive || !mpObject->IsEmptyPresObj() || mpObject->GetPage()->IsMasterPage() ) )
 		{
-			mpOutliner->SetText( *mpOutlinerParaObject );
+			mpOutliner->SetText( *pOutlinerParaObject );
 
 			// #91254# put text to object and set EmptyPresObj to FALSE
-			if( mpText && bTextEditActive && mpOutlinerParaObject && mpObject->IsEmptyPresObj() && pTextObj->IsRealyEdited() )
+			if( mpText && bTextEditActive && pOutlinerParaObject && mpObject->IsEmptyPresObj() && pTextObj->IsRealyEdited() )
 			{
 				mpObject->SetEmptyPresObj( FALSE );
-				static_cast< SdrTextObj* >( mpObject)->NbcSetOutlinerParaObjectForText( mpOutlinerParaObject, mpText );
+				static_cast< SdrTextObj* >( mpObject)->NbcSetOutlinerParaObjectForText( pOutlinerParaObject, mpText );
 			}
 		}
 		else
 		{
-			sal_Bool bVertical = mpOutlinerParaObject ? mpOutlinerParaObject->IsVertical() : sal_False;
+			sal_Bool bVertical = pOutlinerParaObject ? pOutlinerParaObject->IsVertical() : sal_False;
 
 			// set objects style sheet on empty outliner
 			SfxStyleSheetPool* pPool = (SfxStyleSheetPool*)mpObject->GetModel()->GetStyleSheetPool();
 		}
 
 		mbDataValid = TRUE;
+
+        if( bTextEditActive )
+            delete pOutlinerParaObject;
 	}
 
     if( bCreated && mpOutliner && HasView() )

svx/source/unoedit/unotext.cxx

 :	text::XTextRange()
 ,	beans::XPropertySet()
 ,	beans::XMultiPropertySet()
+,   beans::XMultiPropertyStates()
 ,	beans::XPropertyState()
 ,	lang::XServiceInfo()
 ,	text::XTextRangeCompare()
 {
 	OGuard aGuard( Application::GetSolarMutex() );
 
+	SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : NULL;
+
+    if( pForwarder )
+    {
+		const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName(maPropSet.getPropertyMap(), PropertyName );
+        if( pMap )
+        {
+    		CheckSelection( maSelection, mpEditSource->GetTextForwarder() );
+            _setPropertyToDefault( pForwarder, pMap, nPara );
+            return;
+        }
+    }
+
+	throw beans::UnknownPropertyException();
+}
+
+void SvxUnoTextRangeBase::_setPropertyToDefault(SvxTextForwarder* pForwarder, const SfxItemPropertyMap* pMap, sal_Int32 nPara )
+	throw( beans::UnknownPropertyException, uno::RuntimeException )
+{
 	do
 	{
-		SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : NULL;
-
-		if( NULL == pForwarder )
-			break;
-
-		CheckSelection( maSelection, mpEditSource->GetTextForwarder() );
-
-		const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName(maPropSet.getPropertyMap(), PropertyName );
-		if( NULL == pMap )
-			break;
-
 		SfxItemSet aSet( *pForwarder->GetPool(), TRUE );
 
 		if( pMap->nWID == WID_FONTDESC )
 		return;
 	}
 	while(0);
-
-	throw beans::UnknownPropertyException();
 }
 
 uno::Any SAL_CALL SvxUnoTextRangeBase::getPropertyDefault( const OUString& aPropertyName )
 	throw beans::UnknownPropertyException();
 }
 
+// beans::XMultiPropertyStates
+void SAL_CALL SvxUnoTextRangeBase::setAllPropertiesToDefault(  ) throw (uno::RuntimeException)
+{
+	OGuard aGuard( Application::GetSolarMutex() );
+
+	SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : NULL;
+
+    if( pForwarder )
+    {
+        for( const SfxItemPropertyMap* pMap = maPropSet.getPropertyMap(); pMap->pName; pMap++ )
+        {
+            _setPropertyToDefault( pForwarder, pMap, -1 );
+        }
+    }
+}
+
+void SAL_CALL SvxUnoTextRangeBase::setPropertiesToDefault( const uno::Sequence< OUString >& aPropertyNames ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+    sal_Int32 nCount = aPropertyNames.getLength();
+    for( const OUString* pName = aPropertyNames.getConstArray(); nCount; pName++, nCount-- )
+    {
+        setPropertyToDefault( *pName );
+    }
+}
+
+uno::Sequence< uno::Any > SAL_CALL SvxUnoTextRangeBase::getPropertyDefaults( const uno::Sequence< OUString >& aPropertyNames ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+    sal_Int32 nCount = aPropertyNames.getLength();
+    uno::Sequence< uno::Any > ret( nCount );
+    uno::Any* pDefaults = ret.getArray();
+
+    for( const OUString* pName = aPropertyNames.getConstArray(); nCount; pName++, nCount--, pDefaults++ )
+    {
+        *pDefaults = getPropertyDefault( *pName );
+    }
+
+    return ret;
+}
+
 // internal
 void SvxUnoTextRangeBase::CollapseToStart(void) throw()
 {
 	SvxUnoTextRangeBase* pR1 = SvxUnoTextRangeBase::getImplementation( xR1 );
 	SvxUnoTextRangeBase* pR2 = SvxUnoTextRangeBase::getImplementation( xR2 );
 
-	if( (pR1 == 0) || (pR2 == 0) || (pR1->mpEditSource != mpEditSource) || (pR2->mpEditSource != mpEditSource) )
+	if( (pR1 == 0) || (pR2 == 0) )
 		throw lang::IllegalArgumentException();
 
 	const ESelection& r1 = pR1->maSelection;
 	SvxUnoTextRangeBase* pR1 = SvxUnoTextRangeBase::getImplementation( xR1 );
 	SvxUnoTextRangeBase* pR2 = SvxUnoTextRangeBase::getImplementation( xR2 );
 
-	if( (pR1 == 0) || (pR2 == 0) || (pR1->mpEditSource->GetTextForwarder() != mpEditSource->GetTextForwarder()) || (pR2->mpEditSource->GetTextForwarder() != mpEditSource->GetTextForwarder()) )
+	if( (pR1 == 0) || (pR2 == 0) )
 		throw lang::IllegalArgumentException();
 
 	const ESelection& r1 = pR1->maSelection;
 	throw(uno::RuntimeException)
 {
 	QUERYINT( text::XTextRange );
-//	else if( rType == ::getCppuType((const uno::Reference< beans::XTolerantMultiPropertySet >*)0) )
-//		return uno::makeAny(uno::Reference< beans::XTolerantMultiPropertySet >(this));
+	else if( rType == ::getCppuType((const uno::Reference< beans::XMultiPropertyStates >*)0) )
+		return uno::makeAny(uno::Reference< beans::XMultiPropertyStates >(this));
 	else if( rType == ::getCppuType((const uno::Reference< beans::XPropertySet >*)0) )
 		return uno::makeAny(uno::Reference< beans::XPropertySet >(this));
 	else QUERYINT( beans::XPropertyState );
 {
 	if( maTypeSequence.getLength() == 0 )
 	{
-		maTypeSequence.realloc( 8 ); // !DANGER! keep this updated
+		maTypeSequence.realloc( 9 ); // !DANGER! keep this updated
 		uno::Type* pTypes = maTypeSequence.getArray();
 
 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
-//		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XTolerantMultiPropertySet >*)0);
+		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
         return uno::makeAny(uno::Reference< text::XTextRange >((text::XText*)(this)));
 	QUERYINT(container::XEnumerationAccess );
 	QUERYINT( container::XElementAccess );
-//	QUERYINT( beans::XTolerantMultiPropertySet );
+	QUERYINT( beans::XMultiPropertyStates );
 	QUERYINT( beans::XPropertySet );
 	QUERYINT( beans::XMultiPropertySet );
 	QUERYINT( beans::XPropertyState );
 {
 	if( maTypeSequence.getLength() == 0 )
 	{
-        maTypeSequence.realloc( 14 ); // !DANGER! keep this updated
+        maTypeSequence.realloc( 15 ); // !DANGER! keep this updated
 		uno::Type* pTypes = maTypeSequence.getArray();
 
 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XText >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
-//		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XTolerantMultiPropertySet >*)0);
+		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeMover >*)0);
         *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextAppend >*)0);

svx/source/unoedit/unotext2.cxx

 uno::Any SAL_CALL SvxUnoTextContent::queryAggregation( const uno::Type & rType ) throw( uno::RuntimeException )
 {
 	QUERYINT( text::XTextRange );
-//	else QUERYINT( beans::XTolerantMultiPropertySet );
+	else QUERYINT( beans::XMultiPropertyStates );
 	else QUERYINT( beans::XPropertySet );
 	else QUERYINT( beans::XMultiPropertySet );
 	else QUERYINT( beans::XPropertyState );
 {
 	if( maTypeSequence.getLength() == 0 )
 	{
-		maTypeSequence.realloc( 10 ); // !DANGER! keep this updated
+		maTypeSequence.realloc( 11 ); // !DANGER! keep this updated
 		uno::Type* pTypes = maTypeSequence.getArray();
 
 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
-//		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XTolerantMultiPropertySet >*)0);
+		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextContent >*)0);
 	if( rType == ::getCppuType((const uno::Reference< text::XTextRange >*)0) )
         return uno::makeAny(uno::Reference< text::XTextRange >((text::XText*)(this)));
 	else QUERYINT( text::XTextCursor );
-//	else QUERYINT( beans::XTolerantMultiPropertySet );
+	else QUERYINT( beans::XMultiPropertyStates );
 	else QUERYINT( beans::XPropertySet );
 	else QUERYINT( beans::XMultiPropertySet );
 	else QUERYINT( beans::XPropertyState );
 {
 	if( maTypeSequence.getLength() == 0 )
 	{
-		maTypeSequence.realloc( 9 ); // !DANGER! keep this updated
+		maTypeSequence.realloc( 10 ); // !DANGER! keep this updated
 		uno::Type* pTypes = maTypeSequence.getArray();
 
 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCursor >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
-//		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XTolerantMultiPropertySet >*)0);
+		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
 		*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);

sw/source/filter/ww8/writerhelper.cxx

             }
         }
 #endif
-
-        const OutlinerParaObject* GetOutlinerParaObject(const SdrTextObj &rObj)
-        {
-            /*
-            #i13885#
-            When the object is actively being edited, that text is not set into
-            the objects normal text object, but lives in a seperate object.
-            */
-            if (rObj.IsTextEditActive())
-                return rObj.GetEditOutlinerParaObject();
-            else
-                return rObj.GetOutlinerParaObject();
-        }
     }
 
     namespace util

sw/source/filter/ww8/writerhelper.hxx

             DrawingOLEAdaptor(const DrawingOLEAdaptor &rDoc);
         };
 
-        /** Get the Outliner Object from a SdrTextObj that contains the visible
-            text
-
-            A SdrTextObj contains an object which describes its text, but
-            frustratingly if the object is being actively edited this new text
-            outliner object is stored seperately from the previous preedit
-            outliner. So objects being edited have to be handled differently
-            from those that are not to return the currently being edited
-            outliner if its exists, and the normal outliner if not. This method
-            just gives me the text outliner that contains the visible text,
-            which is all anyone could really care about.
-
-            See OpenOffice.org issue 13885
-            (http://www.openoffice.org/issues/show_bug.cgi?id=13885)
-
-            @param SdrTextObj
-            The SdrTextObj from which we want to get the text content.
-
-            @return the OutlinerParaObject that describes the user visible text
-
-            @author
-            <a href="mailto:cmc@openoffice.org">Caol&aacute;n McNamara</a>
-        */
-        const OutlinerParaObject* GetOutlinerParaObject(const SdrTextObj &rObj);
-
 #ifdef DEBUGDUMP
         /** Create a SvStream to dump data to during debugging
 

sw/source/filter/ww8/wrtw8esh.cxx

     if (!pTxtObj)
         return;
 
-    if (const OutlinerParaObject* pParaObj = sw::hack::GetOutlinerParaObject(*pTxtObj))
+    const OutlinerParaObject* pParaObj = 0;
+    bool bOwnParaObj = false;
+
+    /*
+    #i13885#
+    When the object is actively being edited, that text is not set into
+    the objects normal text object, but lives in a seperate object.
+    */
+    if (pTxtObj->IsTextEditActive())
+    {
+        pParaObj = pTxtObj->GetEditOutlinerParaObject();
+        bOwnParaObj = true;
+    }
+    else
+    {
+        pParaObj = pTxtObj->GetOutlinerParaObject();
+    }
+
+    if( pParaObj )
+    {
         WriteOutliner(*pParaObj, nTyp);
+        if( bOwnParaObj )
+            delete pParaObj;
+    }
 }
 
 void SwWW8Writer::WriteOutliner(const OutlinerParaObject& rParaObj, BYTE nTyp)

sw/source/filter/ww8/ww8par.cxx

 #include <svx/unoapi.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/msdffimp.hxx>
+#include <svx/svdoashp.hxx>
 #include <svx/svxerr.hxx>
 #include <svx/mscodec.hxx>
 #include <svx/svdmodel.hxx>
 	{
 		SvxMSDffImportData& rImportData = *(SvxMSDffImportData*)pData;
 		SvxMSDffImportRec* pImpRec = new SvxMSDffImportRec;
-		SvxMSDffImportRec* pTextImpRec = pImpRec;
 
 		// fill Import Record with data
 		pImpRec->nShapeId   = rObjData.nShapeId;
 		}
 
 		//  Textrahmen, auch Title oder Outline
-		SdrObject*  pOrgObj  = pObj;
-		SdrRectObj* pTextObj = 0;
 		UINT32 nTextId = GetPropertyValue( DFF_Prop_lTxid, 0 );
 		if( nTextId )
 		{
                 );
             }
 
-            if (bIsSimpleDrawingTextBox)
-            {
-                SdrObject::Free( pObj );
-                pObj = pOrgObj = 0;
-            }
-
             // Distance of Textbox to it's surrounding Autoshape
 			INT32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 91440L);
 			INT32 nTextRight = GetPropertyValue( DFF_Prop_dxTextRight, 91440L );
                 }
 			}
 
-            pTextObj = new SdrRectObj(OBJ_TEXT, rTextRect);
-            pTextImpRec = new SvxMSDffImportRec(*pImpRec);
+            if (bIsSimpleDrawingTextBox)
+            {
+                SdrObject::Free( pObj );
+				pObj = new SdrRectObj(OBJ_TEXT, rTextRect);
+            }
 
             // Die vertikalen Absatzeinrueckungen sind im BoundRect mit drin,
             // hier rausrechnen
 				if( GetShapeInfos()->Seek_Entry( &aTmpRec, &nFound ) )
 				{
 					SvxMSDffShapeInfo& rInfo = *GetShapeInfos()->GetObject(nFound);
-					pTextImpRec->bReplaceByFly   = rInfo.bReplaceByFly;
-					pTextImpRec->bLastBoxInChain = rInfo.bLastBoxInChain;
+					pImpRec->bReplaceByFly   = rInfo.bReplaceByFly;
+					pImpRec->bLastBoxInChain = rInfo.bLastBoxInChain;
 				}
 			}
 
-			if( !pObj )
+			if( bIsSimpleDrawingTextBox )
                 ApplyAttributes( rSt, aSet, rObjData.eShapeType, rObjData.nSpFlags );
 
             bool bFitText = false;
 			{
 				case mso_wrapNone :
     				aSet.Put( SdrTextAutoGrowWidthItem( TRUE ) );
-                    pTextImpRec->bAutoWidth = true;
+                    pImpRec->bAutoWidth = true;
 				break;
 				case mso_wrapByPoints :
 					aSet.Put( SdrTextContourFrameItem( TRUE ) );
 			aSet.Put( SdrTextRightDistItem( nTextRight ) );
 			aSet.Put( SdrTextUpperDistItem( nTextTop ) );
 			aSet.Put( SdrTextLowerDistItem( nTextBottom ) );
-			pTextImpRec->nDxTextLeft	= nTextLeft;
-			pTextImpRec->nDyTextTop		= nTextTop;
-			pTextImpRec->nDxTextRight	= nTextRight;
-			pTextImpRec->nDyTextBottom	= nTextBottom;
-
-			// Textverankerung lesen
-			if ( IsProperty( DFF_Prop_anchorText ) )
+			pImpRec->nDxTextLeft	= nTextLeft;
+			pImpRec->nDyTextTop		= nTextTop;
+			pImpRec->nDxTextRight	= nTextRight;
+			pImpRec->nDyTextBottom	= nTextBottom;
+
+			// --> SJ 2009-03-06 : taking the correct default (which is mso_anchorTop)
+			MSO_Anchor eTextAnchor =
+                (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
+
+            SdrTextVertAdjust eTVA = bVerticalText
+                                     ? SDRTEXTVERTADJUST_BLOCK
+                                     : SDRTEXTVERTADJUST_CENTER;
+            SdrTextHorzAdjust eTHA = bVerticalText
+                                     ? SDRTEXTHORZADJUST_CENTER
+                                     : SDRTEXTHORZADJUST_BLOCK;
+
+			switch( eTextAnchor )
+            {
+                case mso_anchorTop:
+                {
+                    if ( bVerticalText )
+                        eTHA = SDRTEXTHORZADJUST_RIGHT;
+                    else
+                        eTVA = SDRTEXTVERTADJUST_TOP;
+                }
+                break;
+                case mso_anchorTopCentered:
+                {
+                    if ( bVerticalText )
+                        eTHA = SDRTEXTHORZADJUST_RIGHT;
+                    else
+                        eTVA = SDRTEXTVERTADJUST_TOP;
+                }
+                break;
+                case mso_anchorMiddle:
+                break;
+                case mso_anchorMiddleCentered:
+                break;
+                case mso_anchorBottom:
+                {
+                    if ( bVerticalText )
+                        eTHA = SDRTEXTHORZADJUST_LEFT;
+                    else
+                        eTVA = SDRTEXTVERTADJUST_BOTTOM;
+                }
+                break;
+                case mso_anchorBottomCentered:
+                {
+                    if ( bVerticalText )
+                        eTHA = SDRTEXTHORZADJUST_LEFT;
+                    else
+                        eTVA = SDRTEXTVERTADJUST_BOTTOM;
+                }
+                break;
+/*
+				case mso_anchorTopBaseline:
+				case mso_anchorBottomBaseline:
+				case mso_anchorTopCenteredBaseline:
+				case mso_anchorBottomCenteredBaseline:
+				break;
+*/
+				default:
+					;
+			}
+
+            aSet.Put( SdrTextVertAdjustItem( eTVA ) );
+            aSet.Put( SdrTextHorzAdjustItem( eTHA ) );
+
+			pObj->SetMergedItemSet(aSet);
+            pObj->SetModel(pSdrModel);
+
+            if (bVerticalText && dynamic_cast< SdrTextObj* >( pObj ) )				
+                dynamic_cast< SdrTextObj* >( pObj )->SetVerticalWriting(sal_True);
+
+            if ( bIsSimpleDrawingTextBox )
 			{
-				MSO_Anchor eTextAnchor =
-                    (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText );
-
-                // --> OD 2005-02-17 #i42783#, #b6227886#
-                // consider vertical text and use correct defaults
-                SdrTextVertAdjust eTVA = bVerticalText
-                                         ? SDRTEXTVERTADJUST_BLOCK
-                                         : SDRTEXTVERTADJUST_CENTER;
-                SdrTextHorzAdjust eTHA = bVerticalText
-                                         ? SDRTEXTHORZADJUST_CENTER
-                                         : SDRTEXTHORZADJUST_BLOCK;
-
-                switch( eTextAnchor )
-                {
-                    case mso_anchorTop:
-                    {
-                        if ( bVerticalText )
-                            eTHA = SDRTEXTHORZADJUST_RIGHT;
-                        else
-                            eTVA = SDRTEXTVERTADJUST_TOP;
-                    }
-                    break;
-                    case mso_anchorTopCentered:
-                    {
-                        if ( bVerticalText )
-                            eTHA = SDRTEXTHORZADJUST_RIGHT;
-                        else
-                            eTVA = SDRTEXTVERTADJUST_TOP;
-                    }
-                    break;
-                    case mso_anchorMiddle:
-                    break;
-                    case mso_anchorMiddleCentered:
-                    break;
-                    case mso_anchorBottom:
-                    {
-                        if ( bVerticalText )
-                            eTHA = SDRTEXTHORZADJUST_LEFT;
-                        else
-                            eTVA = SDRTEXTVERTADJUST_BOTTOM;
-                    }
-                    break;
-                    case mso_anchorBottomCentered:
-                    {
-                        if ( bVerticalText )
-                            eTHA = SDRTEXTHORZADJUST_LEFT;
-                        else
-                            eTVA = SDRTEXTVERTADJUST_BOTTOM;
-                    }
-                    break;
-	/*
-					case mso_anchorTopBaseline:
-					case mso_anchorBottomBaseline:
-					case mso_anchorTopCenteredBaseline:
-					case mso_anchorBottomCenteredBaseline:
-					break;
-	*/
-					default:
-						;
+				if ( nTextRotationAngle )
+				{
+					long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ?
+						rTextRect.GetWidth() : rTextRect.GetHeight();
+					nMinWH /= 2;
+					Point aPivot(rTextRect.TopLeft());
+					aPivot.X() += nMinWH;