svx/source/customshapes/EnhancedCustomShapeGeometry.cxx | 60 ++++++++++++++-- sw/source/filter/ww8/ww8graf.cxx | 24 ++++-- 2 files changed, 69 insertions(+), 15 deletions(-)
New commits: commit 73d23a54b8b930520788c891ddb12562198e94e8 Author: Sun Ying <suny...@apache.org> Date: Mon Aug 20 02:29:52 2012 +0000 #119881# fix the"RingInside" fontwork display incorrectly when open .ppt file Reported by: Li Feng Wang Patch by: Ying Sun Review by: Jian Yuan Li(cherry picked from commit 4904b17b657750e565e30d56810da513057fba39) diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index 3eb6308..e823edc 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -6438,7 +6438,47 @@ static const mso_CustomShape msoTextChevronInverted = NULL, 0, (SvxMSDffHandle*)mso_sptTextChevronInvertedHandle, SAL_N_ELEMENTS( mso_sptTextChevronInvertedHandle ) }; - +//V 0 0 21600 ?f2 0 ?f0 21600 ?f0 +//W 0 0 21600 ?f2 21600 ?f0 0 ?f0 N +//V 0 ?f3 21600 21600 0 ?f1 21600 ?f1 +//W 0 ?f3 21600 21600 21600 ?f1 0 ?f1 N +//mso_sptTextRingInside +static const SvxMSDffVertPair mso_sptTextRingInsideVert[] = +{ + { 0, 0 }, { 21600, 2 MSO_I }, { 0, 0 MSO_I },{ 21600, 0 MSO_I },//V + { 0, 0 }, { 21600, 2 MSO_I }, { 21600, 0 MSO_I },{ 0, 0 MSO_I },//W + { 0, 3 MSO_I }, { 21600, 21600 }, { 0, 1 MSO_I },{ 21600, 1 MSO_I },//V + { 0, 3 MSO_I }, { 21600, 21600 }, { 21600, 1 MSO_I },{ 0, 1 MSO_I }//W +}; +static const SvxMSDffCalculationData mso_sptTextRingInsideCalc[] = // adjustment1 : 6629 - 14971 +{ + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x8000, { 21600, 0, 0x400 } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, //$0 + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }//21600-$0 +}; +static const sal_uInt16 mso_sptTextRingInsideSegm[] = +{ + 0xa604, 0xa504,0x8000, + 0xa604, 0xa504,0x8000 +}; +static const SvxMSDffHandle mso_sptTextRingInsideHandle[] = +{ + { MSDFF_HANDLE_FLAGS_RANGE| MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL, + 10800, 0x100, 10800, 10800, 0x80000000, 0x7fffffff, 10800, 21600 } +}; +static const mso_CustomShape msoTextRingInside = +{ + (SvxMSDffVertPair*)mso_sptTextRingInsideVert, sizeof( mso_sptTextRingInsideVert ) / sizeof( SvxMSDffVertPair ), + (sal_uInt16*)mso_sptTextRingInsideSegm, sizeof( mso_sptTextRingInsideSegm ) >> 1, + (SvxMSDffCalculationData*)mso_sptTextRingInsideCalc, sizeof( mso_sptTextRingInsideCalc ) / sizeof( SvxMSDffCalculationData ), + (sal_Int32*)mso_sptDefault13500, + (SvxMSDffTextRectangles*)mso_sptFontWorkTextRect, sizeof( mso_sptFontWorkTextRect ) / sizeof( SvxMSDffTextRectangles ), + 21600, 21600, + 0x80000000, 0x80000000, + NULL, 0, + (SvxMSDffHandle*)mso_sptTextRingInsideHandle, sizeof( mso_sptTextRingInsideHandle ) / sizeof( SvxMSDffHandle ) +}; //mso_sptTextRingOutside //path = U 10800 ?f0 21600 ?f2 180 539 N U 10800 ?f1 21600 ?f2 180 539 N static const SvxMSDffVertPair mso_sptTextRingOutsideVert[] = @@ -8400,7 +8440,7 @@ const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType ) case mso_sptTextTriangleInverted : pCustomShape = &msoTextTriangleInverted; break; case mso_sptTextChevron : pCustomShape = &msoTextChevron; break; case mso_sptTextChevronInverted : pCustomShape = &msoTextChevronInverted; break; - case mso_sptTextRingInside : pCustomShape = &msoTextRingOutside; break; // SJ: TODO->the orientation of the ellipse needs to be changed + case mso_sptTextRingInside : pCustomShape = &msoTextRingInside; break; // SJ: TODO->the orientation of the ellipse needs to be changed case mso_sptTextRingOutside : pCustomShape = &msoTextRingOutside; break; case mso_sptTextFadeRight : pCustomShape = &msoTextFadeRight; break; case mso_sptTextFadeLeft : pCustomShape = &msoTextFadeLeft; break; commit e820522037ff95818b9a40dfd77671f84c714cd5 Author: Sun Ying <suny...@apache.org> Date: Thu Aug 16 04:25:06 2012 +0000 Related: #120556# fix the "RingOutside" fontwork display incorrectly... when open .ppt file Reported by: Li Feng Wang Patch by: Ying Sun Review by: Jian Yuan Li (cherry picked from commit 3473dbf606f525d95b898a08072259018eb4056f) Conflicts: svx/source/customshapes/EnhancedCustomShapeGeometry.cxx Change-Id: I356bf0b5af720765e8ca60ae79bd04e449ff6e18 diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index 2c3cdd7..3eb6308 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -6439,15 +6439,21 @@ static const mso_CustomShape msoTextChevronInverted = (SvxMSDffHandle*)mso_sptTextChevronInvertedHandle, SAL_N_ELEMENTS( mso_sptTextChevronInvertedHandle ) }; +//mso_sptTextRingOutside +//path = U 10800 ?f0 21600 ?f2 180 539 N U 10800 ?f1 21600 ?f2 180 539 N static const SvxMSDffVertPair mso_sptTextRingOutsideVert[] = { - { 10800, 0 MSO_I }, { 10800, 0 MSO_I }, { 180, 359 }, - { 10800, 1 MSO_I }, { 10800, 0 MSO_I }, { 180, 359 } + { 10800, 0 MSO_I }, { 21600, 2 MSO_I }, { 180, 539},//U + { 10800, 1 MSO_I }, { 21600, 2 MSO_I }, { 180, 539 }//U + //{ 10800, 0 MSO_I }, { 10800, 0 MSO_I }, { 180, 359 }, + //{ 10800, 1 MSO_I }, { 10800, 0 MSO_I }, { 180, 359 } }; static const SvxMSDffCalculationData mso_sptTextRingOutsideCalc[] = // adjustment1 : 6629 - 14971 { { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, - { 0x8000, { 21600, 0, 0x400 } } + { 0x8000, { 21600, 0, 0x400 } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, //$0 + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }//21600-$0 }; static const sal_uInt16 mso_sptTextRingOutsideSegm[] = { @@ -6456,7 +6462,7 @@ static const sal_uInt16 mso_sptTextRingOutsideSegm[] = }; static const SvxMSDffHandle mso_sptTextRingOutsideHandle[] = { - { MSDFF_HANDLE_FLAGS_RANGE, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL, 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 10800, 21600 } }; static const mso_CustomShape msoTextRingOutside = @@ -6464,7 +6470,7 @@ static const mso_CustomShape msoTextRingOutside = (SvxMSDffVertPair*)mso_sptTextRingOutsideVert, SAL_N_ELEMENTS( mso_sptTextRingOutsideVert ), (sal_uInt16*)mso_sptTextRingOutsideSegm, sizeof( mso_sptTextRingOutsideSegm ) >> 1, (SvxMSDffCalculationData*)mso_sptTextRingOutsideCalc, SAL_N_ELEMENTS( mso_sptTextRingOutsideCalc ), - (sal_Int32*)mso_sptDefault16200, + (sal_Int32*)mso_sptDefault13500, (SvxMSDffTextRectangles*)mso_sptFontWorkTextRect, SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), 21600, 21600, MIN_INT32, MIN_INT32, commit b4d1fd3cca027ceecc1230e35c15b5363a591906 Author: Lei De Bin <le...@apache.org> Date: Mon Sep 10 04:45:43 2012 +0000 Related: #i119549# fix Position of drawing obj incorrect * when opening .doc in AOO, if the text direction of the whole document is vertical, the pos of the drawing obj will be wrong. Reported by: Lou Qing le Patch by: Chen Zuo Jun Review by: Lei De Bin (cherry picked from commit 5c413ad6d8c2b2e16c19ff007e5315b383b73eb5) Conflicts: sw/source/filter/ww8/ww8graf.cxx Change-Id: I8cfa32974662f89406e1688be0b3dec22e9b7045 diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 3aebdf5..3004bbb 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2118,6 +2118,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, OSL_ENSURE(pRecord || pFSPA, "give me something! to work with for anchoring"); if (!pRecord && !pFSPA) return FLY_AT_PAGE; + sal_Bool bCurSectionVertical = maSectionManager.CurrentSectionIsVertical(); SvxMSDffImportRec aRecordFromFSPA; if (!pRecord) @@ -2159,7 +2160,8 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, // is a hint that these values aren't set by the escher import - see // method <SwMSDffManager::ProcessObj(..)>. Then, check if for each // values, if it differs from the one in the FSPA. - if ( *(pRecord->pXRelTo) == 2 && *(pRecord->pYRelTo) == 2 ) + + if ( *(pRecord->pXRelTo) == 2 && *(pRecord->pYRelTo) == 2 && !bCurSectionVertical) { // if <nYRelTo> differs from <FSPA.nby> overwrite <nYRelTo> if ( pFSPA->nby != *(pRecord->pYRelTo) ) @@ -2289,11 +2291,6 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, eHoriRel = text::RelOrientation::PAGE_PRINT_AREA; } - SwFmtHoriOrient aHoriOri(MakeSafePositioningValue(pFSPA->nXaLeft), - eHoriOri, eHoriRel); - if( 4 <= nXAlign ) - aHoriOri.SetPosToggle(true); - rFlySet.Put( aHoriOri ); //Writer honours this wrap distance when aligned as "left" or "right", //Word doesn't. Writer doesn't honour it when its "from left". @@ -2303,7 +2300,10 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, pRecord->nDxWrapDistRight=0; sal_Int16 eVertRel; + eVertRel = aVertRelOriTab[ nYRelTo ]; // #i18732# + if ( bCurSectionVertical && nYRelTo == 2 ) + eVertRel = text::RelOrientation::PAGE_PRINT_AREA; // #i22673# - fill <eVertOri> in dependence of <eVertRel> sal_Int16 eVertOri; if ( eVertRel == text::RelOrientation::TEXT_LINE ) @@ -2322,8 +2322,16 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, if ((eVertRel == text::RelOrientation::TEXT_LINE) && (eVertOri == text::VertOrientation::NONE)) nYPos = -nYPos; - rFlySet.Put(SwFmtVertOrient(MakeSafePositioningValue(nYPos), - eVertOri, eVertRel)); + SwFmtHoriOrient aHoriOri(MakeSafePositioningValue( bCurSectionVertical ? nYPos : pFSPA->nXaLeft ), + bCurSectionVertical ? eVertOri : eHoriOri, + bCurSectionVertical ? eVertRel : eHoriRel); + if( 4 <= nXAlign ) + aHoriOri.SetPosToggle(true); + rFlySet.Put( aHoriOri ); + + rFlySet.Put(SwFmtVertOrient(MakeSafePositioningValue( !bCurSectionVertical ? nYPos : -pFSPA->nXaRight ), + !bCurSectionVertical ? eVertOri : eHoriOri, + !bCurSectionVertical ? eVertRel : eHoriRel )); } return eAnchor; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits