View | Details | Raw Unified | Return to issue 972
Collapse All | Expand All

(-)a/sfx2/inc/sfx2/ipclient.hxx (+1 lines)
Lines 101-106 Link Here
101
    // used in Writer
101
    // used in Writer
102
    // Rectangle           PixelObjVisAreaToLogic( const Rectangle & rObjRect ) const;
102
    // Rectangle           PixelObjVisAreaToLogic( const Rectangle & rObjRect ) const;
103
    // Rectangle           LogicObjAreaToPixel( const Rectangle & rRect ) const;
103
    // Rectangle           LogicObjAreaToPixel( const Rectangle & rRect ) const;
104
    virtual void        FormatChanged(); // object format was changed (used for StarMath formulas aligning)
104
};
105
};
105
106
106
#endif
107
#endif
(-)a/sfx2/source/view/ipclient.cxx (+6 lines)
Lines 214-219 Link Here
214
214
215
    if ( m_pClient && aEvent.EventName.equalsAscii("OnVisAreaChanged") && m_nAspect != embed::Aspects::MSOLE_ICON )
215
    if ( m_pClient && aEvent.EventName.equalsAscii("OnVisAreaChanged") && m_nAspect != embed::Aspects::MSOLE_ICON )
216
    {
216
    {
217
        m_pClient->FormatChanged(); // for Writer when format of the object is changed with the area
217
        m_pClient->ViewChanged();
218
        m_pClient->ViewChanged();
218
        m_pClient->Invalidate();
219
        m_pClient->Invalidate();
219
    }
220
    }
Lines 1074-1079 Link Here
1074
	// dummy implementation
1075
	// dummy implementation
1075
}
1076
}
1076
1077
1078
void SfxInPlaceClient::FormatChanged()
1079
{
1080
    // dummy implementation
1081
}
1082
1077
void SfxInPlaceClient::DeactivateObject()
1083
void SfxInPlaceClient::DeactivateObject()
1078
{
1084
{
1079
    if ( GetObject().is() )
1085
    if ( GetObject().is() )
(-)a/starmath/inc/node.hxx (+7 lines)
Lines 180-185 Link Here
180
180
181
	const SmNode *	FindTokenAt(USHORT nRow, USHORT nCol) const;
181
	const SmNode *	FindTokenAt(USHORT nRow, USHORT nCol) const;
182
	const SmNode *	FindRectClosestTo(const Point &rPoint) const;
182
	const SmNode *	FindRectClosestTo(const Point &rPoint) const;
183
    // --> 4.7.2010 #i972#
184
    virtual long GetFormulaBaseline() const { return (long)0; } //dummy, used in SmTableNode
185
    // <--
183
};
186
};
184
187
185
188
Lines 467-472 Link Here
467
470
468
class SmTableNode : public SmStructureNode
471
class SmTableNode : public SmStructureNode
469
{
472
{
473
    // --> 4.7.2010 #i972#
474
    long nFormulaBaseline;
475
    // <--
470
public:
476
public:
471
	SmTableNode(const SmToken &rNodeToken)
477
	SmTableNode(const SmToken &rNodeToken)
472
	:	SmStructureNode(NTABLE, rNodeToken)
478
	:	SmStructureNode(NTABLE, rNodeToken)
Lines 476-481 Link Here
476
	virtual SmNode * GetLeftMost();
482
	virtual SmNode * GetLeftMost();
477
483
478
	virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
484
	virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
485
    long GetFormulaBaseline() const { return nFormulaBaseline; }
479
};
486
};
480
487
481
488
(-)a/starmath/source/node.cxx (-16 / +37 lines)
Lines 760-766 Link Here
760
		}
760
		}
761
761
762
	Point  aPos;
762
	Point  aPos;
763
	SmRect::operator = (SmRect(nMaxWidth, 0));
763
	SmRect::operator = (SmRect(nMaxWidth, 1));
