filter/source/msfilter/svdfppt.cxx  |   14 ++++++++------
 include/filter/msfilter/svdfppt.hxx |    4 ++--
 2 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit caeed200754eda7787cae256136dee25f347a69c
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Dec 1 15:29:12 2024 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Dec 1 19:19:13 2024 +0100

    ReadCharProps always overwrites nCharCount
    
    its an out only param, not in-out
    
    Change-Id: I4e969bf06bed41a7e04497880f8ea51a3f784feb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177612
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index 8ec7567edb37..1d1715c545e5 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -5085,8 +5085,8 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& 
rIn, const DffRecordHeader
     }
 }
 
-void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& 
aCharPropSet, std::u16string_view aString,
-                                            sal_uInt32& nCharCount, sal_uInt32 
nCharReadCnt,
+sal_uInt32 PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, 
PPTCharPropSet& aCharPropSet, std::u16string_view aString,
+                                            sal_uInt32 nCharReadCnt,
                                             bool& bTextPropAtom, sal_uInt32 
nExtParaPos,
                                             const std::vector< StyleTextProp9 
>& aStyleTextProp9,
                                             sal_uInt32& nExtParaFlags, 
sal_uInt16& nBuBlip,
@@ -5096,7 +5096,7 @@ void PPTStyleTextPropReader::ReadCharProps( SvStream& 
rIn, PPTCharPropSet& aChar
 
     sal_uInt16 nDummy16;
     rIn.ReadUInt16( nDummy16 );
-    nCharCount = (rIn.good()) ? nDummy16 : 0;
+    sal_uInt32 nCharCount = (rIn.good()) ? nDummy16 : 0;
     rIn.ReadUInt16( nDummy16 );
 
     sal_Int32 nCharsToRead = nStringLen - ( nCharReadCnt + nCharCount );
@@ -5159,7 +5159,7 @@ void PPTStyleTextPropReader::ReadCharProps( SvStream& 
rIn, PPTCharPropSet& aChar
         aSet.mnAttrSet |= 1 << PPT_CharAttr_Escapement;
     }
     if ( !nExtParaPos )
-        return;
+        return nCharCount;
 
     sal_uInt32 nExtBuInd = nMask & 0x3c00;
     if ( nExtBuInd )
@@ -5171,6 +5171,8 @@ void PPTStyleTextPropReader::ReadCharProps( SvStream& 
rIn, PPTCharPropSet& aChar
         nHasAnm = aStyleTextProp9[ nExtBuInd ].mnHasAnm;
         nAnmScheme = aStyleTextProp9[ nExtBuInd ].mnAnmScheme;
     }
+
+    return nCharCount;
 }
 
 void PPTStyleTextPropReader::Init( SvStream& rIn, const DffRecordHeader& 
rTextHeader,
@@ -5281,7 +5283,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, const 
DffRecordHeader& rTextHe
 
             sal_uInt32 nExtParaFlags = 0, nAnmScheme = 0;
             sal_uInt16 nBuBlip = 0xffff, nHasAnm = 0;
-            ReadCharProps( rIn, aCharPropSet, aString, nCharCount, 
0/*nCharReadCnt*/,
+            nCharCount = ReadCharProps( rIn, aCharPropSet, aString, 
0/*nCharReadCnt*/,
                            bTextPropAtom, nExtParaPos, aStyleTextProp9, 
nExtParaFlags,
                            nBuBlip, nHasAnm, nAnmScheme );
 
@@ -5311,7 +5313,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, const 
DffRecordHeader& rTextHe
             PPTCharPropSet aCharPropSet( nCurrentPara );
             if ( bTextPropAtom )
             {
-                ReadCharProps( rIn, aCharPropSet, aString, nCharCount, 
nCharReadCnt,
+                nCharCount = ReadCharProps( rIn, aCharPropSet, aString, 
nCharReadCnt,
                                bTextPropAtom, nExtParaPos, aStyleTextProp9, 
nExtParaFlags,
                                nBuBlip, nHasAnm, nAnmScheme );
                 if (!rIn.good())
diff --git a/include/filter/msfilter/svdfppt.hxx 
b/include/filter/msfilter/svdfppt.hxx
index e92ef0a13c25..eddcda824a68 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -1085,11 +1085,11 @@ struct PPTStyleTextPropReader
                 sal_uInt32& nCharCount,
                 bool& bTextPropAtom
             );
-    static void ReadCharProps(
+    // returns CharCount
+    static sal_uInt32 ReadCharProps(
                 SvStream& rIn,
                 PPTCharPropSet& aCharPropSet,
                 std::u16string_view aString,
-                sal_uInt32& nCharCount,
                 sal_uInt32 nCharReadCnt,
                 bool& bTextPropAtom,
                 sal_uInt32 nExtParaPos,

Reply via email to