summaryrefslogtreecommitdiff
path: root/userguides/sanitycheck/SanityCheck/Imagenes.xba
diff options
context:
space:
mode:
Diffstat (limited to 'userguides/sanitycheck/SanityCheck/Imagenes.xba')
-rw-r--r--userguides/sanitycheck/SanityCheck/Imagenes.xba550
1 files changed, 550 insertions, 0 deletions
diff --git a/userguides/sanitycheck/SanityCheck/Imagenes.xba b/userguides/sanitycheck/SanityCheck/Imagenes.xba
new file mode 100644
index 00000000..cc48cb0b
--- /dev/null
+++ b/userguides/sanitycheck/SanityCheck/Imagenes.xba
@@ -0,0 +1,550 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Imagenes" script:language="StarBasic" script:moduleType="normal">REM ***** BASIC Módulo Imagenes *****
+ Option Explicit
+
+ Const Extension as string = &quot;Revisiones v 1.0.0&quot;
+ Global oImgs as Object
+ Global oImg as Object
+ Global vCursor as Object &apos; CursorVisible
+ Dim oDlgImgs as Object
+ Global Dlg_Activo as Boolean &apos;dlg No modal evita ejecuciones múltiples
+ Global Dlg_Mostrado as Boolean &apos; dlg No modal para cerrar el diálogo
+ Global Indice_Img as Integer
+ Dim Ultima_Img as integer
+ Public oProgressBar
+ Dim PBcounter as Integer
+
+ Rem ############
+ Sub DlgImagenes
+Msgbox &quot;Comprobar renombrado de imágenes&quot;
+ Call L10n.Trad_Imagenes
+ If Thiscomponent.HasLocation = false then : Msgbox (I_Txt(34),0+48+0, Extension) : Exit Sub : End If
+ If Imagenes.F_Prueba_Sel = 0 Then : Exit Sub : End If
+ oImgs = ThisComponent.GraphicObjects()
+ Ultima_Img = oImgs.getCount -1
+ If Ultima_Img &lt; 0 Then : Msgbox (I_Txt(39), 0+48+0,Extension) : Exit Sub : End If
+ Indice_Img = 0
+ oImg = oImgs.getbyIndex(Indice_Img)
+ vCursor = Thiscomponent.CurrentController.getViewCursor()
+ vCursor.gotoStart(False)
+ If Dlg_Activo = False then
+ Dlg_Activo = True
+ Dlg_Mostrado = True
+ DialogLibraries.loadLibrary(&quot;SanityCheck&quot;)
+ oDlgImgs = CreateUnoDialog(DialogLibraries.getByName(&quot;SanityCheck&quot;).getByName(&quot;DlgImagenes&quot;))
+ With oDlgImgs.Model()
+ .TiTle = I_Txt(0): .PositionX = 530: .PositionY = 60: .Step = 1
+ .GetByName(&quot;Btn_Img_Name&quot;).Label = I_Txt(1)
+ .GetByName(&quot;Btn_Ancla&quot;).Label = I_Txt(2)
+ .GetByName(&quot;Btn_Desc_Marco&quot;).Label = I_Txt(1)
+ .GetByName(&quot;Btn_Editar&quot;).Label = I_Txt(3)
+ .GetByName(&quot;Btn_De_Marco&quot;).Label = I_Txt(4)
+ .GetByName(&quot;Btn_Recorte&quot;).Label = I_Txt(5)
+ .GetByName(&quot;Btn_Anterior&quot;).Label = I_Txt(6)
+ .GetByName(&quot;Btn_Siguiente&quot;).Label = I_Txt(7)
+ .GetByName(&quot;Btn_Salir&quot;).Label = I_Txt(8)
+ .GetByName(&quot;Fr_Marco&quot;).Label = I_Txt(10)
+ .GetByName(&quot;Fr_Desc&quot;).Label = I_Txt(11)
+ .GetByName(&quot;Lbl_Anclaje&quot;).Label = I_Txt(12)
+ .GetByName(&quot;Tx_Ayuda&quot;).Text = I_Txt(9)
+ End With
+ Call Imagenes.Cargar_Parametros
+ Do While Dlg_Mostrado = True
+ Wait 200
+ oDlgImgs.SetVisible(True)
+ Loop
+ oDlgImgs.dispose
+ Dlg_Activo= False
+ End If
+end sub
+
+ Rem ############
+Sub Cargar_Parametros
+
+&apos; Call L10n.Trad_Imagenes
+ If not Dlg_Mostrado then : Msgbox I_Txt(33),0+48+0, Extension : exit sub: end if
+ If Imagenes.F_Prueba_Sel = 0 Then : Exit Sub : End If
+ If Ultima_Img &lt; 0 Then : Dlg_Mostrado = False : Msgbox (I_Txt(35),0+48+0, Extension) : Exit Sub : End If &apos;si se borran todas las imágenes
+ Ultima_Img = oImgs.getCount -1
+ oImg = oImgs.getbyIndex(Indice_Img)
+ vCursor.gotoRange(oImg.Anchor,False)
+
+ WITH oDlgImgs.getModel
+ Dim Img_ancla As String , Recorte as String
+ Select case oImg.Anchortype
+ Case 0 : Img_Ancla = I_Txt(13)
+ Case 1 : Img_Ancla = I_Txt(14)
+ Case 2 : Img_Ancla = I_Txt(15)
+ Case 3 : Img_Ancla = I_Txt(16)
+ Case 4 : Img_Ancla = I_Txt(17)
+ End select
+ Dim secuencia
+ If not isempty(oImg.Anchor.TextFrame) Then
+ secuencia = split(oImg.Anchor.getText.string,&quot;: &quot;, 2)(0)
+ Else
+ secuencia = I_Txt(26)
+ End if
+ .getByName(&quot;Fr_Img&quot;).label = I_Txt(18) &amp; Indice_Img +1 &amp; &quot; / &quot; &amp; Ultima_Img + 1 &amp; &quot; (&quot; &amp; secuencia &amp; &quot;)&quot;&apos;oImg.Anchor.gettext().String
+ .getByName(&quot;Tx_Nombre_Img&quot;).text = oImg.Name
+ .getByName(&quot;Tx_Desc_Img&quot;).TextColor = RGB(0,0,0) &apos; RESET
+ .getByName(&quot;Tx_Desc_Marco&quot;).TextColor = RGB(0,0,0) &apos; RESET
+&apos; .getByName(&quot;Btn_Leyendas&quot;).EnableVisible = False &apos; RESET
+ If Indice_Img = 0 then
+ .getByName(&quot;Btn_Anterior&quot;).EnableVisible = False
+ .getByName(&quot;Btn_Siguiente&quot;).EnableVisible = True
+ with .getByName(&quot;Lbl_Ultima&quot;)
+ .EnableVisible = True : .label = I_Txt(19) : .PositionX = 70 : .PositionY = 157
+ End with
+ ElseIf Indice_Img = Ultima_Img then
+ .getByName(&quot;Btn_Siguiente&quot;).EnableVisible = False
+ .getByName(&quot;Btn_Anterior&quot;).EnableVisible = True
+ .getByName(&quot;Btn_Salir&quot;).state = 1
+ with .getByName(&quot;Lbl_Ultima&quot;)
+ .EnableVisible = True : .label = I_Txt(21) : .PositionX = 128 : .PositionY = 157
+ end With
+ Else
+ .getByName(&quot;Lbl_Ultima&quot;).EnableVisible = False
+ .getByName(&quot;Btn_Siguiente&quot;).EnableVisible = True
+ .getByName(&quot;Btn_Anterior&quot;).EnableVisible = True
+ .getByName(&quot;Btn_Salir&quot;).state = 0
+ End If
+ If oImg.AnchorType &lt;&gt; 1 then
+ .getByName(&quot;Lbl_Ancla&quot;).TextColor = RGB(200,0,0)
+ .getByName(&quot;Lbl_Ancla&quot;).label = Img_Ancla
+ .getByName(&quot;Btn_Ancla&quot;).Enabled = True
+ Else
+ .getByName(&quot;Lbl_Ancla&quot;).TextColor = RGB(0,120,0)
+ .getByName(&quot;Lbl_Ancla&quot;).label = Img_Ancla
+ .getByName(&quot;Btn_Ancla&quot;).Enabled = False
+ End If
+ Dim DescMarco As string
+ If not isempty(oImg.Anchor.TextFrame()) then
+ DescMarco = oImg.Anchor.TextFrame().Description
+ Else
+ DescMarco = &quot;&quot;
+ End if
+ Dim oRec : oRec = oImg.GraphicCrop()
+ If oRec.Right + oRec.Left + oRec.Top + oRec.Bottom &lt;&gt; 0 then
+ .getByName(&quot;Btn_Recorte&quot;).EnableVisible = True
+ .getByName(&quot;Lbl_Recorte&quot;).TextColor = RGB(200,0,0)
+ .getByName(&quot;Lbl_Recorte&quot;).label = I_Txt(22)
+ Else
+ .getByName(&quot;Btn_Recorte&quot;).EnableVisible = False
+ .getByName(&quot;Lbl_Recorte&quot;).TextColor = RGB(0,120,0)
+ .getByName(&quot;Lbl_Recorte&quot;).label = I_Txt(23)
+ End if
+ Dim Aspecto as String, Escala as String
+ Aspecto = Format(oImg.ActualSize.Width / oImg.ActualSize.Height, &quot;###00.0&quot;)
+ Escala = Format(oImg.Width / oImg.Height, &quot;###00.0&quot;)
+ If Aspecto &lt;&gt; Escala then
+ .getbyName(&quot;Lbl_Escala&quot;).label= I_Txt(24)
+ .getByName(&quot;Lbl_Escala&quot;).TextColor = RGB(200,0,0)
+ Else
+ .getbyName(&quot;Lbl_Escala&quot;).label = I_Txt(25)
+ .getByName(&quot;Lbl_Escala&quot;).TextColor = RGB(0,120,0)
+ End if
+ If isEmpty(oImg.Anchor.TextFrame()) then
+ .getByName(&quot;Tx_Desc_Marco&quot;).Enabled = False
+ .getByName(&quot;Tx_Desc_Marco&quot;).Text = I_Txt(26)
+ .getByName(&quot;Tx_Desc_Img&quot;).Text = oImg.Description
+ .getByName(&quot;Btn_Desc_Marco&quot;).Enabled = False
+ .getByName(&quot;Btn_De_Marco&quot;).Enabled =False
+ ElseIf Not isEmpty(oImg.Anchor.TextFrame()) then
+ .getByName(&quot;Tx_Desc_Marco&quot;).Enabled = True
+ .getByName(&quot;Btn_Desc_Marco&quot;).Enabled = True
+ .getByName(&quot;Btn_De_Marco&quot;).Enabled = True
+ .getByName(&quot;Tx_Desc_Marco&quot;).Text = &quot;&quot; &apos; RESET
+ .getByName(&quot;Tx_Desc_Img&quot;).Text = oImg.Description
+ .getByName(&quot;Tx_Desc_Marco&quot;).Text = oImg.Anchor.TextFrame.Description
+ End If
+ END WITH
+End Sub
+
+ Rem ############
+sub OnBtn_Anterior(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ If oImgs.getCount -1 &lt;&gt; Ultima_Img Then
+ Ultima_Img = oImgs.getCount -1
+ Msgbox (I_Txt(27), 0+64+0, Extension)
+ Indice_Img = 0
+ ElseIf Not Indice_Img &lt; 0 then
+ Indice_Img = Indice_Img -1
+ End If
+ Call Imagenes.Cargar_Parametros
+end sub
+
+ Rem ############
+Sub OnBtn_Siguiente(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ If oImgs.getCount -1 &lt;&gt; Ultima_Img Then
+ Ultima_Img = oImgs.getCount -1
+ Indice_Img = 0
+ Msgbox (I_Txt(27), 0+64+0, Extension)
+ ElseIf Indice_Img &lt; Ultima_Img Then
+ Indice_Img = Indice_Img + 1
+ End if
+ Call Imagenes.Cargar_Parametros
+End Sub
+
+ Rem ############
+Sub OnBtn_Salir
+ Dlg_Mostrado = False
+ Dlg_Activo = False
+ Msgbox (I_Txt(28), 0+64+0, Extension)
+End Sub
+
+ Rem ############
+Sub OnBtn_Ayuda(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ With oDlgImgs.getModel
+ If .Step = 1 then
+ .Step = 2
+ .getByName(&quot;Btn_Ayuda&quot;).Label = &quot;↫&quot;
+ Else
+ .Step = 1
+ .getByName(&quot;Btn_Ayuda&quot;).Label = &quot;?&quot;
+ End If
+ End With
+End Sub
+
+ Rem ############
+Sub OnTx_Nombre_Img(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ oDlgImgs.getModel.getByName(&quot;Tx_Nombre_Img&quot;).TextColor = RGB(120,0,0)
+End Sub
+
+ Rem ############
+Sub OnBtn_Cambiar_Nombre_Img(oEv)
+
+On error goto ERRORES:
+ oDlgImgs = oEv.Source.Context
+ If oDlgImgs.getModel.getByName(&quot;Tx_Nombre_Img&quot;).Text = &quot;&quot; then
+ Msgbox (I_Txt(30), 0+48+0, &quot;Error&quot;)
+ oDlgImgs.getModel.getByName(&quot;Tx_Nombre_Img&quot;).Text = oImg.name
+ Exit Sub
+ Else
+ oImg.Name = oDlgImgs.getModel.getByName(&quot;Tx_Nombre_Img&quot;).Text
+ oDlgImgs.getModel.getByName(&quot;Tx_Nombre_Img&quot;).TextColor = RGB(0,120,0)
+ End If
+ERRORES:
+ If Err = 1 Then
+ Msgbox (Chr(13) &amp; I_Txt(31), 0+48+0, &quot;Error&quot;)
+ End If
+End Sub
+
+ Rem ############
+Sub OnBtn_Ancla(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ oImg.AnchorType = 1
+ With oDlg.getModel
+ .getByName(&quot;Lbl_Ancla&quot;).label = I_Txt(14)
+ .getByName(&quot;Lbl_Ancla&quot;).TextColor = RGB(0,120,0)
+ End With
+End Sub
+
+ Rem ############
+Sub OnTx_Desc_Marco(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ oDlgImgs.getModel.getByName(&quot;Tx_Desc_Marco&quot;).TextColor = RGB(120,0,0)
+End Sub
+
+ Rem ############
+Sub OnBtn_Cambiar_Desc_Marco(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ oImg.Anchor.TextFrame.Description = oDlgImgs.getModel.getByName(&quot;Tx_Desc_Marco&quot;).Text
+ oDlgImgs.getModel.getByName(&quot;Tx_Desc_Marco&quot;).TextColor = RGB(0,120,0)
+End Sub
+
+ Rem ############
+Sub OnTx_Desc_Img(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ oDlgImgs.getModel.getByName(&quot;Tx_Desc_Img&quot;).TextColor = RGB(120,0,0)
+End Sub
+
+ Rem ############
+Sub OnBtn_Cambiar_Desc_Img(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ oImg.Description = oDlg.getModel.getByName(&quot;Tx_Desc_Img&quot;).Text
+ oDlgImgs.getModel.getByName(&quot;Tx_Desc_Img&quot;).TextColor = RGB(0,120,0)
+End Sub
+
+ Rem ############
+Sub OnBtn_Desde_Marco(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ oImg.Description = oImg.Anchor.TextFrame.Description
+ oDlgImgs.getModel.getByName(&quot;Tx_Desc_Img&quot;).Text = oImg.Description
+ oDlgImgs.getModel.getByName(&quot;Tx_Desc_Img&quot;).TextColor = RGB(0,120,0)
+End Sub
+
+ Rem ############
+Sub OnBtn_Editar_pulsado(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ Dim Miimagen : Miimagen = ThisComponent.GraphicObjects.getbyName(oimg.name)
+ ThisComponent.getCurrentController.select(Miimagen)
+End Sub
+
+ Rem ############
+Sub OnBtn_Editar_soltado(oEv)
+
+ oDlgImgs = oEv.Source.Context
+ Dim Document as Object, Dispatcher as Object
+ Document = ThisComponent.Currentcontroller.Frame
+ Dispatcher = CreateUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
+ Dispatcher.executeDispatch(document, &quot;.uno:ExternalEdit&quot;, &quot;&quot;, 0, Array())
+End Sub
+
+ Rem ############
+Function F_Ajuste_Imagenes_Marcos
+ Rem
+ Rem
+ Rem ======================================================
+
+ Call L10n.Trad_Imagenes
+
+ If Not Thiscomponent.HasLocation then : Msgbox (I_Txt(34),0+48+0,Extension ) : Exit Function : End If
+ REM 1º: Formato de imagen (Obligatorio antes de formato marcos)
+ Dim i as integer
+ Static s as String
+ oImgs = ThisComponent.GraphicObjects()
+ If oImgs.getCount = 0 Then : Msgbox (I_Txt(39), 0+48+0, Extension) : Exit Function : End If
+
+ oProgressBar = ThisComponent.CurrentController.getStatusIndicator()
+ oProgressBar.start( I_Txt(32), oImgs.Count * 2 )
+ oProgressBar.setValue( 1 )
+ Pbcounter = 0
+
+ FOR i = 0 to oImgs.Count-1
+
+ Wait 2
+ pbCounter = pBcounter + 1
+ oProgressBar.setValue(pBCounter)
+
+ oImg = oImgs.getByIndex(i)
+ With oImg
+ .AnchorType = 1
+ .VertOrient = 1
+ .VertOrientRelation = 0
+ .RelativeHeight = 0
+ .RelativeHeightRelation = 0
+ .RelativeWidth = 0
+ .RelativeWidthRelation = 0
+ .getAnchor.ParaStyleName = &quot;Figure&quot;
+ End With
+
+ If oImg.name = &quot; LibreOfficeLogo&quot; then
+ if ThisComponent.StyleFamilies.getByName(&quot;ParagraphStyles&quot;).hasbyName(&quot;New Chapter&quot;) then
+ With oImg
+ .getAnchor.ParaStyleName = &quot;New Chapter&quot;
+ .Description = &quot;LibreOffice Logo&quot;
+ .Title = &quot;LibreOffice Logo&quot;
+ If Comunes.F_LOVersion &lt;= 7.5 then : .Decorative = True : end if
+ End With
+ end If
+ End If
+
+ NEXT
+ s = I_Txt(40)
+ s= s &amp; F_Ajuste_Marcos &apos;Ajuste de marcos y luego Descripciones
+ Msgbox (s,0+64+0, I_Txt(41))
+ F_Ajuste_Imagenes_Marcos = s
+End Function
+
+ Rem ############
+Function F_Ajuste_Marcos
+
+ Dim s : Call L10n.Trad_Imagenes
+ If isEmpty(oProgressBar) then
+ oProgressBar = ThisComponent.CurrentController.getStatusIndicator()
+ oProgressBar.start( I_Txt(32), 1 )
+ oProgressBar.setValue( 1 )
+ Pbcounter = 0
+ End if
+ Dim oFrames as Object, oFrame as Object, oFCursor as Object, i as integer
+ REM Ajuste Marcos
+ oFrames = ThisComponent.TextFrames()
+ FOR i = 0 to oFrames.getcount -1
+ wait 2
+ pbCounter = pBCounter + 1
+ oProgressBar.setValue( pBCounter )
+ oFrame = oFrames.getByIndex(i)
+ With oFrame REM Formato Marco y Descripción
+ .getAnchor().ParaStyleName = &quot;Figure&quot; REM Estilo de párrafo del Marco
+ .AnchorType = 1
+ .SizeType = 0
+ .FrameIsAutomaticHeight = True
+ .VertOrient = 1
+ .IsSyncHeightToWidth = False
+ .IsSyncWidthToHeight = False
+ .RelativeHeight = 0
+ .RelativeHeightRelation = 0
+ .RelativeWidth = 0
+ .RelativeWidthRelation = 0
+ End With
+ NEXT
+ s= s &amp; Chr(13) &amp; I_Txt(42)
+ Rem Descripción Marcos
+ Dim oEnum as Object, oPar, oCursor as Object
+ FOR i = 0 to oFrames.getcount -1
+ pbCounter = pBcounter + 1
+ oFrame = oFrames.getByIndex(i)
+ oFCursor = oFrame.Text.createTextCursor() REM Cursor dentro del marco
+ oEnum = oFrame.Anchor.createEnumeration
+ oFCursor.gotoStart(False)
+ oFCursor.goRight(1, True) REM primer carácter (vací­o = Objeto)
+ Rem Marcos de solo texto -Revisión Leyenda y Descripción
+ IF oFCursor.string &lt;&gt; &quot;&quot; then
+ oFrame.Description = left(oframe.string,40) &amp; &quot;…&quot;
+ Rem comentario marco texto
+ oPar = oEnum.nextElement()
+ oCursor = oPar.getText().createTextCursorByRange(oPar)
+ oCursor.gotoStartOfParagraph(False)
+ Call InsertAnnotation(oPar, oCursor, I_Txt(45))
+ Rem MARCOS CON IMÁGENES - Ancho auto, Compruebo leyenda, Formateo para la descripción y avisos
+ ElSEIF oFCursor.string = &quot;&quot; then
+ oFrame.Width = 2000 &apos;anchura mí­nima
+ oFrame.WidthType = 0&apos;Automático = 0&apos;mínima 2
+ if inStr(oframe.string,&quot;: &quot;) &lt;&gt; 0 then
+ oFrame.Description = split(oframe.string,&quot;: &quot;, 2)(1)
+ else
+ oFCursor.gotoend(False)
+ oFCursor.gotoStartofParagraph(True)
+ oFrame.Description = oFcursor.getString
+ Rem comentario leyenda mal formada
+ oPar = oEnum.nextElement()
+ oCursor = oPar.getText().createTextCursorByRange(oPar)
+ oCursor.gotoEndOfParagraph(False)&apos; Antes start
+ Call InsertAnnotation(oPar, oCursor, I_Txt(46))
+ end if
+ Rem formato párrafo como Caption
+ oFCursor.gotoStart(False) REM inicio del marco
+ oFCursor.goRight(1, False) REM Mismo punto sin selec (asi no borra imagen)
+ if Not oFCursor.isEndOfParagraph then
+ oFCursor.String = Chr(13) REM Salto Parrafo y Formato Leyenda
+ end if
+ oFCursor.gotoNextParagraph(False)
+ oFCursor.ParaStyleName =&quot;Caption&quot;
+ END IF
+ NEXT
+ s = s &amp; Chr(13) &amp; I_Txt(43)
+ Rem Descripciones imágenes y comentarios recortes/escala
+ Dim oImgs as Object, oImg as Object
+ Dim oRec As Object, SinRecortes as Integer
+ Dim Aspecto as Variant, Escala as Variant
+ oImgs = ThisComponent.GraphicObjects()
+ For i = 0 to oImgs.getcount -1
+ pbCounter = pBcounter + 1
+ oImg = oImgs.getByIndex(i)
+ If Not isEmpty(oImg.anchor.TextFrame) then
+ oImg.Description = oImg.anchor.TextFrame.Description
+ oImg.Title = oImg.Description
+ End If
+ Rem Imagen recortada
+ oRec = oImg.GraphicCrop() : SinRecortes = oRec.Right + oRec.Left + oRec.Top + oRec.Bottom
+ oEnum = oImg.Anchor.createEnumeration
+ If SinRecortes &lt;&gt; 0 then&apos;Imagen recortada
+ oPar = oEnum.nextElement()
+ oCursor = oPar.getText().createTextCursorByRange(oPar)
+ oCursor.gotoEndOfParagraph(False) &apos; Antes start
+ Call InsertAnnotation(oPar, oCursor, I_Txt(47))
+ End if
+ Rem Imagen deformada
+ Aspecto = Format(oImg.ActualSize.Width / oImg.ActualSize.Height, &quot;###00.0&quot;)
+ Escala = Format(oImg.Width / oImg.Height, &quot;###00.0&quot;)
+ oEnum = oImg.Anchor.createEnumeration
+ If Aspecto &lt;&gt; Escala And SinRecortes = 0 Then
+ oPar = oEnum.nextElement()
+ oCursor = oPar.getText().createTextCursorByRange(oPar)
+ oCursor.gotoEndOfParagraph(False) &apos; antes start
+ Call InsertAnnotation(oPar, oCursor, I_Txt(48))
+ End if
+ Next
+ s = s &amp; Chr(13) &amp; I_Txt(44)
+ F_Ajuste_Marcos = s
+ Rem Descripción del logo
+ oImg = ThisComponent.GraphicObjects.getByIndex(0)
+ With oImg
+ .Name = &quot; LibreOffice Logo&quot; &apos;espacio la ordena en 1er lugar
+ .Description = &quot;LibreOffice Logo&quot;
+ .Title = &quot;LibreOffice Logo&quot;
+ If Comunes.F_LOVersion &lt;= 7.5 then : .Decorative = True : end if
+ If ThisComponent.StyleFamilies.getByName(&quot;ParagraphStyles&quot;).hasbyName(&quot;New Chapter&quot;) then
+ .getAnchor.ParaStyleName = &quot;New Chapter&quot;
+ End if
+ End With
+ oProgressbar.end
+ F_Ajuste_Marcos = s
+End Function
+
+ Rem ############
+Function F_Prueba_Sel()As Boolean &apos;Pasar prueba selección
+
+ Call L10n.Trad_Imagenes
+ Dim oSel : oSel= ThisComponent.getCurrentSelection
+ On error goto Errores
+ If not oSel.supportsService(&quot;com.sun.star.text.TextRanges&quot;) then
+ Msgbox (I_Txt(37), 0+0+64,Extension)
+ F_Prueba_Sel = 0
+ Exit Function
+ End If
+Errores:
+ if Err = 0 then
+ F_Prueba_Sel = 1
+ Exit Function
+ Elseif Err = 91 then
+ Msgbox (I_Txt(38), 0+64+0,&quot;Error&quot;)
+ Elseif Err &lt;&gt; 0 then
+ Msgbox (I_Txt(36) &amp; Err &amp; &quot; Linea n. &quot; &amp; Erl &amp; CHR(13) &amp; CHR(13) &amp; Error, 0+48+0, &quot;Error&quot;)
+ End if
+ F_Prueba_Sel = 0
+End Function
+
+ Rem ############
+Function F_AlternarLeyenda()
+
+ Call L10n.Trad_Imagenes
+ If ThisComponent.HasLocation = false then : Msgbox (I_Txt(34),0+48+0,Extension): Exit Function : End If
+ If Imagenes.F_Prueba_Sel = 0 Then Exit Function
+ If ThisComponent.TextFrames.Count = 0 Then : Msgbox (I_Txt(53),0+64+0, Extension): Exit Function: End If
+ If Msgbox (I_Txt(50), 4+48+256, Extension) = 6 Then
+ Goto SIGUIENTE
+ else
+ Msgbox (I_Txt(51), 0+64+0, Extension): Exit Function
+ End If
+SIGUIENTE:
+ Dim Document as Object, dispatcher as Object
+ Document = ThisComponent.CurrentController.Frame
+ Dispatcher = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
+ vCursor = ThisComponent.CurrentController.getViewCursor
+ Dim oImages : oImages = ThisComponent.GraphicObjects()
+ Dim oFCursor as Object, oFrame as Variant, i as Integer
+ For i = 0 to oImages.count - 1
+ oImg = oImages.getbyIndex(i)
+ oFrame = oImg.Anchor.TextFrame()
+ IF Not isEmpty(oImg.Anchor.TextFrame()) then
+ oFCursor = oFrame.Text.createTextCursor&apos; Entro en el marco
+ oFCursor.gotoStart(False)
+ vcursor.gotoRange(oFCursor,False)
+ dispatcher.executeDispatch(document, &quot;.uno:MoveDown&quot;, &quot;&quot;, 0, Array())&apos; End If
+ End If
+ Next
+ Dim marco1 : marco1 = ThisComponent.getTextFrames.getByIndex(0).Anchor
+ vcursor.gotoRange(marco1,False)
+ Msgbox (I_Txt(52),0+64+0, Extension)
+ F_AlternarLeyenda = Chr(13) &amp; I_Txt(52)
+End Function
+ REM ================= Fin Imagenes ===========================================================
+
+
+</script:module> \ No newline at end of file