cppcanvas/source/inc/implrenderer.hxx | 2 +- cppcanvas/source/mtfrenderer/emfplus.cxx | 14 +++++++------- sw/source/core/text/itrcrsr.cxx | 6 +++++- vcl/source/filter/wmf/winwmf.cxx | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-)
New commits: commit 5e992f88d9f78a062bd78ea8907fa247f1f49b5f Author: Miklos Vajna <[email protected]> Date: Mon Feb 25 15:00:08 2013 +0100 n#793998 SwTxtCursor::GetCharRect: respect TabOverMargin compat mode Change-Id: I47280399bd9e0757365db8f4f1930efd0a340424 diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 501052b..ab249f3 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -1211,7 +1211,9 @@ sal_Bool SwTxtCursor::GetCharRect( SwRect* pOrig, const xub_StrLen nOfst, pCMS->p2Lines->aPortion.Pos().Y() += aCharPos.Y(); } - if( pOrig->Left() > nTmpRight ) + const bool bTabOverMargin = GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_OVER_MARGIN); + // Make sure the cursor respects the right margin, unless in compat mode, where the tab size has priority over the margin size. + if( pOrig->Left() > nTmpRight && !bTabOverMargin) pOrig->Pos().X() = nTmpRight; if( nMax ) commit cb6d8b906347e03e3c1f279aa802bd87f463bbed Author: Miklos Vajna <[email protected]> Date: Mon Feb 25 14:59:27 2013 +0100 SwTxtCursor::GetCharRect: restore comment removed in 1b081132 Change-Id: I2d6cf0afad4d5237b44e21be051f6f593a12830d diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index e33ef54..501052b 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -1196,6 +1196,8 @@ sal_Bool SwTxtCursor::GetCharRect( SwRect* pOrig, const xub_StrLen nOfst, _GetCharRect( pOrig, nFindOfst, pCMS ); + // This actually would have to be "-1 LogicToPixel", but that seems too + // expensive, so it's a value (-12), that should hopefully be OK. const SwTwips nTmpRight = Right() - 12; pOrig->Pos().X() += aCharPos.X(); commit 251adf02222661bcabf05bd32bbf5cd7345f42b2 Author: Radek Doulik <[email protected]> Date: Mon Feb 25 15:06:11 2013 +0100 Revert "allow WMF's with missing EOF record" This reverts commit 199f0edc93e25ff8144f16599184049573154232. the problematic emf+ file with embedded wmf suffered from different problem so I reverted this fix as it is not needed diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index 97a705b..ecdf04d 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -1188,7 +1188,7 @@ void WMFReader::ReadWMF() || pWMF->IsEof() ) { - if( pWMF->IsEof() && nPos != nEndPos) + if( pWMF->IsEof() ) pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); break; commit 41cfd0fd9d32b5e0a07d9f422aec2c7d97b27c01 Author: Radek Doulik <[email protected]> Date: Mon Feb 25 15:05:19 2013 +0100 workaround for emf+ files with broken dataSize of Image object record Change-Id: I5005961e1b618af949dc978a7ac560fc9eca3e65 diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx index 7f34ad8..7d82ea7 100644 --- a/cppcanvas/source/inc/implrenderer.hxx +++ b/cppcanvas/source/inc/implrenderer.hxx @@ -259,7 +259,7 @@ static float GetSwapFloat( SvStream& rSt ) ActionVector::const_iterator& o_rRangeBegin, ActionVector::const_iterator& o_rRangeEnd ) const; - void processObjectRecord(SvMemoryStream& rObjectStream, sal_uInt16 flags, sal_Bool bUseWholeStream = sal_False); + void processObjectRecord(SvMemoryStream& rObjectStream, sal_uInt16 flags, sal_uInt32 dataSize, sal_Bool bUseWholeStream = sal_False); /* EMF+ */ void processEMFPlus( MetaCommentAction* pAct, const ActionFactoryParameters& rFactoryParms, OutDevState& rState, const CanvasSharedPtr& rCanvas ); diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 0c9db41..9b3d92d 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -714,7 +714,7 @@ namespace cppcanvas Graphic graphic; - void Read (SvMemoryStream &s, sal_Bool bUseWholeStream) + void Read (SvMemoryStream &s, sal_uInt32 dataSize, sal_Bool bUseWholeStream) { sal_uInt32 header, unknown; @@ -736,11 +736,11 @@ namespace cppcanvas sal_Int32 mfType, mfSize; s >> mfType >> mfSize; - EMFP_DEBUG (printf ("EMF+\tmetafile type: %d dataSize: %d\n", mfType, mfSize)); + EMFP_DEBUG (printf ("EMF+\tmetafile type: %d dataSize: %d real size calculated from record dataSize: %d\n", mfType, mfSize, dataSize - 16)); GraphicFilter filter; // workaround buggy metafiles, which have wrong mfSize set (n#705956 for example) - SvMemoryStream mfStream (((char *)s.GetData()) + s.Tell(), bUseWholeStream ? s.remainingSize() : mfSize, STREAM_READ); + SvMemoryStream mfStream (((char *)s.GetData()) + s.Tell(), bUseWholeStream ? s.remainingSize() : dataSize - 16, STREAM_READ); filter.ImportGraphic (graphic, String (), mfStream); @@ -1090,7 +1090,7 @@ namespace cppcanvas } } - void ImplRenderer::processObjectRecord(SvMemoryStream& rObjectStream, sal_uInt16 flags, sal_Bool bUseWholeStream) + void ImplRenderer::processObjectRecord(SvMemoryStream& rObjectStream, sal_uInt16 flags, sal_uInt32 dataSize, sal_Bool bUseWholeStream) { sal_uInt32 index; @@ -1145,7 +1145,7 @@ namespace cppcanvas { EMFPImage *image; aObjects [index] = image = new EMFPImage (); - image->Read (rObjectStream, bUseWholeStream); + image->Read (rObjectStream, dataSize, bUseWholeStream); break; } @@ -1211,7 +1211,7 @@ namespace cppcanvas if (mbMultipart) { EMFP_DEBUG (printf ("EMF+ multipart record flags: %04hx\n", mMFlags)); mMStream.Seek (0); - processObjectRecord (mMStream, mMFlags, sal_True); + processObjectRecord (mMStream, mMFlags, dataSize, sal_True); } mbMultipart = false; } @@ -1235,7 +1235,7 @@ namespace cppcanvas EMFP_DEBUG (printf ("EMF+\talready used in svtools wmf/emf filter parser\n")); break; case EmfPlusRecordTypeObject: - processObjectRecord (rMF, flags); + processObjectRecord (rMF, flags, dataSize); break; case EmfPlusRecordTypeFillPie: { _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
