Commit 41ea55c4 by Edgar Hipp

using xmlTemplater.tagxml instead of constants that match 'w:t' (for

future powerpoint compatibility)
parent 11ad3d7a
...@@ -42,11 +42,13 @@ class ImageModule ...@@ -42,11 +42,13 @@ class ImageModule
tag = templaterState.textInsideTag.substr(1) tag = templaterState.textInsideTag.substr(1)
imgData=scopeManager.getValueFromScope(tag) imgData=scopeManager.getValueFromScope(tag)
if imgData=='undefined' then return @replaceBy('<w:t></w:t>','w:t') tagXml=@manager.getInstance('xmlTemplater').tagXml
startEnd= "<#{tagXml}></#{tagXml}>"
if imgData=='undefined' then return @replaceBy(startEnd,tagXml)
try try
imgBuffer=@getImageFromData(imgData) imgBuffer=@getImageFromData(imgData)
catch e catch e
return @replaceBy('<w:t></w:t>','w:t') return @replaceBy(startEnd,tagXml)
rId=@imgManager rId=@imgManager
.loadImageRels() .loadImageRels()
.addImageRels(@getNextImageName(),imgBuffer) .addImageRels(@getNextImageName(),imgBuffer)
...@@ -55,10 +57,10 @@ class ImageModule ...@@ -55,10 +57,10 @@ 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='w:t' outsideElement=tagXml
newText=@getImageXml(rId,size) newText=@getImageXml(rId,size)
if @options.centered==true if @options.centered==true
outsideElement='w:p' 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