filter/source/msfilter/escherex.cxx | 49 ++++++++--- filter/source/msfilter/svdfppt.cxx | 6 + oox/source/vml/vmlshapecontext.cxx | 35 +++++++- sd/source/filter/eppt/pptexanimations.cxx | 2 sd/source/filter/ppt/pptin.cxx | 8 + svx/source/customshapes/EnhancedCustomShapeGeometry.cxx | 5 - svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx | 68 +++++++++++----- sw/source/filter/ww8/wrtw8esh.cxx | 6 + sw/source/filter/ww8/ww8par5.cxx | 2 9 files changed, 139 insertions(+), 42 deletions(-)
New commits: commit 61651ece1a1eaa5012c69e3b0b36fcddb2e37c71 Author: Armin Le Grand <a...@apache.org> Date: Wed Sep 26 11:26:49 2012 +0000 #119750# corrected opacity import for SC comment shapes and their shadow visualisation diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index 79dac8e..c5edd00 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -59,6 +59,35 @@ OptValue< double > lclDecodePercent( const AttributeList& rAttribs, sal_Int32 nT return OptValue< double >(); } +/** #119750# Special method for opacity; it *should* be a percentage value, but there are cases + where a value relative to 0xffff (65536) is used, ending with an 'f' + */ +OptValue< double > lclDecodeOpacity( const AttributeList& rAttribs, sal_Int32 nToken, double fDefValue ) +{ + OptValue< OUString > oValue = rAttribs.getString( nToken ); + double fRetval(fDefValue); + + if( oValue.has() ) + { + const OUString aString(oValue.get()); + const sal_Int32 nLength(aString.getLength()); + + if(nLength > 0) + { + if(aString.endsWithAsciiL(RTL_CONSTASCII_STRINGPARAM("f"))) + { + fRetval = std::max(0.0, std::min(1.0, aString.toDouble() / 65536.0)); + } + else + { + fRetval = ConversionHelper::decodePercent( aString, fDefValue ); + } + } + } + + return OptValue< double >(fRetval); +} + /** Returns the integer value pair from the specified VML attribute (if present). */ OptValue< Int32Pair > lclDecodeInt32Pair( const AttributeList& rAttribs, sal_Int32 nToken ) @@ -298,7 +327,7 @@ ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const A mrTypeModel.maStrokeModel.maEndArrow.moArrowWidth = rAttribs.getToken( XML_endarrowwidth ); mrTypeModel.maStrokeModel.maEndArrow.moArrowLength = rAttribs.getToken( XML_endarrowlength ); mrTypeModel.maStrokeModel.moColor.assignIfUsed( rAttribs.getString( XML_color ) ); - mrTypeModel.maStrokeModel.moOpacity = lclDecodePercent( rAttribs, XML_opacity, 1.0 ); + mrTypeModel.maStrokeModel.moOpacity = lclDecodeOpacity( rAttribs, XML_opacity, 1.0 ); mrTypeModel.maStrokeModel.moWeight.assignIfUsed( rAttribs.getString( XML_weight ) ); mrTypeModel.maStrokeModel.moDashStyle = rAttribs.getString( XML_dashstyle ); mrTypeModel.maStrokeModel.moLineStyle = rAttribs.getToken( XML_linestyle ); @@ -308,9 +337,9 @@ ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const A case VML_TOKEN( fill ): mrTypeModel.maFillModel.moFilled.assignIfUsed( lclDecodeBool( rAttribs, XML_on ) ); mrTypeModel.maFillModel.moColor.assignIfUsed( rAttribs.getString( XML_color ) ); - mrTypeModel.maFillModel.moOpacity = lclDecodePercent( rAttribs, XML_opacity, 1.0 ); + mrTypeModel.maFillModel.moOpacity = lclDecodeOpacity( rAttribs, XML_opacity, 1.0 ); mrTypeModel.maFillModel.moColor2 = rAttribs.getString( XML_color2 ); - mrTypeModel.maFillModel.moOpacity2 = lclDecodePercent( rAttribs, XML_opacity2, 1.0 ); + mrTypeModel.maFillModel.moOpacity2 = lclDecodeOpacity( rAttribs, XML_opacity2, 1.0 ); mrTypeModel.maFillModel.moType = rAttribs.getToken( XML_type ); mrTypeModel.maFillModel.moAngle = rAttribs.getInteger( XML_angle ); mrTypeModel.maFillModel.moFocus = lclDecodePercent( rAttribs, XML_focus, 0.0 ); diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx index a990384..9076ba7 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx @@ -34,6 +34,7 @@ #include <svx/xfltrit.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <svx/sdr/primitive2d/sdrdecompositiontools.hxx> +#include <basegfx/polygon/b2dpolygonclipper.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -107,32 +108,32 @@ namespace sdr // for SC, the caption object may have a specialized shadow. The usual object shadow is off // and a specialized shadow gets created here (see old paint) const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR)); - const sal_uInt16 nTransp(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue()); - const Color aShadCol(rShadColItem.GetColorValue()); - const XFillStyle eStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue(); + const sal_uInt16 nShadowTransparence(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue()); + const Color aShadowColor(rShadColItem.GetColorValue()); + const XFillStyle eShadowStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue(); // Create own ItemSet and modify as needed // Always hide lines for special calc shadow SfxItemSet aSet(rItemSet); aSet.Put(XLineStyleItem(XLINE_NONE)); - if(XFILL_HATCH == eStyle) + if(XFILL_HATCH == eShadowStyle) { // #41666# Hatch color is set hard to shadow color XHatch aHatch = ((XFillHatchItem&)(rItemSet.Get(XATTR_FILLHATCH))).GetHatchValue(); - aHatch.SetColor(aShadCol); + aHatch.SetColor(aShadowColor); aSet.Put(XFillHatchItem(String(),aHatch)); } else { - if(XFILL_NONE != eStyle && XFILL_SOLID != eStyle) + if(XFILL_SOLID != eShadowStyle) { - // force fill to solid (for Gradient and Bitmap) + // force fill to solid (for Gradient, Bitmap and *no* fill (#119750# not filled comments *have* shadow)) aSet.Put(XFillStyleItem(XFILL_SOLID)); } - aSet.Put(XFillColorItem(String(),aShadCol)); - aSet.Put(XFillTransparenceItem(nTransp)); + aSet.Put(XFillColorItem(String(),aShadowColor)); + aSet.Put(XFillTransparenceItem(nShadowTransparence)); } // crete FillAttribute from modified ItemSet @@ -145,18 +146,43 @@ namespace sdr // add shadow offset to object matrix const sal_uInt32 nXDist(((SdrShadowXDistItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue()); const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue()); - aObjectMatrix.translate(nXDist, nYDist); - - // create unit outline polygon as geometry (see SdrCaptionPrimitive2D::create2DDecomposition) - basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect( - basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), fCornerRadiusX, fCornerRadiusY)); - - // create the specialized shadow primitive - xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive( - basegfx::B2DPolyPolygon(aUnitOutline), - aObjectMatrix, - aFill, - drawinglayer::attribute::FillGradientAttribute()); + + if(nXDist || nYDist) + { + // #119750# create obect and shadow outline, clip shadow outline + // on object outline. If there is a rest, create shadow. Do this to + // emulate that shadow is *not* visible behind the object for + // transparent object fill for comments in excel + basegfx::B2DPolygon aObjectOutline( + basegfx::tools::createPolygonFromRect( + basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), + fCornerRadiusX, + fCornerRadiusY)); + aObjectOutline.transform(aObjectMatrix); + + // create shadow outline + basegfx::B2DPolygon aShadowOutline(aObjectOutline); + aShadowOutline.transform( + basegfx::tools::createTranslateB2DHomMatrix(nXDist, nYDist)); + + // clip shadow outline against object outline + const basegfx::B2DPolyPolygon aClippedShadow( + basegfx::tools::clipPolygonOnPolyPolygon( + aShadowOutline, + basegfx::B2DPolyPolygon(aObjectOutline), + false, // take the outside + false)); + + if(aClippedShadow.count()) + { + // if there is shadow, create the specialized shadow primitive + xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive( + aClippedShadow, + basegfx::B2DHomMatrix(), + aFill, + drawinglayer::attribute::FillGradientAttribute()); + } + } } if(xSpecialShadow.is()) commit bdd1a3e1001258a7af5366d73a24ecb3173dab70 Author: Andre Fischer <a...@apache.org> Date: Mon Jul 9 11:57:55 2012 +0000 #i120039# Export more bitmap fill style parameters. Reported by: Du Jing Patch by: zjchen Review by: Andre Fischer diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 72095b7..880cc51 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1453,7 +1453,43 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties( } if ( eBitmapMode == ::com::sun::star::drawing::BitmapMode_REPEAT ) - AddOpt( ESCHER_Prop_fillType, ESCHER_FillTexture ); + { + sal_Int32 nSizeX = 0,nSizeY = 0,nOffsetX = 0,nOffsetY = 0,nPosOffsetX = 0,nPosOffsetY = 0; + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, + String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapSizeX" ) ), sal_True ) ) + { + aAny >>= nSizeX; + } + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, + String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapSizeY" ) ), sal_True ) ) + { + aAny >>= nSizeY; + } + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, + String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapOffsetX" ) ), sal_True ) ) + { + aAny >>= nOffsetX; + } + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, + String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapOffsetY" ) ), sal_True ) ) + { + aAny >>= nOffsetY; + } + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, + String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapPositionOffsetX" ) ), sal_True ) ) + { + aAny >>= nPosOffsetX; + } + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, + String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapPositionOffsetY" ) ), sal_True ) ) + { + aAny >>= nPosOffsetY; + } + if(nSizeX == -100 && nSizeY == -100 && nOffsetX == 0 && nOffsetY == 0 && nPosOffsetX == 0 && nPosOffsetY == 0) + AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture ); + else + AddOpt( ESCHER_Prop_fillType, ESCHER_FillTexture ); + } else AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture ); commit c81f869a023966ffdfde75f743d70875da19e835 Author: Andre Fischer <a...@apache.org> Date: Mon Jul 9 08:53:58 2012 +0000 #i119536# Fixed rotation when importing PPT. Reported by: Li Feng Wang Patch by: Ma Bingbing Reviewed by: Arming Le Grand and Andre Fischer diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 9c9d727..72095b7 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1450,17 +1450,6 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties( pGraphicAttr->SetMirrorFlags( BMP_MIRROR_HORZ ); if ( bIsGraphicMtf ) AddOpt( ESCHER_Prop_Rotation, ( ( ((sal_Int32)nAngle << 16 ) / 10 ) + 0x8000 ) &~ 0xffff ); - else - { - pGraphicAttr->SetRotation( nAngle ); - if ( nAngle && pShapeBoundRect ) // up to xp ppoint does not rotate bitmaps ! - { - Polygon aPoly( *pShapeBoundRect ); - aPoly.Rotate( pShapeBoundRect->TopLeft(), nAngle ); - *pShapeBoundRect = aPoly.GetBoundRect(); - bSuppressRotation = sal_True; - } - } } if ( eBitmapMode == ::com::sun::star::drawing::BitmapMode_REPEAT ) commit 6cd346c5e8be9065a5578f2caf3f1eacd964e783 Author: Lei De Bin <le...@apache.org> Date: Mon Aug 20 00:26:19 2012 +0000 #120573# fix the export issue for the text box in header&footer with the margin mirrored layout Reported by: Yan Ji Patch by: Lei De Bin Review by: Chen Zuo Jun diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index d0f8fa9..d721e8c 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -2229,6 +2229,12 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri, { eHoriConv = CONV2PG; } + else if ( _iorHoriOri.IsPosToggle() + && _iorHoriOri.GetHoriOrient() == text::HoriOrientation::RIGHT ) + { + eHoriConv = NO_CONV; + _iorHoriOri.SetHoriOrient( text::HoriOrientation::OUTSIDE ); + } else { switch ( _iorHoriOri.GetRelationOrient() ) commit ec585b964e26de967f0373da0d2d9dfd20f8866c Author: Lei De Bin <le...@apache.org> Date: Fri Jul 20 00:57:59 2012 +0000 #119581# fix import issue for left and right horizontal alignment in text box Reported by: liu ping tan Patch by: Li Jian Yuan Review by: Lei De Bin diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index d15ffff..200e7b4 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -938,6 +938,12 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi break; default : + { + if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT ) + eTHA = SDRTEXTHORZADJUST_LEFT; + else if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT ) + eTHA = SDRTEXTHORZADJUST_RIGHT; + } break; } nMinFrameHeight = rTextRect.GetHeight() - ( nTextTop + nTextBottom ); commit 1b6049cde6cc7e59c3621fdcfdec368315496017 Author: Jianyuan Li <liji...@apache.org> Date: Mon Sep 10 07:19:17 2012 +0000 #119491# fix Handout view mode issue Reported by: Du Jing Patch by: Jianyuan Li Review by: sunying diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 5764f3e..308979d 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -558,6 +558,10 @@ sal_Bool ImplSdPPTImport::Import() sal_Bool bStarDrawFiller = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bStarDrawFiller; PageKind ePgKind = ( bNotesMaster ) ? PK_NOTES : PK_STANDARD; + sal_Bool bHandout = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bHandoutMaster; + if ( bHandout ) + ePgKind = PK_HANDOUT; + pPage->SetPageKind( ePgKind ); pSdrModel->InsertMasterPage( (SdrPage*)pPage ); if ( bNotesMaster && bStarDrawFiller ) @@ -698,7 +702,7 @@ sal_Bool ImplSdPPTImport::Import() } SdPage* pMPage; sal_uInt16 i; - for ( i = 1; i < mpDoc->GetMasterPageCount() && ( (pMPage = (SdPage*)mpDoc->GetMasterPage( i )) != 0 ); i++ ) + for ( i = 0; i < mpDoc->GetMasterPageCount() && ( (pMPage = (SdPage*)mpDoc->GetMasterPage( i )) != 0 ); i++ ) { SetPageNum( i, PPT_MASTERPAGE ); ///////////////////////////////////////////// @@ -2277,7 +2281,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj if ( aPresentationText.Len() ) pPage->SetObjText( (SdrTextObj*)pText, pOutl, ePresKind, aPresentationText ); - if ( pPage->GetPageKind() != PK_NOTES ) + if ( pPage->GetPageKind() != PK_NOTES && pPage->GetPageKind() != PK_HANDOUT) { SfxStyleSheet* pSheet2( pPage->GetStyleSheetForPresObj( ePresKind ) ); if ( pSheet2 ) commit 55011ce4784c0a116753ac725f88bd4327010a2e Author: Armin Le Grand <a...@apache.org> Date: Fri Sep 14 00:51:46 2012 +0000 #120848# Added correct text content frame for NotchedRightArrow Autoshape Patch by: JianYuan Li Review by: alg diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index 4f069a2..06d0081 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -1523,11 +1523,12 @@ static const SvxMSDffCalculationData mso_sptNotchedRightArrowCalc[] = { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, { 0x8000, { 10800, 0, DFF_Prop_adjust2Value } }, - { 0x6001, { 0x403, 0x404, 10800 } } + { 0x6001, { 0x403, 0x404, 10800 } }, + { 0x8000, { 21600, 0, 0x405 }} }; static const SvxMSDffTextRectangles mso_sptNotchedRightArrowTextRect[] = // todo { - { { 0, 0 }, { 21600, 21600 } } + { { 5 MSO_I, 1 MSO_I }, { 6 MSO_I, 2 MSO_I } } }; static const SvxMSDffHandle mso_sptNotchedRightArrowHandle[] = { commit f13cff6d71d237068c6af92eda271e5fc144be5a Author: Lei De Bin <le...@apache.org> Date: Thu Jul 19 01:16:30 2012 +0000 #119609# Fixed alphabetical and roman numberals became ditial numbering Reported by: Yan Ji Patch by: Chen Zuo Jun Review by: Lei De Bin diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 97a6641..2b93161 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -1542,7 +1542,7 @@ eF_ResT SwWW8ImplReader::Read_F_Seq( WW8FieldDesc*, String& rStr ) case '*': nRet = aReadParam.SkipToNextToken(); - if( -2 == nRet ) + if( -2 == nRet && !( aReadParam.GetResult().EqualsAscii("MERGEFORMAT") || aReadParam.GetResult().EqualsAscii("CHARFORMAT") )) eNumFormat = GetNumTypeFromName( aReadParam.GetResult() ); break; commit 4313d73f1436f87d937ba10ee05b32bd363b125e Author: Andre Fischer <a...@apache.org> Date: Wed Aug 29 12:59:38 2012 +0000 #i120684# Fixed export of red color-channel. Patch by: Wang Zhe Review by: Andre Fischer diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx index 8345a12..bac80c9 100644 --- a/sd/source/filter/eppt/pptexanimations.cxx +++ b/sd/source/filter/eppt/pptexanimations.cxx @@ -2053,7 +2053,7 @@ sal_Bool AnimationExporter::getColorAny( const Any& rAny, const sal_Int16 nColor Sequence< double > aHSL( 3 ); if ( rAny >>= nColor ) // RGB color { - rA = (sal_uInt8)( nColor >> 24 ); + rA = (sal_uInt8)( nColor >> 16 ); rB = (sal_uInt8)( nColor >> 8 ); rC = (sal_uInt8)( nColor ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits