[Libreoffice-commits] .: 3 commits - vcl/source vcl/unx
David Tardon
dtardon at kemper.freedesktop.org
Wed May 11 05:05:15 PDT 2011
vcl/source/gdi/gdimtf.cxx | 3 ++-
vcl/source/gdi/oldprintadaptor.cxx | 1 +
vcl/unx/source/fontmanager/fontmanager.cxx | 4 ++++
3 files changed, 7 insertions(+), 1 deletion(-)
New commits:
commit c49446bf33ed6098febad3e8965271088f726d06
Author: David Tardon <dtardon at redhat.com>
Date: Wed May 11 13:43:35 2011 +0200
do not leak memory
diff --git a/vcl/source/gdi/oldprintadaptor.cxx b/vcl/source/gdi/oldprintadaptor.cxx
index 2846d8d..1ebaa15 100644
--- a/vcl/source/gdi/oldprintadaptor.cxx
+++ b/vcl/source/gdi/oldprintadaptor.cxx
@@ -63,6 +63,7 @@ OldStylePrintAdaptor::OldStylePrintAdaptor( const boost::shared_ptr< Printer >&
OldStylePrintAdaptor::~OldStylePrintAdaptor()
{
+ delete mpData;
}
void OldStylePrintAdaptor::StartPage()
commit 9479a5ff1ec5746e3cde1eeae5114ebce37e08e4
Author: David Tardon <dtardon at redhat.com>
Date: Wed May 11 13:39:05 2011 +0200
WaE: operation may be undefined
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 5b9044a..bebc0d0 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -829,7 +829,8 @@ void GDIMetaFile::Wind( size_t nActionPos )
void GDIMetaFile::WindPrev()
{
if( !bRecord )
- nCurrentActionElement = ( nCurrentActionElement > 0 ) ? --nCurrentActionElement : 0;
+ if ( nCurrentActionElement > 0 )
+ --nCurrentActionElement;
}
// ------------------------------------------------------------------------
commit f9ef0f1f26a50089ab8245eafec356264d0c5540
Author: David Tardon <dtardon at redhat.com>
Date: Wed May 11 12:00:57 2011 +0200
guard against invalid args
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx
index 60e9967..170796b 100644
--- a/vcl/unx/source/fontmanager/fontmanager.cxx
+++ b/vcl/unx/source/fontmanager/fontmanager.cxx
@@ -3168,6 +3168,10 @@ bool PrintFontManager::getMetrics( fontID nFontID, const sal_Unicode* pString, i
bool PrintFontManager::getMetrics( fontID nFontID, sal_Unicode minCharacter, sal_Unicode maxCharacter, CharacterMetric* pArray, bool bVertical ) const
{
+ OSL_PRECOND(minCharacter <= maxCharacter, "invalid char. range");
+ if (minCharacter > maxCharacter)
+ return false;
+
PrintFont* pFont = getFont( nFontID );
if( ! pFont )
return false;
More information about the Libreoffice-commits
mailing list