Lines Matching refs:doc

26 def has(doc, s): return tryf(lambda: doc.supportsService(s), False)  argument
73 def docprops(doc): argument
74 p = doc.DocumentProperties
79 def basic(doc): argument
82 out[k] = tryf(lambda: sorted(getattr(doc, k).ElementNames), "n/a")
85 def writer(doc): argument
87 txt = doc.Text.String
90 e = doc.Text.createEnumeration(); tbl = 0; port_hash = []
107 ps = doc.StyleFamilies.getByName("PageStyles")
112 pa = doc.StyleFamilies.getByName("ParagraphStyles")
115 cs = doc.StyleFamilies.getByName("CharacterStyles")
117 fs = doc.StyleFamilies.getByName("FrameStyles")
120 for i in range(min(doc.TextTables.Count, 100)):
121 t = doc.TextTables.getByIndex(i)
127 en = doc.TextFields.createEnumeration()
136 …o["footnotes"] = [doc.Footnotes.Count, [tryf(lambda: doc.Footnotes.getByIndex(i).String[:30], "") …
137 …o["endnotes"] = [doc.Endnotes.Count, [tryf(lambda: doc.Endnotes.getByIndex(i).String[:30], "") for…
139 …for coll, name in ((doc.TextFrames, "frame"), (doc.GraphicObjects, "graphic"), (doc.EmbeddedObject…
146 for n in doc.TextSections.ElementNames[:100]:
147 …s = doc.TextSections.getByName(n); sec.append([n, g(s, "FileLink"), g(s, "LinkRegion"), g(s, "IsPr…
151 en = doc.Redlines.createEnumeration()
156 o["bookmarks"] = tryf(lambda: sorted(doc.Bookmarks.ElementNames))
157 o["refmarks"] = tryf(lambda: sorted(doc.ReferenceMarks.ElementNames))
158 o["indexes"] = tryf(lambda: doc.DocumentIndexes.Count)
159 o["shapes"] = [shape(doc.DrawPage.getByIndex(i)) for i in range(min(doc.DrawPage.Count, 150))]
160 o["forms"] = forms_of(doc.DrawPage)
161 …o["nstyles"] = {k: len(doc.StyleFamilies.getByName(k).ElementNames) for k in doc.StyleFamilies.Ele…
164 def calc(doc): argument
166 nfs = doc.NumberFormats; ftype = {}
170 for i in range(doc.Sheets.Count):
171 sh = doc.Sheets.getByIndex(i)
210 …tryf(lambda: [[n, doc.DDELinks.getByName(n).Application, doc.DDELinks.getByName(n).Topic, doc.DDEL…
211 o["names"] = tryf(lambda: sorted(doc.NamedRanges.ElementNames))
212 ps = doc.StyleFamilies.getByName("PageStyles")
214 cs = doc.StyleFamilies.getByName("CellStyles")
218 def draw(doc): argument
220 pages = doc.DrawPages
225 if has(doc, "com.sun.star.presentation.PresentationDocument"):
228 masters = doc.MasterPages
233 gf = doc.StyleFamilies.getByName("graphics")
247 doc = load(DESK, f) variable
248 …out["type"] = ("writer" if has(doc, "com.sun.star.text.TextDocument") else "calc" if has(doc, "com…
249 …else "impress" if has(doc, "com.sun.star.presentation.PresentationDocument") else "draw" if has(do…
250 out["props"] = tryf(lambda: docprops(doc), "ERR")
251 out["basic"] = basic(doc)
253 …{"writer": writer, "calc": calc, "impress": draw, "draw": draw}.get(out["type"], lambda d: {})(doc)
256 doc.close(True)