connectivity/source/drivers/mysqlc/mysqlc_types.cxx |   10 +++++
 xmloff/source/draw/animationexport.cxx              |   34 ++++++++++++--------
 2 files changed, 31 insertions(+), 13 deletions(-)

New commits:
commit 6af52fda008a42f388015e004024dd68e243bed8
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Apr 6 16:45:40 2025 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Apr 9 15:32:03 2025 +0200

    crashtesting: unable to reimport odp export of fdo72444-1.pptx
    
    There is a smil:values / smil:keyTimes count mismatch where the original
    pppx has: <p:tavLst><p:tav tm="0"><p:val></p:val></p:tav> so p:val is
    present but empty which results in an empty Any so the matching
    smil:values at export of the odp is empty while a smil:keyValues is
    exported, resulting in AnimationNodeContext::init_node throwing
    css::io::WrongFormatException from the mismatch of
    xAnimate->getValues().getLength() != xAnimate->getKeyTimes().getLength()
    
    exporting to pptx and then converting that to odp just drops the
    smil:values + smil:keyTimes, so solve this by only exporting
    smil:keyTimes if there was a successful export of smil:values.
    
    Change-Id: I5577a6671bfcebecf995afeea90e2d701f33eab1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183761
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit dc9bcbd50f79811787202429b49fe855c2d643be)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183769
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/xmloff/source/draw/animationexport.cxx 
b/xmloff/source/draw/animationexport.cxx
index 64fee6b8ef4c..d8171be53b53 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -441,7 +441,7 @@ public:
     static Reference< XInterface > getParagraphTarget( const ParagraphTarget& 
pTarget );
 
     static void convertPath( OUStringBuffer& sTmp, const Any& rPath );
-    void convertValue( XMLTokenEnum eAttributeName, OUStringBuffer& sTmp, 
const Any& rValue ) const;
+    bool convertValue( XMLTokenEnum eAttributeName, OUStringBuffer& sTmp, 
const Any& rValue ) const;
     void convertTiming( OUStringBuffer& sTmp, const Any& rTiming ) const;
     void convertTarget( OUStringBuffer& sTmp, const Any& rTarget ) const;
 
@@ -1123,12 +1123,15 @@ void AnimationsExporterImpl::exportAnimate( const 
Reference< XAnimate >& xAnimat
             }
         }
 
