[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source sd/qa

2022-11-21 Thread Marco Cecchetti (via logerrit)
 filter/source/svg/presentation_engine.js |  141 ---
 filter/source/svg/svgexport.cxx  |   12 +-
 filter/source/svg/svgwriter.cxx  |   42 +++--
 sd/qa/unit/SVGExportTests.cxx|   18 +--
 4 files changed, 88 insertions(+), 125 deletions(-)

New commits:
commit 392bffdf3dced101716904ef8231426b3c3b64e7
Author: Marco Cecchetti 
AuthorDate: Mon Nov 21 16:43:34 2022 +0100
Commit: Andras Timar 
CommitDate: Mon Nov 21 20:54:56 2022 +0100

svg export filter: text fields not handled correctly

New solution for fixing text field issues:

- small text field are not substituted with the right content because
the placeholder text span several lines
- copy of standard text fields embedded in the default master page are
not substitute with the right content.

Change-Id: Ifc8773f1ba41f9d0fe6f6ef3982cb64a514fcec7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142933
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index dbfe2ab0f914..a3ef0ee4550b 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -4464,13 +4464,13 @@ var aOOOAttrTextAdjust = 'text-adjust';
 // element class names
 var aClipPathGroupClassName = 'ClipPathGroup';
 var aPageClassName = 'Page';
-var aSlideNumberClassName = 'Slide_Number';
-var aDateTimeClassName = 'Date/Time';
+var aSlideNumberClassName = 'PageNumber';
+var aDateTimeClassName = 'DateTime';
 var aFooterClassName = 'Footer';
 var aHeaderClassName = 'Header';
 var aDateClassName = 'Date';
 var aTimeClassName = 'Time';
-var aSlideNameClassName='SlideName';
+var aSlideNameClassName='PageName';
 
 // Creating a namespace dictionary.
 var NSS = {};
@@ -4785,15 +4785,6 @@ function getRandomInt( nMax )
 return Math.floor( Math.random() * nMax );
 }
 
