diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2021-01-12 15:29:44 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-03-31 10:39:34 +0200 |
commit | 8df59790b8cb921756ef3c59d7d9ef38b7c76d7f (patch) | |
tree | dd9bae1d0cd9cee72330e62931952b0d5a45f1df /filter | |
parent | 9a7bd68d8b42fae731d8826a461954b81bf9139b (diff) |
filter: svg: when date/time field is edited directly in mp, is not shown
If a date/time or footer text field in the master page is editede
directly instead of being filled through the header/footer dialog, is
not displayed by the js engine.
Change-Id: I4a8aa3a6b5e9931ea0b997d611ce54e8481dbbcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109175
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109869
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/svg/presentation_engine.js | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index ce68bc6484fe..848f2dd84226 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -5570,9 +5570,9 @@ PlaceholderShape.prototype.init = function() } } } - this.element = aTextFieldElement; this.textElement = aPlaceholderElement; } + this.element = aTextFieldElement; } }; @@ -5783,9 +5783,10 @@ MasterPageView.prototype.initTextFieldHandler = function( sClassName, aPlaceholderShapeSet, aTextFieldContentProviderSet, aDefsElement, aTextFieldHandlerSet, sMasterSlideId ) { + var sRefId = null; var aTextFieldHandler = null; - if( aPlaceholderShapeSet[sClassName] && - aPlaceholderShapeSet[sClassName].isValid() + var aPlaceholderShape = aPlaceholderShapeSet[sClassName]; + if( aPlaceholderShape && aPlaceholderShape.isValid() && aTextFieldContentProviderSet[sClassName] ) { var sTextFieldContentProviderId = aTextFieldContentProviderSet[sClassName].sId; @@ -5794,7 +5795,7 @@ MasterPageView.prototype.initTextFieldHandler = if ( !aTextFieldHandlerSet[ sMasterSlideId ][ sTextFieldContentProviderId ] ) { aTextFieldHandlerSet[ sMasterSlideId ][ sTextFieldContentProviderId ] = - new TextFieldHandler( aPlaceholderShapeSet[sClassName], + new TextFieldHandler( aPlaceholderShape, aTextFieldContentProviderSet[sClassName] ); aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ sTextFieldContentProviderId ]; aTextFieldHandler.update(); @@ -5804,13 +5805,22 @@ MasterPageView.prototype.initTextFieldHandler = { aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ sTextFieldContentProviderId ]; } + sRefId = aTextFieldHandler.sId; + } + else if( aPlaceholderShape && aPlaceholderShape.element && aPlaceholderShape.element.firstElementChild + && !aPlaceholderShape.textElement && !aTextFieldContentProviderSet[sClassName] ) + { + sRefId = aPlaceholderShape.element.firstElementChild.getAttribute('id'); + } + if( sRefId ) + { // We create a <use> element referring to the cloned text field and // append it to the field group element. - var aTextFieldElement = document.createElementNS( NSS['svg'], 'use' ); - aTextFieldElement.setAttribute( 'class', sClassName ); - setNSAttribute( 'xlink', aTextFieldElement, - 'href', '#' + aTextFieldHandler.sId ); + var aTextFieldElement = document.createElementNS(NSS['svg'], 'use'); + aTextFieldElement.setAttribute('class', sClassName); + setNSAttribute('xlink', aTextFieldElement, + 'href', '#' + sRefId); // node linking this.aBackgroundObjectsElement.appendChild( aTextFieldElement ); } |