+        bool bExportedValues = false;
         Sequence< Any > aValues( xAnimate->getValues() );
         if( aValues.hasElements() )
         {
             aTemp <<= aValues;
-            convertValue( eAttributeName, sTmp, aTemp );
-            mxExport->AddAttribute( XML_NAMESPACE_SMIL, XML_VALUES, 
sTmp.makeStringAndClear() );
+            bExportedValues = convertValue(eAttributeName, sTmp, aTemp);
+            SAL_WARN_IF(!bExportedValues, "xmloff", "exportAnimate(), unable 
to export smil:values");
+            if (bExportedValues)
+                mxExport->AddAttribute(XML_NAMESPACE_SMIL, XML_VALUES, 
sTmp.makeStringAndClear());
         }
         else
         {
@@ -1157,7 +1160,8 @@ void AnimationsExporterImpl::exportAnimate( const 
Reference< XAnimate >& xAnimat
         if(nNodeType != AnimationNodeType::SET)
         {
             const Sequence< double > aKeyTimes( xAnimate->getKeyTimes() );
-            if( aKeyTimes.hasElements() )
+            SAL_WARN_IF(aKeyTimes.hasElements() && !bExportedValues, "xmloff", 
"exportAnimate() no smil:values exported so skipping smil:keyTimes");
+            if (aKeyTimes.hasElements() && bExportedValues)
             {
                 for( const auto& rKeyTime : aKeyTimes )
                 {
@@ -1457,17 +1461,18 @@ void AnimationsExporterImpl::convertPath( 
OUStringBuffer& sTmp, const Any& rPath
     sTmp = aStr;
 }
 
-void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, 
OUStringBuffer& sTmp, const Any& rValue ) const
+bool AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, 
OUStringBuffer& sTmp, const Any& rValue ) const
 {
     if( !rValue.hasValue() )
-        return;
+        return false;
 
+    bool bSuccess = true;
     if( auto pValuePair = o3tl::tryAccess<ValuePair>(rValue) )
     {
         OUStringBuffer sTmp2;
-        convertValue( eAttributeName, sTmp, pValuePair->First );
+        bSuccess &= convertValue( eAttributeName, sTmp, pValuePair->First );
         sTmp.append( ',' );
-        convertValue( eAttributeName, sTmp2, pValuePair->Second );
+        bSuccess &= convertValue( eAttributeName, sTmp2, pValuePair->Second );
         sTmp.append( sTmp2 );
     }
     else if( auto pSequence = o3tl::tryAccess<Sequence<Any>>(rValue) )
@@ -1482,7 +1487,7 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum 
eAttributeName, OUString
         {
             if( !sTmp.isEmpty() )
                 sTmp.append( ';' );
-            convertValue( eAttributeName, sTmp2, *pAny );
+            bSuccess &= convertValue( eAttributeName, sTmp2, *pAny );
             sTmp.append( sTmp2 );
             sTmp2.setLength(0);
         }
@@ -1512,8 +1517,9 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum 
eAttributeName, OUString
             else
             {
                 OSL_FAIL( "xmloff::AnimationsExporterImpl::convertValue(), 
invalid value type!" );
+                bSuccess = false;
             }
-            return;
+            return bSuccess;
         }
 
         case XML_SKEWX:
@@ -1539,13 +1545,17 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum 
eAttributeName, OUString
 
         //const XMLPropertyHandler* pHandler = 
static_cast<SdXMLExport*>(&mrExport)->GetSdPropHdlFactory()->GetPropertyHandler(
 nType );
         const XMLPropertyHandler* pHandler = 
mxSdPropHdlFactory->GetPropertyHandler( nType );
-        if( pHandler )
+        if (!pHandler)
+            bSuccess = false;
+        else
         {
             OUString aString;
-            pHandler->exportXML( aString, rValue, 
mxExport->GetMM100UnitConverter() );
+            bSuccess = pHandler->exportXML( aString, rValue, 
mxExport->GetMM100UnitConverter() );
             sTmp.append( aString );
         }
     }
+
+    return bSuccess;
 }
 
 void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& 
rValue ) const
commit 1ef0b26c70e2f5320829066350e8102e4d4f2a0e
Author:     Julien Nabet <[email protected]>
AuthorDate: Thu Mar 27 14:58:12 2025 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Apr 9 15:31:49 2025 +0200

    tdf#165928: MySQL/MariaDB direct connection: VARCHAR can be > 255 characters
    
    Change-Id: If3d5163416508d0f9e26978e2d853542f7a01961
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183400
    Tested-by: Julien Nabet <[email protected]>
    Reviewed-by: Julien Nabet <[email protected]>
    (cherry picked from commit 4b7ddc149990f21a98deb8ba0cc6a97e62b201d7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183439
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_types.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_types.cxx
index 85d3df43dfe0..b29360c59077 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_types.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_types.cxx
@@ -543,7 +543,15 @@ TypeInfoDef const mysqlc_types[] = {
     {
         "VARCHAR", // Typename
         css::sdbc::DataType::VARCHAR, // sdbc-type
-        255, // Precision
+        // tdf#165928: a VARCHAR should be more than 255 characters
+        // Mysql/MariaDB accepts 65535 bytes
+        // see 
https://mariadb.com/docs/skysql-dbaas/ref/xpand/data-types/VARCHAR/
+        // but precision corresponds to the number of characters and not the 
number of bytes:
+        // see 
https://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html
+        // Knowing that Unicode can use until 4 bytes, it means a varchar 
field can contain:
+        // 65535 / 4, so 16383 characters
+        // TODO if there's a way to retrieve the encoding, we could be more 
precise
+        16383, // Precision
         "'", // Literal prefix
         "'", // Literal suffix
         "(M)", // Create params

Reply via email to