summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx6
-rw-r--r--vcl/source/gdi/sallayout.cxx8
2 files changed, 5 insertions, 9 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 4e84f0711778..3c7b186daec2 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7619,7 +7619,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
std::vector<sal_Ucs> aUnicodes;
aUnicodes.reserve( nMaxGlyphs );
sal_Int32 pUnicodesPerGlyph[nMaxGlyphs];
- int pCharPosAry[nMaxGlyphs+1];
+ int pCharPosAry[nMaxGlyphs];
sal_Int32 nAdvanceWidths[nMaxGlyphs];
const PhysicalFontFace* pFallbackFonts[nMaxGlyphs];
bool bVertical = m_aCurrentPDFState.m_aFont.IsVertical();
@@ -7768,14 +7768,14 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
aUnicodes.push_back( rText.GetChar( sal::static_int_cast<xub_StrLen>(pCharPosAry[i]) ) );
pUnicodesPerGlyph[i] = 1;
// try to handle ligatures and such
- if( i < nGlyphs )
+ if( i < nGlyphs-1 )
{
nChars = pCharPosAry[i+1] - pCharPosAry[i];
// #i115618# fix for simple RTL+CTL cases
// TODO: sanitize for RTL ligatures, more complex CTL, etc.
if( nChars < 0 )
nChars = -nChars;
- else if( nChars == 0 )
+ else if( nChars == 0 )
nChars = 1;
pUnicodesPerGlyph[i] = nChars;
for( int n = 1; n < nChars; n++ )
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 705b8cc8c2e0..6955679350ad 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1427,11 +1427,7 @@ int GenericSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos
nOldFlags = pG->mnGlyphIndex; // &GF_FLAGMASK not needed for test above
}
- // Calculate final pCharPosAry item
- if( pCharPosAry )
- *pCharPosAry = pG->mnCharPos;
-
- aRelativePos.X() /= mnUnitsPerPixel;
+ aRelativePos.X() /= mnUnitsPerPixel;
aRelativePos.Y() /= mnUnitsPerPixel;
rPos = GetDrawPosition( aRelativePos );
@@ -1679,7 +1675,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
// prepare "merge sort"
int nStartOld[ MAX_FALLBACK ];
int nStartNew[ MAX_FALLBACK ];
- int nCharPos[ MAX_FALLBACK+1 ];
+ int nCharPos[ MAX_FALLBACK ];
sal_Int32 nGlyphAdv[ MAX_FALLBACK ];
int nValid[ MAX_FALLBACK ] = {0};