764
	for (i = 0;  i < nSize;  i++)
764
	for (i = 0;  i < nSize;  i++)
765
    {   if (NULL != (pNode = GetSubNode(i)))
765
    {   if (NULL != (pNode = GetSubNode(i)))
766
		{	const SmRect &rNodeRect = pNode->GetRect();
766
		{	const SmRect &rNodeRect = pNode->GetRect();
Lines 776-781 Link Here
776
			ExtendBy(rNodeRect, nSize > 1 ? RCP_NONE : RCP_ARG);
776
			ExtendBy(rNodeRect, nSize > 1 ? RCP_NONE : RCP_ARG);
777
		}
777
		}
778
	}
778
	}
779
    // --> 4.7.2010 #i972#
780
    if (HasBaseline())
781
        nFormulaBaseline = GetBaseline();
782
    else
783
    {
784
        SmTmpDevice  aTmpDev ((OutputDevice &) rDev, TRUE);
785
        aTmpDev.SetFont(GetFont());	
786
787
        SmRect aRect = (SmRect(aTmpDev, &rFormat, C2S("a"),
788
                               GetFont().GetBorderWidth()));
789
        nFormulaBaseline = GetAlignM();
790
        // move from middle position by constant - distance
791
        // between middle and baseline for single letter
792
        nFormulaBaseline+= aRect.GetBaseline() - aRect.GetAlignM();
793
    }
794
    // <--
779
}
795
}
780
796
781
797
Lines 815-834 Link Here
815
    SmTmpDevice  aTmpDev ((OutputDevice &) rDev, TRUE);
831
    SmTmpDevice  aTmpDev ((OutputDevice &) rDev, TRUE);
816
	aTmpDev.SetFont(GetFont());
832
	aTmpDev.SetFont(GetFont());
817
833
818
	// provide an empty rectangle with alignment parameters for the "current"
834
    if (nSize < 1)
819
	// font (in order to make "a^1 {}_2^3 a_4" work correct, that is, have the
835
    { 
820
	// same sub-/supscript positions.)
836
        // provide an empty rectangle with alignment parameters for the "current"
821
	//! be sure to use a character that has explicitly defined HiAttribut
837
        // font (in order to make "a^1 {}_2^3 a_4" work correct, that is, have the
822
	//! line in rect.cxx such as 'a' in order to make 'vec a' look same to
838
        // same sub-/supscript positions.)
823
	//! 'vec {a}'.
839
        //! be sure to use a character that has explicitly defined HiAttribut
824
	SmRect::operator = (SmRect(aTmpDev, &rFormat, C2S("a"),
840
        //! line in rect.cxx such as 'a' in order to make 'vec a' look same to
825
							   GetFont().GetBorderWidth()));
841
        //! 'vec {a}'.
826
	// make sure that the rectangle occupies (almost) no space
842
        SmRect::operator = (SmRect(aTmpDev, &rFormat, C2S("a"),
827
	SetWidth(1);
843
                            GetFont().GetBorderWidth()));
828
	SetItalicSpaces(0, 0);
844
        // make sure that the rectangle occupies (almost) no space
829
845
        SetWidth(1);
830
	if (nSize < 1)
846
        SetItalicSpaces(0, 0);
831
		return;
847
        return;
848
    }
832
849
833
	// make distance depend on font size
850
	// make distance depend on font size
834
	long nDist = (rFormat.GetDistance(DIS_HORIZONTAL) * GetFont().GetSize().Height()) / 100L;
851
	long nDist = (rFormat.GetDistance(DIS_HORIZONTAL) * GetFont().GetSize().Height()) / 100L;
Lines 836-842 Link Here
836
        nDist = 0;
853
        nDist = 0;
837
854
838
	Point   aPos;
855
	Point   aPos;
839
	for (i = 0;  i < nSize;  i++)
856
    // copy the first node into LineNode and extend by the others
