Commit 333cddeb by Edgar HIPP

Use <w:p> or <w:t> even when image is empty

parent 5d43fd3d
...@@ -47,8 +47,15 @@ class ImageModule ...@@ -47,8 +47,15 @@ class ImageModule
imgData=scopeManager.getValueFromScope(tag) imgData=scopeManager.getValueFromScope(tag)
tagXml=@manager.getInstance('xmlTemplater').tagXml tagXml=@manager.getInstance('xmlTemplater').tagXml
tagXmlParagraph = tagXml.substr(0,1)+':p'
if @options.centered==false
outsideElement=tagXml
if @options.centered==true
outsideElement=tagXmlParagraph
startEnd= "<#{tagXml}></#{tagXml}>" startEnd= "<#{tagXml}></#{tagXml}>"
if imgData=='undefined' then return @replaceBy(startEnd,tagXml) if !imgData? or imgData=='undefined' then return @replaceBy(startEnd,outsideElement)
try try
imgBuffer=@getImageFromData(imgData) imgBuffer=@getImageFromData(imgData)
catch e catch e
...@@ -61,10 +68,8 @@ class ImageModule ...@@ -61,10 +68,8 @@ class ImageModule
size=[@convertPixelsToEmus(sizePixel[0]),@convertPixelsToEmus(sizePixel[1])] size=[@convertPixelsToEmus(sizePixel[0]),@convertPixelsToEmus(sizePixel[1])]
if @options.centered==false if @options.centered==false
outsideElement=tagXml
newText=@getImageXml(rId,size) newText=@getImageXml(rId,size)
if @options.centered==true if @options.centered==true
outsideElement=tagXml.substr(0,1)+':p'
newText=@getImageXmlCentered(rId,size) newText=@getImageXmlCentered(rId,size)
@replaceBy(newText,outsideElement) @replaceBy(newText,outsideElement)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment