summaryrefslogtreecommitdiff
path: root/userguides/sanitycheck/SanityCheck/Comunes.xba
diff options
context:
space:
mode:
Diffstat (limited to 'userguides/sanitycheck/SanityCheck/Comunes.xba')
-rw-r--r--userguides/sanitycheck/SanityCheck/Comunes.xba322
1 files changed, 322 insertions, 0 deletions
diff --git a/userguides/sanitycheck/SanityCheck/Comunes.xba b/userguides/sanitycheck/SanityCheck/Comunes.xba
new file mode 100644
index 00000000..c99ac5d7
--- /dev/null
+++ b/userguides/sanitycheck/SanityCheck/Comunes.xba
@@ -0,0 +1,322 @@
+<?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="Comunes" script:language="StarBasic" script:moduleType="normal">REM ***** BASIC Módulo Comunes *****
+Option Explicit
+
+ Const Extension as string = &quot;Revisiones v 1.0.0&quot;
+ Dim oDlgAsist as Object
+ Dim paso &apos;as integer
+
+ Rem ############
+Sub Dlg_Asist
+
+ Call L10n.Trad_Comunes
+ If Thiscomponent.HasLocation = false then : Msgbox (V_Txt(19),0+48+0, Extension) : Exit Sub : End If
+ If Imagenes.F_Prueba_Sel = 0 Then : Exit Sub : End If
+
+ DialogLibraries.loadLibrary(&quot;SanityCheck&quot;)
+ oDlgAsist = CreateUnoDialog(DialogLibraries.getByName(&quot;SanityCheck&quot;).getByName(&quot;DlgAsistente&quot;))
+ &apos; If Not IsMissing(paso) then: oDlgAsist.Model.Step(paso): else: oDlgAsist.Model.Step(1): end if
+
+ With oDlgAsist.getModel
+ .Step = 1
+ .getbyname(&quot;Btn_Atras&quot;).Label = V_Txt(1)
+ .getbyname(&quot;Btn_Salir&quot;).Label = V_Txt(3)
+ .getbyname(&quot;Btn_Campos&quot;).Label = V_Txt(4)
+ .getbyname(&quot;Btn_Estilos&quot;).Label = V_Txt(5)
+ .getbyname(&quot;Btn_Limpiar&quot;).Label = V_Txt(6)
+ .getbyname(&quot;Btn_Renombrar&quot;).Label = V_Txt(7)
+ .getbyname(&quot;Btn_Corregir&quot;).Label = V_Txt(8)
+ .getbyname(&quot;Btn_Leyendas&quot;).Label = V_Txt(9)
+&apos; .getbyname(&quot;Tx_Registro&quot;).Text = &quot;&quot;
+ End With
+ Call Comunes.ParametrosAsistente
+&apos; If Not IsMissing(paso) then: oDlgAsist.Model.Step(paso): end if&apos;: else: oDlgAsist.Model.Step(1): end if
+ oDlgAsist.execute
+End Sub
+
+ Rem ############
+Sub ParametrosAsistente&apos;(oEv)
+
+ With oDlgAsist.getModel
+ .Title = V_Txt(0)
+ .getbyname(&quot;Lbl_N_Pagina&quot;).label = oDlgAsist.Model.Step()
+ .getbyname(&quot;Btn_Atras&quot;).Label = V_Txt(1)
+ .getbyname(&quot;Btn_Omitir&quot;).Label = V_Txt(2)
+
+ Select case oDlgAsist.Model.Step()
+ Case 1 &apos;Campos
+ .getbyName(&quot;Lbl_Pagina&quot;).Label = V_Txt(10)
+ .getbyName(&quot;Lbl_P_Info&quot;).enableVisible = True
+ .getByName(&quot;Lbl_P_Info&quot;).Label = V_Txt(11)
+ .getbyName(&quot;Tx_Ayuda&quot;).Text = V_Txt(32)
+ Case 2 &apos;Estilos
+ .getbyName(&quot;Lbl_Pagina&quot;).Label = V_Txt(12)
+ .getbyName(&quot;Lbl_P_Info&quot;).enableVisible = True
+ .getByName(&quot;Lbl_P_Info&quot;).Label = V_Txt(13)
+ .getbyName(&quot;Tx_Ayuda&quot;).Text = V_Txt(33)
+ Case 3 &apos;Renombrar
+ .getbyName(&quot;Lbl_Pagina&quot;).Label = V_Txt(17)
+ .getbyName(&quot;Lbl_P_Info&quot;).enableVisible = True
+ .getByName(&quot;Lbl_P_Info&quot;).Label = V_Txt(18)
+ .getbyName(&quot;Tx_Ayuda&quot;).Text = V_Txt(35)
+ Case 4 &apos;Limpiar
+ .getbyName(&quot;Lbl_Pagina&quot;).Label = V_Txt(14)
+ .getbyName(&quot;Lbl_P_Info&quot;).enableVisible = True
+ .getByName(&quot;Lbl_P_Info&quot;).Label = V_Txt(15)
+ .getbyName(&quot;Tx_Ayuda&quot;).Text = V_Txt(34)
+ Case 5 &apos;Corregir Imgs
+ .getbyName(&quot;Lbl_Pagina&quot;).Label = V_Txt(24)
+ .getbyName(&quot;Lbl_P_Info&quot;).enableVisible = True
+ .getByName(&quot;Lbl_P_Info&quot;).Label = V_Txt(25)
+ .getbyName(&quot;Tx_Ayuda&quot;).Text = V_Txt(36)
+ Case 6 &apos;Leyendas
+ .getbyName(&quot;Lbl_Pagina&quot;).Label = V_Txt(27)
+ .getbyName(&quot;Lbl_P_Info&quot;).enableVisible = True
+ .getByName(&quot;Lbl_P_Info&quot;).Label = V_Txt(28)
+ .getbyName(&quot;Tx_Ayuda&quot;).Text = V_Txt(37)
+ Case 7 &apos;Registro
+ .getbyName(&quot;Lbl_Pagina&quot;).Label = V_Txt(29)
+ .getbyName(&quot;Lbl_P_Info&quot;).enableVisible = False
+ .getbyName(&quot;Tx_Ayuda&quot;).Text = V_Txt(38)
+ Case -1 &apos;Ayuda
+ .getbyName(&quot;Lbl_Pagina&quot;).Label = V_Txt(31)
+ .getbyName(&quot;Lbl_P_Info&quot;).enableVisible = False
+ End select
+ End With
+End sub
+
+ Rem ############
+Sub OnBtn_Atras(oEv)
+
+ oDlgAsist = oEv.Source.Context
+ If oDlgAsist.Model.Step &lt;&gt; 1 then oDlgAsist.Model.Step = oDlgAsist.Model.Step - 1
+ With oDlgAsist.getModel
+ If oDlgAsist.Model.Step &lt;&gt; 7 then .getbyname(&quot;Btn_Omitir&quot;).EnableVisible = True &apos;3
+ If oDlgAsist.Model.Step = 1 then
+ .getbyname(&quot;Btn_Atras&quot;).EnableVisible = False
+ else
+ .getbyname(&quot;Btn_Atras&quot;).EnableVisible = True
+ end If
+ End WIth
+ Call Comunes.ParametrosAsistente
+End Sub
+
+ Rem ############
+Sub OnBtn_Omitir(oEv)&apos;Siguiente
+
+ oDlgAsist = oEv.Source.Context
+ With oDlgAsist.getModel
+ .Step = .Step + 1
+ Call Comunes.ParametrosAsistente
+ If oDlgAsist.Model.Step = 1 then
+ .getbyname(&quot;Btn_Atras&quot;).EnableVisible = False
+ else
+ .getbyname(&quot;Btn_Atras&quot;).EnableVisible = True
+ end If
+ If oDlgAsist.Model.Step = 7 then .getbyname(&quot;Btn_Omitir&quot;).EnableVisible = False&apos;3
+ End With
+End Sub
+
+ Rem ############
+Sub OnBtn_Campos(oEv)
+
+ oDlgAsist = oEv.Source.Context
+ Call Campos.Dlg_Campos
+ oDlgAsist.getModel.getbyname(&quot;Btn_Omitir&quot;).Label = V_Txt(30)
+ Dim s : s = oDlgAsist.getModel.getbyname(&quot;Tx_Registro&quot;).Text
+ s = s &amp; V_Txt(20) &amp; Chr(13)
+ oDlgAsist.getModel.getbyname(&quot;Tx_Registro&quot;).Text = s
+End Sub
+
+ Rem ############
+Sub OnBtn_Estilos(oEv)
+
+ oDlgAsist = oEv.Source.Context
+ With oDlgAsist.Model
+ .getbyname(&quot;Btn_Omitir&quot;).Label = V_Txt(30)
+ Call Estilos.ComprobacionEstilos
+ Dim s : s = .getbyname(&quot;Tx_Registro&quot;).Text
+ s = s &amp; V_Txt(21) &amp; Chr(13)
+ .getbyname(&quot;Tx_Registro&quot;).Text = s
+ End With
+End Sub
+
+ Rem ############
+Sub OnBtn_Limpiar(oEv)
+
+ oDlgAsist = oEv.Source.Context
+ oDlgAsist.getModel.getbyname(&quot;Btn_Omitir&quot;).Label = V_Txt(30)
+ Call Formatos.Dlg_Formatos
+ Dim s : s = oDlgAsist.getModel.getbyname(&quot;Tx_Registro&quot;).Text
+ s = s &amp; V_Txt(22) &amp; Chr(13)
+ oDlgAsist.getModel.getbyname(&quot;Tx_Registro&quot;).Text = s
+End Sub
+
+ Rem ############
+Sub OnBtn_Renombrar(oEv)
+
+ oDlgAsist = oEv.Source.Context
+ oDlgAsist.getModel.getbyname(&quot;Btn_Omitir&quot;).Label = V_Txt(30)
+ Dim s : s = oDlgAsist.getModel.getbyname(&quot;Tx_Registro&quot;).Text
+ s = s &amp; V_Txt(23) &amp; Chr(13)
+ oDlgAsist.getModel.getbyname(&quot;Tx_Registro&quot;).Text = s
+ Call Renombrar.Dlg_Renombrar
+
+End sub
+
+ Rem ############
+Sub OnBtn_Corregir(oEv)
+
+ oDlgAsist = oEv.Source.Context
+ oDlgAsist.getModel.getbyname(&quot;Btn_Omitir&quot;).Label = V_Txt(30)
+ Dim ajuste : ajuste = F_Ajuste_Imagenes_Marcos
+ Dim s : s = oDlgAsist.getModel.getbyName(&quot;Tx_Registro&quot;).Text
+ s = s &amp; Ajuste
+ oDlgAsist.getModel.getbyName(&quot;Tx_Registro&quot;).Text = s
+End Sub
+
+ Rem ############
+Sub OnBtn_SubirLeyendas(oEv)
+
+ oDlgAsist = oEv.Source.Context
+ Dim ajuste : ajuste = F_AlternarLeyenda
+ With oDlgAsist.getModel
+ .getbyname(&quot;Btn_Omitir&quot;).Label = V_Txt(30)
+ Dim s : s = .getbyName(&quot;Tx_Registro&quot;).text
+ s = s &amp; Ajuste
+ .getbyName(&quot;Tx_Registro&quot;).Text = s
+ End With
+End Sub
+
+ Rem ############
+Sub OnBtn_Revisar(oEv)
+
+ oDlgAsist = oEv.Source.Context
+ oDlgAsist.EndExecute
+ Call Imagenes.DlgImagenes
+End Sub
+
+ Rem ############
+Sub OnBtn_Ayuda(oEv)
+
+ oDlgAsist = oEv.Source.Context
+ Paso = oDlgAsist.Model.Step
+ oDlgAsist.Model.Step = -1
+
+ With oDlgAsist.getModel
+ .getbyname(&quot;Btn_Volver&quot;).EnableVisible = True
+ .getbyname(&quot;Lbl_N_Pagina&quot;).EnableVisible = False
+ .getbyname(&quot;Btn_Ayuda&quot;).EnableVisible = False
+ .getbyname(&quot;Btn_Omitir&quot;).EnableVisible = False
+ .getbyname(&quot;Btn_Atras&quot;).EnableVisible = False
+ .getbyname(&quot;Btn_Salir&quot;).EnableVisible = False
+ .getbyname(&quot;Lbl_P_Info&quot;).EnableVisible = False
+ End WIth
+End Sub
+
+ Rem ############
+Sub OnBtn_Volver(oEv)
+
+ oDlgAsist = oEv.Source.Context
+
+ With oDlgAsist.getModel
+ .Step = Paso
+ .getbyname(&quot;Btn_Volver&quot;).EnableVisible = False
+ .getbyname(&quot;Lbl_N_Pagina&quot;).EnableVisible = True
+ .getbyname(&quot;Btn_Ayuda&quot;).EnableVisible = True
+ .getbyname(&quot;Btn_Atras&quot;).EnableVisible = True
+ .getbyname(&quot;Btn_Salir&quot;).EnableVisible = True
+ .getbyname(&quot;Lbl_P_Info&quot;).EnableVisible = True
+ If oDlgAsist.Model.Step = 7 Then
+ .getbyname(&quot;Btn_Omitir&quot;).EnableVisible = False
+ else
+ .getbyname(&quot;Btn_Omitir&quot;).EnableVisible = True
+ End If
+ End WIth
+ Call Comunes.ParametrosAsistente
+End Sub
+
+ Rem ############
+Sub InsertAnnotation(oParSection As Object, oCursor As Object, sMytext As String)
+
+ Dim oAnno As Object
+ oAnno = ThisComponent.createInstance(&quot;com.sun.star.text.TextField.Annotation&quot;)
+ oAnno.Content = sMytext
+ oAnno.Author = Extension &apos;MyName
+ oAnno.DateTimeValue = Fecha
+ oParSection.Text.insertTextContent(oCursor, oAnno, True)
+End Sub
+
+ Rem ############
+Function Fecha
+Dim oDT As New com.sun.star.util.DateTime
+ With oDT
+ .Day = Day(Now) : .Month = Month(Now): .Year = Year(Now)
+ .Hours = Hour(Now) : .Minutes = Minute(Now) : .Seconds = Second(Now)
+ &apos;.NanoSeconds = 300&apos;parece que no funciona
+ End With
+ Fecha = oDT
+End Function
+
+ Rem ############
+Function Carga_Tools
+Dim Nombre as String : Nombre = &quot;Tools&quot;
+ If GlobalScope.BasicLibraries.hasByName(Nombre) Then
+ if Not GlobalScope.BasicLibraries.isLibraryLoaded(Nombre) Then
+ GlobalScope.BasicLibraries.LoadLibrary(Nombre)
+ end If
+ Else
+ Msgbox &quot;La biblioteca &quot; &amp; Nombre &amp; &quot; no existe , la macro dará errores&quot;
+ End If
+End Function
+
+
+ Rem ############
+Function F_LOVersion() As String
+&apos;-----------------------------------------------------------------------------------------
+&apos; Devuelve la versión de LibreOffice
+ Dim oSet, oCfgProvider
+ Dim aAux(0) As New com.sun.star.beans.PropertyValue
+
+ oCfgProvider = createUnoService(&quot;com.sun.star.configuration.ConfigurationProvider&quot;)
+ aAux(0).Name = &quot;nodepath&quot;
+ aAux(0).Value = &quot;/org.openoffice.Setup/Product&quot;
+ oSet = oCfgProvider.createInstanceWithArguments(&quot;com.sun.star.configuration.ConfigurationAccess&quot;, aAux())
+ F_LOVersion = oSet.getByName(&quot;ooSetupVersion&quot;)
+End Function
+
+ REM ================= Fin Comunes ===========================================================
+
+
+ Rem ############
+Function MyName
+ Dim aProps(0) As New com.sun.star.beans.PropertyValue
+ Dim oRegKey, oConfig As Object
+ aProps(0).Name = &quot;nodepath&quot;
+ aProps(0).Value = &quot;/org.openoffice.UserProfile/Data/&quot;
+ oConfig = createUnoService(&quot;com.sun.star.configuration.ConfigurationProvider&quot;)
+ oRegKey = oConfig.createInstanceWithArguments(&quot;com.sun.star.configuration.ConfigurationUpdateAccess&quot;, aProps())
+ MyName = oRegKey.givenname &amp; &quot; &quot; &amp; oRegKey.sn
+
+End Function
+
+ Rem ############ posible incorporación? Recargar documento.
+sub ActualizarTodo
+rem ----------------------------------------------------------------------
+rem define variables
+dim document as object
+dim dispatcher as object
+rem ----------------------------------------------------------------------
+rem get access to the document
+document = ThisComponent.CurrentController.Frame
+dispatcher = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
+
+rem ----------------------------------------------------------------------
+dispatcher.executeDispatch(document, &quot;.uno:UpdateAll&quot;, &quot;&quot;, 0, Array())
+end sub
+
+
+
+
+</script:module>