[Libreoffice-commits] core.git: 3 commits - linguistic/source sc/source vcl/source

Caolán McNamara caolanm at redhat.com
Mon Oct 21 08:50:34 PDT 2013


 linguistic/source/dlistimp.cxx     |   11 +++++------
 sc/source/filter/dif/difimp.cxx    |    2 --
 vcl/source/gdi/cvtsvm.cxx          |    2 +-
 vcl/source/gdi/pdfwriter_impl2.cxx |    2 +-
 4 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit e03e9bfda7c1f5496879587ce1488faf94e6104b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 21 16:49:24 2013 +0100

    Resolves: fdo#70725 calc export to pdf broken
    
    Change-Id: Ibfe1d3a319fc82223f340ebd705a1966b8250089

diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index a58b719..bcff262 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -1705,7 +1705,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
                 MetaTextArrayAction*    pAct = (MetaTextArrayAction*)pAction;
                 OString aText(OUStringToOString(pAct->GetText(),
                     rActualCharSet));
-                OUString                aUniText = pAct->GetText().copy( pAct->GetIndex(), pAct->GetLen() );
+                OUString                aUniText = pAct->GetText().copy( pAct->GetIndex(), std::min<sal_Int32>(pAct->GetText().getLength() - pAct->GetIndex(), pAct->GetLen()) );
                 sal_uLong               nAryLen;
                 sal_uLong               nLen = pAct->GetLen();
                 const sal_uLong         nTextLen = aText.getLength();
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 9484df2..97d92ba 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -842,7 +842,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
                 case( META_TEXT_ACTION ):
                 {
                     const MetaTextAction* pA = (const MetaTextAction*) pAction;
-                    m_rOuterFace.DrawText( pA->GetPoint(), pA->GetText().copy( pA->GetIndex(), pA->GetLen() ) );
+                    m_rOuterFace.DrawText( pA->GetPoint(), pA->GetText().copy( pA->GetIndex(), std::min<sal_Int32>(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ) );
                 }
                 break;
 
commit d4b20d5c99adf2f32d782453387caef2439d9fa1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 21 15:36:33 2013 +0100

    convert lcl_GetToken from xub_StrLen to sal_Int32
    
    Change-Id: I72e98f1059280ed05b6cf77a6d69e522b4b8c075

diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index f90a6b0..05f514e 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -22,7 +22,6 @@
 #include <i18nlangtag/mslangid.hxx>
 #include <osl/file.hxx>
 #include <tools/stream.hxx>
-#include <tools/string.hxx>
 #include <tools/urlobj.hxx>
 #include <unotools/pathoptions.hxx>
 #include <unotools/useroptions.hxx>
@@ -781,10 +780,10 @@ void * SAL_CALL DicList_getFactory( const sal_Char * pImplName,
 }
 
 
-xub_StrLen lcl_GetToken( OUString &rToken,
+static sal_Int32 lcl_GetToken( OUString &rToken,
             const OUString &rText, xub_StrLen nPos, const OUString &rDelim )
 {
-    xub_StrLen nRes = STRING_LEN;
+    sal_Int32 nRes = -1;
 
     if (rText.isEmpty() ||  nPos >= rText.getLength())
         rToken = "";
@@ -796,7 +795,7 @@ xub_StrLen lcl_GetToken( OUString &rToken,
     }
     else
     {
-        xub_StrLen  i;
+        sal_Int32 i;
         for (i = nPos;  i < rText.getLength();  ++i)
         {
             if (-1 != rDelim.indexOf( rText[i] ))
@@ -828,8 +827,8 @@ static void AddInternal(
             "ensure no '.'");
 
         OUString      aToken;
-        xub_StrLen  nPos = 0;
-        while (STRING_LEN !=
+        sal_Int32 nPos = 0;
+        while (-1 !=
                     (nPos = lcl_GetToken( aToken, rNew, nPos, aDelim )))
         {
             if( !aToken.isEmpty()  &&  !IsNumeric( aToken ) )
commit 4af59f9dea4c57ac5ebc8c43ff3b934a5498d164
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 21 15:33:52 2013 +0100

    drop OSL_ENSURE about STRING_MAXLEN
    
    Change-Id: I945bcf3af5f8b2228c8c8c5958ff3aa60dfae2c2

diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index 53c1a6c..1c0adc9 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -21,7 +21,6 @@
 #include <math.h>
 
 #include <svl/zforlist.hxx>
-#include <tools/string.hxx>
 #include "attrib.hxx"
 #include "dif.hxx"
 #include "docpool.hxx"
@@ -371,7 +370,6 @@ TOPIC DifParser::GetNextTopic( void )
             case S_Data:
                 OSL_ENSURE( aLine.getLength() >= 2,
                     "+GetNextTopic(): <String> ist zu kurz!" );
-                OSL_ENSURE( aLine.getLength() - 2 <= STRING_MAXLEN, "GetNextTopic(): line doesn't fit into data");
                 if( aLine.getLength() > 2 )
                     aData = aLine.copy( 1, aLine.getLength() - 2 );
                 else


More information about the Libreoffice-commits mailing list