857
    if (NULL != (pNode = GetSubNode(0)))
858
        SmRect::operator = (pNode->GetRect());
859
860
    for (i = 1;  i < nSize;  i++)
840
        if (NULL != (pNode = GetSubNode(i)))
861
        if (NULL != (pNode = GetSubNode(i)))
841
		{
862
		{
842
			aPos = pNode->AlignTo(*this, RP_RIGHT, RHA_CENTER, RVA_BASELINE);
863
			aPos = pNode->AlignTo(*this, RP_RIGHT, RHA_CENTER, RVA_BASELINE);
(-)a/starmath/source/unomodel.cxx (-1 / +20 lines)
Lines 237-243 Link Here
237
	// --> PB 2004-08-25 #i33095# Security Options
237
	// --> PB 2004-08-25 #i33095# Security Options
238
	HANDLE_LOAD_READONLY,
238
	HANDLE_LOAD_READONLY,
239
	// <--
239
	// <--
240
    HANDLE_DIALOG_LIBRARIES     // #i73329#
240
    HANDLE_DIALOG_LIBRARIES,     // #i73329#
241
    HANDLE_BASELINE // 3.7.2010 #i972#
241
};
242
};
242
243
243
PropertySetInfo * lcl_createModelPropertyInfo ()
244
PropertySetInfo * lcl_createModelPropertyInfo ()
Lines 308-313 Link Here
308
		// --> PB 2004-08-25 #i33095# Security Options
309
		// --> PB 2004-08-25 #i33095# Security Options
309
		{ RTL_CONSTASCII_STRINGPARAM( "LoadReadonly" ), HANDLE_LOAD_READONLY, &::getBooleanCppuType(), PROPERTY_NONE, 0 },
310
		{ RTL_CONSTASCII_STRINGPARAM( "LoadReadonly" ), HANDLE_LOAD_READONLY, &::getBooleanCppuType(), PROPERTY_NONE, 0 },
310
		// <--
311
		// <--
312
        // --> 3.7.2010 #i972#
313
        { RTL_CONSTASCII_STRINGPARAM( "BaseLine"), HANDLE_BASELINE, &::getCppuType((const sal_Int16*)0), PROPERTY_NONE, 0},
314
        // <--
311
		{ NULL, 0, 0, NULL, 0, 0 }
315
		{ NULL, 0, 0, NULL, 0, 0 }
312
	};
316
	};
313
	PropertySetInfo *pInfo = new PropertySetInfo ( aModelPropertyInfoMap );
317
	PropertySetInfo *pInfo = new PropertySetInfo ( aModelPropertyInfoMap );
Lines 939-944 Link Here
939
				break;
943
				break;
940
			}
944
			}
941
			// <--
945
			// <--
946
            // --> 3.7.2010 #i972#
947
            case HANDLE_BASELINE:
948
            {
949
                if ( !pDocSh->pTree )
950
                    pDocSh->Parse();
951
                if ( pDocSh->pTree )
952
                {
953
                    if ( !pDocSh->IsFormulaArranged() )
954
                        pDocSh->ArrangeFormula();
955
                    
956
                    *pValue <<= static_cast<sal_Int32>( pDocSh->pTree->GetFormulaBaseline() );
957
                }
958
            }
959
            break;
960
            // <--
942
        }
961
        }
943
	}
962
	}
944
}
963
}
(-)a/sw/inc/fesh.hxx (+12 lines)
Lines 549-554 Link Here
549
549
550
	BOOL ReplaceSdrObj( const String& rGrfName, const String& rFltName,
550
	BOOL ReplaceSdrObj( const String& rGrfName, const String& rFltName,
551
						const Graphic* pGrf = 0 );
551
						const Graphic* pGrf = 0 );
552
    // --> #i972#
553
    // Sets the format of the object to be aligned baseline to baseline
554
    // for starmath formulas aligned as character.
