 Tukaj so pa pričal, da jim je zelo počkaj, in je to je inštje. Mi je Miklo Švajna, kaj je zelo počkaj, in zelo se način, da je to počkaj, in se izvaj, da je to počkaj. Zato počkaj sem, zelo počkaj, da je zelo počkaj, in zelo počkaj, da je to počkaj, Kaj. Načo o strame, je, bodo se večo, je zodati na importičnje strane, dawaj za pravajj pptx, ne施no sam je v miecznih, vga dohači in drillje tudi v poveči, položene priloženje, zač načala,不知道 leživo. Ne bomo doberje, ma, ne bili s tussami boje, ne boliressive tistov, pa se je načino, ne bo prištava. Te še boje, ki informacijo. Tako, imelem odakon, kuri se dar veliko prisedremo, svoje je, na svojo našte jaz načine. Ne bomo, ki se radila, ne bo preizv tender, ne bom je prisedremo, ne bom je še breed. Ne, ne bom je svoje, ne bom je preizv eno za nezale. a ni sva ne akimi, da je čelenga. The number of cases where the output was basically either nothing, or some letters rendered on top of each other, and that's basically it. So for some cases we had a terrible result. And this work is focusing on improving the rendering result, in case there is no throwing gamma four back. In je tudi poslutno, da ćeš se vse dobročenje. Je to zelo, da je prič, da je ta nešto deločen, če je pričo deločne, kako je začala, in kako je pričo, kaj je pričo, da je vzelo, da je ta vse pričo, da je pričo. Vse možete sajta, da je to nezavljeno. Vsle nožne, poče neč predvojne, osnečen, neč neč vzelo, Kaj so v počke, tako je v zelo dokonavati, da je vodnje očiv, občas je protektajno. Pozolite na zelo na napretov, in pa delaj se kaj v taj vplika s dončaj vodnje, začin je na dno v ločerbe, kako je tako dokonavati, nije dnev evaluateda.子うžit飆stv, ne bo iz svина, je je to, če je to viziv. Just the first time, but it would be much more interesting later to actually, hello Hare?" quantity of these smart arts. If the Sultan of the Game is part of the game, then we definitely need to have this functionality, to take the drawing marker, drawing. The cartoon markup of the rebuild. 세 Voj tazko tati za. I think it's a good thing that this A z drugim vzoutem, sem veliko prav da se vzoute na večkih tajbi, ki je bilo lepo je. Svičo je, da je vzoute vzout, da je vsih poslušnje tajbi in za vse izglede, nekaj, da se vzoute na vse plafsi, je to vse z vzoutem, in nekaj, da se vzoute na vse plafsi, je to vzoute na vse plafsi, in in pras. For the vertical box placed, the old rendering result was basically not readable. The new one is close to what PowerPoint would do. Then we had quite similar pre-count smart art type in PowerPoint called vertical tab list. Again, the font color was not correct. Also, if you had enough content in the left column of the pictures or the shape, then that was not really readable. The new result is, in many cases, not perfect either. So the idea is that let's improve this up to the point that at least all the content is readable if there is some interaction between the various shapes of this smart art, then it's clear what is the meaning of that relation and don't spend a year on just one type, rather make much more types readable and good enough so that we can move on to the next type and so on. So this is not perfect, but the hope is that for many types this is now much more readable and much more usable compared to what it was. So a prime example of this is this line list where the lines are still not perfect, but this was just not readable before. And now we see that this is a line list. Or in the vertical bracket list case, simply the content of the actual amount on the right-hand side was completely missing. Or just improper sizing of these child shapes made that if you had enough content that it was just not readable. Then we have the vertical table list, which was again something that just the size of these child shapes was so incorrect that if you had enough content that much of the content was simply cut off. So far about these various list types. Another bucket of various subtypes is the process types. And inside that the first thing is the accent process. So again, just due to the incorrect calculation of these text shapes, in the previous case the content was basically not readable, and no, it's readable. I would also note that next to the text content, also the ballots are no longer missing. And in case you had some more content inside the single text shape, and you had multiple progress with ballots, the existence of these ballots is very, very important because that's the only visible separator between the separate progress. So just remove the bytes, and it's possible that the meaning of your content is just not something people can understand. So these ballots are very important. Then we have one more process type, this continuous block process, where again the size of the shape was just so small that if you had enough content then the content was cut off. The last type I was recently working on is this organization chart, which is pretty complex. One metric to talk about the complexity of these charts is the number of maximal lines that describe all the constraints for laying out. And the previous ones are typically around 300, 400 lines. The organization chart markup is around 1,200 lines, something like this. So it's pretty complex. It just takes a lot of time to simplify these documents up to the point that they are simple enough that they are still interesting and it demonstrates the problem. On the other hand, the size is manageable, so actually you can efficiently debug them. So what you see on this picture is garbage on the left. As always, both on the right you see a strange organization with multiple managers, where some of the managers have no employees and this manager too has an assistant and also three different employees. And there are connector shapes between these two. So you have an idea of how the organization is actually shaped. And this one was very interesting because this shape is constructed by basically two algorithms. One is the... One algorithm is focusing on how you lay out employees next to each other, so it's a vertical algorithm. And the other algorithm is focusing on how you lay out one unit as a manager, optionally an assistant, and the employees. So it's a vertical algorithm. And not much of this is documented in the OXMS pack. So your best bet is that you play around with PowerPoint. You get an idea of what's possible in town. You simplify this huge markup to something sensible, one or two hundred lines. You try to guess what's actually ignored during import, what's the reason you just got this garbage and not the readable chart, and you try to implement the algorithm in a way that it mostly behaves compared to what you see with Black Box last time. So far are the results. And for the rest, I would like to share some details about how this is implemented. So before any actual coding, I spent quite some time on trying to understand just the concepts around SmartArt. And I think this was the most challenging part, because inside the OXMS specification, there is a reasonable description of individual XML, Alamance XML attributes, attribute values. But that's like the very small details. But there is no big picture over you in the pack. So getting an idea of what are the concepts behind this layout, hey, Nari, is something that was the most challenging for me. So first, what we have is, we have some data for the SmartArt, which is a hierarchical tree-like data structure with data points having parents and children and siblings. And we have the layout description. And the layout description is, again, a tree of what we call layout nodes. And this is what defines how the content will end up on the screen. That means that we have layout nodes for all the shapes, which are visible on the screen. And also we have layout nodes for these containers. So if you have three shapes next to each other and you want to render them on a linear path, then you need a container that has an algorithm associated with it. And it should say that this should be laid out in a linear path. And then you need a layout node for this container as well. So everything is a layout node in this layout description. Then once you have the layout node, which are either shapes or containers or placeholders for just spacing between shapes and so on. So you have this layout building block called layout node. Then you can assign algorithms to this layout node, where the simplest algorithm is the shape, which means that this layout node should be mapped to a drawing of a shape. And the shape should get some data, some content from the data definition. We will see that in a moment. So you have your layout tree. So you have your layout tree, layout nodes. Then you associate algorithms to this layout nodes and you organize your layout nodes in a tree. And to make this much more interesting, the layout tree can have nodes, which are called atoms, which allow dynamic behavior. So similar to accessibility, you can have conditions for cycles, choices, and so on. So it's almost a whole programming language, which is a bit scary. So you can have just, let's say, two layout nodes, two layout nodes in a layout tree. One is a root node and one children node or child node. And if you have a four layout atom between the two, then, according to your data model, is dynamic how many actual shape ends up in the document. This is why you need some algorithm deciding how these micro push shapes are laid out. Yeah, so we had the building block, the layout node, we had the algorithm, we had the layout tree. So data model mapping is the part that decides how the layout description is associated with the content you assign to the smart art. This means that typically when you edit your smart art in the user interface, then you only edit the data. And all these layout descriptions are hard-variored into PowerPoint. And you can create your own custom layout description, but the major key of the users is that we just use these pre-made 100 types, or I did not count them. So there is a long list of pre-existing types and users typically work with that. From our point of view, this is a very good news. We have a fixed set of layout descriptions. And of course, we tried to solve these layout differences in a generic way. But actually what users care about is really just this fixed set of layout descriptions. And if these are working, then users are typically happy. This is a bit easier problem compared to just handling random input for this layout algorithm and expecting that it's behaving exactly the same as PowerPoint all the time. So the data model mapping decides how to associate the layout nodes to zero, one, or multiple data nodes. Finally, the last thing that really affects the shape says that for layout nodes with the shape algorithm, you can associate shape properties. Again, this is tightly coupled to drawing amount. So all the properties are using the drawing amount markup. And later we will see this is why we don't do a direct import of SmartArt into Impress. Rather, first we take the drawing amount input, we generate drawing amount in memory representation for that, and we use the existing drawing amount import to actually map that to our shape model. Because this way we can share a lot of code. What else? We have constraints. So this is the most complex part of that. You could even use an SAT solver to find out what's the optimal value for the various requirements to lay out these shapes properly. The good news is that so far this was not necessary. The current implementation is a one-path layout. So we never position shapes multiple times. And so far this is, even this much simpler approach is giving a reasonable result. So constraints are the ones which decide all the properties of all the layout nodes, like what should be the spacing between the shapes, what should be their size, their position, they are the font size of the content inside the shapes, and so on, and so on, and so on. If you use this automatic text sizing in impress for normal shapes, this is similar, it's just not a single something which does something automagically, but a long list of properties and all of these are calculated automagically. Next to constraints, there are rules. Rules are used for dealing with situations when you have conflicting requirements. So in case, for example, you give constraints that it's clear what should be the size of the shape, but then you have lots of content inside the shape, you have this conflicting requirement that on one hand you want to have all your content visible, on the other hand you have requirements for the size of the shape, so it should be, let's say, small. And then rules come into the picture, and rules can decide what happens when you have the conflicting requirement. For example, the rule might say that if there is not enough space inside the shape, then you should give up the constraint about the height of the shape, so it will be a very tall one, but at least your content is readable. Or you can decide that the conflict resolution should be that the font size should be decreased, so that it will be very hard to read, but at least all the content will be done. And the very last concept is the text properties. So next to the shape properties, you can define all the aspects of text as content appearing inside this shape nodes. Basically, these are the high-level concepts, and once you have a rough understanding what these mean, then it makes sense to jump to the reference and actually read about what the individual maximal elements attribute, attribute values are doing. So regarding the actual markup, this is all part of OXMON with the same benefits and problems of the general OXMON documentation, sometimes something is reasonably documented, sometimes the documentation is completely opaque on the details. Inside the PPTX file, we typically have either four or five XML streams, like XML files inside this zip package. We have the data for the shape, then we have, this is the only piece which is actually edited by the users using the PowerPoint user interface, typically. Then we have, we can have shape styles which are specific to this smart art instance. This is defined in the quick style XML. This is typically not edited by the user. We can have scholar schemes. This is using almost the same markup as document teams. So this is again something that's typically not edited by the users. They just say that they want some dark color, let's say dark, and in practice, perhaps that will be dark blue, and then they want some text on that, so it should be text color, and it will be white so that it's actually readable on dark blue. Then there is the layout XML. So this is the container for the constraints. This is the one that you read the most when you try to improve this code. And again, this is a fixed sound, so you choose that you want a vertical bracket list, and then you get a fixed layout, and whatever you do with your content, the layout definition is not changing. And optionally, there is this drawing stream which is a pre-calculated drawing among group shape, and if it's dark, then we can easily just import that into imprints. Yeah, so much about the markup. So speaking about how this is in the LibreFist codebase, all this smart art handling is inside the drawing ML import, and there is a subdirectory for diagrams, which is just the name for smart art. Probably smart art is some product name, and diagram is the alias used in the specification, but they are the same. At the moment all of these layout is happening at PPTX import time, or OXM import time, so if you want to test how this behaves, you need to open a file, and you will see the result, and you tweak the code, and again you re-import. So it's unlike writer layout, where you open a document, and you actually edit the document, and see how the layout reacts to your key strokes. This is an import time saying, and as mentioned, this is a two-step approach. So first we import the smart art markup, and we produce a tree of these drawing ML shape object, and then later we give this shape tree, drawing a mass shape tree to the drawing ML importer, and that one will issue the, or invoke the necessary unicor so that the actual shape objects are created. So that's the high level over you, the actual implementation. Then regarding how this is tested, the easiest way is integration tasks. You load the document into imprase, and then you can use the UNO API to find out the various properties of the shapes. Given that this is import time, all the layout thing is actually part of the document model once the layout finished, so you can just use the UNO API, which would be available as macros, for macros as well, to assert the size, position, or content of the various shapes. Given that all the layout thing is done with these containers around the shape nodes, there can be quite deep hierarchy of group shapes. So the top container is always a group shape, but till you actually find the shape that has the text, it can happen that you have five or four group shapes inside each other till you actually reach your content. But the benefit of this is that there is more or less one-to-one mapping between the original layout tree and the resulting document model, and then you can reason about if this is a correct mapping or not. So this is somewhat helpful for debugging, and the users typically care about the resulting layout, so they probably want a group, or the group shapes in four or five stages. I have no numbers, what was the state when I started working on this, but today we have almost 30 tasks, like 30 loaded documents with different smart art setups and loads of asserts. So when I start working on a new type, then add one test document for that type, hopefully that's complex enough, and then as I incrementally try to improve the layout so that it produces something sane, then I keep adding new tasks inside that single task function. So there are loads of asserts compared to just the number of loaded documents. Hopefully that's a good trade-off between very long-running make-check versus uncovered code. And the good news is that, again, this is fitter work, at least technically, so you can do all your changes with the matching task coverage. So at least what was presented here as a result, all the improvements were in the form of coins, doing behavior change and task change, no change without a matching task case. So that's basically it. Thanks to our partner, Suza, who spawns part of this work, so this is why it was possible that I bought on this, and that mostly concludes my presentation. Thanks. Are there any questions? Yes, in the front row, Vagina? Yes, at the moment, we read this, and if you write back to PPT, then we actually remember the markup, so it's not lost, but editing at the moment is not possible. Although as you saw from the architecture, the mapping from the smartart to actual shapes is a separate block, so in the future, if you have lots of time and motivation, it would be possible to move this from the PPTX import to actually impress core, and then in the long run, this would also allow editing, but there are loads of problems to be solved first. But it's, we are heading in that direction, yes. And another question in the back. The current state of the export is that if you just import your smartart and you save back to PPTX, then all this smartup markup is remembered, but you can't edit your shape and still preserve your smartart declarative description at the same time. I don't have numbers on that, and it's also an interesting question how you measure that. What I know is that I'm still aware of some problems which are interesting for SZA, and we focus on our customers because that's how we get our paycheck, so I still plan to continue working on this, and let's see what will be the next time. Okay, thanks for listening again.