summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-27 13:56:27 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-27 13:56:27 +0100
commitaedcd7684b23166e700ef816c68d6d049f5cf0fa (patch)
treec47b373d3ae1ab074d7ddf58aaa76e6e83671974 /vcl
parent3b3b79bf00228d13f9ee28c30ee0c9dc224670fc (diff)
error: variable length array of non-POD element type
Change-Id: I65fa98537d883057285c24608582d1facbed2ca0
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/print/genpspgraphics.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 2269bcbd54c3..f5c24afffc71 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <vector>
+
#include <sal/types.h>
// for mmap etc.
@@ -1243,7 +1247,7 @@ const void* GenPspGraphics::DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs
int xMin, yMin, xMax, yMax;
rMgr.getFontBoundingBox( aFont, xMin, yMin, xMax, yMax );
- psp::CharacterMetric aMetrics[nLen];
+ std::vector<psp::CharacterMetric> aMetrics(nLen);
sal_Ucs aUnicodes[nLen];
if( aFontInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL && aFontInfo.m_eType == psp::fonttype::Type1 )
{
@@ -1251,7 +1255,8 @@ const void* GenPspGraphics::DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs
aUnicodes[i] = pUnicodes[i] < 0x0100 ? pUnicodes[i] + 0xf000 : pUnicodes[i];
pUnicodes = aUnicodes;
}
- if (!rMgr.getMetrics(aFont, pUnicodes, nLen, aMetrics))
+ if (!rMgr.getMetrics(
+ aFont, pUnicodes, nLen, nLen == 0 ? nullptr : &aMetrics[0]))
return NULL;
OString aSysPath = rMgr.getFontFileSysPath( aFont );