555
    // only set the SwFrmFmt if SwFlyFrm for the object doesn't exist yet
556
    void AlignFormula( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj , SwFrmFmt* pFrmFmt = 0 );
557
    // bSetAnchor determines whether the anchor is to be set to 'as char'
558
    // then for starmath formulas anchored 'as char' it alignes it baseline to baseline
559
    // changing the previous vertical orientation
560
    void AlignFormulaToBaseline( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj , bool bSetAnchor = FALSE );
561
    // aligns all formulas with anchor 'as char' to baseline
562
    void AlignAllFormulasToBaseline();
563
    // <--
552
564
553
//------------------------------------------
565
//------------------------------------------
554
566
(-)a/sw/inc/swcli.hxx (+2 lines)
Lines 53-58 Link Here
53
	void SetInDoVerb( BOOL bFlag )				{ bInDoVerb = bFlag; }
53
	void SetInDoVerb( BOOL bFlag )				{ bInDoVerb = bFlag; }
54
54
55
	BOOL IsCheckForOLEInCaption() const			{ return bOldCheckForOLEInCaption; }
55
	BOOL IsCheckForOLEInCaption() const			{ return bOldCheckForOLEInCaption; }
56
57
    virtual void FormatChanged();
56
};
58
};
57
59
58
#endif
60
#endif
(-)a/sw/source/core/doc/poolfmt.cxx (-1 / +1 lines)
Lines 1332-1338 Link Here
1332
	case RES_POOLFRM_FORMEL:
1332
	case RES_POOLFRM_FORMEL:
1333
		{
1333
		{
1334
            aSet.Put( SwFmtAnchor( FLY_AS_CHAR ) );
1334
            aSet.Put( SwFmtAnchor( FLY_AS_CHAR ) );
1335
            aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::CHAR_CENTER, text::RelOrientation::FRAME ) );
1335
            aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::NONE, text::RelOrientation::FRAME ) );
1336
            aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1336
            aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1337
		}
1337
		}
1338
		break;
1338
		break;
(-)a/sw/source/core/frmedt/fefly1.cxx (-1 / +140 lines)
Lines 73-78 Link Here
73
#include <HandleAnchorNodeChg.hxx>
73
#include <HandleAnchorNodeChg.hxx>
74
// <--
74
// <--
75
#include <frmatr.hxx>
75
#include <frmatr.hxx>
76
// --> 3.7.2010 #i972#
77
#include <ndole.hxx>
78
// <--
76
// --> OD 2009-12-29 #i89920#
79
// --> OD 2009-12-29 #i89920#
77
#include <fmtsrnd.hxx>
80
#include <fmtsrnd.hxx>
78
#include <editeng/opaqitem.hxx>
81
#include <editeng/opaqitem.hxx>
Lines 1522-1528 Link Here
1522
			pFly->ChgRelPos( aTmp );
1525
			pFly->ChgRelPos( aTmp );
1523
		}
1526
		}
1524
	}
1527
	}
1525
	EndAllAction();
1528
1529
    pFly->SetLastFlyFrmPrtRectPos( pFly->Prt().Pos() ); //stores the value of last Prt rect
1530
1531
    EndAllAction();
1526
1532
1527
	return aResult;
1533
	return aResult;
1528
}
1534
}
Lines 2154-2156 Link Here
2154
    }
2160
    }
