diff options
Diffstat (limited to 'userguides/sanitycheck/SanityCheck/Comunes.xba')
-rw-r--r-- | userguides/sanitycheck/SanityCheck/Comunes.xba | 322 |
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 = "Revisiones v 1.0.0" + Dim oDlgAsist as Object + Dim paso '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("SanityCheck") + oDlgAsist = CreateUnoDialog(DialogLibraries.getByName("SanityCheck").getByName("DlgAsistente")) + ' If Not IsMissing(paso) then: oDlgAsist.Model.Step(paso): else: oDlgAsist.Model.Step(1): end if + + With oDlgAsist.getModel + .Step = 1 + .getbyname("Btn_Atras").Label = V_Txt(1) + .getbyname("Btn_Salir").Label = V_Txt(3) + .getbyname("Btn_Campos").Label = V_Txt(4) + .getbyname("Btn_Estilos").Label = V_Txt(5) + .getbyname("Btn_Limpiar").Label = V_Txt(6) + .getbyname("Btn_Renombrar").Label = V_Txt(7) + .getbyname("Btn_Corregir").Label = V_Txt(8) + .getbyname("Btn_Leyendas").Label = V_Txt(9) +' .getbyname("Tx_Registro").Text = "" + End With + Call Comunes.ParametrosAsistente +' If Not IsMissing(paso) then: oDlgAsist.Model.Step(paso): end if': else: oDlgAsist.Model.Step(1): end if + oDlgAsist.execute +End Sub + + Rem ############ +Sub ParametrosAsistente'(oEv) + + With oDlgAsist.getModel + .Title = V_Txt(0) + .getbyname("Lbl_N_Pagina").label = oDlgAsist.Model.Step() + .getbyname("Btn_Atras").Label = V_Txt(1) + .getbyname("Btn_Omitir").Label = V_Txt(2) + + Select case oDlgAsist.Model.Step() + Case 1 'Campos + .getbyName("Lbl_Pagina").Label = V_Txt(10) + .getbyName("Lbl_P_Info").enableVisible = True + .getByName("Lbl_P_Info").Label = V_Txt(11) + .getbyName("Tx_Ayuda").Text = V_Txt(32) + Case 2 'Estilos + .getbyName("Lbl_Pagina").Label = V_Txt(12) + .getbyName("Lbl_P_Info").enableVisible = True + .getByName("Lbl_P_Info").Label = V_Txt(13) + .getbyName("Tx_Ayuda").Text = V_Txt(33) + Case 3 'Renombrar + .getbyName("Lbl_Pagina").Label = V_Txt(17) + .getbyName("Lbl_P_Info").enableVisible = True + .getByName("Lbl_P_Info").Label = V_Txt(18) + .getbyName("Tx_Ayuda").Text = V_Txt(35) + Case 4 'Limpiar + .getbyName("Lbl_Pagina").Label = V_Txt(14) + .getbyName("Lbl_P_Info").enableVisible = True + .getByName("Lbl_P_Info").Label = V_Txt(15) + .getbyName("Tx_Ayuda").Text = V_Txt(34) + Case 5 'Corregir Imgs + .getbyName("Lbl_Pagina").Label = V_Txt(24) + .getbyName("Lbl_P_Info").enableVisible = True + .getByName("Lbl_P_Info").Label = V_Txt(25) + .getbyName("Tx_Ayuda").Text = V_Txt(36) + Case 6 'Leyendas + .getbyName("Lbl_Pagina").Label = V_Txt(27) + .getbyName("Lbl_P_Info").enableVisible = True + .getByName("Lbl_P_Info").Label = V_Txt(28) + .getbyName("Tx_Ayuda").Text = V_Txt(37) + Case 7 'Registro + .getbyName("Lbl_Pagina").Label = V_Txt(29) + .getbyName("Lbl_P_Info").enableVisible = False + .getbyName("Tx_Ayuda").Text = V_Txt(38) + Case -1 'Ayuda + .getbyName("Lbl_Pagina").Label = V_Txt(31) + .getbyName("Lbl_P_Info").enableVisible = False + End select + End With +End sub + + Rem ############ +Sub OnBtn_Atras(oEv) + + oDlgAsist = oEv.Source.Context + If oDlgAsist.Model.Step <> 1 then oDlgAsist.Model.Step = oDlgAsist.Model.Step - 1 + With oDlgAsist.getModel + If oDlgAsist.Model.Step <> 7 then .getbyname("Btn_Omitir").EnableVisible = True '3 + If oDlgAsist.Model.Step = 1 then + .getbyname("Btn_Atras").EnableVisible = False + else + .getbyname("Btn_Atras").EnableVisible = True + end If + End WIth + Call Comunes.ParametrosAsistente +End Sub + + Rem ############ +Sub OnBtn_Omitir(oEv)'Siguiente + + oDlgAsist = oEv.Source.Context + With oDlgAsist.getModel + .Step = .Step + 1 + Call Comunes.ParametrosAsistente + If oDlgAsist.Model.Step = 1 then + .getbyname("Btn_Atras").EnableVisible = False + else + .getbyname("Btn_Atras").EnableVisible = True + end If + If oDlgAsist.Model.Step = 7 then .getbyname("Btn_Omitir").EnableVisible = False'3 + End With +End Sub + + Rem ############ +Sub OnBtn_Campos(oEv) + + oDlgAsist = oEv.Source.Context + Call Campos.Dlg_Campos + oDlgAsist.getModel.getbyname("Btn_Omitir").Label = V_Txt(30) + Dim s : s = oDlgAsist.getModel.getbyname("Tx_Registro").Text + s = s & V_Txt(20) & Chr(13) + oDlgAsist.getModel.getbyname("Tx_Registro").Text = s +End Sub + + Rem ############ +Sub OnBtn_Estilos(oEv) + + oDlgAsist = oEv.Source.Context + With oDlgAsist.Model + .getbyname("Btn_Omitir").Label = V_Txt(30) + Call Estilos.ComprobacionEstilos + Dim s : s = .getbyname("Tx_Registro").Text + s = s & V_Txt(21) & Chr(13) + .getbyname("Tx_Registro").Text = s + End With +End Sub + + Rem ############ +Sub OnBtn_Limpiar(oEv) + + oDlgAsist = oEv.Source.Context + oDlgAsist.getModel.getbyname("Btn_Omitir").Label = V_Txt(30) + Call Formatos.Dlg_Formatos + Dim s : s = oDlgAsist.getModel.getbyname("Tx_Registro").Text + s = s & V_Txt(22) & Chr(13) + oDlgAsist.getModel.getbyname("Tx_Registro").Text = s +End Sub + + Rem ############ +Sub OnBtn_Renombrar(oEv) + + oDlgAsist = oEv.Source.Context + oDlgAsist.getModel.getbyname("Btn_Omitir").Label = V_Txt(30) + Dim s : s = oDlgAsist.getModel.getbyname("Tx_Registro").Text + s = s & V_Txt(23) & Chr(13) + oDlgAsist.getModel.getbyname("Tx_Registro").Text = s + Call Renombrar.Dlg_Renombrar + +End sub + + Rem ############ +Sub OnBtn_Corregir(oEv) + + oDlgAsist = oEv.Source.Context + oDlgAsist.getModel.getbyname("Btn_Omitir").Label = V_Txt(30) + Dim ajuste : ajuste = F_Ajuste_Imagenes_Marcos + Dim s : s = oDlgAsist.getModel.getbyName("Tx_Registro").Text + s = s & Ajuste + oDlgAsist.getModel.getbyName("Tx_Registro").Text = s +End Sub + + Rem ############ +Sub OnBtn_SubirLeyendas(oEv) + + oDlgAsist = oEv.Source.Context + Dim ajuste : ajuste = F_AlternarLeyenda + With oDlgAsist.getModel + .getbyname("Btn_Omitir").Label = V_Txt(30) + Dim s : s = .getbyName("Tx_Registro").text + s = s & Ajuste + .getbyName("Tx_Registro").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("Btn_Volver").EnableVisible = True + .getbyname("Lbl_N_Pagina").EnableVisible = False + .getbyname("Btn_Ayuda").EnableVisible = False + .getbyname("Btn_Omitir").EnableVisible = False + .getbyname("Btn_Atras").EnableVisible = False + .getbyname("Btn_Salir").EnableVisible = False + .getbyname("Lbl_P_Info").EnableVisible = False + End WIth +End Sub + + Rem ############ +Sub OnBtn_Volver(oEv) + + oDlgAsist = oEv.Source.Context + + With oDlgAsist.getModel + .Step = Paso + .getbyname("Btn_Volver").EnableVisible = False + .getbyname("Lbl_N_Pagina").EnableVisible = True + .getbyname("Btn_Ayuda").EnableVisible = True + .getbyname("Btn_Atras").EnableVisible = True + .getbyname("Btn_Salir").EnableVisible = True + .getbyname("Lbl_P_Info").EnableVisible = True + If oDlgAsist.Model.Step = 7 Then + .getbyname("Btn_Omitir").EnableVisible = False + else + .getbyname("Btn_Omitir").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("com.sun.star.text.TextField.Annotation") + oAnno.Content = sMytext + oAnno.Author = Extension '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) + '.NanoSeconds = 300'parece que no funciona + End With + Fecha = oDT +End Function + + Rem ############ +Function Carga_Tools +Dim Nombre as String : Nombre = "Tools" + If GlobalScope.BasicLibraries.hasByName(Nombre) Then + if Not GlobalScope.BasicLibraries.isLibraryLoaded(Nombre) Then + GlobalScope.BasicLibraries.LoadLibrary(Nombre) + end If + Else + Msgbox "La biblioteca " & Nombre & " no existe , la macro dará errores" + End If +End Function + + + Rem ############ +Function F_LOVersion() As String +'----------------------------------------------------------------------------------------- +' Devuelve la versión de LibreOffice + Dim oSet, oCfgProvider + Dim aAux(0) As New com.sun.star.beans.PropertyValue + + oCfgProvider = createUnoService("com.sun.star.configuration.ConfigurationProvider") + aAux(0).Name = "nodepath" + aAux(0).Value = "/org.openoffice.Setup/Product" + oSet = oCfgProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aAux()) + F_LOVersion = oSet.getByName("ooSetupVersion") +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 = "nodepath" + aProps(0).Value = "/org.openoffice.UserProfile/Data/" + oConfig = createUnoService("com.sun.star.configuration.ConfigurationProvider") + oRegKey = oConfig.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", aProps()) + MyName = oRegKey.givenname & " " & 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("com.sun.star.frame.DispatchHelper") + +rem ---------------------------------------------------------------------- +dispatcher.executeDispatch(document, ".uno:UpdateAll", "", 0, Array()) +end sub + + + + +</script:module> |