-function isTextFieldElement( aElement ) // eslint-disable-line no-unused-vars
-{
-var sClassName = aElement.getAttribute( 'class' );
-return ( sClassName === aSlideNumberClassName ) ||
-   ( sClassName === aFooterClassName ) ||
-   ( sClassName === aHeaderClassName ) ||
-   ( sClassName === aDateTimeClassName );
-}
-
 
 /*
  ** Debug Utilities **
@@ -5192,10 +5183,11 @@ initPlaceholderElements : function()
 for( ; i < aPlaceholderList.length; ++i )
 {
 var aPlaceholderElem = aPlaceholderList[i];
-var sContent = aPlaceholderElem.textContent;
-if( sContent === '' )
+var sClass = aPlaceholderElem.getAttribute('class');
+var sFieldType = sClass.split(' ')[1];
+if( sFieldType ===  aDateClassName)
 aPlaceholderElem.textContent = new Date().toLocaleDateString();
-else if( sContent === '' )
+else if( sFieldType === aTimeClassName )
 aPlaceholderElem.textContent = new Date().toLocaleTimeString();
 }
 },
@@ -5376,53 +5368,43 @@ getSlideAnimationsRoot : function()
 
 }; // end MetaSlide prototype
 
-function getTextFieldType ( elem )
+function removeRedundantParagraphFromTextFieldShape( aObject )
 {
-var sFieldType = null;
-var sClass = elem.getAttribute('class');
-if( sClass == 'TextShape' )
+var aTextElem = getElementByClassName( aObject, 'SVGTextShape' );
+if( aTextElem )
 {
-var aPlaceholderElement = getElementByClassName( elem, 
'PlaceholderText' );
-if (aPlaceholderElement)
+var aPlaceholderElement = getElementsByClassName(aTextElem, 
'PlaceholderText');
+if( aPlaceholderElement )
 {
-var sContent = aPlaceholderElement.textContent
-if (sContent === '')
-sFieldType = aSlideNumberClassName;
-else if (sContent === '')
-sFieldType = aDateTimeClassName;
-else if (sContent === '')
-sFieldType = aDateClassName;
-else if (sContent === '')
-sFieldType = aTimeClassName;
-else if (sContent === '')
-sFieldType = aSlideNameClassName;
-else if (sContent === '')
-sFieldType = aFooterClassName;
-else if (sContent === '')
-sFieldType = aHeaderClassName;
+var aTextParagraphSet = getElementsByClassName(aTextElem, 
'TextParagraph');
+// When the text field width is too small, the placeholder text 
spans several lines.
+// We remove all text lines but the first one which is used as a 
placeholder.
+// This is a workaround but it should work in the majority of 
cases.
+// A complete solution needs to support svg text wrapping.
+if( aTextParagraphSet.length > 1 )
+{
+var i = aTextParagraphSet.length;
+while( i > 1 )
+{
+

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2022-11-16 Thread Marco Cecchetti (via logerrit)
 filter/source/svg/presentation_engine.js |   37 +++
 1 file changed, 37 insertions(+)

New commits:
commit e87d8bb20267b83ba6ef665aabc70a3e26307fd9
Author: Marco Cecchetti 
AuthorDate: Tue Nov 15 10:56:15 2022 +0100
Commit: Andras Timar 
CommitDate: Wed Nov 16 21:45:37 2022 +0100

svg export filter: when a text field is too small, its content is wrong

When the text field width is too small, the placeholder text spans
several lines.
That stopped the js engine to substitute the text field placeholder
with the right content.
This is a workaround but it should work in the majority of cases.
A complete solution needs to support svg text wrapping.

Change-Id: Ide52e08acd35b3764b8abc600e4b467acea0a248
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142794
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index cf49ba565192..dbfe2ab0f914 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5401,6 +5401,29 @@ function getTextFieldType ( elem )
 else if (sContent === '')
 sFieldType = aHeaderClassName;
 }
+
+if( sFieldType )
+return sFieldType;
+
+var aTextPortionElement = getElementByClassName( elem, 'TextPortion' );
+if( aTextPortionElement )
+{
+var sContent = aTextPortionElement.textContent
+if( sContent.indexOf( '' ) != -1 )
+sFieldType = aSlideNumberClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aDateTimeClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aDateClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aTimeClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aSlideNameClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aFooterClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aHeaderClassName;
+}
 }
 return sFieldType;
 }
@@ -5610,6 +5633,20 @@ PlaceholderShape.prototype.init = function()
 var aTextElem = getElementByClassName( aTextFieldElement, 
'SVGTextShape' );
 if( aTextElem )
 {
+var aTextParagraphSet = getElementsByClassName( aTextElem, 
'TextParagraph' );
+// When the text field width is too small, the placeholder text 
spans several lines.
+// We remove all text lines but the first one which is used as a 
placeholder.
+// This is a workaround but it should work in the majority of 
cases.
+// A complete solution needs to support svg text wrapping.
+if( aTextParagraphSet.length > 1 )
+{
+var i = aTextParagraphSet.length;
+while( i > 1 )
+{
+aTextElem.removeChild(aTextParagraphSet[i-1]);
+--i;
+}
+}
 var aPlaceholderElement = getElementByClassName(aTextElem, 
'PlaceholderText');
 if( aPlaceholderElement )
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2022-11-16 Thread Marco Cecchetti (via logerrit)
 filter/source/svg/presentation_engine.js |   25 +++-
 filter/source/svg/svgexport.cxx  |   46 +--
 2 files changed, 37 insertions(+), 34 deletions(-)

New commits:
commit 98ff2f350a79959760b063821000ec6e7a37b090
Author: Marco Cecchetti 
AuthorDate: Mon Nov 14 18:18:23 2022 +0100
Commit: Andras Timar 
CommitDate: Wed Nov 16 21:44:39 2022 +0100

svg export filter: footer was not replaced with the right content

When a user create a copy of the footer text field which can be
included in a master page, the copy content was kept to the text
placeholder instead of being substituted with the right content.

Change-Id: I411349026e41d49b606cdae5d13d990d0fa0b07c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142693
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index 7e6de4282f98..cf49ba565192 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5388,12 +5388,18 @@ function getTextFieldType ( elem )
 var sContent = aPlaceholderElement.textContent
 if (sContent === '')
 sFieldType = aSlideNumberClassName;
+else if (sContent === '')
+sFieldType = aDateTimeClassName;
 else if (sContent === '')
 sFieldType = aDateClassName;
 else if (sContent === '')
 sFieldType = aTimeClassName;
 else if (sContent === '')
 sFieldType = aSlideNameClassName;
+else if (sContent === '')
+sFieldType = aFooterClassName;
+else if (sContent === '')
+sFieldType = aHeaderClassName;
 }
 }
 return sFieldType;
@@ -5401,8 +5407,8 @@ function getTextFieldType ( elem )
 
 function isTextFieldByClassName ( sClassName )
 {
-return sClassName === aDateTimeClassName || sClassName === aFooterClassName
-|| sClassName === aHeaderClassName || sClassName.indexOf( 
aSlideNumberClassName ) == 0
+return sClassName.indexOf( aDateTimeClassName ) == 0 || 
sClassName.indexOf( aFooterClassName ) == 0
+|| sClassName.indexOf( aHeaderClassName ) == 0 || sClassName.indexOf( 
aSlideNumberClassName ) == 0
 || sClassName.indexOf( aDateClassName ) == 0 || sClassName.indexOf( 
aTimeClassName ) == 0
 || sClassName.indexOf( aSlideNameClassName ) == 0;
 }
@@ -5882,7 +5888,10 @@ MasterPageView.prototype.createElement = function()
aTextFieldHandlerSet, 
sMasterSlideId );
 }
 }
-else if( sId.indexOf( aDateClassName ) == 0
+else if( sId.indexOf( aDateTimeClassName ) == 0
+|| sId.indexOf( aFooterClassName ) == 0
+|| sId.indexOf( aHeaderClassName ) == 0
+|| sId.indexOf( aDateClassName ) == 0
 || sId.indexOf( aTimeClassName ) == 0
 || sId.indexOf( aSlideNameClassName ) == 0 )
 {
@@ -5922,21 +5931,21 @@ MasterPageView.prototype.initTextFieldHandler =
 if( aPlaceholderShape  && aPlaceholderShape.isValid()
 && aTextFieldContentProvider )
 {
-var sTextFieldContentProviderId = aTextFieldContentProvider.sId;
+var sTextFiedHandlerKey = aTextFieldContentProvider.sId + '.' + sId;
 // We create only one single TextFieldHandler object (and so one only
 // text field clone) per master slide and text content.
-if ( !aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFieldContentProviderId ] )
+if ( !aTextFieldHandlerSet[ sMasterSlideId ][ sTextFiedHandlerKey ] )
 {
-aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFieldContentProviderId ] =
+aTextFieldHandlerSet[ sMasterSlideId ][ sTextFiedHandlerKey ] =
 new TextFieldHandler( aPlaceholderShape,
   aTextFieldContentProvider );
-aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFieldContentProviderId ];
+aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFiedHandlerKey ];
 aTextFieldHandler.update();
 aTextFieldHandler.appendTo( aDefsElement );
 }
 else
 {
-aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFieldContentProviderId ];
+aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFiedHandlerKey ];
 }
 sRefId = aTextFieldHandler.sId;
 }
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 6022cb966c08..f112c99ee047 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1308,44 +1308,38 @@ void SVGFilter::implGenerateMetaData()
 }
 
  

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2022-05-29 Thread Marco Cecchetti (via logerrit)
 filter/source/svg/svgexport.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 3b3e58765f9194944b577048db893e152ef1220b
Author: Marco Cecchetti 
AuthorDate: Fri May 13 14:35:17 2022 +0200
Commit: Aron Budea 
CommitDate: Mon May 30 05:11:45 2022 +0200

impress online: not handled transform animation causes core crash

The transform animation uses the svg namespace for some attribute,
anyway the exporter was not configured for handling attribute with
such a namespace prepended.

Change-Id: Ia33f55e3589b5743352ec0a156408b374a92509b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134354
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index d0eb6b9c6a8c..6022cb966c08 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -370,6 +370,11 @@ SVGExport::SVGExport(
 mbIsUsePositionedCharacters = 
aFilterDataHashMap.getUnpackedValueOrDefault(SVG_PROP_POSITIONED_CHARACTERS, 
false);
 
 // add namespaces
+GetNamespaceMap_().Add(
+GetXMLToken(XML_NP_SVG),
+GetXMLToken(XML_N_SVG_COMPAT),
+XML_NAMESPACE_SVG);
+
 GetNamespaceMap_().Add(
 GetXMLToken(XML_NP_PRESENTATION),
 GetXMLToken(XML_N_PRESENTATION),
@@ -1054,6 +1059,7 @@ void 
SVGFilter::implExportDocumentHeaderImpressOrDraw(sal_Int32 nDocX, sal_Int32
 mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:presentation", 
"http://sun.com/xmlns/staroffice/presentation; );
 mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:smil", 
"http://www.w3.org/2001/SMIL20/; );
 mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:anim", 
"urn:oasis:names:tc:opendocument:xmlns:animation:1.0" );
+mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:svg", 
"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" );
 mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xml:space", "preserve" );
 
 mpSVGDoc = new SvXMLElementExport( *mpSVGExport, XML_NAMESPACE_NONE, 
"svg", true, true );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2022-05-27 Thread Marco Cecchetti (via logerrit)
 filter/source/svg/presentation_engine.js |  231 ++-
 1 file changed, 226 insertions(+), 5 deletions(-)

New commits:
commit 2b1ede7cdeec0c9569f8dc5b7170afb13f202416
Author: Marco Cecchetti 
AuthorDate: Mon May 23 12:22:19 2022 +0200
Commit: Aron Budea 
CommitDate: Fri May 27 13:52:44 2022 +0200

svg filter: transform animations: support for scale and translate

Now the emphasis grow and shrink animation is supported.
Now the animation engine is able to handle array of values instead of
single value param when computing the next animation state.

Change-Id: Ic200103c6c26a63de8eecc37dcd36ba1a2f0d391
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134870
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
(cherry picked from commit a6ed16394c4a95cf204f38c30cb025bc99f00027)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134994
Reviewed-by: Aron Budea 

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index 201aab2dcf8e..7e6de4282f98 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -7033,6 +7033,8 @@ function matrixToString( aSVGMatrix )
 // eslint-disable-next-line no-unused-vars
 function numberParser( sValue )
 {
+if( typeof sValue !== 'string' )
+return undefined;
 if( sValue === '.' )
 return undefined;
 var reFloatNumber = /^[+-]?[0-9]*[.]?[0-9]*$/;
@@ -7045,6 +7047,9 @@ function numberParser( sValue )
 
 function booleanParser( sValue )
 {
+if( typeof sValue !== 'string' )
+return undefined;
+
 sValue = sValue.toLowerCase();
 if( sValue === 'true' )
 return true;
@@ -7056,6 +7061,9 @@ function booleanParser( sValue )
 
 function colorParser( sValue )
 {
+if( typeof sValue !== 'string' )
+return undefined;
+
 // The following 3 color functions are used in evaluating sValue string
 // so don't remove them.
 
@@ -7989,6 +7997,7 @@ var ENUM_PROPERTY   = 2;
 var COLOR_PROPERTY  = 3;
 var STRING_PROPERTY = 4;
 var BOOL_PROPERTY   = 5;
+var TUPLE_NUMBER_PROPERTY   = 6;
 
 var aValueTypeOutMap = [ 'unknown', 'number', 'enum', 'color', 'string', 
'boolean' ];
 
@@ -8006,6 +8015,14 @@ var aAttributeMap =
 'get':  'getOpacity',
 'set':  'setOpacity'   
 },
 
+'scale':   {   'type':  TUPLE_NUMBER_PROPERTY,
+'get':  'getSize',
+'set':  'setSize'  
 },
+
+'translate':   {   'type':  TUPLE_NUMBER_PROPERTY,
+'get':  'getPos',
+'set':  'setPos'   
 },
+
 'rotate':   {   'type': NUMBER_PROPERTY,
 'get':  'getRotationAngle',
 'set':  'setRotationAngle' 
 },
@@ -11615,10 +11632,21 @@ AnimationTransformNode.prototype.createActivity = 
function()
 var aActivityParamSet = this.fillActivityParams();
 var aAnimation;
 
-aAnimation = createPropertyAnimation( this.getAttributeName(),
-  this.getAnimatedElement(),
-  this.aNodeContext.aSlideWidth,
-  this.aNodeContext.aSlideHeight );
+if( this.getAttributeName() === 'scale' || this.getAttributeName() === 
'translate' )
+{
+aAnimation = createPairPropertyAnimation( this.getAttributeName(),
+  this.getAnimatedElement(),
+  
this.aNodeContext.aSlideWidth,
+  
this.aNodeContext.aSlideHeight );
+
+}
+else
+{
+aAnimation = createPropertyAnimation( this.getAttributeName(),
+  this.getAnimatedElement(),
+  this.aNodeContext.aSlideWidth,
+  this.aNodeContext.aSlideHeight );
+}
 
 var aInterpolator = null;  // createActivity will compute it;
 return createActivity( aActivityParamSet, this, aAnimation, aInterpolator 
);
@@ -12049,6 +12077,41 @@ function createPropertyAnimation( sAttrName, 
aAnimatedElement, nWidth, nHeight )
 
 
 
+function createPairPropertyAnimation( sTransformType, aAnimatedElement, 
nWidth, nHeight )
+{
+var aFunctorSet = aAttributeMap[ sTransformType ];
+var sGetValueMethod = aFunctorSet.get;
+var sSetValueMethod = aFunctorSet.set;
+
+var aDefaultValue = [];
+var aSizeReference = [];
+if( sTransformType === 'scale' )
+{
+

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2022-05-25 Thread Marco Cecchetti (via logerrit)
 filter/source/svg/presentation_engine.js |   68 +++
 1 file changed, 61 insertions(+), 7 deletions(-)

New commits:
commit 41ba315f27f93ffae14e2071dafff79260994d7f
Author: Marco Cecchetti 
AuthorDate: Fri May 20 11:35:57 2022 +0200
Commit: Aron Budea 
CommitDate: Thu May 26 03:51:29 2022 +0200

svg filter: support for emphasis spin animation

Partial support for transform animations.
At present only rotate is supported.

Change-Id: If9ba69ec0b74bc3b527a963cb0c0bf3a7bfa5220
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134625
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index 0a8eb73e7c12..201aab2dcf8e 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -11574,6 +11574,59 @@ PropertyAnimationNode.prototype.createActivity = 
function()
 
 
 
+function isValidTransformation( sType )
+{
+return ( sType === 'translate' || sType === 'scale' || sType === 'rotate'
+  || sType === 'skewX' || sType === 'skewY' );
+}
+
+function AnimationTransformNode(  aAnimElem, aParentNode, aNodeContext )
+{
+AnimationTransformNode.superclass.constructor.call( this, aAnimElem, 
aParentNode, aNodeContext );
+
+this.sClassName = 'AnimationTransformNode';
+}
+extend( AnimationTransformNode, AnimationBaseNode3 );
+
+
+AnimationTransformNode.prototype.parseElement = function()
+{
+var bRet = AnimationTransformNode.superclass.parseElement.call(this);
+
+var aAnimElem = this.aElement;
+
+// transformation type
+var sTransformType = aAnimElem.getAttribute( 'svg:type' );
+if( !isValidTransformation( sTransformType ) )
+{
+this.eCurrentState = INVALID_NODE;
+log( 'AnimationTransformNode.parseElement: transformation type not 
found: ' + sTransformType );
+}
+else
+{
+this.sAttributeName = sTransformType;
+}
+
+return bRet;
+}
+
+AnimationTransformNode.prototype.createActivity = function()
+{
+var aActivityParamSet = this.fillActivityParams();
+var aAnimation;
+
+aAnimation = createPropertyAnimation( this.getAttributeName(),
+  this.getAnimatedElement(),
+  this.aNodeContext.aSlideWidth,
+  this.aNodeContext.aSlideHeight );
+
+var aInterpolator = null;  // createActivity will compute it;
+return createActivity( aActivityParamSet, this, aAnimation, aInterpolator 
);
+};
+
+
+
+
 function AnimationSetNode(  aAnimElem, aParentNode, aNodeContext )
 {
 AnimationSetNode.superclass.constructor.call( this, aAnimElem, 
aParentNode, aNodeContext );
@@ -11872,10 +11925,8 @@ function createAnimationNode( aElement, aParentNode, 
aNodeContext )
 aCreatedNode = new AnimationColorNode( aElement, aParentNode, 
aNodeContext );
 break;
 case ANIMATION_NODE_ANIMATETRANSFORM:
-//aCreatedNode = new AnimationTransformNode( aElement, 
aParentNode, aNodeContext );
-//break;
-log( 'createAnimationNode: ANIMATETRANSFORM not implemented' );
-return null;
+aCreatedNode = new AnimationTransformNode( aElement, aParentNode, 
aNodeContext );
+break;
 case ANIMATION_NODE_TRANSITIONFILTER:
 aCreatedNode = new AnimationTransitionFilterNode( aElement, 
aParentNode, aNodeContext );
 break;
@@ -17934,9 +17985,12 @@ function evalValuesAttribute( aValueList, aValueSet, 
aBBox, nSlideWidth, nSlideH
 for( var i = 0; i < aValueSet.length; ++i )
 {
 var sValue = aValueSet[i];
-sValue = sValue.replace(reMath, 'Math.$&');
-sValue = sValue.replace(/pi(?!\w)/g, 'Math.PI');
-sValue = sValue.replace(/e(?!\w)/g, 'Math.E');
+if(sValue)
+{
+sValue = sValue.replace(reMath, 'Math.$&');
+sValue = sValue.replace(/pi(?!\w)/g, 'Math.PI');
+sValue = sValue.replace(/e(?!\w)/g, 'Math.E');
+}
 var aValue =  eval( sValue );
 aValueList.push( aValue );
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2022-05-18 Thread Julien Nabet (via logerrit)
 filter/source/pdf/impdialog.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit b97666b3eea66855ecf0646f853ed83a91fe6bd8
Author: Julien Nabet 
AuthorDate: Sat May 14 13:28:06 2022 +0200
Commit: Aron Budea 
CommitDate: Wed May 18 14:54:13 2022 +0200

tdf#149072: fix export PDF with PDF/UA in GUI after Index language was set

Regression of a1f9fea520f5b3f5d54a284886aa531693f32e7a
Make accessibility check dialog async

First add of m_xDialog->response(RET_OK) fixes the bug
the second one is just here to have same behaviour as before the quoted 
patch

Change-Id: Ib24459e4e946b83172271a9097930e5977e676be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134311
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit 4d3a9d4ffec4bf9765f965d92c163c94201a3c9a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134497
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 8eda392710bd..cdeed9ed00da 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -329,6 +329,14 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, OkHdl, weld::Button&, 
void)
 m_xDialog->response(retValue);
 });
 }
+else
+{
+m_xDialog->response(RET_OK);
+}
+}
+else
+{
+m_xDialog->response(RET_OK);
 }
 }
 else


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2022-03-28 Thread Tor Lillqvist (via logerrit)
 filter/source/svg/presentation_engine.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 772ef157a20efd3243e6d05825a88d4cbd55b67a
Author: Tor Lillqvist 
AuthorDate: Mon Mar 28 14:51:43 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Mar 28 15:58:40 2022 +0200

Make slideshow touch gestures work again in the mobile apps

Need to s/lool/cool/ here, too.

Change-Id: Ib6762f196ca2b1c2e8735c6ff3e591164d34fb0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132202
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index 0babb0083cc8..0a8eb73e7c12 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -18622,8 +18622,8 @@ SlideShow.prototype.exitSlideShowInApp = function()
 {
 if (window.webkit !== undefined &&
 window.webkit.messageHandlers !== undefined &&
-window.webkit.messageHandlers.lool !== undefined)
-window.webkit.messageHandlers.lool.postMessage('EXITSLIDESHOW', '*');
+window.webkit.messageHandlers.cool !== undefined)
+window.webkit.messageHandlers.cool.postMessage('EXITSLIDESHOW', '*');
 }
 
 SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition )


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source include/svx svx/source sw/source

2022-02-23 Thread NickWingate (via logerrit)
 filter/source/pdf/impdialog.cxx|   48 ++---
 filter/source/pdf/impdialog.hxx|5 ++
 include/svx/AccessibilityCheckDialog.hxx   |1 
 svx/source/dialog/AccessibilityCheckDialog.cxx |   10 +
 sw/source/uibase/shells/basesh.cxx |4 +-
 5 files changed, 37 insertions(+), 31 deletions(-)

New commits:
commit 61fed0c4fe53738254d116543417f1c7028a0f39
Author: NickWingate 
AuthorDate: Wed Feb 23 14:11:49 2022 +
Commit: Mert Tumer 
CommitDate: Thu Feb 24 08:43:31 2022 +0100

Make accessibility check dialog async

Signed-off-by: NickWingate 
Change-Id: I88913b3d7e580a1d8c69a39454f2598e11ba43ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130438
Reviewed-by: Szymon Kłos 
Reviewed-by: Michael Meeks 
Reviewed-by: Mert Tumer 
Tested-by: Jenkins CollaboraOffice 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 31f712c47edf..8eda392710bd 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -271,6 +271,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, 
Sequence< PropertyValue
 GetOKButton().set_label(sOkButtonText);
 
 GetCancelButton().connect_clicked(LINK(this, ImpPDFTabDialog, CancelHdl));
+GetOKButton().connect_clicked(LINK(this, ImpPDFTabDialog, OkHdl));
 
 // remove the reset button, not needed in this tabbed dialog
 RemoveResetButton();
@@ -313,10 +314,37 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, CancelHdl, 
weld::Button&, void)
 m_xDialog->response(RET_CANCEL);
 }
 
+IMPL_LINK_NOARG(ImpPDFTabDialog, OkHdl, weld::Button&, void)
+{
+if (getGeneralPage()->IsPdfUaSelected())
+{
+SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc);
+if (pShell)
+{
+sfx::AccessibilityIssueCollection aCollection = 
pShell->runAccessibilityCheck();
+if (!aCollection.getIssues().empty())
+{
+mpAccessibilityCheckDialog = 
std::make_shared(mpParent, aCollection);
+weld::DialogController::runAsync(mpAccessibilityCheckDialog, 
[this](sal_Int32 retValue){
+m_xDialog->response(retValue);
+});
+}
+}
+}
+else
+{
+m_xDialog->response(RET_OK);
+}
+}
+
 ImpPDFTabDialog::~ImpPDFTabDialog()
 {
 maConfigItem.WriteModifiedConfig();
 maConfigI18N.WriteModifiedConfig();
+if (mpAccessibilityCheckDialog)
+{
+mpAccessibilityCheckDialog->response(RET_CANCEL);
+}
 }
 
 void ImpPDFTabDialog::PageCreated(const OString& rId, SfxTabPage& rPage)
@@ -345,26 +373,6 @@ void ImpPDFTabDialog::PageCreated(const OString& rId, 
SfxTabPage& rPage)
 }
 }
 
-short ImpPDFTabDialog::Ok( )
-{
-// here the whole mechanism of the base class is not used
-// when Ok is hit, the user means 'convert to PDF', so simply close with ok
-
-if (getGeneralPage()->IsPdfUaSelected())
-{
-SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc);
-if (pShell)
-{
-sfx::AccessibilityIssueCollection aCollection = 
pShell->runAccessibilityCheck();
-if (!aCollection.getIssues().empty())
-{
-svx::AccessibilityCheckDialog aDialog(mpParent, aCollection);
-return aDialog.run();
-}
-}
-}
-return RET_OK;
-}
 
 Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
 {
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 17fb57890655..c9d116ed2803 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_FILTER_SOURCE_PDF_IMPDIALOG_HXX
 
 #include 
+#include 
 
 #include 
 #include 
@@ -67,6 +68,7 @@ class ImpPDFTabDialog final : public SfxTabDialogController
 Any maSelection;
 
 DECL_LINK(CancelHdl, weld::Button&, void);
+DECL_LINK(OkHdl, weld::Button&, void);
 
 // the following data are the configuration used throughout the dialog and 
pages
 boolmbIsPresentation;
@@ -124,6 +126,8 @@ class ImpPDFTabDialog final : public SfxTabDialogController
 boolmbCanExtractForAccessibility;
 css::uno::Reference< css::beans::XMaterialHolder > mxPreparedPasswords;
 
+std::shared_ptr< svx::AccessibilityCheckDialog > 
mpAccessibilityCheckDialog;
+
 boolmbIsRangeChecked;
 OUStringmsPageRange;
 boolmbSelectionIsChecked;
@@ -164,7 +168,6 @@ public:
 
 private:
 virtual voidPageCreated(const OString& rId, SfxTabPage& 
rPage) override;
-virtual short   Ok() override;
 };
 
 
diff --git a/include/svx/AccessibilityCheckDialog.hxx 
b/include/svx/AccessibilityCheckDialog.hxx
index 5227cbee2699..e3e1e201f227 100644

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2022-02-15 Thread Marco Cecchetti (via logerrit)
 filter/source/svg/svgwriter.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 5eec28d86a5953de3aa0d5f0c424e92334860270
Author: Marco Cecchetti 
AuthorDate: Mon Feb 14 15:53:08 2022 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Feb 15 16:27:14 2022 +0100

svg filter: google chrome doesn't render white spaces correctly

In Google Chrome white spaces at the beginning of a text line are not
rendered at all.

Change-Id: Idd3b1bc5a383b21a54cc1629173bbe26a6da83bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129918
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index a336b825120a..4da018fa8f9b 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1799,6 +1799,9 @@ void SVGTextWriter::implWriteTextPortion( const Point& 
rPos,
 }
 else
 {
+// Without the following attribute Google Chrome does not render 
leading spaces
+mrExport.AddAttribute( XML_NAMESPACE_NONE, "style", "white-space: pre" 
);
+
 SvXMLElementExport aSVGTspanElem( mrExport, XML_NAMESPACE_NONE, 
aXMLElemTspan, mbIWS, mbIWS );
 mrExport.GetDocHandler()->characters( rText );
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2022-02-07 Thread Stephan Bergmann (via logerrit)
 filter/source/svg/svgwriter.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f492602552a3f70cecf3b323898cf038d6f8ef38
Author: Stephan Bergmann 
AuthorDate: Sun Feb 6 18:36:12 2022 +0100
Commit: Szymon Kłos 
CommitDate: Mon Feb 7 10:42:47 2022 +0100

Missing initialization of SVGActionWriter::mbIsPreview

...introduced with f609a16a52f1ac37f1edd297cf1d9e5f2a294724 "lok: render 
image
preview with lower resolution",

> /filter/source/svg/svgwriter.cxx:2949:9: runtime error: load of value 
190, which is not a valid value for type 'bool'
> #0 0x2b2ee3c573d5 in SVGActionWriter::ImplWriteBmp(BitmapEx const&, 
Point const&, Size const&, Point const&, Size const&, 
com::sun::star::uno::Reference const*) 
/filter/source/svg/svgwriter.cxx:2949:9
> #1 0x2b2ee3c3b670 in SVGActionWriter::ImplWriteActions(GDIMetaFile 
const&, unsigned int, rtl::OUString const&, 
com::sun::star::uno::Reference const*, 
GDIMetaFile const*) /filter/source/svg/svgwriter.cxx:3782:25
> #2 0x2b2ee3c5b3a8 in SVGActionWriter::WriteMetaFile(Point const&, 
Size const&, GDIMetaFile const&, unsigned int, rtl::OUString const&, 
com::sun::star::uno::Reference const*, 
GDIMetaFile const*) /filter/source/svg/svgwriter.cxx:4015:5
> #3 0x2b2ee3a86ae2 in 
SVGFilter::implExportShape(com::sun::star::uno::Reference
 const&, bool) /filter/source/svg/svgexport.cxx:2227:42
> #4 0x2b2ee3a7e1e2 in 
SVGFilter::implExportShapes(com::sun::star::uno::Reference
 const&, bool) /filter/source/svg/svgexport.cxx:2050:20

during CppunitTest_sd_svg_export_tests
()

Change-Id: Ied5a2cc8599466949f57caae05f9fb90c92266b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129582
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129586
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 9677c9e092fd..a336b825120a 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1821,7 +1821,8 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, 
SVGFontExport& rFontExport
 mpVDev(VclPtr::Create()),
 mbClipAttrChanged( false ),
 mbIsPlaceholderShape( false ),
-mpEmbeddedBitmapsMap( nullptr )
+mpEmbeddedBitmapsMap( nullptr ),
+mbIsPreview( false )
 {
 mpVDev->EnableOutput( false );
 maTargetMapMode = MapMode(MapUnit::Map100thMM);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source include/oox oox/source

2022-02-01 Thread Tomaž Vajngerl (via logerrit)
 filter/source/msfilter/msvbahelper.cxx |   13 ++---
 include/oox/ole/vbamodule.hxx  |   13 +++--
 oox/source/ole/vbamodule.cxx   |   29 +++--
 3 files changed, 36 insertions(+), 19 deletions(-)

New commits:
commit a9a9fc732246a38f0e4e59c7eac3f6243c748af4
Author: Tomaž Vajngerl 
AuthorDate: Mon Jan 31 15:35:38 2022 +0900
Commit: Miklos Vajna 
CommitDate: Tue Feb 1 11:24:46 2022 +0100

vba: fix registering shortcuts keys defined by the vba macros

On issue with registering was that the registering happened when
the macro source was in the process to be read into the library,
which is just a bit too early, because the macro wasn't found and
not registered.
Another issue was with searching for the macro method (hasMacro),
which doesn't search the same when the module name is known and
when it isn't. This was changed so we just iterate through the
modules and call the same "FindMethod" method without any extra
restrictions.

Change-Id: I2f4f2f6d8186b289867456ebdccad27ce8eee231
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129197
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/filter/source/msfilter/msvbahelper.cxx 
b/filter/source/msfilter/msvbahelper.cxx
index 1d1c877c652c..662e001d8683 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -200,18 +200,17 @@ static bool hasMacro( SfxObjectShell const * pShell, 
const OUString& sLibrary, O
 SbModule* pModule = pBasic->FindModule( sMod );
 if ( pModule && pModule->FindMethod( sMacro, 
SbxClassType::Method ))
 {
-bFound = true;
+return true;
 }
 }
-else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( 
pBasic->Find( sMacro, SbxClassType::Method ) ) )
+else
 {
-if( SbModule* pModule = pMethod->GetModule() )
+for (auto const& rModuleRef : pBasic->GetModules())
 {
-// when searching for a macro without module name, do 
not search in class/document/form modules
-if( pModule->GetModuleType() == 
script::ModuleType::NORMAL )
+if (rModuleRef && rModuleRef->FindMethod(sMacro, 
SbxClassType::Method))
 {
-sMod = pModule->GetName();
-bFound = true;
+sMod = rModuleRef->GetName();
+return true;
 }
 }
 }
diff --git a/include/oox/ole/vbamodule.hxx b/include/oox/ole/vbamodule.hxx
index 85f1f3e37103..70c522b50025 100644
--- a/include/oox/ole/vbamodule.hxx
+++ b/include/oox/ole/vbamodule.hxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star {
 namespace container { class XNameAccess; }
@@ -39,6 +40,11 @@ namespace oox {
 
 namespace oox::ole {
 
+struct VbaKeyBinding
+{
+OUString msApiKey;
+OUString msMethodName;
+};
 
 class VbaModule
 {
@@ -67,15 +73,17 @@ public:
 voidcreateAndImportModule(
 StorageBase& rVbaStrg,
 const css::uno::Reference< 
css::container::XNameContainer >& rxBasicLib,
-const css::uno::Reference< 
css::container::XNameAccess >& rxDocObjectNA ) const;
+const css::uno::Reference< 
css::container::XNameAccess >& rxDocObjectNA );
 /** Creates an empty Basic module in the passed Basic library. */
 voidcreateEmptyModule(
 const css::uno::Reference< 
css::container::XNameContainer >& rxBasicLib,
 const css::uno::Reference< 
css::container::XNameAccess >& rxDocObjectNA ) const;
 