2155
}
2161
}
2156
// <--
2162
// <--
2163
// --> 8.7.2010 #i972#
2164
void SwFEShell::AlignFormula( const uno::Reference < embed::XEmbeddedObject >& xObj , SwFrmFmt* pFrmFmt )
2165
{
2166
    SvGlobalName aCLSID( xObj->getClassID() );
2167
    BOOL bStarMath = ( SotExchange::IsMath( aCLSID ) != 0 );
2168
2169
    if (bStarMath) //check the object is formula
2170
    {
2171
        SwFlyFrm *pFly = 0;
2172
        if ( !pFrmFmt ) //find format if it was not given
2173
        {
2174
            pFly = FindFlyFrm( xObj );
2175
            if ( !pFly )
2176
            {
2177
                ASSERT( pFly , "No fly frame!" );
2178
                return;
2179
            }
2180
            pFrmFmt = pFly->GetFmt();
2181
        }
2182
2183
        if (pFrmFmt)
2184
        {
2185
            if (FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId()) // check the anchor is AsChar
2186
            {
2187
                uno::Any aBaseline;  
2188
2189
                if( svt::EmbeddedObjectRef::TryRunningState( xObj ) )
2190
                {
2191
                    uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
2192
                    if ( xSet.is() )
2193
                    {
2194
                        try
2195
                        {
2196
                            aBaseline = xSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BaseLine") ) );
2197
                        }
2198
                        catch ( uno::Exception& )
2199
                        {
2200
                            ASSERT( FALSE , "Baseline could not be retrieved from Starmath!" );
2201
                        }
2202
                    }
2203
                }
2204
2205
                sal_Int32 nBaseline = ::comphelper::getINT32(aBaseline);
2206
                const MapMode aSourceMapMode( MAP_100TH_MM );
2207
                const MapMode aTargetMapMode( MAP_TWIP );
2208
                nBaseline = OutputDevice::LogicToLogic( nBaseline, aSourceMapMode.GetMapUnit(), aTargetMapMode.GetMapUnit() );
2209
2210
                ASSERT( (nBaseline > 0) , "Wrong value of Baseline while retrieving from Starmath!" );
2211
                //nBaseline must be moved by aPrt position
2212
                if ( pFly )
2213
                    nBaseline += pFly->GetLastFlyFrmPrtRectPos().Y();
2214
2215
                const SwFmtVertOrient &rVert = pFrmFmt->GetVertOrient();
2216
                SwFmtVertOrient aVert( rVert );
2217
                aVert.SetPos( -nBaseline );
2218
2219
                pFrmFmt->LockModify();
2220
                pFrmFmt->SetFmtAttr( aVert );
2221
                pFrmFmt->UnlockModify();
2222
                if  ( pFly )
2223
                    pFly->InvalidatePos();
2224
            }
2225
        }	
2226
    }
2227
}
2228
2229
void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedObject >& xObj , bool bSetAnchor )
2230
{
2231
    SvGlobalName aCLSID( xObj->getClassID() );
2232
    BOOL bStarMath = ( SotExchange::IsMath( aCLSID ) != 0 );
2233
2234
    if ( bStarMath )
2235
    {
2236
        SwFlyFrm *pFly = FindFlyFrm( xObj );
2237
        if ( !pFly )
2238
        {
2239
            ASSERT( pFly , "No fly frame!" );
2240
            return;
2241
        }
2242
2243
        SwFrmFmt *pFmt = pFly->GetFmt();
2244
        if ( pFmt )
2245
        {
2246
            if ( bSetAnchor )
2247
            {
2248
                const SwFmtAnchor &rAnchor = pFmt->GetAnchor();
2249
                SwFmtAnchor aAnchor( rAnchor );
2250
                aAnchor.SetType( FLY_AS_CHAR );
2251
                pFmt->LockModify();
2252
                pFmt->SetFmtAttr( aAnchor );
2253
                pFmt->UnlockModify();	 
2254
            }
2255
2256
            if ( FLY_AS_CHAR == pFmt->GetAnchor().GetAnchorId() )
2257
            {
2258
                const SwFmtVertOrient &rVert = pFmt->GetVertOrient();
2259
                SwFmtVertOrient aVert( rVert );
2260
                aVert.SetVertOrient( com::sun::star::text::VertOrientation::NONE );
2261
                pFmt->LockModify();
2262
                pFmt->SetFmtAttr( aVert );
2263
                pFmt->UnlockModify();
2264
2265
                AlignFormula( xObj );
2266
            }
2267
        }
2268
    }
2269
}
2270
2271
void SwFEShell::AlignAllFormulasToBaseline()
2272
{
2273
    StartAllAction();
2274
2275
    SwStartNode *pStNd;
2276
    SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
2277
    while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
2278
    {
2279
        aIdx++;
2280
        SwNode& rNd = aIdx.GetNode();
2281
        if( rNd.IsOLENode() )
2282
        {
2283
            const uno::Reference < embed::XEmbeddedObject >& xObj = (dynamic_cast<SwOLENode&>(rNd)).GetOLEObj().GetOleRef();
2284
            SvGlobalName aCLSID( xObj->getClassID() );
2285
            if ( SotExchange::IsMath( aCLSID ) )
2286
                AlignFormulaToBaseline( xObj );
2287
        }
2288
2289
        aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
2290
    }
2291
2292
    EndAllAction();
2293
}
2294
// <--
2295
(-)a/sw/source/core/inc/flyfrm.hxx (+7 lines)
Lines 77-82 Link Here
77
77
78
    // OD 2004-05-27 #i26791# - moved to <SwAnchoredObject>
