parent
cf86fd0b56
commit
b955b9c68f
@ -1,264 +0,0 @@
|
||||
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
|
||||
index 32f2126..05de4cf 100644
|
||||
--- a/vcl/inc/vcl/salgdi.hxx
|
||||
+++ b/vcl/inc/vcl/salgdi.hxx
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "osl/thread.hxx"
|
||||
#include "vcl/outdev.hxx"
|
||||
#include "vcl/salnativewidgets.hxx"
|
||||
+#include "sallayout.hxx"
|
||||
|
||||
#include <map>
|
||||
|
||||
@@ -298,8 +299,8 @@ public:
|
||||
Int32Vector& rWidths,
|
||||
Ucs2UIntMap& rUnicodeEnc ) = 0;
|
||||
|
||||
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
|
||||
- virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0;
|
||||
+ virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) = 0;
|
||||
+ virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) = 0;
|
||||
|
||||
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
|
||||
virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0;
|
||||
diff --git a/vcl/inc/unx/pspgraphics.h b/vcl/inc/unx/pspgraphics.h
|
||||
index 29f9251..f5787b1 100644
|
||||
--- a/vcl/unx/inc/pspgraphics.h
|
||||
+++ b/vcl/unx/inc/pspgraphics.h
|
||||
@@ -123,8 +123,8 @@ public:
|
||||
bool bVertical,
|
||||
Int32Vector& rWidths,
|
||||
Ucs2UIntMap& rUnicodeEnc );
|
||||
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
|
||||
- virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
|
||||
+ virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
|
||||
+ virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& );
|
||||
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
|
||||
virtual void DrawServerFontLayout( const ServerFontLayout& );
|
||||
virtual bool supportsOperation( OutDevSupportType ) const;
|
||||
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
|
||||
index a7c2fa1..d03d1df 100644
|
||||
--- a/vcl/unx/inc/salgdi.h
|
||||
+++ b/vcl/unx/inc/salgdi.h
|
||||
@@ -287,8 +287,8 @@ public:
|
||||
bool bVertical,
|
||||
Int32Vector& rWidths,
|
||||
Ucs2UIntMap& rUnicodeEnc );
|
||||
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
|
||||
- virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
|
||||
+ virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
|
||||
+ virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& );
|
||||
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
|
||||
virtual void DrawServerFontLayout( const ServerFontLayout& );
|
||||
virtual bool supportsOperation( OutDevSupportType ) const;
|
||||
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
|
||||
index 647cc22..f30251d 100755
|
||||
--- a/vcl/source/gdi/outdev3.cxx
|
||||
+++ b/vcl/source/gdi/outdev3.cxx
|
||||
@@ -6112,7 +6112,7 @@ void OutputDevice::forceFallbackFontToFit(SalLayout &rFallback, ImplFontEntry &r
|
||||
if( !rFallback.GetNextGlyphs( 1, &nLGlyph, aPos, nStart ) )
|
||||
break;
|
||||
|
||||
- int nFontTag = nFallbackLevel << GF_FONTSHIFT;
|
||||
+ sal_GlyphId nFontTag = nFallbackLevel << GF_FONTSHIFT;
|
||||
nLGlyph |= nFontTag;
|
||||
|
||||
// get bounding rectangle of individual glyph
|
||||
diff --git a/vcl/unx/generic/gdi/pspgraphics.cxx b/vcl/unx/generic/gdi/pspgraphics.cxx
|
||||
index ba2319c..8e66c93 100644
|
||||
--- a/vcl/unx/source/gdi/pspgraphics.cxx
|
||||
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
|
||||
@@ -941,7 +941,7 @@ sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPa
|
||||
return nHavePairs;
|
||||
}
|
||||
|
||||
-sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
|
||||
+sal_Bool PspGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect )
|
||||
{
|
||||
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
|
||||
if( nLevel >= MAX_FALLBACK )
|
||||
@@ -951,13 +951,13 @@ sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
|
||||
if( !pSF )
|
||||
return sal_False;
|
||||
|
||||
- nGlyphIndex &= ~GF_FONTMASK;
|
||||
+ nGlyphIndex &= GF_IDXMASK;
|
||||
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
|
||||
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
|
||||
return sal_True;
|
||||
}
|
||||
|
||||
-sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex,
|
||||
+sal_Bool PspGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex,
|
||||
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
|
||||
{
|
||||
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
|
||||
@@ -968,7 +968,7 @@ sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex,
|
||||
if( !pSF )
|
||||
return sal_False;
|
||||
|
||||
- nGlyphIndex &= ~GF_FONTMASK;
|
||||
+ nGlyphIndex &= GF_IDXMASK;
|
||||
if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) )
|
||||
return sal_True;
|
||||
|
||||
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
|
||||
index 2615438..a90fd1c 100644
|
||||
--- a/vcl/unx/source/gdi/salgdi3.cxx
|
||||
+++ b/vcl/unx/source/gdi/salgdi3.cxx
|
||||
@@ -1149,17 +1149,17 @@ X11SalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
-sal_Bool X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
|
||||
+sal_Bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect )
|
||||
{
|
||||
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
|
||||
- if( nLevel < 0 || nLevel >= MAX_FALLBACK )
|
||||
+ if( nLevel >= MAX_FALLBACK )
|
||||
return sal_False;
|
||||
|
||||
ServerFont* pSF = mpServerFont[ nLevel ];
|
||||
if( !pSF )
|
||||
return sal_False;
|
||||
|
||||
- nGlyphIndex &= ~GF_FONTMASK;
|
||||
+ nGlyphIndex &= GF_IDXMASK;
|
||||
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
|
||||
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
|
||||
return sal_True;
|
||||
@@ -1167,7 +1167,7 @@ sal_Bool X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
-sal_Bool X11SalGraphics::GetGlyphOutline( long nGlyphIndex,
|
||||
+sal_Bool X11SalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex,
|
||||
::basegfx::B2DPolyPolygon& rPolyPoly )
|
||||
{
|
||||
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
|
||||
@@ -1178,7 +1178,7 @@ sal_Bool X11SalGraphics::GetGlyphOutline( long nGlyphIndex,
|
||||
if( !pSF )
|
||||
return sal_False;
|
||||
|
||||
- nGlyphIndex &= ~GF_FONTMASK;
|
||||
+ nGlyphIndex &= GF_IDXMASK;
|
||||
if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
|
||||
return sal_True;
|
||||
|
||||
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx
|
||||
index 37eac08..640eb43 100644
|
||||
--- a/vcl/unx/headless/svpgdi.hxx
|
||||
+++ b/vcl/unx/headless/svpgdi.hxx
|
||||
@@ -111,8 +111,8 @@ public:
|
||||
bool bVertical,
|
||||
Int32Vector& rWidths,
|
||||
Ucs2UIntMap& rUnicodeEnc );
|
||||
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
|
||||
- virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
|
||||
+ virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
|
||||
+ virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& );
|
||||
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
|
||||
virtual void DrawServerFontLayout( const ServerFontLayout& );
|
||||
virtual bool supportsOperation( OutDevSupportType ) const;
|
||||
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
|
||||
index c9c1a7d..f44c445 100644
|
||||
--- a/vcl/unx/headless/svppspgraphics.cxx
|
||||
+++ b/vcl/unx/headless/svppspgraphics.cxx
|
||||
@@ -848,7 +848,7 @@ sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPa
|
||||
return nHavePairs;
|
||||
}
|
||||
|
||||
-sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
|
||||
+sal_Bool PspGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect )
|
||||
{
|
||||
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
|
||||
if( nLevel >= MAX_FALLBACK )
|
||||
@@ -858,13 +858,13 @@ sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
|
||||
if( !pSF )
|
||||
return sal_False;
|
||||
|
||||
- nGlyphIndex &= ~GF_FONTMASK;
|
||||
+ nGlyphIndex &= GF_IDXMASK;
|
||||
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
|
||||
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
|
||||
return sal_True;
|
||||
}
|
||||
|
||||
-sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex,
|
||||
+sal_Bool PspGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex,
|
||||
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
|
||||
{
|
||||
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
|
||||
@@ -875,7 +875,7 @@ sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex,
|
||||
if( !pSF )
|
||||
return sal_False;
|
||||
|
||||
- nGlyphIndex &= ~GF_FONTMASK;
|
||||
+ nGlyphIndex &= GF_IDXMASK;
|
||||
if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) )
|
||||
return sal_True;
|
||||
|
||||
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
|
||||
index 6245496..2c03386 100644
|
||||
--- a/vcl/unx/headless/svppspgraphics.hxx
|
||||
+++ b/vcl/unx/headless/svppspgraphics.hxx
|
||||
@@ -125,8 +125,8 @@ public:
|
||||
bool bVertical,
|
||||
Int32Vector& rWidths,
|
||||
Ucs2UIntMap& rUnicodeEnc );
|
||||
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
|
||||
- virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
|
||||
+ virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
|
||||
+ virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& );
|
||||
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
|
||||
virtual void DrawServerFontLayout( const ServerFontLayout& );
|
||||
virtual bool supportsOperation( OutDevSupportType ) const;
|
||||
diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx
|
||||
index 24e0f1b..a077685 100644
|
||||
--- a/vcl/unx/headless/svptext.cxx
|
||||
+++ b/vcl/unx/headless/svptext.cxx
|
||||
@@ -460,7 +460,7 @@ void SvpSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
-sal_Bool SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
|
||||
+sal_Bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect )
|
||||
{
|
||||
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
|
||||
if( nLevel >= MAX_FALLBACK )
|
||||
@@ -470,7 +470,7 @@ sal_Bool SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
|
||||
if( !pSF )
|
||||
return sal_False;
|
||||
|
||||
- nGlyphIndex &= ~GF_FONTMASK;
|
||||
+ nGlyphIndex &= GF_IDXMASK;
|
||||
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
|
||||
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
|
||||
return sal_True;
|
||||
@@ -478,7 +478,7 @@ sal_Bool SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
-sal_Bool SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly )
|
||||
+sal_Bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, B2DPolyPolygon& rPolyPoly )
|
||||
{
|
||||
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
|
||||
if( nLevel >= MAX_FALLBACK )
|
||||
@@ -488,7 +488,7 @@ sal_Bool SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPol
|
||||
if( !pSF )
|
||||
return sal_False;
|
||||
|
||||
- nGlyphIndex &= ~GF_FONTMASK;
|
||||
+ nGlyphIndex &= GF_IDXMASK;
|
||||
if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
|
||||
return sal_True;
|
||||
|
||||
@@ -524,7 +524,7 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout )
|
||||
continue;
|
||||
|
||||
// get the glyph's alpha mask and adjust the drawing position
|
||||
- nGlyphIndex &= ~GF_FONTMASK;
|
||||
+ nGlyphIndex &= GF_IDXMASK;
|
||||
B2IPoint aDstPoint( aPos.X(), aPos.Y() );
|
||||
BitmapDeviceSharedPtr aAlphaMask
|
||||
= rGlyphPeer.GetGlyphBmp( *pSF, nGlyphIndex, m_eTextFmt, aDstPoint );
|
@ -1,99 +0,0 @@
|
||||
From 65e841076a947bcf115526e609de78e6952332e7 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Wed, 8 Jun 2011 11:05:37 +0100
|
||||
Subject: [PATCH] Resolves: rhbz#699909 crash in export of .doc in
|
||||
lcl_getFieldId
|
||||
|
||||
---
|
||||
sw/source/filter/ww8/wrtw8nds.cxx | 26 +++++++++++++++-----------
|
||||
1 files changed, 15 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
|
||||
index 114f4a6..183fe59 100644
|
||||
--- a/sw/source/filter/ww8/wrtw8nds.cxx
|
||||
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
|
||||
@@ -121,7 +121,9 @@ using namespace nsFieldFlags;
|
||||
static String lcl_getFieldCode( const IFieldmark* pFieldmark ) {
|
||||
OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???");
|
||||
|
||||
- if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
|
||||
+ if ( !pFieldmark) {
|
||||
+ return String();
|
||||
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
|
||||
return String::CreateFromAscii(" FORMTEXT ");
|
||||
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) {
|
||||
return String::CreateFromAscii(" FORMDROPDOWN ");
|
||||
@@ -140,7 +142,9 @@ static String lcl_getFieldCode( const IFieldmark* pFieldmark ) {
|
||||
|
||||
ww::eField lcl_getFieldId( const IFieldmark* pFieldmark ) {
|
||||
OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???");
|
||||
- if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
|
||||
+ if ( !pFieldmark ) {
|
||||
+ return ww::eUNKNOWN;
|
||||
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
|
||||
return ww::eFORMTEXT;
|
||||
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) {
|
||||
return ww::eFORMDROPDOWN;
|
||||
@@ -1840,11 +1844,11 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
|
||||
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
|
||||
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
|
||||
|
||||
- if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
|
||||
+ if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
|
||||
AppendBookmark( pFieldmark->GetName(), false );
|
||||
ww::eField eFieldId = lcl_getFieldId( pFieldmark );
|
||||
String sCode = lcl_getFieldCode( pFieldmark );
|
||||
- if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
|
||||
+ if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
|
||||
{
|
||||
IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) );
|
||||
@@ -1865,13 +1869,13 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
|
||||
}
|
||||
}
|
||||
OutputField( NULL, eFieldId, sCode, WRITEFIELD_START | WRITEFIELD_CMD_START );
|
||||
- if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
|
||||
+ if ( pFieldmark && pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
|
||||
WriteFormData( *pFieldmark );
|
||||
- else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) )
|
||||
+ else if ( pFieldmark && pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) )
|
||||
WriteHyperlinkData( *pFieldmark );
|
||||
OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CMD_END );
|
||||
|
||||
- if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
|
||||
+ if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
|
||||
{
|
||||
// Check for the presence of a linked OLE object
|
||||
IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
|
||||
@@ -1893,7 +1897,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
|
||||
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDEND??" );
|
||||
|
||||
ww::eField eFieldId = lcl_getFieldId( pFieldmark );
|
||||
- if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
|
||||
+ if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
|
||||
{
|
||||
IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) );
|
||||
@@ -1906,7 +1910,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
|
||||
}
|
||||
|
||||
OutputField( NULL, eFieldId, String(), WRITEFIELD_CLOSE );
|
||||
- if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
|
||||
+ if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
|
||||
AppendBookmark( pFieldmark->GetName(), false );
|
||||
}
|
||||
else if ( ch == CH_TXT_ATR_FORMELEMENT )
|
||||
@@ -1915,8 +1919,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
|
||||
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
|
||||
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
|
||||
|
||||
- bool isDropdownOrCheckbox = pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ||
|
||||
- pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) );
|
||||
+ bool isDropdownOrCheckbox = pFieldmark && (pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ||
|
||||
+ pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ));
|
||||
|
||||
if ( isDropdownOrCheckbox )
|
||||
AppendBookmark( pFieldmark->GetName(), 0 );
|
||||
--
|
||||
1.7.5.2
|
||||
|
@ -1,46 +0,0 @@
|
||||
From 5bc702e5487ba931b2707770a5e25a883bd89b76 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Fri, 27 May 2011 15:33:40 +0100
|
||||
Subject: [PATCH] Resolves: rhbz#707317 avoid crash in getRowSpan (cherry
|
||||
picked from commit
|
||||
23c4f82e9084f8b15f149b074a8ad4ff6a7a4204)
|
||||
|
||||
---
|
||||
sw/source/core/crsr/swcrsr.cxx | 7 +++----
|
||||
1 files changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
|
||||
index 4f646d2..c27d8f7 100644
|
||||
--- a/sw/source/core/crsr/swcrsr.cxx
|
||||
+++ b/sw/source/core/crsr/swcrsr.cxx
|
||||
@@ -1665,8 +1665,7 @@ sal_Bool SwCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
|
||||
{
|
||||
// Set cursor to start/end of covered cell:
|
||||
SwTableBox* pTableBox = pOldTabBoxSttNode->GetTblBox();
|
||||
- const long nRowSpan = pTableBox->getRowSpan();
|
||||
- if ( nRowSpan > 1 )
|
||||
+ if ( pTableBox && pTableBox->getRowSpan() > 1 )
|
||||
{
|
||||
pTableBox = & pTableBox->FindEndOfRowSpan( pOldTabSttNode->GetTable(), (sal_uInt16)(pTableBox->getRowSpan() + mnRowSpanOffset ) );
|
||||
SwNodeIndex& rPtIdx = GetPoint()->nNode;
|
||||
@@ -1953,7 +1952,7 @@ sal_Bool SwCursor::GoPrevNextCell( sal_Bool bNext, sal_uInt16 nCnt )
|
||||
// proceeding:
|
||||
if ( mnRowSpanOffset )
|
||||
{
|
||||
- if ( pTableBox->getRowSpan() > 1 )
|
||||
+ if ( pTableBox && pTableBox->getRowSpan() > 1 )
|
||||
{
|
||||
pTableBox = & pTableBox->FindEndOfRowSpan( pTblNd->GetTable(), (sal_uInt16)(pTableBox->getRowSpan() + mnRowSpanOffset) );
|
||||
SwNodeIndex aNewIdx( *pTableBox->GetSttNd() );
|
||||
@@ -1976,7 +1975,7 @@ sal_Bool SwCursor::GoPrevNextCell( sal_Bool bNext, sal_uInt16 nCnt )
|
||||
|
||||
pTableBoxStartNode = rPtIdx.GetNode().FindTableBoxStartNode();
|
||||
pTableBox = pTableBoxStartNode->GetTblBox();
|
||||
- if ( pTableBox->getRowSpan() < 1 )
|
||||
+ if ( pTableBox && pTableBox->getRowSpan() < 1 )
|
||||
{
|
||||
mnRowSpanOffset = pTableBox->getRowSpan();
|
||||
// move cursor to non-covered cell:
|
||||
--
|
||||
1.7.5.1
|
||||
|
@ -1,29 +0,0 @@
|
||||
From 3860483d8cb9e259ca3f68347ba0e35f7bfb1739 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Thu, 2 Jun 2011 11:39:43 +0100
|
||||
Subject: [PATCH] Resolves: rhbz#710004 band-aid for immediate crash in
|
||||
IsAlignPossible (cherry picked from commit
|
||||
d6839fa9aaac82892b5af2bc00c9ad196c9ff4bb)
|
||||
|
||||
---
|
||||
sw/source/core/frmedt/feshview.cxx | 3 ++-
|
||||
1 files changed, 2 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
|
||||
index ef9becd..87bc266 100644
|
||||
--- a/sw/source/core/frmedt/feshview.cxx
|
||||
+++ b/sw/source/core/frmedt/feshview.cxx
|
||||
@@ -2566,8 +2566,9 @@ sal_Bool SwFEShell::IsAlignPossible() const
|
||||
{
|
||||
SdrObject *pO = Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
|
||||
SwDrawContact *pC = (SwDrawContact*)GetUserCall(pO);
|
||||
+ OSL_ENSURE( pC, "No SwDrawContact!");
|
||||
//only as character bound drawings can be aligned
|
||||
- bRet = (pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_AS_CHAR);
|
||||
+ bRet = pC ? (pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_AS_CHAR) : sal_False;
|
||||
}
|
||||
if ( bRet )
|
||||
return Imp()->GetDrawView()->IsAlignPossible();
|
||||
--
|
||||
1.7.5.2
|
||||
|
@ -1,111 +0,0 @@
|
||||
From b883b506e2d4dca419838b56915c58a0030d5b98 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Tue, 7 Jun 2011 12:37:08 +0100
|
||||
Subject: [PATCH] Resolves: rhbz#710556 don't crash on missing graphics
|
||||
|
||||
---
|
||||
oox/source/export/drawingml.cxx | 28 ++++++++++++++--------------
|
||||
1 files changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
|
||||
index 4e94e90..7cf8d98 100644
|
||||
--- a/oox/source/export/drawingml.cxx
|
||||
+++ b/oox/source/export/drawingml.cxx
|
||||
@@ -469,7 +469,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
|
||||
{
|
||||
GfxLink aLink = rGraphic.GetLink ();
|
||||
OUString sMediaType;
|
||||
- const char* sExtension = NULL;
|
||||
+ const char* pExtension = "";
|
||||
OUString sRelId;
|
||||
|
||||
SvMemoryStream aStream;
|
||||
@@ -479,42 +479,42 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
|
||||
switch ( aLink.GetType() ) {
|
||||
case GFX_LINK_TYPE_NATIVE_GIF:
|
||||
sMediaType = US( "image/gif" );
|
||||
- sExtension = ".gif";
|
||||
+ pExtension = ".gif";
|
||||
break;
|
||||
case GFX_LINK_TYPE_NATIVE_JPG:
|
||||
sMediaType = US( "image/jpeg" );
|
||||
- sExtension = ".jpeg";
|
||||
+ pExtension = ".jpeg";
|
||||
break;
|
||||
case GFX_LINK_TYPE_NATIVE_PNG:
|
||||
sMediaType = US( "image/png" );
|
||||
- sExtension = ".png";
|
||||
+ pExtension = ".png";
|
||||
break;
|
||||
case GFX_LINK_TYPE_NATIVE_TIF:
|
||||
sMediaType = US( "image/tiff" );
|
||||
- sExtension = ".tiff";
|
||||
+ pExtension = ".tiff";
|
||||
break;
|
||||
case GFX_LINK_TYPE_NATIVE_WMF:
|
||||
sMediaType = US( "image/x-wmf" );
|
||||
- sExtension = ".wmf";
|
||||
+ pExtension = ".wmf";
|
||||
break;
|
||||
case GFX_LINK_TYPE_NATIVE_MET:
|
||||
sMediaType = US( "image/x-met" );
|
||||
- sExtension = ".met";
|
||||
+ pExtension = ".met";
|
||||
break;
|
||||
case GFX_LINK_TYPE_NATIVE_PCT:
|
||||
sMediaType = US( "image/x-pict" );
|
||||
- sExtension = ".pct";
|
||||
+ pExtension = ".pct";
|
||||
break;
|
||||
default: {
|
||||
GraphicType aType = rGraphic.GetType();
|
||||
if ( aType == GRAPHIC_BITMAP ) {
|
||||
GraphicConverter::Export( aStream, rGraphic, CVT_PNG );
|
||||
sMediaType = US( "image/png" );
|
||||
- sExtension = ".png";
|
||||
+ pExtension = ".png";
|
||||
} else if ( aType == GRAPHIC_GDIMETAFILE ) {
|
||||
GraphicConverter::Export( aStream, rGraphic, CVT_EMF );
|
||||
sMediaType = US( "image/x-emf" );
|
||||
- sExtension = ".emf";
|
||||
+ pExtension = ".emf";
|
||||
} else {
|
||||
OSL_TRACE( "unhandled graphic type" );
|
||||
break;
|
||||
@@ -526,7 +526,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
|
||||
}
|
||||
}
|
||||
|
||||
- const char *pComponent = NULL;
|
||||
+ const char *pComponent = "";
|
||||
switch ( meDocumentType )
|
||||
{
|
||||
case DOCUMENT_DOCX: pComponent = "word"; break;
|
||||
@@ -538,13 +538,13 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
|
||||
.appendAscii( pComponent )
|
||||
.appendAscii( "/media/image" )
|
||||
.append( (sal_Int32) mnImageCounter )
|
||||
- .appendAscii( sExtension )
|
||||
+ .appendAscii( pExtension )
|
||||
.makeStringAndClear(),
|
||||
sMediaType );
|
||||
xOutStream->writeBytes( Sequence< sal_Int8 >( (const sal_Int8*) aData, nDataSize ) );
|
||||
xOutStream->closeOutput();
|
||||
|
||||
- const char *pImagePrefix = NULL;
|
||||
+ const char *pImagePrefix = "";
|
||||
switch ( meDocumentType )
|
||||
{
|
||||
case DOCUMENT_DOCX:
|
||||
@@ -561,7 +561,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
|
||||
OUStringBuffer()
|
||||
.appendAscii( pImagePrefix )
|
||||
.append( (sal_Int32) mnImageCounter ++ )
|
||||
- .appendAscii( sExtension )
|
||||
+ .appendAscii( pExtension )
|
||||
.makeStringAndClear() );
|
||||
|
||||
return sRelId;
|
||||
--
|
||||
1.7.5.2
|
||||
|
@ -1,35 +0,0 @@
|
||||
From 73a9de430716486d4bd7d535df257fb50889a12b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cedric.bosdonnat.ooo@free.fr>
|
||||
Date: Wed, 8 Jun 2011 10:06:23 +0200
|
||||
Subject: [PATCH] fdo#37584: Make a real copy of the text where to count words
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Const-casting a reference doesn't create a copy of it and then the
|
||||
spaces replacement made by the WordCount was also made on the actual
|
||||
text node. Use String::Copy() to actually copy the text and safely
|
||||
operate on it.
|
||||
(cherry picked from commit 135cf4fdbec71e8d93edc0339e8617d50766f151)
|
||||
|
||||
Signed-off-by: Caolán McNamara <caolanm@redhat.com>
|
||||
---
|
||||
sw/source/core/txtnode/txtedt.cxx | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
|
||||
index d4c02b6..08d0c6b 100644
|
||||
--- a/sw/source/core/txtnode/txtedt.cxx
|
||||
+++ b/sw/source/core/txtnode/txtedt.cxx
|
||||
@@ -1814,7 +1814,7 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
|
||||
}
|
||||
|
||||
// make a copy of the text
|
||||
- String& rTextCopy = const_cast<String&>(m_Text);
|
||||
+ String rTextCopy = m_Text.Copy( );
|
||||
|
||||
// mask out the redlined and hidden text with ' '
|
||||
const xub_Unicode cChar(' ');
|
||||
--
|
||||
1.7.5.2
|
||||
|
Loading…
Reference in new issue