EnhancedCustomShapeFontWork.cxx (c0739476) | EnhancedCustomShapeFontWork.cxx (26734c99) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 435 unchanged lines hidden (view full) --- 444 nVerticalOffset += rFWData.nSingleLineHeight; 445 aParagraphIter++; 446 } 447} 448 449void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape ) 450{ 451 SdrTextHorzAdjust eHorzAdjust( ((SdrTextHorzAdjustItem&)pCustomShape->GetMergedItem( SDRATTR_TEXT_HORZADJUST )).GetValue() ); | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 435 unchanged lines hidden (view full) --- 444 nVerticalOffset += rFWData.nSingleLineHeight; 445 aParagraphIter++; 446 } 447} 448 449void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape ) 450{ 451 SdrTextHorzAdjust eHorzAdjust( ((SdrTextHorzAdjustItem&)pCustomShape->GetMergedItem( SDRATTR_TEXT_HORZADJUST )).GetValue() ); |
452 const sal_Bool bFTS(((SdrTextFitToSizeTypeItem&)pCustomShape->GetMergedItem(SDRATTR_TEXT_FITTOSIZE)).GetValue()); | 452 SdrFitToSizeType eFTS( ((SdrTextFitToSizeTypeItem&)pCustomShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )).GetValue() ); |
453 454 std::vector< FWTextArea >::iterator aTextAreaIter = rFWData.vTextAreas.begin(); 455 std::vector< FWTextArea >::iterator aTextAreaIEnd = rFWData.vTextAreas.end(); 456 457 rFWData.nSingleLineHeight = (sal_Int32)( ( (double)pCustomShape->GetLogicRect().GetHeight() 458 / rFWData.nMaxParagraphsPerTextArea ) * rFWData.fHorizontalTextScaling ); 459 460 sal_Bool bSameLetterHeights = sal_False; 461 SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); 462 const rtl::OUString sTextPath( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) ); 463 const rtl::OUString sSameLetterHeights( RTL_CONSTASCII_USTRINGPARAM ( "SameLetterHeights" ) ); 464 com::sun::star::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sSameLetterHeights ); 465 if ( pAny ) 466 *pAny >>= bSameLetterHeights; 467 468 while ( aTextAreaIter != aTextAreaIEnd ) 469 { 470 GetTextAreaOutline( rFWData, pCustomShape, *aTextAreaIter, bSameLetterHeights ); | 453 454 std::vector< FWTextArea >::iterator aTextAreaIter = rFWData.vTextAreas.begin(); 455 std::vector< FWTextArea >::iterator aTextAreaIEnd = rFWData.vTextAreas.end(); 456 457 rFWData.nSingleLineHeight = (sal_Int32)( ( (double)pCustomShape->GetLogicRect().GetHeight() 458 / rFWData.nMaxParagraphsPerTextArea ) * rFWData.fHorizontalTextScaling ); 459 460 sal_Bool bSameLetterHeights = sal_False; 461 SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); 462 const rtl::OUString sTextPath( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) ); 463 const rtl::OUString sSameLetterHeights( RTL_CONSTASCII_USTRINGPARAM ( "SameLetterHeights" ) ); 464 com::sun::star::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sSameLetterHeights ); 465 if ( pAny ) 466 *pAny >>= bSameLetterHeights; 467 468 while ( aTextAreaIter != aTextAreaIEnd ) 469 { 470 GetTextAreaOutline( rFWData, pCustomShape, *aTextAreaIter, bSameLetterHeights ); |
471 if(bFTS ) | 471 if ( eFTS == SDRTEXTFIT_ALLLINES ) |
472 { 473 std::vector< FWParagraphData >::iterator aParagraphIter( aTextAreaIter->vParagraphs.begin() ); 474 std::vector< FWParagraphData >::iterator aParagraphIEnd( aTextAreaIter->vParagraphs.end() ); 475 while ( aParagraphIter != aParagraphIEnd ) 476 { 477 sal_Int32 nParaWidth = aParagraphIter->aBoundRect.GetWidth(); 478 if ( nParaWidth ) 479 { --- 427 unchanged lines hidden --- | 472 { 473 std::vector< FWParagraphData >::iterator aParagraphIter( aTextAreaIter->vParagraphs.begin() ); 474 std::vector< FWParagraphData >::iterator aParagraphIEnd( aTextAreaIter->vParagraphs.end() ); 475 while ( aParagraphIter != aParagraphIEnd ) 476 { 477 sal_Int32 nParaWidth = aParagraphIter->aBoundRect.GetWidth(); 478 if ( nParaWidth ) 479 { --- 427 unchanged lines hidden --- |