78
    // OD 2004-05-27 #i26791# - moved to <SwAnchoredObject>
79
//    Point aRelPos;   //Die Relative Position zum Master
79
//    Point aRelPos;   //Die Relative Position zum Master
80
    Point aLastFlyFrmPrtRectPos; // it stores the previous position of Prt rectangle from RequestObjectResize
81
                                 // so it can be used to move frames of non-resizable objects to align them correctly
82
                                 // when they get borders (this is done in SwWrtShell::CalcAndGetScale)
80
83
81
private:
84
private:
82
	BOOL bLocked	:1;	//Cntnt-gebundene Flys muessen derart blockiert werden
85
	BOOL bLocked	:1;	//Cntnt-gebundene Flys muessen derart blockiert werden
Lines 283-287 Link Here
283
        @author OD
286
        @author OD
284
    */
287
    */
285
    virtual bool IsFormatPossible() const;
288
    virtual bool IsFormatPossible() const;
289
        
290
    const Point GetLastFlyFrmPrtRectPos() const { return aLastFlyFrmPrtRectPos; }
291
    void SetLastFlyFrmPrtRectPos( Point aPoint ) { aLastFlyFrmPrtRectPos = aPoint; }
292
    
286
};
293
};
287
#endif
294
#endif
(-)a/sw/source/core/inc/flyfrms.hxx (+3 lines)
Lines 188-193 Link Here
188
188
189
	BOOL bInvalidLayout :1;
189
	BOOL bInvalidLayout :1;
190
	BOOL bInvalidCntnt	:1;
190
	BOOL bInvalidCntnt	:1;
191
	bool bPosCalculated;
191
192
192
protected:
193
protected:
193
    virtual void NotifyBackground( SwPageFrm *pPage,
194
    virtual void NotifyBackground( SwPageFrm *pPage,
Lines 237-242 Link Here
237
    // format of the anchor frame
238
    // format of the anchor frame
238
    virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
239
    virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
239
    // <--
240
    // <--
241
242
    void SetPosCalculated( bool bNew ) { bPosCalculated = bNew; }
240
};
243
};
241
244
242
inline void SwFlyInCntFrm::InvalidateLayout() const
245
inline void SwFlyInCntFrm::InvalidateLayout() const
(-)a/sw/source/core/layout/fly.cxx (+1 lines)
Lines 119-124 Link Here
119
//    aRelPos(),
119
//    aRelPos(),
120
	pPrevLink( 0 ),
120
	pPrevLink( 0 ),
121
	pNextLink( 0 ),
121
	pNextLink( 0 ),
122
    aLastFlyFrmPrtRectPos( Point(0,0) ),
122
	bInCnt( FALSE ),
123
	bInCnt( FALSE ),
