Modified: openoffice/branches/l10n40/main/svgio/source/svgreader/svgstyleattributes.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/svgio/source/svgreader/svgstyleattributes.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/svgio/source/svgreader/svgstyleattributes.cxx (original) +++ openoffice/branches/l10n40/main/svgio/source/svgreader/svgstyleattributes.cxx Sat Oct 26 14:59:22 2013 @@ -746,59 +746,6 @@ namespace svgio } } - double get_markerRotation( - const SvgMarkerNode& rMarker, - const basegfx::B2DPolygon& rPolygon, - const sal_uInt32 nIndex) - { - double fAngle(0.0); - const sal_uInt32 nPointCount(rPolygon.count()); - - if(nPointCount) - { - if(rMarker.getOrientAuto()) - { - const bool bPrev(rPolygon.isClosed() || nIndex > 0); - basegfx::B2DCubicBezier aSegment; - basegfx::B2DVector aPrev; - basegfx::B2DVector aNext; - - if(bPrev) - { - rPolygon.getBezierSegment((nIndex - 1) % nPointCount, aSegment); - aPrev = aSegment.getTangent(1.0); - } - - const bool bNext(rPolygon.isClosed() || nIndex + 1 < nPointCount); - - if(bNext) - { - rPolygon.getBezierSegment(nIndex % nPointCount, aSegment); - aNext = aSegment.getTangent(0.0); - } - - if(bPrev && bNext) - { - fAngle = atan2(aPrev.getY() + aNext.getY(), aPrev.getX() + aNext.getX()); - } - else if(bPrev) - { - fAngle = atan2(aPrev.getY(), aPrev.getX()); - } - else if(bNext) - { - fAngle = atan2(aNext.getY(), aNext.getX()); - } - } - else - { - fAngle = rMarker.getAngle(); - } - } - - return fAngle; - } - bool SvgStyleAttributes::prepare_singleMarker( drawinglayer::primitive2d::Primitive2DSequence& rMarkerPrimitives, basegfx::B2DHomMatrix& rMarkerTransform, @@ -889,49 +836,6 @@ namespace svgio return false; } - void SvgStyleAttributes::add_singleMarker( - drawinglayer::primitive2d::Primitive2DSequence& rTarget, - const drawinglayer::primitive2d::Primitive2DSequence& rMarkerPrimitives, - const basegfx::B2DHomMatrix& rMarkerTransform, - const basegfx::B2DRange& rClipRange, - const SvgMarkerNode& rMarker, - const basegfx::B2DPolygon& rCandidate, - const sal_uInt32 nIndex) const - { - const sal_uInt32 nPointCount(rCandidate.count()); - - if(nPointCount) - { - // get and apply rotation - basegfx::B2DHomMatrix aCombinedTransform(rMarkerTransform); - aCombinedTransform.rotate(get_markerRotation(rMarker, rCandidate, nIndex)); - - // get and apply target position - const basegfx::B2DPoint aPoint(rCandidate.getB2DPoint(nIndex % nPointCount)); - aCombinedTransform.translate(aPoint.getX(), aPoint.getY()); - - // prepare marker - drawinglayer::primitive2d::Primitive2DReference xMarker( - new drawinglayer::primitive2d::TransformPrimitive2D( - aCombinedTransform, - rMarkerPrimitives)); - - if(!rClipRange.isEmpty()) - { - // marker needs to be clipped, it's bigger as the mapping - basegfx::B2DPolyPolygon aClipPolygon(basegfx::tools::createPolygonFromRect(rClipRange)); - - aClipPolygon.transform(aCombinedTransform); - xMarker = new drawinglayer::primitive2d::MaskPrimitive2D( - aClipPolygon, - drawinglayer::primitive2d::Primitive2DSequence(&xMarker, 1)); - } - - // add marker - drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(rTarget, xMarker); - } - } - void SvgStyleAttributes::add_markers( const basegfx::B2DPolyPolygon& rPath, drawinglayer::primitive2d::Primitive2DSequence& rTarget) const @@ -943,49 +847,158 @@ namespace svgio if(pStart || pMid || pEnd) { - const sal_uInt32 nCount(rPath.count()); + const sal_uInt32 nSubPathCount(rPath.count()); - for (sal_uInt32 a(0); a < nCount; a++) + if(nSubPathCount) { - const basegfx::B2DPolygon aCandidate(rPath.getB2DPolygon(a)); - const sal_uInt32 nPointCount(aCandidate.count()); + // remember prepared marker; pStart, pMid and pEnd may all be equal when + // only 'marker' was used instead of 'marker-start', 'marker-mid' or 'marker-end', + // see 'case SVGTokenMarker' in this file; thus in this case only one common + // marker in primitive form will be prepared + const SvgMarkerNode* pPrepared = 0; - if(nPointCount) + // values for the prepared marker, results of prepare_singleMarker + drawinglayer::primitive2d::Primitive2DSequence aPreparedMarkerPrimitives; + basegfx::B2DHomMatrix aPreparedMarkerTransform; + basegfx::B2DRange aPreparedMarkerClipRange; + + for (sal_uInt32 a(0); a < nSubPathCount; a++) { - const sal_uInt32 nMarkerCount(aCandidate.isClosed() ? nPointCount + 1 : nPointCount); - drawinglayer::primitive2d::Primitive2DSequence aMarkerPrimitives; - basegfx::B2DHomMatrix aMarkerTransform; - basegfx::B2DRange aClipRange; - const SvgMarkerNode* pPrepared = 0; + // iterate over sub-paths + const basegfx::B2DPolygon aSubPolygonPath(rPath.getB2DPolygon(a)); + const sal_uInt32 nSubPolygonPointCount(aSubPolygonPath.count()); + const bool bSubPolygonPathIsClosed(aSubPolygonPath.isClosed()); - if(pStart) + if(nSubPolygonPointCount) { - if(prepare_singleMarker(aMarkerPrimitives, aMarkerTransform, aClipRange, *pStart)) - { - pPrepared = pStart; - add_singleMarker(rTarget, aMarkerPrimitives, aMarkerTransform, aClipRange, *pPrepared, aCandidate, 0); - } - } + // for each sub-path, create one marker per point (when closed, two markers + // need to pe created for the 1st point) + const sal_uInt32 nTargetMarkerCount(bSubPolygonPathIsClosed ? nSubPolygonPointCount + 1 : nSubPolygonPointCount); - if(pMid && nMarkerCount > 2) - { - if(pMid == pPrepared || prepare_singleMarker(aMarkerPrimitives, aMarkerTransform, aClipRange, *pMid)) + for (sal_uInt32 b(0); b < nTargetMarkerCount; b++) { - pPrepared = pMid; + const bool bIsFirstMarker(!a && !b); + const bool bIsLastMarker(nSubPathCount - 1 == a && nTargetMarkerCount - 1 == b); + const SvgMarkerNode* pNeeded = 0; - for(sal_uInt32 b(1); b < nMarkerCount - 1; b++) + if(bIsFirstMarker) { - add_singleMarker(rTarget, aMarkerPrimitives, aMarkerTransform, aClipRange, *pPrepared, aCandidate, b); + // 1st point in 1st sub-polygon, use pStart + pNeeded = pStart; + } + else if(bIsLastMarker) + { + // last point in last sub-polygon, use pEnd + pNeeded = pEnd; + } + else + { + // anything in-between, use pMid + pNeeded = pMid; } - } - } - if(pEnd) - { - if(pEnd == pPrepared || prepare_singleMarker(aMarkerPrimitives, aMarkerTransform, aClipRange, *pEnd)) - { - pPrepared = pEnd; - add_singleMarker(rTarget, aMarkerPrimitives, aMarkerTransform, aClipRange, *pPrepared, aCandidate, nMarkerCount - 1); + if(!pNeeded) + { + // no marker needs to be created for this point + continue; + } + + if(pPrepared != pNeeded) + { + // if needed marker is not yet prepared, do it now + if(prepare_singleMarker(aPreparedMarkerPrimitives, aPreparedMarkerTransform, aPreparedMarkerClipRange, *pNeeded)) + { + pPrepared = pNeeded; + } + else + { + // error: could not prepare given marker + OSL_ENSURE(false, "OOps, could not prepare given marker as primitives (!)"); + pPrepared = 0; + continue; + } + } + + // prepare complete transform + basegfx::B2DHomMatrix aCombinedTransform(aPreparedMarkerTransform); + + // get rotation + if(pPrepared->getOrientAuto()) + { + const sal_uInt32 nPointIndex(b % nSubPolygonPointCount); + + // get entering and leaving tangents; this will search backward/froward + // in the polygon to find tangents unequal to zero, skipping empty edges + // see basegfx descriptions) + // Hint: Mozilla, Inkscape and others use only leaving tangent for start marker + // and entering tangent for end marker. To achieve this (if wanted) it is possibe + // to make the fetch of aEntering/aLeaving dependent on bIsFirstMarker/bIsLastMarker. + // This is not done here, see comment 14 in task #1232379# + // or http://www.w3.org/TR/SVG/painting.html#OrientAttribute + basegfx::B2DVector aEntering( + basegfx::tools::getTangentEnteringPoint( + aSubPolygonPath, + nPointIndex)); + basegfx::B2DVector aLeaving( + basegfx::tools::getTangentLeavingPoint( + aSubPolygonPath, + nPointIndex)); + const bool bEntering(!aEntering.equalZero()); + const bool bLeaving(!aLeaving.equalZero()); + + if(bEntering || bLeaving) + { + basegfx::B2DVector aSum(0.0, 0.0); + + if(bEntering) + { + aSum += aEntering.normalize(); + } + + if(bLeaving) + { + aSum += aLeaving.normalize(); + } + + if(!aSum.equalZero()) + { + const double fAngle(atan2(aSum.getY(), aSum.getX())); + + // apply rotation + aCombinedTransform.rotate(fAngle); + } + } + } + else + { + // apply rotation + aCombinedTransform.rotate(pPrepared->getAngle()); + } + + // get and apply target position + const basegfx::B2DPoint aPoint(aSubPolygonPath.getB2DPoint(b % nSubPolygonPointCount)); + + aCombinedTransform.translate(aPoint.getX(), aPoint.getY()); + + // prepare marker + drawinglayer::primitive2d::Primitive2DReference xMarker( + new drawinglayer::primitive2d::TransformPrimitive2D( + aCombinedTransform, + aPreparedMarkerPrimitives)); + + if(!aPreparedMarkerClipRange.isEmpty()) + { + // marker needs to be clipped, it's bigger as the mapping + basegfx::B2DPolyPolygon aClipPolygon(basegfx::tools::createPolygonFromRect(aPreparedMarkerClipRange)); + + aClipPolygon.transform(aCombinedTransform); + xMarker = new drawinglayer::primitive2d::MaskPrimitive2D( + aClipPolygon, + drawinglayer::primitive2d::Primitive2DSequence(&xMarker, 1)); + } + + // add marker + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(rTarget, xMarker); } } }
Modified: openoffice/branches/l10n40/main/svtools/source/graphic/grfmgr.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/svtools/source/graphic/grfmgr.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/svtools/source/graphic/grfmgr.cxx (original) +++ openoffice/branches/l10n40/main/svtools/source/graphic/grfmgr.cxx Sat Oct 26 14:59:22 2013 @@ -946,23 +946,25 @@ Graphic GraphicObject::GetTransformedGra if( aMapGraph == MAP_PIXEL ) { - aCropLeftTop = Application::GetDefaultDevice()->LogicToPixel( Size( rAttr.GetLeftCrop(), - rAttr.GetTopCrop() ), - aMap100 ); - aCropRightBottom = Application::GetDefaultDevice()->LogicToPixel( Size( rAttr.GetRightCrop(), - rAttr.GetBottomCrop() ), - aMap100 ); + // crops are in 1/100th mm -> to aMapGraph -> to MAP_PIXEL + aCropLeftTop = Application::GetDefaultDevice()->LogicToPixel( + Size(rAttr.GetLeftCrop(), rAttr.GetTopCrop()), + aMap100); + aCropRightBottom = Application::GetDefaultDevice()->LogicToPixel( + Size(rAttr.GetRightCrop(), rAttr.GetBottomCrop()), + aMap100); } else { - aCropLeftTop = OutputDevice::LogicToLogic( Size( rAttr.GetLeftCrop(), - rAttr.GetTopCrop() ), - aMap100, - aMapGraph ); - aCropRightBottom = OutputDevice::LogicToLogic( Size( rAttr.GetRightCrop(), - rAttr.GetBottomCrop() ), - aMap100, - aMapGraph ); + // crops are in GraphicObject units -> to aMapGraph + aCropLeftTop = OutputDevice::LogicToLogic( + Size(rAttr.GetLeftCrop(), rAttr.GetTopCrop()), + aMap100, + aMapGraph); + aCropRightBottom = OutputDevice::LogicToLogic( + Size(rAttr.GetRightCrop(), rAttr.GetBottomCrop()), + aMap100, + aMapGraph); } // #104115# If the metafile is cropped, give it a special @@ -1012,15 +1014,29 @@ Graphic GraphicObject::GetTransformedGra BitmapEx aBitmapEx( aTransGraphic.GetBitmapEx() ); Rectangle aCropRect; - // convert crops to pixel (crops are always in GraphicObject units) + // convert crops to pixel if(rAttr.IsCropped()) { - aCropLeftTop = Application::GetDefaultDevice()->LogicToPixel( - Size(rAttr.GetLeftCrop(), rAttr.GetTopCrop()), - aMapGraph); - aCropRightBottom = Application::GetDefaultDevice()->LogicToPixel( - Size(rAttr.GetRightCrop(), rAttr.GetBottomCrop()), - aMapGraph); + if( aMapGraph == MAP_PIXEL ) + { + // crops are in 1/100th mm -> to MAP_PIXEL + aCropLeftTop = Application::GetDefaultDevice()->LogicToPixel( + Size(rAttr.GetLeftCrop(), rAttr.GetTopCrop()), + aMap100); + aCropRightBottom = Application::GetDefaultDevice()->LogicToPixel( + Size(rAttr.GetRightCrop(), rAttr.GetBottomCrop()), + aMap100); + } + else + { + // crops are in GraphicObject units -> to MAP_PIXEL + aCropLeftTop = Application::GetDefaultDevice()->LogicToPixel( + Size(rAttr.GetLeftCrop(), rAttr.GetTopCrop()), + aMapGraph); + aCropRightBottom = Application::GetDefaultDevice()->LogicToPixel( + Size(rAttr.GetRightCrop(), rAttr.GetBottomCrop()), + aMapGraph); + } // convert from prefmapmode to pixel Size aSrcSizePixel( @@ -1040,8 +1056,9 @@ Graphic GraphicObject::GetTransformedGra // another possibility is to adapt the values created so far with a factor; this // will keep the original Bitmap untouched and thus quality will not change - const double fFactorX(aBitmapEx.GetSizePixel().Width() / aSrcSizePixel.Width()); - const double fFactorY(aBitmapEx.GetSizePixel().Height() / aSrcSizePixel.Height()); + // caution: convert to double first, else pretty big errors may occurr + const double fFactorX((double)aBitmapEx.GetSizePixel().Width() / aSrcSizePixel.Width()); + const double fFactorY((double)aBitmapEx.GetSizePixel().Height() / aSrcSizePixel.Height()); aCropLeftTop.Width() = basegfx::fround(aCropLeftTop.Width() * fFactorX); aCropLeftTop.Height() = basegfx::fround(aCropLeftTop.Height() * fFactorY); Modified: openoffice/branches/l10n40/main/svx/inc/svx/fillctrl.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/svx/inc/svx/fillctrl.hxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/svx/inc/svx/fillctrl.hxx (original) +++ openoffice/branches/l10n40/main/svx/inc/svx/fillctrl.hxx Sat Oct 26 14:59:22 2013 @@ -58,7 +58,6 @@ private: SvxFillAttrBox* pFillAttrLB; sal_Bool bUpdate; - sal_Bool bIgnoreStatusUpdate; sal_uInt16 eLastXFS; public: @@ -71,7 +70,6 @@ public: const SfxPoolItem* pState ); void Update( const SfxPoolItem* pState ); virtual Window* CreateItemWindow( Window *pParent ); - void IgnoreStatusUpdate( sal_Bool bSet ); }; //======================================================================== Modified: openoffice/branches/l10n40/main/svx/inc/svx/sdrundomanager.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/svx/inc/svx/sdrundomanager.hxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/svx/inc/svx/sdrundomanager.hxx (original) +++ openoffice/branches/l10n40/main/svx/inc/svx/sdrundomanager.hxx Sat Oct 26 14:59:22 2013 @@ -51,6 +51,9 @@ public: virtual sal_Bool Undo(); virtual sal_Bool Redo(); + // ## + virtual void Clear(); + // Call for the view which starts the interactive text edit. Use link to // activate (start text edit) and empty link to reset (end text edit). On // reset all text edit actions will be removed from this undo manager to Modified: openoffice/branches/l10n40/main/svx/source/svdraw/sdrundomanager.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/svx/source/svdraw/sdrundomanager.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/svx/source/svdraw/sdrundomanager.cxx (original) +++ openoffice/branches/l10n40/main/svx/source/svdraw/sdrundomanager.cxx Sat Oct 26 14:59:22 2013 @@ -85,6 +85,25 @@ sal_Bool SdrUndoManager::Redo() return bRetval; } +void SdrUndoManager::Clear() +{ + if(isTextEditActive()) + { + while(GetUndoActionCount() && mpLastUndoActionBeforeTextEdit != GetUndoAction(0)) + { + RemoveLastUndoAction(); + } + + // urgently needed: RemoveLastUndoAction does NOT correct the Redo stack by itself (!) + ClearRedo(); + } + else + { + // call parent + EditUndoManager::Clear(); + } +} + void SdrUndoManager::SetEndTextEditHdl(const Link& rLink) { maEndTextEditHdl = rLink; Modified: openoffice/branches/l10n40/main/svx/source/tbxctrls/fillctrl.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/svx/source/tbxctrls/fillctrl.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/svx/source/tbxctrls/fillctrl.cxx (original) +++ openoffice/branches/l10n40/main/svx/source/tbxctrls/fillctrl.cxx Sat Oct 26 14:59:22 2013 @@ -74,7 +74,6 @@ SvxFillToolBoxControl::SvxFillToolBoxCon pFillTypeLB ( NULL ), pFillAttrLB ( NULL ), bUpdate ( sal_False ), - bIgnoreStatusUpdate( sal_False ), eLastXFS ( XFILL_NONE ) { addStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FillColor" ))); @@ -107,9 +106,6 @@ void SvxFillToolBoxControl::StateChanged { bool bEnableControls = sal_False; - if ( bIgnoreStatusUpdate ) - return; - if( eState == SFX_ITEM_DISABLED ) { if( nSID == SID_ATTR_FILL_STYLE ) @@ -229,13 +225,6 @@ void SvxFillToolBoxControl::StateChanged //======================================================================== -void SvxFillToolBoxControl::IgnoreStatusUpdate( sal_Bool bSet ) -{ - bIgnoreStatusUpdate = bSet; -} - -//======================================================================== - void SvxFillToolBoxControl::Update( const SfxPoolItem* pState ) { if ( pStyleItem && pState && bUpdate ) @@ -686,10 +675,8 @@ IMPL_LINK( FillControl, SelectFillAttrHd aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" )); aXFillStyleItem.QueryValue( a ); aArgs[0].Value = a; - ( (SvxFillToolBoxControl*)GetData() )->IgnoreStatusUpdate( sal_True ); ((SvxFillToolBoxControl*)GetData())->Dispatch( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FillStyle" )), aArgs ); - ( (SvxFillToolBoxControl*)GetData() )->IgnoreStatusUpdate( sal_False ); switch( eXFS ) { Modified: openoffice/branches/l10n40/main/sw/inc/ndtxt.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/inc/ndtxt.hxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/sw/inc/ndtxt.hxx (original) +++ openoffice/branches/l10n40/main/sw/inc/ndtxt.hxx Sat Oct 26 14:59:22 2013 @@ -285,8 +285,12 @@ public: refmarks, toxmarks, and metas will be ignored unless this is true ATTENTION: setting bInclRefToxMark is only allowed from UNDO! */ - void RstAttr( const SwIndex &rIdx, xub_StrLen nLen, sal_uInt16 nWhich = 0, - const SfxItemSet* pSet = 0, sal_Bool bInclRefToxMark = sal_False ); + void RstAttr( + const SwIndex &rIdx, + const xub_StrLen nLen, + const sal_uInt16 nWhich = 0, + const SfxItemSet* pSet = 0, + const sal_Bool bInclRefToxMark = sal_False ); void GCAttr(); // loesche das Text-Attribut (muss beim Pool abgemeldet werden!) Modified: openoffice/branches/l10n40/main/sw/source/core/layout/paintfrm.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/layout/paintfrm.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/sw/source/core/layout/paintfrm.cxx (original) +++ openoffice/branches/l10n40/main/sw/source/core/layout/paintfrm.cxx Sat Oct 26 14:59:22 2013 @@ -6383,10 +6383,27 @@ const Color& SwPageFrm::GetDrawBackgrdCo const SvxBrushItem* pBrushItem; const Color* pDummyColor; SwRect aDummyRect; + if ( GetBackgroundBrush( pBrushItem, pDummyColor, aDummyRect, true) ) - return pBrushItem->GetColor(); - else - return aGlobalRetoucheColor; + { + const Graphic* pGraphic = pBrushItem->GetGraphic(); + + if(pGraphic) + { + // #29105# when a graphic is set, it may be possible to calculate a single + // color which looks good in all places of the graphic. Since it is + // planned to have text edit on the overlay one day and the fallback + // to aGlobalRetoucheColor returns something useful, just use that + // for now. + } + else + { + // not a graphic, use (hopefully) initialized color + return pBrushItem->GetColor(); + } + } + + return aGlobalRetoucheColor; } /************************************************************************* Modified: openoffice/branches/l10n40/main/sw/source/core/text/EnhancedPDFExportHelper.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/text/EnhancedPDFExportHelper.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/sw/source/core/text/EnhancedPDFExportHelper.cxx (original) +++ openoffice/branches/l10n40/main/sw/source/core/text/EnhancedPDFExportHelper.cxx Sat Oct 26 14:59:22 2013 @@ -375,8 +375,9 @@ bool SwTaggedPDFHelper::CheckReopenTag() if ( pKey ) { FrmTagIdMap& rFrmTagIdMap = SwEnhancedPDFExportHelper::GetFrmTagIdMap(); - const FrmTagIdMap::const_iterator aIter = rFrmTagIdMap.find( pKey ); - nReopenTag = (*aIter).second; + const FrmTagIdMap::const_iterator aIter = rFrmTagIdMap.find( pKey ); + if( aIter != rFrmTagIdMap.end()) + nReopenTag = (*aIter).second; } } } Modified: openoffice/branches/l10n40/main/sw/source/core/txtnode/txtedt.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/txtnode/txtedt.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/sw/source/core/txtnode/txtedt.cxx (original) +++ openoffice/branches/l10n40/main/sw/source/core/txtnode/txtedt.cxx Sat Oct 26 14:59:22 2013 @@ -394,26 +394,25 @@ inline sal_Bool InRange(xub_StrLen nIdx, * -> nothing to do */ -void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, sal_uInt16 nWhich, - const SfxItemSet* pSet, sal_Bool bInclRefToxMark ) +void SwTxtNode::RstAttr( + const SwIndex &rIdx, + const xub_StrLen nLen, + const sal_uInt16 nWhich, + const SfxItemSet* pSet, + const sal_Bool bInclRefToxMark ) { - // Attribute? - if ( !GetpSwpHints() ) - return; - - sal_uInt16 i = 0; - xub_StrLen nStt = rIdx.GetIndex(); - xub_StrLen nEnd = nStt + nLen; - xub_StrLen nAttrStart; - SwTxtAttr *pHt; + if ( !GetpSwpHints() ) + return; - sal_Bool bChanged = sal_False; + const xub_StrLen nStt = rIdx.GetIndex(); + const xub_StrLen nEnd = nStt + nLen; + + bool bChanged = false; // nMin and nMax initialized to maximum / minimum (inverse) xub_StrLen nMin = m_Text.Len(); xub_StrLen nMax = nStt; - - const sal_Bool bNoLen = !nMin; + const bool bNoLen = nMin == 0; // We have to remember the "new" attributes, which have // been introduced by splitting surrounding attributes (case 4). @@ -422,18 +421,30 @@ void SwTxtNode::RstAttr(const SwIndex &r // iterate over attribute array until start of attribute is behind // deletion range + sal_uInt16 i = 0; + xub_StrLen nAttrStart; + SwTxtAttr *pHt = NULL; while ((i < m_pSwpHints->Count()) && ((( nAttrStart = *(*m_pSwpHints)[i]->GetStart()) < nEnd ) || nLen==0) ) { pHt = m_pSwpHints->GetTextHint(i); // attributes without end stay in! - xub_StrLen * const pAttrEnd = pHt->GetEnd(); - if ( !pAttrEnd /*|| pHt->HasDummyChar()*/ ) // see bInclRefToxMark + // but consider <bInclRefToxMark> used by Undo + xub_StrLen* const pAttrEnd = pHt->GetEnd(); + const bool bKeepAttrWithoutEnd = + pAttrEnd == NULL + && ( !bInclRefToxMark + || ( RES_TXTATR_REFMARK != pHt->Which() + && RES_TXTATR_TOXMARK != pHt->Which() + && RES_TXTATR_META != pHt->Which() + && RES_TXTATR_METAFIELD != pHt->Which() ) ); + if ( bKeepAttrWithoutEnd ) { - i++; - continue; - } + + i++; + continue; + } // Default behavior is to process all attributes: bool bSkipAttr = false;; @@ -473,28 +484,29 @@ void SwTxtNode::RstAttr(const SwIndex &r if ( bSkipAttr ) { - i++; - continue; - } + i++; + continue; + } if( nStt <= nAttrStart ) // Faelle: 1,3,5 - { - if( nEnd > nAttrStart - || ( nEnd == *pAttrEnd && nEnd==nAttrStart ) ) - { - // Faelle: 1,3 - if ( nMin > nAttrStart ) - nMin = nAttrStart; - if ( nMax < *pAttrEnd ) - nMax = *pAttrEnd; - // Falls wir nur ein nichtaufgespanntes Attribut entfernen, - // tun wir mal so, als ob sich nichts geaendert hat. - bChanged = bChanged || nEnd > nAttrStart || bNoLen; - if( *pAttrEnd <= nEnd ) // Fall: 1 - { - const xub_StrLen nAttrEnd = *pAttrEnd; - + { + const xub_StrLen nAttrEnd = pAttrEnd != NULL + ? *pAttrEnd + : nAttrStart; + if( nEnd > nAttrStart + || ( nEnd == nAttrEnd && nEnd == nAttrStart ) ) + { + // Faelle: 1,3 + if ( nMin > nAttrStart ) + nMin = nAttrStart; + if ( nMax < nAttrEnd ) + nMax = nAttrEnd; + // Falls wir nur ein nichtaufgespanntes Attribut entfernen, + // tun wir mal so, als ob sich nichts geaendert hat. + bChanged = bChanged || nEnd > nAttrStart || bNoLen; + if( nAttrEnd <= nEnd ) // Fall: 1 + { m_pSwpHints->DeleteAtPos(i); DestroyAttr( pHt ); @@ -505,22 +517,21 @@ void SwTxtNode::RstAttr(const SwIndex &r InsertHint( pNew, nsSetAttrMode::SETATTR_NOHINTADJUST ); } - // if the last attribute is a Field, the HintsArray is - // deleted! + // if the last attribute is a Field, the HintsArray is deleted! if ( !m_pSwpHints ) break; - //JP 26.11.96: - // beim DeleteAtPos wird ein Resort ausgefuehrt!! - // darum muessen wir wieder bei 0 anfangen!!! - // ueber den Fall 3 koennen Attribute nach hinten - // verschoben worden sein; damit stimmt jetzt das i - // nicht mehr!!! - i = 0; + //JP 26.11.96: + // beim DeleteAtPos wird ein Resort ausgefuehrt!! + // darum muessen wir wieder bei 0 anfangen!!! + // ueber den Fall 3 koennen Attribute nach hinten + // verschoben worden sein; damit stimmt jetzt das i + // nicht mehr!!! + i = 0; - continue; - } - else // Fall: 3 + continue; + } + else // Fall: 3 { m_pSwpHints->NoteInHistory( pHt ); *pHt->GetStart() = nEnd; @@ -533,20 +544,21 @@ void SwTxtNode::RstAttr(const SwIndex &r InsertHint( pNew, nsSetAttrMode::SETATTR_NOHINTADJUST ); } - bChanged = sal_True; - } - } - } - else // Faelle: 2,4,5 + bChanged = true; + } + } + } + else if ( pAttrEnd != NULL ) // Faelle: 2,4,5 + { if( *pAttrEnd > nStt ) // Faelle: 2,4 - { - if( *pAttrEnd < nEnd ) // Fall: 2 - { - if ( nMin > nAttrStart ) - nMin = nAttrStart; - if ( nMax < *pAttrEnd ) - nMax = *pAttrEnd; - bChanged = sal_True; + { + if( *pAttrEnd < nEnd ) // Fall: 2 + { + if ( nMin > nAttrStart ) + nMin = nAttrStart; + if ( nMax < *pAttrEnd ) + nMax = *pAttrEnd; + bChanged = true; const xub_StrLen nAttrEnd = *pAttrEnd; @@ -557,19 +569,20 @@ void SwTxtNode::RstAttr(const SwIndex &r if ( pStyleHandle.get() ) { SwTxtAttr* pNew = MakeTxtAttr( *GetDoc(), - *pStyleHandle, nStt, nAttrEnd ); + *pStyleHandle, nStt, nAttrEnd ); InsertHint( pNew, nsSetAttrMode::SETATTR_NOHINTADJUST ); } - } - else if( nLen ) // Fall: 4 - { // bei Lange 0 werden beide Hints vom Insert(Ht) - // wieder zu einem zusammengezogen !!!! - if ( nMin > nAttrStart ) - nMin = nAttrStart; - if ( nMax < *pAttrEnd ) - nMax = *pAttrEnd; - bChanged = sal_True; - xub_StrLen nTmpEnd = *pAttrEnd; + } + else if( nLen ) // Fall: 4 + { + // bei Lange 0 werden beide Hints vom Insert(Ht) + // wieder zu einem zusammengezogen !!!! + if ( nMin > nAttrStart ) + nMin = nAttrStart; + if ( nMax < *pAttrEnd ) + nMax = *pAttrEnd; + bChanged = true; + xub_StrLen nTmpEnd = *pAttrEnd; m_pSwpHints->NoteInHistory( pHt ); *pAttrEnd = nStt; m_pSwpHints->NoteInHistory( pHt, sal_True ); @@ -577,14 +590,14 @@ void SwTxtNode::RstAttr(const SwIndex &r if ( pStyleHandle.get() && nStt < nEnd ) { SwTxtAttr* pNew = MakeTxtAttr( *GetDoc(), - *pStyleHandle, nStt, nEnd ); + *pStyleHandle, nStt, nEnd ); InsertHint( pNew, nsSetAttrMode::SETATTR_NOHINTADJUST ); } if( nEnd < nTmpEnd ) { SwTxtAttr* pNew = MakeTxtAttr( *GetDoc(), - pHt->GetAttr(), nEnd, nTmpEnd ); + pHt->GetAttr(), nEnd, nTmpEnd ); if ( pNew ) { SwTxtCharFmt* pCharFmt = dynamic_cast<SwTxtCharFmt*>(pHt); @@ -597,13 +610,14 @@ void SwTxtNode::RstAttr(const SwIndex &r // jetzt kein i+1, weil das eingefuegte Attribut - // ein anderes auf die Position geschoben hat ! - continue; - } - } - } - ++i; - } + // ein anderes auf die Position geschoben hat ! + continue; + } + } + } + ++i; + } + } TryDeleteSwpHints(); if (bChanged) Modified: openoffice/branches/l10n40/main/sw/source/core/undo/untblk.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/undo/untblk.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/sw/source/core/undo/untblk.cxx (original) +++ openoffice/branches/l10n40/main/sw/source/core/undo/untblk.cxx Sat Oct 26 14:59:22 2013 @@ -219,46 +219,44 @@ void SwUndoInserts::UndoImpl(::sw::UndoR nNdDiff += nTmp - pPam->GetPoint()->nNode.GetIndex(); } - SwNodeIndex& rIdx = pPam->GetPoint()->nNode; - SwTxtNode* pTxtNode = rIdx.GetNode().GetTxtNode(); - if( pTxtNode ) - { - if( !pTxtFmtColl ) // falls 0, dann war hier auch kein TextNode, - { // dann muss dieser geloescht werden, - SwNodeIndex aDelIdx( rIdx ); - rIdx++; - SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode(); - xub_StrLen nCnt = 0; if( pCNd ) nCnt = pCNd->Len(); - pPam->GetPoint()->nContent.Assign( pCNd, nCnt ); - pPam->SetMark(); - pPam->DeleteMark(); - - RemoveIdxRel( aDelIdx.GetIndex(), *pPam->GetPoint() ); - - pDoc->GetNodes().Delete( aDelIdx, 1 ); - } - else - { - if( bJoinNext && pTxtNode->CanJoinNext()) - { - { - RemoveIdxRel( rIdx.GetIndex()+1, SwPosition( rIdx, - SwIndex( pTxtNode, pTxtNode->GetTxt().Len() ))); - } - pTxtNode->JoinNext(); - } + SwNodeIndex& rIdx = pPam->GetPoint()->nNode; + SwTxtNode* pTxtNode = rIdx.GetNode().GetTxtNode(); + if( pTxtNode ) + { + if( !pTxtFmtColl ) // falls 0, dann war hier auch kein TextNode, + { // dann muss dieser geloescht werden, + SwNodeIndex aDelIdx( rIdx ); + rIdx++; + SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode(); + xub_StrLen nCnt = 0; if( pCNd ) nCnt = pCNd->Len(); + pPam->GetPoint()->nContent.Assign( pCNd, nCnt ); + pPam->SetMark(); + pPam->DeleteMark(); + + RemoveIdxRel( aDelIdx.GetIndex(), *pPam->GetPoint() ); + + pDoc->GetNodes().Delete( aDelIdx, 1 ); + } + else + { + if( bJoinNext && pTxtNode->CanJoinNext()) + { + { + RemoveIdxRel( rIdx.GetIndex()+1, SwPosition( rIdx, + SwIndex( pTxtNode, pTxtNode->GetTxt().Len() ))); + } + pTxtNode->JoinNext(); + } // reset all text attributes in the paragraph! - //i121897, change the hints clearing method from 'RstAttr' to 'ClarSwpHints' as the certain tox mark index hint reason - if( pTxtNode && pTxtNode->GetpSwpHints() ) - pTxtNode->ClearSwpHintsArr( true ); + pTxtNode->RstAttr( SwIndex(pTxtNode, 0), pTxtNode->Len(), 0, 0, true ); - // setze alle Attribute im Node zurueck + // setze alle Attribute im Node zurueck pTxtNode->ResetAllAttr(); - if( USHRT_MAX != pDoc->GetTxtFmtColls()->GetPos( pTxtFmtColl )) - pTxtFmtColl = (SwTxtFmtColl*)pTxtNode->ChgFmtColl( pTxtFmtColl ); + if( USHRT_MAX != pDoc->GetTxtFmtColls()->GetPos( pTxtFmtColl )) + pTxtFmtColl = (SwTxtFmtColl*)pTxtNode->ChgFmtColl( pTxtFmtColl ); - pHistory->SetTmpEnd( nSetPos ); + pHistory->SetTmpEnd( nSetPos ); pHistory->TmpRollback( pDoc, 0, false ); } } Modified: openoffice/branches/l10n40/main/sw/source/ui/config/optpage.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/ui/config/optpage.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/sw/source/ui/config/optpage.cxx (original) +++ openoffice/branches/l10n40/main/sw/source/ui/config/optpage.cxx Sat Oct 26 14:59:22 2013 @@ -1585,45 +1585,49 @@ void SwShdwCrsrOptionsTabPage::PageCreat sal_Bool SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet ) { - SwShadowCursorItem aOpt; - aOpt.SetOn( aOnOffCB.IsChecked() ); + SwShadowCursorItem aOpt; + aOpt.SetOn( aOnOffCB.IsChecked() ); - sal_uInt8 eMode; - if( aFillIndentRB.IsChecked() ) - eMode= FILL_INDENT; - else if( aFillMarginRB.IsChecked() ) - eMode = FILL_MARGIN; - else if( aFillTabRB.IsChecked() ) - eMode = FILL_TAB; - else - eMode = FILL_SPACE; - aOpt.SetMode( eMode ); + sal_uInt8 eMode; + if( aFillIndentRB.IsChecked() ) + eMode= FILL_INDENT; + else if( aFillMarginRB.IsChecked() ) + eMode = FILL_MARGIN; + else if( aFillTabRB.IsChecked() ) + eMode = FILL_TAB; + else + eMode = FILL_SPACE; + aOpt.SetMode( eMode ); - sal_Bool bRet = sal_False; - const SfxPoolItem* pItem = 0; - if( SFX_ITEM_SET != rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem ) - || ((SwShadowCursorItem&)*pItem) != aOpt ) - { - rSet.Put( aOpt ); - bRet = sal_True; - } + sal_Bool bRet = sal_False; + const SfxPoolItem* pItem = 0; + if( SFX_ITEM_SET != rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem ) + || ((SwShadowCursorItem&)*pItem) != aOpt ) + { + rSet.Put( aOpt ); + bRet = sal_True; + } - m_pWrtShell->GetDoc()->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, + if ( m_pWrtShell ) + { + m_pWrtShell->GetDoc()->set( + IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, m_aMathBaselineAlignmentCB.IsChecked() ); - bRet |= m_aMathBaselineAlignmentCB.IsChecked() != m_aMathBaselineAlignmentCB.GetSavedValue(); + bRet |= m_aMathBaselineAlignmentCB.IsChecked() != m_aMathBaselineAlignmentCB.GetSavedValue(); + } - if( aCrsrInProtCB.IsChecked() != aCrsrInProtCB.GetSavedValue()) - { - rSet.Put(SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aCrsrInProtCB.IsChecked())); - bRet |= sal_True; - } + if( aCrsrInProtCB.IsChecked() != aCrsrInProtCB.GetSavedValue()) + { + rSet.Put(SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aCrsrInProtCB.IsChecked())); + bRet |= sal_True; + } - const SwDocDisplayItem* pOldAttr = (const SwDocDisplayItem*) - GetOldItem(GetItemSet(), FN_PARAM_DOCDISP); + const SwDocDisplayItem* pOldAttr = + (const SwDocDisplayItem*)GetOldItem(GetItemSet(), FN_PARAM_DOCDISP); - SwDocDisplayItem aDisp; - if(pOldAttr) - aDisp = *pOldAttr; + SwDocDisplayItem aDisp; + if(pOldAttr) + aDisp = *pOldAttr; // aDisp.bParagraphEnd = aParaCB .IsChecked(); aDisp.bTab = aTabCB .IsChecked(); @@ -1636,7 +1640,7 @@ sal_Bool SwShdwCrsrOptionsTabPage::FillI aDisp.bManualBreak = aBreakCB .IsChecked(); bRet |= (!pOldAttr || aDisp != *pOldAttr); - if(bRet) + if(bRet) bRet = 0 != rSet.Put(aDisp); return bRet; @@ -1644,31 +1648,41 @@ sal_Bool SwShdwCrsrOptionsTabPage::FillI void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet ) { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = 0; SwShadowCursorItem aOpt; - if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem )) - aOpt = *(SwShadowCursorItem*)pItem; - aOnOffCB.Check( aOpt.IsOn() ); - - sal_uInt8 eMode = aOpt.GetMode(); - aFillIndentRB.Check( FILL_INDENT == eMode ); - aFillMarginRB.Check( FILL_MARGIN == eMode ); - aFillTabRB.Check( FILL_TAB == eMode ); - aFillSpaceRB.Check( FILL_SPACE == eMode ); - - m_aMathBaselineAlignmentCB.Check( m_pWrtShell->GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ); - m_aMathBaselineAlignmentCB.SaveValue(); - - if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, sal_False, &pItem )) - aCrsrInProtCB.Check(((const SfxBoolItem*)pItem)->GetValue()); - aCrsrInProtCB.SaveValue(); + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem )) + { + aOpt = *(SwShadowCursorItem*)pItem; + } + aOnOffCB.Check( aOpt.IsOn() ); + + sal_uInt8 eMode = aOpt.GetMode(); + aFillIndentRB.Check( FILL_INDENT == eMode ); + aFillMarginRB.Check( FILL_MARGIN == eMode ); + aFillTabRB.Check( FILL_TAB == eMode ); + aFillSpaceRB.Check( FILL_SPACE == eMode ); + + if ( m_pWrtShell ) + { + m_aMathBaselineAlignmentCB.Check( m_pWrtShell->GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ); + m_aMathBaselineAlignmentCB.SaveValue(); + } + else + { + m_aMathBaselineAlignmentCB.Disable(); + } + + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, sal_False, &pItem )) + { + aCrsrInProtCB.Check(((const SfxBoolItem*)pItem)->GetValue()); + } + aCrsrInProtCB.SaveValue(); const SwDocDisplayItem* pDocDisplayAttr = 0; - rSet.GetItemState( FN_PARAM_DOCDISP, sal_False, - (const SfxPoolItem**)&pDocDisplayAttr ); - if(pDocDisplayAttr) + rSet.GetItemState( FN_PARAM_DOCDISP, sal_False, (const SfxPoolItem**)&pDocDisplayAttr ); + if(pDocDisplayAttr) { aParaCB .Check (pDocDisplayAttr->bParagraphEnd ); aTabCB .Check (pDocDisplayAttr->bTab ); Modified: openoffice/branches/l10n40/main/sw/source/ui/uno/unotxdoc.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/ui/uno/unotxdoc.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/sw/source/ui/uno/unotxdoc.cxx (original) +++ openoffice/branches/l10n40/main/sw/source/ui/uno/unotxdoc.cxx Sat Oct 26 14:59:22 2013 @@ -2666,6 +2666,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getR if(!IsValid()) throw RuntimeException(); + CleanUpRenderingData(); + const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); bool bIsSwSrcView = false; SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); @@ -2677,20 +2679,6 @@ sal_Int32 SAL_CALL SwXTextDocument::getR return 0; } - // clean up <RenderData> and <PrintUIOptions> - { - if ( m_pRenderData ) - { - delete m_pRenderData; - m_pRenderData = 0; - } - if ( m_pPrintUIOptions ) - { - delete m_pPrintUIOptions; - m_pPrintUIOptions = 0; - } - } - if ( !bIsSwSrcView ) { m_pRenderData = new SwRenderData; @@ -3067,8 +3055,7 @@ SfxViewShell * SwXTextDocument::GuessVie SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocShell, sal_False ); // look for the view shell with the same controller in use, - // otherwise look for a suitable view, preferably a SwView, - // if that one is not found use a SwPagePreView if found. + // otherwise look for a suitable view while (pFrame) { pView = pFrame->GetViewShell(); @@ -3081,7 +3068,7 @@ SfxViewShell * SwXTextDocument::GuessVie if (pView && pView->GetController() == xController) break; } - else if (pSwView || pSwSrcView) + else if ( pSwView || pSwSrcView || pSwPagePreView ) break; pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, sal_False ); } Modified: openoffice/branches/l10n40/main/vcl/source/fontsubset/sft.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/vcl/source/fontsubset/sft.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/vcl/source/fontsubset/sft.cxx (original) +++ openoffice/branches/l10n40/main/vcl/source/fontsubset/sft.cxx Sat Oct 26 14:59:22 2013 @@ -799,7 +799,10 @@ static int GetCompoundTTOutline(TrueType } while (flags & MORE_COMPONENTS); - + // #i123417# some fonts like IFAOGrec have no outline points in some compound glyphs + // so this unlikely but possible scenario should be handled gracefully + if( myPoints.empty() ) + return 0; np = myPoints.size(); @@ -2787,7 +2790,7 @@ GlyphData *GetTTRawGlyphData(TrueTypeFon /* now calculate npoints and ncontours */ ControlPoint *cp; n = GetTTGlyphPoints(ttf, glyphID, &cp); - if (n != -1) { + if( n > 0) { m = 0; for (i = 0; i < n; i++) { if (cp[i].flags & 0x8000) m++; Modified: openoffice/branches/l10n40/main/vcl/win/source/gdi/salbmp.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/vcl/win/source/gdi/salbmp.cxx?rev=1536001&r1=1536000&r2=1536001&view=diff ============================================================================== --- openoffice/branches/l10n40/main/vcl/win/source/gdi/salbmp.cxx (original) +++ openoffice/branches/l10n40/main/vcl/win/source/gdi/salbmp.cxx Sat Oct 26 14:59:22 2013 @@ -333,6 +333,9 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreat if(pExtraRGB) { + // #123478# shockingly, BitmapBuffer does not free the memory it is controlling + // in it's destructor, this *has to be done handish*. Doing it here now + delete[] pExtraRGB->mpBits; delete pExtraRGB; } else @@ -471,6 +474,9 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreat if(pExtraA) { + // #123478# shockingly, BitmapBuffer does not free the memory it is controlling + // in it's destructor, this *has to be done handish*. Doing it here now + delete[] pExtraA->mpBits; delete pExtraA; } else @@ -485,6 +491,9 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreat if(pExtraRGB) { + // #123478# shockingly, BitmapBuffer does not free the memory it is controlling + // in it's destructor, this *has to be done handish*. Doing it here now + delete[] pExtraRGB->mpBits; delete pExtraRGB; } else