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

(-)filter/inc/filter/msfilter/svdfppt.hxx (-1 / +2 lines)
Lines 580-586 Link Here
580
    sal_uInt32     GetNotesPageId(sal_uInt16 nPageNum ) const;
580
    sal_uInt32     GetNotesPageId(sal_uInt16 nPageNum ) const;
581
	SdrOutliner* GetDrawOutliner( SdrTextObj* pSdrText ) const;
581
	SdrOutliner* GetDrawOutliner( SdrTextObj* pSdrText ) const;
582
	void		SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOptions );
582
	void		SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOptions );
583
583
	void		ApplyTextAnchorAttributes( PPTTextObj& rTextObj, SfxItemSet& rSet ) const;
584
	sal_Bool	IsVerticalText() const;
584
public:
585
public:
585
                SdrPowerPointImport( PowerPointImportParam&, const String& rBaseURL );
586
                SdrPowerPointImport( PowerPointImportParam&, const String& rBaseURL );
586
    virtual		~SdrPowerPointImport();
587
    virtual		~SdrPowerPointImport();
(-)filter/source/msfilter/svdfppt.cxx (+130 lines)
Lines 7815-7818 Link Here
7815
7815
7816
7816
7817
////////////////////////////////////////////////////////////////////////////////////////////////////
7817
////////////////////////////////////////////////////////////////////////////////////////////////////
7818
sal_Bool SdrPowerPointImport::IsVerticalText() const
7819
{
7820
	sal_Bool bVerticalText = sal_False;
7821
	if ( IsProperty( DFF_Prop_txflTextFlow ) )
7822
	{
7823
		MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow ) & 0xFFFF );
7824
		switch( eTextFlow )
7825
		{
7826
		case mso_txflTtoBA :		            // Top to Bottom @-font, above -> below
7827
		case mso_txflTtoBN :					// Top to Bottom non-@, above -> below
7828
		case mso_txflVertN :					// Vertical, non-@, above -> below
7829
			bVerticalText = !bVerticalText;
7830
			break;
7831
		default: break;
7832
		}
7833
	}
7834
	
7835
	return bVerticalText;
7836
}
7818
7837
7838
void	SdrPowerPointImport::ApplyTextAnchorAttributes( PPTTextObj& rTextObj, SfxItemSet& rSet ) const
7839
{
7840
	SdrTextVertAdjust eTVA;
7841
	SdrTextHorzAdjust eTHA;
7842
	
7843
	sal_uInt32 nTextFlags = rTextObj.GetTextFlags();
7844
7845
	nTextFlags &= PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT   | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT
7846
		| PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK;
7847
	
7848
	if ( IsVerticalText() )
7849
	{
7850
		eTVA = SDRTEXTVERTADJUST_BLOCK;
7851
		eTHA = SDRTEXTHORZADJUST_CENTER;
7852
7853
		// Textverankerung lesen
7854
		MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
7855
7856
		switch( eTextAnchor )
7857
		{
7858
		case mso_anchorTop:
7859
		case mso_anchorTopCentered:
7860
			eTHA = SDRTEXTHORZADJUST_RIGHT;
7861
			break;
7862
7863
		case mso_anchorMiddle :
7864
		case mso_anchorMiddleCentered:
7865
			eTHA = SDRTEXTHORZADJUST_CENTER;
7866
			break;
7867
7868
		case mso_anchorBottom:
7869
		case mso_anchorBottomCentered:
7870
			eTHA = SDRTEXTHORZADJUST_LEFT;
7871
			break;
7872
		}
7873
		// if there is a 100% use of following attributes, the textbox can been aligned also in vertical direction
7874
		switch ( eTextAnchor )
7875
		{
7876
		case mso_anchorTopCentered :
7877
		case mso_anchorMiddleCentered :
7878
		case mso_anchorBottomCentered :
7879
			{
7880
				// check if it is sensible to use the centered alignment
7881
				sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT;
7882
				if ( ( nTextFlags & nMask ) != nMask )  // if the textobject has left or also right aligned pararagraphs
7883
					eTVA = SDRTEXTVERTADJUST_CENTER;    // the text has to be displayed using the full width;
7884
			}
7885
			break;
7886
7887
		default :
7888
			{
7889
				if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT )
7890
					eTVA = SDRTEXTVERTADJUST_TOP;
7891
				else if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT )
7892
					eTVA = SDRTEXTVERTADJUST_BOTTOM;
7893
			}
7894
			break;
7895
		}
7896
	}
7897
	else
7898
	{
7899
		eTVA = SDRTEXTVERTADJUST_CENTER;
7900
		eTHA = SDRTEXTHORZADJUST_BLOCK;
7901
7902
		// Textverankerung lesen
7903
		MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
7904
7905
		switch( eTextAnchor )
7906
		{
7907
		case mso_anchorTop:
7908
		case mso_anchorTopCentered:
7909
			eTVA = SDRTEXTVERTADJUST_TOP;
7910
			break;
7911
7912
		case mso_anchorMiddle :
7913
		case mso_anchorMiddleCentered:
7914
			eTVA = SDRTEXTVERTADJUST_CENTER;
7915
			break;
7916
7917
		case mso_anchorBottom:
7918
		case mso_anchorBottomCentered:
7919
			eTVA = SDRTEXTVERTADJUST_BOTTOM;
7920
			break;
7921
		}
7922
		// if there is a 100% usage of following attributes, the textbox can be aligned also in horizontal direction
7923
		switch ( eTextAnchor )
7924
		{
7925
		case mso_anchorTopCentered :
7926
		case mso_anchorMiddleCentered :
7927
		case mso_anchorBottomCentered :
7928
			{
7929
				// check if it is sensible to use the centered alignment
7930
				sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT;
7931
				if ( ( nTextFlags & nMask ) != nMask )  // if the textobject has left or also right aligned pararagraphs
7932
					eTHA = SDRTEXTHORZADJUST_CENTER;    // the text has to be displayed using the full width;
7933
			}
7934
			break;
7935
7936
		default :
7937
			{
7938
				if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT )
7939
					eTHA = SDRTEXTHORZADJUST_LEFT;
7940
				else if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT )
7941
					eTHA = SDRTEXTHORZADJUST_RIGHT;
7942
			}
7943
			break;
7944
		}
7945
	}
7946
	rSet.Put( SdrTextVertAdjustItem( eTVA ) );
7947
	rSet.Put( SdrTextHorzAdjustItem( eTHA ) );
7948
}
(-)sd/source/filter/ppt/pptin.cxx (+4 lines)
Lines 2446-2451 Link Here
2446
2446
2447
							SfxItemSet aSet( pSdrModel->GetItemPool() );
2447
							SfxItemSet aSet( pSdrModel->GetItemPool() );
2448
							ApplyAttributes( rStCtrl, aSet );
2448
							ApplyAttributes( rStCtrl, aSet );
2449
2450
							pPresObj->SetLogicRect(pText->GetLogicRect());
2451
							ApplyTextAnchorAttributes( *pTextObj, aSet );
2452
2449
							pPresObj->SetMergedItemSet(aSet);
2453
							pPresObj->SetMergedItemSet(aSet);
2450
2454
2451
							if ( ( eAktPageKind != PPT_NOTEPAGE ) && ( pSlideLayout->aPlacementId[ i ] != (sal_uLong)-1 ) )
2455
							if ( ( eAktPageKind != PPT_NOTEPAGE ) && ( pSlideLayout->aPlacementId[ i ] != (sal_uLong)-1 ) )

Return to issue 119874