Commits

Anonymous committed 35a378a Merge

resynced to m98

  • Participants
  • Parent commits 0ef6282, 4b862a2

Comments (0)

Files changed (205)

 41b0797e09ed77cf6b719fe7c39119d682d24749 DEV300_m95
 8650e94f45129904b7dcb52e6519d0fb4a3c894d OOO330_m18
 41e86e55f8a9f2179f3d1fc1741116280d7a54e1 DEV300_m96
+19d9ebadebea40835d874a702fd86c8281d4cd52 DEV300_m97

RepositoryFixes.mk

 
 
 ifeq ($(OS),WNT)
+ifneq ($(USE_MINGW),)
+gb_Library_FILENAMES := $(patsubst comphelper:icomphelper%,comphelper:icomphelp%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst cui:icui%,cui:icuin%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst i18nisolang1:ii18nisolang1%,i18nisolang1:ii18nisolang%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst i18nisolang1:iii18nisolang1%,i18nisolang1:iii18nisolang%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst sb:isb%,sb:basic%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst sfx:isfx%,sfx:sfx%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst svt:isvt%,svt:svtool%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst tl:itl%,tl:itools%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst vbahelper:ivbahelper%,vbahelper:vbahelper%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst vos3:ivos3%,vos3:ivos%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst xml2:ixml2%,xml2:libxml2$(gb_Library_IARCEXT),$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst z:iz%,z:zlib%,$(gb_Library_FILENAMES))
+ifeq ($(gb_PRODUCT),$(true))
+gb_Library_FILENAMES := $(patsubst stl:istl%,stl:stlport_vc71%,$(gb_Library_FILENAMES))
+else
+gb_Library_FILENAMES := $(patsubst stl:istl%,stl:stlport_vc71_stldebug%,$(gb_Library_FILENAMES))
+endif
+gb_Library_NOILIBFILENAMES:=\
+	icuuc \
+	sot \
+	uwinapi \
+
+gb_Library_FILENAMES := $(filter-out $(foreach lib,$(gb_Library_NOILIBFILENAMES),$(lib):%),$(gb_Library_FILENAMES))
+gb_Library_FILENAMES += $(foreach lib,$(gb_Library_NOILIBFILENAMES),$(lib):$(lib)$(gb_Library_PLAINEXT))
+
+gb_Library_ILIBFILENAMES:=\
+	unicows \
+	uuid \
+
+gb_Library_DLLFILENAMES := $(filter-out $(foreach lib,$(gb_Library_ILIBFILENAMES),$(lib):%),$(gb_Library_DLLFILENAMES))
+gb_Library_DLLFILENAMES += $(foreach lib,$(gb_Library_ILIBFILENAMES),$(lib):$(PSDK_HOME)/lib/$(lib)$(gb_Library_ILIBEXT))
+
+gb_Library_DLLFILENAMES := $(patsubst comphelper:comphelper%,comphelper:comphelp4%,$(gb_Library_DLLFILENAMES))
+gb_Library_DLLFILENAMES := $(patsubst icuuc:icuuc%,icuuc:icuuc40%,$(gb_Library_DLLFILENAMES))
+gb_Library_DLLFILENAMES := $(patsubst ucbhelper:ucbhelper%,ucbhelper:ucbhelper4%,$(gb_Library_DLLFILENAMES))
+gb_Library_DLLFILENAMES := $(patsubst z:z%,z:zlib%,$(gb_Library_DLLFILENAMES))
+
+ifeq ($(USE_SYSTEM_STL),YES)
+gb_Library_FILENAMES := $(patsubst stl:%,stl:$(gb_Library_IARCSYSPRE)stdc++_s$(gb_Library_IARCSYSPRE),$(gb_Library_FILENAMES))
+gb_Library_TARGETS := $(filter-out stl,$(gb_Library_TARGETS))
+endif
+
+else
 gb_Library_FILENAMES := $(patsubst comphelper:icomphelper%,comphelper:icomphelp%,$(gb_Library_FILENAMES))
 gb_Library_FILENAMES := $(patsubst cui:icui%,cui:icuin%,$(gb_Library_FILENAMES))
 gb_Library_FILENAMES := $(patsubst i18nisolang1:ii18nisolang1%,i18nisolang1:ii18nisolang%,$(gb_Library_FILENAMES))
 
 endif
 
+endif
+
 ifeq ($(OS),SOLARIS)
 gb_Library_FILENAMES := $(patsubst comphelper:libcomphelper%,comphelper:libcomphelp4%,$(gb_Library_FILENAMES))
 gb_Library_FILENAMES := $(patsubst cppuhelper:libcppuhelper%,cppuhelper:libuno_cppuhelper%,$(gb_Library_FILENAMES))
 endif
 
 # vim: set noet sw=4 ts=4:
-

basic/source/basmgr/basicmanagerrepository.cxx

 
         // register as listener for the BasicManager being destroyed
         StartListening( *_out_rpBasicManager );
+
+        // #i104876: Library container must not be modified just after
+        // creation. This happens as side effect when creating default
+        // "Standard" libraries and needs to be corrected here
+        xBasicLibs->setModified( sal_False );
+        xDialogLibs->setModified( sal_False );
+
     }
 
     //--------------------------------------------------------------------

basic/source/classes/sbunoobj.cxx

 	return sbxToUnoValueImpl( pVar );
 }
 
+
+// Funktion, um einen globalen Bezeichner im
+// UnoScope zu suchen und fuer Sbx zu wrappen
+static bool implGetTypeByName( const String& rName, Type& rRetType )
+{
+	bool bSuccess = false;
+
+    Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
+    if( xTypeAccess->hasByHierarchicalName( rName ) )
+    {
+        Any aRet = xTypeAccess->getByHierarchicalName( rName );
+		Reference< XTypeDescription > xTypeDesc;
+		aRet >>= xTypeDesc;
+
+        if( xTypeDesc.is() )
+        {
+			rRetType = Type( xTypeDesc->getTypeClass(), xTypeDesc->getName() );
+			bSuccess = true;
+        }
+    }
+	return bSuccess;
+}
+
+
 // Konvertierung von Sbx nach Uno mit bekannter Zielklasse
 Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty )
 {
 		}
 		break;
 
+		case TypeClass_TYPE:
+		{
+			if( eBaseType == SbxOBJECT )
+			{
+				// XIdlClass?
+				Reference< XIdlClass > xIdlClass;
+
+				SbxBaseRef pObj = (SbxBase*)pVar->GetObject();
+				if( pObj && pObj->ISA(SbUnoObject) )
+				{
+					Any aUnoAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny();
+					aUnoAny >>= xIdlClass;
+				}
+
+				if( xIdlClass.is() )
+				{
+					::rtl::OUString aClassName = xIdlClass->getName();
+					Type aType( xIdlClass->getTypeClass(), aClassName.getStr() );
+					aRetVal <<= aType;
+				}
+			}
+			else if( eBaseType == SbxSTRING )
+			{
+				// String representing type?
+				String aTypeName = pVar->GetString();
+				Type aType;
+				bool bSuccess = implGetTypeByName( aTypeName, aType );
+				if( bSuccess )
+					aRetVal <<= aType;
+			}
+		}
+		break;
+
 		/* folgende Typen lassen wir erstmal weg
 		case TypeClass_SERVICE:			break;
 		case TypeClass_CLASS:			break;
     (void)pBasic;
     (void)bWrite;
 
+	static String aTypeTypeString( RTL_CONSTASCII_USTRINGPARAM("type") );
+
 	// 2 parameters needed
 	if ( rPar.Count() != 3 )
 	{
 	String aTypeName = rPar.Get(1)->GetString();
     SbxVariable* pVal = rPar.Get(2);
 
+	if( aTypeName == aTypeTypeString )
+	{
+		SbxDataType eBaseType = pVal->SbxValue::GetType();
+		String aValTypeName;
+		if( eBaseType == SbxSTRING )
+		{
+			aValTypeName = pVal->GetString();
+		}
+		else if( eBaseType == SbxOBJECT )
+		{
+			// XIdlClass?
+			Reference< XIdlClass > xIdlClass;
+
+			SbxBaseRef pObj = (SbxBase*)pVal->GetObject();
+			if( pObj && pObj->ISA(SbUnoObject) )
+			{
+				Any aUnoAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny();
+				aUnoAny >>= xIdlClass;
+			}
+
+			if( xIdlClass.is() )
+				aValTypeName = xIdlClass->getName();
+		}
+		Type aType;
+		bool bSuccess = implGetTypeByName( aValTypeName, aType );
+		if( bSuccess )
+		{
+			Any aTypeAny( aType );
+			SbxVariableRef refVar = rPar.Get(0);
+			SbxObjectRef xUnoAnyObject = new SbUnoAnyObject( aTypeAny );
+			refVar->PutObject( xUnoAnyObject );
+		}
+		return;
+	}
+
     // Check the type
     Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
     Any aRet;

basic/source/runtime/dllmgr.cxx

         return e;
     }
     std::vector< char > * blob = data.newBlob();
-    blob->insert(blob->begin(), str.getStr(), str.getStr() + str.getLength());
+    blob->insert(
+        blob->begin(), str.getStr(), str.getStr() + str.getLength() + 1);
     *buffer = address(*blob);
     data.unmarshalStrings.push_back(StringData(variable, *buffer, special));
     return ERRCODE_NONE;

berkeleydb/makefile.mk

 db_LIBS=
 .IF "$(MINGW_SHARED_GXXLIB)"=="YES"
 CFLAGS+=-D_GLIBCXX_DLL
-db_LIBS+=-lstdc++_s
+db_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
 .ENDIF
 db_LIBXSO_LIBS=$(LIBSTLPORT) $(db_LIBS)
 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"

binfilter/inc/bf_so3/svstor.hxx

 {
 	pObj = (SvStorage *)SvStorage::ClassFactory()->CastAndAddRef( pObjP );
 }
-inline SvStorageRef::SvStorageRef( SotObject * pObjP, SvCastEnum )
-{
-	pObj = (SvStorage *)SvStorage::ClassFactory()->AggCastAndAddRef( pObjP );
-}
 
 }
 

cairo/cairo/makefile.mk

 cairo_CC+=-shared-libgcc
 .ENDIF
 .IF "$(MINGW_SHARED_GXXLIB)"=="YES"
-cairo_LIBS+=-lstdc++_s
+cairo_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
 .ENDIF
 
 CONFIGURE_DIR=

chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx

 
     virtual bool setsCategories( bool bDataInColumns )
     {
-        return !bDataInColumns;
+        return bDataInColumns;
     }
 
     virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )

chart2/source/controller/dialogs/dlg_ObjectProperties.cxx

 #include "chartview/NumberFormatterWrapper.hxx"
 #include "AxisIndexDefines.hxx"
 #include "AxisHelper.hxx"
+#include "ExplicitCategoriesProvider.hxx"
 
 #include <com/sun/star/chart2/XAxis.hpp>
 #include <com/sun/star/chart2/XChartType.hpp>
         , m_bIsCrossingAxisIsCategoryAxis(false)
         , m_aCategories()
         , m_xChartDocument( 0 )
+        , m_bComplexCategoriesAxis( false )
 {
     rtl::OUString aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID );
     m_bAffectsMultipleObjects = aParticleID.equals(C2U("ALLELEMENTS"));
                     if( m_bIsCrossingAxisIsCategoryAxis )
                         m_aCategories = DiagramHelper::getExplicitSimpleCategories( Reference< chart2::XChartDocument >( xChartModel, uno::UNO_QUERY) );
                 }
+
+                m_bComplexCategoriesAxis = false;
+                if ( nDimensionIndex == 0 && aData.AxisType == chart2::AxisType::CATEGORY )
+                {
+                    ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys, xChartModel ); 
+                    m_bComplexCategoriesAxis = aExplicitCategoriesProvider.hasComplexCategories();
+                }
             }
         }
 
 {
     return m_xChartDocument;
 }
+bool ObjectPropertiesDialogParameter::IsComplexCategoriesAxis() const
+{
+    return m_bComplexCategoriesAxis;
+}
 
 //const USHORT nNoArrowDlg          = 1100;
 const USHORT nNoArrowNoShadowDlg    = 1101;
         {
             bool bShowStaggeringControls = m_pParameter->CanAxisLabelsBeStaggered();
             ((SchAxisLabelTabPage&)rPage).ShowStaggeringControls( bShowStaggeringControls );
+            ( dynamic_cast< SchAxisLabelTabPage& >( rPage ) ).SetComplexCategories( m_pParameter->IsComplexCategoriesAxis() );
             break;
         }
 

chart2/source/controller/dialogs/tp_AxisLabel.cxx

         m_nInitialDegrees( 0 ),
         m_bHasInitialDegrees( true ),
         m_bInitialStacking( false ),
-        m_bHasInitialStacking( true )
+        m_bHasInitialStacking( true ),
+        m_bComplexCategories( false )
 {
 	FreeResource();
 
 	}
 }
 
+void SchAxisLabelTabPage::SetComplexCategories( bool bComplexCategories )
+{
+    m_bComplexCategories = bComplexCategories;
+}
+
 // event handling routines
 // -----------------------
 
 	aRbAuto.Enable( bEnable );
 
 	aFlTextFlow.Enable( bEnable );
-	aCbTextOverlap.Enable( bEnable );
+	aCbTextOverlap.Enable( bEnable && !m_bComplexCategories );
 	aCbTextBreak.Enable( bEnable );
 
     m_aFtTextDirection.Enable( bEnable );

chart2/source/controller/dialogs/tp_AxisLabel.hxx

     bool                m_bHasInitialDegrees;       /// false = DialControl in tristate
     bool                m_bInitialStacking;
     bool                m_bHasInitialStacking;      /// false = checkbox in tristate
+    bool                m_bComplexCategories;
 
     DECL_LINK ( ToggleShowLabel, void* );
 
 	virtual void Reset( const SfxItemSet& rInAttrs );
 
     void ShowStaggeringControls( BOOL bShowStaggeringControls );
+    void SetComplexCategories( bool bComplexCategories );
 };
 //.............................................................................
 } //namespace chart

chart2/source/controller/inc/dlg_ObjectProperties.hxx

     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
         getDocument() const;
 
+    bool IsComplexCategoriesAxis() const;
+
 private:
 	rtl::OUString	m_aObjectCID;
 	ObjectType		m_eObjectType;
     ::com::sun::star::uno::Sequence< rtl::OUString > m_aCategories;
 
     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > m_xChartDocument;
+
+    bool m_bComplexCategoriesAxis;
 };
 
 /*************************************************************************

chart2/source/view/axes/VCartesianAxis.cxx

 #include <com/sun/star/text/XText.hpp>
 #include <com/sun/star/text/WritingMode2.hpp>
 #include <editeng/unoprnms.hxx>
+#include <svx/unoshape.hxx>
+#include <svx/unoshtxt.hxx>
 
 #include <algorithm>
 #include <memory>
 
     //correctPositionForRotation
     LabelPositionHelper::correctPositionForRotation( xShape2DText
-        , rAxisProperties.m_aLabelAlignment, rAxisLabelProperties.fRotationAngleDegree, false );
+        , rAxisProperties.m_aLabelAlignment, rAxisLabelProperties.fRotationAngleDegree, rAxisProperties.m_bComplexCategories );
 
     return xShape2DText;
 }
     return pTickInfo;
 }
 
-B2DVector lcl_getLabelsDistance( TickIter& rIter, const B2DVector& rDistanceTickToText )
+B2DVector lcl_getLabelsDistance( TickIter& rIter, const B2DVector& rDistanceTickToText, double fRotationAngleDegree )
 {
     //calculates the height or width of a line of labels
     //thus a following line of labels can be shifted for that distance
         xShape2DText = pTickInfo->xTextShape;
         if( xShape2DText.is() )
         {
-            awt::Size aSize  = xShape2DText->getSize();
+            awt::Size aSize = ShapeFactory::getSizeAfterRotation( xShape2DText, fRotationAngleDegree );
             if(fabs(aStaggerDirection.getX())>fabs(aStaggerDirection.getY()))
                 nDistance = ::std::max(nDistance,aSize.Width);
             else
     }
 }
 
+bool lcl_hasWordBreak( const Reference< drawing::XShape >& rxShape )
+{
+    if ( rxShape.is() )
+    {
+        SvxShape* pShape = SvxShape::getImplementation( rxShape );
+        SvxShapeText* pShapeText = dynamic_cast< SvxShapeText* >( pShape );
+        if ( pShapeText )
+        {
+            SvxTextEditSource* pTextEditSource = dynamic_cast< SvxTextEditSource* >( pShapeText->GetEditSource() );
+            if ( pTextEditSource )
+            {
+                pTextEditSource->UpdateOutliner();
+                SvxTextForwarder* pTextForwarder = pTextEditSource->GetTextForwarder();
+                if ( pTextForwarder )
+                {
+                    USHORT nParaCount = pTextForwarder->GetParagraphCount();
+                    for ( USHORT nPara = 0; nPara < nParaCount; ++nPara )
+                    {
+                        USHORT nLineCount = pTextForwarder->GetLineCount( nPara );
+                        for ( USHORT nLine = 0; nLine < nLineCount; ++nLine )
+                        {
+                            USHORT nLineStart = 0;
+                            USHORT nLineEnd = 0;
+                            pTextForwarder->GetLineBoundaries( nLineStart, nLineEnd, nPara, nLine );
+                            USHORT nWordStart = 0;
+                            USHORT nWordEnd = 0;
+                            if ( pTextForwarder->GetWordIndices( nPara, nLineStart, nWordStart, nWordEnd ) &&
+                                 ( nWordStart != nLineStart ) )
+                            {
+                                return true;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    return false;
+}
+
 class MaxLabelEquidistantTickIter : public EquidistantTickIter
 {
     //iterate over first two and last two labels and the longest label
 
         recordMaximumTextSize( pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree );
 
+         //better rotate if single words are broken apart
+        if( nLimitedSpaceForText>0 && !rAxisLabelProperties.bOverlapAllowed
+                && ::rtl::math::approxEqual( rAxisLabelProperties.fRotationAngleDegree, 0.0 )
+                && m_aAxisProperties.m_bComplexCategories
+                && lcl_hasWordBreak( pTickInfo->xTextShape ) )
+        {
+            rAxisLabelProperties.fRotationAngleDegree = 90;
+            rAxisLabelProperties.bLineBreakAllowed = false;
+            m_aAxisLabelProperties.fRotationAngleDegree = rAxisLabelProperties.fRotationAngleDegree;
+            removeTextShapesFromTicks();
+            return false;
+        }
+        
         //if NO OVERLAP -> remove overlapping shapes
         if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.bOverlapAllowed )
         {
-            if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, m_aAxisLabelProperties.fRotationAngleDegree ) )
+            if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree ) )
             {
                 bool bOverlapAlsoAfterSwitchingOnAutoStaggering = true;
                 if( !bIsStaggered && isAutoStaggeringOfLabelsAllowed( rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis ) )
             ::std::auto_ptr< TickIter > apTickIter = createLabelTickIterator( nTextLevel );
             if(apTickIter.get())
             {
+                double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
                 if( nTextLevel>0 )
+                {
                     lcl_shiftLables( *apTickIter.get(), aCummulatedLabelsDistance );
+                    fRotationAngleDegree = 0.0;
+                }
                 aCummulatedLabelsDistance += lcl_getLabelsDistance( *apTickIter.get()
-                    , pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties ) );
+                    , pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties )
+                    , fRotationAngleDegree );
             }
         }
     }
 
         lcl_shiftLables( aOuterIter
             , lcl_getLabelsDistance( aInnerIter
-                , pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties ) ) );
+                , pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties ), 0.0 ) );
     }
 }
 
                         nScreenDistanceBetweenTicks*=2; //the above used tick iter does contain also the sub ticks -> thus the given distance is only the half
                 }
 
-                AxisLabelProperties aCopy(m_aAxisLabelProperties);
-                aCopy.bRhythmIsFix = true;
-                aCopy.nRhythm = 1;
-                AxisLabelProperties& rAxisLabelProperties = nTextLevel==0 ? m_aAxisLabelProperties : aCopy;
+                AxisLabelProperties aComplexProps(m_aAxisLabelProperties);
+                if( m_aAxisProperties.m_bComplexCategories )
+                {
+                    if( nTextLevel==0 )
+                    {
+                        aComplexProps.bLineBreakAllowed = true;
+                        aComplexProps.bOverlapAllowed = !::rtl::math::approxEqual( aComplexProps.fRotationAngleDegree, 0.0 );
+                    }
+                    else
+                    {
+                        aComplexProps.bOverlapAllowed = true;
+                        aComplexProps.bRhythmIsFix = true;
+                        aComplexProps.nRhythm = 1;
+                        aComplexProps.fRotationAngleDegree = 0.0;
+                    }
+                }
+                AxisLabelProperties& rAxisLabelProperties =  m_aAxisProperties.m_bComplexCategories ? aComplexProps : m_aAxisLabelProperties;
                 while( !createTextShapes( m_xTextTarget, *apTickIter.get(), rAxisLabelProperties, pTickmarkHelper2D, nScreenDistanceBetweenTicks ) )
                 {
                 };
 
         ::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = m_aAllTickInfos.begin();
         const ::std::vector< ::std::vector< TickInfo > >::const_iterator aDepthEnd  = m_aAllTickInfos.end();
-        for( ; aDepthIter != aDepthEnd; aDepthIter++ )
+        for( sal_Int32 nDepth=0; aDepthIter != aDepthEnd; aDepthIter++, nDepth++ )
         {
             ::std::vector< TickInfo >::iterator aTickIter = aDepthIter->begin();
             const ::std::vector< TickInfo >::const_iterator aTickEnd  = aDepthIter->end();
                         static_cast<sal_Int32>(aTickScreenPos2D.getX())
                         ,static_cast<sal_Int32>(aTickScreenPos2D.getY()));
 
+                    double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
+                    if( nDepth>0 )
+                        fRotationAngleDegree = 0.0;
+
                     // #i78696# use mathematically correct rotation now
-                    const double fRotationAnglePi(m_aAxisLabelProperties.fRotationAngleDegree * (F_PI / -180.0));
+                    const double fRotationAnglePi(fRotationAngleDegree * (F_PI / -180.0));
                     uno::Any aATransformation = ShapeFactory::makeTransformation(aAnchorScreenPosition2D, fRotationAnglePi);
 
                     //set new position
 
                     //correctPositionForRotation
                     LabelPositionHelper::correctPositionForRotation( xShape2DText
-                        , m_aAxisProperties.m_aLabelAlignment, m_aAxisLabelProperties.fRotationAngleDegree, false );
+                        , m_aAxisProperties.m_aLabelAlignment, fRotationAngleDegree, m_aAxisProperties.m_bComplexCategories );
                 }                
             }
         }
                 ::std::auto_ptr< TickIter > apTickIter = createLabelTickIterator( nTextLevel );
                 if( apTickIter.get() )
                 {
-                    B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, false ) ) );
+                    double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
+                    if( nTextLevel>0 )
+                        fRotationAngleDegree = 0.0;
+                    B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, false ), fRotationAngleDegree ) );
                     sal_Int32 nCurrentLength = static_cast<sal_Int32>(aLabelsDistance.getLength());
                     aTickmarkPropertiesList.push_back( m_aAxisProperties.makeTickmarkPropertiesForComplexCategories( nOffset + nCurrentLength, 0, nTextLevel ) );
                     nOffset += nCurrentLength;
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS EGREP AWK SED LOCAL_SOLENV _solenv UPD SOURCEVERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os GNUTAR OSVERSION PTHREAD_CFLAGS PTHREAD_LIBS ENABLE_CRASHDUMP VC_STANDARD ENABLE_WERROR ENABLE_DEBUG PRODUCT PROFULLSWITCH PROEXT ENABLE_SYMBOLS DISABLE_STRIP ENABLE_CUPS ENABLE_FONTCONFIG TARFILE_LOCATION DO_FETCH_TARBALLS WITH_BINFILTER ENABLE_DIRECTX DISABLE_ACTIVEX DISABLE_ATL ENABLE_RPATH WITH_MYSPELL_DICTS SYSTEM_DICTS DICT_SYSTEM_DIR HYPH_SYSTEM_DIR THES_SYSTEM_DIR WITH_MINGWIN SHELLPATH GCC_HOME CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT COMPATH GCCVER HAVE_LD_BSYMBOLIC_FUNCTIONS ENABLE_PCH GNUMAKE _cc HAVE_LD_HASH_STYLE PERL MSPDB_PATH COMEX USE_MINGW MIDL_PATH CSC_PATH FRAME_HOME CPP CXX CXXFLAGS ac_ct_CXX CXXCPP SIZEOF_LONG WORDS_BIGENDIAN LFS_CFLAGS ENABLE_VBA VBA_EXTENSION PAM NEW_SHADOW_API PAM_LINK CRYPT_LINK GXX_INCLUDE_PATH MINGW_LIB_INCLUDE_PATH MINGW_BACKWARD_INCLUDE_PATH MINGW_CLIB_DIR MINGW_SHARED_GCCLIB MINGW_GCCLIB_EH MINGW_SHARED_GXXLIB MINGW_GCCDLL MINGW_GXXDLL EXCEPTIONS STLPORT4 STLPORT_VER USE_SYSTEM_STL USE_CCACHE CCACHE HAVE_GCC_VISIBILITY_FEATURE ALLOC BUILD_VER_STRING SOLAR_JAVA JAVAINTERPRETER JAVACOMPILER JAVACISGCJ JAVADOC AWTLIB JAVAAOTCOMPILER JAVA_HOME JDK JAVAFLAGS JAVAIFLAGS DMAKE BUILD_DMAKE EPM DPKG PKGMK BUILD_EPM RPM PKGFORMAT GPERF BUILD_STAX MINGWCXX ac_ct_MINGWCXX MINGWSTRIP ac_ct_MINGWSTRIP BUILD_UNOWINREG SYSTEM_STDLIBS SYSTEM_ZLIB SYSTEM_JPEG SYSTEM_EXPAT PKG_CONFIG LIBWPD_CFLAGS LIBWPD_LIBS SYSTEM_LIBWPD CPPUNIT_CFLAGS CPPUNIT_LIBS SYSTEM_CPPUNIT FREETYPE_CFLAGS FREETYPE_LIBS USE_FT_EMBOLDEN LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC SYSTEM_LIBXSLT LIBXML_CFLAGS LIBXML_LIBS SYSTEM_LIBXML PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir BZIP2 SYSTEM_PYTHON PYTHON_CFLAGS PYTHON_LIBS HOME SYSTEM_DB DB_VERSION DB_INCLUDES DB_JAR SYSTEM_LUCENE LUCENE_CORE_JAR LUCENE_ANALYZERS_JAR ENABLE_MYSQLC MYSQLCONFIG SYSTEM_MYSQL MYSQL_INC MYSQL_LIB MYSQL_DEFINES LIBMYSQL_PATH SYSTEM_MYSQL_CPPCONN SYSTEM_HSQLDB HSQLDB_JAR SYSTEM_BSH BSH_JAR SERIALIZER_JAR SYSTEM_SAXON SAXON_JAR CURLCONFIG SYSTEM_CURL CURL_CFLAGS CURL_LIBS SYSTEM_MDDS SYSTEM_BOOST SYSTEM_VIGRA SYSTEM_ODBC_HEADERS WITH_MOZILLA WITH_LDAP WITH_OPENLDAP MOZ_NSS_CFLAGS MOZ_NSS_LIBS NSS_LIB MOZ_NSPR_CFLAGS MOZ_NSPR_LIBS NSPR_LIB MOZILLAXPCOM_CFLAGS MOZILLAXPCOM_LIBS MOZILLA_VERSION MOZILLA_TOOLKIT MOZGTK2_CFLAGS MOZGTK2_LIBS MOZLIBREQ_CFLAGS MOZLIBREQ_LIBS BUILD_MOZAB ENABLE_NSS_MODULE MOZILLABUILD SYSTEM_MOZILLA MOZ_FLAVOUR MOZ_INC MOZ_LIB MOZ_LIB_XPCOM MOZ_LDAP_CFLAGS SYSTEM_SANE_HEADER SYSTEM_GENBRK SYSTEM_GENCCODE SYSTEM_GENCMN SYSTEM_ICU GRAPHITE_CFLAGS GRAPHITE_LIBS ENABLE_GRAPHITE SYSTEM_GRAPHITE X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XINC XLIB XAU_LIBS DISABLE_XAW SYSTEM_XRENDER_HEADERS XRENDER_LINK XRANDR_CFLAGS XRANDR_LIBS XRANDR_DLOPEN ENABLE_RANDR DISABLE_NEON NEON_CFLAGS NEON_LIBS SYSTEM_NEON NEON_VERSION OPENSSL_CFLAGS OPENSSL_LIBS SYSTEM_OPENSSL ENABLE_AGG AGG_CFLAGS AGG_LIBS SYSTEM_AGG AGG_VERSION REDLAND_CFLAGS REDLAND_LIBS SYSTEM_REDLAND HUNSPELL_CFLAGS HUNSPELL_LIBS SYSTEM_HUNSPELL SYSTEM_HYPH HYPHEN_LIB MYTHES_CFLAGS MYTHES_LIBS SYSTEM_MYTHES SYSTEM_LPSOLVE SYSTEM_LIBTEXTCAT SYSTEM_LIBTEXTCAT_DATA HAVE_GETOPT HAVE_READDIR_R SYSTEM_LIBC PSDK_HOME WINDOWS_VISTA_PSDK DIRECTXSDK_HOME DIRECTXSDK_LIB NSIS_PATH BISON FLEX PATCH GNUCP GNUPATCH CYGWIN_PATH ML_EXE ASM_HOME ZIP UNZIP ZIP_HOME ENABLE_GTK ENABLE_KDE ENABLE_KDE4 GCONF_CFLAGS GCONF_LIBS ENABLE_GCONF GNOMEVFS_CFLAGS GNOMEVFS_LIBS ENABLE_GNOMEVFS GTK_CFLAGS GTK_LIBS DBUS_CFLAGS DBUS_LIBS GIO_CFLAGS GIO_LIBS ENABLE_GIO ENABLE_DBUS ENABLE_SYSTRAY_GTK GSTREAMER_CFLAGS GSTREAMER_LIBS ENABLE_GSTREAMER CAIRO_CFLAGS CAIRO_LIBS ENABLE_CAIRO BUILD_PIXMAN SYSTEM_CAIRO ENABLE_OPENGL ENABLE_PRESENTER_EXTRA_UI ENABLE_MINIMIZER ENABLE_PRESENTER_SCREEN POPPLER_CFLAGS POPPLER_LIBS ENABLE_PDFIMPORT SYSTEM_POPPLER ENABLE_MEDIAWIKI SYSTEM_SERVLETAPI SERVLETAPI_JAR ENABLE_REPORTBUILDER SYSTEM_JFREEREPORT SAC_JAR LIBXML_JAR FLUTE_JAR JFREEREPORT_JAR LIBBASE_JAR LIBLAYOUT_JAR LIBLOADER_JAR LIBFORMULA_JAR LIBREPOSITORY_JAR LIBFONTS_JAR LIBSERIALIZER_JAR SYSTEM_APACHE_COMMONS COMMONS_CODEC_JAR COMMONS_LANG_JAR COMMONS_HTTPCLIENT_JAR COMMONS_LOGGING_JAR MOC KDE_CFLAGS KDE_LIBS MOC4 KDE4_CFLAGS KDE4_LIBS ENABLE_LOCKDOWN GOBJECT_CFLAGS GOBJECT_LIBS ENABLE_EVOAB2 ENABLE_KAB WITH_FONTS WITHOUT_PPDS WITHOUT_AFMS SCPDEFS USE_XINERAMA XINERAMA_LINK ANT ANT_HOME ANT_LIB OOO_JUNIT_JAR WITH_LANG WITH_POOR_HELP_LOCALIZATIONS WITH_DICT INTRO_BITMAPS ABOUT_BITMAPS OOO_VENDOR UNIXWRAPPERNAME ENABLE_STATIC_GTK ENABLE_LAYOUT VERBOSE nodep LOCAL_SOLVER BUILD_TYPE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS EGREP AWK SED LOCAL_SOLENV _solenv UPD SOURCEVERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os GNUTAR OSVERSION PTHREAD_CFLAGS PTHREAD_LIBS ENABLE_CRASHDUMP VC_STANDARD ENABLE_WERROR ENABLE_DEBUG PRODUCT PROFULLSWITCH PROEXT ENABLE_SYMBOLS DISABLE_STRIP ENABLE_CUPS ENABLE_FONTCONFIG TARFILE_LOCATION DO_FETCH_TARBALLS WITH_BINFILTER ENABLE_DIRECTX DISABLE_ACTIVEX DISABLE_ATL ENABLE_RPATH WITH_MYSPELL_DICTS SYSTEM_DICTS DICT_SYSTEM_DIR HYPH_SYSTEM_DIR THES_SYSTEM_DIR WITH_MINGWIN SHELLPATH GCC_HOME CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT COMPATH GCCVER HAVE_LD_BSYMBOLIC_FUNCTIONS ENABLE_PCH GNUMAKE _cc HAVE_LD_HASH_STYLE PERL MSPDB_PATH COMEX USE_MINGW MIDL_PATH CSC_PATH FRAME_HOME CPP CXX CXXFLAGS ac_ct_CXX CXXCPP SIZEOF_LONG WORDS_BIGENDIAN LFS_CFLAGS ENABLE_VBA VBA_EXTENSION PAM NEW_SHADOW_API PAM_LINK CRYPT_LINK GXX_INCLUDE_PATH MINGW_LIB_INCLUDE_PATH MINGW_BACKWARD_INCLUDE_PATH MINGW_CLIB_DIR MINGW_SHARED_GCCLIB MINGW_GCCLIB_EH MINGW_SHARED_GXXLIB MINGW_SHARED_LIBSTDCPP MINGW_GCCDLL MINGW_GXXDLL EXCEPTIONS STLPORT4 STLPORT_VER USE_SYSTEM_STL USE_CCACHE CCACHE HAVE_GCC_VISIBILITY_FEATURE ALLOC BUILD_VER_STRING SOLAR_JAVA JAVAINTERPRETER JAVACOMPILER JAVACISGCJ JAVADOC AWTLIB JAVAAOTCOMPILER JAVA_HOME JDK JAVAFLAGS JAVAIFLAGS DMAKE BUILD_DMAKE EPM DPKG PKGMK BUILD_EPM RPM PKGFORMAT GPERF BUILD_STAX MINGWCXX ac_ct_MINGWCXX MINGWSTRIP ac_ct_MINGWSTRIP BUILD_UNOWINREG SYSTEM_STDLIBS SYSTEM_ZLIB SYSTEM_JPEG SYSTEM_EXPAT PKG_CONFIG LIBWPD_CFLAGS LIBWPD_LIBS SYSTEM_LIBWPD CPPUNIT_CFLAGS CPPUNIT_LIBS SYSTEM_CPPUNIT FREETYPE_CFLAGS FREETYPE_LIBS USE_FT_EMBOLDEN LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC SYSTEM_LIBXSLT LIBXML_CFLAGS LIBXML_LIBS SYSTEM_LIBXML PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir BZIP2 SYSTEM_PYTHON PYTHON_CFLAGS PYTHON_LIBS HOME SYSTEM_DB DB_VERSION DB_INCLUDES DB_JAR SYSTEM_LUCENE LUCENE_CORE_JAR LUCENE_ANALYZERS_JAR ENABLE_MYSQLC MYSQLCONFIG SYSTEM_MYSQL MYSQL_INC MYSQL_LIB MYSQL_DEFINES LIBMYSQL_PATH SYSTEM_MYSQL_CPPCONN SYSTEM_HSQLDB HSQLDB_JAR SYSTEM_BSH BSH_JAR SERIALIZER_JAR SYSTEM_SAXON SAXON_JAR CURLCONFIG SYSTEM_CURL CURL_CFLAGS CURL_LIBS SYSTEM_MDDS SYSTEM_BOOST SYSTEM_VIGRA SYSTEM_ODBC_HEADERS WITH_MOZILLA WITH_LDAP WITH_OPENLDAP MOZ_NSS_CFLAGS MOZ_NSS_LIBS NSS_LIB MOZ_NSPR_CFLAGS MOZ_NSPR_LIBS NSPR_LIB MOZILLAXPCOM_CFLAGS MOZILLAXPCOM_LIBS MOZILLA_VERSION MOZILLA_TOOLKIT MOZGTK2_CFLAGS MOZGTK2_LIBS MOZLIBREQ_CFLAGS MOZLIBREQ_LIBS BUILD_MOZAB ENABLE_NSS_MODULE MOZILLABUILD SYSTEM_MOZILLA MOZ_FLAVOUR MOZ_INC MOZ_LIB MOZ_LIB_XPCOM MOZ_LDAP_CFLAGS SYSTEM_SANE_HEADER SYSTEM_GENBRK SYSTEM_GENCCODE SYSTEM_GENCMN SYSTEM_ICU GRAPHITE_CFLAGS GRAPHITE_LIBS ENABLE_GRAPHITE SYSTEM_GRAPHITE X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XINC XLIB XAU_LIBS DISABLE_XAW SYSTEM_XRENDER_HEADERS XRENDER_LINK XRANDR_CFLAGS XRANDR_LIBS XRANDR_DLOPEN ENABLE_RANDR DISABLE_NEON NEON_CFLAGS NEON_LIBS SYSTEM_NEON NEON_VERSION OPENSSL_CFLAGS OPENSSL_LIBS SYSTEM_OPENSSL ENABLE_AGG AGG_CFLAGS AGG_LIBS SYSTEM_AGG AGG_VERSION REDLAND_CFLAGS REDLAND_LIBS SYSTEM_REDLAND HUNSPELL_CFLAGS HUNSPELL_LIBS SYSTEM_HUNSPELL SYSTEM_HYPH HYPHEN_LIB MYTHES_CFLAGS MYTHES_LIBS SYSTEM_MYTHES SYSTEM_LPSOLVE SYSTEM_LIBTEXTCAT SYSTEM_LIBTEXTCAT_DATA HAVE_GETOPT HAVE_READDIR_R SYSTEM_LIBC PSDK_HOME WINDOWS_VISTA_PSDK DIRECTXSDK_HOME DIRECTXSDK_LIB NSIS_PATH BISON FLEX PATCH GNUCP GNUPATCH CYGWIN_PATH ML_EXE ASM_HOME ZIP UNZIP ZIP_HOME ENABLE_GTK ENABLE_KDE ENABLE_KDE4 GCONF_CFLAGS GCONF_LIBS ENABLE_GCONF GNOMEVFS_CFLAGS GNOMEVFS_LIBS ENABLE_GNOMEVFS GTK_CFLAGS GTK_LIBS DBUS_CFLAGS DBUS_LIBS GIO_CFLAGS GIO_LIBS ENABLE_GIO ENABLE_DBUS ENABLE_SYSTRAY_GTK GSTREAMER_CFLAGS GSTREAMER_LIBS ENABLE_GSTREAMER CAIRO_CFLAGS CAIRO_LIBS ENABLE_CAIRO BUILD_PIXMAN SYSTEM_CAIRO ENABLE_OPENGL ENABLE_PRESENTER_EXTRA_UI ENABLE_MINIMIZER ENABLE_PRESENTER_SCREEN POPPLER_CFLAGS POPPLER_LIBS ENABLE_PDFIMPORT SYSTEM_POPPLER ENABLE_MEDIAWIKI SYSTEM_SERVLETAPI SERVLETAPI_JAR ENABLE_REPORTBUILDER SYSTEM_JFREEREPORT SAC_JAR LIBXML_JAR FLUTE_JAR JFREEREPORT_JAR LIBBASE_JAR LIBLAYOUT_JAR LIBLOADER_JAR LIBFORMULA_JAR LIBREPOSITORY_JAR LIBFONTS_JAR LIBSERIALIZER_JAR SYSTEM_APACHE_COMMONS COMMONS_CODEC_JAR COMMONS_LANG_JAR COMMONS_HTTPCLIENT_JAR COMMONS_LOGGING_JAR MOC KDE_CFLAGS KDE_LIBS MOC4 KDE4_CFLAGS KDE4_LIBS ENABLE_LOCKDOWN GOBJECT_CFLAGS GOBJECT_LIBS ENABLE_EVOAB2 ENABLE_KAB WITH_FONTS WITHOUT_PPDS WITHOUT_AFMS SCPDEFS USE_XINERAMA XINERAMA_LINK ANT ANT_HOME ANT_LIB OOO_JUNIT_JAR WITH_LANG WITH_POOR_HELP_LOCALIZATIONS WITH_DICT INTRO_BITMAPS ABOUT_BITMAPS OOO_VENDOR UNIXWRAPPERNAME ENABLE_STATIC_GTK ENABLE_LAYOUT VERBOSE nodep LOCAL_SOLVER BUILD_TYPE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
   fi
   echo "$as_me:$LINENO: checking whether to use dynamic libstdc++" >&5
 echo $ECHO_N "checking whether to use dynamic libstdc++... $ECHO_C" >&6
+  MINGW_SHARED_LIBSTDCPP=
   if test -e "$MINGW_CLIB_DIR/libstdc++_s.a" ; then
+    MINGW_SHARED_LIBSTDCPP=stdc++_s
+  fi
+  if test -e "$MINGW_CLIB_DIR/libstdc++.dll.a" ; then
+    MINGW_SHARED_LIBSTDCPP=stdc++.dll
+  fi
+  if test -n "$MINGW_SHARED_LIBSTDCPP" ; then
     echo "$as_me:$LINENO: checking dynamic libstdc++ name" >&5
 echo $ECHO_N "checking dynamic libstdc++ name... $ECHO_C" >&6
-    MINGW_GXXDLL_pattern=`nm $MINGW_CLIB_DIR/libstdc++_s.a | sed -ne 's@.* _libstdc__\(.*\)_dll_iname@libstdc++\1.dll@p' | uniq | sed -e 's@_@?@g'`
+    MINGW_GXXDLL_pattern=`nm $MINGW_CLIB_DIR/lib$MINGW_SHARED_LIBSTDCPP.a | sed -ne 's@.* _libstdc__\(.*\)_dll_iname@libstdc++\1.dll@p' | uniq | sed -e 's@_@?@g'`
     MINGW_GXXDLL=`cd $COMPATH/bin && ls $MINGW_GXXDLL_pattern 2>/dev/null`
     if test -n "$MINGW_GXXDLL"; then
+        MINGW_SHARED_LIBSTDCPP=-l$MINGW_SHARED_LIBSTDCPP
         MINGW_SHARED_GXXLIB=YES
         echo "$as_me:$LINENO: result: use $MINGW_GXXDLL" >&5
 echo "${ECHO_T}use $MINGW_GXXDLL" >&6
     else
+        MINGW_SHARED_LIBSTDCPP=
         echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
     fi
 s,@MINGW_SHARED_GCCLIB@,$MINGW_SHARED_GCCLIB,;t t
 s,@MINGW_GCCLIB_EH@,$MINGW_GCCLIB_EH,;t t
 s,@MINGW_SHARED_GXXLIB@,$MINGW_SHARED_GXXLIB,;t t
+s,@MINGW_SHARED_LIBSTDCPP@,$MINGW_SHARED_LIBSTDCPP,;t t
 s,@MINGW_GCCDLL@,$MINGW_GCCDLL,;t t
 s,@MINGW_GXXDLL@,$MINGW_GXXDLL,;t t
 s,@EXCEPTIONS@,$EXCEPTIONS,;t t
       MINGW_GCCLIB_EH=YES
   fi
   AC_MSG_CHECKING([whether to use dynamic libstdc++])
+  MINGW_SHARED_LIBSTDCPP=
   if test -e "$MINGW_CLIB_DIR/libstdc++_s.a" ; then
+    MINGW_SHARED_LIBSTDCPP=stdc++_s
+  fi
+  if test -e "$MINGW_CLIB_DIR/libstdc++.dll.a" ; then
+    MINGW_SHARED_LIBSTDCPP=stdc++.dll
+  fi
+  if test -n "$MINGW_SHARED_LIBSTDCPP" ; then
     AC_MSG_CHECKING([dynamic libstdc++ name])
-    MINGW_GXXDLL_pattern=`nm $MINGW_CLIB_DIR/libstdc++_s.a | sed -ne 's@.* _libstdc__\(.*\)_dll_iname@libstdc++\1.dll@p' | uniq | sed -e 's@_@?@g'`
+    MINGW_GXXDLL_pattern=`nm $MINGW_CLIB_DIR/lib$MINGW_SHARED_LIBSTDCPP.a | sed -ne 's@.* _libstdc__\(.*\)_dll_iname@libstdc++\1.dll@p' | uniq | sed -e 's@_@?@g'`
     MINGW_GXXDLL=`cd $COMPATH/bin && ls $MINGW_GXXDLL_pattern 2>/dev/null`
     if test -n "$MINGW_GXXDLL"; then
+        MINGW_SHARED_LIBSTDCPP=-l$MINGW_SHARED_LIBSTDCPP
         MINGW_SHARED_GXXLIB=YES
         AC_MSG_RESULT([use $MINGW_GXXDLL])
     else
+        MINGW_SHARED_LIBSTDCPP=
         AC_MSG_RESULT([no])
     fi
   else
   AC_SUBST(MINGW_SHARED_GCCLIB)
   AC_SUBST(MINGW_GCCLIB_EH)
   AC_SUBST(MINGW_SHARED_GXXLIB)
+  AC_SUBST(MINGW_SHARED_LIBSTDCPP)
   AC_SUBST(MINGW_GCCDLL)
   AC_SUBST(MINGW_GXXDLL)
 fi

cppuhelper/source/tdmgr.cxx

 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_cppuhelper.hxx"
+
+#include "sal/config.h"
+
+#include <vector>
+
 #include <sal/alloca.h>
 
 #include <osl/diagnose.h>
 #include <com/sun/star/reflection/XEnumTypeDescription.hpp>
 #include <com/sun/star/reflection/XIndirectTypeDescription.hpp>
 #include <com/sun/star/reflection/XInterfaceMemberTypeDescription.hpp>
-#include <com/sun/star/reflection/XInterfaceAttributeTypeDescription.hpp>
+#include <com/sun/star/reflection/XInterfaceAttributeTypeDescription2.hpp>
 #include <com/sun/star/reflection/XMethodParameter.hpp>
 #include <com/sun/star/reflection/XInterfaceMethodTypeDescription.hpp>
 #include <com/sun/star/reflection/XInterfaceTypeDescription2.hpp>
 }
 //==================================================================================================
 inline static typelib_TypeDescription * createCTD(
-	const Reference< XInterfaceAttributeTypeDescription > & xAttribute )
+	const Reference< XInterfaceAttributeTypeDescription2 > & xAttribute )
 {
 	typelib_TypeDescription * pRet = 0;
 	if (xAttribute.is())
 		OUString aMemberName( xAttribute->getName() );
 		Reference< XTypeDescription > xType( xAttribute->getType() );
 		OUString aMemberTypeName( xType->getName() );
-
-		typelib_typedescription_newInterfaceAttribute(
+        std::vector< rtl_uString * > getExc;
+        Sequence< Reference< XCompoundTypeDescription > > getExcs(
+            xAttribute->getGetExceptions() );
+        for (sal_Int32 i = 0; i != getExcs.getLength(); ++i)
+        {
+            OSL_ASSERT( getExcs[i].is() );
+            getExc.push_back( getExcs[i]->getName().pData );
+        }
+        std::vector< rtl_uString * > setExc;
+        Sequence< Reference< XCompoundTypeDescription > > setExcs(
+            xAttribute->getSetExceptions() );
+        for (sal_Int32 i = 0; i != setExcs.getLength(); ++i)
+        {
+            OSL_ASSERT( setExcs[i].is() );
+            setExc.push_back( setExcs[i]->getName().pData );
+        }
+		typelib_typedescription_newExtendedInterfaceAttribute(
 			(typelib_InterfaceAttributeTypeDescription **)&pRet,
 			xAttribute->getPosition(),
 			aMemberName.pData, // name
 			(typelib_TypeClass)xType->getTypeClass(),
 			aMemberTypeName.pData, // type name
-			xAttribute->isReadOnly() );
+			xAttribute->isReadOnly(),
+            getExc.size(), getExc.empty() ? 0 : &getExc[0],
+            setExc.size(), setExc.empty() ? 0 : &setExc[0] );
 	}
 	return pRet;
 }
 			pRet = createCTD( Reference< XInterfaceMethodTypeDescription >::query( xType ) );
 			break;
 		case TypeClass_INTERFACE_ATTRIBUTE:
-			pRet = createCTD( Reference< XInterfaceAttributeTypeDescription >::query( xType ) );
+			pRet = createCTD( Reference< XInterfaceAttributeTypeDescription2 >::query( xType ) );
 			break;
         default:
             break;
 .ENDIF
 curl_LIBS=-lws2_32 -lwinmm
 .IF "$(MINGW_SHARED_GXXLIB)"=="YES"
-curl_LIBS+=-lstdc++_s
+curl_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
 .ENDIF
 CONFIGURE_DIR=.$/
 #relative to CONFIGURE_DIR

embeddedobj/source/commonembedding/embedobj.cxx

 
 awt::Rectangle GetRectangleInterception( const awt::Rectangle& aRect1, const awt::Rectangle& aRect2 )
 {
-	awt::Rectangle aResult;
+    awt::Rectangle aResult;
 
-	OSL_ENSURE( aRect1.Width >= 0 && aRect2.Width >= 0 && aRect1.Height >= 0 && aRect2.Height >= 0,
-				"Offset must not be less then zero!" );
+    OSL_ENSURE( aRect1.Width >= 0 && aRect2.Width >= 0 && aRect1.Height >= 0 && aRect2.Height >= 0,
+                "Offset must not be less then zero!" );
 
-	aResult.X = aRect1.X > aRect2.X ? aRect1.X : aRect2.X;
-	aResult.Y = aRect1.Y > aRect2.Y ? aRect1.Y : aRect2.Y;
+    aResult.X = aRect1.X > aRect2.X ? aRect1.X : aRect2.X;
+    aResult.Y = aRect1.Y > aRect2.Y ? aRect1.Y : aRect2.Y;
 
-	sal_Int32 nRight1 = aRect1.X + aRect1.Width;
-	sal_Int32 nBottom1 = aRect1.Y + aRect1.Height;
-	sal_Int32 nRight2 = aRect2.X + aRect2.Width;
-	sal_Int32 nBottom2 = aRect2.Y + aRect2.Height;
-	aResult.Width = ( nRight1 < nRight2 ? nRight1 : nRight2 ) - aResult.X;
-	aResult.Height = ( nBottom1 < nBottom2 ? nBottom1 : nBottom2 ) - aResult.Y;
+    sal_Int32 nRight1 = aRect1.X + aRect1.Width;
+    sal_Int32 nBottom1 = aRect1.Y + aRect1.Height;
+    sal_Int32 nRight2 = aRect2.X + aRect2.Width;
+    sal_Int32 nBottom2 = aRect2.Y + aRect2.Height;
+    aResult.Width = ( nRight1 < nRight2 ? nRight1 : nRight2 ) - aResult.X;
+    aResult.Height = ( nBottom1 < nBottom2 ? nBottom1 : nBottom2 ) - aResult.Y;
 
-	return aResult;
+    return aResult;
 }
 
 //----------------------------------------------
 sal_Int32 OCommonEmbeddedObject::ConvertVerbToState_Impl( sal_Int32 nVerb )
 {
-	for ( sal_Int32 nInd = 0; nInd < m_aVerbTable.getLength(); nInd++ )
-		if ( m_aVerbTable[nInd][0] == nVerb )
-			return m_aVerbTable[nInd][1];
+    for ( sal_Int32 nInd = 0; nInd < m_aVerbTable.getLength(); nInd++ )
+        if ( m_aVerbTable[nInd][0] == nVerb )
+            return m_aVerbTable[nInd][1];
 
-	throw lang::IllegalArgumentException(); // TODO: unexpected verb provided
+    throw lang::IllegalArgumentException(); // TODO: unexpected verb provided
 }
 
 //----------------------------------------------
     //MBA if ( !xModif.is() )
     //MBA    throw uno::RuntimeException();
 
-	// no need to lock for the initialization
-	uno::Reference< embed::XEmbeddedClient > xClientSite = m_xClientSite;
-	if ( !xClientSite.is() )
-		throw embed::WrongStateException(); //TODO: client site is not set!
+    // no need to lock for the initialization
+    uno::Reference< embed::XEmbeddedClient > xClientSite = m_xClientSite;
+    if ( !xClientSite.is() )
+        throw embed::WrongStateException(); //TODO: client site is not set!
 
-	// store document if it is modified
+    // store document if it is modified
     if ( xModif.is() && xModif->isModified() )
-	{
-		try {
-			xClientSite->saveObject();
-		}
-		catch( embed::ObjectSaveVetoException& )
-		{
-		}
-		catch( uno::Exception& e )
-		{
-			throw embed::StorageWrappedTargetException(
-				::rtl::OUString::createFromAscii( "The client could not store the object!" ),
-				uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ) ),
-				uno::makeAny( e ) );
-		}
-	}
+    {
+        try {
+            xClientSite->saveObject();
+        }
+        catch( embed::ObjectSaveVetoException& )
+        {
+        }
+        catch( uno::Exception& e )
+        {
+            throw embed::StorageWrappedTargetException(
+                ::rtl::OUString::createFromAscii( "The client could not store the object!" ),
+                uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ) ),
+                uno::makeAny( e ) );
+        }
+    }
 
-	m_pDocHolder->CloseFrame();
+    m_pDocHolder->CloseFrame();
 
-	xClientSite->visibilityChanged( sal_False );
+    xClientSite->visibilityChanged( sal_False );
 }
 
 //----------------------------------------------
 void OCommonEmbeddedObject::StateChangeNotification_Impl( sal_Bool bBeforeChange, sal_Int32 nOldState, sal_Int32 nNewState ,::osl::ResettableMutexGuard& rGuard )
 {
-	if ( m_pInterfaceContainer )
-	{
-    	::cppu::OInterfaceContainerHelper* pContainer = m_pInterfaceContainer->getContainer(
-							::getCppuType( ( const uno::Reference< embed::XStateChangeListener >*) NULL ) );
-    	if ( pContainer != NULL )
-		{
-    		lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >( this ) );
-        	::cppu::OInterfaceIteratorHelper pIterator(*pContainer);
+    if ( m_pInterfaceContainer )
+    {
+        ::cppu::OInterfaceContainerHelper* pContainer = m_pInterfaceContainer->getContainer(
+                            ::getCppuType( ( const uno::Reference< embed::XStateChangeListener >*) NULL ) );
+        if ( pContainer != NULL )
+        {
+            lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >( this ) );
+            ::cppu::OInterfaceIteratorHelper pIterator(*pContainer);
 
-			// should be locked after the method is finished successfully
-			rGuard.clear();
+            // should be locked after the method is finished successfully
+            rGuard.clear();
 
-			while (pIterator.hasMoreElements())
-        	{
-            	try
-            	{
-					if ( bBeforeChange )
-                		((embed::XStateChangeListener*)pIterator.next())->changingState( aSource, nOldState, nNewState );
-					else
-                		((embed::XStateChangeListener*)pIterator.next())->stateChanged( aSource, nOldState, nNewState );
-            	}
-            	catch( uno::Exception& )
-            	{
-					// even if the listener complains ignore it for now
-           		}
+            while (pIterator.hasMoreElements())
+            {
+                try
+                {
+                    if ( bBeforeChange )
+                        ((embed::XStateChangeListener*)pIterator.next())->changingState( aSource, nOldState, nNewState );
+                    else
+                        ((embed::XStateChangeListener*)pIterator.next())->stateChanged( aSource, nOldState, nNewState );
+                }
+                catch( uno::Exception& )
+                {
+                    // even if the listener complains ignore it for now
+                   }
 
-				if ( m_bDisposed )
-					return;
-        	}
+                if ( m_bDisposed )
+                    return;
+            }
 
-			rGuard.reset();
-		}
-	}
+            rGuard.reset();
+        }
+    }
 }
 
 //----------------------------------------------
 void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
 {
-	// TODO: may be needs interaction handler to detect wherether the object state
-	//		 can be changed even after errors
+    // TODO: may be needs interaction handler to detect wherether the object state
+    //         can be changed even after errors
 
-	if ( m_nObjectState == embed::EmbedStates::LOADED )
-	{
-		if ( nNextState == embed::EmbedStates::RUNNING )
-		{
+    if ( m_nObjectState == embed::EmbedStates::LOADED )
+    {
+        if ( nNextState == embed::EmbedStates::RUNNING )
+        {
             // after the object reaches the running state the cloned size is not necessary any more
             m_bHasClonedSize = sal_False;
 
-			if ( m_bIsLink )
-			{
+            if ( m_bIsLink )
+            {
                 m_pDocHolder->SetComponent( LoadLink_Impl(), m_bReadOnly );
-			}
-			else
-			{
+            }
+            else
+            {
                 uno::Reference < embed::XEmbedPersist > xPersist( static_cast < embed::XClassifiedObject* > (this), uno::UNO_QUERY );
                 if ( xPersist.is() )
                 {
                     uno::Reference< util::XCloseable > xDocument(
                             m_xFactory->createInstanceWithArguments( GetDocumentServiceName(), aArgs ), uno::UNO_QUERY );
 
-    				uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY );
-    				if ( xChild.is() )
-    					xChild->setParent( m_xParent );
+                    uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY );
+                    if ( xChild.is() )
+                        xChild->setParent( m_xParent );
 
                     m_pDocHolder->SetComponent( xDocument, m_bReadOnly );
                 }
-			}
+            }
 
             if ( !m_pDocHolder->GetComponent().is() )
-				throw embed::UnreachableStateException(); //TODO: can't open document
+                throw embed::UnreachableStateException(); //TODO: can't open document
 
-			m_nObjectState = nNextState;
-		}
-		else
-		{
-			OSL_ENSURE( sal_False, "Unacceptable state switch!\n" );
-			throw uno::RuntimeException(); // TODO
-		}
-	}
-	else if ( m_nObjectState == embed::EmbedStates::RUNNING )
-	{
-		if ( nNextState == embed::EmbedStates::LOADED )
-		{
+            m_nObjectState = nNextState;
+        }
+        else
+        {
+            OSL_ENSURE( sal_False, "Unacceptable state switch!\n" );
+            throw uno::RuntimeException(); // TODO
+        }
+    }
+    else if ( m_nObjectState == embed::EmbedStates::RUNNING )
+    {
+        if ( nNextState == embed::EmbedStates::LOADED )
+        {
             m_nClonedMapUnit = m_pDocHolder->GetMapUnit( embed::Aspects::MSOLE_CONTENT );
             m_bHasClonedSize = m_pDocHolder->GetExtent( embed::Aspects::MSOLE_CONTENT, &m_aClonedSize );
 
-			// actually frame should not exist at this point
-			m_pDocHolder->CloseDocument( sal_False, sal_False );
+            // actually frame should not exist at this point
+            m_pDocHolder->CloseDocument( sal_False, sal_False );
 
-			m_nObjectState = nNextState;
-		}
-		else
-		{
-			if ( nNextState == embed::EmbedStates::INPLACE_ACTIVE )
-			{
-				if ( !m_xClientSite.is() )
-					throw embed::WrongStateException(); //TODO: client site is not set!
+            m_nObjectState = nNextState;
+        }
+        else
+        {
+            if ( nNextState == embed::EmbedStates::INPLACE_ACTIVE )
+            {
+                if ( !m_xClientSite.is() )
+                    throw embed::WrongStateException(); //TODO: client site is not set!
 
-				uno::Reference< embed::XInplaceClient > xInplaceClient( m_xClientSite, uno::UNO_QUERY );
-				if ( xInplaceClient.is() && xInplaceClient->canInplaceActivate() )
-				{
-					xInplaceClient->activatingInplace();
+                uno::Reference< embed::XInplaceClient > xInplaceClient( m_xClientSite, uno::UNO_QUERY );
+                if ( xInplaceClient.is() && xInplaceClient->canInplaceActivate() )
+                {
+                    xInplaceClient->activatingInplace();
 
-					uno::Reference< embed::XWindowSupplier > xClientWindowSupplier( xInplaceClient, uno::UNO_QUERY );
-					if ( !xClientWindowSupplier.is() )
-						throw uno::RuntimeException(); // TODO: the inplace client implementation must support XWinSupp
+                    uno::Reference< embed::XWindowSupplier > xClientWindowSupplier( xInplaceClient, uno::UNO_QUERY );
+                    if ( !xClientWindowSupplier.is() )
+                        throw uno::RuntimeException(); // TODO: the inplace client implementation must support XWinSupp
 
-					m_xClientWindow = xClientWindowSupplier->getWindow();
-					m_aOwnRectangle = xInplaceClient->getPlacement();
-					m_aClipRectangle = xInplaceClient->getClipRectangle();
-					awt::Rectangle aRectangleToShow = GetRectangleInterception( m_aOwnRectangle, m_aClipRectangle );
+                    m_xClientWindow = xClientWindowSupplier->getWindow();
+                    m_aOwnRectangle = xInplaceClient->getPlacement();
+                    m_aClipRectangle = xInplaceClient->getClipRectangle();
+                    awt::Rectangle aRectangleToShow = GetRectangleInterception( m_aOwnRectangle, m_aClipRectangle );
 
-					// create own window based on the client window
-					// place and resize the window according to the rectangles
-					uno::Reference< awt::XWindowPeer > xClientWindowPeer( m_xClientWindow, uno::UNO_QUERY );
-					if ( !xClientWindowPeer.is() )
-						throw uno::RuntimeException(); // TODO: the container window must support the interface
+                    // create own window based on the client window
+                    // place and resize the window according to the rectangles
+                    uno::Reference< awt::XWindowPeer > xClientWindowPeer( m_xClientWindow, uno::UNO_QUERY );
+                    if ( !xClientWindowPeer.is() )
+                        throw uno::RuntimeException(); // TODO: the container window must support the interface
 
-					// dispatch provider may not be provided
-					uno::Reference< frame::XDispatchProvider > xContainerDP = xInplaceClient->getInplaceDispatchProvider();
+                    // dispatch provider may not be provided
+                    uno::Reference< frame::XDispatchProvider > xContainerDP = xInplaceClient->getInplaceDispatchProvider();
                     sal_Bool bOk = m_pDocHolder->ShowInplace( xClientWindowPeer, aRectangleToShow, xContainerDP );
-					m_nObjectState = nNextState;
+                    m_nObjectState = nNextState;
                     if ( !bOk )
-					{
+                    {
                         SwitchStateTo_Impl( embed::EmbedStates::RUNNING );
-						throw embed::WrongStateException(); //TODO: can't activate inplace
-					}
-				}
-				else
-					throw embed::WrongStateException(); //TODO: can't activate inplace
-			}
-			else if ( nNextState == embed::EmbedStates::ACTIVE )
-			{
-				if ( !m_xClientSite.is() )
-					throw embed::WrongStateException(); //TODO: client site is not set!
+                        throw embed::WrongStateException(); //TODO: can't activate inplace
+                    }
+                }
+                else
+                    throw embed::WrongStateException(); //TODO: can't activate inplace
+            }
+            else if ( nNextState == embed::EmbedStates::ACTIVE )
+            {
+                if ( !m_xClientSite.is() )
+                    throw embed::WrongStateException(); //TODO: client site is not set!
 
-				// create frame and load document in the frame
-				m_pDocHolder->Show();
+                // create frame and load document in the frame
+                m_pDocHolder->Show();
 
-				m_xClientSite->visibilityChanged( sal_True );
-				m_nObjectState = nNextState;
-			}
-			else
-			{
-				OSL_ENSURE( sal_False, "Unacceptable state switch!\n" );
-				throw uno::RuntimeException(); // TODO
-			}
-		}
-	}
-	else if ( m_nObjectState == embed::EmbedStates::INPLACE_ACTIVE )
-	{
-		if ( nNextState == embed::EmbedStates::RUNNING )
-		{
-			uno::Reference< embed::XInplaceClient > xInplaceClient( m_xClientSite, uno::UNO_QUERY );
-			if ( !xInplaceClient.is() )
-				throw uno::RuntimeException();
+                m_xClientSite->visibilityChanged( sal_True );
+                m_nObjectState = nNextState;
+            }
+            else
+            {
+                OSL_ENSURE( sal_False, "Unacceptable state switch!\n" );
+                throw uno::RuntimeException(); // TODO
+            }
+        }
+    }
+    else if ( m_nObjectState == embed::EmbedStates::INPLACE_ACTIVE )
+    {
+        if ( nNextState == embed::EmbedStates::RUNNING )
+        {
+            uno::Reference< embed::XInplaceClient > xInplaceClient( m_xClientSite, uno::UNO_QUERY );
+            if ( !xInplaceClient.is() )
+                throw uno::RuntimeException();
 
-			m_xClientSite->visibilityChanged( sal_True );
+            m_xClientSite->visibilityChanged( sal_True );
 
-			xInplaceClient->deactivatedInplace();
-			Deactivate();
-			m_nObjectState = nNextState;
-		}
+            xInplaceClient->deactivatedInplace();
+            Deactivate();
+            m_nObjectState = nNextState;
+        }
         else if ( nNextState == embed::EmbedStates::UI_ACTIVE )
-		{
+        {
             if ( !(m_nMiscStatus & embed::EmbedMisc::MS_EMBED_NOUIACTIVATE) )
             {
                 uno::Reference< embed::XInplaceClient > xInplaceClient( m_xClientSite, uno::UNO_QUERY_THROW );
                 else
                     throw embed::WrongStateException(); //TODO: can't activate UI
             }
-		}
-		else
-		{
-			OSL_ENSURE( sal_False, "Unacceptable state switch!\n" );
-			throw uno::RuntimeException(); // TODO
-		}
-	}
-	else if ( m_nObjectState == embed::EmbedStates::ACTIVE )
-	{
-		if ( nNextState == embed::EmbedStates::RUNNING )
-		{
-			Deactivate();
-			m_nObjectState = nNextState;
-		}
-		else
-		{
-			OSL_ENSURE( sal_False, "Unacceptable state switch!\n" );
-			throw uno::RuntimeException(); // TODO
-		}
-	}
+        }
+        else
+        {
+            OSL_ENSURE( sal_False, "Unacceptable state switch!\n" );
+            throw uno::RuntimeException(); // TODO
+        }
+    }
+    else if ( m_nObjectState == embed::EmbedStates::ACTIVE )
+    {
+        if ( nNextState == embed::EmbedStates::RUNNING )
+        {
+            Deactivate();
+            m_nObjectState = nNextState;
+        }
+        else
+        {
+            OSL_ENSURE( sal_False, "Unacceptable state switch!\n" );
+            throw uno::RuntimeException(); // TODO
+        }
+    }
     else if ( m_nObjectState == embed::EmbedStates::UI_ACTIVE )
     {
         if ( nNextState == embed::EmbedStates::INPLACE_ACTIVE )
         {
             uno::Reference< embed::XInplaceClient > xInplaceClient( m_xClientSite, uno::UNO_QUERY_THROW );
-    		uno::Reference< ::com::sun::star::frame::XLayoutManager > xContainerLM =
-						xInplaceClient->getLayoutManager();
+            uno::Reference< ::com::sun::star::frame::XLayoutManager > xContainerLM =
+                        xInplaceClient->getLayoutManager();
 
-			sal_Bool bOk = sal_False;
-			if ( xContainerLM.is() )
-           		bOk = m_pDocHolder->HideUI( xContainerLM );
+            sal_Bool bOk = sal_False;
+            if ( xContainerLM.is() )
+                   bOk = m_pDocHolder->HideUI( xContainerLM );
 
-			if ( bOk )
-			{
-				m_nObjectState = nNextState;
+            if ( bOk )
+            {
+                m_nObjectState = nNextState;
                 m_pDocHolder->ResizeHatchWindow();
-       			xInplaceClient->deactivatedUI();
-			}
-			else
-				throw embed::WrongStateException(); //TODO: can't activate UI
+                   xInplaceClient->deactivatedUI();
+            }
+            else
+                throw embed::WrongStateException(); //TODO: can't activate UI
         }
     }
-	else
-		throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object is in unacceptable state!\n" ),
-										uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    else
+        throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object is in unacceptable state!\n" ),
+                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 }
 
 //----------------------------------------------
 uno::Sequence< sal_Int32 > OCommonEmbeddedObject::GetIntermediateStatesSequence_Impl( sal_Int32 nNewState )
 {
-	sal_Int32 nCurInd = 0;
-	for ( nCurInd = 0; nCurInd < m_aAcceptedStates.getLength(); nCurInd++ )
-		if ( m_aAcceptedStates[nCurInd] == m_nObjectState )
-			break;
+    sal_Int32 nCurInd = 0;
+    for ( nCurInd = 0; nCurInd < m_aAcceptedStates.getLength(); nCurInd++ )
+        if ( m_aAcceptedStates[nCurInd] == m_nObjectState )
+            break;
 
-	if ( nCurInd == m_aAcceptedStates.getLength() )
-		throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object is in unacceptable state!\n" ),
-										uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    if ( nCurInd == m_aAcceptedStates.getLength() )
+        throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object is in unacceptable state!\n" ),
+                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 
-	sal_Int32 nDestInd = 0;
-	for ( nDestInd = 0; nDestInd < m_aAcceptedStates.getLength(); nDestInd++ )
-		if ( m_aAcceptedStates[nDestInd] == nNewState )
-			break;
+    sal_Int32 nDestInd = 0;
+    for ( nDestInd = 0; nDestInd < m_aAcceptedStates.getLength(); nDestInd++ )
+        if ( m_aAcceptedStates[nDestInd] == nNewState )
+            break;
 
-	if ( nDestInd == m_aAcceptedStates.getLength() )
-		throw embed::UnreachableStateException(
-			::rtl::OUString::createFromAscii( "The state either not reachable, or the object allows the state only as an intermediate one!\n" ),
-			uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
-			m_nObjectState,
-			nNewState );
+    if ( nDestInd == m_aAcceptedStates.getLength() )
+        throw embed::UnreachableStateException(
+            ::rtl::OUString::createFromAscii( "The state either not reachable, or the object allows the state only as an intermediate one!\n" ),
+            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+            m_nObjectState,
+            nNewState );
 
-	return m_pIntermediateStatesSeqs[nCurInd][nDestInd];
+    return m_pIntermediateStatesSeqs[nCurInd][nDestInd];
 }
 
 //----------------------------------------------
 void SAL_CALL OCommonEmbeddedObject::changeState( sal_Int32 nNewState )
-		throw ( embed::UnreachableStateException,
-				embed::WrongStateException,
-				uno::Exception,
-				uno::RuntimeException )
+        throw ( embed::UnreachableStateException,
+                embed::WrongStateException,
+                uno::Exception,
+                uno::RuntimeException )
 {
-	RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::changeState" );
+    RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::changeState" );
 
-	uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ), uno::UNO_QUERY);
-	{
-		::osl::ResettableMutexGuard aGuard( m_aMutex );
-		if ( m_bDisposed )
-			throw lang::DisposedException(); // TODO
+    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ), uno::UNO_QUERY);
+    {
+        ::osl::ResettableMutexGuard aGuard( m_aMutex );
+        if ( m_bDisposed )
+            throw lang::DisposedException(); // TODO
 
-		if ( m_nObjectState == -1 )
-			throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
-											uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+        if ( m_nObjectState == -1 )
+            throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
+                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 
-		sal_Int32 nOldState = m_nObjectState;
+        sal_Int32 nOldState = m_nObjectState;
         
-		if ( m_nTargetState != -1 )
-		{
-			// means that the object is currently trying to reach the target state
-			throw embed::StateChangeInProgressException( ::rtl::OUString(),
-														uno::Reference< uno::XInterface >(),
-														m_nTargetState );
-		}
-		else
-		{
-			TargetStateControl_Impl aControl( m_nTargetState, nNewState );
+        if ( m_nTargetState != -1 )
+        {
+            // means that the object is currently trying to reach the target state
+            throw embed::StateChangeInProgressException( ::rtl::OUString(),
+                                                        uno::Reference< uno::XInterface >(),
+                                                        m_nTargetState );
+        }
+        else
+        {
+            TargetStateControl_Impl aControl( m_nTargetState, nNewState );
 
-			// in case the object is already in requested state
-			if ( m_nObjectState == nNewState )
-			{
-				// if active object is activated again, bring it's window to top
-				if ( m_nObjectState == embed::EmbedStates::ACTIVE )
-					m_pDocHolder->Show();
+            // in case the object is already in requested state
+            if ( m_nObjectState == nNewState )
+            {
+                // if active object is activated again, bring it's window to top
+                if ( m_nObjectState == embed::EmbedStates::ACTIVE )
+                    m_pDocHolder->Show();
 
-				return;
-			}
+                return;
+            }
 
-			// retrieve sequence of states that should be passed to reach desired state
-			uno::Sequence< sal_Int32 > aIntermediateStates = GetIntermediateStatesSequence_Impl( nNewState );
+            // retrieve sequence of states that should be passed to reach desired state
+            uno::Sequence< sal_Int32 > aIntermediateStates = GetIntermediateStatesSequence_Impl( nNewState );
 
-			// notify listeners that the object is going to change the state
-			StateChangeNotification_Impl( sal_True, nOldState, nNewState,aGuard );
+            // notify listeners that the object is going to change the state
+            StateChangeNotification_Impl( sal_True, nOldState, nNewState,aGuard );
 
-			try {
-				for ( sal_Int32 nInd = 0; nInd < aIntermediateStates.getLength(); nInd++ )
-					SwitchStateTo_Impl( aIntermediateStates[nInd] );
+            try {
+                for ( sal_Int32 nInd = 0; nInd < aIntermediateStates.getLength(); nInd++ )
+                    SwitchStateTo_Impl( aIntermediateStates[nInd] );
 
-				SwitchStateTo_Impl( nNewState );
-			}
-			catch( uno::Exception& )
-			{
-				if ( nOldState != m_nObjectState )
-					// notify listeners that the object has changed the state
-					StateChangeNotification_Impl( sal_False, nOldState, m_nObjectState ,aGuard);
+                SwitchStateTo_Impl( nNewState );
+            }
+            catch( uno::Exception& )
+            {
+                if ( nOldState != m_nObjectState )
+                    // notify listeners that the object has changed the state
+                    StateChangeNotification_Impl( sal_False, nOldState, m_nObjectState, aGuard );
 
-				throw;
-			}
-		}
+                throw;
+            }
+        }
 
-		// notify listeners that the object has changed the state
-		StateChangeNotification_Impl( sal_False, nOldState, nNewState,aGuard );
-	}
+        // notify listeners that the object has changed the state
+        StateChangeNotification_Impl( sal_False, nOldState, nNewState, aGuard );
+
+        // let the object window be shown
+        if ( nNewState == embed::EmbedStates::UI_ACTIVE || nNewState == embed::EmbedStates::INPLACE_ACTIVE )
+            PostEvent_Impl( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) ),
+                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    }
 }
 
 //----------------------------------------------
 uno::Sequence< sal_Int32 > SAL_CALL OCommonEmbeddedObject::getReachableStates()
-		throw ( embed::WrongStateException,
-				uno::RuntimeException )
+        throw ( embed::WrongStateException,
+                uno::RuntimeException )
 {
-	::osl::MutexGuard aGuard( m_aMutex );
-	if ( m_bDisposed )
-		throw lang::DisposedException(); // TODO
+    if ( m_bDisposed )
+        throw lang::DisposedException(); // TODO
 
-	if ( m_nObjectState == -1 )
-		throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
-										uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    if ( m_nObjectState == -1 )
+        throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
+                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 
-	return m_aAcceptedStates;
+    return m_aAcceptedStates;
 }
 
 //----------------------------------------------
 sal_Int32 SAL_CALL OCommonEmbeddedObject::getCurrentState()
-		throw ( embed::WrongStateException,
-				uno::RuntimeException )
+        throw ( embed::WrongStateException,
+                uno::RuntimeException )
 {
-	::osl::MutexGuard aGuard( m_aMutex );
-	if ( m_bDisposed )
-		throw lang::DisposedException(); // TODO
+    if ( m_bDisposed )
+        throw lang::DisposedException(); // TODO
 
-	if ( m_nObjectState == -1 )
-		throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
-										uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    if ( m_nObjectState == -1 )
+        throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
+                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 
-	return m_nObjectState;
+    return m_nObjectState;
 }
 
 //----------------------------------------------
 void SAL_CALL OCommonEmbeddedObject::doVerb( sal_Int32 nVerbID )
-		throw ( lang::IllegalArgumentException,
-				embed::WrongStateException,
-				embed::UnreachableStateException,
-				uno::Exception,
-				uno::RuntimeException )
+        throw ( lang::IllegalArgumentException,
+                embed::WrongStateException,
+                embed::UnreachableStateException,
+                uno::Exception,
+                uno::RuntimeException )
 {
-	RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::doVerb" );
+    RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::doVerb" );
 
-	::osl::MutexGuard aGuard( m_aMutex );
-	if ( m_bDisposed )
-		throw lang::DisposedException(); // TODO
+    ::osl::ResettableMutexGuard aGuard( m_aMutex );
+    if ( m_bDisposed )
+        throw lang::DisposedException(); // TODO
 
-	if ( m_nObjectState == -1 )
-		throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
-										uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    if ( m_nObjectState == -1 )
+        throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
+                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 
-	// for internal documents this call is just a duplicate of changeState
-	sal_Int32 nNewState = -1;
-	try
-	{
-		nNewState = ConvertVerbToState_Impl( nVerbID );
-	}
-	catch( uno::Exception& )
-	{}
+    // for internal documents this call is just a duplicate of changeState
+    sal_Int32 nNewState = -1;
+    try
+    {
+        nNewState = ConvertVerbToState_Impl( nVerbID );
+    }
+    catch( uno::Exception& )
+    {}
 
-	if ( nNewState == -1 )
-	{
-		// TODO/LATER: Save Copy as... verb ( -8 ) is implemented by container
-		// TODO/LATER: check if the verb is a supported one and if it is produce related operation
-	}
-	else
-		changeState( nNewState );
+    if ( nNewState == -1 )
+    {
+        // TODO/LATER: Save Copy as... verb ( -8 ) is implemented by container
+        // TODO/LATER: check if the verb is a supported one and if it is produce related operation
+    }
+    else
+    {
+        aGuard.clear();
+        changeState( nNewState );
+    }
 }
 
 //----------------------------------------------
 uno::Sequence< embed::VerbDescriptor > SAL_CALL OCommonEmbeddedObject::getSupportedVerbs()
-		throw ( embed::WrongStateException,
-				uno::RuntimeException )
+        throw ( embed::WrongStateException,
+                uno::RuntimeException )
 {
-	::osl::MutexGuard aGuard( m_aMutex );
-	if ( m_bDisposed )
-		throw lang::DisposedException(); // TODO
+    if ( m_bDisposed )
+        throw lang::DisposedException(); // TODO
 
-	if ( m_nObjectState == -1 )
-		throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
-										uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    if ( m_nObjectState == -1 )
+        throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
+                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 
-	return m_aObjectVerbs;
+    return m_aObjectVerbs;
 }
 
 //----------------------------------------------
 void SAL_CALL OCommonEmbeddedObject::setClientSite(
-				const uno::Reference< embed::XEmbeddedClient >& xClient )
-		throw ( embed::WrongStateException,
-				uno::RuntimeException )
+                const uno::Reference< embed::XEmbeddedClient >& xClient )
+        throw ( embed::WrongStateException,
+                uno::RuntimeException )
 {
-	::osl::MutexGuard aGuard( m_aMutex );
-	if ( m_bDisposed )
-		throw lang::DisposedException(); // TODO
+    ::osl::MutexGuard aGuard( m_aMutex );
+    if ( m_bDisposed )
+        throw lang::DisposedException(); // TODO
 
-	if ( m_xClientSite != xClient)
-	{
-		if ( m_nObjectState != embed::EmbedStates::LOADED && m_nObjectState != embed::EmbedStates::RUNNING )
-			throw embed::WrongStateException(
-									::rtl::OUString::createFromAscii( "The client site can not be set currently!\n" ),
-									uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    if ( m_xClientSite != xClient)
+    {
+        if ( m_nObjectState != embed::EmbedStates::LOADED && m_nObjectState != embed::EmbedStates::RUNNING )
+            throw embed::WrongStateException(
+                                    ::rtl::OUString::createFromAscii( "The client site can not be set currently!\n" ),
+                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 
-		m_xClientSite = xClient;
-	}
+        m_xClientSite = xClient;
+    }
 }
 
 //----------------------------------------------
 uno::Reference< embed::XEmbeddedClient > SAL_CALL OCommonEmbeddedObject::getClientSite()
-		throw ( embed::WrongStateException,
-				uno::RuntimeException )
+        throw ( embed::WrongStateException,
+                uno::RuntimeException )
 {
-	::osl::MutexGuard aGuard( m_aMutex );
-	if ( m_bDisposed )
-		throw lang::DisposedException(); // TODO
+    if ( m_bDisposed )
+        throw lang::DisposedException(); // TODO
 
-	if ( m_nObjectState == -1 )
-		throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
-										uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    if ( m_nObjectState == -1 )
+        throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
+                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 
-	return m_xClientSite;
+    return m_xClientSite;
 }
 
 //----------------------------------------------
 void SAL_CALL OCommonEmbeddedObject::update()
-		throw ( embed::WrongStateException,
-				uno::Exception,
-				uno::RuntimeException )
+        throw ( embed::WrongStateException,
+                uno::Exception,
+                uno::RuntimeException )
 {
-	::osl::MutexGuard aGuard( m_aMutex );
-	if ( m_bDisposed )
-		throw lang::DisposedException(); // TODO
+    ::osl::MutexGuard aGuard( m_aMutex );
+    if ( m_bDisposed )
+        throw lang::DisposedException(); // TODO
 
-	if ( m_nObjectState == -1 )
-		throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
-										uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    if ( m_nObjectState == -1 )
+        throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
+                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 
-	PostEvent_Impl( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) ),
-										uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+    PostEvent_Impl( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) ),
+                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
 }
 
 //----------------------------------------------
 void SAL_CALL OCommonEmbeddedObject::setUpdateMode( sal_Int32 nMode )
-		throw ( embed::WrongStateException,
-				uno::RuntimeException )
+        throw ( embed::WrongStateException,
+                uno::RuntimeException )
 {
-	::osl::MutexGuard aGuard( m_aMutex );