123
	bAtCnt( FALSE ),
124
	bAtCnt( FALSE ),
124
	bLayout( FALSE ),
125
	bLayout( FALSE ),
(-)a/sw/source/core/layout/flyincnt.cxx (+6 lines)
Lines 56-61 Link Here
56
	SwFlyFrm( pFmt, pAnch )
56
	SwFlyFrm( pFmt, pAnch )
57
{
57
{
58
	bInCnt = bInvalidLayout = bInvalidCntnt = TRUE;
58
	bInCnt = bInvalidLayout = bInvalidCntnt = TRUE;
59
    bPosCalculated = FALSE;
59
    SwTwips nRel = pFmt->GetVertOrient().GetPos();
60
    SwTwips nRel = pFmt->GetVertOrient().GetPos();
60
    // OD 2004-05-27 #i26791# - member <aRelPos> moved to <SwAnchoredObject>
61
    // OD 2004-05-27 #i26791# - member <aRelPos> moved to <SwAnchoredObject>
61
    Point aRelPos;
62
    Point aRelPos;
Lines 203-208 Link Here
203
    if ( !bValidPos )
204
    if ( !bValidPos )
204
    {
205
    {
205
        bValidPos = TRUE;
206
        bValidPos = TRUE;
207
        // --> let the position be set, only if it was calculated in
208
        // SwAsCharAnchoredObjectPosition::CalcPosition
209
        if ( !bPosCalculated )
210
            return;
211
        // <--
206
        SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
212
        SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
207
        const SwFmtVertOrient &rVert = pFmt->GetVertOrient();
213
        const SwFmtVertOrient &rVert = pFmt->GetVertOrient();
208
        //Und ggf. noch die aktuellen Werte im Format updaten, dabei darf
214
        //Und ggf. noch die aktuellen Werte im Format updaten, dabei darf
(-)a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx (+4 lines)
Lines 328-334 Link Here
328
        {
328
        {
329
            // set new anchor position and relative position
329
            // set new anchor position and relative position
330
            SwFlyInCntFrm* pFlyInCntFrm = &(const_cast<SwFlyInCntFrm&>(rFlyInCntFrm));
330
            SwFlyInCntFrm* pFlyInCntFrm = &(const_cast<SwFlyInCntFrm&>(rFlyInCntFrm));
331
            // --> let SwFlyInCnt::MakeObjPos set position only at this place using bPosCalculated
332
            pFlyInCntFrm->SetPosCalculated( TRUE );
331
            pFlyInCntFrm->SetRefPoint( aAnchorPos, aRelAttr, aRelPos );
333
            pFlyInCntFrm->SetRefPoint( aAnchorPos, aRelAttr, aRelPos );
334
            pFlyInCntFrm->SetPosCalculated( FALSE );
335
            // <--
332
            if( nObjWidth != (pFlyInCntFrm->Frm().*fnRect->fnGetWidth)() )
336
            if( nObjWidth != (pFlyInCntFrm->Frm().*fnRect->fnGetWidth)() )
333
            {
337
            {
334
                // recalculate object bound rectangle, if object width has changed.
338
                // recalculate object bound rectangle, if object width has changed.
(-)a/sw/source/ui/uiview/swcli.cxx (+14 lines)
Lines 169-171 Link Here
169
	const SwWrtShell &rSh  = ((SwView*)GetViewShell())->GetWrtShell();
169
	const SwWrtShell &rSh  = ((SwView*)GetViewShell())->GetWrtShell();
170
    rSh.MakeObjVisible( GetObject() );
170
    rSh.MakeObjVisible( GetObject() );
171
}
171
}
172
173
void SwOleClient::FormatChanged()
174
{
175
    // --> #i972#
176
    const uno::Reference < embed::XEmbeddedObject >& xObj = GetObject();
177
    
178
    SvGlobalName aCLSID( xObj->getClassID() );
179
    if ( SotExchange::IsMath( aCLSID ) )
180
    {
181
        SwWrtShell &rSh = ( dynamic_cast<SwView*>( GetViewShell() ) )->GetWrtShell();
182
        rSh.AlignFormula( xObj );
183
    }
184
    // <--
185
}
(-)a/sw/source/ui/wrtsh/wrtsh1.cxx (-2 / +25 lines)
Lines 493-499 Link Here
493
493
494
        if ( xObj.is() )
494
        if ( xObj.is() )
495
		{
495
		{
496
            if( InsertOleObject( xObj ) && bActivate && bDoVerb )
496
            BOOL bActivate2 = InsertOleObject( xObj );
497
            if( bActivate && bDoVerb )
497
			{
498
			{
498
                SfxInPlaceClient* pClient = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
499
                SfxInPlaceClient* pClient = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
499
                if ( !pClient )
500
                if ( !pClient )
Lines 517-523 Link Here
517
518
518
                //#50270# Error brauchen wir nicht handeln, das erledigt das
519
                //#50270# Error brauchen wir nicht handeln, das erledigt das
519
                //DoVerb in der SfxViewShell
520
                //DoVerb in der SfxViewShell
520
                pClient->DoVerb( SVVERB_SHOW );
521
                if ( bActivate2 )
522
                    pClient->DoVerb( SVVERB_SHOW );
521
523
522
                // TODO/LATER: set document name - should be done in Client
524
                // TODO/LATER: set document name - should be done in Client
523
                //if ( !ERRCODE_TOERROR( nErr ) )
525
                //if ( !ERRCODE_TOERROR( nErr ) )
Lines 614-619 Link Here
614
	aFrmMgr.SetSize( aSz );
616
	aFrmMgr.SetSize( aSz );
615
    SwFlyFrmFmt *pFmt = SwFEShell::InsertObject( xRef, &aFrmMgr.GetAttrSet() );
617
    SwFlyFrmFmt *pFmt = SwFEShell::InsertObject( xRef, &aFrmMgr.GetAttrSet() );
616
618
619
    // --> #i972#
620
    if ( bStarMath ) //sets baseline
621
        AlignFormula( xRef.GetObject() , pFmt );
622
    // <--
623
617
    if (pFlyFrmFmt)
624
    if (pFlyFrmFmt)
618
        *pFlyFrmFmt = pFmt;
625
        *pFlyFrmFmt = pFmt;
619
626
Lines 774-779 Link Here
774
        if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) || bLinkingChart
781
        if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) || bLinkingChart
775
            // TODO/LATER: ResizeOnPrinterChange
782
            // TODO/LATER: ResizeOnPrinterChange
776
             //|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
783
             //|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
784
             || nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE // non-resizable objects need to be
785
                                                            // set the size back by this method
777
             )
786
             )
778
        {
787
        {
779
            pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
788
            pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
Lines 884-889 Link Here
884
893
885
	if ( bUseObjectSize )
894
	if ( bUseObjectSize )
886
	{
895
	{
896
        // --> this moves non-resizable object so that when adding borders the baseline remains the same 
897
        const SwFlyFrm *pFly = GetCurrFlyFrm();
898
        if ( pFly )
899
        {
900
            const Point aPoint = pFly->GetLastFlyFrmPrtRectPos();
901
            SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
902
                        : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
903
            aArea += aPoint - aRect.Pos();
904
        }
905
        else
906
        {
907
            ASSERT( FALSE , "Could not find fly frame." );
908
        }
909
        // <--
887
        aArea.Width ( _aVisArea.Width() );
910
        aArea.Width ( _aVisArea.Width() );
888
        aArea.Height( _aVisArea.Height() );
911
        aArea.Height( _aVisArea.Height() );
889
		RequestObjectResize( aArea, xObj.GetObject() );
912
		RequestObjectResize( aArea, xObj.GetObject() );

Return to issue 972