+void registerShortcutKeys();
+
 private:
 /** Reads and returns the VBA source code from the passed storage. */
-OUString readSourceCode( StorageBase& rVbaStrg ) const;
+OUString readSourceCode( StorageBase& rVbaStrg );
 
 /** Creates a new Basic module and inserts it into the passed Basic 
library. */
 voidcreateModule(
@@ -97,6 +105,7 @@ private:
 boolmbReadOnly;
 boolmbPrivate;
 boolmbExecutable;
+std::vector maKeyBindings;
 };
 
 
diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx
index 7e913124730b..5b055b52f745 100644
--- a/oox/source/ole/vbamodule.cxx
+++ b/oox/source/ole/vbamodule.cxx
@@ -127,10 +127,26 @@ void VbaModule::importDirRecords( BinaryInputStream& 
rDirStrm )
 
 void VbaModule::createAndImportModule( StorageBase& rVbaStrg,
   

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2022-01-05 Thread Szymon Kłos (via logerrit)
 filter/source/textfilterdetect/filterdetect.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit d9a4e323555d01202dd15e71a3a32294bfd568cc
Author: Szymon Kłos 
AuthorDate: Wed Jan 5 17:29:49 2022 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 6 08:29:58 2022 +0100

Open empty (0 bytes) ods as spreadsheet

Before this patch we opened it with Writer UI because
we didn't detect any filter with PREFFERED annotation

Change-Id: I6262fb695b5fe20a377120f298f144e2cafbadc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128015
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/filter/source/textfilterdetect/filterdetect.cxx 
b/filter/source/textfilterdetect/filterdetect.cxx
index 915020aa117c..0c00abf28e87 100644
--- a/filter/source/textfilterdetect/filterdetect.cxx
+++ b/filter/source/textfilterdetect/filterdetect.cxx
@@ -155,7 +155,12 @@ bool HandleEmptyFileUrlByExtension(MediaDescriptor& 
rMediaDesc, const OUString&
 std::shared_ptr 
pFilter(SfxFilterMatcher().GetFilter4Extension(rExt, nMust));
 if (!pFilter)
 {
-return false;
+// retry without PREFFERED so we can find at least something for 
0-byte *.ods
+nMust = SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT;
+pFilter = SfxFilterMatcher().GetFilter4Extension(rExt, nMust);
+
+if (!pFilter)
+return false;
 }
 
 rMediaDesc[MediaDescriptor::PROP_FILTERNAME()] <<= 
pFilter->GetFilterName();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2021-10-14 Thread Jan Holesovsky (via logerrit)
 filter/source/config/fragments/types/writer_T602_Document.xcu |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bc714f2401d0f912c6cc38abc0bc21f36202b1c6
Author: Jan Holesovsky 
AuthorDate: Thu Oct 7 15:12:18 2021 +0200
Commit: Miklos Vajna 
CommitDate: Thu Oct 14 14:59:52 2021 +0200

T602 is an obsolete format, don't assume .txt files are T602

Without this, when the user tries to open a 0-bytes .txt file, they are
asked for a Save As operation after they hit the Save button.

When we remove the 'txt' from the T602 detection, it rather asks if the
user wants to use ODT or Plain text (and lose formatting).

Change-Id: Ic48fa61064a9ed78c64d56bc8864f0e12528e072
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123216
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 
(cherry picked from commit d602c433a08c6df28198ceb61b95f5c6d85d1a87)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123402
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/filter/source/config/fragments/types/writer_T602_Document.xcu 
b/filter/source/config/fragments/types/writer_T602_Document.xcu
index c34f823da4ca..e9b3df39cf33 100644
--- a/filter/source/config/fragments/types/writer_T602_Document.xcu
+++ b/filter/source/config/fragments/types/writer_T602_Document.xcu
@@ -18,7 +18,7 @@
 
 com.sun.star.comp.Writer.T602ImportFilter
 
-602 txt
+602
 application/x-t602
 true
 T602Document


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source sd/qa

2021-07-15 Thread Mike Kaganski (via logerrit)
 filter/source/msfilter/msdffimp.cxx|3 +
 sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt |binary
 sd/qa/unit/export-tests-ooxml2.cxx |   26 +
 3 files changed, 29 insertions(+)

New commits:
commit 6c411afae7f6cd9819c1b65d7b4212019a7b3cfe
Author: Mike Kaganski 
AuthorDate: Thu Jul 15 01:14:15 2021 +0300
Commit: Miklos Vajna 
CommitDate: Thu Jul 15 08:58:21 2021 +0200

tdf#143315: restore the stylesheet after clearing outliner object

Prior to commit c4f615b359be56e88e4fbf9aaaf30affb29d57e2, pObj passed
to SvxMSDffManager::ReadObjText was not initializing its properties
(no call to AttributeProperties::GetObjectItemSet() happened) until
call to CreateParaObject in the end of the function. Then it finally
initialized, and called applyDefaultStyleSheetFromSdrModel, which
applied the obtained stylesheet to the nodes of the outliner object,
and resulted in OutlinerParaObject having correct style name in its
ContentInfo structures, which then went into pObj.

The mentioned commit added calls to SdrTextObj::GetTextColumns* in
SdrOutliner::SetTextObj, called by SdrTextObj::ImpGetDrawOutliner
indirectly. These calls initialize the object properties, and the
stylesheet gets applied to the SdrOutliner and its empty node early.
Then the call to Outliner::Init and Outliner::Clear resulted in the
node being destroyed and re-created without stylesheet info. Then in
AttributeProperties::GetObjectItemSet called from CreateParaObject,
re-initialization does not happen, because the item set exists.

When exporting to OOXML, the missing stylesheet required to use pool
default value, which led to bullet being exported.

The previous behavior relied on fragile and unspecified assumption.
Instead, now we call SetStyleSheet after all operations, to make sure
that the stylesheet information is present in the final data.

Change-Id: I14de9017e4af92a2eaf12b3a0e090b0db7fcc759
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118961
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118963
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index e2f5b2eac0a4..d4617e652791 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3662,6 +3662,9 @@ void SvxMSDffManager::ReadObjText( const OUString& rText, 
SdrObject* pObj )
 rOutliner.Clear();
 rOutliner.SetUpdateMode( bOldUpdateMode );
 pText->SetOutlinerParaObject( std::move(pNewText) );
+// tdf#143315: restore stylesheet applied to Outliner's nodes when 
SdrTextObj initializes
+// its attributes, but removed by Outliner::Init, which calls 
Outliner::Clear.
+pText->SetStyleSheet(pText->GetStyleSheet(), true);
 }
 
 //static
diff --git a/sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt 
b/sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt
new file mode 100644
index ..54111bb28a7a
Binary files /dev/null and 
b/sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index b80078fe7844..759fa8e203e5 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -215,6 +215,7 @@ public:
 void testTextColumns_3columns();
 void testTdf59323_slideFooters();
 void testTdf143222_embeddedWorksheet();
+void testTdf143315();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -342,6 +343,7 @@ public:
 CPPUNIT_TEST(testTextColumns_3columns);
 CPPUNIT_TEST(testTdf59323_slideFooters);
 CPPUNIT_TEST(testTdf143222_embeddedWorksheet);
+CPPUNIT_TEST(testTdf143315);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -3319,6 +3321,30 @@ void 
SdOOXMLExportTest2::testTdf143222_embeddedWorksheet()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf143315()
+{
+auto xDocShRef = loadURL(
+
m_directories.getURLFromSrc(u"sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt"),
+PPT);
+
+utl::TempFile tmpfile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, );
+xDocShRef->DoClose();
+
+xmlDocUniquePtr pXml = parseExport(tmpfile, "ppt/slides/slide1.xml");
+
+// Without the fix in place, whis would have failed with
+// - Expected:
+// - Actual  : 216000
+// - In , XPath 
'/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr' unexpected 'marL' attribute
+
+assertXPathNoAttribute(pXml, 
"/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr", "marL");
+assertXPathNoAttribute(pXml, 
"/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr", "indent");
+assertXPath(pXml, 
"/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr/a:buClr", 0);
+assertXPath(pXml, 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source

2021-05-10 Thread Mike Kaganski (via logerrit)
 filter/source/textfilterdetect/filterdetect.cxx |   18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

New commits:
commit db759800abb62a9abda39c16d6f529d1a76207b6
Author: Mike Kaganski 
AuthorDate: Mon May 3 17:04:04 2021 +0200
Commit: Mike Kaganski 
CommitDate: Tue May 11 07:18:15 2021 +0200

tdf#123476: also use filter by extension when its service is the same

... as passed explicitly in the media descriptor, for 0-byte files.
This makes proper handling for such files when passing module name
in command line, like --writer for DOCX.

Change-Id: If8fd51e65dcf8a67b2653026f5fc1d5c964074af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114924
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit dff586735b6618d9b011823594a33287d8f7f223)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114925
Reviewed-by: Caolán McNamara 
(cherry picked from commit a8e84a2d6e634c03d62e17bcc1b617238dcc9eb1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115278
Tested-by: Jenkins CollaboraOffice 

diff --git a/filter/source/textfilterdetect/filterdetect.cxx 
b/filter/source/textfilterdetect/filterdetect.cxx
index 09efe5e595e0..19696ec9fa17 100644
--- a/filter/source/textfilterdetect/filterdetect.cxx
+++ b/filter/source/textfilterdetect/filterdetect.cxx
@@ -135,7 +135,7 @@ bool IsHTMLStream( const uno::Reference& 
xInStream )
  * writes the type name to rType, the filter name to rMediaDesc.
  */
 bool HandleEmptyFileUrlByExtension(MediaDescriptor& rMediaDesc, const 
OUString& rExt,
-   OUString& rType)
+   OUString& rType, OUString& rService)
 {
 OUString aURL = 
rMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), OUString());
 if (!tools::isEmptyFileUrl(aURL))
@@ -156,6 +156,7 @@ bool HandleEmptyFileUrlByExtension(MediaDescriptor& 
rMediaDesc, const OUString&
 
 rMediaDesc[MediaDescriptor::PROP_FILTERNAME()] <<= 
pFilter->GetFilterName();
 rType = pFilter->GetTypeName();
+rService = pFilter->GetServiceName();
 return true;
 }
 }
@@ -216,14 +217,25 @@ OUString SAL_CALL 
PlainTextFilterDetect::detect(uno::Sequencehttps://lists.freedesktop.org/mailman/listinfo/libreoffice-commits