def showDlg(ctx=uno.getComponentContext()):
    logger.debug(
        "----showDlg-------------------------------------------------")
    calcUnoObjs = util.UnoObjs(ctx, util.UnoObjs.DOCTYPE_CALC)
    logger.debug("got UNO context")
    dlg = DlgSpellingStep(calcUnoObjs)
    dlg.showDlg()
Beispiel #2
0
def showDlgForType(ctx, exType):
    logger.debug("----showDlg(%s)--------------------------------", exType)
    unoObjs = util.UnoObjs(ctx)
    logger.debug("got UNO context")

    dlg = DlgGrabExamples(exType, unoObjs)
    if not requireInputFile(exType, unoObjs, dlg.userVars):
        return
    dlg.showDlg()
def showDlg(ctx=uno.getComponentContext()):
    """Main method to show a dialog window.
    You can call this method directly by Tools -> Macros -> Run Macro.
    """
    logger.debug("----showDlg()----------------------------------------------")
    unoObjs = util.UnoObjs(ctx)
    logger.debug("got UNO context")

    dlg = DlgMkoxt(unoObjs)
    dlg.showDlg()
def showDlg(ctx=uno.getComponentContext()):
    """Main method to show a dialog window.
    You can call this method directly by Tools -> Macros -> Run Macro.
    """
    logger.debug("----showDlg()----------------------------------------------")
    drawingUnoObjs = util.UnoObjs(ctx, doctype=util.UnoObjs.DOCTYPE_DRAW)
    logger.debug("got UNO context")

    dlg = DlgDataConversion(drawingUnoObjs)
    dlg.showDlg()
Beispiel #5
0
def showDlg(ctx=uno.getComponentContext()):
    """Main method to show a dialog window.
    You can call this method directly by Tools -> Macros -> Run Macro.
    """
    logger.debug("----ShowMakerDlg()------------------------------------")
    calcUnoObjs = util.UnoObjs(ctx, doctype=util.UnoObjs.DOCTYPE_CALC)
    logger.debug("got UNO context")

    dlg = DlgChangerMaker(calcUnoObjs)
    dlg.showDlg()
def run_suite(suite, outputToFile):

    ## Make sure a writer document is open

    ctx = testutil.stored.getContext()
    unoObjs = util.UnoObjs(ctx, loadDocObjs=False)
    if len(unoObjs.getOpenDocs()) == 0:
        unoObjs.desktop.loadComponentFromURL("private:factory/swriter",
                                             "_blank", 0, ())

    ## Load and run the suite

    if outputToFile:
        run_suite_to_outfile(suite)
    else:
        unittest.TextTestRunner(verbosity=2).run(suite)

    unoObjs = testutil.unoObjsForCurrentDoc()
    oVC = unoObjs.viewcursor
    oVC.gotoEnd(False)
    oVC.getText().insertString(oVC, "Testing finished.\n", False)
    testutil.restoreMsgboxDisplay()
Beispiel #7
0
def aaa_del_sys_modules(dummy_int=0):
    """Normally it is necessary to restart Office in order to reload modules.
    To make a change to a lingt module without restarting, do the following:
    1. Run this function.
    2. Make the desired change to a module in lingt.
    [3. Make an arbitrary change to this file to cause it to reload.
        Running build/deploy_to_userdir.ps1 will update the modified timestamp,
        which makes it so that this step is not necessary.]
    (Steps 1-3 can be done in any order).
    4. Run build/deploy_to_userdir.ps1 to deploy the changes.
    5. Run the component again, which will now use the new changes.

    Note: "aaa_" prefix is just to move it up in the alphabetical list.
    """
    logManager.spacer()
    modules_count = 0
    for mod in list(sys.modules):
        if mod.startswith('lingt.') or mod.startswith('lingttest.'):
            del sys.modules[mod]
            modules_count += 1
    ctx = uno.getComponentContext()
    uno_objs = util.UnoObjs(ctx, util.UnoObjs.DOCTYPE_GENERIC)
    msgbox = messagebox.MessageBox(uno_objs)
    msgbox.display("Deleted " + str(modules_count) + " modules.")
 def getPlainUnoObjs(self):
     """Get basic UNO objects not including document objects."""
     return util.UnoObjs(self.getContext(), loadDocObjs=False)
def _unoObjsForDoc(document, doctype):
    unoObjs = util.UnoObjs(stored.getContext(), loadDocObjs=False)
    unoObjs.loadDocObjs(document, doctype)
    return unoObjs
Beispiel #10
0
def aab_disp_sys_modules(dummy_int=0):
    logManager.spacer()
    ctx = uno.getComponentContext()
    uno_objs = util.UnoObjs(ctx)
    msgbox = messagebox.MessageBox(uno_objs)
    msgbox.display(sorted(sys.modules.keys()))
 def setUpClass(cls):
     unoObjs = util.UnoObjs(testutil.stored.getContext(), loadDocObjs=False)
     testutil.blankWriterDoc(unoObjs)
Beispiel #12
0
    #t.dispval()
    #if t.dlg:
    #    print("t.dlg =...")
    #    dir(t.dlg)
    #    #xray(t.dlg)
    #else:
    #    print("t.dlg not")
    #t.dlg.endExecute()


#------------------------------------------------------------------------------
# Main routine
#------------------------------------------------------------------------------
print("Starting...")
ctx = util.UnoObjs.getCtxFromSocket()
unoObjs = util.UnoObjs(ctx)
#unoObjs = util.UnoObjs(ctx, 'calc')
#unoObjs = util.UnoObjs(ctx, 'impress')
#msgbox = MessageBox(unoObjs)

#copyAll()
#testSelString()
#testReadInsertUnicode()
#impress()
#fs2_GoToTimestamp()
show_mdlg()
#underlying_style_names()
#displayAttrs()
#doReplace()
print("Finished!")
Beispiel #13
0
 def setUpClass(cls):
     unoObjs = util.UnoObjs(testutil.stored.getContext(), loadDocObjs=False)
     testutil.blankCalcSpreadsheet(unoObjs)